Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f73213964b | ||
|
|
60871ccd60 | ||
|
|
1f55657390 | ||
|
|
b4e92b9b7b | ||
|
|
215d67ce89 | ||
|
|
b29fda5ae9 | ||
|
|
d10dae1b53 | ||
|
|
1a77896c32 | ||
|
|
a811feaede | ||
|
|
24bbfc354f | ||
|
|
faa48a0264 |
@@ -1,42 +1,21 @@
|
||||
name: 🐛 Bug Report
|
||||
name: 🐛 Bug
|
||||
description: Report a bug or unexpected behavior
|
||||
title: '🐛 [BUG]: '
|
||||
body:
|
||||
- type: textarea
|
||||
id: information
|
||||
attributes:
|
||||
label: Information
|
||||
description: Provide all information about the issue.
|
||||
label: Description
|
||||
description: Provide all information.
|
||||
placeholder: 'What happened? What did you expect to happen?'
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: steps
|
||||
id: criteria
|
||||
attributes:
|
||||
label: Steps to Reproduce
|
||||
description: Step-by-step instructions to reproduce the issue.
|
||||
placeholder: |
|
||||
1. Go to ...
|
||||
2. Click on ...
|
||||
3. Observe ...
|
||||
label: Acceptance Criteria
|
||||
description: What are the expectations?
|
||||
placeholder: 'How do you want it implemented? How should it be tested?'
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: logs
|
||||
attributes:
|
||||
label: Logs or Error Messages
|
||||
description: Paste any relevant console output, stack traces, or screenshots.
|
||||
placeholder: 'Console output, stacktrace, or screenshots here'
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: input
|
||||
id: occurrence
|
||||
attributes:
|
||||
label: Occurrence Version
|
||||
description: Specify in which version the issue occurred
|
||||
placeholder: 'v0.1.TTMMJJ-hhmm'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -1,29 +1,21 @@
|
||||
name: 💡 Enhancement
|
||||
description: Suggest a new feature or improvement
|
||||
title: '💡 [ENHANCEMENT]: '
|
||||
description: Suggest a new feature
|
||||
title: '💡 [Enhancement]: '
|
||||
body:
|
||||
- type: textarea
|
||||
id: description
|
||||
id: information
|
||||
attributes:
|
||||
label: Description
|
||||
description: Describe the new feature or improvement!
|
||||
placeholder: 'What problem does it solve or what value does it add?'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: proposal
|
||||
attributes:
|
||||
label: Proposed Solution
|
||||
placeholder: 'Describe how the feature should work.'
|
||||
description: Provide all information.
|
||||
placeholder: 'What happened? What did you expect to happen?'
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: input
|
||||
id: implementation
|
||||
- type: textarea
|
||||
id: criteria
|
||||
attributes:
|
||||
label: Implementation Version
|
||||
description: Specify in which version the enhancement should be released.
|
||||
placeholder: 'v0.1'
|
||||
label: Acceptance Criteria
|
||||
description: What are the expectations?
|
||||
placeholder: 'How do you want it implemented? How should it be tested?'
|
||||
validations:
|
||||
required: true
|
||||
required: false
|
||||
|
||||
@@ -1,39 +1,21 @@
|
||||
name: ⚙️ Improvement
|
||||
description: Suggest an improvement to existing functionality, code quality, or performance
|
||||
description: Suggest an improvement to existing functionality
|
||||
title: '⚙️ [Improvement]: '
|
||||
body:
|
||||
- type: textarea
|
||||
id: context
|
||||
id: information
|
||||
attributes:
|
||||
label: Current Situation / Context
|
||||
description: Describe the current behavior or implementation that could be improved.
|
||||
placeholder: 'Currently, the system loads all users at once, which slows down response time.'
|
||||
label: Description
|
||||
description: Provide all information.
|
||||
placeholder: 'What happened? What did you expect to happen?'
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: proposal
|
||||
id: criteria
|
||||
attributes:
|
||||
label: Proposed Improvement
|
||||
description: Describe your proposed change or improvement in detail.
|
||||
placeholder: 'Implement pagination for user loading to reduce memory usage and response time.'
|
||||
label: Acceptance Criteria
|
||||
description: What are the expectations?
|
||||
placeholder: 'How do you want it implemented? How should it be tested?'
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: benefits
|
||||
attributes:
|
||||
label: Expected Benefits
|
||||
description: Explain how this improvement will help (e.g., better performance, cleaner code, easier maintenance).
|
||||
placeholder: 'Faster load times, improved scalability, and reduced database load.'
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: input
|
||||
id: implementation
|
||||
attributes:
|
||||
label: Implementation Version
|
||||
description: Specify in which version the improvement should be released.
|
||||
placeholder: 'v0.1'
|
||||
validations:
|
||||
required: true
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
name: 📝 Service Request
|
||||
description: Request a service or support task
|
||||
title: '📝 [Service Request]: '
|
||||
body:
|
||||
- type: textarea
|
||||
id: information
|
||||
attributes:
|
||||
label: Description
|
||||
description: Provide all information.
|
||||
placeholder: 'What happened? What did you expect to happen?'
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: criteria
|
||||
attributes:
|
||||
label: Acceptance Criteria
|
||||
description: What are the expectations?
|
||||
placeholder: 'How do you want it implemented? How should it be tested?'
|
||||
validations:
|
||||
required: false
|
||||
@@ -0,0 +1,21 @@
|
||||
name: 👮 Story
|
||||
description: Describe a user story
|
||||
title: '👮 [Story]: '
|
||||
body:
|
||||
- type: textarea
|
||||
id: information
|
||||
attributes:
|
||||
label: Description
|
||||
description: Provide all information.
|
||||
placeholder: 'What happened? What did you expect to happen?'
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: textarea
|
||||
id: criteria
|
||||
attributes:
|
||||
label: Acceptance Criteria
|
||||
description: What are the expectations?
|
||||
placeholder: 'How do you want it implemented? How should it be tested?'
|
||||
validations:
|
||||
required: false
|
||||
@@ -4,39 +4,34 @@
|
||||

|
||||

|
||||
|
||||
> **Designed for 24/7 Discord audio playback.**
|
||||
> `discord-audio-stream` is a small TypeScript library for managed Discord voice playback through
|
||||
> `@discordjs/voice` and ffmpeg.
|
||||
`discord-audio-stream` is a small TypeScript library for managed Discord voice playback through
|
||||
`@discordjs/voice` and ffmpeg.
|
||||
|
||||
Discord voice streams need careful lifecycle handling. This package manages the voice connection, ffmpeg process,
|
||||
raw PCM resource creation, optional reconnect renewal, and predictable cleanup so your bot code stays small and readable.
|
||||
It manages the Discord voice connection, ffmpeg process, raw PCM audio resource, optional renewal, and cleanup. Keep one
|
||||
`AudioManager` per guild, usually in a `Map<string, AudioManager>`, and call `dispose()` when that manager will not be
|
||||
reused.
|
||||
|
||||
> **Recommended best practice:**
|
||||
> Keep one `AudioManager` per guild, usually in a `Map<string, AudioManager>`. Update the connection or source through
|
||||
> `setConnection()` and `setSource()`, then call `start()`. When playback stops, call `stop()`. When the manager will not
|
||||
> be reused, call `dispose()` to release timers, streams, ffmpeg, and the voice connection.
|
||||
## Support
|
||||
|
||||
> **For large bots:**
|
||||
> Queue many simultaneous starts, for example with [`p-queue`](https://www.npmjs.com/package/p-queue), so the host does
|
||||
> not spawn too many ffmpeg processes in the same tick.
|
||||
|
||||
## 👋 Support
|
||||
|
||||
Please create an [issue](https://github.com/FrauJulian/Discord-Audio-Stream/issues) on GitHub or contact
|
||||
Create an [issue](https://github.com/FrauJulian/Discord-Audio-Stream/issues) on GitHub or contact
|
||||
[`fraujulian`](https://discord.com/users/860206216893693973) on Discord.
|
||||
|
||||
## 📝 Usage
|
||||
## Installation
|
||||
|
||||
### Installation
|
||||
|
||||
**Node.js `22.22.3` or newer is required.**
|
||||
|
||||
Install the library and the required voice packages:
|
||||
Node.js `22.22.3` or newer is required.
|
||||
|
||||
```bash
|
||||
npm install discord-audio-stream @discordjs/voice prism-media @snazzah/davey opusscript
|
||||
```
|
||||
|
||||
`ffmpeg` must be available either on the host PATH or through the optional `ffmpeg-static` package:
|
||||
|
||||
```bash
|
||||
npm install ffmpeg-static
|
||||
```
|
||||
|
||||
Use `ffmpeg.mode: 'native'` for PATH-based ffmpeg and `ffmpeg.mode: 'static'` for `ffmpeg-static`.
|
||||
|
||||
`libsodium-wrappers` is optional. Install it only when your runtime does not support `aes-256-gcm`:
|
||||
|
||||
```bash
|
||||
@@ -44,15 +39,7 @@ node -e "console.log(require('node:crypto').getCiphers().includes('aes-256-gcm')
|
||||
npm install libsodium-wrappers
|
||||
```
|
||||
|
||||
For bundled ffmpeg support, install `ffmpeg-static` and use `ffmpeg.mode: 'static'`:
|
||||
|
||||
```bash
|
||||
npm install ffmpeg-static
|
||||
```
|
||||
|
||||
If ffmpeg is already available on the host PATH, use `ffmpeg.mode: 'native'`.
|
||||
|
||||
### AudioManager Example
|
||||
## Basic Usage
|
||||
|
||||
```ts
|
||||
import { AudioManager } from 'discord-audio-stream';
|
||||
@@ -70,7 +57,6 @@ const manager = new AudioManager({
|
||||
ffmpeg: {
|
||||
mode: 'native',
|
||||
},
|
||||
renewIntervalMs: 5_400_000,
|
||||
});
|
||||
|
||||
await manager.start();
|
||||
@@ -89,9 +75,25 @@ await manager.start();
|
||||
|
||||
Relative file paths are resolved from `process.cwd()`. URL sources are validated before playback starts.
|
||||
|
||||
## ⚙️ API
|
||||
For large bots, queue many simultaneous starts so the host does not spawn too many ffmpeg processes in the same tick.
|
||||
|
||||
### Constructor
|
||||
## Lifecycle
|
||||
|
||||
```ts
|
||||
manager.setConnection(connectionOptions);
|
||||
manager.setSource(source);
|
||||
|
||||
await manager.start(); // connect() + play()
|
||||
manager.pause();
|
||||
manager.resume();
|
||||
await manager.stop(); // stops playback and destroys the voice connection
|
||||
manager.dispose(); // final cleanup; the manager cannot be reused
|
||||
```
|
||||
|
||||
`connect()` joins the configured voice channel. `play(source?)` starts playback on an existing connection. Use `start()`
|
||||
when you want both.
|
||||
|
||||
## API
|
||||
|
||||
```ts
|
||||
type AudioManagerOptions = {
|
||||
@@ -148,11 +150,9 @@ manager.isPlaying;
|
||||
manager.isConnected;
|
||||
```
|
||||
|
||||
## 🔊 Audio Options
|
||||
## Audio Options
|
||||
|
||||
### Volume
|
||||
|
||||
Inline volume has a runtime cost in `@discordjs/voice`, so it is disabled by default.
|
||||
Inline volume has runtime cost in `@discordjs/voice`, so it is disabled by default.
|
||||
|
||||
```ts
|
||||
const manager = new AudioManager({
|
||||
@@ -170,33 +170,15 @@ manager.setVolume(25);
|
||||
|
||||
Calling `setVolume()` without `volume.enabled: true` throws `AudioManagerStateError`.
|
||||
|
||||
### ffmpeg Modes
|
||||
|
||||
- `mode: 'native'` uses the `ffmpeg` executable from the host environment.
|
||||
- `mode: 'static'` resolves the optional `ffmpeg-static` package.
|
||||
- `executablePath` overrides both modes and is useful for Docker images or custom ffmpeg builds.
|
||||
|
||||
Default output is raw Discord-compatible PCM: `s16le`, `48000 Hz`, `2 channels`.
|
||||
Default ffmpeg output is raw Discord-compatible PCM: `s16le`, `48000 Hz`, `2 channels`.
|
||||
|
||||
You can override ffmpeg arguments through `ffmpeg.inputArgs` and `ffmpeg.outputArgs`. When you override them, you are
|
||||
responsible for keeping the output compatible with `StreamType.Raw`.
|
||||
|
||||
### Renewal
|
||||
|
||||
By default, the manager schedules a renewal after `5_400_000 ms` so long-running streams can reconnect periodically.
|
||||
Set `renewIntervalMs: false` to disable this behavior:
|
||||
Set `renewIntervalMs: false` to disable it. `stop()` and `dispose()` always clear the renewal timer.
|
||||
|
||||
```ts
|
||||
const manager = new AudioManager({
|
||||
connection,
|
||||
source,
|
||||
renewIntervalMs: false,
|
||||
});
|
||||
```
|
||||
|
||||
`stop()` and `dispose()` always clear the renewal timer.
|
||||
|
||||
## 🧯 Errors
|
||||
## Errors
|
||||
|
||||
The package exports these error classes:
|
||||
|
||||
@@ -208,7 +190,7 @@ The package exports these error classes:
|
||||
Configuration problems, such as a missing source or invalid URL, throw `AudioManagerConfigError`. Invalid lifecycle
|
||||
operations, such as calling `pause()` while nothing is playing, throw `AudioManagerStateError`.
|
||||
|
||||
## 🧑💻 Development
|
||||
## Development
|
||||
|
||||
```bash
|
||||
npm ci
|
||||
@@ -216,10 +198,10 @@ npm run check
|
||||
npm run build
|
||||
```
|
||||
|
||||
## 📋 Contributors
|
||||
## Contributors
|
||||
|
||||
~ [**FrauJulian - Julian Lechner**](https://fraujulian.xyz/) - CODEOWNER
|
||||
|
||||
## 🤝 Enjoy the package?
|
||||
## Enjoy the package?
|
||||
|
||||
Give it a star ⭐ on [GitHub](https://github.com/FrauJulian/discord-audio-stream)!
|
||||
Give it a star on [GitHub](https://github.com/FrauJulian/discord-audio-stream)!
|
||||
|
||||
Generated
+264
-254
@@ -11,19 +11,19 @@
|
||||
"devDependencies": {
|
||||
"@jest/globals": "^30.4.1",
|
||||
"@types/ejs": "^3.1.5",
|
||||
"@types/node": "^25.9.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.60.0",
|
||||
"@typescript-eslint/parser": "^8.60.0",
|
||||
"@types/node": "^26.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.61.1",
|
||||
"@typescript-eslint/parser": "^8.61.1",
|
||||
"eslint": "^9.39.4",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
"eslint-import-resolver-typescript": "^4.4.5",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-n": "^18.0.1",
|
||||
"eslint-plugin-n": "^18.1.0",
|
||||
"eslint-plugin-promise": "^7.3.0",
|
||||
"eslint-plugin-unused-imports": "^4.4.1",
|
||||
"husky": "^9.1.7",
|
||||
"jest": "^30.4.2",
|
||||
"prettier": "^3.8.3",
|
||||
"prettier": "^3.8.4",
|
||||
"ts-jest": "^29.4.11",
|
||||
"tsup": "^8.5.1",
|
||||
"typescript": "^6.0.3"
|
||||
@@ -36,7 +36,7 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@discordjs/voice": "^0.19.2",
|
||||
"@snazzah/davey": "^0.1.11",
|
||||
"@snazzah/davey": "^0.1.12",
|
||||
"ffmpeg-static": "^5.3.0",
|
||||
"libsodium-wrappers": "^0.8.4",
|
||||
"opusscript": "^0.0.8",
|
||||
@@ -620,9 +620,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.1.tgz",
|
||||
"integrity": "sha512-HHB50pdsBX6k47S4u5g/CaLjqS3qwaOVE5ILsq64jyzgMhLuCuZ8rGzM9yhsAjfjkbgUPMzZEPa7DAp7yz6vuA==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz",
|
||||
"integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -637,9 +637,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.1.tgz",
|
||||
"integrity": "sha512-kFqa6/UcaTbGm/NncN9kzVOODjhZW8e+FRdSeypWe6j33gzclHtwlANs26JrupOntlcWmB0u8+8HZo8s7thHvg==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz",
|
||||
"integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -654,9 +654,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-arm64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.1.tgz",
|
||||
"integrity": "sha512-45fuKmAJpxnQWixOGCrS+ro4Uvb4Re9+UTieUY2f8AEc+t7d4AaZ6eUJ3Hva7dtrxAAWHtlEFsXFMAgNnGU9uQ==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz",
|
||||
"integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -671,9 +671,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/android-x64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.1.tgz",
|
||||
"integrity": "sha512-LBEpOz0BsgMEeHgenf5aqmn/lLNTFXVfoWMUox8CtWWYK9X4jmQzWjoGoNb8lmAYml/tQ/Ysvm8q7szu7BoxRQ==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz",
|
||||
"integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -688,9 +688,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-arm64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.1.tgz",
|
||||
"integrity": "sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz",
|
||||
"integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -705,9 +705,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/darwin-x64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.1.tgz",
|
||||
"integrity": "sha512-+3ELd+nTzhfWb07Vol7EZ+5PTbJ/u74nC6iv4/lwIU99Ip5uuY6QoIf0Hn4m2HoV0qcnRivN3KSqc+FyCHjoVQ==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz",
|
||||
"integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -722,9 +722,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-arm64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.1.tgz",
|
||||
"integrity": "sha512-/8Rfgns4XD9XOSXlzUDepG8PX+AVWHliYlUkFI3K3GB6tqbdjYqdhcb4BKRd7C0BhZSoaCxhv8kTcBrcZWP+xg==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz",
|
||||
"integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -739,9 +739,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/freebsd-x64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.1.tgz",
|
||||
"integrity": "sha512-GITpD8dK9C+r+5yRT/UKVT36h/DQLOHdwGVwwoHidlnA168oD3uxA878XloXebK4Ul3gDBBIvEdL7go9gCUFzQ==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz",
|
||||
"integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -756,9 +756,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.1.tgz",
|
||||
"integrity": "sha512-ieMID0JRZY/ZeCrsFQ3Y3NlHNCqIhTprJfDgSB3/lv5jJZ8FX3hqPyXWhe+gvS5ARMBJ242PM+VNz/ctNj//eA==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz",
|
||||
"integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -773,9 +773,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-arm64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.1.tgz",
|
||||
"integrity": "sha512-W9//kCrh/6in9rWIBdKaMtuTTzNj6jSeG/haWBADqLLa9P8O5YSRDzgD5y9QBok4AYlzS6ARHifAb75V6G670Q==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz",
|
||||
"integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -790,9 +790,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ia32": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.1.tgz",
|
||||
"integrity": "sha512-VIUV4z8GD8rtSVMfAj1aXFahsi/+tcoXXNYmXgzISL+KB381vbSTNdeZHHHIYqFyXcoEhu9n5cT+05tRv13rlw==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz",
|
||||
"integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -807,9 +807,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-loong64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.1.tgz",
|
||||
"integrity": "sha512-l4rfiiJRN7sTNI//ff65zJ9z8U+k6zcCg0LALU5iEWzY+a1mVZ8iWC1k5EsNKThZ7XCQ6YWtsZ8EWYm7r1UEsg==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz",
|
||||
"integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==",
|
||||
"cpu": [
|
||||
"loong64"
|
||||
],
|
||||
@@ -824,9 +824,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-mips64el": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.1.tgz",
|
||||
"integrity": "sha512-U0bEuAOLvO/DWFdygTHWY8C067FXz+UbzKgxYhXC0fDieFa0kDIra1FAhsAARRJbvEyso8aAqvPdNxzWuStBnA==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz",
|
||||
"integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==",
|
||||
"cpu": [
|
||||
"mips64el"
|
||||
],
|
||||
@@ -841,9 +841,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-ppc64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.1.tgz",
|
||||
"integrity": "sha512-NzdQ/Xwu6vPSf/GkdmRNsOfIeSGnh7muundsWItmBsVpMoNPVpM61qNzAVY3pZ1glzzAxLR40UyYM23eaDDbYQ==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz",
|
||||
"integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
@@ -858,9 +858,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-riscv64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.1.tgz",
|
||||
"integrity": "sha512-7zlw8p3IApcsN7mFw0O1Z1PyEk6PlKMu18roImfl3iQHTnr/yAfYv6s4hXPidbDoI2Q0pW+5xeoM4eTCC0UdrQ==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz",
|
||||
"integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
@@ -875,9 +875,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-s390x": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.1.tgz",
|
||||
"integrity": "sha512-cGj5wli+G+nkVQdZo3+7FDKC25Uh4ZVwOAK6A06Hsvgr8WqBBuOy/1s+PUEd/6Je+vjfm6stX0kmib5b/O2Ykw==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz",
|
||||
"integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@@ -892,9 +892,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/linux-x64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.1.tgz",
|
||||
"integrity": "sha512-z3H/HYI9MM0HTv3hQZ81f+AKb+yEoCRlUby1F80vbQ5XdzEMyY/9iNlAmhqiBKw4MJXwfgsh7ERGEOhrM1niMA==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz",
|
||||
"integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -909,9 +909,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-arm64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.1.tgz",
|
||||
"integrity": "sha512-wzC24DxAvk8Em01YmVXyjl96Mr+ecTPyOuADAvjGg+fyBpGmxmcr2E5ttf7Im8D0sXZihpxzO1isus8MdjMCXQ==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz",
|
||||
"integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -926,9 +926,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/netbsd-x64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.1.tgz",
|
||||
"integrity": "sha512-1YQ8ybGi2yIXswu6eNzJsrYIGFpnlzEWRl6iR5gMgmsrR0FcNoV1m9k9sc3PuP5rUBLshOZylc9nqSgymI+TYg==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz",
|
||||
"integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -943,9 +943,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-arm64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.1.tgz",
|
||||
"integrity": "sha512-5Z+DzLCrq5wmU7RDaMDe2DVXMRm2tTDvX2KU14JJVBN2CT/qov7XVix85QoJqHltpvAOZUAc3ndU56HSMWrv8g==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz",
|
||||
"integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -960,9 +960,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openbsd-x64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.1.tgz",
|
||||
"integrity": "sha512-Q73ENzIdPF5jap4wqLtsfh8YbYSZ8Q0wnxplOlZUOyZy7B4ZKW8DXGWgTCZmF8VWD7Tciwv5F4NsRf6vYlZtqg==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz",
|
||||
"integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -977,9 +977,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/openharmony-arm64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.1.tgz",
|
||||
"integrity": "sha512-ajbHrGM/XiK+sXM0JzEbJAen+0E+JMQZ2l4RR4VFwvV9JEERx+oxtgkpoKv1SevhjavK2z2ReHk32pjzktWbGg==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz",
|
||||
"integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -994,9 +994,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/sunos-x64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.1.tgz",
|
||||
"integrity": "sha512-IPUW+y4VIjuDVn+OMzHc5FV4GubIwPnsz6ubkvN8cuhEqH81NovB53IUlrlBkPMEPxvNnf79MGBoz8rZ2iW8HA==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz",
|
||||
"integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1011,9 +1011,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-arm64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.1.tgz",
|
||||
"integrity": "sha512-RIVRWiljWA6CdVu8zkWcRmGP7iRRIIwvhDKem8UMBjPql2TXM5PkDVvvrzMtj1V+WFPB4K7zkIGM7VzRtFkjdg==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz",
|
||||
"integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -1028,9 +1028,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-ia32": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.1.tgz",
|
||||
"integrity": "sha512-2BR5M8CPbptC1AK5JbJT1fWrHLvejwZidKx3UMSF0ecHMa+smhi16drIrCEggkgviBwLYd5nwrFLSl5Kho96RQ==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz",
|
||||
"integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -1045,9 +1045,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/win32-x64": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.1.tgz",
|
||||
"integrity": "sha512-d5X6RMYv6taIymSk8JBP+nxv8DQAMY6A51GPgusqLdK9wBz5wWIXy1KjTck6HnjE9hqJzJRdk+1p/t5soSbCtw==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz",
|
||||
"integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -1869,14 +1869,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@napi-rs/wasm-runtime": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz",
|
||||
"integrity": "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==",
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.5.tgz",
|
||||
"integrity": "sha512-AWPoBRJ9tsnVhor4sjO7rkni+7p+2IAEFj6cx06UgP10jkQHqay/36uRV/bFkgrh18D9vb4cr8Q0Pthskgzy+Q==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@tybys/wasm-util": "^0.10.1"
|
||||
"@tybys/wasm-util": "^0.10.2"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
@@ -2335,9 +2335,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey/-/davey-0.1.11.tgz",
|
||||
"integrity": "sha512-oBN+msHzPnm1M5DDx3wVD7iBwpNXFUtkh2MrAbUJu0OhKjliLChi28hq++mu1+qdMpAVQO5JKAvQQxYVbyneiw==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey/-/davey-0.1.12.tgz",
|
||||
"integrity": "sha512-V+NlX5931RwVamZhhEfZekMdcvXDKdMAmHW1AuGaykVQsNyBOq3bpmGpoKRBDCYgFWKIufJ0Dcg3m4cYhvUy6g==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
@@ -2347,26 +2347,26 @@
|
||||
"url": "https://github.com/sponsors/Snazzah"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@snazzah/davey-android-arm-eabi": "0.1.11",
|
||||
"@snazzah/davey-android-arm64": "0.1.11",
|
||||
"@snazzah/davey-darwin-arm64": "0.1.11",
|
||||
"@snazzah/davey-darwin-x64": "0.1.11",
|
||||
"@snazzah/davey-freebsd-x64": "0.1.11",
|
||||
"@snazzah/davey-linux-arm-gnueabihf": "0.1.11",
|
||||
"@snazzah/davey-linux-arm64-gnu": "0.1.11",
|
||||
"@snazzah/davey-linux-arm64-musl": "0.1.11",
|
||||
"@snazzah/davey-linux-x64-gnu": "0.1.11",
|
||||
"@snazzah/davey-linux-x64-musl": "0.1.11",
|
||||
"@snazzah/davey-wasm32-wasi": "0.1.11",
|
||||
"@snazzah/davey-win32-arm64-msvc": "0.1.11",
|
||||
"@snazzah/davey-win32-ia32-msvc": "0.1.11",
|
||||
"@snazzah/davey-win32-x64-msvc": "0.1.11"
|
||||
"@snazzah/davey-android-arm-eabi": "0.1.12",
|
||||
"@snazzah/davey-android-arm64": "0.1.12",
|
||||
"@snazzah/davey-darwin-arm64": "0.1.12",
|
||||
"@snazzah/davey-darwin-x64": "0.1.12",
|
||||
"@snazzah/davey-freebsd-x64": "0.1.12",
|
||||
"@snazzah/davey-linux-arm-gnueabihf": "0.1.12",
|
||||
"@snazzah/davey-linux-arm64-gnu": "0.1.12",
|
||||
"@snazzah/davey-linux-arm64-musl": "0.1.12",
|
||||
"@snazzah/davey-linux-x64-gnu": "0.1.12",
|
||||
"@snazzah/davey-linux-x64-musl": "0.1.12",
|
||||
"@snazzah/davey-wasm32-wasi": "0.1.12",
|
||||
"@snazzah/davey-win32-arm64-msvc": "0.1.12",
|
||||
"@snazzah/davey-win32-ia32-msvc": "0.1.12",
|
||||
"@snazzah/davey-win32-x64-msvc": "0.1.12"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-android-arm-eabi": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-android-arm-eabi/-/davey-android-arm-eabi-0.1.11.tgz",
|
||||
"integrity": "sha512-T1RYbNYKN6tLOcGIDKJd8OI6FBSEemwL7DOYdTMmhqfhhMr3YVN8WOhfoxGg63OcnpTN2e2c5tdY2bAx25RmQQ==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-android-arm-eabi/-/davey-android-arm-eabi-0.1.12.tgz",
|
||||
"integrity": "sha512-6VC/an+Sx5dI5skb+90rYcIB1jhm48Rl0nDaw0UNT4bz1rMjpVfmmZqeocYXMq96IdbBMlE6OTKGcBm2C3gkQg==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -2381,9 +2381,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-android-arm64": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-android-arm64/-/davey-android-arm64-0.1.11.tgz",
|
||||
"integrity": "sha512-ksJn/x2VU8h6w9eku1HT96ugSRZ7lKVkKNKbFleaFN+U99DJaPM+gMu2YvnFU4V54HR06ZBnRihnVG6VLXQpDw==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-android-arm64/-/davey-android-arm64-0.1.12.tgz",
|
||||
"integrity": "sha512-0Bwd03/JsTFhlPhF4q/LW0RxSzntFpQdhz+TBdFljYSg8IEyA38saPJeTNjpIgDfhAumPzvhCdfS6O5qT8yXDw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2398,9 +2398,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-darwin-arm64": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-darwin-arm64/-/davey-darwin-arm64-0.1.11.tgz",
|
||||
"integrity": "sha512-E1d7PbaaVMO3Lj9EiAPqOVbuV0xg5+PsHzHH097DDXiD1+zUDXvJaTnUWsnm5z50pJniHpi4GtaYmk+ieB/guA==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-darwin-arm64/-/davey-darwin-arm64-0.1.12.tgz",
|
||||
"integrity": "sha512-lKMV6ITi9BQLt0fx/pAT7M8xcojVK7bryVJGdaW3bq8gABFslS3ti/KzrWabQvhpEV71FZe5mV0UcKHFVaTsZw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2415,9 +2415,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-darwin-x64": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-darwin-x64/-/davey-darwin-x64-0.1.11.tgz",
|
||||
"integrity": "sha512-Tl4TI/LTmgJZepgbgVMYDi8RqlAkPtPg1OEBPl7a9Tn3AwR36Vs6lyIT1cs/lGy/ds/+B+mKI4rPObN1cyILTw==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-darwin-x64/-/davey-darwin-x64-0.1.12.tgz",
|
||||
"integrity": "sha512-vXXc/eW/e3TQeb7VsdtrPqs3/22j0aSqiP1ZXmZtDjQRBwgSxwItWYa6sh5MELP2EHB2igNlGzB6Hc0XlbGi4g==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -2432,9 +2432,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-freebsd-x64": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-freebsd-x64/-/davey-freebsd-x64-0.1.11.tgz",
|
||||
"integrity": "sha512-T8Iw9FXkuI1T+YBAFzh9v/TXf9IOTOSqnd/BFpTRTrlW72PR2lhIidzSmg027VxO7r5pX47iFwiOkb9I/NU/EA==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-freebsd-x64/-/davey-freebsd-x64-0.1.12.tgz",
|
||||
"integrity": "sha512-G1gas5HrC4Xp3mRY0+OeAqXS6fG2tRgBEc8gQh69Hw4YK9RV9mzQKcmoKMkBM72U1+2C+2u57dolnKKzwozByQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -2449,9 +2449,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-linux-arm-gnueabihf": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-arm-gnueabihf/-/davey-linux-arm-gnueabihf-0.1.11.tgz",
|
||||
"integrity": "sha512-1Txj+8pqA8uq/OGtaUaBFWAPnNMQzFgIywj0iA7EI4xZl+mab48/pv+YZ1pNb/suC6ynsW44oB9efiXSdcUAgA==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-arm-gnueabihf/-/davey-linux-arm-gnueabihf-0.1.12.tgz",
|
||||
"integrity": "sha512-97Fujh82r2Ll7dPZeNuoZ3yKfsqycf3c93OWXOo/ThNL/18Onl2Ht4SIvpX6VHhfeS9bDpHJ1lHCaz1b/i5ocw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@@ -2466,9 +2466,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-linux-arm64-gnu": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-arm64-gnu/-/davey-linux-arm64-gnu-0.1.11.tgz",
|
||||
"integrity": "sha512-ERzF5nM/IYW1BcN3wLXpEwBCGLFf0kGJUVhaV6yfiInz0tkU8UmvrrgpaMaACfMjIhfWdq5CcX+aTkXo/saNcg==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-arm64-gnu/-/davey-linux-arm64-gnu-0.1.12.tgz",
|
||||
"integrity": "sha512-FWyAOv52cHKDM4BOsmImKKogHFvqNFoXmZcicNJbX3XpVl8Mas88ZoXQ+IA5V+qc9pNtAl1MbWwEZ9JrqAQtbg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2486,9 +2486,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-linux-arm64-musl": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-arm64-musl/-/davey-linux-arm64-musl-0.1.11.tgz",
|
||||
"integrity": "sha512-e6pX6Hiabtz99q+H/YHNkm9JVlpqN8HGh0qPib8G2+UY4/SSH8WvqWipk3v581dMy2oyCHt7MOoY1aU1P1N/xA==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-arm64-musl/-/davey-linux-arm64-musl-0.1.12.tgz",
|
||||
"integrity": "sha512-ptRbLSQxtV6EjXppS5z7qaPDI0NRKhrkJYsTlAjEghmOvlAObozSCYYnMO6nbkt6Ab3+lWqyahClzcRNcD2ouw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2506,9 +2506,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-linux-x64-gnu": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-x64-gnu/-/davey-linux-x64-gnu-0.1.11.tgz",
|
||||
"integrity": "sha512-TW5bSoqChOJMbvsDb4wAATYrxmAXuNnse7wFNVSAJUaZKSeRfZbu3UAiPWSNn7GwLwSfU6hg322KZUn8IWCuvg==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-x64-gnu/-/davey-linux-x64-gnu-0.1.12.tgz",
|
||||
"integrity": "sha512-w86fZvhJn0ErOoAQHt2UbQ95V/cgwvfvQ4GlTPQLCzt58nn+rLlXLgPn90qYlSQrZxFW38rKXwqVOMbm9p+pwQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -2526,9 +2526,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-linux-x64-musl": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-x64-musl/-/davey-linux-x64-musl-0.1.11.tgz",
|
||||
"integrity": "sha512-5j6Pmc+Wzv5lSxVP6quA7teYRJXibkZqQyYGfTDnTsUOO5dPpcojpqlXlkhyvsA1OAQTj4uxbOCciN3cVWwzug==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-linux-x64-musl/-/davey-linux-x64-musl-0.1.12.tgz",
|
||||
"integrity": "sha512-LLNnO+hfG41ymeI+O1YHo5/0h3aKaetUNLdkBwpdJsjoyKMXZaeCnB+aHNkkupJCMPmWS0g6iPMCHUOqZSBcTg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -2546,9 +2546,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-wasm32-wasi": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-wasm32-wasi/-/davey-wasm32-wasi-0.1.11.tgz",
|
||||
"integrity": "sha512-rKOwZ/0J8lp+4VEyOdMDBRP9KR+PksZpa9V1Qn0veMzy4FqTVKthkxwGqewheFe0SFg9fdvt798l/PBFrfDeZw==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-wasm32-wasi/-/davey-wasm32-wasi-0.1.12.tgz",
|
||||
"integrity": "sha512-MPKFuqYVkDFXheR7qmtEY4FWxQ/ADfgsCojQWHi13sibUqCTR9q2F1LqNn2i9IVh3sh1sxeg87fdFMCH63pl7g==",
|
||||
"cpu": [
|
||||
"wasm32"
|
||||
],
|
||||
@@ -2556,16 +2556,16 @@
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@napi-rs/wasm-runtime": "^1.1.2"
|
||||
"@napi-rs/wasm-runtime": "^1.1.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-win32-arm64-msvc": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-win32-arm64-msvc/-/davey-win32-arm64-msvc-0.1.11.tgz",
|
||||
"integrity": "sha512-5fptJU4tX901m3mj0SHiBljMrPT4ZEsynbBhR7bK1yn9TY1jjyhN8EFi7QF5IWtUEni+0mia2BCMHZ5ZkmFZqQ==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-win32-arm64-msvc/-/davey-win32-arm64-msvc-0.1.12.tgz",
|
||||
"integrity": "sha512-Uf4OYHyfbXpzyaOqIV8/h6kv166Qni5+Bxmc1E/ov4uhhKO8qXbOky8zbVOzu0U4cv5ll3s4IQ8jDAJkx/K75Q==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -2580,9 +2580,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-win32-ia32-msvc": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-win32-ia32-msvc/-/davey-win32-ia32-msvc-0.1.11.tgz",
|
||||
"integrity": "sha512-ualexn8SeLsiMHhWfzVrzRcjHgcBapg++FPaVgJJxoh2S/jCRiklXOu3luqIZdJdNKvhe2V9SwO/cImPeIIBKw==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-win32-ia32-msvc/-/davey-win32-ia32-msvc-0.1.12.tgz",
|
||||
"integrity": "sha512-nRVbKTsb2ldcPI8D4BDA7P/UeiMEMvR+wYuUMp7H1pRD/3dF2hKo+MzUU+Pn78EhuYA3CWHItiAcS/GsPld67A==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
@@ -2597,9 +2597,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@snazzah/davey-win32-x64-msvc": {
|
||||
"version": "0.1.11",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-win32-x64-msvc/-/davey-win32-x64-msvc-0.1.11.tgz",
|
||||
"integrity": "sha512-muNhc8UKXtknzsH/w4AIkbPR2I8BuvApn0pDXar0IEvY8PCjqU/M8MPbOOEYwQVvQRMwVTgExtxzrkBPSXB4nA==",
|
||||
"version": "0.1.12",
|
||||
"resolved": "https://registry.npmjs.org/@snazzah/davey-win32-x64-msvc/-/davey-win32-x64-msvc-0.1.12.tgz",
|
||||
"integrity": "sha512-AgUA3itPDVkxQq7RIkgE1thCiWePwWjyfOZefBBxGIlMWpRUOSwF4vY9kNLnrScyJcFULdR+Zm8PwiwV8/RKnw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@@ -2614,9 +2614,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@tybys/wasm-util": {
|
||||
"version": "0.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz",
|
||||
"integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==",
|
||||
"version": "0.10.2",
|
||||
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz",
|
||||
"integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
@@ -2724,12 +2724,12 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "25.9.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.9.1.tgz",
|
||||
"integrity": "sha512-xfrlY7UD5rMJk3ZVJP8BNzS28J36YJg+xp+LPXV1TdWxr8uMH5A860QNxYDGQe/ylDSgjxE52Q9VnO7p75tJxg==",
|
||||
"version": "26.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.0.0.tgz",
|
||||
"integrity": "sha512-vf2YFi1iY9lHGwNJMs01biZFbKJkrZR1T6/MlzjhJLPdntOHLhTrDSnSVcdtvjihi4VQNlrFRIxLsDBlQpAipA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": ">=7.24.0 <7.24.7"
|
||||
"undici-types": "~8.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/stack-utils": {
|
||||
@@ -2767,17 +2767,17 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "8.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.60.0.tgz",
|
||||
"integrity": "sha512-QYb/sa74/s7OKMbACMjrYnGspj9Hs5YI5aaffSL65UfeBUzVzBJfVo3oWSpbzPurvm7yaCCo2Lk7lVj610HqKw==",
|
||||
"version": "8.61.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.61.1.tgz",
|
||||
"integrity": "sha512-ZPlVl3PB3et/59Ne0fv/sci6ZXz4T4Hp4nTJ56i/Y0gR89ARb+KphojTq6j+56E5PIezmOIOOWyY+aWQFd+IkQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.12.2",
|
||||
"@typescript-eslint/scope-manager": "8.60.0",
|
||||
"@typescript-eslint/type-utils": "8.60.0",
|
||||
"@typescript-eslint/utils": "8.60.0",
|
||||
"@typescript-eslint/visitor-keys": "8.60.0",
|
||||
"@typescript-eslint/scope-manager": "8.61.1",
|
||||
"@typescript-eslint/type-utils": "8.61.1",
|
||||
"@typescript-eslint/utils": "8.61.1",
|
||||
"@typescript-eslint/visitor-keys": "8.61.1",
|
||||
"ignore": "^7.0.5",
|
||||
"natural-compare": "^1.4.0",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
@@ -2790,22 +2790,22 @@
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/parser": "^8.60.0",
|
||||
"@typescript-eslint/parser": "^8.61.1",
|
||||
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
||||
"typescript": ">=4.8.4 <6.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "8.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.60.0.tgz",
|
||||
"integrity": "sha512-fcqpj/MyK4sxDPcbe7STNPbpQL4RLZOPWuaTmwZYuc+hJKzRf58yRxfhqGpc6PIq9ZyfSBpfHgmUHmHs0KwHwg==",
|
||||
"version": "8.61.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.61.1.tgz",
|
||||
"integrity": "sha512-PJ5vePq5/ognBbrIcoC5+SHO5dfpeLPzP9FpLkzWrguoYQEeeSjlJpVwOpo1JRSTEi7dRcwNy4h4dzV70PqHcg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "8.60.0",
|
||||
"@typescript-eslint/types": "8.60.0",
|
||||
"@typescript-eslint/typescript-estree": "8.60.0",
|
||||
"@typescript-eslint/visitor-keys": "8.60.0",
|
||||
"@typescript-eslint/scope-manager": "8.61.1",
|
||||
"@typescript-eslint/types": "8.61.1",
|
||||
"@typescript-eslint/typescript-estree": "8.61.1",
|
||||
"@typescript-eslint/visitor-keys": "8.61.1",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -2821,14 +2821,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/project-service": {
|
||||
"version": "8.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.60.0.tgz",
|
||||
"integrity": "sha512-aZu74NNKJeUWqCjDddzdiKaS82dgYgV/vmf+Ui3ZdZejmgfXR/q+pRumgobnQ2cCJTgGTWp4ypiwsuofFubavg==",
|
||||
"version": "8.61.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.61.1.tgz",
|
||||
"integrity": "sha512-PrC4JYGmR241lYnfhmKGTXkFqv8+ymbTFgSAY0fVXpY82/QkMw5TZPl+vGzuDDU2QYJk9fIDOBTntF+yDv9LEA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/tsconfig-utils": "^8.60.0",
|
||||
"@typescript-eslint/types": "^8.60.0",
|
||||
"@typescript-eslint/tsconfig-utils": "^8.61.1",
|
||||
"@typescript-eslint/types": "^8.61.1",
|
||||
"debug": "^4.4.3"
|
||||
},
|
||||
"engines": {
|
||||
@@ -2843,14 +2843,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "8.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.60.0.tgz",
|
||||
"integrity": "sha512-pFzqhllJMs+jghLQWzV00ds39xLzuyqPSev5pd8f4Ir0rtKR3ZLUB4/4dhjOFighWb9larvtfJvqL+4yKDI3Xw==",
|
||||
"version": "8.61.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.61.1.tgz",
|
||||
"integrity": "sha512-L2bdIeoQS8FlKAvONAr20w6OcLXeB+qiDKbAooS9A0Ben+iSIkBef0FxqwKWYqt5sa0i4KJtxVyVmhMylKzF5w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.60.0",
|
||||
"@typescript-eslint/visitor-keys": "8.60.0"
|
||||
"@typescript-eslint/types": "8.61.1",
|
||||
"@typescript-eslint/visitor-keys": "8.61.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -2861,9 +2861,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/tsconfig-utils": {
|
||||
"version": "8.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.60.0.tgz",
|
||||
"integrity": "sha512-BZPR3RGYlAXnly6ymAxfkVn5rCbZzQNou0rxv3GfWZ8cTQp+hhVd73khbGLAd8k1TlAPLISH337M+tAgAnaJDQ==",
|
||||
"version": "8.61.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.61.1.tgz",
|
||||
"integrity": "sha512-UN/H4di+OO7EWx2ovME+8t31YO+KVnK0RRKEHR3kOt21/Ay8BOq3M1OMvWs5vNiqcFCYGYoxK3MXPZzmMUE+yg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -2878,15 +2878,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "8.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.60.0.tgz",
|
||||
"integrity": "sha512-SX46wEUtitCpq7AN38HkUU/+zvUpdKf7ephtWAFgckH8O7PQIyL5gvrhQgBLuEYgLfuKWOVvWVskMbuFHAz5xg==",
|
||||
"version": "8.61.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.61.1.tgz",
|
||||
"integrity": "sha512-GYRicKmVK0C4fsKgaACaknOUAq9Oa2kwsjnpFhFcS/5p4Ht5IP9OVLbgIgcK4SRk92nVHFluurg1lumD9dBcLw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.60.0",
|
||||
"@typescript-eslint/typescript-estree": "8.60.0",
|
||||
"@typescript-eslint/utils": "8.60.0",
|
||||
"@typescript-eslint/types": "8.61.1",
|
||||
"@typescript-eslint/typescript-estree": "8.61.1",
|
||||
"@typescript-eslint/utils": "8.61.1",
|
||||
"debug": "^4.4.3",
|
||||
"ts-api-utils": "^2.5.0"
|
||||
},
|
||||
@@ -2903,9 +2903,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "8.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.60.0.tgz",
|
||||
"integrity": "sha512-AsE7x2XaAK+CVbeih0Fvbn+r1qHxtpLDJ3XUuFcIinT318T90yHMJC+Zgv+jUuDjQQd06HKwxnDu6sz1IcTilA==",
|
||||
"version": "8.61.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.61.1.tgz",
|
||||
"integrity": "sha512-G+CRlPqLv7Bz1IZVs03x5K59F1veqL0EJUROAdGhKsEq8qOiRiZbI+HUojPq5l0fEGOKModD9br6lObhB8zkoA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
@@ -2917,16 +2917,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "8.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.60.0.tgz",
|
||||
"integrity": "sha512-3AcZNBGMClm6CXDyo8kYvVGT/sx29sS0oBsIb9oZI2gunA4Vm2M3YHzRLPvsUBBsl+yB5FPtltq7gGH0iTlp9g==",
|
||||
"version": "8.61.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.61.1.tgz",
|
||||
"integrity": "sha512-u+oQD3BqYWPc8YV9Zab4vaJElJuwOLPRc10Jm1o/qS+6Qwen14HCWwx0Seo4LnSn2wxea2Ik8DxPt2/FHmuhrg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/project-service": "8.60.0",
|
||||
"@typescript-eslint/tsconfig-utils": "8.60.0",
|
||||
"@typescript-eslint/types": "8.60.0",
|
||||
"@typescript-eslint/visitor-keys": "8.60.0",
|
||||
"@typescript-eslint/project-service": "8.61.1",
|
||||
"@typescript-eslint/tsconfig-utils": "8.61.1",
|
||||
"@typescript-eslint/types": "8.61.1",
|
||||
"@typescript-eslint/visitor-keys": "8.61.1",
|
||||
"debug": "^4.4.3",
|
||||
"minimatch": "^10.2.2",
|
||||
"semver": "^7.7.3",
|
||||
@@ -2945,16 +2945,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "8.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.60.0.tgz",
|
||||
"integrity": "sha512-HtXuPfrHTyBDkameWpl+vJb1Uevu2tznAyahM1Oc4AENidCLTPiZDWIo4GfcxNdC/RcfGcadzzkqbRG87dUrQA==",
|
||||
"version": "8.61.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.61.1.tgz",
|
||||
"integrity": "sha512-1+P/3Dj6jvtybE1q0HQ6yBt/gq+oKJyLdEv4HdnqasaEXRSYCAsD59mXEVQnM/ULNdQxbX77tdG4jPRjIS6knA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.9.1",
|
||||
"@typescript-eslint/scope-manager": "8.60.0",
|
||||
"@typescript-eslint/types": "8.60.0",
|
||||
"@typescript-eslint/typescript-estree": "8.60.0"
|
||||
"@typescript-eslint/scope-manager": "8.61.1",
|
||||
"@typescript-eslint/types": "8.61.1",
|
||||
"@typescript-eslint/typescript-estree": "8.61.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||
@@ -2969,13 +2969,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "8.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.60.0.tgz",
|
||||
"integrity": "sha512-9WI52t8ZGLVGrPMBet25yAftqY/n95+zmoUUtJBBQTKDSKUu7OsPTroT2op7U9JatkoRccL0YkWDNMFfC4Sjxg==",
|
||||
"version": "8.61.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.61.1.tgz",
|
||||
"integrity": "sha512-6fJ9MHWtK14C1DSkiMlHUSOmrVebL7150xZJBlJiL62jjhIA4JmOq6flwBgDxIdBKKdoiZRel+dfPD5MLfny3w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "8.60.0",
|
||||
"@typescript-eslint/types": "8.61.1",
|
||||
"eslint-visitor-keys": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -4513,9 +4513,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/esbuild": {
|
||||
"version": "0.27.1",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.1.tgz",
|
||||
"integrity": "sha512-yY35KZckJJuVVPXpvjgxiCuVEJT67F6zDeVTv4rizyPrfGBUpZQsvmxnN+C371c2esD/hNMjj4tpBhuueLN7aA==",
|
||||
"version": "0.28.1",
|
||||
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz",
|
||||
"integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==",
|
||||
"dev": true,
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
@@ -4526,32 +4526,32 @@
|
||||
"node": ">=18"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@esbuild/aix-ppc64": "0.27.1",
|
||||
"@esbuild/android-arm": "0.27.1",
|
||||
"@esbuild/android-arm64": "0.27.1",
|
||||
"@esbuild/android-x64": "0.27.1",
|
||||
"@esbuild/darwin-arm64": "0.27.1",
|
||||
"@esbuild/darwin-x64": "0.27.1",
|
||||
"@esbuild/freebsd-arm64": "0.27.1",
|
||||
"@esbuild/freebsd-x64": "0.27.1",
|
||||
"@esbuild/linux-arm": "0.27.1",
|
||||
"@esbuild/linux-arm64": "0.27.1",
|
||||
"@esbuild/linux-ia32": "0.27.1",
|
||||
"@esbuild/linux-loong64": "0.27.1",
|
||||
"@esbuild/linux-mips64el": "0.27.1",
|
||||
"@esbuild/linux-ppc64": "0.27.1",
|
||||
"@esbuild/linux-riscv64": "0.27.1",
|
||||
"@esbuild/linux-s390x": "0.27.1",
|
||||
"@esbuild/linux-x64": "0.27.1",
|
||||
"@esbuild/netbsd-arm64": "0.27.1",
|
||||
"@esbuild/netbsd-x64": "0.27.1",
|
||||
"@esbuild/openbsd-arm64": "0.27.1",
|
||||
"@esbuild/openbsd-x64": "0.27.1",
|
||||
"@esbuild/openharmony-arm64": "0.27.1",
|
||||
"@esbuild/sunos-x64": "0.27.1",
|
||||
"@esbuild/win32-arm64": "0.27.1",
|
||||
"@esbuild/win32-ia32": "0.27.1",
|
||||
"@esbuild/win32-x64": "0.27.1"
|
||||
"@esbuild/aix-ppc64": "0.28.1",
|
||||
"@esbuild/android-arm": "0.28.1",
|
||||
"@esbuild/android-arm64": "0.28.1",
|
||||
"@esbuild/android-x64": "0.28.1",
|
||||
"@esbuild/darwin-arm64": "0.28.1",
|
||||
"@esbuild/darwin-x64": "0.28.1",
|
||||
"@esbuild/freebsd-arm64": "0.28.1",
|
||||
"@esbuild/freebsd-x64": "0.28.1",
|
||||
"@esbuild/linux-arm": "0.28.1",
|
||||
"@esbuild/linux-arm64": "0.28.1",
|
||||
"@esbuild/linux-ia32": "0.28.1",
|
||||
"@esbuild/linux-loong64": "0.28.1",
|
||||
"@esbuild/linux-mips64el": "0.28.1",
|
||||
"@esbuild/linux-ppc64": "0.28.1",
|
||||
"@esbuild/linux-riscv64": "0.28.1",
|
||||
"@esbuild/linux-s390x": "0.28.1",
|
||||
"@esbuild/linux-x64": "0.28.1",
|
||||
"@esbuild/netbsd-arm64": "0.28.1",
|
||||
"@esbuild/netbsd-x64": "0.28.1",
|
||||
"@esbuild/openbsd-arm64": "0.28.1",
|
||||
"@esbuild/openbsd-x64": "0.28.1",
|
||||
"@esbuild/openharmony-arm64": "0.28.1",
|
||||
"@esbuild/sunos-x64": "0.28.1",
|
||||
"@esbuild/win32-arm64": "0.28.1",
|
||||
"@esbuild/win32-ia32": "0.28.1",
|
||||
"@esbuild/win32-x64": "0.28.1"
|
||||
}
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
@@ -4717,9 +4717,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-import-resolver-typescript": {
|
||||
"version": "4.4.4",
|
||||
"resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-4.4.4.tgz",
|
||||
"integrity": "sha512-1iM2zeBvrYmUNTj2vSC/90JTHDth+dfOfiNKkxApWRsTJYNrc8rOdxxIf5vazX+BiAXTeOT0UvWpGI/7qIWQOw==",
|
||||
"version": "4.4.5",
|
||||
"resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-4.4.5.tgz",
|
||||
"integrity": "sha512-nbE5XLph6TLtGYcu/U6e6ZVXyKBhbDWK5cLGk76eJ7NdZpwf1P9EFkpt1Z01mNZNrrilsAYWKH6zUkL4reoXbw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
@@ -4880,9 +4880,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-n": {
|
||||
"version": "18.0.1",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-18.0.1.tgz",
|
||||
"integrity": "sha512-q3ARhk+eZRc7myR0KHx+R3/GJeOHF+Ir6PK95Pu2tEX8Sl/4BIpmmVLva2kPrjC2gCmn6WHlHm+3yeo6Rxhycw==",
|
||||
"version": "18.1.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-18.1.0.tgz",
|
||||
"integrity": "sha512-hkUm9EtnFV2h2fE16jNVUfCVUqvPzI7fGLsFdun5lFt/pbmf2kCgDx6ymi9rx+NCUSggBmurJCZOfG20JBs/kg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -7101,10 +7101,20 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/js-yaml": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
|
||||
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.2.0.tgz",
|
||||
"integrity": "sha512-ePWsvanv0DWuDRsW8dnt+R4jQ31SCRCQ7hhNcPXZPsoBZiemuZNYGf7adZdqX2D86j6rvKp3RpCxVTSb8WQlOw==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/puzrin"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/nodeca"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"argparse": "^2.0.1"
|
||||
@@ -7976,9 +7986,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prettier": {
|
||||
"version": "3.8.3",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.3.tgz",
|
||||
"integrity": "sha512-7igPTM53cGHMW8xWuVTydi2KO233VFiTNyF5hLJqpilHfmn8C8gPf+PS7dUT64YcXFbiMGZxS9pCSxL/Dxm/Jw==",
|
||||
"version": "3.8.4",
|
||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.4.tgz",
|
||||
"integrity": "sha512-N2MylSdi48+5N/6S5j+maeHbUSIzzZ5uOcX5Hm4QpV8Dkb1HFjfAKTKX6yNPJQD9AhcT3ifHNB66tWTTJDi11Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
@@ -9389,9 +9399,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "7.24.6",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz",
|
||||
"integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==",
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz",
|
||||
"integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/unrs-resolver": {
|
||||
|
||||
+10
-7
@@ -72,26 +72,26 @@
|
||||
"devDependencies": {
|
||||
"@jest/globals": "^30.4.1",
|
||||
"@types/ejs": "^3.1.5",
|
||||
"@types/node": "^25.9.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.60.0",
|
||||
"@typescript-eslint/parser": "^8.60.0",
|
||||
"@types/node": "^26.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.61.1",
|
||||
"@typescript-eslint/parser": "^8.61.1",
|
||||
"eslint": "^9.39.4",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
"eslint-import-resolver-typescript": "^4.4.5",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-n": "^18.0.1",
|
||||
"eslint-plugin-n": "^18.1.0",
|
||||
"eslint-plugin-promise": "^7.3.0",
|
||||
"eslint-plugin-unused-imports": "^4.4.1",
|
||||
"husky": "^9.1.7",
|
||||
"jest": "^30.4.2",
|
||||
"prettier": "^3.8.3",
|
||||
"prettier": "^3.8.4",
|
||||
"ts-jest": "^29.4.11",
|
||||
"tsup": "^8.5.1",
|
||||
"typescript": "^6.0.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@discordjs/voice": "^0.19.2",
|
||||
"@snazzah/davey": "^0.1.11",
|
||||
"@snazzah/davey": "^0.1.12",
|
||||
"ffmpeg-static": "^5.3.0",
|
||||
"libsodium-wrappers": "^0.8.4",
|
||||
"opusscript": "^0.0.8",
|
||||
@@ -105,6 +105,9 @@
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"overrides": {
|
||||
"esbuild": "^0.28.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22.22.3"
|
||||
},
|
||||
|
||||
+50
-11
@@ -82,14 +82,27 @@ export default class AudioManager {
|
||||
this.clearRenewTimer();
|
||||
this.playbackState = 'connecting';
|
||||
this.connection?.destroy();
|
||||
this.connection = joinVoiceChannel({
|
||||
const connection = joinVoiceChannel({
|
||||
guildId: this.connectionOptions.guildId,
|
||||
channelId: this.connectionOptions.channelId,
|
||||
adapterCreator: this.connectionOptions.adapterCreator,
|
||||
});
|
||||
this.connection.subscribe(this.audioPlayer);
|
||||
this.connection = connection;
|
||||
connection.subscribe(this.audioPlayer);
|
||||
|
||||
await entersState(this.connection, VoiceConnectionStatus.Ready, this.options.connectTimeoutMs);
|
||||
try {
|
||||
await entersState(connection, VoiceConnectionStatus.Ready, this.options.connectTimeoutMs);
|
||||
} catch (error) {
|
||||
connection.destroy();
|
||||
if (this.connection === connection) {
|
||||
this.connection = undefined;
|
||||
}
|
||||
this.playbackState = 'stopped';
|
||||
throw error;
|
||||
}
|
||||
if (this.connection !== connection) {
|
||||
throw new AudioManagerStateError('Voice connection was stopped before it became ready.');
|
||||
}
|
||||
this.playbackState = 'ready';
|
||||
this.scheduleRenewal();
|
||||
}
|
||||
@@ -108,17 +121,35 @@ export default class AudioManager {
|
||||
const resolvedSource = this.resolveSource();
|
||||
this.stopCurrentPlayback();
|
||||
this.ffmpeg = startFfmpeg(resolvedSource.input, this.options.ffmpeg);
|
||||
this.resource = createAudioResource(this.ffmpeg.process.stdout, {
|
||||
inputType: StreamType.Raw,
|
||||
inlineVolume: this.options.volume?.enabled === true,
|
||||
});
|
||||
const ffmpeg = this.ffmpeg;
|
||||
try {
|
||||
await ffmpeg.ready;
|
||||
if (this.ffmpeg !== ffmpeg) {
|
||||
throw new AudioManagerStateError('Playback was stopped before ffmpeg became ready.');
|
||||
}
|
||||
this.resource = createAudioResource(ffmpeg.process.stdout, {
|
||||
inputType: StreamType.Raw,
|
||||
inlineVolume: this.options.volume?.enabled === true,
|
||||
});
|
||||
} catch (error) {
|
||||
if (this.ffmpeg === ffmpeg) {
|
||||
this.stopCurrentPlayback();
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
if (this.options.volume?.enabled === true && this.options.volume.initialPercent !== undefined) {
|
||||
this.setVolume(this.options.volume.initialPercent);
|
||||
}
|
||||
|
||||
this.audioPlayer.play(this.resource);
|
||||
this.playbackState = 'playing';
|
||||
try {
|
||||
this.audioPlayer.play(this.resource);
|
||||
this.playbackState = 'playing';
|
||||
} catch (error) {
|
||||
this.stopCurrentPlayback();
|
||||
this.playbackState = 'ready';
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
public async start(): Promise<void> {
|
||||
@@ -169,7 +200,7 @@ export default class AudioManager {
|
||||
throw new AudioManagerStateError('Volume control requires volume.enabled to be true.');
|
||||
}
|
||||
|
||||
if (volumeInPercent < 0 || volumeInPercent > 100) {
|
||||
if (!Number.isFinite(volumeInPercent) || volumeInPercent < 0 || volumeInPercent > 100) {
|
||||
throw new AudioManagerConfigError('Volume must be between 0 and 100 percent.');
|
||||
}
|
||||
|
||||
@@ -227,7 +258,15 @@ export default class AudioManager {
|
||||
}
|
||||
|
||||
this.renewTimer = setTimeout(() => {
|
||||
void this.start();
|
||||
void this.start().catch(() => {
|
||||
this.clearRenewTimer();
|
||||
this.stopCurrentPlayback();
|
||||
this.audioPlayer.stop(true);
|
||||
this.connection?.disconnect();
|
||||
this.connection?.destroy();
|
||||
this.connection = undefined;
|
||||
this.playbackState = 'stopped';
|
||||
});
|
||||
}, renewIntervalMs);
|
||||
|
||||
if (typeof this.renewTimer.unref === 'function') {
|
||||
|
||||
+51
-2
@@ -3,7 +3,7 @@ import type { ChildProcessByStdio } from 'node:child_process';
|
||||
import { createRequire } from 'node:module';
|
||||
import type { Readable } from 'node:stream';
|
||||
|
||||
import { AudioManagerConfigError } from './errors';
|
||||
import { AudioManagerConfigError, FfmpegProcessError } from './errors';
|
||||
import type { FfmpegOptions } from './types';
|
||||
|
||||
const requireFromCurrentModule = createRequire(__filename);
|
||||
@@ -11,9 +11,11 @@ const requireFromCurrentModule = createRequire(__filename);
|
||||
const DEFAULT_INPUT_ARGS = ['-hide_banner', '-loglevel', 'error', '-nostdin'] as const;
|
||||
const DEFAULT_OUTPUT_ARGS = ['-vn', '-f', 's16le', '-ar', '48000', '-ac', '2', 'pipe:1'] as const;
|
||||
const FORCE_KILL_TIMEOUT_MS = 2_000;
|
||||
const STDERR_TAIL_BYTES = 4_096;
|
||||
|
||||
export type FfmpegProcessHandle = {
|
||||
process: ChildProcessByStdio<null, Readable, Readable>;
|
||||
ready: Promise<void>;
|
||||
stop(): void;
|
||||
};
|
||||
|
||||
@@ -50,18 +52,65 @@ export function startFfmpeg(input: string, options: FfmpegOptions = {}): FfmpegP
|
||||
...(options.outputArgs ?? DEFAULT_OUTPUT_ARGS),
|
||||
];
|
||||
const childProcess = spawn(executable, args, { stdio: ['ignore', 'pipe', 'pipe'] });
|
||||
const ready = waitForFfmpegOutput(childProcess);
|
||||
|
||||
childProcess.once('error', () => undefined);
|
||||
childProcess.stderr.resume();
|
||||
|
||||
return {
|
||||
process: childProcess,
|
||||
ready,
|
||||
stop: (): void => {
|
||||
stopProcess(childProcess);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function waitForFfmpegOutput(childProcess: ChildProcessByStdio<null, Readable, Readable>): Promise<void> {
|
||||
let stderrTail = '';
|
||||
|
||||
const appendStderr = (chunk: Buffer | string): void => {
|
||||
stderrTail = (stderrTail + String(chunk)).slice(-STDERR_TAIL_BYTES);
|
||||
};
|
||||
|
||||
childProcess.stderr.on('data', appendStderr);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
const cleanup = (): void => {
|
||||
childProcess.off('error', onError);
|
||||
childProcess.off('exit', onExit);
|
||||
childProcess.stdout.off('readable', onReadable);
|
||||
};
|
||||
|
||||
const fail = (message: string, cause?: unknown): void => {
|
||||
cleanup();
|
||||
reject(new FfmpegProcessError(addStderrTail(message, stderrTail), cause));
|
||||
};
|
||||
|
||||
const onError = (error: Error): void => {
|
||||
fail(`Unable to start ffmpeg. Cause: ${error.message}`, error);
|
||||
};
|
||||
|
||||
const onExit = (code: number | null, signal: NodeJS.Signals | null): void => {
|
||||
fail(`ffmpeg exited before producing audio. Exit code: ${code ?? 'none'}, signal: ${signal ?? 'none'}.`);
|
||||
};
|
||||
|
||||
const onReadable = (): void => {
|
||||
cleanup();
|
||||
resolve();
|
||||
};
|
||||
|
||||
childProcess.once('error', onError);
|
||||
childProcess.once('exit', onExit);
|
||||
childProcess.stdout.once('readable', onReadable);
|
||||
});
|
||||
}
|
||||
|
||||
function addStderrTail(message: string, stderrTail: string): string {
|
||||
const trimmedTail = stderrTail.trim();
|
||||
|
||||
return trimmedTail ? `${message} stderr: ${trimmedTail}` : message;
|
||||
}
|
||||
|
||||
function stopProcess(childProcess: ChildProcessByStdio<null, Readable, Readable>): void {
|
||||
childProcess.stdout.destroy();
|
||||
childProcess.stderr.destroy();
|
||||
|
||||
+294
-5
@@ -1,11 +1,14 @@
|
||||
import { jest, describe, beforeEach, afterEach, it, expect } from '@jest/globals';
|
||||
import { createAudioResource, entersState, joinVoiceChannel } from '@discordjs/voice';
|
||||
import { resolve } from 'node:path';
|
||||
import { PassThrough } from 'node:stream';
|
||||
|
||||
import AudioManager from '../src/audio-manager';
|
||||
import { AudioManagerConfigError, AudioManagerStateError } from '../src';
|
||||
import { AudioManagerConfigError, AudioManagerStateError, FfmpegProcessError } from '../src';
|
||||
import { startFfmpeg } from '../src/ffmpeg';
|
||||
import type { FfmpegProcessHandle } from '../src/ffmpeg';
|
||||
import type { AudioSource, VoiceConnectionOptions } from '../src';
|
||||
import type { VoiceConnection } from '@discordjs/voice';
|
||||
|
||||
const mockAudioPlayer = {
|
||||
play: jest.fn(),
|
||||
@@ -18,6 +21,13 @@ const mockConnection = {
|
||||
disconnect: jest.fn(),
|
||||
destroy: jest.fn(),
|
||||
};
|
||||
const mockSecondConnection = {
|
||||
subscribe: jest.fn(),
|
||||
disconnect: jest.fn(),
|
||||
destroy: jest.fn(),
|
||||
};
|
||||
const mockVoiceConnection = mockConnection as unknown as VoiceConnection;
|
||||
const mockSecondVoiceConnection = mockSecondConnection as unknown as VoiceConnection;
|
||||
const mockAudioResource = {
|
||||
playStream: {
|
||||
destroy: jest.fn(),
|
||||
@@ -26,10 +36,11 @@ const mockAudioResource = {
|
||||
setVolume: jest.fn(),
|
||||
},
|
||||
};
|
||||
const mockFfmpegHandle = {
|
||||
const mockFfmpegHandle: FfmpegProcessHandle = {
|
||||
process: {
|
||||
stdout: new PassThrough(),
|
||||
},
|
||||
} as unknown as FfmpegProcessHandle['process'],
|
||||
ready: Promise.resolve(),
|
||||
stop: jest.fn(),
|
||||
};
|
||||
|
||||
@@ -45,8 +56,8 @@ jest.mock('@discordjs/voice', () => ({
|
||||
},
|
||||
createAudioPlayer: jest.fn(() => mockAudioPlayer),
|
||||
createAudioResource: jest.fn(() => mockAudioResource),
|
||||
entersState: jest.fn(() => Promise.resolve(mockConnection)),
|
||||
joinVoiceChannel: jest.fn(() => mockConnection),
|
||||
entersState: jest.fn(() => Promise.resolve(mockVoiceConnection)),
|
||||
joinVoiceChannel: jest.fn(() => mockVoiceConnection),
|
||||
}));
|
||||
|
||||
jest.mock('../src/ffmpeg', () => ({
|
||||
@@ -66,6 +77,26 @@ const liveStreamSource: AudioSource = {
|
||||
|
||||
const fileSourcePath = 'tests/audio.mp3';
|
||||
const resolvedFileSourcePath = resolve(process.cwd(), fileSourcePath);
|
||||
type MockedEntersStateReturn = ReturnType<typeof entersState>;
|
||||
|
||||
function deferred<T>(): { promise: Promise<T>; resolve: (value: T) => void } {
|
||||
let resolve!: (value: T) => void;
|
||||
const promise = new Promise<T>((promiseResolve) => {
|
||||
resolve = promiseResolve;
|
||||
});
|
||||
|
||||
return { promise, resolve };
|
||||
}
|
||||
|
||||
function createMockFfmpegHandle(): FfmpegProcessHandle {
|
||||
return {
|
||||
process: {
|
||||
stdout: new PassThrough(),
|
||||
} as unknown as FfmpegProcessHandle['process'],
|
||||
ready: Promise.resolve(),
|
||||
stop: jest.fn(),
|
||||
};
|
||||
}
|
||||
|
||||
describe('AudioManager', () => {
|
||||
beforeEach(() => {
|
||||
@@ -99,6 +130,91 @@ describe('AudioManager', () => {
|
||||
expect(mockAudioPlayer.play).toHaveBeenCalledWith(mockAudioResource);
|
||||
});
|
||||
|
||||
it('cleans up when connection startup fails', async () => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
renewIntervalMs: 10_000,
|
||||
});
|
||||
jest.mocked(entersState).mockRejectedValueOnce(new Error('voice connection timeout'));
|
||||
|
||||
await expect(manager.connect()).rejects.toThrow('voice connection timeout');
|
||||
|
||||
expect(manager.state).toBe('stopped');
|
||||
expect(manager.isConnected).toBe(false);
|
||||
expect(mockConnection.subscribe).toHaveBeenCalledWith(mockAudioPlayer);
|
||||
expect(mockConnection.destroy).toHaveBeenCalledTimes(1);
|
||||
expect(jest.getTimerCount()).toBe(0);
|
||||
});
|
||||
|
||||
it('does not become ready when stopped during connection startup', async () => {
|
||||
jest.useFakeTimers();
|
||||
const ready = deferred<VoiceConnection>();
|
||||
jest.mocked(entersState).mockReturnValueOnce(ready.promise as unknown as MockedEntersStateReturn);
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
renewIntervalMs: 10_000,
|
||||
});
|
||||
|
||||
const connectPromise = manager.connect();
|
||||
await manager.stop();
|
||||
ready.resolve(mockVoiceConnection);
|
||||
|
||||
await expect(connectPromise).rejects.toThrow(AudioManagerStateError);
|
||||
|
||||
expect(manager.state).toBe('stopped');
|
||||
expect(manager.isConnected).toBe(false);
|
||||
expect(jest.getTimerCount()).toBe(0);
|
||||
});
|
||||
|
||||
it('keeps the latest connection when concurrent connects resolve out of order', async () => {
|
||||
const firstReady = deferred<VoiceConnection>();
|
||||
const secondReady = deferred<VoiceConnection>();
|
||||
jest.mocked(joinVoiceChannel)
|
||||
.mockReturnValueOnce(mockVoiceConnection)
|
||||
.mockReturnValueOnce(mockSecondVoiceConnection);
|
||||
jest.mocked(entersState)
|
||||
.mockReturnValueOnce(firstReady.promise as unknown as MockedEntersStateReturn)
|
||||
.mockReturnValueOnce(secondReady.promise as unknown as MockedEntersStateReturn);
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
renewIntervalMs: false,
|
||||
});
|
||||
|
||||
const firstConnect = manager.connect();
|
||||
const secondConnect = manager.connect();
|
||||
firstReady.resolve(mockVoiceConnection);
|
||||
secondReady.resolve(mockSecondVoiceConnection);
|
||||
|
||||
await expect(firstConnect).rejects.toThrow(AudioManagerStateError);
|
||||
await expect(secondConnect).resolves.toBeUndefined();
|
||||
|
||||
expect(manager.state).toBe('ready');
|
||||
expect(manager.isConnected).toBe(true);
|
||||
expect(mockConnection.destroy).toHaveBeenCalledTimes(1);
|
||||
expect(mockSecondConnection.destroy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('does not become ready when disposed during connection startup', async () => {
|
||||
const ready = deferred<VoiceConnection>();
|
||||
jest.mocked(entersState).mockReturnValueOnce(ready.promise as unknown as MockedEntersStateReturn);
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
renewIntervalMs: false,
|
||||
});
|
||||
|
||||
const connectPromise = manager.connect();
|
||||
manager.dispose();
|
||||
ready.resolve(mockVoiceConnection);
|
||||
|
||||
await expect(connectPromise).rejects.toThrow(AudioManagerStateError);
|
||||
|
||||
expect(manager.state).toBe('disposed');
|
||||
expect(manager.isConnected).toBe(false);
|
||||
expect(mockConnection.destroy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('starts playback with the committed mp3 test file', async () => {
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
@@ -144,6 +260,138 @@ describe('AudioManager', () => {
|
||||
expect(manager.state).toBe('playing');
|
||||
});
|
||||
|
||||
it('does not report playback when ffmpeg startup fails', async () => {
|
||||
const startupError = new FfmpegProcessError('Unable to start ffmpeg.');
|
||||
jest.mocked(startFfmpeg).mockReturnValueOnce({
|
||||
...mockFfmpegHandle,
|
||||
ready: Promise.reject(startupError),
|
||||
});
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
source: liveStreamSource,
|
||||
renewIntervalMs: false,
|
||||
});
|
||||
|
||||
await manager.connect();
|
||||
await expect(manager.play()).rejects.toBe(startupError);
|
||||
|
||||
expect(manager.state).toBe('ready');
|
||||
expect(mockAudioPlayer.play).not.toHaveBeenCalled();
|
||||
expect(mockFfmpegHandle.stop).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('cleans up when audio resource creation fails', async () => {
|
||||
const resourceError = new Error('resource failed');
|
||||
jest.mocked(createAudioResource).mockImplementationOnce(() => {
|
||||
throw resourceError;
|
||||
});
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
source: liveStreamSource,
|
||||
renewIntervalMs: false,
|
||||
});
|
||||
|
||||
await manager.connect();
|
||||
await expect(manager.play()).rejects.toBe(resourceError);
|
||||
|
||||
expect(manager.state).toBe('ready');
|
||||
expect(mockFfmpegHandle.stop).toHaveBeenCalledTimes(1);
|
||||
expect(mockAudioPlayer.play).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('cleans up when the audio player rejects playback', async () => {
|
||||
const playerError = new Error('player failed');
|
||||
mockAudioPlayer.play.mockImplementationOnce(() => {
|
||||
throw playerError;
|
||||
});
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
source: liveStreamSource,
|
||||
renewIntervalMs: false,
|
||||
});
|
||||
|
||||
await manager.connect();
|
||||
await expect(manager.play()).rejects.toBe(playerError);
|
||||
|
||||
expect(manager.state).toBe('ready');
|
||||
expect(mockFfmpegHandle.stop).toHaveBeenCalledTimes(1);
|
||||
expect(mockAudioResource.playStream.destroy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('does not report playback when stopped before ffmpeg is ready', async () => {
|
||||
const ready = deferred<void>();
|
||||
jest.mocked(startFfmpeg).mockReturnValueOnce({
|
||||
...mockFfmpegHandle,
|
||||
ready: ready.promise,
|
||||
});
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
source: liveStreamSource,
|
||||
renewIntervalMs: false,
|
||||
});
|
||||
|
||||
await manager.connect();
|
||||
const playPromise = manager.play();
|
||||
await manager.stop();
|
||||
ready.resolve();
|
||||
|
||||
await expect(playPromise).rejects.toThrow(AudioManagerStateError);
|
||||
|
||||
expect(manager.state).toBe('stopped');
|
||||
expect(mockAudioPlayer.play).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('does not report playback when disposed before ffmpeg is ready', async () => {
|
||||
const ready = deferred<void>();
|
||||
jest.mocked(startFfmpeg).mockReturnValueOnce({
|
||||
...mockFfmpegHandle,
|
||||
ready: ready.promise,
|
||||
});
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
source: liveStreamSource,
|
||||
renewIntervalMs: false,
|
||||
});
|
||||
|
||||
await manager.connect();
|
||||
const playPromise = manager.play();
|
||||
manager.dispose();
|
||||
ready.resolve();
|
||||
|
||||
await expect(playPromise).rejects.toThrow(AudioManagerStateError);
|
||||
|
||||
expect(manager.state).toBe('disposed');
|
||||
expect(mockAudioPlayer.play).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('keeps only the latest concurrent playback', async () => {
|
||||
const firstReady = deferred<void>();
|
||||
const firstHandle = {
|
||||
...createMockFfmpegHandle(),
|
||||
ready: firstReady.promise,
|
||||
};
|
||||
const secondHandle = createMockFfmpegHandle();
|
||||
jest.mocked(startFfmpeg).mockReturnValueOnce(firstHandle).mockReturnValueOnce(secondHandle);
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
source: liveStreamSource,
|
||||
renewIntervalMs: false,
|
||||
});
|
||||
|
||||
await manager.connect();
|
||||
const firstPlay = manager.play();
|
||||
const secondPlay = manager.play({ type: 'file', path: fileSourcePath });
|
||||
firstReady.resolve();
|
||||
|
||||
await expect(firstPlay).rejects.toThrow(AudioManagerStateError);
|
||||
await expect(secondPlay).resolves.toBeUndefined();
|
||||
|
||||
expect(manager.state).toBe('playing');
|
||||
expect(mockAudioPlayer.play).toHaveBeenCalledTimes(1);
|
||||
expect(firstHandle.stop).toHaveBeenCalledTimes(1);
|
||||
expect(secondHandle.stop).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('replaces active playback when a new source is played', async () => {
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
@@ -233,6 +481,12 @@ describe('AudioManager', () => {
|
||||
|
||||
expect(() => manager.setVolume(-1)).toThrow(AudioManagerConfigError);
|
||||
expect(() => manager.setVolume(101)).toThrow(AudioManagerConfigError);
|
||||
expect(() => manager.setVolume(Number.NaN)).toThrow(AudioManagerConfigError);
|
||||
expect(() => manager.setVolume(Number.POSITIVE_INFINITY)).toThrow(AudioManagerConfigError);
|
||||
expect(() => manager.setVolume(Number.NEGATIVE_INFINITY)).toThrow(AudioManagerConfigError);
|
||||
expect(() => manager.setVolume(0)).not.toThrow();
|
||||
expect(() => manager.setVolume(42)).not.toThrow();
|
||||
expect(() => manager.setVolume(100)).not.toThrow();
|
||||
});
|
||||
|
||||
it('rejects volume changes before any resource exists', () => {
|
||||
@@ -281,6 +535,20 @@ describe('AudioManager', () => {
|
||||
expect(manager.state).toBe('stopped');
|
||||
});
|
||||
|
||||
it('rejects pause and resume after stop', async () => {
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
source: liveStreamSource,
|
||||
renewIntervalMs: false,
|
||||
});
|
||||
|
||||
await manager.start();
|
||||
await manager.stop();
|
||||
|
||||
expect(() => manager.pause()).toThrow(AudioManagerStateError);
|
||||
expect(() => manager.resume()).toThrow(AudioManagerStateError);
|
||||
});
|
||||
|
||||
it('restarts playback when the renewal timer fires', async () => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
@@ -298,6 +566,27 @@ describe('AudioManager', () => {
|
||||
expect(startSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('cleans up when renewal restart fails', async () => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
const manager = new AudioManager({
|
||||
connection: connectionOptions,
|
||||
source: liveStreamSource,
|
||||
renewIntervalMs: 10_000,
|
||||
});
|
||||
const startSpy = jest.spyOn(manager, 'start').mockRejectedValue(new Error('renewal failed'));
|
||||
|
||||
await manager.connect();
|
||||
jest.advanceTimersByTime(10_000);
|
||||
await Promise.resolve();
|
||||
|
||||
expect(startSpy).toHaveBeenCalledTimes(1);
|
||||
expect(mockAudioPlayer.stop).toHaveBeenCalledWith(true);
|
||||
expect(mockConnection.destroy).toHaveBeenCalled();
|
||||
expect(manager.state).toBe('stopped');
|
||||
expect(jest.getTimerCount()).toBe(0);
|
||||
});
|
||||
|
||||
it('clears existing renewal timer before reconnecting', async () => {
|
||||
jest.useFakeTimers();
|
||||
|
||||
|
||||
+92
-4
@@ -1,6 +1,8 @@
|
||||
import { jest, describe, beforeEach, afterEach, it, expect } from '@jest/globals';
|
||||
import { spawn } from 'node:child_process';
|
||||
import type { ChildProcess } from 'node:child_process';
|
||||
|
||||
import { FfmpegProcessError } from '../src';
|
||||
import { resolveFfmpegExecutable, startFfmpeg } from '../src/ffmpeg';
|
||||
|
||||
jest.mock('node:child_process', () => ({
|
||||
@@ -12,12 +14,16 @@ const mockSpawn = jest.mocked(spawn);
|
||||
type MockChildProcess = {
|
||||
stdout: {
|
||||
destroy: jest.Mock;
|
||||
once: jest.Mock;
|
||||
off: jest.Mock;
|
||||
};
|
||||
stderr: {
|
||||
destroy: jest.Mock;
|
||||
on: jest.Mock;
|
||||
resume: jest.Mock;
|
||||
};
|
||||
once: jest.Mock;
|
||||
off: jest.Mock;
|
||||
removeAllListeners: jest.Mock;
|
||||
kill: jest.Mock;
|
||||
killed: boolean;
|
||||
@@ -29,12 +35,16 @@ function createMockChildProcess(): MockChildProcess {
|
||||
return {
|
||||
stdout: {
|
||||
destroy: jest.fn(),
|
||||
once: jest.fn(),
|
||||
off: jest.fn(),
|
||||
},
|
||||
stderr: {
|
||||
destroy: jest.fn(),
|
||||
on: jest.fn(),
|
||||
resume: jest.fn(),
|
||||
},
|
||||
once: jest.fn(),
|
||||
off: jest.fn(),
|
||||
removeAllListeners: jest.fn(),
|
||||
kill: jest.fn(),
|
||||
killed: false,
|
||||
@@ -43,6 +53,26 @@ function createMockChildProcess(): MockChildProcess {
|
||||
};
|
||||
}
|
||||
|
||||
function mockSpawnReturn(childProcess: MockChildProcess): void {
|
||||
mockSpawn.mockReturnValue(childProcess as unknown as ChildProcess);
|
||||
}
|
||||
|
||||
function getProcessHandler(childProcess: MockChildProcess, eventName: string): (...args: unknown[]) => void {
|
||||
return childProcess.once.mock.calls.find(([event]) => event === eventName)?.[1] as (...args: unknown[]) => void;
|
||||
}
|
||||
|
||||
function getStdoutHandler(childProcess: MockChildProcess, eventName: string): (...args: unknown[]) => void {
|
||||
return childProcess.stdout.once.mock.calls.find(([event]) => event === eventName)?.[1] as (
|
||||
...args: unknown[]
|
||||
) => void;
|
||||
}
|
||||
|
||||
function getStderrHandler(childProcess: MockChildProcess, eventName: string): (...args: unknown[]) => void {
|
||||
return childProcess.stderr.on.mock.calls.find(([event]) => event === eventName)?.[1] as (
|
||||
...args: unknown[]
|
||||
) => void;
|
||||
}
|
||||
|
||||
describe('ffmpeg helpers', () => {
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
@@ -63,7 +93,7 @@ describe('ffmpeg helpers', () => {
|
||||
|
||||
it('spawns ffmpeg with the default argument set', () => {
|
||||
const childProcess = createMockChildProcess();
|
||||
mockSpawn.mockReturnValue(childProcess);
|
||||
mockSpawnReturn(childProcess);
|
||||
|
||||
startFfmpeg('https://synradiode.stream.laut.fm/synradiode');
|
||||
|
||||
@@ -88,12 +118,70 @@ describe('ffmpeg helpers', () => {
|
||||
{ stdio: ['ignore', 'pipe', 'pipe'] },
|
||||
);
|
||||
expect(childProcess.once).toHaveBeenCalledWith('error', expect.any(Function));
|
||||
expect(childProcess.once).toHaveBeenCalledWith('exit', expect.any(Function));
|
||||
expect(childProcess.stdout.once).toHaveBeenCalledWith('readable', expect.any(Function));
|
||||
expect(childProcess.stderr.on).toHaveBeenCalledWith('data', expect.any(Function));
|
||||
expect(childProcess.stderr.resume).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('rejects readiness when ffmpeg startup emits an error', async () => {
|
||||
const childProcess = createMockChildProcess();
|
||||
mockSpawnReturn(childProcess);
|
||||
|
||||
const handle = startFfmpeg('tests/audio.mp3');
|
||||
const errorHandler = getProcessHandler(childProcess, 'error');
|
||||
|
||||
errorHandler(new Error('spawn ENOENT'));
|
||||
|
||||
await expect(handle.ready).rejects.toThrow(FfmpegProcessError);
|
||||
await expect(handle.ready).rejects.toThrow('spawn ENOENT');
|
||||
});
|
||||
|
||||
it('includes stderr when ffmpeg exits before producing audio', async () => {
|
||||
const childProcess = createMockChildProcess();
|
||||
mockSpawnReturn(childProcess);
|
||||
|
||||
const handle = startFfmpeg('tests/audio.mp3');
|
||||
const stderrHandler = getStderrHandler(childProcess, 'data');
|
||||
const exitHandler = getProcessHandler(childProcess, 'exit');
|
||||
|
||||
stderrHandler('invalid input');
|
||||
exitHandler(1, null);
|
||||
|
||||
await expect(handle.ready).rejects.toThrow('invalid input');
|
||||
});
|
||||
|
||||
it('keeps the useful tail of long ffmpeg stderr output', async () => {
|
||||
const childProcess = createMockChildProcess();
|
||||
mockSpawnReturn(childProcess);
|
||||
|
||||
const handle = startFfmpeg('tests/audio.mp3');
|
||||
const stderrHandler = getStderrHandler(childProcess, 'data');
|
||||
const exitHandler = getProcessHandler(childProcess, 'exit');
|
||||
|
||||
stderrHandler(`${'x'.repeat(5_000)}final diagnostic`);
|
||||
exitHandler(1, null);
|
||||
|
||||
await expect(handle.ready).rejects.toThrow('final diagnostic');
|
||||
});
|
||||
|
||||
it('keeps readiness resolved when ffmpeg exits after producing audio', async () => {
|
||||
const childProcess = createMockChildProcess();
|
||||
mockSpawnReturn(childProcess);
|
||||
|
||||
const handle = startFfmpeg('tests/audio.mp3');
|
||||
const readableHandler = getStdoutHandler(childProcess, 'readable');
|
||||
const exitHandler = getProcessHandler(childProcess, 'exit');
|
||||
|
||||
readableHandler();
|
||||
exitHandler(1, null);
|
||||
|
||||
await expect(handle.ready).resolves.toBeUndefined();
|
||||
});
|
||||
|
||||
it('uses custom executable and argument overrides when provided', () => {
|
||||
const childProcess = createMockChildProcess();
|
||||
mockSpawn.mockReturnValue(childProcess);
|
||||
mockSpawnReturn(childProcess);
|
||||
|
||||
startFfmpeg('tests/audio.mp3', {
|
||||
executablePath: '/custom/ffmpeg',
|
||||
@@ -111,7 +199,7 @@ describe('ffmpeg helpers', () => {
|
||||
it('stops a running child process and schedules a force kill fallback', () => {
|
||||
jest.useFakeTimers();
|
||||
const childProcess = createMockChildProcess();
|
||||
mockSpawn.mockReturnValue(childProcess);
|
||||
mockSpawnReturn(childProcess);
|
||||
|
||||
const handle = startFfmpeg('tests/audio.mp3');
|
||||
handle.stop();
|
||||
@@ -129,7 +217,7 @@ describe('ffmpeg helpers', () => {
|
||||
it('does not signal a process that already exited', () => {
|
||||
const childProcess = createMockChildProcess();
|
||||
childProcess.exitCode = 0;
|
||||
mockSpawn.mockReturnValue(childProcess);
|
||||
mockSpawnReturn(childProcess);
|
||||
|
||||
const handle = startFfmpeg('tests/audio.mp3');
|
||||
handle.stop();
|
||||
|
||||
Reference in New Issue
Block a user