mirror of
https://github.com/discordjs/discord.js.git
synced 2024-08-21 06:24:43 +12:00
chore: deps
This commit is contained in:
parent
a58556adc0
commit
bcf7f1cfad
54 changed files with 669 additions and 526 deletions
|
@ -38,13 +38,13 @@
|
|||
},
|
||||
"homepage": "https://discord.js.org",
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^16.2.1",
|
||||
"@commitlint/config-angular": "^16.2.1",
|
||||
"@commitlint/cli": "^16.2.3",
|
||||
"@commitlint/config-angular": "^16.2.3",
|
||||
"@favware/npm-deprecate": "^1.0.4",
|
||||
"conventional-changelog-cli": "^2.2.2",
|
||||
"husky": "^7.0.4",
|
||||
"prettier": "^2.5.1",
|
||||
"turbo": "1.1.4"
|
||||
"prettier": "^2.6.2",
|
||||
"turbo": "^1.2.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
|
|
|
@ -53,32 +53,32 @@
|
|||
"homepage": "https://discord.js.org",
|
||||
"dependencies": {
|
||||
"@sapphire/shapeshift": "^2.0.0",
|
||||
"@sindresorhus/is": "^4.4.0",
|
||||
"@sindresorhus/is": "^4.6.0",
|
||||
"discord-api-types": "^0.31.1",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"ts-mixer": "^6.0.0",
|
||||
"ts-mixer": "^6.0.1",
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.17.2",
|
||||
"@babel/plugin-proposal-decorators": "^7.17.2",
|
||||
"@babel/core": "^7.17.9",
|
||||
"@babel/plugin-proposal-decorators": "^7.17.9",
|
||||
"@babel/preset-env": "^7.16.11",
|
||||
"@babel/preset-typescript": "^7.16.7",
|
||||
"@discordjs/ts-docgen": "^0.3.4",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@types/node": "^16.11.24",
|
||||
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
||||
"@typescript-eslint/parser": "^5.11.0",
|
||||
"@types/jest": "^27.4.1",
|
||||
"@types/node": "^16.11.27",
|
||||
"@typescript-eslint/eslint-plugin": "^5.19.0",
|
||||
"@typescript-eslint/parser": "^5.19.0",
|
||||
"babel-plugin-transform-typescript-metadata": "^0.3.2",
|
||||
"eslint": "^8.9.0",
|
||||
"eslint-config-marine": "^9.3.2",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint": "^8.13.0",
|
||||
"eslint-config-marine": "^9.4.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"jest": "^27.5.1",
|
||||
"prettier": "^2.5.1",
|
||||
"prettier": "^2.6.2",
|
||||
"tsup": "^5.11.13",
|
||||
"typedoc": "^0.22.11",
|
||||
"typescript": "^4.5.5"
|
||||
"typedoc": "^0.22.15",
|
||||
"typescript": "^4.6.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
|
|
|
@ -5,9 +5,9 @@ import {
|
|||
APIModalActionRowComponent,
|
||||
APIActionRowComponentTypes,
|
||||
} from 'discord-api-types/v10';
|
||||
import type { ButtonBuilder, SelectMenuBuilder, TextInputBuilder } from '..';
|
||||
import { ComponentBuilder } from './Component';
|
||||
import { createComponentBuilder } from './Components';
|
||||
import type { ButtonBuilder, SelectMenuBuilder, TextInputBuilder } from '..';
|
||||
|
||||
export type MessageComponentBuilder =
|
||||
| MessageActionRowComponentBuilder
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { APIMessageComponentEmoji, ButtonStyle } from 'discord-api-types/v10';
|
||||
import { s } from '@sapphire/shapeshift';
|
||||
import { APIMessageComponentEmoji, ButtonStyle } from 'discord-api-types/v10';
|
||||
import type { SelectMenuOptionBuilder } from './selectMenu/SelectMenuOption';
|
||||
import { UnsafeSelectMenuOptionBuilder } from './selectMenu/UnsafeSelectMenuOption';
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import type { JSONEncodable } from '../util/jsonEncodable';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
APIActionRowComponentTypes,
|
||||
APIBaseComponent,
|
||||
ComponentType,
|
||||
} from 'discord-api-types/v10';
|
||||
import type { JSONEncodable } from '../util/jsonEncodable';
|
||||
|
||||
export type AnyAPIActionRowComponent = APIActionRowComponentTypes | APIActionRowComponent<APIActionRowComponentTypes>;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { APIMessageComponent, APIModalComponent, ComponentType } from 'discord-api-types/v10';
|
||||
import { ActionRowBuilder, ButtonBuilder, ComponentBuilder, SelectMenuBuilder, TextInputBuilder } from '../index';
|
||||
import type { AnyComponentBuilder, MessageComponentBuilder, ModalComponentBuilder } from './ActionRow';
|
||||
import { ActionRowBuilder, ButtonBuilder, ComponentBuilder, SelectMenuBuilder, TextInputBuilder } from '../index';
|
||||
|
||||
export interface MappedComponentTypes {
|
||||
[ComponentType.ActionRow]: ActionRowBuilder<AnyComponentBuilder>;
|
||||
|
|
|
@ -5,6 +5,7 @@ import type {
|
|||
APIButtonComponentWithCustomId,
|
||||
APIButtonComponentWithURL,
|
||||
} from 'discord-api-types/v10';
|
||||
import { UnsafeButtonBuilder } from './UnsafeButton';
|
||||
import {
|
||||
buttonLabelValidator,
|
||||
buttonStyleValidator,
|
||||
|
@ -14,7 +15,6 @@ import {
|
|||
urlValidator,
|
||||
validateRequiredButtonParameters,
|
||||
} from '../Assertions';
|
||||
import { UnsafeButtonBuilder } from './UnsafeButton';
|
||||
|
||||
/**
|
||||
* Represents a validated button component
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import type { APISelectMenuComponent, APISelectMenuOption } from 'discord-api-types/v10';
|
||||
import { UnsafeSelectMenuBuilder } from './UnsafeSelectMenu';
|
||||
import { UnsafeSelectMenuOptionBuilder } from './UnsafeSelectMenuOption';
|
||||
import {
|
||||
customIdValidator,
|
||||
disabledValidator,
|
||||
|
@ -8,8 +10,6 @@ import {
|
|||
placeholderValidator,
|
||||
validateRequiredSelectMenuParameters,
|
||||
} from '../Assertions';
|
||||
import { UnsafeSelectMenuBuilder } from './UnsafeSelectMenu';
|
||||
import { UnsafeSelectMenuOptionBuilder } from './UnsafeSelectMenuOption';
|
||||
|
||||
/**
|
||||
* Represents a validated select menu component
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import type { APIMessageComponentEmoji, APISelectMenuOption } from 'discord-api-types/v10';
|
||||
import { UnsafeSelectMenuOptionBuilder } from './UnsafeSelectMenuOption';
|
||||
import {
|
||||
defaultValidator,
|
||||
emojiValidator,
|
||||
labelValueValidator,
|
||||
validateRequiredSelectMenuOptionParameters,
|
||||
} from '../Assertions';
|
||||
import { UnsafeSelectMenuOptionBuilder } from './UnsafeSelectMenuOption';
|
||||
|
||||
/**
|
||||
* Represents a validated option within a select menu component
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { APISelectMenuOption, ComponentType, type APISelectMenuComponent } from 'discord-api-types/v10';
|
||||
import { ComponentBuilder } from '../Component';
|
||||
import { UnsafeSelectMenuOptionBuilder } from './UnsafeSelectMenuOption';
|
||||
import { ComponentBuilder } from '../Component';
|
||||
|
||||
/**
|
||||
* Represents a non-validated select menu component
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { TextInputStyle } from 'discord-api-types/v10';
|
||||
import { s } from '@sapphire/shapeshift';
|
||||
import { TextInputStyle } from 'discord-api-types/v10';
|
||||
import { customIdValidator } from '../Assertions';
|
||||
|
||||
export const textInputStyleValidator = s.nativeEnum(TextInputStyle);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { ComponentType, type TextInputStyle, type APITextInputComponent } from 'discord-api-types/v10';
|
||||
import { ComponentBuilder } from '../../index';
|
||||
import isEqual from 'fast-deep-equal';
|
||||
import { ComponentBuilder } from '../../index';
|
||||
|
||||
export class UnsafeTextInputBuilder extends ComponentBuilder<APITextInputComponent> {
|
||||
public constructor(data?: APITextInputComponent & { type?: ComponentType.TextInput }) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { validateRequiredParameters, validateName, validateType, validateDefaultPermission } from './Assertions';
|
||||
import type { ApplicationCommandType, RESTPostAPIApplicationCommandsJSONBody } from 'discord-api-types/v10';
|
||||
import { validateRequiredParameters, validateName, validateType, validateDefaultPermission } from './Assertions';
|
||||
|
||||
export class ContextMenuCommandBuilder {
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { APIModalInteractionResponseCallbackData } from 'discord-api-types/v10';
|
||||
import { customIdValidator } from '../../components/Assertions';
|
||||
import { titleValidator, validateRequiredParameters } from './Assertions';
|
||||
import { UnsafeModalBuilder } from './UnsafeModal';
|
||||
import { customIdValidator } from '../../components/Assertions';
|
||||
|
||||
export class ModalBuilder extends UnsafeModalBuilder {
|
||||
public override setCustomId(customId: string): this {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { s } from '@sapphire/shapeshift';
|
||||
import is from '@sindresorhus/is';
|
||||
import { type APIApplicationCommandOptionChoice, Locale } from 'discord-api-types/v10';
|
||||
import { s } from '@sapphire/shapeshift';
|
||||
import type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOptionBase';
|
||||
import type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';
|
||||
import type { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';
|
||||
import type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOptionBase';
|
||||
|
||||
const namePredicate = s.string
|
||||
.lengthGe(1)
|
||||
|
|
|
@ -10,9 +10,9 @@ import {
|
|||
validateMaxOptionsLength,
|
||||
validateRequiredParameters,
|
||||
} from './Assertions';
|
||||
import { SharedSlashCommandOptions } from './mixins/SharedSlashCommandOptions';
|
||||
import { SharedNameAndDescription } from './mixins/NameAndDescription';
|
||||
import { SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder } from './SlashCommandSubcommands';
|
||||
import { SharedNameAndDescription } from './mixins/NameAndDescription';
|
||||
import { SharedSlashCommandOptions } from './mixins/SharedSlashCommandOptions';
|
||||
|
||||
@mix(SharedSlashCommandOptions, SharedNameAndDescription)
|
||||
export class SlashCommandBuilder {
|
||||
|
|
|
@ -5,10 +5,10 @@ import {
|
|||
} from 'discord-api-types/v10';
|
||||
import { mix } from 'ts-mixer';
|
||||
import { assertReturnOfBuilder, validateMaxOptionsLength, validateRequiredParameters } from './Assertions';
|
||||
import type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';
|
||||
import type { ApplicationCommandOptionBase } from './mixins/ApplicationCommandOptionBase';
|
||||
import { SharedNameAndDescription } from './mixins/NameAndDescription';
|
||||
import { SharedSlashCommandOptions } from './mixins/SharedSlashCommandOptions';
|
||||
import type { ToAPIApplicationCommandOptions } from './SlashCommandBuilder';
|
||||
|
||||
/**
|
||||
* Represents a folder for subcommands
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { APIApplicationCommandBasicOption, ApplicationCommandOptionType } from 'discord-api-types/v10';
|
||||
import { validateRequiredParameters, validateRequired } from '../Assertions';
|
||||
import { SharedNameAndDescription } from './NameAndDescription';
|
||||
import { validateRequiredParameters, validateRequired } from '../Assertions';
|
||||
|
||||
export abstract class ApplicationCommandOptionBase extends SharedNameAndDescription {
|
||||
public abstract readonly type: ApplicationCommandOptionType;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { ChannelType } from 'discord-api-types/v10';
|
||||
import { s } from '@sapphire/shapeshift';
|
||||
import { ChannelType } from 'discord-api-types/v10';
|
||||
|
||||
// Only allow valid channel types to be used. (This can't be dynamic because const enums are erased at runtime)
|
||||
const allowedChannelTypes = [
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from 'discord-api-types/v10';
|
||||
import { s } from '@sapphire/shapeshift';
|
||||
import { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from 'discord-api-types/v10';
|
||||
import { validateChoicesLength } from '../Assertions';
|
||||
|
||||
const stringPredicate = s.string.lengthGe(1).lengthLe(100);
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { assertReturnOfBuilder, validateMaxOptionsLength } from '../Assertions';
|
||||
import type { ApplicationCommandOptionBase } from './ApplicationCommandOptionBase';
|
||||
import { assertReturnOfBuilder, validateMaxOptionsLength } from '../Assertions';
|
||||
import type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';
|
||||
import { SlashCommandAttachmentOption } from '../options/attachment';
|
||||
import { SlashCommandBooleanOption } from '../options/boolean';
|
||||
import { SlashCommandChannelOption } from '../options/channel';
|
||||
import { SlashCommandIntegerOption } from '../options/integer';
|
||||
import { SlashCommandMentionableOption } from '../options/mentionable';
|
||||
import { SlashCommandNumberOption } from '../options/number';
|
||||
import { SlashCommandRoleOption } from '../options/role';
|
||||
import { SlashCommandAttachmentOption } from '../options/attachment';
|
||||
import { SlashCommandStringOption } from '../options/string';
|
||||
import { SlashCommandUserOption } from '../options/user';
|
||||
import type { ToAPIApplicationCommandOptions } from '../SlashCommandBuilder';
|
||||
|
||||
export class SharedSlashCommandOptions<ShouldOmitSubcommandFunctions = true> {
|
||||
public readonly options!: ToAPIApplicationCommandOptions[];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { s } from '@sapphire/shapeshift';
|
||||
import { APIApplicationCommandIntegerOption, ApplicationCommandOptionType } from 'discord-api-types/v10';
|
||||
import { mix } from 'ts-mixer';
|
||||
import { s } from '@sapphire/shapeshift';
|
||||
import { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin';
|
||||
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';
|
||||
import { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { s } from '@sapphire/shapeshift';
|
||||
import { APIApplicationCommandNumberOption, ApplicationCommandOptionType } from 'discord-api-types/v10';
|
||||
import { mix } from 'ts-mixer';
|
||||
import { s } from '@sapphire/shapeshift';
|
||||
import { ApplicationCommandNumericOptionMinMaxValueMixin } from '../mixins/ApplicationCommandNumericOptionMinMaxValueMixin';
|
||||
import { ApplicationCommandOptionBase } from '../mixins/ApplicationCommandOptionBase';
|
||||
import { ApplicationCommandOptionWithChoicesAndAutocompleteMixin } from '../mixins/ApplicationCommandOptionWithChoicesAndAutocompleteMixin';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { APIEmbedField } from 'discord-api-types/v10';
|
||||
import { s } from '@sapphire/shapeshift';
|
||||
import type { APIEmbedField } from 'discord-api-types/v10';
|
||||
|
||||
export const fieldNamePredicate = s.string.lengthGe(1).lengthLe(256);
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { Snowflake } from 'discord-api-types/globals';
|
||||
import type { URL } from 'url';
|
||||
import type { Snowflake } from 'discord-api-types/globals';
|
||||
|
||||
/**
|
||||
* Wraps the content inside a codeblock with no language
|
||||
|
|
|
@ -48,23 +48,23 @@
|
|||
},
|
||||
"homepage": "https://discord.js.org",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.17.2",
|
||||
"@babel/core": "^7.17.9",
|
||||
"@babel/preset-env": "^7.16.11",
|
||||
"@babel/preset-typescript": "^7.16.7",
|
||||
"@discordjs/ts-docgen": "^0.3.4",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@types/node": "^16.11.24",
|
||||
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
||||
"@typescript-eslint/parser": "^5.11.0",
|
||||
"eslint": "^8.9.0",
|
||||
"eslint-config-marine": "^9.3.2",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"@types/jest": "^27.4.1",
|
||||
"@types/node": "^16.11.27",
|
||||
"@typescript-eslint/eslint-plugin": "^5.19.0",
|
||||
"@typescript-eslint/parser": "^5.19.0",
|
||||
"eslint": "^8.13.0",
|
||||
"eslint-config-marine": "^9.4.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"jest": "^27.5.1",
|
||||
"prettier": "^2.5.1",
|
||||
"prettier": "^2.6.2",
|
||||
"tsup": "^5.11.13",
|
||||
"typedoc": "^0.22.11",
|
||||
"typescript": "^4.5.5"
|
||||
"typedoc": "^0.22.15",
|
||||
"typescript": "^4.6.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
|
|
|
@ -50,30 +50,30 @@
|
|||
"@discordjs/builders": "workspace:^",
|
||||
"@discordjs/collection": "workspace:^",
|
||||
"@discordjs/rest": "workspace:^",
|
||||
"@sapphire/snowflake": "^3.1.0",
|
||||
"@types/ws": "^8.2.2",
|
||||
"@sapphire/snowflake": "^3.2.1",
|
||||
"@types/ws": "^8.5.3",
|
||||
"discord-api-types": "^0.31.1",
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"lodash.snakecase": "^4.1.1",
|
||||
"tslib": "^2.3.1",
|
||||
"undici": "^4.14.1",
|
||||
"undici": "^4.16.0",
|
||||
"ws": "^8.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@discordjs/docgen": "^0.11.0",
|
||||
"@types/node": "^16.11.24",
|
||||
"@types/node": "^16.11.27",
|
||||
"dtslint": "^4.2.1",
|
||||
"eslint": "^8.9.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.25.4",
|
||||
"eslint": "^8.13.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"husky": "^7.0.4",
|
||||
"is-ci": "^3.0.1",
|
||||
"jest": "^27.5.1",
|
||||
"prettier": "^2.5.1",
|
||||
"tsd": "^0.19.1",
|
||||
"prettier": "^2.6.2",
|
||||
"tsd": "^0.20.0",
|
||||
"tslint": "^6.1.3",
|
||||
"typescript": "^4.5.5"
|
||||
"typescript": "^4.6.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import nock from 'nock';
|
||||
import { DiscordSnowflake } from '@sapphire/snowflake';
|
||||
import { REST, DefaultRestOptions, APIRequest } from '../src';
|
||||
import { Routes, Snowflake } from 'discord-api-types/v10';
|
||||
import nock from 'nock';
|
||||
import { Response } from 'node-fetch';
|
||||
import { REST, DefaultRestOptions, APIRequest } from '../src';
|
||||
|
||||
const newSnowflake: Snowflake = DiscordSnowflake.generate().toString();
|
||||
|
||||
|
|
|
@ -51,35 +51,35 @@
|
|||
"homepage": "https://discord.js.org",
|
||||
"dependencies": {
|
||||
"@discordjs/collection": "workspace:^",
|
||||
"@sapphire/async-queue": "^1.2.0",
|
||||
"@sapphire/snowflake": "^3.1.0",
|
||||
"@types/node-fetch": "^2.5.12",
|
||||
"@sapphire/async-queue": "^1.3.1",
|
||||
"@sapphire/snowflake": "^3.2.1",
|
||||
"@types/node-fetch": "^2.6.1",
|
||||
"discord-api-types": "^0.29.0",
|
||||
"form-data": "^4.0.0",
|
||||
"node-fetch": "^2.6.7",
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.17.2",
|
||||
"@babel/plugin-proposal-decorators": "^7.17.2",
|
||||
"@babel/core": "^7.17.9",
|
||||
"@babel/plugin-proposal-decorators": "^7.17.9",
|
||||
"@babel/preset-env": "^7.16.11",
|
||||
"@babel/preset-typescript": "^7.16.7",
|
||||
"@discordjs/ts-docgen": "^0.3.4",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
||||
"@typescript-eslint/parser": "^5.11.0",
|
||||
"@types/jest": "^27.4.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.19.0",
|
||||
"@typescript-eslint/parser": "^5.19.0",
|
||||
"babel-plugin-const-enum": "^1.2.0",
|
||||
"babel-plugin-transform-typescript-metadata": "^0.3.2",
|
||||
"eslint": "^8.9.0",
|
||||
"eslint-config-marine": "^9.3.2",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"eslint": "^8.13.0",
|
||||
"eslint-config-marine": "^9.4.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"jest": "^27.5.1",
|
||||
"nock": "^13.2.4",
|
||||
"prettier": "^2.5.1",
|
||||
"prettier": "^2.6.2",
|
||||
"tsup": "^5.11.13",
|
||||
"typedoc": "^0.22.11",
|
||||
"typescript": "^4.5.5"
|
||||
"typedoc": "^0.22.15",
|
||||
"typescript": "^4.6.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
import { EventEmitter } from 'node:events';
|
||||
import type { AgentOptions } from 'node:https';
|
||||
import type Collection from '@discordjs/collection';
|
||||
import type { RequestInit, Response } from 'node-fetch';
|
||||
import { CDN } from './CDN';
|
||||
import {
|
||||
HandlerRequestData,
|
||||
|
@ -8,12 +11,9 @@ import {
|
|||
RequestMethod,
|
||||
RouteLike,
|
||||
} from './RequestManager';
|
||||
import { DefaultRestOptions, RESTEvents } from './utils/constants';
|
||||
import type { AgentOptions } from 'node:https';
|
||||
import type { RequestInit, Response } from 'node-fetch';
|
||||
import type { HashData } from './RequestManager';
|
||||
import type Collection from '@discordjs/collection';
|
||||
import type { IHandler } from './handlers/IHandler';
|
||||
import { DefaultRestOptions, RESTEvents } from './utils/constants';
|
||||
|
||||
/**
|
||||
* Options to be passed when creating the REST instance
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import Collection from '@discordjs/collection';
|
||||
import FormData from 'form-data';
|
||||
import { DiscordSnowflake } from '@sapphire/snowflake';
|
||||
import { EventEmitter } from 'node:events';
|
||||
import { Agent as httpsAgent } from 'node:https';
|
||||
import { Agent as httpAgent } from 'node:http';
|
||||
import { Agent as httpsAgent } from 'node:https';
|
||||
import Collection from '@discordjs/collection';
|
||||
import { DiscordSnowflake } from '@sapphire/snowflake';
|
||||
import FormData from 'form-data';
|
||||
import type { RequestInit, BodyInit } from 'node-fetch';
|
||||
import type { RESTOptions, RestEvents } from './REST';
|
||||
import type { IHandler } from './handlers/IHandler';
|
||||
import { SequentialHandler } from './handlers/SequentialHandler';
|
||||
import type { RESTOptions, RestEvents } from './REST';
|
||||
import { DefaultRestOptions, DefaultUserAgent, RESTEvents } from './utils/constants';
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { InternalRequest } from '../RequestManager';
|
||||
import type { RequestBody } from './DiscordAPIError';
|
||||
import type { InternalRequest } from '../RequestManager';
|
||||
|
||||
/**
|
||||
* Represents a HTTP error
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { setTimeout as sleep } from 'node:timers/promises';
|
||||
import { AsyncQueue } from '@sapphire/async-queue';
|
||||
import fetch, { RequestInit, Response } from 'node-fetch';
|
||||
import type { IHandler } from './IHandler';
|
||||
import type { RateLimitData } from '../REST';
|
||||
import type { HandlerRequestData, RequestManager, RouteData } from '../RequestManager';
|
||||
import { DiscordAPIError, DiscordErrorData, OAuthErrorData } from '../errors/DiscordAPIError';
|
||||
import { HTTPError } from '../errors/HTTPError';
|
||||
import { RateLimitError } from '../errors/RateLimitError';
|
||||
import type { HandlerRequestData, RequestManager, RouteData } from '../RequestManager';
|
||||
import { RESTEvents } from '../utils/constants';
|
||||
import { hasSublimit, parseResponse } from '../utils/utils';
|
||||
import type { RateLimitData } from '../REST';
|
||||
import type { IHandler } from './IHandler';
|
||||
|
||||
/* Invalid request limiting is done on a per-IP basis, not a per-token basis.
|
||||
* The best we can do is track invalid counts process-wide (on the theory that
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/dot-notation */
|
||||
import { AudioResource } from '../src/audio/AudioResource';
|
||||
import { createAudioPlayer, AudioPlayerStatus, AudioPlayer, SILENCE_FRAME } from '../src/audio/AudioPlayer';
|
||||
import { Readable } from 'node:stream';
|
||||
import { addAudioPlayer, deleteAudioPlayer } from '../src/DataStore';
|
||||
import { NoSubscriberBehavior } from '../src';
|
||||
import { VoiceConnection, VoiceConnectionStatus } from '../src/VoiceConnection';
|
||||
import { once } from 'node:events';
|
||||
import { Readable } from 'node:stream';
|
||||
import { NoSubscriberBehavior } from '../src';
|
||||
import { addAudioPlayer, deleteAudioPlayer } from '../src/DataStore';
|
||||
import { VoiceConnection, VoiceConnectionStatus } from '../src/VoiceConnection';
|
||||
import { createAudioPlayer, AudioPlayerStatus, AudioPlayer, SILENCE_FRAME } from '../src/audio/AudioPlayer';
|
||||
import { AudioPlayerError } from '../src/audio/AudioPlayerError';
|
||||
import { AudioResource } from '../src/audio/AudioResource';
|
||||
|
||||
jest.mock('../src/DataStore');
|
||||
jest.mock('../src/VoiceConnection');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
import { opus, VolumeTransformer } from 'prism-media';
|
||||
import { PassThrough, Readable } from 'node:stream';
|
||||
import { opus, VolumeTransformer } from 'prism-media';
|
||||
import { SILENCE_FRAME } from '../src/audio/AudioPlayer';
|
||||
import { AudioResource, createAudioResource, NO_CONSTRAINT, VOLUME_CONSTRAINT } from '../src/audio/AudioResource';
|
||||
import { Edge, findPipeline as _findPipeline, StreamType, TransformerType } from '../src/audio/TransformerGraph';
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
/* eslint-disable @typescript-eslint/dot-notation */
|
||||
import { GatewayOpcodes } from 'discord-api-types/v10';
|
||||
import * as DataStore from '../src/DataStore';
|
||||
import * as _AudioPlayer from '../src/audio/AudioPlayer';
|
||||
import { VoiceConnection } from '../src/VoiceConnection';
|
||||
import * as _AudioPlayer from '../src/audio/AudioPlayer';
|
||||
jest.mock('../src/VoiceConnection');
|
||||
jest.mock('../src/audio/AudioPlayer');
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { noop } from '../src/util/util';
|
||||
import { SpeakingMap } from '../src/receive/SpeakingMap';
|
||||
import { noop } from '../src/util/util';
|
||||
|
||||
jest.useFakeTimers();
|
||||
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-argument */
|
||||
/* eslint-disable @typescript-eslint/dot-notation */
|
||||
import EventEmitter from 'node:events';
|
||||
import * as _DataStore from '../src/DataStore';
|
||||
import {
|
||||
createVoiceConnection,
|
||||
VoiceConnection,
|
||||
|
@ -13,12 +15,10 @@ import {
|
|||
VoiceConnectionStatus,
|
||||
} from '../src/VoiceConnection';
|
||||
|
||||
import * as _DataStore from '../src/DataStore';
|
||||
import * as _Networking from '../src/networking/Networking';
|
||||
import * as _AudioPlayer from '../src/audio/AudioPlayer';
|
||||
import { PlayerSubscription as _PlayerSubscription } from '../src/audio/PlayerSubscription';
|
||||
import * as _Networking from '../src/networking/Networking';
|
||||
import type { DiscordGatewayAdapterLibraryMethods } from '../src/util/adapter';
|
||||
import EventEmitter from 'node:events';
|
||||
|
||||
jest.mock('../src/audio/AudioPlayer');
|
||||
jest.mock('../src/audio/PlayerSubscription');
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/dot-notation */
|
||||
import { VoiceReceiver } from '../src/receive/VoiceReceiver';
|
||||
import { VoiceConnection as _VoiceConnection, VoiceConnectionStatus } from '../src/VoiceConnection';
|
||||
import { RTP_PACKET_DESKTOP, RTP_PACKET_CHROME, RTP_PACKET_ANDROID } from '../__mocks__/rtp';
|
||||
import { once } from 'node:events';
|
||||
import { VoiceOpcodes } from 'discord-api-types/voice/v4';
|
||||
import { RTP_PACKET_DESKTOP, RTP_PACKET_CHROME, RTP_PACKET_ANDROID } from '../__mocks__/rtp';
|
||||
import { VoiceConnection as _VoiceConnection, VoiceConnectionStatus } from '../src/VoiceConnection';
|
||||
import { VoiceReceiver } from '../src/receive/VoiceReceiver';
|
||||
import { methods } from '../src/util/Secretbox';
|
||||
|
||||
jest.mock('../src/VoiceConnection');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import { VoiceOpcodes } from 'discord-api-types/voice/v4';
|
||||
import EventEmitter, { once } from 'node:events';
|
||||
import { VoiceOpcodes } from 'discord-api-types/voice/v4';
|
||||
import WS from 'jest-websocket-mock';
|
||||
import { VoiceWebSocket } from '../src/networking/VoiceWebSocket';
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
import { demuxProbe } from '../src/util/demuxProbe';
|
||||
import { opus as _opus } from 'prism-media';
|
||||
import { Readable } from 'node:stream';
|
||||
import { StreamType } from '../src/audio';
|
||||
import EventEmitter, { once } from 'node:events';
|
||||
import { Readable } from 'node:stream';
|
||||
import { opus as _opus } from 'prism-media';
|
||||
import { StreamType } from '../src/audio';
|
||||
import { demuxProbe } from '../src/util/demuxProbe';
|
||||
|
||||
jest.mock('prism-media');
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||
import { joinVoiceChannel } from '../src/joinVoiceChannel';
|
||||
import * as VoiceConnection from '../src/VoiceConnection';
|
||||
import { joinVoiceChannel } from '../src/joinVoiceChannel';
|
||||
|
||||
const adapterCreator = () => ({ destroy: jest.fn(), send: jest.fn() } as any);
|
||||
const createVoiceConnection = jest.spyOn(VoiceConnection, 'createVoiceConnection');
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
},
|
||||
"homepage": "https://discord.js.org",
|
||||
"dependencies": {
|
||||
"@types/ws": "^8.2.2",
|
||||
"@types/ws": "^8.5.3",
|
||||
"discord-api-types": "^0.29.0",
|
||||
"prism-media": "^1.3.2",
|
||||
"tiny-typed-emitter": "^2.1.0",
|
||||
|
@ -58,26 +58,26 @@
|
|||
"ws": "^8.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.17.2",
|
||||
"@babel/core": "^7.17.9",
|
||||
"@babel/preset-env": "^7.16.11",
|
||||
"@babel/preset-typescript": "^7.16.7",
|
||||
"@discordjs/ts-docgen": "^0.3.4",
|
||||
"@types/jest": "^27.4.0",
|
||||
"@types/node": "^16.11.24",
|
||||
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
||||
"@typescript-eslint/parser": "^5.11.0",
|
||||
"eslint": "^8.9.0",
|
||||
"eslint-config-marine": "^9.3.2",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-prettier": "^4.0.0",
|
||||
"@types/jest": "^27.4.1",
|
||||
"@types/node": "^16.11.27",
|
||||
"@typescript-eslint/eslint-plugin": "^5.19.0",
|
||||
"@typescript-eslint/parser": "^5.19.0",
|
||||
"eslint": "^8.13.0",
|
||||
"eslint-config-marine": "^9.4.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"jest": "^27.5.1",
|
||||
"jest-websocket-mock": "^2.3.0",
|
||||
"mock-socket": "^9.1.2",
|
||||
"prettier": "^2.5.1",
|
||||
"prettier": "^2.6.2",
|
||||
"tsup": "^5.11.13",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"typedoc": "^0.22.11",
|
||||
"typescript": "^4.5.5"
|
||||
"typedoc": "^0.22.15",
|
||||
"typescript": "^4.6.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GatewayOpcodes } from 'discord-api-types/v10';
|
||||
import type { AudioPlayer } from './audio';
|
||||
import type { VoiceConnection } from './VoiceConnection';
|
||||
import type { AudioPlayer } from './audio';
|
||||
|
||||
export interface JoinConfig {
|
||||
guildId: string;
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
/* eslint-disable @typescript-eslint/prefer-ts-expect-error */
|
||||
import type { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from 'discord-api-types/v10';
|
||||
import { TypedEmitter } from 'tiny-typed-emitter';
|
||||
import type { CreateVoiceConnectionOptions } from '.';
|
||||
import type { AudioPlayer } from './audio/AudioPlayer';
|
||||
import type { PlayerSubscription } from './audio/PlayerSubscription';
|
||||
import {
|
||||
getVoiceConnection,
|
||||
createJoinVoiceChannelPayload,
|
||||
|
@ -10,12 +9,13 @@ import {
|
|||
JoinConfig,
|
||||
untrackVoiceConnection,
|
||||
} from './DataStore';
|
||||
import type { DiscordGatewayAdapterImplementerMethods } from './util/adapter';
|
||||
import { Networking, NetworkingState, NetworkingStatusCode } from './networking/Networking';
|
||||
import { Awaited, noop } from './util/util';
|
||||
import { TypedEmitter } from 'tiny-typed-emitter';
|
||||
import { VoiceReceiver } from './receive';
|
||||
import type { AudioPlayer } from './audio/AudioPlayer';
|
||||
import type { PlayerSubscription } from './audio/PlayerSubscription';
|
||||
import type { VoiceWebSocket, VoiceUDPSocket } from './networking';
|
||||
import { Networking, NetworkingState, NetworkingStatusCode } from './networking/Networking';
|
||||
import { VoiceReceiver } from './receive';
|
||||
import type { DiscordGatewayAdapterImplementerMethods } from './util/adapter';
|
||||
import { Awaited, noop } from './util/util';
|
||||
|
||||
/**
|
||||
* The various status codes a voice connection can hold at any one time.
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/* eslint-disable @typescript-eslint/prefer-ts-expect-error */
|
||||
import { addAudioPlayer, deleteAudioPlayer } from '../DataStore';
|
||||
import { Awaited, noop } from '../util/util';
|
||||
import { VoiceConnection, VoiceConnectionStatus } from '../VoiceConnection';
|
||||
import { TypedEmitter } from 'tiny-typed-emitter';
|
||||
import { AudioPlayerError } from './AudioPlayerError';
|
||||
import type { AudioResource } from './AudioResource';
|
||||
import { PlayerSubscription } from './PlayerSubscription';
|
||||
import { TypedEmitter } from 'tiny-typed-emitter';
|
||||
import { addAudioPlayer, deleteAudioPlayer } from '../DataStore';
|
||||
import { VoiceConnection, VoiceConnectionStatus } from '../VoiceConnection';
|
||||
import { Awaited, noop } from '../util/util';
|
||||
|
||||
// The Opus "silent" frame
|
||||
export const SILENCE_FRAME = Buffer.from([0xf8, 0xff, 0xfe]);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { Edge, findPipeline, StreamType, TransformerType } from './TransformerGraph';
|
||||
import { pipeline, Readable } from 'node:stream';
|
||||
import { noop } from '../util/util';
|
||||
import prism from 'prism-media';
|
||||
import { AudioPlayer, SILENCE_FRAME } from './AudioPlayer';
|
||||
import { Edge, findPipeline, StreamType, TransformerType } from './TransformerGraph';
|
||||
import { noop } from '../util/util';
|
||||
|
||||
/**
|
||||
* Options that are set when creating a new audio resource.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* eslint-disable @typescript-eslint/dot-notation */
|
||||
import type { VoiceConnection } from '../VoiceConnection';
|
||||
import type { AudioPlayer } from './AudioPlayer';
|
||||
import type { VoiceConnection } from '../VoiceConnection';
|
||||
|
||||
/**
|
||||
* Represents a subscription of a voice connection to an audio player, allowing
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { createVoiceConnection } from './VoiceConnection';
|
||||
import type { JoinConfig } from './DataStore';
|
||||
import { createVoiceConnection } from './VoiceConnection';
|
||||
import type { DiscordGatewayAdapterCreator } from './util/adapter';
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { VoiceOpcodes } from 'discord-api-types/voice/v4';
|
||||
import { TypedEmitter } from 'tiny-typed-emitter';
|
||||
import type { CloseEvent } from 'ws';
|
||||
import { VoiceUDPSocket } from './VoiceUDPSocket';
|
||||
import { VoiceWebSocket } from './VoiceWebSocket';
|
||||
import * as secretbox from '../util/Secretbox';
|
||||
import { Awaited, noop } from '../util/util';
|
||||
import type { CloseEvent } from 'ws';
|
||||
import { TypedEmitter } from 'tiny-typed-emitter';
|
||||
|
||||
// The number of audio channels required by Discord
|
||||
const CHANNELS = 2;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { VoiceOpcodes } from 'discord-api-types/voice/v4';
|
||||
import WebSocket, { MessageEvent } from 'ws';
|
||||
import { TypedEmitter } from 'tiny-typed-emitter';
|
||||
import WebSocket, { MessageEvent } from 'ws';
|
||||
import type { Awaited } from '../util/util';
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { VoiceOpcodes } from 'discord-api-types/voice/v4';
|
||||
import type { ConnectionData } from '../networking/Networking';
|
||||
import { methods } from '../util/Secretbox';
|
||||
import type { VoiceConnection } from '../VoiceConnection';
|
||||
import {
|
||||
AudioReceiveStream,
|
||||
AudioReceiveStreamOptions,
|
||||
createDefaultAudioReceiveStreamOptions,
|
||||
} from './AudioReceiveStream';
|
||||
import { SpeakingMap } from './SpeakingMap';
|
||||
import { SSRCMap } from './SSRCMap';
|
||||
import { SpeakingMap } from './SpeakingMap';
|
||||
import type { VoiceConnection } from '../VoiceConnection';
|
||||
import type { ConnectionData } from '../networking/Networking';
|
||||
import { methods } from '../util/Secretbox';
|
||||
|
||||
/**
|
||||
* Attaches to a VoiceConnection, allowing you to receive audio packets from other
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import EventEmitter, { once } from 'node:events';
|
||||
import { abortAfter } from './abortAfter';
|
||||
import type { VoiceConnection, VoiceConnectionStatus } from '../VoiceConnection';
|
||||
import type { AudioPlayer, AudioPlayerStatus } from '../audio/AudioPlayer';
|
||||
import { abortAfter } from './abortAfter';
|
||||
import EventEmitter, { once } from 'node:events';
|
||||
|
||||
/**
|
||||
* Allows a voice connection a specified amount of time to enter a given state, otherwise rejects with an error.
|
||||
|
|
Loading…
Reference in a new issue