diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index e78346e..2ad32c0 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -4,10 +4,29 @@ "lockfileVersion": 2, "requires": true, "packages": { + "node_modules/@discordjs/builders": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.5.0.tgz", + "integrity": "sha512-HP5y4Rqw68o61Qv4qM5tVmDbWi4mdTFftqIOGRo33SNPpLJ1Ga3KEIR2ibKofkmsoQhEpLmopD1AZDs3cKpHuw==", + "dependencies": { + "@sindresorhus/is": "^4.0.1", + "discord-api-types": "^0.22.0", + "ow": "^0.27.0", + "ts-mixer": "^6.0.0", + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=14.0.0", + "npm": ">=7.0.0" + } + }, "node_modules/@discordjs/collection": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz", - "integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ==" + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz", + "integrity": "sha512-vhxqzzM8gkomw0TYRF3tgx7SwElzUlXT/Aa41O7mOcyN6wIJfj5JmDWaO5XGKsGSsNx7F3i5oIlrucCCWV1Nog==", + "engines": { + "node": ">=14.0.0" + } }, "node_modules/@discordjs/form-data": { "version": "3.0.1", @@ -22,13 +41,24 @@ "node": ">= 6" } }, + "node_modules/@sapphire/async-queue": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.4.tgz", + "integrity": "sha512-fFrlF/uWpGOX5djw5Mu2Hnnrunao75WGey0sP0J3jnhmrJ5TAPzHYOmytD5iN/+pMxS+f+u/gezqHa9tPhRHEA==", + "engines": { + "node": ">=14", + "npm": ">=6" + } + }, "node_modules/@sindresorhus/is": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", - "dev": true, + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz", + "integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==", "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" } }, "node_modules/@szmarczak/http-timer": { @@ -44,26 +74,23 @@ } }, "node_modules/@types/node": { - "version": "16.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.5.tgz", - "integrity": "sha512-E7SpxDXoHEpmZ9C1gSqwadhE6zPRtf3g0gJy9Y51DsImnR5TcDs3QEiV/3Q7zOM8LWaZp5Gph71NK6ElVMG1IQ==" + "version": "16.9.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.9.1.tgz", + "integrity": "sha512-QpLcX9ZSsq3YYUUnD3nFDY8H7wctAhQj/TFKL8Ya8v5fMm3CFXxo8zStsLAl780ltoYoo1WvKUVGBQK+1ifr7g==" + }, + "node_modules/@types/ws": { + "version": "7.4.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", + "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "dependencies": { + "@types/node": "*" + } }, "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==" }, - "node_modules/abort-controller": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "engines": { - "node": ">=6.5" - } - }, "node_modules/ansi-align": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", @@ -164,9 +191,9 @@ "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" }, "node_modules/are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", + "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", "dependencies": { "delegates": "^1.0.0", "readable-stream": "^2.0.6" @@ -214,9 +241,9 @@ } }, "node_modules/boxen/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" @@ -263,6 +290,15 @@ "node": ">=8" } }, + "node_modules/boxen/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -326,6 +362,14 @@ "node": ">=8" } }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "engines": { + "node": ">=6" + } + }, "node_modules/camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", @@ -481,15 +525,27 @@ "node": ">=8" } }, + "node_modules/configstore/node_modules/dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" }, "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" }, "node_modules/crypto-random-string": { "version": "2.0.0", @@ -558,35 +614,45 @@ "node": ">=0.10" } }, + "node_modules/discord-api-types": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz", + "integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==", + "engines": { + "node": ">=12" + } + }, "node_modules/discord.js": { - "version": "12.5.3", - "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.3.tgz", - "integrity": "sha512-D3nkOa/pCkNyn6jLZnAiJApw2N9XrIsXUAdThf01i7yrEuqUmDGc7/CexVWwEcgbQR97XQ+mcnqJpmJ/92B4Aw==", - "deprecated": "no longer supported", + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.1.0.tgz", + "integrity": "sha512-gxO4CXKdHpqA+WKG+f5RNnd3srTDj5uFJHgOathksDE90YNq/Qijkd2WlMgTTMS6AJoEnHxI7G9eDQHCuZ+xDA==", "dependencies": { - "@discordjs/collection": "^0.1.6", + "@discordjs/builders": "^0.5.0", + "@discordjs/collection": "^0.2.1", "@discordjs/form-data": "^3.0.1", - "abort-controller": "^3.0.0", + "@sapphire/async-queue": "^1.1.4", + "@types/ws": "^7.4.7", + "discord-api-types": "^0.22.0", "node-fetch": "^2.6.1", - "prism-media": "^1.2.9", - "setimmediate": "^1.0.5", - "tweetnacl": "^1.0.3", - "ws": "^7.4.4" + "ws": "^7.5.1" }, "engines": { - "node": ">=12.0.0" + "node": ">=16.6.0", + "npm": ">=7.0.0" } }, "node_modules/dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "dev": true, + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", + "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", "dependencies": { "is-obj": "^2.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/dotenv": { @@ -632,14 +698,6 @@ "node": ">=8" } }, - "node_modules/event-target-shim": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", - "engines": { - "node": ">=6" - } - }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -766,6 +824,15 @@ "node": ">=8.6" } }, + "node_modules/got/node_modules/@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/graceful-fs": { "version": "4.2.8", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", @@ -965,7 +1032,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "dev": true, "engines": { "node": ">=8" } @@ -1028,6 +1094,11 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" + }, "node_modules/lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -1179,9 +1250,9 @@ "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==" }, "node_modules/needle": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.0.tgz", - "integrity": "sha512-UBLC4P8w9to3rAhWOQYXIXzTUio9yVnDzIeKxfGbF+Hngy+2bXTqqFK+6nF42EAQKfJdezXK6vzMsefUa1Y3ag==", + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.9.1.tgz", + "integrity": "sha512-6R9fqJ5Zcmf+uYaFgdIHmLwNldn5HbK8L5ybn7Uz+ylX/rnOsSp1AHcvQSrCaFN+qNM1wpymHqD7mVasEOlHGQ==", "dependencies": { "debug": "^3.2.6", "iconv-lite": "^0.4.4", @@ -1195,9 +1266,9 @@ } }, "node_modules/node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz", + "integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==", "engines": { "node": "4.x || >=6.0.0" } @@ -1365,6 +1436,25 @@ "os-tmpdir": "^1.0.0" } }, + "node_modules/ow": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz", + "integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==", + "dependencies": { + "@sindresorhus/is": "^4.0.1", + "callsites": "^3.1.0", + "dot-prop": "^6.0.1", + "lodash.isequal": "^4.5.0", + "type-fest": "^1.2.1", + "vali-date": "^1.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -1427,31 +1517,6 @@ "node": ">=4" } }, - "node_modules/prism-media": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.2.tgz", - "integrity": "sha512-L6UsGHcT6i4wrQhFF1aPK+MNYgjRqR2tUoIqEY+CG1NqVkMjPRKzS37j9f8GiYPlD6wG9ruBj+q5Ax+bH8Ik1g==", - "peerDependencies": { - "@discordjs/opus": "^0.5.0", - "ffmpeg-static": "^4.2.7 || ^3.0.0 || ^2.4.0", - "node-opus": "^0.3.3", - "opusscript": "^0.0.8" - }, - "peerDependenciesMeta": { - "@discordjs/opus": { - "optional": true - }, - "ffmpeg-static": { - "optional": true - }, - "node-opus": { - "optional": true - }, - "opusscript": { - "optional": true - } - } - }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -1712,11 +1777,6 @@ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" - }, "node_modules/signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", @@ -1885,18 +1945,25 @@ "node": "*" } }, - "node_modules/tweetnacl": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", - "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" + "node_modules/ts-mixer": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz", + "integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ==" + }, + "node_modules/tslib": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" }, "node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true, + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", + "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/typedarray-to-buffer": { @@ -1996,6 +2063,14 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/vali-date": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", + "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/validator": { "version": "13.6.0", "resolved": "https://registry.npmjs.org/validator/-/validator-13.6.0.tgz", @@ -2025,9 +2100,9 @@ } }, "node_modules/widest-line/node_modules/ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { "node": ">=8" @@ -2100,9 +2175,9 @@ } }, "node_modules/ws": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.4.tgz", - "integrity": "sha512-zP9z6GXm6zC27YtspwH99T3qTG7bBFv2VIkeHstMLrLlDJuzA7tQ5ls3OJ1hOGGCzTQPniNJoHXIAOS0Jljohg==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.5.tgz", + "integrity": "sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w==", "engines": { "node": ">=8.3.0" }, diff --git a/node_modules/prism-media/LICENSE b/node_modules/@discordjs/builders/LICENSE similarity index 99% rename from node_modules/prism-media/LICENSE rename to node_modules/@discordjs/builders/LICENSE index 369db8d..9300648 100644 --- a/node_modules/prism-media/LICENSE +++ b/node_modules/@discordjs/builders/LICENSE @@ -175,7 +175,7 @@ END OF TERMS AND CONDITIONS - Copyright 2019 - 2020 Amish Shah + Copyright 2021 Vlad Frangu Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/node_modules/@discordjs/builders/README.md b/node_modules/@discordjs/builders/README.md new file mode 100644 index 0000000..7838460 --- /dev/null +++ b/node_modules/@discordjs/builders/README.md @@ -0,0 +1,33 @@ +
+
+

+ discord.js +

+
+

+ Discord server + Test status + Lint status + Code coverage +

+
+ +## Installation + +Install with [npm](https://www.npmjs.com/) / [yarn](https://yarnpkg.com) / [pnpm](https://pnpm.js.org/): + +```sh +npm install @discordjs/builders +yarn add @discordjs/builders +pnpm add @discordjs/builders +``` + +## Contribution + +See [Contributing Guide](https://github.com/discordjs/builders/blob/main/.github/CONTRIBUTING.md). + +## Examples + +Here are some examples for the builders and utilities you can find in this package: + +- [Slash Command Builders](./docs/examples/Slash%20Command%20Builders.md) diff --git a/node_modules/@discordjs/builders/dist/index.d.ts b/node_modules/@discordjs/builders/dist/index.d.ts new file mode 100644 index 0000000..3530b2c --- /dev/null +++ b/node_modules/@discordjs/builders/dist/index.d.ts @@ -0,0 +1,12 @@ +export * from './messages/formatters'; +export * as SlashCommandAssertions from './interactions/slashCommands/Assertions'; +export * from './interactions/slashCommands/SlashCommandBuilder'; +export * from './interactions/slashCommands/SlashCommandSubcommands'; +export * from './interactions/slashCommands/options/boolean'; +export * from './interactions/slashCommands/options/channel'; +export * from './interactions/slashCommands/options/integer'; +export * from './interactions/slashCommands/options/mentionable'; +export * from './interactions/slashCommands/options/role'; +export * from './interactions/slashCommands/options/string'; +export * from './interactions/slashCommands/options/user'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/index.d.ts.map b/node_modules/@discordjs/builders/dist/index.d.ts.map new file mode 100644 index 0000000..865451b --- /dev/null +++ b/node_modules/@discordjs/builders/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AAEtC,OAAO,KAAK,sBAAsB,MAAM,yCAAyC,CAAC;AAClF,cAAc,kDAAkD,CAAC;AACjE,cAAc,sDAAsD,CAAC;AACrE,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,kDAAkD,CAAC;AACjE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/index.js b/node_modules/@discordjs/builders/dist/index.js new file mode 100644 index 0000000..fe11988 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/index.js @@ -0,0 +1,16 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SlashCommandAssertions = void 0; +const tslib_1 = require("tslib"); +tslib_1.__exportStar(require("./messages/formatters"), exports); +exports.SlashCommandAssertions = tslib_1.__importStar(require("./interactions/slashCommands/Assertions")); +tslib_1.__exportStar(require("./interactions/slashCommands/SlashCommandBuilder"), exports); +tslib_1.__exportStar(require("./interactions/slashCommands/SlashCommandSubcommands"), exports); +tslib_1.__exportStar(require("./interactions/slashCommands/options/boolean"), exports); +tslib_1.__exportStar(require("./interactions/slashCommands/options/channel"), exports); +tslib_1.__exportStar(require("./interactions/slashCommands/options/integer"), exports); +tslib_1.__exportStar(require("./interactions/slashCommands/options/mentionable"), exports); +tslib_1.__exportStar(require("./interactions/slashCommands/options/role"), exports); +tslib_1.__exportStar(require("./interactions/slashCommands/options/string"), exports); +tslib_1.__exportStar(require("./interactions/slashCommands/options/user"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/index.js.map b/node_modules/@discordjs/builders/dist/index.js.map new file mode 100644 index 0000000..efbee90 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;AAAA,gEAAsC;AAEtC,0GAAkF;AAClF,2FAAiE;AACjE,+FAAqE;AACrE,uFAA6D;AAC7D,uFAA6D;AAC7D,uFAA6D;AAC7D,2FAAiE;AACjE,oFAA0D;AAC1D,sFAA4D;AAC5D,oFAA0D","sourcesContent":["export * from './messages/formatters';\n\nexport * as SlashCommandAssertions from './interactions/slashCommands/Assertions';\nexport * from './interactions/slashCommands/SlashCommandBuilder';\nexport * from './interactions/slashCommands/SlashCommandSubcommands';\nexport * from './interactions/slashCommands/options/boolean';\nexport * from './interactions/slashCommands/options/channel';\nexport * from './interactions/slashCommands/options/integer';\nexport * from './interactions/slashCommands/options/mentionable';\nexport * from './interactions/slashCommands/options/role';\nexport * from './interactions/slashCommands/options/string';\nexport * from './interactions/slashCommands/options/user';\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/index.mjs b/node_modules/@discordjs/builders/dist/index.mjs new file mode 100644 index 0000000..71b2694 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/index.mjs @@ -0,0 +1,33 @@ +import mod from "./index.js"; + +export default mod; +export const Faces = mod.Faces; +export const SlashCommandAssertions = mod.SlashCommandAssertions; +export const SlashCommandBooleanOption = mod.SlashCommandBooleanOption; +export const SlashCommandBuilder = mod.SlashCommandBuilder; +export const SlashCommandChannelOption = mod.SlashCommandChannelOption; +export const SlashCommandIntegerOption = mod.SlashCommandIntegerOption; +export const SlashCommandMentionableOption = mod.SlashCommandMentionableOption; +export const SlashCommandRoleOption = mod.SlashCommandRoleOption; +export const SlashCommandStringOption = mod.SlashCommandStringOption; +export const SlashCommandSubcommandBuilder = mod.SlashCommandSubcommandBuilder; +export const SlashCommandSubcommandGroupBuilder = mod.SlashCommandSubcommandGroupBuilder; +export const SlashCommandUserOption = mod.SlashCommandUserOption; +export const TimestampStyles = mod.TimestampStyles; +export const blockQuote = mod.blockQuote; +export const bold = mod.bold; +export const channelMention = mod.channelMention; +export const codeBlock = mod.codeBlock; +export const formatEmoji = mod.formatEmoji; +export const hideLinkEmbed = mod.hideLinkEmbed; +export const hyperlink = mod.hyperlink; +export const inlineCode = mod.inlineCode; +export const italic = mod.italic; +export const memberNicknameMention = mod.memberNicknameMention; +export const quote = mod.quote; +export const roleMention = mod.roleMention; +export const spoiler = mod.spoiler; +export const strikethrough = mod.strikethrough; +export const time = mod.time; +export const underscore = mod.underscore; +export const userMention = mod.userMention; diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.d.ts new file mode 100644 index 0000000..a4ca912 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.d.ts @@ -0,0 +1,11 @@ +import type { APIApplicationCommandOptionChoice } from 'discord-api-types/v9'; +import type { SlashCommandOptionBase } from './mixins/CommandOptionBase'; +import type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder'; +import type { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands'; +export declare function validateRequiredParameters(name: string, description: string, options: ToAPIApplicationCommandOptions[]): void; +export declare function validateName(name: unknown): asserts name is string; +export declare function validateDescription(description: unknown): asserts description is string; +export declare function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[]; +export declare function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]): void; +export declare function assertReturnOfBuilder(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T; +//# sourceMappingURL=Assertions.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.d.ts.map new file mode 100644 index 0000000..f27fa12 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Assertions.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/Assertions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC;AAE9E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAC5E,OAAO,KAAK,EAAE,6BAA6B,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAEnH,wBAAgB,0BAA0B,CACzC,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,8BAA8B,EAAE,QAUzC;AAUD,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,IAAI,MAAM,CAElE;AAID,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,IAAI,MAAM,CAEvF;AAID,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,8BAA8B,EAAE,CAE9G;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,iCAAiC,EAAE,QAEpF;AAED,wBAAgB,qBAAqB,CACpC,CAAC,SAAS,sBAAsB,GAAG,6BAA6B,GAAG,kCAAkC,EACpG,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,KAAK,IAAI,CAAC,CAuBrE"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.js new file mode 100644 index 0000000..887f849 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.js @@ -0,0 +1,58 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assertReturnOfBuilder = exports.validateMaxChoicesLength = exports.validateMaxOptionsLength = exports.validateDescription = exports.validateName = exports.validateRequiredParameters = void 0; +const tslib_1 = require("tslib"); +const is_1 = tslib_1.__importDefault(require("@sindresorhus/is")); +const ow_1 = tslib_1.__importDefault(require("ow")); +function validateRequiredParameters(name, description, options) { + // Assert name matches all conditions + validateName(name); + // Assert description conditions + validateDescription(description); + // Assert options conditions + validateMaxOptionsLength(options); +} +exports.validateRequiredParameters = validateRequiredParameters; +const namePredicate = ow_1.default.string.lowercase + .minLength(1) + .maxLength(32) + .addValidator({ + message: (value, label) => `Expected ${label} to match "^[\\p{L}\\p{N}_-]+$", got ${value} instead`, + validator: (value) => /^[\p{L}\p{N}_-]+$/u.test(value), +}); +function validateName(name) { + ow_1.default(name, 'name', namePredicate); +} +exports.validateName = validateName; +const descriptionPredicate = ow_1.default.string.minLength(1).maxLength(100); +function validateDescription(description) { + ow_1.default(description, 'description', descriptionPredicate); +} +exports.validateDescription = validateDescription; +const maxArrayLengthPredicate = ow_1.default.array.maxLength(25); +function validateMaxOptionsLength(options) { + ow_1.default(options, 'options', maxArrayLengthPredicate); +} +exports.validateMaxOptionsLength = validateMaxOptionsLength; +function validateMaxChoicesLength(choices) { + ow_1.default(choices, 'choices', maxArrayLengthPredicate); +} +exports.validateMaxChoicesLength = validateMaxChoicesLength; +function assertReturnOfBuilder(input, ExpectedInstanceOf) { + const instanceName = ExpectedInstanceOf.name; + if (is_1.default.nullOrUndefined(input)) { + throw new TypeError(`Expected to receive a ${instanceName} builder, got ${input === null ? 'null' : 'undefined'} instead.`); + } + if (is_1.default.primitive(input)) { + throw new TypeError(`Expected to receive a ${instanceName} builder, got a primitive (${typeof input}) instead.`); + } + if (!(input instanceof ExpectedInstanceOf)) { + const casted = input; + const constructorName = is_1.default.function_(input) ? input.name : casted.constructor.name; + const stringTag = Reflect.get(casted, Symbol.toStringTag); + const fullResultName = stringTag ? `${constructorName} [${stringTag}]` : constructorName; + throw new TypeError(`Expected to receive a ${instanceName} builder, got ${fullResultName} instead.`); + } +} +exports.assertReturnOfBuilder = assertReturnOfBuilder; +//# sourceMappingURL=Assertions.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.js.map new file mode 100644 index 0000000..fe1441f --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/Assertions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Assertions.js","sourceRoot":"/","sources":["interactions/slashCommands/Assertions.ts"],"names":[],"mappings":";;;;AAAA,kEAAkC;AAElC,oDAAoB;AAKpB,SAAgB,0BAA0B,CACzC,IAAY,EACZ,WAAmB,EACnB,OAAyC;IAEzC,qCAAqC;IACrC,YAAY,CAAC,IAAI,CAAC,CAAC;IAEnB,gCAAgC;IAChC,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAEjC,4BAA4B;IAC5B,wBAAwB,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAbD,gEAaC;AAED,MAAM,aAAa,GAAG,YAAE,CAAC,MAAM,CAAC,SAAS;KACvC,SAAS,CAAC,CAAC,CAAC;KACZ,SAAS,CAAC,EAAE,CAAC;KACb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AE;QACxB,MAAM,IAAI,SAAS,CAAC,yBAAyB,YAAY,8BAA8B,OAAO,KAAK,YAAY,CAAC,CAAC;KACjH;IAED,IAAI,CAAC,CAAC,KAAK,YAAY,kBAAkB,CAAC,EAAE;QAC3C,MAAM,MAAM,GAAG,KAAqC,CAAC;QAErD,MAAM,eAAe,GAAG,YAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;QACnF,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,CAAuB,CAAC;QAEhF,MAAM,cAAc,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,eAAe,KAAK,SAAS,GAAG,CAAC,CAAC,CAAC,eAAe,CAAC;QAEzF,MAAM,IAAI,SAAS,CAAC,yBAAyB,YAAY,iBAAiB,cAAc,WAAW,CAAC,CAAC;KACrG;AACF,CAAC;AAzBD,sDAyBC","sourcesContent":["import is from '@sindresorhus/is';\nimport type { APIApplicationCommandOptionChoice } from 'discord-api-types/v9';\nimport ow from 'ow';\nimport type { SlashCommandOptionBase } from './mixins/CommandOptionBase';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\nimport type { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\nexport function validateRequiredParameters(\n\tname: string,\n\tdescription: string,\n\toptions: ToAPIApplicationCommandOptions[],\n) {\n\t// Assert name matches all conditions\n\tvalidateName(name);\n\n\t// Assert description conditions\n\tvalidateDescription(description);\n\n\t// Assert options conditions\n\tvalidateMaxOptionsLength(options);\n}\n\nconst namePredicate = ow.string.lowercase\n\t.minLength(1)\n\t.maxLength(32)\n\t.addValidator({\n\t\tmessage: (value, label) => `Expected ${label!} to match \"^[\\\\p{L}\\\\p{N}_-]+$\", got ${value} instead`,\n\t\tvalidator: (value) => /^[\\p{L}\\p{N}_-]+$/u.test(value),\n\t});\n\nexport function validateName(name: unknown): asserts name is string {\n\tow(name, 'name', namePredicate);\n}\n\nconst descriptionPredicate = ow.string.minLength(1).maxLength(100);\n\nexport function validateDescription(description: unknown): asserts description is string {\n\tow(description, 'description', descriptionPredicate);\n}\n\nconst maxArrayLengthPredicate = ow.array.maxLength(25);\n\nexport function validateMaxOptionsLength(options: unknown): asserts options is ToAPIApplicationCommandOptions[] {\n\tow(options, 'options', maxArrayLengthPredicate);\n}\n\nexport function validateMaxChoicesLength(choices: APIApplicationCommandOptionChoice[]) {\n\tow(choices, 'choices', maxArrayLengthPredicate);\n}\n\nexport function assertReturnOfBuilder<\n\tT extends SlashCommandOptionBase | SlashCommandSubcommandBuilder | SlashCommandSubcommandGroupBuilder,\n>(input: unknown, ExpectedInstanceOf: new () => T): asserts input is T {\n\tconst instanceName = ExpectedInstanceOf.name;\n\n\tif (is.nullOrUndefined(input)) {\n\t\tthrow new TypeError(\n\t\t\t`Expected to receive a ${instanceName} builder, got ${input === null ? 'null' : 'undefined'} instead.`,\n\t\t);\n\t}\n\n\tif (is.primitive(input)) {\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got a primitive (${typeof input}) instead.`);\n\t}\n\n\tif (!(input instanceof ExpectedInstanceOf)) {\n\t\tconst casted = input as Record;\n\n\t\tconst constructorName = is.function_(input) ? input.name : casted.constructor.name;\n\t\tconst stringTag = Reflect.get(casted, Symbol.toStringTag) as string | undefined;\n\n\t\tconst fullResultName = stringTag ? `${constructorName} [${stringTag}]` : constructorName;\n\n\t\tthrow new TypeError(`Expected to receive a ${instanceName} builder, got ${fullResultName} instead.`);\n\t}\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandBuilder.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandBuilder.d.ts new file mode 100644 index 0000000..5b0ee56 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandBuilder.d.ts @@ -0,0 +1,50 @@ +import type { APIApplicationCommandOption } from 'discord-api-types/v9'; +import { SharedNameAndDescription } from './mixins/NameAndDescription'; +import { SharedSlashCommandOptions } from './mixins/CommandOptions'; +import { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands'; +export declare class SlashCommandBuilder { + /** + * The name of this slash command + */ + readonly name: string; + /** + * The description of this slash command + */ + readonly description: string; + /** + * The options of this slash command + */ + readonly options: ToAPIApplicationCommandOptions[]; + /** + * Returns the final data that should be sent to Discord. + * + * **Note:** Calling this function will validate required properties based on their conditions. + */ + toJSON(): { + name: string; + description: string; + options: APIApplicationCommandOption[]; + }; + /** + * Adds a new subcommand group to this command + * @param input A function that returns a subcommand group builder, or an already built builder + */ + addSubcommandGroup(input: SlashCommandSubcommandGroupBuilder | ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder)): SlashCommandSubcommandGroupsOnlyBuilder; + /** + * Adds a new subcommand to this command + * @param input A function that returns a subcommand builder, or an already built builder + */ + addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): SlashCommandSubcommandsOnlyBuilder; +} +export interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions { +} +export interface SlashCommandSubcommandsOnlyBuilder extends SharedNameAndDescription, Pick { +} +export interface SlashCommandSubcommandGroupsOnlyBuilder extends SharedNameAndDescription, Pick { +} +export interface SlashCommandOptionsOnlyBuilder extends SharedNameAndDescription, SharedSlashCommandOptions, Pick { +} +export interface ToAPIApplicationCommandOptions { + toJSON(): APIApplicationCommandOption; +} +//# sourceMappingURL=SlashCommandBuilder.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandBuilder.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandBuilder.d.ts.map new file mode 100644 index 0000000..7337097 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandBuilder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SlashCommandBuilder.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/SlashCommandBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAGxE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,6BAA6B,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAE9G,qBACa,mBAAmB;IAC/B;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAc;IAE1C;;OAEG;IACH,SAAgB,WAAW,EAAE,MAAM,CAAc;IAEjD;;OAEG;IACH,SAAgB,OAAO,EAAE,8BAA8B,EAAE,CAAM;IAE/D;;;;OAIG;IACI,MAAM;;;;;IASb;;;OAGG;IACI,kBAAkB,CACxB,KAAK,EACF,kCAAkC,GAClC,CAAC,CAAC,eAAe,EAAE,kCAAkC,KAAK,kCAAkC,CAAC,GAC9F,uCAAuC;IAqB1C;;;OAGG;IACI,aAAa,CACnB,KAAK,EACF,6BAA6B,GAC7B,CAAC,CAAC,eAAe,EAAE,6BAA6B,KAAK,6BAA6B,CAAC,GACpF,kCAAkC;CAqBrC;AAED,MAAM,WAAW,mBAAoB,SAAQ,wBAAwB,EAAE,yBAAyB;CAAG;AAEnG,MAAM,WAAW,kCAChB,SAAQ,wBAAwB,EAC/B,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,eAAe,CAAC;CAAG;AAE1D,MAAM,WAAW,uCAChB,SAAQ,wBAAwB,EAC/B,IAAI,CAAC,mBAAmB,EAAE,QAAQ,GAAG,oBAAoB,CAAC;CAAG;AAE/D,MAAM,WAAW,8BAChB,SAAQ,wBAAwB,EAC/B,yBAAyB,EACzB,IAAI,CAAC,mBAAmB,EAAE,QAAQ,CAAC;CAAG;AAExC,MAAM,WAAW,8BAA8B;IAC9C,MAAM,IAAI,2BAA2B,CAAC;CACtC"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandBuilder.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandBuilder.js new file mode 100644 index 0000000..ddaad91 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandBuilder.js @@ -0,0 +1,96 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SlashCommandBuilder = void 0; +const tslib_1 = require("tslib"); +const ts_mixer_1 = require("ts-mixer"); +const Assertions_1 = require("./Assertions"); +const NameAndDescription_1 = require("./mixins/NameAndDescription"); +const CommandOptions_1 = require("./mixins/CommandOptions"); +const SlashCommandSubcommands_1 = require("./SlashCommandSubcommands"); +let SlashCommandBuilder = class SlashCommandBuilder { + constructor() { + /** + * The name of this slash command + */ + Object.defineProperty(this, "name", { + enumerable: true, + configurable: true, + writable: true, + value: undefined + }); + /** + * The description of this slash command + */ + Object.defineProperty(this, "description", { + enumerable: true, + configurable: true, + writable: true, + value: undefined + }); + /** + * The options of this slash command + */ + Object.defineProperty(this, "options", { + enumerable: true, + configurable: true, + writable: true, + value: [] + }); + } + /** + * Returns the final data that should be sent to Discord. + * + * **Note:** Calling this function will validate required properties based on their conditions. + */ + toJSON() { + Assertions_1.validateRequiredParameters(this.name, this.description, this.options); + return { + name: this.name, + description: this.description, + options: this.options.map((option) => option.toJSON()), + }; + } + /** + * Adds a new subcommand group to this command + * @param input A function that returns a subcommand group builder, or an already built builder + */ + addSubcommandGroup(input) { + const { options } = this; + // First, assert options conditions - we cannot have more than 25 options + Assertions_1.validateMaxOptionsLength(options); + // Make sure there is no subcommand at the root level - if there is, throw + const hasSubcommands = options.some((item) => item instanceof SlashCommandSubcommands_1.SlashCommandSubcommandBuilder); + if (hasSubcommands) + throw new RangeError(`You cannot mix subcommands and subcommand groups at the root level.`); + // Get the final result + const result = typeof input === 'function' ? input(new SlashCommandSubcommands_1.SlashCommandSubcommandGroupBuilder()) : input; + Assertions_1.assertReturnOfBuilder(result, SlashCommandSubcommands_1.SlashCommandSubcommandGroupBuilder); + // Push it + options.push(result); + return this; + } + /** + * Adds a new subcommand to this command + * @param input A function that returns a subcommand builder, or an already built builder + */ + addSubcommand(input) { + const { options } = this; + // First, assert options conditions - we cannot have more than 25 options + Assertions_1.validateMaxOptionsLength(options); + // Make sure there is no subcommand at the root level - if there is, throw + const hasSubcommandGroups = options.some((item) => item instanceof SlashCommandSubcommands_1.SlashCommandSubcommandGroupBuilder); + if (hasSubcommandGroups) + throw new RangeError(`You cannot mix subcommands and subcommand groups at the root level.`); + // Get the final result + const result = typeof input === 'function' ? input(new SlashCommandSubcommands_1.SlashCommandSubcommandBuilder()) : input; + Assertions_1.assertReturnOfBuilder(result, SlashCommandSubcommands_1.SlashCommandSubcommandBuilder); + // Push it + options.push(result); + return this; + } +}; +SlashCommandBuilder = tslib_1.__decorate([ + ts_mixer_1.mix(CommandOptions_1.SharedSlashCommandOptions, NameAndDescription_1.SharedNameAndDescription) +], SlashCommandBuilder); +exports.SlashCommandBuilder = SlashCommandBuilder; +//# sourceMappingURL=SlashCommandBuilder.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandBuilder.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandBuilder.js.map new file mode 100644 index 0000000..5c271ff --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandBuilder.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SlashCommandBuilder.js","sourceRoot":"/","sources":["interactions/slashCommands/SlashCommandBuilder.ts"],"names":[],"mappings":";;;;AACA,uCAA+B;AAC/B,6CAA2G;AAC3G,oEAAuE;AACvE,4DAAoE;AACpE,uEAA8G;AAG9G,IAAa,mBAAmB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AI,CAAC;QAEzB,yEAAyE;QACzE,qCAAwB,CAAC,OAAO,CAAC,CAAC;QAElC,0EAA0E;QAC1E,MAAM,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,YAAY,4DAAkC,CAAC,CAAC;QACvG,IAAI,mBAAmB;YACtB,MAAM,IAAI,UAAU,CAAC,qEAAqE,CAAC,CAAC;QAE7F,uBAAuB;QACvB,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,uDAA6B,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAEhG,kCAAqB,CAAC,MAAM,EAAE,uDAA6B,CAAC,CAAC;QAE7D,UAAU;QACV,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAErB,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAA;AAxFY,mBAAmB;IAD/B,cAAG,CAAC,0CAAyB,EAAE,6CAAwB,CAAC;GAC5C,mBAAmB,CAwF/B;AAxFY,kDAAmB","sourcesContent":["import type { APIApplicationCommandOption } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { assertReturnOfBuilder, validateMaxOptionsLength, validateRequiredParameters } from './Assertions';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport { SharedSlashCommandOptions } from './mixins/CommandOptions';\nimport { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';\n\n@mix(SharedSlashCommandOptions, SharedNameAndDescription)\nexport class SlashCommandBuilder {\n\t/**\n\t * The name of this slash command\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this slash command\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this slash command\n\t */\n\tpublic readonly options: ToAPIApplicationCommandOptions[] = [];\n\n\t/**\n\t * Returns the final data that should be sent to Discord.\n\t *\n\t * **Note:** Calling this function will validate required properties based on their conditions.\n\t */\n\tpublic toJSON() {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n\n\t/**\n\t * Adds a new subcommand group to this command\n\t * @param input A function that returns a subcommand group builder, or an already built builder\n\t */\n\tpublic addSubcommandGroup(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandGroupBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandGroupBuilder) => SlashCommandSubcommandGroupBuilder),\n\t): SlashCommandSubcommandGroupsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Make sure there is no subcommand at the root level - if there is, throw\n\t\tconst hasSubcommands = options.some((item) => item instanceof SlashCommandSubcommandBuilder);\n\t\tif (hasSubcommands) throw new RangeError(`You cannot mix subcommands and subcommand groups at the root level.`);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandGroupBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandGroupBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new subcommand to this command\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t): SlashCommandSubcommandsOnlyBuilder {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Make sure there is no subcommand at the root level - if there is, throw\n\t\tconst hasSubcommandGroups = options.some((item) => item instanceof SlashCommandSubcommandGroupBuilder);\n\t\tif (hasSubcommandGroups)\n\t\t\tthrow new RangeError(`You cannot mix subcommands and subcommand groups at the root level.`);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n}\n\nexport interface SlashCommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {}\n\nexport interface SlashCommandSubcommandsOnlyBuilder\n\textends SharedNameAndDescription,\n\t\tPick {}\n\nexport interface SlashCommandSubcommandGroupsOnlyBuilder\n\textends SharedNameAndDescription,\n\t\tPick {}\n\nexport interface SlashCommandOptionsOnlyBuilder\n\textends SharedNameAndDescription,\n\t\tSharedSlashCommandOptions,\n\t\tPick {}\n\nexport interface ToAPIApplicationCommandOptions {\n\ttoJSON(): APIApplicationCommandOption;\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts new file mode 100644 index 0000000..dff28bb --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts @@ -0,0 +1,64 @@ +import { ApplicationCommandOptionType } from 'discord-api-types/v9'; +import { SharedSlashCommandOptions } from './mixins/CommandOptions'; +import { SharedNameAndDescription } from './mixins/NameAndDescription'; +import type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder'; +/** + * Represents a folder for subcommands + * + * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups + */ +export declare class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions { + /** + * The name of this subcommand group + */ + readonly name: string; + /** + * The description of this subcommand group + */ + readonly description: string; + /** + * The subcommands part of this subcommand group + */ + readonly options: ToAPIApplicationCommandOptions[]; + /** + * Adds a new subcommand to this group + * @param input A function that returns a subcommand builder, or an already built builder + */ + addSubcommand(input: SlashCommandSubcommandBuilder | ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder)): this; + toJSON(): { + type: ApplicationCommandOptionType; + name: string; + description: string; + options: import("discord-api-types/v9").APIApplicationCommandOption[]; + }; +} +export interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription { +} +/** + * Represents a subcommand + * + * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups + */ +export declare class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions { + /** + * The name of this subcommand + */ + readonly name: string; + /** + * The description of this subcommand + */ + readonly description: string; + /** + * The options of this subcommand + */ + readonly options: ToAPIApplicationCommandOptions[]; + toJSON(): { + type: ApplicationCommandOptionType; + name: string; + description: string; + options: import("discord-api-types/v9").APIApplicationCommandOption[]; + }; +} +export interface SlashCommandSubcommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions { +} +//# sourceMappingURL=SlashCommandSubcommands.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts.map new file mode 100644 index 0000000..bdc2bb9 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandSubcommands.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SlashCommandSubcommands.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/SlashCommandSubcommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAGpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAE5E;;;;GAIG;AACH,qBACa,kCAAmC,YAAW,8BAA8B;IACxF;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAc;IAE1C;;OAEG;IACH,SAAgB,WAAW,EAAE,MAAM,CAAc;IAEjD;;OAEG;IACH,SAAgB,OAAO,EAAE,8BAA8B,EAAE,CAAM;IAE/D;;;OAGG;IACI,aAAa,CACnB,KAAK,EACF,6BAA6B,GAC7B,CAAC,CAAC,eAAe,EAAE,6BAA6B,KAAK,6BAA6B,CAAC;IAkBhF,MAAM;;;;;;CASb;AAED,MAAM,WAAW,kCAAmC,SAAQ,wBAAwB;CAAG;AAEvF;;;;GAIG;AACH,qBACa,6BAA8B,YAAW,8BAA8B;IACnF;;OAEG;IACH,SAAgB,IAAI,EAAE,MAAM,CAAc;IAE1C;;OAEG;IACH,SAAgB,WAAW,EAAE,MAAM,CAAc;IAEjD;;OAEG;IACH,SAAgB,OAAO,EAAE,8BAA8B,EAAE,CAAM;IAExD,MAAM;;;;;;CASb;AAED,MAAM,WAAW,6BAA8B,SAAQ,wBAAwB,EAAE,yBAAyB,CAAC,KAAK,CAAC;CAAG"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandSubcommands.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandSubcommands.js new file mode 100644 index 0000000..0bbb917 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandSubcommands.js @@ -0,0 +1,123 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SlashCommandSubcommandBuilder = exports.SlashCommandSubcommandGroupBuilder = void 0; +const tslib_1 = require("tslib"); +require("discord-api-types/v9"); +const ts_mixer_1 = require("ts-mixer"); +const Assertions_1 = require("./Assertions"); +const CommandOptions_1 = require("./mixins/CommandOptions"); +const NameAndDescription_1 = require("./mixins/NameAndDescription"); +/** + * Represents a folder for subcommands + * + * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups + */ +let SlashCommandSubcommandGroupBuilder = class SlashCommandSubcommandGroupBuilder { + constructor() { + /** + * The name of this subcommand group + */ + Object.defineProperty(this, "name", { + enumerable: true, + configurable: true, + writable: true, + value: undefined + }); + /** + * The description of this subcommand group + */ + Object.defineProperty(this, "description", { + enumerable: true, + configurable: true, + writable: true, + value: undefined + }); + /** + * The subcommands part of this subcommand group + */ + Object.defineProperty(this, "options", { + enumerable: true, + configurable: true, + writable: true, + value: [] + }); + } + /** + * Adds a new subcommand to this group + * @param input A function that returns a subcommand builder, or an already built builder + */ + addSubcommand(input) { + const { options } = this; + // First, assert options conditions - we cannot have more than 25 options + Assertions_1.validateMaxOptionsLength(options); + // Get the final result + const result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input; + Assertions_1.assertReturnOfBuilder(result, SlashCommandSubcommandBuilder); + // Push it + options.push(result); + return this; + } + toJSON() { + Assertions_1.validateRequiredParameters(this.name, this.description, this.options); + return { + type: 2 /* SubcommandGroup */, + name: this.name, + description: this.description, + options: this.options.map((option) => option.toJSON()), + }; + } +}; +SlashCommandSubcommandGroupBuilder = tslib_1.__decorate([ + ts_mixer_1.mix(NameAndDescription_1.SharedNameAndDescription) +], SlashCommandSubcommandGroupBuilder); +exports.SlashCommandSubcommandGroupBuilder = SlashCommandSubcommandGroupBuilder; +/** + * Represents a subcommand + * + * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups + */ +let SlashCommandSubcommandBuilder = class SlashCommandSubcommandBuilder { + constructor() { + /** + * The name of this subcommand + */ + Object.defineProperty(this, "name", { + enumerable: true, + configurable: true, + writable: true, + value: undefined + }); + /** + * The description of this subcommand + */ + Object.defineProperty(this, "description", { + enumerable: true, + configurable: true, + writable: true, + value: undefined + }); + /** + * The options of this subcommand + */ + Object.defineProperty(this, "options", { + enumerable: true, + configurable: true, + writable: true, + value: [] + }); + } + toJSON() { + Assertions_1.validateRequiredParameters(this.name, this.description, this.options); + return { + type: 1 /* Subcommand */, + name: this.name, + description: this.description, + options: this.options.map((option) => option.toJSON()), + }; + } +}; +SlashCommandSubcommandBuilder = tslib_1.__decorate([ + ts_mixer_1.mix(NameAndDescription_1.SharedNameAndDescription, CommandOptions_1.SharedSlashCommandOptions) +], SlashCommandSubcommandBuilder); +exports.SlashCommandSubcommandBuilder = SlashCommandSubcommandBuilder; +//# sourceMappingURL=SlashCommandSubcommands.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandSubcommands.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandSubcommands.js.map new file mode 100644 index 0000000..223a108 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/SlashCommandSubcommands.js.map @@ -0,0 +1 @@ +{"version":3,"file":"SlashCommandSubcommands.js","sourceRoot":"/","sources":["interactions/slashCommands/SlashCommandSubcommands.ts"],"names":[],"mappings":";;;;AAAA,gCAAoE;AACpE,uCAA+B;AAC/B,6CAA2G;AAC3G,4DAAoE;AACpE,oEAAuE;AAGvE;;;;GAIG;AAEH,IAAa,kCAAkC,GAA/C,MAAa,kCAAkC;IAA/C;QACC;;WAEG;QACH;;;;mBAA+B,SAAU;WAAC;QAE1C;;WAEG;QACH;;;;mBAAsC,SAAU;WAAC;QAEjD;;WAEG;QACH;;;;mBAA4D,EAAE;WAAC;IAoChE,CAAC;IAlCA;;;OAGG;IACI,aAAa,CACnB,KAEsF;QAEtF,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAEzB,yEAAyE;QACzE,qCAAwB,CAAC,OAAO,CAAC,CAAC;QAElC,uBAAuB;QACvB,MAAM,MAAM,GAAG,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,6BAA6B,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAEhG,kCAAqB,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;QAE7D,UAAU;QACV,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAErB,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,MAAM;QACZ,uCAA0B,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,OAAO;YACN,IAAI,yBAA8C;YAClD,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;SACtD,CAAC;IACH,CAAC;CACD,CAAA;AAlDY,kCAAkC;IAD9C,cAAG,CAAC,6CAAwB,CAAC;GACjB,kCAAkC,CAkD9C;AAlDY,gFAAkC;AAsD/C;;;;GAIG;AAEH,IAAa,6BAA6B,GAA1C,MAAa,6BAA6B;IAA1C;QACC;;WAEG;QACH;;;;mBAA+B,SAAU;WAAC;QAE1C;;WAEG;QACH;;;;mBAAsC,SAAU;WAAC;QAEjD;;WAEG;QACH;;;;mBAA4D,EAAE;WAAC;IAWhE,CAAC;IATO,MAAM;QACZ,uCAA0B,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,OAAO;YACN,IAAI,oBAAyC;YAC7C,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;SACtD,CAAC;IACH,CAAC;CACD,CAAA;AAzBY,6BAA6B;IADzC,cAAG,CAAC,6CAAwB,EAAE,0CAAyB,CAAC;GAC5C,6BAA6B,CAyBzC;AAzBY,sEAA6B","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { mix } from 'ts-mixer';\nimport { assertReturnOfBuilder, validateMaxOptionsLength, validateRequiredParameters } from './Assertions';\nimport { SharedSlashCommandOptions } from './mixins/CommandOptions';\nimport { SharedNameAndDescription } from './mixins/NameAndDescription';\nimport type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';\n\n/**\n * Represents a folder for subcommands\n *\n * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription)\nexport class SlashCommandSubcommandGroupBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand group\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand group\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The subcommands part of this subcommand group\n\t */\n\tpublic readonly options: ToAPIApplicationCommandOptions[] = [];\n\n\t/**\n\t * Adds a new subcommand to this group\n\t * @param input A function that returns a subcommand builder, or an already built builder\n\t */\n\tpublic addSubcommand(\n\t\tinput:\n\t\t\t| SlashCommandSubcommandBuilder\n\t\t\t| ((subcommandGroup: SlashCommandSubcommandBuilder) => SlashCommandSubcommandBuilder),\n\t) {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new SlashCommandSubcommandBuilder()) : input;\n\n\t\tassertReturnOfBuilder(result, SlashCommandSubcommandBuilder);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON() {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.SubcommandGroup,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandGroupBuilder extends SharedNameAndDescription {}\n\n/**\n * Represents a subcommand\n *\n * For more information, go to https://discord.com/developers/docs/interactions/slash-commands#subcommands-and-subcommand-groups\n */\n@mix(SharedNameAndDescription, SharedSlashCommandOptions)\nexport class SlashCommandSubcommandBuilder implements ToAPIApplicationCommandOptions {\n\t/**\n\t * The name of this subcommand\n\t */\n\tpublic readonly name: string = undefined!;\n\n\t/**\n\t * The description of this subcommand\n\t */\n\tpublic readonly description: string = undefined!;\n\n\t/**\n\t * The options of this subcommand\n\t */\n\tpublic readonly options: ToAPIApplicationCommandOptions[] = [];\n\n\tpublic toJSON() {\n\t\tvalidateRequiredParameters(this.name, this.description, this.options);\n\t\treturn {\n\t\t\ttype: ApplicationCommandOptionType.Subcommand,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\toptions: this.options.map((option) => option.toJSON()),\n\t\t};\n\t}\n}\n\nexport interface SlashCommandSubcommandBuilder extends SharedNameAndDescription, SharedSlashCommandOptions {}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionBase.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionBase.d.ts new file mode 100644 index 0000000..605d794 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionBase.d.ts @@ -0,0 +1,20 @@ +import type { ApplicationCommandOptionType } from 'discord-api-types/v9'; +import type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder'; +import { SharedNameAndDescription } from './NameAndDescription'; +export declare class SlashCommandOptionBase extends SharedNameAndDescription implements ToAPIApplicationCommandOptions { + required: boolean; + readonly type: ApplicationCommandOptionType; + constructor(type: ApplicationCommandOptionType); + /** + * Marks the option as required + * @param required If this option should be required + */ + setRequired(required: boolean): this; + toJSON(): { + type: ApplicationCommandOptionType; + name: string; + description: string; + required: boolean; + }; +} +//# sourceMappingURL=CommandOptionBase.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionBase.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionBase.d.ts.map new file mode 100644 index 0000000..2df4534 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionBase.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CommandOptionBase.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptionBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAGzE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,qBAAa,sBAAuB,SAAQ,wBAAyB,YAAW,8BAA8B;IACtG,QAAQ,UAAS;IACxB,SAAgB,IAAI,EAAE,4BAA4B,CAAC;gBAEhC,IAAI,EAAE,4BAA4B;IAKrD;;;OAGG;IACI,WAAW,CAAC,QAAQ,EAAE,OAAO;IAS7B,MAAM;;;;;;CAab"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionBase.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionBase.js new file mode 100644 index 0000000..0faefa5 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionBase.js @@ -0,0 +1,48 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SlashCommandOptionBase = void 0; +const tslib_1 = require("tslib"); +const ow_1 = tslib_1.__importDefault(require("ow")); +const Assertions_1 = require("../Assertions"); +const NameAndDescription_1 = require("./NameAndDescription"); +class SlashCommandOptionBase extends NameAndDescription_1.SharedNameAndDescription { + constructor(type) { + super(); + Object.defineProperty(this, "required", { + enumerable: true, + configurable: true, + writable: true, + value: false + }); + Object.defineProperty(this, "type", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + this.type = type; + } + /** + * Marks the option as required + * @param required If this option should be required + */ + setRequired(required) { + // Assert that you actually passed a boolean + ow_1.default(required, 'required', ow_1.default.boolean); + this.required = required; + return this; + } + toJSON() { + Assertions_1.validateRequiredParameters(this.name, this.description, []); + // Assert that you actually passed a boolean + ow_1.default(this.required, 'required', ow_1.default.boolean); + return { + type: this.type, + name: this.name, + description: this.description, + required: this.required, + }; + } +} +exports.SlashCommandOptionBase = SlashCommandOptionBase; +//# sourceMappingURL=CommandOptionBase.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionBase.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionBase.js.map new file mode 100644 index 0000000..7c34245 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionBase.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CommandOptionBase.js","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptionBase.ts"],"names":[],"mappings":";;;;AACA,oDAAoB;AACpB,8CAA2D;AAE3D,6DAAgE;AAEhE,MAAa,sBAAuB,SAAQ,6CAAwB;IAInE,YAAmB,IAAkC;QACpD,KAAK,EAAE,CAAC;QAJT;;;;mBAAkB,KAAK;WAAC;QACxB;;;;;WAAmD;QAIlD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;IAED;;;OAGG;IACI,WAAW,CAAC,QAAiB;QACnC,4CAA4C;QAC5C,YAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAE,CAAC,OAAO,CAAC,CAAC;QAErC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,MAAM;QACZ,uCAA0B,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAE5D,4CAA4C;QAC5C,YAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAE,CAAC,OAAO,CAAC,CAAC;QAE1C,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACvB,CAAC;IACH,CAAC;CACD;AAnCD,wDAmCC","sourcesContent":["import type { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport ow from 'ow';\nimport { validateRequiredParameters } from '../Assertions';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\nimport { SharedNameAndDescription } from './NameAndDescription';\n\nexport class SlashCommandOptionBase extends SharedNameAndDescription implements ToAPIApplicationCommandOptions {\n\tpublic required = false;\n\tpublic readonly type: ApplicationCommandOptionType;\n\n\tpublic constructor(type: ApplicationCommandOptionType) {\n\t\tsuper();\n\t\tthis.type = type;\n\t}\n\n\t/**\n\t * Marks the option as required\n\t * @param required If this option should be required\n\t */\n\tpublic setRequired(required: boolean) {\n\t\t// Assert that you actually passed a boolean\n\t\tow(required, 'required', ow.boolean);\n\n\t\tthis.required = required;\n\n\t\treturn this;\n\t}\n\n\tpublic toJSON() {\n\t\tvalidateRequiredParameters(this.name, this.description, []);\n\n\t\t// Assert that you actually passed a boolean\n\t\tow(this.required, 'required', ow.boolean);\n\n\t\treturn {\n\t\t\ttype: this.type,\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\trequired: this.required,\n\t\t};\n\t}\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.d.ts new file mode 100644 index 0000000..bbbab94 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.d.ts @@ -0,0 +1,25 @@ +import { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from 'discord-api-types/v9'; +import type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder'; +import { SlashCommandOptionBase } from './CommandOptionBase'; +export declare abstract class ApplicationCommandOptionWithChoicesBase extends SlashCommandOptionBase implements ToAPIApplicationCommandOptions { + choices?: APIApplicationCommandOptionChoice[]; + /** + * Adds a choice for this option + * @param name The name of the choice + * @param value The value of the choice + */ + addChoice(name: string, value: T): this; + /** + * Adds multiple choices for this option + * @param choices The choices to add + */ + addChoices(choices: [name: string, value: T][]): this; + toJSON(): { + choices: APIApplicationCommandOptionChoice[] | undefined; + type: ApplicationCommandOptionType; + name: string; + description: string; + required: boolean; + }; +} +//# sourceMappingURL=CommandOptionWithChoices.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.d.ts.map new file mode 100644 index 0000000..26102cd --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CommandOptionWithChoices.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptionWithChoices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAGvG,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAU7D,8BAAsB,uCAAuC,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CACtF,SAAQ,sBACR,YAAW,8BAA8B;IAElC,OAAO,CAAC,EAAE,iCAAiC,EAAE,CAAC;IAErD;;;;OAIG;IACI,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAqBvC;;;OAGG;IACI,UAAU,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE;IAWrC,MAAM;;;;;;;CAMtB"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.js new file mode 100644 index 0000000..06b9bb2 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.js @@ -0,0 +1,59 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ApplicationCommandOptionWithChoicesBase = void 0; +const tslib_1 = require("tslib"); +require("discord-api-types/v9"); +const ow_1 = tslib_1.__importDefault(require("ow")); +const Assertions_1 = require("../Assertions"); +const CommandOptionBase_1 = require("./CommandOptionBase"); +const stringPredicate = ow_1.default.string.minLength(1).maxLength(100); +const integerPredicate = ow_1.default.number.finite; +// TODO: See resolution for sindresorhus/ow#217 in relation to this cast +const choicesPredicate = ow_1.default.array.ofType(ow_1.default.array.exactShape([stringPredicate, ow_1.default.any(ow_1.default.string, integerPredicate)])); +class ApplicationCommandOptionWithChoicesBase extends CommandOptionBase_1.SlashCommandOptionBase { + constructor() { + super(...arguments); + Object.defineProperty(this, "choices", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + } + /** + * Adds a choice for this option + * @param name The name of the choice + * @param value The value of the choice + */ + addChoice(name, value) { + this.choices ?? (this.choices = []); + Assertions_1.validateMaxChoicesLength(this.choices); + // Validate name + ow_1.default(name, `${this.type === 3 /* String */ ? 'string' : 'integer'} choice name`, stringPredicate); + // Validate the value + if (this.type === 3 /* String */) + ow_1.default(value, 'string choice value', stringPredicate); + else + ow_1.default(value, 'integer choice value', integerPredicate); + this.choices.push({ name, value }); + return this; + } + /** + * Adds multiple choices for this option + * @param choices The choices to add + */ + addChoices(choices) { + ow_1.default(choices, `${this.type === 3 /* String */ ? 'string' : 'integer'} choices`, choicesPredicate); + for (const [label, value] of choices) + this.addChoice(label, value); + return this; + } + toJSON() { + return { + ...super.toJSON(), + choices: this.choices, + }; + } +} +exports.ApplicationCommandOptionWithChoicesBase = ApplicationCommandOptionWithChoicesBase; +//# sourceMappingURL=CommandOptionWithChoices.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.js.map new file mode 100644 index 0000000..ecfeed3 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptionWithChoices.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CommandOptionWithChoices.js","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptionWithChoices.ts"],"names":[],"mappings":";;;;AAAA,gCAAuG;AACvG,oDAAmC;AACnC,8CAAyD;AAEzD,2DAA6D;AAE7D,MAAM,eAAe,GAAG,YAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAC9D,MAAM,gBAAgB,GAAG,YAAE,CAAC,MAAM,CAAC,MAAM,CAAC;AAE1C,wEAAwE;AACxE,MAAM,gBAAgB,GAAG,YAAE,CAAC,KAAK,CAAC,MAAM,CACvC,YAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,eAAe,EAAE,YAAE,CAAC,GAAG,CAAC,YAAE,CAAC,MAAM,EAAE,gBAAgB,CAA0C,CAAC,CAAC,CACpH,CAAC;AAEF,MAAsB,uCACrB,SAAQ,0CAAsB;IAD/B;;QAIC;;;;;WAAqD;IAiDtD,CAAC;IA/CA;;;;OAIG;IACI,SAAS,CAAC,IAAY,EAAE,KAAQ;QACtC,IAAI,CAAC,OAAO,KAAZ,IAAI,CAAC,OAAO,GAAK,EAAE,EAAC;QAEpB,qCAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAEvC,gBAAgB;QAChB,YAAE,CACD,IAAI,EACJ,GAAG,IAAI,CAAC,IAAI,mBAAwC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,cAAc,EACzF,eAAe,CACf,CAAC;QAEF,qBAAqB;QACrB,IAAI,IAAI,CAAC,IAAI,mBAAwC;YAAE,YAAE,CAAC,KAAK,EAAE,qBAAqB,EAAE,eAAe,CAAC,CAAC;;YACpG,YAAE,CAAC,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,CAAC,CAAC;QAEzD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAEnC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,OAAmC;QACpD,YAAE,CACD,OAAO,EACP,GAAG,IAAI,CAAC,IAAI,mBAAwC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,UAAU,EACrF,gBAAgB,CAChB,CAAC;QAEF,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,OAAO;YAAE,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QACnE,OAAO,IAAI,CAAC;IACb,CAAC;IAEe,MAAM;QACrB,OAAO;YACN,GAAG,KAAK,CAAC,MAAM,EAAE;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;SACrB,CAAC;IACH,CAAC;CACD;AArDD,0FAqDC","sourcesContent":["import { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport ow, { Predicate } from 'ow';\nimport { validateMaxChoicesLength } from '../Assertions';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\nimport { SlashCommandOptionBase } from './CommandOptionBase';\n\nconst stringPredicate = ow.string.minLength(1).maxLength(100);\nconst integerPredicate = ow.number.finite;\n\n// TODO: See resolution for sindresorhus/ow#217 in relation to this cast\nconst choicesPredicate = ow.array.ofType<[string, string | number]>(\n\tow.array.exactShape([stringPredicate, ow.any(ow.string, integerPredicate) as unknown as Predicate]),\n);\n\nexport abstract class ApplicationCommandOptionWithChoicesBase\n\textends SlashCommandOptionBase\n\timplements ToAPIApplicationCommandOptions\n{\n\tpublic choices?: APIApplicationCommandOptionChoice[];\n\n\t/**\n\t * Adds a choice for this option\n\t * @param name The name of the choice\n\t * @param value The value of the choice\n\t */\n\tpublic addChoice(name: string, value: T) {\n\t\tthis.choices ??= [];\n\n\t\tvalidateMaxChoicesLength(this.choices);\n\n\t\t// Validate name\n\t\tow(\n\t\t\tname,\n\t\t\t`${this.type === ApplicationCommandOptionType.String ? 'string' : 'integer'} choice name`,\n\t\t\tstringPredicate,\n\t\t);\n\n\t\t// Validate the value\n\t\tif (this.type === ApplicationCommandOptionType.String) ow(value, 'string choice value', stringPredicate);\n\t\telse ow(value, 'integer choice value', integerPredicate);\n\n\t\tthis.choices.push({ name, value });\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds multiple choices for this option\n\t * @param choices The choices to add\n\t */\n\tpublic addChoices(choices: [name: string, value: T][]) {\n\t\tow(\n\t\t\tchoices,\n\t\t\t`${this.type === ApplicationCommandOptionType.String ? 'string' : 'integer'} choices`,\n\t\t\tchoicesPredicate,\n\t\t);\n\n\t\tfor (const [label, value] of choices) this.addChoice(label, value);\n\t\treturn this;\n\t}\n\n\tpublic override toJSON() {\n\t\treturn {\n\t\t\t...super.toJSON(),\n\t\t\tchoices: this.choices,\n\t\t};\n\t}\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptions.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptions.d.ts new file mode 100644 index 0000000..c3db448 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptions.d.ts @@ -0,0 +1,48 @@ +import { SlashCommandBooleanOption } from '../options/boolean'; +import { SlashCommandChannelOption } from '../options/channel'; +import { SlashCommandIntegerOption } from '../options/integer'; +import { SlashCommandMentionableOption } from '../options/mentionable'; +import { SlashCommandRoleOption } from '../options/role'; +import { SlashCommandStringOption } from '../options/string'; +import { SlashCommandUserOption } from '../options/user'; +import type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder'; +export declare class SharedSlashCommandOptions { + readonly options: ToAPIApplicationCommandOptions[]; + /** + * Adds a boolean option + * @param input A function that returns an option builder, or an already built builder + */ + addBooleanOption(input: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption)): ShouldOmitSubcommandFunctions extends true ? Omit : this; + /** + * Adds a user option + * @param input A function that returns an option builder, or an already built builder + */ + addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)): ShouldOmitSubcommandFunctions extends true ? Omit : this; + /** + * Adds a channel option + * @param input A function that returns an option builder, or an already built builder + */ + addChannelOption(input: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption)): ShouldOmitSubcommandFunctions extends true ? Omit : this; + /** + * Adds a role option + * @param input A function that returns an option builder, or an already built builder + */ + addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)): ShouldOmitSubcommandFunctions extends true ? Omit : this; + /** + * Adds a mentionable option + * @param input A function that returns an option builder, or an already built builder + */ + addMentionableOption(input: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption)): ShouldOmitSubcommandFunctions extends true ? Omit : this; + /** + * Adds a string option + * @param input A function that returns an option builder, or an already built builder + */ + addStringOption(input: SlashCommandStringOption | ((builder: SlashCommandStringOption) => SlashCommandStringOption)): ShouldOmitSubcommandFunctions extends true ? Omit : this; + /** + * Adds an integer option + * @param input A function that returns an option builder, or an already built builder + */ + addIntegerOption(input: SlashCommandIntegerOption | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption)): ShouldOmitSubcommandFunctions extends true ? Omit : this; + private _sharedAddOptionMethod; +} +//# sourceMappingURL=CommandOptions.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptions.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptions.d.ts.map new file mode 100644 index 0000000..2a21fbc --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CommandOptions.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AAE7E,qBAAa,yBAAyB,CAAC,6BAA6B,GAAG,IAAI;IAC1E,SAAgB,OAAO,EAAG,8BAA8B,EAAE,CAAC;IAE3D;;;OAGG;IACI,gBAAgB,CACtB,KAAK,EAAE,yBAAyB,GAAG,CAAC,CAAC,OAAO,EAAE,yBAAyB,KAAK,yBAAyB,CAAC;IAKvG;;;OAGG;IACI,aAAa,CAAC,KAAK,EAAE,sBAAsB,GAAG,CAAC,CAAC,OAAO,EAAE,sBAAsB,KAAK,sBAAsB,CAAC;IAIlH;;;OAGG;IACI,gBAAgB,CACtB,KAAK,EAAE,yBAAyB,GAAG,CAAC,CAAC,OAAO,EAAE,yBAAyB,KAAK,yBAAyB,CAAC;IAKvG;;;OAGG;IACI,aAAa,CAAC,KAAK,EAAE,sBAAsB,GAAG,CAAC,CAAC,OAAO,EAAE,sBAAsB,KAAK,sBAAsB,CAAC;IAIlH;;;OAGG;IACI,oBAAoB,CAC1B,KAAK,EAAE,6BAA6B,GAAG,CAAC,CAAC,OAAO,EAAE,6BAA6B,KAAK,6BAA6B,CAAC;IAKnH;;;OAGG;IACI,eAAe,CACrB,KAAK,EAAE,wBAAwB,GAAG,CAAC,CAAC,OAAO,EAAE,wBAAwB,KAAK,wBAAwB,CAAC;IAKpG;;;OAGG;IACI,gBAAgB,CACtB,KAAK,EAAE,yBAAyB,GAAG,CAAC,CAAC,OAAO,EAAE,yBAAyB,KAAK,yBAAyB,CAAC;IAKvG,OAAO,CAAC,sBAAsB;CAmB9B"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptions.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptions.js new file mode 100644 index 0000000..940275f --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptions.js @@ -0,0 +1,83 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SharedSlashCommandOptions = void 0; +const Assertions_1 = require("../Assertions"); +const boolean_1 = require("../options/boolean"); +const channel_1 = require("../options/channel"); +const integer_1 = require("../options/integer"); +const mentionable_1 = require("../options/mentionable"); +const role_1 = require("../options/role"); +const string_1 = require("../options/string"); +const user_1 = require("../options/user"); +class SharedSlashCommandOptions { + constructor() { + Object.defineProperty(this, "options", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + } + /** + * Adds a boolean option + * @param input A function that returns an option builder, or an already built builder + */ + addBooleanOption(input) { + return this._sharedAddOptionMethod(input, boolean_1.SlashCommandBooleanOption); + } + /** + * Adds a user option + * @param input A function that returns an option builder, or an already built builder + */ + addUserOption(input) { + return this._sharedAddOptionMethod(input, user_1.SlashCommandUserOption); + } + /** + * Adds a channel option + * @param input A function that returns an option builder, or an already built builder + */ + addChannelOption(input) { + return this._sharedAddOptionMethod(input, channel_1.SlashCommandChannelOption); + } + /** + * Adds a role option + * @param input A function that returns an option builder, or an already built builder + */ + addRoleOption(input) { + return this._sharedAddOptionMethod(input, role_1.SlashCommandRoleOption); + } + /** + * Adds a mentionable option + * @param input A function that returns an option builder, or an already built builder + */ + addMentionableOption(input) { + return this._sharedAddOptionMethod(input, mentionable_1.SlashCommandMentionableOption); + } + /** + * Adds a string option + * @param input A function that returns an option builder, or an already built builder + */ + addStringOption(input) { + return this._sharedAddOptionMethod(input, string_1.SlashCommandStringOption); + } + /** + * Adds an integer option + * @param input A function that returns an option builder, or an already built builder + */ + addIntegerOption(input) { + return this._sharedAddOptionMethod(input, integer_1.SlashCommandIntegerOption); + } + _sharedAddOptionMethod(input, Instance) { + const { options } = this; + // First, assert options conditions - we cannot have more than 25 options + Assertions_1.validateMaxOptionsLength(options); + // Get the final result + const result = typeof input === 'function' ? input(new Instance()) : input; + Assertions_1.assertReturnOfBuilder(result, Instance); + // Push it + options.push(result); + return this; + } +} +exports.SharedSlashCommandOptions = SharedSlashCommandOptions; +//# sourceMappingURL=CommandOptions.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptions.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptions.js.map new file mode 100644 index 0000000..b2b1223 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/CommandOptions.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CommandOptions.js","sourceRoot":"/","sources":["interactions/slashCommands/mixins/CommandOptions.ts"],"names":[],"mappings":";;;AAAA,8CAAgF;AAEhF,gDAA+D;AAC/D,gDAA+D;AAC/D,gDAA+D;AAC/D,wDAAuE;AACvE,0CAAyD;AACzD,8CAA6D;AAC7D,0CAAyD;AAGzD,MAAa,yBAAyB;IAAtC;QACC;;;;;WAA2D;IAuF5D,CAAC;IArFA;;;OAGG;IACI,gBAAgB,CACtB,KAAsG;QAEtG,OAAO,IAAI,CAAC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AC;CACD;AAxFD,8DAwFC","sourcesContent":["import { assertReturnOfBuilder, validateMaxOptionsLength } from '../Assertions';\nimport type { SlashCommandOptionBase } from './CommandOptionBase';\nimport { SlashCommandBooleanOption } from '../options/boolean';\nimport { SlashCommandChannelOption } from '../options/channel';\nimport { SlashCommandIntegerOption } from '../options/integer';\nimport { SlashCommandMentionableOption } from '../options/mentionable';\nimport { SlashCommandRoleOption } from '../options/role';\nimport { SlashCommandStringOption } from '../options/string';\nimport { SlashCommandUserOption } from '../options/user';\nimport type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';\n\nexport class SharedSlashCommandOptions {\n\tpublic readonly options!: ToAPIApplicationCommandOptions[];\n\n\t/**\n\t * Adds a boolean option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addBooleanOption(\n\t\tinput: SlashCommandBooleanOption | ((builder: SlashCommandBooleanOption) => SlashCommandBooleanOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandBooleanOption);\n\t}\n\n\t/**\n\t * Adds a user option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addUserOption(input: SlashCommandUserOption | ((builder: SlashCommandUserOption) => SlashCommandUserOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandUserOption);\n\t}\n\n\t/**\n\t * Adds a channel option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addChannelOption(\n\t\tinput: SlashCommandChannelOption | ((builder: SlashCommandChannelOption) => SlashCommandChannelOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandChannelOption);\n\t}\n\n\t/**\n\t * Adds a role option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addRoleOption(input: SlashCommandRoleOption | ((builder: SlashCommandRoleOption) => SlashCommandRoleOption)) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandRoleOption);\n\t}\n\n\t/**\n\t * Adds a mentionable option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addMentionableOption(\n\t\tinput: SlashCommandMentionableOption | ((builder: SlashCommandMentionableOption) => SlashCommandMentionableOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandMentionableOption);\n\t}\n\n\t/**\n\t * Adds a string option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addStringOption(\n\t\tinput: SlashCommandStringOption | ((builder: SlashCommandStringOption) => SlashCommandStringOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandStringOption);\n\t}\n\n\t/**\n\t * Adds an integer option\n\t * @param input A function that returns an option builder, or an already built builder\n\t */\n\tpublic addIntegerOption(\n\t\tinput: SlashCommandIntegerOption | ((builder: SlashCommandIntegerOption) => SlashCommandIntegerOption),\n\t) {\n\t\treturn this._sharedAddOptionMethod(input, SlashCommandIntegerOption);\n\t}\n\n\tprivate _sharedAddOptionMethod(\n\t\tinput: T | ((builder: T) => T),\n\t\tInstance: new () => T,\n\t): ShouldOmitSubcommandFunctions extends true ? Omit : this {\n\t\tconst { options } = this;\n\n\t\t// First, assert options conditions - we cannot have more than 25 options\n\t\tvalidateMaxOptionsLength(options);\n\n\t\t// Get the final result\n\t\tconst result = typeof input === 'function' ? input(new Instance()) : input;\n\n\t\tassertReturnOfBuilder(result, Instance);\n\n\t\t// Push it\n\t\toptions.push(result);\n\n\t\treturn this;\n\t}\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts new file mode 100644 index 0000000..a7a5695 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts @@ -0,0 +1,15 @@ +export declare class SharedNameAndDescription { + readonly name: string; + readonly description: string; + /** + * Sets the name + * @param name The name + */ + setName(name: string): this; + /** + * Sets the description + * @param description The description + */ + setDescription(description: string): this; +} +//# sourceMappingURL=NameAndDescription.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts.map new file mode 100644 index 0000000..868dc88 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/NameAndDescription.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"NameAndDescription.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/mixins/NameAndDescription.ts"],"names":[],"mappings":"AAEA,qBAAa,wBAAwB;IACpC,SAAgB,IAAI,EAAG,MAAM,CAAC;IAC9B,SAAgB,WAAW,EAAG,MAAM,CAAC;IAErC;;;OAGG;IACI,OAAO,CAAC,IAAI,EAAE,MAAM;IAS3B;;;OAGG;IACI,cAAc,CAAC,WAAW,EAAE,MAAM;CAQzC"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/NameAndDescription.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/NameAndDescription.js new file mode 100644 index 0000000..bb6031d --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/NameAndDescription.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SharedNameAndDescription = void 0; +const Assertions_1 = require("../Assertions"); +class SharedNameAndDescription { + constructor() { + Object.defineProperty(this, "name", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + Object.defineProperty(this, "description", { + enumerable: true, + configurable: true, + writable: true, + value: void 0 + }); + } + /** + * Sets the name + * @param name The name + */ + setName(name) { + // Assert the name matches the conditions + Assertions_1.validateName(name); + Reflect.set(this, 'name', name); + return this; + } + /** + * Sets the description + * @param description The description + */ + setDescription(description) { + // Assert the description matches the conditions + Assertions_1.validateDescription(description); + Reflect.set(this, 'description', description); + return this; + } +} +exports.SharedNameAndDescription = SharedNameAndDescription; +//# sourceMappingURL=NameAndDescription.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/NameAndDescription.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/NameAndDescription.js.map new file mode 100644 index 0000000..f4fa197 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/mixins/NameAndDescription.js.map @@ -0,0 +1 @@ +{"version":3,"file":"NameAndDescription.js","sourceRoot":"/","sources":["interactions/slashCommands/mixins/NameAndDescription.ts"],"names":[],"mappings":";;;AAAA,8CAAkE;AAElE,MAAa,wBAAwB;IAArC;QACC;;;;;WAA8B;QAC9B;;;;;WAAqC;IA2BtC,CAAC;IAzBA;;;OAGG;IACI,OAAO,CAAC,IAAY;QAC1B,yCAAyC;QACzC,yBAAY,CAAC,IAAI,CAAC,CAAC;QAEnB,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAEhC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;OAGG;IACI,cAAc,CAAC,WAAmB;QACxC,gDAAgD;QAChD,gCAAmB,CAAC,WAAW,CAAC,CAAC;QAEjC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;QAE9C,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AA7BD,4DA6BC","sourcesContent":["import { validateDescription, validateName } from '../Assertions';\n\nexport class SharedNameAndDescription {\n\tpublic readonly name!: string;\n\tpublic readonly description!: string;\n\n\t/**\n\t * Sets the name\n\t * @param name The name\n\t */\n\tpublic setName(name: string) {\n\t\t// Assert the name matches the conditions\n\t\tvalidateName(name);\n\n\t\tReflect.set(this, 'name', name);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the description\n\t * @param description The description\n\t */\n\tpublic setDescription(description: string) {\n\t\t// Assert the description matches the conditions\n\t\tvalidateDescription(description);\n\n\t\tReflect.set(this, 'description', description);\n\n\t\treturn this;\n\t}\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/boolean.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/boolean.d.ts new file mode 100644 index 0000000..a0cda36 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/boolean.d.ts @@ -0,0 +1,7 @@ +import { ApplicationCommandOptionType } from 'discord-api-types/v9'; +import { SlashCommandOptionBase } from '../mixins/CommandOptionBase'; +export declare class SlashCommandBooleanOption extends SlashCommandOptionBase { + readonly type: ApplicationCommandOptionType.Boolean; + constructor(); +} +//# sourceMappingURL=boolean.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/boolean.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/boolean.d.ts.map new file mode 100644 index 0000000..d4d1596 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/boolean.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"boolean.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/boolean.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,yBAA0B,SAAQ,sBAAsB;IACpE,SAAyB,IAAI,uCAAiD;;CAK9E"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/boolean.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/boolean.js new file mode 100644 index 0000000..c54342d --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/boolean.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SlashCommandBooleanOption = void 0; +require("discord-api-types/v9"); +const CommandOptionBase_1 = require("../mixins/CommandOptionBase"); +class SlashCommandBooleanOption extends CommandOptionBase_1.SlashCommandOptionBase { + constructor() { + super(5 /* Boolean */); + Object.defineProperty(this, "type", { + enumerable: true, + configurable: true, + writable: true, + value: 5 /* Boolean */ + }); + } +} +exports.SlashCommandBooleanOption = SlashCommandBooleanOption; +//# sourceMappingURL=boolean.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/boolean.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/boolean.js.map new file mode 100644 index 0000000..94e0554 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/boolean.js.map @@ -0,0 +1 @@ +{"version":3,"file":"boolean.js","sourceRoot":"/","sources":["interactions/slashCommands/options/boolean.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,yBAA0B,SAAQ,0CAAsB;IAGpE;QACC,KAAK,iBAAsC,CAAC;QAH7C;;;;mBAAgC,eAA6C;WAAC;IAI9E,CAAC;CACD;AAND,8DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandBooleanOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Boolean as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Boolean);\n\t}\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/channel.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/channel.d.ts new file mode 100644 index 0000000..2b6d03a --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/channel.d.ts @@ -0,0 +1,7 @@ +import { ApplicationCommandOptionType } from 'discord-api-types/v9'; +import { SlashCommandOptionBase } from '../mixins/CommandOptionBase'; +export declare class SlashCommandChannelOption extends SlashCommandOptionBase { + readonly type: ApplicationCommandOptionType.Channel; + constructor(); +} +//# sourceMappingURL=channel.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/channel.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/channel.d.ts.map new file mode 100644 index 0000000..5e55e53 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/channel.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"channel.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/channel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,yBAA0B,SAAQ,sBAAsB;IACpE,SAAyB,IAAI,uCAAiD;;CAK9E"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/channel.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/channel.js new file mode 100644 index 0000000..87e22b4 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/channel.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SlashCommandChannelOption = void 0; +require("discord-api-types/v9"); +const CommandOptionBase_1 = require("../mixins/CommandOptionBase"); +class SlashCommandChannelOption extends CommandOptionBase_1.SlashCommandOptionBase { + constructor() { + super(7 /* Channel */); + Object.defineProperty(this, "type", { + enumerable: true, + configurable: true, + writable: true, + value: 7 /* Channel */ + }); + } +} +exports.SlashCommandChannelOption = SlashCommandChannelOption; +//# sourceMappingURL=channel.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/channel.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/channel.js.map new file mode 100644 index 0000000..1424a39 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/channel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"channel.js","sourceRoot":"/","sources":["interactions/slashCommands/options/channel.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,yBAA0B,SAAQ,0CAAsB;IAGpE;QACC,KAAK,iBAAsC,CAAC;QAH7C;;;;mBAAgC,eAA6C;WAAC;IAI9E,CAAC;CACD;AAND,8DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandChannelOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Channel as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Channel);\n\t}\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/integer.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/integer.d.ts new file mode 100644 index 0000000..3faefe0 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/integer.d.ts @@ -0,0 +1,7 @@ +import { ApplicationCommandOptionType } from 'discord-api-types/v9'; +import { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices'; +export declare class SlashCommandIntegerOption extends ApplicationCommandOptionWithChoicesBase { + readonly type: ApplicationCommandOptionType.Integer; + constructor(); +} +//# sourceMappingURL=integer.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/integer.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/integer.d.ts.map new file mode 100644 index 0000000..e991150 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/integer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"integer.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/integer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uCAAuC,EAAE,MAAM,oCAAoC,CAAC;AAE7F,qBAAa,yBAA0B,SAAQ,uCAAuC,CAAC,MAAM,CAAC;IAC7F,SAAyB,IAAI,uCAAiD;;CAK9E"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/integer.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/integer.js new file mode 100644 index 0000000..73ace64 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/integer.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SlashCommandIntegerOption = void 0; +require("discord-api-types/v9"); +const CommandOptionWithChoices_1 = require("../mixins/CommandOptionWithChoices"); +class SlashCommandIntegerOption extends CommandOptionWithChoices_1.ApplicationCommandOptionWithChoicesBase { + constructor() { + super(4 /* Integer */); + Object.defineProperty(this, "type", { + enumerable: true, + configurable: true, + writable: true, + value: 4 /* Integer */ + }); + } +} +exports.SlashCommandIntegerOption = SlashCommandIntegerOption; +//# sourceMappingURL=integer.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/integer.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/integer.js.map new file mode 100644 index 0000000..8bb13b6 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/integer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"integer.js","sourceRoot":"/","sources":["interactions/slashCommands/options/integer.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,iFAA6F;AAE7F,MAAa,yBAA0B,SAAQ,kEAA+C;IAG7F;QACC,KAAK,iBAAsC,CAAC;QAH7C;;;;mBAAgC,eAA6C;WAAC;IAI9E,CAAC;CACD;AAND,8DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';\n\nexport class SlashCommandIntegerOption extends ApplicationCommandOptionWithChoicesBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Integer as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Integer);\n\t}\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/mentionable.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/mentionable.d.ts new file mode 100644 index 0000000..ff98caf --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/mentionable.d.ts @@ -0,0 +1,7 @@ +import { ApplicationCommandOptionType } from 'discord-api-types/v9'; +import { SlashCommandOptionBase } from '../mixins/CommandOptionBase'; +export declare class SlashCommandMentionableOption extends SlashCommandOptionBase { + readonly type: ApplicationCommandOptionType.Mentionable; + constructor(); +} +//# sourceMappingURL=mentionable.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/mentionable.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/mentionable.d.ts.map new file mode 100644 index 0000000..2099899 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/mentionable.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mentionable.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/mentionable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,6BAA8B,SAAQ,sBAAsB;IACxE,SAAyB,IAAI,2CAAqD;;CAKlF"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/mentionable.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/mentionable.js new file mode 100644 index 0000000..a6167b3 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/mentionable.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SlashCommandMentionableOption = void 0; +require("discord-api-types/v9"); +const CommandOptionBase_1 = require("../mixins/CommandOptionBase"); +class SlashCommandMentionableOption extends CommandOptionBase_1.SlashCommandOptionBase { + constructor() { + super(9 /* Mentionable */); + Object.defineProperty(this, "type", { + enumerable: true, + configurable: true, + writable: true, + value: 9 /* Mentionable */ + }); + } +} +exports.SlashCommandMentionableOption = SlashCommandMentionableOption; +//# sourceMappingURL=mentionable.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/mentionable.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/mentionable.js.map new file mode 100644 index 0000000..96e79cb --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/mentionable.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mentionable.js","sourceRoot":"/","sources":["interactions/slashCommands/options/mentionable.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,6BAA8B,SAAQ,0CAAsB;IAGxE;QACC,KAAK,qBAA0C,CAAC;QAHjD;;;;mBAAgC,mBAAiD;WAAC;IAIlF,CAAC;CACD;AAND,sEAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandMentionableOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Mentionable as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Mentionable);\n\t}\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/role.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/role.d.ts new file mode 100644 index 0000000..3f78471 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/role.d.ts @@ -0,0 +1,7 @@ +import { ApplicationCommandOptionType } from 'discord-api-types/v9'; +import { SlashCommandOptionBase } from '../mixins/CommandOptionBase'; +export declare class SlashCommandRoleOption extends SlashCommandOptionBase { + readonly type: ApplicationCommandOptionType.Role; + constructor(); +} +//# sourceMappingURL=role.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/role.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/role.d.ts.map new file mode 100644 index 0000000..c4efc7a --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/role.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"role.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,sBAAuB,SAAQ,sBAAsB;IACjE,SAAyB,IAAI,oCAA8C;;CAK3E"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/role.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/role.js new file mode 100644 index 0000000..a01871a --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/role.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SlashCommandRoleOption = void 0; +require("discord-api-types/v9"); +const CommandOptionBase_1 = require("../mixins/CommandOptionBase"); +class SlashCommandRoleOption extends CommandOptionBase_1.SlashCommandOptionBase { + constructor() { + super(8 /* Role */); + Object.defineProperty(this, "type", { + enumerable: true, + configurable: true, + writable: true, + value: 8 /* Role */ + }); + } +} +exports.SlashCommandRoleOption = SlashCommandRoleOption; +//# sourceMappingURL=role.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/role.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/role.js.map new file mode 100644 index 0000000..d901da3 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/role.js.map @@ -0,0 +1 @@ +{"version":3,"file":"role.js","sourceRoot":"/","sources":["interactions/slashCommands/options/role.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,sBAAuB,SAAQ,0CAAsB;IAGjE;QACC,KAAK,cAAmC,CAAC;QAH1C;;;;mBAAgC,YAA0C;WAAC;IAI3E,CAAC;CACD;AAND,wDAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandRoleOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.Role as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.Role);\n\t}\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/string.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/string.d.ts new file mode 100644 index 0000000..3141ee7 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/string.d.ts @@ -0,0 +1,7 @@ +import { ApplicationCommandOptionType } from 'discord-api-types/v9'; +import { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices'; +export declare class SlashCommandStringOption extends ApplicationCommandOptionWithChoicesBase { + readonly type: ApplicationCommandOptionType.String; + constructor(); +} +//# sourceMappingURL=string.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/string.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/string.d.ts.map new file mode 100644 index 0000000..cce8fc5 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/string.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"string.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,uCAAuC,EAAE,MAAM,oCAAoC,CAAC;AAE7F,qBAAa,wBAAyB,SAAQ,uCAAuC,CAAC,MAAM,CAAC;IAC5F,SAAyB,IAAI,sCAAgD;;CAK7E"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/string.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/string.js new file mode 100644 index 0000000..8578f86 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/string.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SlashCommandStringOption = void 0; +require("discord-api-types/v9"); +const CommandOptionWithChoices_1 = require("../mixins/CommandOptionWithChoices"); +class SlashCommandStringOption extends CommandOptionWithChoices_1.ApplicationCommandOptionWithChoicesBase { + constructor() { + super(3 /* String */); + Object.defineProperty(this, "type", { + enumerable: true, + configurable: true, + writable: true, + value: 3 /* String */ + }); + } +} +exports.SlashCommandStringOption = SlashCommandStringOption; +//# sourceMappingURL=string.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/string.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/string.js.map new file mode 100644 index 0000000..68eac55 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/string.js.map @@ -0,0 +1 @@ +{"version":3,"file":"string.js","sourceRoot":"/","sources":["interactions/slashCommands/options/string.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,iFAA6F;AAE7F,MAAa,wBAAyB,SAAQ,kEAA+C;IAG5F;QACC,KAAK,gBAAqC,CAAC;QAH5C;;;;mBAAgC,cAA4C;WAAC;IAI7E,CAAC;CACD;AAND,4DAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { ApplicationCommandOptionWithChoicesBase } from '../mixins/CommandOptionWithChoices';\n\nexport class SlashCommandStringOption extends ApplicationCommandOptionWithChoicesBase {\n\tpublic override readonly type = ApplicationCommandOptionType.String as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.String);\n\t}\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/user.d.ts b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/user.d.ts new file mode 100644 index 0000000..341727c --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/user.d.ts @@ -0,0 +1,7 @@ +import { ApplicationCommandOptionType } from 'discord-api-types/v9'; +import { SlashCommandOptionBase } from '../mixins/CommandOptionBase'; +export declare class SlashCommandUserOption extends SlashCommandOptionBase { + readonly type: ApplicationCommandOptionType.User; + constructor(); +} +//# sourceMappingURL=user.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/user.d.ts.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/user.d.ts.map new file mode 100644 index 0000000..9947f56 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/user.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"user.d.ts","sourceRoot":"/","sources":["interactions/slashCommands/options/user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,sBAAuB,SAAQ,sBAAsB;IACjE,SAAyB,IAAI,oCAA8C;;CAK3E"} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/user.js b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/user.js new file mode 100644 index 0000000..d4922ad --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/user.js @@ -0,0 +1,18 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SlashCommandUserOption = void 0; +require("discord-api-types/v9"); +const CommandOptionBase_1 = require("../mixins/CommandOptionBase"); +class SlashCommandUserOption extends CommandOptionBase_1.SlashCommandOptionBase { + constructor() { + super(6 /* User */); + Object.defineProperty(this, "type", { + enumerable: true, + configurable: true, + writable: true, + value: 6 /* User */ + }); + } +} +exports.SlashCommandUserOption = SlashCommandUserOption; +//# sourceMappingURL=user.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/user.js.map b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/user.js.map new file mode 100644 index 0000000..44bad52 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/interactions/slashCommands/options/user.js.map @@ -0,0 +1 @@ +{"version":3,"file":"user.js","sourceRoot":"/","sources":["interactions/slashCommands/options/user.ts"],"names":[],"mappings":";;;AAAA,gCAAoE;AACpE,mEAAqE;AAErE,MAAa,sBAAuB,SAAQ,0CAAsB;IAGjE;QACC,KAAK,cAAmC,CAAC;QAH1C;;;;mBAAgC,YAA0C;WAAC;IAI3E,CAAC;CACD;AAND,wDAMC","sourcesContent":["import { ApplicationCommandOptionType } from 'discord-api-types/v9';\nimport { SlashCommandOptionBase } from '../mixins/CommandOptionBase';\n\nexport class SlashCommandUserOption extends SlashCommandOptionBase {\n\tpublic override readonly type = ApplicationCommandOptionType.User as const;\n\n\tpublic constructor() {\n\t\tsuper(ApplicationCommandOptionType.User);\n\t}\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/messages/formatters.d.ts b/node_modules/@discordjs/builders/dist/messages/formatters.d.ts new file mode 100644 index 0000000..fbe14af --- /dev/null +++ b/node_modules/@discordjs/builders/dist/messages/formatters.d.ts @@ -0,0 +1,220 @@ +/// +import type { Snowflake } from 'discord-api-types/globals'; +import type { URL } from 'url'; +/** + * Wraps the content inside a codeblock with no language. + * @param content The content to wrap. + * @returns The formatted content. + */ +export declare function codeBlock(content: C): `\`\`\`\n${C}\`\`\``; +/** + * Wraps the content inside a codeblock with the specified language. + * @param language The language for the codeblock. + * @param content The content to wrap. + * @returns The formatted content. + */ +export declare function codeBlock(language: L, content: C): `\`\`\`${L}\n${C}\`\`\``; +/** + * Wraps the content inside \`backticks\`, which formats it as inline code. + * @param content The content to wrap. + * @returns The formatted content. + */ +export declare function inlineCode(content: C): `\`${C}\``; +/** + * Formats the content into italic text. + * @param content The content to wrap. + * @returns The formatted content. + */ +export declare function italic(content: C): `_${C}_`; +/** + * Formats the content into bold text. + * @param content The content to wrap. + * @returns The formatted content. + */ +export declare function bold(content: C): `**${C}**`; +/** + * Formats the content into underscored text. + * @param content The content to wrap. + * @returns The formatted content. + */ +export declare function underscore(content: C): `__${C}__`; +/** + * Formats the content into strike-through text. + * @param content The content to wrap. + * @returns The formatted content. + */ +export declare function strikethrough(content: C): `~~${C}~~`; +/** + * Formats the content into a quote. This needs to be at the start of the line for Discord to format it. + * @param content The content to wrap. + * @returns The formatted content. + */ +export declare function quote(content: C): `> ${C}`; +/** + * Formats the content into a block quote. This needs to be at the start of the line for Discord to format it. + * @param content The content to wrap. + * @returns The formatted content. + */ +export declare function blockQuote(content: C): `>>> ${C}`; +/** + * Wraps the URL into `<>`, which stops it from embedding. + * @param url The URL to wrap. + * @returns The formatted content. + */ +export declare function hideLinkEmbed(url: C): `<${C}>`; +/** + * Wraps the URL into `<>`, which stops it from embedding. + * @param url The URL to wrap. + * @returns The formatted content. + */ +export declare function hideLinkEmbed(url: URL): `<${string}>`; +/** + * Formats the content and the URL into a masked URL. + * @param content The content to display. + * @param url The URL the content links to. + * @returns The formatted content. + */ +export declare function hyperlink(content: C, url: URL): `[${C}](${string})`; +/** + * Formats the content and the URL into a masked URL. + * @param content The content to display. + * @param url The URL the content links to. + * @returns The formatted content. + */ +export declare function hyperlink(content: C, url: U): `[${C}](${U})`; +/** + * Formats the content and the URL into a masked URL. + * @param content The content to display. + * @param url The URL the content links to. + * @param title The title shown when hovering on the masked link. + * @returns The formatted content. + */ +export declare function hyperlink(content: C, url: URL, title: T): `[${C}](${string} "${T}")`; +/** + * Formats the content and the URL into a masked URL. + * @param content The content to display. + * @param url The URL the content links to. + * @param title The title shown when hovering on the masked link. + * @returns The formatted content. + */ +export declare function hyperlink(content: C, url: U, title: T): `[${C}](${U} "${T}")`; +/** + * Wraps the content inside spoiler (hidden text). + * @param content The content to wrap. + * @returns The formatted content. + */ +export declare function spoiler(content: C): `||${C}||`; +/** + * Formats a user ID into a user mention. + * @param userId The user ID to format. + * @returns The formatted user mention. + */ +export declare function userMention(userId: C): `<@${C}>`; +/** + * Formats a user ID into a member-nickname mention. + * @param memberId The user ID to format. + * @returns The formatted member-nickname mention. + */ +export declare function memberNicknameMention(memberId: C): `<@!${C}>`; +/** + * Formats a channel ID into a channel mention. + * @param channelId The channel ID to format. + * @returns The formatted channel mention. + */ +export declare function channelMention(channelId: C): `<#${C}>`; +/** + * Formats a role ID into a role mention. + * @param roleId The role ID to format. + * @returns The formatted role mention. + */ +export declare function roleMention(roleId: C): `<@&${C}>`; +/** + * Formats an emoji ID into a fully qualified emoji identifier + * @param emojiId The emoji ID to format. + * @returns The formatted emoji. + */ +export declare function formatEmoji(emojiId: C, animated?: false): `<:_:${C}>`; +/** + * Formats an emoji ID into a fully qualified emoji identifier + * @param emojiId The emoji ID to format. + * @param animated Whether the emoji is animated or not. Defaults to `false` + * @returns The formatted emoji. + */ +export declare function formatEmoji(emojiId: C, animated?: true): ``; +/** + * Formats a date into a short date-time string. + * @param date The date to format, defaults to the current time. + */ +export declare function time(date?: Date): ``; +/** + * Formats a date given a format style. + * @param date The date to format. + * @param style The style to use. + */ +export declare function time(date: Date, style: S): ``; +/** + * Formats the given timestamp into a short date-time string. + * @param seconds The time to format, represents an UNIX timestamp in seconds. + */ +export declare function time(seconds: C): ``; +/** + * Formats the given timestamp into a short date-time string. + * @param seconds The time to format, represents an UNIX timestamp in seconds. + * @param style The style to use. + */ +export declare function time(seconds: C, style: S): ``; +/** + * The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord. + */ +export declare const TimestampStyles: { + /** + * Short time format, consisting of hours and minutes, e.g. 16:20. + */ + readonly ShortTime: "t"; + /** + * Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30. + */ + readonly LongTime: "T"; + /** + * Short date format, consisting of day, month, and year, e.g. 20/04/2021. + */ + readonly ShortDate: "d"; + /** + * Long date format, consisting of day, month, and year, e.g. 20 April 2021. + */ + readonly LongDate: "D"; + /** + * Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20. + */ + readonly ShortDateTime: "f"; + /** + * Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20. + */ + readonly LongDateTime: "F"; + /** + * Relative time format, consisting of a relative duration format, e.g. 2 months ago. + */ + readonly RelativeTime: "R"; +}; +/** + * The possible values, see {@link TimestampStyles} for more information. + */ +export declare type TimestampStylesString = typeof TimestampStyles[keyof typeof TimestampStyles]; +/** + * An enum with all the available faces from Discord's native slash commands + */ +export declare enum Faces { + /** + * ¯\\_(ツ)\\_/¯ + */ + Shrug = "\u00AF\\_(\u30C4)\\_/\u00AF", + /** + * (╯°□°)╯︵ ┻━┻ + */ + Tableflip = "(\u256F\u00B0\u25A1\u00B0\uFF09\u256F\uFE35 \u253B\u2501\u253B", + /** + * ┬─┬ ノ( ゜-゜ノ) + */ + Unflip = "\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)" +} +//# sourceMappingURL=formatters.d.ts.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/messages/formatters.d.ts.map b/node_modules/@discordjs/builders/dist/messages/formatters.d.ts.map new file mode 100644 index 0000000..2ece71d --- /dev/null +++ b/node_modules/@discordjs/builders/dist/messages/formatters.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"formatters.d.ts","sourceRoot":"/","sources":["messages/formatters.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE/B;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC;AAE9E;;;;;GAKG;AACH,wB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 No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/messages/formatters.js b/node_modules/@discordjs/builders/dist/messages/formatters.js new file mode 100644 index 0000000..4d3b467 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/messages/formatters.js @@ -0,0 +1,194 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Faces = exports.TimestampStyles = exports.time = exports.formatEmoji = exports.roleMention = exports.channelMention = exports.memberNicknameMention = exports.userMention = exports.spoiler = exports.hyperlink = exports.hideLinkEmbed = exports.blockQuote = exports.quote = exports.strikethrough = exports.underscore = exports.bold = exports.italic = exports.inlineCode = exports.codeBlock = void 0; +function codeBlock(language, content) { + return typeof content === 'undefined' ? `\`\`\`\n${language}\`\`\`` : `\`\`\`${language}\n${content}\`\`\``; +} +exports.codeBlock = codeBlock; +/** + * Wraps the content inside \`backticks\`, which formats it as inline code. + * @param content The content to wrap. + * @returns The formatted content. + */ +function inlineCode(content) { + return `\`${content}\``; +} +exports.inlineCode = inlineCode; +/** + * Formats the content into italic text. + * @param content The content to wrap. + * @returns The formatted content. + */ +function italic(content) { + return `_${content}_`; +} +exports.italic = italic; +/** + * Formats the content into bold text. + * @param content The content to wrap. + * @returns The formatted content. + */ +function bold(content) { + return `**${content}**`; +} +exports.bold = bold; +/** + * Formats the content into underscored text. + * @param content The content to wrap. + * @returns The formatted content. + */ +function underscore(content) { + return `__${content}__`; +} +exports.underscore = underscore; +/** + * Formats the content into strike-through text. + * @param content The content to wrap. + * @returns The formatted content. + */ +function strikethrough(content) { + return `~~${content}~~`; +} +exports.strikethrough = strikethrough; +/** + * Formats the content into a quote. This needs to be at the start of the line for Discord to format it. + * @param content The content to wrap. + * @returns The formatted content. + */ +function quote(content) { + return `> ${content}`; +} +exports.quote = quote; +/** + * Formats the content into a block quote. This needs to be at the start of the line for Discord to format it. + * @param content The content to wrap. + * @returns The formatted content. + */ +function blockQuote(content) { + return `>>> ${content}`; +} +exports.blockQuote = blockQuote; +function hideLinkEmbed(url) { + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + return `<${url}>`; +} +exports.hideLinkEmbed = hideLinkEmbed; +function hyperlink(content, url, title) { + // eslint-disable-next-line @typescript-eslint/restrict-template-expressions + return title ? `[${content}](${url} "${title}")` : `[${content}](${url})`; +} +exports.hyperlink = hyperlink; +/** + * Wraps the content inside spoiler (hidden text). + * @param content The content to wrap. + * @returns The formatted content. + */ +function spoiler(content) { + return `||${content}||`; +} +exports.spoiler = spoiler; +/** + * Formats a user ID into a user mention. + * @param userId The user ID to format. + * @returns The formatted user mention. + */ +function userMention(userId) { + return `<@${userId}>`; +} +exports.userMention = userMention; +/** + * Formats a user ID into a member-nickname mention. + * @param memberId The user ID to format. + * @returns The formatted member-nickname mention. + */ +function memberNicknameMention(memberId) { + return `<@!${memberId}>`; +} +exports.memberNicknameMention = memberNicknameMention; +/** + * Formats a channel ID into a channel mention. + * @param channelId The channel ID to format. + * @returns The formatted channel mention. + */ +function channelMention(channelId) { + return `<#${channelId}>`; +} +exports.channelMention = channelMention; +/** + * Formats a role ID into a role mention. + * @param roleId The role ID to format. + * @returns The formatted role mention. + */ +function roleMention(roleId) { + return `<@&${roleId}>`; +} +exports.roleMention = roleMention; +/** + * Formats an emoji ID into a fully qualified emoji identifier + * @param emojiId The emoji ID to format. + * @param animated Whether the emoji is animated or not. Defaults to `false` + * @returns The formatted emoji. + */ +function formatEmoji(emojiId, animated = false) { + return `<${animated ? 'a' : ''}:_:${emojiId}>`; +} +exports.formatEmoji = formatEmoji; +function time(timeOrSeconds, style) { + if (typeof timeOrSeconds !== 'number') { + timeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1000); + } + return typeof style === 'string' ? `` : ``; +} +exports.time = time; +/** + * The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord. + */ +exports.TimestampStyles = { + /** + * Short time format, consisting of hours and minutes, e.g. 16:20. + */ + ShortTime: 't', + /** + * Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30. + */ + LongTime: 'T', + /** + * Short date format, consisting of day, month, and year, e.g. 20/04/2021. + */ + ShortDate: 'd', + /** + * Long date format, consisting of day, month, and year, e.g. 20 April 2021. + */ + LongDate: 'D', + /** + * Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20. + */ + ShortDateTime: 'f', + /** + * Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20. + */ + LongDateTime: 'F', + /** + * Relative time format, consisting of a relative duration format, e.g. 2 months ago. + */ + RelativeTime: 'R', +}; +/** + * An enum with all the available faces from Discord's native slash commands + */ +var Faces; +(function (Faces) { + /** + * ¯\\_(ツ)\\_/¯ + */ + Faces["Shrug"] = "\u00AF\\_(\u30C4)\\_/\u00AF"; + /** + * (╯°□°)╯︵ ┻━┻ + */ + Faces["Tableflip"] = "(\u256F\u00B0\u25A1\u00B0\uFF09\u256F\uFE35 \u253B\u2501\u253B"; + /** + * ┬─┬ ノ( ゜-゜ノ) + */ + Faces["Unflip"] = "\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)"; +})(Faces = exports.Faces || (exports.Faces = {})); +//# sourceMappingURL=formatters.js.map \ No newline at end of file diff --git a/node_modules/@discordjs/builders/dist/messages/formatters.js.map b/node_modules/@discordjs/builders/dist/messages/formatters.js.map new file mode 100644 index 0000000..86b5226 --- /dev/null +++ b/node_modules/@discordjs/builders/dist/messages/formatters.js.map @@ -0,0 +1 @@ +{"version":3,"file":"formatters.js","sourceRoot":"/","sources":["messages/formatters.ts"],"names":[],"mappings":";;;AAiBA,SAAgB,SAAS,CAAC,QAAgB,EAAE,OAAgB;IAC3D,OAAO,OAAO,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW,QAAQ,QAAQ,CAAC,CAAC,CAAC,SAAS,QAAQ,KAAK,OAAO,QAAQ,CAAC;AAC7G,CAAC;AAFD,8BAEC;AAED;;;;GAIG;AACH,SAAgB,UAAU,CAAmB,OAAU;IACtD,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AC;AAOX;;GAEG;AACH,IAAY,KAeX;AAfD,WAAY,KAAK;IAChB;;OAEG;IACH,8CAAsB,CAAA;IAEtB;;OAEG;IACH,qFAA0B,CAAA;IAE1B;;OAEG;IACH,mEAAuB,CAAA;AACxB,CAAC,EAfW,KAAK,GAAL,aAAK,KAAL,aAAK,QAehB","sourcesContent":["import type { Snowflake } from 'discord-api-types/globals';\nimport type { URL } from 'url';\n\n/**\n * Wraps the content inside a codeblock with no language.\n * @param content The content to wrap.\n * @returns The formatted content.\n */\nexport function codeBlock(content: C): `\\`\\`\\`\\n${C}\\`\\`\\``;\n\n/**\n * Wraps the content inside a codeblock with the specified language.\n * @param language The language for the codeblock.\n * @param content The content to wrap.\n * @returns The formatted content.\n */\nexport function codeBlock(language: L, content: C): `\\`\\`\\`${L}\\n${C}\\`\\`\\``;\nexport function codeBlock(language: string, content?: string): string {\n\treturn typeof content === 'undefined' ? `\\`\\`\\`\\n${language}\\`\\`\\`` : `\\`\\`\\`${language}\\n${content}\\`\\`\\``;\n}\n\n/**\n * Wraps the content inside \\`backticks\\`, which formats it as inline code.\n * @param content The content to wrap.\n * @returns The formatted content.\n */\nexport function inlineCode(content: C): `\\`${C}\\`` {\n\treturn `\\`${content}\\``;\n}\n\n/**\n * Formats the content into italic text.\n * @param content The content to wrap.\n * @returns The formatted content.\n */\nexport function italic(content: C): `_${C}_` {\n\treturn `_${content}_`;\n}\n\n/**\n * Formats the content into bold text.\n * @param content The content to wrap.\n * @returns The formatted content.\n */\nexport function bold(content: C): `**${C}**` {\n\treturn `**${content}**`;\n}\n\n/**\n * Formats the content into underscored text.\n * @param content The content to wrap.\n * @returns The formatted content.\n */\nexport function underscore(content: C): `__${C}__` {\n\treturn `__${content}__`;\n}\n\n/**\n * Formats the content into strike-through text.\n * @param content The content to wrap.\n * @returns The formatted content.\n */\nexport function strikethrough(content: C): `~~${C}~~` {\n\treturn `~~${content}~~`;\n}\n\n/**\n * Formats the content into a quote. This needs to be at the start of the line for Discord to format it.\n * @param content The content to wrap.\n * @returns The formatted content.\n */\nexport function quote(content: C): `> ${C}` {\n\treturn `> ${content}`;\n}\n\n/**\n * Formats the content into a block quote. This needs to be at the start of the line for Discord to format it.\n * @param content The content to wrap.\n * @returns The formatted content.\n */\nexport function blockQuote(content: C): `>>> ${C}` {\n\treturn `>>> ${content}`;\n}\n\n/**\n * Wraps the URL into `<>`, which stops it from embedding.\n * @param url The URL to wrap.\n * @returns The formatted content.\n */\nexport function hideLinkEmbed(url: C): `<${C}>`;\n\n/**\n * Wraps the URL into `<>`, which stops it from embedding.\n * @param url The URL to wrap.\n * @returns The formatted content.\n */\nexport function hideLinkEmbed(url: URL): `<${string}>`;\nexport function hideLinkEmbed(url: string | URL) {\n\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\treturn `<${url}>`;\n}\n\n/**\n * Formats the content and the URL into a masked URL.\n * @param content The content to display.\n * @param url The URL the content links to.\n * @returns The formatted content.\n */\nexport function hyperlink(content: C, url: URL): `[${C}](${string})`;\n\n/**\n * Formats the content and the URL into a masked URL.\n * @param content The content to display.\n * @param url The URL the content links to.\n * @returns The formatted content.\n */\nexport function hyperlink(content: C, url: U): `[${C}](${U})`;\n\n/**\n * Formats the content and the URL into a masked URL.\n * @param content The content to display.\n * @param url The URL the content links to.\n * @param title The title shown when hovering on the masked link.\n * @returns The formatted content.\n */\nexport function hyperlink(\n\tcontent: C,\n\turl: URL,\n\ttitle: T,\n): `[${C}](${string} \"${T}\")`;\n\n/**\n * Formats the content and the URL into a masked URL.\n * @param content The content to display.\n * @param url The URL the content links to.\n * @param title The title shown when hovering on the masked link.\n * @returns The formatted content.\n */\nexport function hyperlink(\n\tcontent: C,\n\turl: U,\n\ttitle: T,\n): `[${C}](${U} \"${T}\")`;\nexport function hyperlink(content: string, url: string | URL, title?: string) {\n\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\treturn title ? `[${content}](${url} \"${title}\")` : `[${content}](${url})`;\n}\n\n/**\n * Wraps the content inside spoiler (hidden text).\n * @param content The content to wrap.\n * @returns The formatted content.\n */\nexport function spoiler(content: C): `||${C}||` {\n\treturn `||${content}||`;\n}\n\n/**\n * Formats a user ID into a user mention.\n * @param userId The user ID to format.\n * @returns The formatted user mention.\n */\nexport function userMention(userId: C): `<@${C}>` {\n\treturn `<@${userId}>`;\n}\n\n/**\n * Formats a user ID into a member-nickname mention.\n * @param memberId The user ID to format.\n * @returns The formatted member-nickname mention.\n */\nexport function memberNicknameMention(memberId: C): `<@!${C}>` {\n\treturn `<@!${memberId}>`;\n}\n\n/**\n * Formats a channel ID into a channel mention.\n * @param channelId The channel ID to format.\n * @returns The formatted channel mention.\n */\nexport function channelMention(channelId: C): `<#${C}>` {\n\treturn `<#${channelId}>`;\n}\n\n/**\n * Formats a role ID into a role mention.\n * @param roleId The role ID to format.\n * @returns The formatted role mention.\n */\nexport function roleMention(roleId: C): `<@&${C}>` {\n\treturn `<@&${roleId}>`;\n}\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n * @param emojiId The emoji ID to format.\n * @returns The formatted emoji.\n */\nexport function formatEmoji(emojiId: C, animated?: false): `<:_:${C}>`;\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n * @param emojiId The emoji ID to format.\n * @param animated Whether the emoji is animated or not. Defaults to `false`\n * @returns The formatted emoji.\n */\nexport function formatEmoji(emojiId: C, animated?: true): ``;\n\n/**\n * Formats an emoji ID into a fully qualified emoji identifier\n * @param emojiId The emoji ID to format.\n * @param animated Whether the emoji is animated or not. Defaults to `false`\n * @returns The formatted emoji.\n */\nexport function formatEmoji(emojiId: C, animated = false): `` | `<:_:${C}>` {\n\treturn `<${animated ? 'a' : ''}:_:${emojiId}>`;\n}\n\n/**\n * Formats a date into a short date-time string.\n * @param date The date to format, defaults to the current time.\n */\nexport function time(date?: Date): ``;\n\n/**\n * Formats a date given a format style.\n * @param date The date to format.\n * @param style The style to use.\n */\nexport function time(date: Date, style: S): ``;\n\n/**\n * Formats the given timestamp into a short date-time string.\n * @param seconds The time to format, represents an UNIX timestamp in seconds.\n */\nexport function time(seconds: C): ``;\n\n/**\n * Formats the given timestamp into a short date-time string.\n * @param seconds The time to format, represents an UNIX timestamp in seconds.\n * @param style The style to use.\n */\nexport function time(seconds: C, style: S): ``;\nexport function time(timeOrSeconds?: number | Date, style?: TimestampStylesString): string {\n\tif (typeof timeOrSeconds !== 'number') {\n\t\ttimeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1000);\n\t}\n\n\treturn typeof style === 'string' ? `` : ``;\n}\n\n/**\n * The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord.\n */\nexport const TimestampStyles = {\n\t/**\n\t * Short time format, consisting of hours and minutes, e.g. 16:20.\n\t */\n\tShortTime: 't',\n\n\t/**\n\t * Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30.\n\t */\n\tLongTime: 'T',\n\n\t/**\n\t * Short date format, consisting of day, month, and year, e.g. 20/04/2021.\n\t */\n\tShortDate: 'd',\n\n\t/**\n\t * Long date format, consisting of day, month, and year, e.g. 20 April 2021.\n\t */\n\tLongDate: 'D',\n\n\t/**\n\t * Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20.\n\t */\n\tShortDateTime: 'f',\n\n\t/**\n\t * Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20.\n\t */\n\tLongDateTime: 'F',\n\n\t/**\n\t * Relative time format, consisting of a relative duration format, e.g. 2 months ago.\n\t */\n\tRelativeTime: 'R',\n} as const;\n\n/**\n * The possible values, see {@link TimestampStyles} for more information.\n */\nexport type TimestampStylesString = typeof TimestampStyles[keyof typeof TimestampStyles];\n\n/**\n * An enum with all the available faces from Discord's native slash commands\n */\nexport enum Faces {\n\t/**\n\t * ¯\\\\_(ツ)\\\\_/¯\n\t */\n\tShrug = '¯\\\\_(ツ)\\\\_/¯',\n\n\t/**\n\t * (╯°□°)╯︵ ┻━┻\n\t */\n\tTableflip = '(╯°□°)╯︵ ┻━┻',\n\n\t/**\n\t * ┬─┬ ノ( ゜-゜ノ)\n\t */\n\tUnflip = '┬─┬ ノ( ゜-゜ノ)',\n}\n"]} \ No newline at end of file diff --git a/node_modules/@discordjs/builders/package.json b/node_modules/@discordjs/builders/package.json new file mode 100644 index 0000000..f909c2e --- /dev/null +++ b/node_modules/@discordjs/builders/package.json @@ -0,0 +1,86 @@ +{ + "name": "@discordjs/builders", + "version": "0.5.0", + "description": "A set of builders that you can use when creating your bot.", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "exports": { + "require": "./dist/index.js", + "import": "./dist/index.mjs" + }, + "scripts": { + "prebuild": "npm run clean", + "build": "tsc && gen-esm-wrapper ./dist/index.js ./dist/index.mjs", + "clean": "rimraf dist", + "lint": "eslint --ext mjs,ts src/**/*.ts", + "lint:fix": "eslint --fix --ext mjs,ts src/**/*.ts", + "prepare": "is-ci || husky install", + "prepublishOnly": "npm run lint && npm run test", + "pretest": "npm run build", + "test": "jest", + "test:ci": "jest --verbose --no-stack-trace", + "release": "standard-version --preset angular" + }, + "repository": { + "type": "git", + "url": "https://github.com/discordjs/builders.git" + }, + "keywords": [ + "discord", + "api", + "bot", + "client", + "node", + "discordapp", + "discordjs" + ], + "author": "Vlad Frangu ", + "license": "Apache-2.0", + "files": [ + "dist" + ], + "bugs": { + "url": "https://github.com/discordjs/builders/issues" + }, + "homepage": "https://github.com/discordjs/builders#readme", + "dependencies": { + "@sindresorhus/is": "^4.0.1", + "discord-api-types": "^0.22.0", + "ow": "^0.27.0", + "ts-mixer": "^6.0.0", + "tslib": "^2.3.0" + }, + "devDependencies": { + "@babel/core": "^7.15.0", + "@babel/plugin-proposal-decorators": "^7.14.5", + "@babel/preset-env": "^7.15.0", + "@babel/preset-typescript": "^7.15.0", + "@commitlint/cli": "^13.1.0", + "@commitlint/config-angular": "^13.1.0", + "@types/jest": "^26.0.24", + "@types/node": "^16.4.12", + "@typescript-eslint/eslint-plugin": "^4.29.0", + "@typescript-eslint/parser": "^4.29.0", + "babel-jest": "^27.0.6", + "babel-plugin-transform-typescript-metadata": "^0.3.2", + "eslint": "^7.32.0", + "eslint-config-marine": "^9.0.6", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^3.4.0", + "gen-esm-wrapper": "^1.1.2", + "husky": "^7.0.1", + "is-ci": "^3.0.0", + "jest": "^27.0.6", + "lint-staged": "^11.1.1", + "npm-run-all": "^4.1.5", + "prettier": "^2.3.2", + "rimraf": "^3.0.2", + "standard-version": "^9.3.1", + "typescript": "^4.3.5" + }, + "engines": { + "node": ">=14.0.0", + "npm": ">=7.0.0" + } +} diff --git a/node_modules/@discordjs/collection/LICENSE b/node_modules/@discordjs/collection/LICENSE old mode 100755 new mode 100644 index 9997d13..414073d --- a/node_modules/@discordjs/collection/LICENSE +++ b/node_modules/@discordjs/collection/LICENSE @@ -175,7 +175,7 @@ END OF TERMS AND CONDITIONS - Copyright 2015 - 2020 Amish Shah + Copyright 2015 - 2021 Amish Shah Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/node_modules/@discordjs/collection/README.md b/node_modules/@discordjs/collection/README.md old mode 100755 new mode 100644 diff --git a/node_modules/@discordjs/collection/dist/index.d.ts b/node_modules/@discordjs/collection/dist/index.d.ts old mode 100755 new mode 100644 index a332396..3bcd3f8 --- a/node_modules/@discordjs/collection/dist/index.d.ts +++ b/node_modules/@discordjs/collection/dist/index.d.ts @@ -11,12 +11,9 @@ export interface CollectionConstructor { * @extends {Map} * @property {number} size - The amount of elements in this collection. */ -declare class Collection extends Map { - private _array; - private _keyArray; +export declare class Collection extends Map { static readonly default: typeof Collection; - ['constructor']: typeof Collection; - constructor(entries?: ReadonlyArray | null); + ['constructor']: CollectionConstructor; /** * Identical to [Map.get()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get). * Gets an element with the specified key, and returns its value, or `undefined` if the element does not exist. @@ -53,21 +50,17 @@ declare class Collection extends Map { */ clear(): void; /** - * Creates an ordered array of the values of this collection, and caches it internally. The array will only be - * reconstructed if an item is added to or removed from the collection, or if you change the length of the array - * itself. If you don't want this caching behavior, use `[...collection.values()]` or - * `Array.from(collection.values())` instead. - * @returns {Array} + * Checks if all of the elements exist in the collection. + * @param {...*} keys - The keys of the elements to check for + * @returns {boolean} `true` if all of the elements exist, `false` if at least one does not exist. */ - array(): V[]; + hasAll(...keys: K[]): boolean; /** - * Creates an ordered array of the keys of this collection, and caches it internally. The array will only be - * reconstructed if an item is added to or removed from the collection, or if you change the length of the array - * itself. If you don't want this caching behavior, use `[...collection.keys()]` or - * `Array.from(collection.keys())` instead. - * @returns {Array} + * Checks if any of the elements exist in the collection. + * @param {...*} keys - The keys of the elements to check for + * @returns {boolean} `true` if any of the elements exist, `false` if none exist. */ - keyArray(): K[]; + hasAny(...keys: K[]): boolean; /** * Obtains the first value(s) in this collection. * @param {number} [amount] Amount of values to obtain from the beginning @@ -85,8 +78,7 @@ declare class Collection extends Map { firstKey(): K | undefined; firstKey(amount: number): K[]; /** - * Obtains the last value(s) in this collection. This relies on {@link Collection#array}, and thus the caching - * mechanism applies here as well. + * Obtains the last value(s) in this collection. * @param {number} [amount] Amount of values to obtain from the end * @returns {*|Array<*>} A single value if no amount is provided or an array of values, starting from the start if * amount is negative @@ -94,8 +86,7 @@ declare class Collection extends Map { last(): V | undefined; last(amount: number): V[]; /** - * Obtains the last key(s) in this collection. This relies on {@link Collection#keyArray}, and thus the caching - * mechanism applies here as well. + * Obtains the last key(s) in this collection. * @param {number} [amount] Amount of keys to obtain from the end * @returns {*|Array<*>} A single key if no amount is provided or an array of keys, starting from the start if * amount is negative @@ -103,16 +94,14 @@ declare class Collection extends Map { lastKey(): K | undefined; lastKey(amount: number): K[]; /** - * Obtains unique random value(s) from this collection. This relies on {@link Collection#array}, and thus the caching - * mechanism applies here as well. + * Obtains unique random value(s) from this collection. * @param {number} [amount] Amount of values to obtain randomly * @returns {*|Array<*>} A single value if no amount is provided or an array of values */ random(): V; random(amount: number): V[]; /** - * Obtains unique random key(s) from this collection. This relies on {@link Collection#keyArray}, and thus the caching - * mechanism applies here as well. + * Obtains unique random key(s) from this collection. * @param {number} [amount] Amount of keys to obtain randomly * @returns {*|Array<*>} A single key if no amount is provided or an array */ @@ -129,8 +118,10 @@ declare class Collection extends Map { * @returns {*} * @example collection.find(user => user.username === 'Bob'); */ + find(fn: (value: V, key: K, collection: this) => value is V2): V2 | undefined; find(fn: (value: V, key: K, collection: this) => boolean): V | undefined; - find(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): V | undefined; + find(fn: (this: This, value: V, key: K, collection: this) => value is V2, thisArg: This): V2 | undefined; + find(fn: (this: This, value: V, key: K, collection: this) => boolean, thisArg: This): V | undefined; /** * Searches for the key of a single item where the given function returns a truthy value. This behaves like * [Array.findIndex()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex), @@ -140,8 +131,10 @@ declare class Collection extends Map { * @returns {*} * @example collection.findKey(user => user.username === 'Bob'); */ + findKey(fn: (value: V, key: K, collection: this) => key is K2): K2 | undefined; findKey(fn: (value: V, key: K, collection: this) => boolean): K | undefined; - findKey(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): K | undefined; + findKey(fn: (this: This, value: V, key: K, collection: this) => key is K2, thisArg: This): K2 | undefined; + findKey(fn: (this: This, value: V, key: K, collection: this) => boolean, thisArg: This): K | undefined; /** * Removes items that satisfy the provided filter function. * @param {Function} fn Function used to test (should return a boolean) @@ -159,8 +152,12 @@ declare class Collection extends Map { * @returns {Collection} * @example collection.filter(user => user.username === 'Bob'); */ - filter(fn: (value: V, key: K, collection: this) => boolean): this; - filter(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): this; + filter(fn: (value: V, key: K, collection: this) => key is K2): Collection; + filter(fn: (value: V, key: K, collection: this) => value is V2): Collection; + filter(fn: (value: V, key: K, collection: this) => boolean): Collection; + filter(fn: (this: This, value: V, key: K, collection: this) => key is K2, thisArg: This): Collection; + filter(fn: (this: This, value: V, key: K, collection: this) => value is V2, thisArg: This): Collection; + filter(fn: (this: This, value: V, key: K, collection: this) => boolean, thisArg: This): Collection; /** * Partitions the collection into two collections where the first collection * contains the items that passed and the second contains the items that failed. @@ -169,8 +166,12 @@ declare class Collection extends Map { * @returns {Collection[]} * @example const [big, small] = collection.partition(guild => guild.memberCount > 250); */ - partition(fn: (value: V, key: K, collection: this) => boolean): [this, this]; - partition(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): [this, this]; + partition(fn: (value: V, key: K, collection: this) => key is K2): [Collection, Collection, V>]; + partition(fn: (value: V, key: K, collection: this) => value is V2): [Collection, Collection>]; + partition(fn: (value: V, key: K, collection: this) => boolean): [Collection, Collection]; + partition(fn: (this: This, value: V, key: K, collection: this) => key is K2, thisArg: This): [Collection, Collection, V>]; + partition(fn: (this: This, value: V, key: K, collection: this) => value is V2, thisArg: This): [Collection, Collection>]; + partition(fn: (this: This, value: V, key: K, collection: this) => boolean, thisArg: This): [Collection, Collection]; /** * Maps each item into a Collection, then joins the results into a single Collection. Identical in behavior to * [Array.flatMap()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap). @@ -219,8 +220,12 @@ declare class Collection extends Map { * @returns {boolean} * @example collection.every(user => !user.bot); */ + every(fn: (value: V, key: K, collection: this) => key is K2): this is Collection; + every(fn: (value: V, key: K, collection: this) => value is V2): this is Collection; every(fn: (value: V, key: K, collection: this) => boolean): boolean; - every(fn: (this: T, value: V, key: K, collection: this) => boolean, thisArg: T): boolean; + every(fn: (this: This, value: V, key: K, collection: this) => key is K2, thisArg: This): this is Collection; + every(fn: (this: This, value: V, key: K, collection: this) => value is V2, thisArg: This): this is Collection; + every(fn: (this: This, value: V, key: K, collection: this) => boolean, thisArg: This): boolean; /** * Applies a function to produce a single value. Identical in behavior to * [Array.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce). @@ -264,14 +269,14 @@ declare class Collection extends Map { * @returns {Collection} * @example const newColl = someColl.clone(); */ - clone(): this; + clone(): Collection; /** * Combines this collection with others into a new collection. None of the source collections are modified. * @param {...Collection} collections Collections to merge * @returns {Collection} * @example const newColl = someColl.concat(someOtherColl, anotherColl, ohBoyAColl); */ - concat(...collections: Collection[]): this; + concat(...collections: Collection[]): Collection; /** * Checks if this collection shares identical items with another. * This is different to checking for equality using equal-signs, because @@ -290,7 +295,7 @@ declare class Collection extends Map { * @returns {Collection} * @example collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp); */ - sort(compareFunction?: (firstValue: V, secondValue: V, firstKey: K, secondKey: K) => number): this; + sort(compareFunction?: Comparator): this; /** * The intersect method returns a new structure containing items where the keys are present in both original structures. * @param {Collection} other The other Collection to filter against @@ -313,7 +318,9 @@ declare class Collection extends Map { * @returns {Collection} * @example collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp); */ - sorted(compareFunction?: (firstValue: V, secondValue: V, firstKey: K, secondKey: K) => number): this; + sorted(compareFunction?: Comparator): Collection; + toJSON(): V[]; + private static defaultSort; } -export { Collection }; +export declare type Comparator = (firstValue: V, secondValue: V, firstKey: K, secondKey: K) => number; export default Collection; diff --git a/node_modules/@discordjs/collection/dist/index.js b/node_modules/@discordjs/collection/dist/index.js old mode 100755 new mode 100644 index 8c47cfd..e730c30 --- a/node_modules/@discordjs/collection/dist/index.js +++ b/node_modules/@discordjs/collection/dist/index.js @@ -8,23 +8,6 @@ exports.Collection = void 0; * @property {number} size - The amount of elements in this collection. */ class Collection extends Map { - constructor(entries) { - super(entries); - /** - * Cached array for the `array()` method - will be reset to `null` whenever `set()` or `delete()` are called - * @name Collection#_array - * @type {?Array} - * @private - */ - Object.defineProperty(this, '_array', { value: null, writable: true, configurable: true }); - /** - * Cached array for the `keyArray()` method - will be reset to `null` whenever `set()` or `delete()` are called - * @name Collection#_keyArray - * @type {?Array} - * @private - */ - Object.defineProperty(this, '_keyArray', { value: null, writable: true, configurable: true }); - } /** * Identical to [Map.get()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get). * Gets an element with the specified key, and returns its value, or `undefined` if the element does not exist. @@ -42,8 +25,6 @@ class Collection extends Map { * @returns {Collection} */ set(key, value) { - this._array = null; - this._keyArray = null; return super.set(key, value); } /** @@ -62,8 +43,6 @@ class Collection extends Map { * @returns {boolean} `true` if the element was removed, `false` if the element does not exist. */ delete(key) { - this._array = null; - this._keyArray = null; return super.delete(key); } /** @@ -75,28 +54,20 @@ class Collection extends Map { return super.clear(); } /** - * Creates an ordered array of the values of this collection, and caches it internally. The array will only be - * reconstructed if an item is added to or removed from the collection, or if you change the length of the array - * itself. If you don't want this caching behavior, use `[...collection.values()]` or - * `Array.from(collection.values())` instead. - * @returns {Array} + * Checks if all of the elements exist in the collection. + * @param {...*} keys - The keys of the elements to check for + * @returns {boolean} `true` if all of the elements exist, `false` if at least one does not exist. */ - array() { - if (!this._array || this._array.length !== this.size) - this._array = [...this.values()]; - return this._array; + hasAll(...keys) { + return keys.every((k) => super.has(k)); } /** - * Creates an ordered array of the keys of this collection, and caches it internally. The array will only be - * reconstructed if an item is added to or removed from the collection, or if you change the length of the array - * itself. If you don't want this caching behavior, use `[...collection.keys()]` or - * `Array.from(collection.keys())` instead. - * @returns {Array} + * Checks if any of the elements exist in the collection. + * @param {...*} keys - The keys of the elements to check for + * @returns {boolean} `true` if any of the elements exist, `false` if none exist. */ - keyArray() { - if (!this._keyArray || this._keyArray.length !== this.size) - this._keyArray = [...this.keys()]; - return this._keyArray; + hasAny(...keys) { + return keys.some((k) => super.has(k)); } first(amount) { if (typeof amount === 'undefined') @@ -117,7 +88,7 @@ class Collection extends Map { return Array.from({ length: amount }, () => iter.next().value); } last(amount) { - const arr = this.array(); + const arr = [...this.values()]; if (typeof amount === 'undefined') return arr[arr.length - 1]; if (amount < 0) @@ -127,7 +98,7 @@ class Collection extends Map { return arr.slice(-amount); } lastKey(amount) { - const arr = this.keyArray(); + const arr = [...this.keys()]; if (typeof amount === 'undefined') return arr[arr.length - 1]; if (amount < 0) @@ -137,22 +108,20 @@ class Collection extends Map { return arr.slice(-amount); } random(amount) { - let arr = this.array(); + const arr = [...this.values()]; if (typeof amount === 'undefined') return arr[Math.floor(Math.random() * arr.length)]; - if (arr.length === 0 || !amount) + if (!arr.length || !amount) return []; - arr = arr.slice(); - return Array.from({ length: amount }, () => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]); + return Array.from({ length: Math.min(amount, arr.length) }, () => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]); } randomKey(amount) { - let arr = this.keyArray(); + const arr = [...this.keys()]; if (typeof amount === 'undefined') return arr[Math.floor(Math.random() * arr.length)]; - if (arr.length === 0 || !amount) + if (!arr.length || !amount) return []; - arr = arr.slice(); - return Array.from({ length: amount }, () => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]); + return Array.from({ length: Math.min(amount, arr.length) }, () => arr.splice(Math.floor(Math.random() * arr.length), 1)[0]); } find(fn, thisArg) { if (typeof thisArg !== 'undefined') @@ -195,8 +164,10 @@ class Collection extends Map { partition(fn, thisArg) { if (typeof thisArg !== 'undefined') fn = fn.bind(thisArg); - // TODO: consider removing the from the constructors after TS 3.7.0 is released, as it infers it - const results = [new this.constructor[Symbol.species](), new this.constructor[Symbol.species]()]; + const results = [ + new this.constructor[Symbol.species](), + new this.constructor[Symbol.species](), + ]; for (const [key, val] of this) { if (fn(val, key, this)) { results[0].set(key, val); @@ -318,8 +289,9 @@ class Collection extends Map { * @returns {boolean} Whether the collections have identical contents */ equals(collection) { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition if (!collection) - return false; + return false; // runtime check if (this === collection) return true; if (this.size !== collection.size) @@ -341,13 +313,11 @@ class Collection extends Map { * @returns {Collection} * @example collection.sort((userA, userB) => userA.createdTimestamp - userB.createdTimestamp); */ - sort(compareFunction = (x, y) => Number(x > y) || Number(x === y) - 1) { + sort(compareFunction = Collection.defaultSort) { const entries = [...this.entries()]; entries.sort((a, b) => compareFunction(a[1], b[1], a[0], b[0])); // Perform clean-up super.clear(); - this._array = null; - this._keyArray = null; // Set the new entries for (const [k, v] of entries) { super.set(k, v); @@ -360,7 +330,12 @@ class Collection extends Map { * @returns {Collection} */ intersect(other) { - return other.filter((_, k) => this.has(k)); + const coll = new this.constructor[Symbol.species](); + for (const [k, v] of other) { + if (this.has(k)) + coll.set(k, v); + } + return coll; } /** * The difference method returns a new structure containing items where the key is present in one of the original structures but not the other. @@ -368,7 +343,16 @@ class Collection extends Map { * @returns {Collection} */ difference(other) { - return other.filter((_, k) => !this.has(k)).concat(this.filter((_, k) => !other.has(k))); + const coll = new this.constructor[Symbol.species](); + for (const [k, v] of other) { + if (!this.has(k)) + coll.set(k, v); + } + for (const [k, v] of this) { + if (!other.has(k)) + coll.set(k, v); + } + return coll; } /** * The sorted method sorts the items of a collection and returns it. @@ -380,13 +364,18 @@ class Collection extends Map { * @returns {Collection} * @example collection.sorted((userA, userB) => userA.createdTimestamp - userB.createdTimestamp); */ - sorted(compareFunction = (x, y) => Number(x > y) || Number(x === y) - 1) { - return new this.constructor[Symbol.species]([...this.entries()]) - .sort((av, bv, ak, bk) => compareFunction(av, bv, ak, bk)); + sorted(compareFunction = Collection.defaultSort) { + return new this.constructor[Symbol.species](this).sort((av, bv, ak, bk) => compareFunction(av, bv, ak, bk)); + } + toJSON() { + // toJSON is called recursively by JSON.stringify. + return [...this.values()]; + } + static defaultSort(firstValue, secondValue) { + return Number(firstValue > secondValue) || Number(firstValue === secondValue) - 1; } } exports.Collection = Collection; Collection.default = Collection; -module.exports = Collection; exports.default = Collection; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiLyIsInNvdXJjZXMiOlsiaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXB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hdG9yPEssIFY+ID0gKGZpcnN0VmFsdWU6IFYsIHNlY29uZFZhbHVlOiBWLCBmaXJzdEtleTogSywgc2Vjb25kS2V5OiBLKSA9PiBudW1iZXI7XG5cbmV4cG9ydCBkZWZhdWx0IENvbGxlY3Rpb247XG4iXX0= \ No newline at end of file diff --git a/node_modules/@discordjs/collection/package.json b/node_modules/@discordjs/collection/package.json old mode 100755 new mode 100644 index 84358ab..f1151bb --- a/node_modules/@discordjs/collection/package.json +++ b/node_modules/@discordjs/collection/package.json @@ -1,78 +1,105 @@ { - "_from": "@discordjs/collection@^0.1.6", - "_id": "@discordjs/collection@0.1.6", - "_inBundle": false, - "_integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ==", - "_location": "/@discordjs/collection", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "@discordjs/collection@^0.1.6", - "name": "@discordjs/collection", - "escapedName": "@discordjs%2fcollection", - "scope": "@discordjs", - "rawSpec": "^0.1.6", - "saveSpec": null, - "fetchSpec": "^0.1.6" - }, - "_requiredBy": [ - "/discord.js" - ], - "_resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz", - "_shasum": "9e9a7637f4e4e0688fd8b2b5c63133c91607682c", - "_spec": "@discordjs/collection@^0.1.6", - "_where": "D:\\Users\\henri\\Desktop\\TestHabana\\node_modules\\discord.js", - "author": { - "name": "Amish Shah", - "email": "amishshah.2k@gmail.com" - }, - "bugs": { - "url": "https://github.com/discordjs/collection/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Utility data structure used in Discord.js", - "devDependencies": { - "@babel/cli": "^7.8.4", - "@babel/core": "^7.8.4", - "@babel/preset-env": "^7.8.4", - "@babel/preset-typescript": "^7.8.3", - "@types/node": "^13.7.4", - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "discord.js-docgen": "github:discordjs/docgen#ts-patch", - "eslint": "^6.8.0", - "eslint-config-marine": "^6.0.0", - "jsdoc-babel": "^0.5.0", - "rimraf": "^3.0.2", - "typescript": "^3.8.2" - }, - "eslintConfig": { - "extends": "marine/node" - }, - "homepage": "https://github.com/discordjs/collection#readme", - "keywords": [ - "map", - "collection", - "utility" - ], - "license": "Apache-2.0", - "main": "dist/index.js", - "name": "@discordjs/collection", - "repository": { - "type": "git", - "url": "git+https://github.com/discordjs/collection.git" - }, - "scripts": { - "build": "rimraf dist/ && tsc", - "docs": "docgen --jsdoc jsdoc.json --source src/*.ts src/**/*.ts --custom docs/index.yml --output docs/docs.json", - "docs:test": "docgen --jsdoc jsdoc.json --source src/*.ts src/**/*.ts --custom docs/index.yml", - "lint": "eslint src --ext .ts", - "prebuild": "npm run lint", - "pretest": "npm run build", - "test": "node test/index.js" - }, - "types": "dist/index.d.ts", - "version": "0.1.6" + "name": "@discordjs/collection", + "version": "0.2.1", + "description": "Utility data structure used in Discord.js", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "lint": "eslint test src --ext .ts", + "lint:fix": "eslint test src --ext .ts --fix", + "prebuild": "npm run lint", + "build": "rimraf dist/ && tsc", + "pretest": "npm run build", + "test": "jest", + "docs": "docgen --jsdoc jsdoc.json --source src/*.ts src/**/*.ts --custom docs/index.yml --output docs/docs.json", + "docs:test": "docgen --jsdoc jsdoc.json --source src/*.ts src/**/*.ts --custom docs/index.yml" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/discordjs/collection.git" + }, + "keywords": [ + "map", + "collection", + "utility" + ], + "files": [ + "!**/*.ts", + "**/*.d.ts", + "!package-lock.json" + ], + "author": "Amish Shah ", + "license": "Apache-2.0", + "bugs": { + "url": "https://github.com/discordjs/collection/issues" + }, + "homepage": "https://github.com/discordjs/collection#readme", + "engines": { + "node": ">=14.0.0" + }, + "devDependencies": { + "@babel/cli": "^7.14.8", + "@babel/core": "^7.14.8", + "@babel/preset-env": "^7.14.8", + "@babel/preset-typescript": "^7.14.5", + "@commitlint/cli": "^13.1.0", + "@commitlint/config-angular": "^13.1.0", + "@types/jest": "^26.0.24", + "@types/node": "^16.4.8", + "@typescript-eslint/eslint-plugin": "^4.28.5", + "@typescript-eslint/parser": "^4.28.5", + "discord.js-docgen": "discordjs/docgen#ts-patch", + "eslint": "^7.32.0", + "eslint-config-marine": "^9.0.6", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-prettier": "^3.4.0", + "husky": "^4.3.7", + "jest": "^27.0.6", + "jsdoc-babel": "^0.5.0", + "lint-staged": "^11.1.1", + "prettier": "^2.3.2", + "rimraf": "^3.0.2", + "typescript": "^4.3.5" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged", + "commit-msg": "commitlint -E HUSKY_GIT_PARAMS" + } + }, + "lint-staged": { + "*.{ts,js}": [ + "eslint --fix" + ], + "*.{json,yml,yaml}": [ + "prettier --write" + ] + }, + "commitlint": { + "extends": [ + "@commitlint/config-angular" + ], + "rules": { + "type-enum": [ + 2, + "always", + [ + "chore", + "build", + "ci", + "docs", + "feat", + "fix", + "perf", + "refactor", + "revert", + "style", + "test", + "types", + "wip", + "src" + ] + ] + } + } } diff --git a/node_modules/@sapphire/async-queue/LICENSE.md b/node_modules/@sapphire/async-queue/LICENSE.md new file mode 100644 index 0000000..685eb3a --- /dev/null +++ b/node_modules/@sapphire/async-queue/LICENSE.md @@ -0,0 +1,24 @@ +# The MIT License (MIT) + +Copyright © `2020` `The Sapphire Community and its 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/node_modules/@sapphire/async-queue/README.md b/node_modules/@sapphire/async-queue/README.md new file mode 100644 index 0000000..06cc286 --- /dev/null +++ b/node_modules/@sapphire/async-queue/README.md @@ -0,0 +1,95 @@ +
+ +![Sapphire Logo](https://cdn.skyra.pw/gh-assets/sapphire-banner.png) + +# @sapphire/async-queue + +**Sequential asynchronous lock-based queue for promises.** + +[![GitHub](https://img.shields.io/github/license/sapphiredev/utilities)](https://github.com/sapphiredev/utilities/blob/main/LICENSE.md) +[![codecov](https://codecov.io/gh/sapphiredev/utilities/branch/main/graph/badge.svg?token=OEGIV6RFDO)](https://codecov.io/gh/sapphiredev/utilities) +[![npm bundle size](https://img.shields.io/bundlephobia/min/@sapphire/async-queue?logo=webpack&style=flat-square)](https://bundlephobia.com/result?p=@sapphire/async-queue) +[![npm](https://img.shields.io/npm/v/@sapphire/async-queue?color=crimson&logo=npm&style=flat-square)](https://www.npmjs.com/package/@sapphire/async-queue) +[![Depfu](https://badges.depfu.com/badges/ec42ff3d6bae55eee1de4749960852b3/count.svg)](https://depfu.com/github/sapphiredev/utilities?project_id=15195) + +
+ +## Description + +Ever needed a queue for a set of promises? This is the package for you. + +## Features + +- Written in TypeScript +- Bundled with Rollup so it can be used in NodeJS and browsers +- Offers CommonJS, ESM and UMD bundles +- Fully tested + +## Installation + +You can use the following command to install this package, or replace `npm install` with your package manager of choice. + +```sh +npm install @sapphire/async-queue +``` + +--- + +## API Documentation + +For the full API documentation please refer to the TypeDoc generated [documentation](https://sapphiredev.github.io/utilities/modules/_sapphire_async_queue.html). + +## Buy us some doughnuts + +Sapphire Community is and always will be open source, even if we don't get donations. That being said, we know there are amazing people who may still want to donate just to show their appreciation. Thank you very much in advance! + +We accept donations through Open Collective, Ko-fi, PayPal, Patreon and GitHub Sponsorships. You can use the buttons below to donate through your method of choice. + +| Donate With | Address | +| :-------------: | :-------------------------------------------------: | +| Open Collective | [Click Here](https://sapphirejs.dev/opencollective) | +| Ko-fi | [Click Here](https://sapphirejs.dev/kofi) | +| Patreon | [Click Here](https://sapphirejs.dev/patreon) | +| PayPal | [Click Here](https://sapphirejs.dev/paypal) | + +## Contributors ✨ + +Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Jeroen Claassens

💻 🚇 📆 📖 ⚠️

Antonio Román

💻 📆 👀 ⚠️

Gryffon Bellish

💻 👀 ⚠️

Vlad Frangu

💻 🐛 👀 📓 ⚠️

Soumil07

💻 📆 ⚠️

depfu[bot]

🚧

allcontributors[bot]

📖

Tyler J Russell

📖

Ivan Lieder

💻 🐛

Hezekiah Hendry

💻

Stitch07

💻 ⚠️

Vetlix

💻

Ethan Mitchell

📖

Elliot

💻

Jurien Hamaker

💻

Charalampos Fanoulis

📖

dependabot[bot]

🚧

Kaname

💻

nandhagk

🐛
+ + + + + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! diff --git a/node_modules/@sapphire/async-queue/dist/index.d.ts b/node_modules/@sapphire/async-queue/dist/index.d.ts new file mode 100644 index 0000000..5230846 --- /dev/null +++ b/node_modules/@sapphire/async-queue/dist/index.d.ts @@ -0,0 +1,2 @@ +export * from './lib/AsyncQueue'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/@sapphire/async-queue/dist/index.d.ts.map b/node_modules/@sapphire/async-queue/dist/index.d.ts.map new file mode 100644 index 0000000..c55e43f --- /dev/null +++ b/node_modules/@sapphire/async-queue/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"} \ No newline at end of file diff --git a/node_modules/@sapphire/async-queue/dist/index.js b/node_modules/@sapphire/async-queue/dist/index.js new file mode 100644 index 0000000..ee43a21 --- /dev/null +++ b/node_modules/@sapphire/async-queue/dist/index.js @@ -0,0 +1,70 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +/** + * The AsyncQueue class used to sequentialize burst requests + */ +class AsyncQueue { + constructor() { + /** + * The promises array + */ + Object.defineProperty(this, "promises", { + enumerable: true, + configurable: true, + writable: true, + value: [] + }); + } + /** + * The remaining amount of queued promises + */ + get remaining() { + return this.promises.length; + } + /** + * Waits for last promise and queues a new one + * @example + * ``` + * const queue = new AsyncQueue(); + * async function request(url, options) { + * await queue.wait(); + * try { + * const result = await fetch(url, options); + * // Do some operations with 'result' + * } finally { + * // Remove first entry from the queue and resolve for the next entry + * queue.shift(); + * } + * } + * + * request(someUrl1, someOptions1); // Will call fetch() immediately + * request(someUrl2, someOptions2); // Will call fetch() after the first finished + * request(someUrl3, someOptions3); // Will call fetch() after the second finished + * ``` + */ + wait() { + const next = this.promises.length ? this.promises[this.promises.length - 1].promise : Promise.resolve(); + let resolve; + const promise = new Promise((res) => { + resolve = res; + }); + this.promises.push({ + resolve: resolve, + promise + }); + return next; + } + /** + * Frees the queue's lock for the next item to process + */ + shift() { + const deferred = this.promises.shift(); + if (typeof deferred !== 'undefined') + deferred.resolve(); + } +} + +exports.AsyncQueue = AsyncQueue; +//# sourceMappingURL=index.js.map diff --git a/node_modules/@sapphire/async-queue/dist/index.js.map b/node_modules/@sapphire/async-queue/dist/index.js.map new file mode 100644 index 0000000..b470eda --- /dev/null +++ b/node_modules/@sapphire/async-queue/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/lib/AsyncQueue.ts"],"sourcesContent":["/**\n * The AsyncQueue class used to sequentialize burst requests\n */\nexport class AsyncQueue {\n\t/**\n\t * The remaining amount of queued promises\n\t */\n\tpublic get remaining(): number {\n\t\treturn this.promises.length;\n\t}\n\n\t/**\n\t * The promises array\n\t */\n\tprivate promises: InternalAsyncQueueDeferredPromise[] = [];\n\n\t/**\n\t * Waits for last promise and queues a new one\n\t * @example\n\t * ```\n\t * const queue = new AsyncQueue();\n\t * async function request(url, options) {\n\t * await queue.wait();\n\t * try {\n\t * const result = await fetch(url, options);\n\t * // Do some operations with 'result'\n\t * } finally {\n\t * // Remove first entry from the queue and resolve for the next entry\n\t * queue.shift();\n\t * }\n\t * }\n\t *\n\t * request(someUrl1, someOptions1); // Will call fetch() immediately\n\t * request(someUrl2, someOptions2); // Will call fetch() after the first finished\n\t * request(someUrl3, someOptions3); // Will call fetch() after the second finished\n\t * ```\n\t */\n\tpublic wait(): Promise {\n\t\tconst next = this.promises.length ? this.promises[this.promises.length - 1].promise : Promise.resolve();\n\t\tlet resolve: () => void;\n\t\tconst promise = new Promise((res) => {\n\t\t\tresolve = res;\n\t\t});\n\n\t\tthis.promises.push({\n\t\t\tresolve: resolve!,\n\t\t\tpromise\n\t\t});\n\n\t\treturn next;\n\t}\n\n\t/**\n\t * Frees the queue's lock for the next item to process\n\t */\n\tpublic shift(): void {\n\t\tconst deferred = this.promises.shift();\n\t\tif (typeof deferred !== 'undefined') deferred.resolve();\n\t}\n}\n\n/**\n * @internal\n */\ninterface InternalAsyncQueueDeferredPromise {\n\tresolve(): void;\n\tpromise: Promise;\n}\n"],"names":[],"mappings":";;;;AAAA;;;MAGa,UAAU;IAAvB;;;;QAWC;;;;mBAAwD,EAAE;WAAC;KA6C3D;;;;IApDA,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;KAC5B;;;;;;;;;;;;;;;;;;;;;;IA4BM,IAAI;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;QACxG,IAAI,OAAmB,CAAC;QACxB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,GAAG;YACrC,OAAO,GAAG,GAAG,CAAC;SACd,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YAClB,OAAO,EAAE,OAAQ;YACjB,OAAO;SACP,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;KACZ;;;;IAKM,KAAK;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACvC,IAAI,OAAO,QAAQ,KAAK,WAAW;YAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;KACxD;;;;;"} \ No newline at end of file diff --git a/node_modules/@sapphire/async-queue/dist/index.mjs b/node_modules/@sapphire/async-queue/dist/index.mjs new file mode 100644 index 0000000..c46365e --- /dev/null +++ b/node_modules/@sapphire/async-queue/dist/index.mjs @@ -0,0 +1,66 @@ +/** + * The AsyncQueue class used to sequentialize burst requests + */ +class AsyncQueue { + constructor() { + /** + * The promises array + */ + Object.defineProperty(this, "promises", { + enumerable: true, + configurable: true, + writable: true, + value: [] + }); + } + /** + * The remaining amount of queued promises + */ + get remaining() { + return this.promises.length; + } + /** + * Waits for last promise and queues a new one + * @example + * ``` + * const queue = new AsyncQueue(); + * async function request(url, options) { + * await queue.wait(); + * try { + * const result = await fetch(url, options); + * // Do some operations with 'result' + * } finally { + * // Remove first entry from the queue and resolve for the next entry + * queue.shift(); + * } + * } + * + * request(someUrl1, someOptions1); // Will call fetch() immediately + * request(someUrl2, someOptions2); // Will call fetch() after the first finished + * request(someUrl3, someOptions3); // Will call fetch() after the second finished + * ``` + */ + wait() { + const next = this.promises.length ? this.promises[this.promises.length - 1].promise : Promise.resolve(); + let resolve; + const promise = new Promise((res) => { + resolve = res; + }); + this.promises.push({ + resolve: resolve, + promise + }); + return next; + } + /** + * Frees the queue's lock for the next item to process + */ + shift() { + const deferred = this.promises.shift(); + if (typeof deferred !== 'undefined') + deferred.resolve(); + } +} + +export { AsyncQueue }; +//# sourceMappingURL=index.mjs.map diff --git a/node_modules/@sapphire/async-queue/dist/index.mjs.map b/node_modules/@sapphire/async-queue/dist/index.mjs.map new file mode 100644 index 0000000..b629a5d --- /dev/null +++ b/node_modules/@sapphire/async-queue/dist/index.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.mjs","sources":["../src/lib/AsyncQueue.ts"],"sourcesContent":["/**\n * The AsyncQueue class used to sequentialize burst requests\n */\nexport class AsyncQueue {\n\t/**\n\t * The remaining amount of queued promises\n\t */\n\tpublic get remaining(): number {\n\t\treturn this.promises.length;\n\t}\n\n\t/**\n\t * The promises array\n\t */\n\tprivate promises: InternalAsyncQueueDeferredPromise[] = [];\n\n\t/**\n\t * Waits for last promise and queues a new one\n\t * @example\n\t * ```\n\t * const queue = new AsyncQueue();\n\t * async function request(url, options) {\n\t * await queue.wait();\n\t * try {\n\t * const result = await fetch(url, options);\n\t * // Do some operations with 'result'\n\t * } finally {\n\t * // Remove first entry from the queue and resolve for the next entry\n\t * queue.shift();\n\t * }\n\t * }\n\t *\n\t * request(someUrl1, someOptions1); // Will call fetch() immediately\n\t * request(someUrl2, someOptions2); // Will call fetch() after the first finished\n\t * request(someUrl3, someOptions3); // Will call fetch() after the second finished\n\t * ```\n\t */\n\tpublic wait(): Promise {\n\t\tconst next = this.promises.length ? this.promises[this.promises.length - 1].promise : Promise.resolve();\n\t\tlet resolve: () => void;\n\t\tconst promise = new Promise((res) => {\n\t\t\tresolve = res;\n\t\t});\n\n\t\tthis.promises.push({\n\t\t\tresolve: resolve!,\n\t\t\tpromise\n\t\t});\n\n\t\treturn next;\n\t}\n\n\t/**\n\t * Frees the queue's lock for the next item to process\n\t */\n\tpublic shift(): void {\n\t\tconst deferred = this.promises.shift();\n\t\tif (typeof deferred !== 'undefined') deferred.resolve();\n\t}\n}\n\n/**\n * @internal\n */\ninterface InternalAsyncQueueDeferredPromise {\n\tresolve(): void;\n\tpromise: Promise;\n}\n"],"names":[],"mappings":"AAAA;;;MAGa,UAAU;IAAvB;;;;QAWC;;;;mBAAwD,EAAE;WAAC;KA6C3D;;;;IApDA,IAAW,SAAS;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;KAC5B;;;;;;;;;;;;;;;;;;;;;;IA4BM,IAAI;QACV,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;QACxG,IAAI,OAAmB,CAAC;QACxB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,GAAG;YACrC,OAAO,GAAG,GAAG,CAAC;SACd,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YAClB,OAAO,EAAE,OAAQ;YACjB,OAAO;SACP,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;KACZ;;;;IAKM,KAAK;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACvC,IAAI,OAAO,QAAQ,KAAK,WAAW;YAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;KACxD;;;;;"} \ No newline at end of file diff --git a/node_modules/@sapphire/async-queue/dist/index.umd.js b/node_modules/@sapphire/async-queue/dist/index.umd.js new file mode 100644 index 0000000..3da3cd8 --- /dev/null +++ b/node_modules/@sapphire/async-queue/dist/index.umd.js @@ -0,0 +1,76 @@ +(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.SapphireAsyncQueue = {})); +}(this, (function (exports) { 'use strict'; + + /** + * The AsyncQueue class used to sequentialize burst requests + */ + class AsyncQueue { + constructor() { + /** + * The promises array + */ + Object.defineProperty(this, "promises", { + enumerable: true, + configurable: true, + writable: true, + value: [] + }); + } + /** + * The remaining amount of queued promises + */ + get remaining() { + return this.promises.length; + } + /** + * Waits for last promise and queues a new one + * @example + * ``` + * const queue = new AsyncQueue(); + * async function request(url, options) { + * await queue.wait(); + * try { + * const result = await fetch(url, options); + * // Do some operations with 'result' + * } finally { + * // Remove first entry from the queue and resolve for the next entry + * queue.shift(); + * } + * } + * + * request(someUrl1, someOptions1); // Will call fetch() immediately + * request(someUrl2, someOptions2); // Will call fetch() after the first finished + * request(someUrl3, someOptions3); // Will call fetch() after the second finished + * ``` + */ + wait() { + const next = this.promises.length ? this.promises[this.promises.length - 1].promise : Promise.resolve(); + let resolve; + const promise = new Promise((res) => { + resolve = res; + }); + this.promises.push({ + resolve: resolve, + promise + }); + return next; + } + /** + * Frees the queue's lock for the next item to process + */ + shift() { + const deferred = this.promises.shift(); + if (typeof deferred !== 'undefined') + deferred.resolve(); + } + } + + exports.AsyncQueue = AsyncQueue; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=index.umd.js.map diff --git a/node_modules/@sapphire/async-queue/dist/index.umd.js.map b/node_modules/@sapphire/async-queue/dist/index.umd.js.map new file mode 100644 index 0000000..0485efb --- /dev/null +++ b/node_modules/@sapphire/async-queue/dist/index.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.umd.js","sources":["../src/lib/AsyncQueue.ts"],"sourcesContent":["/**\n * The AsyncQueue class used to sequentialize burst requests\n */\nexport class AsyncQueue {\n\t/**\n\t * The remaining amount of queued promises\n\t */\n\tpublic get remaining(): number {\n\t\treturn this.promises.length;\n\t}\n\n\t/**\n\t * The promises array\n\t */\n\tprivate promises: InternalAsyncQueueDeferredPromise[] = [];\n\n\t/**\n\t * Waits for last promise and queues a new one\n\t * @example\n\t * ```\n\t * const queue = new AsyncQueue();\n\t * async function request(url, options) {\n\t * await queue.wait();\n\t * try {\n\t * const result = await fetch(url, options);\n\t * // Do some operations with 'result'\n\t * } finally {\n\t * // Remove first entry from the queue and resolve for the next entry\n\t * queue.shift();\n\t * }\n\t * }\n\t *\n\t * request(someUrl1, someOptions1); // Will call fetch() immediately\n\t * request(someUrl2, someOptions2); // Will call fetch() after the first finished\n\t * request(someUrl3, someOptions3); // Will call fetch() after the second finished\n\t * ```\n\t */\n\tpublic wait(): Promise {\n\t\tconst next = this.promises.length ? this.promises[this.promises.length - 1].promise : Promise.resolve();\n\t\tlet resolve: () => void;\n\t\tconst promise = new Promise((res) => {\n\t\t\tresolve = res;\n\t\t});\n\n\t\tthis.promises.push({\n\t\t\tresolve: resolve!,\n\t\t\tpromise\n\t\t});\n\n\t\treturn next;\n\t}\n\n\t/**\n\t * Frees the queue's lock for the next item to process\n\t */\n\tpublic shift(): void {\n\t\tconst deferred = this.promises.shift();\n\t\tif (typeof deferred !== 'undefined') deferred.resolve();\n\t}\n}\n\n/**\n * @internal\n */\ninterface InternalAsyncQueueDeferredPromise {\n\tresolve(): void;\n\tpromise: Promise;\n}\n"],"names":[],"mappings":";;;;;;CAAA;;;OAGa,UAAU;KAAvB;;;;SAWC;;;;oBAAwD,EAAE;YAAC;MA6C3D;;;;KApDA,IAAW,SAAS;SACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;MAC5B;;;;;;;;;;;;;;;;;;;;;;KA4BM,IAAI;SACV,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;SACxG,IAAI,OAAmB,CAAC;SACxB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,GAAG;aACrC,OAAO,GAAG,GAAG,CAAC;UACd,CAAC,CAAC;SAEH,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;aAClB,OAAO,EAAE,OAAQ;aACjB,OAAO;UACP,CAAC,CAAC;SAEH,OAAO,IAAI,CAAC;MACZ;;;;KAKM,KAAK;SACX,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;SACvC,IAAI,OAAO,QAAQ,KAAK,WAAW;aAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;MACxD;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@sapphire/async-queue/dist/lib/AsyncQueue.d.ts b/node_modules/@sapphire/async-queue/dist/lib/AsyncQueue.d.ts new file mode 100644 index 0000000..9c89038 --- /dev/null +++ b/node_modules/@sapphire/async-queue/dist/lib/AsyncQueue.d.ts @@ -0,0 +1,40 @@ +/** + * The AsyncQueue class used to sequentialize burst requests + */ +export declare class AsyncQueue { + /** + * The remaining amount of queued promises + */ + get remaining(): number; + /** + * The promises array + */ + private promises; + /** + * Waits for last promise and queues a new one + * @example + * ``` + * const queue = new AsyncQueue(); + * async function request(url, options) { + * await queue.wait(); + * try { + * const result = await fetch(url, options); + * // Do some operations with 'result' + * } finally { + * // Remove first entry from the queue and resolve for the next entry + * queue.shift(); + * } + * } + * + * request(someUrl1, someOptions1); // Will call fetch() immediately + * request(someUrl2, someOptions2); // Will call fetch() after the first finished + * request(someUrl3, someOptions3); // Will call fetch() after the second finished + * ``` + */ + wait(): Promise; + /** + * Frees the queue's lock for the next item to process + */ + shift(): void; +} +//# sourceMappingURL=AsyncQueue.d.ts.map \ No newline at end of file diff --git a/node_modules/@sapphire/async-queue/dist/lib/AsyncQueue.d.ts.map b/node_modules/@sapphire/async-queue/dist/lib/AsyncQueue.d.ts.map new file mode 100644 index 0000000..56205af --- /dev/null +++ b/node_modules/@sapphire/async-queue/dist/lib/AsyncQueue.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AsyncQueue.d.ts","sourceRoot":"","sources":["../../src/lib/AsyncQueue.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,UAAU;IACtB;;OAEG;IACH,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED;;OAEG;IACH,OAAO,CAAC,QAAQ,CAA2C;IAE3D;;;;;;;;;;;;;;;;;;;;OAoBG;IACI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAe5B;;OAEG;IACI,KAAK,IAAI,IAAI;CAIpB"} \ No newline at end of file diff --git a/node_modules/@sapphire/async-queue/package.json b/node_modules/@sapphire/async-queue/package.json new file mode 100644 index 0000000..faf54a7 --- /dev/null +++ b/node_modules/@sapphire/async-queue/package.json @@ -0,0 +1,55 @@ +{ + "name": "@sapphire/async-queue", + "version": "1.1.4", + "description": "Sequential asynchronous lock-based queue for promises", + "author": "@sapphire", + "license": "MIT", + "main": "dist/index.js", + "module": "dist/index.mjs", + "browser": "dist/index.umd.js", + "unpkg": "dist/index.umd.js", + "types": "dist/index.d.ts", + "exports": { + "import": "./dist/index.mjs", + "require": "./dist/index.js" + }, + "sideEffects": false, + "homepage": "https://github.com/sapphiredev/utilities/tree/main/packages/async-queue", + "scripts": { + "test": "jest", + "lint": "eslint src tests --ext ts --fix -c ../../.eslintrc", + "build": "rollup -c", + "start": "yarn build -w", + "prepublishOnly": "yarn build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/sapphiredev/utilities.git", + "directory": "packages/async-queue" + }, + "files": [ + "dist", + "!dist/*.tsbuildinfo" + ], + "engines": { + "node": ">=14", + "npm": ">=6" + }, + "keywords": [ + "@sapphire/async-queue", + "bot", + "typescript", + "ts", + "yarn", + "discord", + "sapphire", + "standalone" + ], + "bugs": { + "url": "https://github.com/sapphiredev/utilities/issues" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "632c305cb9666dcff8c0ee71167570b8df46ccab" +} diff --git a/node_modules/@sindresorhus/is/dist/index.d.ts b/node_modules/@sindresorhus/is/dist/index.d.ts index e94d30b..7f6c4c1 100644 --- a/node_modules/@sindresorhus/is/dist/index.d.ts +++ b/node_modules/@sindresorhus/is/dist/index.d.ts @@ -1,132 +1,225 @@ /// -/// -/// -/// +/// /// -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; +import { Class, TypedArray, ObservableLike, Primitive } from './types'; +declare const objectTypeNames: readonly ["Function", "Generator", "AsyncGenerator", "GeneratorFunction", "AsyncGeneratorFunction", "AsyncFunction", "Observable", "Array", "Buffer", "Object", "RegExp", "Date", "Error", "Map", "Set", "WeakMap", "WeakSet", "ArrayBuffer", "SharedArrayBuffer", "DataView", "Promise", "URL", "FormData", "URLSearchParams", "HTMLElement", ...("Int8Array" | "Uint8Array" | "Uint8ClampedArray" | "Int16Array" | "Uint16Array" | "Int32Array" | "Uint32Array" | "Float32Array" | "Float64Array" | "BigInt64Array" | "BigUint64Array")[]]; +declare type ObjectTypeName = typeof objectTypeNames[number]; +declare const primitiveTypeNames: readonly ["null", "undefined", "string", "number", "bigint", "boolean", "symbol"]; +declare type PrimitiveTypeName = typeof primitiveTypeNames[number]; +export declare type TypeName = ObjectTypeName | PrimitiveTypeName; +declare function is(value: unknown): TypeName; +declare namespace is { + var undefined: (value: unknown) => value is undefined; + var string: (value: unknown) => value is string; + var number: (value: unknown) => value is number; + var bigint: (value: unknown) => value is bigint; + var function_: (value: unknown) => value is Function; + var null_: (value: unknown) => value is null; + var class_: (value: unknown) => value is Class; + var boolean: (value: unknown) => value is boolean; + var symbol: (value: unknown) => value is symbol; + var numericString: (value: unknown) => value is string; + var array: (value: unknown, assertion?: ((value: T) => value is T) | undefined) => value is T[]; + var buffer: (value: unknown) => value is Buffer; + var nullOrUndefined: (value: unknown) => value is null | undefined; + var object: (value: unknown) => value is object; + var iterable: (value: unknown) => value is IterableIterator; + var asyncIterable: (value: unknown) => value is AsyncIterableIterator; + var generator: (value: unknown) => value is Generator; + var asyncGenerator: (value: unknown) => value is AsyncGenerator; + var nativePromise: (value: unknown) => value is Promise; + var promise: (value: unknown) => value is Promise; + var generatorFunction: (value: unknown) => value is GeneratorFunction; + var asyncGeneratorFunction: (value: unknown) => value is (...args: any[]) => Promise; + var asyncFunction: (value: unknown) => value is (...args: any[]) => Promise; + var boundFunction: (value: unknown) => value is Function; + var regExp: (value: unknown) => value is RegExp; + var date: (value: unknown) => value is Date; + var error: (value: unknown) => value is Error; + var map: (value: unknown) => value is Map; + var set: (value: unknown) => value is Set; + var weakMap: (value: unknown) => value is WeakMap; + var weakSet: (value: unknown) => value is WeakSet; + var int8Array: (value: unknown) => value is Int8Array; + var uint8Array: (value: unknown) => value is Uint8Array; + var uint8ClampedArray: (value: unknown) => value is Uint8ClampedArray; + var int16Array: (value: unknown) => value is Int16Array; + var uint16Array: (value: unknown) => value is Uint16Array; + var int32Array: (value: unknown) => value is Int32Array; + var uint32Array: (value: unknown) => value is Uint32Array; + var float32Array: (value: unknown) => value is Float32Array; + var float64Array: (value: unknown) => value is Float64Array; + var bigInt64Array: (value: unknown) => value is BigInt64Array; + var bigUint64Array: (value: unknown) => value is BigUint64Array; + var arrayBuffer: (value: unknown) => value is ArrayBuffer; + var sharedArrayBuffer: (value: unknown) => value is SharedArrayBuffer; + var dataView: (value: unknown) => value is DataView; + var directInstanceOf: (instance: unknown, class_: Class) => instance is T; + var urlInstance: (value: unknown) => value is URL; + var urlString: (value: unknown) => value is string; + var truthy: (value: unknown) => boolean; + var falsy: (value: unknown) => boolean; + var nan: (value: unknown) => boolean; + var primitive: (value: unknown) => value is Primitive; + var integer: (value: unknown) => value is number; + var safeInteger: (value: unknown) => value is number; + var plainObject: (value: unknown) => value is Record; + var typedArray: (value: unknown) => value is TypedArray; + var arrayLike: (value: unknown) => value is ArrayLike; + var inRange: (value: number, range: number | number[]) => value is number; + var domElement: (value: unknown) => value is HTMLElement; + var observable: (value: unknown) => value is ObservableLike; + var nodeStream: (value: unknown) => value is NodeStream; + var infinite: (value: unknown) => value is number; + var evenInteger: (value: number) => value is number; + var oddInteger: (value: number) => value is number; + var emptyArray: (value: unknown) => value is never[]; + var nonEmptyArray: (value: unknown) => value is unknown[]; + var emptyString: (value: unknown) => value is ""; + var nonEmptyString: (value: unknown) => value is string; + var emptyStringOrWhitespace: (value: unknown) => value is string; + var emptyObject: (value: unknown) => value is Record; + var nonEmptyObject: (value: unknown) => value is Record; + var emptySet: (value: unknown) => value is Set; + var nonEmptySet: (value: unknown) => value is Set; + var emptyMap: (value: unknown) => value is Map; + var nonEmptyMap: (value: unknown) => value is Map; + var propertyKey: (value: unknown) => value is string | number | symbol; + var formData: (value: unknown) => value is FormData; + var urlSearchParams: (value: unknown) => value is URLSearchParams; + var any: (predicate: Predicate | Predicate[], ...values: unknown[]) => boolean; + var all: (predicate: Predicate, ...values: unknown[]) => boolean; } -export interface Class { - new (...args: any[]): T; +export interface ArrayLike { + readonly [index: number]: T; + readonly length: number; } -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" +export interface NodeStream extends NodeJS.EventEmitter { + pipe(destination: T, options?: { + end?: boolean; + }): T; } -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 declare type Predicate = (value: unknown) => boolean; +export declare const enum AssertionTypeDescription { + class_ = "Class", + numericString = "string with a number", + nullOrUndefined = "null or undefined", + iterable = "Iterable", + asyncIterable = "AsyncIterable", + nativePromise = "native Promise", + urlString = "string with a URL", + truthy = "truthy", + falsy = "falsy", + nan = "NaN", + primitive = "primitive", + integer = "integer", + safeInteger = "integer", + plainObject = "plain object", + arrayLike = "array-like", + typedArray = "TypedArray", + domElement = "HTMLElement", + nodeStream = "Node.js Stream", + infinite = "infinite number", + emptyArray = "empty array", + nonEmptyArray = "non-empty array", + emptyString = "empty string", + nonEmptyString = "non-empty string", + emptyStringOrWhitespace = "empty string or whitespace", + emptyObject = "empty object", + nonEmptyObject = "non-empty object", + emptySet = "empty set", + nonEmptySet = "non-empty set", + emptyMap = "empty map", + nonEmptyMap = "non-empty map", + evenInteger = "even integer", + oddInteger = "odd integer", + directInstanceOf = "T", + inRange = "in range", + any = "predicate returns truthy for any value", + all = "predicate returns truthy for all values" +} +interface Assert { + undefined: (value: unknown) => asserts value is undefined; + string: (value: unknown) => asserts value is string; + number: (value: unknown) => asserts value is number; + bigint: (value: unknown) => asserts value is bigint; + function_: (value: unknown) => asserts value is Function; + null_: (value: unknown) => asserts value is null; + class_: (value: unknown) => asserts value is Class; + boolean: (value: unknown) => asserts value is boolean; + symbol: (value: unknown) => asserts value is symbol; + numericString: (value: unknown) => asserts value is string; + array: (value: unknown, assertion?: (element: unknown) => asserts element is T) => asserts value is T[]; + buffer: (value: unknown) => asserts value is Buffer; + nullOrUndefined: (value: unknown) => asserts value is null | undefined; + object: (value: unknown) => asserts value is Record; + iterable: (value: unknown) => asserts value is Iterable; + asyncIterable: (value: unknown) => asserts value is AsyncIterable; + generator: (value: unknown) => asserts value is Generator; + asyncGenerator: (value: unknown) => asserts value is AsyncGenerator; + nativePromise: (value: unknown) => asserts value is Promise; + promise: (value: unknown) => asserts value is Promise; + generatorFunction: (value: unknown) => asserts value is GeneratorFunction; + asyncGeneratorFunction: (value: unknown) => asserts value is AsyncGeneratorFunction; + asyncFunction: (value: unknown) => asserts value is Function; + boundFunction: (value: unknown) => asserts value is Function; + regExp: (value: unknown) => asserts value is RegExp; + date: (value: unknown) => asserts value is Date; + error: (value: unknown) => asserts value is Error; + map: (value: unknown) => asserts value is Map; + set: (value: unknown) => asserts value is Set; + weakMap: (value: unknown) => asserts value is WeakMap; + weakSet: (value: unknown) => asserts value is WeakSet; + int8Array: (value: unknown) => asserts value is Int8Array; + uint8Array: (value: unknown) => asserts value is Uint8Array; + uint8ClampedArray: (value: unknown) => asserts value is Uint8ClampedArray; + int16Array: (value: unknown) => asserts value is Int16Array; + uint16Array: (value: unknown) => asserts value is Uint16Array; + int32Array: (value: unknown) => asserts value is Int32Array; + uint32Array: (value: unknown) => asserts value is Uint32Array; + float32Array: (value: unknown) => asserts value is Float32Array; + float64Array: (value: unknown) => asserts value is Float64Array; + bigInt64Array: (value: unknown) => asserts value is BigInt64Array; + bigUint64Array: (value: unknown) => asserts value is BigUint64Array; + arrayBuffer: (value: unknown) => asserts value is ArrayBuffer; + sharedArrayBuffer: (value: unknown) => asserts value is SharedArrayBuffer; + dataView: (value: unknown) => asserts value is DataView; + urlInstance: (value: unknown) => asserts value is URL; + urlString: (value: unknown) => asserts value is string; + truthy: (value: unknown) => asserts value is unknown; + falsy: (value: unknown) => asserts value is unknown; + nan: (value: unknown) => asserts value is unknown; + primitive: (value: unknown) => asserts value is Primitive; + integer: (value: unknown) => asserts value is number; + safeInteger: (value: unknown) => asserts value is number; + plainObject: (value: unknown) => asserts value is Record; + typedArray: (value: unknown) => asserts value is TypedArray; + arrayLike: (value: unknown) => asserts value is ArrayLike; + domElement: (value: unknown) => asserts value is HTMLElement; + observable: (value: unknown) => asserts value is ObservableLike; + nodeStream: (value: unknown) => asserts value is NodeStream; + infinite: (value: unknown) => asserts value is number; + emptyArray: (value: unknown) => asserts value is never[]; + nonEmptyArray: (value: unknown) => asserts value is unknown[]; + emptyString: (value: unknown) => asserts value is ''; + nonEmptyString: (value: unknown) => asserts value is string; + emptyStringOrWhitespace: (value: unknown) => asserts value is string; + emptyObject: (value: unknown) => asserts value is Record; + nonEmptyObject: (value: unknown) => asserts value is Record; + emptySet: (value: unknown) => asserts value is Set; + nonEmptySet: (value: unknown) => asserts value is Set; + emptyMap: (value: unknown) => asserts value is Map; + nonEmptyMap: (value: unknown) => asserts value is Map; + propertyKey: (value: unknown) => asserts value is PropertyKey; + formData: (value: unknown) => asserts value is FormData; + urlSearchParams: (value: unknown) => asserts value is URLSearchParams; + evenInteger: (value: number) => asserts value is number; + oddInteger: (value: number) => asserts value is number; + directInstanceOf: (instance: unknown, class_: Class) => asserts instance is T; + inRange: (value: number, range: number | number[]) => asserts value is number; + any: (predicate: Predicate | Predicate[], ...values: unknown[]) => void | never; + all: (predicate: Predicate, ...values: unknown[]) => void | never; } +export declare const assert: Assert; export default is; +export { Class, TypedArray, ObservableLike, Primitive } from './types'; diff --git a/node_modules/@sindresorhus/is/dist/index.js b/node_modules/@sindresorhus/is/dist/index.js index 3cbafae..057135f 100644 --- a/node_modules/@sindresorhus/is/dist/index.js +++ b/node_modules/@sindresorhus/is/dist/index.js @@ -1,54 +1,112 @@ "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 typedArrayTypeNames = [ + 'Int8Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Int16Array', + 'Uint16Array', + 'Int32Array', + 'Uint32Array', + 'Float32Array', + 'Float64Array', + 'BigInt64Array', + 'BigUint64Array' +]; +function isTypedArrayName(name) { + return typedArrayTypeNames.includes(name); +} +const objectTypeNames = [ + 'Function', + 'Generator', + 'AsyncGenerator', + 'GeneratorFunction', + 'AsyncGeneratorFunction', + 'AsyncFunction', + 'Observable', + 'Array', + 'Buffer', + 'Object', + 'RegExp', + 'Date', + 'Error', + 'Map', + 'Set', + 'WeakMap', + 'WeakSet', + 'ArrayBuffer', + 'SharedArrayBuffer', + 'DataView', + 'Promise', + 'URL', + 'FormData', + 'URLSearchParams', + 'HTMLElement', + ...typedArrayTypeNames +]; +function isObjectTypeName(name) { + return objectTypeNames.includes(name); +} +const primitiveTypeNames = [ + 'null', + 'undefined', + 'string', + 'number', + 'bigint', + 'boolean', + 'symbol' +]; +function isPrimitiveTypeName(name) { + return primitiveTypeNames.includes(name); +} +// eslint-disable-next-line @typescript-eslint/ban-types +function isOfType(type) { + return (value) => typeof value === type; +} +const { toString } = Object.prototype; const getObjectType = (value) => { - const objectName = toString.call(value).slice(8, -1); - if (objectName) { - return objectName; + const objectTypeName = toString.call(value).slice(8, -1); + if (/HTML\w+Element/.test(objectTypeName) && is.domElement(value)) { + return 'HTMLElement'; } - return null; + if (isObjectTypeName(objectTypeName)) { + return objectTypeName; + } + return undefined; }; 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: + if (value === null) { + return 'null'; } switch (typeof value) { case 'undefined': - return "undefined" /* undefined */; + return 'undefined'; case 'string': - return "string" /* string */; + return 'string'; case 'number': - return "number" /* number */; + return 'number'; + case 'boolean': + return 'boolean'; + case 'function': + return 'Function'; + case 'bigint': + return 'bigint'; case 'symbol': - return "symbol" /* symbol */; + return 'symbol'; default: } - if (is.function_(value)) { - return "Function" /* Function */; - } if (is.observable(value)) { - return "Observable" /* Observable */; + return 'Observable'; } - if (Array.isArray(value)) { - return "Array" /* Array */; + if (is.array(value)) { + return 'Array'; } - if (isBuffer(value)) { - return "Buffer" /* Buffer */; + if (is.buffer(value)) { + return 'Buffer'; } const tagType = getObjectType(value); if (tagType) { @@ -57,174 +115,287 @@ function is(value) { 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 */; + return '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; - } +is.undefined = isOfType('undefined'); +is.string = isOfType('string'); +const isNumberType = isOfType('number'); +is.number = (value) => isNumberType(value) && !is.nan(value); +is.bigint = isOfType('bigint'); +// eslint-disable-next-line @typescript-eslint/ban-types +is.function_ = isOfType('function'); +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'); +is.numericString = (value) => is.string(value) && !is.emptyStringOrWhitespace(value) && !Number.isNaN(Number(value)); +is.array = (value, assertion) => { + if (!Array.isArray(value)) { 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'); + } + if (!is.function_(assertion)) { + return true; + } + return value.every(assertion); +}; +is.buffer = (value) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = value) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.isBuffer) === null || _c === void 0 ? void 0 : _c.call(_b, value)) !== null && _d !== void 0 ? _d : false; }; +is.nullOrUndefined = (value) => is.null_(value) || is.undefined(value); +is.object = (value) => !is.null_(value) && (typeof value === 'object' || is.function_(value)); +is.iterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.iterator]); }; +is.asyncIterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.asyncIterator]); }; +is.generator = (value) => is.iterable(value) && is.function_(value.next) && is.function_(value.throw); +is.asyncGenerator = (value) => is.asyncIterable(value) && is.function_(value.next) && is.function_(value.throw); +is.nativePromise = (value) => isObjectOfType('Promise')(value); +const hasPromiseAPI = (value) => { + var _a, _b; + return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.then) && + is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.catch); +}; +is.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value); +is.generatorFunction = isObjectOfType('GeneratorFunction'); +is.asyncGeneratorFunction = (value) => getObjectType(value) === 'AsyncGeneratorFunction'; +is.asyncFunction = (value) => getObjectType(value) === 'AsyncFunction'; +// eslint-disable-next-line no-prototype-builtins, @typescript-eslint/ban-types +is.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype'); +is.regExp = isObjectOfType('RegExp'); +is.date = isObjectOfType('Date'); +is.error = isObjectOfType('Error'); +is.map = (value) => isObjectOfType('Map')(value); +is.set = (value) => isObjectOfType('Set')(value); +is.weakMap = (value) => isObjectOfType('WeakMap')(value); +is.weakSet = (value) => isObjectOfType('WeakSet')(value); +is.int8Array = isObjectOfType('Int8Array'); +is.uint8Array = isObjectOfType('Uint8Array'); +is.uint8ClampedArray = isObjectOfType('Uint8ClampedArray'); +is.int16Array = isObjectOfType('Int16Array'); +is.uint16Array = isObjectOfType('Uint16Array'); +is.int32Array = isObjectOfType('Int32Array'); +is.uint32Array = isObjectOfType('Uint32Array'); +is.float32Array = isObjectOfType('Float32Array'); +is.float64Array = isObjectOfType('Float64Array'); +is.bigInt64Array = isObjectOfType('BigInt64Array'); +is.bigUint64Array = isObjectOfType('BigUint64Array'); +is.arrayBuffer = isObjectOfType('ArrayBuffer'); +is.sharedArrayBuffer = isObjectOfType('SharedArrayBuffer'); +is.dataView = isObjectOfType('DataView'); +is.directInstanceOf = (instance, class_) => Object.getPrototypeOf(instance) === class_.prototype; +is.urlInstance = (value) => isObjectOfType('URL')(value); +is.urlString = (value) => { + if (!is.string(value)) { + return false; + } + try { + new URL(value); // eslint-disable-line no-new + return true; + } + catch (_a) { + return false; + } +}; +// TODO: Use the `not` operator with a type guard here when it's available. +// Example: `is.truthy = (value: unknown): value is (not false | not 0 | not '' | not undefined | not null) => Boolean(value);` +is.truthy = (value) => Boolean(value); +// Example: `is.falsy = (value: unknown): value is (not true | 0 | '' | undefined | null) => Boolean(value);` +is.falsy = (value) => !value; +is.nan = (value) => Number.isNaN(value); +is.primitive = (value) => is.null_(value) || isPrimitiveTypeName(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/main/index.js + if (toString.call(value) !== '[object Object]') { + return false; + } + const prototype = Object.getPrototypeOf(value); + return prototype === null || prototype === Object.getPrototypeOf({}); +}; +is.typedArray = (value) => isTypedArrayName(getObjectType(value)); +const isValidLength = (value) => is.safeInteger(value) && value >= 0; +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) => { + return 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) => { + var _a, _b, _c, _d; + if (!value) { + return false; + } + // eslint-disable-next-line no-use-extend-native/no-use-extend-native + if (value === ((_b = (_a = value)[Symbol.observable]) === null || _b === void 0 ? void 0 : _b.call(_a))) { + return true; + } + if (value === ((_d = (_c = value)['@@observable']) === null || _d === void 0 ? void 0 : _d.call(_c))) { + return true; + } + return false; +}; +is.nodeStream = (value) => is.object(value) && is.function_(value.pipe) && !is.observable(value); +is.infinite = (value) => value === Infinity || value === -Infinity; +const isAbsoluteMod2 = (remainder) => (value) => is.integer(value) && Math.abs(value % 2) === remainder; +is.evenInteger = isAbsoluteMod2(0); +is.oddInteger = isAbsoluteMod2(1); +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; +// TODO: Use `not ''` when the `not` operator is available. +is.nonEmptyString = (value) => is.string(value) && value.length > 0; +const isWhiteSpaceString = (value) => is.string(value) && !/\S/.test(value); +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; +// TODO: Use `not` operator here to remove `Map` and `Set` from type guard: +// - https://github.com/Microsoft/TypeScript/pull/29317 +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; +// `PropertyKey` is any value that can be used as an object key (string, number, or symbol) +is.propertyKey = (value) => is.any([is.string, is.number, is.symbol], value); +is.formData = (value) => isObjectOfType('FormData')(value); +is.urlSearchParams = (value) => isObjectOfType('URLSearchParams')(value); +const predicateOnArray = (method, predicate, values) => { + if (!is.function_(predicate)) { + throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`); + } + if (values.length === 0) { + throw new TypeError('Invalid number of values'); + } + return method.call(values, predicate); +}; +is.any = (predicate, ...values) => { + const predicates = is.array(predicate) ? predicate : [predicate]; + return predicates.some(singlePredicate => predicateOnArray(Array.prototype.some, singlePredicate, values)); +}; +is.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values); +const assertType = (condition, description, value, options = {}) => { + if (!condition) { + const { multipleValues } = options; + const valuesMessage = multipleValues ? + `received values of types ${[ + ...new Set(value.map(singleValue => `\`${is(singleValue)}\``)) + ].join(', ')}` : + `received value of type \`${is(value)}\``; + throw new TypeError(`Expected value which is \`${description}\`, ${valuesMessage}.`); + } +}; +exports.assert = { + // Unknowns. + undefined: (value) => assertType(is.undefined(value), 'undefined', value), + string: (value) => assertType(is.string(value), 'string', value), + number: (value) => assertType(is.number(value), 'number', value), + bigint: (value) => assertType(is.bigint(value), 'bigint', value), + // eslint-disable-next-line @typescript-eslint/ban-types + function_: (value) => assertType(is.function_(value), 'Function', value), + null_: (value) => assertType(is.null_(value), 'null', value), + class_: (value) => assertType(is.class_(value), "Class" /* class_ */, value), + boolean: (value) => assertType(is.boolean(value), 'boolean', value), + symbol: (value) => assertType(is.symbol(value), 'symbol', value), + numericString: (value) => assertType(is.numericString(value), "string with a number" /* numericString */, value), + array: (value, assertion) => { + const assert = assertType; + assert(is.array(value), 'Array', value); + if (assertion) { + value.forEach(assertion); } - 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 = {})); + }, + buffer: (value) => assertType(is.buffer(value), 'Buffer', value), + nullOrUndefined: (value) => assertType(is.nullOrUndefined(value), "null or undefined" /* nullOrUndefined */, value), + object: (value) => assertType(is.object(value), 'Object', value), + iterable: (value) => assertType(is.iterable(value), "Iterable" /* iterable */, value), + asyncIterable: (value) => assertType(is.asyncIterable(value), "AsyncIterable" /* asyncIterable */, value), + generator: (value) => assertType(is.generator(value), 'Generator', value), + asyncGenerator: (value) => assertType(is.asyncGenerator(value), 'AsyncGenerator', value), + nativePromise: (value) => assertType(is.nativePromise(value), "native Promise" /* nativePromise */, value), + promise: (value) => assertType(is.promise(value), 'Promise', value), + generatorFunction: (value) => assertType(is.generatorFunction(value), 'GeneratorFunction', value), + asyncGeneratorFunction: (value) => assertType(is.asyncGeneratorFunction(value), 'AsyncGeneratorFunction', value), + // eslint-disable-next-line @typescript-eslint/ban-types + asyncFunction: (value) => assertType(is.asyncFunction(value), 'AsyncFunction', value), + // eslint-disable-next-line @typescript-eslint/ban-types + boundFunction: (value) => assertType(is.boundFunction(value), 'Function', value), + regExp: (value) => assertType(is.regExp(value), 'RegExp', value), + date: (value) => assertType(is.date(value), 'Date', value), + error: (value) => assertType(is.error(value), 'Error', value), + map: (value) => assertType(is.map(value), 'Map', value), + set: (value) => assertType(is.set(value), 'Set', value), + weakMap: (value) => assertType(is.weakMap(value), 'WeakMap', value), + weakSet: (value) => assertType(is.weakSet(value), 'WeakSet', value), + int8Array: (value) => assertType(is.int8Array(value), 'Int8Array', value), + uint8Array: (value) => assertType(is.uint8Array(value), 'Uint8Array', value), + uint8ClampedArray: (value) => assertType(is.uint8ClampedArray(value), 'Uint8ClampedArray', value), + int16Array: (value) => assertType(is.int16Array(value), 'Int16Array', value), + uint16Array: (value) => assertType(is.uint16Array(value), 'Uint16Array', value), + int32Array: (value) => assertType(is.int32Array(value), 'Int32Array', value), + uint32Array: (value) => assertType(is.uint32Array(value), 'Uint32Array', value), + float32Array: (value) => assertType(is.float32Array(value), 'Float32Array', value), + float64Array: (value) => assertType(is.float64Array(value), 'Float64Array', value), + bigInt64Array: (value) => assertType(is.bigInt64Array(value), 'BigInt64Array', value), + bigUint64Array: (value) => assertType(is.bigUint64Array(value), 'BigUint64Array', value), + arrayBuffer: (value) => assertType(is.arrayBuffer(value), 'ArrayBuffer', value), + sharedArrayBuffer: (value) => assertType(is.sharedArrayBuffer(value), 'SharedArrayBuffer', value), + dataView: (value) => assertType(is.dataView(value), 'DataView', value), + urlInstance: (value) => assertType(is.urlInstance(value), 'URL', value), + urlString: (value) => assertType(is.urlString(value), "string with a URL" /* urlString */, value), + truthy: (value) => assertType(is.truthy(value), "truthy" /* truthy */, value), + falsy: (value) => assertType(is.falsy(value), "falsy" /* falsy */, value), + nan: (value) => assertType(is.nan(value), "NaN" /* nan */, value), + primitive: (value) => assertType(is.primitive(value), "primitive" /* primitive */, value), + integer: (value) => assertType(is.integer(value), "integer" /* integer */, value), + safeInteger: (value) => assertType(is.safeInteger(value), "integer" /* safeInteger */, value), + plainObject: (value) => assertType(is.plainObject(value), "plain object" /* plainObject */, value), + typedArray: (value) => assertType(is.typedArray(value), "TypedArray" /* typedArray */, value), + arrayLike: (value) => assertType(is.arrayLike(value), "array-like" /* arrayLike */, value), + domElement: (value) => assertType(is.domElement(value), "HTMLElement" /* domElement */, value), + observable: (value) => assertType(is.observable(value), 'Observable', value), + nodeStream: (value) => assertType(is.nodeStream(value), "Node.js Stream" /* nodeStream */, value), + infinite: (value) => assertType(is.infinite(value), "infinite number" /* infinite */, value), + emptyArray: (value) => assertType(is.emptyArray(value), "empty array" /* emptyArray */, value), + nonEmptyArray: (value) => assertType(is.nonEmptyArray(value), "non-empty array" /* nonEmptyArray */, value), + emptyString: (value) => assertType(is.emptyString(value), "empty string" /* emptyString */, value), + nonEmptyString: (value) => assertType(is.nonEmptyString(value), "non-empty string" /* nonEmptyString */, value), + emptyStringOrWhitespace: (value) => assertType(is.emptyStringOrWhitespace(value), "empty string or whitespace" /* emptyStringOrWhitespace */, value), + emptyObject: (value) => assertType(is.emptyObject(value), "empty object" /* emptyObject */, value), + nonEmptyObject: (value) => assertType(is.nonEmptyObject(value), "non-empty object" /* nonEmptyObject */, value), + emptySet: (value) => assertType(is.emptySet(value), "empty set" /* emptySet */, value), + nonEmptySet: (value) => assertType(is.nonEmptySet(value), "non-empty set" /* nonEmptySet */, value), + emptyMap: (value) => assertType(is.emptyMap(value), "empty map" /* emptyMap */, value), + nonEmptyMap: (value) => assertType(is.nonEmptyMap(value), "non-empty map" /* nonEmptyMap */, value), + propertyKey: (value) => assertType(is.propertyKey(value), 'PropertyKey', value), + formData: (value) => assertType(is.formData(value), 'FormData', value), + urlSearchParams: (value) => assertType(is.urlSearchParams(value), 'URLSearchParams', value), + // Numbers. + evenInteger: (value) => assertType(is.evenInteger(value), "even integer" /* evenInteger */, value), + oddInteger: (value) => assertType(is.oddInteger(value), "odd integer" /* oddInteger */, value), + // Two arguments. + directInstanceOf: (instance, class_) => assertType(is.directInstanceOf(instance, class_), "T" /* directInstanceOf */, instance), + inRange: (value, range) => assertType(is.inRange(value, range), "in range" /* inRange */, value), + // Variadic functions. + any: (predicate, ...values) => { + return assertType(is.any(predicate, ...values), "predicate returns truthy for any value" /* any */, values, { multipleValues: true }); + }, + all: (predicate, ...values) => assertType(is.all(predicate, ...values), "predicate returns truthy for all values" /* all */, values, { multipleValues: true }) +}; // 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, { @@ -238,8 +409,19 @@ Object.defineProperties(is, { value: is.null_ } }); +Object.defineProperties(exports.assert, { + class: { + value: exports.assert.class_ + }, + function: { + value: exports.assert.function_ + }, + null: { + value: exports.assert.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 +module.exports.assert = exports.assert; diff --git a/node_modules/@sindresorhus/is/dist/types.d.ts b/node_modules/@sindresorhus/is/dist/types.d.ts new file mode 100644 index 0000000..a63acda --- /dev/null +++ b/node_modules/@sindresorhus/is/dist/types.d.ts @@ -0,0 +1,24 @@ +/** +Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). +*/ +export declare type Primitive = null | undefined | string | number | boolean | symbol | bigint; +/** +Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). +*/ +export declare type Class = new (...arguments_: Arguments) => T; +/** +Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. +*/ +export declare type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array; +declare global { + interface SymbolConstructor { + readonly observable: symbol; + } +} +/** +Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). +*/ +export interface ObservableLike { + subscribe(observer: (value: unknown) => void): void; + [Symbol.observable](): ObservableLike; +} diff --git a/node_modules/@sindresorhus/is/dist/types.js b/node_modules/@sindresorhus/is/dist/types.js new file mode 100644 index 0000000..0930323 --- /dev/null +++ b/node_modules/@sindresorhus/is/dist/types.js @@ -0,0 +1,3 @@ +"use strict"; +// Extracted from https://github.com/sindresorhus/type-fest/blob/78019f42ea888b0cdceb41a4a78163868de57555/index.d.ts +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@sindresorhus/is/license b/node_modules/@sindresorhus/is/license index e7af2f7..fa7ceba 100644 --- a/node_modules/@sindresorhus/is/license +++ b/node_modules/@sindresorhus/is/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +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: diff --git a/node_modules/@sindresorhus/is/package.json b/node_modules/@sindresorhus/is/package.json index 9c28caf..9763df0 100644 --- a/node_modules/@sindresorhus/is/package.json +++ b/node_modules/@sindresorhus/is/package.json @@ -1,99 +1,96 @@ { - "_args": [ - [ - "@sindresorhus/is@0.14.0", - "D:\\Users\\henri\\Desktop\\TestHabana" - ] - ], - "_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": "version", - "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", - "_spec": "0.14.0", - "_where": "D:\\Users\\henri\\Desktop\\TestHabana", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/is/issues" - }, - "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" + "name": "@sindresorhus/is", + "version": "4.2.0", + "description": "Type check values", + "license": "MIT", + "repository": "sindresorhus/is", + "funding": "https://github.com/sindresorhus/is?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "main": "dist/index.js", + "engines": { + "node": ">=10" + }, + "scripts": { + "build": "del dist && tsc", + "test": "xo && ava", + "prepare": "npm run build" + }, + "files": [ + "dist" + ], + "keywords": [ + "type", + "types", + "is", + "check", + "checking", + "validate", + "validation", + "utility", + "util", + "typeof", + "instanceof", + "object", + "assert", + "assertion", + "test", + "kind", + "primitive", + "verify", + "compare", + "typescript", + "typeguards", + "types" + ], + "devDependencies": { + "@sindresorhus/tsconfig": "^0.7.0", + "@types/jsdom": "^16.1.0", + "@types/node": "^14.0.13", + "@types/zen-observable": "^0.8.0", + "@typescript-eslint/eslint-plugin": "^2.20.0", + "@typescript-eslint/parser": "^2.20.0", + "ava": "^3.3.0", + "del-cli": "^2.0.0", + "eslint-config-xo-typescript": "^0.26.0", + "jsdom": "^16.0.1", + "rxjs": "^6.4.0", + "tempy": "^0.4.0", + "ts-node": "^8.3.0", + "typescript": "~3.8.2", + "xo": "^0.26.1", + "zen-observable": "^0.8.8" + }, + "types": "dist/index.d.ts", + "sideEffects": false, + "ava": { + "extensions": [ + "ts" + ], + "require": [ + "ts-node/register" + ] + }, + "xo": { + "extends": "xo-typescript", + "extensions": [ + "ts" + ], + "parserOptions": { + "project": "./tsconfig.xo.json" + }, + "globals": [ + "BigInt", + "BigInt64Array", + "BigUint64Array" + ], + "rules": { + "@typescript-eslint/promise-function-async": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/explicit-function-return-type": "off" + } + } } diff --git a/node_modules/@sindresorhus/is/readme.md b/node_modules/@sindresorhus/is/readme.md index 97c023b..c9b5463 100644 --- a/node_modules/@sindresorhus/is/readme.md +++ b/node_modules/@sindresorhus/is/readme.md @@ -1,9 +1,19 @@ -# is [![Build Status](https://travis-ci.org/sindresorhus/is.svg?branch=master)](https://travis-ci.org/sindresorhus/is) +# is -> Type check values: `is.string('🦄') //=> true` +> Type check values + +For example, `is.string('🦄') //=> true` +## Highlights + +- Written in TypeScript +- [Extensive use of type guards](#type-guards) +- [Supports type assertions](#type-assertions) +- [Aware of generic type parameters](#generic-type-parameters) (use with caution) +- Actively maintained +- ![Millions of downloads per week](https://img.shields.io/npm/dw/@sindresorhus/is) ## Install @@ -11,7 +21,6 @@ $ npm install @sindresorhus/is ``` - ## Usage ```js @@ -27,33 +36,24 @@ 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. +[Assertions](#type-assertions) perform the same type checks, but throw an error if the type does not match. -```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; - } +```js +const {assert} = require('@sindresorhus/is'); - if (is.string(padding)) { - // `padding` is typed as `string` - return padding + value; - } +assert.string(2); +//=> Error: Expected value which is `string`, received value of type `number`. +``` - throw new TypeError(`Expected 'padding' to be of type 'string' or 'number', got '${is(padding)}'.`); -} +And with TypeScript: -padLeft('🦄', 3); -//=> ' 🦄' +```ts +import {assert} from '@sindresorhus/is'; -padLeft('🦄', '🌈'); -//=> '🌈🦄' +assert.string(foo); +// `foo` is now typed as a `string`. ``` - ## API ### is(value) @@ -84,12 +84,24 @@ All the below methods accept a value and returns a boolean for whether the value ##### .null(value) ##### .string(value) ##### .number(value) + +Note: `is.number(NaN)` returns `false`. This intentionally deviates from `typeof` behavior to increase user-friendliness of `is` type checks. + ##### .boolean(value) ##### .symbol(value) +##### .bigint(value) #### Built-in types -##### .array(value) +##### .array(value, assertion?) + +Returns true if `value` is an array and all of its items match the assertion (if provided). + +```js +is.array(value); // Validate `value` is an array. +is.array(value, is.number); // Validate `value` is an array and all of its items are numbers. +``` + ##### .function(value) ##### .buffer(value) ##### .object(value) @@ -98,7 +110,7 @@ Keep in mind that [functions are objects too](https://developer.mozilla.org/en-U ##### .numericString(value) -Returns `true` for a string that represents a number. For example, `'42'` and `'-8'`. +Returns `true` for a string that represents a number satisfying `is.number`, for example, `'42'` and `'-8.3'`. Note: `'NaN'` returns `false`, but `'Infinity'` and `'-Infinity'` return `true`. @@ -122,10 +134,42 @@ Returns `true` for any `async` function that can be called with the `await` oper ```js is.asyncFunction(async () => {}); -// => true +//=> true is.asyncFunction(() => {}); -// => false +//=> false +``` + +##### .asyncGenerator(value) + +```js +is.asyncGenerator( + (async function * () { + yield 4; + })() +); +//=> true + +is.asyncGenerator( + (function * () { + yield 4; + })() +); +//=> false +``` + +##### .asyncGeneratorFunction(value) + +```js +is.asyncGeneratorFunction(async function * () { + yield 4; +}); +//=> true + +is.asyncGeneratorFunction(function * () { + yield 4; +}); +//=> false ``` ##### .boundFunction(value) @@ -134,13 +178,13 @@ Returns `true` for any `bound` function. ```js is.boundFunction(() => {}); -// => true +//=> true is.boundFunction(function () {}.bind(null)); -// => true +//=> true is.boundFunction(function () {}); -// => false +//=> false ``` ##### .map(value) @@ -159,6 +203,8 @@ is.boundFunction(function () {}); ##### .uint32Array(value) ##### .float32Array(value) ##### .float64Array(value) +##### .bigInt64Array(value) +##### .bigUint64Array(value) #### Structured data @@ -205,7 +251,7 @@ Object.defineProperty(object1, 'property1', { }); is.emptyObject(object1); -// => true +//=> true ``` ##### .nonEmptyObject(value) @@ -255,7 +301,7 @@ is.urlInstance(url); //=> true ``` -### .url(value) +##### .urlString(value) Returns `true` if `value` is a URL string. @@ -264,10 +310,10 @@ Note: this only does basic checking using the [`URL` class](https://developer.mo ```js const url = 'https://example.com'; -is.url(url); +is.urlString(url); //=> true -is.url(new URL(url)); +is.urlString(new URL(url)); //=> false ``` @@ -374,17 +420,43 @@ is.observable(new Observable()); Check if `value` is `Infinity` or `-Infinity`. -##### .even(value) +##### .evenInteger(value) Returns `true` if `value` is an even integer. -##### .odd(value) +##### .oddInteger(value) Returns `true` if `value` is an odd integer. -##### .any(predicate, ...values) +##### .propertyKey(value) + +Returns `true` if `value` can be used as an object property key (either `string`, `number`, or `symbol`). + +##### .formData(value) + +Returns `true` if `value` is an instance of the [`FormData` class](https://developer.mozilla.org/en-US/docs/Web/API/FormData). + +```js +const data = new FormData(); + +is.formData(data); +//=> true +``` + +##### .urlSearchParams(value) + +Returns `true` if `value` is an instance of the [`URLSearchParams` class](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams). + +```js +const searchParams = new URLSearchParams(); + +is.urlSearchParams(searchParams); +//=> true +``` + +##### .any(predicate | predicate[], ...values) -Returns `true` if **any** of the input `values` returns true in the `predicate`: +Using a single `predicate` argument, returns `true` if **any** of the input `values` returns true in the `predicate`: ```js is.any(is.string, {}, true, '🦄'); @@ -394,6 +466,16 @@ is.any(is.boolean, 'unicorns', [], new Map()); //=> false ``` +Using an array of `predicate[]`, returns `true` if **any** of the input `values` returns true for **any** of the `predicates` provided in an array: + +```js +is.any([is.string, is.number], {}, true, '🦄'); +//=> true + +is.any([is.boolean, is.number], 'unicorns', [], new Map()); +//=> false +``` + ##### .all(predicate, ...values) Returns `true` if **all** of the input `values` returns true in the `predicate`: @@ -406,6 +488,102 @@ is.all(is.string, '🦄', [], 'unicorns'); //=> false ``` +## Type guards + +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 extensively 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('🦄', '🌈'); +//=> '🌈🦄' +``` + +## Type assertions + +The type guards are also available as [type assertions](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions), which throw an error for unexpected types. It is a convenient one-line version of the often repetitive "if-not-expected-type-throw" pattern. + +```ts +import {assert} from '@sindresorhus/is'; + +const handleMovieRatingApiResponse = (response: unknown) => { + assert.plainObject(response); + // `response` is now typed as a plain `object` with `unknown` properties. + + assert.number(response.rating); + // `response.rating` is now typed as a `number`. + + assert.string(response.title); + // `response.title` is now typed as a `string`. + + return `${response.title} (${response.rating * 10})`; +}; + +handleMovieRatingApiResponse({rating: 0.87, title: 'The Matrix'}); +//=> 'The Matrix (8.7)' + +// This throws an error. +handleMovieRatingApiResponse({rating: '🦄'}); +``` + +## Generic type parameters + +The type guards and type assertions are aware of [generic type parameters](https://www.typescriptlang.org/docs/handbook/generics.html), such as `Promise` and `Map`. The default is `unknown` for most cases, since `is` cannot check them at runtime. If the generic type is known at compile-time, either implicitly (inferred) or explicitly (provided), `is` propagates the type so it can be used later. + +Use generic type parameters with caution. They are only checked by the TypeScript compiler, and not checked by `is` at runtime. This can lead to unexpected behavior, where the generic type is _assumed_ at compile-time, but actually is something completely different at runtime. It is best to use `unknown` (default) and type-check the value of the generic type parameter at runtime with `is` or `assert`. + +```ts +import {assert} from '@sindresorhus/is'; + +async function badNumberAssumption(input: unknown) { + // Bad assumption about the generic type parameter fools the compile-time type system. + assert.promise(input); + // `input` is a `Promise` but only assumed to be `Promise`. + + const resolved = await input; + // `resolved` is typed as `number` but was not actually checked at runtime. + + // Multiplication will return NaN if the input promise did not actually contain a number. + return 2 * resolved; +} + +async function goodNumberAssertion(input: unknown) { + assert.promise(input); + // `input` is typed as `Promise` + + const resolved = await input; + // `resolved` is typed as `unknown` + + assert.number(resolved); + // `resolved` is typed as `number` + + // Uses runtime checks so only numbers will reach the multiplication. + return 2 * resolved; +} + +badNumberAssumption(Promise.resolve('An unexpected string')); +//=> NaN + +// This correctly throws an error because of the unexpected string value. +goodNumberAssertion(Promise.resolve('An unexpected string')); +``` ## FAQ @@ -424,6 +602,11 @@ 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. +## For enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of @sindresorhus/is and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-sindresorhus-is?utm_source=npm-sindresorhus-is&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) ## Related @@ -438,14 +621,8 @@ The most common mistakes I noticed in these modules was using `instanceof` for t - [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 +## Maintainers - [Sindre Sorhus](https://github.com/sindresorhus) - [Giora Guttsait](https://github.com/gioragutt) - [Brandon Smith](https://github.com/brandon93s) - - -## License - -MIT diff --git a/node_modules/@types/node/README.md b/node_modules/@types/node/README.md index c9bfd30..48a83fc 100755 --- a/node_modules/@types/node/README.md +++ b/node_modules/@types/node/README.md @@ -2,15 +2,15 @@ > `npm install --save @types/node` # Summary -This package contains type definitions for Node.js (http://nodejs.org/). +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: Sat, 28 Aug 2021 22:01:27 GMT + * Last updated: Thu, 09 Sep 2021 20:01:20 GMT * Dependencies: none * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require` # 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), [Hoàng Văn Khải](https://github.com/KSXGitHub), [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), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Jason Kwok](https://github.com/JasonHK), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), and [Linus Unnebäck](https://github.com/LinusU). +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), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Jason Kwok](https://github.com/JasonHK), [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), and [wafuwafu13](https://github.com/wafuwafu13). diff --git a/node_modules/@types/node/crypto.d.ts b/node_modules/@types/node/crypto.d.ts index 7b1d6d9..8b7c1a3 100755 --- a/node_modules/@types/node/crypto.d.ts +++ b/node_modules/@types/node/crypto.d.ts @@ -508,6 +508,18 @@ declare module 'crypto' { * 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). */ @@ -535,6 +547,10 @@ declare module 'crypto' { */ class KeyObject { private constructor(); + /** + * @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: @@ -565,8 +581,11 @@ declare module 'crypto' { * through this property can be used to uniquely identify a key or to compromise * the security of the key. * - * RSA-PSS parameters, DH, or any future key type details might be exposed via this - * API using additional attributes. + * 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; @@ -2207,7 +2226,7 @@ declare module 'crypto' { function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean; /** @deprecated since v10.0.0 */ const DEFAULT_ENCODING: BufferEncoding; - type KeyType = 'rsa' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448'; + type KeyType = 'rsa' | 'rsa-pss' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448'; type KeyFormat = 'pem' | 'der'; interface BasePrivateKeyEncodingOptions { format: T; @@ -2238,6 +2257,16 @@ declare module 'crypto' { */ publicExponent?: number | undefined; } + interface RSAPSSKeyPairKeyObjectOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * @default 0x10001 + */ + publicExponent?: number | undefined; + } interface DSAKeyPairKeyObjectOptions { /** * Key size in bits @@ -2265,6 +2294,23 @@ declare module 'crypto' { type: 'pkcs1' | 'pkcs8'; }; } + interface RSAPSSKeyPairOptions { + /** + * Key size in bits + */ + modulusLength: number; + /** + * @default 0x10001 + */ + publicExponent?: number | undefined; + publicKeyEncoding: { + type: 'spki'; + format: PubF; + }; + privateKeyEncoding: BasePrivateKeyEncodingOptions & { + type: 'pkcs8'; + }; + } interface DSAKeyPairOptions { /** * Key size in bits @@ -2374,13 +2420,18 @@ declare module 'crypto' { * 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'`, `'dsa'`, `'ec'`, `'ed25519'`, `'ed448'`, `'x25519'`, `'x448'`, or `'dh'`. + * @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; @@ -2455,6 +2506,11 @@ declare module 'crypto' { 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; @@ -2515,6 +2571,35 @@ declare module 'crypto' { 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'> diff --git a/node_modules/@types/node/fs.d.ts b/node_modules/@types/node/fs.d.ts index 4fa1923..d50eade 100755 --- a/node_modules/@types/node/fs.d.ts +++ b/node_modules/@types/node/fs.d.ts @@ -188,7 +188,7 @@ declare module 'fs' { /** * A class representing a directory stream. * - * Created by {@link opendir}, {@link opendirSync}, or {@link promises.opendir}. + * Created by {@link opendir}, {@link opendirSync}, or `fsPromises.opendir()`. * * ```js * import { opendir } from 'fs/promises'; @@ -208,7 +208,7 @@ declare module 'fs' { */ export class Dir implements AsyncIterable { /** - * The read-only path of this directory as was provided to {@link opendir}, {@link opendirSync}, or {@link promises.opendir}. + * 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; diff --git a/node_modules/@types/node/globals.d.ts b/node_modules/@types/node/globals.d.ts index 5e359db..ae974db 100755 --- a/node_modules/@types/node/globals.d.ts +++ b/node_modules/@types/node/globals.d.ts @@ -185,7 +185,6 @@ declare namespace NodeJS { code?: string | undefined; path?: string | undefined; syscall?: string | undefined; - stack?: string | undefined; } interface ReadableStream extends EventEmitter { diff --git a/node_modules/@types/node/http2.d.ts b/node_modules/@types/node/http2.d.ts index 40bb417..bf0ae2d 100755 --- a/node_modules/@types/node/http2.d.ts +++ b/node_modules/@types/node/http2.d.ts @@ -1714,7 +1714,7 @@ declare module 'http2' { writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this; writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this; /** - * Call {@link tream.pushStream} with the given headers, and wrap the + * 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`. diff --git a/node_modules/@types/node/index.d.ts b/node_modules/@types/node/index.d.ts index a7ea6f8..9636fae 100755 --- a/node_modules/@types/node/index.d.ts +++ b/node_modules/@types/node/index.d.ts @@ -1,5 +1,5 @@ -// Type definitions for non-npm package Node.js 16.7 -// Project: http://nodejs.org/ +// Type definitions for non-npm package Node.js 16.9 +// Project: https://nodejs.org/ // Definitions by: Microsoft TypeScript // DefinitelyTyped // Alberto Schiabel @@ -11,7 +11,6 @@ // Deividas Bakanas // Eugene Y. Q. Shen // Hannes Magnusson -// Hoàng Văn Khải // Huw // Kelvin Jin // Klaus Meinhardt @@ -43,6 +42,7 @@ // Yongsheng Zhang // NodeJS Contributors // Linus Unnebäck +// wafuwafu13 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /** diff --git a/node_modules/@types/node/package.json b/node_modules/@types/node/package.json index 90d3cbe..9319db3 100755 --- a/node_modules/@types/node/package.json +++ b/node_modules/@types/node/package.json @@ -1,6 +1,6 @@ { "name": "@types/node", - "version": "16.7.5", + "version": "16.9.1", "description": "TypeScript definitions for Node.js", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", "license": "MIT", @@ -60,11 +60,6 @@ "url": "https://github.com/Hannes-Magnusson-CK", "githubUsername": "Hannes-Magnusson-CK" }, - { - "name": "Hoàng Văn Khải", - "url": "https://github.com/KSXGitHub", - "githubUsername": "KSXGitHub" - }, { "name": "Huw", "url": "https://github.com/hoo29", @@ -219,6 +214,11 @@ "name": "Linus Unnebäck", "url": "https://github.com/LinusU", "githubUsername": "LinusU" + }, + { + "name": "wafuwafu13", + "url": "https://github.com/wafuwafu13", + "githubUsername": "wafuwafu13" } ], "main": "", @@ -230,6 +230,6 @@ }, "scripts": {}, "dependencies": {}, - "typesPublisherContentHash": "670f012e9875deb3f4d2443913edfd5edd1d4e5d58720d42898cdb89c1915842", + "typesPublisherContentHash": "2d4a0159d689896e5538afa996ef597df6922b3b716729c273148522b74b9f6c", "typeScriptVersion": "3.7" } \ No newline at end of file diff --git a/node_modules/@types/node/stream.d.ts b/node_modules/@types/node/stream.d.ts index 75575cb..9fdf3bd 100755 --- a/node_modules/@types/node/stream.d.ts +++ b/node_modules/@types/node/stream.d.ts @@ -52,12 +52,27 @@ declare module 'stream' { * A utility method for creating Readable Streams out of iterators. */ static from(iterable: Iterable | AsyncIterable, options?: ReadableOptions): Readable; + /** + * Returns whether the stream has been read from or cancelled. + * @since v16.8.0 + */ + static isDisturbed(stream: Readable | NodeJS.ReadableStream): boolean; + /** + * Returns whether the stream was destroyed or errored before emitting `'end'`. + * @since v16.8.0 + */ + 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 + */ + 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 @@ -790,7 +805,30 @@ declare module 'stream' { readonly writableLength: number; readonly writableObjectMode: boolean; readonly writableCorked: number; + 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 | Blob | ArrayBuffer | string | Iterable | AsyncIterable | AsyncGeneratorFunction | Promise | Object): Duplex; _write(chunk: any, encoding: BufferEncoding, callback: (error?: Error | null) => void): void; _writev?( chunks: Array<{ diff --git a/node_modules/@types/node/stream/consumers.d.ts b/node_modules/@types/node/stream/consumers.d.ts index 315308a..ce6c9bb 100755 --- a/node_modules/@types/node/stream/consumers.d.ts +++ b/node_modules/@types/node/stream/consumers.d.ts @@ -11,7 +11,6 @@ interface Blob { stream(): NodeJS.ReadableStream; text(): Promise; } - declare module 'stream/consumers' { import { Readable } from 'node:stream'; function buffer(stream: NodeJS.ReadableStream | Readable | AsyncIterator): Promise; diff --git a/node_modules/@types/node/tls.d.ts b/node_modules/@types/node/tls.d.ts index 4c2f69c..8d523b4 100755 --- a/node_modules/@types/node/tls.d.ts +++ b/node_modules/@types/node/tls.d.ts @@ -160,9 +160,10 @@ declare module 'tls' { encrypted: boolean; /** * String containing the selected ALPN protocol. - * When ALPN has no selected protocol, tlsSocket.alpnProtocol equals false. + * 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 | undefined; + alpnProtocol: string | false | null; /** * Returns an object representing the local certificate. The returned object has * some properties corresponding to the fields of the certificate. diff --git a/node_modules/@types/node/url.d.ts b/node_modules/@types/node/url.d.ts index c85a97a..fe07ea4 100755 --- a/node_modules/@types/node/url.d.ts +++ b/node_modules/@types/node/url.d.ts @@ -697,7 +697,7 @@ declare module 'url' { * 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 {@link earchParams[@@iterator]}. + * Alias for `urlSearchParams[@@iterator]()`. */ entries(): IterableIterator<[string, string]>; /** diff --git a/node_modules/@types/node/util.d.ts b/node_modules/@types/node/util.d.ts index 9d8cfe2..b8cb07e 100755 --- a/node_modules/@types/node/util.d.ts +++ b/node_modules/@types/node/util.d.ts @@ -141,6 +141,14 @@ declare module 'util' { * @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 + */ + export function toUSVString(string: string): string; /** * 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 diff --git a/node_modules/@types/node/vm.d.ts b/node_modules/@types/node/vm.d.ts index 9d8b8eb..48d1fc8 100755 --- a/node_modules/@types/node/vm.d.ts +++ b/node_modules/@types/node/vm.d.ts @@ -267,7 +267,11 @@ declare module 'vm' { * @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 diff --git a/node_modules/@types/ws/LICENSE b/node_modules/@types/ws/LICENSE new file mode 100755 index 0000000..9e841e7 --- /dev/null +++ b/node_modules/@types/ws/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/node_modules/@types/ws/README.md b/node_modules/@types/ws/README.md new file mode 100755 index 0000000..87ba866 --- /dev/null +++ b/node_modules/@types/ws/README.md @@ -0,0 +1,16 @@ +# Installation +> `npm install --save @types/ws` + +# Summary +This package contains type definitions for ws (https://github.com/websockets/ws). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ws. + +### Additional Details + * Last updated: Mon, 19 Jul 2021 23:01:29 GMT + * Dependencies: [@types/node](https://npmjs.com/package/@types/node) + * Global values: none + +# Credits +These definitions were written by [Paul Loyd](https://github.com/loyd), [Margus Lamp](https://github.com/mlamp), [Philippe D'Alva](https://github.com/TitaneBoy), [reduckted](https://github.com/reduckted), [teidesu](https://github.com/teidesu), [Bartosz Wojtkowiak](https://github.com/wojtkowiak), and [Kyle Hensel](https://github.com/k-yle). diff --git a/node_modules/@types/ws/index.d.ts b/node_modules/@types/ws/index.d.ts new file mode 100755 index 0000000..d2adbcf --- /dev/null +++ b/node_modules/@types/ws/index.d.ts @@ -0,0 +1,353 @@ +// Type definitions for ws 7.4 +// Project: https://github.com/websockets/ws +// Definitions by: Paul Loyd +// Margus Lamp +// Philippe D'Alva +// reduckted +// teidesu +// Bartosz Wojtkowiak +// Kyle Hensel +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { EventEmitter } from "events"; +import { + Agent, + ClientRequest, + ClientRequestArgs, + IncomingMessage, + OutgoingHttpHeaders, + Server as HTTPServer, +} from "http"; +import { Server as HTTPSServer } from "https"; +import { Socket } from "net"; +import { Duplex, DuplexOptions } from "stream"; +import { SecureContextOptions } from "tls"; +import { URL } from "url"; +import { ZlibOptions } from "zlib"; + +// WebSocket socket. +declare class WebSocket extends EventEmitter { + /** The connection is not yet open. */ + static readonly CONNECTING: 0; + /** The connection is open and ready to communicate. */ + static readonly OPEN: 1; + /** The connection is in the process of closing. */ + static readonly CLOSING: 2; + /** The connection is closed. */ + static readonly CLOSED: 3; + + binaryType: "nodebuffer" | "arraybuffer" | "fragments"; + readonly bufferedAmount: number; + readonly extensions: string; + readonly protocol: string; + /** The current state of the connection */ + readonly readyState: + | typeof WebSocket.CONNECTING + | typeof WebSocket.OPEN + | typeof WebSocket.CLOSING + | typeof WebSocket.CLOSED; + readonly url: string; + + /** The connection is not yet open. */ + readonly CONNECTING: 0; + /** The connection is open and ready to communicate. */ + readonly OPEN: 1; + /** The connection is in the process of closing. */ + readonly CLOSING: 2; + /** The connection is closed. */ + readonly CLOSED: 3; + + onopen: (event: WebSocket.OpenEvent) => void; + onerror: (event: WebSocket.ErrorEvent) => void; + onclose: (event: WebSocket.CloseEvent) => void; + onmessage: (event: WebSocket.MessageEvent) => void; + + constructor(address: string | URL, options?: WebSocket.ClientOptions | ClientRequestArgs); + constructor( + address: string | URL, + protocols?: string | string[], + options?: WebSocket.ClientOptions | ClientRequestArgs, + ); + + close(code?: number, data?: string): void; + ping(data?: any, mask?: boolean, cb?: (err: Error) => void): void; + pong(data?: any, mask?: boolean, cb?: (err: Error) => void): void; + send(data: any, cb?: (err?: Error) => void): void; + send( + data: any, + options: { mask?: boolean | undefined; binary?: boolean | undefined; compress?: boolean | undefined; fin?: boolean | undefined }, + cb?: (err?: Error) => void, + ): void; + terminate(): void; + + // HTML5 WebSocket events + addEventListener( + method: "message", + cb: (event: { data: any; type: string; target: WebSocket }) => void, + options?: WebSocket.EventListenerOptions, + ): void; + addEventListener( + method: "close", + cb: (event: { wasClean: boolean; code: number; reason: string; target: WebSocket }) => void, + options?: WebSocket.EventListenerOptions, + ): void; + addEventListener( + method: "error", + cb: (event: { error: any; message: any; type: string; target: WebSocket }) => void, + options?: WebSocket.EventListenerOptions, + ): void; + addEventListener( + method: "open", + cb: (event: { target: WebSocket }) => void, + options?: WebSocket.EventListenerOptions, + ): void; + addEventListener(method: string, listener: () => void, options?: WebSocket.EventListenerOptions): void; + + removeEventListener(method: "message", cb?: (event: { data: any; type: string; target: WebSocket }) => void): void; + removeEventListener( + method: "close", + cb?: (event: { wasClean: boolean; code: number; reason: string; target: WebSocket }) => void, + ): void; + removeEventListener( + method: "error", + cb?: (event: { error: any; message: any; type: string; target: WebSocket }) => void, + ): void; + removeEventListener(method: "open", cb?: (event: { target: WebSocket }) => void): void; + removeEventListener(method: string, listener?: () => void): void; + + // Events + on(event: "close", listener: (this: WebSocket, code: number, reason: string) => void): this; + on(event: "error", listener: (this: WebSocket, err: Error) => void): this; + on(event: "upgrade", listener: (this: WebSocket, request: IncomingMessage) => void): this; + on(event: "message", listener: (this: WebSocket, data: WebSocket.Data) => void): this; + on(event: "open", listener: (this: WebSocket) => void): this; + on(event: "ping" | "pong", listener: (this: WebSocket, data: Buffer) => void): this; + on( + event: "unexpected-response", + listener: (this: WebSocket, request: ClientRequest, response: IncomingMessage) => void, + ): this; + on(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this; + + once(event: "close", listener: (this: WebSocket, code: number, reason: string) => void): this; + once(event: "error", listener: (this: WebSocket, err: Error) => void): this; + once(event: "upgrade", listener: (this: WebSocket, request: IncomingMessage) => void): this; + once(event: "message", listener: (this: WebSocket, data: WebSocket.Data) => void): this; + once(event: "open", listener: (this: WebSocket) => void): this; + once(event: "ping" | "pong", listener: (this: WebSocket, data: Buffer) => void): this; + once( + event: "unexpected-response", + listener: (this: WebSocket, request: ClientRequest, response: IncomingMessage) => void, + ): this; + once(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this; + + off(event: "close", listener: (this: WebSocket, code: number, reason: string) => void): this; + off(event: "error", listener: (this: WebSocket, err: Error) => void): this; + off(event: "upgrade", listener: (this: WebSocket, request: IncomingMessage) => void): this; + off(event: "message", listener: (this: WebSocket, data: WebSocket.Data) => void): this; + off(event: "open", listener: (this: WebSocket) => void): this; + off(event: "ping" | "pong", listener: (this: WebSocket, data: Buffer) => void): this; + off( + event: "unexpected-response", + listener: (this: WebSocket, request: ClientRequest, response: IncomingMessage) => void, + ): this; + off(event: string | symbol, listener: (this: WebSocket, ...args: any[]) => void): this; + + addListener(event: "close", listener: (code: number, message: string) => void): this; + addListener(event: "error", listener: (err: Error) => void): this; + addListener(event: "upgrade", listener: (request: IncomingMessage) => void): this; + addListener(event: "message", listener: (data: WebSocket.Data) => void): this; + addListener(event: "open", listener: () => void): this; + addListener(event: "ping" | "pong", listener: (data: Buffer) => void): this; + addListener( + event: "unexpected-response", + listener: (request: ClientRequest, response: IncomingMessage) => void, + ): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + removeListener(event: "close", listener: (code: number, message: string) => void): this; + removeListener(event: "error", listener: (err: Error) => void): this; + removeListener(event: "upgrade", listener: (request: IncomingMessage) => void): this; + removeListener(event: "message", listener: (data: WebSocket.Data) => void): this; + removeListener(event: "open", listener: () => void): this; + removeListener(event: "ping" | "pong", listener: (data: Buffer) => void): this; + removeListener( + event: "unexpected-response", + listener: (request: ClientRequest, response: IncomingMessage) => void, + ): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; +} + +declare namespace WebSocket { + /** + * Data represents the message payload received over the WebSocket. + */ + type Data = string | Buffer | ArrayBuffer | Buffer[]; + + /** + * CertMeta represents the accepted types for certificate & key data. + */ + type CertMeta = string | string[] | Buffer | Buffer[]; + + /** + * VerifyClientCallbackSync is a synchronous callback used to inspect the + * incoming message. The return value (boolean) of the function determines + * whether or not to accept the handshake. + */ + type VerifyClientCallbackSync = (info: { origin: string; secure: boolean; req: IncomingMessage }) => boolean; + + /** + * VerifyClientCallbackAsync is an asynchronous callback used to inspect the + * incoming message. The return value (boolean) of the function determines + * whether or not to accept the handshake. + */ + type VerifyClientCallbackAsync = ( + info: { origin: string; secure: boolean; req: IncomingMessage }, + callback: (res: boolean, code?: number, message?: string, headers?: OutgoingHttpHeaders) => void, + ) => void; + + interface ClientOptions extends SecureContextOptions { + protocol?: string | undefined; + followRedirects?: boolean | undefined; + handshakeTimeout?: number | undefined; + maxRedirects?: number | undefined; + perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined; + localAddress?: string | undefined; + protocolVersion?: number | undefined; + headers?: { [key: string]: string } | undefined; + origin?: string | undefined; + agent?: Agent | undefined; + host?: string | undefined; + family?: number | undefined; + checkServerIdentity?(servername: string, cert: CertMeta): boolean; + rejectUnauthorized?: boolean | undefined; + maxPayload?: number | undefined; + } + + interface PerMessageDeflateOptions { + serverNoContextTakeover?: boolean | undefined; + clientNoContextTakeover?: boolean | undefined; + serverMaxWindowBits?: number | undefined; + clientMaxWindowBits?: number | undefined; + zlibDeflateOptions?: { + flush?: number | undefined; + finishFlush?: number | undefined; + chunkSize?: number | undefined; + windowBits?: number | undefined; + level?: number | undefined; + memLevel?: number | undefined; + strategy?: number | undefined; + dictionary?: Buffer | Buffer[] | DataView | undefined; + info?: boolean | undefined; + } | undefined; + zlibInflateOptions?: ZlibOptions | undefined; + threshold?: number | undefined; + concurrencyLimit?: number | undefined; + } + + interface OpenEvent { + type: string; + target: WebSocket; + } + + interface ErrorEvent { + error: any; + message: string; + type: string; + target: WebSocket; + } + + interface CloseEvent { + wasClean: boolean; + code: number; + reason: string; + type: string; + target: WebSocket; + } + + interface MessageEvent { + data: Data; + type: string; + target: WebSocket; + } + + interface EventListenerOptions { + once?: boolean | undefined; + } + + interface ServerOptions { + host?: string | undefined; + port?: number | undefined; + backlog?: number | undefined; + server?: HTTPServer | HTTPSServer | undefined; + verifyClient?: VerifyClientCallbackAsync | VerifyClientCallbackSync | undefined; + handleProtocols?: any; + path?: string | undefined; + noServer?: boolean | undefined; + clientTracking?: boolean | undefined; + perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined; + maxPayload?: number | undefined; + } + + interface AddressInfo { + address: string; + family: string; + port: number; + } + + // WebSocket Server + class Server extends EventEmitter { + options: ServerOptions; + path: string; + clients: Set; + + constructor(options?: ServerOptions, callback?: () => void); + + address(): AddressInfo | string; + close(cb?: (err?: Error) => void): void; + handleUpgrade( + request: IncomingMessage, + socket: Socket, + upgradeHead: Buffer, + callback: (client: WebSocket, request: IncomingMessage) => void, + ): void; + shouldHandle(request: IncomingMessage): boolean | Promise; + + // Events + on(event: "connection", cb: (this: Server, socket: WebSocket, request: IncomingMessage) => void): this; + on(event: "error", cb: (this: Server, error: Error) => void): this; + on(event: "headers", cb: (this: Server, headers: string[], request: IncomingMessage) => void): this; + on(event: "close" | "listening", cb: (this: Server) => void): this; + on(event: string | symbol, listener: (this: Server, ...args: any[]) => void): this; + + once(event: "connection", cb: (this: Server, socket: WebSocket, request: IncomingMessage) => void): this; + once(event: "error", cb: (this: Server, error: Error) => void): this; + once(event: "headers", cb: (this: Server, headers: string[], request: IncomingMessage) => void): this; + once(event: "close" | "listening", cb: (this: Server) => void): this; + once(event: string | symbol, listener: (...args: any[]) => void): this; + + off(event: "connection", cb: (this: Server, socket: WebSocket, request: IncomingMessage) => void): this; + off(event: "error", cb: (this: Server, error: Error) => void): this; + off(event: "headers", cb: (this: Server, headers: string[], request: IncomingMessage) => void): this; + off(event: "close" | "listening", cb: (this: Server) => void): this; + off(event: string | symbol, listener: (this: Server, ...args: any[]) => void): this; + + addListener(event: "connection", cb: (client: WebSocket, request: IncomingMessage) => void): this; + addListener(event: "error", cb: (err: Error) => void): this; + addListener(event: "headers", cb: (headers: string[], request: IncomingMessage) => void): this; + addListener(event: "close" | "listening", cb: () => void): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + removeListener(event: "connection", cb: (client: WebSocket) => void): this; + removeListener(event: "error", cb: (err: Error) => void): this; + removeListener(event: "headers", cb: (headers: string[], request: IncomingMessage) => void): this; + removeListener(event: "close" | "listening", cb: () => void): this; + removeListener(event: string | symbol, listener: (...args: any[]) => void): this; + } + + // WebSocket stream + function createWebSocketStream(websocket: WebSocket, options?: DuplexOptions): Duplex; +} + +export = WebSocket; diff --git a/node_modules/@types/ws/package.json b/node_modules/@types/ws/package.json new file mode 100755 index 0000000..b3ea358 --- /dev/null +++ b/node_modules/@types/ws/package.json @@ -0,0 +1,57 @@ +{ + "name": "@types/ws", + "version": "7.4.7", + "description": "TypeScript definitions for ws", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ws", + "license": "MIT", + "contributors": [ + { + "name": "Paul Loyd", + "url": "https://github.com/loyd", + "githubUsername": "loyd" + }, + { + "name": "Margus Lamp", + "url": "https://github.com/mlamp", + "githubUsername": "mlamp" + }, + { + "name": "Philippe D'Alva", + "url": "https://github.com/TitaneBoy", + "githubUsername": "TitaneBoy" + }, + { + "name": "reduckted", + "url": "https://github.com/reduckted", + "githubUsername": "reduckted" + }, + { + "name": "teidesu", + "url": "https://github.com/teidesu", + "githubUsername": "teidesu" + }, + { + "name": "Bartosz Wojtkowiak", + "url": "https://github.com/wojtkowiak", + "githubUsername": "wojtkowiak" + }, + { + "name": "Kyle Hensel", + "url": "https://github.com/k-yle", + "githubUsername": "k-yle" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/ws" + }, + "scripts": {}, + "dependencies": { + "@types/node": "*" + }, + "typesPublisherContentHash": "bfa5f3d19c5c1f1c415aec2e218c5c83c4c88b441bb05b2c022b6cfee2c36dfd", + "typeScriptVersion": "3.6" +} \ No newline at end of file diff --git a/node_modules/abort-controller/README.md b/node_modules/abort-controller/README.md deleted file mode 100755 index 9de3e45..0000000 --- a/node_modules/abort-controller/README.md +++ /dev/null @@ -1,98 +0,0 @@ -# abort-controller - -[![npm version](https://img.shields.io/npm/v/abort-controller.svg)](https://www.npmjs.com/package/abort-controller) -[![Downloads/month](https://img.shields.io/npm/dm/abort-controller.svg)](http://www.npmtrends.com/abort-controller) -[![Build Status](https://travis-ci.org/mysticatea/abort-controller.svg?branch=master)](https://travis-ci.org/mysticatea/abort-controller) -[![Coverage Status](https://codecov.io/gh/mysticatea/abort-controller/branch/master/graph/badge.svg)](https://codecov.io/gh/mysticatea/abort-controller) -[![Dependency Status](https://david-dm.org/mysticatea/abort-controller.svg)](https://david-dm.org/mysticatea/abort-controller) - -An implementation of [WHATWG AbortController interface](https://dom.spec.whatwg.org/#interface-abortcontroller). - -```js -import AbortController from "abort-controller" - -const controller = new AbortController() -const signal = controller.signal - -signal.addEventListener("abort", () => { - console.log("aborted!") -}) - -controller.abort() -``` - -> https://jsfiddle.net/1r2994qp/1/ - -## 💿 Installation - -Use [npm](https://www.npmjs.com/) to install then use a bundler. - -``` -npm install abort-controller -``` - -Or download from [`dist` directory](./dist). - -- [dist/abort-controller.mjs](dist/abort-controller.mjs) ... ES modules version. -- [dist/abort-controller.js](dist/abort-controller.js) ... Common JS version. -- [dist/abort-controller.umd.js](dist/abort-controller.umd.js) ... UMD (Universal Module Definition) version. This is transpiled by [Babel](https://babeljs.io/) for IE 11. - -## 📖 Usage - -### Basic - -```js -import AbortController from "abort-controller" -// or -const AbortController = require("abort-controller") - -// or UMD version defines a global variable: -const AbortController = window.AbortControllerShim -``` - -If your bundler recognizes `browser` field of `package.json`, the imported `AbortController` is the native one and it doesn't contain shim (even if the native implementation was nothing). -If you wanted to polyfill `AbortController` for IE, use `abort-controller/polyfill`. - -### Polyfilling - -Importing `abort-controller/polyfill` assigns the `AbortController` shim to the `AbortController` global variable if the native implementation was nothing. - -```js -import "abort-controller/polyfill" -// or -require("abort-controller/polyfill") -``` - -### API - -#### AbortController - -> https://dom.spec.whatwg.org/#interface-abortcontroller - -##### controller.signal - -The [AbortSignal](https://dom.spec.whatwg.org/#interface-AbortSignal) object which is associated to this controller. - -##### controller.abort() - -Notify `abort` event to listeners that the `signal` has. - -## 📰 Changelog - -- See [GitHub releases](https://github.com/mysticatea/abort-controller/releases). - -## 🍻 Contributing - -Contributing is welcome ❤️ - -Please use GitHub issues/PRs. - -### Development tools - -- `npm install` installs dependencies for development. -- `npm test` runs tests and measures code coverage. -- `npm run clean` removes temporary files of tests. -- `npm run coverage` opens code coverage of the previous test with your default browser. -- `npm run lint` runs ESLint. -- `npm run build` generates `dist` codes. -- `npm run watch` runs tests on each file change. diff --git a/node_modules/abort-controller/browser.js b/node_modules/abort-controller/browser.js deleted file mode 100755 index b0c5ec3..0000000 --- a/node_modules/abort-controller/browser.js +++ /dev/null @@ -1,13 +0,0 @@ -/*globals self, window */ -"use strict" - -/*eslint-disable @mysticatea/prettier */ -const { AbortController, AbortSignal } = - typeof self !== "undefined" ? self : - typeof window !== "undefined" ? window : - /* otherwise */ undefined -/*eslint-enable @mysticatea/prettier */ - -module.exports = AbortController -module.exports.AbortSignal = AbortSignal -module.exports.default = AbortController diff --git a/node_modules/abort-controller/browser.mjs b/node_modules/abort-controller/browser.mjs deleted file mode 100755 index a8f321a..0000000 --- a/node_modules/abort-controller/browser.mjs +++ /dev/null @@ -1,11 +0,0 @@ -/*globals self, window */ - -/*eslint-disable @mysticatea/prettier */ -const { AbortController, AbortSignal } = - typeof self !== "undefined" ? self : - typeof window !== "undefined" ? window : - /* otherwise */ undefined -/*eslint-enable @mysticatea/prettier */ - -export default AbortController -export { AbortController, AbortSignal } diff --git a/node_modules/abort-controller/dist/abort-controller.d.ts b/node_modules/abort-controller/dist/abort-controller.d.ts deleted file mode 100755 index 75852fb..0000000 --- a/node_modules/abort-controller/dist/abort-controller.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { EventTarget } from "event-target-shim" - -type Events = { - abort: any -} -type EventAttributes = { - onabort: any -} -/** - * The signal class. - * @see https://dom.spec.whatwg.org/#abortsignal - */ -declare class AbortSignal extends EventTarget { - /** - * AbortSignal cannot be constructed directly. - */ - constructor() - /** - * Returns `true` if this `AbortSignal`"s `AbortController` has signaled to abort, and `false` otherwise. - */ - readonly aborted: boolean -} -/** - * The AbortController. - * @see https://dom.spec.whatwg.org/#abortcontroller - */ -declare class AbortController { - /** - * Initialize this controller. - */ - constructor() - /** - * Returns the `AbortSignal` object associated with this object. - */ - readonly signal: AbortSignal - /** - * Abort and signal to any observers that the associated activity is to be aborted. - */ - abort(): void -} - -export default AbortController -export { AbortController, AbortSignal } diff --git a/node_modules/abort-controller/dist/abort-controller.js b/node_modules/abort-controller/dist/abort-controller.js deleted file mode 100755 index 49af739..0000000 --- a/node_modules/abort-controller/dist/abort-controller.js +++ /dev/null @@ -1,127 +0,0 @@ -/** - * @author Toru Nagashima - * See LICENSE file in root directory for full license. - */ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var eventTargetShim = require('event-target-shim'); - -/** - * The signal class. - * @see https://dom.spec.whatwg.org/#abortsignal - */ -class AbortSignal extends eventTargetShim.EventTarget { - /** - * AbortSignal cannot be constructed directly. - */ - constructor() { - super(); - throw new TypeError("AbortSignal cannot be constructed directly"); - } - /** - * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise. - */ - get aborted() { - const aborted = abortedFlags.get(this); - if (typeof aborted !== "boolean") { - throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`); - } - return aborted; - } -} -eventTargetShim.defineEventAttribute(AbortSignal.prototype, "abort"); -/** - * Create an AbortSignal object. - */ -function createAbortSignal() { - const signal = Object.create(AbortSignal.prototype); - eventTargetShim.EventTarget.call(signal); - abortedFlags.set(signal, false); - return signal; -} -/** - * Abort a given signal. - */ -function abortSignal(signal) { - if (abortedFlags.get(signal) !== false) { - return; - } - abortedFlags.set(signal, true); - signal.dispatchEvent({ type: "abort" }); -} -/** - * Aborted flag for each instances. - */ -const abortedFlags = new WeakMap(); -// Properties should be enumerable. -Object.defineProperties(AbortSignal.prototype, { - aborted: { enumerable: true }, -}); -// `toString()` should return `"[object AbortSignal]"` -if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { - Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, { - configurable: true, - value: "AbortSignal", - }); -} - -/** - * The AbortController. - * @see https://dom.spec.whatwg.org/#abortcontroller - */ -class AbortController { - /** - * Initialize this controller. - */ - constructor() { - signals.set(this, createAbortSignal()); - } - /** - * Returns the `AbortSignal` object associated with this object. - */ - get signal() { - return getSignal(this); - } - /** - * Abort and signal to any observers that the associated activity is to be aborted. - */ - abort() { - abortSignal(getSignal(this)); - } -} -/** - * Associated signals. - */ -const signals = new WeakMap(); -/** - * Get the associated signal of a given controller. - */ -function getSignal(controller) { - const signal = signals.get(controller); - if (signal == null) { - throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`); - } - return signal; -} -// Properties should be enumerable. -Object.defineProperties(AbortController.prototype, { - signal: { enumerable: true }, - abort: { enumerable: true }, -}); -if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { - Object.defineProperty(AbortController.prototype, Symbol.toStringTag, { - configurable: true, - value: "AbortController", - }); -} - -exports.AbortController = AbortController; -exports.AbortSignal = AbortSignal; -exports.default = AbortController; - -module.exports = AbortController -module.exports.AbortController = module.exports["default"] = AbortController -module.exports.AbortSignal = AbortSignal -//# sourceMappingURL=abort-controller.js.map diff --git a/node_modules/abort-controller/dist/abort-controller.js.map b/node_modules/abort-controller/dist/abort-controller.js.map deleted file mode 100755 index cfdcafd..0000000 --- a/node_modules/abort-controller/dist/abort-controller.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abort-controller.js","sources":["../src/abort-signal.ts","../src/abort-controller.ts"],"sourcesContent":["import {\n // Event,\n EventTarget,\n // Type,\n defineEventAttribute,\n} from \"event-target-shim\"\n\n// Known Limitation\n// Use `any` because the type of `AbortSignal` in `lib.dom.d.ts` is wrong and\n// to make assignable our `AbortSignal` into that.\n// https://github.com/Microsoft/TSJS-lib-generator/pull/623\ntype Events = {\n abort: any // Event & Type<\"abort\">\n}\ntype EventAttributes = {\n onabort: any // Event & Type<\"abort\">\n}\n\n/**\n * The signal class.\n * @see https://dom.spec.whatwg.org/#abortsignal\n */\nexport default class AbortSignal extends EventTarget {\n /**\n * AbortSignal cannot be constructed directly.\n */\n public constructor() {\n super()\n throw new TypeError(\"AbortSignal cannot be constructed directly\")\n }\n\n /**\n * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise.\n */\n public get aborted(): boolean {\n const aborted = abortedFlags.get(this)\n if (typeof aborted !== \"boolean\") {\n throw new TypeError(\n `Expected 'this' to be an 'AbortSignal' object, but got ${\n this === null ? \"null\" : typeof this\n }`,\n )\n }\n return aborted\n }\n}\ndefineEventAttribute(AbortSignal.prototype, \"abort\")\n\n/**\n * Create an AbortSignal object.\n */\nexport function createAbortSignal(): AbortSignal {\n const signal = Object.create(AbortSignal.prototype)\n EventTarget.call(signal)\n abortedFlags.set(signal, false)\n return signal\n}\n\n/**\n * Abort a given signal.\n */\nexport function abortSignal(signal: AbortSignal): void {\n if (abortedFlags.get(signal) !== false) {\n return\n }\n\n abortedFlags.set(signal, true)\n signal.dispatchEvent<\"abort\">({ type: \"abort\" })\n}\n\n/**\n * Aborted flag for each instances.\n */\nconst abortedFlags = new WeakMap()\n\n// Properties should be enumerable.\nObject.defineProperties(AbortSignal.prototype, {\n aborted: { enumerable: true },\n})\n\n// `toString()` should return `\"[object AbortSignal]\"`\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortSignal\",\n })\n}\n","import AbortSignal, { abortSignal, createAbortSignal } from \"./abort-signal\"\n\n/**\n * The AbortController.\n * @see https://dom.spec.whatwg.org/#abortcontroller\n */\nexport default class AbortController {\n /**\n * Initialize this controller.\n */\n public constructor() {\n signals.set(this, createAbortSignal())\n }\n\n /**\n * Returns the `AbortSignal` object associated with this object.\n */\n public get signal(): AbortSignal {\n return getSignal(this)\n }\n\n /**\n * Abort and signal to any observers that the associated activity is to be aborted.\n */\n public abort(): void {\n abortSignal(getSignal(this))\n }\n}\n\n/**\n * Associated signals.\n */\nconst signals = new WeakMap()\n\n/**\n * Get the associated signal of a given controller.\n */\nfunction getSignal(controller: AbortController): AbortSignal {\n const signal = signals.get(controller)\n if (signal == null) {\n throw new TypeError(\n `Expected 'this' to be an 'AbortController' object, but got ${\n controller === null ? \"null\" : typeof controller\n }`,\n )\n }\n return signal\n}\n\n// Properties should be enumerable.\nObject.defineProperties(AbortController.prototype, {\n signal: { enumerable: true },\n abort: { enumerable: true },\n})\n\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortController.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortController\",\n })\n}\n\nexport { AbortController, AbortSignal }\n"],"names":["EventTarget","defineEventAttribute"],"mappings":";;;;;;;;;;AAkBA;;;;AAIA,MAAqB,WAAY,SAAQA,2BAAoC;;;;IAIzE;QACI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E,MAAM,CAAC,WAAW,EAAE;QAC7D,YAAY,EAAE,IAAI;QAClB,KAAK,EAAE,aAAa;KACvB,CAAC,CAAA;CACL;;ACpFD;;;;AAIA,MAAqB,eAAe;;;;IAIhC;QACI,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAA;KACzC;;;;IAKD,IAAW,MAAM;QACb,OAAO,SAAS,CAAC,IAAI,CAAC,CAAA;KACzB;;;;IAKM,KAAK;QACR,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;KAC/B;CACJ;;;;AAKD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAgC,CAAA;;;;AAK3D,SAAS,SAAS,CAAC,UAA2B;IAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IACtC,IAAI,MAAM,IAAI,IAAI,EAAE;QAChB,MAAM,IAAI,SAAS,CACf,8DACI,UAAU,KAAK,IAAI,GAAG,MAAM,GAAG,OAAO,UAC1C,EAAE,CACL,CAAA;KACJ;IACD,OAAO,MAAM,CAAA;CAChB;;AAGD,MAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC,SAAS,EAAE;IAC/C,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;IAC5B,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;CAC9B,CAAC,CAAA;AAEF,IAAI,OAAO,MAAM,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,WAAW,KAAK,QAAQ,EAAE;IACxE,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,EAAE;QACjE,YAAY,EAAE,IAAI;QAClB,KAAK,EAAE,iBAAiB;KAC3B,CAAC,CAAA;CACL;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/abort-controller/dist/abort-controller.mjs b/node_modules/abort-controller/dist/abort-controller.mjs deleted file mode 100755 index 88ba22d..0000000 --- a/node_modules/abort-controller/dist/abort-controller.mjs +++ /dev/null @@ -1,118 +0,0 @@ -/** - * @author Toru Nagashima - * See LICENSE file in root directory for full license. - */ -import { EventTarget, defineEventAttribute } from 'event-target-shim'; - -/** - * The signal class. - * @see https://dom.spec.whatwg.org/#abortsignal - */ -class AbortSignal extends EventTarget { - /** - * AbortSignal cannot be constructed directly. - */ - constructor() { - super(); - throw new TypeError("AbortSignal cannot be constructed directly"); - } - /** - * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise. - */ - get aborted() { - const aborted = abortedFlags.get(this); - if (typeof aborted !== "boolean") { - throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`); - } - return aborted; - } -} -defineEventAttribute(AbortSignal.prototype, "abort"); -/** - * Create an AbortSignal object. - */ -function createAbortSignal() { - const signal = Object.create(AbortSignal.prototype); - EventTarget.call(signal); - abortedFlags.set(signal, false); - return signal; -} -/** - * Abort a given signal. - */ -function abortSignal(signal) { - if (abortedFlags.get(signal) !== false) { - return; - } - abortedFlags.set(signal, true); - signal.dispatchEvent({ type: "abort" }); -} -/** - * Aborted flag for each instances. - */ -const abortedFlags = new WeakMap(); -// Properties should be enumerable. -Object.defineProperties(AbortSignal.prototype, { - aborted: { enumerable: true }, -}); -// `toString()` should return `"[object AbortSignal]"` -if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { - Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, { - configurable: true, - value: "AbortSignal", - }); -} - -/** - * The AbortController. - * @see https://dom.spec.whatwg.org/#abortcontroller - */ -class AbortController { - /** - * Initialize this controller. - */ - constructor() { - signals.set(this, createAbortSignal()); - } - /** - * Returns the `AbortSignal` object associated with this object. - */ - get signal() { - return getSignal(this); - } - /** - * Abort and signal to any observers that the associated activity is to be aborted. - */ - abort() { - abortSignal(getSignal(this)); - } -} -/** - * Associated signals. - */ -const signals = new WeakMap(); -/** - * Get the associated signal of a given controller. - */ -function getSignal(controller) { - const signal = signals.get(controller); - if (signal == null) { - throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`); - } - return signal; -} -// Properties should be enumerable. -Object.defineProperties(AbortController.prototype, { - signal: { enumerable: true }, - abort: { enumerable: true }, -}); -if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { - Object.defineProperty(AbortController.prototype, Symbol.toStringTag, { - configurable: true, - value: "AbortController", - }); -} - -export default AbortController; -export { AbortController, AbortSignal }; -//# sourceMappingURL=abort-controller.mjs.map diff --git a/node_modules/abort-controller/dist/abort-controller.mjs.map b/node_modules/abort-controller/dist/abort-controller.mjs.map deleted file mode 100755 index 1e8fa6b..0000000 --- a/node_modules/abort-controller/dist/abort-controller.mjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"abort-controller.mjs","sources":["../src/abort-signal.ts","../src/abort-controller.ts"],"sourcesContent":["import {\n // Event,\n EventTarget,\n // Type,\n defineEventAttribute,\n} from \"event-target-shim\"\n\n// Known Limitation\n// Use `any` because the type of `AbortSignal` in `lib.dom.d.ts` is wrong and\n// to make assignable our `AbortSignal` into that.\n// https://github.com/Microsoft/TSJS-lib-generator/pull/623\ntype Events = {\n abort: any // Event & Type<\"abort\">\n}\ntype EventAttributes = {\n onabort: any // Event & Type<\"abort\">\n}\n\n/**\n * The signal class.\n * @see https://dom.spec.whatwg.org/#abortsignal\n */\nexport default class AbortSignal extends EventTarget {\n /**\n * AbortSignal cannot be constructed directly.\n */\n public constructor() {\n super()\n throw new TypeError(\"AbortSignal cannot be constructed directly\")\n }\n\n /**\n * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise.\n */\n public get aborted(): boolean {\n const aborted = abortedFlags.get(this)\n if (typeof aborted !== \"boolean\") {\n throw new TypeError(\n `Expected 'this' to be an 'AbortSignal' object, but got ${\n this === null ? \"null\" : typeof this\n }`,\n )\n }\n return aborted\n }\n}\ndefineEventAttribute(AbortSignal.prototype, \"abort\")\n\n/**\n * Create an AbortSignal object.\n */\nexport function createAbortSignal(): AbortSignal {\n const signal = Object.create(AbortSignal.prototype)\n EventTarget.call(signal)\n abortedFlags.set(signal, false)\n return signal\n}\n\n/**\n * Abort a given signal.\n */\nexport function abortSignal(signal: AbortSignal): void {\n if (abortedFlags.get(signal) !== false) {\n return\n }\n\n abortedFlags.set(signal, true)\n signal.dispatchEvent<\"abort\">({ type: \"abort\" })\n}\n\n/**\n * Aborted flag for each instances.\n */\nconst abortedFlags = new WeakMap()\n\n// Properties should be enumerable.\nObject.defineProperties(AbortSignal.prototype, {\n aborted: { enumerable: true },\n})\n\n// `toString()` should return `\"[object AbortSignal]\"`\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortSignal\",\n })\n}\n","import AbortSignal, { abortSignal, createAbortSignal } from \"./abort-signal\"\n\n/**\n * The AbortController.\n * @see https://dom.spec.whatwg.org/#abortcontroller\n */\nexport default class AbortController {\n /**\n * Initialize this controller.\n */\n public constructor() {\n signals.set(this, createAbortSignal())\n }\n\n /**\n * Returns the `AbortSignal` object associated with this object.\n */\n public get signal(): AbortSignal {\n return getSignal(this)\n }\n\n /**\n * Abort and signal to any observers that the associated activity is to be aborted.\n */\n public abort(): void {\n abortSignal(getSignal(this))\n }\n}\n\n/**\n * Associated signals.\n */\nconst signals = new WeakMap()\n\n/**\n * Get the associated signal of a given controller.\n */\nfunction getSignal(controller: AbortController): AbortSignal {\n const signal = signals.get(controller)\n if (signal == null) {\n throw new TypeError(\n `Expected 'this' to be an 'AbortController' object, but got ${\n controller === null ? \"null\" : typeof controller\n }`,\n )\n }\n return signal\n}\n\n// Properties should be enumerable.\nObject.defineProperties(AbortController.prototype, {\n signal: { enumerable: true },\n abort: { enumerable: true },\n})\n\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortController.prototype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KAC3B,CAAC,CAAA;CACL;;;;;"} \ No newline at end of file diff --git a/node_modules/abort-controller/dist/abort-controller.umd.js b/node_modules/abort-controller/dist/abort-controller.umd.js deleted file mode 100755 index f643cfd..0000000 --- a/node_modules/abort-controller/dist/abort-controller.umd.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * @author Toru Nagashima - * See LICENSE file in root directory for full license. - */(function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports):"function"==typeof define&&define.amd?define(["exports"],b):(a=a||self,b(a.AbortControllerShim={}))})(this,function(a){'use strict';function b(a){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},b(a)}function c(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function d(a,b){for(var c,d=0;d\n * @copyright 2015 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n/**\n * @typedef {object} PrivateData\n * @property {EventTarget} eventTarget The event target.\n * @property {{type:string}} event The original event object.\n * @property {number} eventPhase The current event phase.\n * @property {EventTarget|null} currentTarget The current event target.\n * @property {boolean} canceled The flag to prevent default.\n * @property {boolean} stopped The flag to stop propagation.\n * @property {boolean} immediateStopped The flag to stop propagation immediately.\n * @property {Function|null} passiveListener The listener if the current listener is passive. Otherwise this is null.\n * @property {number} timeStamp The unix time.\n * @private\n */\n\n/**\n * Private data for event wrappers.\n * @type {WeakMap}\n * @private\n */\nconst privateData = new WeakMap();\n\n/**\n * Cache for wrapper classes.\n * @type {WeakMap}\n * @private\n */\nconst wrappers = new WeakMap();\n\n/**\n * Get private data.\n * @param {Event} event The event object to get private data.\n * @returns {PrivateData} The private data of the event.\n * @private\n */\nfunction pd(event) {\n const retv = privateData.get(event);\n console.assert(\n retv != null,\n \"'this' is expected an Event object, but got\",\n event\n );\n return retv\n}\n\n/**\n * https://dom.spec.whatwg.org/#set-the-canceled-flag\n * @param data {PrivateData} private data.\n */\nfunction setCancelFlag(data) {\n if (data.passiveListener != null) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(\n \"Unable to preventDefault inside passive event listener invocation.\",\n data.passiveListener\n );\n }\n return\n }\n if (!data.event.cancelable) {\n return\n }\n\n data.canceled = true;\n if (typeof data.event.preventDefault === \"function\") {\n data.event.preventDefault();\n }\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#interface-event\n * @private\n */\n/**\n * The event wrapper.\n * @constructor\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Event|{type:string}} event The original event to wrap.\n */\nfunction Event(eventTarget, event) {\n privateData.set(this, {\n eventTarget,\n event,\n eventPhase: 2,\n currentTarget: eventTarget,\n canceled: false,\n stopped: false,\n immediateStopped: false,\n passiveListener: null,\n timeStamp: event.timeStamp || Date.now(),\n });\n\n // https://heycam.github.io/webidl/#Unforgeable\n Object.defineProperty(this, \"isTrusted\", { value: false, enumerable: true });\n\n // Define accessors\n const keys = Object.keys(event);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!(key in this)) {\n Object.defineProperty(this, key, defineRedirectDescriptor(key));\n }\n }\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEvent.prototype = {\n /**\n * The type of this event.\n * @type {string}\n */\n get type() {\n return pd(this).event.type\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get target() {\n return pd(this).eventTarget\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n */\n get currentTarget() {\n return pd(this).currentTarget\n },\n\n /**\n * @returns {EventTarget[]} The composed path of this event.\n */\n composedPath() {\n const currentTarget = pd(this).currentTarget;\n if (currentTarget == null) {\n return []\n }\n return [currentTarget]\n },\n\n /**\n * Constant of NONE.\n * @type {number}\n */\n get NONE() {\n return 0\n },\n\n /**\n * Constant of CAPTURING_PHASE.\n * @type {number}\n */\n get CAPTURING_PHASE() {\n return 1\n },\n\n /**\n * Constant of AT_TARGET.\n * @type {number}\n */\n get AT_TARGET() {\n return 2\n },\n\n /**\n * Constant of BUBBLING_PHASE.\n * @type {number}\n */\n get BUBBLING_PHASE() {\n return 3\n },\n\n /**\n * The target of this event.\n * @type {number}\n */\n get eventPhase() {\n return pd(this).eventPhase\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopPropagation() {\n const data = pd(this);\n\n data.stopped = true;\n if (typeof data.event.stopPropagation === \"function\") {\n data.event.stopPropagation();\n }\n },\n\n /**\n * Stop event bubbling.\n * @returns {void}\n */\n stopImmediatePropagation() {\n const data = pd(this);\n\n data.stopped = true;\n data.immediateStopped = true;\n if (typeof data.event.stopImmediatePropagation === \"function\") {\n data.event.stopImmediatePropagation();\n }\n },\n\n /**\n * The flag to be bubbling.\n * @type {boolean}\n */\n get bubbles() {\n return Boolean(pd(this).event.bubbles)\n },\n\n /**\n * The flag to be cancelable.\n * @type {boolean}\n */\n get cancelable() {\n return Boolean(pd(this).event.cancelable)\n },\n\n /**\n * Cancel this event.\n * @returns {void}\n */\n preventDefault() {\n setCancelFlag(pd(this));\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n */\n get defaultPrevented() {\n return pd(this).canceled\n },\n\n /**\n * The flag to be composed.\n * @type {boolean}\n */\n get composed() {\n return Boolean(pd(this).event.composed)\n },\n\n /**\n * The unix time of this event.\n * @type {number}\n */\n get timeStamp() {\n return pd(this).timeStamp\n },\n\n /**\n * The target of this event.\n * @type {EventTarget}\n * @deprecated\n */\n get srcElement() {\n return pd(this).eventTarget\n },\n\n /**\n * The flag to stop event bubbling.\n * @type {boolean}\n * @deprecated\n */\n get cancelBubble() {\n return pd(this).stopped\n },\n set cancelBubble(value) {\n if (!value) {\n return\n }\n const data = pd(this);\n\n data.stopped = true;\n if (typeof data.event.cancelBubble === \"boolean\") {\n data.event.cancelBubble = true;\n }\n },\n\n /**\n * The flag to indicate cancellation state.\n * @type {boolean}\n * @deprecated\n */\n get returnValue() {\n return !pd(this).canceled\n },\n set returnValue(value) {\n if (!value) {\n setCancelFlag(pd(this));\n }\n },\n\n /**\n * Initialize this event object. But do nothing under event dispatching.\n * @param {string} type The event type.\n * @param {boolean} [bubbles=false] The flag to be possible to bubble up.\n * @param {boolean} [cancelable=false] The flag to be possible to cancel.\n * @deprecated\n */\n initEvent() {\n // Do nothing.\n },\n};\n\n// `constructor` is not enumerable.\nObject.defineProperty(Event.prototype, \"constructor\", {\n value: Event,\n configurable: true,\n writable: true,\n});\n\n// Ensure `event instanceof window.Event` is `true`.\nif (typeof window !== \"undefined\" && typeof window.Event !== \"undefined\") {\n Object.setPrototypeOf(Event.prototype, window.Event.prototype);\n\n // Make association for wrappers.\n wrappers.set(window.Event.prototype, Event);\n}\n\n/**\n * Get the property descriptor to redirect a given property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to redirect the property.\n * @private\n */\nfunction defineRedirectDescriptor(key) {\n return {\n get() {\n return pd(this).event[key]\n },\n set(value) {\n pd(this).event[key] = value;\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Get the property descriptor to call a given method property.\n * @param {string} key Property name to define property descriptor.\n * @returns {PropertyDescriptor} The property descriptor to call the method property.\n * @private\n */\nfunction defineCallDescriptor(key) {\n return {\n value() {\n const event = pd(this).event;\n return event[key].apply(event, arguments)\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define new wrapper class.\n * @param {Function} BaseEvent The base wrapper class.\n * @param {Object} proto The prototype of the original event.\n * @returns {Function} The defined wrapper class.\n * @private\n */\nfunction defineWrapper(BaseEvent, proto) {\n const keys = Object.keys(proto);\n if (keys.length === 0) {\n return BaseEvent\n }\n\n /** CustomEvent */\n function CustomEvent(eventTarget, event) {\n BaseEvent.call(this, eventTarget, event);\n }\n\n CustomEvent.prototype = Object.create(BaseEvent.prototype, {\n constructor: { value: CustomEvent, configurable: true, writable: true },\n });\n\n // Define accessors.\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!(key in BaseEvent.prototype)) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, key);\n const isFunc = typeof descriptor.value === \"function\";\n Object.defineProperty(\n CustomEvent.prototype,\n key,\n isFunc\n ? defineCallDescriptor(key)\n : defineRedirectDescriptor(key)\n );\n }\n }\n\n return CustomEvent\n}\n\n/**\n * Get the wrapper class of a given prototype.\n * @param {Object} proto The prototype of the original event to get its wrapper.\n * @returns {Function} The wrapper class.\n * @private\n */\nfunction getWrapper(proto) {\n if (proto == null || proto === Object.prototype) {\n return Event\n }\n\n let wrapper = wrappers.get(proto);\n if (wrapper == null) {\n wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto);\n wrappers.set(proto, wrapper);\n }\n return wrapper\n}\n\n/**\n * Wrap a given event to management a dispatching.\n * @param {EventTarget} eventTarget The event target of this dispatching.\n * @param {Object} event The event to wrap.\n * @returns {Event} The wrapper instance.\n * @private\n */\nfunction wrapEvent(eventTarget, event) {\n const Wrapper = getWrapper(Object.getPrototypeOf(event));\n return new Wrapper(eventTarget, event)\n}\n\n/**\n * Get the immediateStopped flag of a given event.\n * @param {Event} event The event to get.\n * @returns {boolean} The flag to stop propagation immediately.\n * @private\n */\nfunction isStopped(event) {\n return pd(event).immediateStopped\n}\n\n/**\n * Set the current event phase of a given event.\n * @param {Event} event The event to set current target.\n * @param {number} eventPhase New event phase.\n * @returns {void}\n * @private\n */\nfunction setEventPhase(event, eventPhase) {\n pd(event).eventPhase = eventPhase;\n}\n\n/**\n * Set the current target of a given event.\n * @param {Event} event The event to set current target.\n * @param {EventTarget|null} currentTarget New current target.\n * @returns {void}\n * @private\n */\nfunction setCurrentTarget(event, currentTarget) {\n pd(event).currentTarget = currentTarget;\n}\n\n/**\n * Set a passive listener of a given event.\n * @param {Event} event The event to set current target.\n * @param {Function|null} passiveListener New passive listener.\n * @returns {void}\n * @private\n */\nfunction setPassiveListener(event, passiveListener) {\n pd(event).passiveListener = passiveListener;\n}\n\n/**\n * @typedef {object} ListenerNode\n * @property {Function} listener\n * @property {1|2|3} listenerType\n * @property {boolean} passive\n * @property {boolean} once\n * @property {ListenerNode|null} next\n * @private\n */\n\n/**\n * @type {WeakMap>}\n * @private\n */\nconst listenersMap = new WeakMap();\n\n// Listener types\nconst CAPTURE = 1;\nconst BUBBLE = 2;\nconst ATTRIBUTE = 3;\n\n/**\n * Check whether a given value is an object or not.\n * @param {any} x The value to check.\n * @returns {boolean} `true` if the value is an object.\n */\nfunction isObject(x) {\n return x !== null && typeof x === \"object\" //eslint-disable-line no-restricted-syntax\n}\n\n/**\n * Get listeners.\n * @param {EventTarget} eventTarget The event target to get.\n * @returns {Map} The listeners.\n * @private\n */\nfunction getListeners(eventTarget) {\n const listeners = listenersMap.get(eventTarget);\n if (listeners == null) {\n throw new TypeError(\n \"'this' is expected an EventTarget object, but got another value.\"\n )\n }\n return listeners\n}\n\n/**\n * Get the property descriptor for the event attribute of a given event.\n * @param {string} eventName The event name to get property descriptor.\n * @returns {PropertyDescriptor} The property descriptor.\n * @private\n */\nfunction defineEventAttributeDescriptor(eventName) {\n return {\n get() {\n const listeners = getListeners(this);\n let node = listeners.get(eventName);\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n return node.listener\n }\n node = node.next;\n }\n return null\n },\n\n set(listener) {\n if (typeof listener !== \"function\" && !isObject(listener)) {\n listener = null; // eslint-disable-line no-param-reassign\n }\n const listeners = getListeners(this);\n\n // Traverse to the tail while removing old value.\n let prev = null;\n let node = listeners.get(eventName);\n while (node != null) {\n if (node.listenerType === ATTRIBUTE) {\n // Remove old value.\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n } else {\n prev = node;\n }\n\n node = node.next;\n }\n\n // Add new value.\n if (listener !== null) {\n const newNode = {\n listener,\n listenerType: ATTRIBUTE,\n passive: false,\n once: false,\n next: null,\n };\n if (prev === null) {\n listeners.set(eventName, newNode);\n } else {\n prev.next = newNode;\n }\n }\n },\n configurable: true,\n enumerable: true,\n }\n}\n\n/**\n * Define an event attribute (e.g. `eventTarget.onclick`).\n * @param {Object} eventTargetPrototype The event target prototype to define an event attrbite.\n * @param {string} eventName The event name to define.\n * @returns {void}\n */\nfunction defineEventAttribute(eventTargetPrototype, eventName) {\n Object.defineProperty(\n eventTargetPrototype,\n `on${eventName}`,\n defineEventAttributeDescriptor(eventName)\n );\n}\n\n/**\n * Define a custom EventTarget with event attributes.\n * @param {string[]} eventNames Event names for event attributes.\n * @returns {EventTarget} The custom EventTarget.\n * @private\n */\nfunction defineCustomEventTarget(eventNames) {\n /** CustomEventTarget */\n function CustomEventTarget() {\n EventTarget.call(this);\n }\n\n CustomEventTarget.prototype = Object.create(EventTarget.prototype, {\n constructor: {\n value: CustomEventTarget,\n configurable: true,\n writable: true,\n },\n });\n\n for (let i = 0; i < eventNames.length; ++i) {\n defineEventAttribute(CustomEventTarget.prototype, eventNames[i]);\n }\n\n return CustomEventTarget\n}\n\n/**\n * EventTarget.\n *\n * - This is constructor if no arguments.\n * - This is a function which returns a CustomEventTarget constructor if there are arguments.\n *\n * For example:\n *\n * class A extends EventTarget {}\n * class B extends EventTarget(\"message\") {}\n * class C extends EventTarget(\"message\", \"error\") {}\n * class D extends EventTarget([\"message\", \"error\"]) {}\n */\nfunction EventTarget() {\n /*eslint-disable consistent-return */\n if (this instanceof EventTarget) {\n listenersMap.set(this, new Map());\n return\n }\n if (arguments.length === 1 && Array.isArray(arguments[0])) {\n return defineCustomEventTarget(arguments[0])\n }\n if (arguments.length > 0) {\n const types = new Array(arguments.length);\n for (let i = 0; i < arguments.length; ++i) {\n types[i] = arguments[i];\n }\n return defineCustomEventTarget(types)\n }\n throw new TypeError(\"Cannot call a class as a function\")\n /*eslint-enable consistent-return */\n}\n\n// Should be enumerable, but class methods are not enumerable.\nEventTarget.prototype = {\n /**\n * Add a given listener to this event target.\n * @param {string} eventName The event name to add.\n * @param {Function} listener The listener to add.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n addEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n if (typeof listener !== \"function\" && !isObject(listener)) {\n throw new TypeError(\"'listener' should be a function or an object.\")\n }\n\n const listeners = getListeners(this);\n const optionsIsObj = isObject(options);\n const capture = optionsIsObj\n ? Boolean(options.capture)\n : Boolean(options);\n const listenerType = capture ? CAPTURE : BUBBLE;\n const newNode = {\n listener,\n listenerType,\n passive: optionsIsObj && Boolean(options.passive),\n once: optionsIsObj && Boolean(options.once),\n next: null,\n };\n\n // Set it as the first node if the first node is null.\n let node = listeners.get(eventName);\n if (node === undefined) {\n listeners.set(eventName, newNode);\n return\n }\n\n // Traverse to the tail while checking duplication..\n let prev = null;\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n // Should ignore duplication.\n return\n }\n prev = node;\n node = node.next;\n }\n\n // Add it.\n prev.next = newNode;\n },\n\n /**\n * Remove a given listener from this event target.\n * @param {string} eventName The event name to remove.\n * @param {Function} listener The listener to remove.\n * @param {boolean|{capture?:boolean,passive?:boolean,once?:boolean}} [options] The options for this listener.\n * @returns {void}\n */\n removeEventListener(eventName, listener, options) {\n if (listener == null) {\n return\n }\n\n const listeners = getListeners(this);\n const capture = isObject(options)\n ? Boolean(options.capture)\n : Boolean(options);\n const listenerType = capture ? CAPTURE : BUBBLE;\n\n let prev = null;\n let node = listeners.get(eventName);\n while (node != null) {\n if (\n node.listener === listener &&\n node.listenerType === listenerType\n ) {\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n return\n }\n\n prev = node;\n node = node.next;\n }\n },\n\n /**\n * Dispatch a given event.\n * @param {Event|{type:string}} event The event to dispatch.\n * @returns {boolean} `false` if canceled.\n */\n dispatchEvent(event) {\n if (event == null || typeof event.type !== \"string\") {\n throw new TypeError('\"event.type\" should be a string.')\n }\n\n // If listeners aren't registered, terminate.\n const listeners = getListeners(this);\n const eventName = event.type;\n let node = listeners.get(eventName);\n if (node == null) {\n return true\n }\n\n // Since we cannot rewrite several properties, so wrap object.\n const wrappedEvent = wrapEvent(this, event);\n\n // This doesn't process capturing phase and bubbling phase.\n // This isn't participating in a tree.\n let prev = null;\n while (node != null) {\n // Remove this listener if it's once\n if (node.once) {\n if (prev !== null) {\n prev.next = node.next;\n } else if (node.next !== null) {\n listeners.set(eventName, node.next);\n } else {\n listeners.delete(eventName);\n }\n } else {\n prev = node;\n }\n\n // Call this listener\n setPassiveListener(\n wrappedEvent,\n node.passive ? node.listener : null\n );\n if (typeof node.listener === \"function\") {\n try {\n node.listener.call(this, wrappedEvent);\n } catch (err) {\n if (\n typeof console !== \"undefined\" &&\n typeof console.error === \"function\"\n ) {\n console.error(err);\n }\n }\n } else if (\n node.listenerType !== ATTRIBUTE &&\n typeof node.listener.handleEvent === \"function\"\n ) {\n node.listener.handleEvent(wrappedEvent);\n }\n\n // Break if `event.stopImmediatePropagation` was called.\n if (isStopped(wrappedEvent)) {\n break\n }\n\n node = node.next;\n }\n setPassiveListener(wrappedEvent, null);\n setEventPhase(wrappedEvent, 0);\n setCurrentTarget(wrappedEvent, null);\n\n return !wrappedEvent.defaultPrevented\n },\n};\n\n// `constructor` is not enumerable.\nObject.defineProperty(EventTarget.prototype, \"constructor\", {\n value: EventTarget,\n configurable: true,\n writable: true,\n});\n\n// Ensure `eventTarget instanceof window.EventTarget` is `true`.\nif (\n typeof window !== \"undefined\" &&\n typeof window.EventTarget !== \"undefined\"\n) {\n Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype);\n}\n\nexport default EventTarget;\nexport { defineEventAttribute, EventTarget };\n//# sourceMappingURL=event-target-shim.mjs.map\n","import {\n // Event,\n EventTarget,\n // Type,\n defineEventAttribute,\n} from \"event-target-shim\"\n\n// Known Limitation\n// Use `any` because the type of `AbortSignal` in `lib.dom.d.ts` is wrong and\n// to make assignable our `AbortSignal` into that.\n// https://github.com/Microsoft/TSJS-lib-generator/pull/623\ntype Events = {\n abort: any // Event & Type<\"abort\">\n}\ntype EventAttributes = {\n onabort: any // Event & Type<\"abort\">\n}\n\n/**\n * The signal class.\n * @see https://dom.spec.whatwg.org/#abortsignal\n */\nexport default class AbortSignal extends EventTarget {\n /**\n * AbortSignal cannot be constructed directly.\n */\n public constructor() {\n super()\n throw new TypeError(\"AbortSignal cannot be constructed directly\")\n }\n\n /**\n * Returns `true` if this `AbortSignal`'s `AbortController` has signaled to abort, and `false` otherwise.\n */\n public get aborted(): boolean {\n const aborted = abortedFlags.get(this)\n if (typeof aborted !== \"boolean\") {\n throw new TypeError(\n `Expected 'this' to be an 'AbortSignal' object, but got ${\n this === null ? \"null\" : typeof this\n }`,\n )\n }\n return aborted\n }\n}\ndefineEventAttribute(AbortSignal.prototype, \"abort\")\n\n/**\n * Create an AbortSignal object.\n */\nexport function createAbortSignal(): AbortSignal {\n const signal = Object.create(AbortSignal.prototype)\n EventTarget.call(signal)\n abortedFlags.set(signal, false)\n return signal\n}\n\n/**\n * Abort a given signal.\n */\nexport function abortSignal(signal: AbortSignal): void {\n if (abortedFlags.get(signal) !== false) {\n return\n }\n\n abortedFlags.set(signal, true)\n signal.dispatchEvent<\"abort\">({ type: \"abort\" })\n}\n\n/**\n * Aborted flag for each instances.\n */\nconst abortedFlags = new WeakMap()\n\n// Properties should be enumerable.\nObject.defineProperties(AbortSignal.prototype, {\n aborted: { enumerable: true },\n})\n\n// `toString()` should return `\"[object AbortSignal]\"`\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortSignal\",\n })\n}\n","import AbortSignal, { abortSignal, createAbortSignal } from \"./abort-signal\"\n\n/**\n * The AbortController.\n * @see https://dom.spec.whatwg.org/#abortcontroller\n */\nexport default class AbortController {\n /**\n * Initialize this controller.\n */\n public constructor() {\n signals.set(this, createAbortSignal())\n }\n\n /**\n * Returns the `AbortSignal` object associated with this object.\n */\n public get signal(): AbortSignal {\n return getSignal(this)\n }\n\n /**\n * Abort and signal to any observers that the associated activity is to be aborted.\n */\n public abort(): void {\n abortSignal(getSignal(this))\n }\n}\n\n/**\n * Associated signals.\n */\nconst signals = new WeakMap()\n\n/**\n * Get the associated signal of a given controller.\n */\nfunction getSignal(controller: AbortController): AbortSignal {\n const signal = signals.get(controller)\n if (signal == null) {\n throw new TypeError(\n `Expected 'this' to be an 'AbortController' object, but got ${\n controller === null ? \"null\" : typeof controller\n }`,\n )\n }\n return signal\n}\n\n// Properties should be enumerable.\nObject.defineProperties(AbortController.prototype, {\n signal: { enumerable: true },\n abort: { enumerable: true },\n})\n\nif (typeof Symbol === \"function\" && typeof Symbol.toStringTag === \"symbol\") {\n Object.defineProperty(AbortController.prototype, Symbol.toStringTag, {\n configurable: true,\n value: \"AbortController\",\n })\n}\n\nexport { AbortController, AbortSignal }\n"],"names":["pd","event","retv","privateData","get","console","assert","setCancelFlag","data","passiveListener","cancelable","canceled","preventDefault","error","Event","eventTarget","set","eventPhase","currentTarget","stopped","immediateStopped","timeStamp","Date","now","Object","defineProperty","value","enumerable","key","keys","i","length","defineRedirectDescriptor","configurable","defineCallDescriptor","apply","arguments","defineWrapper","BaseEvent","proto","CustomEvent","call","prototype","create","constructor","writable","descriptor","getOwnPropertyDescriptor","isFunc","getWrapper","wrapper","wrappers","getPrototypeOf","wrapEvent","Wrapper","isStopped","setEventPhase","setCurrentTarget","setPassiveListener","createAbortSignal","signal","AbortSignal","EventTarget","abortedFlags","abortSignal","dispatchEvent","type","getSignal","controller","signals","TypeError","WeakMap","target","composedPath","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","stopPropagation","stopImmediatePropagation","bubbles","defaultPrevented","composed","srcElement","cancelBubble","returnValue","initEvent","window","setPrototypeOf","aborted","defineEventAttribute","defineProperties","Symbol","_typeof","toStringTag","AbortController","abort"],"mappings":";;;+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,CAAe,CAACrD,SAAtClB,CAAiDoE,MAAM,CAACE,WAAxDtE,CAAqE,CACjES,YAAY,GADqD,CAEjEP,KAAK,CAAE,iBAF0D,CAArEF"} \ No newline at end of file diff --git a/node_modules/abort-controller/package.json b/node_modules/abort-controller/package.json deleted file mode 100755 index bd967e1..0000000 --- a/node_modules/abort-controller/package.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "_from": "abort-controller@^3.0.0", - "_id": "abort-controller@3.0.0", - "_inBundle": false, - "_integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", - "_location": "/abort-controller", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "abort-controller@^3.0.0", - "name": "abort-controller", - "escapedName": "abort-controller", - "rawSpec": "^3.0.0", - "saveSpec": null, - "fetchSpec": "^3.0.0" - }, - "_requiredBy": [ - "/discord.js" - ], - "_resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "_shasum": "eaf54d53b62bae4138e809ca225c8439a6efb392", - "_spec": "abort-controller@^3.0.0", - "_where": "D:\\Users\\henri\\Desktop\\TestHabana\\node_modules\\discord.js", - "author": { - "name": "Toru Nagashima", - "url": "https://github.com/mysticatea" - }, - "browser": "./browser.js", - "bugs": { - "url": "https://github.com/mysticatea/abort-controller/issues" - }, - "bundleDependencies": false, - "dependencies": { - "event-target-shim": "^5.0.0" - }, - "deprecated": false, - "description": "An implementation of WHATWG AbortController interface.", - "devDependencies": { - "@babel/core": "^7.2.2", - "@babel/plugin-transform-modules-commonjs": "^7.2.0", - "@babel/preset-env": "^7.3.0", - "@babel/register": "^7.0.0", - "@mysticatea/eslint-plugin": "^8.0.1", - "@mysticatea/spy": "^0.1.2", - "@types/mocha": "^5.2.5", - "@types/node": "^10.12.18", - "assert": "^1.4.1", - "codecov": "^3.1.0", - "dts-bundle-generator": "^2.0.0", - "eslint": "^5.12.1", - "karma": "^3.1.4", - "karma-chrome-launcher": "^2.2.0", - "karma-coverage": "^1.1.2", - "karma-firefox-launcher": "^1.1.0", - "karma-growl-reporter": "^1.0.0", - "karma-ie-launcher": "^1.0.0", - "karma-mocha": "^1.3.0", - "karma-rollup-preprocessor": "^7.0.0-rc.2", - "mocha": "^5.2.0", - "npm-run-all": "^4.1.5", - "nyc": "^13.1.0", - "opener": "^1.5.1", - "rimraf": "^2.6.3", - "rollup": "^1.1.2", - "rollup-plugin-babel": "^4.3.2", - "rollup-plugin-babel-minify": "^7.0.0", - "rollup-plugin-commonjs": "^9.2.0", - "rollup-plugin-node-resolve": "^4.0.0", - "rollup-plugin-sourcemaps": "^0.4.2", - "rollup-plugin-typescript": "^1.0.0", - "rollup-watch": "^4.3.1", - "ts-node": "^8.0.1", - "type-tester": "^1.0.0", - "typescript": "^3.2.4" - }, - "engines": { - "node": ">=6.5" - }, - "files": [ - "dist", - "polyfill.*", - "browser.*" - ], - "homepage": "https://github.com/mysticatea/abort-controller#readme", - "keywords": [ - "w3c", - "whatwg", - "event", - "events", - "abort", - "cancel", - "abortcontroller", - "abortsignal", - "controller", - "signal", - "shim" - ], - "license": "MIT", - "main": "dist/abort-controller", - "name": "abort-controller", - "repository": { - "type": "git", - "url": "git+https://github.com/mysticatea/abort-controller.git" - }, - "scripts": { - "build": "run-s -s build:*", - "build:dts": "dts-bundle-generator -o dist/abort-controller.d.ts src/abort-controller.ts && ts-node scripts/fix-dts", - "build:rollup": "rollup -c", - "clean": "rimraf .nyc_output coverage", - "codecov": "codecov", - "coverage": "opener coverage/lcov-report/index.html", - "lint": "eslint . --ext .ts", - "postversion": "git push && git push --tags", - "preversion": "npm test", - "test": "run-s -s lint test:*", - "test:karma": "karma start --single-run", - "test:mocha": "nyc mocha test/*.ts", - "version": "npm run -s build && git add dist/*", - "watch": "run-p -s watch:*", - "watch:karma": "karma start --watch", - "watch:mocha": "mocha test/*.ts --require ts-node/register --watch-extensions ts --watch --growl" - }, - "version": "3.0.0" -} diff --git a/node_modules/abort-controller/polyfill.js b/node_modules/abort-controller/polyfill.js deleted file mode 100755 index 3ca8923..0000000 --- a/node_modules/abort-controller/polyfill.js +++ /dev/null @@ -1,21 +0,0 @@ -/*globals require, self, window */ -"use strict" - -const ac = require("./dist/abort-controller") - -/*eslint-disable @mysticatea/prettier */ -const g = - typeof self !== "undefined" ? self : - typeof window !== "undefined" ? window : - typeof global !== "undefined" ? global : - /* otherwise */ undefined -/*eslint-enable @mysticatea/prettier */ - -if (g) { - if (typeof g.AbortController === "undefined") { - g.AbortController = ac.AbortController - } - if (typeof g.AbortSignal === "undefined") { - g.AbortSignal = ac.AbortSignal - } -} diff --git a/node_modules/abort-controller/polyfill.mjs b/node_modules/abort-controller/polyfill.mjs deleted file mode 100755 index 0602a64..0000000 --- a/node_modules/abort-controller/polyfill.mjs +++ /dev/null @@ -1,19 +0,0 @@ -/*globals self, window */ -import * as ac from "./dist/abort-controller" - -/*eslint-disable @mysticatea/prettier */ -const g = - typeof self !== "undefined" ? self : - typeof window !== "undefined" ? window : - typeof global !== "undefined" ? global : - /* otherwise */ undefined -/*eslint-enable @mysticatea/prettier */ - -if (g) { - if (typeof g.AbortController === "undefined") { - g.AbortController = ac.AbortController - } - if (typeof g.AbortSignal === "undefined") { - g.AbortSignal = ac.AbortSignal - } -} diff --git a/node_modules/are-we-there-yet/package.json b/node_modules/are-we-there-yet/package.json index 4e43220..ff36bf4 100644 --- a/node_modules/are-we-there-yet/package.json +++ b/node_modules/are-we-there-yet/package.json @@ -1,45 +1,29 @@ { - "_from": "are-we-there-yet@~1.1.2", - "_id": "are-we-there-yet@1.1.5", - "_inBundle": false, - "_integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "_location": "/are-we-there-yet", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "are-we-there-yet@~1.1.2", - "name": "are-we-there-yet", - "escapedName": "are-we-there-yet", - "rawSpec": "~1.1.2", - "saveSpec": null, - "fetchSpec": "~1.1.2" + "name": "are-we-there-yet", + "version": "1.1.7", + "description": "Keep track of the overall completion of many disparate processes", + "main": "index.js", + "scripts": { + "test": "standard && tap test/*.js" }, - "_requiredBy": [ - "/npmlog" - ], - "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "_shasum": "4b35c2944f062a8bfcda66410760350fe9ddfc21", - "_spec": "are-we-there-yet@~1.1.2", - "_where": "D:\\Users\\henri\\Desktop\\TestHabana\\node_modules\\npmlog", - "author": { - "name": "Rebecca Turner", - "url": "http://re-becca.org" + "repository": { + "type": "git", + "url": "https://github.com/iarna/are-we-there-yet.git" }, + "author": "Rebecca Turner (http://re-becca.org)", + "license": "ISC", "bugs": { "url": "https://github.com/iarna/are-we-there-yet/issues" }, - "bundleDependencies": false, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - }, - "deprecated": false, - "description": "Keep track of the overall completion of many disparate processes", + "homepage": "https://github.com/iarna/are-we-there-yet", "devDependencies": { "standard": "^11.0.1", "tap": "^12.0.1" }, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + }, "files": [ "index.js", "tracker-base.js", @@ -47,17 +31,5 @@ "tracker-stream.js", "tracker.js", "CHANGES.md" - ], - "homepage": "https://github.com/iarna/are-we-there-yet", - "license": "ISC", - "main": "index.js", - "name": "are-we-there-yet", - "repository": { - "type": "git", - "url": "git+https://github.com/iarna/are-we-there-yet.git" - }, - "scripts": { - "test": "standard && tap test/*.js" - }, - "version": "1.1.5" + ] } diff --git a/node_modules/boxen/node_modules/ansi-regex/index.js b/node_modules/boxen/node_modules/ansi-regex/index.js index 35054aa..616ff83 100644 --- a/node_modules/boxen/node_modules/ansi-regex/index.js +++ b/node_modules/boxen/node_modules/ansi-regex/index.js @@ -2,7 +2,7 @@ module.exports = ({onlyFirst = false} = {}) => { const pattern = [ - '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', + '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))' ].join('|'); diff --git a/node_modules/boxen/node_modules/ansi-regex/package.json b/node_modules/boxen/node_modules/ansi-regex/package.json index eafffb9..017f531 100644 --- a/node_modules/boxen/node_modules/ansi-regex/package.json +++ b/node_modules/boxen/node_modules/ansi-regex/package.json @@ -1,90 +1,55 @@ { - "_args": [ - [ - "ansi-regex@5.0.0", - "D:\\Users\\henri\\Desktop\\TestHabana" - ] - ], - "_from": "ansi-regex@5.0.0", - "_id": "ansi-regex@5.0.0", - "_inBundle": false, - "_integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "_location": "/boxen/ansi-regex", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "ansi-regex@5.0.0", - "name": "ansi-regex", - "escapedName": "ansi-regex", - "rawSpec": "5.0.0", - "saveSpec": null, - "fetchSpec": "5.0.0" - }, - "_requiredBy": [ - "/boxen/strip-ansi" - ], - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "_spec": "5.0.0", - "_where": "D:\\Users\\henri\\Desktop\\TestHabana", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/chalk/ansi-regex/issues" - }, - "description": "Regular expression for matching ANSI escape codes", - "devDependencies": { - "ava": "^2.4.0", - "tsd": "^0.9.0", - "xo": "^0.25.3" - }, - "engines": { - "node": ">=8" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "homepage": "https://github.com/chalk/ansi-regex#readme", - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "license": "MIT", - "name": "ansi-regex", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/ansi-regex.git" - }, - "scripts": { - "test": "xo && ava && tsd", - "view-supported": "node fixtures/view-codes.js" - }, - "version": "5.0.0" + "name": "ansi-regex", + "version": "5.0.1", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": "chalk/ansi-regex", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "view-supported": "node fixtures/view-codes.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re", + "match", + "test", + "find", + "pattern" + ], + "devDependencies": { + "ava": "^2.4.0", + "tsd": "^0.9.0", + "xo": "^0.25.3" + } } diff --git a/node_modules/boxen/node_modules/ansi-regex/readme.md b/node_modules/boxen/node_modules/ansi-regex/readme.md index 3c2b77c..4d848bc 100644 --- a/node_modules/boxen/node_modules/ansi-regex/readme.md +++ b/node_modules/boxen/node_modules/ansi-regex/readme.md @@ -1,4 +1,4 @@ -# ansi-regex [![Build Status](https://travis-ci.org/chalk/ansi-regex.svg?branch=master)](https://travis-ci.org/chalk/ansi-regex) +# ansi-regex > Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) diff --git a/node_modules/boxen/node_modules/type-fest/index.d.ts b/node_modules/boxen/node_modules/type-fest/index.d.ts new file mode 100644 index 0000000..520df22 --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/index.d.ts @@ -0,0 +1,20 @@ +// Basic +export * from './source/basic'; + +// Utilities +export {Except} from './source/except'; +export {Mutable} from './source/mutable'; +export {Merge} from './source/merge'; +export {MergeExclusive} from './source/merge-exclusive'; +export {RequireAtLeastOne} from './source/require-at-least-one'; +export {RequireExactlyOne} from './source/require-exactly-one'; +export {PartialDeep} from './source/partial-deep'; +export {ReadonlyDeep} from './source/readonly-deep'; +export {LiteralUnion} from './source/literal-union'; +export {Promisable} from './source/promisable'; +export {Opaque} from './source/opaque'; +export {SetOptional} from './source/set-optional'; +export {SetRequired} from './source/set-required'; + +// Miscellaneous +export {PackageJson} from './source/package-json'; diff --git a/node_modules/boxen/node_modules/type-fest/license b/node_modules/boxen/node_modules/type-fest/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/license @@ -0,0 +1,9 @@ +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/node_modules/boxen/node_modules/type-fest/package.json b/node_modules/boxen/node_modules/type-fest/package.json new file mode 100644 index 0000000..ea66211 --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/package.json @@ -0,0 +1,51 @@ +{ + "name": "type-fest", + "version": "0.8.1", + "description": "A collection of essential TypeScript types", + "license": "(MIT OR CC0-1.0)", + "repository": "sindresorhus/type-fest", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && tsd" + }, + "files": [ + "index.d.ts", + "source" + ], + "keywords": [ + "typescript", + "ts", + "types", + "utility", + "util", + "utilities", + "omit", + "merge", + "json" + ], + "devDependencies": { + "@sindresorhus/tsconfig": "^0.4.0", + "@typescript-eslint/eslint-plugin": "^2.2.0", + "@typescript-eslint/parser": "^2.2.0", + "eslint-config-xo-typescript": "^0.18.0", + "tsd": "^0.7.3", + "xo": "^0.24.0" + }, + "xo": { + "extends": "xo-typescript", + "extensions": [ + "ts" + ], + "rules": { + "import/no-unresolved": "off", + "@typescript-eslint/indent": "off" + } + } +} diff --git a/node_modules/boxen/node_modules/type-fest/readme.md b/node_modules/boxen/node_modules/type-fest/readme.md new file mode 100644 index 0000000..1824bda --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/readme.md @@ -0,0 +1,635 @@ +
+
+
+ type-fest +
+
+ A collection of essential TypeScript types +
+
+
+
+
+ +[![Build Status](https://travis-ci.com/sindresorhus/type-fest.svg?branch=master)](https://travis-ci.com/sindresorhus/type-fest) +[![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) + + +Many of the types here should have been built-in. You can help by suggesting some of them to the [TypeScript project](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). + +Either add this package as a dependency or copy-paste the needed types. No credit required. 👌 + +PR welcome for additional commonly needed types and docs improvements. Read the [contributing guidelines](.github/contributing.md) first. + + +## Install + +``` +$ npm install type-fest +``` + +*Requires TypeScript >=3.2* + + +## Usage + +```ts +import {Except} from 'type-fest'; + +type Foo = { + unicorn: string; + rainbow: boolean; +}; + +type FooWithoutRainbow = Except; +//=> {unicorn: string} +``` + + +## API + +Click the type names for complete docs. + +### Basic + +- [`Primitive`](source/basic.d.ts) - Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). +- [`Class`](source/basic.d.ts) - Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). +- [`TypedArray`](source/basic.d.ts) - Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. +- [`JsonObject`](source/basic.d.ts) - Matches a JSON object. +- [`JsonArray`](source/basic.d.ts) - Matches a JSON array. +- [`JsonValue`](source/basic.d.ts) - Matches any valid JSON value. +- [`ObservableLike`](source/basic.d.ts) - Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). + +### Utilities + +- [`Except`](source/except.d.ts) - Create a type from an object type without certain keys. This is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). +- [`Mutable`](source/mutable.d.ts) - Convert an object with `readonly` keys into a mutable object. The inverse of `Readonly`. +- [`Merge`](source/merge.d.ts) - Merge two types into a new type. Keys of the second type overrides keys of the first type. +- [`MergeExclusive`](source/merge-exclusive.d.ts) - Create a type that has mutually exclusive keys. +- [`RequireAtLeastOne`](source/require-at-least-one.d.ts) - Create a type that requires at least one of the given keys. +- [`RequireExactlyOne`](source/require-one.d.ts) - Create a type that requires exactly a single key of the given keys and disallows more. +- [`PartialDeep`](source/partial-deep.d.ts) - Create a deeply optional version of another type. Use [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) if you only need one level deep. +- [`ReadonlyDeep`](source/readonly-deep.d.ts) - Create a deeply immutable version of an `object`/`Map`/`Set`/`Array` type. Use [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) if you only need one level deep. +- [`LiteralUnion`](source/literal-union.d.ts) - Create a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. Workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). +- [`Promisable`](source/promisable.d.ts) - Create a type that represents either the value or the value wrapped in `PromiseLike`. +- [`Opaque`](source/opaque.d.ts) - Create an [opaque type](https://codemix.com/opaque-types-in-javascript/). +- [`SetOptional`](source/set-optional.d.ts) - Create a type that makes the given keys optional. +- [`SetRequired`](source/set-required.d.ts) - Create a type that makes the given keys required. + +### Miscellaneous + +- [`PackageJson`](source/package-json.d.ts) - Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). + + +## Declined types + +*If we decline a type addition, we will make sure to document the better solution here.* + +- [`Diff` and `Spread`](https://github.com/sindresorhus/type-fest/pull/7) - The PR author didn't provide any real-world use-cases and the PR went stale. If you think this type is useful, provide some real-world use-cases and we might reconsider. +- [`Dictionary`](https://github.com/sindresorhus/type-fest/issues/33) - You only save a few characters (`Dictionary` vs `Record`) from [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434), which is more flexible and well-known. Also, you shouldn't use an object as a dictionary. We have `Map` in JavaScript now. + + +## Tips + +### Built-in types + +There are many advanced types most users don't know about. + +- [`Partial`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1401-L1406) - Make all properties in `T` optional. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/KYOwrgtgBAMg9gcxsAbsANlA3gKClAeQDMiAaPKAEWACMwFz8BRAJxbhcagDEBDAF17ocAXxw4AliH7AWRXgGNgUAHJwAJsADCcEEQkJsFXgAcTK3hGAAuKAGd+LKQgDcFEx363wEGrLf46IjIaOi28EioGG5iOArovHZ2qhrAAIJmAEJgEuiaLEb4Jk4oAsoKuvoIYCwCErq2apo6egZQALyF+FCm5pY2UABETelmg1xFnrYAzAAM8xNQQZGh4cFR6AB0xEQUIm4UFa0IABRHVbYACrws-BJCADwjLVUAfACUXfhEHFBnug4oABrYAATygcCIhBoACtgAp+JsQaC7P9ju9Prhut0joCwCZ1GUAGpCMDKTrnAwAbWRPWSyMhKWalQMAF0Dtj8BIoSd8YSZCT0GSOu1OmAQJp9CBgOpPkc7uBgBzOfwABYSOybSnVWp3XQ0sF04FgxnPFkIVkdKB84mkpUUfCxbEsYD8GogKBqjUBKBiWIAen9UGut3u6CeqReBlePXQQQA7skwMl+HAoMU4CgJJoISB0ODeOmbvwIVC1cAcIGmdpzVApDI5IpgJscNL49WMiZsrl8id3lrzScsD0zBYrLZBgAVOCUOCdwa+95uIA) + + ```ts + interface NodeConfig { + appName: string; + port: number; + } + + class NodeAppBuilder { + private configuration: NodeConfig = { + appName: 'NodeApp', + port: 3000 + }; + + config(config: Partial) { + type NodeConfigKey = keyof NodeConfig; + + for (const key of Object.keys(config) as NodeConfigKey[]) { + const updateValue = config[key]; + + if (updateValue === undefined) { + continue; + } + + this.configuration[key] = updateValue; + } + + return this; + } + } + + // `Partial`` allows us to provide only a part of the + // NodeConfig interface. + new NodeAppBuilder().config({appName: 'ToDoApp'}); + ``` +
+ +- [`Required`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1408-L1413) - Make all properties in `T` required. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgGED21VQGJZwC2wA3gFCjXAzFJgA2A-AFzADOUckA5gNxUaIYjA4ckvGG07c+g6gF8KQkAgCuEFFDA5O6gEbEwUbLm2ESwABQIixACJIoSdgCUYAR3Vg4MACYAPGYuFvYAfACU5Ko0APRxwADKMBD+wFAAFuh2Vv7OSBlYGdmc8ABu8LHKsRyGxqY4oQT21pTCIHQMjOwA5DAAHgACxAAOjDAAdChYxL0ANLHUouKSMH0AEmAAhJhY6ozpAJ77GTCMjMCiV0ToSAb7UJPPC9WRgrEJwAAqR6MwSRQPFGUFocDgRHYxnEfGAowh-zgUCOwF6KwkUl6tXqJhCeEsxDaS1AXSYfUGI3GUxmc0WSneQA) + + ```ts + interface ContactForm { + email?: string; + message?: string; + } + + function submitContactForm(formData: Required) { + // Send the form data to the server. + } + + submitContactForm({ + email: 'ex@mple.com', + message: 'Hi! Could you tell me more about…', + }); + + // TypeScript error: missing property 'message' + submitContactForm({ + email: 'ex@mple.com', + }); + ``` +
+ +- [`Readonly`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1415-L1420) - Make all properties in `T` readonly. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4UwOwVwW2AZA9gc3mAbmANsA3gKFCOAHkAzMgGkOJABEwAjKZa2kAUQCcvEu32AMQCGAF2FYBIAL4BufDRABLCKLBcywgMZgEKZOoDCiCGSXI8i4hGEwwALmABnUVxXJ57YFgzZHSVF8sT1BpBSItLGEnJz1kAy5LLy0TM2RHACUwYQATEywATwAeAITjU3MAPnkrCJMXLigtUT4AClxgGztKbyDgaX99I1TzAEokr1BRAAslJwA6FIqLAF48TtswHp9MHDla9hJGACswZvmyLjAwAC8wVpm5xZHkUZDaMKIwqyWXYCW0oN4sNlsA1h0ug5gAByACyBQAggAHJHQ7ZBIFoXbzBjMCz7OoQP5YIaJNYQMAAdziCVaALGNSIAHomcAACoFJFgADKWjcSNEwG4vC4ji0wggEEQguiTnMEGALWAV1yAFp8gVgEjeFyuKICvMrCTgVxnst5jtsGC4ljsPNhXxGaAWcAAOq6YRXYDCRg+RWIcA5JSC+kWdCepQ+v3RYCU3RInzRMCGwlpC19NYBW1Ye08R1AA) + + ```ts + enum LogLevel { + Off, + Debug, + Error, + Fatal + }; + + interface LoggerConfig { + name: string; + level: LogLevel; + } + + class Logger { + config: Readonly; + + constructor({name, level}: LoggerConfig) { + this.config = {name, level}; + Object.freeze(this.config); + } + } + + const config: LoggerConfig = { + name: 'MyApp', + level: LogLevel.Debug + }; + + const logger = new Logger(config); + + // TypeScript Error: cannot assign to read-only property. + logger.config.level = LogLevel.Error; + + // We are able to edit config variable as we please. + config.level = LogLevel.Error; + ``` +
+ +- [`Pick`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1422-L1427) - From `T`, pick a set of properties whose keys are in the union `K`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4SwOwFwUwJwGYEMDGNgEE5TCgNugN4BQoZwOUBAXMAM5RyQDmA3KeSFABYCuAtgCMISMHloMmENh04oA9tBjQJjFuzIBfYrOAB6PcADCcGElh1gEGAHcKATwAO6ebyjB5CTNlwFwSxFR0BX5HeToYABNgBDh5fm8cfBg6AHIKG3ldA2BHOOcfFNpUygJ0pAhokr4hETFUgDpswywkggAFUwA3MFtgAF5gQgowKhhVKTYKGuFRcXo1aVZgbTIoJ3RW3xhOmB6+wfbcAGsAHi3kgBpgEtGy4AAfG54BWfqAPnZm4AAlZUj4MAkMA8GAGB4vEgfMlLLw6CwPBA8PYRmMgZVgAC6CgmI4cIommQELwICh8RBgKZKvALh1ur0bHQABR5PYMui0Wk7em2ADaAF0AJS0AASABUALIAGQAogR+Mp3CROCAFBBwVC2ikBpj5CgBIqGjizLA5TAFdAmalImAuqlBRoVQh5HBgEy1eDWfs7J5cjzGYKhroVfpDEhHM4MV6GRR5NN0JrtnRg6BVirTFBeHAKYmYY6QNpdB73LmCJZBlSAXAubtvczeSmQMNSuMbmKNgBlHFgPEUNwusBIPAAQlS1xetTmxT0SDoESgdD0C4aACtHMwxytLrohawgA) + + ```ts + interface Article { + title: string; + thumbnail: string; + content: string; + } + + // Creates new type out of the `Article` interface composed + // from the Articles' two properties: `title` and `thumbnail`. + // `ArticlePreview = {title: string; thumbnail: string}` + type ArticlePreview = Pick; + + // Render a list of articles using only title and description. + function renderArticlePreviews(previews: ArticlePreview[]): HTMLElement { + const articles = document.createElement('div'); + + for (const preview of previews) { + // Append preview to the articles. + } + + return articles; + } + + const articles = renderArticlePreviews([ + { + title: 'TypeScript tutorial!', + thumbnail: '/assets/ts.jpg' + } + ]); + ``` +
+ +- [`Record`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1429-L1434) - Construct a type with a set of properties `K` of type `T`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/AQ4ejYAUHsGcCWAXBMB2dgwGbAKYC2ADgDYwCeeemCaWArgE7ADGMxAhmuQHQBQoYEnJE8wALKEARnkaxEKdMAC8wAOS0kstGuAAfdQBM8ANzxlRjXQbVaWACwC0JPB0NqA3HwGgIwAJJoWozYHCxixnAsjAhStADmwESMMJYo1Fi4HMCIaPEu+MRklHj8gpqyoeHAAKJFFFTAAN4+giDYCIxwSAByHAR4AFw5SDF5Xm2gJBzdfQPD3WPxE5PAlBxdAPLYNQAelgh4aOHDaPQEMowrIAC+3oJ+AMKMrlrAXFhSAFZ4LEhC9g4-0BmA4JBISXgiCkBQABpILrJ5MhUGhYcATGD6Bk4Hh-jNgABrPDkOBlXyQAAq9ngYmJpOAAHcEOCRjAXqwYODfoo6DhakUSph+Uh7GI4P0xER4Cj0OSQGwMP8tP1hgAlX7swwAHgRl2RvIANALSA08ABtAC6AD4VM1Wm0Kow0MMrYaHYJjGYLLJXZb3at1HYnC43Go-QHQDcvA6-JsmEJXARgCDgMYWAhjIYhDAU+YiMAAFIwex0ZmilMITCGF79TLAGRsAgJYAAZRwSEZGzEABFTOZUrJ5Yn+jwnWgeER6HB7AAKJrADpdXqS4ZqYultTG6azVfqHswPBbtauLY7fayQ7HIbAAAMwBuAEoYw9IBq2Ixs9h2eFMOQYPQObALQKJgggABeYhghCIpikkKRpOQRIknAsZUiIeCttECBEP8NSMCkjDDAARMGziuIYxHwYOjDCMBmDNnAuTxA6irdCOBB1Lh5Dqpqn66tISIykawBnOCtqqC0gbjqc9DgpGkxegOliyfJDrRkAA) + + ```ts + // Positions of employees in our company. + type MemberPosition = 'intern' | 'developer' | 'tech-lead'; + + // Interface describing properties of a single employee. + interface Employee { + firstName: string; + lastName: string; + yearsOfExperience: number; + } + + // Create an object that has all possible `MemberPosition` values set as keys. + // Those keys will store a collection of Employees of the same position. + const team: Record = { + intern: [], + developer: [], + 'tech-lead': [], + }; + + // Our team has decided to help John with his dream of becoming Software Developer. + team.intern.push({ + firstName: 'John', + lastName: 'Doe', + yearsOfExperience: 0 + }); + + // `Record` forces you to initialize all of the property keys. + // TypeScript Error: "tech-lead" property is missing + const teamEmpty: Record = { + intern: null, + developer: null, + }; + ``` +
+ +- [`Exclude`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1436-L1439) - Exclude from `T` those types that are assignable to `U`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgMrQG7QMIHsQzADmyA3gFDLIAOuUYAXMiAK4A2byAPsgM5hRQJHqwC2AI2gBucgF9y5MAE9qKAEoQAjiwj8AEnBAATNtGQBeZAAooWphu26wAGmS3e93bRC8IASgsAPmRDJRlyAHoI5ABRAA8ENhYjFFYOZGVVZBgoXFFkAAM0zh5+QRBhZhYJaAKAOkjogEkQZAQ4X2QAdwALCFbaemRgXmQtFjhOMFwq9K6ULuB0lk6U+HYwZAxJnQaYFhAEMGB8ZCIIMAAFOjAANR2IK0HGWISklIAedCgsKDwCYgAbQA5M9gQBdVzFQJ+JhiSRQMiUYYwayZCC4VHPCzmSzAspCYEBWxgFhQAZwKC+FpgJ43VwARgADH4ZFQSWSBjcZPJyPtDsdTvxKWBvr8rD1DCZoJ5HPopaYoK4EPhCEQmGKcKriLCtrhgEYkVQVT5Nr4fmZLLZtMBbFZgT0wGBqES6ghbHBIJqoBKFdBWQpjfh+DQbhY2tqiHVsbjLMVkAB+ZAAZiZaeQTHOVxu9ySjxNaujNwDVHNvzqbBGkBAdPoAfkQA) + + ```ts + interface ServerConfig { + port: null | string | number; + } + + type RequestHandler = (request: Request, response: Response) => void; + + // Exclude `null` type from `null | string | number`. + // In case the port is equal to `null`, we will use default value. + function getPortValue(port: Exclude): number { + if (typeof port === 'string') { + return parseInt(port, 10); + } + + return port; + } + + function startServer(handler: RequestHandler, config: ServerConfig): void { + const server = require('http').createServer(handler); + + const port = config.port === null ? 3000 : getPortValue(config.port); + server.listen(port); + } + ``` +
+ +- [`Extract`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1441-L1444) - Extract from `T` those types that are assignable to `U`. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXzSwEdkQBJYACgEoAueVZAWwCMQYBuAKDDwGcM8MgBF4AXngBlAJ6scESgHIRi6ty5ZUGdoihgEABXZ888AN5d48ANoiAuvUat23K6ihMQ9ATE0BzV3goPy8GZjZOLgBfLi4Aejj4AEEICBwAdz54MAALKFQQ+BxEeAAHY1NgKAwoIKy0grr4DByEUpgccpgMaXgAaxBerCzi+B9-ZulygDouFHRsU1z8kKMYE1RhaqgAHkt4AHkWACt4EAAPbVRgLLWNgBp9gGlBs8uQa6yAUUuYPQwdgNpKM7nh7mMML4CgA+R5WABqUAgpDeVxuhxO1he0jsXGh8EoOBO9COx3BQPo2PBADckaR6IjkSA6PBqTgsMBzPsicdrEC7OJWXSQNwYvFEgAVTS9JLXODpeDpKBZFg4GCoWa8VACIJykAKiQWKy2YQOAioYikCg0OEMDyhRSy4DyxS24KhAAMjyi6gS8AAwjh5OD0iBFHAkJoEOksC1mnkMJq8gUQKDNttKPlnfrwYp3J5XfBHXqoKpfYkAOI4ansTxaeDADmoRSCCBYAbxhC6TDx6rwYHIRX5bScjA4bLJwoDmDwDkfbA9JMrVMVdM1TN69LgkTgwgkchUahqIA) + + ```ts + declare function uniqueId(): number; + + const ID = Symbol('ID'); + + interface Person { + [ID]: number; + name: string; + age: number; + } + + // Allows changing the person data as long as the property key is of string type. + function changePersonData< + Obj extends Person, + Key extends Extract, + Value extends Obj[Key] + > (obj: Obj, key: Key, value: Value): void { + obj[key] = value; + } + + // Tiny Andrew was born. + const andrew = { + [ID]: uniqueId(), + name: 'Andrew', + age: 0, + }; + + // Cool, we're fine with that. + changePersonData(andrew, 'name', 'Pony'); + + // Goverment didn't like the fact that you wanted to change your identity. + changePersonData(andrew, ID, uniqueId()); + ``` +
+ +- [`NonNullable`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1446-L1449) - Exclude `null` and `undefined` from `T`. +
+ + Example + + Works with strictNullChecks set to true. (Read more here) + + [Playground](https://typescript-play.js.org/?target=6#code/C4TwDgpgBACg9gJ2AOQK4FsBGEFQLxQDOwCAlgHYDmUAPlORtrnQwDasDcAUFwPQBU-WAEMkUOADMowqAGNWwwoSgATCBIqlgpOOSjAAFsOBRSy1IQgr9cKJlSlW1mZYQA3HFH68u8xcoBlHA8EACEHJ08Aby4oKDBUTFZSWXjEFEYcAEIALihkXTR2YSSIAB54JDQsHAA+blj4xOTUsHSACkMzPKD3HHDHNQQAGjSkPMqMmoQASh7g-oihqBi4uNIpdraxPAI2VhmVxrX9AzMAOm2ppnwoAA4ABifuE4BfKAhWSyOTuK7CS7pao3AhXF5rV48E4ICDAVAIPT-cGQyG+XTEIgLMJLTx7CAAdygvRCA0iCHaMwarhJOIQjUBSHaACJHk8mYdeLwxtdcVAAOSsh58+lXdr7Dlcq7A3n3J4PEUdADMcspUE53OluAIUGVTx46oAKuAIAFZGQwCYAKIIBCILjUxaDHAMnla+iodjcIA) + + ```ts + type PortNumber = string | number | null; + + /** Part of a class definition that is used to build a server */ + class ServerBuilder { + portNumber!: NonNullable; + + port(this: ServerBuilder, port: PortNumber): ServerBuilder { + if (port == null) { + this.portNumber = 8000; + } else { + this.portNumber = port; + } + + return this; + } + } + + const serverBuilder = new ServerBuilder(); + + serverBuilder + .port('8000') // portNumber = '8000' + .port(null) // portNumber = 8000 + .port(3000); // portNumber = 3000 + + // TypeScript error + serverBuilder.portNumber = null; + ``` +
+ +- [`Parameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1451-L1454) - Obtain the parameters of a function type in a tuple. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/GYVwdgxgLglg9mABAZwBYmMANgUwBQxgAOIUAXIgIZgCeA2gLoCUFAbnDACaIDeAUIkQB6IYgCypSlBxUATrMo1ECsJzgBbLEoipqAc0J7EMKMgDkiHLnU4wp46pwAPHMgB0fAL58+oSLARECEosLAA5ABUYG2QAHgAxJGdpVWREPDdMylk9ZApqemZEAF4APipacrw-CApEgBogkKwAYThwckQwEHUAIxxZJl4BYVEImiIZKF0oZRwiWVdbeygJmThgOYgcGFYcbhqApCJsyhtpWXcR1cnEePBoeDAABVPzgbTixFeFd8uEsClADcIxGiygIFkSEOT3SmTc2VydQeRx+ZxwF2QQ34gkEwDgsnSuFmMBKiAADEDjIhYk1Qm0OlSYABqZnYka4xA1DJZHJYkGc7yCbyeRA+CAIZCzNAYbA4CIAdxg2zJwVCkWirjwMswuEaACYmCCgA) + + ```ts + function shuffle(input: any[]): void { + // Mutate array randomly changing its' elements indexes. + } + + function callNTimes any> (func: Fn, callCount: number) { + // Type that represents the type of the received function parameters. + type FunctionParameters = Parameters; + + return function (...args: FunctionParameters) { + for (let i = 0; i < callCount; i++) { + func(...args); + } + } + } + + const shuffleTwice = callNTimes(shuffle, 2); + ``` +
+ +- [`ConstructorParameters`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1456-L1459) - Obtain the parameters of a constructor function type in a tuple. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECCBOAXAlqApgWQPYBM0mgG8AoaaFRENALmgkXmQDsBzAblOmCycTV4D8teo1YdO3JiICuwRFngAKClWENmLAJRFOZRAAtkEAHQq00ALzlklNBzIBfYk+KhIMAJJTEYJsDQAwmDA+mgAPAAq0GgAHnxMODCKTGgA7tCKxllg8CwQtL4AngDaALraFgB80EWa1SRkAA6MAG5gfNAB4FABPDJyCrQR9tDNyG0dwMGhtBhgjWEiGgA00F70vv4RhY3hEZXVVinpc42KmuJkkv3y8Bly8EPaDWTkhiZd7r3e8LK3llwGCMXGQWGhEOsfH5zJlsrl8p0+gw-goAAo5MAAW3BaHgEEilU0tEhmzQ212BJ0ry4SOg+kg+gBBiMximIGA0nAfAQLGk2N4EAAEgzYcYcnkLsRdDTvNEYkYUKwSdCme9WdM0MYwYhFPSIPpJdTkAAzDKxBUaZX+aAAQgsVmkCTQxuYaBw2ng4Ok8CYcotSu8pMur09iG9vuObxZnx6SN+AyUWTF8MN0CcZE4Ywm5jZHK5aB5fP4iCFIqT4oRRTKRLo6lYVNeAHpG50wOzOe1zHr9NLQ+HoABybsD4HOKXXRA1JCoKhBELmI5pNaB6Fz0KKBAodDYPAgSUTmqYsAALx4m5nC6nW9nGq14KtaEUA9gR9PvuNCjQ9BgACNvcwNBtAcLiAA) + + ```ts + class ArticleModel { + title: string; + content?: string; + + constructor(title: string) { + this.title = title; + } + } + + class InstanceCache any)> { + private ClassConstructor: T; + private cache: Map> = new Map(); + + constructor (ctr: T) { + this.ClassConstructor = ctr; + } + + getInstance (...args: ConstructorParameters): InstanceType { + const hash = this.calculateArgumentsHash(...args); + + const existingInstance = this.cache.get(hash); + if (existingInstance !== undefined) { + return existingInstance; + } + + return new this.ClassConstructor(...args); + } + + private calculateArgumentsHash(...args: any[]): string { + // Calculate hash. + return 'hash'; + } + } + + const articleCache = new InstanceCache(ArticleModel); + const amazonArticle = articleCache.getInstance('Amazon forests burining!'); + ``` +
+ +- [`ReturnType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1461-L1464) – Obtain the return type of a function type. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) + + ```ts + /** Provides every element of the iterable `iter` into the `callback` function and stores the results in an array. */ + function mapIter< + Elem, + Func extends (elem: Elem) => any, + Ret extends ReturnType + >(iter: Iterable, callback: Func): Ret[] { + const mapped: Ret[] = []; + + for (const elem of iter) { + mapped.push(callback(elem)); + } + + return mapped; + } + + const setObject: Set = new Set(); + const mapObject: Map = new Map(); + + mapIter(setObject, (value: string) => value.indexOf('Foo')); // number[] + + mapIter(mapObject, ([key, value]: [number, string]) => { + return key % 2 === 0 ? value : 'Odd'; + }); // string[] + ``` +
+ +- [`InstanceType`](https://github.com/Microsoft/TypeScript/blob/2961bc3fc0ea1117d4e53bc8e97fa76119bc33e3/src/lib/es5.d.ts#L1466-L1469) – Obtain the instance type of a constructor function type. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/MYGwhgzhAECSAmICmBlJAnAbgS2E6A3gFDTTwD2AcuQC4AW2AdgOYAUAlAFzSbnbyEAvkWFFQkGJSQB3GMVI1sNZNwg10TZgG4S0YOUY0kh1es07d+xmvQBXYDXLpWi5UlMaWAGj0GjJ6BtNdkJdBQYIADpXZGgAXmgYpB1ScOwoq38aeN9DYxoU6GFRKzVoJjUwRjwAYXJbPPRuAFkwAAcAHgAxBodsAx9GWwBbACMMAD4cxhloVraOCyYjdAAzMDxoOut1e0d0UNIZ6WhWSPOwdGYIbiqATwBtAF0uaHudUQB6ACpv6ABpJBINqJdAbADW0Do5BOw3u5R2VTwMHIq2gAANtjZ0bkbHsnFCwJh8ONjHp0EgwEZ4JFoN9PkRVr1FAZoMwkDRYIjqkgOrosepoEgAB7+eAwAV2BxOLy6ACCVxgIrFEoMeOl6AACpcwMMORgIB1JRMiBNWKVdhruJKfOdIpdrtwFddXlzKjyACp3Nq842HaDIbL6BrZBIVGhIpB1EMYSLsmjmtWW-YhAA+qegAAYLKQLQj3ZsEsdccmnGcLor2Dn8xGedHGpEIBzEzspfsfMHDNAANTQACMVaIljV5GQkRA5DYmIpVKQAgAJARO9le33BDXIyi0YuLW2nJFGLqkOvxFB0YPdBSaLZ0IwNzyPkO8-xkGgsLh8Al427a3hWAhXwwHA8EHT5PmgAB1bAQBAANJ24adKWpft72RaBUTgRBUCAj89HAM8xCTaBjggABRQx0DuHJv25P9dCkWRZVIAAiBjoFImpmjlFBgA0NpsjadByDacgIDAEAIAAQmYpjoGYgAZSBsmGPw6DtZiiFA8CoJguDmAQmoZ2QvtUKQLdoAYmBTwgdEiCAA) + + ```ts + class IdleService { + doNothing (): void {} + } + + class News { + title: string; + content: string; + + constructor(title: string, content: string) { + this.title = title; + this.content = content; + } + } + + const instanceCounter: Map = new Map(); + + interface Constructor { + new(...args: any[]): any; + } + + // Keep track how many instances of `Constr` constructor have been created. + function getInstance< + Constr extends Constructor, + Args extends ConstructorParameters + >(constructor: Constr, ...args: Args): InstanceType { + let count = instanceCounter.get(constructor) || 0; + + const instance = new constructor(...args); + + instanceCounter.set(constructor, count + 1); + + console.log(`Created ${count + 1} instances of ${Constr.name} class`); + + return instance; + } + + + const idleService = getInstance(IdleService); + // Will log: `Created 1 instances of IdleService class` + const newsEntry = getInstance(News, 'New ECMAScript proposals!', 'Last month...'); + // Will log: `Created 1 instances of News class` + ``` +
+ +- [`Omit`](https://github.com/microsoft/TypeScript/blob/71af02f7459dc812e85ac31365bfe23daf14b4e4/src/lib/es5.d.ts#L1446) – Constructs a type by picking all properties from T and then removing K. +
+ + Example + + + [Playground](https://typescript-play.js.org/?target=6#code/JYOwLgpgTgZghgYwgAgIImAWzgG2QbwChlks4BzCAVShwC5kBnMKUcgbmKYAcIFgIjBs1YgOXMpSFMWbANoBdTiW5woFddwAW0kfKWEAvoUIB6U8gDCUCHEiNkICAHdkYAJ69kz4GC3JcPG4oAHteKDABBxCYNAxsPFBIWEQUCAAPJG4wZABySUFcgJAAEzMLXNV1ck0dIuCw6EjBADpy5AB1FAQ4EGQAV0YUP2AHDy8wEOQbUugmBLwtEIA3OcmQnEjuZBgQqE7gAGtgZAhwKHdkHFGwNvGUdDIcAGUliIBJEF3kAF5kAHlML4ADyPBIAGjyBUYRQAPnkqho4NoYQA+TiEGD9EAISIhPozErQMG4AASK2gn2+AApek9pCSXm8wFSQooAJQMUkAFQAsgAZACiOAgmDOOSIJAQ+OYyGl4DgoDmf2QJRCCH6YvALQQNjsEGFovF1NyJWAy1y7OUyHMyE+yRAuFImG4Iq1YDswHxbRINjA-SgfXlHqVUE4xiAA) + + ```ts + interface Animal { + imageUrl: string; + species: string; + images: string[]; + paragraphs: string[]; + } + + // Creates new type with all properties of the `Animal` interface + // except 'images' and 'paragraphs' properties. We can use this + // type to render small hover tooltip for a wiki entry list. + type AnimalShortInfo = Omit; + + function renderAnimalHoverInfo (animals: AnimalShortInfo[]): HTMLElement { + const container = document.createElement('div'); + // Internal implementation. + return container; + } + ``` +
+ +You can find some examples in the [TypeScript docs](https://www.typescriptlang.org/docs/handbook/advanced-types.html#predefined-conditional-types). + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Jarek Radosz](https://github.com/CvX) +- [Dimitri Benin](https://github.com/BendingBender) + + +## License + +(MIT OR CC0-1.0) + + +--- + +
+ + 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/node_modules/boxen/node_modules/type-fest/source/basic.d.ts b/node_modules/boxen/node_modules/type-fest/source/basic.d.ts new file mode 100644 index 0000000..5969ce5 --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/basic.d.ts @@ -0,0 +1,67 @@ +/// + +// TODO: This can just be `export type Primitive = not object` when the `not` keyword is out. +/** +Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). +*/ +export type Primitive = + | null + | undefined + | string + | number + | boolean + | symbol + | bigint; + +// TODO: Remove the `= unknown` sometime in the future when most users are on TS 3.5 as it's now the default +/** +Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). +*/ +export type Class = new(...arguments_: Arguments) => T; + +/** +Matches any [typed array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray), like `Uint8Array` or `Float64Array`. +*/ +export type TypedArray = + | Int8Array + | Uint8Array + | Uint8ClampedArray + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | Float32Array + | Float64Array + | BigInt64Array + | BigUint64Array; + +/** +Matches a JSON object. + +This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`. +*/ +export type JsonObject = {[key: string]: JsonValue}; + +/** +Matches a JSON array. +*/ +export interface JsonArray extends Array {} + +/** +Matches any valid JSON value. +*/ +export type JsonValue = string | number | boolean | null | JsonObject | JsonArray; + +declare global { + interface SymbolConstructor { + readonly observable: symbol; + } +} + +/** +Matches a value that is like an [Observable](https://github.com/tc39/proposal-observable). +*/ +export interface ObservableLike { + subscribe(observer: (value: unknown) => void): void; + [Symbol.observable](): ObservableLike; +} diff --git a/node_modules/boxen/node_modules/type-fest/source/except.d.ts b/node_modules/boxen/node_modules/type-fest/source/except.d.ts new file mode 100644 index 0000000..7dedbaa --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/except.d.ts @@ -0,0 +1,22 @@ +/** +Create a type from an object type without certain keys. + +This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/30825) if you want to have the stricter version as a built-in in TypeScript. + +@example +``` +import {Except} from 'type-fest'; + +type Foo = { + a: number; + b: string; + c: boolean; +}; + +type FooWithoutA = Except; +//=> {b: string}; +``` +*/ +export type Except = Pick>; diff --git a/node_modules/boxen/node_modules/type-fest/source/literal-union.d.ts b/node_modules/boxen/node_modules/type-fest/source/literal-union.d.ts new file mode 100644 index 0000000..52e8de6 --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/literal-union.d.ts @@ -0,0 +1,33 @@ +import {Primitive} from './basic'; + +/** +Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. + +Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals. + +This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore. + +@example +``` +import {LiteralUnion} from 'type-fest'; + +// Before + +type Pet = 'dog' | 'cat' | string; + +const pet: Pet = ''; +// Start typing in your TypeScript-enabled IDE. +// You **will not** get auto-completion for `dog` and `cat` literals. + +// After + +type Pet2 = LiteralUnion<'dog' | 'cat', string>; + +const pet: Pet2 = ''; +// You **will** get auto-completion for `dog` and `cat` literals. +``` + */ +export type LiteralUnion< + LiteralType extends BaseType, + BaseType extends Primitive +> = LiteralType | (BaseType & {_?: never}); diff --git a/node_modules/boxen/node_modules/type-fest/source/merge-exclusive.d.ts b/node_modules/boxen/node_modules/type-fest/source/merge-exclusive.d.ts new file mode 100644 index 0000000..059bd2c --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/merge-exclusive.d.ts @@ -0,0 +1,39 @@ +// Helper type. Not useful on its own. +type Without = {[KeyType in Exclude]?: never}; + +/** +Create a type that has mutually exclusive keys. + +This type was inspired by [this comment](https://github.com/Microsoft/TypeScript/issues/14094#issuecomment-373782604). + +This type works with a helper type, called `Without`. `Without` produces a type that has only keys from `FirstType` which are not present on `SecondType` and sets the value type for these keys to `never`. This helper type is then used in `MergeExclusive` to remove keys from either `FirstType` or `SecondType`. + +@example +``` +import {MergeExclusive} from 'type-fest'; + +interface ExclusiveVariation1 { + exclusive1: boolean; +} + +interface ExclusiveVariation2 { + exclusive2: string; +} + +type ExclusiveOptions = MergeExclusive; + +let exclusiveOptions: ExclusiveOptions; + +exclusiveOptions = {exclusive1: true}; +//=> Works +exclusiveOptions = {exclusive2: 'hi'}; +//=> Works +exclusiveOptions = {exclusive1: true, exclusive2: 'hi'}; +//=> Error +``` +*/ +export type MergeExclusive = + (FirstType | SecondType) extends object ? + (Without & SecondType) | (Without & FirstType) : + FirstType | SecondType; + diff --git a/node_modules/boxen/node_modules/type-fest/source/merge.d.ts b/node_modules/boxen/node_modules/type-fest/source/merge.d.ts new file mode 100644 index 0000000..4b3920b --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/merge.d.ts @@ -0,0 +1,22 @@ +import {Except} from './except'; + +/** +Merge two types into a new type. Keys of the second type overrides keys of the first type. + +@example +``` +import {Merge} from 'type-fest'; + +type Foo = { + a: number; + b: string; +}; + +type Bar = { + b: number; +}; + +const ab: Merge = {a: 1, b: 2}; +``` +*/ +export type Merge = Except> & SecondType; diff --git a/node_modules/boxen/node_modules/type-fest/source/mutable.d.ts b/node_modules/boxen/node_modules/type-fest/source/mutable.d.ts new file mode 100644 index 0000000..03d0dda --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/mutable.d.ts @@ -0,0 +1,22 @@ +/** +Convert an object with `readonly` keys into a mutable object. Inverse of `Readonly`. + +This can be used to [store and mutate options within a class](https://github.com/sindresorhus/pageres/blob/4a5d05fca19a5fbd2f53842cbf3eb7b1b63bddd2/source/index.ts#L72), [edit `readonly` objects within tests](https://stackoverflow.com/questions/50703834), and [construct a `readonly` object within a function](https://github.com/Microsoft/TypeScript/issues/24509). + +@example +``` +import {Mutable} from 'type-fest'; + +type Foo = { + readonly a: number; + readonly b: string; +}; + +const mutableFoo: Mutable = {a: 1, b: '2'}; +mutableFoo.a = 3; +``` +*/ +export type Mutable = { + // For each `Key` in the keys of `ObjectType`, make a mapped type by removing the `readonly` modifier from the key. + -readonly [KeyType in keyof ObjectType]: ObjectType[KeyType]; +}; diff --git a/node_modules/boxen/node_modules/type-fest/source/opaque.d.ts b/node_modules/boxen/node_modules/type-fest/source/opaque.d.ts new file mode 100644 index 0000000..5311c1b --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/opaque.d.ts @@ -0,0 +1,40 @@ +/** +Create an opaque type, which hides its internal details from the public, and can only be created by being used explicitly. + +The generic type parameter can be anything. It doesn't have to be an object. + +[Read more about opaque types.](https://codemix.com/opaque-types-in-javascript/) + +There have been several discussions about adding this feature to TypeScript via the `opaque type` operator, similar to how Flow does it. Unfortunately, nothing has (yet) moved forward: + - [Microsoft/TypeScript#15408](https://github.com/Microsoft/TypeScript/issues/15408) + - [Microsoft/TypeScript#15807](https://github.com/Microsoft/TypeScript/issues/15807) + +@example +``` +import {Opaque} from 'type-fest'; + +type AccountNumber = Opaque; +type AccountBalance = Opaque; + +function createAccountNumber(): AccountNumber { + return 2 as AccountNumber; +} + +function getMoneyForAccount(accountNumber: AccountNumber): AccountBalance { + return 4 as AccountBalance; +} + +// This will compile successfully. +getMoneyForAccount(createAccountNumber()); + +// But this won't, because it has to be explicitly passed as an `AccountNumber` type. +getMoneyForAccount(2); + +// You can use opaque values like they aren't opaque too. +const accountNumber = createAccountNumber(); + +// This will compile successfully. +accountNumber + 2; +``` +*/ +export type Opaque = Type & {readonly __opaque__: unique symbol}; diff --git a/node_modules/boxen/node_modules/type-fest/source/package-json.d.ts b/node_modules/boxen/node_modules/type-fest/source/package-json.d.ts new file mode 100644 index 0000000..3179e58 --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/package-json.d.ts @@ -0,0 +1,501 @@ +import {LiteralUnion} from '..'; + +declare namespace PackageJson { + /** + A person who has been involved in creating or maintaining the package. + */ + export type Person = + | string + | { + name: string; + url?: string; + email?: string; + }; + + export type BugsLocation = + | string + | { + /** + The URL to the package's issue tracker. + */ + url?: string; + + /** + The email address to which issues should be reported. + */ + email?: string; + }; + + export interface DirectoryLocations { + /** + Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder. + */ + bin?: string; + + /** + Location for Markdown files. + */ + doc?: string; + + /** + Location for example scripts. + */ + example?: string; + + /** + Location for the bulk of the library. + */ + lib?: string; + + /** + Location for man pages. Sugar to generate a `man` array by walking the folder. + */ + man?: string; + + /** + Location for test files. + */ + test?: string; + + [directoryType: string]: unknown; + } + + export type Scripts = { + /** + Run **before** the package is published (Also run on local `npm install` without any arguments). + */ + prepublish?: string; + + /** + Run both **before** the package is packed and published, and on local `npm install` without any arguments. This is run **after** `prepublish`, but **before** `prepublishOnly`. + */ + prepare?: string; + + /** + Run **before** the package is prepared and packed, **only** on `npm publish`. + */ + prepublishOnly?: string; + + /** + Run **before** a tarball is packed (on `npm pack`, `npm publish`, and when installing git dependencies). + */ + prepack?: string; + + /** + Run **after** the tarball has been generated and moved to its final destination. + */ + postpack?: string; + + /** + Run **after** the package is published. + */ + publish?: string; + + /** + Run **after** the package is published. + */ + postpublish?: string; + + /** + Run **before** the package is installed. + */ + preinstall?: string; + + /** + Run **after** the package is installed. + */ + install?: string; + + /** + Run **after** the package is installed and after `install`. + */ + postinstall?: string; + + /** + Run **before** the package is uninstalled and before `uninstall`. + */ + preuninstall?: string; + + /** + Run **before** the package is uninstalled. + */ + uninstall?: string; + + /** + Run **after** the package is uninstalled. + */ + postuninstall?: string; + + /** + Run **before** bump the package version and before `version`. + */ + preversion?: string; + + /** + Run **before** bump the package version. + */ + version?: string; + + /** + Run **after** bump the package version. + */ + postversion?: string; + + /** + Run with the `npm test` command, before `test`. + */ + pretest?: string; + + /** + Run with the `npm test` command. + */ + test?: string; + + /** + Run with the `npm test` command, after `test`. + */ + posttest?: string; + + /** + Run with the `npm stop` command, before `stop`. + */ + prestop?: string; + + /** + Run with the `npm stop` command. + */ + stop?: string; + + /** + Run with the `npm stop` command, after `stop`. + */ + poststop?: string; + + /** + Run with the `npm start` command, before `start`. + */ + prestart?: string; + + /** + Run with the `npm start` command. + */ + start?: string; + + /** + Run with the `npm start` command, after `start`. + */ + poststart?: string; + + /** + Run with the `npm restart` command, before `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + prerestart?: string; + + /** + Run with the `npm restart` command. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + restart?: string; + + /** + Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. + */ + postrestart?: string; + } & { + [scriptName: string]: string; + }; + + /** + Dependencies of the package. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or Git URL. + */ + export interface Dependency { + [packageName: string]: string; + } + + export interface NonStandardEntryPoints { + /** + An ECMAScript module ID that is the primary entry point to the program. + */ + module?: string; + + /** + A module ID with untranspiled code that is the primary entry point to the program. + */ + esnext?: + | string + | { + main?: string; + browser?: string; + [moduleName: string]: string | undefined; + }; + + /** + A hint to JavaScript bundlers or component tools when packaging modules for client side use. + */ + browser?: + | string + | { + [moduleName: string]: string | false; + }; + } + + export interface TypeScriptConfiguration { + /** + Location of the bundled TypeScript declaration file. + */ + types?: string; + + /** + Location of the bundled TypeScript declaration file. Alias of `types`. + */ + typings?: string; + } + + export interface YarnConfiguration { + /** + If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command line, set this to `true`. + + Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an application), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line. + */ + flat?: boolean; + + /** + Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file. + */ + resolutions?: Dependency; + } + + export interface JSPMConfiguration { + /** + JSPM configuration. + */ + jspm?: PackageJson; + } +} + +/** +Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn. +*/ +export type PackageJson = { + /** + The name of the package. + */ + name?: string; + + /** + Package version, parseable by [`node-semver`](https://github.com/npm/node-semver). + */ + version?: string; + + /** + Package description, listed in `npm search`. + */ + description?: string; + + /** + Keywords associated with package, listed in `npm search`. + */ + keywords?: string[]; + + /** + The URL to the package's homepage. + */ + homepage?: LiteralUnion<'.', string>; + + /** + The URL to the package's issue tracker and/or the email address to which issues should be reported. + */ + bugs?: PackageJson.BugsLocation; + + /** + The license for the package. + */ + license?: string; + + /** + The licenses for the package. + */ + licenses?: Array<{ + type?: string; + url?: string; + }>; + + author?: PackageJson.Person; + + /** + A list of people who contributed to the package. + */ + contributors?: PackageJson.Person[]; + + /** + A list of people who maintain the package. + */ + maintainers?: PackageJson.Person[]; + + /** + The files included in the package. + */ + files?: string[]; + + /** + The module ID that is the primary entry point to the program. + */ + main?: string; + + /** + The executable files that should be installed into the `PATH`. + */ + bin?: + | string + | { + [binary: string]: string; + }; + + /** + Filenames to put in place for the `man` program to find. + */ + man?: string | string[]; + + /** + Indicates the structure of the package. + */ + directories?: PackageJson.DirectoryLocations; + + /** + Location for the code repository. + */ + repository?: + | string + | { + type: string; + url: string; + }; + + /** + Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point. + */ + scripts?: PackageJson.Scripts; + + /** + Is used to set configuration parameters used in package scripts that persist across upgrades. + */ + config?: { + [configKey: string]: unknown; + }; + + /** + The dependencies of the package. + */ + dependencies?: PackageJson.Dependency; + + /** + Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling. + */ + devDependencies?: PackageJson.Dependency; + + /** + Dependencies that are skipped if they fail to install. + */ + optionalDependencies?: PackageJson.Dependency; + + /** + Dependencies that will usually be required by the package user directly or via another dependency. + */ + peerDependencies?: PackageJson.Dependency; + + /** + Package names that are bundled when the package is published. + */ + bundledDependencies?: string[]; + + /** + Alias of `bundledDependencies`. + */ + bundleDependencies?: string[]; + + /** + Engines that this package runs on. + */ + engines?: { + [EngineName in 'npm' | 'node' | string]: string; + }; + + /** + @deprecated + */ + engineStrict?: boolean; + + /** + Operating systems the module runs on. + */ + os?: Array>; + + /** + CPU architectures the module runs on. + */ + cpu?: Array>; + + /** + If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally. + + @deprecated + */ + preferGlobal?: boolean; + + /** + If set to `true`, then npm will refuse to publish it. + */ + private?: boolean; + + /** + * A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default. + */ + publishConfig?: { + [config: string]: unknown; + }; +} & +PackageJson.NonStandardEntryPoints & +PackageJson.TypeScriptConfiguration & +PackageJson.YarnConfiguration & +PackageJson.JSPMConfiguration & { + [key: string]: unknown; +}; diff --git a/node_modules/boxen/node_modules/type-fest/source/partial-deep.d.ts b/node_modules/boxen/node_modules/type-fest/source/partial-deep.d.ts new file mode 100644 index 0000000..b962b84 --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/partial-deep.d.ts @@ -0,0 +1,72 @@ +import {Primitive} from './basic'; + +/** +Create a type from another type with all keys and nested keys set to optional. + +Use-cases: +- Merging a default settings/config object with another object, the second object would be a deep partial of the default object. +- Mocking and testing complex entities, where populating an entire object with its keys would be redundant in terms of the mock or test. + +@example +``` +import {PartialDeep} from 'type-fest'; + +const settings: Settings = { + textEditor: { + fontSize: 14; + fontColor: '#000000'; + fontWeight: 400; + } + autocomplete: false; + autosave: true; +}; + +const applySavedSettings = (savedSettings: PartialDeep) => { + return {...settings, ...savedSettings}; +} + +settings = applySavedSettings({textEditor: {fontWeight: 500}}); +``` +*/ +export type PartialDeep = T extends Primitive + ? Partial + : T extends Map + ? PartialMapDeep + : T extends Set + ? PartialSetDeep + : T extends ReadonlyMap + ? PartialReadonlyMapDeep + : T extends ReadonlySet + ? PartialReadonlySetDeep + : T extends ((...arguments: any[]) => unknown) + ? T | undefined + : T extends object + ? PartialObjectDeep + : unknown; + +/** +Same as `PartialDeep`, but accepts only `Map`s and as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialMapDeep extends Map, PartialDeep> {} + +/** +Same as `PartialDeep`, but accepts only `Set`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialSetDeep extends Set> {} + +/** +Same as `PartialDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialReadonlyMapDeep extends ReadonlyMap, PartialDeep> {} + +/** +Same as `PartialDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `PartialDeep`. +*/ +interface PartialReadonlySetDeep extends ReadonlySet> {} + +/** +Same as `PartialDeep`, but accepts only `object`s as inputs. Internal helper for `PartialDeep`. +*/ +type PartialObjectDeep = { + [KeyType in keyof ObjectType]?: PartialDeep +}; diff --git a/node_modules/boxen/node_modules/type-fest/source/promisable.d.ts b/node_modules/boxen/node_modules/type-fest/source/promisable.d.ts new file mode 100644 index 0000000..71242a5 --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/promisable.d.ts @@ -0,0 +1,23 @@ +/** +Create a type that represents either the value or the value wrapped in `PromiseLike`. + +Use-cases: +- A function accepts a callback that may either return a value synchronously or may return a promised value. +- This type could be the return type of `Promise#then()`, `Promise#catch()`, and `Promise#finally()` callbacks. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/31394) if you want to have this type as a built-in in TypeScript. + +@example +``` +import {Promisable} from 'type-fest'; + +async function logger(getLogEntry: () => Promisable): Promise { + const entry = await getLogEntry(); + console.log(entry); +} + +logger(() => 'foo'); +logger(() => Promise.resolve('bar')); +``` +*/ +export type Promisable = T | PromiseLike; diff --git a/node_modules/boxen/node_modules/type-fest/source/readonly-deep.d.ts b/node_modules/boxen/node_modules/type-fest/source/readonly-deep.d.ts new file mode 100644 index 0000000..b8c04de --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/readonly-deep.d.ts @@ -0,0 +1,59 @@ +import {Primitive} from './basic'; + +/** +Convert `object`s, `Map`s, `Set`s, and `Array`s and all of their keys/elements into immutable structures recursively. + +This is useful when a deeply nested structure needs to be exposed as completely immutable, for example, an imported JSON module or when receiving an API response that is passed around. + +Please upvote [this issue](https://github.com/microsoft/TypeScript/issues/13923) if you want to have this type as a built-in in TypeScript. + +@example +``` +// data.json +{ + "foo": ["bar"] +} + +// main.ts +import {ReadonlyDeep} from 'type-fest'; +import dataJson = require('./data.json'); + +const data: ReadonlyDeep = dataJson; + +export default data; + +// test.ts +import data from './main'; + +data.foo.push('bar'); +//=> error TS2339: Property 'push' does not exist on type 'readonly string[]' +``` +*/ +export type ReadonlyDeep = T extends Primitive | ((...arguments: any[]) => unknown) + ? T + : T extends ReadonlyMap + ? ReadonlyMapDeep + : T extends ReadonlySet + ? ReadonlySetDeep + : T extends object + ? ReadonlyObjectDeep + : unknown; + +/** +Same as `ReadonlyDeep`, but accepts only `ReadonlyMap`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +interface ReadonlyMapDeep + extends ReadonlyMap, ReadonlyDeep> {} + +/** +Same as `ReadonlyDeep`, but accepts only `ReadonlySet`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +interface ReadonlySetDeep + extends ReadonlySet> {} + +/** +Same as `ReadonlyDeep`, but accepts only `object`s as inputs. Internal helper for `ReadonlyDeep`. +*/ +type ReadonlyObjectDeep = { + readonly [KeyType in keyof ObjectType]: ReadonlyDeep +}; diff --git a/node_modules/boxen/node_modules/type-fest/source/require-at-least-one.d.ts b/node_modules/boxen/node_modules/type-fest/source/require-at-least-one.d.ts new file mode 100644 index 0000000..337379f --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/require-at-least-one.d.ts @@ -0,0 +1,32 @@ +import {Except} from './except'; + +/** +Create a type that requires at least one of the given keys. The remaining keys are kept as is. + +@example +``` +import {RequireAtLeastOne} from 'type-fest'; + +type Responder = { + text?: () => string; + json?: () => string; + + secure?: boolean; +}; + +const responder: RequireAtLeastOne = { + json: () => '{"message": "ok"}', + secure: true +}; +``` +*/ +export type RequireAtLeastOne = + { + // For each Key in KeysType make a mapped type + [Key in KeysType]: ( + // …by picking that Key's type and making it required + Required> + ) + }[KeysType] + // …then, make intersection types by adding the remaining keys to each mapped type. + & Except; diff --git a/node_modules/boxen/node_modules/type-fest/source/require-exactly-one.d.ts b/node_modules/boxen/node_modules/type-fest/source/require-exactly-one.d.ts new file mode 100644 index 0000000..d8c71b7 --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/require-exactly-one.d.ts @@ -0,0 +1,36 @@ +// TODO: Remove this when we target TypeScript >=3.5. +// eslint-disable-next-line @typescript-eslint/generic-type-naming +type _Omit = Pick>; + +/** +Create a type that requires exactly one of the given keys and disallows more. The remaining keys are kept as is. + +Use-cases: +- Creating interfaces for components that only need one of the keys to display properly. +- Declaring generic keys in a single place for a single use-case that gets narrowed down via `RequireExactlyOne`. + +The caveat with `RequireExactlyOne` is that TypeScript doesn't always know at compile time every key that will exist at runtime. Therefore `RequireExactlyOne` can't do anything to prevent extra keys it doesn't know about. + +@example +``` +import {RequireExactlyOne} from 'type-fest'; + +type Responder = { + text: () => string; + json: () => string; + secure: boolean; +}; + +const responder: RequireExactlyOne = { + // Adding a `text` key here would cause a compile error. + + json: () => '{"message": "ok"}', + secure: true +}; +``` +*/ +export type RequireExactlyOne = + {[Key in KeysType]: ( + Required> & + Partial, never>> + )}[KeysType] & _Omit; diff --git a/node_modules/boxen/node_modules/type-fest/source/set-optional.d.ts b/node_modules/boxen/node_modules/type-fest/source/set-optional.d.ts new file mode 100644 index 0000000..a9a256a --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/set-optional.d.ts @@ -0,0 +1,32 @@ +/** +Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the `SetRequired` type. + +Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional. + +@example +``` +import {SetOptional} from 'type-fest'; + +type Foo = { + a: number; + b?: string; + c: boolean; +} + +type SomeOptional = SetOptional; +// type SomeOptional = { +// a: number; +// b?: string; // Was already optional and still is. +// c?: boolean; // Is now optional. +// } +``` +*/ +export type SetOptional = + // Pick just the keys that are not optional from the base type. + Pick> & + // Pick the keys that should be optional from the base type and make them optional. + Partial> extends + // If `InferredType` extends the previous, then for each key, use the inferred type key. + infer InferredType + ? {[KeyType in keyof InferredType]: InferredType[KeyType]} + : never; diff --git a/node_modules/boxen/node_modules/type-fest/source/set-required.d.ts b/node_modules/boxen/node_modules/type-fest/source/set-required.d.ts new file mode 100644 index 0000000..2572bc1 --- /dev/null +++ b/node_modules/boxen/node_modules/type-fest/source/set-required.d.ts @@ -0,0 +1,32 @@ +/** +Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type. + +Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required. + +@example +``` +import {SetRequired} from 'type-fest'; + +type Foo = { + a?: number; + b: string; + c?: boolean; +} + +type SomeRequired = SetRequired; +// type SomeRequired = { +// a?: number; +// b: string; // Was already required and still is. +// c: boolean; // Is now required. +// } +``` +*/ +export type SetRequired = + // Pick just the keys that are not required from the base type. + Pick> & + // Pick the keys that should be required from the base type and make them required. + Required> extends + // If `InferredType` extends the previous, then for each key, use the inferred type key. + infer InferredType + ? {[KeyType in keyof InferredType]: InferredType[KeyType]} + : never; diff --git a/node_modules/callsites/index.d.ts b/node_modules/callsites/index.d.ts new file mode 100644 index 0000000..61f597c --- /dev/null +++ b/node_modules/callsites/index.d.ts @@ -0,0 +1,96 @@ +declare namespace callsites { + interface CallSite { + /** + Returns the value of `this`. + */ + getThis(): unknown | undefined; + + /** + Returns the 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; + + /** + Returns the current function. + */ + getFunction(): Function | undefined; + + /** + Returns the 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; + + /** + Returns the name of the property of `this` or one of its prototypes that holds the current function. + */ + getMethodName(): string | undefined; + + /** + Returns the name of the script if this function was defined in a script. + */ + getFileName(): string | null; + + /** + Returns the current line number if this function was defined in a script. + */ + getLineNumber(): number | null; + + /** + Returns the current column number if this function was defined in a script. + */ + getColumnNumber(): number | null; + + /** + Returns a string representing the location where `eval` was called if this function was created using a call to `eval`. + */ + getEvalOrigin(): string | undefined; + + /** + Returns `true` if this is a top-level invocation, that is, if it's a global object. + */ + isToplevel(): boolean; + + /** + Returns `true` if this call takes place in code defined by a call to `eval`. + */ + isEval(): boolean; + + /** + Returns `true` if this call is in native V8 code. + */ + isNative(): boolean; + + /** + Returns `true` if this is a constructor call. + */ + isConstructor(): boolean; + } +} + +declare const callsites: { + /** + Get callsites from the V8 stack trace API. + + @returns An array of `CallSite` objects. + + @example + ``` + import callsites = require('callsites'); + + function unicorn() { + console.log(callsites()[0].getFileName()); + //=> '/Users/sindresorhus/dev/callsites/test.js' + } + + unicorn(); + ``` + */ + (): callsites.CallSite[]; + + // TODO: Remove this for the next major release, refactor the whole definition to: + // declare function callsites(): callsites.CallSite[]; + // export = callsites; + default: typeof callsites; +}; + +export = callsites; diff --git a/node_modules/callsites/index.js b/node_modules/callsites/index.js new file mode 100644 index 0000000..486c241 --- /dev/null +++ b/node_modules/callsites/index.js @@ -0,0 +1,13 @@ +'use strict'; + +const callsites = () => { + const _prepareStackTrace = Error.prepareStackTrace; + Error.prepareStackTrace = (_, stack) => stack; + const stack = new Error().stack.slice(1); + Error.prepareStackTrace = _prepareStackTrace; + return stack; +}; + +module.exports = callsites; +// TODO: Remove this for the next major release +module.exports.default = callsites; diff --git a/node_modules/callsites/license b/node_modules/callsites/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/callsites/license @@ -0,0 +1,9 @@ +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/node_modules/callsites/package.json b/node_modules/callsites/package.json new file mode 100644 index 0000000..93463c3 --- /dev/null +++ b/node_modules/callsites/package.json @@ -0,0 +1,39 @@ +{ + "name": "callsites", + "version": "3.1.0", + "description": "Get callsites from the V8 stack trace API", + "license": "MIT", + "repository": "sindresorhus/callsites", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "stacktrace", + "v8", + "callsite", + "callsites", + "stack", + "trace", + "function", + "file", + "line", + "debug" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.7.2", + "xo": "^0.24.0" + } +} diff --git a/node_modules/callsites/readme.md b/node_modules/callsites/readme.md new file mode 100644 index 0000000..fc84613 --- /dev/null +++ b/node_modules/callsites/readme.md @@ -0,0 +1,48 @@ +# callsites [![Build Status](https://travis-ci.org/sindresorhus/callsites.svg?branch=master)](https://travis-ci.org/sindresorhus/callsites) + +> Get callsites from the [V8 stack trace API](https://v8.dev/docs/stack-trace-api) + + +## Install + +``` +$ npm install callsites +``` + + +## Usage + +```js +const callsites = require('callsites'); + +function unicorn() { + console.log(callsites()[0].getFileName()); + //=> '/Users/sindresorhus/dev/callsites/test.js' +} + +unicorn(); +``` + + +## API + +Returns an array of callsite objects with the following methods: + +- `getThis`: returns the value of `this`. +- `getTypeName`: returns the 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. +- `getFunction`: returns the current function. +- `getFunctionName`: returns the 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. +- `getMethodName`: returns the name of the property of `this` or one of its prototypes that holds the current function. +- `getFileName`: if this function was defined in a script returns the name of the script. +- `getLineNumber`: if this function was defined in a script returns the current line number. +- `getColumnNumber`: if this function was defined in a script returns the current column number +- `getEvalOrigin`: if this function was created using a call to `eval` returns a string representing the location where `eval` was called. +- `isToplevel`: is this a top-level invocation, that is, is this the global object? +- `isEval`: does this call take place in code defined by a call to `eval`? +- `isNative`: is this call in native V8 code? +- `isConstructor`: is this a constructor call? + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/configstore/node_modules/dot-prop/index.d.ts b/node_modules/configstore/node_modules/dot-prop/index.d.ts new file mode 100644 index 0000000..861f533 --- /dev/null +++ b/node_modules/configstore/node_modules/dot-prop/index.d.ts @@ -0,0 +1,101 @@ +declare const dotProp: { + /** + @param object - Object to get the `path` value. + @param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key. + @param defaultValue - Default value. + + @example + ``` + import dotProp = require('dot-prop'); + + dotProp.get({foo: {bar: 'unicorn'}}, 'foo.bar'); + //=> 'unicorn' + + dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep'); + //=> undefined + + dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep', 'default value'); + //=> 'default value' + + dotProp.get({foo: {'dot.dot': 'unicorn'}}, 'foo.dot\\.dot'); + //=> 'unicorn' + ``` + */ + get( + object: {[key: string]: any} | undefined, + path: string + ): T | undefined; + get( + object: {[key: string]: any} | undefined, + path: string, + defaultValue: T + ): T; + + /** + @param object - Object to set the `path` value. + @param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key. + @param value - Value to set at `path`. + @returns The object. + + @example + ``` + import dotProp = require('dot-prop'); + + const object = {foo: {bar: 'a'}}; + dotProp.set(object, 'foo.bar', 'b'); + console.log(object); + //=> {foo: {bar: 'b'}} + + const foo = dotProp.set({}, 'foo.bar', 'c'); + console.log(foo); + //=> {foo: {bar: 'c'}} + + dotProp.set(object, 'foo.baz', 'x'); + console.log(object); + //=> {foo: {bar: 'b', baz: 'x'}} + ``` + */ + set( + object: T, + path: string, + value: unknown + ): T; + + /** + @param object - Object to test the `path` value. + @param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key. + + @example + ``` + import dotProp = require('dot-prop'); + + dotProp.has({foo: {bar: 'unicorn'}}, 'foo.bar'); + //=> true + ``` + */ + has(object: {[key: string]: any} | undefined, path: string): boolean; + + /** + @param object - Object to delete the `path` value. + @param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key. + @returns A boolean of whether the property existed before being deleted. + + @example + ``` + import dotProp = require('dot-prop'); + + const object = {foo: {bar: 'a'}}; + dotProp.delete(object, 'foo.bar'); + console.log(object); + //=> {foo: {}} + + object.foo.bar = {x: 'y', y: 'x'}; + dotProp.delete(object, 'foo.bar.x'); + console.log(object); + //=> {foo: {bar: {y: 'x'}}} + ``` + */ + delete(object: {[key: string]: any}, path: string): boolean; +}; + +export = dotProp; diff --git a/node_modules/configstore/node_modules/dot-prop/index.js b/node_modules/configstore/node_modules/dot-prop/index.js new file mode 100644 index 0000000..a90f599 --- /dev/null +++ b/node_modules/configstore/node_modules/dot-prop/index.js @@ -0,0 +1,142 @@ +'use strict'; +const isObj = require('is-obj'); + +const disallowedKeys = [ + '__proto__', + 'prototype', + 'constructor' +]; + +const isValidPath = pathSegments => !pathSegments.some(segment => disallowedKeys.includes(segment)); + +function getPathSegments(path) { + const pathArray = path.split('.'); + const parts = []; + + for (let i = 0; i < pathArray.length; i++) { + let p = pathArray[i]; + + while (p[p.length - 1] === '\\' && pathArray[i + 1] !== undefined) { + p = p.slice(0, -1) + '.'; + p += pathArray[++i]; + } + + parts.push(p); + } + + if (!isValidPath(parts)) { + return []; + } + + return parts; +} + +module.exports = { + get(object, path, value) { + if (!isObj(object) || typeof path !== 'string') { + return value === undefined ? object : value; + } + + const pathArray = getPathSegments(path); + if (pathArray.length === 0) { + return; + } + + for (let i = 0; i < pathArray.length; i++) { + if (!Object.prototype.propertyIsEnumerable.call(object, pathArray[i])) { + return value; + } + + object = object[pathArray[i]]; + + if (object === undefined || object === null) { + // `object` is either `undefined` or `null` so we want to stop the loop, and + // if this is not the last bit of the path, and + // if it did't return `undefined` + // it would return `null` if `object` is `null` + // but we want `get({foo: null}, 'foo.bar')` to equal `undefined`, or the supplied value, not `null` + if (i !== pathArray.length - 1) { + return value; + } + + break; + } + } + + return object; + }, + + set(object, path, value) { + if (!isObj(object) || typeof path !== 'string') { + return object; + } + + const root = object; + const pathArray = getPathSegments(path); + + for (let i = 0; i < pathArray.length; i++) { + const p = pathArray[i]; + + if (!isObj(object[p])) { + object[p] = {}; + } + + if (i === pathArray.length - 1) { + object[p] = value; + } + + object = object[p]; + } + + return root; + }, + + delete(object, path) { + if (!isObj(object) || typeof path !== 'string') { + return false; + } + + const pathArray = getPathSegments(path); + + for (let i = 0; i < pathArray.length; i++) { + const p = pathArray[i]; + + if (i === pathArray.length - 1) { + delete object[p]; + return true; + } + + object = object[p]; + + if (!isObj(object)) { + return false; + } + } + }, + + has(object, path) { + if (!isObj(object) || typeof path !== 'string') { + return false; + } + + const pathArray = getPathSegments(path); + if (pathArray.length === 0) { + return false; + } + + // eslint-disable-next-line unicorn/no-for-loop + for (let i = 0; i < pathArray.length; i++) { + if (isObj(object)) { + if (!(pathArray[i] in object)) { + return false; + } + + object = object[pathArray[i]]; + } else { + return false; + } + } + + return true; + } +}; diff --git a/node_modules/configstore/node_modules/dot-prop/license b/node_modules/configstore/node_modules/dot-prop/license new file mode 100644 index 0000000..e7af2f7 --- /dev/null +++ b/node_modules/configstore/node_modules/dot-prop/license @@ -0,0 +1,9 @@ +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/node_modules/configstore/node_modules/dot-prop/package.json b/node_modules/configstore/node_modules/dot-prop/package.json new file mode 100644 index 0000000..d4e51bf --- /dev/null +++ b/node_modules/configstore/node_modules/dot-prop/package.json @@ -0,0 +1,45 @@ +{ + "name": "dot-prop", + "version": "5.3.0", + "description": "Get, set, or delete a property from a nested object using a dot path", + "license": "MIT", + "repository": "sindresorhus/dot-prop", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=8" + }, + "scripts": { + "test": "xo && ava && tsd", + "bench": "node bench.js" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "object", + "prop", + "property", + "dot", + "path", + "get", + "set", + "delete", + "access", + "notation", + "dotty" + ], + "dependencies": { + "is-obj": "^2.0.0" + }, + "devDependencies": { + "ava": "^2.1.0", + "benchmark": "^2.1.4", + "tsd": "^0.7.2", + "xo": "^0.25.3" + } +} diff --git a/node_modules/configstore/node_modules/dot-prop/readme.md b/node_modules/configstore/node_modules/dot-prop/readme.md new file mode 100644 index 0000000..4170565 --- /dev/null +++ b/node_modules/configstore/node_modules/dot-prop/readme.md @@ -0,0 +1,117 @@ +# dot-prop [![Build Status](https://travis-ci.org/sindresorhus/dot-prop.svg?branch=master)](https://travis-ci.org/sindresorhus/dot-prop) + +> Get, set, or delete a property from a nested object using a dot path + + +## Install + +``` +$ npm install dot-prop +``` + + +## Usage + +```js +const dotProp = require('dot-prop'); + +// Getter +dotProp.get({foo: {bar: 'unicorn'}}, 'foo.bar'); +//=> 'unicorn' + +dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep'); +//=> undefined + +dotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep', 'default value'); +//=> 'default value' + +dotProp.get({foo: {'dot.dot': 'unicorn'}}, 'foo.dot\\.dot'); +//=> 'unicorn' + +// Setter +const object = {foo: {bar: 'a'}}; +dotProp.set(object, 'foo.bar', 'b'); +console.log(object); +//=> {foo: {bar: 'b'}} + +const foo = dotProp.set({}, 'foo.bar', 'c'); +console.log(foo); +//=> {foo: {bar: 'c'}} + +dotProp.set(object, 'foo.baz', 'x'); +console.log(object); +//=> {foo: {bar: 'b', baz: 'x'}} + +// Has +dotProp.has({foo: {bar: 'unicorn'}}, 'foo.bar'); +//=> true + +// Deleter +const object = {foo: {bar: 'a'}}; +dotProp.delete(object, 'foo.bar'); +console.log(object); +//=> {foo: {}} + +object.foo.bar = {x: 'y', y: 'x'}; +dotProp.delete(object, 'foo.bar.x'); +console.log(object); +//=> {foo: {bar: {y: 'x'}}} +``` + + +## API + +### get(object, path, defaultValue?) + +### set(object, path, value) + +Returns the object. + +### has(object, path) + +### delete(object, path) + +Returns a boolean of whether the property existed before being deleted. + +#### object + +Type: `object` + +Object to get, set, or delete the `path` value. + +You are allowed to pass in `undefined` as the object to the `get` and `has` functions. + +#### path + +Type: `string` + +Path of the property in the object, using `.` to separate each nested key. + +Use `\\.` if you have a `.` in the key. + +The following path components are invalid and results in `undefined` being returned: `__proto__`, `prototype`, `constructor`. + +#### value + +Type: `unknown` + +Value to set at `path`. + +#### defaultValue + +Type: `unknown` + +Default value. + + +--- + +
+ + 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/node_modules/core-util-is/float.patch b/node_modules/core-util-is/float.patch deleted file mode 100644 index a06d5c0..0000000 --- a/node_modules/core-util-is/float.patch +++ /dev/null @@ -1,604 +0,0 @@ -diff --git a/lib/util.js b/lib/util.js -index a03e874..9074e8e 100644 ---- a/lib/util.js -+++ b/lib/util.js -@@ -19,430 +19,6 @@ - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - --var formatRegExp = /%[sdj%]/g; --exports.format = function(f) { -- if (!isString(f)) { -- var objects = []; -- for (var i = 0; i < arguments.length; i++) { -- objects.push(inspect(arguments[i])); -- } -- return objects.join(' '); -- } -- -- var i = 1; -- var args = arguments; -- var len = args.length; -- var str = String(f).replace(formatRegExp, function(x) { -- if (x === '%%') return '%'; -- if (i >= len) return x; -- switch (x) { -- case '%s': return String(args[i++]); -- case '%d': return Number(args[i++]); -- case '%j': -- try { -- return JSON.stringify(args[i++]); -- } catch (_) { -- return '[Circular]'; -- } -- default: -- return x; -- } -- }); -- for (var x = args[i]; i < len; x = args[++i]) { -- if (isNull(x) || !isObject(x)) { -- str += ' ' + x; -- } else { -- str += ' ' + inspect(x); -- } -- } -- return str; --}; -- -- --// Mark that a method should not be used. --// Returns a modified function which warns once by default. --// If --no-deprecation is set, then it is a no-op. --exports.deprecate = function(fn, msg) { -- // Allow for deprecating things in the process of starting up. -- if (isUndefined(global.process)) { -- return function() { -- return exports.deprecate(fn, msg).apply(this, arguments); -- }; -- } -- -- if (process.noDeprecation === true) { -- return fn; -- } -- -- var warned = false; -- function deprecated() { -- if (!warned) { -- if (process.throwDeprecation) { -- throw new Error(msg); -- } else if (process.traceDeprecation) { -- console.trace(msg); -- } else { -- console.error(msg); -- } -- warned = true; -- } -- return fn.apply(this, arguments); -- } -- -- return deprecated; --}; -- -- --var debugs = {}; --var debugEnviron; --exports.debuglog = function(set) { -- if (isUndefined(debugEnviron)) -- debugEnviron = process.env.NODE_DEBUG || ''; -- set = set.toUpperCase(); -- if (!debugs[set]) { -- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { -- var pid = process.pid; -- debugs[set] = function() { -- var msg = exports.format.apply(exports, arguments); -- console.error('%s %d: %s', set, pid, msg); -- }; -- } else { -- debugs[set] = function() {}; -- } -- } -- return debugs[set]; --}; -- -- --/** -- * Echos the value of a value. Trys to print the value out -- * in the best way possible given the different types. -- * -- * @param {Object} obj The object to print out. -- * @param {Object} opts Optional options object that alters the output. -- */ --/* legacy: obj, showHidden, depth, colors*/ --function inspect(obj, opts) { -- // default options -- var ctx = { -- seen: [], -- stylize: stylizeNoColor -- }; -- // legacy... -- if (arguments.length >= 3) ctx.depth = arguments[2]; -- if (arguments.length >= 4) ctx.colors = arguments[3]; -- if (isBoolean(opts)) { -- // legacy... -- ctx.showHidden = opts; -- } else if (opts) { -- // got an "options" object -- exports._extend(ctx, opts); -- } -- // set default options -- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; -- if (isUndefined(ctx.depth)) ctx.depth = 2; -- if (isUndefined(ctx.colors)) ctx.colors = false; -- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; -- if (ctx.colors) ctx.stylize = stylizeWithColor; -- return formatValue(ctx, obj, ctx.depth); --} --exports.inspect = inspect; -- -- --// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics --inspect.colors = { -- 'bold' : [1, 22], -- 'italic' : [3, 23], -- 'underline' : [4, 24], -- 'inverse' : [7, 27], -- 'white' : [37, 39], -- 'grey' : [90, 39], -- 'black' : [30, 39], -- 'blue' : [34, 39], -- 'cyan' : [36, 39], -- 'green' : [32, 39], -- 'magenta' : [35, 39], -- 'red' : [31, 39], -- 'yellow' : [33, 39] --}; -- --// Don't use 'blue' not visible on cmd.exe --inspect.styles = { -- 'special': 'cyan', -- 'number': 'yellow', -- 'boolean': 'yellow', -- 'undefined': 'grey', -- 'null': 'bold', -- 'string': 'green', -- 'date': 'magenta', -- // "name": intentionally not styling -- 'regexp': 'red' --}; -- -- --function stylizeWithColor(str, styleType) { -- var style = inspect.styles[styleType]; -- -- if (style) { -- return '\u001b[' + inspect.colors[style][0] + 'm' + str + -- '\u001b[' + inspect.colors[style][1] + 'm'; -- } else { -- return str; -- } --} -- -- --function stylizeNoColor(str, styleType) { -- return str; --} -- -- --function arrayToHash(array) { -- var hash = {}; -- -- array.forEach(function(val, idx) { -- hash[val] = true; -- }); -- -- return hash; --} -- -- --function formatValue(ctx, value, recurseTimes) { -- // Provide a hook for user-specified inspect functions. -- // Check that value is an object with an inspect function on it -- if (ctx.customInspect && -- value && -- isFunction(value.inspect) && -- // Filter out the util module, it's inspect function is special -- value.inspect !== exports.inspect && -- // Also filter out any prototype objects using the circular check. -- !(value.constructor && value.constructor.prototype === value)) { -- var ret = value.inspect(recurseTimes, ctx); -- if (!isString(ret)) { -- ret = formatValue(ctx, ret, recurseTimes); -- } -- return ret; -- } -- -- // Primitive types cannot have properties -- var primitive = formatPrimitive(ctx, value); -- if (primitive) { -- return primitive; -- } -- -- // Look up the keys of the object. -- var keys = Object.keys(value); -- var visibleKeys = arrayToHash(keys); -- -- if (ctx.showHidden) { -- keys = Object.getOwnPropertyNames(value); -- } -- -- // Some type of object without properties can be shortcutted. -- if (keys.length === 0) { -- if (isFunction(value)) { -- var name = value.name ? ': ' + value.name : ''; -- return ctx.stylize('[Function' + name + ']', 'special'); -- } -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } -- if (isDate(value)) { -- return ctx.stylize(Date.prototype.toString.call(value), 'date'); -- } -- if (isError(value)) { -- return formatError(value); -- } -- } -- -- var base = '', array = false, braces = ['{', '}']; -- -- // Make Array say that they are Array -- if (isArray(value)) { -- array = true; -- braces = ['[', ']']; -- } -- -- // Make functions say that they are functions -- if (isFunction(value)) { -- var n = value.name ? ': ' + value.name : ''; -- base = ' [Function' + n + ']'; -- } -- -- // Make RegExps say that they are RegExps -- if (isRegExp(value)) { -- base = ' ' + RegExp.prototype.toString.call(value); -- } -- -- // Make dates with properties first say the date -- if (isDate(value)) { -- base = ' ' + Date.prototype.toUTCString.call(value); -- } -- -- // Make error with message first say the error -- if (isError(value)) { -- base = ' ' + formatError(value); -- } -- -- if (keys.length === 0 && (!array || value.length == 0)) { -- return braces[0] + base + braces[1]; -- } -- -- if (recurseTimes < 0) { -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } else { -- return ctx.stylize('[Object]', 'special'); -- } -- } -- -- ctx.seen.push(value); -- -- var output; -- if (array) { -- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); -- } else { -- output = keys.map(function(key) { -- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); -- }); -- } -- -- ctx.seen.pop(); -- -- return reduceToSingleString(output, base, braces); --} -- -- --function formatPrimitive(ctx, value) { -- if (isUndefined(value)) -- return ctx.stylize('undefined', 'undefined'); -- if (isString(value)) { -- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') -- .replace(/'/g, "\\'") -- .replace(/\\"/g, '"') + '\''; -- return ctx.stylize(simple, 'string'); -- } -- if (isNumber(value)) { -- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, -- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . -- if (value === 0 && 1 / value < 0) -- return ctx.stylize('-0', 'number'); -- return ctx.stylize('' + value, 'number'); -- } -- if (isBoolean(value)) -- return ctx.stylize('' + value, 'boolean'); -- // For some reason typeof null is "object", so special case here. -- if (isNull(value)) -- return ctx.stylize('null', 'null'); --} -- -- --function formatError(value) { -- return '[' + Error.prototype.toString.call(value) + ']'; --} -- -- --function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { -- var output = []; -- for (var i = 0, l = value.length; i < l; ++i) { -- if (hasOwnProperty(value, String(i))) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- String(i), true)); -- } else { -- output.push(''); -- } -- } -- keys.forEach(function(key) { -- if (!key.match(/^\d+$/)) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- key, true)); -- } -- }); -- return output; --} -- -- --function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { -- var name, str, desc; -- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; -- if (desc.get) { -- if (desc.set) { -- str = ctx.stylize('[Getter/Setter]', 'special'); -- } else { -- str = ctx.stylize('[Getter]', 'special'); -- } -- } else { -- if (desc.set) { -- str = ctx.stylize('[Setter]', 'special'); -- } -- } -- if (!hasOwnProperty(visibleKeys, key)) { -- name = '[' + key + ']'; -- } -- if (!str) { -- if (ctx.seen.indexOf(desc.value) < 0) { -- if (isNull(recurseTimes)) { -- str = formatValue(ctx, desc.value, null); -- } else { -- str = formatValue(ctx, desc.value, recurseTimes - 1); -- } -- if (str.indexOf('\n') > -1) { -- if (array) { -- str = str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n').substr(2); -- } else { -- str = '\n' + str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n'); -- } -- } -- } else { -- str = ctx.stylize('[Circular]', 'special'); -- } -- } -- if (isUndefined(name)) { -- if (array && key.match(/^\d+$/)) { -- return str; -- } -- name = JSON.stringify('' + key); -- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { -- name = name.substr(1, name.length - 2); -- name = ctx.stylize(name, 'name'); -- } else { -- name = name.replace(/'/g, "\\'") -- .replace(/\\"/g, '"') -- .replace(/(^"|"$)/g, "'"); -- name = ctx.stylize(name, 'string'); -- } -- } -- -- return name + ': ' + str; --} -- -- --function reduceToSingleString(output, base, braces) { -- var numLinesEst = 0; -- var length = output.reduce(function(prev, cur) { -- numLinesEst++; -- if (cur.indexOf('\n') >= 0) numLinesEst++; -- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; -- }, 0); -- -- if (length > 60) { -- return braces[0] + -- (base === '' ? '' : base + '\n ') + -- ' ' + -- output.join(',\n ') + -- ' ' + -- braces[1]; -- } -- -- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; --} -- -- - // NOTE: These type checking functions intentionally don't use `instanceof` - // because it is fragile and can be easily faked with `Object.create()`. - function isArray(ar) { -@@ -522,166 +98,10 @@ function isPrimitive(arg) { - exports.isPrimitive = isPrimitive; - - function isBuffer(arg) { -- return arg instanceof Buffer; -+ return Buffer.isBuffer(arg); - } - exports.isBuffer = isBuffer; - - function objectToString(o) { - return Object.prototype.toString.call(o); --} -- -- --function pad(n) { -- return n < 10 ? '0' + n.toString(10) : n.toString(10); --} -- -- --var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', -- 'Oct', 'Nov', 'Dec']; -- --// 26 Feb 16:19:34 --function timestamp() { -- var d = new Date(); -- var time = [pad(d.getHours()), -- pad(d.getMinutes()), -- pad(d.getSeconds())].join(':'); -- return [d.getDate(), months[d.getMonth()], time].join(' '); --} -- -- --// log is just a thin wrapper to console.log that prepends a timestamp --exports.log = function() { -- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); --}; -- -- --/** -- * Inherit the prototype methods from one constructor into another. -- * -- * The Function.prototype.inherits from lang.js rewritten as a standalone -- * function (not on Function.prototype). NOTE: If this file is to be loaded -- * during bootstrapping this function needs to be rewritten using some native -- * functions as prototype setup using normal JavaScript does not work as -- * expected during bootstrapping (see mirror.js in r114903). -- * -- * @param {function} ctor Constructor function which needs to inherit the -- * prototype. -- * @param {function} superCtor Constructor function to inherit prototype from. -- */ --exports.inherits = function(ctor, superCtor) { -- ctor.super_ = superCtor; -- ctor.prototype = Object.create(superCtor.prototype, { -- constructor: { -- value: ctor, -- enumerable: false, -- writable: true, -- configurable: true -- } -- }); --}; -- --exports._extend = function(origin, add) { -- // Don't do anything if add isn't an object -- if (!add || !isObject(add)) return origin; -- -- var keys = Object.keys(add); -- var i = keys.length; -- while (i--) { -- origin[keys[i]] = add[keys[i]]; -- } -- return origin; --}; -- --function hasOwnProperty(obj, prop) { -- return Object.prototype.hasOwnProperty.call(obj, prop); --} -- -- --// Deprecated old stuff. -- --exports.p = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- console.error(exports.inspect(arguments[i])); -- } --}, 'util.p: Use console.error() instead'); -- -- --exports.exec = exports.deprecate(function() { -- return require('child_process').exec.apply(this, arguments); --}, 'util.exec is now called `child_process.exec`.'); -- -- --exports.print = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(String(arguments[i])); -- } --}, 'util.print: Use console.log instead'); -- -- --exports.puts = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(arguments[i] + '\n'); -- } --}, 'util.puts: Use console.log instead'); -- -- --exports.debug = exports.deprecate(function(x) { -- process.stderr.write('DEBUG: ' + x + '\n'); --}, 'util.debug: Use console.error instead'); -- -- --exports.error = exports.deprecate(function(x) { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stderr.write(arguments[i] + '\n'); -- } --}, 'util.error: Use console.error instead'); -- -- --exports.pump = exports.deprecate(function(readStream, writeStream, callback) { -- var callbackCalled = false; -- -- function call(a, b, c) { -- if (callback && !callbackCalled) { -- callback(a, b, c); -- callbackCalled = true; -- } -- } -- -- readStream.addListener('data', function(chunk) { -- if (writeStream.write(chunk) === false) readStream.pause(); -- }); -- -- writeStream.addListener('drain', function() { -- readStream.resume(); -- }); -- -- readStream.addListener('end', function() { -- writeStream.end(); -- }); -- -- readStream.addListener('close', function() { -- call(); -- }); -- -- readStream.addListener('error', function(err) { -- writeStream.end(); -- call(err); -- }); -- -- writeStream.addListener('error', function(err) { -- readStream.destroy(); -- call(err); -- }); --}, 'util.pump(): Use readableStream.pipe() instead'); -- -- --var uv; --exports._errnoException = function(err, syscall) { -- if (isUndefined(uv)) uv = process.binding('uv'); -- var errname = uv.errname(err); -- var e = new Error(syscall + ' ' + errname); -- e.code = errname; -- e.errno = errname; -- e.syscall = syscall; -- return e; --}; -+} \ No newline at end of file diff --git a/node_modules/core-util-is/lib/util.js b/node_modules/core-util-is/lib/util.js index ff4c851..6e5a20d 100644 --- a/node_modules/core-util-is/lib/util.js +++ b/node_modules/core-util-is/lib/util.js @@ -100,7 +100,7 @@ function isPrimitive(arg) { } exports.isPrimitive = isPrimitive; -exports.isBuffer = Buffer.isBuffer; +exports.isBuffer = require('buffer').Buffer.isBuffer; function objectToString(o) { return Object.prototype.toString.call(o); diff --git a/node_modules/core-util-is/package.json b/node_modules/core-util-is/package.json index 745c4b5..b0c51f5 100644 --- a/node_modules/core-util-is/package.json +++ b/node_modules/core-util-is/package.json @@ -1,43 +1,15 @@ { - "_from": "core-util-is@~1.0.0", - "_id": "core-util-is@1.0.2", - "_inBundle": false, - "_integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "_location": "/core-util-is", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "core-util-is@~1.0.0", - "name": "core-util-is", - "escapedName": "core-util-is", - "rawSpec": "~1.0.0", - "saveSpec": null, - "fetchSpec": "~1.0.0" - }, - "_requiredBy": [ - "/readable-stream", - "/verror" - ], - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", - "_spec": "core-util-is@~1.0.0", - "_where": "D:\\Users\\henri\\Desktop\\TestHabana\\node_modules\\readable-stream", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/core-util-is/issues" - }, - "bundleDependencies": false, - "deprecated": false, + "name": "core-util-is", + "version": "1.0.3", "description": "The `util.is*` functions introduced in Node v0.12.", - "devDependencies": { - "tap": "^2.3.0" + "main": "lib/util.js", + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is" }, - "homepage": "https://github.com/isaacs/core-util-is#readme", "keywords": [ "util", "isBuffer", @@ -49,15 +21,18 @@ "isThat", "polyfill" ], + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", "license": "MIT", - "main": "lib/util.js", - "name": "core-util-is", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/core-util-is.git" + "bugs": { + "url": "https://github.com/isaacs/core-util-is/issues" }, "scripts": { - "test": "tap test.js" + "test": "tap test.js", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" }, - "version": "1.0.2" + "devDependencies": { + "tap": "^15.0.9" + } } diff --git a/node_modules/core-util-is/test.js b/node_modules/core-util-is/test.js deleted file mode 100644 index 1a490c6..0000000 --- a/node_modules/core-util-is/test.js +++ /dev/null @@ -1,68 +0,0 @@ -var assert = require('tap'); - -var t = require('./lib/util'); - -assert.equal(t.isArray([]), true); -assert.equal(t.isArray({}), false); - -assert.equal(t.isBoolean(null), false); -assert.equal(t.isBoolean(true), true); -assert.equal(t.isBoolean(false), true); - -assert.equal(t.isNull(null), true); -assert.equal(t.isNull(undefined), false); -assert.equal(t.isNull(false), false); -assert.equal(t.isNull(), false); - -assert.equal(t.isNullOrUndefined(null), true); -assert.equal(t.isNullOrUndefined(undefined), true); -assert.equal(t.isNullOrUndefined(false), false); -assert.equal(t.isNullOrUndefined(), true); - -assert.equal(t.isNumber(null), false); -assert.equal(t.isNumber('1'), false); -assert.equal(t.isNumber(1), true); - -assert.equal(t.isString(null), false); -assert.equal(t.isString('1'), true); -assert.equal(t.isString(1), false); - -assert.equal(t.isSymbol(null), false); -assert.equal(t.isSymbol('1'), false); -assert.equal(t.isSymbol(1), false); -assert.equal(t.isSymbol(Symbol()), true); - -assert.equal(t.isUndefined(null), false); -assert.equal(t.isUndefined(undefined), true); -assert.equal(t.isUndefined(false), false); -assert.equal(t.isUndefined(), true); - -assert.equal(t.isRegExp(null), false); -assert.equal(t.isRegExp('1'), false); -assert.equal(t.isRegExp(new RegExp()), true); - -assert.equal(t.isObject({}), true); -assert.equal(t.isObject([]), true); -assert.equal(t.isObject(new RegExp()), true); -assert.equal(t.isObject(new Date()), true); - -assert.equal(t.isDate(null), false); -assert.equal(t.isDate('1'), false); -assert.equal(t.isDate(new Date()), true); - -assert.equal(t.isError(null), false); -assert.equal(t.isError({ err: true }), false); -assert.equal(t.isError(new Error()), true); - -assert.equal(t.isFunction(null), false); -assert.equal(t.isFunction({ }), false); -assert.equal(t.isFunction(function() {}), true); - -assert.equal(t.isPrimitive(null), true); -assert.equal(t.isPrimitive(''), true); -assert.equal(t.isPrimitive(0), true); -assert.equal(t.isPrimitive(new Date()), false); - -assert.equal(t.isBuffer(null), false); -assert.equal(t.isBuffer({}), false); -assert.equal(t.isBuffer(new Buffer(0)), true); diff --git a/node_modules/abort-controller/LICENSE b/node_modules/discord-api-types/LICENSE old mode 100755 new mode 100644 similarity index 96% rename from node_modules/abort-controller/LICENSE rename to node_modules/discord-api-types/LICENSE index c914149..a8b1694 --- a/node_modules/abort-controller/LICENSE +++ b/node_modules/discord-api-types/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 Toru Nagashima +Copyright (c) 2020 vladfrangu Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/discord-api-types/README.md b/node_modules/discord-api-types/README.md new file mode 100644 index 0000000..e0ab3b3 --- /dev/null +++ b/node_modules/discord-api-types/README.md @@ -0,0 +1,97 @@ +# Discord API Types + +[![GitHub](https://img.shields.io/github/license/discordjs/discord-api-types)](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md) +[![npm](https://img.shields.io/npm/v/discord-api-types?color=crimson&logo=npm)](https://www.npmjs.com/package/discord-api-types) +[![deno](https://img.shields.io/npm/v/discord-api-types?color=blue&label=deno&logo=deno)](https://deno.land/x/discord_api_types) +[![Patreon Donate](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Donate%20with%20Patreon&logo=patreon&colorB=F96854&link=https://www.patreon.com/vladfrangu)](https://www.patreon.com/vladfrangu) +[![Ko-fi Donate](https://img.shields.io/badge/kofi-donate-brightgreen.svg?label=Donate%20with%20Ko-fi&logo=ko-fi&colorB=F16061&link=https://ko-fi.com/wolfgalvlad&logoColor=FFFFFF)](https://ko-fi.com/wolfgalvlad) +[![GitHub Sponsors](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Sponsor%20through%20GitHub&logo=github&colorB=F96854&link=https://github.com/sponsors/vladfrangu)](https://github.com/sponsors/vladfrangu) + +Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro). + +## Installation + +Install with [npm](https://www.npmjs.com/) / [yarn](https://yarnpkg.com) / [pnpm](https://pnpm.js.org/): + +```sh +npm install discord-api-types +yarn add discord-api-types +pnpm add discord-api-types +``` + +### Usage + +You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples + +```js +const { APIUser } = require('discord-api-types/v9'); +``` + +```ts +// TypeScript/ES Module support +import { APIUser } from 'discord-api-types/v9'; +``` + +You may also import just certain parts of the module that you need. The possible values are: `globals`, `gateway`, `gateway/v*`, `payloads`, `payloads/v*`, `rest`, `rest/v*`, `rpc`, `rpc/v*`, `utils`, `utils/v*`, `voice`, and `voice/v*`. Below are some examples + +```js +const { GatewayVersion } = require('discord-api-types/gateway/v9'); +``` + +```ts +// TypeScript/ES Module support +import { GatewayVersion } from 'discord-api-types/gateway/v9'; +``` + +> _**Note:** The `v*` exports (`discord-api-type/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_ + +### Deno + +We also provide typings compatible with the [deno](https://deno.land/) runtime. You have 3 ways you can import them: + +1. Directly from GitHub + +```ts +// Importing a specific API version +import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v9.ts'; +``` + +2. From [deno.land/x](https://deno.land/x) + +```ts +// Importing a specific API version +import { APIUser } from 'https://deno.land/x/discord_api_types/v9.ts'; +``` + +3. From [skypack.dev](https://www.skypack.dev/) + +```ts +// Importing a specific API version +import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v9?dts'; +``` + +## Project Structure + +The exports of each API version is split into three main parts: + +- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway. + +- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway. + +- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API. + + - For endpoint options, they will follow the following structure: `REST` where the type represents what it will return. + + - For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`. + + - Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `RESTOAuth2` + + - If a type ends with `Result`, then it represents the expected result by calling its accompanying route. + + - Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors. + +- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object). + +- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above. + +**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means _and have received the green light to be used_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will **NOT** be included. diff --git a/node_modules/discord-api-types/gateway/common.d.ts b/node_modules/discord-api-types/gateway/common.d.ts new file mode 100644 index 0000000..c77bc48 --- /dev/null +++ b/node_modules/discord-api-types/gateway/common.d.ts @@ -0,0 +1,9 @@ +/** + * https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params + */ +export interface GatewayURLQuery { + v: string; + encoding: 'json' | 'etf'; + compress?: 'zlib-stream'; +} +//# sourceMappingURL=common.d.ts.map \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/common.d.ts.map b/node_modules/discord-api-types/gateway/common.d.ts.map new file mode 100644 index 0000000..59c2f60 --- /dev/null +++ b/node_modules/discord-api-types/gateway/common.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["common.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,GAAG,KAAK,CAAC;IACzB,QAAQ,CAAC,EAAE,aAAa,CAAC;CACzB"} \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/common.js b/node_modules/discord-api-types/gateway/common.js new file mode 100644 index 0000000..b9529e7 --- /dev/null +++ b/node_modules/discord-api-types/gateway/common.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=common.js.map \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/common.js.map b/node_modules/discord-api-types/gateway/common.js.map new file mode 100644 index 0000000..d0f541d --- /dev/null +++ b/node_modules/discord-api-types/gateway/common.js.map @@ -0,0 +1 @@ +{"version":3,"file":"common.js","sourceRoot":"","sources":["common.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/index.d.ts b/node_modules/discord-api-types/gateway/index.d.ts new file mode 100644 index 0000000..f63d200 --- /dev/null +++ b/node_modules/discord-api-types/gateway/index.d.ts @@ -0,0 +1,2 @@ +export * from './v9'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/index.d.ts.map b/node_modules/discord-api-types/gateway/index.d.ts.map new file mode 100644 index 0000000..c1a119e --- /dev/null +++ b/node_modules/discord-api-types/gateway/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAGA,cAAc,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/index.js b/node_modules/discord-api-types/gateway/index.js new file mode 100644 index 0000000..92089f2 --- /dev/null +++ b/node_modules/discord-api-types/gateway/index.js @@ -0,0 +1,16 @@ +"use strict"; +// This file exports all the types available in the recommended gateway version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./v9"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/index.js.map b/node_modules/discord-api-types/gateway/index.js.map new file mode 100644 index 0000000..e8cb276 --- /dev/null +++ b/node_modules/discord-api-types/gateway/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,+EAA+E;AAC/E,2FAA2F;;;;;;;;;;;;AAE3F,uCAAqB"} \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/index.mjs b/node_modules/discord-api-types/gateway/index.mjs new file mode 100644 index 0000000..fd4ff25 --- /dev/null +++ b/node_modules/discord-api-types/gateway/index.mjs @@ -0,0 +1,8 @@ +import mod from "./index.js"; + +export default mod; +export const GatewayCloseCodes = mod.GatewayCloseCodes; +export const GatewayDispatchEvents = mod.GatewayDispatchEvents; +export const GatewayIntentBits = mod.GatewayIntentBits; +export const GatewayOpcodes = mod.GatewayOpcodes; +export const GatewayVersion = mod.GatewayVersion; diff --git a/node_modules/discord-api-types/gateway/v6.d.ts b/node_modules/discord-api-types/gateway/v6.d.ts new file mode 100644 index 0000000..949ceee --- /dev/null +++ b/node_modules/discord-api-types/gateway/v6.d.ts @@ -0,0 +1,608 @@ +/** + * Types extracted from https://discord.com/developers/docs/topics/gateway + */ +import type { APIChannel, APIEmoji, APIGuild, APIGuildMember, APIMessage, APIRole, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayVoiceState, InviteTargetUserType, PresenceUpdateStatus } from '../payloads/v6/index'; +export * from './common'; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare const GatewayVersion = "6"; +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare enum GatewayOPCodes { + Dispatch = 0, + Heartbeat = 1, + Identify = 2, + PresenceUpdate = 3, + VoiceStateUpdate = 4, + Resume = 6, + Reconnect = 7, + RequestGuildMembers = 8, + InvalidSession = 9, + Hello = 10, + HeartbeatAck = 11 +} +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare enum GatewayCloseCodes { + UnknownError = 4000, + UnknownOpCode = 4001, + DecodeError = 4002, + NotAuthenticated = 4003, + AuthenticationFailed = 4004, + AlreadyAuthenticated = 4005, + InvalidSeq = 4007, + RateLimited = 4008, + SessionTimedOut = 4009, + InvalidShard = 4010, + ShardingRequired = 4011, + InvalidAPIVersion = 4012, + InvalidIntents = 4013, + DisallowedIntents = 4014 +} +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare enum VoiceOPCodes { + Identify = 0, + SelectProtocol = 1, + Ready = 2, + Heartbeat = 3, + SessionDescription = 4, + Speaking = 5, + HeartbeatAck = 6, + Resume = 7, + Hello = 8, + Resumed = 9, + ClientDisconnect = 13 +} +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare enum VoiceCloseCodes { + UnknownOpCode = 4001, + NotAuthenticated = 4003, + AuthenticationFailed = 4004, + AlreadyAuthenticated = 4005, + SessionNoLongerValid = 4006, + SessionTimeout = 4009, + ServerNotFound = 4011, + UnknownProtocol = 4012, + Disconnected = 4014, + VoiceServerCrashed = 4015, + UnknownEncryptionMode = 4016 +} +/** + * https://discord.com/developers/docs/topics/gateway#list-of-intents + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare enum GatewayIntentBits { + GUILDS = 1, + GUILD_MEMBERS = 2, + GUILD_BANS = 4, + GUILD_EMOJIS = 8, + GUILD_INTEGRATIONS = 16, + GUILD_WEBHOOKS = 32, + GUILD_INVITES = 64, + GUILD_VOICE_STATES = 128, + GUILD_PRESENCES = 256, + GUILD_MESSAGES = 512, + GUILD_MESSAGE_REACTIONS = 1024, + GUILD_MESSAGE_TYPING = 2048, + DIRECT_MESSAGES = 4096, + DIRECT_MESSAGE_REACTIONS = 8192, + DIRECT_MESSAGE_TYPING = 16384 +} +/** + * https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare enum GatewayDispatchEvents { + Ready = "READY", + Resumed = "RESUMED", + ChannelCreate = "CHANNEL_CREATE", + ChannelUpdate = "CHANNEL_UPDATE", + ChannelDelete = "CHANNEL_DELETE", + ChannelPinsUpdate = "CHANNEL_PINS_UPDATE", + GuildCreate = "GUILD_CREATE", + GuildUpdate = "GUILD_UPDATE", + GuildDelete = "GUILD_DELETE", + GuildBanAdd = "GUILD_BAN_ADD", + GuildBanRemove = "GUILD_BAN_REMOVE", + GuildEmojisUpdate = "GUILD_EMOJIS_UPDATE", + GuildIntegrationsUpdate = "GUILD_INTEGRATIONS_UPDATE", + GuildMemberAdd = "GUILD_MEMBER_ADD", + GuildMemberRemove = "GUILD_MEMBER_REMOVE", + GuildMemberUpdate = "GUILD_MEMBER_UPDATE", + GuildMembersChunk = "GUILD_MEMBERS_CHUNK", + GuildRoleCreate = "GUILD_ROLE_CREATE", + GuildRoleUpdate = "GUILD_ROLE_UPDATE", + GuildRoleDelete = "GUILD_ROLE_DELETE", + InviteCreate = "INVITE_CREATE", + InviteDelete = "INVITE_DELETE", + MessageCreate = "MESSAGE_CREATE", + MessageUpdate = "MESSAGE_UPDATE", + MessageDelete = "MESSAGE_DELETE", + MessageDeleteBulk = "MESSAGE_DELETE_BULK", + MessageReactionAdd = "MESSAGE_REACTION_ADD", + MessageReactionRemove = "MESSAGE_REACTION_REMOVE", + MessageReactionRemoveAll = "MESSAGE_REACTION_REMOVE_ALL", + MessageReactionRemoveEmoji = "MESSAGE_REACTION_REMOVE_EMOJI", + PresenceUpdate = "PRESENCE_UPDATE", + TypingStart = "TYPING_START", + UserUpdate = "USER_UPDATE", + VoiceStateUpdate = "VOICE_STATE_UPDATE", + VoiceServerUpdate = "VOICE_SERVER_UPDATE", + WebhooksUpdate = "WEBHOOKS_UPDATE" +} +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayUpdatePresence | GatewayVoiceStateUpdate | GatewayResume | GatewayRequestGuildMembers; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayReceivePayload = GatewayHello | GatewayHeartbeatRequest | GatewayHeartbeatAck | GatewayInvalidSession | GatewayReconnect | GatewayDispatchPayload; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayDispatchPayload = GatewayReadyDispatch | GatewayResumedDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildDeleteDispatch | GatewayGuildBanModifyDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageUpdateDispatch | GatewayMessageDeleteDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayPresenceUpdateDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayWebhooksUpdateDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#hello + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export interface GatewayHello extends NonDispatchPayload { + op: GatewayOPCodes.Hello; + d: { + heartbeat_interval: number; + }; +} +/** + * https://discord.com/developers/docs/topics/gateway#heartbeating + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export interface GatewayHeartbeatRequest extends NonDispatchPayload { + op: GatewayOPCodes.Heartbeat; + d: never; +} +/** + * https://discord.com/developers/docs/topics/gateway#heartbeating-example-gateway-heartbeat-ack + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export interface GatewayHeartbeatAck extends NonDispatchPayload { + op: GatewayOPCodes.HeartbeatAck; + d: never; +} +/** + * https://discord.com/developers/docs/topics/gateway#invalid-session + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export interface GatewayInvalidSession extends NonDispatchPayload { + op: GatewayOPCodes.InvalidSession; + d: boolean; +} +/** + * https://discord.com/developers/docs/topics/gateway#reconnect + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export interface GatewayReconnect extends NonDispatchPayload { + op: GatewayOPCodes.Reconnect; + d: never; +} +/** + * https://discord.com/developers/docs/topics/gateway#ready + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayReadyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#resumed + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayResumedDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#channel-create + * https://discord.com/developers/docs/topics/gateway#channel-update + * https://discord.com/developers/docs/topics/gateway#channel-delete + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayChannelModifyDispatch = DataPayload; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#channel-pins-update + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayChannelPinsUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-create + * https://discord.com/developers/docs/topics/gateway#guild-update + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildModifyDispatch = DataPayload; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-delete + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-ban-add + * https://discord.com/developers/docs/topics/gateway#guild-ban-remove + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildBanModifyDispatch = DataPayload; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-emojis-update + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildEmojisUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-integrations-update + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildIntegrationsUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-add + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildMemberAddDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-remove + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildMemberRemoveDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-update + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildMemberUpdateDispatch = DataPayload & { + guild_id: string; +}>; +/** + * https://discord.com/developers/docs/topics/gateway#guild-members-chunk + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildMembersChunkDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-create + * https://discord.com/developers/docs/topics/gateway#guild-role-update + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildRoleModifyDispatch = DataPayload; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-delete + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayGuildRoleDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#invite-create + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayInviteCreateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#invite-delete + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayInviteDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-create + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayMessageCreateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-update + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayMessageUpdateDispatch = DataPayload>; +/** + * https://discord.com/developers/docs/topics/gateway#message-delete + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayMessageDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-delete-bulk + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayMessageDeleteBulkDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-add + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayMessageReactionAddDispatch = ReactionData; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayMessageReactionRemoveDispatch = ReactionData; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayMessageReactionRemoveAllDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayMessageReactionRemoveEmojiDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#presence-update + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayPresenceUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#typing-start + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayTypingStartDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#user-update + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayUserUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#voice-state-update + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayVoiceStateUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#voice-server-update + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayVoiceServerUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#webhooks-update + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export declare type GatewayWebhooksUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#heartbeating + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export interface GatewayHeartbeat { + op: GatewayOPCodes.Heartbeat; + d: number; +} +/** + * https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export interface GatewayIdentifyProperties { + $os: string; + $browser: string; + $device: string; +} +/** + * https://discord.com/developers/docs/topics/gateway#identify + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export interface GatewayIdentify { + op: GatewayOPCodes.Identify; + d: { + token: string; + properties: GatewayIdentifyProperties; + compress?: boolean; + large_threshold?: number; + shard?: [shard_id: number, shard_count: number]; + presence?: RawGatewayPresenceUpdate; + guild_subscriptions?: boolean; + intents?: number; + }; +} +/** + * https://discord.com/developers/docs/topics/gateway#resume + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export interface GatewayResume { + op: GatewayOPCodes.Resume; + d: { + token: string; + session_id: string; + seq: number; + }; +} +/** + * https://discord.com/developers/docs/topics/gateway#request-guild-members + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export interface GatewayRequestGuildMembers { + op: GatewayOPCodes.RequestGuildMembers; + d: { + guild_id: string | string[]; + query?: string; + limit: number; + presences?: boolean; + user_ids?: string | string[]; + nonce?: string; + }; +} +/** + * https://discord.com/developers/docs/topics/gateway#update-voice-state + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export interface GatewayVoiceStateUpdate { + op: GatewayOPCodes.VoiceStateUpdate; + d: { + guild_id: string; + channel_id: string | null; + self_mute: boolean; + self_deaf: boolean; + }; +} +/** + * https://discord.com/developers/docs/topics/gateway#update-status + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export interface GatewayUpdatePresence { + op: GatewayOPCodes.PresenceUpdate; + d: GatewayPresenceUpdateData; +} +/** + * https://discord.com/developers/docs/topics/gateway#update-status-gateway-status-update-structure + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +export interface GatewayPresenceUpdateData { + since: number | null; + game: GatewayActivity | null; + status: PresenceUpdateStatus; + afk: boolean; +} +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +interface BasePayload { + op: GatewayOPCodes; + s: number; + d?: unknown; + t?: string; +} +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +declare type NonDispatchPayload = Omit; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +interface DataPayload extends BasePayload { + op: GatewayOPCodes.Dispatch; + t: Event; + d: D; +} +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +declare type ReactionData = DataPayload>; +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +interface MessageReactionRemoveData { + channel_id: string; + message_id: string; + guild_id?: string; +} +//# sourceMappingURL=v6.d.ts.map \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/v6.d.ts.map b/node_modules/discord-api-types/gateway/v6.d.ts.map new file mode 100644 index 0000000..30bcd47 --- /dev/null +++ b/node_modules/discord-api-types/gateway/v6.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"v6.d.ts","sourceRoot":"","sources":["v6.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACX,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,cAAc,EACd,UAAU,EACV,OAAO,EACP,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,qBAAqB,IAAI,wBAAwB,EACjD,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACpB,MAAM,sBAAsB,CAAC;AAE9B,cAAc,UAAU,CAAC;AAEzB;;GAEG;AACH,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;;GAGG;AACH,oBAAY,cAAc;IACzB,QAAQ,IAAA;IACR,SAAS,IAAA;IACT,QAAQ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rB,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;IAC7B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,GAAG,EAAE,OAAO,CAAC;CACb;AAKD;;GAEG;AACH,UAAU,WAAW;IACpB,EAAE,EAAE,cAAc,CAAC;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,OAAO,CAAC;IACZ,CAAC,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,aAAK,kBAAkB,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AAEjD;;GAEG;AACH,UAAU,WAAW,CAAC,KAAK,SAAS,qBAAqB,EAAE,CAAC,GAAG,OAAO,CAAE,SAAQ,WAAW;IAC1F,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC;IAC5B,CAAC,EAAE,KAAK,CAAC;IACT,CAAC,EAAE,CAAC,CAAC;CACL;AAED;;GAEG;AACH,aAAK,YAAY,CAAC,CAAC,SAAS,qBAAqB,EAAE,CAAC,SAAS,MAAM,GAAG,KAAK,IAAI,WAAW,CACzF,CAAC,EACD,IAAI,CACH;IACC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,QAAQ,CAAC;CAChB,EACD,CAAC,CACD,CACD,CAAC;AAEF;;GAEG;AACH,UAAU,yBAAyB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB"} \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/v6.js b/node_modules/discord-api-types/gateway/v6.js new file mode 100644 index 0000000..7e6face --- /dev/null +++ b/node_modules/discord-api-types/gateway/v6.js @@ -0,0 +1,163 @@ +"use strict"; +/** + * Types extracted from https://discord.com/developers/docs/topics/gateway + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.VoiceCloseCodes = exports.VoiceOPCodes = exports.GatewayCloseCodes = exports.GatewayOPCodes = exports.GatewayVersion = void 0; +__exportStar(require("./common"), exports); +/** + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +exports.GatewayVersion = '6'; +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +var GatewayOPCodes; +(function (GatewayOPCodes) { + GatewayOPCodes[GatewayOPCodes["Dispatch"] = 0] = "Dispatch"; + GatewayOPCodes[GatewayOPCodes["Heartbeat"] = 1] = "Heartbeat"; + GatewayOPCodes[GatewayOPCodes["Identify"] = 2] = "Identify"; + GatewayOPCodes[GatewayOPCodes["PresenceUpdate"] = 3] = "PresenceUpdate"; + GatewayOPCodes[GatewayOPCodes["VoiceStateUpdate"] = 4] = "VoiceStateUpdate"; + GatewayOPCodes[GatewayOPCodes["Resume"] = 6] = "Resume"; + GatewayOPCodes[GatewayOPCodes["Reconnect"] = 7] = "Reconnect"; + GatewayOPCodes[GatewayOPCodes["RequestGuildMembers"] = 8] = "RequestGuildMembers"; + GatewayOPCodes[GatewayOPCodes["InvalidSession"] = 9] = "InvalidSession"; + GatewayOPCodes[GatewayOPCodes["Hello"] = 10] = "Hello"; + GatewayOPCodes[GatewayOPCodes["HeartbeatAck"] = 11] = "HeartbeatAck"; +})(GatewayOPCodes = exports.GatewayOPCodes || (exports.GatewayOPCodes = {})); +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +var GatewayCloseCodes; +(function (GatewayCloseCodes) { + GatewayCloseCodes[GatewayCloseCodes["UnknownError"] = 4000] = "UnknownError"; + GatewayCloseCodes[GatewayCloseCodes["UnknownOpCode"] = 4001] = "UnknownOpCode"; + GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError"; + GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated"; + GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed"; + GatewayCloseCodes[GatewayCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated"; + GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq"; + GatewayCloseCodes[GatewayCloseCodes["RateLimited"] = 4008] = "RateLimited"; + GatewayCloseCodes[GatewayCloseCodes["SessionTimedOut"] = 4009] = "SessionTimedOut"; + GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard"; + GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired"; + GatewayCloseCodes[GatewayCloseCodes["InvalidAPIVersion"] = 4012] = "InvalidAPIVersion"; + GatewayCloseCodes[GatewayCloseCodes["InvalidIntents"] = 4013] = "InvalidIntents"; + GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents"; +})(GatewayCloseCodes = exports.GatewayCloseCodes || (exports.GatewayCloseCodes = {})); +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +var VoiceOPCodes; +(function (VoiceOPCodes) { + VoiceOPCodes[VoiceOPCodes["Identify"] = 0] = "Identify"; + VoiceOPCodes[VoiceOPCodes["SelectProtocol"] = 1] = "SelectProtocol"; + VoiceOPCodes[VoiceOPCodes["Ready"] = 2] = "Ready"; + VoiceOPCodes[VoiceOPCodes["Heartbeat"] = 3] = "Heartbeat"; + VoiceOPCodes[VoiceOPCodes["SessionDescription"] = 4] = "SessionDescription"; + VoiceOPCodes[VoiceOPCodes["Speaking"] = 5] = "Speaking"; + VoiceOPCodes[VoiceOPCodes["HeartbeatAck"] = 6] = "HeartbeatAck"; + VoiceOPCodes[VoiceOPCodes["Resume"] = 7] = "Resume"; + VoiceOPCodes[VoiceOPCodes["Hello"] = 8] = "Hello"; + VoiceOPCodes[VoiceOPCodes["Resumed"] = 9] = "Resumed"; + VoiceOPCodes[VoiceOPCodes["ClientDisconnect"] = 13] = "ClientDisconnect"; +})(VoiceOPCodes = exports.VoiceOPCodes || (exports.VoiceOPCodes = {})); +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +var VoiceCloseCodes; +(function (VoiceCloseCodes) { + VoiceCloseCodes[VoiceCloseCodes["UnknownOpCode"] = 4001] = "UnknownOpCode"; + VoiceCloseCodes[VoiceCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated"; + VoiceCloseCodes[VoiceCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed"; + VoiceCloseCodes[VoiceCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated"; + VoiceCloseCodes[VoiceCloseCodes["SessionNoLongerValid"] = 4006] = "SessionNoLongerValid"; + VoiceCloseCodes[VoiceCloseCodes["SessionTimeout"] = 4009] = "SessionTimeout"; + VoiceCloseCodes[VoiceCloseCodes["ServerNotFound"] = 4011] = "ServerNotFound"; + VoiceCloseCodes[VoiceCloseCodes["UnknownProtocol"] = 4012] = "UnknownProtocol"; + VoiceCloseCodes[VoiceCloseCodes["Disconnected"] = 4014] = "Disconnected"; + VoiceCloseCodes[VoiceCloseCodes["VoiceServerCrashed"] = 4015] = "VoiceServerCrashed"; + VoiceCloseCodes[VoiceCloseCodes["UnknownEncryptionMode"] = 4016] = "UnknownEncryptionMode"; +})(VoiceCloseCodes = exports.VoiceCloseCodes || (exports.VoiceCloseCodes = {})); +/** + * https://discord.com/developers/docs/topics/gateway#list-of-intents + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +var GatewayIntentBits; +(function (GatewayIntentBits) { + GatewayIntentBits[GatewayIntentBits["GUILDS"] = 1] = "GUILDS"; + GatewayIntentBits[GatewayIntentBits["GUILD_MEMBERS"] = 2] = "GUILD_MEMBERS"; + GatewayIntentBits[GatewayIntentBits["GUILD_BANS"] = 4] = "GUILD_BANS"; + GatewayIntentBits[GatewayIntentBits["GUILD_EMOJIS"] = 8] = "GUILD_EMOJIS"; + GatewayIntentBits[GatewayIntentBits["GUILD_INTEGRATIONS"] = 16] = "GUILD_INTEGRATIONS"; + GatewayIntentBits[GatewayIntentBits["GUILD_WEBHOOKS"] = 32] = "GUILD_WEBHOOKS"; + GatewayIntentBits[GatewayIntentBits["GUILD_INVITES"] = 64] = "GUILD_INVITES"; + GatewayIntentBits[GatewayIntentBits["GUILD_VOICE_STATES"] = 128] = "GUILD_VOICE_STATES"; + GatewayIntentBits[GatewayIntentBits["GUILD_PRESENCES"] = 256] = "GUILD_PRESENCES"; + GatewayIntentBits[GatewayIntentBits["GUILD_MESSAGES"] = 512] = "GUILD_MESSAGES"; + GatewayIntentBits[GatewayIntentBits["GUILD_MESSAGE_REACTIONS"] = 1024] = "GUILD_MESSAGE_REACTIONS"; + GatewayIntentBits[GatewayIntentBits["GUILD_MESSAGE_TYPING"] = 2048] = "GUILD_MESSAGE_TYPING"; + GatewayIntentBits[GatewayIntentBits["DIRECT_MESSAGES"] = 4096] = "DIRECT_MESSAGES"; + GatewayIntentBits[GatewayIntentBits["DIRECT_MESSAGE_REACTIONS"] = 8192] = "DIRECT_MESSAGE_REACTIONS"; + GatewayIntentBits[GatewayIntentBits["DIRECT_MESSAGE_TYPING"] = 16384] = "DIRECT_MESSAGE_TYPING"; +})(GatewayIntentBits = exports.GatewayIntentBits || (exports.GatewayIntentBits = {})); +/** + * https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events + * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. + */ +var GatewayDispatchEvents; +(function (GatewayDispatchEvents) { + GatewayDispatchEvents["Ready"] = "READY"; + GatewayDispatchEvents["Resumed"] = "RESUMED"; + GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE"; + GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE"; + GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE"; + GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE"; + GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE"; + GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE"; + GatewayDispatchEvents["GuildDelete"] = "GUILD_DELETE"; + GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD"; + GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE"; + GatewayDispatchEvents["GuildEmojisUpdate"] = "GUILD_EMOJIS_UPDATE"; + GatewayDispatchEvents["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE"; + GatewayDispatchEvents["GuildMemberAdd"] = "GUILD_MEMBER_ADD"; + GatewayDispatchEvents["GuildMemberRemove"] = "GUILD_MEMBER_REMOVE"; + GatewayDispatchEvents["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE"; + GatewayDispatchEvents["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK"; + GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE"; + GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE"; + GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE"; + GatewayDispatchEvents["InviteCreate"] = "INVITE_CREATE"; + GatewayDispatchEvents["InviteDelete"] = "INVITE_DELETE"; + GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE"; + GatewayDispatchEvents["MessageUpdate"] = "MESSAGE_UPDATE"; + GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE"; + GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK"; + GatewayDispatchEvents["MessageReactionAdd"] = "MESSAGE_REACTION_ADD"; + GatewayDispatchEvents["MessageReactionRemove"] = "MESSAGE_REACTION_REMOVE"; + GatewayDispatchEvents["MessageReactionRemoveAll"] = "MESSAGE_REACTION_REMOVE_ALL"; + GatewayDispatchEvents["MessageReactionRemoveEmoji"] = "MESSAGE_REACTION_REMOVE_EMOJI"; + GatewayDispatchEvents["PresenceUpdate"] = "PRESENCE_UPDATE"; + GatewayDispatchEvents["TypingStart"] = "TYPING_START"; + GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE"; + GatewayDispatchEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE"; + GatewayDispatchEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE"; + GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE"; +})(GatewayDispatchEvents = exports.GatewayDispatchEvents || (exports.GatewayDispatchEvents = {})); +// #endregion Shared +//# sourceMappingURL=v6.js.map \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/v6.js.map b/node_modules/discord-api-types/gateway/v6.js.map new file mode 100644 index 0000000..c52f494 --- /dev/null +++ b/node_modules/discord-api-types/gateway/v6.js.map @@ -0,0 +1 @@ +{"version":3,"file":"v6.js","sourceRoot":"","sources":["v6.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;AAkBH,2CAAyB;AAEzB;;GAEG;AACU,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;;GAGG;AACH,IAAY,cAaX;AAbD,WAA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AA;IAC5B,mDAA0B,CAAA;IAC1B,gEAAuC,CAAA;IACvC,kEAAyC,CAAA;IACzC,2DAAkC,CAAA;AACnC,CAAC,EArCW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAqChC;AAwoBD,oBAAoB"} \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/v6.mjs b/node_modules/discord-api-types/gateway/v6.mjs new file mode 100644 index 0000000..848edfc --- /dev/null +++ b/node_modules/discord-api-types/gateway/v6.mjs @@ -0,0 +1,10 @@ +import mod from "./v6.js"; + +export default mod; +export const GatewayCloseCodes = mod.GatewayCloseCodes; +export const GatewayDispatchEvents = mod.GatewayDispatchEvents; +export const GatewayIntentBits = mod.GatewayIntentBits; +export const GatewayOPCodes = mod.GatewayOPCodes; +export const GatewayVersion = mod.GatewayVersion; +export const VoiceCloseCodes = mod.VoiceCloseCodes; +export const VoiceOPCodes = mod.VoiceOPCodes; diff --git a/node_modules/discord-api-types/gateway/v8.d.ts b/node_modules/discord-api-types/gateway/v8.d.ts new file mode 100644 index 0000000..79d3ee1 --- /dev/null +++ b/node_modules/discord-api-types/gateway/v8.d.ts @@ -0,0 +1,1302 @@ +/** + * Types extracted from https://discord.com/developers/docs/topics/gateway + */ +import type { Snowflake } from '../globals'; +import type { APIApplication, APIApplicationCommand, APIApplicationCommandInteraction, APIChannel, APIEmoji, APIGuild, APIGuildIntegration, APIGuildMember, APIMessage, APIMessageComponentInteraction, APIRole, APIStageInstance, APISticker, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayVoiceState, InviteTargetType, PresenceUpdateStatus } from '../payloads/v8/index'; +import type { Nullable } from '../utils/internals'; +export * from './common'; +export declare const GatewayVersion = "8"; +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes + */ +export declare const enum GatewayOpcodes { + /** + * An event was dispatched + */ + Dispatch = 0, + /** + * A bidirectional opcode to maintain an active gateway connection. + * Fired periodically by the client, or fired by the gateway to request an immediate heartbeat from the client. + */ + Heartbeat = 1, + /** + * Starts a new session during the initial handshake + */ + Identify = 2, + /** + * Update the client's presence + */ + PresenceUpdate = 3, + /** + * Used to join/leave or move between voice channels + */ + VoiceStateUpdate = 4, + /** + * Resume a previous session that was disconnected + */ + Resume = 6, + /** + * You should attempt to reconnect and resume immediately + */ + Reconnect = 7, + /** + * Request information about offline guild members in a large guild + */ + RequestGuildMembers = 8, + /** + * The session has been invalidated. You should reconnect and identify/resume accordingly + */ + InvalidSession = 9, + /** + * Sent immediately after connecting, contains the `heartbeat_interval` to use + */ + Hello = 10, + /** + * Sent in response to receiving a heartbeat to acknowledge that it has been received + */ + HeartbeatAck = 11 +} +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes + */ +export declare const enum GatewayCloseCodes { + /** + * We're not sure what went wrong. Try reconnecting? + */ + UnknownError = 4000, + /** + * You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that! + * + * See https://discord.com/developers/docs/topics/gateway#payloads-and-opcodes + */ + UnknownOpcode = 4001, + /** + * You sent an invalid payload to us. Don't do that! + * + * See https://discord.com/developers/docs/topics/gateway#sending-payloads + */ + DecodeError = 4002, + /** + * You sent us a payload prior to identifying + * + * See https://discord.com/developers/docs/topics/gateway#identify + */ + NotAuthenticated = 4003, + /** + * The account token sent with your identify payload is incorrect + * + * See https://discord.com/developers/docs/topics/gateway#identify + */ + AuthenticationFailed = 4004, + /** + * You sent more than one identify payload. Don't do that! + */ + AlreadyAuthenticated = 4005, + /** + * The sequence sent when resuming the session was invalid. Reconnect and start a new session + * + * See https://discord.com/developers/docs/topics/gateway#resume + */ + InvalidSeq = 4007, + /** + * Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this + */ + RateLimited = 4008, + /** + * Your session timed out. Reconnect and start a new one + */ + SessionTimedOut = 4009, + /** + * You sent us an invalid shard when identifying + * + * See https://discord.com/developers/docs/topics/gateway#sharding + */ + InvalidShard = 4010, + /** + * The session would have handled too many guilds - you are required to shard your connection in order to connect + * + * See https://discord.com/developers/docs/topics/gateway#sharding + */ + ShardingRequired = 4011, + /** + * You sent an invalid version for the gateway + */ + InvalidAPIVersion = 4012, + /** + * You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value + * + * See https://discord.com/developers/docs/topics/gateway#gateway-intents + */ + InvalidIntents = 4013, + /** + * You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not + * enabled or are not whitelisted for + * + * See https://discord.com/developers/docs/topics/gateway#gateway-intents + * + * See https://discord.com/developers/docs/topics/gateway#privileged-intents + */ + DisallowedIntents = 4014 +} +/** + * https://discord.com/developers/docs/topics/gateway#list-of-intents + */ +export declare const enum GatewayIntentBits { + Guilds = 1, + GuildMembers = 2, + GuildBans = 4, + GuildEmojisAndStickers = 8, + GuildIntegrations = 16, + GuildWebhooks = 32, + GuildInvites = 64, + GuildVoiceStates = 128, + GuildPresences = 256, + GuildMessages = 512, + GuildMessageReactions = 1024, + GuildMessageTyping = 2048, + DirectMessages = 4096, + DirectMessageReactions = 8192, + DirectMessageTyping = 16384 +} +/** + * https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events + */ +export declare const enum GatewayDispatchEvents { + ApplicationCommandCreate = "APPLICATION_COMMAND_CREATE", + ApplicationCommandDelete = "APPLICATION_COMMAND_DELETE", + ApplicationCommandUpdate = "APPLICATION_COMMAND_UPDATE", + ChannelCreate = "CHANNEL_CREATE", + ChannelDelete = "CHANNEL_DELETE", + ChannelPinsUpdate = "CHANNEL_PINS_UPDATE", + ChannelUpdate = "CHANNEL_UPDATE", + GuildBanAdd = "GUILD_BAN_ADD", + GuildBanRemove = "GUILD_BAN_REMOVE", + GuildCreate = "GUILD_CREATE", + GuildDelete = "GUILD_DELETE", + GuildEmojisUpdate = "GUILD_EMOJIS_UPDATE", + GuildIntegrationsUpdate = "GUILD_INTEGRATIONS_UPDATE", + GuildMemberAdd = "GUILD_MEMBER_ADD", + GuildMemberRemove = "GUILD_MEMBER_REMOVE", + GuildMembersChunk = "GUILD_MEMBERS_CHUNK", + GuildMemberUpdate = "GUILD_MEMBER_UPDATE", + GuildRoleCreate = "GUILD_ROLE_CREATE", + GuildRoleDelete = "GUILD_ROLE_DELETE", + GuildRoleUpdate = "GUILD_ROLE_UPDATE", + GuildStickersUpdate = "GUILD_STICKERS_UPDATE", + GuildUpdate = "GUILD_UPDATE", + IntegrationCreate = "INTEGRATION_CREATE", + IntegrationDelete = "INTEGRATION_DELETE", + IntegrationUpdate = "INTEGRATION_UPDATE", + InteractionCreate = "INTERACTION_CREATE", + InviteCreate = "INVITE_CREATE", + InviteDelete = "INVITE_DELETE", + MessageCreate = "MESSAGE_CREATE", + MessageDelete = "MESSAGE_DELETE", + MessageDeleteBulk = "MESSAGE_DELETE_BULK", + MessageReactionAdd = "MESSAGE_REACTION_ADD", + MessageReactionRemove = "MESSAGE_REACTION_REMOVE", + MessageReactionRemoveAll = "MESSAGE_REACTION_REMOVE_ALL", + MessageReactionRemoveEmoji = "MESSAGE_REACTION_REMOVE_EMOJI", + MessageUpdate = "MESSAGE_UPDATE", + PresenceUpdate = "PRESENCE_UPDATE", + StageInstanceCreate = "STAGE_INSTANCE_CREATE", + StageInstanceDelete = "STAGE_INSTANCE_DELETE", + StageInstanceUpdate = "STAGE_INSTANCE_UPDATE", + Ready = "READY", + Resumed = "RESUMED", + TypingStart = "TYPING_START", + UserUpdate = "USER_UPDATE", + VoiceServerUpdate = "VOICE_SERVER_UPDATE", + VoiceStateUpdate = "VOICE_STATE_UPDATE", + WebhooksUpdate = "WEBHOOKS_UPDATE" +} +export declare type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayUpdatePresence | GatewayVoiceStateUpdate | GatewayResume | GatewayRequestGuildMembers; +export declare type GatewayReceivePayload = GatewayHello | GatewayHeartbeatRequest | GatewayHeartbeatAck | GatewayInvalidSession | GatewayReconnect | GatewayDispatchPayload; +export declare type GatewayDispatchPayload = GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildStickersUpdateDispatch | GatewayIntegrationCreateDispatch | GatewayIntegrationDeleteDispatch | GatewayIntegrationUpdateDispatch | GatewayInteractionCreateDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageDeleteDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch | GatewayReadyDispatch | GatewayResumedDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-create + * https://discord.com/developers/docs/topics/gateway#application-command-update + * https://discord.com/developers/docs/topics/gateway#application-command-delete + */ +export declare type GatewayApplicationCommandModifyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-create + * https://discord.com/developers/docs/topics/gateway#application-command-update + * https://discord.com/developers/docs/topics/gateway#application-command-delete + */ +export declare type GatewayApplicationCommandModifyDispatchData = APIApplicationCommand; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-create + */ +export declare type GatewayApplicationCommandCreateDispatch = GatewayApplicationCommandModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-create + */ +export declare type GatewayApplicationCommandCreateDispatchData = GatewayApplicationCommandModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-update + */ +export declare type GatewayApplicationCommandUpdateDispatch = GatewayApplicationCommandModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-update + */ +export declare type GatewayApplicationCommandUpdateDispatchData = GatewayApplicationCommandModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-delete + */ +export declare type GatewayApplicationCommandDeleteDispatch = GatewayApplicationCommandModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-delete + */ +export declare type GatewayApplicationCommandDeleteDispatchData = GatewayApplicationCommandModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#hello + */ +export interface GatewayHello extends NonDispatchPayload { + op: GatewayOpcodes.Hello; + d: GatewayHelloData; +} +/** + * https://discord.com/developers/docs/topics/gateway#hello + */ +export interface GatewayHelloData { + /** + * The interval (in milliseconds) the client should heartbeat with + */ + heartbeat_interval: number; +} +/** + * https://discord.com/developers/docs/topics/gateway#heartbeating + */ +export interface GatewayHeartbeatRequest extends NonDispatchPayload { + op: GatewayOpcodes.Heartbeat; + d: never; +} +/** + * https://discord.com/developers/docs/topics/gateway#heartbeating-example-gateway-heartbeat-ack + */ +export interface GatewayHeartbeatAck extends NonDispatchPayload { + op: GatewayOpcodes.HeartbeatAck; + d: never; +} +/** + * https://discord.com/developers/docs/topics/gateway#invalid-session + */ +export interface GatewayInvalidSession extends NonDispatchPayload { + op: GatewayOpcodes.InvalidSession; + d: GatewayInvalidSessionData; +} +/** + * https://discord.com/developers/docs/topics/gateway#invalid-session + */ +export declare type GatewayInvalidSessionData = boolean; +/** + * https://discord.com/developers/docs/topics/gateway#reconnect + */ +export interface GatewayReconnect extends NonDispatchPayload { + op: GatewayOpcodes.Reconnect; + d: never; +} +/** + * https://discord.com/developers/docs/topics/gateway#ready + */ +export declare type GatewayReadyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#ready + */ +export interface GatewayReadyDispatchData { + /** + * Gateway version + * + * See https://discord.com/developers/docs/topics/gateway#gateways-gateway-versions + */ + v: number; + /** + * Information about the user including email + * + * See https://discord.com/developers/docs/resources/user#user-object + */ + user: APIUser; + /** + * The guilds the user is in + * + * See https://discord.com/developers/docs/resources/guild#unavailable-guild-object + */ + guilds: APIUnavailableGuild[]; + /** + * Used for resuming connections + */ + session_id: string; + /** + * The shard information associated with this session, if sent when identifying + * + * See https://discord.com/developers/docs/topics/gateway#sharding + */ + shard?: [shard_id: number, shard_count: number]; + /** + * Contains `id` and `flags` + * + * See https://discord.com/developers/docs/resources/application#application-object + */ + application: Pick; +} +/** + * https://discord.com/developers/docs/topics/gateway#resumed + */ +export declare type GatewayResumedDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#channel-create + * https://discord.com/developers/docs/topics/gateway#channel-update + * https://discord.com/developers/docs/topics/gateway#channel-delete + */ +export declare type GatewayChannelModifyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#channel-create + * https://discord.com/developers/docs/topics/gateway#channel-update + * https://discord.com/developers/docs/topics/gateway#channel-delete + */ +export declare type GatewayChannelModifyDispatchData = APIChannel; +/** + * https://discord.com/developers/docs/topics/gateway#channel-create + */ +export declare type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#channel-create + */ +export declare type GatewayChannelCreateDispatchData = GatewayChannelModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#channel-update + */ +export declare type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#channel-update + */ +export declare type GatewayChannelUpdateDispatchData = GatewayChannelModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#channel-delete + */ +export declare type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#channel-delete + */ +export declare type GatewayChannelDeleteDispatchData = GatewayChannelModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#channel-pins-update + */ +export declare type GatewayChannelPinsUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#channel-pins-update + */ +export interface GatewayChannelPinsUpdateDispatchData { + /** + * The id of the guild + */ + guild_id?: Snowflake; + /** + * The id of the channel + */ + channel_id: Snowflake; + /** + * The time at which the most recent pinned message was pinned + */ + last_pin_timestamp?: string | null; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-create + * https://discord.com/developers/docs/topics/gateway#guild-update + */ +export declare type GatewayGuildModifyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-create + * https://discord.com/developers/docs/topics/gateway#guild-update + */ +export declare type GatewayGuildModifyDispatchData = APIGuild; +/** + * https://discord.com/developers/docs/topics/gateway#guild-create + */ +export declare type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-create + */ +export declare type GatewayGuildCreateDispatchData = GatewayGuildModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#guild-update + */ +export declare type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-update + */ +export declare type GatewayGuildUpdateDispatchData = GatewayGuildModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#guild-delete + */ +export declare type GatewayGuildDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-delete + */ +export declare type GatewayGuildDeleteDispatchData = APIUnavailableGuild; +/** + * https://discord.com/developers/docs/topics/gateway#guild-ban-add + * https://discord.com/developers/docs/topics/gateway#guild-ban-remove + */ +export declare type GatewayGuildBanModifyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-ban-add + * https://discord.com/developers/docs/topics/gateway#guild-ban-remove + */ +export interface GatewayGuildBanModifyDispatchData { + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * The banned user + * + * See https://discord.com/developers/docs/resources/user#user-object + */ + user: APIUser; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-ban-add + */ +export declare type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-ban-add + */ +export declare type GatewayGuildBanAddDispatchData = GatewayGuildBanModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#guild-ban-remove + */ +export declare type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-ban-remove + */ +export declare type GatewayGuildBanRemoveDispatchData = GatewayGuildBanModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#guild-emojis-update + */ +export declare type GatewayGuildEmojisUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-emojis-update + */ +export interface GatewayGuildEmojisUpdateDispatchData { + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * Array of emojis + * + * See https://discord.com/developers/docs/resources/emoji#emoji-object + */ + emojis: APIEmoji[]; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-stickers-update + */ +export declare type GatewayGuildStickersUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-stickers-update + */ +export interface GatewayGuildStickersUpdateDispatchData { + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * Array of stickers + * + * See https://discord.com/developers/docs/resources/sticker#sticker-object + */ + stickers: APISticker[]; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-integrations-update + */ +export declare type GatewayGuildIntegrationsUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-integrations-update + */ +export interface GatewayGuildIntegrationsUpdateDispatchData { + /** + * ID of the guild whose integrations were updated + */ + guild_id: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-add + */ +export declare type GatewayGuildMemberAddDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-add + */ +export interface GatewayGuildMemberAddDispatchData extends APIGuildMember { + /** + * The id of the guild + */ + guild_id: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-remove + */ +export declare type GatewayGuildMemberRemoveDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-remove + */ +export interface GatewayGuildMemberRemoveDispatchData { + /** + * The id of the guild + */ + guild_id: Snowflake; + /** + * The user who was removed + * + * See https://discord.com/developers/docs/resources/user#user-object + */ + user: APIUser; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-update + */ +export declare type GatewayGuildMemberUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-update + */ +export declare type GatewayGuildMemberUpdateDispatchData = Omit & Partial> & Required> & Nullable> & { + /** + * The id of the guild + */ + guild_id: Snowflake; +}; +/** + * https://discord.com/developers/docs/topics/gateway#guild-members-chunk + */ +export declare type GatewayGuildMembersChunkDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-members-chunk + */ +export interface GatewayGuildMembersChunkDispatchData { + /** + * The id of the guild + */ + guild_id: Snowflake; + /** + * Set of guild members + * + * See https://discord.com/developers/docs/resources/guild#guild-member-object + */ + members: APIGuildMember[]; + /** + * The chunk index in the expected chunks for this response (`0 <= chunk_index < chunk_count`) + */ + chunk_index?: number; + /** + * The total number of expected chunks for this response + */ + chunk_count?: number; + /** + * If passing an invalid id to `REQUEST_GUILD_MEMBERS`, it will be returned here + */ + not_found?: unknown[]; + /** + * If passing true to `REQUEST_GUILD_MEMBERS`, presences of the returned members will be here + * + * See https://discord.com/developers/docs/topics/gateway#presence + */ + presences?: RawGatewayPresenceUpdate[]; + /** + * The nonce used in the Guild Members Request + * + * See https://discord.com/developers/docs/topics/gateway#request-guild-members + */ + nonce?: string; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-create + * https://discord.com/developers/docs/topics/gateway#guild-role-update + */ +export declare type GatewayGuildRoleModifyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-create + * https://discord.com/developers/docs/topics/gateway#guild-role-update + */ +export interface GatewayGuildRoleModifyDispatchData { + /** + * The id of the guild + */ + guild_id: Snowflake; + /** + * The role created or updated + * + * See https://discord.com/developers/docs/topics/permissions#role-object + */ + role: APIRole; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-create + */ +export declare type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-create + */ +export declare type GatewayGuildRoleCreateDispatchData = GatewayGuildRoleModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-update + */ +export declare type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-update + */ +export declare type GatewayGuildRoleUpdateDispatchData = GatewayGuildRoleModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-delete + */ +export declare type GatewayGuildRoleDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-delete + */ +export interface GatewayGuildRoleDeleteDispatchData { + /** + * The id of the guild + */ + guild_id: Snowflake; + /** + * The id of the role + */ + role_id: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#integration-create + */ +export declare type GatewayIntegrationCreateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#integration-create + */ +export declare type GatewayIntegrationCreateDispatchData = APIGuildIntegration & { + guild_id: Snowflake; +}; +/** + * https://discord.com/developers/docs/topics/gateway#integration-update + */ +export declare type GatewayIntegrationUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#integration-update + */ +export declare type GatewayIntegrationUpdateDispatchData = APIGuildIntegration & { + guild_id: Snowflake; +}; +/** + * https://discord.com/developers/docs/topics/gateway#integration-update + */ +export declare type GatewayIntegrationDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#integration-delete + */ +export interface GatewayIntegrationDeleteDispatchData { + /** + * Integration id + */ + id: Snowflake; + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * ID of the bot/OAuth2 application for this Discord integration + */ + application_id?: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#interaction-create + */ +export declare type GatewayInteractionCreateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#interaction-create + */ +export declare type GatewayInteractionCreateDispatchData = APIApplicationCommandInteraction | APIMessageComponentInteraction; +/** + * https://discord.com/developers/docs/topics/gateway#invite-create + */ +export declare type GatewayInviteCreateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#invite-create + */ +export interface GatewayInviteCreateDispatchData { + /** + * The channel the invite is for + */ + channel_id: Snowflake; + /** + * The unique invite code + * + * See https://discord.com/developers/docs/resources/invite#invite-object + */ + code: string; + /** + * The time at which the invite was created + */ + created_at: number; + /** + * The guild of the invite + */ + guild_id?: Snowflake; + /** + * The user that created the invite + * + * See https://discord.com/developers/docs/resources/user#user-object + */ + inviter?: APIUser; + /** + * How long the invite is valid for (in seconds) + */ + max_age: number; + /** + * The maximum number of times the invite can be used + */ + max_uses: number; + /** + * The type of target for this voice channel invite + * + * See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types + */ + target_type?: InviteTargetType; + /** + * The user whose stream to display for this voice channel stream invite + * + * See https://discord.com/developers/docs/resources/user#user-object + */ + target_user?: APIUser; + /** + * The embedded application to open for this voice channel embedded application invite + */ + target_application?: Partial; + /** + * Whether or not the invite is temporary (invited users will be kicked on disconnect unless they're assigned a role) + */ + temporary: boolean; + /** + * How many times the invite has been used (always will be `0`) + */ + uses: 0; +} +/** + * https://discord.com/developers/docs/topics/gateway#invite-delete + */ +export declare type GatewayInviteDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#invite-delete + */ +export interface GatewayInviteDeleteDispatchData { + /** + * The channel of the invite + */ + channel_id: Snowflake; + /** + * The guild of the invite + */ + guild_id?: Snowflake; + /** + * The unique invite code + * + * See https://discord.com/developers/docs/resources/invite#invite-object + */ + code: string; +} +/** + * https://discord.com/developers/docs/topics/gateway#message-create + */ +export declare type GatewayMessageCreateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-create + */ +export declare type GatewayMessageCreateDispatchData = APIMessage; +/** + * https://discord.com/developers/docs/topics/gateway#message-update + */ +export declare type GatewayMessageUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-update + */ +export declare type GatewayMessageUpdateDispatchData = { + id: Snowflake; + channel_id: Snowflake; +} & Partial; +/** + * https://discord.com/developers/docs/topics/gateway#message-delete + */ +export declare type GatewayMessageDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-delete + */ +export interface GatewayMessageDeleteDispatchData { + /** + * The id of the message + */ + id: Snowflake; + /** + * The id of the channel + */ + channel_id: Snowflake; + /** + * The id of the guild + */ + guild_id?: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#message-delete-bulk + */ +export declare type GatewayMessageDeleteBulkDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-delete-bulk + */ +export interface GatewayMessageDeleteBulkDispatchData { + /** + * The ids of the messages + */ + ids: Snowflake[]; + /** + * The id of the channel + */ + channel_id: Snowflake; + /** + * The id of the guild + */ + guild_id?: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-add + */ +export declare type GatewayMessageReactionAddDispatch = ReactionData; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-add + */ +export declare type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d']; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove + */ +export declare type GatewayMessageReactionRemoveDispatch = ReactionData; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove + */ +export declare type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d']; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all + */ +export declare type GatewayMessageReactionRemoveAllDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all + */ +export declare type GatewayMessageReactionRemoveAllDispatchData = MessageReactionRemoveData; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji + */ +export declare type GatewayMessageReactionRemoveEmojiDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji + */ +export interface GatewayMessageReactionRemoveEmojiDispatchData extends MessageReactionRemoveData { + /** + * The emoji that was removed + */ + emoji: APIEmoji; +} +/** + * https://discord.com/developers/docs/topics/gateway#presence-update + */ +export declare type GatewayPresenceUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#presence-update + */ +export declare type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate; +/** + * https://discord.com/developers/docs/topics/gateway#stage-instance-create + */ +export declare type GatewayStageInstanceCreateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#stage-instance-create + */ +export declare type GatewayStageInstanceCreateDispatchData = APIStageInstance; +/** + * https://discord.com/developers/docs/topics/gateway#stage-instance-delete + */ +export declare type GatewayStageInstanceDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#stage-instance-delete + */ +export declare type GatewayStageInstanceDeleteDispatchData = APIStageInstance; +/** + * https://discord.com/developers/docs/topics/gateway#stage-instance-update + */ +export declare type GatewayStageInstanceUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#stage-instance-update + */ +export declare type GatewayStageInstanceUpdateDispatchData = APIStageInstance; +/** + * https://discord.com/developers/docs/topics/gateway#typing-start + */ +export declare type GatewayTypingStartDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#typing-start + */ +export interface GatewayTypingStartDispatchData { + /** + * The id of the channel + */ + channel_id: Snowflake; + /** + * The id of the guild + */ + guild_id?: Snowflake; + /** + * The id of the user + */ + user_id: Snowflake; + /** + * Unix time (in seconds) of when the user started typing + */ + timestamp: number; + /** + * The member who started typing if this happened in a guild + * + * See https://discord.com/developers/docs/resources/guild#guild-member-object + */ + member?: APIGuildMember; +} +/** + * https://discord.com/developers/docs/topics/gateway#user-update + */ +export declare type GatewayUserUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#user-update + */ +export declare type GatewayUserUpdateDispatchData = APIUser; +/** + * https://discord.com/developers/docs/topics/gateway#voice-state-update + */ +export declare type GatewayVoiceStateUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#voice-state-update + */ +export declare type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState; +/** + * https://discord.com/developers/docs/topics/gateway#voice-server-update + */ +export declare type GatewayVoiceServerUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#voice-server-update + */ +export interface GatewayVoiceServerUpdateDispatchData { + /** + * Voice connection token + */ + token: string; + /** + * The guild this voice server update is for + */ + guild_id: Snowflake; + /** + * The voice server host + * + * A `null` endpoint means that the voice server allocated has gone away and is trying to be reallocated. + * You should attempt to disconnect from the currently connected voice server, and not attempt to reconnect + * until a new voice server is allocated + */ + endpoint: string | null; +} +/** + * https://discord.com/developers/docs/topics/gateway#webhooks-update + */ +export declare type GatewayWebhooksUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#webhooks-update + */ +export interface GatewayWebhooksUpdateDispatchData { + /** + * The id of the guild + */ + guild_id: Snowflake; + /** + * The id of the channel + */ + channel_id: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#heartbeating + */ +export interface GatewayHeartbeat { + op: GatewayOpcodes.Heartbeat; + d: GatewayHeartbeatData; +} +/** + * https://discord.com/developers/docs/topics/gateway#heartbeating + */ +export declare type GatewayHeartbeatData = number | null; +/** + * https://discord.com/developers/docs/topics/gateway#identify + */ +export interface GatewayIdentify { + op: GatewayOpcodes.Identify; + d: GatewayIdentifyData; +} +/** + * https://discord.com/developers/docs/topics/gateway#identify + */ +export interface GatewayIdentifyData { + /** + * Authentication token + */ + token: string; + /** + * Connection properties + * + * See https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties + */ + properties: GatewayIdentifyProperties; + /** + * Whether this connection supports compression of packets + * + * @default false + */ + compress?: boolean; + /** + * Value between 50 and 250, total number of members where the gateway will stop sending + * offline members in the guild member list + * + * @default 50 + */ + large_threshold?: number; + /** + * Used for Guild Sharding + * + * See https://discord.com/developers/docs/topics/gateway#sharding + */ + shard?: [shard_id: number, shard_count: number]; + /** + * Presence structure for initial presence information + * + * See https://discord.com/developers/docs/topics/gateway#update-presence + */ + presence?: GatewayPresenceUpdateData; + /** + * The Gateway Intents you wish to receive + * + * See https://discord.com/developers/docs/topics/gateway#gateway-intents + */ + intents: number; +} +/** + * https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties + */ +export interface GatewayIdentifyProperties { + /** + * Your operating system + */ + $os: string; + /** + * Your library name + */ + $browser: string; + /** + * Your library name + */ + $device: string; +} +/** + * https://discord.com/developers/docs/topics/gateway#resume + */ +export interface GatewayResume { + op: GatewayOpcodes.Resume; + d: GatewayResumeData; +} +/** + * https://discord.com/developers/docs/topics/gateway#resume + */ +export interface GatewayResumeData { + /** + * Session token + */ + token: string; + /** + * Session id + */ + session_id: string; + /** + * Last sequence number received + */ + seq: number; +} +/** + * https://discord.com/developers/docs/topics/gateway#request-guild-members + */ +export interface GatewayRequestGuildMembers { + op: GatewayOpcodes.RequestGuildMembers; + d: GatewayRequestGuildMembersData; +} +/** + * https://discord.com/developers/docs/topics/gateway#request-guild-members + */ +export interface GatewayRequestGuildMembersData { + /** + * ID of the guild to get members for + */ + guild_id: Snowflake; + /** + * String that username starts with, or an empty string to return all members + */ + query?: string; + /** + * Maximum number of members to send matching the `query`; + * a limit of `0` can be used with an empty string `query` to return all members + */ + limit: number; + /** + * Used to specify if we want the presences of the matched members + */ + presences?: boolean; + /** + * Used to specify which users you wish to fetch + */ + user_ids?: Snowflake | Snowflake[]; + /** + * Nonce to identify the Guild Members Chunk response + * + * Nonce can only be up to 32 bytes. If you send an invalid nonce it will be ignored and the reply member_chunk(s) will not have a `nonce` set. + * + * See https://discord.com/developers/docs/topics/gateway#guild-members-chunk + */ + nonce?: string; +} +/** + * https://discord.com/developers/docs/topics/gateway#update-voice-state + */ +export interface GatewayVoiceStateUpdate { + op: GatewayOpcodes.VoiceStateUpdate; + d: GatewayVoiceStateUpdateData; +} +/** + * https://discord.com/developers/docs/topics/gateway#update-voice-state + */ +export interface GatewayVoiceStateUpdateData { + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * ID of the voice channel client wants to join (`null` if disconnecting) + */ + channel_id: Snowflake | null; + /** + * Is the client muted + */ + self_mute: boolean; + /** + * Is the client deafened + */ + self_deaf: boolean; +} +/** + * https://discord.com/developers/docs/topics/gateway#update-presence + */ +export interface GatewayUpdatePresence { + op: GatewayOpcodes.PresenceUpdate; + d: GatewayPresenceUpdateData; +} +/** + * https://discord.com/developers/docs/topics/gateway#update-presence-gateway-presence-update-structure + */ +export interface GatewayPresenceUpdateData { + /** + * Unix time (in milliseconds) of when the client went idle, or `null` if the client is not idle + */ + since: number | null; + /** + * The user's activities + * + * See https://discord.com/developers/docs/topics/gateway#activity-object + */ + activities: GatewayActivityUpdateData[]; + /** + * The user's new status + * + * See https://discord.com/developers/docs/topics/gateway#update-presence-status-types + */ + status: PresenceUpdateStatus; + /** + * Whether or not the client is afk + */ + afk: boolean; +} +/** + * https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure + */ +export declare type GatewayActivityUpdateData = Pick; +interface BasePayload { + /** + * Opcode for the payload + */ + op: GatewayOpcodes; + /** + * Event data + */ + d?: unknown; + /** + * Sequence number, used for resuming sessions and heartbeats + */ + s: number; + /** + * The event name for this payload + */ + t?: string; +} +declare type NonDispatchPayload = Omit; +interface DataPayload extends BasePayload { + op: GatewayOpcodes.Dispatch; + t: Event; + d: D; +} +declare type ReactionData = DataPayload>; +interface MessageReactionRemoveData { + /** + * The id of the channel + */ + channel_id: Snowflake; + /** + * The id of the message + */ + message_id: Snowflake; + /** + * The id of the guild + */ + guild_id?: Snowflake; +} +//# sourceMappingURL=v8.d.ts.map \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/v8.d.ts.map b/node_modules/discord-api-types/gateway/v8.d.ts.map new file mode 100644 index 0000000..008e526 --- /dev/null +++ b/node_modules/discord-api-types/gateway/v8.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"v8.d.ts","sourceRoot":"","sources":["v8.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EACX,cAAc,EACd,qBAAqB,EACrB,gCAAgC,EAChC,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,mBAAmB,EACnB,cAAc,EACd,UAAU,EACV,8BAA8B,EAC9B,OAAO,EACP,gBAAgB,EAChB,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,eAAe,EACf,qBAAqB,IAAI,wBAAwB,EACjD,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,cAAc,UAAU,CAAC;AAEzB,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;GAEG;AACH,0BAAkB,cAAc;IAC/B;;OAEG;IACH,QAAQ,IAAA;IACR;;;OAGG;IACH,SAAS,IAAA;IACT;;OAEG;IACH,QAAQ,IAAA;IACR;;OAEG;IACH,cAAc,IAAA;IACd;;OAEG;IACH,gBAAgB,IAAA;IAChB;;OAEG;IACH,MAAM,IAAI;IACV;;OAEG;IACH,SAAS,IAAA;IACT;;OAEG;IACH,mBAAmB,IAAA;IACnB;;OAEG;IACH,cAAc,IAAA;IACd;;OAEG;IACH,KAAK,KAAA;IACL;;OAEG;IACH,YAAY,KAAA;CACZ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IACZ;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;CACX;AAED,aAAK,kBAAkB,GAAG,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;AAEjD,UAAU,WAAW,CAAC,KAAK,SAAS,qBAAqB,EAAE,CAAC,GAAG,OAAO,CAAE,SAAQ,WAAW;IAC1F,EAAE,EAAE,cAAc,CAAC,QAAQ,CAAC;IAC5B,CAAC,EAAE,KAAK,CAAC;IACT,CAAC,EAAE,CAAC,CAAC;CACL;AAED,aAAK,YAAY,CAAC,CAAC,SAAS,qBAAqB,EAAE,CAAC,SAAS,MAAM,GAAG,KAAK,IAAI,WAAW,CACzF,CAAC,EACD,IAAI,CACH;IACC;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;;;OAIG;IACH,KAAK,EAAE,QAAQ,CAAC;CAChB,EACD,CAAC,CACD,CACD,CAAC;AAEF,UAAU,yBAAyB;IAClC;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB"} \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/v8.js b/node_modules/discord-api-types/gateway/v8.js new file mode 100644 index 0000000..a40af16 --- /dev/null +++ b/node_modules/discord-api-types/gateway/v8.js @@ -0,0 +1,228 @@ +"use strict"; +/** + * Types extracted from https://discord.com/developers/docs/topics/gateway + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.GatewayCloseCodes = exports.GatewayOpcodes = exports.GatewayVersion = void 0; +__exportStar(require("./common"), exports); +exports.GatewayVersion = '8'; +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes + */ +var GatewayOpcodes; +(function (GatewayOpcodes) { + /** + * An event was dispatched + */ + GatewayOpcodes[GatewayOpcodes["Dispatch"] = 0] = "Dispatch"; + /** + * A bidirectional opcode to maintain an active gateway connection. + * Fired periodically by the client, or fired by the gateway to request an immediate heartbeat from the client. + */ + GatewayOpcodes[GatewayOpcodes["Heartbeat"] = 1] = "Heartbeat"; + /** + * Starts a new session during the initial handshake + */ + GatewayOpcodes[GatewayOpcodes["Identify"] = 2] = "Identify"; + /** + * Update the client's presence + */ + GatewayOpcodes[GatewayOpcodes["PresenceUpdate"] = 3] = "PresenceUpdate"; + /** + * Used to join/leave or move between voice channels + */ + GatewayOpcodes[GatewayOpcodes["VoiceStateUpdate"] = 4] = "VoiceStateUpdate"; + /** + * Resume a previous session that was disconnected + */ + GatewayOpcodes[GatewayOpcodes["Resume"] = 6] = "Resume"; + /** + * You should attempt to reconnect and resume immediately + */ + GatewayOpcodes[GatewayOpcodes["Reconnect"] = 7] = "Reconnect"; + /** + * Request information about offline guild members in a large guild + */ + GatewayOpcodes[GatewayOpcodes["RequestGuildMembers"] = 8] = "RequestGuildMembers"; + /** + * The session has been invalidated. You should reconnect and identify/resume accordingly + */ + GatewayOpcodes[GatewayOpcodes["InvalidSession"] = 9] = "InvalidSession"; + /** + * Sent immediately after connecting, contains the `heartbeat_interval` to use + */ + GatewayOpcodes[GatewayOpcodes["Hello"] = 10] = "Hello"; + /** + * Sent in response to receiving a heartbeat to acknowledge that it has been received + */ + GatewayOpcodes[GatewayOpcodes["HeartbeatAck"] = 11] = "HeartbeatAck"; +})(GatewayOpcodes = exports.GatewayOpcodes || (exports.GatewayOpcodes = {})); +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes + */ +var GatewayCloseCodes; +(function (GatewayCloseCodes) { + /** + * We're not sure what went wrong. Try reconnecting? + */ + GatewayCloseCodes[GatewayCloseCodes["UnknownError"] = 4000] = "UnknownError"; + /** + * You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that! + * + * See https://discord.com/developers/docs/topics/gateway#payloads-and-opcodes + */ + GatewayCloseCodes[GatewayCloseCodes["UnknownOpcode"] = 4001] = "UnknownOpcode"; + /** + * You sent an invalid payload to us. Don't do that! + * + * See https://discord.com/developers/docs/topics/gateway#sending-payloads + */ + GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError"; + /** + * You sent us a payload prior to identifying + * + * See https://discord.com/developers/docs/topics/gateway#identify + */ + GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated"; + /** + * The account token sent with your identify payload is incorrect + * + * See https://discord.com/developers/docs/topics/gateway#identify + */ + GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed"; + /** + * You sent more than one identify payload. Don't do that! + */ + GatewayCloseCodes[GatewayCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated"; + /** + * The sequence sent when resuming the session was invalid. Reconnect and start a new session + * + * See https://discord.com/developers/docs/topics/gateway#resume + */ + GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq"; + /** + * Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this + */ + GatewayCloseCodes[GatewayCloseCodes["RateLimited"] = 4008] = "RateLimited"; + /** + * Your session timed out. Reconnect and start a new one + */ + GatewayCloseCodes[GatewayCloseCodes["SessionTimedOut"] = 4009] = "SessionTimedOut"; + /** + * You sent us an invalid shard when identifying + * + * See https://discord.com/developers/docs/topics/gateway#sharding + */ + GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard"; + /** + * The session would have handled too many guilds - you are required to shard your connection in order to connect + * + * See https://discord.com/developers/docs/topics/gateway#sharding + */ + GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired"; + /** + * You sent an invalid version for the gateway + */ + GatewayCloseCodes[GatewayCloseCodes["InvalidAPIVersion"] = 4012] = "InvalidAPIVersion"; + /** + * You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value + * + * See https://discord.com/developers/docs/topics/gateway#gateway-intents + */ + GatewayCloseCodes[GatewayCloseCodes["InvalidIntents"] = 4013] = "InvalidIntents"; + /** + * You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not + * enabled or are not whitelisted for + * + * See https://discord.com/developers/docs/topics/gateway#gateway-intents + * + * See https://discord.com/developers/docs/topics/gateway#privileged-intents + */ + GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents"; +})(GatewayCloseCodes = exports.GatewayCloseCodes || (exports.GatewayCloseCodes = {})); +/** + * https://discord.com/developers/docs/topics/gateway#list-of-intents + */ +var GatewayIntentBits; +(function (GatewayIntentBits) { + GatewayIntentBits[GatewayIntentBits["Guilds"] = 1] = "Guilds"; + GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers"; + GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans"; + GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers"; + GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations"; + GatewayIntentBits[GatewayIntentBits["GuildWebhooks"] = 32] = "GuildWebhooks"; + GatewayIntentBits[GatewayIntentBits["GuildInvites"] = 64] = "GuildInvites"; + GatewayIntentBits[GatewayIntentBits["GuildVoiceStates"] = 128] = "GuildVoiceStates"; + GatewayIntentBits[GatewayIntentBits["GuildPresences"] = 256] = "GuildPresences"; + GatewayIntentBits[GatewayIntentBits["GuildMessages"] = 512] = "GuildMessages"; + GatewayIntentBits[GatewayIntentBits["GuildMessageReactions"] = 1024] = "GuildMessageReactions"; + GatewayIntentBits[GatewayIntentBits["GuildMessageTyping"] = 2048] = "GuildMessageTyping"; + GatewayIntentBits[GatewayIntentBits["DirectMessages"] = 4096] = "DirectMessages"; + GatewayIntentBits[GatewayIntentBits["DirectMessageReactions"] = 8192] = "DirectMessageReactions"; + GatewayIntentBits[GatewayIntentBits["DirectMessageTyping"] = 16384] = "DirectMessageTyping"; +})(GatewayIntentBits = exports.GatewayIntentBits || (exports.GatewayIntentBits = {})); +/** + * https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events + */ +var GatewayDispatchEvents; +(function (GatewayDispatchEvents) { + GatewayDispatchEvents["ApplicationCommandCreate"] = "APPLICATION_COMMAND_CREATE"; + GatewayDispatchEvents["ApplicationCommandDelete"] = "APPLICATION_COMMAND_DELETE"; + GatewayDispatchEvents["ApplicationCommandUpdate"] = "APPLICATION_COMMAND_UPDATE"; + GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE"; + GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE"; + GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE"; + GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE"; + GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD"; + GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE"; + GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE"; + GatewayDispatchEvents["GuildDelete"] = "GUILD_DELETE"; + GatewayDispatchEvents["GuildEmojisUpdate"] = "GUILD_EMOJIS_UPDATE"; + GatewayDispatchEvents["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE"; + GatewayDispatchEvents["GuildMemberAdd"] = "GUILD_MEMBER_ADD"; + GatewayDispatchEvents["GuildMemberRemove"] = "GUILD_MEMBER_REMOVE"; + GatewayDispatchEvents["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK"; + GatewayDispatchEvents["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE"; + GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE"; + GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE"; + GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE"; + GatewayDispatchEvents["GuildStickersUpdate"] = "GUILD_STICKERS_UPDATE"; + GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE"; + GatewayDispatchEvents["IntegrationCreate"] = "INTEGRATION_CREATE"; + GatewayDispatchEvents["IntegrationDelete"] = "INTEGRATION_DELETE"; + GatewayDispatchEvents["IntegrationUpdate"] = "INTEGRATION_UPDATE"; + GatewayDispatchEvents["InteractionCreate"] = "INTERACTION_CREATE"; + GatewayDispatchEvents["InviteCreate"] = "INVITE_CREATE"; + GatewayDispatchEvents["InviteDelete"] = "INVITE_DELETE"; + GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE"; + GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE"; + GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK"; + GatewayDispatchEvents["MessageReactionAdd"] = "MESSAGE_REACTION_ADD"; + GatewayDispatchEvents["MessageReactionRemove"] = "MESSAGE_REACTION_REMOVE"; + GatewayDispatchEvents["MessageReactionRemoveAll"] = "MESSAGE_REACTION_REMOVE_ALL"; + GatewayDispatchEvents["MessageReactionRemoveEmoji"] = "MESSAGE_REACTION_REMOVE_EMOJI"; + GatewayDispatchEvents["MessageUpdate"] = "MESSAGE_UPDATE"; + GatewayDispatchEvents["PresenceUpdate"] = "PRESENCE_UPDATE"; + GatewayDispatchEvents["StageInstanceCreate"] = "STAGE_INSTANCE_CREATE"; + GatewayDispatchEvents["StageInstanceDelete"] = "STAGE_INSTANCE_DELETE"; + GatewayDispatchEvents["StageInstanceUpdate"] = "STAGE_INSTANCE_UPDATE"; + GatewayDispatchEvents["Ready"] = "READY"; + GatewayDispatchEvents["Resumed"] = "RESUMED"; + GatewayDispatchEvents["TypingStart"] = "TYPING_START"; + GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE"; + GatewayDispatchEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE"; + GatewayDispatchEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE"; + GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE"; +})(GatewayDispatchEvents = exports.GatewayDispatchEvents || (exports.GatewayDispatchEvents = {})); +// #endregion Shared +//# sourceMappingURL=v8.js.map \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/v8.js.map b/node_modules/discord-api-types/gateway/v8.js.map new file mode 100644 index 0000000..ebdb041 --- /dev/null +++ b/node_modules/discord-api-types/gateway/v8.js.map @@ -0,0 +1 @@ +{"version":3,"file":"v8.js","sourceRoot":"","sources":["v8.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;AA2BH,2CAAyB;AAEZ,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;GAEG;AACH,IAAkB,cA8CjB;AA9CD,WAAkB,cAAc;IAC/B;;OAEG;IACH,2DAAQ,CAAA;IACR;;;OAGG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,2DAAQ,CAAA;IACR;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,2EAAgB,CAAA;IAChB;;OAEG;IACH,uDAAU,CAAA;IACV;;OAEG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,iFAAmB,CAAA;IACnB;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,sDAAK,C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D,CAAA;IACvD,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,yDAAgC,CAAA;IAChC,sDAA6B,CAAA;IAC7B,4DAAmC,CAAA;IACnC,qDAA4B,CAAA;IAC5B,qDAA4B,CAAA;IAC5B,kEAAyC,CAAA;IACzC,8EAAqD,CAAA;IACrD,4DAAmC,CAAA;IACnC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,sEAA6C,CAAA;IAC7C,qDAA4B,CAAA;IAC5B,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,oEAA2C,CAAA;IAC3C,0EAAiD,CAAA;IACjD,iFAAwD,CAAA;IACxD,qFAA4D,CAAA;IAC5D,yDAAgC,CAAA;IAChC,2DAAkC,CAAA;IAClC,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,kEAAyC,CAAA;IACzC,gEAAuC,CAAA;IACvC,2DAAkC,CAAA;AACnC,CAAC,EAhDiB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAgDtC;AA42CD,oBAAoB"} \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/v8.mjs b/node_modules/discord-api-types/gateway/v8.mjs new file mode 100644 index 0000000..c5cfed1 --- /dev/null +++ b/node_modules/discord-api-types/gateway/v8.mjs @@ -0,0 +1,8 @@ +import mod from "./v8.js"; + +export default mod; +export const GatewayCloseCodes = mod.GatewayCloseCodes; +export const GatewayDispatchEvents = mod.GatewayDispatchEvents; +export const GatewayIntentBits = mod.GatewayIntentBits; +export const GatewayOpcodes = mod.GatewayOpcodes; +export const GatewayVersion = mod.GatewayVersion; diff --git a/node_modules/discord-api-types/gateway/v9.d.ts b/node_modules/discord-api-types/gateway/v9.d.ts new file mode 100644 index 0000000..acad031 --- /dev/null +++ b/node_modules/discord-api-types/gateway/v9.d.ts @@ -0,0 +1,1362 @@ +/** + * Types extracted from https://discord.com/developers/docs/topics/gateway + */ +import type { Snowflake } from '../globals'; +import type { APIApplication, APIApplicationCommand, APIApplicationCommandInteraction, APIChannel, APIEmoji, APIGuild, APIGuildIntegration, APIGuildMember, APIMessage, APIMessageComponentInteraction, APIRole, APIStageInstance, APISticker, APIThreadMember, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayThreadListSync as RawGatewayThreadListSync, GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate, GatewayVoiceState, InviteTargetType, PresenceUpdateStatus } from '../payloads/v9/index'; +import type { Nullable } from '../utils/internals'; +export * from './common'; +export declare const GatewayVersion = "9"; +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes + */ +export declare const enum GatewayOpcodes { + /** + * An event was dispatched + */ + Dispatch = 0, + /** + * A bidirectional opcode to maintain an active gateway connection. + * Fired periodically by the client, or fired by the gateway to request an immediate heartbeat from the client. + */ + Heartbeat = 1, + /** + * Starts a new session during the initial handshake + */ + Identify = 2, + /** + * Update the client's presence + */ + PresenceUpdate = 3, + /** + * Used to join/leave or move between voice channels + */ + VoiceStateUpdate = 4, + /** + * Resume a previous session that was disconnected + */ + Resume = 6, + /** + * You should attempt to reconnect and resume immediately + */ + Reconnect = 7, + /** + * Request information about offline guild members in a large guild + */ + RequestGuildMembers = 8, + /** + * The session has been invalidated. You should reconnect and identify/resume accordingly + */ + InvalidSession = 9, + /** + * Sent immediately after connecting, contains the `heartbeat_interval` to use + */ + Hello = 10, + /** + * Sent in response to receiving a heartbeat to acknowledge that it has been received + */ + HeartbeatAck = 11 +} +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes + */ +export declare const enum GatewayCloseCodes { + /** + * We're not sure what went wrong. Try reconnecting? + */ + UnknownError = 4000, + /** + * You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that! + * + * See https://discord.com/developers/docs/topics/gateway#payloads-and-opcodes + */ + UnknownOpcode = 4001, + /** + * You sent an invalid payload to us. Don't do that! + * + * See https://discord.com/developers/docs/topics/gateway#sending-payloads + */ + DecodeError = 4002, + /** + * You sent us a payload prior to identifying + * + * See https://discord.com/developers/docs/topics/gateway#identify + */ + NotAuthenticated = 4003, + /** + * The account token sent with your identify payload is incorrect + * + * See https://discord.com/developers/docs/topics/gateway#identify + */ + AuthenticationFailed = 4004, + /** + * You sent more than one identify payload. Don't do that! + */ + AlreadyAuthenticated = 4005, + /** + * The sequence sent when resuming the session was invalid. Reconnect and start a new session + * + * See https://discord.com/developers/docs/topics/gateway#resume + */ + InvalidSeq = 4007, + /** + * Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this + */ + RateLimited = 4008, + /** + * Your session timed out. Reconnect and start a new one + */ + SessionTimedOut = 4009, + /** + * You sent us an invalid shard when identifying + * + * See https://discord.com/developers/docs/topics/gateway#sharding + */ + InvalidShard = 4010, + /** + * The session would have handled too many guilds - you are required to shard your connection in order to connect + * + * See https://discord.com/developers/docs/topics/gateway#sharding + */ + ShardingRequired = 4011, + /** + * You sent an invalid version for the gateway + */ + InvalidAPIVersion = 4012, + /** + * You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value + * + * See https://discord.com/developers/docs/topics/gateway#gateway-intents + */ + InvalidIntents = 4013, + /** + * You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not + * enabled or are not whitelisted for + * + * See https://discord.com/developers/docs/topics/gateway#gateway-intents + * + * See https://discord.com/developers/docs/topics/gateway#privileged-intents + */ + DisallowedIntents = 4014 +} +/** + * https://discord.com/developers/docs/topics/gateway#list-of-intents + */ +export declare const enum GatewayIntentBits { + Guilds = 1, + GuildMembers = 2, + GuildBans = 4, + GuildEmojisAndStickers = 8, + GuildIntegrations = 16, + GuildWebhooks = 32, + GuildInvites = 64, + GuildVoiceStates = 128, + GuildPresences = 256, + GuildMessages = 512, + GuildMessageReactions = 1024, + GuildMessageTyping = 2048, + DirectMessages = 4096, + DirectMessageReactions = 8192, + DirectMessageTyping = 16384 +} +/** + * https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events + */ +export declare const enum GatewayDispatchEvents { + ApplicationCommandCreate = "APPLICATION_COMMAND_CREATE", + ApplicationCommandDelete = "APPLICATION_COMMAND_DELETE", + ApplicationCommandUpdate = "APPLICATION_COMMAND_UPDATE", + ChannelCreate = "CHANNEL_CREATE", + ChannelDelete = "CHANNEL_DELETE", + ChannelPinsUpdate = "CHANNEL_PINS_UPDATE", + ChannelUpdate = "CHANNEL_UPDATE", + GuildBanAdd = "GUILD_BAN_ADD", + GuildBanRemove = "GUILD_BAN_REMOVE", + GuildCreate = "GUILD_CREATE", + GuildDelete = "GUILD_DELETE", + GuildEmojisUpdate = "GUILD_EMOJIS_UPDATE", + GuildIntegrationsUpdate = "GUILD_INTEGRATIONS_UPDATE", + GuildMemberAdd = "GUILD_MEMBER_ADD", + GuildMemberRemove = "GUILD_MEMBER_REMOVE", + GuildMembersChunk = "GUILD_MEMBERS_CHUNK", + GuildMemberUpdate = "GUILD_MEMBER_UPDATE", + GuildRoleCreate = "GUILD_ROLE_CREATE", + GuildRoleDelete = "GUILD_ROLE_DELETE", + GuildRoleUpdate = "GUILD_ROLE_UPDATE", + GuildStickersUpdate = "GUILD_STICKERS_UPDATE", + GuildUpdate = "GUILD_UPDATE", + IntegrationCreate = "INTEGRATION_CREATE", + IntegrationDelete = "INTEGRATION_DELETE", + IntegrationUpdate = "INTEGRATION_UPDATE", + InteractionCreate = "INTERACTION_CREATE", + InviteCreate = "INVITE_CREATE", + InviteDelete = "INVITE_DELETE", + MessageCreate = "MESSAGE_CREATE", + MessageDelete = "MESSAGE_DELETE", + MessageDeleteBulk = "MESSAGE_DELETE_BULK", + MessageReactionAdd = "MESSAGE_REACTION_ADD", + MessageReactionRemove = "MESSAGE_REACTION_REMOVE", + MessageReactionRemoveAll = "MESSAGE_REACTION_REMOVE_ALL", + MessageReactionRemoveEmoji = "MESSAGE_REACTION_REMOVE_EMOJI", + MessageUpdate = "MESSAGE_UPDATE", + PresenceUpdate = "PRESENCE_UPDATE", + StageInstanceCreate = "STAGE_INSTANCE_CREATE", + StageInstanceDelete = "STAGE_INSTANCE_DELETE", + StageInstanceUpdate = "STAGE_INSTANCE_UPDATE", + Ready = "READY", + Resumed = "RESUMED", + ThreadCreate = "THREAD_CREATE", + ThreadDelete = "THREAD_DELETE", + ThreadListSync = "THREAD_LIST_SYNC", + ThreadMembersUpdate = "THREAD_MEMBERS_UPDATE", + ThreadMemberUpdate = "THREAD_MEMBER_UPDATE", + ThreadUpdate = "THREAD_UPDATE", + TypingStart = "TYPING_START", + UserUpdate = "USER_UPDATE", + VoiceServerUpdate = "VOICE_SERVER_UPDATE", + VoiceStateUpdate = "VOICE_STATE_UPDATE", + WebhooksUpdate = "WEBHOOKS_UPDATE" +} +export declare type GatewaySendPayload = GatewayHeartbeat | GatewayIdentify | GatewayUpdatePresence | GatewayVoiceStateUpdate | GatewayResume | GatewayRequestGuildMembers; +export declare type GatewayReceivePayload = GatewayHello | GatewayHeartbeatRequest | GatewayHeartbeatAck | GatewayInvalidSession | GatewayReconnect | GatewayDispatchPayload; +export declare type GatewayDispatchPayload = GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch | GatewayGuildMembersChunkDispatch | GatewayGuildMemberUpdateDispatch | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildStickersUpdateDispatch | GatewayIntegrationCreateDispatch | GatewayIntegrationDeleteDispatch | GatewayIntegrationUpdateDispatch | GatewayInteractionCreateDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch | GatewayMessageDeleteBulkDispatch | GatewayMessageDeleteDispatch | GatewayMessageReactionAddDispatch | GatewayMessageReactionRemoveAllDispatch | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch | GatewayReadyDispatch | GatewayResumedDispatch | GatewayThreadListSyncDispatch | GatewayThreadMembersUpdateDispatch | GatewayThreadMemberUpdateDispatch | GatewayThreadModifyDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-create + * https://discord.com/developers/docs/topics/gateway#application-command-update + * https://discord.com/developers/docs/topics/gateway#application-command-delete + */ +export declare type GatewayApplicationCommandModifyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-create + * https://discord.com/developers/docs/topics/gateway#application-command-update + * https://discord.com/developers/docs/topics/gateway#application-command-delete + */ +export declare type GatewayApplicationCommandModifyDispatchData = APIApplicationCommand; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-create + */ +export declare type GatewayApplicationCommandCreateDispatch = GatewayApplicationCommandModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-create + */ +export declare type GatewayApplicationCommandCreateDispatchData = GatewayApplicationCommandModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-update + */ +export declare type GatewayApplicationCommandUpdateDispatch = GatewayApplicationCommandModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-update + */ +export declare type GatewayApplicationCommandUpdateDispatchData = GatewayApplicationCommandModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-delete + */ +export declare type GatewayApplicationCommandDeleteDispatch = GatewayApplicationCommandModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#application-command-delete + */ +export declare type GatewayApplicationCommandDeleteDispatchData = GatewayApplicationCommandModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#hello + */ +export interface GatewayHello extends NonDispatchPayload { + op: GatewayOpcodes.Hello; + d: GatewayHelloData; +} +/** + * https://discord.com/developers/docs/topics/gateway#hello + */ +export interface GatewayHelloData { + /** + * The interval (in milliseconds) the client should heartbeat with + */ + heartbeat_interval: number; +} +/** + * https://discord.com/developers/docs/topics/gateway#heartbeating + */ +export interface GatewayHeartbeatRequest extends NonDispatchPayload { + op: GatewayOpcodes.Heartbeat; + d: never; +} +/** + * https://discord.com/developers/docs/topics/gateway#heartbeating-example-gateway-heartbeat-ack + */ +export interface GatewayHeartbeatAck extends NonDispatchPayload { + op: GatewayOpcodes.HeartbeatAck; + d: never; +} +/** + * https://discord.com/developers/docs/topics/gateway#invalid-session + */ +export interface GatewayInvalidSession extends NonDispatchPayload { + op: GatewayOpcodes.InvalidSession; + d: GatewayInvalidSessionData; +} +/** + * https://discord.com/developers/docs/topics/gateway#invalid-session + */ +export declare type GatewayInvalidSessionData = boolean; +/** + * https://discord.com/developers/docs/topics/gateway#reconnect + */ +export interface GatewayReconnect extends NonDispatchPayload { + op: GatewayOpcodes.Reconnect; + d: never; +} +/** + * https://discord.com/developers/docs/topics/gateway#ready + */ +export declare type GatewayReadyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#ready + */ +export interface GatewayReadyDispatchData { + /** + * Gateway version + * + * See https://discord.com/developers/docs/topics/gateway#gateways-gateway-versions + */ + v: number; + /** + * Information about the user including email + * + * See https://discord.com/developers/docs/resources/user#user-object + */ + user: APIUser; + /** + * The guilds the user is in + * + * See https://discord.com/developers/docs/resources/guild#unavailable-guild-object + */ + guilds: APIUnavailableGuild[]; + /** + * Used for resuming connections + */ + session_id: string; + /** + * The shard information associated with this session, if sent when identifying + * + * See https://discord.com/developers/docs/topics/gateway#sharding + */ + shard?: [shard_id: number, shard_count: number]; + /** + * Contains `id` and `flags` + * + * See https://discord.com/developers/docs/resources/application#application-object + */ + application: Pick; +} +/** + * https://discord.com/developers/docs/topics/gateway#resumed + */ +export declare type GatewayResumedDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#channel-create + * https://discord.com/developers/docs/topics/gateway#channel-update + * https://discord.com/developers/docs/topics/gateway#channel-delete + */ +export declare type GatewayChannelModifyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#channel-create + * https://discord.com/developers/docs/topics/gateway#channel-update + * https://discord.com/developers/docs/topics/gateway#channel-delete + */ +export declare type GatewayChannelModifyDispatchData = APIChannel; +/** + * https://discord.com/developers/docs/topics/gateway#channel-create + */ +export declare type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#channel-create + */ +export declare type GatewayChannelCreateDispatchData = GatewayChannelModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#channel-update + */ +export declare type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#channel-update + */ +export declare type GatewayChannelUpdateDispatchData = GatewayChannelModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#channel-delete + */ +export declare type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#channel-delete + */ +export declare type GatewayChannelDeleteDispatchData = GatewayChannelModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#channel-pins-update + */ +export declare type GatewayChannelPinsUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#channel-pins-update + */ +export interface GatewayChannelPinsUpdateDispatchData { + /** + * The id of the guild + */ + guild_id?: Snowflake; + /** + * The id of the channel + */ + channel_id: Snowflake; + /** + * The time at which the most recent pinned message was pinned + */ + last_pin_timestamp?: string | null; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-create + * https://discord.com/developers/docs/topics/gateway#guild-update + */ +export declare type GatewayGuildModifyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-create + * https://discord.com/developers/docs/topics/gateway#guild-update + */ +export declare type GatewayGuildModifyDispatchData = APIGuild; +/** + * https://discord.com/developers/docs/topics/gateway#guild-create + */ +export declare type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-create + */ +export declare type GatewayGuildCreateDispatchData = GatewayGuildModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#guild-update + */ +export declare type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-update + */ +export declare type GatewayGuildUpdateDispatchData = GatewayGuildModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#guild-delete + */ +export declare type GatewayGuildDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-delete + */ +export declare type GatewayGuildDeleteDispatchData = APIUnavailableGuild; +/** + * https://discord.com/developers/docs/topics/gateway#guild-ban-add + * https://discord.com/developers/docs/topics/gateway#guild-ban-remove + */ +export declare type GatewayGuildBanModifyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-ban-add + * https://discord.com/developers/docs/topics/gateway#guild-ban-remove + */ +export interface GatewayGuildBanModifyDispatchData { + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * The banned user + * + * See https://discord.com/developers/docs/resources/user#user-object + */ + user: APIUser; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-ban-add + */ +export declare type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-ban-add + */ +export declare type GatewayGuildBanAddDispatchData = GatewayGuildBanModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#guild-ban-remove + */ +export declare type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-ban-remove + */ +export declare type GatewayGuildBanRemoveDispatchData = GatewayGuildBanModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#guild-emojis-update + */ +export declare type GatewayGuildEmojisUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-emojis-update + */ +export interface GatewayGuildEmojisUpdateDispatchData { + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * Array of emojis + * + * See https://discord.com/developers/docs/resources/emoji#emoji-object + */ + emojis: APIEmoji[]; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-stickers-update + */ +export declare type GatewayGuildStickersUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-stickers-update + */ +export interface GatewayGuildStickersUpdateDispatchData { + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * Array of stickers + * + * See https://discord.com/developers/docs/resources/sticker#sticker-object + */ + stickers: APISticker[]; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-integrations-update + */ +export declare type GatewayGuildIntegrationsUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-integrations-update + */ +export interface GatewayGuildIntegrationsUpdateDispatchData { + /** + * ID of the guild whose integrations were updated + */ + guild_id: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-add + */ +export declare type GatewayGuildMemberAddDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-add + */ +export interface GatewayGuildMemberAddDispatchData extends APIGuildMember { + /** + * The id of the guild + */ + guild_id: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-remove + */ +export declare type GatewayGuildMemberRemoveDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-remove + */ +export interface GatewayGuildMemberRemoveDispatchData { + /** + * The id of the guild + */ + guild_id: Snowflake; + /** + * The user who was removed + * + * See https://discord.com/developers/docs/resources/user#user-object + */ + user: APIUser; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-update + */ +export declare type GatewayGuildMemberUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-member-update + */ +export declare type GatewayGuildMemberUpdateDispatchData = Omit & Partial> & Required> & Nullable> & { + /** + * The id of the guild + */ + guild_id: Snowflake; +}; +/** + * https://discord.com/developers/docs/topics/gateway#guild-members-chunk + */ +export declare type GatewayGuildMembersChunkDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-members-chunk + */ +export interface GatewayGuildMembersChunkDispatchData { + /** + * The id of the guild + */ + guild_id: Snowflake; + /** + * Set of guild members + * + * See https://discord.com/developers/docs/resources/guild#guild-member-object + */ + members: APIGuildMember[]; + /** + * The chunk index in the expected chunks for this response (`0 <= chunk_index < chunk_count`) + */ + chunk_index?: number; + /** + * The total number of expected chunks for this response + */ + chunk_count?: number; + /** + * If passing an invalid id to `REQUEST_GUILD_MEMBERS`, it will be returned here + */ + not_found?: unknown[]; + /** + * If passing true to `REQUEST_GUILD_MEMBERS`, presences of the returned members will be here + * + * See https://discord.com/developers/docs/topics/gateway#presence + */ + presences?: RawGatewayPresenceUpdate[]; + /** + * The nonce used in the Guild Members Request + * + * See https://discord.com/developers/docs/topics/gateway#request-guild-members + */ + nonce?: string; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-create + * https://discord.com/developers/docs/topics/gateway#guild-role-update + */ +export declare type GatewayGuildRoleModifyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-create + * https://discord.com/developers/docs/topics/gateway#guild-role-update + */ +export interface GatewayGuildRoleModifyDispatchData { + /** + * The id of the guild + */ + guild_id: Snowflake; + /** + * The role created or updated + * + * See https://discord.com/developers/docs/topics/permissions#role-object + */ + role: APIRole; +} +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-create + */ +export declare type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-create + */ +export declare type GatewayGuildRoleCreateDispatchData = GatewayGuildRoleModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-update + */ +export declare type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-update + */ +export declare type GatewayGuildRoleUpdateDispatchData = GatewayGuildRoleModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-delete + */ +export declare type GatewayGuildRoleDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#guild-role-delete + */ +export interface GatewayGuildRoleDeleteDispatchData { + /** + * The id of the guild + */ + guild_id: Snowflake; + /** + * The id of the role + */ + role_id: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#integration-create + */ +export declare type GatewayIntegrationCreateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#integration-create + */ +export declare type GatewayIntegrationCreateDispatchData = APIGuildIntegration & { + guild_id: Snowflake; +}; +/** + * https://discord.com/developers/docs/topics/gateway#integration-update + */ +export declare type GatewayIntegrationUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#integration-update + */ +export declare type GatewayIntegrationUpdateDispatchData = APIGuildIntegration & { + guild_id: Snowflake; +}; +/** + * https://discord.com/developers/docs/topics/gateway#integration-update + */ +export declare type GatewayIntegrationDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#integration-delete + */ +export interface GatewayIntegrationDeleteDispatchData { + /** + * Integration id + */ + id: Snowflake; + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * ID of the bot/OAuth2 application for this Discord integration + */ + application_id?: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#interaction-create + */ +export declare type GatewayInteractionCreateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#interaction-create + */ +export declare type GatewayInteractionCreateDispatchData = APIApplicationCommandInteraction | APIMessageComponentInteraction; +/** + * https://discord.com/developers/docs/topics/gateway#invite-create + */ +export declare type GatewayInviteCreateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#invite-create + */ +export interface GatewayInviteCreateDispatchData { + /** + * The channel the invite is for + */ + channel_id: Snowflake; + /** + * The unique invite code + * + * See https://discord.com/developers/docs/resources/invite#invite-object + */ + code: string; + /** + * The time at which the invite was created + */ + created_at: number; + /** + * The guild of the invite + */ + guild_id?: Snowflake; + /** + * The user that created the invite + * + * See https://discord.com/developers/docs/resources/user#user-object + */ + inviter?: APIUser; + /** + * How long the invite is valid for (in seconds) + */ + max_age: number; + /** + * The maximum number of times the invite can be used + */ + max_uses: number; + /** + * The type of target for this voice channel invite + * + * See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types + */ + target_type?: InviteTargetType; + /** + * The user whose stream to display for this voice channel stream invite + * + * See https://discord.com/developers/docs/resources/user#user-object + */ + target_user?: APIUser; + /** + * The embedded application to open for this voice channel embedded application invite + */ + target_application?: Partial; + /** + * Whether or not the invite is temporary (invited users will be kicked on disconnect unless they're assigned a role) + */ + temporary: boolean; + /** + * How many times the invite has been used (always will be `0`) + */ + uses: 0; +} +/** + * https://discord.com/developers/docs/topics/gateway#invite-delete + */ +export declare type GatewayInviteDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#invite-delete + */ +export interface GatewayInviteDeleteDispatchData { + /** + * The channel of the invite + */ + channel_id: Snowflake; + /** + * The guild of the invite + */ + guild_id?: Snowflake; + /** + * The unique invite code + * + * See https://discord.com/developers/docs/resources/invite#invite-object + */ + code: string; +} +/** + * https://discord.com/developers/docs/topics/gateway#message-create + */ +export declare type GatewayMessageCreateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-create + */ +export declare type GatewayMessageCreateDispatchData = APIMessage; +/** + * https://discord.com/developers/docs/topics/gateway#message-update + */ +export declare type GatewayMessageUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-update + */ +export declare type GatewayMessageUpdateDispatchData = { + id: Snowflake; + channel_id: Snowflake; +} & Partial; +/** + * https://discord.com/developers/docs/topics/gateway#message-delete + */ +export declare type GatewayMessageDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-delete + */ +export interface GatewayMessageDeleteDispatchData { + /** + * The id of the message + */ + id: Snowflake; + /** + * The id of the channel + */ + channel_id: Snowflake; + /** + * The id of the guild + */ + guild_id?: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#message-delete-bulk + */ +export declare type GatewayMessageDeleteBulkDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-delete-bulk + */ +export interface GatewayMessageDeleteBulkDispatchData { + /** + * The ids of the messages + */ + ids: Snowflake[]; + /** + * The id of the channel + */ + channel_id: Snowflake; + /** + * The id of the guild + */ + guild_id?: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-add + */ +export declare type GatewayMessageReactionAddDispatch = ReactionData; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-add + */ +export declare type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d']; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove + */ +export declare type GatewayMessageReactionRemoveDispatch = ReactionData; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove + */ +export declare type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d']; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all + */ +export declare type GatewayMessageReactionRemoveAllDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all + */ +export declare type GatewayMessageReactionRemoveAllDispatchData = MessageReactionRemoveData; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji + */ +export declare type GatewayMessageReactionRemoveEmojiDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji + */ +export interface GatewayMessageReactionRemoveEmojiDispatchData extends MessageReactionRemoveData { + /** + * The emoji that was removed + */ + emoji: APIEmoji; +} +/** + * https://discord.com/developers/docs/topics/gateway#presence-update + */ +export declare type GatewayPresenceUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#presence-update + */ +export declare type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate; +/** + * https://discord.com/developers/docs/topics/gateway#stage-instance-create + */ +export declare type GatewayStageInstanceCreateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#stage-instance-create + */ +export declare type GatewayStageInstanceCreateDispatchData = APIStageInstance; +/** + * https://discord.com/developers/docs/topics/gateway#stage-instance-delete + */ +export declare type GatewayStageInstanceDeleteDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#stage-instance-delete + */ +export declare type GatewayStageInstanceDeleteDispatchData = APIStageInstance; +/** + * https://discord.com/developers/docs/topics/gateway#stage-instance-update + */ +export declare type GatewayStageInstanceUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#stage-instance-update + */ +export declare type GatewayStageInstanceUpdateDispatchData = APIStageInstance; +/** + * https://discord.com/developers/docs/topics/gateway#thread-list-sync + */ +export declare type GatewayThreadListSyncDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#thread-list-sync + */ +export declare type GatewayThreadListSyncDispatchData = RawGatewayThreadListSync; +/** + * https://discord.com/developers/docs/topics/gateway#thread-members-update + */ +export declare type GatewayThreadMembersUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#thread-members-update + */ +export declare type GatewayThreadMembersUpdateDispatchData = RawGatewayThreadMembersUpdate; +/** + * https://discord.com/developers/docs/topics/gateway#thread-member-update + */ +export declare type GatewayThreadMemberUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#thread-member-update + */ +export declare type GatewayThreadMemberUpdateDispatchData = APIThreadMember; +/** + * https://discord.com/developers/docs/topics/gateway#thread-create + * https://discord.com/developers/docs/topics/gateway#thread-update + * https://discord.com/developers/docs/topics/gateway#thread-delete + */ +export declare type GatewayThreadModifyDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#thread-create + */ +export declare type GatewayThreadCreateDispatch = GatewayChannelModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#thread-create + */ +export declare type GatewayThreadCreateDispatchData = GatewayChannelModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#thread-update + */ +export declare type GatewayThreadUpdateDispatch = GatewayChannelModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#thread-update + */ +export declare type GatewayThreadUpdateDispatchData = GatewayChannelModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#thread-delete + */ +export declare type GatewayThreadDeleteDispatch = GatewayChannelModifyDispatch; +/** + * https://discord.com/developers/docs/topics/gateway#thread-delete + */ +export declare type GatewayThreadDeleteDispatchData = GatewayChannelModifyDispatchData; +/** + * https://discord.com/developers/docs/topics/gateway#typing-start + */ +export declare type GatewayTypingStartDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#typing-start + */ +export interface GatewayTypingStartDispatchData { + /** + * The id of the channel + */ + channel_id: Snowflake; + /** + * The id of the guild + */ + guild_id?: Snowflake; + /** + * The id of the user + */ + user_id: Snowflake; + /** + * Unix time (in seconds) of when the user started typing + */ + timestamp: number; + /** + * The member who started typing if this happened in a guild + * + * See https://discord.com/developers/docs/resources/guild#guild-member-object + */ + member?: APIGuildMember; +} +/** + * https://discord.com/developers/docs/topics/gateway#user-update + */ +export declare type GatewayUserUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#user-update + */ +export declare type GatewayUserUpdateDispatchData = APIUser; +/** + * https://discord.com/developers/docs/topics/gateway#voice-state-update + */ +export declare type GatewayVoiceStateUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#voice-state-update + */ +export declare type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState; +/** + * https://discord.com/developers/docs/topics/gateway#voice-server-update + */ +export declare type GatewayVoiceServerUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#voice-server-update + */ +export interface GatewayVoiceServerUpdateDispatchData { + /** + * Voice connection token + */ + token: string; + /** + * The guild this voice server update is for + */ + guild_id: Snowflake; + /** + * The voice server host + * + * A `null` endpoint means that the voice server allocated has gone away and is trying to be reallocated. + * You should attempt to disconnect from the currently connected voice server, and not attempt to reconnect + * until a new voice server is allocated + */ + endpoint: string | null; +} +/** + * https://discord.com/developers/docs/topics/gateway#webhooks-update + */ +export declare type GatewayWebhooksUpdateDispatch = DataPayload; +/** + * https://discord.com/developers/docs/topics/gateway#webhooks-update + */ +export interface GatewayWebhooksUpdateDispatchData { + /** + * The id of the guild + */ + guild_id: Snowflake; + /** + * The id of the channel + */ + channel_id: Snowflake; +} +/** + * https://discord.com/developers/docs/topics/gateway#heartbeating + */ +export interface GatewayHeartbeat { + op: GatewayOpcodes.Heartbeat; + d: GatewayHeartbeatData; +} +/** + * https://discord.com/developers/docs/topics/gateway#heartbeating + */ +export declare type GatewayHeartbeatData = number | null; +/** + * https://discord.com/developers/docs/topics/gateway#identify + */ +export interface GatewayIdentify { + op: GatewayOpcodes.Identify; + d: GatewayIdentifyData; +} +/** + * https://discord.com/developers/docs/topics/gateway#identify + */ +export interface GatewayIdentifyData { + /** + * Authentication token + */ + token: string; + /** + * Connection properties + * + * See https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties + */ + properties: GatewayIdentifyProperties; + /** + * Whether this connection supports compression of packets + * + * @default false + */ + compress?: boolean; + /** + * Value between 50 and 250, total number of members where the gateway will stop sending + * offline members in the guild member list + * + * @default 50 + */ + large_threshold?: number; + /** + * Used for Guild Sharding + * + * See https://discord.com/developers/docs/topics/gateway#sharding + */ + shard?: [shard_id: number, shard_count: number]; + /** + * Presence structure for initial presence information + * + * See https://discord.com/developers/docs/topics/gateway#update-presence + */ + presence?: GatewayPresenceUpdateData; + /** + * The Gateway Intents you wish to receive + * + * See https://discord.com/developers/docs/topics/gateway#gateway-intents + */ + intents: number; +} +/** + * https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties + */ +export interface GatewayIdentifyProperties { + /** + * Your operating system + */ + $os: string; + /** + * Your library name + */ + $browser: string; + /** + * Your library name + */ + $device: string; +} +/** + * https://discord.com/developers/docs/topics/gateway#resume + */ +export interface GatewayResume { + op: GatewayOpcodes.Resume; + d: GatewayResumeData; +} +/** + * https://discord.com/developers/docs/topics/gateway#resume + */ +export interface GatewayResumeData { + /** + * Session token + */ + token: string; + /** + * Session id + */ + session_id: string; + /** + * Last sequence number received + */ + seq: number; +} +/** + * https://discord.com/developers/docs/topics/gateway#request-guild-members + */ +export interface GatewayRequestGuildMembers { + op: GatewayOpcodes.RequestGuildMembers; + d: GatewayRequestGuildMembersData; +} +/** + * https://discord.com/developers/docs/topics/gateway#request-guild-members + */ +export interface GatewayRequestGuildMembersData { + /** + * ID of the guild to get members for + */ + guild_id: Snowflake; + /** + * String that username starts with, or an empty string to return all members + */ + query?: string; + /** + * Maximum number of members to send matching the `query`; + * a limit of `0` can be used with an empty string `query` to return all members + */ + limit: number; + /** + * Used to specify if we want the presences of the matched members + */ + presences?: boolean; + /** + * Used to specify which users you wish to fetch + */ + user_ids?: Snowflake | Snowflake[]; + /** + * Nonce to identify the Guild Members Chunk response + * + * Nonce can only be up to 32 bytes. If you send an invalid nonce it will be ignored and the reply member_chunk(s) will not have a `nonce` set. + * + * See https://discord.com/developers/docs/topics/gateway#guild-members-chunk + */ + nonce?: string; +} +/** + * https://discord.com/developers/docs/topics/gateway#update-voice-state + */ +export interface GatewayVoiceStateUpdate { + op: GatewayOpcodes.VoiceStateUpdate; + d: GatewayVoiceStateUpdateData; +} +/** + * https://discord.com/developers/docs/topics/gateway#update-voice-state + */ +export interface GatewayVoiceStateUpdateData { + /** + * ID of the guild + */ + guild_id: Snowflake; + /** + * ID of the voice channel client wants to join (`null` if disconnecting) + */ + channel_id: Snowflake | null; + /** + * Is the client muted + */ + self_mute: boolean; + /** + * Is the client deafened + */ + self_deaf: boolean; +} +/** + * https://discord.com/developers/docs/topics/gateway#update-status + */ +export interface GatewayUpdatePresence { + op: GatewayOpcodes.PresenceUpdate; + d: GatewayPresenceUpdateData; +} +/** + * https://discord.com/developers/docs/topics/gateway#update-presence-gateway-presence-update-structure + */ +export interface GatewayPresenceUpdateData { + /** + * Unix time (in milliseconds) of when the client went idle, or `null` if the client is not idle + */ + since: number | null; + /** + * The user's activities + * + * See https://discord.com/developers/docs/topics/gateway#activity-object + */ + activities: GatewayActivityUpdateData[]; + /** + * The user's new status + * + * See https://discord.com/developers/docs/topics/gateway#update-presence-status-types + */ + status: PresenceUpdateStatus; + /** + * Whether or not the client is afk + */ + afk: boolean; +} +/** + * https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure + */ +export declare type GatewayActivityUpdateData = Pick; +interface BasePayload { + /** + * Opcode for the payload + */ + op: GatewayOpcodes; + /** + * Event data + */ + d?: unknown; + /** + * Sequence number, used for resuming sessions and heartbeats + */ + s: number; + /** + * The event name for this payload + */ + t?: string; +} +declare type NonDispatchPayload = Omit; +interface DataPayload extends BasePayload { + op: GatewayOpcodes.Dispatch; + t: Event; + d: D; +} +declare type ReactionData = DataPayload>; +interface MessageReactionRemoveData { + /** + * The id of the channel + */ + channel_id: Snowflake; + /** + * The id of the message + */ + message_id: Snowflake; + /** + * The id of the guild + */ + guild_id?: Snowflake; +} +//# sourceMappingURL=v9.d.ts.map \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/v9.d.ts.map b/node_modules/discord-api-types/gateway/v9.d.ts.map new file mode 100644 index 0000000..bc6289b --- /dev/null +++ b/node_modules/discord-api-types/gateway/v9.d.ts.map @@ -0,0 +1 @@ +{"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AED,aAAK,YAAY,CAAC,CAAC,SAAS,qBAAqB,EAAE,CAAC,SAAS,MAAM,GAAG,KAAK,IAAI,WAAW,CACzF,CAAC,EACD,IAAI,CACH;IACC;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;;;OAIG;IACH,KAAK,EAAE,QAAQ,CAAC;CAChB,EACD,CAAC,CACD,CACD,CAAC;AAEF,UAAU,yBAAyB;IAClC;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACrB"} \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/v9.js b/node_modules/discord-api-types/gateway/v9.js new file mode 100644 index 0000000..a677a51 --- /dev/null +++ b/node_modules/discord-api-types/gateway/v9.js @@ -0,0 +1,234 @@ +"use strict"; +/** + * Types extracted from https://discord.com/developers/docs/topics/gateway + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GatewayDispatchEvents = exports.GatewayIntentBits = exports.GatewayCloseCodes = exports.GatewayOpcodes = exports.GatewayVersion = void 0; +__exportStar(require("./common"), exports); +exports.GatewayVersion = '9'; +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes + */ +var GatewayOpcodes; +(function (GatewayOpcodes) { + /** + * An event was dispatched + */ + GatewayOpcodes[GatewayOpcodes["Dispatch"] = 0] = "Dispatch"; + /** + * A bidirectional opcode to maintain an active gateway connection. + * Fired periodically by the client, or fired by the gateway to request an immediate heartbeat from the client. + */ + GatewayOpcodes[GatewayOpcodes["Heartbeat"] = 1] = "Heartbeat"; + /** + * Starts a new session during the initial handshake + */ + GatewayOpcodes[GatewayOpcodes["Identify"] = 2] = "Identify"; + /** + * Update the client's presence + */ + GatewayOpcodes[GatewayOpcodes["PresenceUpdate"] = 3] = "PresenceUpdate"; + /** + * Used to join/leave or move between voice channels + */ + GatewayOpcodes[GatewayOpcodes["VoiceStateUpdate"] = 4] = "VoiceStateUpdate"; + /** + * Resume a previous session that was disconnected + */ + GatewayOpcodes[GatewayOpcodes["Resume"] = 6] = "Resume"; + /** + * You should attempt to reconnect and resume immediately + */ + GatewayOpcodes[GatewayOpcodes["Reconnect"] = 7] = "Reconnect"; + /** + * Request information about offline guild members in a large guild + */ + GatewayOpcodes[GatewayOpcodes["RequestGuildMembers"] = 8] = "RequestGuildMembers"; + /** + * The session has been invalidated. You should reconnect and identify/resume accordingly + */ + GatewayOpcodes[GatewayOpcodes["InvalidSession"] = 9] = "InvalidSession"; + /** + * Sent immediately after connecting, contains the `heartbeat_interval` to use + */ + GatewayOpcodes[GatewayOpcodes["Hello"] = 10] = "Hello"; + /** + * Sent in response to receiving a heartbeat to acknowledge that it has been received + */ + GatewayOpcodes[GatewayOpcodes["HeartbeatAck"] = 11] = "HeartbeatAck"; +})(GatewayOpcodes = exports.GatewayOpcodes || (exports.GatewayOpcodes = {})); +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes + */ +var GatewayCloseCodes; +(function (GatewayCloseCodes) { + /** + * We're not sure what went wrong. Try reconnecting? + */ + GatewayCloseCodes[GatewayCloseCodes["UnknownError"] = 4000] = "UnknownError"; + /** + * You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that! + * + * See https://discord.com/developers/docs/topics/gateway#payloads-and-opcodes + */ + GatewayCloseCodes[GatewayCloseCodes["UnknownOpcode"] = 4001] = "UnknownOpcode"; + /** + * You sent an invalid payload to us. Don't do that! + * + * See https://discord.com/developers/docs/topics/gateway#sending-payloads + */ + GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError"; + /** + * You sent us a payload prior to identifying + * + * See https://discord.com/developers/docs/topics/gateway#identify + */ + GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated"; + /** + * The account token sent with your identify payload is incorrect + * + * See https://discord.com/developers/docs/topics/gateway#identify + */ + GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed"; + /** + * You sent more than one identify payload. Don't do that! + */ + GatewayCloseCodes[GatewayCloseCodes["AlreadyAuthenticated"] = 4005] = "AlreadyAuthenticated"; + /** + * The sequence sent when resuming the session was invalid. Reconnect and start a new session + * + * See https://discord.com/developers/docs/topics/gateway#resume + */ + GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq"; + /** + * Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this + */ + GatewayCloseCodes[GatewayCloseCodes["RateLimited"] = 4008] = "RateLimited"; + /** + * Your session timed out. Reconnect and start a new one + */ + GatewayCloseCodes[GatewayCloseCodes["SessionTimedOut"] = 4009] = "SessionTimedOut"; + /** + * You sent us an invalid shard when identifying + * + * See https://discord.com/developers/docs/topics/gateway#sharding + */ + GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard"; + /** + * The session would have handled too many guilds - you are required to shard your connection in order to connect + * + * See https://discord.com/developers/docs/topics/gateway#sharding + */ + GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired"; + /** + * You sent an invalid version for the gateway + */ + GatewayCloseCodes[GatewayCloseCodes["InvalidAPIVersion"] = 4012] = "InvalidAPIVersion"; + /** + * You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value + * + * See https://discord.com/developers/docs/topics/gateway#gateway-intents + */ + GatewayCloseCodes[GatewayCloseCodes["InvalidIntents"] = 4013] = "InvalidIntents"; + /** + * You sent a disallowed intent for a Gateway Intent. You may have tried to specify an intent that you have not + * enabled or are not whitelisted for + * + * See https://discord.com/developers/docs/topics/gateway#gateway-intents + * + * See https://discord.com/developers/docs/topics/gateway#privileged-intents + */ + GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents"; +})(GatewayCloseCodes = exports.GatewayCloseCodes || (exports.GatewayCloseCodes = {})); +/** + * https://discord.com/developers/docs/topics/gateway#list-of-intents + */ +var GatewayIntentBits; +(function (GatewayIntentBits) { + GatewayIntentBits[GatewayIntentBits["Guilds"] = 1] = "Guilds"; + GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers"; + GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans"; + GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers"; + GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations"; + GatewayIntentBits[GatewayIntentBits["GuildWebhooks"] = 32] = "GuildWebhooks"; + GatewayIntentBits[GatewayIntentBits["GuildInvites"] = 64] = "GuildInvites"; + GatewayIntentBits[GatewayIntentBits["GuildVoiceStates"] = 128] = "GuildVoiceStates"; + GatewayIntentBits[GatewayIntentBits["GuildPresences"] = 256] = "GuildPresences"; + GatewayIntentBits[GatewayIntentBits["GuildMessages"] = 512] = "GuildMessages"; + GatewayIntentBits[GatewayIntentBits["GuildMessageReactions"] = 1024] = "GuildMessageReactions"; + GatewayIntentBits[GatewayIntentBits["GuildMessageTyping"] = 2048] = "GuildMessageTyping"; + GatewayIntentBits[GatewayIntentBits["DirectMessages"] = 4096] = "DirectMessages"; + GatewayIntentBits[GatewayIntentBits["DirectMessageReactions"] = 8192] = "DirectMessageReactions"; + GatewayIntentBits[GatewayIntentBits["DirectMessageTyping"] = 16384] = "DirectMessageTyping"; +})(GatewayIntentBits = exports.GatewayIntentBits || (exports.GatewayIntentBits = {})); +/** + * https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events + */ +var GatewayDispatchEvents; +(function (GatewayDispatchEvents) { + GatewayDispatchEvents["ApplicationCommandCreate"] = "APPLICATION_COMMAND_CREATE"; + GatewayDispatchEvents["ApplicationCommandDelete"] = "APPLICATION_COMMAND_DELETE"; + GatewayDispatchEvents["ApplicationCommandUpdate"] = "APPLICATION_COMMAND_UPDATE"; + GatewayDispatchEvents["ChannelCreate"] = "CHANNEL_CREATE"; + GatewayDispatchEvents["ChannelDelete"] = "CHANNEL_DELETE"; + GatewayDispatchEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE"; + GatewayDispatchEvents["ChannelUpdate"] = "CHANNEL_UPDATE"; + GatewayDispatchEvents["GuildBanAdd"] = "GUILD_BAN_ADD"; + GatewayDispatchEvents["GuildBanRemove"] = "GUILD_BAN_REMOVE"; + GatewayDispatchEvents["GuildCreate"] = "GUILD_CREATE"; + GatewayDispatchEvents["GuildDelete"] = "GUILD_DELETE"; + GatewayDispatchEvents["GuildEmojisUpdate"] = "GUILD_EMOJIS_UPDATE"; + GatewayDispatchEvents["GuildIntegrationsUpdate"] = "GUILD_INTEGRATIONS_UPDATE"; + GatewayDispatchEvents["GuildMemberAdd"] = "GUILD_MEMBER_ADD"; + GatewayDispatchEvents["GuildMemberRemove"] = "GUILD_MEMBER_REMOVE"; + GatewayDispatchEvents["GuildMembersChunk"] = "GUILD_MEMBERS_CHUNK"; + GatewayDispatchEvents["GuildMemberUpdate"] = "GUILD_MEMBER_UPDATE"; + GatewayDispatchEvents["GuildRoleCreate"] = "GUILD_ROLE_CREATE"; + GatewayDispatchEvents["GuildRoleDelete"] = "GUILD_ROLE_DELETE"; + GatewayDispatchEvents["GuildRoleUpdate"] = "GUILD_ROLE_UPDATE"; + GatewayDispatchEvents["GuildStickersUpdate"] = "GUILD_STICKERS_UPDATE"; + GatewayDispatchEvents["GuildUpdate"] = "GUILD_UPDATE"; + GatewayDispatchEvents["IntegrationCreate"] = "INTEGRATION_CREATE"; + GatewayDispatchEvents["IntegrationDelete"] = "INTEGRATION_DELETE"; + GatewayDispatchEvents["IntegrationUpdate"] = "INTEGRATION_UPDATE"; + GatewayDispatchEvents["InteractionCreate"] = "INTERACTION_CREATE"; + GatewayDispatchEvents["InviteCreate"] = "INVITE_CREATE"; + GatewayDispatchEvents["InviteDelete"] = "INVITE_DELETE"; + GatewayDispatchEvents["MessageCreate"] = "MESSAGE_CREATE"; + GatewayDispatchEvents["MessageDelete"] = "MESSAGE_DELETE"; + GatewayDispatchEvents["MessageDeleteBulk"] = "MESSAGE_DELETE_BULK"; + GatewayDispatchEvents["MessageReactionAdd"] = "MESSAGE_REACTION_ADD"; + GatewayDispatchEvents["MessageReactionRemove"] = "MESSAGE_REACTION_REMOVE"; + GatewayDispatchEvents["MessageReactionRemoveAll"] = "MESSAGE_REACTION_REMOVE_ALL"; + GatewayDispatchEvents["MessageReactionRemoveEmoji"] = "MESSAGE_REACTION_REMOVE_EMOJI"; + GatewayDispatchEvents["MessageUpdate"] = "MESSAGE_UPDATE"; + GatewayDispatchEvents["PresenceUpdate"] = "PRESENCE_UPDATE"; + GatewayDispatchEvents["StageInstanceCreate"] = "STAGE_INSTANCE_CREATE"; + GatewayDispatchEvents["StageInstanceDelete"] = "STAGE_INSTANCE_DELETE"; + GatewayDispatchEvents["StageInstanceUpdate"] = "STAGE_INSTANCE_UPDATE"; + GatewayDispatchEvents["Ready"] = "READY"; + GatewayDispatchEvents["Resumed"] = "RESUMED"; + GatewayDispatchEvents["ThreadCreate"] = "THREAD_CREATE"; + GatewayDispatchEvents["ThreadDelete"] = "THREAD_DELETE"; + GatewayDispatchEvents["ThreadListSync"] = "THREAD_LIST_SYNC"; + GatewayDispatchEvents["ThreadMembersUpdate"] = "THREAD_MEMBERS_UPDATE"; + GatewayDispatchEvents["ThreadMemberUpdate"] = "THREAD_MEMBER_UPDATE"; + GatewayDispatchEvents["ThreadUpdate"] = "THREAD_UPDATE"; + GatewayDispatchEvents["TypingStart"] = "TYPING_START"; + GatewayDispatchEvents["UserUpdate"] = "USER_UPDATE"; + GatewayDispatchEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE"; + GatewayDispatchEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE"; + GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE"; +})(GatewayDispatchEvents = exports.GatewayDispatchEvents || (exports.GatewayDispatchEvents = {})); +// #endregion Shared +//# sourceMappingURL=v9.js.map \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/v9.js.map b/node_modules/discord-api-types/gateway/v9.js.map new file mode 100644 index 0000000..ccc7617 --- /dev/null +++ b/node_modules/discord-api-types/gateway/v9.js.map @@ -0,0 +1 @@ +{"version":3,"file":"v9.js","sourceRoot":"","sources":["v9.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;AA8BH,2CAAyB;AAEZ,QAAA,cAAc,GAAG,GAAG,CAAC;AAElC;;GAEG;AACH,IAAkB,cA8CjB;AA9CD,WAAkB,cAAc;IAC/B;;OAEG;IACH,2DAAQ,CAAA;IACR;;;OAGG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,2DAAQ,CAAA;IACR;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,2EAAgB,CAAA;IAChB;;OAEG;IACH,uDAAU,CAAA;IACV;;OAEG;IACH,6DAAS,CAAA;IACT;;OAEG;IACH,iFAAmB,CAAA;IACnB;;OAEG;IACH,uEAAc,CAAA;IACd;;OAEG;IACH,sDAAK,CAAA;IACL;;OAEG;IACH,oEAAY,CAAA;AACb,CAAC,EA9CiB,cAAc,GAAd,sBAAc,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C,yDAAgC,CAAA;IAChC,sDAA6B,CAAA;IAC7B,4DAAmC,CAAA;IACnC,qDAA4B,CAAA;IAC5B,qDAA4B,CAAA;IAC5B,kEAAyC,CAAA;IACzC,8EAAqD,CAAA;IACrD,4DAAmC,CAAA;IACnC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,kEAAyC,CAAA;IACzC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,8DAAqC,CAAA;IACrC,sEAA6C,CAAA;IAC7C,qDAA4B,CAAA;IAC5B,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,oEAA2C,CAAA;IAC3C,0EAAiD,CAAA;IACjD,iFAAwD,CAAA;IACxD,qFAA4D,CAAA;IAC5D,yDAAgC,CAAA;IAChC,2DAAkC,CAAA;IAClC,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,4DAAmC,CAAA;IACnC,sEAA6C,CAAA;IAC7C,oEAA2C,CAAA;IAC3C,uDAA8B,CAAA;IAC9B,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,kEAAyC,CAAA;IACzC,gEAAuC,CAAA;IACvC,2DAAkC,CAAA;AACnC,CAAC,EAtDiB,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAsDtC;AA47CD,oBAAoB"} \ No newline at end of file diff --git a/node_modules/discord-api-types/gateway/v9.mjs b/node_modules/discord-api-types/gateway/v9.mjs new file mode 100644 index 0000000..27b1baf --- /dev/null +++ b/node_modules/discord-api-types/gateway/v9.mjs @@ -0,0 +1,8 @@ +import mod from "./v9.js"; + +export default mod; +export const GatewayCloseCodes = mod.GatewayCloseCodes; +export const GatewayDispatchEvents = mod.GatewayDispatchEvents; +export const GatewayIntentBits = mod.GatewayIntentBits; +export const GatewayOpcodes = mod.GatewayOpcodes; +export const GatewayVersion = mod.GatewayVersion; diff --git a/node_modules/discord-api-types/globals.d.ts b/node_modules/discord-api-types/globals.d.ts new file mode 100644 index 0000000..d821e73 --- /dev/null +++ b/node_modules/discord-api-types/globals.d.ts @@ -0,0 +1,81 @@ +/** + * https://discord.com/developers/docs/reference#snowflakes + */ +export declare type Snowflake = string; +/** + * https://discord.com/developers/docs/topics/permissions + * @internal + */ +export declare type Permissions = string; +/** + * https://discord.com/developers/docs/reference#message-formatting-formats + */ +export declare const FormattingPatterns: { + /** + * Regular expression for matching a user mention, strictly without a nickname + * + * The `id` group property is present on the `exec` result of this expression + */ + readonly User: RegExp; + /** + * Regular expression for matching a user mention, strictly with a nickname + * + * The `id` group property is present on the `exec` result of this expression + */ + readonly UserWithNickname: RegExp; + /** + * Regular expression for matching a user mention, with or without a nickname + * + * The `id` group property is present on the `exec` result of this expression + */ + readonly UserWithOptionalNickname: RegExp; + /** + * Regular expression for matching a channel mention + * + * The `id` group property is present on the `exec` result of this expression + */ + readonly Channel: RegExp; + /** + * Regular expression for matching a role mention + * + * The `id` group property is present on the `exec` result of this expression + */ + readonly Role: RegExp; + /** + * Regular expression for matching a custom emoji, either static or animated + * + * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression + */ + readonly Emoji: RegExp; + /** + * Regular expression for matching strictly an animated custom emoji + * + * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression + */ + readonly AnimatedEmoji: RegExp; + /** + * Regular expression for matching strictly a static custom emoji + * + * The `name` and `id` group properties are present on the `exec` result of this expression + */ + readonly StaticEmoji: RegExp; + /** + * Regular expression for matching a timestamp, either default or custom styled + * + * The `timestamp` and `style` group properties are present on the `exec` result of this expression + */ + readonly Timestamp: RegExp; + /** + * Regular expression for matching strictly default styled timestamps + * + * The `timestamp` group property is present on the `exec` result of this expression + */ + readonly DefaultStyledTimestamp: RegExp; + /** + * Regular expression for matching strictly custom styled timestamps + * + * The `timestamp` and `style` group properties are present on the `exec` result of this expression + */ + readonly StyledTimestamp: RegExp; +}; +//# sourceMappingURL=globals.d.ts.map \ No newline at end of file diff --git a/node_modules/discord-api-types/globals.d.ts.map b/node_modules/discord-api-types/globals.d.ts.map new file mode 100644 index 0000000..505ffb2 --- /dev/null +++ b/node_modules/discord-api-types/globals.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["globals.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,SAAS,GAAG,MAAM,CAAC;AAE/B;;;GAGG;AACH,oBAAY,WAAW,GAAG,MAAM,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,kBAAkB;IAC9B;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;CAEM,CAAC"} \ No newline at end of file diff --git a/node_modules/discord-api-types/globals.js b/node_modules/discord-api-types/globals.js new file mode 100644 index 0000000..3cae1b8 --- /dev/null +++ b/node_modules/discord-api-types/globals.js @@ -0,0 +1,80 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.FormattingPatterns = void 0; +/** + * https://discord.com/developers/docs/reference#message-formatting-formats + */ +exports.FormattingPatterns = { + /** + * Regular expression for matching a user mention, strictly without a nickname + * + * The `id` group property is present on the `exec` result of this expression + */ + User: /<@(?\d{17,20})>/, + /** + * Regular expression for matching a user mention, strictly with a nickname + * + * The `id` group property is present on the `exec` result of this expression + */ + UserWithNickname: /<@!(?\d{17,20})>/, + /** + * Regular expression for matching a user mention, with or without a nickname + * + * The `id` group property is present on the `exec` result of this expression + */ + UserWithOptionalNickname: /<@!?(?\d{17,20})>/, + /** + * Regular expression for matching a channel mention + * + * The `id` group property is present on the `exec` result of this expression + */ + Channel: /<#(?\d{17,20})>/, + /** + * Regular expression for matching a role mention + * + * The `id` group property is present on the `exec` result of this expression + */ + Role: /<@&(?\d{17,20})>/, + /** + * Regular expression for matching a custom emoji, either static or animated + * + * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression + */ + Emoji: /<(?a)?:(?\w{2,32}):(?\d{17,20})>/, + /** + * Regular expression for matching strictly an animated custom emoji + * + * The `animated`, `name` and `id` group properties are present on the `exec` result of this expression + */ + AnimatedEmoji: /<(?a):(?\w{2,32}):(?\d{17,20})>/, + /** + * Regular expression for matching strictly a static custom emoji + * + * The `name` and `id` group properties are present on the `exec` result of this expression + */ + StaticEmoji: /<:(?\w{2,32}):(?\d{17,20})>/, + /** + * Regular expression for matching a timestamp, either default or custom styled + * + * The `timestamp` and `style` group properties are present on the `exec` result of this expression + */ + Timestamp: /-?\d{1,13})(:(?