Compare commits

...

13 Commits

Author SHA1 Message Date
Jiralite
dd1e3c98b7 chore(builders): release @discordjs/builders@1.12.2 2025-10-09 01:27:11 +01:00
Jiralite
43362c9352 fix(Assertions): literal default values 2025-10-09 00:47:02 +01:00
Vlad Frangu
8b9bb25ddb chore(builders): release @discordjs/builders@1.12.1 2025-10-08 21:17:58 +03:00
Vlad Frangu
99b8436117 fix(builders): text display component support for modals (#11155) 2025-10-08 19:17:19 +01:00
Jiralite
9a60e4033b chore(builders): release @discordjs/builders@1.12.0 2025-10-08 08:34:43 +01:00
Vlad Frangu
ac683b9d04 feat(builders): modal select menus in builders v1 (#11138)
* feat(builders): modal select menus

* chore: fix test

* fix: move setRequired up

* fix: pack

* chore: forwardport https://github.com/discordjs/discord.js/pull/11139

* types: expect errors

* fix: id validator being required

* fix: validators 2

* Apply suggestion from @Jiralite

* Apply suggestion from @Jiralite

* Apply suggestion from @Jiralite

* fix: replace tests

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-08 08:21:41 +01:00
Qjuh
437bb94349 feat: show default values in docs (#10465) 2025-09-02 01:22:30 +01:00
Amgelo563
77f7c7fb15 fix: Do not omit falsy default values (#10755)
* fix(docs): fix default falsy values being omitted

* fix(docs): swap defaultValue check to avoid negated condition

* fix: fix pr by removing everything it added and committing something entirely different

---------

Co-authored-by: almeidx <github@almeidx.dev>
2025-09-02 01:16:15 +01:00
Vlad Frangu
9ce9e66ec1 chore(builders): release @discordjs/builders@1.11.3 2025-08-10 18:48:53 +02:00
Jiralite
4906aaea4c fix(contextMenuCommands): Remove regular expression validation (#10996)
* fix: remove name check for context menu commands

* fix: simpler regex

Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com>

---------

Co-authored-by: Qjuh <76154676+Qjuh@users.noreply.github.com>
2025-07-17 10:07:18 +01:00
Jiralite
ba5ccab919 build: Upgrade dependencies 2025-07-15 01:35:12 +01:00
Vlad Frangu
93cf7721d0 chore(builders): release @discordjs/builders@1.11.2 2025-05-03 01:03:20 +03:00
Qjuh
e6370ae378 chore: remove container limit (#10867)
* chore: remove container limit

* fix: typo

* fix: setValidationEnabled
2025-04-30 22:19:31 +02:00
26 changed files with 795 additions and 2756 deletions

View File

@@ -114,7 +114,7 @@ interface DocgenEventJson {
}
interface DocgenParamJson {
default?: string;
default?: boolean | number | string;
description: string;
name: string;
nullable?: boolean;
@@ -155,7 +155,7 @@ interface DocgenMethodJson {
interface DocgenPropertyJson {
abstract?: boolean;
access?: DocgenAccess;
default?: string;
default?: boolean | number | string;
deprecated?: DocgenDeprecated;
description: string;
meta: DocgenMetaJson;
@@ -1264,7 +1264,7 @@ export class ApiModelGenerator {
const apiItemMetadata: ApiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
const docComment: tsdoc.DocComment | undefined = jsDoc
? this._tsDocParser.parseString(
`/**\n * ${this._fixLinkTags(jsDoc.description) ?? ''}\n${
`/**\n * ${this._fixLinkTags(jsDoc.description) ?? ''}${jsDoc.default ? ` (default: ${this._escapeSpecialChars(jsDoc.default)})` : ''}\n${
'see' in jsDoc ? jsDoc.see.map((see) => ` * @see ${see}\n`).join('') : ''
}${'readonly' in jsDoc && jsDoc.readonly ? ' * @readonly\n' : ''}${
'deprecated' in jsDoc && jsDoc.deprecated
@@ -1342,7 +1342,7 @@ export class ApiModelGenerator {
const apiItemMetadata: ApiItemMetadata = this._collector.fetchApiItemMetadata(astDeclaration);
const docComment: tsdoc.DocComment | undefined = jsDoc
? this._tsDocParser.parseString(
`/**\n * ${this._fixLinkTags(jsDoc.description) ?? ''}\n${
`/**\n * ${this._fixLinkTags(jsDoc.description) ?? ''}${jsDoc.default ? ` (default: ${this._escapeSpecialChars(jsDoc.default)})` : ''}\n${
'see' in jsDoc ? jsDoc.see.map((see) => ` * @see ${see}\n`).join('') : ''
}${'readonly' in jsDoc && jsDoc.readonly ? ' * @readonly\n' : ''}${
'deprecated' in jsDoc && jsDoc.deprecated
@@ -1746,6 +1746,14 @@ export class ApiModelGenerator {
return sourceLocation;
}
private _escapeSpecialChars(input: boolean | number | string) {
if (typeof input !== 'string') {
return input;
}
return input.replaceAll(/(?<char>[{}])/g, '\\$<char>');
}
private _fixLinkTags(input?: string): string | undefined {
return input
?.replaceAll(linkRegEx, (_match, _p1, _p2, _p3, _p4, _p5, _offset, _string, groups) => {
@@ -1823,7 +1831,7 @@ export class ApiModelGenerator {
isOptional: Boolean(prop.nullable),
isReadonly: Boolean(prop.readonly),
docComment: this._tsDocParser.parseString(
`/**\n * ${this._fixLinkTags(prop.description) ?? ''}\n${
`/**\n * ${this._fixLinkTags(prop.description) ?? ''}${prop.default ? ` (default: ${this._escapeSpecialChars(prop.default)})` : ''}\n${
prop.see?.map((see) => ` * @see ${see}\n`).join('') ?? ''
}${prop.readonly ? ' * @readonly\n' : ''} */`,
).docComment,

View File

@@ -2,6 +2,30 @@
All notable changes to this project will be documented in this file.
# [@discordjs/builders@1.12.2](https://github.com/discordjs/discord.js/compare/@discordjs/builders@1.12.1...@discordjs/builders@1.12.2) - (2025-10-09)
## Bug Fixes
- **Assertions:** Literal default values ([43362c9](https://github.com/discordjs/discord.js/commit/43362c93525f98d72b894eb0fc6b358d30ec45b9))
# [@discordjs/builders@1.12.1](https://github.com/discordjs/discord.js/compare/@discordjs/builders@1.12.0...@discordjs/builders@1.12.1) - (2025-10-08)
## Bug Fixes
- **builders:** Text display component support for modals (#11155) ([99b8436](https://github.com/discordjs/discord.js/commit/99b8436117bc12654278337abc4a23f5bdf4ba46))
# [@discordjs/builders@1.12.0](https://github.com/discordjs/discord.js/compare/@discordjs/builders@1.11.3...@discordjs/builders@1.12.0) - (2025-10-08)
## Features
- **builders:** Modal select menus in builders v1 (#11138) ([ac683b9](https://github.com/discordjs/discord.js/commit/ac683b9d040635de8514c80a9d433d9c6d63701b))
# [@discordjs/builders@1.11.3](https://github.com/discordjs/discord.js/compare/@discordjs/builders@1.11.2...@discordjs/builders@1.11.3) - (2025-08-10)
## Bug Fixes
- **contextMenuCommands:** Remove regular expression validation (#10996) ([4906aae](https://github.com/discordjs/discord.js/commit/4906aaea4c0e6e868fa658d3359026eb662fbcb8))
# [@discordjs/builders@1.11.0](https://github.com/discordjs/discord.js/compare/@discordjs/builders@1.10.1...@discordjs/builders@1.11.0) - (2025-04-25)
## Features

View File

@@ -100,7 +100,7 @@ describe('Text Input Components', () => {
.setPlaceholder('hello')
.setStyle(TextInputStyle.Paragraph)
.toJSON();
}).toThrowError();
}).not.toThrowError();
});
test('GIVEN valid input THEN valid JSON outputs are given', () => {

View File

@@ -1,8 +1,8 @@
import { type APIContainerComponent, ComponentType, SeparatorSpacingSize } from 'discord-api-types/v10';
import { describe, test, expect } from 'vitest';
import { ButtonBuilder } from '../../../dist/index.mjs';
import { ActionRowBuilder } from '../../../src/components/ActionRow.js';
import { createComponentBuilder } from '../../../src/components/Components.js';
import { ButtonBuilder } from '../../../src/components/button/Button.js';
import { ContainerBuilder } from '../../../src/components/v2/Container.js';
import { FileBuilder } from '../../../src/components/v2/File.js';
import { MediaGalleryBuilder } from '../../../src/components/v2/MediaGallery.js';

View File

@@ -16,8 +16,8 @@ describe('Context Menu Commands', () => {
// Too short of a name
expect(() => ContextMenuCommandAssertions.validateName('')).toThrowError();
// Invalid characters used
expect(() => ContextMenuCommandAssertions.validateName('ABC123$%^&')).toThrowError();
// This should be fine, even with trailing and leading spaces (API trims it).
expect(() => ContextMenuCommandAssertions.validateName(' 🩵 ABC 123 $%^& ')).not.toThrowError();
// Too long of a name
expect(() =>
@@ -60,8 +60,6 @@ describe('Context Menu Commands', () => {
});
test('GIVEN invalid name THEN throw error', () => {
expect(() => getBuilder().setName('$$$')).toThrowError();
expect(() => getBuilder().setName(' ')).toThrowError();
});

View File

@@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@discordjs/builders",
"version": "1.11.1",
"version": "1.12.2",
"description": "A set of builders that you can use when creating your bot",
"scripts": {
"test": "vitest run",
@@ -68,7 +68,7 @@
"@discordjs/formatters": "workspace:^",
"@discordjs/util": "workspace:^",
"@sapphire/shapeshift": "^4.0.0",
"discord-api-types": "^0.38.1",
"discord-api-types": "^0.38.26",
"fast-deep-equal": "^3.1.3",
"ts-mixer": "^6.0.4",
"tslib": "^2.6.3"

View File

@@ -5,6 +5,7 @@ import type {
APIBaseComponent,
ComponentType,
APIMessageComponent,
APIModalComponent,
} from 'discord-api-types/v10';
import { idValidator } from './Assertions';
@@ -14,7 +15,8 @@ import { idValidator } from './Assertions';
export type AnyAPIActionRowComponent =
| APIActionRowComponent<APIComponentInActionRow>
| APIComponentInActionRow
| APIMessageComponent;
| APIMessageComponent
| APIModalComponent;
/**
* The base component builder that contains common symbols for all sorts of components.

View File

@@ -8,6 +8,7 @@ import {
} from './ActionRow.js';
import { ComponentBuilder } from './Component.js';
import { ButtonBuilder } from './button/Button.js';
import { LabelBuilder } from './label/Label.js';
import { ChannelSelectMenuBuilder } from './selectMenu/ChannelSelectMenu.js';
import { MentionableSelectMenuBuilder } from './selectMenu/MentionableSelectMenu.js';
import { RoleSelectMenuBuilder } from './selectMenu/RoleSelectMenu.js';
@@ -100,6 +101,10 @@ export interface MappedComponentTypes {
* The media gallery component type is associated with a {@link MediaGalleryBuilder}.
*/
[ComponentType.MediaGallery]: MediaGalleryBuilder;
/**
* The label component type is associated with a {@link LabelBuilder}.
*/
[ComponentType.Label]: LabelBuilder;
}
/**
@@ -161,6 +166,8 @@ export function createComponentBuilder(
return new ThumbnailBuilder(data);
case ComponentType.MediaGallery:
return new MediaGalleryBuilder(data);
case ComponentType.Label:
return new LabelBuilder(data);
default:
// @ts-expect-error This case can still occur if we get a newer unsupported component type
throw new Error(`Cannot properly serialize component type: ${data.type}`);

View File

@@ -0,0 +1,29 @@
import { s } from '@sapphire/shapeshift';
import { ComponentType } from 'discord-api-types/v10';
import { isValidationEnabled } from '../../util/validation.js';
import { idValidator } from '../Assertions.js';
import {
selectMenuChannelPredicate,
selectMenuMentionablePredicate,
selectMenuRolePredicate,
selectMenuStringPredicate,
selectMenuUserPredicate,
} from '../selectMenu/Assertions.js';
import { textInputPredicate } from '../textInput/Assertions.js';
export const labelPredicate = s
.object({
id: idValidator.optional(),
type: s.literal(ComponentType.Label),
label: s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(45),
description: s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).optional(),
component: s.union([
textInputPredicate,
selectMenuUserPredicate,
selectMenuRolePredicate,
selectMenuMentionablePredicate,
selectMenuChannelPredicate,
selectMenuStringPredicate,
]),
})
.setValidationEnabled(isValidationEnabled);

View File

@@ -0,0 +1,198 @@
import type {
APIChannelSelectComponent,
APILabelComponent,
APIMentionableSelectComponent,
APIRoleSelectComponent,
APIStringSelectComponent,
APITextInputComponent,
APIUserSelectComponent,
} from 'discord-api-types/v10';
import { ComponentType } from 'discord-api-types/v10';
import { ComponentBuilder } from '../Component.js';
import { createComponentBuilder, resolveBuilder } from '../Components.js';
import { ChannelSelectMenuBuilder } from '../selectMenu/ChannelSelectMenu.js';
import { MentionableSelectMenuBuilder } from '../selectMenu/MentionableSelectMenu.js';
import { RoleSelectMenuBuilder } from '../selectMenu/RoleSelectMenu.js';
import { StringSelectMenuBuilder } from '../selectMenu/StringSelectMenu.js';
import { UserSelectMenuBuilder } from '../selectMenu/UserSelectMenu.js';
import { TextInputBuilder } from '../textInput/TextInput.js';
import { labelPredicate } from './Assertions.js';
export interface LabelBuilderData extends Partial<Omit<APILabelComponent, 'component'>> {
component?:
| ChannelSelectMenuBuilder
| MentionableSelectMenuBuilder
| RoleSelectMenuBuilder
| StringSelectMenuBuilder
| TextInputBuilder
| UserSelectMenuBuilder;
}
/**
* A builder that creates API-compatible JSON data for labels.
*/
export class LabelBuilder extends ComponentBuilder<LabelBuilderData> {
/**
* @internal
*/
public override readonly data: LabelBuilderData;
/**
* Creates a new label.
*
* @param data - The API data to create this label with
* @example
* Creating a label from an API data object:
* ```ts
* const label = new LabelBuilder({
* label: "label",
* component,
* });
* ```
* @example
* Creating a label using setters and API data:
* ```ts
* const label = new LabelBuilder({
* label: 'label',
* component,
* }).setLabel('new text');
* ```
*/
public constructor(data: Partial<APILabelComponent> = {}) {
super({ type: ComponentType.Label });
const { component, ...rest } = data;
this.data = {
...rest,
component: component ? createComponentBuilder(component) : undefined,
type: ComponentType.Label,
};
}
/**
* Sets the label for this label.
*
* @param label - The label to use
*/
public setLabel(label: string) {
this.data.label = label;
return this;
}
/**
* Sets the description for this label.
*
* @param description - The description to use
*/
public setDescription(description: string) {
this.data.description = description;
return this;
}
/**
* Clears the description for this label.
*/
public clearDescription() {
this.data.description = undefined;
return this;
}
/**
* Sets a string select menu component to this label.
*
* @param input - A function that returns a component builder or an already built builder
*/
public setStringSelectMenuComponent(
input:
| APIStringSelectComponent
| StringSelectMenuBuilder
| ((builder: StringSelectMenuBuilder) => StringSelectMenuBuilder),
): this {
this.data.component = resolveBuilder(input, StringSelectMenuBuilder);
return this;
}
/**
* Sets a user select menu component to this label.
*
* @param input - A function that returns a component builder or an already built builder
*/
public setUserSelectMenuComponent(
input: APIUserSelectComponent | UserSelectMenuBuilder | ((builder: UserSelectMenuBuilder) => UserSelectMenuBuilder),
): this {
this.data.component = resolveBuilder(input, UserSelectMenuBuilder);
return this;
}
/**
* Sets a role select menu component to this label.
*
* @param input - A function that returns a component builder or an already built builder
*/
public setRoleSelectMenuComponent(
input: APIRoleSelectComponent | RoleSelectMenuBuilder | ((builder: RoleSelectMenuBuilder) => RoleSelectMenuBuilder),
): this {
this.data.component = resolveBuilder(input, RoleSelectMenuBuilder);
return this;
}
/**
* Sets a mentionable select menu component to this label.
*
* @param input - A function that returns a component builder or an already built builder
*/
public setMentionableSelectMenuComponent(
input:
| APIMentionableSelectComponent
| MentionableSelectMenuBuilder
| ((builder: MentionableSelectMenuBuilder) => MentionableSelectMenuBuilder),
): this {
this.data.component = resolveBuilder(input, MentionableSelectMenuBuilder);
return this;
}
/**
* Sets a channel select menu component to this label.
*
* @param input - A function that returns a component builder or an already built builder
*/
public setChannelSelectMenuComponent(
input:
| APIChannelSelectComponent
| ChannelSelectMenuBuilder
| ((builder: ChannelSelectMenuBuilder) => ChannelSelectMenuBuilder),
): this {
this.data.component = resolveBuilder(input, ChannelSelectMenuBuilder);
return this;
}
/**
* Sets a text input component to this label.
*
* @param input - A function that returns a component builder or an already built builder
*/
public setTextInputComponent(
input: APITextInputComponent | TextInputBuilder | ((builder: TextInputBuilder) => TextInputBuilder),
): this {
this.data.component = resolveBuilder(input, TextInputBuilder);
return this;
}
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/
public override toJSON(): APILabelComponent {
const { component, ...rest } = this.data;
const data = {
...rest,
// The label predicate validates the component.
component: component?.toJSON(),
};
labelPredicate.parse(data);
return data as APILabelComponent;
}
}

View File

@@ -0,0 +1,92 @@
import { Result, s } from '@sapphire/shapeshift';
import { ChannelType, ComponentType, SelectMenuDefaultValueType } from 'discord-api-types/v10';
import { isValidationEnabled } from '../../util/validation.js';
import { customIdValidator, emojiValidator, idValidator } from '../Assertions.js';
import { labelValidator } from '../textInput/Assertions.js';
const selectMenuBasePredicate = s.object({
id: idValidator.optional(),
placeholder: s.string().lengthLessThanOrEqual(150).optional(),
min_values: s.number().greaterThanOrEqual(0).lessThanOrEqual(25).optional(),
max_values: s.number().greaterThanOrEqual(0).lessThanOrEqual(25).optional(),
custom_id: customIdValidator,
disabled: s.boolean().optional(),
});
export const selectMenuChannelPredicate = selectMenuBasePredicate
.extend({
type: s.literal(ComponentType.ChannelSelect),
channel_types: s.nativeEnum(ChannelType).array().optional(),
default_values: s
.object({ id: s.string(), type: s.literal(SelectMenuDefaultValueType.Channel) })
.array()
.lengthLessThanOrEqual(25)
.optional(),
})
.setValidationEnabled(isValidationEnabled);
export const selectMenuMentionablePredicate = selectMenuBasePredicate
.extend({
type: s.literal(ComponentType.MentionableSelect),
default_values: s
.object({
id: s.string(),
type: s.union([s.literal(SelectMenuDefaultValueType.Role), s.literal(SelectMenuDefaultValueType.User)]),
})
.array()
.lengthLessThanOrEqual(25)
.optional(),
})
.setValidationEnabled(isValidationEnabled);
export const selectMenuRolePredicate = selectMenuBasePredicate
.extend({
type: s.literal(ComponentType.RoleSelect),
default_values: s
.object({ id: s.string(), type: s.literal(SelectMenuDefaultValueType.Role) })
.array()
.lengthLessThanOrEqual(25)
.optional(),
})
.setValidationEnabled(isValidationEnabled);
export const selectMenuUserPredicate = selectMenuBasePredicate
.extend({
type: s.literal(ComponentType.UserSelect),
default_values: s
.object({ id: s.string(), type: s.literal(SelectMenuDefaultValueType.User) })
.array()
.lengthLessThanOrEqual(25)
.optional(),
})
.setValidationEnabled(isValidationEnabled);
export const selectMenuStringOptionPredicate = s
.object({
label: labelValidator,
value: s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100),
description: s.string().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(100).optional(),
emoji: emojiValidator.optional(),
default: s.boolean().optional(),
})
.setValidationEnabled(isValidationEnabled);
export const selectMenuStringPredicate = selectMenuBasePredicate
.extend({
type: s.literal(ComponentType.StringSelect),
options: selectMenuStringOptionPredicate.array().lengthGreaterThanOrEqual(1).lengthLessThanOrEqual(25),
})
.reshape((value) => {
if (value.min_values !== undefined && value.options.length < value.min_values) {
return Result.err(new RangeError(`The number of options must be greater than or equal to min_values`));
}
if (value.min_values !== undefined && value.max_values !== undefined && value.min_values > value.max_values) {
return Result.err(
new RangeError(`The maximum amount of options must be greater than or equal to the minimum amount of options`),
);
}
return Result.ok(value);
})
.setValidationEnabled(isValidationEnabled);

View File

@@ -1,6 +1,7 @@
import type { APISelectMenuComponent } from 'discord-api-types/v10';
import { customIdValidator, disabledValidator, minMaxValidator, placeholderValidator } from '../Assertions.js';
import { ComponentBuilder } from '../Component.js';
import { requiredValidator } from '../textInput/Assertions.js';
/**
* The base select menu builder that contains common symbols for select menu builders.
@@ -60,6 +61,17 @@ export abstract class BaseSelectMenuBuilder<
return this;
}
/**
* Sets whether this select menu is required.
*
* @remarks Only for use in modals.
* @param required - Whether this select menu is required
*/
public setRequired(required = true) {
this.data.required = requiredValidator.parse(required);
return this;
}
/**
* {@inheritDoc ComponentBuilder.toJSON}
*/

View File

@@ -1,9 +1,9 @@
import { s } from '@sapphire/shapeshift';
import { TextInputStyle } from 'discord-api-types/v10';
import { ComponentType, TextInputStyle } from 'discord-api-types/v10';
import { isValidationEnabled } from '../../util/validation.js';
import { customIdValidator } from '../Assertions.js';
import { customIdValidator, idValidator } from '../Assertions.js';
export const textInputStyleValidator = s.nativeEnum(TextInputStyle);
export const textInputStyleValidator = s.nativeEnum(TextInputStyle).setValidationEnabled(isValidationEnabled);
export const minLengthValidator = s
.number()
.int()
@@ -16,7 +16,7 @@ export const maxLengthValidator = s
.greaterThanOrEqual(1)
.lessThanOrEqual(4_000)
.setValidationEnabled(isValidationEnabled);
export const requiredValidator = s.boolean();
export const requiredValidator = s.boolean().setValidationEnabled(isValidationEnabled);
export const valueValidator = s.string().lengthLessThanOrEqual(4_000).setValidationEnabled(isValidationEnabled);
export const placeholderValidator = s.string().lengthLessThanOrEqual(100).setValidationEnabled(isValidationEnabled);
export const labelValidator = s
@@ -25,8 +25,21 @@ export const labelValidator = s
.lengthLessThanOrEqual(45)
.setValidationEnabled(isValidationEnabled);
export function validateRequiredParameters(customId?: string, style?: TextInputStyle, label?: string) {
export const textInputPredicate = s
.object({
type: s.literal(ComponentType.TextInput),
custom_id: customIdValidator,
style: textInputStyleValidator,
id: idValidator.optional(),
min_length: minLengthValidator.optional(),
max_length: maxLengthValidator.optional(),
placeholder: placeholderValidator.optional(),
value: valueValidator.optional(),
required: requiredValidator.optional(),
})
.setValidationEnabled(isValidationEnabled);
export function validateRequiredParameters(customId?: string, style?: TextInputStyle) {
customIdValidator.parse(customId);
textInputStyleValidator.parse(style);
labelValidator.parse(label);
}

View File

@@ -30,7 +30,7 @@ export class TextInputBuilder
* ```ts
* const textInput = new TextInputBuilder({
* custom_id: 'a cool text input',
* label: 'Type something',
* placeholder: 'Type something',
* style: TextInputStyle.Short,
* });
* ```
@@ -38,7 +38,7 @@ export class TextInputBuilder
* Creating a text input using setters and API data:
* ```ts
* const textInput = new TextInputBuilder({
* label: 'Type something else',
* placeholder: 'Type something else',
* })
* .setCustomId('woah')
* .setStyle(TextInputStyle.Paragraph);
@@ -62,6 +62,7 @@ export class TextInputBuilder
* Sets the label for this text input.
*
* @param label - The label to use
* @deprecated Use a label builder to create a label (and optionally a description) instead.
*/
public setLabel(label: string) {
this.data.label = labelValidator.parse(label);
@@ -132,7 +133,7 @@ export class TextInputBuilder
* {@inheritDoc ComponentBuilder.toJSON}
*/
public toJSON(): APITextInputComponent {
validateRequiredParameters(this.data.custom_id, this.data.style, this.data.label);
validateRequiredParameters(this.data.custom_id, this.data.style);
return {
...this.data,

View File

@@ -57,7 +57,7 @@ export function assertReturnOfBuilder<ReturnType extends MediaGalleryItemBuilder
input: unknown,
ExpectedInstanceOf: new () => ReturnType,
): asserts input is ReturnType {
s.instance(ExpectedInstanceOf).parse(input);
s.instance(ExpectedInstanceOf).setValidationEnabled(isValidationEnabled).parse(input);
}
export function validateComponentArray<
@@ -67,5 +67,6 @@ export function validateComponentArray<
.array()
.lengthGreaterThanOrEqual(min)
.lengthLessThanOrEqual(max)
.setValidationEnabled(isValidationEnabled)
.parse(input);
}

View File

@@ -19,7 +19,7 @@ import type { AnyComponentBuilder, MessageActionRowComponentBuilder } from '../A
import { ActionRowBuilder } from '../ActionRow.js';
import { ComponentBuilder } from '../Component.js';
import { createComponentBuilder, resolveBuilder } from '../Components.js';
import { containerColorPredicate, spoilerPredicate, validateComponentArray } from './Assertions.js';
import { containerColorPredicate, spoilerPredicate } from './Assertions.js';
import { FileBuilder } from './File.js';
import { SeparatorBuilder } from './Separator.js';
import { TextDisplayBuilder } from './TextDisplay.js';
@@ -231,7 +231,6 @@ export class ContainerBuilder extends ComponentBuilder<APIContainerComponent> {
* {@inheritDoc ComponentBuilder.toJSON}
*/
public toJSON(): APIContainerComponent {
validateComponentArray(this.components, 1, 10);
return {
...this.data,
components: this.components.map((component) => component.toJSON()),

View File

@@ -11,7 +11,7 @@ export class ThumbnailBuilder extends ComponentBuilder<APIThumbnailComponent> {
* @example
* Creating a thumbnail from an API data object:
* ```ts
* const thumbnaik = new ThumbnailBuilder({
* const thumbnail = new ThumbnailBuilder({
* description: 'some text',
* media: {
* url: 'https://cdn.discordapp.com/embed/avatars/4.png',

View File

@@ -34,6 +34,9 @@ export {
export * from './components/selectMenu/StringSelectMenuOption.js';
export * from './components/selectMenu/UserSelectMenu.js';
export * from './components/label/Label.js';
export * as LabelAssertions from './components/label/Assertions.js';
export * as ComponentsV2Assertions from './components/v2/Assertions.js';
export * from './components/v2/Container.js';
export * from './components/v2/File.js';

View File

@@ -7,8 +7,7 @@ const namePredicate = s
.string()
.lengthGreaterThanOrEqual(1)
.lengthLessThanOrEqual(32)
// eslint-disable-next-line prefer-named-capture-group
.regex(/^( *[\p{P}\p{L}\p{N}\p{sc=Devanagari}\p{sc=Thai}]+ *)+$/u)
.regex(/\S/)
.setValidationEnabled(isValidationEnabled);
const typePredicate = s
.union([s.literal(ApplicationCommandType.User), s.literal(ApplicationCommandType.Message)])

View File

@@ -1,6 +1,8 @@
import { s } from '@sapphire/shapeshift';
import { ActionRowBuilder, type ModalActionRowComponentBuilder } from '../../components/ActionRow.js';
import { customIdValidator } from '../../components/Assertions.js';
import { LabelBuilder } from '../../components/label/Label.js';
import { TextDisplayBuilder } from '../../components/v2/TextDisplay.js';
import { isValidationEnabled } from '../../util/validation.js';
export const titleValidator = s
@@ -9,7 +11,7 @@ export const titleValidator = s
.lengthLessThanOrEqual(45)
.setValidationEnabled(isValidationEnabled);
export const componentsValidator = s
.instance(ActionRowBuilder)
.union([s.instance(ActionRowBuilder), s.instance(LabelBuilder), s.instance(TextDisplayBuilder)])
.array()
.lengthGreaterThanOrEqual(1)
.setValidationEnabled(isValidationEnabled);
@@ -17,7 +19,7 @@ export const componentsValidator = s
export function validateRequiredParameters(
customId?: string,
title?: string,
components?: ActionRowBuilder<ModalActionRowComponentBuilder>[],
components?: (ActionRowBuilder<ModalActionRowComponentBuilder> | LabelBuilder | TextDisplayBuilder)[],
) {
customIdValidator.parse(customId);
titleValidator.parse(title);

View File

@@ -2,13 +2,20 @@
import type { JSONEncodable } from '@discordjs/util';
import type {
APITextInputComponent,
APIActionRowComponent,
APIComponentInModalActionRow,
APILabelComponent,
APIModalInteractionResponseCallbackData,
APITextDisplayComponent,
} from 'discord-api-types/v10';
import { ComponentType } from 'discord-api-types/v10';
import { ActionRowBuilder, type ModalActionRowComponentBuilder } from '../../components/ActionRow.js';
import { customIdValidator } from '../../components/Assertions.js';
import { createComponentBuilder } from '../../components/Components.js';
import { createComponentBuilder, resolveBuilder } from '../../components/Components.js';
import { LabelBuilder } from '../../components/label/Label.js';
import { TextInputBuilder } from '../../components/textInput/TextInput.js';
import { TextDisplayBuilder } from '../../components/v2/TextDisplay.js';
import { normalizeArray, type RestOrArray } from '../../util/normalizeArray.js';
import { titleValidator, validateRequiredParameters } from './Assertions.js';
@@ -24,7 +31,8 @@ export class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCa
/**
* The components within this modal.
*/
public readonly components: ActionRowBuilder<ModalActionRowComponentBuilder>[] = [];
public readonly components: (ActionRowBuilder<ModalActionRowComponentBuilder> | LabelBuilder | TextDisplayBuilder)[] =
[];
/**
* Creates a new modal from API data.
@@ -33,8 +41,10 @@ export class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCa
*/
public constructor({ components, ...data }: Partial<APIModalInteractionResponseCallbackData> = {}) {
this.data = { ...data };
this.components = (components?.map((component) => createComponentBuilder(component)) ??
[]) as ActionRowBuilder<ModalActionRowComponentBuilder>[];
this.components = (components?.map((component) => createComponentBuilder(component)) ?? []) as (
| ActionRowBuilder<ModalActionRowComponentBuilder>
| LabelBuilder
)[];
}
/**
@@ -61,28 +71,182 @@ export class ModalBuilder implements JSONEncodable<APIModalInteractionResponseCa
* Adds components to this modal.
*
* @param components - The components to add
* @deprecated Use {@link ModalBuilder.addLabelComponents} or {@link ModalBuilder.addTextDisplayComponents} instead
*/
public addComponents(
...components: RestOrArray<
ActionRowBuilder<ModalActionRowComponentBuilder> | APIActionRowComponent<APIComponentInModalActionRow>
| ActionRowBuilder<ModalActionRowComponentBuilder>
| APIActionRowComponent<APIComponentInModalActionRow>
| APILabelComponent
| APITextDisplayComponent
| APITextInputComponent
| LabelBuilder
| TextDisplayBuilder
| TextInputBuilder
>
) {
this.components.push(
...normalizeArray(components).map((component) =>
component instanceof ActionRowBuilder
? component
: new ActionRowBuilder<ModalActionRowComponentBuilder>(component),
),
...normalizeArray(components).map((component, idx) => {
if (
component instanceof ActionRowBuilder ||
component instanceof LabelBuilder ||
component instanceof TextDisplayBuilder
) {
return component;
}
// Deprecated support
if (component instanceof TextInputBuilder) {
return new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(component);
}
if ('type' in component) {
if (component.type === ComponentType.ActionRow) {
return new ActionRowBuilder<ModalActionRowComponentBuilder>(component);
}
if (component.type === ComponentType.Label) {
return new LabelBuilder(component);
}
if (component.type === ComponentType.TextDisplay) {
return new TextDisplayBuilder(component);
}
// Deprecated, should go in a label component
if (component.type === ComponentType.TextInput) {
return new ActionRowBuilder<ModalActionRowComponentBuilder>().addComponents(
new TextInputBuilder(component),
);
}
}
throw new TypeError(`Invalid component passed in ModalBuilder.addComponents at index ${idx}!`);
}),
);
return this;
}
/**
* Adds label components to this modal.
*
* @param components - The components to add
*/
public addLabelComponents(
...components: RestOrArray<APILabelComponent | LabelBuilder | ((builder: LabelBuilder) => LabelBuilder)>
) {
const normalized = normalizeArray(components);
const resolved = normalized.map((label) => resolveBuilder(label, LabelBuilder));
this.components.push(...resolved);
return this;
}
/**
* Adds text display components to this modal.
*
* @param components - The components to add
*/
public addTextDisplayComponents(
...components: RestOrArray<
APITextDisplayComponent | TextDisplayBuilder | ((builder: TextDisplayBuilder) => TextDisplayBuilder)
>
) {
const normalized = normalizeArray(components);
const resolved = normalized.map((row) => resolveBuilder(row, TextDisplayBuilder));
this.components.push(...resolved);
return this;
}
/**
* Adds action rows to this modal.
*
* @param components - The components to add
* @deprecated Use {@link ModalBuilder.addLabelComponents} instead
*/
public addActionRowComponents(
...components: RestOrArray<
| ActionRowBuilder<ModalActionRowComponentBuilder>
| APIActionRowComponent<APIComponentInModalActionRow>
| ((
builder: ActionRowBuilder<ModalActionRowComponentBuilder>,
) => ActionRowBuilder<ModalActionRowComponentBuilder>)
>
) {
const normalized = normalizeArray(components);
const resolved = normalized.map((row) => resolveBuilder(row, ActionRowBuilder<ModalActionRowComponentBuilder>));
this.components.push(...resolved);
return this;
}
/**
* Sets the labels for this modal.
*
* @param components - The components to set
*/
public setLabelComponents(
...components: RestOrArray<APILabelComponent | LabelBuilder | ((builder: LabelBuilder) => LabelBuilder)>
) {
const normalized = normalizeArray(components);
this.spliceLabelComponents(0, this.components.length, ...normalized);
return this;
}
/**
* Removes, replaces, or inserts labels for this modal.
*
* @remarks
* This method behaves similarly
* to {@link https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/splice | Array.prototype.splice()}.
* The maximum amount of labels that can be added is 5.
*
* It's useful for modifying and adjusting order of the already-existing labels of a modal.
* @example
* Remove the first label:
* ```ts
* modal.spliceLabelComponents(0, 1);
* ```
* @example
* Remove the first n labels:
* ```ts
* const n = 4;
* modal.spliceLabelComponents(0, n);
* ```
* @example
* Remove the last label:
* ```ts
* modal.spliceLabelComponents(-1, 1);
* ```
* @param index - The index to start at
* @param deleteCount - The number of labels to remove
* @param labels - The replacing label objects
*/
public spliceLabelComponents(
index: number,
deleteCount: number,
...labels: (APILabelComponent | LabelBuilder | ((builder: LabelBuilder) => LabelBuilder))[]
): this {
const resolved = labels.map((label) => resolveBuilder(label, LabelBuilder));
this.components.splice(index, deleteCount, ...resolved);
return this;
}
/**
* Sets components for this modal.
*
* @param components - The components to set
* @deprecated Use {@link ModalBuilder.setLabelComponents} instead
*/
public setComponents(...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder>>) {
public setComponents(
...components: RestOrArray<ActionRowBuilder<ModalActionRowComponentBuilder> | LabelBuilder | TextDisplayBuilder>
) {
this.components.splice(0, this.components.length, ...normalizeArray(components));
return this;
}

View File

@@ -314,8 +314,9 @@ export class ActionRowBuilder<
>,
);
public static from<ComponentType extends AnyComponentBuilder = AnyComponentBuilder>(
other:
| JSONEncodable<APIActionRowComponent<ReturnType<ComponentType['toJSON']>>>
other: // @ts-expect-error builders/1.x.
| JSONEncodable<APIActionRowComponent<ReturnType<ComponentType['toJSON']>>>
// @ts-expect-error builders/1.x.
| APIActionRowComponent<ReturnType<ComponentType['toJSON']>>,
): ActionRowBuilder<ComponentType>;
}
@@ -6461,6 +6462,7 @@ export interface BaseMessageOptions {
)[];
components?: readonly (
| JSONEncodable<APIActionRowComponent<APIComponentInMessageActionRow>>
// @ts-expect-error builders/1.x.
| ActionRowData<MessageActionRowComponentData | MessageActionRowComponentBuilder>
| APIActionRowComponent<APIComponentInMessageActionRow>
)[];

File diff suppressed because it is too large Load Diff

View File

@@ -55,7 +55,7 @@
"homepage": "https://discord.js.org",
"funding": "https://github.com/discordjs/discord.js?sponsor",
"dependencies": {
"discord-api-types": "^0.38.1"
"discord-api-types": "^0.38.16"
},
"devDependencies": {
"@discordjs/api-extractor": "workspace:^",

View File

@@ -39,6 +39,7 @@ import {
} from '@discordjs/api-extractor-model';
import { DocNodeKind, SelectorKind, StandardTags } from '@microsoft/tsdoc';
import type {
DocEscapedText,
DocNode,
DocNodeContainer,
DocDeclarationReference,
@@ -307,6 +308,11 @@ function itemTsDoc(item: DocNode, apiItem: ApiItem) {
kind: DocNodeKind.PlainText,
text: (node as DocPlainText).text,
};
case DocNodeKind.EscapedText:
return {
kind: DocNodeKind.PlainText,
text: (node as DocEscapedText).decodedText,
};
case DocNodeKind.Section:
case DocNodeKind.Paragraph:
return (node as DocNodeContainer).nodes.map((node) => createNode(node));

305
pnpm-lock.yaml generated
View File

@@ -680,8 +680,8 @@ importers:
specifier: ^4.0.0
version: 4.0.0
discord-api-types:
specifier: ^0.38.1
version: 0.38.1
specifier: ^0.38.26
version: 0.38.26
fast-deep-equal:
specifier: ^3.1.3
version: 3.1.3
@@ -1060,8 +1060,8 @@ importers:
packages/formatters:
dependencies:
discord-api-types:
specifier: ^0.38.1
version: 0.38.1
specifier: ^0.38.16
version: 0.38.16
devDependencies:
'@discordjs/api-extractor':
specifier: workspace:^
@@ -2601,12 +2601,12 @@ packages:
resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
engines: {node: '>=12'}
'@definitelytyped/header-parser@0.2.19':
resolution: {integrity: sha512-zu+RxQpUCgorYUQZoyyrRIn9CljL1CeM4qak3NDeMO1r7tjAkodfpAGnVzx/6JR2OUk0tAgwmZxNMSwd9LVgxw==}
'@definitelytyped/header-parser@0.2.20':
resolution: {integrity: sha512-97YPAlUo8XjWNtZ+6k+My+50/ljE2iX6KEPjOZ1Az1RsZdKwJ6taAX3F5g6SY1SJr50bzdm2RZzyQNdRmHcs4w==}
engines: {node: '>=18.18.0'}
'@definitelytyped/typescript-versions@0.1.8':
resolution: {integrity: sha512-iz6q9aTwWW7CzN2g8jFQfZ955D63LA+wdIAKz4+2pCc/7kokmEHie1/jVWSczqLFOlmH+69bWQxIurryBP/sig==}
'@definitelytyped/typescript-versions@0.1.9':
resolution: {integrity: sha512-Qjalw9eNlcTjXhzx0Q6kHKuRCOUt/M5RGGRGKsiYlm/nveGvPX9liZSQlGXZVwyQ5I9qvq/GdaWiPchQ+ZXOrQ==}
engines: {node: '>=18.18.0'}
'@definitelytyped/utils@0.1.8':
@@ -7490,6 +7490,15 @@ packages:
supports-color:
optional: true
debug@4.4.3:
resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==}
engines: {node: '>=6.0'}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
decamelize-keys@1.1.1:
resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==}
engines: {node: '>=0.10.0'}
@@ -7641,6 +7650,12 @@ packages:
discord-api-types@0.38.1:
resolution: {integrity: sha512-vsjsqjAuxsPhiwbPjTBeGQaDPlizFmSkU0mTzFGMgRxqCDIRBR7iTY74HacpzrDV0QtERHRKQEk1tq7drZUtHg==}
discord-api-types@0.38.16:
resolution: {integrity: sha512-Cz42dC5WqJD17Yk0bRy7YLTJmh3NKo4FGpxZuA8MHqT0RPxKSrll5YhlODZ2z5DiEV/gpHMeTSrTFTWpSXjT1Q==}
discord-api-types@0.38.26:
resolution: {integrity: sha512-xpmPviHjIJ6dFu1eNwNDIGQ3N6qmPUUYFVAx/YZ64h7ZgPkTcKjnciD8bZe8Vbeji7yS5uYljyciunpq0J5NSw==}
dlv@1.1.3:
resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==}
@@ -8653,8 +8668,8 @@ packages:
resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==}
engines: {node: '>= 0.4'}
get-tsconfig@4.10.0:
resolution: {integrity: sha512-kGzZ3LWWQcGIAmg6iWvXn0ei6WDtV26wzHRMwDSzmAbcXrTEXxHy6IehI6/4eT6VRKyMP1eF1VqwrVUmE/LR7A==}
get-tsconfig@4.10.1:
resolution: {integrity: sha512-auHyJ4AgMz7vgS8Hp3N6HXSmlMdUyhSUrfBF16w153rxtLIEOE+HGqaBppczZvnHLqQJfiHotCYpNhl0lUROFQ==}
get-tsconfig@4.7.6:
resolution: {integrity: sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==}
@@ -11431,6 +11446,11 @@ packages:
engines: {node: '>=14'}
hasBin: true
prettier@3.6.2:
resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==}
engines: {node: '>=14'}
hasBin: true
pretty-format@24.9.0:
resolution: {integrity: sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==}
engines: {node: '>= 6'}
@@ -12075,6 +12095,11 @@ packages:
engines: {node: '>=10'}
hasBin: true
semver@7.7.2:
resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==}
engines: {node: '>=10'}
hasBin: true
send@0.18.0:
resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==}
engines: {node: '>= 0.8.0'}
@@ -12814,6 +12839,9 @@ packages:
tslib@2.6.3:
resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==}
tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
tslint@5.14.0:
resolution: {integrity: sha512-IUla/ieHVnB8Le7LdQFRGlVJid2T/gaJe5VkjzRVSRR6pA2ODYrnfR1hmxi+5+au9l50jBwpbBL34txgv4NnTQ==}
engines: {node: '>=4.8.0'}
@@ -14683,7 +14711,7 @@ snapshots:
'@commitlint/is-ignored@19.2.2':
dependencies:
'@commitlint/types': 19.0.3
semver: 7.6.3
semver: 7.7.2
'@commitlint/lint@19.2.2':
dependencies:
@@ -14852,13 +14880,13 @@ snapshots:
dependencies:
'@jridgewell/trace-mapping': 0.3.9
'@definitelytyped/header-parser@0.2.19':
'@definitelytyped/header-parser@0.2.20':
dependencies:
'@definitelytyped/typescript-versions': 0.1.8
'@definitelytyped/typescript-versions': 0.1.9
'@definitelytyped/utils': 0.1.8
semver: 7.6.3
semver: 7.7.2
'@definitelytyped/typescript-versions@0.1.8': {}
'@definitelytyped/typescript-versions@0.1.9': {}
'@definitelytyped/utils@0.1.8':
dependencies:
@@ -14884,7 +14912,7 @@ snapshots:
'@vladfrangu/async_event_emitter': 2.4.6
discord-api-types: 0.37.83
magic-bytes.js: 1.10.0
tslib: 2.6.3
tslib: 2.8.1
undici: 6.13.0
'@discordjs/util@1.1.0': {}
@@ -14898,7 +14926,7 @@ snapshots:
'@types/ws': 8.5.12
'@vladfrangu/async_event_emitter': 2.4.6
discord-api-types: 0.37.83
tslib: 2.6.3
tslib: 2.8.1
ws: 8.18.0(bufferutil@4.0.8)(utf-8-validate@6.0.4)
transitivePeerDependencies:
- bufferutil
@@ -14949,7 +14977,7 @@ snapshots:
'@emnapi/runtime@1.2.0':
dependencies:
tslib: 2.6.3
tslib: 2.8.1
optional: true
'@emotion/use-insertion-effect-with-fallbacks@1.1.0(react@18.3.1)':
@@ -14965,7 +14993,7 @@ snapshots:
'@esbuild-plugins/node-resolve@0.1.4(esbuild@0.18.20)':
dependencies:
'@types/resolve': 1.20.6
debug: 4.4.0
debug: 4.4.3
esbuild: 0.18.20
escape-string-regexp: 4.0.0
resolve: 1.22.10
@@ -15261,26 +15289,26 @@ snapshots:
'@formatjs/ecma402-abstract@2.0.0':
dependencies:
'@formatjs/intl-localematcher': 0.5.4
tslib: 2.6.3
tslib: 2.8.1
'@formatjs/fast-memoize@2.2.0':
dependencies:
tslib: 2.6.3
tslib: 2.8.1
'@formatjs/icu-messageformat-parser@2.7.8':
dependencies:
'@formatjs/ecma402-abstract': 2.0.0
'@formatjs/icu-skeleton-parser': 1.8.2
tslib: 2.6.3
tslib: 2.8.1
'@formatjs/icu-skeleton-parser@1.8.2':
dependencies:
'@formatjs/ecma402-abstract': 2.0.0
tslib: 2.6.3
tslib: 2.8.1
'@formatjs/intl-localematcher@0.5.4':
dependencies:
tslib: 2.6.3
tslib: 2.8.1
'@grpc/grpc-js@1.11.1':
dependencies:
@@ -15451,14 +15479,14 @@ snapshots:
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 18.19.45
'@types/node': 18.19.74
ansi-escapes: 4.3.2
chalk: 4.1.2
ci-info: 3.9.0
exit: 0.1.2
graceful-fs: 4.2.11
jest-changed-files: 29.7.0
jest-config: 29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@16.18.105)(typescript@5.5.4))
jest-config: 29.7.0(@types/node@18.19.74)(ts-node@10.9.2(@types/node@16.18.105)(typescript@5.5.4))
jest-haste-map: 29.7.0
jest-message-util: 29.7.0
jest-regex-util: 29.6.3
@@ -15486,14 +15514,14 @@ snapshots:
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 18.19.45
'@types/node': 18.19.74
ansi-escapes: 4.3.2
chalk: 4.1.2
ci-info: 3.9.0
exit: 0.1.2
graceful-fs: 4.2.11
jest-changed-files: 29.7.0
jest-config: 29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4))
jest-config: 29.7.0(@types/node@18.19.74)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4))
jest-haste-map: 29.7.0
jest-message-util: 29.7.0
jest-regex-util: 29.6.3
@@ -15634,7 +15662,7 @@ snapshots:
'@jest/schemas': 29.6.3
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports': 3.0.4
'@types/node': 18.19.45
'@types/node': 18.19.74
'@types/yargs': 17.0.33
chalk: 4.1.2
@@ -15680,7 +15708,7 @@ snapshots:
'@js-temporal/polyfill@0.4.4':
dependencies:
jsbi: 4.3.0
tslib: 2.6.3
tslib: 2.8.1
'@jsdoc/salty@0.2.8':
dependencies:
@@ -18429,7 +18457,7 @@ snapshots:
globby: 14.0.2
jscodeshift: 0.15.2(@babel/preset-env@7.25.4(@babel/core@7.25.2))
lodash: 4.17.21
prettier: 3.3.3
prettier: 3.6.2
recast: 0.23.9
tiny-invariant: 1.3.3
transitivePeerDependencies:
@@ -18465,7 +18493,7 @@ snapshots:
'@storybook/node-logger': 7.6.20
'@storybook/types': 7.6.20
'@types/find-cache-dir': 3.2.1
'@types/node': 18.19.45
'@types/node': 18.19.74
'@types/node-fetch': 2.6.11
'@types/pretty-hrtime': 1.0.3
chalk: 4.1.2
@@ -18500,7 +18528,7 @@ snapshots:
dependencies:
'@storybook/csf': 0.1.11
'@types/express': 4.17.21
'@types/node': 18.19.45
'@types/node': 18.19.74
browser-assert: 1.2.1
esbuild: 0.21.5
esbuild-register: 3.6.0(esbuild@0.21.5)
@@ -18642,7 +18670,7 @@ snapshots:
'@storybook/theming': 8.2.9(storybook@8.2.9(@babel/preset-env@7.25.4(@babel/core@7.25.2))(bufferutil@4.0.8)(utf-8-validate@6.0.4))
'@types/escodegen': 0.0.6
'@types/estree': 0.0.51
'@types/node': 18.19.45
'@types/node': 18.19.74
acorn: 7.4.1
acorn-jsx: 5.3.2(acorn@7.4.1)
acorn-walk: 7.2.0
@@ -18737,16 +18765,16 @@ snapshots:
'@swc/helpers@0.5.11':
dependencies:
tslib: 2.6.3
tslib: 2.8.1
'@swc/helpers@0.5.12':
dependencies:
tslib: 2.6.3
tslib: 2.8.1
'@swc/helpers@0.5.5':
dependencies:
'@swc/counter': 0.1.3
tslib: 2.6.3
tslib: 2.8.1
'@tailwindcss/typography@0.5.14(tailwindcss@3.4.10(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4)))':
dependencies:
@@ -19113,7 +19141,7 @@ snapshots:
'@types/prompts@2.4.9':
dependencies:
'@types/node': 18.19.45
'@types/node': 18.19.74
kleur: 3.0.3
'@types/prop-types@15.7.12': {}
@@ -19152,7 +19180,7 @@ snapshots:
dependencies:
'@types/cookiejar': 2.1.5
'@types/methods': 1.1.4
'@types/node': 18.19.45
'@types/node': 18.19.74
form-data: 4.0.0
'@types/supertest@6.0.2':
@@ -19178,7 +19206,7 @@ snapshots:
'@types/ws@8.5.12':
dependencies:
'@types/node': 16.18.105
'@types/node': 18.19.74
'@types/yargs-parser@21.0.3': {}
@@ -19328,7 +19356,7 @@ snapshots:
dependencies:
'@typescript-eslint/types': 5.62.0
'@typescript-eslint/visitor-keys': 5.62.0
debug: 4.4.0
debug: 4.4.3
globby: 11.1.0
is-glob: 4.0.3
semver: 7.5.4
@@ -19342,11 +19370,11 @@ snapshots:
dependencies:
'@typescript-eslint/types': 7.11.0
'@typescript-eslint/visitor-keys': 7.11.0
debug: 4.4.0
debug: 4.4.3
globby: 11.1.0
is-glob: 4.0.3
minimatch: 9.0.5
semver: 7.6.3
semver: 7.7.2
ts-api-utils: 1.3.0(typescript@5.5.4)
optionalDependencies:
typescript: 5.5.4
@@ -20087,7 +20115,7 @@ snapshots:
agent-base@6.0.2:
dependencies:
debug: 4.4.0
debug: 4.4.3
transitivePeerDependencies:
- supports-color
@@ -20211,7 +20239,7 @@ snapshots:
aria-hidden@1.2.4:
dependencies:
tslib: 2.6.3
tslib: 2.8.1
aria-query@5.1.3:
dependencies:
@@ -20339,11 +20367,11 @@ snapshots:
ast-types@0.13.4:
dependencies:
tslib: 2.6.3
tslib: 2.8.1
ast-types@0.16.1:
dependencies:
tslib: 2.6.3
tslib: 2.8.1
astring@1.8.6: {}
@@ -20678,7 +20706,7 @@ snapshots:
camel-case@4.1.2:
dependencies:
pascal-case: 3.1.2
tslib: 2.6.3
tslib: 2.8.1
camelcase-css@2.0.1: {}
@@ -21381,6 +21409,10 @@ snapshots:
dependencies:
ms: 2.1.3
debug@4.4.3:
dependencies:
ms: 2.1.3
decamelize-keys@1.1.1:
dependencies:
decamelize: 1.2.0
@@ -21517,6 +21549,10 @@ snapshots:
discord-api-types@0.38.1: {}
discord-api-types@0.38.16: {}
discord-api-types@0.38.26: {}
dlv@1.1.3: {}
dmd@6.2.3:
@@ -21566,7 +21602,7 @@ snapshots:
dts-critic@3.3.11(typescript@5.5.4):
dependencies:
'@definitelytyped/header-parser': 0.2.19
'@definitelytyped/header-parser': 0.2.20
command-exists: 1.2.9
rimraf: 3.0.2
semver: 6.3.1
@@ -21576,8 +21612,8 @@ snapshots:
dtslint@4.2.1(typescript@5.5.4):
dependencies:
'@definitelytyped/header-parser': 0.2.19
'@definitelytyped/typescript-versions': 0.1.8
'@definitelytyped/header-parser': 0.2.20
'@definitelytyped/typescript-versions': 0.1.9
'@definitelytyped/utils': 0.1.8
dts-critic: 3.3.11(typescript@5.5.4)
fs-extra: 6.0.1
@@ -22100,7 +22136,7 @@ snapshots:
remark-parse: 11.0.0
remark-stringify: 11.0.0
synckit: 0.9.1
tslib: 2.6.3
tslib: 2.8.1
unified: 11.0.5
unified-engine: 11.2.1
unist-util-visit: 5.0.0
@@ -22159,12 +22195,12 @@ snapshots:
eslint-plugin-i@2.29.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0):
dependencies:
debug: 4.4.0
debug: 4.4.3
doctrine: 3.0.0
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint-plugin-i@2.29.1)(eslint@8.57.0))(eslint@8.57.0)
get-tsconfig: 4.10.0
get-tsconfig: 4.10.1
is-glob: 4.0.3
minimatch: 3.1.2
semver: 7.5.4
@@ -22226,7 +22262,7 @@ snapshots:
remark-mdx: 3.0.1
remark-parse: 11.0.0
remark-stringify: 11.0.0
tslib: 2.6.3
tslib: 2.8.1
unified: 11.0.5
vfile: 6.0.2
transitivePeerDependencies:
@@ -22285,7 +22321,7 @@ snapshots:
eslint: 8.57.0
eslint-etc: 5.2.1(eslint@8.57.0)(typescript@5.5.4)
requireindex: 1.2.0
tslib: 2.6.3
tslib: 2.8.1
typescript: 5.5.4
transitivePeerDependencies:
- supports-color
@@ -22299,7 +22335,7 @@ snapshots:
eslint-etc: 5.2.1(eslint@8.57.0)(typescript@5.5.4)
requireindex: 1.2.0
rxjs-report-usage: 1.0.6
tslib: 2.6.3
tslib: 2.8.1
tsutils: 3.21.0(typescript@5.5.4)
tsutils-etc: 1.4.2(tsutils@3.21.0(typescript@5.5.4))(typescript@5.5.4)
typescript: 5.5.4
@@ -22960,7 +22996,7 @@ snapshots:
es-errors: 1.3.0
get-intrinsic: 1.2.4
get-tsconfig@4.10.0:
get-tsconfig@4.10.1:
dependencies:
resolve-pkg-maps: 1.0.0
@@ -22972,7 +23008,7 @@ snapshots:
dependencies:
basic-ftp: 5.0.5
data-uri-to-buffer: 6.0.2
debug: 4.4.0
debug: 4.4.3
fs-extra: 11.2.0
transitivePeerDependencies:
- supports-color
@@ -23432,7 +23468,7 @@ snapshots:
dependencies:
'@tootallnate/once': 2.0.0
agent-base: 6.0.2
debug: 4.4.0
debug: 4.4.3
transitivePeerDependencies:
- supports-color
@@ -23452,7 +23488,7 @@ snapshots:
https-proxy-agent@5.0.1:
dependencies:
agent-base: 6.0.2
debug: 4.4.0
debug: 4.4.3
transitivePeerDependencies:
- supports-color
@@ -23582,7 +23618,7 @@ snapshots:
'@formatjs/ecma402-abstract': 2.0.0
'@formatjs/fast-memoize': 2.2.0
'@formatjs/icu-messageformat-parser': 2.7.8
tslib: 2.6.3
tslib: 2.8.1
invariant@2.2.4:
dependencies:
@@ -23870,7 +23906,7 @@ snapshots:
istanbul-lib-source-maps@4.0.1:
dependencies:
debug: 4.4.0
debug: 4.4.3
istanbul-lib-coverage: 3.2.2
source-map: 0.6.1
transitivePeerDependencies:
@@ -24010,37 +24046,6 @@ snapshots:
- babel-plugin-macros
- supports-color
jest-config@29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@16.18.105)(typescript@5.5.4)):
dependencies:
'@babel/core': 7.25.2
'@jest/test-sequencer': 29.7.0
'@jest/types': 29.6.3
babel-jest: 29.7.0(@babel/core@7.25.2)
chalk: 4.1.2
ci-info: 3.9.0
deepmerge: 4.3.1
glob: 7.2.3
graceful-fs: 4.2.11
jest-circus: 29.7.0
jest-environment-node: 29.7.0
jest-get-type: 29.6.3
jest-regex-util: 29.6.3
jest-resolve: 29.7.0
jest-runner: 29.7.0
jest-util: 29.7.0
jest-validate: 29.7.0
micromatch: 4.0.7
parse-json: 5.2.0
pretty-format: 29.7.0
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 18.19.45
ts-node: 10.9.2(@types/node@16.18.105)(typescript@5.5.4)
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
jest-config@29.7.0(@types/node@18.19.45)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4)):
dependencies:
'@babel/core': 7.25.2
@@ -24072,6 +24077,68 @@ snapshots:
- babel-plugin-macros
- supports-color
jest-config@29.7.0(@types/node@18.19.74)(ts-node@10.9.2(@types/node@16.18.105)(typescript@5.5.4)):
dependencies:
'@babel/core': 7.25.2
'@jest/test-sequencer': 29.7.0
'@jest/types': 29.6.3
babel-jest: 29.7.0(@babel/core@7.25.2)
chalk: 4.1.2
ci-info: 3.9.0
deepmerge: 4.3.1
glob: 7.2.3
graceful-fs: 4.2.11
jest-circus: 29.7.0
jest-environment-node: 29.7.0
jest-get-type: 29.6.3
jest-regex-util: 29.6.3
jest-resolve: 29.7.0
jest-runner: 29.7.0
jest-util: 29.7.0
jest-validate: 29.7.0
micromatch: 4.0.7
parse-json: 5.2.0
pretty-format: 29.7.0
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 18.19.74
ts-node: 10.9.2(@types/node@16.18.105)(typescript@5.5.4)
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
jest-config@29.7.0(@types/node@18.19.74)(ts-node@10.9.2(@types/node@18.19.45)(typescript@5.5.4)):
dependencies:
'@babel/core': 7.25.2
'@jest/test-sequencer': 29.7.0
'@jest/types': 29.6.3
babel-jest: 29.7.0(@babel/core@7.25.2)
chalk: 4.1.2
ci-info: 3.9.0
deepmerge: 4.3.1
glob: 7.2.3
graceful-fs: 4.2.11
jest-circus: 29.7.0
jest-environment-node: 29.7.0
jest-get-type: 29.6.3
jest-regex-util: 29.6.3
jest-resolve: 29.7.0
jest-runner: 29.7.0
jest-util: 29.7.0
jest-validate: 29.7.0
micromatch: 4.0.7
parse-json: 5.2.0
pretty-format: 29.7.0
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 18.19.74
ts-node: 10.9.2(@types/node@18.19.45)(typescript@5.5.4)
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
jest-diff@29.7.0:
dependencies:
chalk: 4.1.2
@@ -24694,7 +24761,7 @@ snapshots:
lower-case@2.0.2:
dependencies:
tslib: 2.6.3
tslib: 2.8.1
lru-cache@10.4.3: {}
@@ -25703,7 +25770,7 @@ snapshots:
micromark@2.11.4:
dependencies:
debug: 4.4.0
debug: 4.4.3
parse-entities: 2.0.0
transitivePeerDependencies:
- supports-color
@@ -25711,7 +25778,7 @@ snapshots:
micromark@3.2.0:
dependencies:
'@types/debug': 4.1.12
debug: 4.4.0
debug: 4.4.3
decode-named-character-reference: 1.0.2
micromark-core-commonmark: 1.1.0
micromark-factory-space: 1.1.0
@@ -25733,7 +25800,7 @@ snapshots:
micromark@4.0.0:
dependencies:
'@types/debug': 4.1.12
debug: 4.4.0
debug: 4.4.3
decode-named-character-reference: 1.0.2
devlop: 1.1.0
micromark-core-commonmark: 2.0.1
@@ -26001,7 +26068,7 @@ snapshots:
no-case@3.0.4:
dependencies:
lower-case: 2.0.2
tslib: 2.6.3
tslib: 2.8.1
node-dir@0.1.17:
dependencies:
@@ -26448,7 +26515,7 @@ snapshots:
pascal-case@3.1.2:
dependencies:
no-case: 3.0.4
tslib: 2.6.3
tslib: 2.8.1
path-browserify@1.0.1: {}
@@ -26687,6 +26754,8 @@ snapshots:
prettier@3.3.3: {}
prettier@3.6.2: {}
pretty-format@24.9.0:
dependencies:
'@jest/types': 24.9.0
@@ -26982,7 +27051,7 @@ snapshots:
dependencies:
react: 18.3.1
react-style-singleton: 2.2.1(@types/react@18.3.4)(react@18.3.1)
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
@@ -26990,7 +27059,7 @@ snapshots:
dependencies:
react: 19.0.0-rc-f994737d14-20240522
react-style-singleton: 2.2.1(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
@@ -26999,7 +27068,7 @@ snapshots:
react: 18.3.1
react-remove-scroll-bar: 2.3.6(@types/react@18.3.4)(react@18.3.1)
react-style-singleton: 2.2.1(@types/react@18.3.4)(react@18.3.1)
tslib: 2.6.3
tslib: 2.8.1
use-callback-ref: 1.3.2(@types/react@18.3.4)(react@18.3.1)
use-sidecar: 1.1.2(@types/react@18.3.4)(react@18.3.1)
optionalDependencies:
@@ -27010,7 +27079,7 @@ snapshots:
react: 19.0.0-rc-f994737d14-20240522
react-remove-scroll-bar: 2.3.6(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
react-style-singleton: 2.2.1(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
tslib: 2.6.3
tslib: 2.8.1
use-callback-ref: 1.3.2(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
use-sidecar: 1.1.2(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
optionalDependencies:
@@ -27021,7 +27090,7 @@ snapshots:
react: 19.0.0-rc-f994737d14-20240522
react-remove-scroll-bar: 2.3.6(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
react-style-singleton: 2.2.1(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
tslib: 2.6.3
tslib: 2.8.1
use-callback-ref: 1.3.2(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
use-sidecar: 1.1.2(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522)
optionalDependencies:
@@ -27059,7 +27128,7 @@ snapshots:
get-nonce: 1.0.1
invariant: 2.2.4
react: 18.3.1
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
@@ -27068,7 +27137,7 @@ snapshots:
get-nonce: 1.0.1
invariant: 2.2.4
react: 19.0.0-rc-f994737d14-20240522
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
@@ -27144,7 +27213,7 @@ snapshots:
esprima: 4.0.1
source-map: 0.6.1
tiny-invariant: 1.3.3
tslib: 2.6.3
tslib: 2.8.1
redent@3.0.0:
dependencies:
@@ -27519,7 +27588,7 @@ snapshots:
rxjs@7.8.1:
dependencies:
tslib: 2.6.3
tslib: 2.8.1
sade@1.8.1:
dependencies:
@@ -27587,6 +27656,8 @@ snapshots:
semver@7.6.3: {}
semver@7.7.2: {}
send@0.18.0:
dependencies:
debug: 2.6.9
@@ -27753,7 +27824,7 @@ snapshots:
socks-proxy-agent@7.0.0:
dependencies:
agent-base: 6.0.2
debug: 4.4.0
debug: 4.4.3
socks: 2.8.3
transitivePeerDependencies:
- supports-color
@@ -27890,7 +27961,7 @@ snapshots:
jscodeshift: 0.15.2(@babel/preset-env@7.25.4(@babel/core@7.25.2))
leven: 3.1.0
ora: 5.4.1
prettier: 3.3.3
prettier: 3.6.2
prompts: 2.4.2
semver: 7.5.4
strip-json-comments: 3.1.1
@@ -28151,7 +28222,7 @@ snapshots:
synckit@0.9.1:
dependencies:
'@pkgr/core': 0.1.1
tslib: 2.6.3
tslib: 2.8.1
table-layout@0.4.5:
dependencies:
@@ -28469,6 +28540,8 @@ snapshots:
tslib@2.6.3: {}
tslib@2.8.1: {}
tslint@5.14.0(typescript@5.5.4):
dependencies:
babel-code-frame: 6.26.0
@@ -29068,14 +29141,14 @@ snapshots:
use-callback-ref@1.3.2(@types/react@18.3.4)(react@18.3.1):
dependencies:
react: 18.3.1
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
use-callback-ref@1.3.2(@types/react@18.3.4)(react@19.0.0-rc-f994737d14-20240522):
dependencies:
react: 19.0.0-rc-f994737d14-20240522
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
@@ -29089,7 +29162,7 @@ snapshots:
dependencies:
detect-node-es: 1.1.0
react: 18.3.1
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4
@@ -29097,7 +29170,7 @@ snapshots:
dependencies:
detect-node-es: 1.1.0
react: 19.0.0-rc-f994737d14-20240522
tslib: 2.6.3
tslib: 2.8.1
optionalDependencies:
'@types/react': 18.3.4