This commit is contained in:
Bxio 2025-05-04 21:32:46 +01:00
parent 840a9de55f
commit 628f65ab0f
485 changed files with 14200 additions and 4870 deletions

109
node_modules/.package-lock.json generated vendored
View File

@ -4,33 +4,33 @@
"requires": true, "requires": true,
"packages": { "packages": {
"node_modules/@clack/core": { "node_modules/@clack/core": {
"version": "0.4.1", "version": "0.4.2",
"resolved": "https://registry.npmjs.org/@clack/core/-/core-0.4.1.tgz", "resolved": "https://registry.npmjs.org/@clack/core/-/core-0.4.2.tgz",
"integrity": "sha512-Pxhij4UXg8KSr7rPek6Zowm+5M22rbd2g1nfojHJkxp5YkFqiZ2+YLEM/XGVIzvGOcM0nqjIFxrpDwWRZYWYjA==", "integrity": "sha512-NYQfcEy8MWIxrT5Fj8nIVchfRFA26yYKJcvBS7WlUIlw2OmQOY9DhGGXMovyI5J5PpxrCPGkgUi207EBrjpBvg==",
"dependencies": { "dependencies": {
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"sisteransi": "^1.0.5" "sisteransi": "^1.0.5"
} }
}, },
"node_modules/@clack/prompts": { "node_modules/@clack/prompts": {
"version": "0.10.0", "version": "0.10.1",
"resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-0.10.0.tgz", "resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-0.10.1.tgz",
"integrity": "sha512-H3rCl6CwW1NdQt9rE3n373t7o5cthPv7yUoxF2ytZvyvlJv89C5RYMJu83Hed8ODgys5vpBU0GKxIRG83jd8NQ==", "integrity": "sha512-Q0T02vx8ZM9XSv9/Yde0jTmmBQufZhPJfYAg2XrrrxWWaZgq1rr8nU8Hv710BQ1dhoP8rtY7YUdpGej2Qza/cw==",
"dependencies": { "dependencies": {
"@clack/core": "0.4.1", "@clack/core": "0.4.2",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"sisteransi": "^1.0.5" "sisteransi": "^1.0.5"
} }
}, },
"node_modules/@discordjs/builders": { "node_modules/@discordjs/builders": {
"version": "1.10.1", "version": "1.11.2",
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.10.1.tgz", "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.11.2.tgz",
"integrity": "sha512-OWo1fY4ztL1/M/DUyRPShB4d/EzVfuUvPTRRHRIt/YxBrUYSz0a+JicD5F5zHFoNs2oTuWavxCOVFV1UljHTng==", "integrity": "sha512-F1WTABdd8/R9D1icJzajC4IuLyyS8f3rTOz66JsSI3pKvpCAtsMBweu8cyNYsIyvcrKAVn9EPK+Psoymq+XC0A==",
"dependencies": { "dependencies": {
"@discordjs/formatters": "^0.6.0", "@discordjs/formatters": "^0.6.1",
"@discordjs/util": "^1.1.1", "@discordjs/util": "^1.1.1",
"@sapphire/shapeshift": "^4.0.0", "@sapphire/shapeshift": "^4.0.0",
"discord-api-types": "^0.37.119", "discord-api-types": "^0.38.1",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"ts-mixer": "^6.0.4", "ts-mixer": "^6.0.4",
"tslib": "^2.6.3" "tslib": "^2.6.3"
@ -51,11 +51,11 @@
} }
}, },
"node_modules/@discordjs/formatters": { "node_modules/@discordjs/formatters": {
"version": "0.6.0", "version": "0.6.1",
"resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.6.0.tgz", "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.6.1.tgz",
"integrity": "sha512-YIruKw4UILt/ivO4uISmrGq2GdMY6EkoTtD0oS0GvkJFRZbTSdPhzYiUILbJ/QslsvC9H9nTgGgnarnIl4jMfw==", "integrity": "sha512-5cnX+tASiPCqCWtFcFslxBVUaCetB0thvM/JyavhbXInP1HJIEU+Qv/zMrnuwSsX3yWH2lVXNJZeDK3EiP4HHg==",
"dependencies": { "dependencies": {
"discord-api-types": "^0.37.114" "discord-api-types": "^0.38.1"
}, },
"engines": { "engines": {
"node": ">=16.11.0" "node": ">=16.11.0"
@ -65,16 +65,16 @@
} }
}, },
"node_modules/@discordjs/rest": { "node_modules/@discordjs/rest": {
"version": "2.4.3", "version": "2.5.0",
"resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.4.3.tgz", "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.5.0.tgz",
"integrity": "sha512-+SO4RKvWsM+y8uFHgYQrcTl/3+cY02uQOH7/7bKbVZsTfrfpoE62o5p+mmV+s7FVhTX82/kQUGGbu4YlV60RtA==", "integrity": "sha512-PWhchxTzpn9EV3vvPRpwS0EE2rNYB9pvzDU/eLLW3mByJl0ZHZjHI2/wA8EbH2gRMQV7nu+0FoDF84oiPl8VAQ==",
"dependencies": { "dependencies": {
"@discordjs/collection": "^2.1.1", "@discordjs/collection": "^2.1.1",
"@discordjs/util": "^1.1.1", "@discordjs/util": "^1.1.1",
"@sapphire/async-queue": "^1.5.3", "@sapphire/async-queue": "^1.5.3",
"@sapphire/snowflake": "^3.5.3", "@sapphire/snowflake": "^3.5.3",
"@vladfrangu/async_event_emitter": "^2.4.6", "@vladfrangu/async_event_emitter": "^2.4.6",
"discord-api-types": "^0.37.119", "discord-api-types": "^0.38.1",
"magic-bytes.js": "^1.10.0", "magic-bytes.js": "^1.10.0",
"tslib": "^2.6.3", "tslib": "^2.6.3",
"undici": "6.21.1" "undici": "6.21.1"
@ -109,17 +109,17 @@
} }
}, },
"node_modules/@discordjs/ws": { "node_modules/@discordjs/ws": {
"version": "1.2.1", "version": "1.2.2",
"resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.2.1.tgz", "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.2.2.tgz",
"integrity": "sha512-PBvenhZG56a6tMWF/f4P6f4GxZKJTBG95n7aiGSPTnodmz4N5g60t79rSIAq7ywMbv8A4jFtexMruH+oe51aQQ==", "integrity": "sha512-dyfq7yn0wO0IYeYOs3z79I6/HumhmKISzFL0Z+007zQJMtAFGtt3AEoq1nuLXtcunUE5YYYQqgKvybXukAK8/w==",
"dependencies": { "dependencies": {
"@discordjs/collection": "^2.1.0", "@discordjs/collection": "^2.1.0",
"@discordjs/rest": "^2.4.3", "@discordjs/rest": "^2.5.0",
"@discordjs/util": "^1.1.0", "@discordjs/util": "^1.1.0",
"@sapphire/async-queue": "^1.5.2", "@sapphire/async-queue": "^1.5.2",
"@types/ws": "^8.5.10", "@types/ws": "^8.5.10",
"@vladfrangu/async_event_emitter": "^2.2.4", "@vladfrangu/async_event_emitter": "^2.2.4",
"discord-api-types": "^0.37.119", "discord-api-types": "^0.38.1",
"tslib": "^2.6.2", "tslib": "^2.6.2",
"ws": "^8.17.0" "ws": "^8.17.0"
}, },
@ -172,9 +172,9 @@
} }
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "22.14.0", "version": "22.15.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.0.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.3.tgz",
"integrity": "sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==", "integrity": "sha512-lX7HFZeHf4QG/J7tBZqrCAXwz9J5RD56Y6MpP0eJkka8p+K0RY/yBTW7CYFJ4VGCclxqOLKmiGP5juQc6MKgcw==",
"dependencies": { "dependencies": {
"undici-types": "~6.21.0" "undici-types": "~6.21.0"
} }
@ -246,9 +246,9 @@
} }
}, },
"node_modules/axios": { "node_modules/axios": {
"version": "1.8.4", "version": "1.9.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.8.4.tgz", "resolved": "https://registry.npmjs.org/axios/-/axios-1.9.0.tgz",
"integrity": "sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==", "integrity": "sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==",
"dependencies": { "dependencies": {
"follow-redirects": "^1.15.6", "follow-redirects": "^1.15.6",
"form-data": "^4.0.0", "form-data": "^4.0.0",
@ -484,25 +484,26 @@
} }
}, },
"node_modules/discord-api-types": { "node_modules/discord-api-types": {
"version": "0.37.119", "version": "0.38.2",
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.37.119.tgz", "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.38.2.tgz",
"integrity": "sha512-WasbGFXEB+VQWXlo6IpW3oUv73Yuau1Ig4AZF/m13tXcTKnMpc/mHjpztIlz4+BM9FG9BHQkEXiPto3bKduQUg==" "integrity": "sha512-GAPY1/Kv3aqEoBYgUYXB2tHdWJCZXfytlCzxZ4QMQ1/TIQn1JI+xUOukehl4iEa9m7fCURnMIOpOxpaTWqzX2w=="
}, },
"node_modules/discord.js": { "node_modules/discord.js": {
"version": "14.18.0", "version": "14.19.3",
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.18.0.tgz", "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.19.3.tgz",
"integrity": "sha512-SvU5kVUvwunQhN2/+0t55QW/1EHfB1lp0TtLZUSXVHDmyHTrdOj5LRKdR0zLcybaA15F+NtdWuWmGOX9lE+CAw==", "integrity": "sha512-lncTRk0k+8Q5D3nThnODBR8fR8x2fM798o8Vsr40Krx0DjPwpZCuxxTcFMrXMQVOqM1QB9wqWgaXPg3TbmlHqA==",
"dependencies": { "dependencies": {
"@discordjs/builders": "^1.10.1", "@discordjs/builders": "^1.11.2",
"@discordjs/collection": "1.5.3", "@discordjs/collection": "1.5.3",
"@discordjs/formatters": "^0.6.0", "@discordjs/formatters": "^0.6.1",
"@discordjs/rest": "^2.4.3", "@discordjs/rest": "^2.5.0",
"@discordjs/util": "^1.1.1", "@discordjs/util": "^1.1.1",
"@discordjs/ws": "^1.2.1", "@discordjs/ws": "^1.2.2",
"@sapphire/snowflake": "3.5.3", "@sapphire/snowflake": "3.5.3",
"discord-api-types": "^0.37.119", "discord-api-types": "^0.38.1",
"fast-deep-equal": "3.1.3", "fast-deep-equal": "3.1.3",
"lodash.snakecase": "4.1.1", "lodash.snakecase": "4.1.1",
"magic-bytes.js": "^1.10.0",
"tslib": "^2.6.3", "tslib": "^2.6.3",
"undici": "6.21.1" "undici": "6.21.1"
}, },
@ -899,9 +900,9 @@
"integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==" "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw=="
}, },
"node_modules/long": { "node_modules/long": {
"version": "5.3.1", "version": "5.3.2",
"resolved": "https://registry.npmjs.org/long/-/long-5.3.1.tgz", "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",
"integrity": "sha512-ka87Jz3gcx/I7Hal94xaN2tZEOPoUOEVftkQqZx2EeQRN7LGdfLlI3FvZ+7WDplm+vK2Urx9ULrvSowtdCieng==" "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA=="
}, },
"node_modules/lru-cache": { "node_modules/lru-cache": {
"version": "7.18.3", "version": "7.18.3",
@ -926,9 +927,9 @@
} }
}, },
"node_modules/magic-bytes.js": { "node_modules/magic-bytes.js": {
"version": "1.10.0", "version": "1.12.1",
"resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.10.0.tgz", "resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.12.1.tgz",
"integrity": "sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ==" "integrity": "sha512-ThQLOhN86ZkJ7qemtVRGYM+gRgR8GEXNli9H/PMvpnZsE44Xfh3wx9kGJaldg314v85m+bFW6WBMaVHJc/c3zA=="
}, },
"node_modules/math-intrinsics": { "node_modules/math-intrinsics": {
"version": "1.1.0", "version": "1.1.0",
@ -1057,9 +1058,9 @@
} }
}, },
"node_modules/mysql2": { "node_modules/mysql2": {
"version": "3.14.0", "version": "3.14.1",
"resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.14.0.tgz", "resolved": "https://registry.npmjs.org/mysql2/-/mysql2-3.14.1.tgz",
"integrity": "sha512-8eMhmG6gt/hRkU1G+8KlGOdQi2w+CgtNoD1ksXZq9gQfkfDsX4LHaBwTe1SY0Imx//t2iZA03DFnyYKPinxSRw==", "integrity": "sha512-7ytuPQJjQB8TNAYX/H2yhL+iQOnIBjAMam361R7UAL0lOVXWjtdrmoL9HYKqKoLp/8UUTRcvo1QPvK9KL7wA8w==",
"dependencies": { "dependencies": {
"aws-ssl-profiles": "^1.1.1", "aws-ssl-profiles": "^1.1.1",
"denque": "^2.1.0", "denque": "^2.1.0",
@ -1543,9 +1544,9 @@
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
}, },
"node_modules/ws": { "node_modules/ws": {
"version": "8.18.1", "version": "8.18.2",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.1.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.2.tgz",
"integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==", "integrity": "sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==",
"engines": { "engines": {
"node": ">=10.0.0" "node": ">=10.0.0"
}, },

View File

@ -1,5 +1,13 @@
# @clack/core # @clack/core
## 0.4.2
### Patch Changes
- 30aa7ed: Adds a new `selectableGroups` boolean to the group multi-select prompt. Using `selectableGroups: false` will disable the ability to select a top-level group, but still allow every child to be selected individually.
- 5dfce8a: Fixes an edge case for placeholder values. Previously, when pressing `enter` on an empty prompt, placeholder values would be ignored. Now, placeholder values are treated as the prompt value.
- f574297: Fix "TTY initialization failed: uv_tty_init returned EBADF (bad file descriptor)" error happening on Windows for non-tty terminals.
## 0.4.1 ## 0.4.1
### Patch Changes ### Patch Changes

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -111,10 +111,12 @@ interface GroupMultiSelectOptions<T extends {
initialValues?: T['value'][]; initialValues?: T['value'][];
required?: boolean; required?: boolean;
cursorAt?: T['value']; cursorAt?: T['value'];
selectableGroups?: boolean;
} }
declare class GroupMultiSelectPrompt<T extends { declare class GroupMultiSelectPrompt<T extends {
value: any; value: any;
}> extends Prompt { }> extends Prompt {
#private;
options: (T & { options: (T & {
group: string | boolean; group: string | boolean;
})[]; })[];

View File

@ -111,10 +111,12 @@ interface GroupMultiSelectOptions<T extends {
initialValues?: T['value'][]; initialValues?: T['value'][];
required?: boolean; required?: boolean;
cursorAt?: T['value']; cursorAt?: T['value'];
selectableGroups?: boolean;
} }
declare class GroupMultiSelectPrompt<T extends { declare class GroupMultiSelectPrompt<T extends {
value: any; value: any;
}> extends Prompt { }> extends Prompt {
#private;
options: (T & { options: (T & {
group: string | boolean; group: string | boolean;
})[]; })[];

View File

@ -111,10 +111,12 @@ interface GroupMultiSelectOptions<T extends {
initialValues?: T['value'][]; initialValues?: T['value'][];
required?: boolean; required?: boolean;
cursorAt?: T['value']; cursorAt?: T['value'];
selectableGroups?: boolean;
} }
declare class GroupMultiSelectPrompt<T extends { declare class GroupMultiSelectPrompt<T extends {
value: any; value: any;
}> extends Prompt { }> extends Prompt {
#private;
options: (T & { options: (T & {
group: string | boolean; group: string | boolean;
})[]; })[];

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "@clack/core", "name": "@clack/core",
"version": "0.4.1", "version": "0.4.2",
"type": "module", "type": "module",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",
"module": "./dist/index.mjs", "module": "./dist/index.mjs",
@ -15,13 +15,13 @@
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/natemoo-re/clack", "url": "git+https://github.com/bombshell-dev/clack.git",
"directory": "packages/core" "directory": "packages/core"
}, },
"bugs": { "bugs": {
"url": "https://github.com/natemoo-re/clack/issues" "url": "https://github.com/bombshell-dev/clack/issues"
}, },
"homepage": "https://github.com/natemoo-re/clack/tree/main/packages/core#readme", "homepage": "https://github.com/bombshell-dev/clack/tree/main/packages/core#readme",
"files": [ "files": [
"dist", "dist",
"CHANGELOG.md" "CHANGELOG.md"

View File

@ -1,5 +1,16 @@
# @clack/prompts # @clack/prompts
## 0.10.1
### Patch Changes
- 11a5dc1: Fixes multiselect only shows hints on the first item in the options list. Now correctly shows hints for all selected options with hint property.
- 30aa7ed: Adds a new `selectableGroups` boolean to the group multi-select prompt. Using `selectableGroups: false` will disable the ability to select a top-level group, but still allow every child to be selected individually.
- Updated dependencies [30aa7ed]
- Updated dependencies [5dfce8a]
- Updated dependencies [f574297]
- @clack/core@0.4.2
## 0.10.0 ## 0.10.0
### Minor Changes ### Minor Changes

View File

@ -2,7 +2,7 @@
Effortlessly build beautiful command-line apps 🪄 [Try the demo](https://stackblitz.com/edit/clack-prompts?file=index.js) Effortlessly build beautiful command-line apps 🪄 [Try the demo](https://stackblitz.com/edit/clack-prompts?file=index.js)
![clack-prompt](https://github.com/natemoo-re/clack/blob/main/.github/assets/clack-demo.gif) ![clack-prompt](https://github.com/bombshell-dev/clack/blob/main/.github/assets/clack-demo.gif)
--- ---
@ -204,4 +204,4 @@ stream.error((function *() { yield 'Error!'; })());
stream.message((function *() { yield 'Hello'; yield ", World" })(), { symbol: color.cyan('~') }); stream.message((function *() { yield 'Hello'; yield ", World" })(), { symbol: color.cyan('~') });
``` ```
[clack-log-prompts](https://github.com/natemoo-re/clack/blob/main/.github/assets/clack-logs.png) ![clack-log-prompts](https://github.com/bombshell-dev/clack/blob/main/.github/assets/clack-logs.png)

View File

@ -1,87 +1,87 @@
"use strict";const node_util=require("node:util"),core=require("@clack/core"),process$1=require("node:process"),e=require("picocolors"),sisteransi=require("sisteransi");function _interopDefaultCompat(t){return t&&typeof t=="object"&&"default"in t?t.default:t}const process__default=_interopDefaultCompat(process$1),e__default=_interopDefaultCompat(e);function isUnicodeSupported(){return process__default.platform!=="win32"?process__default.env.TERM!=="linux":!!process__default.env.CI||!!process__default.env.WT_SESSION||!!process__default.env.TERMINUS_SUBLIME||process__default.env.ConEmuTask==="{cmd::Cmder}"||process__default.env.TERM_PROGRAM==="Terminus-Sublime"||process__default.env.TERM_PROGRAM==="vscode"||process__default.env.TERM==="xterm-256color"||process__default.env.TERM==="alacritty"||process__default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const P=isUnicodeSupported(),u=(t,o)=>P?t:o,ie=u("\u25C6","*"),L=u("\u25A0","x"),G=u("\u25B2","x"),S=u("\u25C7","o"),ae=u("\u250C","T"),a=u("\u2502","|"),d=u("\u2514","\u2014"),_=u("\u25CF",">"),A=u("\u25CB"," "),C=u("\u25FB","[\u2022]"),V=u("\u25FC","[+]"),N=u("\u25FB","[ ]"),oe=u("\u25AA","\u2022"),j=u("\u2500","-"),le=u("\u256E","+"),ce=u("\u251C","+"),ue=u("\u256F","+"),B=u("\u25CF","\u2022"),W=u("\u25C6","*"),H=u("\u25B2","!"),q=u("\u25A0","x"),v=t=>{switch(t){case"initial":case"active":return e__default.cyan(ie);case"cancel":return e__default.red(L);case"error":return e__default.yellow(G);case"submit":return e__default.green(S)}},E=t=>{const{cursor:o,options:s,style:r}=t,i=t.maxItems??Number.POSITIVE_INFINITY,n=Math.max(process.stdout.rows-4,0),c=Math.min(n,Math.max(i,5));let l=0;o>=l+c-3?l=Math.max(Math.min(o-c+3,s.length-c),0):o<l+2&&(l=Math.max(o-2,0));const $=c<s.length&&l>0,p=c<s.length&&l+c<s.length;return s.slice(l,l+c).map((w,y,f)=>{const x=y===0&&$,M=y===f.length-1&&p;return x||M?e__default.dim("..."):r(w,y+l===o)})},text=t=>new core.TextPrompt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){const o=`${e__default.gray(a)} "use strict";const node_util=require("node:util"),core=require("@clack/core"),process$1=require("node:process"),e=require("picocolors"),sisteransi=require("sisteransi");function _interopDefaultCompat(t){return t&&typeof t=="object"&&"default"in t?t.default:t}const process__default=_interopDefaultCompat(process$1),e__default=_interopDefaultCompat(e);function isUnicodeSupported(){return process__default.platform!=="win32"?process__default.env.TERM!=="linux":!!process__default.env.CI||!!process__default.env.WT_SESSION||!!process__default.env.TERMINUS_SUBLIME||process__default.env.ConEmuTask==="{cmd::Cmder}"||process__default.env.TERM_PROGRAM==="Terminus-Sublime"||process__default.env.TERM_PROGRAM==="vscode"||process__default.env.TERM==="xterm-256color"||process__default.env.TERM==="alacritty"||process__default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const P=isUnicodeSupported(),u=(t,o)=>P?t:o,ie=u("\u25C6","*"),G=u("\u25A0","x"),L=u("\u25B2","x"),S=u("\u25C7","o"),ae=u("\u250C","T"),a=u("\u2502","|"),g=u("\u2514","\u2014"),_=u("\u25CF",">"),A=u("\u25CB"," "),C=u("\u25FB","[\u2022]"),V=u("\u25FC","[+]"),N=u("\u25FB","[ ]"),oe=u("\u25AA","\u2022"),j=u("\u2500","-"),le=u("\u256E","+"),ce=u("\u251C","+"),ue=u("\u256F","+"),B=u("\u25CF","\u2022"),W=u("\u25C6","*"),H=u("\u25B2","!"),q=u("\u25A0","x"),b=t=>{switch(t){case"initial":case"active":return e__default.cyan(ie);case"cancel":return e__default.red(G);case"error":return e__default.yellow(L);case"submit":return e__default.green(S)}},E=t=>{const{cursor:o,options:s,style:i}=t,r=t.maxItems??Number.POSITIVE_INFINITY,c=Math.max(process.stdout.rows-4,0),n=Math.min(c,Math.max(r,5));let l=0;o>=l+n-3?l=Math.max(Math.min(o-n+3,s.length-n),0):o<l+2&&(l=Math.max(o-2,0));const $=n<s.length&&l>0,h=n<s.length&&l+n<s.length;return s.slice(l,l+n).map((m,y,w)=>{const x=y===0&&$,M=y===w.length-1&&h;return x||M?e__default.dim("..."):i(m,y+l===o)})},text=t=>new core.TextPrompt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){const o=`${e__default.gray(a)}
${v(this.state)} ${t.message} ${b(this.state)} ${t.message}
`,s=t.placeholder?e__default.inverse(t.placeholder[0])+e__default.dim(t.placeholder.slice(1)):e__default.inverse(e__default.hidden("_")),r=this.value?this.valueWithCursor:s;switch(this.state){case"error":return`${o.trim()} `,s=t.placeholder?e__default.inverse(t.placeholder[0])+e__default.dim(t.placeholder.slice(1)):e__default.inverse(e__default.hidden("_")),i=this.value?this.valueWithCursor:s;switch(this.state){case"error":return`${o.trim()}
${e__default.yellow(a)} ${r} ${e__default.yellow(a)} ${i}
${e__default.yellow(d)} ${e__default.yellow(this.error)} ${e__default.yellow(g)} ${e__default.yellow(this.error)}
`;case"submit":return`${o}${e__default.gray(a)} ${e__default.dim(this.value||t.placeholder)}`;case"cancel":return`${o}${e__default.gray(a)} ${e__default.strikethrough(e__default.dim(this.value??""))}${this.value?.trim()?` `;case"submit":return`${o}${e__default.gray(a)} ${e__default.dim(this.value||t.placeholder)}`;case"cancel":return`${o}${e__default.gray(a)} ${e__default.strikethrough(e__default.dim(this.value??""))}${this.value?.trim()?`
${e__default.gray(a)}`:""}`;default:return`${o}${e__default.cyan(a)} ${r} ${e__default.gray(a)}`:""}`;default:return`${o}${e__default.cyan(a)} ${i}
${e__default.cyan(d)} ${e__default.cyan(g)}
`}}}).prompt(),password=t=>new core.PasswordPrompt({validate:t.validate,mask:t.mask??oe,render(){const o=`${e__default.gray(a)} `}}}).prompt(),password=t=>new core.PasswordPrompt({validate:t.validate,mask:t.mask??oe,render(){const o=`${e__default.gray(a)}
${v(this.state)} ${t.message} ${b(this.state)} ${t.message}
`,s=this.valueWithCursor,r=this.masked;switch(this.state){case"error":return`${o.trim()} `,s=this.valueWithCursor,i=this.masked;switch(this.state){case"error":return`${o.trim()}
${e__default.yellow(a)} ${r} ${e__default.yellow(a)} ${i}
${e__default.yellow(d)} ${e__default.yellow(this.error)} ${e__default.yellow(g)} ${e__default.yellow(this.error)}
`;case"submit":return`${o}${e__default.gray(a)} ${e__default.dim(r)}`;case"cancel":return`${o}${e__default.gray(a)} ${e__default.strikethrough(e__default.dim(r??""))}${r?` `;case"submit":return`${o}${e__default.gray(a)} ${e__default.dim(i)}`;case"cancel":return`${o}${e__default.gray(a)} ${e__default.strikethrough(e__default.dim(i??""))}${i?`
${e__default.gray(a)}`:""}`;default:return`${o}${e__default.cyan(a)} ${s} ${e__default.gray(a)}`:""}`;default:return`${o}${e__default.cyan(a)} ${s}
${e__default.cyan(d)} ${e__default.cyan(g)}
`}}}).prompt(),confirm=t=>{const o=t.active??"Yes",s=t.inactive??"No";return new core.ConfirmPrompt({active:o,inactive:s,initialValue:t.initialValue??!0,render(){const r=`${e__default.gray(a)} `}}}).prompt(),confirm=t=>{const o=t.active??"Yes",s=t.inactive??"No";return new core.ConfirmPrompt({active:o,inactive:s,initialValue:t.initialValue??!0,render(){const i=`${e__default.gray(a)}
${v(this.state)} ${t.message} ${b(this.state)} ${t.message}
`,i=this.value?o:s;switch(this.state){case"submit":return`${r}${e__default.gray(a)} ${e__default.dim(i)}`;case"cancel":return`${r}${e__default.gray(a)} ${e__default.strikethrough(e__default.dim(i))} `,r=this.value?o:s;switch(this.state){case"submit":return`${i}${e__default.gray(a)} ${e__default.dim(r)}`;case"cancel":return`${i}${e__default.gray(a)} ${e__default.strikethrough(e__default.dim(r))}
${e__default.gray(a)}`;default:return`${r}${e__default.cyan(a)} ${this.value?`${e__default.green(_)} ${o}`:`${e__default.dim(A)} ${e__default.dim(o)}`} ${e__default.dim("/")} ${this.value?`${e__default.dim(A)} ${e__default.dim(s)}`:`${e__default.green(_)} ${s}`} ${e__default.gray(a)}`;default:return`${i}${e__default.cyan(a)} ${this.value?`${e__default.green(_)} ${o}`:`${e__default.dim(A)} ${e__default.dim(o)}`} ${e__default.dim("/")} ${this.value?`${e__default.dim(A)} ${e__default.dim(s)}`:`${e__default.green(_)} ${s}`}
${e__default.cyan(d)} ${e__default.cyan(g)}
`}}}).prompt()},select=t=>{const o=(s,r)=>{const i=s.label??String(s.value);switch(r){case"selected":return`${e__default.dim(i)}`;case"active":return`${e__default.green(_)} ${i} ${s.hint?e__default.dim(`(${s.hint})`):""}`;case"cancelled":return`${e__default.strikethrough(e__default.dim(i))}`;default:return`${e__default.dim(A)} ${e__default.dim(i)}`}};return new core.SelectPrompt({options:t.options,initialValue:t.initialValue,render(){const s=`${e__default.gray(a)} `}}}).prompt()},select=t=>{const o=(s,i)=>{const r=s.label??String(s.value);switch(i){case"selected":return`${e__default.dim(r)}`;case"active":return`${e__default.green(_)} ${r} ${s.hint?e__default.dim(`(${s.hint})`):""}`;case"cancelled":return`${e__default.strikethrough(e__default.dim(r))}`;default:return`${e__default.dim(A)} ${e__default.dim(r)}`}};return new core.SelectPrompt({options:t.options,initialValue:t.initialValue,render(){const s=`${e__default.gray(a)}
${v(this.state)} ${t.message} ${b(this.state)} ${t.message}
`;switch(this.state){case"submit":return`${s}${e__default.gray(a)} ${o(this.options[this.cursor],"selected")}`;case"cancel":return`${s}${e__default.gray(a)} ${o(this.options[this.cursor],"cancelled")} `;switch(this.state){case"submit":return`${s}${e__default.gray(a)} ${o(this.options[this.cursor],"selected")}`;case"cancel":return`${s}${e__default.gray(a)} ${o(this.options[this.cursor],"cancelled")}
${e__default.gray(a)}`;default:return`${s}${e__default.cyan(a)} ${E({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(r,i)=>o(r,i?"active":"inactive")}).join(` ${e__default.gray(a)}`;default:return`${s}${e__default.cyan(a)} ${E({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(i,r)=>o(i,r?"active":"inactive")}).join(`
${e__default.cyan(a)} `)} ${e__default.cyan(a)} `)}
${e__default.cyan(d)} ${e__default.cyan(g)}
`}}}).prompt()},selectKey=t=>{const o=(s,r="inactive")=>{const i=s.label??String(s.value);return r==="selected"?`${e__default.dim(i)}`:r==="cancelled"?`${e__default.strikethrough(e__default.dim(i))}`:r==="active"?`${e__default.bgCyan(e__default.gray(` ${s.value} `))} ${i} ${s.hint?e__default.dim(`(${s.hint})`):""}`:`${e__default.gray(e__default.bgWhite(e__default.inverse(` ${s.value} `)))} ${i} ${s.hint?e__default.dim(`(${s.hint})`):""}`};return new core.SelectKeyPrompt({options:t.options,initialValue:t.initialValue,render(){const s=`${e__default.gray(a)} `}}}).prompt()},selectKey=t=>{const o=(s,i="inactive")=>{const r=s.label??String(s.value);return i==="selected"?`${e__default.dim(r)}`:i==="cancelled"?`${e__default.strikethrough(e__default.dim(r))}`:i==="active"?`${e__default.bgCyan(e__default.gray(` ${s.value} `))} ${r} ${s.hint?e__default.dim(`(${s.hint})`):""}`:`${e__default.gray(e__default.bgWhite(e__default.inverse(` ${s.value} `)))} ${r} ${s.hint?e__default.dim(`(${s.hint})`):""}`};return new core.SelectKeyPrompt({options:t.options,initialValue:t.initialValue,render(){const s=`${e__default.gray(a)}
${v(this.state)} ${t.message} ${b(this.state)} ${t.message}
`;switch(this.state){case"submit":return`${s}${e__default.gray(a)} ${o(this.options.find(r=>r.value===this.value)??t.options[0],"selected")}`;case"cancel":return`${s}${e__default.gray(a)} ${o(this.options[0],"cancelled")} `;switch(this.state){case"submit":return`${s}${e__default.gray(a)} ${o(this.options.find(i=>i.value===this.value)??t.options[0],"selected")}`;case"cancel":return`${s}${e__default.gray(a)} ${o(this.options[0],"cancelled")}
${e__default.gray(a)}`;default:return`${s}${e__default.cyan(a)} ${this.options.map((r,i)=>o(r,i===this.cursor?"active":"inactive")).join(` ${e__default.gray(a)}`;default:return`${s}${e__default.cyan(a)} ${this.options.map((i,r)=>o(i,r===this.cursor?"active":"inactive")).join(`
${e__default.cyan(a)} `)} ${e__default.cyan(a)} `)}
${e__default.cyan(d)} ${e__default.cyan(g)}
`}}}).prompt()},multiselect=t=>{const o=(s,r)=>{const i=s.label??String(s.value);return r==="active"?`${e__default.cyan(C)} ${i} ${s.hint?e__default.dim(`(${s.hint})`):""}`:r==="selected"?`${e__default.green(V)} ${e__default.dim(i)}`:r==="cancelled"?`${e__default.strikethrough(e__default.dim(i))}`:r==="active-selected"?`${e__default.green(V)} ${i} ${s.hint?e__default.dim(`(${s.hint})`):""}`:r==="submitted"?`${e__default.dim(i)}`:`${e__default.dim(N)} ${e__default.dim(i)}`};return new core.MultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(s){if(this.required&&s.length===0)return`Please select at least one option. `}}}).prompt()},multiselect=t=>{const o=(s,i)=>{const r=s.label??String(s.value);return i==="active"?`${e__default.cyan(C)} ${r} ${s.hint?e__default.dim(`(${s.hint})`):""}`:i==="selected"?`${e__default.green(V)} ${e__default.dim(r)} ${s.hint?e__default.dim(`(${s.hint})`):""}`:i==="cancelled"?`${e__default.strikethrough(e__default.dim(r))}`:i==="active-selected"?`${e__default.green(V)} ${r} ${s.hint?e__default.dim(`(${s.hint})`):""}`:i==="submitted"?`${e__default.dim(r)}`:`${e__default.dim(N)} ${e__default.dim(r)}`};return new core.MultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(s){if(this.required&&s.length===0)return`Please select at least one option.
${e__default.reset(e__default.dim(`Press ${e__default.gray(e__default.bgWhite(e__default.inverse(" space ")))} to select, ${e__default.gray(e__default.bgWhite(e__default.inverse(" enter ")))} to submit`))}`},render(){const s=`${e__default.gray(a)} ${e__default.reset(e__default.dim(`Press ${e__default.gray(e__default.bgWhite(e__default.inverse(" space ")))} to select, ${e__default.gray(e__default.bgWhite(e__default.inverse(" enter ")))} to submit`))}`},render(){const s=`${e__default.gray(a)}
${v(this.state)} ${t.message} ${b(this.state)} ${t.message}
`,r=(i,n)=>{const c=this.value.includes(i.value);return n&&c?o(i,"active-selected"):c?o(i,"selected"):o(i,n?"active":"inactive")};switch(this.state){case"submit":return`${s}${e__default.gray(a)} ${this.options.filter(({value:i})=>this.value.includes(i)).map(i=>o(i,"submitted")).join(e__default.dim(", "))||e__default.dim("none")}`;case"cancel":{const i=this.options.filter(({value:n})=>this.value.includes(n)).map(n=>o(n,"cancelled")).join(e__default.dim(", "));return`${s}${e__default.gray(a)} ${i.trim()?`${i} `,i=(r,c)=>{const n=this.value.includes(r.value);return c&&n?o(r,"active-selected"):n?o(r,"selected"):o(r,c?"active":"inactive")};switch(this.state){case"submit":return`${s}${e__default.gray(a)} ${this.options.filter(({value:r})=>this.value.includes(r)).map(r=>o(r,"submitted")).join(e__default.dim(", "))||e__default.dim("none")}`;case"cancel":{const r=this.options.filter(({value:c})=>this.value.includes(c)).map(c=>o(c,"cancelled")).join(e__default.dim(", "));return`${s}${e__default.gray(a)} ${r.trim()?`${r}
${e__default.gray(a)}`:""}`}case"error":{const i=this.error.split(`
`).map((n,c)=>c===0?`${e__default.yellow(d)} ${e__default.yellow(n)}`:` ${n}`).join(`
`);return`${s+e__default.yellow(a)} ${E({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(`
${e__default.yellow(a)} `)}
${i}
`}default:return`${s}${e__default.cyan(a)} ${E({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(`
${e__default.cyan(a)} `)}
${e__default.cyan(d)}
`}}}).prompt()},groupMultiselect=t=>{const o=(s,r,i=[])=>{const n=s.label??String(s.value),c=typeof s.group=="string",l=c&&(i[i.indexOf(s)+1]??{group:!0}),$=c&&l.group===!0,p=c?`${$?d:a} `:"";return r==="active"?`${e__default.dim(p)}${e__default.cyan(C)} ${n} ${s.hint?e__default.dim(`(${s.hint})`):""}`:r==="group-active"?`${p}${e__default.cyan(C)} ${e__default.dim(n)}`:r==="group-active-selected"?`${p}${e__default.green(V)} ${e__default.dim(n)}`:r==="selected"?`${e__default.dim(p)}${e__default.green(V)} ${e__default.dim(n)}`:r==="cancelled"?`${e__default.strikethrough(e__default.dim(n))}`:r==="active-selected"?`${e__default.dim(p)}${e__default.green(V)} ${n} ${s.hint?e__default.dim(`(${s.hint})`):""}`:r==="submitted"?`${e__default.dim(n)}`:`${e__default.dim(p)}${e__default.dim(N)} ${e__default.dim(n)}`};return new core.GroupMultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(s){if(this.required&&s.length===0)return`Please select at least one option.
${e__default.reset(e__default.dim(`Press ${e__default.gray(e__default.bgWhite(e__default.inverse(" space ")))} to select, ${e__default.gray(e__default.bgWhite(e__default.inverse(" enter ")))} to submit`))}`},render(){const s=`${e__default.gray(a)}
${v(this.state)} ${t.message}
`;switch(this.state){case"submit":return`${s}${e__default.gray(a)} ${this.options.filter(({value:r})=>this.value.includes(r)).map(r=>o(r,"submitted")).join(e__default.dim(", "))}`;case"cancel":{const r=this.options.filter(({value:i})=>this.value.includes(i)).map(i=>o(i,"cancelled")).join(e__default.dim(", "));return`${s}${e__default.gray(a)} ${r.trim()?`${r}
${e__default.gray(a)}`:""}`}case"error":{const r=this.error.split(` ${e__default.gray(a)}`:""}`}case"error":{const r=this.error.split(`
`).map((i,n)=>n===0?`${e__default.yellow(d)} ${e__default.yellow(i)}`:` ${i}`).join(` `).map((c,n)=>n===0?`${e__default.yellow(g)} ${e__default.yellow(c)}`:` ${c}`).join(`
`);return`${s}${e__default.yellow(a)} ${this.options.map((i,n,c)=>{const l=this.value.includes(i.value)||i.group===!0&&this.isGroupSelected(`${i.value}`),$=n===this.cursor;return!$&&typeof i.group=="string"&&this.options[this.cursor].value===i.group?o(i,l?"group-active-selected":"group-active",c):$&&l?o(i,"active-selected",c):l?o(i,"selected",c):o(i,$?"active":"inactive",c)}).join(` `);return`${s+e__default.yellow(a)} ${E({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:i}).join(`
${e__default.yellow(a)} `)} ${e__default.yellow(a)} `)}
${r} ${r}
`}default:return`${s}${e__default.cyan(a)} ${this.options.map((r,i,n)=>{const c=this.value.includes(r.value)||r.group===!0&&this.isGroupSelected(`${r.value}`),l=i===this.cursor;return!l&&typeof r.group=="string"&&this.options[this.cursor].value===r.group?o(r,c?"group-active-selected":"group-active",n):l&&c?o(r,"active-selected",n):c?o(r,"selected",n):o(r,l?"active":"inactive",n)}).join(` `}default:return`${s}${e__default.cyan(a)} ${E({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:i}).join(`
${e__default.cyan(a)} `)} ${e__default.cyan(a)} `)}
${e__default.cyan(d)} ${e__default.cyan(g)}
`}}}).prompt()},groupMultiselect=t=>{const{selectableGroups:o=!0}=t,s=(i,r,c=[])=>{const n=i.label??String(i.value),l=typeof i.group=="string",$=l&&(c[c.indexOf(i)+1]??{group:!0}),h=l&&$.group===!0,m=l?o?`${h?g:a} `:" ":"";if(r==="active")return`${e__default.dim(m)}${e__default.cyan(C)} ${n} ${i.hint?e__default.dim(`(${i.hint})`):""}`;if(r==="group-active")return`${m}${e__default.cyan(C)} ${e__default.dim(n)}`;if(r==="group-active-selected")return`${m}${e__default.green(V)} ${e__default.dim(n)}`;if(r==="selected"){const w=l||o?e__default.green(V):"";return`${e__default.dim(m)}${w} ${e__default.dim(n)} ${i.hint?e__default.dim(`(${i.hint})`):""}`}if(r==="cancelled")return`${e__default.strikethrough(e__default.dim(n))}`;if(r==="active-selected")return`${e__default.dim(m)}${e__default.green(V)} ${n} ${i.hint?e__default.dim(`(${i.hint})`):""}`;if(r==="submitted")return`${e__default.dim(n)}`;const y=l||o?e__default.dim(N):"";return`${e__default.dim(m)}${y} ${e__default.dim(n)}`};return new core.GroupMultiSelectPrompt({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,selectableGroups:o,validate(i){if(this.required&&i.length===0)return`Please select at least one option.
${e__default.reset(e__default.dim(`Press ${e__default.gray(e__default.bgWhite(e__default.inverse(" space ")))} to select, ${e__default.gray(e__default.bgWhite(e__default.inverse(" enter ")))} to submit`))}`},render(){const i=`${e__default.gray(a)}
${b(this.state)} ${t.message}
`;switch(this.state){case"submit":return`${i}${e__default.gray(a)} ${this.options.filter(({value:r})=>this.value.includes(r)).map(r=>s(r,"submitted")).join(e__default.dim(", "))}`;case"cancel":{const r=this.options.filter(({value:c})=>this.value.includes(c)).map(c=>s(c,"cancelled")).join(e__default.dim(", "));return`${i}${e__default.gray(a)} ${r.trim()?`${r}
${e__default.gray(a)}`:""}`}case"error":{const r=this.error.split(`
`).map((c,n)=>n===0?`${e__default.yellow(g)} ${e__default.yellow(c)}`:` ${c}`).join(`
`);return`${i}${e__default.yellow(a)} ${this.options.map((c,n,l)=>{const $=this.value.includes(c.value)||c.group===!0&&this.isGroupSelected(`${c.value}`),h=n===this.cursor;return!h&&typeof c.group=="string"&&this.options[this.cursor].value===c.group?s(c,$?"group-active-selected":"group-active",l):h&&$?s(c,"active-selected",l):$?s(c,"selected",l):s(c,h?"active":"inactive",l)}).join(`
${e__default.yellow(a)} `)}
${r}
`}default:return`${i}${e__default.cyan(a)} ${this.options.map((r,c,n)=>{const l=this.value.includes(r.value)||r.group===!0&&this.isGroupSelected(`${r.value}`),$=c===this.cursor;return!$&&typeof r.group=="string"&&this.options[this.cursor].value===r.group?s(r,l?"group-active-selected":"group-active",n):$&&l?s(r,"active-selected",n):l?s(r,"selected",n):s(r,$?"active":"inactive",n)}).join(`
${e__default.cyan(a)} `)}
${e__default.cyan(g)}
`}}}).prompt()},note=(t="",o="")=>{const s=` `}}}).prompt()},note=(t="",o="")=>{const s=`
${t} ${t}
`.split(` `.split(`
`),r=node_util.stripVTControlCharacters(o).length,i=Math.max(s.reduce((c,l)=>{const $=node_util.stripVTControlCharacters(l);return $.length>c?$.length:c},0),r)+2,n=s.map(c=>`${e__default.gray(a)} ${e__default.dim(c)}${" ".repeat(i-node_util.stripVTControlCharacters(c).length)}${e__default.gray(a)}`).join(` `),i=node_util.stripVTControlCharacters(o).length,r=Math.max(s.reduce((n,l)=>{const $=node_util.stripVTControlCharacters(l);return $.length>n?$.length:n},0),i)+2,c=s.map(n=>`${e__default.gray(a)} ${e__default.dim(n)}${" ".repeat(r-node_util.stripVTControlCharacters(n).length)}${e__default.gray(a)}`).join(`
`);process.stdout.write(`${e__default.gray(a)} `);process.stdout.write(`${e__default.gray(a)}
${e__default.green(S)} ${e__default.reset(o)} ${e__default.gray(j.repeat(Math.max(i-r-1,1))+le)} ${e__default.green(S)} ${e__default.reset(o)} ${e__default.gray(j.repeat(Math.max(r-i-1,1))+le)}
${n} ${c}
${e__default.gray(ce+j.repeat(i+2)+ue)} ${e__default.gray(ce+j.repeat(r+2)+ue)}
`)},cancel=(t="")=>{process.stdout.write(`${e__default.gray(d)} ${e__default.red(t)} `)},cancel=(t="")=>{process.stdout.write(`${e__default.gray(g)} ${e__default.red(t)}
`)},intro=(t="")=>{process.stdout.write(`${e__default.gray(ae)} ${t} `)},intro=(t="")=>{process.stdout.write(`${e__default.gray(ae)} ${t}
`)},outro=(t="")=>{process.stdout.write(`${e__default.gray(a)} `)},outro=(t="")=>{process.stdout.write(`${e__default.gray(a)}
${e__default.gray(d)} ${t} ${e__default.gray(g)} ${t}
`)},log={message:(t="",{symbol:o=e__default.gray(a)}={})=>{const s=[`${e__default.gray(a)}`];if(t){const[r,...i]=t.split(` `)},log={message:(t="",{symbol:o=e__default.gray(a)}={})=>{const s=[`${e__default.gray(a)}`];if(t){const[i,...r]=t.split(`
`);s.push(`${o} ${r}`,...i.map(n=>`${e__default.gray(a)} ${n}`))}process.stdout.write(`${s.join(` `);s.push(`${o} ${i}`,...r.map(c=>`${e__default.gray(a)} ${c}`))}process.stdout.write(`${s.join(`
`)} `)}
`)},info:t=>{log.message(t,{symbol:e__default.blue(B)})},success:t=>{log.message(t,{symbol:e__default.green(W)})},step:t=>{log.message(t,{symbol:e__default.green(S)})},warn:t=>{log.message(t,{symbol:e__default.yellow(H)})},warning:t=>{log.warn(t)},error:t=>{log.message(t,{symbol:e__default.red(q)})}},D=`${e__default.gray(a)} `,stream={message:async(t,{symbol:o=e__default.gray(a)}={})=>{process.stdout.write(`${e__default.gray(a)} `)},info:t=>{log.message(t,{symbol:e__default.blue(B)})},success:t=>{log.message(t,{symbol:e__default.green(W)})},step:t=>{log.message(t,{symbol:e__default.green(S)})},warn:t=>{log.message(t,{symbol:e__default.yellow(H)})},warning:t=>{log.warn(t)},error:t=>{log.message(t,{symbol:e__default.red(q)})}},D=`${e__default.gray(a)} `,stream={message:async(t,{symbol:o=e__default.gray(a)}={})=>{process.stdout.write(`${e__default.gray(a)}
${o} `);let s=3;for await(let r of t){r=r.replace(/\n/g,` ${o} `);let s=3;for await(let i of t){i=i.replace(/\n/g,`
${D}`),r.includes(` ${D}`),i.includes(`
`)&&(s=3+node_util.stripVTControlCharacters(r.slice(r.lastIndexOf(` `)&&(s=3+node_util.stripVTControlCharacters(i.slice(i.lastIndexOf(`
`))).length);const i=node_util.stripVTControlCharacters(r).length;s+i<process.stdout.columns?(s+=i,process.stdout.write(r)):(process.stdout.write(` `))).length);const r=node_util.stripVTControlCharacters(i).length;s+r<process.stdout.columns?(s+=r,process.stdout.write(i)):(process.stdout.write(`
${D}${r.trimStart()}`),s=3+node_util.stripVTControlCharacters(r.trimStart()).length)}process.stdout.write(` ${D}${i.trimStart()}`),s=3+node_util.stripVTControlCharacters(i.trimStart()).length)}process.stdout.write(`
`)},info:t=>stream.message(t,{symbol:e__default.blue(B)}),success:t=>stream.message(t,{symbol:e__default.green(W)}),step:t=>stream.message(t,{symbol:e__default.green(S)}),warn:t=>stream.message(t,{symbol:e__default.yellow(H)}),warning:t=>stream.warn(t),error:t=>stream.message(t,{symbol:e__default.red(q)})},spinner=({indicator:t="dots"}={})=>{const o=P?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],s=P?80:120,r=process.env.CI==="true";let i,n,c=!1,l="",$,p=performance.now();const w=m=>{const h=m>1?"Something went wrong":"Canceled";c&&R(h,m)},y=()=>w(2),f=()=>w(1),x=()=>{process.on("uncaughtExceptionMonitor",y),process.on("unhandledRejection",y),process.on("SIGINT",f),process.on("SIGTERM",f),process.on("exit",w)},M=()=>{process.removeListener("uncaughtExceptionMonitor",y),process.removeListener("unhandledRejection",y),process.removeListener("SIGINT",f),process.removeListener("SIGTERM",f),process.removeListener("exit",w)},T=()=>{if($===void 0)return;r&&process.stdout.write(` `)},info:t=>stream.message(t,{symbol:e__default.blue(B)}),success:t=>stream.message(t,{symbol:e__default.green(W)}),step:t=>stream.message(t,{symbol:e__default.green(S)}),warn:t=>stream.message(t,{symbol:e__default.yellow(H)}),warning:t=>stream.warn(t),error:t=>stream.message(t,{symbol:e__default.red(q)})},spinner=({indicator:t="dots"}={})=>{const o=P?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],s=P?80:120,i=process.env.CI==="true";let r,c,n=!1,l="",$,h=performance.now();const m=p=>{const d=p>1?"Something went wrong":"Canceled";n&&R(d,p)},y=()=>m(2),w=()=>m(1),x=()=>{process.on("uncaughtExceptionMonitor",y),process.on("unhandledRejection",y),process.on("SIGINT",w),process.on("SIGTERM",w),process.on("exit",m)},M=()=>{process.removeListener("uncaughtExceptionMonitor",y),process.removeListener("unhandledRejection",y),process.removeListener("SIGINT",w),process.removeListener("SIGTERM",w),process.removeListener("exit",m)},T=()=>{if($===void 0)return;i&&process.stdout.write(`
`);const m=$.split(` `);const p=$.split(`
`);process.stdout.write(sisteransi.cursor.move(-999,m.length-1)),process.stdout.write(sisteransi.erase.down(m.length))},I=m=>m.replace(/\.+$/,""),k=m=>{const h=(performance.now()-m)/1e3,g=Math.floor(h/60),b=Math.floor(h%60);return g>0?`[${g}m ${b}s]`:`[${b}s]`},O=(m="")=>{c=!0,i=core.block(),l=I(m),p=performance.now(),process.stdout.write(`${e__default.gray(a)} `);process.stdout.write(sisteransi.cursor.move(-999,p.length-1)),process.stdout.write(sisteransi.erase.down(p.length))},I=p=>p.replace(/\.+$/,""),k=p=>{const d=(performance.now()-p)/1e3,v=Math.floor(d/60),f=Math.floor(d%60);return v>0?`[${v}m ${f}s]`:`[${f}s]`},O=(p="")=>{n=!0,r=core.block(),l=I(p),h=performance.now(),process.stdout.write(`${e__default.gray(a)}
`);let h=0,g=0;x(),n=setInterval(()=>{if(r&&l===$)return;T(),$=l;const b=e__default.magenta(o[h]);if(r)process.stdout.write(`${b} ${l}...`);else if(t==="timer")process.stdout.write(`${b} ${l} ${k(p)}`);else{const F=".".repeat(Math.floor(g)).slice(0,3);process.stdout.write(`${b} ${l}${F}`)}h=h+1<o.length?h+1:0,g=g<o.length?g+.125:0},s)},R=(m="",h=0)=>{c=!1,clearInterval(n),T();const g=h===0?e__default.green(S):h===1?e__default.red(L):e__default.red(G);l=I(m??l),t==="timer"?process.stdout.write(`${g} ${l} ${k(p)} `);let d=0,v=0;x(),c=setInterval(()=>{if(i&&l===$)return;T(),$=l;const f=e__default.magenta(o[d]);if(i)process.stdout.write(`${f} ${l}...`);else if(t==="timer")process.stdout.write(`${f} ${l} ${k(h)}`);else{const F=".".repeat(Math.floor(v)).slice(0,3);process.stdout.write(`${f} ${l}${F}`)}d=d+1<o.length?d+1:0,v=v<o.length?v+.125:0},s)},R=(p="",d=0)=>{n=!1,clearInterval(c),T();const v=d===0?e__default.green(S):d===1?e__default.red(G):e__default.red(L);l=I(p??l),t==="timer"?process.stdout.write(`${v} ${l} ${k(h)}
`):process.stdout.write(`${g} ${l} `):process.stdout.write(`${v} ${l}
`),M(),i()};return{start:O,stop:R,message:(m="")=>{l=I(m??l)}}},group=async(t,o)=>{const s={},r=Object.keys(t);for(const i of r){const n=t[i],c=await n({results:s})?.catch(l=>{throw l});if(typeof o?.onCancel=="function"&&core.isCancel(c)){s[i]="canceled",o.onCancel({results:s});continue}s[i]=c}return s},tasks=async t=>{for(const o of t){if(o.enabled===!1)continue;const s=spinner();s.start(o.title);const r=await o.task(s.message);s.stop(r||o.title)}};exports.isCancel=core.isCancel,exports.updateSettings=core.updateSettings,exports.cancel=cancel,exports.confirm=confirm,exports.group=group,exports.groupMultiselect=groupMultiselect,exports.intro=intro,exports.log=log,exports.multiselect=multiselect,exports.note=note,exports.outro=outro,exports.password=password,exports.select=select,exports.selectKey=selectKey,exports.spinner=spinner,exports.stream=stream,exports.tasks=tasks,exports.text=text; `),M(),r()};return{start:O,stop:R,message:(p="")=>{l=I(p??l)}}},group=async(t,o)=>{const s={},i=Object.keys(t);for(const r of i){const c=t[r],n=await c({results:s})?.catch(l=>{throw l});if(typeof o?.onCancel=="function"&&core.isCancel(n)){s[r]="canceled",o.onCancel({results:s});continue}s[r]=n}return s},tasks=async t=>{for(const o of t){if(o.enabled===!1)continue;const s=spinner();s.start(o.title);const i=await o.task(s.message);s.stop(i||o.title)}};exports.isCancel=core.isCancel,exports.updateSettings=core.updateSettings,exports.cancel=cancel,exports.confirm=confirm,exports.group=group,exports.groupMultiselect=groupMultiselect,exports.intro=intro,exports.log=log,exports.multiselect=multiselect,exports.note=note,exports.outro=outro,exports.password=password,exports.select=select,exports.selectKey=selectKey,exports.spinner=spinner,exports.stream=stream,exports.tasks=tasks,exports.text=text;
//# sourceMappingURL=index.cjs.map //# sourceMappingURL=index.cjs.map

File diff suppressed because one or more lines are too long

View File

@ -80,6 +80,7 @@ interface GroupMultiSelectOptions<Value> {
initialValues?: Value[]; initialValues?: Value[];
required?: boolean; required?: boolean;
cursorAt?: Value; cursorAt?: Value;
selectableGroups?: boolean;
} }
declare const groupMultiselect: <Value>(opts: GroupMultiSelectOptions<Value>) => Promise<symbol | Value[]>; declare const groupMultiselect: <Value>(opts: GroupMultiSelectOptions<Value>) => Promise<symbol | Value[]>;
declare const note: (message?: string, title?: string) => void; declare const note: (message?: string, title?: string) => void;

View File

@ -80,6 +80,7 @@ interface GroupMultiSelectOptions<Value> {
initialValues?: Value[]; initialValues?: Value[];
required?: boolean; required?: boolean;
cursorAt?: Value; cursorAt?: Value;
selectableGroups?: boolean;
} }
declare const groupMultiselect: <Value>(opts: GroupMultiSelectOptions<Value>) => Promise<symbol | Value[]>; declare const groupMultiselect: <Value>(opts: GroupMultiSelectOptions<Value>) => Promise<symbol | Value[]>;
declare const note: (message?: string, title?: string) => void; declare const note: (message?: string, title?: string) => void;

View File

@ -80,6 +80,7 @@ interface GroupMultiSelectOptions<Value> {
initialValues?: Value[]; initialValues?: Value[];
required?: boolean; required?: boolean;
cursorAt?: Value; cursorAt?: Value;
selectableGroups?: boolean;
} }
declare const groupMultiselect: <Value>(opts: GroupMultiSelectOptions<Value>) => Promise<symbol | Value[]>; declare const groupMultiselect: <Value>(opts: GroupMultiSelectOptions<Value>) => Promise<symbol | Value[]>;
declare const note: (message?: string, title?: string) => void; declare const note: (message?: string, title?: string) => void;

View File

@ -1,87 +1,87 @@
import{stripVTControlCharacters as S}from"node:util";import{TextPrompt as Q,PasswordPrompt as X,ConfirmPrompt as Z,SelectPrompt as ee,SelectKeyPrompt as te,MultiSelectPrompt as se,GroupMultiSelectPrompt as re,isCancel as ie,block as ne}from"@clack/core";export{isCancel,updateSettings}from"@clack/core";import g from"node:process";import e from"picocolors";import{cursor as oe,erase as ae}from"sisteransi";function ce(){return g.platform!=="win32"?g.env.TERM!=="linux":!!g.env.CI||!!g.env.WT_SESSION||!!g.env.TERMINUS_SUBLIME||g.env.ConEmuTask==="{cmd::Cmder}"||g.env.TERM_PROGRAM==="Terminus-Sublime"||g.env.TERM_PROGRAM==="vscode"||g.env.TERM==="xterm-256color"||g.env.TERM==="alacritty"||g.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const V=ce(),u=(t,n)=>V?t:n,le=u("\u25C6","*"),L=u("\u25A0","x"),W=u("\u25B2","x"),C=u("\u25C7","o"),ue=u("\u250C","T"),o=u("\u2502","|"),d=u("\u2514","\u2014"),k=u("\u25CF",">"),P=u("\u25CB"," "),A=u("\u25FB","[\u2022]"),T=u("\u25FC","[+]"),F=u("\u25FB","[ ]"),$e=u("\u25AA","\u2022"),_=u("\u2500","-"),me=u("\u256E","+"),de=u("\u251C","+"),pe=u("\u256F","+"),q=u("\u25CF","\u2022"),D=u("\u25C6","*"),U=u("\u25B2","!"),K=u("\u25A0","x"),w=t=>{switch(t){case"initial":case"active":return e.cyan(le);case"cancel":return e.red(L);case"error":return e.yellow(W);case"submit":return e.green(C)}},B=t=>{const{cursor:n,options:s,style:r}=t,i=t.maxItems??Number.POSITIVE_INFINITY,a=Math.max(process.stdout.rows-4,0),c=Math.min(a,Math.max(i,5));let l=0;n>=l+c-3?l=Math.max(Math.min(n-c+3,s.length-c),0):n<l+2&&(l=Math.max(n-2,0));const $=c<s.length&&l>0,p=c<s.length&&l+c<s.length;return s.slice(l,l+c).map((M,v,x)=>{const j=v===0&&$,E=v===x.length-1&&p;return j||E?e.dim("..."):r(M,v+l===n)})},he=t=>new Q({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){const n=`${e.gray(o)} import{stripVTControlCharacters as S}from"node:util";import{TextPrompt as Q,PasswordPrompt as X,ConfirmPrompt as Z,SelectPrompt as ee,SelectKeyPrompt as te,MultiSelectPrompt as re,GroupMultiSelectPrompt as se,isCancel as ie,block as ne}from"@clack/core";export{isCancel,updateSettings}from"@clack/core";import y from"node:process";import e from"picocolors";import{cursor as oe,erase as ae}from"sisteransi";function ce(){return y.platform!=="win32"?y.env.TERM!=="linux":!!y.env.CI||!!y.env.WT_SESSION||!!y.env.TERMINUS_SUBLIME||y.env.ConEmuTask==="{cmd::Cmder}"||y.env.TERM_PROGRAM==="Terminus-Sublime"||y.env.TERM_PROGRAM==="vscode"||y.env.TERM==="xterm-256color"||y.env.TERM==="alacritty"||y.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const V=ce(),u=(t,n)=>V?t:n,le=u("\u25C6","*"),L=u("\u25A0","x"),W=u("\u25B2","x"),C=u("\u25C7","o"),ue=u("\u250C","T"),o=u("\u2502","|"),d=u("\u2514","\u2014"),k=u("\u25CF",">"),P=u("\u25CB"," "),A=u("\u25FB","[\u2022]"),T=u("\u25FC","[+]"),F=u("\u25FB","[ ]"),$e=u("\u25AA","\u2022"),_=u("\u2500","-"),me=u("\u256E","+"),de=u("\u251C","+"),pe=u("\u256F","+"),q=u("\u25CF","\u2022"),D=u("\u25C6","*"),U=u("\u25B2","!"),K=u("\u25A0","x"),b=t=>{switch(t){case"initial":case"active":return e.cyan(le);case"cancel":return e.red(L);case"error":return e.yellow(W);case"submit":return e.green(C)}},G=t=>{const{cursor:n,options:r,style:i}=t,s=t.maxItems??Number.POSITIVE_INFINITY,c=Math.max(process.stdout.rows-4,0),a=Math.min(c,Math.max(s,5));let l=0;n>=l+a-3?l=Math.max(Math.min(n-a+3,r.length-a),0):n<l+2&&(l=Math.max(n-2,0));const $=a<r.length&&l>0,g=a<r.length&&l+a<r.length;return r.slice(l,l+a).map((p,v,f)=>{const j=v===0&&$,E=v===f.length-1&&g;return j||E?e.dim("..."):i(p,v+l===n)})},he=t=>new Q({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){const n=`${e.gray(o)}
${w(this.state)} ${t.message} ${b(this.state)} ${t.message}
`,s=t.placeholder?e.inverse(t.placeholder[0])+e.dim(t.placeholder.slice(1)):e.inverse(e.hidden("_")),r=this.value?this.valueWithCursor:s;switch(this.state){case"error":return`${n.trim()} `,r=t.placeholder?e.inverse(t.placeholder[0])+e.dim(t.placeholder.slice(1)):e.inverse(e.hidden("_")),i=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${n.trim()}
${e.yellow(o)} ${r} ${e.yellow(o)} ${i}
${e.yellow(d)} ${e.yellow(this.error)} ${e.yellow(d)} ${e.yellow(this.error)}
`;case"submit":return`${n}${e.gray(o)} ${e.dim(this.value||t.placeholder)}`;case"cancel":return`${n}${e.gray(o)} ${e.strikethrough(e.dim(this.value??""))}${this.value?.trim()?` `;case"submit":return`${n}${e.gray(o)} ${e.dim(this.value||t.placeholder)}`;case"cancel":return`${n}${e.gray(o)} ${e.strikethrough(e.dim(this.value??""))}${this.value?.trim()?`
${e.gray(o)}`:""}`;default:return`${n}${e.cyan(o)} ${r} ${e.gray(o)}`:""}`;default:return`${n}${e.cyan(o)} ${i}
${e.cyan(d)} ${e.cyan(d)}
`}}}).prompt(),ge=t=>new X({validate:t.validate,mask:t.mask??$e,render(){const n=`${e.gray(o)} `}}}).prompt(),ge=t=>new X({validate:t.validate,mask:t.mask??$e,render(){const n=`${e.gray(o)}
${w(this.state)} ${t.message} ${b(this.state)} ${t.message}
`,s=this.valueWithCursor,r=this.masked;switch(this.state){case"error":return`${n.trim()} `,r=this.valueWithCursor,i=this.masked;switch(this.state){case"error":return`${n.trim()}
${e.yellow(o)} ${r} ${e.yellow(o)} ${i}
${e.yellow(d)} ${e.yellow(this.error)} ${e.yellow(d)} ${e.yellow(this.error)}
`;case"submit":return`${n}${e.gray(o)} ${e.dim(r)}`;case"cancel":return`${n}${e.gray(o)} ${e.strikethrough(e.dim(r??""))}${r?` `;case"submit":return`${n}${e.gray(o)} ${e.dim(i)}`;case"cancel":return`${n}${e.gray(o)} ${e.strikethrough(e.dim(i??""))}${i?`
${e.gray(o)}`:""}`;default:return`${n}${e.cyan(o)} ${s} ${e.gray(o)}`:""}`;default:return`${n}${e.cyan(o)} ${r}
${e.cyan(d)} ${e.cyan(d)}
`}}}).prompt(),ye=t=>{const n=t.active??"Yes",s=t.inactive??"No";return new Z({active:n,inactive:s,initialValue:t.initialValue??!0,render(){const r=`${e.gray(o)} `}}}).prompt(),ye=t=>{const n=t.active??"Yes",r=t.inactive??"No";return new Z({active:n,inactive:r,initialValue:t.initialValue??!0,render(){const i=`${e.gray(o)}
${w(this.state)} ${t.message} ${b(this.state)} ${t.message}
`,i=this.value?n:s;switch(this.state){case"submit":return`${r}${e.gray(o)} ${e.dim(i)}`;case"cancel":return`${r}${e.gray(o)} ${e.strikethrough(e.dim(i))} `,s=this.value?n:r;switch(this.state){case"submit":return`${i}${e.gray(o)} ${e.dim(s)}`;case"cancel":return`${i}${e.gray(o)} ${e.strikethrough(e.dim(s))}
${e.gray(o)}`;default:return`${r}${e.cyan(o)} ${this.value?`${e.green(k)} ${n}`:`${e.dim(P)} ${e.dim(n)}`} ${e.dim("/")} ${this.value?`${e.dim(P)} ${e.dim(s)}`:`${e.green(k)} ${s}`} ${e.gray(o)}`;default:return`${i}${e.cyan(o)} ${this.value?`${e.green(k)} ${n}`:`${e.dim(P)} ${e.dim(n)}`} ${e.dim("/")} ${this.value?`${e.dim(P)} ${e.dim(r)}`:`${e.green(k)} ${r}`}
${e.cyan(d)} ${e.cyan(d)}
`}}}).prompt()},ve=t=>{const n=(s,r)=>{const i=s.label??String(s.value);switch(r){case"selected":return`${e.dim(i)}`;case"active":return`${e.green(k)} ${i} ${s.hint?e.dim(`(${s.hint})`):""}`;case"cancelled":return`${e.strikethrough(e.dim(i))}`;default:return`${e.dim(P)} ${e.dim(i)}`}};return new ee({options:t.options,initialValue:t.initialValue,render(){const s=`${e.gray(o)} `}}}).prompt()},ve=t=>{const n=(r,i)=>{const s=r.label??String(r.value);switch(i){case"selected":return`${e.dim(s)}`;case"active":return`${e.green(k)} ${s} ${r.hint?e.dim(`(${r.hint})`):""}`;case"cancelled":return`${e.strikethrough(e.dim(s))}`;default:return`${e.dim(P)} ${e.dim(s)}`}};return new ee({options:t.options,initialValue:t.initialValue,render(){const r=`${e.gray(o)}
${w(this.state)} ${t.message} ${b(this.state)} ${t.message}
`;switch(this.state){case"submit":return`${s}${e.gray(o)} ${n(this.options[this.cursor],"selected")}`;case"cancel":return`${s}${e.gray(o)} ${n(this.options[this.cursor],"cancelled")} `;switch(this.state){case"submit":return`${r}${e.gray(o)} ${n(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${e.gray(o)} ${n(this.options[this.cursor],"cancelled")}
${e.gray(o)}`;default:return`${s}${e.cyan(o)} ${B({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(r,i)=>n(r,i?"active":"inactive")}).join(` ${e.gray(o)}`;default:return`${r}${e.cyan(o)} ${G({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(i,s)=>n(i,s?"active":"inactive")}).join(`
${e.cyan(o)} `)} ${e.cyan(o)} `)}
${e.cyan(d)} ${e.cyan(d)}
`}}}).prompt()},we=t=>{const n=(s,r="inactive")=>{const i=s.label??String(s.value);return r==="selected"?`${e.dim(i)}`:r==="cancelled"?`${e.strikethrough(e.dim(i))}`:r==="active"?`${e.bgCyan(e.gray(` ${s.value} `))} ${i} ${s.hint?e.dim(`(${s.hint})`):""}`:`${e.gray(e.bgWhite(e.inverse(` ${s.value} `)))} ${i} ${s.hint?e.dim(`(${s.hint})`):""}`};return new te({options:t.options,initialValue:t.initialValue,render(){const s=`${e.gray(o)} `}}}).prompt()},we=t=>{const n=(r,i="inactive")=>{const s=r.label??String(r.value);return i==="selected"?`${e.dim(s)}`:i==="cancelled"?`${e.strikethrough(e.dim(s))}`:i==="active"?`${e.bgCyan(e.gray(` ${r.value} `))} ${s} ${r.hint?e.dim(`(${r.hint})`):""}`:`${e.gray(e.bgWhite(e.inverse(` ${r.value} `)))} ${s} ${r.hint?e.dim(`(${r.hint})`):""}`};return new te({options:t.options,initialValue:t.initialValue,render(){const r=`${e.gray(o)}
${w(this.state)} ${t.message} ${b(this.state)} ${t.message}
`;switch(this.state){case"submit":return`${s}${e.gray(o)} ${n(this.options.find(r=>r.value===this.value)??t.options[0],"selected")}`;case"cancel":return`${s}${e.gray(o)} ${n(this.options[0],"cancelled")} `;switch(this.state){case"submit":return`${r}${e.gray(o)} ${n(this.options.find(i=>i.value===this.value)??t.options[0],"selected")}`;case"cancel":return`${r}${e.gray(o)} ${n(this.options[0],"cancelled")}
${e.gray(o)}`;default:return`${s}${e.cyan(o)} ${this.options.map((r,i)=>n(r,i===this.cursor?"active":"inactive")).join(` ${e.gray(o)}`;default:return`${r}${e.cyan(o)} ${this.options.map((i,s)=>n(i,s===this.cursor?"active":"inactive")).join(`
${e.cyan(o)} `)} ${e.cyan(o)} `)}
${e.cyan(d)} ${e.cyan(d)}
`}}}).prompt()},fe=t=>{const n=(s,r)=>{const i=s.label??String(s.value);return r==="active"?`${e.cyan(A)} ${i} ${s.hint?e.dim(`(${s.hint})`):""}`:r==="selected"?`${e.green(T)} ${e.dim(i)}`:r==="cancelled"?`${e.strikethrough(e.dim(i))}`:r==="active-selected"?`${e.green(T)} ${i} ${s.hint?e.dim(`(${s.hint})`):""}`:r==="submitted"?`${e.dim(i)}`:`${e.dim(F)} ${e.dim(i)}`};return new se({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(s){if(this.required&&s.length===0)return`Please select at least one option. `}}}).prompt()},fe=t=>{const n=(r,i)=>{const s=r.label??String(r.value);return i==="active"?`${e.cyan(A)} ${s} ${r.hint?e.dim(`(${r.hint})`):""}`:i==="selected"?`${e.green(T)} ${e.dim(s)} ${r.hint?e.dim(`(${r.hint})`):""}`:i==="cancelled"?`${e.strikethrough(e.dim(s))}`:i==="active-selected"?`${e.green(T)} ${s} ${r.hint?e.dim(`(${r.hint})`):""}`:i==="submitted"?`${e.dim(s)}`:`${e.dim(F)} ${e.dim(s)}`};return new re({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(r){if(this.required&&r.length===0)return`Please select at least one option.
${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`},render(){const s=`${e.gray(o)} ${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`},render(){const r=`${e.gray(o)}
${w(this.state)} ${t.message} ${b(this.state)} ${t.message}
`,r=(i,a)=>{const c=this.value.includes(i.value);return a&&c?n(i,"active-selected"):c?n(i,"selected"):n(i,a?"active":"inactive")};switch(this.state){case"submit":return`${s}${e.gray(o)} ${this.options.filter(({value:i})=>this.value.includes(i)).map(i=>n(i,"submitted")).join(e.dim(", "))||e.dim("none")}`;case"cancel":{const i=this.options.filter(({value:a})=>this.value.includes(a)).map(a=>n(a,"cancelled")).join(e.dim(", "));return`${s}${e.gray(o)} ${i.trim()?`${i} `,i=(s,c)=>{const a=this.value.includes(s.value);return c&&a?n(s,"active-selected"):a?n(s,"selected"):n(s,c?"active":"inactive")};switch(this.state){case"submit":return`${r}${e.gray(o)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>n(s,"submitted")).join(e.dim(", "))||e.dim("none")}`;case"cancel":{const s=this.options.filter(({value:c})=>this.value.includes(c)).map(c=>n(c,"cancelled")).join(e.dim(", "));return`${r}${e.gray(o)} ${s.trim()?`${s}
${e.gray(o)}`:""}`}case"error":{const i=this.error.split(` ${e.gray(o)}`:""}`}case"error":{const s=this.error.split(`
`).map((a,c)=>c===0?`${e.yellow(d)} ${e.yellow(a)}`:` ${a}`).join(` `).map((c,a)=>a===0?`${e.yellow(d)} ${e.yellow(c)}`:` ${c}`).join(`
`);return`${s+e.yellow(o)} ${B({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(` `);return`${r+e.yellow(o)} ${G({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:i}).join(`
${e.yellow(o)} `)} ${e.yellow(o)} `)}
${i} ${s}
`}default:return`${s}${e.cyan(o)} ${B({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(` `}default:return`${r}${e.cyan(o)} ${G({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:i}).join(`
${e.cyan(o)} `)} ${e.cyan(o)} `)}
${e.cyan(d)} ${e.cyan(d)}
`}}}).prompt()},be=t=>{const n=(s,r,i=[])=>{const a=s.label??String(s.value),c=typeof s.group=="string",l=c&&(i[i.indexOf(s)+1]??{group:!0}),$=c&&l.group===!0,p=c?`${$?d:o} `:"";return r==="active"?`${e.dim(p)}${e.cyan(A)} ${a} ${s.hint?e.dim(`(${s.hint})`):""}`:r==="group-active"?`${p}${e.cyan(A)} ${e.dim(a)}`:r==="group-active-selected"?`${p}${e.green(T)} ${e.dim(a)}`:r==="selected"?`${e.dim(p)}${e.green(T)} ${e.dim(a)}`:r==="cancelled"?`${e.strikethrough(e.dim(a))}`:r==="active-selected"?`${e.dim(p)}${e.green(T)} ${a} ${s.hint?e.dim(`(${s.hint})`):""}`:r==="submitted"?`${e.dim(a)}`:`${e.dim(p)}${e.dim(F)} ${e.dim(a)}`};return new re({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,validate(s){if(this.required&&s.length===0)return`Please select at least one option. `}}}).prompt()},be=t=>{const{selectableGroups:n=!0}=t,r=(i,s,c=[])=>{const a=i.label??String(i.value),l=typeof i.group=="string",$=l&&(c[c.indexOf(i)+1]??{group:!0}),g=l&&$.group===!0,p=l?n?`${g?d:o} `:" ":"";if(s==="active")return`${e.dim(p)}${e.cyan(A)} ${a} ${i.hint?e.dim(`(${i.hint})`):""}`;if(s==="group-active")return`${p}${e.cyan(A)} ${e.dim(a)}`;if(s==="group-active-selected")return`${p}${e.green(T)} ${e.dim(a)}`;if(s==="selected"){const f=l||n?e.green(T):"";return`${e.dim(p)}${f} ${e.dim(a)} ${i.hint?e.dim(`(${i.hint})`):""}`}if(s==="cancelled")return`${e.strikethrough(e.dim(a))}`;if(s==="active-selected")return`${e.dim(p)}${e.green(T)} ${a} ${i.hint?e.dim(`(${i.hint})`):""}`;if(s==="submitted")return`${e.dim(a)}`;const v=l||n?e.dim(F):"";return`${e.dim(p)}${v} ${e.dim(a)}`};return new se({options:t.options,initialValues:t.initialValues,required:t.required??!0,cursorAt:t.cursorAt,selectableGroups:n,validate(i){if(this.required&&i.length===0)return`Please select at least one option.
${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`},render(){const s=`${e.gray(o)} ${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`},render(){const i=`${e.gray(o)}
${w(this.state)} ${t.message} ${b(this.state)} ${t.message}
`;switch(this.state){case"submit":return`${s}${e.gray(o)} ${this.options.filter(({value:r})=>this.value.includes(r)).map(r=>n(r,"submitted")).join(e.dim(", "))}`;case"cancel":{const r=this.options.filter(({value:i})=>this.value.includes(i)).map(i=>n(i,"cancelled")).join(e.dim(", "));return`${s}${e.gray(o)} ${r.trim()?`${r} `;switch(this.state){case"submit":return`${i}${e.gray(o)} ${this.options.filter(({value:s})=>this.value.includes(s)).map(s=>r(s,"submitted")).join(e.dim(", "))}`;case"cancel":{const s=this.options.filter(({value:c})=>this.value.includes(c)).map(c=>r(c,"cancelled")).join(e.dim(", "));return`${i}${e.gray(o)} ${s.trim()?`${s}
${e.gray(o)}`:""}`}case"error":{const r=this.error.split(` ${e.gray(o)}`:""}`}case"error":{const s=this.error.split(`
`).map((i,a)=>a===0?`${e.yellow(d)} ${e.yellow(i)}`:` ${i}`).join(` `).map((c,a)=>a===0?`${e.yellow(d)} ${e.yellow(c)}`:` ${c}`).join(`
`);return`${s}${e.yellow(o)} ${this.options.map((i,a,c)=>{const l=this.value.includes(i.value)||i.group===!0&&this.isGroupSelected(`${i.value}`),$=a===this.cursor;return!$&&typeof i.group=="string"&&this.options[this.cursor].value===i.group?n(i,l?"group-active-selected":"group-active",c):$&&l?n(i,"active-selected",c):l?n(i,"selected",c):n(i,$?"active":"inactive",c)}).join(` `);return`${i}${e.yellow(o)} ${this.options.map((c,a,l)=>{const $=this.value.includes(c.value)||c.group===!0&&this.isGroupSelected(`${c.value}`),g=a===this.cursor;return!g&&typeof c.group=="string"&&this.options[this.cursor].value===c.group?r(c,$?"group-active-selected":"group-active",l):g&&$?r(c,"active-selected",l):$?r(c,"selected",l):r(c,g?"active":"inactive",l)}).join(`
${e.yellow(o)} `)} ${e.yellow(o)} `)}
${r} ${s}
`}default:return`${s}${e.cyan(o)} ${this.options.map((r,i,a)=>{const c=this.value.includes(r.value)||r.group===!0&&this.isGroupSelected(`${r.value}`),l=i===this.cursor;return!l&&typeof r.group=="string"&&this.options[this.cursor].value===r.group?n(r,c?"group-active-selected":"group-active",a):l&&c?n(r,"active-selected",a):c?n(r,"selected",a):n(r,l?"active":"inactive",a)}).join(` `}default:return`${i}${e.cyan(o)} ${this.options.map((s,c,a)=>{const l=this.value.includes(s.value)||s.group===!0&&this.isGroupSelected(`${s.value}`),$=c===this.cursor;return!$&&typeof s.group=="string"&&this.options[this.cursor].value===s.group?r(s,l?"group-active-selected":"group-active",a):$&&l?r(s,"active-selected",a):l?r(s,"selected",a):r(s,$?"active":"inactive",a)}).join(`
${e.cyan(o)} `)} ${e.cyan(o)} `)}
${e.cyan(d)} ${e.cyan(d)}
`}}}).prompt()},Me=(t="",n="")=>{const s=` `}}}).prompt()},Me=(t="",n="")=>{const r=`
${t} ${t}
`.split(` `.split(`
`),r=S(n).length,i=Math.max(s.reduce((c,l)=>{const $=S(l);return $.length>c?$.length:c},0),r)+2,a=s.map(c=>`${e.gray(o)} ${e.dim(c)}${" ".repeat(i-S(c).length)}${e.gray(o)}`).join(` `),i=S(n).length,s=Math.max(r.reduce((a,l)=>{const $=S(l);return $.length>a?$.length:a},0),i)+2,c=r.map(a=>`${e.gray(o)} ${e.dim(a)}${" ".repeat(s-S(a).length)}${e.gray(o)}`).join(`
`);process.stdout.write(`${e.gray(o)} `);process.stdout.write(`${e.gray(o)}
${e.green(C)} ${e.reset(n)} ${e.gray(_.repeat(Math.max(i-r-1,1))+me)} ${e.green(C)} ${e.reset(n)} ${e.gray(_.repeat(Math.max(s-i-1,1))+me)}
${a} ${c}
${e.gray(de+_.repeat(i+2)+pe)} ${e.gray(de+_.repeat(s+2)+pe)}
`)},xe=(t="")=>{process.stdout.write(`${e.gray(d)} ${e.red(t)} `)},xe=(t="")=>{process.stdout.write(`${e.gray(d)} ${e.red(t)}
`)},Ie=(t="")=>{process.stdout.write(`${e.gray(ue)} ${t} `)},Ie=(t="")=>{process.stdout.write(`${e.gray(ue)} ${t}
`)},Se=(t="")=>{process.stdout.write(`${e.gray(o)} `)},Se=(t="")=>{process.stdout.write(`${e.gray(o)}
${e.gray(d)} ${t} ${e.gray(d)} ${t}
`)},f={message:(t="",{symbol:n=e.gray(o)}={})=>{const s=[`${e.gray(o)}`];if(t){const[r,...i]=t.split(` `)},M={message:(t="",{symbol:n=e.gray(o)}={})=>{const r=[`${e.gray(o)}`];if(t){const[i,...s]=t.split(`
`);s.push(`${n} ${r}`,...i.map(a=>`${e.gray(o)} ${a}`))}process.stdout.write(`${s.join(` `);r.push(`${n} ${i}`,...s.map(c=>`${e.gray(o)} ${c}`))}process.stdout.write(`${r.join(`
`)} `)}
`)},info:t=>{f.message(t,{symbol:e.blue(q)})},success:t=>{f.message(t,{symbol:e.green(D)})},step:t=>{f.message(t,{symbol:e.green(C)})},warn:t=>{f.message(t,{symbol:e.yellow(U)})},warning:t=>{f.warn(t)},error:t=>{f.message(t,{symbol:e.red(K)})}},J=`${e.gray(o)} `,b={message:async(t,{symbol:n=e.gray(o)}={})=>{process.stdout.write(`${e.gray(o)} `)},info:t=>{M.message(t,{symbol:e.blue(q)})},success:t=>{M.message(t,{symbol:e.green(D)})},step:t=>{M.message(t,{symbol:e.green(C)})},warn:t=>{M.message(t,{symbol:e.yellow(U)})},warning:t=>{M.warn(t)},error:t=>{M.message(t,{symbol:e.red(K)})}},J=`${e.gray(o)} `,x={message:async(t,{symbol:n=e.gray(o)}={})=>{process.stdout.write(`${e.gray(o)}
${n} `);let s=3;for await(let r of t){r=r.replace(/\n/g,` ${n} `);let r=3;for await(let i of t){i=i.replace(/\n/g,`
${J}`),r.includes(` ${J}`),i.includes(`
`)&&(s=3+S(r.slice(r.lastIndexOf(` `)&&(r=3+S(i.slice(i.lastIndexOf(`
`))).length);const i=S(r).length;s+i<process.stdout.columns?(s+=i,process.stdout.write(r)):(process.stdout.write(` `))).length);const s=S(i).length;r+s<process.stdout.columns?(r+=s,process.stdout.write(i)):(process.stdout.write(`
${J}${r.trimStart()}`),s=3+S(r.trimStart()).length)}process.stdout.write(` ${J}${i.trimStart()}`),r=3+S(i.trimStart()).length)}process.stdout.write(`
`)},info:t=>b.message(t,{symbol:e.blue(q)}),success:t=>b.message(t,{symbol:e.green(D)}),step:t=>b.message(t,{symbol:e.green(C)}),warn:t=>b.message(t,{symbol:e.yellow(U)}),warning:t=>b.warn(t),error:t=>b.message(t,{symbol:e.red(K)})},Y=({indicator:t="dots"}={})=>{const n=V?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],s=V?80:120,r=process.env.CI==="true";let i,a,c=!1,l="",$,p=performance.now();const M=m=>{const h=m>1?"Something went wrong":"Canceled";c&&N(h,m)},v=()=>M(2),x=()=>M(1),j=()=>{process.on("uncaughtExceptionMonitor",v),process.on("unhandledRejection",v),process.on("SIGINT",x),process.on("SIGTERM",x),process.on("exit",M)},E=()=>{process.removeListener("uncaughtExceptionMonitor",v),process.removeListener("unhandledRejection",v),process.removeListener("SIGINT",x),process.removeListener("SIGTERM",x),process.removeListener("exit",M)},O=()=>{if($===void 0)return;r&&process.stdout.write(` `)},info:t=>x.message(t,{symbol:e.blue(q)}),success:t=>x.message(t,{symbol:e.green(D)}),step:t=>x.message(t,{symbol:e.green(C)}),warn:t=>x.message(t,{symbol:e.yellow(U)}),warning:t=>x.warn(t),error:t=>x.message(t,{symbol:e.red(K)})},Y=({indicator:t="dots"}={})=>{const n=V?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],r=V?80:120,i=process.env.CI==="true";let s,c,a=!1,l="",$,g=performance.now();const p=m=>{const h=m>1?"Something went wrong":"Canceled";a&&N(h,m)},v=()=>p(2),f=()=>p(1),j=()=>{process.on("uncaughtExceptionMonitor",v),process.on("unhandledRejection",v),process.on("SIGINT",f),process.on("SIGTERM",f),process.on("exit",p)},E=()=>{process.removeListener("uncaughtExceptionMonitor",v),process.removeListener("unhandledRejection",v),process.removeListener("SIGINT",f),process.removeListener("SIGTERM",f),process.removeListener("exit",p)},B=()=>{if($===void 0)return;i&&process.stdout.write(`
`);const m=$.split(` `);const m=$.split(`
`);process.stdout.write(oe.move(-999,m.length-1)),process.stdout.write(ae.down(m.length))},R=m=>m.replace(/\.+$/,""),G=m=>{const h=(performance.now()-m)/1e3,y=Math.floor(h/60),I=Math.floor(h%60);return y>0?`[${y}m ${I}s]`:`[${I}s]`},H=(m="")=>{c=!0,i=ne(),l=R(m),p=performance.now(),process.stdout.write(`${e.gray(o)} `);process.stdout.write(oe.move(-999,m.length-1)),process.stdout.write(ae.down(m.length))},R=m=>m.replace(/\.+$/,""),O=m=>{const h=(performance.now()-m)/1e3,w=Math.floor(h/60),I=Math.floor(h%60);return w>0?`[${w}m ${I}s]`:`[${I}s]`},H=(m="")=>{a=!0,s=ne(),l=R(m),g=performance.now(),process.stdout.write(`${e.gray(o)}
`);let h=0,y=0;j(),a=setInterval(()=>{if(r&&l===$)return;O(),$=l;const I=e.magenta(n[h]);if(r)process.stdout.write(`${I} ${l}...`);else if(t==="timer")process.stdout.write(`${I} ${l} ${G(p)}`);else{const z=".".repeat(Math.floor(y)).slice(0,3);process.stdout.write(`${I} ${l}${z}`)}h=h+1<n.length?h+1:0,y=y<n.length?y+.125:0},s)},N=(m="",h=0)=>{c=!1,clearInterval(a),O();const y=h===0?e.green(C):h===1?e.red(L):e.red(W);l=R(m??l),t==="timer"?process.stdout.write(`${y} ${l} ${G(p)} `);let h=0,w=0;j(),c=setInterval(()=>{if(i&&l===$)return;B(),$=l;const I=e.magenta(n[h]);if(i)process.stdout.write(`${I} ${l}...`);else if(t==="timer")process.stdout.write(`${I} ${l} ${O(g)}`);else{const z=".".repeat(Math.floor(w)).slice(0,3);process.stdout.write(`${I} ${l}${z}`)}h=h+1<n.length?h+1:0,w=w<n.length?w+.125:0},r)},N=(m="",h=0)=>{a=!1,clearInterval(c),B();const w=h===0?e.green(C):h===1?e.red(L):e.red(W);l=R(m??l),t==="timer"?process.stdout.write(`${w} ${l} ${O(g)}
`):process.stdout.write(`${y} ${l} `):process.stdout.write(`${w} ${l}
`),E(),i()};return{start:H,stop:N,message:(m="")=>{l=R(m??l)}}},Ce=async(t,n)=>{const s={},r=Object.keys(t);for(const i of r){const a=t[i],c=await a({results:s})?.catch(l=>{throw l});if(typeof n?.onCancel=="function"&&ie(c)){s[i]="canceled",n.onCancel({results:s});continue}s[i]=c}return s},Te=async t=>{for(const n of t){if(n.enabled===!1)continue;const s=Y();s.start(n.title);const r=await n.task(s.message);s.stop(r||n.title)}};export{xe as cancel,ye as confirm,Ce as group,be as groupMultiselect,Ie as intro,f as log,fe as multiselect,Me as note,Se as outro,ge as password,ve as select,we as selectKey,Y as spinner,b as stream,Te as tasks,he as text}; `),E(),s()};return{start:H,stop:N,message:(m="")=>{l=R(m??l)}}},Ce=async(t,n)=>{const r={},i=Object.keys(t);for(const s of i){const c=t[s],a=await c({results:r})?.catch(l=>{throw l});if(typeof n?.onCancel=="function"&&ie(a)){r[s]="canceled",n.onCancel({results:r});continue}r[s]=a}return r},Te=async t=>{for(const n of t){if(n.enabled===!1)continue;const r=Y();r.start(n.title);const i=await n.task(r.message);r.stop(i||n.title)}};export{xe as cancel,ye as confirm,Ce as group,be as groupMultiselect,Ie as intro,M as log,fe as multiselect,Me as note,Se as outro,ge as password,ve as select,we as selectKey,Y as spinner,x as stream,Te as tasks,he as text};
//# sourceMappingURL=index.mjs.map //# sourceMappingURL=index.mjs.map

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{ {
"name": "@clack/prompts", "name": "@clack/prompts",
"version": "0.10.0", "version": "0.10.1",
"type": "module", "type": "module",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",
"module": "./dist/index.mjs", "module": "./dist/index.mjs",
@ -15,13 +15,13 @@
"types": "./dist/index.d.ts", "types": "./dist/index.d.ts",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/natemoo-re/clack", "url": "git+https://github.com/bombshell-dev/clack.git",
"directory": "packages/prompts" "directory": "packages/prompts"
}, },
"bugs": { "bugs": {
"url": "https://github.com/natemoo-re/clack/issues" "url": "https://github.com/bombshell-dev/clack/issues"
}, },
"homepage": "https://github.com/natemoo-re/clack/tree/main/packages/prompts#readme", "homepage": "https://github.com/bombshell-dev/clack/tree/main/packages/prompts#readme",
"files": [ "files": [
"dist", "dist",
"CHANGELOG.md" "CHANGELOG.md"
@ -50,7 +50,7 @@
"dependencies": { "dependencies": {
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"sisteransi": "^1.0.5", "sisteransi": "^1.0.5",
"@clack/core": "0.4.1" "@clack/core": "0.4.2"
}, },
"devDependencies": { "devDependencies": {
"is-unicode-supported": "^1.3.0" "is-unicode-supported": "^1.3.0"

View File

@ -1,5 +1,5 @@
import * as _sapphire_shapeshift from '@sapphire/shapeshift'; import * as _sapphire_shapeshift from '@sapphire/shapeshift';
import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, ChannelType, APIActionRowComponent, APIActionRowComponentTypes, APIBaseComponent, ComponentType, APIButtonComponent, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APIMessageActionRowComponent, APIModalActionRowComponent, APIModalComponent, APIMessageComponent, APIModalInteractionResponseCallbackData, LocalizationMap, LocaleString, InteractionContextType, Permissions, ApplicationIntegrationType, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandAttachmentOption, APIApplicationCommandBooleanOption, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, APIApplicationCommandOption, Locale, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody } from 'discord-api-types/v10'; import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, ChannelType, APIActionRowComponent, APIComponentInActionRow, APIMessageComponent, APIBaseComponent, ComponentType, APIButtonComponent, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APIComponentInMessageActionRow, APIComponentInModalActionRow, APIFileComponent, APISeparatorComponent, SeparatorSpacingSize, APITextDisplayComponent, APIContainerComponent, APIMediaGalleryComponent, APISectionComponent, APIComponentInContainer, APIMediaGalleryItem, APIThumbnailComponent, APIModalComponent, APIModalInteractionResponseCallbackData, LocalizationMap, LocaleString, InteractionContextType, Permissions, ApplicationIntegrationType, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandAttachmentOption, APIApplicationCommandBooleanOption, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, APIApplicationCommandOption, Locale, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody } from 'discord-api-types/v10';
export * from '@discordjs/formatters'; export * from '@discordjs/formatters';
import { JSONEncodable, Equatable } from '@discordjs/util'; import { JSONEncodable, Equatable } from '@discordjs/util';
@ -40,7 +40,7 @@ declare const embedAuthorPredicate: _sapphire_shapeshift.ObjectValidator<{
}>>; }>>;
declare const RGBPredicate: _sapphire_shapeshift.NumberValidator<number>; declare const RGBPredicate: _sapphire_shapeshift.NumberValidator<number>;
declare const colorPredicate: _sapphire_shapeshift.UnionValidator<number | [number, number, number] | null>; declare const colorPredicate: _sapphire_shapeshift.UnionValidator<number | [number, number, number] | null>;
declare const descriptionPredicate: _sapphire_shapeshift.UnionValidator<string | null>; declare const descriptionPredicate$1: _sapphire_shapeshift.UnionValidator<string | null>;
declare const footerTextPredicate: _sapphire_shapeshift.UnionValidator<string | null>; declare const footerTextPredicate: _sapphire_shapeshift.UnionValidator<string | null>;
declare const embedFooterPredicate: _sapphire_shapeshift.ObjectValidator<{ declare const embedFooterPredicate: _sapphire_shapeshift.ObjectValidator<{
text: string | null; text: string | null;
@ -52,26 +52,25 @@ declare const embedFooterPredicate: _sapphire_shapeshift.ObjectValidator<{
declare const timestampPredicate: _sapphire_shapeshift.UnionValidator<number | Date | null>; declare const timestampPredicate: _sapphire_shapeshift.UnionValidator<number | Date | null>;
declare const titlePredicate: _sapphire_shapeshift.UnionValidator<string | null>; declare const titlePredicate: _sapphire_shapeshift.UnionValidator<string | null>;
declare const Assertions$5_RGBPredicate: typeof RGBPredicate; declare const Assertions$6_RGBPredicate: typeof RGBPredicate;
declare const Assertions$5_authorNamePredicate: typeof authorNamePredicate; declare const Assertions$6_authorNamePredicate: typeof authorNamePredicate;
declare const Assertions$5_colorPredicate: typeof colorPredicate; declare const Assertions$6_colorPredicate: typeof colorPredicate;
declare const Assertions$5_descriptionPredicate: typeof descriptionPredicate; declare const Assertions$6_embedAuthorPredicate: typeof embedAuthorPredicate;
declare const Assertions$5_embedAuthorPredicate: typeof embedAuthorPredicate; declare const Assertions$6_embedFieldPredicate: typeof embedFieldPredicate;
declare const Assertions$5_embedFieldPredicate: typeof embedFieldPredicate; declare const Assertions$6_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
declare const Assertions$5_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate; declare const Assertions$6_embedFooterPredicate: typeof embedFooterPredicate;
declare const Assertions$5_embedFooterPredicate: typeof embedFooterPredicate; declare const Assertions$6_fieldInlinePredicate: typeof fieldInlinePredicate;
declare const Assertions$5_fieldInlinePredicate: typeof fieldInlinePredicate; declare const Assertions$6_fieldLengthPredicate: typeof fieldLengthPredicate;
declare const Assertions$5_fieldLengthPredicate: typeof fieldLengthPredicate; declare const Assertions$6_fieldNamePredicate: typeof fieldNamePredicate;
declare const Assertions$5_fieldNamePredicate: typeof fieldNamePredicate; declare const Assertions$6_fieldValuePredicate: typeof fieldValuePredicate;
declare const Assertions$5_fieldValuePredicate: typeof fieldValuePredicate; declare const Assertions$6_footerTextPredicate: typeof footerTextPredicate;
declare const Assertions$5_footerTextPredicate: typeof footerTextPredicate; declare const Assertions$6_imageURLPredicate: typeof imageURLPredicate;
declare const Assertions$5_imageURLPredicate: typeof imageURLPredicate; declare const Assertions$6_timestampPredicate: typeof timestampPredicate;
declare const Assertions$5_timestampPredicate: typeof timestampPredicate; declare const Assertions$6_titlePredicate: typeof titlePredicate;
declare const Assertions$5_titlePredicate: typeof titlePredicate; declare const Assertions$6_urlPredicate: typeof urlPredicate;
declare const Assertions$5_urlPredicate: typeof urlPredicate; declare const Assertions$6_validateFieldLength: typeof validateFieldLength;
declare const Assertions$5_validateFieldLength: typeof validateFieldLength; declare namespace Assertions$6 {
declare namespace Assertions$5 { export { Assertions$6_RGBPredicate as RGBPredicate, Assertions$6_authorNamePredicate as authorNamePredicate, Assertions$6_colorPredicate as colorPredicate, descriptionPredicate$1 as descriptionPredicate, Assertions$6_embedAuthorPredicate as embedAuthorPredicate, Assertions$6_embedFieldPredicate as embedFieldPredicate, Assertions$6_embedFieldsArrayPredicate as embedFieldsArrayPredicate, Assertions$6_embedFooterPredicate as embedFooterPredicate, Assertions$6_fieldInlinePredicate as fieldInlinePredicate, Assertions$6_fieldLengthPredicate as fieldLengthPredicate, Assertions$6_fieldNamePredicate as fieldNamePredicate, Assertions$6_fieldValuePredicate as fieldValuePredicate, Assertions$6_footerTextPredicate as footerTextPredicate, Assertions$6_imageURLPredicate as imageURLPredicate, Assertions$6_timestampPredicate as timestampPredicate, Assertions$6_titlePredicate as titlePredicate, Assertions$6_urlPredicate as urlPredicate, Assertions$6_validateFieldLength as validateFieldLength };
export { Assertions$5_RGBPredicate as RGBPredicate, Assertions$5_authorNamePredicate as authorNamePredicate, Assertions$5_colorPredicate as colorPredicate, Assertions$5_descriptionPredicate as descriptionPredicate, Assertions$5_embedAuthorPredicate as embedAuthorPredicate, Assertions$5_embedFieldPredicate as embedFieldPredicate, Assertions$5_embedFieldsArrayPredicate as embedFieldsArrayPredicate, Assertions$5_embedFooterPredicate as embedFooterPredicate, Assertions$5_fieldInlinePredicate as fieldInlinePredicate, Assertions$5_fieldLengthPredicate as fieldLengthPredicate, Assertions$5_fieldNamePredicate as fieldNamePredicate, Assertions$5_fieldValuePredicate as fieldValuePredicate, Assertions$5_footerTextPredicate as footerTextPredicate, Assertions$5_imageURLPredicate as imageURLPredicate, Assertions$5_timestampPredicate as timestampPredicate, Assertions$5_titlePredicate as titlePredicate, Assertions$5_urlPredicate as urlPredicate, Assertions$5_validateFieldLength as validateFieldLength };
} }
/** /**
@ -346,6 +345,7 @@ declare class StringSelectMenuOptionBuilder implements JSONEncodable<APISelectMe
toJSON(): APISelectMenuOption; toJSON(): APISelectMenuOption;
} }
declare const idValidator: _sapphire_shapeshift.NumberValidator<number>;
declare const customIdValidator: _sapphire_shapeshift.StringValidator<string>; declare const customIdValidator: _sapphire_shapeshift.StringValidator<string>;
declare const emojiValidator: _sapphire_shapeshift.ObjectValidator<{ declare const emojiValidator: _sapphire_shapeshift.ObjectValidator<{
name?: string | undefined; name?: string | undefined;
@ -393,31 +393,32 @@ declare const channelTypesValidator: _sapphire_shapeshift.ArrayValidator<Channel
declare const urlValidator: _sapphire_shapeshift.StringValidator<string>; declare const urlValidator: _sapphire_shapeshift.StringValidator<string>;
declare function validateRequiredButtonParameters(style?: ButtonStyle, label?: string, emoji?: APIMessageComponentEmoji, customId?: string, skuId?: string, url?: string): void; declare function validateRequiredButtonParameters(style?: ButtonStyle, label?: string, emoji?: APIMessageComponentEmoji, customId?: string, skuId?: string, url?: string): void;
declare const Assertions$4_buttonLabelValidator: typeof buttonLabelValidator; declare const Assertions$5_buttonLabelValidator: typeof buttonLabelValidator;
declare const Assertions$4_buttonStyleValidator: typeof buttonStyleValidator; declare const Assertions$5_buttonStyleValidator: typeof buttonStyleValidator;
declare const Assertions$4_channelTypesValidator: typeof channelTypesValidator; declare const Assertions$5_channelTypesValidator: typeof channelTypesValidator;
declare const Assertions$4_customIdValidator: typeof customIdValidator; declare const Assertions$5_customIdValidator: typeof customIdValidator;
declare const Assertions$4_defaultValidator: typeof defaultValidator; declare const Assertions$5_defaultValidator: typeof defaultValidator;
declare const Assertions$4_disabledValidator: typeof disabledValidator; declare const Assertions$5_disabledValidator: typeof disabledValidator;
declare const Assertions$4_emojiValidator: typeof emojiValidator; declare const Assertions$5_emojiValidator: typeof emojiValidator;
declare const Assertions$4_jsonOptionValidator: typeof jsonOptionValidator; declare const Assertions$5_idValidator: typeof idValidator;
declare const Assertions$4_labelValueDescriptionValidator: typeof labelValueDescriptionValidator; declare const Assertions$5_jsonOptionValidator: typeof jsonOptionValidator;
declare const Assertions$4_minMaxValidator: typeof minMaxValidator; declare const Assertions$5_labelValueDescriptionValidator: typeof labelValueDescriptionValidator;
declare const Assertions$4_optionValidator: typeof optionValidator; declare const Assertions$5_minMaxValidator: typeof minMaxValidator;
declare const Assertions$4_optionsLengthValidator: typeof optionsLengthValidator; declare const Assertions$5_optionValidator: typeof optionValidator;
declare const Assertions$4_optionsValidator: typeof optionsValidator; declare const Assertions$5_optionsLengthValidator: typeof optionsLengthValidator;
declare const Assertions$4_urlValidator: typeof urlValidator; declare const Assertions$5_optionsValidator: typeof optionsValidator;
declare const Assertions$4_validateRequiredButtonParameters: typeof validateRequiredButtonParameters; declare const Assertions$5_urlValidator: typeof urlValidator;
declare const Assertions$4_validateRequiredSelectMenuOptionParameters: typeof validateRequiredSelectMenuOptionParameters; declare const Assertions$5_validateRequiredButtonParameters: typeof validateRequiredButtonParameters;
declare const Assertions$4_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters; declare const Assertions$5_validateRequiredSelectMenuOptionParameters: typeof validateRequiredSelectMenuOptionParameters;
declare namespace Assertions$4 { declare const Assertions$5_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters;
export { Assertions$4_buttonLabelValidator as buttonLabelValidator, Assertions$4_buttonStyleValidator as buttonStyleValidator, Assertions$4_channelTypesValidator as channelTypesValidator, Assertions$4_customIdValidator as customIdValidator, Assertions$4_defaultValidator as defaultValidator, Assertions$4_disabledValidator as disabledValidator, Assertions$4_emojiValidator as emojiValidator, Assertions$4_jsonOptionValidator as jsonOptionValidator, Assertions$4_labelValueDescriptionValidator as labelValueDescriptionValidator, Assertions$4_minMaxValidator as minMaxValidator, Assertions$4_optionValidator as optionValidator, Assertions$4_optionsLengthValidator as optionsLengthValidator, Assertions$4_optionsValidator as optionsValidator, placeholderValidator$1 as placeholderValidator, Assertions$4_urlValidator as urlValidator, Assertions$4_validateRequiredButtonParameters as validateRequiredButtonParameters, Assertions$4_validateRequiredSelectMenuOptionParameters as validateRequiredSelectMenuOptionParameters, Assertions$4_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters }; declare namespace Assertions$5 {
export { Assertions$5_buttonLabelValidator as buttonLabelValidator, Assertions$5_buttonStyleValidator as buttonStyleValidator, Assertions$5_channelTypesValidator as channelTypesValidator, Assertions$5_customIdValidator as customIdValidator, Assertions$5_defaultValidator as defaultValidator, Assertions$5_disabledValidator as disabledValidator, Assertions$5_emojiValidator as emojiValidator, Assertions$5_idValidator as idValidator, Assertions$5_jsonOptionValidator as jsonOptionValidator, Assertions$5_labelValueDescriptionValidator as labelValueDescriptionValidator, Assertions$5_minMaxValidator as minMaxValidator, Assertions$5_optionValidator as optionValidator, Assertions$5_optionsLengthValidator as optionsLengthValidator, Assertions$5_optionsValidator as optionsValidator, placeholderValidator$1 as placeholderValidator, Assertions$5_urlValidator as urlValidator, Assertions$5_validateRequiredButtonParameters as validateRequiredButtonParameters, Assertions$5_validateRequiredSelectMenuOptionParameters as validateRequiredSelectMenuOptionParameters, Assertions$5_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters };
} }
/** /**
* Any action row component data represented as an object. * Any action row component data represented as an object.
*/ */
type AnyAPIActionRowComponent = APIActionRowComponent<APIActionRowComponentTypes> | APIActionRowComponentTypes; type AnyAPIActionRowComponent = APIActionRowComponent<APIComponentInActionRow> | APIComponentInActionRow | APIMessageComponent;
/** /**
* The base component builder that contains common symbols for all sorts of components. * The base component builder that contains common symbols for all sorts of components.
* *
@ -442,6 +443,16 @@ declare abstract class ComponentBuilder<DataType extends Partial<APIBaseComponen
* @param data - The data to construct a component out of * @param data - The data to construct a component out of
*/ */
constructor(data: Partial<DataType>); constructor(data: Partial<DataType>);
/**
* Sets the id (not the custom id) for this component.
*
* @param id - The id for this component
*/
setId(id: number): this;
/**
* Clears the id of this component, defaulting to a default incremented id.
*/
clearId(): this;
} }
/** /**
@ -940,10 +951,6 @@ declare class TextInputBuilder extends ComponentBuilder<APITextInputComponent> i
equals(other: APITextInputComponent | JSONEncodable<APITextInputComponent>): boolean; equals(other: APITextInputComponent | JSONEncodable<APITextInputComponent>): boolean;
} }
/**
* The builders that may be used for messages.
*/
type MessageComponentBuilder = ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder;
/** /**
* The builders that may be used for modals. * The builders that may be used for modals.
*/ */
@ -965,7 +972,7 @@ type AnyComponentBuilder = MessageActionRowComponentBuilder | ModalActionRowComp
* *
* @typeParam ComponentType - The types of components this action row holds * @typeParam ComponentType - The types of components this action row holds
*/ */
declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extends ComponentBuilder<APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>> { declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extends ComponentBuilder<APIActionRowComponent<APIComponentInMessageActionRow | APIComponentInModalActionRow>> {
/** /**
* The components within this action row. * The components within this action row.
*/ */
@ -1004,7 +1011,7 @@ declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extend
* .addComponents(button2, button3); * .addComponents(button2, button3);
* ``` * ```
*/ */
constructor({ components, ...data }?: Partial<APIActionRowComponent<APIActionRowComponentTypes>>); constructor({ components, ...data }?: Partial<APIActionRowComponent<APIComponentInActionRow>>);
/** /**
* Adds components to this action row. * Adds components to this action row.
* *
@ -1023,6 +1030,504 @@ declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extend
toJSON(): APIActionRowComponent<ReturnType<ComponentType['toJSON']>>; toJSON(): APIActionRowComponent<ReturnType<ComponentType['toJSON']>>;
} }
declare class FileBuilder extends ComponentBuilder<APIFileComponent> {
/**
* Creates a new file from API data.
*
* @param data - The API data to create this file with
* @example
* Creating a file from an API data object:
* ```ts
* const file = new FileBuilder({
* spoiler: true,
* file: {
* url: 'attachment://file.png',
* },
* });
* ```
* @example
* Creating a file using setters and API data:
* ```ts
* const file = new FileBuilder({
* file: {
* url: 'attachment://image.jpg',
* },
* })
* .setSpoiler(false);
* ```
*/
constructor(data?: Partial<APIFileComponent>);
/**
* Sets the spoiler status of this file.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* Sets the media URL of this file.
*
* @param url - The URL to use
*/
setURL(url: string): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APIFileComponent;
}
declare class SeparatorBuilder extends ComponentBuilder<APISeparatorComponent> {
/**
* Creates a new separator from API data.
*
* @param data - The API data to create this separator with
* @example
* Creating a separator from an API data object:
* ```ts
* const separator = new SeparatorBuilder({
* spacing: SeparatorSpacingSize.Small,
* divider: true,
* });
* ```
* @example
* Creating a separator using setters and API data:
* ```ts
* const separator = new SeparatorBuilder({
* spacing: SeparatorSpacingSize.Large,
* })
* .setDivider(false);
* ```
*/
constructor(data?: Partial<APISeparatorComponent>);
/**
* Sets whether this separator should show a divider line.
*
* @param divider - Whether to show a divider line
*/
setDivider(divider?: boolean): this;
/**
* Sets the spacing of this separator.
*
* @param spacing - The spacing to use
*/
setSpacing(spacing: SeparatorSpacingSize): this;
/**
* Clears the spacing of this separator.
*/
clearSpacing(): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APISeparatorComponent;
}
declare class TextDisplayBuilder extends ComponentBuilder<APITextDisplayComponent> {
/**
* Creates a new text display from API data.
*
* @param data - The API data to create this text display with
* @example
* Creating a text display from an API data object:
* ```ts
* const textDisplay = new TextDisplayBuilder({
* content: 'some text',
* });
* ```
* @example
* Creating a text display using setters and API data:
* ```ts
* const textDisplay = new TextDisplayBuilder({
* content: 'old text',
* })
* .setContent('new text');
* ```
*/
constructor(data?: Partial<APITextDisplayComponent>);
/**
* Sets the text of this text display.
*
* @param content - The text to use
*/
setContent(content: string): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APITextDisplayComponent;
}
/**
* The builders that may be used within a container.
*/
type ContainerComponentBuilder = ActionRowBuilder<AnyComponentBuilder> | FileBuilder | MediaGalleryBuilder | SectionBuilder | SeparatorBuilder | TextDisplayBuilder;
/**
* A builder that creates API-compatible JSON data for a container.
*/
declare class ContainerBuilder extends ComponentBuilder<APIContainerComponent> {
/**
* The components within this container.
*/
readonly components: ContainerComponentBuilder[];
/**
* Creates a new container from API data.
*
* @param data - The API data to create this container with
* @example
* Creating a container from an API data object:
* ```ts
* const container = new ContainerBuilder({
* components: [
* {
* content: "Some text here",
* type: ComponentType.TextDisplay,
* },
* ],
* });
* ```
* @example
* Creating a container using setters and API data:
* ```ts
* const container = new ContainerBuilder({
* components: [
* {
* content: "# Heading",
* type: ComponentType.TextDisplay,
* },
* ],
* })
* .addComponents(separator, section);
* ```
*/
constructor({ components, ...data }?: Partial<APIContainerComponent>);
/**
* Sets the accent color of this container.
*
* @param color - The color to use
*/
setAccentColor(color?: RGBTuple | number): this;
/**
* Clears the accent color of this container.
*/
clearAccentColor(): this;
/**
* Adds action row components to this container.
*
* @param components - The action row components to add
*/
addActionRowComponents<ComponentType extends MessageActionRowComponentBuilder>(...components: RestOrArray<ActionRowBuilder<ComponentType> | APIActionRowComponent<APIComponentInMessageActionRow> | ((builder: ActionRowBuilder<ComponentType>) => ActionRowBuilder<ComponentType>)>): this;
/**
* Adds file components to this container.
*
* @param components - The file components to add
*/
addFileComponents(...components: RestOrArray<APIFileComponent | FileBuilder | ((builder: FileBuilder) => FileBuilder)>): this;
/**
* Adds media gallery components to this container.
*
* @param components - The media gallery components to add
*/
addMediaGalleryComponents(...components: RestOrArray<APIMediaGalleryComponent | MediaGalleryBuilder | ((builder: MediaGalleryBuilder) => MediaGalleryBuilder)>): this;
/**
* Adds section components to this container.
*
* @param components - The section components to add
*/
addSectionComponents(...components: RestOrArray<APISectionComponent | SectionBuilder | ((builder: SectionBuilder) => SectionBuilder)>): this;
/**
* Adds separator components to this container.
*
* @param components - The separator components to add
*/
addSeparatorComponents(...components: RestOrArray<APISeparatorComponent | SeparatorBuilder | ((builder: SeparatorBuilder) => SeparatorBuilder)>): this;
/**
* Adds text display components to this container.
*
* @param components - The text display components to add
*/
addTextDisplayComponents(...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>): this;
/**
* Removes, replaces, or inserts components for this container.
*
* @param index - The index to start removing, replacing or inserting components
* @param deleteCount - The amount of components to remove
* @param components - The components to set
*/
spliceComponents(index: number, deleteCount: number, ...components: RestOrArray<APIComponentInContainer | ContainerComponentBuilder>): this;
/**
* Sets the spoiler status of this container.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APIContainerComponent;
}
declare class MediaGalleryItemBuilder implements JSONEncodable<APIMediaGalleryItem> {
/**
* The API data associated with this media gallery item.
*/
readonly data: Partial<APIMediaGalleryItem>;
/**
* Creates a new media gallery item from API data.
*
* @param data - The API data to create this media gallery item with
* @example
* Creating a media gallery item from an API data object:
* ```ts
* const item = new MediaGalleryItemBuilder({
* description: "Some text here",
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/2.png',
* },
* });
* ```
* @example
* Creating a media gallery item using setters and API data:
* ```ts
* const item = new MediaGalleryItemBuilder({
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/5.png',
* },
* })
* .setDescription("alt text");
* ```
*/
constructor(data?: Partial<APIMediaGalleryItem>);
/**
* Sets the description of this media gallery item.
*
* @param description - The description to use
*/
setDescription(description: string): this;
/**
* Clears the description of this media gallery item.
*/
clearDescription(): this;
/**
* Sets the spoiler status of this media gallery item.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* Sets the media URL of this media gallery item.
*
* @param url - The URL to use
*/
setURL(url: string): this;
/**
* Serializes this builder to API-compatible JSON data.
*
* @remarks
* This method runs validations on the data before serializing it.
* As such, it may throw an error if the data is invalid.
*/
toJSON(): APIMediaGalleryItem;
}
/**
* A builder that creates API-compatible JSON data for a container.
*/
declare class MediaGalleryBuilder extends ComponentBuilder<APIMediaGalleryComponent> {
/**
* The components within this container.
*/
readonly items: MediaGalleryItemBuilder[];
/**
* Creates a new media gallery from API data.
*
* @param data - The API data to create this media gallery with
* @example
* Creating a media gallery from an API data object:
* ```ts
* const mediaGallery = new MediaGalleryBuilder({
* items: [
* {
* description: "Some text here",
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/2.png',
* },
* },
* ],
* });
* ```
* @example
* Creating a media gallery using setters and API data:
* ```ts
* const mediaGallery = new MediaGalleryBuilder({
* items: [
* {
* description: "alt text",
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/5.png',
* },
* },
* ],
* })
* .addItems(item2, item3);
* ```
*/
constructor({ items, ...data }?: Partial<APIMediaGalleryComponent>);
/**
* Adds items to this media gallery.
*
* @param items - The items to add
*/
addItems(...items: RestOrArray<APIMediaGalleryItem | MediaGalleryItemBuilder | ((builder: MediaGalleryItemBuilder) => MediaGalleryItemBuilder)>): this;
/**
* Removes, replaces, or inserts media gallery items for this media gallery.
*
* @param index - The index to start removing, replacing or inserting items
* @param deleteCount - The amount of items to remove
* @param items - The items to insert
*/
spliceItems(index: number, deleteCount: number, ...items: RestOrArray<APIMediaGalleryItem | MediaGalleryItemBuilder | ((builder: MediaGalleryItemBuilder) => MediaGalleryItemBuilder)>): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APIMediaGalleryComponent;
}
/**
* A builder that creates API-compatible JSON data for a section.
*/
declare class SectionBuilder extends ComponentBuilder<APISectionComponent> {
/**
* The components within this section.
*/
readonly components: ComponentBuilder[];
/**
* The accessory of this section.
*/
readonly accessory?: ButtonBuilder | ThumbnailBuilder;
/**
* Creates a new section from API data.
*
* @param data - The API data to create this section with
* @example
* Creating a section from an API data object:
* ```ts
* const section = new SectionBuilder({
* components: [
* {
* content: "Some text here",
* type: ComponentType.TextDisplay,
* },
* ],
* accessory: {
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/3.png',
* },
* }
* });
* ```
* @example
* Creating a section using setters and API data:
* ```ts
* const section = new SectionBuilder({
* components: [
* {
* content: "# Heading",
* type: ComponentType.TextDisplay,
* },
* ],
* })
* .setPrimaryButtonAccessory(button);
* ```
*/
constructor({ components, accessory, ...data }?: Partial<APISectionComponent>);
/**
* Sets the accessory of this section to a button.
*
* @param accessory - The accessory to use
*/
setButtonAccessory(accessory: APIButtonComponent | ButtonBuilder | ((builder: ButtonBuilder) => ButtonBuilder)): this;
/**
* Sets the accessory of this section to a thumbnail.
*
* @param accessory - The accessory to use
*/
setThumbnailAccessory(accessory: APIThumbnailComponent | ThumbnailBuilder | ((builder: ThumbnailBuilder) => ThumbnailBuilder)): this;
/**
* Adds text display components to this section.
*
* @param components - The text display components to add
*/
addTextDisplayComponents(...components: RestOrArray<TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>): this;
/**
* Removes, replaces, or inserts text display components for this section.
*
* @param index - The index to start removing, replacing or inserting text display components
* @param deleteCount - The amount of text display components to remove
* @param components - The text display components to insert
*/
spliceTextDisplayComponents(index: number, deleteCount: number, ...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APISectionComponent;
}
declare class ThumbnailBuilder extends ComponentBuilder<APIThumbnailComponent> {
/**
* Creates a new thumbnail from API data.
*
* @param data - The API data to create this thumbnail with
* @example
* Creating a thumbnail from an API data object:
* ```ts
* const thumbnail = new ThumbnailBuilder({
* description: 'some text',
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/4.png',
* },
* });
* ```
* @example
* Creating a thumbnail using setters and API data:
* ```ts
* const thumbnail = new ThumbnailBuilder({
* media: {
* url: 'attachment://image.png',
* },
* })
* .setDescription('alt text');
* ```
*/
constructor(data?: Partial<APIThumbnailComponent>);
/**
* Sets the description of this thumbnail.
*
* @param description - The description to use
*/
setDescription(description: string): this;
/**
* Clears the description of this thumbnail.
*/
clearDescription(): this;
/**
* Sets the spoiler status of this thumbnail.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* Sets the media URL of this thumbnail.
*
* @param url - The URL to use
*/
setURL(url: string): this;
/**
* {@inheritdoc ComponentBuilder.toJSON}
*/
toJSON(): APIThumbnailComponent;
}
/**
* The builders that may be used for messages.
*/
type MessageComponentBuilder = ActionRowBuilder<MessageActionRowComponentBuilder> | ContainerBuilder | FileBuilder | MediaGalleryBuilder | MessageActionRowComponentBuilder | SectionBuilder | SeparatorBuilder | TextDisplayBuilder | ThumbnailBuilder;
/** /**
* Components here are mapped to their respective builder. * Components here are mapped to their respective builder.
*/ */
@ -1059,6 +1564,34 @@ interface MappedComponentTypes {
* The channel select component type is associated with a {@link ChannelSelectMenuBuilder}. * The channel select component type is associated with a {@link ChannelSelectMenuBuilder}.
*/ */
[ComponentType.ChannelSelect]: ChannelSelectMenuBuilder; [ComponentType.ChannelSelect]: ChannelSelectMenuBuilder;
/**
* The file component type is associated with a {@link FileBuilder}.
*/
[ComponentType.File]: FileBuilder;
/**
* The separator component type is associated with a {@link SeparatorBuilder}.
*/
[ComponentType.Separator]: SeparatorBuilder;
/**
* The container component type is associated with a {@link ContainerBuilder}.
*/
[ComponentType.Container]: ContainerBuilder;
/**
* The text display component type is associated with a {@link TextDisplayBuilder}.
*/
[ComponentType.TextDisplay]: TextDisplayBuilder;
/**
* The thumbnail component type is associated with a {@link ThumbnailBuilder}.
*/
[ComponentType.Thumbnail]: ThumbnailBuilder;
/**
* The section component type is associated with a {@link SectionBuilder}.
*/
[ComponentType.Section]: SectionBuilder;
/**
* The media gallery component type is associated with a {@link MediaGalleryBuilder}.
*/
[ComponentType.MediaGallery]: MediaGalleryBuilder;
} }
/** /**
* Factory for creating components from API data. * Factory for creating components from API data.
@ -1076,6 +1609,7 @@ declare function createComponentBuilder<ComponentType extends keyof MappedCompon
* @param data - The API data to transform to a component class * @param data - The API data to transform to a component class
*/ */
declare function createComponentBuilder<ComponentBuilder extends MessageComponentBuilder | ModalComponentBuilder>(data: ComponentBuilder): ComponentBuilder; declare function createComponentBuilder<ComponentBuilder extends MessageComponentBuilder | ModalComponentBuilder>(data: ComponentBuilder): ComponentBuilder;
declare function resolveBuilder<ComponentType extends Record<PropertyKey, any>, Builder extends JSONEncodable<any>>(builder: Builder | ComponentType | ((builder: Builder) => Builder), Constructor: new (data?: ComponentType) => Builder): Builder;
declare const textInputStyleValidator: _sapphire_shapeshift.NativeEnumValidator<typeof TextInputStyle>; declare const textInputStyleValidator: _sapphire_shapeshift.NativeEnumValidator<typeof TextInputStyle>;
declare const minLengthValidator: _sapphire_shapeshift.NumberValidator<number>; declare const minLengthValidator: _sapphire_shapeshift.NumberValidator<number>;
@ -1086,15 +1620,15 @@ declare const placeholderValidator: _sapphire_shapeshift.StringValidator<string>
declare const labelValidator: _sapphire_shapeshift.StringValidator<string>; declare const labelValidator: _sapphire_shapeshift.StringValidator<string>;
declare function validateRequiredParameters$3(customId?: string, style?: TextInputStyle, label?: string): void; declare function validateRequiredParameters$3(customId?: string, style?: TextInputStyle, label?: string): void;
declare const Assertions$3_labelValidator: typeof labelValidator; declare const Assertions$4_labelValidator: typeof labelValidator;
declare const Assertions$3_maxLengthValidator: typeof maxLengthValidator; declare const Assertions$4_maxLengthValidator: typeof maxLengthValidator;
declare const Assertions$3_minLengthValidator: typeof minLengthValidator; declare const Assertions$4_minLengthValidator: typeof minLengthValidator;
declare const Assertions$3_placeholderValidator: typeof placeholderValidator; declare const Assertions$4_placeholderValidator: typeof placeholderValidator;
declare const Assertions$3_requiredValidator: typeof requiredValidator; declare const Assertions$4_requiredValidator: typeof requiredValidator;
declare const Assertions$3_textInputStyleValidator: typeof textInputStyleValidator; declare const Assertions$4_textInputStyleValidator: typeof textInputStyleValidator;
declare const Assertions$3_valueValidator: typeof valueValidator; declare const Assertions$4_valueValidator: typeof valueValidator;
declare namespace Assertions$3 { declare namespace Assertions$4 {
export { Assertions$3_labelValidator as labelValidator, Assertions$3_maxLengthValidator as maxLengthValidator, Assertions$3_minLengthValidator as minLengthValidator, Assertions$3_placeholderValidator as placeholderValidator, Assertions$3_requiredValidator as requiredValidator, Assertions$3_textInputStyleValidator as textInputStyleValidator, validateRequiredParameters$3 as validateRequiredParameters, Assertions$3_valueValidator as valueValidator }; export { Assertions$4_labelValidator as labelValidator, Assertions$4_maxLengthValidator as maxLengthValidator, Assertions$4_minLengthValidator as minLengthValidator, Assertions$4_placeholderValidator as placeholderValidator, Assertions$4_requiredValidator as requiredValidator, Assertions$4_textInputStyleValidator as textInputStyleValidator, validateRequiredParameters$3 as validateRequiredParameters, Assertions$4_valueValidator as valueValidator };
} }
/** /**
@ -1132,7 +1666,7 @@ declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseC
* *
* @param components - The components to add * @param components - The components to add
*/ */
addComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIModalActionRowComponent>>): this; addComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIComponentInModalActionRow>>): this;
/** /**
* Sets components for this modal. * Sets components for this modal.
* *
@ -1149,10 +1683,44 @@ declare const titleValidator: _sapphire_shapeshift.StringValidator<string>;
declare const componentsValidator: _sapphire_shapeshift.ArrayValidator<[ActionRowBuilder<AnyComponentBuilder>, ...ActionRowBuilder<AnyComponentBuilder>[]], ActionRowBuilder<AnyComponentBuilder>>; declare const componentsValidator: _sapphire_shapeshift.ArrayValidator<[ActionRowBuilder<AnyComponentBuilder>, ...ActionRowBuilder<AnyComponentBuilder>[]], ActionRowBuilder<AnyComponentBuilder>>;
declare function validateRequiredParameters$2(customId?: string, title?: string, components?: ActionRowBuilder<ModalActionRowComponentBuilder>[]): void; declare function validateRequiredParameters$2(customId?: string, title?: string, components?: ActionRowBuilder<ModalActionRowComponentBuilder>[]): void;
declare const Assertions$2_componentsValidator: typeof componentsValidator; declare const Assertions$3_componentsValidator: typeof componentsValidator;
declare const Assertions$2_titleValidator: typeof titleValidator; declare const Assertions$3_titleValidator: typeof titleValidator;
declare namespace Assertions$3 {
export { Assertions$3_componentsValidator as componentsValidator, Assertions$3_titleValidator as titleValidator, validateRequiredParameters$2 as validateRequiredParameters };
}
declare const unfurledMediaItemPredicate: _sapphire_shapeshift.ObjectValidator<{
url: string;
}, _sapphire_shapeshift.UndefinedToOptional<{
url: string;
}>>;
declare const descriptionPredicate: _sapphire_shapeshift.StringValidator<string>;
declare const filePredicate: _sapphire_shapeshift.ObjectValidator<{
url: string;
}, _sapphire_shapeshift.UndefinedToOptional<{
url: string;
}>>;
declare const spoilerPredicate: _sapphire_shapeshift.BooleanValidator<boolean>;
declare const dividerPredicate: _sapphire_shapeshift.BooleanValidator<boolean>;
declare const spacingPredicate: _sapphire_shapeshift.NativeEnumValidator<typeof SeparatorSpacingSize>;
declare const textDisplayContentPredicate: _sapphire_shapeshift.StringValidator<string>;
declare const accessoryPredicate: _sapphire_shapeshift.UnionValidator<ButtonBuilder | ThumbnailBuilder>;
declare const containerColorPredicate: _sapphire_shapeshift.UnionValidator<number | [number, number, number] | null | undefined>;
declare function assertReturnOfBuilder$1<ReturnType extends MediaGalleryItemBuilder | TextDisplayBuilder>(input: unknown, ExpectedInstanceOf: new () => ReturnType): asserts input is ReturnType;
declare function validateComponentArray<ReturnType extends ContainerComponentBuilder | MediaGalleryItemBuilder = ContainerComponentBuilder>(input: unknown, min: number, max: number, ExpectedInstanceOf?: new () => ReturnType): asserts input is ReturnType[];
declare const Assertions$2_accessoryPredicate: typeof accessoryPredicate;
declare const Assertions$2_containerColorPredicate: typeof containerColorPredicate;
declare const Assertions$2_descriptionPredicate: typeof descriptionPredicate;
declare const Assertions$2_dividerPredicate: typeof dividerPredicate;
declare const Assertions$2_filePredicate: typeof filePredicate;
declare const Assertions$2_spacingPredicate: typeof spacingPredicate;
declare const Assertions$2_spoilerPredicate: typeof spoilerPredicate;
declare const Assertions$2_textDisplayContentPredicate: typeof textDisplayContentPredicate;
declare const Assertions$2_unfurledMediaItemPredicate: typeof unfurledMediaItemPredicate;
declare const Assertions$2_validateComponentArray: typeof validateComponentArray;
declare namespace Assertions$2 { declare namespace Assertions$2 {
export { Assertions$2_componentsValidator as componentsValidator, Assertions$2_titleValidator as titleValidator, validateRequiredParameters$2 as validateRequiredParameters }; export { Assertions$2_accessoryPredicate as accessoryPredicate, assertReturnOfBuilder$1 as assertReturnOfBuilder, Assertions$2_containerColorPredicate as containerColorPredicate, Assertions$2_descriptionPredicate as descriptionPredicate, Assertions$2_dividerPredicate as dividerPredicate, Assertions$2_filePredicate as filePredicate, Assertions$2_spacingPredicate as spacingPredicate, Assertions$2_spoilerPredicate as spoilerPredicate, Assertions$2_textDisplayContentPredicate as textDisplayContentPredicate, Assertions$2_unfurledMediaItemPredicate as unfurledMediaItemPredicate, Assertions$2_validateComponentArray as validateComponentArray };
} }
/** /**
@ -2040,4 +2608,4 @@ declare function isValidationEnabled(): boolean;
*/ */
declare const version: string; declare const version: string;
export { ActionRowBuilder, type AnyAPIActionRowComponent, type AnyComponentBuilder, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, ApplicationCommandOptionChannelTypesMixin, ApplicationCommandOptionWithAutocompleteMixin, ApplicationCommandOptionWithChoicesMixin, BaseSelectMenuBuilder, ButtonBuilder, ChannelSelectMenuBuilder, Assertions$4 as ComponentAssertions, ComponentBuilder, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, type ContextMenuCommandType, Assertions$5 as EmbedAssertions, type EmbedAuthorData, type EmbedAuthorOptions, EmbedBuilder, type EmbedFooterData, type EmbedFooterOptions, type EmbedImageData, type IconData, type MappedComponentTypes, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, type MessageComponentBuilder, type ModalActionRowComponentBuilder, Assertions$2 as ModalAssertions, ModalBuilder, type ModalComponentBuilder, type RGBTuple, type RestOrArray, RoleSelectMenuBuilder, StringSelectMenuBuilder as SelectMenuBuilder, StringSelectMenuOptionBuilder as SelectMenuOptionBuilder, SharedNameAndDescription, SharedSlashCommand, SharedSlashCommandOptions, SharedSlashCommandSubcommands, Assertions$1 as SlashCommandAssertions, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, type SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, type SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, Assertions$3 as TextInputAssertions, TextInputBuilder, type ToAPIApplicationCommandOptions, UserSelectMenuBuilder, createComponentBuilder, disableValidators, embedLength, enableValidators, isValidationEnabled, normalizeArray, version }; export { ActionRowBuilder, type AnyAPIActionRowComponent, type AnyComponentBuilder, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, ApplicationCommandOptionChannelTypesMixin, ApplicationCommandOptionWithAutocompleteMixin, ApplicationCommandOptionWithChoicesMixin, BaseSelectMenuBuilder, ButtonBuilder, ChannelSelectMenuBuilder, Assertions$5 as ComponentAssertions, ComponentBuilder, Assertions$2 as ComponentsV2Assertions, ContainerBuilder, type ContainerComponentBuilder, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, type ContextMenuCommandType, Assertions$6 as EmbedAssertions, type EmbedAuthorData, type EmbedAuthorOptions, EmbedBuilder, type EmbedFooterData, type EmbedFooterOptions, type EmbedImageData, FileBuilder, type IconData, type MappedComponentTypes, MediaGalleryBuilder, MediaGalleryItemBuilder, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, type MessageComponentBuilder, type ModalActionRowComponentBuilder, Assertions$3 as ModalAssertions, ModalBuilder, type ModalComponentBuilder, type RGBTuple, type RestOrArray, RoleSelectMenuBuilder, SectionBuilder, StringSelectMenuBuilder as SelectMenuBuilder, StringSelectMenuOptionBuilder as SelectMenuOptionBuilder, SeparatorBuilder, SharedNameAndDescription, SharedSlashCommand, SharedSlashCommandOptions, SharedSlashCommandSubcommands, Assertions$1 as SlashCommandAssertions, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, type SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, type SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, TextDisplayBuilder, Assertions$4 as TextInputAssertions, TextInputBuilder, ThumbnailBuilder, type ToAPIApplicationCommandOptions, UserSelectMenuBuilder, createComponentBuilder, disableValidators, embedLength, enableValidators, isValidationEnabled, normalizeArray, resolveBuilder, version };

View File

@ -1,5 +1,5 @@
import * as _sapphire_shapeshift from '@sapphire/shapeshift'; import * as _sapphire_shapeshift from '@sapphire/shapeshift';
import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, ChannelType, APIActionRowComponent, APIActionRowComponentTypes, APIBaseComponent, ComponentType, APIButtonComponent, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APIMessageActionRowComponent, APIModalActionRowComponent, APIModalComponent, APIMessageComponent, APIModalInteractionResponseCallbackData, LocalizationMap, LocaleString, InteractionContextType, Permissions, ApplicationIntegrationType, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandAttachmentOption, APIApplicationCommandBooleanOption, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, APIApplicationCommandOption, Locale, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody } from 'discord-api-types/v10'; import { APIEmbedField, APIEmbedAuthor, APIEmbedFooter, APIEmbedImage, APIEmbed, APISelectMenuOption, APIMessageComponentEmoji, ButtonStyle, ChannelType, APIActionRowComponent, APIComponentInActionRow, APIMessageComponent, APIBaseComponent, ComponentType, APIButtonComponent, Snowflake, APISelectMenuComponent, APIChannelSelectComponent, APIMentionableSelectComponent, APISelectMenuDefaultValue, SelectMenuDefaultValueType, APIRoleSelectComponent, APIStringSelectComponent, APIUserSelectComponent, APITextInputComponent, TextInputStyle, APIComponentInMessageActionRow, APIComponentInModalActionRow, APIFileComponent, APISeparatorComponent, SeparatorSpacingSize, APITextDisplayComponent, APIContainerComponent, APIMediaGalleryComponent, APISectionComponent, APIComponentInContainer, APIMediaGalleryItem, APIThumbnailComponent, APIModalComponent, APIModalInteractionResponseCallbackData, LocalizationMap, LocaleString, InteractionContextType, Permissions, ApplicationIntegrationType, RESTPostAPIChatInputApplicationCommandsJSONBody, ApplicationCommandOptionType, APIApplicationCommandBasicOption, APIApplicationCommandAttachmentOption, APIApplicationCommandBooleanOption, APIApplicationCommandChannelOption, APIApplicationCommandOptionChoice, APIApplicationCommandIntegerOption, APIApplicationCommandMentionableOption, APIApplicationCommandNumberOption, APIApplicationCommandRoleOption, APIApplicationCommandStringOption, APIApplicationCommandUserOption, APIApplicationCommandSubcommandGroupOption, APIApplicationCommandSubcommandOption, APIApplicationCommandOption, Locale, ApplicationCommandType, RESTPostAPIContextMenuApplicationCommandsJSONBody } from 'discord-api-types/v10';
export * from '@discordjs/formatters'; export * from '@discordjs/formatters';
import { JSONEncodable, Equatable } from '@discordjs/util'; import { JSONEncodable, Equatable } from '@discordjs/util';
@ -40,7 +40,7 @@ declare const embedAuthorPredicate: _sapphire_shapeshift.ObjectValidator<{
}>>; }>>;
declare const RGBPredicate: _sapphire_shapeshift.NumberValidator<number>; declare const RGBPredicate: _sapphire_shapeshift.NumberValidator<number>;
declare const colorPredicate: _sapphire_shapeshift.UnionValidator<number | [number, number, number] | null>; declare const colorPredicate: _sapphire_shapeshift.UnionValidator<number | [number, number, number] | null>;
declare const descriptionPredicate: _sapphire_shapeshift.UnionValidator<string | null>; declare const descriptionPredicate$1: _sapphire_shapeshift.UnionValidator<string | null>;
declare const footerTextPredicate: _sapphire_shapeshift.UnionValidator<string | null>; declare const footerTextPredicate: _sapphire_shapeshift.UnionValidator<string | null>;
declare const embedFooterPredicate: _sapphire_shapeshift.ObjectValidator<{ declare const embedFooterPredicate: _sapphire_shapeshift.ObjectValidator<{
text: string | null; text: string | null;
@ -52,26 +52,25 @@ declare const embedFooterPredicate: _sapphire_shapeshift.ObjectValidator<{
declare const timestampPredicate: _sapphire_shapeshift.UnionValidator<number | Date | null>; declare const timestampPredicate: _sapphire_shapeshift.UnionValidator<number | Date | null>;
declare const titlePredicate: _sapphire_shapeshift.UnionValidator<string | null>; declare const titlePredicate: _sapphire_shapeshift.UnionValidator<string | null>;
declare const Assertions$5_RGBPredicate: typeof RGBPredicate; declare const Assertions$6_RGBPredicate: typeof RGBPredicate;
declare const Assertions$5_authorNamePredicate: typeof authorNamePredicate; declare const Assertions$6_authorNamePredicate: typeof authorNamePredicate;
declare const Assertions$5_colorPredicate: typeof colorPredicate; declare const Assertions$6_colorPredicate: typeof colorPredicate;
declare const Assertions$5_descriptionPredicate: typeof descriptionPredicate; declare const Assertions$6_embedAuthorPredicate: typeof embedAuthorPredicate;
declare const Assertions$5_embedAuthorPredicate: typeof embedAuthorPredicate; declare const Assertions$6_embedFieldPredicate: typeof embedFieldPredicate;
declare const Assertions$5_embedFieldPredicate: typeof embedFieldPredicate; declare const Assertions$6_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate;
declare const Assertions$5_embedFieldsArrayPredicate: typeof embedFieldsArrayPredicate; declare const Assertions$6_embedFooterPredicate: typeof embedFooterPredicate;
declare const Assertions$5_embedFooterPredicate: typeof embedFooterPredicate; declare const Assertions$6_fieldInlinePredicate: typeof fieldInlinePredicate;
declare const Assertions$5_fieldInlinePredicate: typeof fieldInlinePredicate; declare const Assertions$6_fieldLengthPredicate: typeof fieldLengthPredicate;
declare const Assertions$5_fieldLengthPredicate: typeof fieldLengthPredicate; declare const Assertions$6_fieldNamePredicate: typeof fieldNamePredicate;
declare const Assertions$5_fieldNamePredicate: typeof fieldNamePredicate; declare const Assertions$6_fieldValuePredicate: typeof fieldValuePredicate;
declare const Assertions$5_fieldValuePredicate: typeof fieldValuePredicate; declare const Assertions$6_footerTextPredicate: typeof footerTextPredicate;
declare const Assertions$5_footerTextPredicate: typeof footerTextPredicate; declare const Assertions$6_imageURLPredicate: typeof imageURLPredicate;
declare const Assertions$5_imageURLPredicate: typeof imageURLPredicate; declare const Assertions$6_timestampPredicate: typeof timestampPredicate;
declare const Assertions$5_timestampPredicate: typeof timestampPredicate; declare const Assertions$6_titlePredicate: typeof titlePredicate;
declare const Assertions$5_titlePredicate: typeof titlePredicate; declare const Assertions$6_urlPredicate: typeof urlPredicate;
declare const Assertions$5_urlPredicate: typeof urlPredicate; declare const Assertions$6_validateFieldLength: typeof validateFieldLength;
declare const Assertions$5_validateFieldLength: typeof validateFieldLength; declare namespace Assertions$6 {
declare namespace Assertions$5 { export { Assertions$6_RGBPredicate as RGBPredicate, Assertions$6_authorNamePredicate as authorNamePredicate, Assertions$6_colorPredicate as colorPredicate, descriptionPredicate$1 as descriptionPredicate, Assertions$6_embedAuthorPredicate as embedAuthorPredicate, Assertions$6_embedFieldPredicate as embedFieldPredicate, Assertions$6_embedFieldsArrayPredicate as embedFieldsArrayPredicate, Assertions$6_embedFooterPredicate as embedFooterPredicate, Assertions$6_fieldInlinePredicate as fieldInlinePredicate, Assertions$6_fieldLengthPredicate as fieldLengthPredicate, Assertions$6_fieldNamePredicate as fieldNamePredicate, Assertions$6_fieldValuePredicate as fieldValuePredicate, Assertions$6_footerTextPredicate as footerTextPredicate, Assertions$6_imageURLPredicate as imageURLPredicate, Assertions$6_timestampPredicate as timestampPredicate, Assertions$6_titlePredicate as titlePredicate, Assertions$6_urlPredicate as urlPredicate, Assertions$6_validateFieldLength as validateFieldLength };
export { Assertions$5_RGBPredicate as RGBPredicate, Assertions$5_authorNamePredicate as authorNamePredicate, Assertions$5_colorPredicate as colorPredicate, Assertions$5_descriptionPredicate as descriptionPredicate, Assertions$5_embedAuthorPredicate as embedAuthorPredicate, Assertions$5_embedFieldPredicate as embedFieldPredicate, Assertions$5_embedFieldsArrayPredicate as embedFieldsArrayPredicate, Assertions$5_embedFooterPredicate as embedFooterPredicate, Assertions$5_fieldInlinePredicate as fieldInlinePredicate, Assertions$5_fieldLengthPredicate as fieldLengthPredicate, Assertions$5_fieldNamePredicate as fieldNamePredicate, Assertions$5_fieldValuePredicate as fieldValuePredicate, Assertions$5_footerTextPredicate as footerTextPredicate, Assertions$5_imageURLPredicate as imageURLPredicate, Assertions$5_timestampPredicate as timestampPredicate, Assertions$5_titlePredicate as titlePredicate, Assertions$5_urlPredicate as urlPredicate, Assertions$5_validateFieldLength as validateFieldLength };
} }
/** /**
@ -346,6 +345,7 @@ declare class StringSelectMenuOptionBuilder implements JSONEncodable<APISelectMe
toJSON(): APISelectMenuOption; toJSON(): APISelectMenuOption;
} }
declare const idValidator: _sapphire_shapeshift.NumberValidator<number>;
declare const customIdValidator: _sapphire_shapeshift.StringValidator<string>; declare const customIdValidator: _sapphire_shapeshift.StringValidator<string>;
declare const emojiValidator: _sapphire_shapeshift.ObjectValidator<{ declare const emojiValidator: _sapphire_shapeshift.ObjectValidator<{
name?: string | undefined; name?: string | undefined;
@ -393,31 +393,32 @@ declare const channelTypesValidator: _sapphire_shapeshift.ArrayValidator<Channel
declare const urlValidator: _sapphire_shapeshift.StringValidator<string>; declare const urlValidator: _sapphire_shapeshift.StringValidator<string>;
declare function validateRequiredButtonParameters(style?: ButtonStyle, label?: string, emoji?: APIMessageComponentEmoji, customId?: string, skuId?: string, url?: string): void; declare function validateRequiredButtonParameters(style?: ButtonStyle, label?: string, emoji?: APIMessageComponentEmoji, customId?: string, skuId?: string, url?: string): void;
declare const Assertions$4_buttonLabelValidator: typeof buttonLabelValidator; declare const Assertions$5_buttonLabelValidator: typeof buttonLabelValidator;
declare const Assertions$4_buttonStyleValidator: typeof buttonStyleValidator; declare const Assertions$5_buttonStyleValidator: typeof buttonStyleValidator;
declare const Assertions$4_channelTypesValidator: typeof channelTypesValidator; declare const Assertions$5_channelTypesValidator: typeof channelTypesValidator;
declare const Assertions$4_customIdValidator: typeof customIdValidator; declare const Assertions$5_customIdValidator: typeof customIdValidator;
declare const Assertions$4_defaultValidator: typeof defaultValidator; declare const Assertions$5_defaultValidator: typeof defaultValidator;
declare const Assertions$4_disabledValidator: typeof disabledValidator; declare const Assertions$5_disabledValidator: typeof disabledValidator;
declare const Assertions$4_emojiValidator: typeof emojiValidator; declare const Assertions$5_emojiValidator: typeof emojiValidator;
declare const Assertions$4_jsonOptionValidator: typeof jsonOptionValidator; declare const Assertions$5_idValidator: typeof idValidator;
declare const Assertions$4_labelValueDescriptionValidator: typeof labelValueDescriptionValidator; declare const Assertions$5_jsonOptionValidator: typeof jsonOptionValidator;
declare const Assertions$4_minMaxValidator: typeof minMaxValidator; declare const Assertions$5_labelValueDescriptionValidator: typeof labelValueDescriptionValidator;
declare const Assertions$4_optionValidator: typeof optionValidator; declare const Assertions$5_minMaxValidator: typeof minMaxValidator;
declare const Assertions$4_optionsLengthValidator: typeof optionsLengthValidator; declare const Assertions$5_optionValidator: typeof optionValidator;
declare const Assertions$4_optionsValidator: typeof optionsValidator; declare const Assertions$5_optionsLengthValidator: typeof optionsLengthValidator;
declare const Assertions$4_urlValidator: typeof urlValidator; declare const Assertions$5_optionsValidator: typeof optionsValidator;
declare const Assertions$4_validateRequiredButtonParameters: typeof validateRequiredButtonParameters; declare const Assertions$5_urlValidator: typeof urlValidator;
declare const Assertions$4_validateRequiredSelectMenuOptionParameters: typeof validateRequiredSelectMenuOptionParameters; declare const Assertions$5_validateRequiredButtonParameters: typeof validateRequiredButtonParameters;
declare const Assertions$4_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters; declare const Assertions$5_validateRequiredSelectMenuOptionParameters: typeof validateRequiredSelectMenuOptionParameters;
declare namespace Assertions$4 { declare const Assertions$5_validateRequiredSelectMenuParameters: typeof validateRequiredSelectMenuParameters;
export { Assertions$4_buttonLabelValidator as buttonLabelValidator, Assertions$4_buttonStyleValidator as buttonStyleValidator, Assertions$4_channelTypesValidator as channelTypesValidator, Assertions$4_customIdValidator as customIdValidator, Assertions$4_defaultValidator as defaultValidator, Assertions$4_disabledValidator as disabledValidator, Assertions$4_emojiValidator as emojiValidator, Assertions$4_jsonOptionValidator as jsonOptionValidator, Assertions$4_labelValueDescriptionValidator as labelValueDescriptionValidator, Assertions$4_minMaxValidator as minMaxValidator, Assertions$4_optionValidator as optionValidator, Assertions$4_optionsLengthValidator as optionsLengthValidator, Assertions$4_optionsValidator as optionsValidator, placeholderValidator$1 as placeholderValidator, Assertions$4_urlValidator as urlValidator, Assertions$4_validateRequiredButtonParameters as validateRequiredButtonParameters, Assertions$4_validateRequiredSelectMenuOptionParameters as validateRequiredSelectMenuOptionParameters, Assertions$4_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters }; declare namespace Assertions$5 {
export { Assertions$5_buttonLabelValidator as buttonLabelValidator, Assertions$5_buttonStyleValidator as buttonStyleValidator, Assertions$5_channelTypesValidator as channelTypesValidator, Assertions$5_customIdValidator as customIdValidator, Assertions$5_defaultValidator as defaultValidator, Assertions$5_disabledValidator as disabledValidator, Assertions$5_emojiValidator as emojiValidator, Assertions$5_idValidator as idValidator, Assertions$5_jsonOptionValidator as jsonOptionValidator, Assertions$5_labelValueDescriptionValidator as labelValueDescriptionValidator, Assertions$5_minMaxValidator as minMaxValidator, Assertions$5_optionValidator as optionValidator, Assertions$5_optionsLengthValidator as optionsLengthValidator, Assertions$5_optionsValidator as optionsValidator, placeholderValidator$1 as placeholderValidator, Assertions$5_urlValidator as urlValidator, Assertions$5_validateRequiredButtonParameters as validateRequiredButtonParameters, Assertions$5_validateRequiredSelectMenuOptionParameters as validateRequiredSelectMenuOptionParameters, Assertions$5_validateRequiredSelectMenuParameters as validateRequiredSelectMenuParameters };
} }
/** /**
* Any action row component data represented as an object. * Any action row component data represented as an object.
*/ */
type AnyAPIActionRowComponent = APIActionRowComponent<APIActionRowComponentTypes> | APIActionRowComponentTypes; type AnyAPIActionRowComponent = APIActionRowComponent<APIComponentInActionRow> | APIComponentInActionRow | APIMessageComponent;
/** /**
* The base component builder that contains common symbols for all sorts of components. * The base component builder that contains common symbols for all sorts of components.
* *
@ -442,6 +443,16 @@ declare abstract class ComponentBuilder<DataType extends Partial<APIBaseComponen
* @param data - The data to construct a component out of * @param data - The data to construct a component out of
*/ */
constructor(data: Partial<DataType>); constructor(data: Partial<DataType>);
/**
* Sets the id (not the custom id) for this component.
*
* @param id - The id for this component
*/
setId(id: number): this;
/**
* Clears the id of this component, defaulting to a default incremented id.
*/
clearId(): this;
} }
/** /**
@ -940,10 +951,6 @@ declare class TextInputBuilder extends ComponentBuilder<APITextInputComponent> i
equals(other: APITextInputComponent | JSONEncodable<APITextInputComponent>): boolean; equals(other: APITextInputComponent | JSONEncodable<APITextInputComponent>): boolean;
} }
/**
* The builders that may be used for messages.
*/
type MessageComponentBuilder = ActionRowBuilder<MessageActionRowComponentBuilder> | MessageActionRowComponentBuilder;
/** /**
* The builders that may be used for modals. * The builders that may be used for modals.
*/ */
@ -965,7 +972,7 @@ type AnyComponentBuilder = MessageActionRowComponentBuilder | ModalActionRowComp
* *
* @typeParam ComponentType - The types of components this action row holds * @typeParam ComponentType - The types of components this action row holds
*/ */
declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extends ComponentBuilder<APIActionRowComponent<APIMessageActionRowComponent | APIModalActionRowComponent>> { declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extends ComponentBuilder<APIActionRowComponent<APIComponentInMessageActionRow | APIComponentInModalActionRow>> {
/** /**
* The components within this action row. * The components within this action row.
*/ */
@ -1004,7 +1011,7 @@ declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extend
* .addComponents(button2, button3); * .addComponents(button2, button3);
* ``` * ```
*/ */
constructor({ components, ...data }?: Partial<APIActionRowComponent<APIActionRowComponentTypes>>); constructor({ components, ...data }?: Partial<APIActionRowComponent<APIComponentInActionRow>>);
/** /**
* Adds components to this action row. * Adds components to this action row.
* *
@ -1023,6 +1030,504 @@ declare class ActionRowBuilder<ComponentType extends AnyComponentBuilder> extend
toJSON(): APIActionRowComponent<ReturnType<ComponentType['toJSON']>>; toJSON(): APIActionRowComponent<ReturnType<ComponentType['toJSON']>>;
} }
declare class FileBuilder extends ComponentBuilder<APIFileComponent> {
/**
* Creates a new file from API data.
*
* @param data - The API data to create this file with
* @example
* Creating a file from an API data object:
* ```ts
* const file = new FileBuilder({
* spoiler: true,
* file: {
* url: 'attachment://file.png',
* },
* });
* ```
* @example
* Creating a file using setters and API data:
* ```ts
* const file = new FileBuilder({
* file: {
* url: 'attachment://image.jpg',
* },
* })
* .setSpoiler(false);
* ```
*/
constructor(data?: Partial<APIFileComponent>);
/**
* Sets the spoiler status of this file.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* Sets the media URL of this file.
*
* @param url - The URL to use
*/
setURL(url: string): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APIFileComponent;
}
declare class SeparatorBuilder extends ComponentBuilder<APISeparatorComponent> {
/**
* Creates a new separator from API data.
*
* @param data - The API data to create this separator with
* @example
* Creating a separator from an API data object:
* ```ts
* const separator = new SeparatorBuilder({
* spacing: SeparatorSpacingSize.Small,
* divider: true,
* });
* ```
* @example
* Creating a separator using setters and API data:
* ```ts
* const separator = new SeparatorBuilder({
* spacing: SeparatorSpacingSize.Large,
* })
* .setDivider(false);
* ```
*/
constructor(data?: Partial<APISeparatorComponent>);
/**
* Sets whether this separator should show a divider line.
*
* @param divider - Whether to show a divider line
*/
setDivider(divider?: boolean): this;
/**
* Sets the spacing of this separator.
*
* @param spacing - The spacing to use
*/
setSpacing(spacing: SeparatorSpacingSize): this;
/**
* Clears the spacing of this separator.
*/
clearSpacing(): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APISeparatorComponent;
}
declare class TextDisplayBuilder extends ComponentBuilder<APITextDisplayComponent> {
/**
* Creates a new text display from API data.
*
* @param data - The API data to create this text display with
* @example
* Creating a text display from an API data object:
* ```ts
* const textDisplay = new TextDisplayBuilder({
* content: 'some text',
* });
* ```
* @example
* Creating a text display using setters and API data:
* ```ts
* const textDisplay = new TextDisplayBuilder({
* content: 'old text',
* })
* .setContent('new text');
* ```
*/
constructor(data?: Partial<APITextDisplayComponent>);
/**
* Sets the text of this text display.
*
* @param content - The text to use
*/
setContent(content: string): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APITextDisplayComponent;
}
/**
* The builders that may be used within a container.
*/
type ContainerComponentBuilder = ActionRowBuilder<AnyComponentBuilder> | FileBuilder | MediaGalleryBuilder | SectionBuilder | SeparatorBuilder | TextDisplayBuilder;
/**
* A builder that creates API-compatible JSON data for a container.
*/
declare class ContainerBuilder extends ComponentBuilder<APIContainerComponent> {
/**
* The components within this container.
*/
readonly components: ContainerComponentBuilder[];
/**
* Creates a new container from API data.
*
* @param data - The API data to create this container with
* @example
* Creating a container from an API data object:
* ```ts
* const container = new ContainerBuilder({
* components: [
* {
* content: "Some text here",
* type: ComponentType.TextDisplay,
* },
* ],
* });
* ```
* @example
* Creating a container using setters and API data:
* ```ts
* const container = new ContainerBuilder({
* components: [
* {
* content: "# Heading",
* type: ComponentType.TextDisplay,
* },
* ],
* })
* .addComponents(separator, section);
* ```
*/
constructor({ components, ...data }?: Partial<APIContainerComponent>);
/**
* Sets the accent color of this container.
*
* @param color - The color to use
*/
setAccentColor(color?: RGBTuple | number): this;
/**
* Clears the accent color of this container.
*/
clearAccentColor(): this;
/**
* Adds action row components to this container.
*
* @param components - The action row components to add
*/
addActionRowComponents<ComponentType extends MessageActionRowComponentBuilder>(...components: RestOrArray<ActionRowBuilder<ComponentType> | APIActionRowComponent<APIComponentInMessageActionRow> | ((builder: ActionRowBuilder<ComponentType>) => ActionRowBuilder<ComponentType>)>): this;
/**
* Adds file components to this container.
*
* @param components - The file components to add
*/
addFileComponents(...components: RestOrArray<APIFileComponent | FileBuilder | ((builder: FileBuilder) => FileBuilder)>): this;
/**
* Adds media gallery components to this container.
*
* @param components - The media gallery components to add
*/
addMediaGalleryComponents(...components: RestOrArray<APIMediaGalleryComponent | MediaGalleryBuilder | ((builder: MediaGalleryBuilder) => MediaGalleryBuilder)>): this;
/**
* Adds section components to this container.
*
* @param components - The section components to add
*/
addSectionComponents(...components: RestOrArray<APISectionComponent | SectionBuilder | ((builder: SectionBuilder) => SectionBuilder)>): this;
/**
* Adds separator components to this container.
*
* @param components - The separator components to add
*/
addSeparatorComponents(...components: RestOrArray<APISeparatorComponent | SeparatorBuilder | ((builder: SeparatorBuilder) => SeparatorBuilder)>): this;
/**
* Adds text display components to this container.
*
* @param components - The text display components to add
*/
addTextDisplayComponents(...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>): this;
/**
* Removes, replaces, or inserts components for this container.
*
* @param index - The index to start removing, replacing or inserting components
* @param deleteCount - The amount of components to remove
* @param components - The components to set
*/
spliceComponents(index: number, deleteCount: number, ...components: RestOrArray<APIComponentInContainer | ContainerComponentBuilder>): this;
/**
* Sets the spoiler status of this container.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APIContainerComponent;
}
declare class MediaGalleryItemBuilder implements JSONEncodable<APIMediaGalleryItem> {
/**
* The API data associated with this media gallery item.
*/
readonly data: Partial<APIMediaGalleryItem>;
/**
* Creates a new media gallery item from API data.
*
* @param data - The API data to create this media gallery item with
* @example
* Creating a media gallery item from an API data object:
* ```ts
* const item = new MediaGalleryItemBuilder({
* description: "Some text here",
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/2.png',
* },
* });
* ```
* @example
* Creating a media gallery item using setters and API data:
* ```ts
* const item = new MediaGalleryItemBuilder({
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/5.png',
* },
* })
* .setDescription("alt text");
* ```
*/
constructor(data?: Partial<APIMediaGalleryItem>);
/**
* Sets the description of this media gallery item.
*
* @param description - The description to use
*/
setDescription(description: string): this;
/**
* Clears the description of this media gallery item.
*/
clearDescription(): this;
/**
* Sets the spoiler status of this media gallery item.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* Sets the media URL of this media gallery item.
*
* @param url - The URL to use
*/
setURL(url: string): this;
/**
* Serializes this builder to API-compatible JSON data.
*
* @remarks
* This method runs validations on the data before serializing it.
* As such, it may throw an error if the data is invalid.
*/
toJSON(): APIMediaGalleryItem;
}
/**
* A builder that creates API-compatible JSON data for a container.
*/
declare class MediaGalleryBuilder extends ComponentBuilder<APIMediaGalleryComponent> {
/**
* The components within this container.
*/
readonly items: MediaGalleryItemBuilder[];
/**
* Creates a new media gallery from API data.
*
* @param data - The API data to create this media gallery with
* @example
* Creating a media gallery from an API data object:
* ```ts
* const mediaGallery = new MediaGalleryBuilder({
* items: [
* {
* description: "Some text here",
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/2.png',
* },
* },
* ],
* });
* ```
* @example
* Creating a media gallery using setters and API data:
* ```ts
* const mediaGallery = new MediaGalleryBuilder({
* items: [
* {
* description: "alt text",
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/5.png',
* },
* },
* ],
* })
* .addItems(item2, item3);
* ```
*/
constructor({ items, ...data }?: Partial<APIMediaGalleryComponent>);
/**
* Adds items to this media gallery.
*
* @param items - The items to add
*/
addItems(...items: RestOrArray<APIMediaGalleryItem | MediaGalleryItemBuilder | ((builder: MediaGalleryItemBuilder) => MediaGalleryItemBuilder)>): this;
/**
* Removes, replaces, or inserts media gallery items for this media gallery.
*
* @param index - The index to start removing, replacing or inserting items
* @param deleteCount - The amount of items to remove
* @param items - The items to insert
*/
spliceItems(index: number, deleteCount: number, ...items: RestOrArray<APIMediaGalleryItem | MediaGalleryItemBuilder | ((builder: MediaGalleryItemBuilder) => MediaGalleryItemBuilder)>): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APIMediaGalleryComponent;
}
/**
* A builder that creates API-compatible JSON data for a section.
*/
declare class SectionBuilder extends ComponentBuilder<APISectionComponent> {
/**
* The components within this section.
*/
readonly components: ComponentBuilder[];
/**
* The accessory of this section.
*/
readonly accessory?: ButtonBuilder | ThumbnailBuilder;
/**
* Creates a new section from API data.
*
* @param data - The API data to create this section with
* @example
* Creating a section from an API data object:
* ```ts
* const section = new SectionBuilder({
* components: [
* {
* content: "Some text here",
* type: ComponentType.TextDisplay,
* },
* ],
* accessory: {
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/3.png',
* },
* }
* });
* ```
* @example
* Creating a section using setters and API data:
* ```ts
* const section = new SectionBuilder({
* components: [
* {
* content: "# Heading",
* type: ComponentType.TextDisplay,
* },
* ],
* })
* .setPrimaryButtonAccessory(button);
* ```
*/
constructor({ components, accessory, ...data }?: Partial<APISectionComponent>);
/**
* Sets the accessory of this section to a button.
*
* @param accessory - The accessory to use
*/
setButtonAccessory(accessory: APIButtonComponent | ButtonBuilder | ((builder: ButtonBuilder) => ButtonBuilder)): this;
/**
* Sets the accessory of this section to a thumbnail.
*
* @param accessory - The accessory to use
*/
setThumbnailAccessory(accessory: APIThumbnailComponent | ThumbnailBuilder | ((builder: ThumbnailBuilder) => ThumbnailBuilder)): this;
/**
* Adds text display components to this section.
*
* @param components - The text display components to add
*/
addTextDisplayComponents(...components: RestOrArray<TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>): this;
/**
* Removes, replaces, or inserts text display components for this section.
*
* @param index - The index to start removing, replacing or inserting text display components
* @param deleteCount - The amount of text display components to remove
* @param components - The text display components to insert
*/
spliceTextDisplayComponents(index: number, deleteCount: number, ...components: RestOrArray<APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)>): this;
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
toJSON(): APISectionComponent;
}
declare class ThumbnailBuilder extends ComponentBuilder<APIThumbnailComponent> {
/**
* Creates a new thumbnail from API data.
*
* @param data - The API data to create this thumbnail with
* @example
* Creating a thumbnail from an API data object:
* ```ts
* const thumbnail = new ThumbnailBuilder({
* description: 'some text',
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/4.png',
* },
* });
* ```
* @example
* Creating a thumbnail using setters and API data:
* ```ts
* const thumbnail = new ThumbnailBuilder({
* media: {
* url: 'attachment://image.png',
* },
* })
* .setDescription('alt text');
* ```
*/
constructor(data?: Partial<APIThumbnailComponent>);
/**
* Sets the description of this thumbnail.
*
* @param description - The description to use
*/
setDescription(description: string): this;
/**
* Clears the description of this thumbnail.
*/
clearDescription(): this;
/**
* Sets the spoiler status of this thumbnail.
*
* @param spoiler - The spoiler status to use
*/
setSpoiler(spoiler?: boolean): this;
/**
* Sets the media URL of this thumbnail.
*
* @param url - The URL to use
*/
setURL(url: string): this;
/**
* {@inheritdoc ComponentBuilder.toJSON}
*/
toJSON(): APIThumbnailComponent;
}
/**
* The builders that may be used for messages.
*/
type MessageComponentBuilder = ActionRowBuilder<MessageActionRowComponentBuilder> | ContainerBuilder | FileBuilder | MediaGalleryBuilder | MessageActionRowComponentBuilder | SectionBuilder | SeparatorBuilder | TextDisplayBuilder | ThumbnailBuilder;
/** /**
* Components here are mapped to their respective builder. * Components here are mapped to their respective builder.
*/ */
@ -1059,6 +1564,34 @@ interface MappedComponentTypes {
* The channel select component type is associated with a {@link ChannelSelectMenuBuilder}. * The channel select component type is associated with a {@link ChannelSelectMenuBuilder}.
*/ */
[ComponentType.ChannelSelect]: ChannelSelectMenuBuilder; [ComponentType.ChannelSelect]: ChannelSelectMenuBuilder;
/**
* The file component type is associated with a {@link FileBuilder}.
*/
[ComponentType.File]: FileBuilder;
/**
* The separator component type is associated with a {@link SeparatorBuilder}.
*/
[ComponentType.Separator]: SeparatorBuilder;
/**
* The container component type is associated with a {@link ContainerBuilder}.
*/
[ComponentType.Container]: ContainerBuilder;
/**
* The text display component type is associated with a {@link TextDisplayBuilder}.
*/
[ComponentType.TextDisplay]: TextDisplayBuilder;
/**
* The thumbnail component type is associated with a {@link ThumbnailBuilder}.
*/
[ComponentType.Thumbnail]: ThumbnailBuilder;
/**
* The section component type is associated with a {@link SectionBuilder}.
*/
[ComponentType.Section]: SectionBuilder;
/**
* The media gallery component type is associated with a {@link MediaGalleryBuilder}.
*/
[ComponentType.MediaGallery]: MediaGalleryBuilder;
} }
/** /**
* Factory for creating components from API data. * Factory for creating components from API data.
@ -1076,6 +1609,7 @@ declare function createComponentBuilder<ComponentType extends keyof MappedCompon
* @param data - The API data to transform to a component class * @param data - The API data to transform to a component class
*/ */
declare function createComponentBuilder<ComponentBuilder extends MessageComponentBuilder | ModalComponentBuilder>(data: ComponentBuilder): ComponentBuilder; declare function createComponentBuilder<ComponentBuilder extends MessageComponentBuilder | ModalComponentBuilder>(data: ComponentBuilder): ComponentBuilder;
declare function resolveBuilder<ComponentType extends Record<PropertyKey, any>, Builder extends JSONEncodable<any>>(builder: Builder | ComponentType | ((builder: Builder) => Builder), Constructor: new (data?: ComponentType) => Builder): Builder;
declare const textInputStyleValidator: _sapphire_shapeshift.NativeEnumValidator<typeof TextInputStyle>; declare const textInputStyleValidator: _sapphire_shapeshift.NativeEnumValidator<typeof TextInputStyle>;
declare const minLengthValidator: _sapphire_shapeshift.NumberValidator<number>; declare const minLengthValidator: _sapphire_shapeshift.NumberValidator<number>;
@ -1086,15 +1620,15 @@ declare const placeholderValidator: _sapphire_shapeshift.StringValidator<string>
declare const labelValidator: _sapphire_shapeshift.StringValidator<string>; declare const labelValidator: _sapphire_shapeshift.StringValidator<string>;
declare function validateRequiredParameters$3(customId?: string, style?: TextInputStyle, label?: string): void; declare function validateRequiredParameters$3(customId?: string, style?: TextInputStyle, label?: string): void;
declare const Assertions$3_labelValidator: typeof labelValidator; declare const Assertions$4_labelValidator: typeof labelValidator;
declare const Assertions$3_maxLengthValidator: typeof maxLengthValidator; declare const Assertions$4_maxLengthValidator: typeof maxLengthValidator;
declare const Assertions$3_minLengthValidator: typeof minLengthValidator; declare const Assertions$4_minLengthValidator: typeof minLengthValidator;
declare const Assertions$3_placeholderValidator: typeof placeholderValidator; declare const Assertions$4_placeholderValidator: typeof placeholderValidator;
declare const Assertions$3_requiredValidator: typeof requiredValidator; declare const Assertions$4_requiredValidator: typeof requiredValidator;
declare const Assertions$3_textInputStyleValidator: typeof textInputStyleValidator; declare const Assertions$4_textInputStyleValidator: typeof textInputStyleValidator;
declare const Assertions$3_valueValidator: typeof valueValidator; declare const Assertions$4_valueValidator: typeof valueValidator;
declare namespace Assertions$3 { declare namespace Assertions$4 {
export { Assertions$3_labelValidator as labelValidator, Assertions$3_maxLengthValidator as maxLengthValidator, Assertions$3_minLengthValidator as minLengthValidator, Assertions$3_placeholderValidator as placeholderValidator, Assertions$3_requiredValidator as requiredValidator, Assertions$3_textInputStyleValidator as textInputStyleValidator, validateRequiredParameters$3 as validateRequiredParameters, Assertions$3_valueValidator as valueValidator }; export { Assertions$4_labelValidator as labelValidator, Assertions$4_maxLengthValidator as maxLengthValidator, Assertions$4_minLengthValidator as minLengthValidator, Assertions$4_placeholderValidator as placeholderValidator, Assertions$4_requiredValidator as requiredValidator, Assertions$4_textInputStyleValidator as textInputStyleValidator, validateRequiredParameters$3 as validateRequiredParameters, Assertions$4_valueValidator as valueValidator };
} }
/** /**
@ -1132,7 +1666,7 @@ declare class ModalBuilder implements JSONEncodable<APIModalInteractionResponseC
* *
* @param components - The components to add * @param components - The components to add
*/ */
addComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIModalActionRowComponent>>): this; addComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIComponentInModalActionRow>>): this;
/** /**
* Sets components for this modal. * Sets components for this modal.
* *
@ -1149,10 +1683,44 @@ declare const titleValidator: _sapphire_shapeshift.StringValidator<string>;
declare const componentsValidator: _sapphire_shapeshift.ArrayValidator<[ActionRowBuilder<AnyComponentBuilder>, ...ActionRowBuilder<AnyComponentBuilder>[]], ActionRowBuilder<AnyComponentBuilder>>; declare const componentsValidator: _sapphire_shapeshift.ArrayValidator<[ActionRowBuilder<AnyComponentBuilder>, ...ActionRowBuilder<AnyComponentBuilder>[]], ActionRowBuilder<AnyComponentBuilder>>;
declare function validateRequiredParameters$2(customId?: string, title?: string, components?: ActionRowBuilder<ModalActionRowComponentBuilder>[]): void; declare function validateRequiredParameters$2(customId?: string, title?: string, components?: ActionRowBuilder<ModalActionRowComponentBuilder>[]): void;
declare const Assertions$2_componentsValidator: typeof componentsValidator; declare const Assertions$3_componentsValidator: typeof componentsValidator;
declare const Assertions$2_titleValidator: typeof titleValidator; declare const Assertions$3_titleValidator: typeof titleValidator;
declare namespace Assertions$3 {
export { Assertions$3_componentsValidator as componentsValidator, Assertions$3_titleValidator as titleValidator, validateRequiredParameters$2 as validateRequiredParameters };
}
declare const unfurledMediaItemPredicate: _sapphire_shapeshift.ObjectValidator<{
url: string;
}, _sapphire_shapeshift.UndefinedToOptional<{
url: string;
}>>;
declare const descriptionPredicate: _sapphire_shapeshift.StringValidator<string>;
declare const filePredicate: _sapphire_shapeshift.ObjectValidator<{
url: string;
}, _sapphire_shapeshift.UndefinedToOptional<{
url: string;
}>>;
declare const spoilerPredicate: _sapphire_shapeshift.BooleanValidator<boolean>;
declare const dividerPredicate: _sapphire_shapeshift.BooleanValidator<boolean>;
declare const spacingPredicate: _sapphire_shapeshift.NativeEnumValidator<typeof SeparatorSpacingSize>;
declare const textDisplayContentPredicate: _sapphire_shapeshift.StringValidator<string>;
declare const accessoryPredicate: _sapphire_shapeshift.UnionValidator<ButtonBuilder | ThumbnailBuilder>;
declare const containerColorPredicate: _sapphire_shapeshift.UnionValidator<number | [number, number, number] | null | undefined>;
declare function assertReturnOfBuilder$1<ReturnType extends MediaGalleryItemBuilder | TextDisplayBuilder>(input: unknown, ExpectedInstanceOf: new () => ReturnType): asserts input is ReturnType;
declare function validateComponentArray<ReturnType extends ContainerComponentBuilder | MediaGalleryItemBuilder = ContainerComponentBuilder>(input: unknown, min: number, max: number, ExpectedInstanceOf?: new () => ReturnType): asserts input is ReturnType[];
declare const Assertions$2_accessoryPredicate: typeof accessoryPredicate;
declare const Assertions$2_containerColorPredicate: typeof containerColorPredicate;
declare const Assertions$2_descriptionPredicate: typeof descriptionPredicate;
declare const Assertions$2_dividerPredicate: typeof dividerPredicate;
declare const Assertions$2_filePredicate: typeof filePredicate;
declare const Assertions$2_spacingPredicate: typeof spacingPredicate;
declare const Assertions$2_spoilerPredicate: typeof spoilerPredicate;
declare const Assertions$2_textDisplayContentPredicate: typeof textDisplayContentPredicate;
declare const Assertions$2_unfurledMediaItemPredicate: typeof unfurledMediaItemPredicate;
declare const Assertions$2_validateComponentArray: typeof validateComponentArray;
declare namespace Assertions$2 { declare namespace Assertions$2 {
export { Assertions$2_componentsValidator as componentsValidator, Assertions$2_titleValidator as titleValidator, validateRequiredParameters$2 as validateRequiredParameters }; export { Assertions$2_accessoryPredicate as accessoryPredicate, assertReturnOfBuilder$1 as assertReturnOfBuilder, Assertions$2_containerColorPredicate as containerColorPredicate, Assertions$2_descriptionPredicate as descriptionPredicate, Assertions$2_dividerPredicate as dividerPredicate, Assertions$2_filePredicate as filePredicate, Assertions$2_spacingPredicate as spacingPredicate, Assertions$2_spoilerPredicate as spoilerPredicate, Assertions$2_textDisplayContentPredicate as textDisplayContentPredicate, Assertions$2_unfurledMediaItemPredicate as unfurledMediaItemPredicate, Assertions$2_validateComponentArray as validateComponentArray };
} }
/** /**
@ -2040,4 +2608,4 @@ declare function isValidationEnabled(): boolean;
*/ */
declare const version: string; declare const version: string;
export { ActionRowBuilder, type AnyAPIActionRowComponent, type AnyComponentBuilder, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, ApplicationCommandOptionChannelTypesMixin, ApplicationCommandOptionWithAutocompleteMixin, ApplicationCommandOptionWithChoicesMixin, BaseSelectMenuBuilder, ButtonBuilder, ChannelSelectMenuBuilder, Assertions$4 as ComponentAssertions, ComponentBuilder, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, type ContextMenuCommandType, Assertions$5 as EmbedAssertions, type EmbedAuthorData, type EmbedAuthorOptions, EmbedBuilder, type EmbedFooterData, type EmbedFooterOptions, type EmbedImageData, type IconData, type MappedComponentTypes, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, type MessageComponentBuilder, type ModalActionRowComponentBuilder, Assertions$2 as ModalAssertions, ModalBuilder, type ModalComponentBuilder, type RGBTuple, type RestOrArray, RoleSelectMenuBuilder, StringSelectMenuBuilder as SelectMenuBuilder, StringSelectMenuOptionBuilder as SelectMenuOptionBuilder, SharedNameAndDescription, SharedSlashCommand, SharedSlashCommandOptions, SharedSlashCommandSubcommands, Assertions$1 as SlashCommandAssertions, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, type SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, type SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, Assertions$3 as TextInputAssertions, TextInputBuilder, type ToAPIApplicationCommandOptions, UserSelectMenuBuilder, createComponentBuilder, disableValidators, embedLength, enableValidators, isValidationEnabled, normalizeArray, version }; export { ActionRowBuilder, type AnyAPIActionRowComponent, type AnyComponentBuilder, ApplicationCommandNumericOptionMinMaxValueMixin, type ApplicationCommandOptionAllowedChannelTypes, ApplicationCommandOptionBase, ApplicationCommandOptionChannelTypesMixin, ApplicationCommandOptionWithAutocompleteMixin, ApplicationCommandOptionWithChoicesMixin, BaseSelectMenuBuilder, ButtonBuilder, ChannelSelectMenuBuilder, Assertions$5 as ComponentAssertions, ComponentBuilder, Assertions$2 as ComponentsV2Assertions, ContainerBuilder, type ContainerComponentBuilder, Assertions as ContextMenuCommandAssertions, ContextMenuCommandBuilder, type ContextMenuCommandType, Assertions$6 as EmbedAssertions, type EmbedAuthorData, type EmbedAuthorOptions, EmbedBuilder, type EmbedFooterData, type EmbedFooterOptions, type EmbedImageData, FileBuilder, type IconData, type MappedComponentTypes, MediaGalleryBuilder, MediaGalleryItemBuilder, MentionableSelectMenuBuilder, type MessageActionRowComponentBuilder, type MessageComponentBuilder, type ModalActionRowComponentBuilder, Assertions$3 as ModalAssertions, ModalBuilder, type ModalComponentBuilder, type RGBTuple, type RestOrArray, RoleSelectMenuBuilder, SectionBuilder, StringSelectMenuBuilder as SelectMenuBuilder, StringSelectMenuOptionBuilder as SelectMenuOptionBuilder, SeparatorBuilder, SharedNameAndDescription, SharedSlashCommand, SharedSlashCommandOptions, SharedSlashCommandSubcommands, Assertions$1 as SlashCommandAssertions, SlashCommandAttachmentOption, SlashCommandBooleanOption, SlashCommandBuilder, SlashCommandChannelOption, SlashCommandIntegerOption, SlashCommandMentionableOption, SlashCommandNumberOption, type SlashCommandOptionsOnlyBuilder, SlashCommandRoleOption, SlashCommandStringOption, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, type SlashCommandSubcommandsOnlyBuilder, SlashCommandUserOption, StringSelectMenuBuilder, StringSelectMenuOptionBuilder, TextDisplayBuilder, Assertions$4 as TextInputAssertions, TextInputBuilder, ThumbnailBuilder, type ToAPIApplicationCommandOptions, UserSelectMenuBuilder, createComponentBuilder, disableValidators, embedLength, enableValidators, isValidationEnabled, normalizeArray, resolveBuilder, version };

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{ {
"$schema": "https://json.schemastore.org/package.json", "$schema": "https://json.schemastore.org/package.json",
"name": "@discordjs/builders", "name": "@discordjs/builders",
"version": "1.10.1", "version": "1.11.2",
"description": "A set of builders that you can use when creating your bot", "description": "A set of builders that you can use when creating your bot",
"exports": { "exports": {
".": { ".": {
@ -54,12 +54,12 @@
"funding": "https://github.com/discordjs/discord.js?sponsor", "funding": "https://github.com/discordjs/discord.js?sponsor",
"dependencies": { "dependencies": {
"@sapphire/shapeshift": "^4.0.0", "@sapphire/shapeshift": "^4.0.0",
"discord-api-types": "^0.37.119", "discord-api-types": "^0.38.1",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
"ts-mixer": "^6.0.4", "ts-mixer": "^6.0.4",
"tslib": "^2.6.3", "tslib": "^2.6.3",
"@discordjs/util": "^1.1.1", "@discordjs/formatters": "^0.6.1",
"@discordjs/formatters": "^0.6.0" "@discordjs/util": "^1.1.1"
}, },
"devDependencies": { "devDependencies": {
"@favware/cliff-jumper": "^4.1.0", "@favware/cliff-jumper": "^4.1.0",

View File

@ -402,7 +402,7 @@ var GuildNavigationMentions = /* @__PURE__ */ ((GuildNavigationMentions2) => {
})(GuildNavigationMentions || {}); })(GuildNavigationMentions || {});
// src/index.ts // src/index.ts
var version = "0.6.0"; var version = "0.6.1";
// Annotate the CommonJS export names for ESM import in node: // Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = { 0 && (module.exports = {
Faces, Faces,

File diff suppressed because one or more lines are too long

View File

@ -336,7 +336,7 @@ var GuildNavigationMentions = /* @__PURE__ */ ((GuildNavigationMentions2) => {
})(GuildNavigationMentions || {}); })(GuildNavigationMentions || {});
// src/index.ts // src/index.ts
var version = "0.6.0"; var version = "0.6.1";
export { export {
Faces, Faces,
GuildNavigationMentions, GuildNavigationMentions,

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{ {
"$schema": "https://json.schemastore.org/package.json", "$schema": "https://json.schemastore.org/package.json",
"name": "@discordjs/formatters", "name": "@discordjs/formatters",
"version": "0.6.0", "version": "0.6.1",
"description": "A set of functions to format strings for Discord.", "description": "A set of functions to format strings for Discord.",
"exports": { "exports": {
".": { ".": {
@ -44,7 +44,7 @@
"homepage": "https://discord.js.org", "homepage": "https://discord.js.org",
"funding": "https://github.com/discordjs/discord.js?sponsor", "funding": "https://github.com/discordjs/discord.js?sponsor",
"dependencies": { "dependencies": {
"discord-api-types": "^0.37.114" "discord-api-types": "^0.38.1"
}, },
"devDependencies": { "devDependencies": {
"@favware/cliff-jumper": "^4.1.0", "@favware/cliff-jumper": "^4.1.0",

View File

@ -1,5 +1,6 @@
import * as url from 'url'; import * as url from 'url';
import { Snowflake } from 'discord-api-types/v10'; import { ImageSize, Snowflake } from 'discord-api-types/v10';
export { ImageSize } from 'discord-api-types/v10';
import { Readable } from 'node:stream'; import { Readable } from 'node:stream';
import { ReadableStream } from 'node:stream/web'; import { ReadableStream } from 'node:stream/web';
import { Collection } from '@discordjs/collection'; import { Collection } from '@discordjs/collection';
@ -430,10 +431,9 @@ declare enum RESTEvents {
} }
declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"]; declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"];
declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"]; declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"];
declare const ALLOWED_SIZES: readonly [16, 32, 64, 128, 256, 512, 1024, 2048, 4096]; declare const ALLOWED_SIZES: readonly number[];
type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number]; type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number];
type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number]; type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number];
type ImageSize = (typeof ALLOWED_SIZES)[number];
declare const OverwrittenMimeTypes: { declare const OverwrittenMimeTypes: {
readonly 'image/apng': "image/png"; readonly 'image/apng': "image/png";
}; };
@ -663,6 +663,12 @@ declare class CDN {
* @param options - Optional options for the cover image * @param options - Optional options for the cover image
*/ */
guildScheduledEventCover(scheduledEventId: string, coverHash: string, options?: Readonly<BaseImageURLOptions>): string; guildScheduledEventCover(scheduledEventId: string, coverHash: string, options?: Readonly<BaseImageURLOptions>): string;
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId: string): string;
/** /**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`. * Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
* *
@ -923,4 +929,4 @@ declare function calculateUserDefaultAvatarIndex(userId: Snowflake): number;
*/ */
declare const version: string; declare const version: string;
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageSize, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version }; export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };

View File

@ -1,5 +1,6 @@
import * as url from 'url'; import * as url from 'url';
import { Snowflake } from 'discord-api-types/v10'; import { ImageSize, Snowflake } from 'discord-api-types/v10';
export { ImageSize } from 'discord-api-types/v10';
import { Readable } from 'node:stream'; import { Readable } from 'node:stream';
import { ReadableStream } from 'node:stream/web'; import { ReadableStream } from 'node:stream/web';
import { Collection } from '@discordjs/collection'; import { Collection } from '@discordjs/collection';
@ -430,10 +431,9 @@ declare enum RESTEvents {
} }
declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"]; declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"];
declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"]; declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"];
declare const ALLOWED_SIZES: readonly [16, 32, 64, 128, 256, 512, 1024, 2048, 4096]; declare const ALLOWED_SIZES: readonly number[];
type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number]; type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number];
type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number]; type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number];
type ImageSize = (typeof ALLOWED_SIZES)[number];
declare const OverwrittenMimeTypes: { declare const OverwrittenMimeTypes: {
readonly 'image/apng': "image/png"; readonly 'image/apng': "image/png";
}; };
@ -663,6 +663,12 @@ declare class CDN {
* @param options - Optional options for the cover image * @param options - Optional options for the cover image
*/ */
guildScheduledEventCover(scheduledEventId: string, coverHash: string, options?: Readonly<BaseImageURLOptions>): string; guildScheduledEventCover(scheduledEventId: string, coverHash: string, options?: Readonly<BaseImageURLOptions>): string;
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId: string): string;
/** /**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`. * Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
* *
@ -923,4 +929,4 @@ declare function calculateUserDefaultAvatarIndex(userId: Snowflake): number;
*/ */
declare const version: string; declare const version: string;
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageSize, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version }; export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };

View File

@ -121,10 +121,13 @@ async function resolveBody(body) {
} }
__name(resolveBody, "resolveBody"); __name(resolveBody, "resolveBody");
// src/lib/CDN.ts
var import_v102 = require("discord-api-types/v10");
// src/lib/utils/constants.ts // src/lib/utils/constants.ts
var import_util = require("@discordjs/util"); var import_util = require("@discordjs/util");
var import_v10 = require("discord-api-types/v10"); var import_v10 = require("discord-api-types/v10");
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.4.3)`; var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.5.0)`;
var DefaultUserAgentAppendix = (0, import_util.getUserAgentAppendix)(); var DefaultUserAgentAppendix = (0, import_util.getUserAgentAppendix)();
var DefaultRestOptions = { var DefaultRestOptions = {
agent: null, agent: null,
@ -162,7 +165,17 @@ var RESTEvents = /* @__PURE__ */ ((RESTEvents2) => {
})(RESTEvents || {}); })(RESTEvents || {});
var ALLOWED_EXTENSIONS = ["webp", "png", "jpg", "jpeg", "gif"]; var ALLOWED_EXTENSIONS = ["webp", "png", "jpg", "jpeg", "gif"];
var ALLOWED_STICKER_EXTENSIONS = ["png", "json", "gif"]; var ALLOWED_STICKER_EXTENSIONS = ["png", "json", "gif"];
var ALLOWED_SIZES = [16, 32, 64, 128, 256, 512, 1024, 2048, 4096]; var ALLOWED_SIZES = [
16,
32,
64,
128,
256,
512,
1024,
2048,
4096
];
var OverwrittenMimeTypes = { var OverwrittenMimeTypes = {
// https://github.com/discordjs/discord.js/issues/8557 // https://github.com/discordjs/discord.js/issues/8557
"image/apng": "image/png" "image/apng": "image/png"
@ -522,6 +535,14 @@ var CDN = class {
guildScheduledEventCover(scheduledEventId, coverHash, options) { guildScheduledEventCover(scheduledEventId, coverHash, options) {
return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`, options); return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`, options);
} }
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId) {
return `${this.cdn}${import_v102.CDNRoutes.soundboardSound(soundId)}`;
}
/** /**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`. * Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
* *
@ -1448,7 +1469,7 @@ var REST = class _REST extends import_async_event_emitter.AsyncEventEmitter {
}; };
// src/shared.ts // src/shared.ts
var version = "2.4.3"; var version = "2.5.0";
// src/index.ts // src/index.ts
globalThis.FormData ??= import_undici2.FormData; globalThis.FormData ??= import_undici2.FormData;

File diff suppressed because one or more lines are too long

View File

@ -80,10 +80,13 @@ async function resolveBody(body) {
} }
__name(resolveBody, "resolveBody"); __name(resolveBody, "resolveBody");
// src/lib/CDN.ts
import { CDNRoutes } from "discord-api-types/v10";
// src/lib/utils/constants.ts // src/lib/utils/constants.ts
import { getUserAgentAppendix } from "@discordjs/util"; import { getUserAgentAppendix } from "@discordjs/util";
import { APIVersion } from "discord-api-types/v10"; import { APIVersion } from "discord-api-types/v10";
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.4.3)`; var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.5.0)`;
var DefaultUserAgentAppendix = getUserAgentAppendix(); var DefaultUserAgentAppendix = getUserAgentAppendix();
var DefaultRestOptions = { var DefaultRestOptions = {
agent: null, agent: null,
@ -121,7 +124,17 @@ var RESTEvents = /* @__PURE__ */ ((RESTEvents2) => {
})(RESTEvents || {}); })(RESTEvents || {});
var ALLOWED_EXTENSIONS = ["webp", "png", "jpg", "jpeg", "gif"]; var ALLOWED_EXTENSIONS = ["webp", "png", "jpg", "jpeg", "gif"];
var ALLOWED_STICKER_EXTENSIONS = ["png", "json", "gif"]; var ALLOWED_STICKER_EXTENSIONS = ["png", "json", "gif"];
var ALLOWED_SIZES = [16, 32, 64, 128, 256, 512, 1024, 2048, 4096]; var ALLOWED_SIZES = [
16,
32,
64,
128,
256,
512,
1024,
2048,
4096
];
var OverwrittenMimeTypes = { var OverwrittenMimeTypes = {
// https://github.com/discordjs/discord.js/issues/8557 // https://github.com/discordjs/discord.js/issues/8557
"image/apng": "image/png" "image/apng": "image/png"
@ -481,6 +494,14 @@ var CDN = class {
guildScheduledEventCover(scheduledEventId, coverHash, options) { guildScheduledEventCover(scheduledEventId, coverHash, options) {
return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`, options); return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`, options);
} }
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId) {
return `${this.cdn}${CDNRoutes.soundboardSound(soundId)}`;
}
/** /**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`. * Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
* *
@ -1407,7 +1428,7 @@ var REST = class _REST extends AsyncEventEmitter {
}; };
// src/shared.ts // src/shared.ts
var version = "2.4.3"; var version = "2.5.0";
// src/index.ts // src/index.ts
globalThis.FormData ??= FormData2; globalThis.FormData ??= FormData2;

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,6 @@
import * as url from 'url'; import * as url from 'url';
import { Snowflake } from 'discord-api-types/v10'; import { ImageSize, Snowflake } from 'discord-api-types/v10';
export { ImageSize } from 'discord-api-types/v10';
import { Readable } from 'node:stream'; import { Readable } from 'node:stream';
import { ReadableStream } from 'node:stream/web'; import { ReadableStream } from 'node:stream/web';
import { Collection } from '@discordjs/collection'; import { Collection } from '@discordjs/collection';
@ -430,10 +431,9 @@ declare enum RESTEvents {
} }
declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"]; declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"];
declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"]; declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"];
declare const ALLOWED_SIZES: readonly [16, 32, 64, 128, 256, 512, 1024, 2048, 4096]; declare const ALLOWED_SIZES: readonly number[];
type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number]; type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number];
type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number]; type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number];
type ImageSize = (typeof ALLOWED_SIZES)[number];
declare const OverwrittenMimeTypes: { declare const OverwrittenMimeTypes: {
readonly 'image/apng': "image/png"; readonly 'image/apng': "image/png";
}; };
@ -663,6 +663,12 @@ declare class CDN {
* @param options - Optional options for the cover image * @param options - Optional options for the cover image
*/ */
guildScheduledEventCover(scheduledEventId: string, coverHash: string, options?: Readonly<BaseImageURLOptions>): string; guildScheduledEventCover(scheduledEventId: string, coverHash: string, options?: Readonly<BaseImageURLOptions>): string;
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId: string): string;
/** /**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`. * Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
* *
@ -923,4 +929,4 @@ declare function calculateUserDefaultAvatarIndex(userId: Snowflake): number;
*/ */
declare const version: string; declare const version: string;
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageSize, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version }; export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };

View File

@ -1,5 +1,6 @@
import * as url from 'url'; import * as url from 'url';
import { Snowflake } from 'discord-api-types/v10'; import { ImageSize, Snowflake } from 'discord-api-types/v10';
export { ImageSize } from 'discord-api-types/v10';
import { Readable } from 'node:stream'; import { Readable } from 'node:stream';
import { ReadableStream } from 'node:stream/web'; import { ReadableStream } from 'node:stream/web';
import { Collection } from '@discordjs/collection'; import { Collection } from '@discordjs/collection';
@ -430,10 +431,9 @@ declare enum RESTEvents {
} }
declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"]; declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"];
declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"]; declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"];
declare const ALLOWED_SIZES: readonly [16, 32, 64, 128, 256, 512, 1024, 2048, 4096]; declare const ALLOWED_SIZES: readonly number[];
type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number]; type ImageExtension = (typeof ALLOWED_EXTENSIONS)[number];
type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number]; type StickerExtension = (typeof ALLOWED_STICKER_EXTENSIONS)[number];
type ImageSize = (typeof ALLOWED_SIZES)[number];
declare const OverwrittenMimeTypes: { declare const OverwrittenMimeTypes: {
readonly 'image/apng': "image/png"; readonly 'image/apng': "image/png";
}; };
@ -663,6 +663,12 @@ declare class CDN {
* @param options - Optional options for the cover image * @param options - Optional options for the cover image
*/ */
guildScheduledEventCover(scheduledEventId: string, coverHash: string, options?: Readonly<BaseImageURLOptions>): string; guildScheduledEventCover(scheduledEventId: string, coverHash: string, options?: Readonly<BaseImageURLOptions>): string;
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId: string): string;
/** /**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`. * Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
* *
@ -923,4 +929,4 @@ declare function calculateUserDefaultAvatarIndex(userId: Snowflake): number;
*/ */
declare const version: string; declare const version: string;
export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageSize, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version }; export { ALLOWED_EXTENSIONS, ALLOWED_SIZES, ALLOWED_STICKER_EXTENSIONS, type APIRequest, type BaseImageURLOptions, BurstHandlerMajorIdKey, CDN, DEPRECATION_WARNING_PREFIX, DefaultRestOptions, DefaultUserAgent, DefaultUserAgentAppendix, DiscordAPIError, type DiscordErrorData, type GetRateLimitOffsetFunction, HTTPError, type HandlerRequestData, type HashData, type ImageExtension, type ImageURLOptions, type InternalRequest, type InvalidRequestWarningData, type MakeURLOptions, type OAuthErrorData, OverwrittenMimeTypes, REST, RESTEvents, type RESTOptions, type RateLimitData, RateLimitError, type RateLimitQueueFilter, type RawFile, type RequestBody, type RequestData, type RequestHeaders, RequestMethod, type ResponseLike, type RestEvents, type RestEventsMap, type RouteData, type RouteLike, type StickerExtension, calculateUserDefaultAvatarIndex, makeURLSearchParams, parseResponse, version };

View File

@ -55,10 +55,13 @@ function getDefaultStrategy() {
} }
__name(getDefaultStrategy, "getDefaultStrategy"); __name(getDefaultStrategy, "getDefaultStrategy");
// src/lib/CDN.ts
var import_v102 = require("discord-api-types/v10");
// src/lib/utils/constants.ts // src/lib/utils/constants.ts
var import_util = require("@discordjs/util"); var import_util = require("@discordjs/util");
var import_v10 = require("discord-api-types/v10"); var import_v10 = require("discord-api-types/v10");
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.4.3)`; var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.5.0)`;
var DefaultUserAgentAppendix = (0, import_util.getUserAgentAppendix)(); var DefaultUserAgentAppendix = (0, import_util.getUserAgentAppendix)();
var DefaultRestOptions = { var DefaultRestOptions = {
agent: null, agent: null,
@ -96,7 +99,17 @@ var RESTEvents = /* @__PURE__ */ ((RESTEvents2) => {
})(RESTEvents || {}); })(RESTEvents || {});
var ALLOWED_EXTENSIONS = ["webp", "png", "jpg", "jpeg", "gif"]; var ALLOWED_EXTENSIONS = ["webp", "png", "jpg", "jpeg", "gif"];
var ALLOWED_STICKER_EXTENSIONS = ["png", "json", "gif"]; var ALLOWED_STICKER_EXTENSIONS = ["png", "json", "gif"];
var ALLOWED_SIZES = [16, 32, 64, 128, 256, 512, 1024, 2048, 4096]; var ALLOWED_SIZES = [
16,
32,
64,
128,
256,
512,
1024,
2048,
4096
];
var OverwrittenMimeTypes = { var OverwrittenMimeTypes = {
// https://github.com/discordjs/discord.js/issues/8557 // https://github.com/discordjs/discord.js/issues/8557
"image/apng": "image/png" "image/apng": "image/png"
@ -456,6 +469,14 @@ var CDN = class {
guildScheduledEventCover(scheduledEventId, coverHash, options) { guildScheduledEventCover(scheduledEventId, coverHash, options) {
return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`, options); return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`, options);
} }
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId) {
return `${this.cdn}${import_v102.CDNRoutes.soundboardSound(soundId)}`;
}
/** /**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`. * Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
* *
@ -1382,7 +1403,7 @@ var REST = class _REST extends import_async_event_emitter.AsyncEventEmitter {
}; };
// src/shared.ts // src/shared.ts
var version = "2.4.3"; var version = "2.5.0";
// src/web.ts // src/web.ts
setDefaultStrategy(fetch); setDefaultStrategy(fetch);

File diff suppressed because one or more lines are too long

View File

@ -12,10 +12,13 @@ function getDefaultStrategy() {
} }
__name(getDefaultStrategy, "getDefaultStrategy"); __name(getDefaultStrategy, "getDefaultStrategy");
// src/lib/CDN.ts
import { CDNRoutes } from "discord-api-types/v10";
// src/lib/utils/constants.ts // src/lib/utils/constants.ts
import { getUserAgentAppendix } from "@discordjs/util"; import { getUserAgentAppendix } from "@discordjs/util";
import { APIVersion } from "discord-api-types/v10"; import { APIVersion } from "discord-api-types/v10";
var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.4.3)`; var DefaultUserAgent = `DiscordBot (https://discord.js.org, 2.5.0)`;
var DefaultUserAgentAppendix = getUserAgentAppendix(); var DefaultUserAgentAppendix = getUserAgentAppendix();
var DefaultRestOptions = { var DefaultRestOptions = {
agent: null, agent: null,
@ -53,7 +56,17 @@ var RESTEvents = /* @__PURE__ */ ((RESTEvents2) => {
})(RESTEvents || {}); })(RESTEvents || {});
var ALLOWED_EXTENSIONS = ["webp", "png", "jpg", "jpeg", "gif"]; var ALLOWED_EXTENSIONS = ["webp", "png", "jpg", "jpeg", "gif"];
var ALLOWED_STICKER_EXTENSIONS = ["png", "json", "gif"]; var ALLOWED_STICKER_EXTENSIONS = ["png", "json", "gif"];
var ALLOWED_SIZES = [16, 32, 64, 128, 256, 512, 1024, 2048, 4096]; var ALLOWED_SIZES = [
16,
32,
64,
128,
256,
512,
1024,
2048,
4096
];
var OverwrittenMimeTypes = { var OverwrittenMimeTypes = {
// https://github.com/discordjs/discord.js/issues/8557 // https://github.com/discordjs/discord.js/issues/8557
"image/apng": "image/png" "image/apng": "image/png"
@ -413,6 +426,14 @@ var CDN = class {
guildScheduledEventCover(scheduledEventId, coverHash, options) { guildScheduledEventCover(scheduledEventId, coverHash, options) {
return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`, options); return this.makeURL(`/guild-events/${scheduledEventId}/${coverHash}`, options);
} }
/**
* Generates a URL for a soundboard sound.
*
* @param soundId - The soundboard sound id
*/
soundboardSound(soundId) {
return `${this.cdn}${CDNRoutes.soundboardSound(soundId)}`;
}
/** /**
* Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`. * Constructs the URL for the resource, checking whether or not `hash` starts with `a_` if `dynamic` is set to `true`.
* *
@ -1339,7 +1360,7 @@ var REST = class _REST extends AsyncEventEmitter {
}; };
// src/shared.ts // src/shared.ts
var version = "2.4.3"; var version = "2.5.0";
// src/web.ts // src/web.ts
setDefaultStrategy(fetch); setDefaultStrategy(fetch);

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{ {
"$schema": "https://json.schemastore.org/package.json", "$schema": "https://json.schemastore.org/package.json",
"name": "@discordjs/rest", "name": "@discordjs/rest",
"version": "2.4.3", "version": "2.5.0",
"description": "The REST API for discord.js", "description": "The REST API for discord.js",
"exports": { "exports": {
".": { ".": {
@ -74,12 +74,12 @@
"@sapphire/async-queue": "^1.5.3", "@sapphire/async-queue": "^1.5.3",
"@sapphire/snowflake": "^3.5.3", "@sapphire/snowflake": "^3.5.3",
"@vladfrangu/async_event_emitter": "^2.4.6", "@vladfrangu/async_event_emitter": "^2.4.6",
"discord-api-types": "^0.37.119", "discord-api-types": "^0.38.1",
"magic-bytes.js": "^1.10.0", "magic-bytes.js": "^1.10.0",
"tslib": "^2.6.3", "tslib": "^2.6.3",
"undici": "6.21.1", "undici": "6.21.1",
"@discordjs/collection": "^2.1.1", "@discordjs/util": "^1.1.1",
"@discordjs/util": "^1.1.1" "@discordjs/collection": "^2.1.1"
}, },
"devDependencies": { "devDependencies": {
"@favware/cliff-jumper": "^4.1.0", "@favware/cliff-jumper": "^4.1.0",
@ -95,8 +95,8 @@
"turbo": "^2.0.14", "turbo": "^2.0.14",
"typescript": "~5.5.4", "typescript": "~5.5.4",
"vitest": "^2.0.5", "vitest": "^2.0.5",
"@discordjs/scripts": "^0.1.0", "@discordjs/api-extractor": "^7.38.1",
"@discordjs/api-extractor": "^7.38.1" "@discordjs/scripts": "^0.1.0"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"

View File

@ -519,7 +519,7 @@ var CompressionMethod = /* @__PURE__ */ ((CompressionMethod2) => {
CompressionMethod2["ZlibStream"] = "zlib-stream"; CompressionMethod2["ZlibStream"] = "zlib-stream";
return CompressionMethod2; return CompressionMethod2;
})(CompressionMethod || {}); })(CompressionMethod || {});
var DefaultDeviceProperty = `@discordjs/ws 1.2.1`; var DefaultDeviceProperty = `@discordjs/ws 1.2.2`;
var getDefaultSessionStore = (0, import_util.lazy)(() => new import_collection4.Collection()); var getDefaultSessionStore = (0, import_util.lazy)(() => new import_collection4.Collection());
var DefaultWebSocketManagerOptions = { var DefaultWebSocketManagerOptions = {
async buildIdentifyThrottler(manager) { async buildIdentifyThrottler(manager) {
@ -1476,7 +1476,7 @@ var WebSocketManager = class extends import_async_event_emitter2.AsyncEventEmitt
}; };
// src/index.ts // src/index.ts
var version = "1.2.1"; var version = "1.2.2";
// Annotate the CommonJS export names for ESM import in node: // Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = { 0 && (module.exports = {
CloseCodes, CloseCodes,

File diff suppressed because one or more lines are too long

View File

@ -480,7 +480,7 @@ var CompressionMethod = /* @__PURE__ */ ((CompressionMethod2) => {
CompressionMethod2["ZlibStream"] = "zlib-stream"; CompressionMethod2["ZlibStream"] = "zlib-stream";
return CompressionMethod2; return CompressionMethod2;
})(CompressionMethod || {}); })(CompressionMethod || {});
var DefaultDeviceProperty = `@discordjs/ws 1.2.1`; var DefaultDeviceProperty = `@discordjs/ws 1.2.2`;
var getDefaultSessionStore = lazy(() => new Collection4()); var getDefaultSessionStore = lazy(() => new Collection4());
var DefaultWebSocketManagerOptions = { var DefaultWebSocketManagerOptions = {
async buildIdentifyThrottler(manager) { async buildIdentifyThrottler(manager) {
@ -1439,7 +1439,7 @@ var WebSocketManager = class extends AsyncEventEmitter2 {
}; };
// src/index.ts // src/index.ts
var version = "1.2.1"; var version = "1.2.2";
export { export {
CloseCodes, CloseCodes,
CompressionMethod, CompressionMethod,

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{ {
"$schema": "https://json.schemastore.org/package.json", "$schema": "https://json.schemastore.org/package.json",
"name": "@discordjs/ws", "name": "@discordjs/ws",
"version": "1.2.1", "version": "1.2.2",
"description": "Wrapper around Discord's gateway", "description": "Wrapper around Discord's gateway",
"exports": { "exports": {
".": { ".": {
@ -62,11 +62,11 @@
"homepage": "https://discord.js.org", "homepage": "https://discord.js.org",
"funding": "https://github.com/discordjs/discord.js?sponsor", "funding": "https://github.com/discordjs/discord.js?sponsor",
"dependencies": { "dependencies": {
"@discordjs/rest": "^2.4.3", "@discordjs/rest": "^2.5.0",
"@sapphire/async-queue": "^1.5.2", "@sapphire/async-queue": "^1.5.2",
"@types/ws": "^8.5.10", "@types/ws": "^8.5.10",
"@vladfrangu/async_event_emitter": "^2.2.4", "@vladfrangu/async_event_emitter": "^2.2.4",
"discord-api-types": "^0.37.119", "discord-api-types": "^0.38.1",
"tslib": "^2.6.2", "tslib": "^2.6.2",
"ws": "^8.17.0", "ws": "^8.17.0",
"@discordjs/collection": "^2.1.0", "@discordjs/collection": "^2.1.0",
@ -90,8 +90,8 @@
"undici": "6.21.1", "undici": "6.21.1",
"vitest": "^1.6.0", "vitest": "^1.6.0",
"zlib-sync": "^0.1.9", "zlib-sync": "^0.1.9",
"@discordjs/scripts": "^0.1.0", "@discordjs/api-extractor": "^7.38.1",
"@discordjs/api-extractor": "^7.38.1" "@discordjs/scripts": "^0.1.0"
}, },
"engines": { "engines": {
"node": ">=16.11.0" "node": ">=16.11.0"

4
node_modules/@types/node/README.md generated vendored
View File

@ -8,8 +8,8 @@ This package contains type definitions for node (https://nodejs.org/).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node. Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
### Additional Details ### Additional Details
* Last updated: Wed, 02 Apr 2025 18:39:01 GMT * Last updated: Mon, 28 Apr 2025 06:43:21 GMT
* Dependencies: [undici-types](https://npmjs.com/package/undici-types) * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
# Credits # Credits
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [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), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky). These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [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), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), [Dmitry Semigradsky](https://github.com/Semigradsky), and [René](https://github.com/Renegade334).

55
node_modules/@types/node/assert.d.ts generated vendored
View File

@ -957,55 +957,14 @@ declare module "assert" {
*/ */
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void; function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
/** /**
* `assert.partialDeepStrictEqual()` Asserts the equivalence between the `actual` and `expected` parameters through a * Tests for partial deep equality between the `actual` and `expected` parameters.
* deep comparison, ensuring that all properties in the `expected` parameter are * "Deep" equality means that the enumerable "own" properties of child objects
* present in the `actual` parameter with equivalent values, not allowing type coercion. * are recursively evaluated also by the following rules. "Partial" equality means
* The main difference with `assert.deepStrictEqual()` is that `assert.partialDeepStrictEqual()` does not require * that only properties that exist on the `expected` parameter are going to be
* all properties in the `actual` parameter to be present in the `expected` parameter. * compared.
* This method should always pass the same test cases as `assert.deepStrictEqual()`, behaving as a super set of it.
* *
* ```js * This method always passes the same test cases as `assert.deepStrictEqual()`,
* import assert from 'node:assert'; * behaving as a super set of it.
*
* assert.partialDeepStrictEqual({ a: 1, b: 2 }, { a: 1, b: 2 });
* // OK
*
* assert.partialDeepStrictEqual({ a: { b: { c: 1 } } }, { a: { b: { c: 1 } } });
* // OK
*
* assert.partialDeepStrictEqual({ a: 1, b: 2, c: 3 }, { a: 1, b: 2 });
* // OK
*
* assert.partialDeepStrictEqual(new Set(['value1', 'value2']), new Set(['value1', 'value2']));
* // OK
*
* assert.partialDeepStrictEqual(new Map([['key1', 'value1']]), new Map([['key1', 'value1']]));
* // OK
*
* assert.partialDeepStrictEqual(new Uint8Array([1, 2, 3]), new Uint8Array([1, 2, 3]));
* // OK
*
* assert.partialDeepStrictEqual(/abc/, /abc/);
* // OK
*
* assert.partialDeepStrictEqual([{ a: 5 }, { b: 5 }], [{ a: 5 }]);
* // OK
*
* assert.partialDeepStrictEqual(new Set([{ a: 1 }, { b: 1 }]), new Set([{ a: 1 }]));
* // OK
*
* assert.partialDeepStrictEqual(new Date(0), new Date(0));
* // OK
*
* assert.partialDeepStrictEqual({ a: 1 }, { a: 1, b: 2 });
* // AssertionError
*
* assert.partialDeepStrictEqual({ a: 1, b: '2' }, { a: 1, b: 2 });
* // AssertionError
*
* assert.partialDeepStrictEqual({ a: { b: 2 } }, { a: { b: '2' } });
* // AssertionError
* ```
* @since v22.13.0 * @since v22.13.0
*/ */
function partialDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void; function partialDeepStrictEqual(actual: unknown, expected: unknown, message?: string | Error): void;

View File

@ -372,7 +372,6 @@ declare module "async_hooks" {
/** /**
* Binds the given function to the current execution context. * Binds the given function to the current execution context.
* @since v19.8.0 * @since v19.8.0
* @experimental
* @param fn The function to bind to the current execution context. * @param fn The function to bind to the current execution context.
* @return A new function that calls `fn` within the captured execution context. * @return A new function that calls `fn` within the captured execution context.
*/ */
@ -403,7 +402,6 @@ declare module "async_hooks" {
* console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123 * console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123
* ``` * ```
* @since v19.8.0 * @since v19.8.0
* @experimental
* @return A new function with the signature `(fn: (...args) : R, ...args) : R`. * @return A new function with the signature `(fn: (...args) : R, ...args) : R`.
*/ */
static snapshot(): <R, TArgs extends any[]>(fn: (...args: TArgs) => R, ...args: TArgs) => R; static snapshot(): <R, TArgs extends any[]>(fn: (...args: TArgs) => R, ...args: TArgs) => R;

View File

@ -160,6 +160,7 @@ declare module "buffer" {
* @param encoding The encoding of `string`. **Default:** `'utf8'`. * @param encoding The encoding of `string`. **Default:** `'utf8'`.
*/ */
from(string: WithImplicitCoercion<string>, encoding?: BufferEncoding): Buffer<ArrayBuffer>; from(string: WithImplicitCoercion<string>, encoding?: BufferEncoding): Buffer<ArrayBuffer>;
from(arrayOrString: WithImplicitCoercion<ArrayLike<number> | string>): Buffer<ArrayBuffer>;
/** /**
* Creates a new Buffer using the passed {data} * Creates a new Buffer using the passed {data}
* @param values to create a new Buffer * @param values to create a new Buffer

17
node_modules/@types/node/crypto.d.ts generated vendored
View File

@ -4221,9 +4221,13 @@ declare module "crypto" {
* - `'PBKDF2'` * - `'PBKDF2'`
* @since v15.0.0 * @since v15.0.0
*/ */
deriveBits(algorithm: EcdhKeyDeriveParams, baseKey: CryptoKey, length: number | null): Promise<ArrayBuffer>;
deriveBits( deriveBits(
algorithm: AlgorithmIdentifier | HkdfParams | Pbkdf2Params, algorithm: EcdhKeyDeriveParams,
baseKey: CryptoKey,
length?: number | null,
): Promise<ArrayBuffer>;
deriveBits(
algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
baseKey: CryptoKey, baseKey: CryptoKey,
length: number, length: number,
): Promise<ArrayBuffer>; ): Promise<ArrayBuffer>;
@ -4245,14 +4249,9 @@ declare module "crypto" {
* @since v15.0.0 * @since v15.0.0
*/ */
deriveKey( deriveKey(
algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, algorithm: EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params,
baseKey: CryptoKey, baseKey: CryptoKey,
derivedKeyAlgorithm: derivedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams,
| AlgorithmIdentifier
| AesDerivedKeyParams
| HmacImportParams
| HkdfParams
| Pbkdf2Params,
extractable: boolean, extractable: boolean,
keyUsages: readonly KeyUsage[], keyUsages: readonly KeyUsage[],
): Promise<CryptoKey>; ): Promise<CryptoKey>;

View File

@ -87,13 +87,6 @@ declare module "fs/promises" {
highWaterMark?: number | undefined; highWaterMark?: number | undefined;
flush?: boolean | undefined; flush?: boolean | undefined;
} }
interface ReadableWebStreamOptions {
/**
* Whether to open a normal or a `'bytes'` stream.
* @since v20.0.0
*/
type?: "bytes" | undefined;
}
// TODO: Add `EventEmitter` close // TODO: Add `EventEmitter` close
interface FileHandle { interface FileHandle {
/** /**
@ -244,7 +237,8 @@ declare module "fs/promises" {
): Promise<FileReadResult<T>>; ): Promise<FileReadResult<T>>;
read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>; read<T extends NodeJS.ArrayBufferView = Buffer>(options?: FileReadOptions<T>): Promise<FileReadResult<T>>;
/** /**
* Returns a `ReadableStream` that may be used to read the files data. * Returns a byte-oriented `ReadableStream` that may be used to read the file's
* contents.
* *
* An error will be thrown if this method is called more than once or is called * An error will be thrown if this method is called more than once or is called
* after the `FileHandle` is closed or closing. * after the `FileHandle` is closed or closing.
@ -267,7 +261,7 @@ declare module "fs/promises" {
* @since v17.0.0 * @since v17.0.0
* @experimental * @experimental
*/ */
readableWebStream(options?: ReadableWebStreamOptions): ReadableStream; readableWebStream(): ReadableStream;
/** /**
* Asynchronously reads the entire contents of a file. * Asynchronously reads the entire contents of a file.
* *

View File

@ -1252,6 +1252,8 @@ declare module "http2" {
Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse, Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse,
> extends SessionOptions { > extends SessionOptions {
streamResetBurst?: number | undefined;
streamResetRate?: number | undefined;
Http1IncomingMessage?: Http1Request | undefined; Http1IncomingMessage?: Http1Request | undefined;
Http1ServerResponse?: Http1Response | undefined; Http1ServerResponse?: Http1Response | undefined;
Http2ServerRequest?: Http2Request | undefined; Http2ServerRequest?: Http2Request | undefined;
@ -1269,10 +1271,7 @@ declare module "http2" {
Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse, Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse,
Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest, Http2Request extends typeof Http2ServerRequest = typeof Http2ServerRequest,
Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse, Http2Response extends typeof Http2ServerResponse<InstanceType<Http2Request>> = typeof Http2ServerResponse,
> extends ServerSessionOptions<Http1Request, Http1Response, Http2Request, Http2Response> { > extends ServerSessionOptions<Http1Request, Http1Response, Http2Request, Http2Response> {}
streamResetBurst?: number | undefined;
streamResetRate?: number | undefined;
}
export interface SecureServerOptions< export interface SecureServerOptions<
Http1Request extends typeof IncomingMessage = typeof IncomingMessage, Http1Request extends typeof IncomingMessage = typeof IncomingMessage,
Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse, Http1Response extends typeof ServerResponse<InstanceType<Http1Request>> = typeof ServerResponse,

View File

@ -1720,6 +1720,38 @@ declare module 'inspector' {
* Monotonically increasing time in seconds since an arbitrary point in the past. * Monotonically increasing time in seconds since an arbitrary point in the past.
*/ */
type MonotonicTime = number; type MonotonicTime = number;
/**
* Information about the request initiator.
*/
interface Initiator {
/**
* Type of this initiator.
*/
type: string;
/**
* Initiator JavaScript stack trace, set for Script only.
* Requires the Debugger domain to be enabled.
*/
stack?: Runtime.StackTrace | undefined;
/**
* Initiator URL, set for Parser type or for Script type (when script is importing module) or for SignedExchange type.
*/
url?: string | undefined;
/**
* Initiator line number, set for Parser type or for Script type (when script is importing
* module) (0-based).
*/
lineNumber?: number | undefined;
/**
* Initiator column number, set for Parser type or for Script type (when script is importing
* module) (0-based).
*/
columnNumber?: number | undefined;
/**
* Set if another request triggered this request (e.g. preflight).
*/
requestId?: RequestId | undefined;
}
/** /**
* HTTP request data. * HTTP request data.
*/ */
@ -1751,6 +1783,10 @@ declare module 'inspector' {
* Request data. * Request data.
*/ */
request: Request; request: Request;
/**
* Request initiator.
*/
initiator: Initiator;
/** /**
* Timestamp. * Timestamp.
*/ */

25
node_modules/@types/node/module.d.ts generated vendored
View File

@ -220,6 +220,31 @@ declare module "module" {
options?: RegisterOptions<Data>, options?: RegisterOptions<Data>,
): void; ): void;
function register<Data = any>(specifier: string | URL, options?: RegisterOptions<Data>): void; function register<Data = any>(specifier: string | URL, options?: RegisterOptions<Data>): void;
interface RegisterHooksOptions {
/**
* See [load hook](https://nodejs.org/docs/latest-v22.x/api/module.html#loadurl-context-nextload).
* @default undefined
*/
load?: LoadHook | undefined;
/**
* See [resolve hook](https://nodejs.org/docs/latest-v22.x/api/module.html#resolvespecifier-context-nextresolve).
* @default undefined
*/
resolve?: ResolveHook | undefined;
}
interface ModuleHooks {
/**
* Deregister the hook instance.
*/
deregister(): void;
}
/**
* Register [hooks](https://nodejs.org/docs/latest-v22.x/api/module.html#customization-hooks)
* that customize Node.js module resolution and loading behavior.
* @since v22.15.0
* @experimental
*/
function registerHooks(options: RegisterHooksOptions): ModuleHooks;
interface StripTypeScriptTypesOptions { interface StripTypeScriptTypesOptions {
/** /**
* Possible values are: * Possible values are:

View File

@ -1,6 +1,6 @@
{ {
"name": "@types/node", "name": "@types/node",
"version": "22.14.0", "version": "22.15.3",
"description": "TypeScript definitions for node", "description": "TypeScript definitions for node",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
"license": "MIT", "license": "MIT",
@ -194,6 +194,11 @@
"name": "Dmitry Semigradsky", "name": "Dmitry Semigradsky",
"githubUsername": "Semigradsky", "githubUsername": "Semigradsky",
"url": "https://github.com/Semigradsky" "url": "https://github.com/Semigradsky"
},
{
"name": "René",
"githubUsername": "Renegade334",
"url": "https://github.com/Renegade334"
} }
], ],
"main": "", "main": "",
@ -215,6 +220,6 @@
"undici-types": "~6.21.0" "undici-types": "~6.21.0"
}, },
"peerDependencies": {}, "peerDependencies": {},
"typesPublisherContentHash": "85380e858018285cbe47b1f83eb49c9bd791be4b6f059c2ae75b99b5b202ea93", "typesPublisherContentHash": "2aecc93ec4fa0fcbf62f8df1fe665ab3615d3005c7b01703781b7e8c26655911",
"typeScriptVersion": "5.1" "typeScriptVersion": "5.1"
} }

View File

@ -1938,6 +1938,28 @@ declare module "process" {
* @param maybeRefable An object that may be "unref'd". * @param maybeRefable An object that may be "unref'd".
*/ */
unref(maybeRefable: any): void; unref(maybeRefable: any): void;
/**
* Replaces the current process with a new process.
*
* This is achieved by using the `execve` POSIX function and therefore no memory or other
* resources from the current process are preserved, except for the standard input,
* standard output and standard error file descriptor.
*
* All other resources are discarded by the system when the processes are swapped, without triggering
* any exit or close events and without running any cleanup handler.
*
* This function will never return, unless an error occurred.
*
* This function is not available on Windows or IBM i.
* @since v22.15.0
* @experimental
* @param file The name or path of the executable file to run.
* @param args List of string arguments. No argument can contain a null-byte (`\u0000`).
* @param env Environment key-value pairs.
* No key or value can contain a null-byte (`\u0000`).
* **Default:** `process.env`.
*/
execve?(file: string, args?: readonly string[], env?: ProcessEnv): never;
/* EventEmitter */ /* EventEmitter */
addListener(event: "beforeExit", listener: BeforeExitListener): this; addListener(event: "beforeExit", listener: BeforeExitListener): this;
addListener(event: "disconnect", listener: DisconnectListener): this; addListener(event: "disconnect", listener: DisconnectListener): this;

View File

@ -51,7 +51,7 @@ declare module "readline" {
* and is read from, the `input` stream. * and is read from, the `input` stream.
* @since v0.1.104 * @since v0.1.104
*/ */
export class Interface extends EventEmitter { export class Interface extends EventEmitter implements Disposable {
readonly terminal: boolean; readonly terminal: boolean;
/** /**
* The current input data being processed by node. * The current input data being processed by node.
@ -208,6 +208,11 @@ declare module "readline" {
* @since v0.1.98 * @since v0.1.98
*/ */
close(): void; close(): void;
/**
* Alias for `rl.close()`.
* @since v22.15.0
*/
[Symbol.dispose](): void;
/** /**
* The `rl.write()` method will write either `data` or a key sequence identified * The `rl.write()` method will write either `data` or a key sequence identified
* by `key` to the `output`. The `key` argument is supported only if `output` is * by `key` to the `output`. The `key` argument is supported only if `output` is

49
node_modules/@types/node/sqlite.d.ts generated vendored
View File

@ -158,9 +158,10 @@ declare module "node:sqlite" {
*/ */
useBigIntArguments?: boolean | undefined; useBigIntArguments?: boolean | undefined;
/** /**
* If `true`, `function` can accept a variable number of * If `true`, `function` may be invoked with any number of
* arguments. If `false`, `function` must be invoked with exactly * arguments (between zero and
* `function.length` arguments. * [`SQLITE_MAX_FUNCTION_ARG`](https://www.sqlite.org/limits.html#max_function_arg)). If `false`,
* `function` must be invoked with exactly `function.length` arguments.
* @default false * @default false
*/ */
varargs?: boolean | undefined; varargs?: boolean | undefined;
@ -170,16 +171,16 @@ declare module "node:sqlite" {
* exposed by this class execute synchronously. * exposed by this class execute synchronously.
* @since v22.5.0 * @since v22.5.0
*/ */
class DatabaseSync { class DatabaseSync implements Disposable {
/** /**
* Constructs a new `DatabaseSync` instance. * Constructs a new `DatabaseSync` instance.
* @param location The location of the database. * @param path The path of the database.
* A SQLite database can be stored in a file or completely [in memory](https://www.sqlite.org/inmemorydb.html). * A SQLite database can be stored in a file or completely [in memory](https://www.sqlite.org/inmemorydb.html).
* To use a file-backed database, the location should be a file path. * To use a file-backed database, the path should be a file path.
* To use an in-memory database, the location should be the special name `':memory:'`. * To use an in-memory database, the path should be the special name `':memory:'`.
* @param options Configuration options for the database connection. * @param options Configuration options for the database connection.
*/ */
constructor(location: string, options?: DatabaseSyncOptions); constructor(path: string | Buffer | URL, options?: DatabaseSyncOptions);
/** /**
* Closes the database connection. An exception is thrown if the database is not * Closes the database connection. An exception is thrown if the database is not
* open. This method is a wrapper around [`sqlite3_close_v2()`](https://www.sqlite.org/c3ref/close.html). * open. This method is a wrapper around [`sqlite3_close_v2()`](https://www.sqlite.org/c3ref/close.html).
@ -217,16 +218,24 @@ declare module "node:sqlite" {
* @param name The name of the SQLite function to create. * @param name The name of the SQLite function to create.
* @param options Optional configuration settings for the function. * @param options Optional configuration settings for the function.
* @param func The JavaScript function to call when the SQLite * @param func The JavaScript function to call when the SQLite
* function is invoked. * function is invoked. The return value of this function should be a valid
* SQLite data type: see
* [Type conversion between JavaScript and SQLite](https://nodejs.org/docs/latest-v22.x/api/sqlite.html#type-conversion-between-javascript-and-sqlite).
* The result defaults to `NULL` if the return value is `undefined`.
*/ */
function( function(
name: string, name: string,
options: FunctionOptions, options: FunctionOptions,
func: (...args: SupportedValueType[]) => SupportedValueType, func: (...args: SQLOutputValue[]) => SQLInputValue,
): void; ): void;
function(name: string, func: (...args: SupportedValueType[]) => SupportedValueType): void; function(name: string, func: (...args: SQLOutputValue[]) => SQLInputValue): void;
/** /**
* Opens the database specified in the `location` argument of the `DatabaseSync`constructor. This method should only be used when the database is not opened via * Whether the database is currently open or not.
* @since v22.15.0
*/
readonly isOpen: boolean;
/**
* Opens the database specified in the `path` argument of the `DatabaseSync`constructor. This method should only be used when the database is not opened via
* the constructor. An exception is thrown if the database is already open. * the constructor. An exception is thrown if the database is already open.
* @since v22.5.0 * @since v22.5.0
*/ */
@ -272,10 +281,17 @@ declare module "node:sqlite" {
* ``` * ```
* @param changeset A binary changeset or patchset. * @param changeset A binary changeset or patchset.
* @param options The configuration options for how the changes will be applied. * @param options The configuration options for how the changes will be applied.
* @returns Whether the changeset was applied succesfully without being aborted. * @returns Whether the changeset was applied successfully without being aborted.
* @since v22.12.0 * @since v22.12.0
*/ */
applyChangeset(changeset: Uint8Array, options?: ApplyChangesetOptions): boolean; applyChangeset(changeset: Uint8Array, options?: ApplyChangesetOptions): boolean;
/**
* Closes the database connection. If the database connection is already closed
* then this is a no-op.
* @since v22.15.0
* @experimental
*/
[Symbol.dispose](): void;
} }
/** /**
* @since v22.12.0 * @since v22.12.0
@ -424,6 +440,13 @@ declare module "node:sqlite" {
* @param enabled Enables or disables support for binding named parameters without the prefix character. * @param enabled Enables or disables support for binding named parameters without the prefix character.
*/ */
setAllowBareNamedParameters(enabled: boolean): void; setAllowBareNamedParameters(enabled: boolean): void;
/**
* By default, if an unknown name is encountered while binding parameters, an
* exception is thrown. This method allows unknown named parameters to be ignored.
* @since v22.15.0
* @param enabled Enables or disables support for unknown named parameters.
*/
setAllowUnknownNamedParameters(enabled: boolean): void;
/** /**
* When reading from the database, SQLite `INTEGER`s are mapped to JavaScript * When reading from the database, SQLite `INTEGER`s are mapped to JavaScript
* numbers by default. However, SQLite `INTEGER`s can store values larger than * numbers by default. However, SQLite `INTEGER`s can store values larger than

60
node_modules/@types/node/test.d.ts generated vendored
View File

@ -648,11 +648,12 @@ declare module "node:test" {
*/ */
readonly name: string; readonly name: string;
/** /**
* Used to set the number of assertions and subtests that are expected to run within the test. * This function is used to set the number of assertions and subtests that are expected to run
* If the number of assertions and subtests that run does not match the expected count, the test will fail. * within the test. If the number of assertions and subtests that run does not match the
* expected count, the test will fail.
*
* > Note: To make sure assertions are tracked, `t.assert` must be used instead of `assert` directly.
* *
* To make sure assertions are tracked, the assert functions on `context.assert` must be used,
* instead of importing from the `node:assert` module.
* ```js * ```js
* test('top level test', (t) => { * test('top level test', (t) => {
* t.plan(2); * t.plan(2);
@ -661,7 +662,9 @@ declare module "node:test" {
* }); * });
* ``` * ```
* *
* When working with asynchronous code, the `plan` function can be used to ensure that the correct number of assertions are run: * When working with asynchronous code, the `plan` function can be used to ensure that the
* correct number of assertions are run:
*
* ```js * ```js
* test('planning with streams', (t, done) => { * test('planning with streams', (t, done) => {
* function* generate() { * function* generate() {
@ -675,14 +678,35 @@ declare module "node:test" {
* stream.on('data', (chunk) => { * stream.on('data', (chunk) => {
* t.assert.strictEqual(chunk, expected.shift()); * t.assert.strictEqual(chunk, expected.shift());
* }); * });
*
* stream.on('end', () => { * stream.on('end', () => {
* done(); * done();
* }); * });
* }); * });
* ``` * ```
*
* When using the `wait` option, you can control how long the test will wait for the expected assertions.
* For example, setting a maximum wait time ensures that the test will wait for asynchronous assertions
* to complete within the specified timeframe:
*
* ```js
* test('plan with wait: 2000 waits for async assertions', (t) => {
* t.plan(1, { wait: 2000 }); // Waits for up to 2 seconds for the assertion to complete.
*
* const asyncActivity = () => {
* setTimeout(() => {
* * t.assert.ok(true, 'Async assertion completed within the wait time');
* }, 1000); // Completes after 1 second, within the 2-second wait time.
* };
*
* asyncActivity(); // The test will pass because the assertion is completed in time.
* });
* ```
*
* Note: If a `wait` timeout is specified, it begins counting down only after the test function finishes executing.
* @since v22.2.0 * @since v22.2.0
*/ */
plan(count: number): void; plan(count: number, options?: TestContextPlanOptions): void;
/** /**
* If `shouldRunOnlyTests` is truthy, the test context will only run tests that * If `shouldRunOnlyTests` is truthy, the test context will only run tests that
* have the `only` option set. Otherwise, all tests are run. If Node.js was not * have the `only` option set. Otherwise, all tests are run. If Node.js was not
@ -858,6 +882,20 @@ declare module "node:test" {
*/ */
serializers?: ReadonlyArray<(value: any) => any> | undefined; serializers?: ReadonlyArray<(value: any) => any> | undefined;
} }
interface TestContextPlanOptions {
/**
* The wait time for the plan:
* * If `true`, the plan waits indefinitely for all assertions and subtests to run.
* * If `false`, the plan performs an immediate check after the test function completes,
* without waiting for any pending assertions or subtests.
* Any assertions or subtests that complete after this check will not be counted towards the plan.
* * If a number, it specifies the maximum wait time in milliseconds
* before timing out while waiting for expected assertions and subtests to be matched.
* If the timeout is reached, the test will fail.
* @default false
*/
wait?: boolean | number | undefined;
}
interface TestContextWaitForOptions { interface TestContextWaitForOptions {
/** /**
* The number of milliseconds to wait after an unsuccessful * The number of milliseconds to wait after an unsuccessful
@ -1971,6 +2009,11 @@ interface TestDequeue extends TestLocationInfo {
* The nesting level of the test. * The nesting level of the test.
*/ */
nesting: number; nesting: number;
/**
* The test type. Either `'suite'` or `'test'`.
* @since v22.15.0
*/
type: "suite" | "test";
} }
interface TestEnqueue extends TestLocationInfo { interface TestEnqueue extends TestLocationInfo {
/** /**
@ -1981,6 +2024,11 @@ interface TestEnqueue extends TestLocationInfo {
* The nesting level of the test. * The nesting level of the test.
*/ */
nesting: number; nesting: number;
/**
* The test type. Either `'suite'` or `'test'`.
* @since v22.15.0
*/
type: "suite" | "test";
} }
interface TestFail extends TestLocationInfo { interface TestFail extends TestLocationInfo {
/** /**

33
node_modules/@types/node/tls.d.ts generated vendored
View File

@ -398,6 +398,14 @@ declare module "tls" {
}, },
callback: (err: Error | null) => void, callback: (err: Error | null) => void,
): undefined | boolean; ): undefined | boolean;
/**
* The `tlsSocket.setKeyCert()` method sets the private key and certificate to use for the socket.
* This is mainly useful if you wish to select a server certificate from a TLS server's `ALPNCallback`.
* @since v22.5.0, v20.17.0
* @param context An object containing at least `key` and `cert` properties from the {@link createSecureContext()} `options`,
* or a TLS context object created with {@link createSecureContext()} itself.
*/
setKeyCert(context: SecureContextOptions | SecureContext): void;
/** /**
* The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size. * The `tlsSocket.setMaxSendFragment()` method sets the maximum TLS fragment size.
* Returns `true` if setting the limit succeeded; `false` otherwise. * Returns `true` if setting the limit succeeded; `false` otherwise.
@ -1158,6 +1166,31 @@ declare module "tls" {
* @since v0.11.13 * @since v0.11.13
*/ */
function createSecureContext(options?: SecureContextOptions): SecureContext; function createSecureContext(options?: SecureContextOptions): SecureContext;
/**
* Returns an array containing the CA certificates from various sources, depending on `type`:
*
* * `"default"`: return the CA certificates that will be used by the Node.js TLS clients by default.
* * When `--use-bundled-ca` is enabled (default), or `--use-openssl-ca` is not enabled,
* this would include CA certificates from the bundled Mozilla CA store.
* * When `--use-system-ca` is enabled, this would also include certificates from the system's
* trusted store.
* * When `NODE_EXTRA_CA_CERTS` is used, this would also include certificates loaded from the specified
* file.
* * `"system"`: return the CA certificates that are loaded from the system's trusted store, according
* to rules set by `--use-system-ca`. This can be used to get the certificates from the system
* when `--use-system-ca` is not enabled.
* * `"bundled"`: return the CA certificates from the bundled Mozilla CA store. This would be the same
* as `tls.rootCertificates`.
* * `"extra"`: return the CA certificates loaded from `NODE_EXTRA_CA_CERTS`. It's an empty array if
* `NODE_EXTRA_CA_CERTS` is not set.
* @since v22.15.0
* @param type The type of CA certificates that will be returned. Valid values
* are `"default"`, `"system"`, `"bundled"` and `"extra"`.
* **Default:** `"default"`.
* @returns An array of PEM-encoded certificates. The array may contain duplicates
* if the same certificate is repeatedly stored in multiple sources.
*/
function getCACertificates(type?: "default" | "system" | "bundled" | "extra"): string[];
/** /**
* Returns an array with the names of the supported TLS ciphers. The names are * Returns an array with the names of the supported TLS ciphers. The names are
* lower-case for historical reasons, but must be uppercased to be used in * lower-case for historical reasons, but must be uppercased to be used in

View File

@ -158,6 +158,7 @@ declare module "buffer" {
* @param encoding The encoding of `string`. **Default:** `'utf8'`. * @param encoding The encoding of `string`. **Default:** `'utf8'`.
*/ */
from(string: WithImplicitCoercion<string>, encoding?: BufferEncoding): Buffer; from(string: WithImplicitCoercion<string>, encoding?: BufferEncoding): Buffer;
from(arrayOrString: WithImplicitCoercion<ArrayLike<number> | string>): Buffer;
/** /**
* Creates a new Buffer using the passed {data} * Creates a new Buffer using the passed {data}
* @param values to create a new Buffer * @param values to create a new Buffer

313
node_modules/@types/node/util.d.ts generated vendored
View File

@ -133,6 +133,58 @@ declare module "util" {
*/ */
columnNumber: number; columnNumber: number;
} }
export type DiffEntry = [operation: -1 | 0 | 1, value: string];
/**
* `util.diff()` compares two string or array values and returns an array of difference entries.
* It uses the Myers diff algorithm to compute minimal differences, which is the same algorithm
* used internally by assertion error messages.
*
* If the values are equal, an empty array is returned.
*
* ```js
* const { diff } = require('node:util');
*
* // Comparing strings
* const actualString = '12345678';
* const expectedString = '12!!5!7!';
* console.log(diff(actualString, expectedString));
* // [
* // [0, '1'],
* // [0, '2'],
* // [1, '3'],
* // [1, '4'],
* // [-1, '!'],
* // [-1, '!'],
* // [0, '5'],
* // [1, '6'],
* // [-1, '!'],
* // [0, '7'],
* // [1, '8'],
* // [-1, '!'],
* // ]
* // Comparing arrays
* const actualArray = ['1', '2', '3'];
* const expectedArray = ['1', '3', '4'];
* console.log(diff(actualArray, expectedArray));
* // [
* // [0, '1'],
* // [1, '2'],
* // [0, '3'],
* // [-1, '4'],
* // ]
* // Equal values return empty array
* console.log(diff('same', 'same'));
* // []
* ```
* @since v22.15.0
* @experimental
* @param actual The first value to compare
* @param expected The second value to compare
* @returns An array of difference entries. Each entry is an array with two elements:
* * Index 0: `number` Operation code: `-1` for delete, `0` for no-op/unchanged, `1` for insert
* * Index 1: `string` The value associated with the operation
*/
export function diff(actual: string | readonly string[], expected: string | readonly string[]): DiffEntry[];
/** /**
* The `util.format()` method returns a formatted string using the first argument * The `util.format()` method returns a formatted string using the first argument
* as a `printf`-like format string which can contain zero or more format * as a `printf`-like format string which can contain zero or more format
@ -203,10 +255,10 @@ declare module "util" {
* the caller function. * the caller function.
* *
* ```js * ```js
* const util = require('node:util'); * import { getCallSites } from 'node:util';
* *
* function exampleFunction() { * function exampleFunction() {
* const callSites = util.getCallSites(); * const callSites = getCallSites();
* *
* console.log('Call Sites:'); * console.log('Call Sites:');
* callSites.forEach((callSite, index) => { * callSites.forEach((callSite, index) => {
@ -245,13 +297,13 @@ declare module "util" {
* `sourceMap` will be true by default. * `sourceMap` will be true by default.
* *
* ```ts * ```ts
* import util from 'node:util'; * import { getCallSites } from 'node:util';
* *
* interface Foo { * interface Foo {
* foo: string; * foo: string;
* } * }
* *
* const callSites = util.getCallSites({ sourceMap: true }); * const callSites = getCallSites({ sourceMap: true });
* *
* // With sourceMap: * // With sourceMap:
* // Function Name: '' * // Function Name: ''
@ -308,8 +360,8 @@ declare module "util" {
* *
* ```js * ```js
* fs.access('file/that/does/not/exist', (err) => { * fs.access('file/that/does/not/exist', (err) => {
* const name = util.getSystemErrorMessage(err.errno); * const message = util.getSystemErrorMessage(err.errno);
* console.error(name); // no such file or directory * console.error(message); // no such file or directory
* }); * });
* ``` * ```
* @since v22.12.0 * @since v22.12.0
@ -339,7 +391,6 @@ declare module "util" {
* Creates and returns an `AbortController` instance whose `AbortSignal` is marked * Creates and returns an `AbortController` instance whose `AbortSignal` is marked
* as transferable and can be used with `structuredClone()` or `postMessage()`. * as transferable and can be used with `structuredClone()` or `postMessage()`.
* @since v18.11.0 * @since v18.11.0
* @experimental
* @returns A transferable AbortController * @returns A transferable AbortController
*/ */
export function transferableAbortController(): AbortController; export function transferableAbortController(): AbortController;
@ -352,7 +403,6 @@ declare module "util" {
* channel.port2.postMessage(signal, [signal]); * channel.port2.postMessage(signal, [signal]);
* ``` * ```
* @since v18.11.0 * @since v18.11.0
* @experimental
* @param signal The AbortSignal * @param signal The AbortSignal
* @returns The same AbortSignal * @returns The same AbortSignal
*/ */
@ -394,7 +444,8 @@ declare module "util" {
* The `util.inspect()` method returns a string representation of `object` that is * 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 * intended for debugging. The output of `util.inspect` may change at any time
* and should not be depended upon programmatically. Additional `options` may be * and should not be depended upon programmatically. Additional `options` may be
* passed that alter the result. `util.inspect()` will use the constructor's name and/or `@@toStringTag` to make * passed that alter the result.
* `util.inspect()` will use the constructor's name and/or `@@toStringTag` to make
* an identifiable tag for an inspected value. * an identifiable tag for an inspected value.
* *
* ```js * ```js
@ -442,7 +493,7 @@ declare module "util" {
* The following example highlights the effect of the `compact` option: * The following example highlights the effect of the `compact` option:
* *
* ```js * ```js
* import util from 'node:util'; * import { inspect } from 'node:util';
* *
* const o = { * const o = {
* a: [1, 2, [[ * a: [1, 2, [[
@ -452,7 +503,7 @@ declare module "util" {
* 'foo']], 4], * 'foo']], 4],
* b: new Map([['za', 1], ['zb', 'test']]), * b: new Map([['za', 1], ['zb', 'test']]),
* }; * };
* console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 })); * console.log(inspect(o, { compact: true, depth: 5, breakLength: 80 }));
* *
* // { a: * // { a:
* // [ 1, * // [ 1,
@ -464,7 +515,7 @@ declare module "util" {
* // b: Map(2) { 'za' => 1, 'zb' => 'test' } } * // b: Map(2) { 'za' => 1, 'zb' => 'test' } }
* *
* // Setting `compact` to false or an integer creates more reader friendly output. * // Setting `compact` to false or an integer creates more reader friendly output.
* console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 })); * console.log(inspect(o, { compact: false, depth: 5, breakLength: 80 }));
* *
* // { * // {
* // a: [ * // a: [
@ -491,11 +542,10 @@ declare module "util" {
* // single line. * // single line.
* ``` * ```
* *
* The `showHidden` option allows [`WeakMap`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap) and * The `showHidden` option allows `WeakMap` and `WeakSet` entries to be
* [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries to be
* inspected. If there are more entries than `maxArrayLength`, there is no * inspected. If there are more entries than `maxArrayLength`, there is no
* guarantee which entries are displayed. That means retrieving the same [`WeakSet`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet) entries twice may * guarantee which entries are displayed. That means retrieving the same
* result in different output. Furthermore, entries * `WeakSet` entries twice may result in different output. Furthermore, entries
* with no remaining strong references may be garbage collected at any time. * with no remaining strong references may be garbage collected at any time.
* *
* ```js * ```js
@ -543,10 +593,10 @@ declare module "util" {
* ```js * ```js
* import { inspect } from 'node:util'; * import { inspect } from 'node:util';
* *
* const thousand = 1_000; * const thousand = 1000;
* const million = 1_000_000; * const million = 1000000;
* const bigNumber = 123_456_789n; * const bigNumber = 123456789n;
* const bigDecimal = 1_234.123_45; * const bigDecimal = 1234.12345;
* *
* console.log(inspect(thousand, { numericSeparator: true })); * console.log(inspect(thousand, { numericSeparator: true }));
* // 1_000 * // 1_000
@ -667,19 +717,23 @@ declare module "util" {
*/ */
export function isError(object: unknown): object is Error; export function isError(object: unknown): object is Error;
/** /**
* Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and `extends` keywords to get language level inheritance support. Also note * Usage of `util.inherits()` is discouraged. Please use the ES6 `class` and
* `extends` keywords to get language level inheritance support. Also note
* that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179). * that the two styles are [semantically incompatible](https://github.com/nodejs/node/issues/4179).
* *
* Inherit the prototype methods from one [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The * Inherit the prototype methods from one
* prototype of `constructor` will be set to a new object created from `superConstructor`. * [constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/constructor) into another. The
* prototype of `constructor` will be set to a new object created from
* `superConstructor`.
* *
* This mainly adds some input validation on top of`Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`. * This mainly adds some input validation on top of
* `Object.setPrototypeOf(constructor.prototype, superConstructor.prototype)`.
* As an additional convenience, `superConstructor` will be accessible * As an additional convenience, `superConstructor` will be accessible
* through the `constructor.super_` property. * through the `constructor.super_` property.
* *
* ```js * ```js
* import util from 'node:util'; * const util = require('node:util');
* import EventEmitter from 'node:events'; * const EventEmitter = require('node:events');
* *
* function MyStream() { * function MyStream() {
* EventEmitter.call(this); * EventEmitter.call(this);
@ -726,18 +780,42 @@ declare module "util" {
export function inherits(constructor: unknown, superConstructor: unknown): void; export function inherits(constructor: unknown, superConstructor: unknown): void;
export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void; export type DebugLoggerFunction = (msg: string, ...param: unknown[]) => void;
export interface DebugLogger extends DebugLoggerFunction { export interface DebugLogger extends DebugLoggerFunction {
/**
* The `util.debuglog().enabled` getter is used to create a test that can be used
* in conditionals based on the existence of the `NODE_DEBUG` environment variable.
* If the `section` name appears within the value of that environment variable,
* then the returned value will be `true`. If not, then the returned value will be
* `false`.
*
* ```js
* import { debuglog } from 'node:util';
* const enabled = debuglog('foo').enabled;
* if (enabled) {
* console.log('hello from foo [%d]', 123);
* }
* ```
*
* If this program is run with `NODE_DEBUG=foo` in the environment, then it will
* output something like:
*
* ```console
* hello from foo [123]
* ```
*/
enabled: boolean; enabled: boolean;
} }
/** /**
* The `util.debuglog()` method is used to create a function that conditionally * The `util.debuglog()` method is used to create a function that conditionally
* writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`environment variable. If the `section` name appears within the value of that * writes debug messages to `stderr` based on the existence of the `NODE_DEBUG`
* environment variable, then the returned function operates similar to `console.error()`. If not, then the returned function is a no-op. * environment variable. If the `section` name appears within the value of that
* environment variable, then the returned function operates similar to
* `console.error()`. If not, then the returned function is a no-op.
* *
* ```js * ```js
* import util from 'node:util'; * import { debuglog } from 'node:util';
* const debuglog = util.debuglog('foo'); * const log = debuglog('foo');
* *
* debuglog('hello from foo [%d]', 123); * log('hello from foo [%d]', 123);
* ``` * ```
* *
* If this program is run with `NODE_DEBUG=foo` in the environment, then * If this program is run with `NODE_DEBUG=foo` in the environment, then
@ -753,10 +831,10 @@ declare module "util" {
* The `section` supports wildcard also: * The `section` supports wildcard also:
* *
* ```js * ```js
* import util from 'node:util'; * import { debuglog } from 'node:util';
* const debuglog = util.debuglog('foo-bar'); * const log = debuglog('foo');
* *
* debuglog('hi there, it\'s foo-bar [%d]', 2333); * log('hi there, it\'s foo-bar [%d]', 2333);
* ``` * ```
* *
* if it is run with `NODE_DEBUG=foo*` in the environment, then it will output * if it is run with `NODE_DEBUG=foo*` in the environment, then it will output
@ -766,18 +844,19 @@ declare module "util" {
* FOO-BAR 3257: hi there, it's foo-bar [2333] * FOO-BAR 3257: hi there, it's foo-bar [2333]
* ``` * ```
* *
* Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`environment variable: `NODE_DEBUG=fs,net,tls`. * Multiple comma-separated `section` names may be specified in the `NODE_DEBUG`
* environment variable: `NODE_DEBUG=fs,net,tls`.
* *
* The optional `callback` argument can be used to replace the logging function * The optional `callback` argument can be used to replace the logging function
* with a different function that doesn't have any initialization or * with a different function that doesn't have any initialization or
* unnecessary wrapping. * unnecessary wrapping.
* *
* ```js * ```js
* import util from 'node:util'; * import { debuglog } from 'node:util';
* let debuglog = util.debuglog('internals', (debug) => { * let log = debuglog('internals', (debug) => {
* // Replace with a logging function that optimizes out * // Replace with a logging function that optimizes out
* // testing if the section is enabled * // testing if the section is enabled
* debuglog = debug; * log = debug;
* }); * });
* ``` * ```
* @since v0.11.3 * @since v0.11.3
@ -786,7 +865,7 @@ declare module "util" {
* @return The logging function * @return The logging function
*/ */
export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger; export function debuglog(section: string, callback?: (fn: DebugLoggerFunction) => void): DebugLogger;
export const debug: typeof debuglog; export { debuglog as debug };
/** /**
* Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`. * Returns `true` if the given `object` is a `Boolean`. Otherwise, returns `false`.
* *
@ -1003,14 +1082,15 @@ declare module "util" {
* such a way that it is marked as deprecated. * such a way that it is marked as deprecated.
* *
* ```js * ```js
* import util from 'node:util'; * import { deprecate } from 'node:util';
* *
* exports.obsoleteFunction = util.deprecate(() => { * export const obsoleteFunction = deprecate(() => {
* // Do something here. * // Do something here.
* }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.'); * }, 'obsoleteFunction() is deprecated. Use newShinyFunction() instead.');
* ``` * ```
* *
* When called, `util.deprecate()` will return a function that will emit a `DeprecationWarning` using the `'warning'` event. The warning will * When called, `util.deprecate()` will return a function that will emit a
* `DeprecationWarning` using the `'warning'` event. The warning will
* be emitted and printed to `stderr` the first time the returned function is * be emitted and printed to `stderr` the first time the returned function is
* called. After the warning is emitted, the wrapped function is called without * called. After the warning is emitted, the wrapped function is called without
* emitting a warning. * emitting a warning.
@ -1019,16 +1099,24 @@ declare module "util" {
* the warning will be emitted only once for that `code`. * the warning will be emitted only once for that `code`.
* *
* ```js * ```js
* import util from 'node:util'; * import { deprecate } from 'node:util';
* *
* const fn1 = util.deprecate(someFunction, someMessage, 'DEP0001'); * const fn1 = deprecate(
* const fn2 = util.deprecate(someOtherFunction, someOtherMessage, 'DEP0001'); * () => 'a value',
* 'deprecation message',
* 'DEP0001',
* );
* const fn2 = deprecate(
* () => 'a different value',
* 'other dep message',
* 'DEP0001',
* );
* fn1(); // Emits a deprecation warning with code DEP0001 * fn1(); // Emits a deprecation warning with code DEP0001
* fn2(); // Does not emit a deprecation warning because it has the same code * fn2(); // Does not emit a deprecation warning because it has the same code
* ``` * ```
* *
* If either the `--no-deprecation` or `--no-warnings` command-line flags are * If either the `--no-deprecation` or `--no-warnings` command-line flags are
* used, or if the `process.noDeprecation` property is set to `true`_prior_ to * used, or if the `process.noDeprecation` property is set to `true` _prior_ to
* the first deprecation warning, the `util.deprecate()` method does nothing. * the first deprecation warning, the `util.deprecate()` method does nothing.
* *
* If the `--trace-deprecation` or `--trace-warnings` command-line flags are set, * If the `--trace-deprecation` or `--trace-warnings` command-line flags are set,
@ -1036,10 +1124,13 @@ declare module "util" {
* stack trace are printed to `stderr` the first time the deprecated function is * stack trace are printed to `stderr` the first time the deprecated function is
* called. * called.
* *
* If the `--throw-deprecation` command-line flag is set, or the `process.throwDeprecation` property is set to `true`, then an exception will be * If the `--throw-deprecation` command-line flag is set, or the
* `process.throwDeprecation` property is set to `true`, then an exception will be
* thrown when the deprecated function is called. * thrown when the deprecated function is called.
* *
* The `--throw-deprecation` command-line flag and `process.throwDeprecation` property take precedence over `--trace-deprecation` and `process.traceDeprecation`. * The `--throw-deprecation` command-line flag and `process.throwDeprecation`
* property take precedence over `--trace-deprecation` and
* `process.traceDeprecation`.
* @since v0.8.0 * @since v0.8.0
* @param fn The function that is being deprecated. * @param fn The function that is being deprecated.
* @param msg A warning message to display when the deprecated function is invoked. * @param msg A warning message to display when the deprecated function is invoked.
@ -1070,15 +1161,16 @@ declare module "util" {
* Takes an `async` function (or a function that returns a `Promise`) and returns a * Takes an `async` function (or a function that returns a `Promise`) and returns a
* function following the error-first callback style, i.e. taking * function following the error-first callback style, i.e. taking
* an `(err, value) => ...` callback as the last argument. In the callback, the * an `(err, value) => ...` callback as the last argument. In the callback, the
* first argument will be the rejection reason (or `null` if the `Promise` resolved), and the second argument will be the resolved value. * first argument will be the rejection reason (or `null` if the `Promise`
* resolved), and the second argument will be the resolved value.
* *
* ```js * ```js
* import util from 'node:util'; * import { callbackify } from 'node:util';
* *
* async function fn() { * async function fn() {
* return 'hello world'; * return 'hello world';
* } * }
* const callbackFunction = util.callbackify(fn); * const callbackFunction = callbackify(fn);
* *
* callbackFunction((err, ret) => { * callbackFunction((err, ret) => {
* if (err) throw err; * if (err) throw err;
@ -1093,11 +1185,13 @@ declare module "util" {
* ``` * ```
* *
* The callback is executed asynchronously, and will have a limited stack trace. * The callback is executed asynchronously, and will have a limited stack trace.
* If the callback throws, the process will emit an `'uncaughtException'` event, and if not handled will exit. * If the callback throws, the process will emit an `'uncaughtException'`
* event, and if not handled will exit.
* *
* Since `null` has a special meaning as the first argument to a callback, if a * Since `null` has a special meaning as the first argument to a callback, if a
* wrapped function rejects a `Promise` with a falsy value as a reason, the value * wrapped function rejects a `Promise` with a falsy value as a reason, the value
* is wrapped in an `Error` with the original value stored in a field named `reason`. * is wrapped in an `Error` with the original value stored in a field named
* `reason`.
* *
* ```js * ```js
* function fn() { * function fn() {
@ -1108,7 +1202,7 @@ declare module "util" {
* callbackFunction((err, ret) => { * callbackFunction((err, ret) => {
* // When the Promise was rejected with `null` it is wrapped with an Error and * // When the Promise was rejected with `null` it is wrapped with an Error and
* // the original value is stored in `reason`. * // the original value is stored in `reason`.
* err &#x26;&#x26; Object.hasOwn(err, 'reason') &#x26;&#x26; err.reason === null; // true * err && Object.hasOwn(err, 'reason') && err.reason === null; // true
* }); * });
* ``` * ```
* @since v8.2.0 * @since v8.2.0
@ -1199,11 +1293,11 @@ declare module "util" {
* that returns promises. * that returns promises.
* *
* ```js * ```js
* import util from 'node:util'; * import { promisify } from 'node:util';
* import fs from 'node:fs'; * import { stat } from 'node:fs';
* *
* const stat = util.promisify(fs.stat); * const promisifiedStat = promisify(stat);
* stat('.').then((stats) => { * promisifiedStat('.').then((stats) => {
* // Do something with `stats` * // Do something with `stats`
* }).catch((error) => { * }).catch((error) => {
* // Handle the error. * // Handle the error.
@ -1213,23 +1307,25 @@ declare module "util" {
* Or, equivalently using `async function`s: * Or, equivalently using `async function`s:
* *
* ```js * ```js
* import util from 'node:util'; * import { promisify } from 'node:util';
* import fs from 'node:fs'; * import { stat } from 'node:fs';
* *
* const stat = util.promisify(fs.stat); * const promisifiedStat = promisify(stat);
* *
* async function callStat() { * async function callStat() {
* const stats = await stat('.'); * const stats = await promisifiedStat('.');
* console.log(`This directory is owned by ${stats.uid}`); * console.log(`This directory is owned by ${stats.uid}`);
* } * }
* *
* callStat(); * callStat();
* ``` * ```
* *
* If there is an `original[util.promisify.custom]` property present, `promisify` will return its value, see `Custom promisified functions`. * If there is an `original[util.promisify.custom]` property present, `promisify`
* will return its value, see [Custom promisified functions](https://nodejs.org/docs/latest-v22.x/api/util.html#custom-promisified-functions).
* *
* `promisify()` assumes that `original` is a function taking a callback as its * `promisify()` assumes that `original` is a function taking a callback as its
* final argument in all cases. If `original` is not a function, `promisify()` will throw an error. If `original` is a function but its last argument is not * final argument in all cases. If `original` is not a function, `promisify()`
* will throw an error. If `original` is a function but its last argument is not
* an error-first callback, it will still be passed an error-first * an error-first callback, it will still be passed an error-first
* callback as its last argument. * callback as its last argument.
* *
@ -1237,7 +1333,7 @@ declare module "util" {
* work as expected unless handled specially: * work as expected unless handled specially:
* *
* ```js * ```js
* import util from 'node:util'; * import { promisify } from 'node:util';
* *
* class Foo { * class Foo {
* constructor() { * constructor() {
@ -1251,8 +1347,8 @@ declare module "util" {
* *
* const foo = new Foo(); * const foo = new Foo();
* *
* const naiveBar = util.promisify(foo.bar); * const naiveBar = promisify(foo.bar);
* // TypeError: Cannot read property 'a' of undefined * // TypeError: Cannot read properties of undefined (reading 'a')
* // naiveBar().then(a => console.log(a)); * // naiveBar().then(a => console.log(a));
* *
* naiveBar.call(foo).then((a) => console.log(a)); // '42' * naiveBar.call(foo).then((a) => console.log(a)); // '42'
@ -1371,15 +1467,29 @@ declare module "util" {
| "strikethrough" | "strikethrough"
| "underline"; | "underline";
/** /**
* This function returns a formatted text considering the `format` passed. * This function returns a formatted text considering the `format` passed
* for printing in a terminal. It is aware of the terminal's capabilities
* and acts according to the configuration set via `NO_COLORS`,
* `NODE_DISABLE_COLORS` and `FORCE_COLOR` environment variables.
* *
* ```js * ```js
* import { styleText } from 'node:util'; * import { styleText } from 'node:util';
* const errorMessage = styleText('red', 'Error! Error!'); * import { stderr } from 'node:process';
* console.log(errorMessage); *
* const successMessage = styleText('green', 'Success!');
* console.log(successMessage);
*
* const errorMessage = styleText(
* 'red',
* 'Error! Error!',
* // Validate if process.stderr has TTY
* { stream: stderr },
* );
* console.error(errorMessage);
* ``` * ```
* *
* `util.inspect.colors` also provides text formats such as `italic`, and `underline` and you can combine both: * `util.inspect.colors` also provides text formats such as `italic`, and
* `underline` and you can combine both:
* *
* ```js * ```js
* console.log( * console.log(
@ -1387,8 +1497,8 @@ declare module "util" {
* ); * );
* ``` * ```
* *
* When passing an array of formats, the order of the format applied is left to right so the following style * When passing an array of formats, the order of the format applied
* might overwrite the previous one. * is left to right so the following style might overwrite the previous one.
* *
* ```js * ```js
* console.log( * console.log(
@ -1561,11 +1671,17 @@ declare module "util" {
* @return The parsed command line arguments: * @return The parsed command line arguments:
*/ */
export function parseArgs<T extends ParseArgsConfig>(config?: T): ParsedResults<T>; export function parseArgs<T extends ParseArgsConfig>(config?: T): ParsedResults<T>;
interface ParseArgsOptionConfig {
/**
* Type of argument used in {@link parseArgs}.
*/
export type ParseArgsOptionsType = "boolean" | "string";
export interface ParseArgsOptionDescriptor {
/** /**
* Type of argument. * Type of argument.
*/ */
type: "string" | "boolean"; type: ParseArgsOptionsType;
/** /**
* Whether this option can be provided multiple times. * Whether this option can be provided multiple times.
* If `true`, all values will be collected in an array. * If `true`, all values will be collected in an array.
@ -1586,8 +1702,8 @@ declare module "util" {
*/ */
default?: string | boolean | string[] | boolean[] | undefined; default?: string | boolean | string[] | boolean[] | undefined;
} }
interface ParseArgsOptionsConfig { export interface ParseArgsOptionsConfig {
[longOption: string]: ParseArgsOptionConfig; [longOption: string]: ParseArgsOptionDescriptor;
} }
export interface ParseArgsConfig { export interface ParseArgsConfig {
/** /**
@ -1639,7 +1755,7 @@ declare module "util" {
: T extends true ? IfTrue : T extends true ? IfTrue
: IfFalse; : IfFalse;
type ExtractOptionValue<T extends ParseArgsConfig, O extends ParseArgsOptionConfig> = IfDefaultsTrue< type ExtractOptionValue<T extends ParseArgsConfig, O extends ParseArgsOptionDescriptor> = IfDefaultsTrue<
T["strict"], T["strict"],
O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean, O["type"] extends "string" ? string : O["type"] extends "boolean" ? boolean : string | boolean,
string | boolean string | boolean
@ -1672,7 +1788,7 @@ declare module "util" {
type PreciseTokenForOptions< type PreciseTokenForOptions<
K extends string, K extends string,
O extends ParseArgsOptionConfig, O extends ParseArgsOptionDescriptor,
> = O["type"] extends "string" ? { > = O["type"] extends "string" ? {
kind: "option"; kind: "option";
index: number; index: number;
@ -1762,7 +1878,6 @@ declare module "util" {
* components. When parsed, a `MIMEType` object is returned containing * components. When parsed, a `MIMEType` object is returned containing
* properties for each of these components. * properties for each of these components.
* @since v19.1.0, v18.13.0 * @since v19.1.0, v18.13.0
* @experimental
*/ */
export class MIMEType { export class MIMEType {
/** /**
@ -2061,7 +2176,9 @@ declare module "util/types" {
* A native `External` value is a special type of object that contains a * A native `External` value is a special type of object that contains a
* raw C++ pointer (`void*`) for access from native code, and has no other * raw C++ pointer (`void*`) for access from native code, and has no other
* properties. Such objects are created either by Node.js internals or native * properties. Such objects are created either by Node.js internals or native
* addons. In JavaScript, they are [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a`null` prototype. * addons. In JavaScript, they are
* [frozen](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze) objects with a
* `null` prototype.
* *
* ```c * ```c
* #include <js_native_api.h> * #include <js_native_api.h>
@ -2069,7 +2186,7 @@ declare module "util/types" {
* napi_value result; * napi_value result;
* static napi_value MyNapi(napi_env env, napi_callback_info info) { * static napi_value MyNapi(napi_env env, napi_callback_info info) {
* int* raw = (int*) malloc(1024); * int* raw = (int*) malloc(1024);
* napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &#x26;result); * napi_status status = napi_create_external(env, (void*) raw, NULL, NULL, &result);
* if (status != napi_ok) { * if (status != napi_ok) {
* napi_throw_error(env, NULL, "napi_create_external failed"); * napi_throw_error(env, NULL, "napi_create_external failed");
* return NULL; * return NULL;
@ -2082,14 +2199,17 @@ declare module "util/types" {
* ``` * ```
* *
* ```js * ```js
* const native = require('napi_addon.node'); * import native from 'napi_addon.node';
* import { types } from 'node:util';
*
* const data = native.myNapi(); * const data = native.myNapi();
* util.types.isExternal(data); // returns true * types.isExternal(data); // returns true
* util.types.isExternal(0); // returns false * types.isExternal(0); // returns false
* util.types.isExternal(new String('foo')); // returns false * types.isExternal(new String('foo')); // returns false
* ``` * ```
* *
* For further information on `napi_create_external`, refer to `napi_create_external()`. * For further information on `napi_create_external`, refer to
* [`napi_create_external()`](https://nodejs.org/docs/latest-v22.x/api/n-api.html#napi_create_external).
* @since v10.0.0 * @since v10.0.0
*/ */
function isExternal(object: unknown): boolean; function isExternal(object: unknown): boolean;
@ -2213,7 +2333,8 @@ declare module "util/types" {
*/ */
function isModuleNamespaceObject(value: unknown): boolean; function isModuleNamespaceObject(value: unknown): boolean;
/** /**
* Returns `true` if the value was returned by the constructor of a [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects). * Returns `true` if the value was returned by the constructor of a
* [built-in `Error` type](https://tc39.es/ecma262/#sec-error-objects).
* *
* ```js * ```js
* console.log(util.types.isNativeError(new Error())); // true * console.log(util.types.isNativeError(new Error())); // true
@ -2228,14 +2349,18 @@ declare module "util/types" {
* console.log(util.types.isNativeError(new MyError())); // true * console.log(util.types.isNativeError(new MyError())); // true
* ``` * ```
* *
* A value being `instanceof` a native error class is not equivalent to `isNativeError()` returning `true` for that value. `isNativeError()` returns `true` for errors * A value being `instanceof` a native error class is not equivalent to `isNativeError()`
* which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false` for these errors: * returning `true` for that value. `isNativeError()` returns `true` for errors
* which come from a different [realm](https://tc39.es/ecma262/#realm) while `instanceof Error` returns `false`
* for these errors:
* *
* ```js * ```js
* import vm from 'node:vm'; * import { createContext, runInContext } from 'node:vm';
* const context = vm.createContext({}); * import { types } from 'node:util';
* const myError = vm.runInContext('new Error()', context); *
* console.log(util.types.isNativeError(myError)); // true * const context = createContext({});
* const myError = runInContext('new Error()', context);
* console.log(types.isNativeError(myError)); // true
* console.log(myError instanceof Error); // false * console.log(myError instanceof Error); // false
* ``` * ```
* *

81
node_modules/@types/node/v8.d.ts generated vendored
View File

@ -113,6 +113,87 @@ declare module "v8" {
* @since v1.0.0 * @since v1.0.0
*/ */
function getHeapStatistics(): HeapInfo; function getHeapStatistics(): HeapInfo;
/**
* It returns an object with a structure similar to the
* [`cppgc::HeapStatistics`](https://v8docs.nodesource.com/node-22.4/d7/d51/heap-statistics_8h_source.html)
* object. See the [V8 documentation](https://v8docs.nodesource.com/node-22.4/df/d2f/structcppgc_1_1_heap_statistics.html)
* for more information about the properties of the object.
*
* ```js
* // Detailed
* ({
* committed_size_bytes: 131072,
* resident_size_bytes: 131072,
* used_size_bytes: 152,
* space_statistics: [
* {
* name: 'NormalPageSpace0',
* committed_size_bytes: 0,
* resident_size_bytes: 0,
* used_size_bytes: 0,
* page_stats: [{}],
* free_list_stats: {},
* },
* {
* name: 'NormalPageSpace1',
* committed_size_bytes: 131072,
* resident_size_bytes: 131072,
* used_size_bytes: 152,
* page_stats: [{}],
* free_list_stats: {},
* },
* {
* name: 'NormalPageSpace2',
* committed_size_bytes: 0,
* resident_size_bytes: 0,
* used_size_bytes: 0,
* page_stats: [{}],
* free_list_stats: {},
* },
* {
* name: 'NormalPageSpace3',
* committed_size_bytes: 0,
* resident_size_bytes: 0,
* used_size_bytes: 0,
* page_stats: [{}],
* free_list_stats: {},
* },
* {
* name: 'LargePageSpace',
* committed_size_bytes: 0,
* resident_size_bytes: 0,
* used_size_bytes: 0,
* page_stats: [{}],
* free_list_stats: {},
* },
* ],
* type_names: [],
* detail_level: 'detailed',
* });
* ```
*
* ```js
* // Brief
* ({
* committed_size_bytes: 131072,
* resident_size_bytes: 131072,
* used_size_bytes: 128864,
* space_statistics: [],
* type_names: [],
* detail_level: 'brief',
* });
* ```
* @since v22.15.0
* @param detailLevel **Default:** `'detailed'`. Specifies the level of detail in the returned statistics.
* Accepted values are:
* * `'brief'`: Brief statistics contain only the top-level
* allocated and used
* memory statistics for the entire heap.
* * `'detailed'`: Detailed statistics also contain a break
* down per space and page, as well as freelist statistics
* and object type histograms.
*/
function getCppHeapStatistics(detailLevel?: "brief" | "detailed"): object;
/** /**
* Returns statistics about the V8 heap spaces, i.e. the segments which make up * Returns statistics about the V8 heap spaces, i.e. the segments which make up
* the V8 heap. Neither the ordering of heap spaces, nor the availability of a * the V8 heap. Neither the ordering of heap spaces, nor the availability of a

207
node_modules/@types/node/zlib.d.ts generated vendored
View File

@ -148,6 +148,31 @@ declare module "zlib" {
*/ */
maxOutputLength?: number | undefined; maxOutputLength?: number | undefined;
} }
interface ZstdOptions {
/**
* @default constants.ZSTD_e_continue
*/
flush?: number | undefined;
/**
* @default constants.ZSTD_e_end
*/
finishFlush?: number | undefined;
/**
* @default 16 * 1024
*/
chunkSize?: number | undefined;
/**
* Key-value object containing indexed
* [Zstd parameters](https://nodejs.org/docs/latest-v22.x/api/zlib.html#zstd-constants).
*/
params?: { [key: number]: number | boolean } | undefined;
/**
* Limits output size when using
* [convenience methods](https://nodejs.org/docs/latest-v22.x/api/zlib.html#convenience-methods).
* @default buffer.kMaxLength
*/
maxOutputLength?: number | undefined;
}
interface Zlib { interface Zlib {
/** @deprecated Use bytesWritten instead. */ /** @deprecated Use bytesWritten instead. */
readonly bytesRead: number; readonly bytesRead: number;
@ -172,6 +197,16 @@ declare module "zlib" {
interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams {} interface DeflateRaw extends stream.Transform, Zlib, ZlibReset, ZlibParams {}
interface InflateRaw extends stream.Transform, Zlib, ZlibReset {} interface InflateRaw extends stream.Transform, Zlib, ZlibReset {}
interface Unzip extends stream.Transform, Zlib {} interface Unzip extends stream.Transform, Zlib {}
/**
* @since v22.15.0
* @experimental
*/
interface ZstdCompress extends stream.Transform, Zlib {}
/**
* @since v22.15.0
* @experimental
*/
interface ZstdDecompress extends stream.Transform, Zlib {}
/** /**
* Computes a 32-bit [Cyclic Redundancy Check](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) checksum of `data`. * Computes a 32-bit [Cyclic Redundancy Check](https://en.wikipedia.org/wiki/Cyclic_redundancy_check) checksum of `data`.
* If `value` is specified, it is used as the starting value of the checksum, otherwise, 0 is used as the starting value. * If `value` is specified, it is used as the starting value of the checksum, otherwise, 0 is used as the starting value.
@ -233,6 +268,16 @@ declare module "zlib" {
* @since v0.5.8 * @since v0.5.8
*/ */
function createUnzip(options?: ZlibOptions): Unzip; function createUnzip(options?: ZlibOptions): Unzip;
/**
* Creates and returns a new `ZstdCompress` object.
* @since v22.15.0
*/
function createZstdCompress(options?: ZstdOptions): ZstdCompress;
/**
* Creates and returns a new `ZstdDecompress` object.
* @since v22.15.0
*/
function createZstdDecompress(options?: ZstdOptions): ZstdDecompress;
type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView; type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView;
type CompressCallback = (error: Error | null, result: Buffer) => void; type CompressCallback = (error: Error | null, result: Buffer) => void;
/** /**
@ -352,6 +397,36 @@ declare module "zlib" {
* @since v0.11.12 * @since v0.11.12
*/ */
function unzipSync(buf: InputType, options?: ZlibOptions): Buffer; function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;
/**
* @since v22.15.0
* @experimental
*/
function zstdCompress(buf: InputType, callback: CompressCallback): void;
function zstdCompress(buf: InputType, options: ZstdOptions, callback: CompressCallback): void;
namespace zstdCompress {
function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<Buffer>;
}
/**
* Compress a chunk of data with `ZstdCompress`.
* @since v22.15.0
* @experimental
*/
function zstdCompressSync(buf: InputType, options?: ZstdOptions): Buffer;
/**
* @since v22.15.0
* @experimental
*/
function zstdDecompress(buf: InputType, callback: CompressCallback): void;
function zstdDecompress(buf: InputType, options: ZstdOptions, callback: CompressCallback): void;
namespace zstdDecompress {
function __promisify__(buffer: InputType, options?: ZstdOptions): Promise<Buffer>;
}
/**
* Decompress a chunk of data with `ZstdDecompress`.
* @since v22.15.0
* @experimental
*/
function zstdDecompressSync(buf: InputType, options?: ZstdOptions): Buffer;
namespace constants { namespace constants {
const BROTLI_DECODE: number; const BROTLI_DECODE: number;
const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number; const BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: number;
@ -423,50 +498,106 @@ declare module "zlib" {
const INFLATE: number; const INFLATE: number;
const INFLATERAW: number; const INFLATERAW: number;
const UNZIP: number; const UNZIP: number;
// Allowed flush values. const ZLIB_VERNUM: number;
const Z_NO_FLUSH: number; const ZSTD_CLEVEL_DEFAULT: number;
const Z_PARTIAL_FLUSH: number; const ZSTD_COMPRESS: number;
const Z_SYNC_FLUSH: number; const ZSTD_DECOMPRESS: number;
const Z_FULL_FLUSH: number; const ZSTD_btlazy2: number;
const Z_FINISH: number; const ZSTD_btopt: number;
const Z_BLOCK: number; const ZSTD_btultra: number;
const Z_TREES: number; const ZSTD_btultra2: number;
// Return codes for the compression/decompression functions. const ZSTD_c_chainLog: number;
// Negative values are errors, positive values are used for special but normal events. const ZSTD_c_checksumFlag: number;
const Z_OK: number; const ZSTD_c_compressionLevel: number;
const Z_STREAM_END: number; const ZSTD_c_contentSizeFlag: number;
const Z_NEED_DICT: number; const ZSTD_c_dictIDFlag: number;
const Z_ERRNO: number; const ZSTD_c_enableLongDistanceMatching: number;
const Z_STREAM_ERROR: number; const ZSTD_c_hashLog: number;
const Z_DATA_ERROR: number; const ZSTD_c_jobSize: number;
const Z_MEM_ERROR: number; const ZSTD_c_ldmBucketSizeLog: number;
const Z_BUF_ERROR: number; const ZSTD_c_ldmHashLog: number;
const Z_VERSION_ERROR: number; const ZSTD_c_ldmHashRateLog: number;
// Compression levels. const ZSTD_c_ldmMinMatch: number;
const Z_NO_COMPRESSION: number; const ZSTD_c_minMatch: number;
const Z_BEST_SPEED: number; const ZSTD_c_nbWorkers: number;
const ZSTD_c_overlapLog: number;
const ZSTD_c_searchLog: number;
const ZSTD_c_strategy: number;
const ZSTD_c_targetLength: number;
const ZSTD_c_windowLog: number;
const ZSTD_d_windowLogMax: number;
const ZSTD_dfast: number;
const ZSTD_e_continue: number;
const ZSTD_e_end: number;
const ZSTD_e_flush: number;
const ZSTD_error_GENERIC: number;
const ZSTD_error_checksum_wrong: number;
const ZSTD_error_corruption_detected: number;
const ZSTD_error_dictionaryCreation_failed: number;
const ZSTD_error_dictionary_corrupted: number;
const ZSTD_error_dictionary_wrong: number;
const ZSTD_error_dstBuffer_null: number;
const ZSTD_error_dstSize_tooSmall: number;
const ZSTD_error_frameParameter_unsupported: number;
const ZSTD_error_frameParameter_windowTooLarge: number;
const ZSTD_error_init_missing: number;
const ZSTD_error_literals_headerWrong: number;
const ZSTD_error_maxSymbolValue_tooLarge: number;
const ZSTD_error_maxSymbolValue_tooSmall: number;
const ZSTD_error_memory_allocation: number;
const ZSTD_error_noForwardProgress_destFull: number;
const ZSTD_error_noForwardProgress_inputEmpty: number;
const ZSTD_error_no_error: number;
const ZSTD_error_parameter_combination_unsupported: number;
const ZSTD_error_parameter_outOfBound: number;
const ZSTD_error_parameter_unsupported: number;
const ZSTD_error_prefix_unknown: number;
const ZSTD_error_srcSize_wrong: number;
const ZSTD_error_stabilityCondition_notRespected: number;
const ZSTD_error_stage_wrong: number;
const ZSTD_error_tableLog_tooLarge: number;
const ZSTD_error_version_unsupported: number;
const ZSTD_error_workSpace_tooSmall: number;
const ZSTD_fast: number;
const ZSTD_greedy: number;
const ZSTD_lazy: number;
const ZSTD_lazy2: number;
const Z_BEST_COMPRESSION: number; const Z_BEST_COMPRESSION: number;
const Z_BEST_SPEED: number;
const Z_BLOCK: number;
const Z_BUF_ERROR: number;
const Z_DATA_ERROR: number;
const Z_DEFAULT_CHUNK: number;
const Z_DEFAULT_COMPRESSION: number; const Z_DEFAULT_COMPRESSION: number;
// Compression strategy. const Z_DEFAULT_LEVEL: number;
const Z_FILTERED: number; const Z_DEFAULT_MEMLEVEL: number;
const Z_HUFFMAN_ONLY: number;
const Z_RLE: number;
const Z_FIXED: number;
const Z_DEFAULT_STRATEGY: number; const Z_DEFAULT_STRATEGY: number;
const Z_DEFAULT_WINDOWBITS: number; const Z_DEFAULT_WINDOWBITS: number;
const Z_ERRNO: number;
const Z_MIN_WINDOWBITS: number; const Z_FILTERED: number;
const Z_MAX_WINDOWBITS: number; const Z_FINISH: number;
const Z_MIN_CHUNK: number; const Z_FIXED: number;
const Z_FULL_FLUSH: number;
const Z_HUFFMAN_ONLY: number;
const Z_MAX_CHUNK: number; const Z_MAX_CHUNK: number;
const Z_DEFAULT_CHUNK: number;
const Z_MIN_MEMLEVEL: number;
const Z_MAX_MEMLEVEL: number;
const Z_DEFAULT_MEMLEVEL: number;
const Z_MIN_LEVEL: number;
const Z_MAX_LEVEL: number; const Z_MAX_LEVEL: number;
const Z_DEFAULT_LEVEL: number; const Z_MAX_MEMLEVEL: number;
const ZLIB_VERNUM: number; const Z_MAX_WINDOWBITS: number;
const Z_MEM_ERROR: number;
const Z_MIN_CHUNK: number;
const Z_MIN_LEVEL: number;
const Z_MIN_MEMLEVEL: number;
const Z_MIN_WINDOWBITS: number;
const Z_NEED_DICT: number;
const Z_NO_COMPRESSION: number;
const Z_NO_FLUSH: number;
const Z_OK: number;
const Z_PARTIAL_FLUSH: number;
const Z_RLE: number;
const Z_STREAM_END: number;
const Z_STREAM_ERROR: number;
const Z_SYNC_FLUSH: number;
const Z_VERSION_ERROR: number;
} }
// Allowed flush values. // Allowed flush values.
/** @deprecated Use `constants.Z_NO_FLUSH` */ /** @deprecated Use `constants.Z_NO_FLUSH` */

27
node_modules/axios/CHANGELOG.md generated vendored
View File

@ -1,5 +1,32 @@
# Changelog # Changelog
# [1.9.0](https://github.com/axios/axios/compare/v1.8.4...v1.9.0) (2025-04-24)
### Bug Fixes
* **core:** fix the Axios constructor implementation to treat the config argument as optional; ([#6881](https://github.com/axios/axios/issues/6881)) ([6c5d4cd](https://github.com/axios/axios/commit/6c5d4cd69286868059c5e52d45085cb9a894a983))
* **fetch:** fixed ERR_NETWORK mapping for Safari browsers; ([#6767](https://github.com/axios/axios/issues/6767)) ([dfe8411](https://github.com/axios/axios/commit/dfe8411c9a082c3d068bdd1f8d6e73054f387f45))
* **headers:** allow iterable objects to be a data source for the set method; ([#6873](https://github.com/axios/axios/issues/6873)) ([1b1f9cc](https://github.com/axios/axios/commit/1b1f9ccdc15f1ea745160ec9a5223de9db4673bc))
* **headers:** fix `getSetCookie` by using 'get' method for caseless access; ([#6874](https://github.com/axios/axios/issues/6874)) ([d4f7df4](https://github.com/axios/axios/commit/d4f7df4b304af8b373488fdf8e830793ff843eb9))
* **headers:** fixed support for setting multiple header values from an iterated source; ([#6885](https://github.com/axios/axios/issues/6885)) ([f7a3b5e](https://github.com/axios/axios/commit/f7a3b5e0f7e5e127b97defa92a132fbf1b55cf15))
* **http:** send minimal end multipart boundary ([#6661](https://github.com/axios/axios/issues/6661)) ([987d2e2](https://github.com/axios/axios/commit/987d2e2dd3b362757550f36eab875e60640b6ddc))
* **types:** fix autocomplete for adapter config ([#6855](https://github.com/axios/axios/issues/6855)) ([e61a893](https://github.com/axios/axios/commit/e61a8934d8f94dd429a2f309b48c67307c700df0))
### Features
* **AxiosHeaders:** add getSetCookie method to retrieve set-cookie headers values ([#5707](https://github.com/axios/axios/issues/5707)) ([80ea756](https://github.com/axios/axios/commit/80ea756e72bcf53110fa792f5d7ab76e8b11c996))
### Contributors to this release
- <img src="https://avatars.githubusercontent.com/u/12586868?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Dmitriy Mozgovoy](https://github.com/DigitalBrainJS "+200/-34 (#6890 #6889 #6888 #6885 #6881 #6767 #6874 #6873 )")
- <img src="https://avatars.githubusercontent.com/u/4814473?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Jay](https://github.com/jasonsaayman "+26/-1 ()")
- <img src="https://avatars.githubusercontent.com/u/22686401?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Willian Agostini](https://github.com/WillianAgostini "+21/-0 (#5707 )")
- <img src="https://avatars.githubusercontent.com/u/2500247?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [George Cheng](https://github.com/Gerhut "+3/-3 (#5096 )")
- <img src="https://avatars.githubusercontent.com/u/30260221?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [FatahChan](https://github.com/FatahChan "+2/-2 (#6855 )")
- <img src="https://avatars.githubusercontent.com/u/49002?v&#x3D;4&amp;s&#x3D;18" alt="avatar" width="18"/> [Ionuț G. Stan](https://github.com/igstan "+1/-1 (#6661 )")
## [1.8.4](https://github.com/axios/axios/compare/v1.8.3...v1.8.4) (2025-03-19) ## [1.8.4](https://github.com/axios/axios/compare/v1.8.3...v1.8.4) (2025-03-19)

12
node_modules/axios/README.md generated vendored
View File

@ -1,13 +1,13 @@
<h3 align="center"> 🥇 Gold sponsors <br> </h3> <table align="center" width="100%"><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://stytch.com/?utm_source&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;website-link&amp;utm_campaign&#x3D;axios-http" style="padding: 10px; display: inline-block"> <picture> <source width="200px" height="38px" media="(prefers-color-scheme: dark)" srcset="https://axios-http.com/assets/sponsors/stytch_white.png"> <img width="200px" height="38px" src="https://axios-http.com/assets/sponsors/stytch.png" alt="Stytch"/> </picture> </a> <p align="center" title="API-first authentication, authorization, and fraud prevention">API-first authentication, authorization, and fraud prevention</p> <p align="center"> <a href="https://stytch.com/?utm_source&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;website-link&amp;utm_campaign&#x3D;axios-http"><b>Website</b></a> | <a href="https://stytch.com/docs?utm_source&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;docs-link&amp;utm_campaign&#x3D;axios-http"><b>Documentation</b></a> | <a href="https://github.com/stytchauth/stytch-node?utm_source&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;node-sdk&amp;utm_campaign&#x3D;axios-http"><b>Node.js</b></a> </p> <h3 align="center"> 🥇 Gold sponsors <br> </h3> <table align="center" width="100%"><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://stytch.com/?utm_source&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;website-link&amp;utm_campaign&#x3D;axios-http" style="padding: 10px; display: inline-block"> <picture> <source width="200px" height="38px" media="(prefers-color-scheme: dark)" srcset="https://axios-http.com/assets/sponsors/stytch_white.png"> <img width="200px" height="38px" src="https://axios-http.com/assets/sponsors/stytch.png" alt="Stytch"/> </picture> </a> <p align="center" title="API-first authentication, authorization, and fraud prevention">API-first authentication, authorization, and fraud prevention</p> <p align="center"> <a href="https://stytch.com/?utm_source&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;website-link&amp;utm_campaign&#x3D;axios-http"><b>Website</b></a> | <a href="https://stytch.com/docs?utm_source&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;docs-link&amp;utm_campaign&#x3D;axios-http"><b>Documentation</b></a> | <a href="https://github.com/stytchauth/stytch-node?utm_source&#x3D;oss-sponsorship&amp;utm_medium&#x3D;paid_sponsorship&amp;utm_content&#x3D;node-sdk&amp;utm_campaign&#x3D;axios-http"><b>Node.js</b></a> </p>
</td><td align="center" width="33.333333333333336%"> <a href="https://www.principal.com/about-us?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="133px" height="43px" src="https://axios-http.com/assets/sponsors/principal.svg" alt="Principal Financial Group"/> </a> <p align="center" title="Were bound by one common purpose: to give you the financial tools, resources and information you need to live your best life.">Were bound by one common purpose: to give you the financial tools, resources and information you ne...</p> <p align="center"> <a href="https://www.principal.com/about-us?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>www.principal.com</b></a> </p> </td><td align="center" width="33.333333333333336%"> <a href="https://www.principal.com/about-us?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="133px" height="43px" src="https://axios-http.com/assets/sponsors/principal.svg" alt="Principal Financial Group"/> </a> <p align="center" title="Were bound by one common purpose: to give you the financial tools, resources and information you need to live your best life.">Were bound by one common purpose: to give you the financial tools, resources and information you ne...</p> <p align="center"> <a href="https://www.principal.com/about-us?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>www.principal.com</b></a> </p>
</td><td align="center" width="33.333333333333336%"> <a href="https://www.descope.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship" style="padding: 10px; display: inline-block"> <picture> <source width="200px" height="52px" media="(prefers-color-scheme: dark)" srcset="https://axios-http.com/assets/sponsors/descope_white.png"> <img width="200px" height="52px" src="https://axios-http.com/assets/sponsors/descope.png" alt="Descope"/> </picture> </a> <p align="center" title="Hi, we&#x27;re Descope! We are building something in the authentication space for app developers and cant wait to place it in your hands.">Hi, we&#x27;re Descope! We are building something in the authentication space for app developers and...</p> <p align="center"> <a href="https://www.descope.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship"><b>Website</b></a> | <a href="https://docs.descope.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship"><b>Documentation</b></a> | <a href="https://www.descope.com/community?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship"><b>Community</b></a> </p>
</td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://buzzoid.com/buy-instagram-followers/?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="62px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/buzzoid-buy-instagram-followers.png" alt="Buzzoid - Buy Instagram Followers"/> </a> <p align="center" title="At Buzzoid, you can buy Instagram followers quickly, safely, and easily with just a few clicks. Rated world&#x27;s #1 IG service since 2012.">At Buzzoid, you can buy Instagram followers quickly, safely, and easily with just a few clicks. Rate...</p> <p align="center"> <a href="https://buzzoid.com/buy-instagram-followers/?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>buzzoid.com</b></a> </p>
</td><td align="center" width="33.333333333333336%"> <a href="https://www.famety.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/famety-buy-instagram-followers.png" alt="Famety - Buy Instagram Followers"/> </a> <p align="center" title="At Famety, you can grow your social media following quickly, safely, and easily with just a few clicks. Rated the worlds #1 social media service since 2013.">At Famety, you can grow your social media following quickly, safely, and easily with just a few clic...</p> <p align="center"> <a href="https://www.famety.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>www.famety.com</b></a> </p>
</td><td align="center" width="33.333333333333336%"> <a href="https://poprey.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/instagram-likes.png" alt="Poprey - Buy Instagram Likes"/> </a> <p align="center" title="Buy Instagram Likes">Buy Instagram Likes</p> <p align="center"> <a href="https://poprey.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>poprey.com</b></a> </p>
</td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://musicza.co.za/?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="124px" height="52px" src="https://axios-http.com/assets/sponsors/opencollective/musicza.png" alt="Tubidy"/> </a> <p align="center" title="Tubidy: Free Music and Video Downloads | MP3, MP4">Tubidy: Free Music and Video Downloads | MP3, MP4</p> <p align="center"> <a href="https://musicza.co.za/?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>musicza.co.za</b></a> </p>
</td><td align="center" width="33.333333333333336%"> <a href="https://ssmarket.net/buy-youtube-subscribers?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/youtube-subscribers-ssmarket.png" alt="Buy Youtube Subscribers"/> </a> <p align="center" title="SS Market offers professional social media services that rapidly increase your YouTube subscriber count, elevating your channel to a powerful position.">SS Market offers professional social media services that rapidly increase your YouTube subscriber co...</p> <p align="center"> <a href="https://ssmarket.net/buy-youtube-subscribers?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>ssmarket.net</b></a> </p>
</td><td align="center" width="33.333333333333336%"> <a href="https://twicsy.com/buy-instagram-followers?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="85px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/buy-instagram-followers-twicsy.png" alt="Buy Instagram Followers Twicsy"/> </a> <p align="center" title="Buy real Instagram followers from Twicsy starting at only $2.97. Twicsy has been voted the best site to buy followers from the likes of US Magazine.">Buy real Instagram followers from Twicsy starting at only $2.97. Twicsy has been voted the best site...</p> <p align="center"> <a href="https://twicsy.com/buy-instagram-followers?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>twicsy.com</b></a> </p> </td><td align="center" width="33.333333333333336%"> <a href="https://twicsy.com/buy-instagram-followers?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="85px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/buy-instagram-followers-twicsy.png" alt="Buy Instagram Followers Twicsy"/> </a> <p align="center" title="Buy real Instagram followers from Twicsy starting at only $2.97. Twicsy has been voted the best site to buy followers from the likes of US Magazine.">Buy real Instagram followers from Twicsy starting at only $2.97. Twicsy has been voted the best site...</p> <p align="center"> <a href="https://twicsy.com/buy-instagram-followers?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>twicsy.com</b></a> </p>
</td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://www.descope.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship" style="padding: 10px; display: inline-block"> <picture> <source width="200px" height="52px" media="(prefers-color-scheme: dark)" srcset="https://axios-http.com/assets/sponsors/descope_white.png"> <img width="200px" height="52px" src="https://axios-http.com/assets/sponsors/descope.png" alt="Descope"/> </picture> </a> <p align="center" title="Hi, we&#x27;re Descope! We are building something in the authentication space for app developers and cant wait to place it in your hands.">Hi, we&#x27;re Descope! We are building something in the authentication space for app developers and...</p> <p align="center"> <a href="https://www.descope.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship"><b>Website</b></a> | <a href="https://docs.descope.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship"><b>Docs</b></a> | <a href="https://www.descope.com/community?utm_source&#x3D;axios&amp;utm_medium&#x3D;referral&amp;utm_campaign&#x3D;axios-oss-sponsorship"><b>Community</b></a> </p>
</td><td align="center" width="33.333333333333336%"> <a href="https://buzzoid.com/buy-instagram-followers/?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="62px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/buzzoid-buy-instagram-followers.png" alt="Buzzoid - Buy Instagram Followers"/> </a> <p align="center" title="At Buzzoid, you can buy Instagram followers quickly, safely, and easily with just a few clicks. Rated world&#x27;s #1 IG service since 2012.">At Buzzoid, you can buy Instagram followers quickly, safely, and easily with just a few clicks. Rate...</p> <p align="center"> <a href="https://buzzoid.com/buy-instagram-followers/?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>buzzoid.com</b></a> </p>
</td><td align="center" width="33.333333333333336%"> <a href="https://www.famety.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/famety-buy-instagram-followers.png" alt="Famety - Buy Instagram Followers"/> </a> <p align="center" title="At Famety, you can grow your social media following quickly, safely, and easily with just a few clicks. Rated the worlds #1 social media service since 2013.">At Famety, you can grow your social media following quickly, safely, and easily with just a few clic...</p> <p align="center"> <a href="https://www.famety.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>www.famety.com</b></a> </p>
</td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://poprey.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/instagram-likes.png" alt="Poprey - Buy Instagram Likes"/> </a> <p align="center" title="Buy Instagram Likes">Buy Instagram Likes</p> <p align="center"> <a href="https://poprey.com/?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>poprey.com</b></a> </p>
</td><td align="center" width="33.333333333333336%"> <a href="https://betking.com.ua/sports-book/?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/bukmeker.jpeg" alt="Букмекер"/> </a> <p align="center" title="Ставки на спорт, БК в Україні">Ставки на спорт, БК в Україні</p> <p align="center"> <a href="https://betking.com.ua/sports-book/?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>betking.com.ua</b></a> </p>
</td><td align="center" width="33.333333333333336%"> <a href="https://ssmarket.net/buy-youtube-subscribers?utm_source&#x3D;axios&amp;utm_medium&#x3D;sponsorlist&amp;utm_campaign&#x3D;sponsorship" style="padding: 10px; display: inline-block"> <img width="70px" height="70px" src="https://axios-http.com/assets/sponsors/opencollective/youtube-subscribers-ssmarket.png" alt="Buy Youtube Subscribers"/> </a> <p align="center" title="SS Market offers professional social media services that rapidly increase your YouTube subscriber count, elevating your channel to a powerful position.">SS Market offers professional social media services that rapidly increase your YouTube subscriber co...</p> <p align="center"> <a href="https://ssmarket.net/buy-youtube-subscribers?utm_source&#x3D;axios&amp;utm_medium&#x3D;readme_sponsorlist&amp;utm_campaign&#x3D;sponsorship"><b>ssmarket.net</b></a> </p>
</td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a> </td></tr><tr width="33.333333333333336%"><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a>
</td><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a> </td><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a>
</td><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a> </td><td align="center" width="33.333333333333336%"> <a href="https://opencollective.com/axios/contribute">💜 Become a sponsor</a>

48
node_modules/axios/dist/axios.js generated vendored
View File

@ -1,4 +1,4 @@
/*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */ /*! Axios v1.9.0 Copyright (c) 2025 Matt Zabriskie and contributors */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) : typeof define === 'function' && define.amd ? define(factory) :
@ -681,6 +681,8 @@
var toString = Object.prototype.toString; var toString = Object.prototype.toString;
var getPrototypeOf = Object.getPrototypeOf; var getPrototypeOf = Object.getPrototypeOf;
var iterator = Symbol.iterator,
toStringTag = Symbol.toStringTag;
var kindOf = function (cache) { var kindOf = function (cache) {
return function (thing) { return function (thing) {
var str = toString.call(thing); var str = toString.call(thing);
@ -813,7 +815,7 @@
return false; return false;
} }
var prototype = getPrototypeOf(val); var prototype = getPrototypeOf(val);
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
}; };
/** /**
@ -1165,10 +1167,10 @@
* @returns {void} * @returns {void}
*/ */
var forEachEntry = function forEachEntry(obj, fn) { var forEachEntry = function forEachEntry(obj, fn) {
var generator = obj && obj[Symbol.iterator]; var generator = obj && obj[iterator];
var iterator = generator.call(obj); var _iterator = generator.call(obj);
var result; var result;
while ((result = iterator.next()) && !result.done) { while ((result = _iterator.next()) && !result.done) {
var pair = result.value; var pair = result.value;
fn.call(obj, pair[0], pair[1]); fn.call(obj, pair[0], pair[1]);
} }
@ -1275,7 +1277,7 @@
* @returns {boolean} * @returns {boolean}
*/ */
function isSpecCompliantForm(thing) { function isSpecCompliantForm(thing) {
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
} }
var toJSONObject = function toJSONObject(obj) { var toJSONObject = function toJSONObject(obj) {
var stack = new Array(10); var stack = new Array(10);
@ -1331,6 +1333,9 @@
// ********************* // *********************
var isIterable = function isIterable(thing) {
return thing != null && isFunction(thing[iterator]);
};
var utils$1 = { var utils$1 = {
isArray: isArray, isArray: isArray,
isArrayBuffer: isArrayBuffer, isArrayBuffer: isArrayBuffer,
@ -1387,7 +1392,8 @@
isAsyncFn: isAsyncFn, isAsyncFn: isAsyncFn,
isThenable: isThenable, isThenable: isThenable,
setImmediate: _setImmediate, setImmediate: _setImmediate,
asap: asap asap: asap,
isIterable: isIterable
}; };
/** /**
@ -2227,21 +2233,26 @@
setHeaders(header, valueOrRewrite); setHeaders(header, valueOrRewrite);
} else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { } else if (utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
setHeaders(parseHeaders(header), valueOrRewrite); setHeaders(parseHeaders(header), valueOrRewrite);
} else if (utils$1.isHeaders(header)) { } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
var _iterator = _createForOfIteratorHelper(header.entries()), var obj = {},
dest,
key;
var _iterator = _createForOfIteratorHelper(header),
_step; _step;
try { try {
for (_iterator.s(); !(_step = _iterator.n()).done;) { for (_iterator.s(); !(_step = _iterator.n()).done;) {
var _step$value = _slicedToArray(_step.value, 2), var entry = _step.value;
key = _step$value[0], if (!utils$1.isArray(entry)) {
value = _step$value[1]; throw TypeError('Object iterator must return a key-value pair');
setHeader(value, key, rewrite); }
obj[key = entry[0]] = (dest = obj[key]) ? utils$1.isArray(dest) ? [].concat(_toConsumableArray(dest), [entry[1]]) : [dest, entry[1]] : entry[1];
} }
} catch (err) { } catch (err) {
_iterator.e(err); _iterator.e(err);
} finally { } finally {
_iterator.f(); _iterator.f();
} }
setHeaders(obj, valueOrRewrite);
} else { } else {
header != null && setHeader(valueOrRewrite, header, rewrite); header != null && setHeader(valueOrRewrite, header, rewrite);
} }
@ -2372,6 +2383,11 @@
return header + ': ' + value; return header + ': ' + value;
}).join('\n'); }).join('\n');
} }
}, {
key: "getSetCookie",
value: function getSetCookie() {
return this.get("set-cookie") || [];
}
}, { }, {
key: _Symbol$toStringTag, key: _Symbol$toStringTag,
get: function get() { get: function get() {
@ -3521,7 +3537,7 @@
_context4.prev = 33; _context4.prev = 33;
_context4.t2 = _context4["catch"](4); _context4.t2 = _context4["catch"](4);
unsubscribe && unsubscribe(); unsubscribe && unsubscribe();
if (!(_context4.t2 && _context4.t2.name === 'TypeError' && /fetch/i.test(_context4.t2.message))) { if (!(_context4.t2 && _context4.t2.name === 'TypeError' && /Load failed|fetch/i.test(_context4.t2.message))) {
_context4.next = 38; _context4.next = 38;
break; break;
} }
@ -3658,7 +3674,7 @@
}); });
} }
var VERSION = "1.8.4"; var VERSION = "1.9.0";
var validators$1 = {}; var validators$1 = {};
@ -3754,7 +3770,7 @@
var Axios = /*#__PURE__*/function () { var Axios = /*#__PURE__*/function () {
function Axios(instanceConfig) { function Axios(instanceConfig) {
_classCallCheck(this, Axios); _classCallCheck(this, Axios);
this.defaults = instanceConfig; this.defaults = instanceConfig || {};
this.interceptors = { this.interceptors = {
request: new InterceptorManager$1(), request: new InterceptorManager$1(),
response: new InterceptorManager$1() response: new InterceptorManager$1()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */ /*! Axios v1.9.0 Copyright (c) 2025 Matt Zabriskie and contributors */
'use strict'; 'use strict';
function bind(fn, thisArg) { function bind(fn, thisArg) {
@ -11,6 +11,7 @@ function bind(fn, thisArg) {
const {toString} = Object.prototype; const {toString} = Object.prototype;
const {getPrototypeOf} = Object; const {getPrototypeOf} = Object;
const {iterator, toStringTag} = Symbol;
const kindOf = (cache => thing => { const kindOf = (cache => thing => {
const str = toString.call(thing); const str = toString.call(thing);
@ -137,7 +138,7 @@ const isPlainObject = (val) => {
} }
const prototype = getPrototypeOf(val); const prototype = getPrototypeOf(val);
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
}; };
/** /**
@ -488,13 +489,13 @@ const isTypedArray = (TypedArray => {
* @returns {void} * @returns {void}
*/ */
const forEachEntry = (obj, fn) => { const forEachEntry = (obj, fn) => {
const generator = obj && obj[Symbol.iterator]; const generator = obj && obj[iterator];
const iterator = generator.call(obj); const _iterator = generator.call(obj);
let result; let result;
while ((result = iterator.next()) && !result.done) { while ((result = _iterator.next()) && !result.done) {
const pair = result.value; const pair = result.value;
fn.call(obj, pair[0], pair[1]); fn.call(obj, pair[0], pair[1]);
} }
@ -615,7 +616,7 @@ const toFiniteNumber = (value, defaultValue) => {
* @returns {boolean} * @returns {boolean}
*/ */
function isSpecCompliantForm(thing) { function isSpecCompliantForm(thing) {
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
} }
const toJSONObject = (obj) => { const toJSONObject = (obj) => {
@ -684,6 +685,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
// ********************* // *********************
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
var utils$1 = { var utils$1 = {
isArray, isArray,
isArrayBuffer, isArrayBuffer,
@ -739,7 +744,8 @@ var utils$1 = {
isAsyncFn, isAsyncFn,
isThenable, isThenable,
setImmediate: _setImmediate, setImmediate: _setImmediate,
asap asap,
isIterable
}; };
/** /**
@ -1724,10 +1730,18 @@ class AxiosHeaders {
setHeaders(header, valueOrRewrite); setHeaders(header, valueOrRewrite);
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
setHeaders(parseHeaders(header), valueOrRewrite); setHeaders(parseHeaders(header), valueOrRewrite);
} else if (utils$1.isHeaders(header)) { } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
for (const [key, value] of header.entries()) { let obj = {}, dest, key;
setHeader(value, key, rewrite); for (const entry of header) {
if (!utils$1.isArray(entry)) {
throw TypeError('Object iterator must return a key-value pair');
}
obj[key = entry[0]] = (dest = obj[key]) ?
(utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
} }
setHeaders(obj, valueOrRewrite);
} else { } else {
header != null && setHeader(valueOrRewrite, header, rewrite); header != null && setHeader(valueOrRewrite, header, rewrite);
} }
@ -1869,6 +1883,10 @@ class AxiosHeaders {
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
} }
getSetCookie() {
return this.get("set-cookie") || [];
}
get [Symbol.toStringTag]() { get [Symbol.toStringTag]() {
return 'AxiosHeaders'; return 'AxiosHeaders';
} }
@ -2908,7 +2926,7 @@ var fetchAdapter = isFetchSupported && (async (config) => {
} catch (err) { } catch (err) {
unsubscribe && unsubscribe(); unsubscribe && unsubscribe();
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) { if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
throw Object.assign( throw Object.assign(
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
{ {
@ -3068,7 +3086,7 @@ function dispatchRequest(config) {
}); });
} }
const VERSION = "1.8.4"; const VERSION = "1.9.0";
const validators$1 = {}; const validators$1 = {};
@ -3176,7 +3194,7 @@ const validators = validator.validators;
*/ */
class Axios { class Axios {
constructor(instanceConfig) { constructor(instanceConfig) {
this.defaults = instanceConfig; this.defaults = instanceConfig || {};
this.interceptors = { this.interceptors = {
request: new InterceptorManager$1(), request: new InterceptorManager$1(),
response: new InterceptorManager$1() response: new InterceptorManager$1()

File diff suppressed because one or more lines are too long

44
node_modules/axios/dist/esm/axios.js generated vendored
View File

@ -1,4 +1,4 @@
/*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */ /*! Axios v1.9.0 Copyright (c) 2025 Matt Zabriskie and contributors */
function bind(fn, thisArg) { function bind(fn, thisArg) {
return function wrap() { return function wrap() {
return fn.apply(thisArg, arguments); return fn.apply(thisArg, arguments);
@ -9,6 +9,7 @@ function bind(fn, thisArg) {
const {toString} = Object.prototype; const {toString} = Object.prototype;
const {getPrototypeOf} = Object; const {getPrototypeOf} = Object;
const {iterator, toStringTag} = Symbol;
const kindOf = (cache => thing => { const kindOf = (cache => thing => {
const str = toString.call(thing); const str = toString.call(thing);
@ -135,7 +136,7 @@ const isPlainObject = (val) => {
} }
const prototype = getPrototypeOf(val); const prototype = getPrototypeOf(val);
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
}; };
/** /**
@ -486,13 +487,13 @@ const isTypedArray = (TypedArray => {
* @returns {void} * @returns {void}
*/ */
const forEachEntry = (obj, fn) => { const forEachEntry = (obj, fn) => {
const generator = obj && obj[Symbol.iterator]; const generator = obj && obj[iterator];
const iterator = generator.call(obj); const _iterator = generator.call(obj);
let result; let result;
while ((result = iterator.next()) && !result.done) { while ((result = _iterator.next()) && !result.done) {
const pair = result.value; const pair = result.value;
fn.call(obj, pair[0], pair[1]); fn.call(obj, pair[0], pair[1]);
} }
@ -613,7 +614,7 @@ const toFiniteNumber = (value, defaultValue) => {
* @returns {boolean} * @returns {boolean}
*/ */
function isSpecCompliantForm(thing) { function isSpecCompliantForm(thing) {
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
} }
const toJSONObject = (obj) => { const toJSONObject = (obj) => {
@ -682,6 +683,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
// ********************* // *********************
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
const utils$1 = { const utils$1 = {
isArray, isArray,
isArrayBuffer, isArrayBuffer,
@ -737,7 +742,8 @@ const utils$1 = {
isAsyncFn, isAsyncFn,
isThenable, isThenable,
setImmediate: _setImmediate, setImmediate: _setImmediate,
asap asap,
isIterable
}; };
/** /**
@ -1722,10 +1728,18 @@ class AxiosHeaders$1 {
setHeaders(header, valueOrRewrite); setHeaders(header, valueOrRewrite);
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
setHeaders(parseHeaders(header), valueOrRewrite); setHeaders(parseHeaders(header), valueOrRewrite);
} else if (utils$1.isHeaders(header)) { } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
for (const [key, value] of header.entries()) { let obj = {}, dest, key;
setHeader(value, key, rewrite); for (const entry of header) {
if (!utils$1.isArray(entry)) {
throw TypeError('Object iterator must return a key-value pair');
}
obj[key = entry[0]] = (dest = obj[key]) ?
(utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
} }
setHeaders(obj, valueOrRewrite);
} else { } else {
header != null && setHeader(valueOrRewrite, header, rewrite); header != null && setHeader(valueOrRewrite, header, rewrite);
} }
@ -1867,6 +1881,10 @@ class AxiosHeaders$1 {
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
} }
getSetCookie() {
return this.get("set-cookie") || [];
}
get [Symbol.toStringTag]() { get [Symbol.toStringTag]() {
return 'AxiosHeaders'; return 'AxiosHeaders';
} }
@ -2906,7 +2924,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
} catch (err) { } catch (err) {
unsubscribe && unsubscribe(); unsubscribe && unsubscribe();
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) { if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
throw Object.assign( throw Object.assign(
new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request), new AxiosError$1('Network Error', AxiosError$1.ERR_NETWORK, config, request),
{ {
@ -3066,7 +3084,7 @@ function dispatchRequest(config) {
}); });
} }
const VERSION$1 = "1.8.4"; const VERSION$1 = "1.9.0";
const validators$1 = {}; const validators$1 = {};
@ -3174,7 +3192,7 @@ const validators = validator.validators;
*/ */
class Axios$1 { class Axios$1 {
constructor(instanceConfig) { constructor(instanceConfig) {
this.defaults = instanceConfig; this.defaults = instanceConfig || {};
this.interceptors = { this.interceptors = {
request: new InterceptorManager$1(), request: new InterceptorManager$1(),
response: new InterceptorManager$1() response: new InterceptorManager$1()

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! Axios v1.8.4 Copyright (c) 2025 Matt Zabriskie and contributors */ /*! Axios v1.9.0 Copyright (c) 2025 Matt Zabriskie and contributors */
'use strict'; 'use strict';
const FormData$1 = require('form-data'); const FormData$1 = require('form-data');
@ -36,6 +36,7 @@ function bind(fn, thisArg) {
const {toString} = Object.prototype; const {toString} = Object.prototype;
const {getPrototypeOf} = Object; const {getPrototypeOf} = Object;
const {iterator, toStringTag} = Symbol;
const kindOf = (cache => thing => { const kindOf = (cache => thing => {
const str = toString.call(thing); const str = toString.call(thing);
@ -162,7 +163,7 @@ const isPlainObject = (val) => {
} }
const prototype = getPrototypeOf(val); const prototype = getPrototypeOf(val);
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
}; };
/** /**
@ -513,13 +514,13 @@ const isTypedArray = (TypedArray => {
* @returns {void} * @returns {void}
*/ */
const forEachEntry = (obj, fn) => { const forEachEntry = (obj, fn) => {
const generator = obj && obj[Symbol.iterator]; const generator = obj && obj[iterator];
const iterator = generator.call(obj); const _iterator = generator.call(obj);
let result; let result;
while ((result = iterator.next()) && !result.done) { while ((result = _iterator.next()) && !result.done) {
const pair = result.value; const pair = result.value;
fn.call(obj, pair[0], pair[1]); fn.call(obj, pair[0], pair[1]);
} }
@ -640,7 +641,7 @@ const toFiniteNumber = (value, defaultValue) => {
* @returns {boolean} * @returns {boolean}
*/ */
function isSpecCompliantForm(thing) { function isSpecCompliantForm(thing) {
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
} }
const toJSONObject = (obj) => { const toJSONObject = (obj) => {
@ -709,6 +710,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
// ********************* // *********************
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
const utils$1 = { const utils$1 = {
isArray, isArray,
isArrayBuffer, isArrayBuffer,
@ -764,7 +769,8 @@ const utils$1 = {
isAsyncFn, isAsyncFn,
isThenable, isThenable,
setImmediate: _setImmediate, setImmediate: _setImmediate,
asap asap,
isIterable
}; };
/** /**
@ -1767,10 +1773,18 @@ class AxiosHeaders {
setHeaders(header, valueOrRewrite); setHeaders(header, valueOrRewrite);
} else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { } else if(utils$1.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
setHeaders(parseHeaders(header), valueOrRewrite); setHeaders(parseHeaders(header), valueOrRewrite);
} else if (utils$1.isHeaders(header)) { } else if (utils$1.isObject(header) && utils$1.isIterable(header)) {
for (const [key, value] of header.entries()) { let obj = {}, dest, key;
setHeader(value, key, rewrite); for (const entry of header) {
if (!utils$1.isArray(entry)) {
throw TypeError('Object iterator must return a key-value pair');
}
obj[key = entry[0]] = (dest = obj[key]) ?
(utils$1.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
} }
setHeaders(obj, valueOrRewrite);
} else { } else {
header != null && setHeader(valueOrRewrite, header, rewrite); header != null && setHeader(valueOrRewrite, header, rewrite);
} }
@ -1912,6 +1926,10 @@ class AxiosHeaders {
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
} }
getSetCookie() {
return this.get("set-cookie") || [];
}
get [Symbol.toStringTag]() { get [Symbol.toStringTag]() {
return 'AxiosHeaders'; return 'AxiosHeaders';
} }
@ -2084,7 +2102,7 @@ function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
return requestedURL; return requestedURL;
} }
const VERSION = "1.8.4"; const VERSION = "1.9.0";
function parseProtocol(url) { function parseProtocol(url) {
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
@ -2366,7 +2384,7 @@ const formDataToStream = (form, headersHandler, options) => {
} }
const boundaryBytes = textEncoder.encode('--' + boundary + CRLF); const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF); const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
let contentLength = footerBytes.byteLength; let contentLength = footerBytes.byteLength;
const parts = Array.from(form.entries()).map(([name, value]) => { const parts = Array.from(form.entries()).map(([name, value]) => {
@ -3967,7 +3985,7 @@ const fetchAdapter = isFetchSupported && (async (config) => {
} catch (err) { } catch (err) {
unsubscribe && unsubscribe(); unsubscribe && unsubscribe();
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) { if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
throw Object.assign( throw Object.assign(
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
{ {
@ -4233,7 +4251,7 @@ const validators = validator.validators;
*/ */
class Axios { class Axios {
constructor(instanceConfig) { constructor(instanceConfig) {
this.defaults = instanceConfig; this.defaults = instanceConfig || {};
this.interceptors = { this.interceptors = {
request: new InterceptorManager$1(), request: new InterceptorManager$1(),
response: new InterceptorManager$1() response: new InterceptorManager$1()

File diff suppressed because one or more lines are too long

4
node_modules/axios/index.d.cts generated vendored
View File

@ -359,7 +359,7 @@ declare namespace axios {
type Milliseconds = number; type Milliseconds = number;
type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | string; type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | (string & {});
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName; type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
@ -508,6 +508,7 @@ declare namespace axios {
<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>; <T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>; <T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
create(config?: CreateAxiosDefaults): AxiosInstance;
defaults: Omit<AxiosDefaults, 'headers'> & { defaults: Omit<AxiosDefaults, 'headers'> & {
headers: HeadersDefaults & { headers: HeadersDefaults & {
[key: string]: AxiosHeaderValue [key: string]: AxiosHeaderValue
@ -526,7 +527,6 @@ declare namespace axios {
} }
interface AxiosStatic extends AxiosInstance { interface AxiosStatic extends AxiosInstance {
create(config?: CreateAxiosDefaults): AxiosInstance;
Cancel: CancelStatic; Cancel: CancelStatic;
CancelToken: CancelTokenStatic; CancelToken: CancelTokenStatic;
Axios: typeof Axios; Axios: typeof Axios;

6
node_modules/axios/index.d.ts generated vendored
View File

@ -74,6 +74,8 @@ export class AxiosHeaders {
getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue; getAuthorization(matcher?: AxiosHeaderMatcher): AxiosHeaderValue;
hasAuthorization(matcher?: AxiosHeaderMatcher): boolean; hasAuthorization(matcher?: AxiosHeaderMatcher): boolean;
getSetCookie(): string[];
[Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>; [Symbol.iterator](): IterableIterator<[string, AxiosHeaderValue]>;
} }
@ -300,7 +302,7 @@ export interface AxiosProgressEvent {
type Milliseconds = number; type Milliseconds = number;
type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | string; type AxiosAdapterName = 'fetch' | 'xhr' | 'http' | (string & {});
type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName; type AxiosAdapterConfig = AxiosAdapter | AxiosAdapterName;
@ -512,6 +514,7 @@ export interface AxiosInstance extends Axios {
<T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>; <T = any, R = AxiosResponse<T>, D = any>(config: AxiosRequestConfig<D>): Promise<R>;
<T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>; <T = any, R = AxiosResponse<T>, D = any>(url: string, config?: AxiosRequestConfig<D>): Promise<R>;
create(config?: CreateAxiosDefaults): AxiosInstance;
defaults: Omit<AxiosDefaults, 'headers'> & { defaults: Omit<AxiosDefaults, 'headers'> & {
headers: HeadersDefaults & { headers: HeadersDefaults & {
[key: string]: AxiosHeaderValue [key: string]: AxiosHeaderValue
@ -546,7 +549,6 @@ export function all<T>(values: Array<T | Promise<T>>): Promise<T[]>;
export function mergeConfig<D = any>(config1: AxiosRequestConfig<D>, config2: AxiosRequestConfig<D>): AxiosRequestConfig<D>; export function mergeConfig<D = any>(config1: AxiosRequestConfig<D>, config2: AxiosRequestConfig<D>): AxiosRequestConfig<D>;
export interface AxiosStatic extends AxiosInstance { export interface AxiosStatic extends AxiosInstance {
create(config?: CreateAxiosDefaults): AxiosInstance;
Cancel: CancelStatic; Cancel: CancelStatic;
CancelToken: CancelTokenStatic; CancelToken: CancelTokenStatic;
Axios: typeof Axios; Axios: typeof Axios;

View File

@ -213,7 +213,7 @@ export default isFetchSupported && (async (config) => {
} catch (err) { } catch (err) {
unsubscribe && unsubscribe(); unsubscribe && unsubscribe();
if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) { if (err && err.name === 'TypeError' && /Load failed|fetch/i.test(err.message)) {
throw Object.assign( throw Object.assign(
new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request), new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),
{ {

View File

@ -20,7 +20,7 @@ const validators = validator.validators;
*/ */
class Axios { class Axios {
constructor(instanceConfig) { constructor(instanceConfig) {
this.defaults = instanceConfig; this.defaults = instanceConfig || {};
this.interceptors = { this.interceptors = {
request: new InterceptorManager(), request: new InterceptorManager(),
response: new InterceptorManager() response: new InterceptorManager()

View File

@ -100,10 +100,18 @@ class AxiosHeaders {
setHeaders(header, valueOrRewrite) setHeaders(header, valueOrRewrite)
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
setHeaders(parseHeaders(header), valueOrRewrite); setHeaders(parseHeaders(header), valueOrRewrite);
} else if (utils.isHeaders(header)) { } else if (utils.isObject(header) && utils.isIterable(header)) {
for (const [key, value] of header.entries()) { let obj = {}, dest, key;
setHeader(value, key, rewrite); for (const entry of header) {
if (!utils.isArray(entry)) {
throw TypeError('Object iterator must return a key-value pair');
}
obj[key = entry[0]] = (dest = obj[key]) ?
(utils.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]]) : entry[1];
} }
setHeaders(obj, valueOrRewrite)
} else { } else {
header != null && setHeader(valueOrRewrite, header, rewrite); header != null && setHeader(valueOrRewrite, header, rewrite);
} }
@ -245,6 +253,10 @@ class AxiosHeaders {
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n'); return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
} }
getSetCookie() {
return this.get("set-cookie") || [];
}
get [Symbol.toStringTag]() { get [Symbol.toStringTag]() {
return 'AxiosHeaders'; return 'AxiosHeaders';
} }

2
node_modules/axios/lib/env/data.js generated vendored
View File

@ -1 +1 @@
export const VERSION = "1.8.4"; export const VERSION = "1.9.0";

View File

@ -76,7 +76,7 @@ const formDataToStream = (form, headersHandler, options) => {
} }
const boundaryBytes = textEncoder.encode('--' + boundary + CRLF); const boundaryBytes = textEncoder.encode('--' + boundary + CRLF);
const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF + CRLF); const footerBytes = textEncoder.encode('--' + boundary + '--' + CRLF);
let contentLength = footerBytes.byteLength; let contentLength = footerBytes.byteLength;
const parts = Array.from(form.entries()).map(([name, value]) => { const parts = Array.from(form.entries()).map(([name, value]) => {

18
node_modules/axios/lib/utils.js generated vendored
View File

@ -6,6 +6,7 @@ import bind from './helpers/bind.js';
const {toString} = Object.prototype; const {toString} = Object.prototype;
const {getPrototypeOf} = Object; const {getPrototypeOf} = Object;
const {iterator, toStringTag} = Symbol;
const kindOf = (cache => thing => { const kindOf = (cache => thing => {
const str = toString.call(thing); const str = toString.call(thing);
@ -132,7 +133,7 @@ const isPlainObject = (val) => {
} }
const prototype = getPrototypeOf(val); const prototype = getPrototypeOf(val);
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(toStringTag in val) && !(iterator in val);
} }
/** /**
@ -483,13 +484,13 @@ const isTypedArray = (TypedArray => {
* @returns {void} * @returns {void}
*/ */
const forEachEntry = (obj, fn) => { const forEachEntry = (obj, fn) => {
const generator = obj && obj[Symbol.iterator]; const generator = obj && obj[iterator];
const iterator = generator.call(obj); const _iterator = generator.call(obj);
let result; let result;
while ((result = iterator.next()) && !result.done) { while ((result = _iterator.next()) && !result.done) {
const pair = result.value; const pair = result.value;
fn.call(obj, pair[0], pair[1]); fn.call(obj, pair[0], pair[1]);
} }
@ -610,7 +611,7 @@ const toFiniteNumber = (value, defaultValue) => {
* @returns {boolean} * @returns {boolean}
*/ */
function isSpecCompliantForm(thing) { function isSpecCompliantForm(thing) {
return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]); return !!(thing && isFunction(thing.append) && thing[toStringTag] === 'FormData' && thing[iterator]);
} }
const toJSONObject = (obj) => { const toJSONObject = (obj) => {
@ -679,6 +680,10 @@ const asap = typeof queueMicrotask !== 'undefined' ?
// ********************* // *********************
const isIterable = (thing) => thing != null && isFunction(thing[iterator]);
export default { export default {
isArray, isArray,
isArrayBuffer, isArrayBuffer,
@ -734,5 +739,6 @@ export default {
isAsyncFn, isAsyncFn,
isThenable, isThenable,
setImmediate: _setImmediate, setImmediate: _setImmediate,
asap asap,
isIterable
}; };

8
node_modules/axios/package.json generated vendored
View File

@ -1,6 +1,6 @@
{ {
"name": "axios", "name": "axios",
"version": "1.8.4", "version": "1.9.0",
"description": "Promise based HTTP client for the browser and node.js", "description": "Promise based HTTP client for the browser and node.js",
"main": "index.js", "main": "index.js",
"exports": { "exports": {
@ -167,10 +167,10 @@
"Justin Beckwith (https://github.com/JustinBeckwith)", "Justin Beckwith (https://github.com/JustinBeckwith)",
"Martti Laine (https://github.com/codeclown)", "Martti Laine (https://github.com/codeclown)",
"Xianming Zhong (https://github.com/chinesedfan)", "Xianming Zhong (https://github.com/chinesedfan)",
"Remco Haszing (https://github.com/remcohaszing)",
"Rikki Gibson (https://github.com/RikkiGibson)", "Rikki Gibson (https://github.com/RikkiGibson)",
"Ben Carp (https://github.com/carpben)", "Remco Haszing (https://github.com/remcohaszing)",
"Yasu Flores (https://github.com/yasuf)" "Yasu Flores (https://github.com/yasuf)",
"Ben Carp (https://github.com/carpben)"
], ],
"sideEffects": false, "sideEffects": false,
"release-it": { "release-it": {

View File

@ -1,5 +1,5 @@
/** /**
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params * @see {@link https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params}
*/ */
export interface GatewayURLQuery { export interface GatewayURLQuery {
v: string; v: string;

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -21,7 +21,7 @@ exports.VoiceChannelEffectSendAnimationType = exports.GatewayDispatchEvents = ex
__exportStar(require("./common"), exports); __exportStar(require("./common"), exports);
exports.GatewayVersion = '10'; exports.GatewayVersion = '10';
/** /**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes}
*/ */
var GatewayOpcodes; var GatewayOpcodes;
(function (GatewayOpcodes) { (function (GatewayOpcodes) {
@ -76,7 +76,7 @@ var GatewayOpcodes;
GatewayOpcodes[GatewayOpcodes["RequestSoundboardSounds"] = 31] = "RequestSoundboardSounds"; GatewayOpcodes[GatewayOpcodes["RequestSoundboardSounds"] = 31] = "RequestSoundboardSounds";
})(GatewayOpcodes || (exports.GatewayOpcodes = GatewayOpcodes = {})); })(GatewayOpcodes || (exports.GatewayOpcodes = GatewayOpcodes = {}));
/** /**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes * @see {@link https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes}
*/ */
var GatewayCloseCodes; var GatewayCloseCodes;
(function (GatewayCloseCodes) { (function (GatewayCloseCodes) {
@ -87,25 +87,25 @@ var GatewayCloseCodes;
/** /**
* You sent an invalid Gateway opcode or an invalid payload for an opcode. Don't do that! * 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-events#payload-structure * @see {@link https://discord.com/developers/docs/topics/gateway-events#payload-structure}
*/ */
GatewayCloseCodes[GatewayCloseCodes["UnknownOpcode"] = 4001] = "UnknownOpcode"; GatewayCloseCodes[GatewayCloseCodes["UnknownOpcode"] = 4001] = "UnknownOpcode";
/** /**
* You sent an invalid payload to us. Don't do that! * You sent an invalid payload to us. Don't do that!
* *
* See https://discord.com/developers/docs/topics/gateway#sending-events * @see {@link https://discord.com/developers/docs/topics/gateway#sending-events}
*/ */
GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError"; GatewayCloseCodes[GatewayCloseCodes["DecodeError"] = 4002] = "DecodeError";
/** /**
* You sent us a payload prior to identifying * You sent us a payload prior to identifying
* *
* See https://discord.com/developers/docs/topics/gateway-events#identify * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify}
*/ */
GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated"; GatewayCloseCodes[GatewayCloseCodes["NotAuthenticated"] = 4003] = "NotAuthenticated";
/** /**
* The account token sent with your identify payload is incorrect * The account token sent with your identify payload is incorrect
* *
* See https://discord.com/developers/docs/topics/gateway-events#identify * @see {@link https://discord.com/developers/docs/topics/gateway-events#identify}
*/ */
GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed"; GatewayCloseCodes[GatewayCloseCodes["AuthenticationFailed"] = 4004] = "AuthenticationFailed";
/** /**
@ -115,7 +115,7 @@ var GatewayCloseCodes;
/** /**
* The sequence sent when resuming the session was invalid. Reconnect and start a new session * The sequence sent when resuming the session was invalid. Reconnect and start a new session
* *
* See https://discord.com/developers/docs/topics/gateway-events#resume * @see {@link https://discord.com/developers/docs/topics/gateway-events#resume}
*/ */
GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq"; GatewayCloseCodes[GatewayCloseCodes["InvalidSeq"] = 4007] = "InvalidSeq";
/** /**
@ -129,13 +129,13 @@ var GatewayCloseCodes;
/** /**
* You sent us an invalid shard when identifying * You sent us an invalid shard when identifying
* *
* See https://discord.com/developers/docs/topics/gateway#sharding * @see {@link https://discord.com/developers/docs/topics/gateway#sharding}
*/ */
GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard"; GatewayCloseCodes[GatewayCloseCodes["InvalidShard"] = 4010] = "InvalidShard";
/** /**
* The session would have handled too many guilds - you are required to shard your connection in order to connect * 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 * @see {@link https://discord.com/developers/docs/topics/gateway#sharding}
*/ */
GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired"; GatewayCloseCodes[GatewayCloseCodes["ShardingRequired"] = 4011] = "ShardingRequired";
/** /**
@ -145,21 +145,20 @@ var GatewayCloseCodes;
/** /**
* You sent an invalid intent for a Gateway Intent. You may have incorrectly calculated the bitwise value * 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 * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents}
*/ */
GatewayCloseCodes[GatewayCloseCodes["InvalidIntents"] = 4013] = "InvalidIntents"; 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 * 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 * enabled or are not whitelisted for
* *
* See https://discord.com/developers/docs/topics/gateway#gateway-intents * @see {@link https://discord.com/developers/docs/topics/gateway#gateway-intents}
* * @see {@link https://discord.com/developers/docs/topics/gateway#privileged-intents}
* See https://discord.com/developers/docs/topics/gateway#privileged-intents
*/ */
GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents"; GatewayCloseCodes[GatewayCloseCodes["DisallowedIntents"] = 4014] = "DisallowedIntents";
})(GatewayCloseCodes || (exports.GatewayCloseCodes = GatewayCloseCodes = {})); })(GatewayCloseCodes || (exports.GatewayCloseCodes = GatewayCloseCodes = {}));
/** /**
* https://discord.com/developers/docs/topics/gateway#list-of-intents * @see {@link https://discord.com/developers/docs/topics/gateway#list-of-intents}
*/ */
var GatewayIntentBits; var GatewayIntentBits;
(function (GatewayIntentBits) { (function (GatewayIntentBits) {
@ -167,12 +166,12 @@ var GatewayIntentBits;
GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers"; GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers";
GatewayIntentBits[GatewayIntentBits["GuildModeration"] = 4] = "GuildModeration"; GatewayIntentBits[GatewayIntentBits["GuildModeration"] = 4] = "GuildModeration";
/** /**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration} * @deprecated This is the old name for {@link GatewayIntentBits.GuildModeration}
*/ */
GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans"; GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans";
GatewayIntentBits[GatewayIntentBits["GuildExpressions"] = 8] = "GuildExpressions"; GatewayIntentBits[GatewayIntentBits["GuildExpressions"] = 8] = "GuildExpressions";
/** /**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildExpressions} * @deprecated This is the old name for {@link GatewayIntentBits.GuildExpressions}
*/ */
GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers"; GatewayIntentBits[GatewayIntentBits["GuildEmojisAndStickers"] = 8] = "GuildEmojisAndStickers";
GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations"; GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations";
@ -194,7 +193,7 @@ var GatewayIntentBits;
GatewayIntentBits[GatewayIntentBits["DirectMessagePolls"] = 33554432] = "DirectMessagePolls"; GatewayIntentBits[GatewayIntentBits["DirectMessagePolls"] = 33554432] = "DirectMessagePolls";
})(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {})); })(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {}));
/** /**
* https://discord.com/developers/docs/topics/gateway-events#receive-events * @see {@link https://discord.com/developers/docs/topics/gateway-events#receive-events}
*/ */
var GatewayDispatchEvents; var GatewayDispatchEvents;
(function (GatewayDispatchEvents) { (function (GatewayDispatchEvents) {
@ -275,7 +274,7 @@ var GatewayDispatchEvents;
GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE"; GatewayDispatchEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE";
})(GatewayDispatchEvents || (exports.GatewayDispatchEvents = GatewayDispatchEvents = {})); })(GatewayDispatchEvents || (exports.GatewayDispatchEvents = GatewayDispatchEvents = {}));
/** /**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types * @see {@link https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types}
*/ */
var VoiceChannelEffectSendAnimationType; var VoiceChannelEffectSendAnimationType;
(function (VoiceChannelEffectSendAnimationType) { (function (VoiceChannelEffectSendAnimationType) {

View File

@ -1 +1 @@
{"version":3,"file":"v10.js","sourceRoot":"","sources":["v10.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AA2CH,2CAAyB;AAEZ,QAAA,cAAc,GAAG,IAAI,CAAC;AAEnC;;GAEG;AACH,IAAY,cAkDX;AAlDD,WAAY,cAAc;IACzB;;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;IACZ;;OAEG;IACH,0FAA4B,CAAA;AAC7B,CAAC,EAlDW,cAAc,8BAAd,cAAc,QAkDzB;AAED;;GAEG;AACH,IAAY,iBA8EX;AA9ED,WAAY,iBAAiB;IAC5B;;OAEG;IACH,4EAAoB,CAAA;IACpB;;;;OAIG;IACH,8EAAa,CAAA;IACb;;;;OAIG;IACH,0EAAW,CAAA;IACX;;;;OAIG;IACH,oFAAgB,CAAA;IAChB;;;;OAIG;IACH,4FAAoB,CAAA;IACpB;;OAEG;IACH,4FAAoB,CAAA;IACpB;;;;OAIG;IACH,wEAAkB,CAAA;IAClB;;OAEG;IACH,0EAAW,CAAA;IACX;;OAEG;IACH,kFAAe,CAAA;IACf;;;;OAIG;IACH,4EAAY,CAAA;IACZ;;;;OAIG;IACH,oFAAgB,CAAA;IAChB;;OAEG;IACH,sFAAiB,CAAA;IACjB;;;;OAIG;IACH,gFAAc,CAAA;IACd;;;;;;;OAOG;IACH,sFAAiB,CAAA;AAClB,CAAC,EA9EW,iBAAiB,iCAAjB,iBAAiB,QA8E5B;AAED;;GAEG;AACH,IAAY,iBA8BX;AA9BD,WAAY,iBAAiB;IAC5B,6DAAe,CAAA;IACf,yEAAqB,CAAA;IACrB,+EAAwB,CAAA;IACxB;;OAEG;IACH,mEAA2B,CAAA;IAC3B,iFAAyB,CAAA;IACzB;;OAEG;IACH,6FAAyC,CAAA;IACzC,oFAA0B,CAAA;IAC1B,4EAAsB,CAAA;IACtB,0EAAqB,CAAA;IACrB,mFAAyB,CAAA;IACzB,+EAAuB,CAAA;IACvB,6EAAsB,CAAA;IACtB,8FAA+B,CAAA;IAC/B,wFAA4B,CAAA;IAC5B,gFAAwB,CAAA;IACxB,gGAAgC,CAAA;IAChC,2FAA6B,CAAA;IAC7B,iFAAwB,CAAA;IACxB,6FAA8B,CAAA;IAC9B,6GAAqC,CAAA;IACrC,qGAAiC,CAAA;IACjC,0FAA2B,CAAA;IAC3B,4FAA4B,CAAA;AAC7B,CAAC,EA9BW,iBAAiB,iCAAjB,iBAAiB,QA8B5B;AAED;;GAEG;AACH,IAAY,qBA4EX;AA5ED,WAAY,qBAAqB;IAChC,uGAA8E,CAAA;IAC9E,2FAAkE,CAAA;IAClE,iFAAwD,CAAA;IACxD,iFAAwD,CAAA;IACxD,iFAAwD,CAAA;IACxD,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,yDAAgC,CAAA;IAChC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,kFAAyD,CAAA;IACzD,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,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,sFAA6D,CAAA;IAC7D,4FAAmE,CAAA;IACnE,qFAA4D,CAAA;IAC5D,qFAA4D,CAAA;IAC5D,uFAA8D,CAAA;IAC9D,qFAA4D,CAAA;IAC5D,+DAAsC,CAAA;IACtC,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,qEAA4C,CAAA;IAC5C,2EAAkD,CAAA;IAClD,oEAA2C,CAAA;IAC3C,0EAAiD,CAAA;IACjD,iFAAwD,CAAA;IACxD,qFAA4D,CAAA;IAC5D,yDAAgC,CAAA;IAChC,2DAAkC,CAAA;IAClC,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,mEAA0C,CAAA;IAC1C,mEAA0C,CAAA;IAC1C,mEAA0C,CAAA;IAC1C,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,4DAAmC,CAAA;IACnC,sEAA6C,CAAA;IAC7C,oEAA2C,CAAA;IAC3C,uDAA8B,CAAA;IAC9B,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,6EAAoD,CAAA;IACpD,kEAAyC,CAAA;IACzC,gEAAuC,CAAA;IACvC,2DAAkC,CAAA;AACnC,CAAC,EA5EW,qBAAqB,qCAArB,qBAAqB,QA4EhC;AAiqDD;;GAEG;AACH,IAAY,mCASX;AATD,WAAY,mCAAmC;IAC9C;;OAEG;IACH,mGAAO,CAAA;IACP;;OAEG;IACH,+FAAK,CAAA;AACN,CAAC,EATW,mCAAmC,mDAAnC,mCAAmC,QAS9C;AA6eD,oBAAoB"} {"version":3,"file":"v10.js","sourceRoot":"","sources":["v10.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AA2CH,2CAAyB;AAEZ,QAAA,cAAc,GAAG,IAAI,CAAC;AAEnC;;GAEG;AACH,IAAY,cAkDX;AAlDD,WAAY,cAAc;IACzB;;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;IACZ;;OAEG;IACH,0FAA4B,CAAA;AAC7B,CAAC,EAlDW,cAAc,8BAAd,cAAc,QAkDzB;AAED;;GAEG;AACH,IAAY,iBA6EX;AA7ED,WAAY,iBAAiB;IAC5B;;OAEG;IACH,4EAAoB,CAAA;IACpB;;;;OAIG;IACH,8EAAa,CAAA;IACb;;;;OAIG;IACH,0EAAW,CAAA;IACX;;;;OAIG;IACH,oFAAgB,CAAA;IAChB;;;;OAIG;IACH,4FAAoB,CAAA;IACpB;;OAEG;IACH,4FAAoB,CAAA;IACpB;;;;OAIG;IACH,wEAAkB,CAAA;IAClB;;OAEG;IACH,0EAAW,CAAA;IACX;;OAEG;IACH,kFAAe,CAAA;IACf;;;;OAIG;IACH,4EAAY,CAAA;IACZ;;;;OAIG;IACH,oFAAgB,CAAA;IAChB;;OAEG;IACH,sFAAiB,CAAA;IACjB;;;;OAIG;IACH,gFAAc,CAAA;IACd;;;;;;OAMG;IACH,sFAAiB,CAAA;AAClB,CAAC,EA7EW,iBAAiB,iCAAjB,iBAAiB,QA6E5B;AAED;;GAEG;AACH,IAAY,iBA8BX;AA9BD,WAAY,iBAAiB;IAC5B,6DAAe,CAAA;IACf,yEAAqB,CAAA;IACrB,+EAAwB,CAAA;IACxB;;OAEG;IACH,mEAA2B,CAAA;IAC3B,iFAAyB,CAAA;IACzB;;OAEG;IACH,6FAAyC,CAAA;IACzC,oFAA0B,CAAA;IAC1B,4EAAsB,CAAA;IACtB,0EAAqB,CAAA;IACrB,mFAAyB,CAAA;IACzB,+EAAuB,CAAA;IACvB,6EAAsB,CAAA;IACtB,8FAA+B,CAAA;IAC/B,wFAA4B,CAAA;IAC5B,gFAAwB,CAAA;IACxB,gGAAgC,CAAA;IAChC,2FAA6B,CAAA;IAC7B,iFAAwB,CAAA;IACxB,6FAA8B,CAAA;IAC9B,6GAAqC,CAAA;IACrC,qGAAiC,CAAA;IACjC,0FAA2B,CAAA;IAC3B,4FAA4B,CAAA;AAC7B,CAAC,EA9BW,iBAAiB,iCAAjB,iBAAiB,QA8B5B;AAED;;GAEG;AACH,IAAY,qBA4EX;AA5ED,WAAY,qBAAqB;IAChC,uGAA8E,CAAA;IAC9E,2FAAkE,CAAA;IAClE,iFAAwD,CAAA;IACxD,iFAAwD,CAAA;IACxD,iFAAwD,CAAA;IACxD,yDAAgC,CAAA;IAChC,yDAAgC,CAAA;IAChC,kEAAyC,CAAA;IACzC,yDAAgC,CAAA;IAChC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,iEAAwC,CAAA;IACxC,kFAAyD,CAAA;IACzD,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,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,mFAA0D,CAAA;IAC1D,sFAA6D,CAAA;IAC7D,4FAAmE,CAAA;IACnE,qFAA4D,CAAA;IAC5D,qFAA4D,CAAA;IAC5D,uFAA8D,CAAA;IAC9D,qFAA4D,CAAA;IAC5D,+DAAsC,CAAA;IACtC,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,qEAA4C,CAAA;IAC5C,2EAAkD,CAAA;IAClD,oEAA2C,CAAA;IAC3C,0EAAiD,CAAA;IACjD,iFAAwD,CAAA;IACxD,qFAA4D,CAAA;IAC5D,yDAAgC,CAAA;IAChC,2DAAkC,CAAA;IAClC,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,sEAA6C,CAAA;IAC7C,mEAA0C,CAAA;IAC1C,mEAA0C,CAAA;IAC1C,mEAA0C,CAAA;IAC1C,uDAA8B,CAAA;IAC9B,uDAA8B,CAAA;IAC9B,4DAAmC,CAAA;IACnC,sEAA6C,CAAA;IAC7C,oEAA2C,CAAA;IAC3C,uDAA8B,CAAA;IAC9B,qDAA4B,CAAA;IAC5B,mDAA0B,CAAA;IAC1B,6EAAoD,CAAA;IACpD,kEAAyC,CAAA;IACzC,gEAAuC,CAAA;IACvC,2DAAkC,CAAA;AACnC,CAAC,EA5EW,qBAAqB,qCAArB,qBAAqB,QA4EhC;AA6qDD;;GAEG;AACH,IAAY,mCASX;AATD,WAAY,mCAAmC;IAC9C;;OAEG;IACH,mGAAO,CAAA;IACP;;OAEG;IACH,+FAAK,CAAA;AACN,CAAC,EATW,mCAAmC,mDAAnC,mCAAmC,QAS9C;AA6eD,oBAAoB"}

View File

@ -3,7 +3,7 @@
*/ */
import type { Snowflake } from '../globals'; import type { Snowflake } from '../globals';
import type { APIApplication, APIChannel, APIEmoji, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildScheduledEvent, APIInteraction, APIMessage, APIRole, APIStageInstance, APISticker, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayVoiceState, InviteTargetType, PresenceUpdateStatus } from '../payloads/v8/index'; import type { APIApplication, APIChannel, APIEmoji, APIGuild, APIGuildIntegration, APIGuildMember, APIGuildScheduledEvent, APIInteraction, APIMessage, APIRole, APIStageInstance, APISticker, APIUnavailableGuild, APIUser, GatewayActivity, GatewayPresenceUpdate as RawGatewayPresenceUpdate, GatewayVoiceState, InviteTargetType, PresenceUpdateStatus } from '../payloads/v8/index';
import type { Nullable } from '../utils/internals'; import type { _Nullable } from '../utils/internals';
export * from './common'; export * from './common';
/** /**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
@ -641,7 +641,7 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<GatewayDispatchEvents
* *
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/ */
export type GatewayGuildMemberUpdateDispatchData = Nullable<Pick<APIGuildMember, 'joined_at'>> & Omit<APIGuildMember, 'deaf' | 'joined_at' | 'mute' | 'user'> & Partial<Pick<APIGuildMember, 'deaf' | 'mute'>> & Required<Pick<APIGuildMember, 'user'>> & { export type GatewayGuildMemberUpdateDispatchData = _Nullable<Pick<APIGuildMember, 'joined_at'>> & Omit<APIGuildMember, 'deaf' | 'joined_at' | 'mute' | 'user'> & Partial<Pick<APIGuildMember, 'deaf' | 'mute'>> & Required<Pick<APIGuildMember, 'user'>> & {
/** /**
* The id of the guild * The id of the guild
*/ */

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More