mirror of
https://github.com/sern-handler/handler
synced 2026-06-06 01:16:55 +00:00
Compare commits
56 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2fd7697300 | ||
|
|
f9609ce6cd | ||
|
|
a3064aa915 | ||
|
|
0a53a48521 | ||
|
|
05037b5315 | ||
|
|
06a3e69210 | ||
|
|
74c4b77d4b | ||
|
|
d381ff568e | ||
|
|
6db5c71506 | ||
|
|
507c9e7939 | ||
|
|
09610d0501 | ||
|
|
0862bf92d0 | ||
|
|
62162f6b8c | ||
|
|
eb501db09a | ||
|
|
964848a4e2 | ||
|
|
78dead1b49 | ||
|
|
39e6d6d2f9 | ||
|
|
5aff57ed6d | ||
|
|
4095471346 | ||
|
|
f7b9c52df1 | ||
|
|
d20d01524b | ||
|
|
5684c060bc | ||
|
|
ca8b31f280 | ||
|
|
ce9a0831a6 | ||
|
|
3a32968a17 | ||
|
|
e549f8bc3e | ||
|
|
3ab73459ad | ||
|
|
16af2e996d | ||
|
|
4f9a842b0e | ||
|
|
5dfd1a1fc1 | ||
|
|
c45a10c950 | ||
|
|
b45ba34f3c | ||
|
|
facee79c90 | ||
|
|
306eee071d | ||
|
|
00d55208a0 | ||
|
|
49fad801a5 | ||
|
|
c9f44ce72b | ||
|
|
a9a2528faf | ||
|
|
529edb7da5 | ||
|
|
f236dc05e2 | ||
|
|
c78936a225 | ||
|
|
1860b898f3 | ||
|
|
fd10772a9b | ||
|
|
cd36bd8a47 | ||
|
|
dda7f41231 | ||
|
|
371a57194c | ||
|
|
bfcc160a39 | ||
|
|
86fa531eb6 | ||
|
|
58052e94cb | ||
|
|
96f4281121 | ||
|
|
f9ae7c003b | ||
|
|
ec211d5a8d | ||
|
|
3faf83bbf7 | ||
|
|
8eed099503 | ||
|
|
e2874be4e7 | ||
|
|
1d6751a9cd |
2
.github/workflows/continuous-integration.yml
vendored
2
.github/workflows/continuous-integration.yml
vendored
@@ -5,6 +5,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
main
|
main
|
||||||
|
paths:
|
||||||
|
- '**.ts'
|
||||||
pull_request_target:
|
pull_request_target:
|
||||||
branches:
|
branches:
|
||||||
main
|
main
|
||||||
|
|||||||
33
.github/workflows/npm-publish.yml
vendored
33
.github/workflows/npm-publish.yml
vendored
@@ -1,30 +1,23 @@
|
|||||||
name: NPM / Publish
|
name: NPM / Publish
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
workflow_dispatch:
|
||||||
types: [created]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
test-and-publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 17
|
||||||
- run: npm ci
|
- uses: pnpm/action-setup@v2
|
||||||
- run: npm test
|
|
||||||
|
|
||||||
publish-npm:
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-node@v3
|
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
run_install: |
|
||||||
registry-url: https://registry.npmjs.org/
|
- recursive: true
|
||||||
- run: npm ci
|
args: [--strict-peer-dependencies]
|
||||||
- run: npm publish
|
- run: pnpm install
|
||||||
env:
|
- run: pnpm build:prod
|
||||||
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
- uses: JS-DevTools/npm-publish@v1
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.NPM_TOKEN }}
|
||||||
|
access: "public"
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ typings/
|
|||||||
.node_repl_history
|
.node_repl_history
|
||||||
|
|
||||||
# Output of 'npm pack'
|
# Output of 'npm pack'
|
||||||
|
|
||||||
*.tgz
|
*.tgz
|
||||||
|
|
||||||
# Yarn Integrity file
|
# Yarn Integrity file
|
||||||
@@ -108,6 +109,8 @@ tsup.config.js
|
|||||||
|
|
||||||
tsconfig-base.json
|
tsconfig-base.json
|
||||||
|
|
||||||
tsconfig.cjs.json
|
tsconfig-cjs.json
|
||||||
|
|
||||||
tsconfig.esm.json
|
tsconfig-esm.json
|
||||||
|
|
||||||
|
renovate.json
|
||||||
|
|||||||
46
CHANGELOG.md
46
CHANGELOG.md
@@ -1,5 +1,51 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [2.6.1](https://github.com/sern-handler/handler/compare/v2.6.0...v2.6.1) (2023-03-17)
|
||||||
|
|
||||||
|
|
||||||
|
### Miscellaneous Chores
|
||||||
|
|
||||||
|
* release 2.6.1 ([f9609ce](https://github.com/sern-handler/handler/commit/f9609ce6cd777fa0eb595d8c48d57905bbce5966))
|
||||||
|
|
||||||
|
## [2.6.0](https://github.com/sern-handler/handler/compare/v2.5.3...v2.6.0) (2023-03-09)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* adding pure annotation for better tree shaking ([d20d015](https://github.com/sern-handler/handler/commit/d20d01524b872549da501e21feec147ab204f397))
|
||||||
|
|
||||||
|
## [2.5.3](https://github.com/sern-handler/handler/compare/v2.5.2...v2.5.3) (2023-02-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Miscellaneous Chores
|
||||||
|
|
||||||
|
* release 2.5.3 ([ce9a083](https://github.com/sern-handler/handler/commit/ce9a0831a6e47dd38648f34653f0bd89b1d2e48e))
|
||||||
|
|
||||||
|
## [2.5.2](https://github.com/sern-handler/handler/compare/v2.5.1...v2.5.2) (2023-02-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Reverts
|
||||||
|
|
||||||
|
* version ([facee79](https://github.com/sern-handler/handler/commit/facee79c904ad663d3c57ce56fb825419fcc12f9))
|
||||||
|
|
||||||
|
## [2.5.1](https://github.com/sern-handler/handler/compare/v2.5.0...v2.5.1) (2023-02-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Adding my bot to readme ([#210](https://github.com/sern-handler/handler/issues/210)) ([96f4281](https://github.com/sern-handler/handler/commit/96f42811218e4898a47e75a8138ccd452ae2c5c2))
|
||||||
|
* Adding the WIP to my bot ([86fa531](https://github.com/sern-handler/handler/commit/86fa531eb620d2ac649bad6decb29d5c55a25445))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* autocomplete ([1860b89](https://github.com/sern-handler/handler/commit/1860b898f3a231840e2a8b781e007ef9d6f587a4))
|
||||||
|
|
||||||
|
|
||||||
|
### Miscellaneous Chores
|
||||||
|
|
||||||
|
* release 2.5.1 ([c78936a](https://github.com/sern-handler/handler/commit/c78936a22574da4af71826f5b5f72f354a4eb06a))
|
||||||
|
|
||||||
## [2.5.0](https://github.com/sern-handler/handler/compare/v2.1.1...v2.5.0) (2023-01-30)
|
## [2.5.0](https://github.com/sern-handler/handler/compare/v2.1.1...v2.5.0) (2023-01-30)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
128
README.md
128
README.md
@@ -3,7 +3,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h1 align="center">Handlers. Redefined.</h1>
|
<h1 align="center">Handlers. Redefined.</h1>
|
||||||
<h4 align="center">A customizable, batteries-included, powerful discord.js framework to streamline bot development.</h4>
|
<h4 align="center">A complete, customizable, typesafe, & reactive framework for discord bots</h4>
|
||||||
|
|
||||||
<div align="center" styles="margin-top: 10px">
|
<div align="center" styles="margin-top: 10px">
|
||||||
<img src="https://img.shields.io/badge/open-source-brightgreen" />
|
<img src="https://img.shields.io/badge/open-source-brightgreen" />
|
||||||
@@ -14,6 +14,20 @@
|
|||||||
<img alt="Lines of code" src="https://img.shields.io/badge/total%20lines-2k-blue" />
|
<img alt="Lines of code" src="https://img.shields.io/badge/total%20lines-2k-blue" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
## Why?
|
||||||
|
- Most handlers don't support discord.js 14.7+
|
||||||
|
- Customizable, composable commands
|
||||||
|
- Plug and play or customize to your liking
|
||||||
|
- Embraces reactive programming for consistent and reliable backend
|
||||||
|
- Customizable logger, error handling, and more
|
||||||
|
- Active development and growing [community](https://sern.dev/discord)
|
||||||
|
## 👀 Quick Look
|
||||||
|
|
||||||
|
* Support for discord.js v14 and all interactions
|
||||||
|
* Hybrid commands
|
||||||
|
* Lightweight and customizable
|
||||||
|
* ESM, CommonJS and TypeScript support
|
||||||
|
* A powerful CLI and awesome community-made plugins
|
||||||
|
|
||||||
## 📜 Installation
|
## 📜 Installation
|
||||||
|
|
||||||
@@ -28,46 +42,56 @@ yarn add @sern/handler
|
|||||||
```sh
|
```sh
|
||||||
pnpm add @sern/handler
|
pnpm add @sern/handler
|
||||||
```
|
```
|
||||||
## Why?
|
|
||||||
- Most handlers don't support discord.js 14.7+
|
|
||||||
- Customizable commands
|
|
||||||
- Plug and play or customize to your liking
|
|
||||||
- Embraces reactive programming for consistent and reliable backend
|
|
||||||
- Customizable logger, error handling, and more
|
|
||||||
- Active development and growing [community](https://sern.dev/discord)
|
|
||||||
## 👀 Quick Look
|
|
||||||
|
|
||||||
* Support for discord.js v14 and all interactions
|
|
||||||
* Hybrid commands
|
|
||||||
* Lightweight and customizable
|
|
||||||
* ESM, CommonJS and TypeScript support
|
|
||||||
* A powerful CLI and awesome community-made plugins
|
|
||||||
|
|
||||||
## 👶 Basic Usage
|
## 👶 Basic Usage
|
||||||
|
<details open><summary>ping.ts</summary>
|
||||||
|
|
||||||
#### ` index.js (CommonJS)`
|
```ts
|
||||||
|
export default commandModule({
|
||||||
```js
|
type: CommandType.Slash,
|
||||||
// Import the discord.js Client and GatewayIntentBits
|
//Installed plugin to publish to discord api and allow access to owners only.
|
||||||
const { Client, GatewayIntentBits } = require('discord.js');
|
plugins: [publish(), ownerOnly()],
|
||||||
|
description: 'A ping pong command',
|
||||||
// Import Sern namespace
|
execute(ctx) {
|
||||||
const { Sern } = require('@sern/handler');
|
ctx.reply('Hello owner of the bot');
|
||||||
|
}
|
||||||
// Our configuration file
|
|
||||||
const { defaultPrefix, token } = require('./config.json');
|
|
||||||
|
|
||||||
const client = new Client({
|
|
||||||
intents: [
|
|
||||||
GatewayIntentBits.Guilds,
|
|
||||||
GatewayIntentBits.GuildMembers,
|
|
||||||
GatewayIntentBits.GuildMessages
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
export const useContainer = Sern.makeDependencies({
|
```
|
||||||
|
</details>
|
||||||
|
<details open><summary>modal.ts</summary>
|
||||||
|
|
||||||
|
```ts
|
||||||
|
export default commandModule({
|
||||||
|
type: CommandType.Modal,
|
||||||
|
//Installed a plugin to make sure modal fields pass a validation.
|
||||||
|
plugins : [
|
||||||
|
assertFields({
|
||||||
|
fields: {
|
||||||
|
name: /^([^0-9]*)$/
|
||||||
|
},
|
||||||
|
failure: (errors, modal) => modal.reply('your submission did not pass the validations')
|
||||||
|
})
|
||||||
|
],
|
||||||
|
execute : (modal) => {
|
||||||
|
modal.reply('thanks for the submission!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
<details open><summary>index.ts</summary>
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import { Client, GatewayIntentBits } from 'discord.js';
|
||||||
|
import { Sern, single, type Dependencies } from '@sern/handler';
|
||||||
|
|
||||||
|
//client has been declared previously
|
||||||
|
|
||||||
|
interface MyDependencies extends Dependencies {
|
||||||
|
'@sern/client': Singleton<Client>;
|
||||||
|
}
|
||||||
|
export const useContainer = Sern.makeDependencies<MyDependencies>({
|
||||||
build: root => root
|
build: root => root
|
||||||
.add({ '@sern/client': single(client) })
|
.add({ '@sern/client': single(() => client) })
|
||||||
.add({ '@sern/logger': single(new DefaultLogging()) })
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//View docs for all options
|
//View docs for all options
|
||||||
@@ -76,29 +100,21 @@ Sern.init({
|
|||||||
commands: 'src/commands',
|
commands: 'src/commands',
|
||||||
// events: 'src/events' (optional),
|
// events: 'src/events' (optional),
|
||||||
containerConfig : {
|
containerConfig : {
|
||||||
get: useContainer
|
get: useContainer
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
client.login(token);
|
client.login("YOUR_BOT_TOKEN_HERE");
|
||||||
```
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
#### ` ping.js (CommonJS)`
|
## 🤖 Bots Using sern
|
||||||
|
- [Community Bot](https://github.com/sern-handler/sern-community), the community bot for our [discord server](https://sern.dev/discord).
|
||||||
```js
|
- [Vinci](https://github.com/SrIzan10/vinci), the bot for Mara Turing.
|
||||||
const { CommandType, commandModule } = require('@sern/handler');
|
- [Bask](https://github.com/baskbotml/bask), Listen your favorite artists on Discord.
|
||||||
|
- [ava](https://github.com/SrIzan10/ava), A discord bot that plays KNGI and Gensokyo Radio.
|
||||||
exports.default = commandModule({
|
- [ALMA (WIP)](https://github.com/Benzo-Fury/ALMA), Using AI to unleash the power in your server.
|
||||||
name: 'ping',
|
- [Protector (WIP)](https://github.com/needhamgary/Protector), Just a simple bot to help enhance a private minecraft server.
|
||||||
description: 'A ping pong command',
|
|
||||||
type: CommandType.Slash,
|
|
||||||
execute(ctx) {
|
|
||||||
ctx.reply('pong!');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
```
|
|
||||||
|
|
||||||
See our [templates](https://github.com/sern-handler/templates) for TypeScript examples and more.
|
|
||||||
|
|
||||||
## 💻 CLI
|
## 💻 CLI
|
||||||
|
|
||||||
@@ -110,11 +126,7 @@ It is **highly encouraged** to use the [command line interface](https://github.c
|
|||||||
- [Support Server](https://sern.dev/discord)
|
- [Support Server](https://sern.dev/discord)
|
||||||
|
|
||||||
## 👋 Contribute
|
## 👋 Contribute
|
||||||
|
|
||||||
- Read our contribution [guidelines](https://github.com/sern-handler/handler/blob/main/.github/CONTRIBUTING.md) carefully
|
- Read our contribution [guidelines](https://github.com/sern-handler/handler/blob/main/.github/CONTRIBUTING.md) carefully
|
||||||
- Pull up on [issues](https://github.com/sern-handler/handler/issues) and report bugs
|
- Pull up on [issues](https://github.com/sern-handler/handler/issues) and report bugs
|
||||||
- All kinds of contributions are welcomed.
|
- All kinds of contributions are welcomed.
|
||||||
|
|
||||||
## 🚈 Roadmap
|
|
||||||
|
|
||||||
You can check our [roadmap](https://github.com/sern-handler/roadmap) to see what's going to be added or patched in the future.
|
|
||||||
|
|||||||
29
package.json
29
package.json
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"name": "@sern/handler",
|
"name": "@sern/handler",
|
||||||
"packageManager": "pnpm@7.25.0",
|
"packageManager": "pnpm@7.28.0",
|
||||||
"version": "2.5.0",
|
"version": "2.6.1",
|
||||||
"description": "A customizable, batteries-included, powerful discord.js framework to automate and streamline bot development.",
|
"description": "A complete, customizable, typesafe, & reactive framework for discord bots.",
|
||||||
"main": "dist/cjs/index.cjs",
|
"main": "dist/cjs/index.cjs",
|
||||||
"module": "dist/esm/index.mjs",
|
"module": "dist/esm/index.mjs",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
@@ -13,12 +13,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"watch": "tsup --watch --dts",
|
"watch": "tsup --watch",
|
||||||
"clean-modules": "rimraf node_modules/ && npm install",
|
"clean-modules": "rimraf node_modules/ && npm install",
|
||||||
"lint": "eslint src/**/*.ts",
|
"lint": "eslint src/**/*.ts",
|
||||||
"format": "eslint src/**/*.ts --fix",
|
"format": "eslint src/**/*.ts --fix",
|
||||||
"build": "tsup && node scripts/mkjson.mjs dist/cjs dist/esm && tsup --dts-only --outDir dist",
|
"build:dev": "tsup && tsup --dts-only --outDir dist",
|
||||||
"publish": "npm run build && npm publish",
|
"build:prod": "tsup --minify && tsup --dts-only --outDir dist",
|
||||||
|
"publish": "npm run build:prod && npm publish",
|
||||||
"pretty": "prettier --write ."
|
"pretty": "prettier --write ."
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@@ -34,18 +35,18 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"iti": "^0.6.0",
|
"iti": "^0.6.0",
|
||||||
"rxjs": "^7.5.6",
|
"rxjs": "^7.8.0",
|
||||||
"ts-pattern": "^4.0.6",
|
|
||||||
"ts-results-es": "^3.5.0"
|
"ts-results-es": "^3.5.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "5.47.1",
|
"@typescript-eslint/eslint-plugin": "5.54.0",
|
||||||
"@typescript-eslint/parser": "5.48.0",
|
"@typescript-eslint/parser": "5.54.0",
|
||||||
"discord.js": ">= ^14.7.x",
|
"discord.js": "^14.8.0",
|
||||||
|
"esbuild-ifdef": "^0.2.0",
|
||||||
"eslint": "8.30.0",
|
"eslint": "8.30.0",
|
||||||
"prettier": "2.8.3",
|
"prettier": "2.8.4",
|
||||||
"tsup": "^6.1.3",
|
"typescript": "4.9.5",
|
||||||
"typescript": "4.9.4"
|
"tsup": "^6.6.3"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
594
pnpm-lock.yaml
generated
594
pnpm-lock.yaml
generated
@@ -1,68 +1,76 @@
|
|||||||
lockfileVersion: 5.4
|
lockfileVersion: 5.4
|
||||||
|
|
||||||
specifiers:
|
specifiers:
|
||||||
'@typescript-eslint/eslint-plugin': 5.47.1
|
'@typescript-eslint/eslint-plugin': 5.54.0
|
||||||
'@typescript-eslint/parser': 5.48.0
|
'@typescript-eslint/parser': 5.54.0
|
||||||
discord.js: '>= ^14.7.x'
|
discord.js: ^14.8.0
|
||||||
|
esbuild-ifdef: ^0.2.0
|
||||||
eslint: 8.30.0
|
eslint: 8.30.0
|
||||||
iti: ^0.6.0
|
iti: ^0.6.0
|
||||||
prettier: 2.8.3
|
prettier: 2.8.4
|
||||||
rxjs: ^7.5.6
|
rxjs: ^7.8.0
|
||||||
ts-pattern: ^4.0.6
|
|
||||||
ts-results-es: ^3.5.0
|
ts-results-es: ^3.5.0
|
||||||
tsup: ^6.1.3
|
tsup: ^6.6.3
|
||||||
typescript: 4.9.4
|
typescript: 4.9.5
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
iti: 0.6.0
|
iti: 0.6.0
|
||||||
rxjs: 7.8.0
|
rxjs: 7.8.0
|
||||||
ts-pattern: 4.0.6
|
|
||||||
ts-results-es: 3.5.0
|
ts-results-es: 3.5.0
|
||||||
|
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@typescript-eslint/eslint-plugin': 5.47.1_ms6clkwmnrnf7qx5hae2o4lcfe
|
'@typescript-eslint/eslint-plugin': 5.54.0_mzmvz7fez5lraqzwidvcdoeocu
|
||||||
'@typescript-eslint/parser': 5.48.0_lzzuuodtsqwxnvqeq4g4likcqa
|
'@typescript-eslint/parser': 5.54.0_req3y6wneysbxs6mlxvssjag2i
|
||||||
discord.js: 14.7.1
|
discord.js: 14.8.0
|
||||||
|
esbuild-ifdef: 0.2.0_esbuild@0.15.18
|
||||||
eslint: 8.30.0
|
eslint: 8.30.0
|
||||||
prettier: 2.8.3
|
prettier: 2.8.4
|
||||||
tsup: 6.5.0_typescript@4.9.4
|
tsup: 6.6.3_typescript@4.9.5
|
||||||
typescript: 4.9.4
|
typescript: 4.9.5
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
|
|
||||||
/@discordjs/builders/1.4.0:
|
/@discordjs/builders/1.5.0:
|
||||||
resolution: {integrity: sha512-nEeTCheTTDw5kO93faM1j8ZJPonAX86qpq/QVoznnSa8WWcCgJpjlu6GylfINTDW6o7zZY0my2SYdxx2mfNwGA==}
|
resolution: {integrity: sha512-7XxT78mnNBPigHn2y6KAXkicxIBFtZREGWaRZ249EC1l6gBUEP8IyVY5JTciIjJArxkF+tg675aZvsTNTKBpmA==}
|
||||||
engines: {node: '>=16.9.0'}
|
engines: {node: '>=16.9.0'}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@discordjs/util': 0.1.0
|
'@discordjs/formatters': 0.2.0
|
||||||
|
'@discordjs/util': 0.2.0
|
||||||
'@sapphire/shapeshift': 3.8.1
|
'@sapphire/shapeshift': 3.8.1
|
||||||
discord-api-types: 0.37.24
|
discord-api-types: 0.37.35
|
||||||
fast-deep-equal: 3.1.3
|
fast-deep-equal: 3.1.3
|
||||||
ts-mixer: 6.0.2
|
ts-mixer: 6.0.3
|
||||||
tslib: 2.4.1
|
tslib: 2.5.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@discordjs/collection/1.3.0:
|
/@discordjs/collection/1.4.0:
|
||||||
resolution: {integrity: sha512-ylt2NyZ77bJbRij4h9u/wVy7qYw/aDqQLWnadjvDqW/WoWCxrsX6M3CIw9GVP5xcGCDxsrKj5e0r5evuFYwrKg==}
|
resolution: {integrity: sha512-hiOJyk2CPFf1+FL3a4VKCuu1f448LlROVuu8nLz1+jCOAPokUcdFAV+l4pd3B3h6uJlJQSASoZzrdyNdjdtfzQ==}
|
||||||
engines: {node: '>=16.9.0'}
|
engines: {node: '>=16.9.0'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@discordjs/rest/1.5.0:
|
/@discordjs/formatters/0.2.0:
|
||||||
resolution: {integrity: sha512-lXgNFqHnbmzp5u81W0+frdXN6Etf4EUi8FAPcWpSykKd8hmlWh1xy6BmE0bsJypU1pxohaA8lQCgp70NUI3uzA==}
|
resolution: {integrity: sha512-vn4oMSXuMZUm8ITqVOtvE7/fMMISj4cI5oLsR09PEQXHKeKDAMLltG/DWeeIs7Idfy6V8Fk3rn1e69h7NfzuNA==}
|
||||||
engines: {node: '>=16.9.0'}
|
engines: {node: '>=16.9.0'}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@discordjs/collection': 1.3.0
|
discord-api-types: 0.37.35
|
||||||
'@discordjs/util': 0.1.0
|
dev: true
|
||||||
|
|
||||||
|
/@discordjs/rest/1.6.0:
|
||||||
|
resolution: {integrity: sha512-HGvqNCZ5Z5j0tQHjmT1lFvE5ETO4hvomJ1r0cbnpC1zM23XhCpZ9wgTCiEmaxKz05cyf2CI9p39+9LL+6Yz1bA==}
|
||||||
|
engines: {node: '>=16.9.0'}
|
||||||
|
dependencies:
|
||||||
|
'@discordjs/collection': 1.4.0
|
||||||
|
'@discordjs/util': 0.2.0
|
||||||
'@sapphire/async-queue': 1.5.0
|
'@sapphire/async-queue': 1.5.0
|
||||||
'@sapphire/snowflake': 3.4.0
|
'@sapphire/snowflake': 3.4.0
|
||||||
discord-api-types: 0.37.24
|
discord-api-types: 0.37.35
|
||||||
file-type: 18.0.0
|
file-type: 18.2.1
|
||||||
tslib: 2.4.1
|
tslib: 2.5.0
|
||||||
undici: 5.14.0
|
undici: 5.20.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@discordjs/util/0.1.0:
|
/@discordjs/util/0.2.0:
|
||||||
resolution: {integrity: sha512-e7d+PaTLVQav6rOc2tojh2y6FE8S7REkqLldq1XF4soCx74XB/DIjbVbVLtBemf0nLW77ntz0v+o5DytKwFNLQ==}
|
resolution: {integrity: sha512-/8qNbebFzLWKOOg+UV+RB8itp4SmU5jw0tBUD3ifElW6rYNOj1Ku5JaSW7lLl/WgjjxF01l/1uQPCzkwr110vg==}
|
||||||
engines: {node: '>=16.9.0'}
|
engines: {node: '>=16.9.0'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
@@ -75,6 +83,96 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/android-arm/0.17.11:
|
||||||
|
resolution: {integrity: sha512-CdyX6sRVh1NzFCsf5vw3kULwlAhfy9wVt8SZlrhQ7eL2qBjGbFhRBWkkAzuZm9IIEOCKJw4DXA6R85g+qc8RDw==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [arm]
|
||||||
|
os: [android]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/android-arm64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-QnK4d/zhVTuV4/pRM4HUjcsbl43POALU2zvBynmrrqZt9LPcLA3x1fTZPBg2RRguBQnJcnU059yKr+bydkntjg==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [android]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/android-x64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-3PL3HKtsDIXGQcSCKtWD/dy+mgc4p2Tvo2qKgKHj9Yf+eniwFnuoQ0OUhlSfAEpKAFzF9N21Nwgnap6zy3L3MQ==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [android]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/darwin-arm64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-pJ950bNKgzhkGNO3Z9TeHzIFtEyC2GDQL3wxkMApDEghYx5Qers84UTNc1bAxWbRkuJOgmOha5V0WUeh8G+YGw==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [darwin]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/darwin-x64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-iB0dQkIHXyczK3BZtzw1tqegf0F0Ab5texX2TvMQjiJIWXAfM4FQl7D909YfXWnB92OQz4ivBYQ2RlxBJrMJOw==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [darwin]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/freebsd-arm64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-7EFzUADmI1jCHeDRGKgbnF5sDIceZsQGapoO6dmw7r/ZBEKX7CCDnIz8m9yEclzr7mFsd+DyasHzpjfJnmBB1Q==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [freebsd]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/freebsd-x64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-iPgenptC8i8pdvkHQvXJFzc1eVMR7W2lBPrTE6GbhR54sLcF42mk3zBOjKPOodezzuAz/KSu8CPyFSjcBMkE9g==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [freebsd]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/linux-arm/0.17.11:
|
||||||
|
resolution: {integrity: sha512-M9iK/d4lgZH0U5M1R2p2gqhPV/7JPJcRz+8O8GBKVgqndTzydQ7B2XGDbxtbvFkvIs53uXTobOhv+RyaqhUiMg==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [arm]
|
||||||
|
os: [linux]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/linux-arm64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-Qxth3gsWWGKz2/qG2d5DsW/57SeA2AmpSMhdg9TSB5Svn2KDob3qxfQSkdnWjSd42kqoxIPy3EJFs+6w1+6Qjg==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [linux]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/linux-ia32/0.17.11:
|
||||||
|
resolution: {integrity: sha512-dB1nGaVWtUlb/rRDHmuDQhfqazWE0LMro/AIbT2lWM3CDMHJNpLckH+gCddQyhhcLac2OYw69ikUMO34JLt3wA==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [ia32]
|
||||||
|
os: [linux]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
/@esbuild/linux-loong64/0.15.18:
|
/@esbuild/linux-loong64/0.15.18:
|
||||||
resolution: {integrity: sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==}
|
resolution: {integrity: sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -84,14 +182,122 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
/@eslint/eslintrc/1.4.0:
|
/@esbuild/linux-loong64/0.17.11:
|
||||||
resolution: {integrity: sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==}
|
resolution: {integrity: sha512-aCWlq70Q7Nc9WDnormntGS1ar6ZFvUpqr8gXtO+HRejRYPweAFQN615PcgaSJkZjhHp61+MNLhzyVALSF2/Q0g==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [loong64]
|
||||||
|
os: [linux]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/linux-mips64el/0.17.11:
|
||||||
|
resolution: {integrity: sha512-cGeGNdQxqY8qJwlYH1BP6rjIIiEcrM05H7k3tR7WxOLmD1ZxRMd6/QIOWMb8mD2s2YJFNRuNQ+wjMhgEL2oCEw==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [mips64el]
|
||||||
|
os: [linux]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/linux-ppc64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-BdlziJQPW/bNe0E8eYsHB40mYOluS+jULPCjlWiHzDgr+ZBRXPtgMV1nkLEGdpjrwgmtkZHEGEPaKdS/8faLDA==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [ppc64]
|
||||||
|
os: [linux]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/linux-riscv64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-MDLwQbtF+83oJCI1Cixn68Et/ME6gelmhssPebC40RdJaect+IM+l7o/CuG0ZlDs6tZTEIoxUe53H3GmMn8oMA==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [riscv64]
|
||||||
|
os: [linux]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/linux-s390x/0.17.11:
|
||||||
|
resolution: {integrity: sha512-4N5EMESvws0Ozr2J94VoUD8HIRi7X0uvUv4c0wpTHZyZY9qpaaN7THjosdiW56irQ4qnJ6Lsc+i+5zGWnyqWqQ==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [s390x]
|
||||||
|
os: [linux]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/linux-x64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-rM/v8UlluxpytFSmVdbCe1yyKQd/e+FmIJE2oPJvbBo+D0XVWi1y/NQ4iTNx+436WmDHQBjVLrbnAQLQ6U7wlw==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [linux]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/netbsd-x64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-4WaAhuz5f91h3/g43VBGdto1Q+X7VEZfpcWGtOFXnggEuLvjV+cP6DyLRU15IjiU9fKLLk41OoJfBFN5DhPvag==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [netbsd]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/openbsd-x64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-UBj135Nx4FpnvtE+C8TWGp98oUgBcmNmdYgl5ToKc0mBHxVVqVE7FUS5/ELMImOp205qDAittL6Ezhasc2Ev/w==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [openbsd]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/sunos-x64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-1/gxTifDC9aXbV2xOfCbOceh5AlIidUrPsMpivgzo8P8zUtczlq1ncFpeN1ZyQJ9lVs2hILy1PG5KPp+w8QPPg==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [sunos]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/win32-arm64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-vtSfyx5yRdpiOW9yp6Ax0zyNOv9HjOAw8WaZg3dF5djEHKKm3UnoohftVvIJtRh0Ec7Hso0RIdTqZvPXJ7FdvQ==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [arm64]
|
||||||
|
os: [win32]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/win32-ia32/0.17.11:
|
||||||
|
resolution: {integrity: sha512-GFPSLEGQr4wHFTiIUJQrnJKZhZjjq4Sphf+mM76nQR6WkQn73vm7IsacmBRPkALfpOCHsopSvLgqdd4iUW2mYw==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [ia32]
|
||||||
|
os: [win32]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@esbuild/win32-x64/0.17.11:
|
||||||
|
resolution: {integrity: sha512-N9vXqLP3eRL8BqSy8yn4Y98cZI2pZ8fyuHx6lKjiG2WABpT2l01TXdzq5Ma2ZUBzfB7tx5dXVhge8X9u0S70ZQ==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
cpu: [x64]
|
||||||
|
os: [win32]
|
||||||
|
requiresBuild: true
|
||||||
|
dev: true
|
||||||
|
optional: true
|
||||||
|
|
||||||
|
/@eslint/eslintrc/1.4.1:
|
||||||
|
resolution: {integrity: sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
dependencies:
|
dependencies:
|
||||||
ajv: 6.12.6
|
ajv: 6.12.6
|
||||||
debug: 4.3.4
|
debug: 4.3.4
|
||||||
espree: 9.4.1
|
espree: 9.4.1
|
||||||
globals: 13.19.0
|
globals: 13.20.0
|
||||||
ignore: 5.2.4
|
ignore: 5.2.4
|
||||||
import-fresh: 3.3.0
|
import-fresh: 3.3.0
|
||||||
js-yaml: 4.1.0
|
js-yaml: 4.1.0
|
||||||
@@ -139,7 +345,7 @@ packages:
|
|||||||
engines: {node: '>= 8'}
|
engines: {node: '>= 8'}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@nodelib/fs.scandir': 2.1.5
|
'@nodelib/fs.scandir': 2.1.5
|
||||||
fastq: 1.14.0
|
fastq: 1.15.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@sapphire/async-queue/1.5.0:
|
/@sapphire/async-queue/1.5.0:
|
||||||
@@ -168,22 +374,22 @@ packages:
|
|||||||
resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==}
|
resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/node/18.11.18:
|
/@types/node/18.14.0:
|
||||||
resolution: {integrity: sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==}
|
resolution: {integrity: sha512-5EWrvLmglK+imbCJY0+INViFWUHg1AHel1sq4ZVSfdcNqGy9Edv3UB9IIzzg+xPaUcAgZYcfVs2fBcwDeZzU0A==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/semver/7.3.13:
|
/@types/semver/7.3.13:
|
||||||
resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==}
|
resolution: {integrity: sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/ws/8.5.3:
|
/@types/ws/8.5.4:
|
||||||
resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==}
|
resolution: {integrity: sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': 18.11.18
|
'@types/node': 18.14.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/eslint-plugin/5.47.1_ms6clkwmnrnf7qx5hae2o4lcfe:
|
/@typescript-eslint/eslint-plugin/5.54.0_mzmvz7fez5lraqzwidvcdoeocu:
|
||||||
resolution: {integrity: sha512-r4RZ2Jl9kcQN7K/dcOT+J7NAimbiis4sSM9spvWimsBvDegMhKLA5vri2jG19PmIPbDjPeWzfUPQ2hjEzA4Nmg==}
|
resolution: {integrity: sha512-+hSN9BdSr629RF02d7mMtXhAJvDTyCbprNYJKrXETlul/Aml6YZwd90XioVbjejQeHbb3R8Dg0CkRgoJDxo8aw==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@typescript-eslint/parser': ^5.0.0
|
'@typescript-eslint/parser': ^5.0.0
|
||||||
@@ -193,24 +399,25 @@ packages:
|
|||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/parser': 5.48.0_lzzuuodtsqwxnvqeq4g4likcqa
|
'@typescript-eslint/parser': 5.54.0_req3y6wneysbxs6mlxvssjag2i
|
||||||
'@typescript-eslint/scope-manager': 5.47.1
|
'@typescript-eslint/scope-manager': 5.54.0
|
||||||
'@typescript-eslint/type-utils': 5.47.1_lzzuuodtsqwxnvqeq4g4likcqa
|
'@typescript-eslint/type-utils': 5.54.0_req3y6wneysbxs6mlxvssjag2i
|
||||||
'@typescript-eslint/utils': 5.47.1_lzzuuodtsqwxnvqeq4g4likcqa
|
'@typescript-eslint/utils': 5.54.0_req3y6wneysbxs6mlxvssjag2i
|
||||||
debug: 4.3.4
|
debug: 4.3.4
|
||||||
eslint: 8.30.0
|
eslint: 8.30.0
|
||||||
|
grapheme-splitter: 1.0.4
|
||||||
ignore: 5.2.4
|
ignore: 5.2.4
|
||||||
natural-compare-lite: 1.4.0
|
natural-compare-lite: 1.4.0
|
||||||
regexpp: 3.2.0
|
regexpp: 3.2.0
|
||||||
semver: 7.3.8
|
semver: 7.3.8
|
||||||
tsutils: 3.21.0_typescript@4.9.4
|
tsutils: 3.21.0_typescript@4.9.5
|
||||||
typescript: 4.9.4
|
typescript: 4.9.5
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/parser/5.48.0_lzzuuodtsqwxnvqeq4g4likcqa:
|
/@typescript-eslint/parser/5.54.0_req3y6wneysbxs6mlxvssjag2i:
|
||||||
resolution: {integrity: sha512-1mxNA8qfgxX8kBvRDIHEzrRGrKHQfQlbW6iHyfHYS0Q4X1af+S6mkLNtgCOsGVl8+/LUPrqdHMssAemkrQ01qg==}
|
resolution: {integrity: sha512-aAVL3Mu2qTi+h/r04WI/5PfNWvO6pdhpeMRWk9R7rEV4mwJNzoWf5CCU5vDKBsPIFQFjEq1xg7XBI2rjiMXQbQ==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||||
@@ -219,34 +426,26 @@ packages:
|
|||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/scope-manager': 5.48.0
|
'@typescript-eslint/scope-manager': 5.54.0
|
||||||
'@typescript-eslint/types': 5.48.0
|
'@typescript-eslint/types': 5.54.0
|
||||||
'@typescript-eslint/typescript-estree': 5.48.0_typescript@4.9.4
|
'@typescript-eslint/typescript-estree': 5.54.0_typescript@4.9.5
|
||||||
debug: 4.3.4
|
debug: 4.3.4
|
||||||
eslint: 8.30.0
|
eslint: 8.30.0
|
||||||
typescript: 4.9.4
|
typescript: 4.9.5
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/scope-manager/5.47.1:
|
/@typescript-eslint/scope-manager/5.54.0:
|
||||||
resolution: {integrity: sha512-9hsFDsgUwrdOoW1D97Ewog7DYSHaq4WKuNs0LHF9RiCmqB0Z+XRR4Pf7u7u9z/8CciHuJ6yxNws1XznI3ddjEw==}
|
resolution: {integrity: sha512-VTPYNZ7vaWtYna9M4oD42zENOBrb+ZYyCNdFs949GcN8Miwn37b8b7eMj+EZaq7VK9fx0Jd+JhmkhjFhvnovhg==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/types': 5.47.1
|
'@typescript-eslint/types': 5.54.0
|
||||||
'@typescript-eslint/visitor-keys': 5.47.1
|
'@typescript-eslint/visitor-keys': 5.54.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/scope-manager/5.48.0:
|
/@typescript-eslint/type-utils/5.54.0_req3y6wneysbxs6mlxvssjag2i:
|
||||||
resolution: {integrity: sha512-0AA4LviDtVtZqlyUQnZMVHydDATpD9SAX/RC5qh6cBd3xmyWvmXYF+WT1oOmxkeMnWDlUVTwdODeucUnjz3gow==}
|
resolution: {integrity: sha512-WI+WMJ8+oS+LyflqsD4nlXMsVdzTMYTxl16myXPaCXnSgc7LWwMsjxQFZCK/rVmTZ3FN71Ct78ehO9bRC7erYQ==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
|
||||||
dependencies:
|
|
||||||
'@typescript-eslint/types': 5.48.0
|
|
||||||
'@typescript-eslint/visitor-keys': 5.48.0
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@typescript-eslint/type-utils/5.47.1_lzzuuodtsqwxnvqeq4g4likcqa:
|
|
||||||
resolution: {integrity: sha512-/UKOeo8ee80A7/GJA427oIrBi/Gd4osk/3auBUg4Rn9EahFpevVV1mUK8hjyQD5lHPqX397x6CwOk5WGh1E/1w==}
|
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: '*'
|
eslint: '*'
|
||||||
@@ -255,28 +454,23 @@ packages:
|
|||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/typescript-estree': 5.47.1_typescript@4.9.4
|
'@typescript-eslint/typescript-estree': 5.54.0_typescript@4.9.5
|
||||||
'@typescript-eslint/utils': 5.47.1_lzzuuodtsqwxnvqeq4g4likcqa
|
'@typescript-eslint/utils': 5.54.0_req3y6wneysbxs6mlxvssjag2i
|
||||||
debug: 4.3.4
|
debug: 4.3.4
|
||||||
eslint: 8.30.0
|
eslint: 8.30.0
|
||||||
tsutils: 3.21.0_typescript@4.9.4
|
tsutils: 3.21.0_typescript@4.9.5
|
||||||
typescript: 4.9.4
|
typescript: 4.9.5
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/types/5.47.1:
|
/@typescript-eslint/types/5.54.0:
|
||||||
resolution: {integrity: sha512-CmALY9YWXEpwuu6377ybJBZdtSAnzXLSQcxLSqSQSbC7VfpMu/HLVdrnVJj7ycI138EHqocW02LPJErE35cE9A==}
|
resolution: {integrity: sha512-nExy+fDCBEgqblasfeE3aQ3NuafBUxZxgxXcYfzYRZFHdVvk5q60KhCSkG0noHgHRo/xQ/BOzURLZAafFpTkmQ==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/types/5.48.0:
|
/@typescript-eslint/typescript-estree/5.54.0_typescript@4.9.5:
|
||||||
resolution: {integrity: sha512-UTe67B0Ypius0fnEE518NB2N8gGutIlTojeTg4nt0GQvikReVkurqxd2LvYa9q9M5MQ6rtpNyWTBxdscw40Xhw==}
|
resolution: {integrity: sha512-X2rJG97Wj/VRo5YxJ8Qx26Zqf0RRKsVHd4sav8NElhbZzhpBI8jU54i6hfo9eheumj4oO4dcRN1B/zIVEqR/MQ==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@typescript-eslint/typescript-estree/5.47.1_typescript@4.9.4:
|
|
||||||
resolution: {integrity: sha512-4+ZhFSuISAvRi2xUszEj0xXbNTHceV9GbH9S8oAD2a/F9SW57aJNQVOCxG8GPfSWH/X4eOPdMEU2jYVuWKEpWA==}
|
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
typescript: '*'
|
typescript: '*'
|
||||||
@@ -284,50 +478,29 @@ packages:
|
|||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/types': 5.47.1
|
'@typescript-eslint/types': 5.54.0
|
||||||
'@typescript-eslint/visitor-keys': 5.47.1
|
'@typescript-eslint/visitor-keys': 5.54.0
|
||||||
debug: 4.3.4
|
debug: 4.3.4
|
||||||
globby: 11.1.0
|
globby: 11.1.0
|
||||||
is-glob: 4.0.3
|
is-glob: 4.0.3
|
||||||
semver: 7.3.8
|
semver: 7.3.8
|
||||||
tsutils: 3.21.0_typescript@4.9.4
|
tsutils: 3.21.0_typescript@4.9.5
|
||||||
typescript: 4.9.4
|
typescript: 4.9.5
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/typescript-estree/5.48.0_typescript@4.9.4:
|
/@typescript-eslint/utils/5.54.0_req3y6wneysbxs6mlxvssjag2i:
|
||||||
resolution: {integrity: sha512-7pjd94vvIjI1zTz6aq/5wwE/YrfIyEPLtGJmRfyNR9NYIW+rOvzzUv3Cmq2hRKpvt6e9vpvPUQ7puzX7VSmsEw==}
|
resolution: {integrity: sha512-cuwm8D/Z/7AuyAeJ+T0r4WZmlnlxQ8wt7C7fLpFlKMR+dY6QO79Cq1WpJhvZbMA4ZeZGHiRWnht7ZJ8qkdAunw==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
|
||||||
peerDependencies:
|
|
||||||
typescript: '*'
|
|
||||||
peerDependenciesMeta:
|
|
||||||
typescript:
|
|
||||||
optional: true
|
|
||||||
dependencies:
|
|
||||||
'@typescript-eslint/types': 5.48.0
|
|
||||||
'@typescript-eslint/visitor-keys': 5.48.0
|
|
||||||
debug: 4.3.4
|
|
||||||
globby: 11.1.0
|
|
||||||
is-glob: 4.0.3
|
|
||||||
semver: 7.3.8
|
|
||||||
tsutils: 3.21.0_typescript@4.9.4
|
|
||||||
typescript: 4.9.4
|
|
||||||
transitivePeerDependencies:
|
|
||||||
- supports-color
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@typescript-eslint/utils/5.47.1_lzzuuodtsqwxnvqeq4g4likcqa:
|
|
||||||
resolution: {integrity: sha512-l90SdwqfmkuIVaREZ2ykEfCezepCLxzWMo5gVfcJsJCaT4jHT+QjgSkYhs5BMQmWqE9k3AtIfk4g211z/sTMVw==}
|
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/json-schema': 7.0.11
|
'@types/json-schema': 7.0.11
|
||||||
'@types/semver': 7.3.13
|
'@types/semver': 7.3.13
|
||||||
'@typescript-eslint/scope-manager': 5.47.1
|
'@typescript-eslint/scope-manager': 5.54.0
|
||||||
'@typescript-eslint/types': 5.47.1
|
'@typescript-eslint/types': 5.54.0
|
||||||
'@typescript-eslint/typescript-estree': 5.47.1_typescript@4.9.4
|
'@typescript-eslint/typescript-estree': 5.54.0_typescript@4.9.5
|
||||||
eslint: 8.30.0
|
eslint: 8.30.0
|
||||||
eslint-scope: 5.1.1
|
eslint-scope: 5.1.1
|
||||||
eslint-utils: 3.0.0_eslint@8.30.0
|
eslint-utils: 3.0.0_eslint@8.30.0
|
||||||
@@ -337,32 +510,24 @@ packages:
|
|||||||
- typescript
|
- typescript
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/visitor-keys/5.47.1:
|
/@typescript-eslint/visitor-keys/5.54.0:
|
||||||
resolution: {integrity: sha512-rF3pmut2JCCjh6BLRhNKdYjULMb1brvoaiWDlHfLNVgmnZ0sBVJrs3SyaKE1XoDDnJuAx/hDQryHYmPUuNq0ig==}
|
resolution: {integrity: sha512-xu4wT7aRCakGINTLGeyGqDn+78BwFlggwBjnHa1ar/KaGagnmwLYmlrXIrgAaQ3AE1Vd6nLfKASm7LrFHNbKGA==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/types': 5.47.1
|
'@typescript-eslint/types': 5.54.0
|
||||||
eslint-visitor-keys: 3.3.0
|
eslint-visitor-keys: 3.3.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/visitor-keys/5.48.0:
|
/acorn-jsx/5.3.2_acorn@8.8.2:
|
||||||
resolution: {integrity: sha512-5motVPz5EgxQ0bHjut3chzBkJ3Z3sheYVcSwS5BpHZpLqSptSmELNtGixmgj65+rIfhvtQTz5i9OP2vtzdDH7Q==}
|
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
|
||||||
dependencies:
|
|
||||||
'@typescript-eslint/types': 5.48.0
|
|
||||||
eslint-visitor-keys: 3.3.0
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/acorn-jsx/5.3.2_acorn@8.8.1:
|
|
||||||
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
|
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
|
acorn: ^6.0.0 || ^7.0.0 || ^8.0.0
|
||||||
dependencies:
|
dependencies:
|
||||||
acorn: 8.8.1
|
acorn: 8.8.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/acorn/8.8.1:
|
/acorn/8.8.2:
|
||||||
resolution: {integrity: sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==}
|
resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==}
|
||||||
engines: {node: '>=0.4.0'}
|
engines: {node: '>=0.4.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dev: true
|
dev: true
|
||||||
@@ -432,13 +597,13 @@ packages:
|
|||||||
fill-range: 7.0.1
|
fill-range: 7.0.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/bundle-require/3.1.2_esbuild@0.15.18:
|
/bundle-require/4.0.1_esbuild@0.17.11:
|
||||||
resolution: {integrity: sha512-Of6l6JBAxiyQ5axFxUM6dYeP/W7X2Sozeo/4EYB9sJhL+dqL7TKjg+shwxp6jlu/6ZSERfsYtIpSJ1/x3XkAEA==}
|
resolution: {integrity: sha512-9NQkRHlNdNpDBGmLpngF3EFDcwodhMUuLz9PaWYciVcQF9SE4LFjM2DB/xV1Li5JiuDMv7ZUWuC3rGbqR0MAXQ==}
|
||||||
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
esbuild: '>=0.13'
|
esbuild: '>=0.17'
|
||||||
dependencies:
|
dependencies:
|
||||||
esbuild: 0.15.18
|
esbuild: 0.17.11
|
||||||
load-tsconfig: 0.2.3
|
load-tsconfig: 0.2.3
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
@@ -534,26 +699,27 @@ packages:
|
|||||||
path-type: 4.0.0
|
path-type: 4.0.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/discord-api-types/0.37.24:
|
/discord-api-types/0.37.35:
|
||||||
resolution: {integrity: sha512-1+Fb4huJCihdbkJLcq2p7nBmtlmAryNwjefT8wwJnL8c7bc7WA87Oaa5mbLe96QvZyfwnwRCDX40H0HhcVV50g==}
|
resolution: {integrity: sha512-iyKZ/82k7FX3lcmHiAvvWu5TmyfVo78RtghBV/YsehK6CID83k5SI03DKKopBcln+TiEIYw5MGgq7SJXSpNzMg==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/discord.js/14.7.1:
|
/discord.js/14.8.0:
|
||||||
resolution: {integrity: sha512-1FECvqJJjjeYcjSm0IGMnPxLqja/pmG1B0W2l3lUY2Gi4KXiyTeQmU1IxWcbXHn2k+ytP587mMWqva2IA87EbA==}
|
resolution: {integrity: sha512-UOxYtc/YnV7jAJ2gISluJyYeBw4e+j8gWn+IoqG8unaHAVuvZ13DdYN0M1f9fbUgUvSarV798inIrYFtDNDjwQ==}
|
||||||
engines: {node: '>=16.9.0'}
|
engines: {node: '>=16.9.0'}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@discordjs/builders': 1.4.0
|
'@discordjs/builders': 1.5.0
|
||||||
'@discordjs/collection': 1.3.0
|
'@discordjs/collection': 1.4.0
|
||||||
'@discordjs/rest': 1.5.0
|
'@discordjs/formatters': 0.2.0
|
||||||
'@discordjs/util': 0.1.0
|
'@discordjs/rest': 1.6.0
|
||||||
|
'@discordjs/util': 0.2.0
|
||||||
'@sapphire/snowflake': 3.4.0
|
'@sapphire/snowflake': 3.4.0
|
||||||
'@types/ws': 8.5.3
|
'@types/ws': 8.5.4
|
||||||
discord-api-types: 0.37.24
|
discord-api-types: 0.37.35
|
||||||
fast-deep-equal: 3.1.3
|
fast-deep-equal: 3.1.3
|
||||||
lodash.snakecase: 4.1.1
|
lodash.snakecase: 4.1.1
|
||||||
tslib: 2.4.1
|
tslib: 2.5.0
|
||||||
undici: 5.14.0
|
undici: 5.20.0
|
||||||
ws: 8.11.0
|
ws: 8.12.1
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- bufferutil
|
- bufferutil
|
||||||
- utf-8-validate
|
- utf-8-validate
|
||||||
@@ -620,6 +786,14 @@ packages:
|
|||||||
dev: true
|
dev: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
/esbuild-ifdef/0.2.0_esbuild@0.15.18:
|
||||||
|
resolution: {integrity: sha512-1+QJyEI3hIN5SY56MBgnfOQWqNTjfRBbkGKyTHvL44A+Q/NlKwJ79w1nZcIjHhvouM7ArngK99yiMjd6G3iC6A==}
|
||||||
|
peerDependencies:
|
||||||
|
esbuild: ^0.15.2
|
||||||
|
dependencies:
|
||||||
|
esbuild: 0.15.18
|
||||||
|
dev: true
|
||||||
|
|
||||||
/esbuild-linux-32/0.15.18:
|
/esbuild-linux-32/0.15.18:
|
||||||
resolution: {integrity: sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg==}
|
resolution: {integrity: sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg==}
|
||||||
engines: {node: '>=12'}
|
engines: {node: '>=12'}
|
||||||
@@ -776,6 +950,36 @@ packages:
|
|||||||
esbuild-windows-arm64: 0.15.18
|
esbuild-windows-arm64: 0.15.18
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/esbuild/0.17.11:
|
||||||
|
resolution: {integrity: sha512-pAMImyokbWDtnA/ufPxjQg0fYo2DDuzAlqwnDvbXqHLphe+m80eF++perYKVm8LeTuj2zUuFXC+xgSVxyoHUdg==}
|
||||||
|
engines: {node: '>=12'}
|
||||||
|
hasBin: true
|
||||||
|
requiresBuild: true
|
||||||
|
optionalDependencies:
|
||||||
|
'@esbuild/android-arm': 0.17.11
|
||||||
|
'@esbuild/android-arm64': 0.17.11
|
||||||
|
'@esbuild/android-x64': 0.17.11
|
||||||
|
'@esbuild/darwin-arm64': 0.17.11
|
||||||
|
'@esbuild/darwin-x64': 0.17.11
|
||||||
|
'@esbuild/freebsd-arm64': 0.17.11
|
||||||
|
'@esbuild/freebsd-x64': 0.17.11
|
||||||
|
'@esbuild/linux-arm': 0.17.11
|
||||||
|
'@esbuild/linux-arm64': 0.17.11
|
||||||
|
'@esbuild/linux-ia32': 0.17.11
|
||||||
|
'@esbuild/linux-loong64': 0.17.11
|
||||||
|
'@esbuild/linux-mips64el': 0.17.11
|
||||||
|
'@esbuild/linux-ppc64': 0.17.11
|
||||||
|
'@esbuild/linux-riscv64': 0.17.11
|
||||||
|
'@esbuild/linux-s390x': 0.17.11
|
||||||
|
'@esbuild/linux-x64': 0.17.11
|
||||||
|
'@esbuild/netbsd-x64': 0.17.11
|
||||||
|
'@esbuild/openbsd-x64': 0.17.11
|
||||||
|
'@esbuild/sunos-x64': 0.17.11
|
||||||
|
'@esbuild/win32-arm64': 0.17.11
|
||||||
|
'@esbuild/win32-ia32': 0.17.11
|
||||||
|
'@esbuild/win32-x64': 0.17.11
|
||||||
|
dev: true
|
||||||
|
|
||||||
/escape-string-regexp/4.0.0:
|
/escape-string-regexp/4.0.0:
|
||||||
resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
|
resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
@@ -822,7 +1026,7 @@ packages:
|
|||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@eslint/eslintrc': 1.4.0
|
'@eslint/eslintrc': 1.4.1
|
||||||
'@humanwhocodes/config-array': 0.11.8
|
'@humanwhocodes/config-array': 0.11.8
|
||||||
'@humanwhocodes/module-importer': 1.0.1
|
'@humanwhocodes/module-importer': 1.0.1
|
||||||
'@nodelib/fs.walk': 1.2.8
|
'@nodelib/fs.walk': 1.2.8
|
||||||
@@ -836,20 +1040,20 @@ packages:
|
|||||||
eslint-utils: 3.0.0_eslint@8.30.0
|
eslint-utils: 3.0.0_eslint@8.30.0
|
||||||
eslint-visitor-keys: 3.3.0
|
eslint-visitor-keys: 3.3.0
|
||||||
espree: 9.4.1
|
espree: 9.4.1
|
||||||
esquery: 1.4.0
|
esquery: 1.4.2
|
||||||
esutils: 2.0.3
|
esutils: 2.0.3
|
||||||
fast-deep-equal: 3.1.3
|
fast-deep-equal: 3.1.3
|
||||||
file-entry-cache: 6.0.1
|
file-entry-cache: 6.0.1
|
||||||
find-up: 5.0.0
|
find-up: 5.0.0
|
||||||
glob-parent: 6.0.2
|
glob-parent: 6.0.2
|
||||||
globals: 13.19.0
|
globals: 13.20.0
|
||||||
grapheme-splitter: 1.0.4
|
grapheme-splitter: 1.0.4
|
||||||
ignore: 5.2.4
|
ignore: 5.2.4
|
||||||
import-fresh: 3.3.0
|
import-fresh: 3.3.0
|
||||||
imurmurhash: 0.1.4
|
imurmurhash: 0.1.4
|
||||||
is-glob: 4.0.3
|
is-glob: 4.0.3
|
||||||
is-path-inside: 3.0.3
|
is-path-inside: 3.0.3
|
||||||
js-sdsl: 4.2.0
|
js-sdsl: 4.3.0
|
||||||
js-yaml: 4.1.0
|
js-yaml: 4.1.0
|
||||||
json-stable-stringify-without-jsonify: 1.0.1
|
json-stable-stringify-without-jsonify: 1.0.1
|
||||||
levn: 0.4.1
|
levn: 0.4.1
|
||||||
@@ -869,13 +1073,13 @@ packages:
|
|||||||
resolution: {integrity: sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==}
|
resolution: {integrity: sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
dependencies:
|
dependencies:
|
||||||
acorn: 8.8.1
|
acorn: 8.8.2
|
||||||
acorn-jsx: 5.3.2_acorn@8.8.1
|
acorn-jsx: 5.3.2_acorn@8.8.2
|
||||||
eslint-visitor-keys: 3.3.0
|
eslint-visitor-keys: 3.3.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/esquery/1.4.0:
|
/esquery/1.4.2:
|
||||||
resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==}
|
resolution: {integrity: sha512-JVSoLdTlTDkmjFmab7H/9SL9qGSyjElT3myyKp7krqjVFQCDLmj1QFaCLRFBszBKI0XVZaiiXvuPIX3ZwHe1Ng==}
|
||||||
engines: {node: '>=0.10'}
|
engines: {node: '>=0.10'}
|
||||||
dependencies:
|
dependencies:
|
||||||
estraverse: 5.3.0
|
estraverse: 5.3.0
|
||||||
@@ -941,8 +1145,8 @@ packages:
|
|||||||
resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
|
resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/fastq/1.14.0:
|
/fastq/1.15.0:
|
||||||
resolution: {integrity: sha512-eR2D+V9/ExcbF9ls441yIuN6TI2ED1Y2ZcA5BmMtJsOkWOFRJQ0Jt0g1UwqXJJVAb+V+umH5Dfr8oh4EVP7VVg==}
|
resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==}
|
||||||
dependencies:
|
dependencies:
|
||||||
reusify: 1.0.4
|
reusify: 1.0.4
|
||||||
dev: true
|
dev: true
|
||||||
@@ -954,8 +1158,8 @@ packages:
|
|||||||
flat-cache: 3.0.4
|
flat-cache: 3.0.4
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/file-type/18.0.0:
|
/file-type/18.2.1:
|
||||||
resolution: {integrity: sha512-jjMwFpnW8PKofLE/4ohlhqwDk5k0NC6iy0UHAJFKoY1fQeGMN0GDdLgHQrvCbSpMwbqzoCZhRI5dETCZna5qVA==}
|
resolution: {integrity: sha512-Yw5MtnMv7vgD2/6Bjmmuegc8bQEVA9GmAyaR18bMYWKqsWDG9wgYZ1j4I6gNMF5Y5JBDcUcjRQqNQx7Y8uotcg==}
|
||||||
engines: {node: '>=14.16'}
|
engines: {node: '>=14.16'}
|
||||||
dependencies:
|
dependencies:
|
||||||
readable-web-to-node-stream: 3.0.2
|
readable-web-to-node-stream: 3.0.2
|
||||||
@@ -1043,8 +1247,8 @@ packages:
|
|||||||
path-is-absolute: 1.0.1
|
path-is-absolute: 1.0.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/globals/13.19.0:
|
/globals/13.20.0:
|
||||||
resolution: {integrity: sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==}
|
resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
dependencies:
|
dependencies:
|
||||||
type-fest: 0.20.2
|
type-fest: 0.20.2
|
||||||
@@ -1159,8 +1363,8 @@ packages:
|
|||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/js-sdsl/4.2.0:
|
/js-sdsl/4.3.0:
|
||||||
resolution: {integrity: sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==}
|
resolution: {integrity: sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/js-yaml/4.1.0:
|
/js-yaml/4.1.0:
|
||||||
@@ -1186,8 +1390,8 @@ packages:
|
|||||||
type-check: 0.4.0
|
type-check: 0.4.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/lilconfig/2.0.6:
|
/lilconfig/2.1.0:
|
||||||
resolution: {integrity: sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg==}
|
resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==}
|
||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
@@ -1388,7 +1592,7 @@ packages:
|
|||||||
ts-node:
|
ts-node:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
lilconfig: 2.0.6
|
lilconfig: 2.1.0
|
||||||
yaml: 1.10.2
|
yaml: 1.10.2
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
@@ -1397,14 +1601,14 @@ packages:
|
|||||||
engines: {node: '>= 0.8.0'}
|
engines: {node: '>= 0.8.0'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/prettier/2.8.3:
|
/prettier/2.8.4:
|
||||||
resolution: {integrity: sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==}
|
resolution: {integrity: sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==}
|
||||||
engines: {node: '>=10.13.0'}
|
engines: {node: '>=10.13.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/punycode/2.1.1:
|
/punycode/2.3.0:
|
||||||
resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==}
|
resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
@@ -1462,8 +1666,8 @@ packages:
|
|||||||
glob: 7.2.3
|
glob: 7.2.3
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/rollup/3.9.0:
|
/rollup/3.19.1:
|
||||||
resolution: {integrity: sha512-nGGylpmblyjTpF4lEUPgmOw6OVxRvnI6Iuuh6Lz4O/X66cVOX1XJSsqP1YamxQ+mPuFE7qJxLFDSCk8rNv5dDw==}
|
resolution: {integrity: sha512-lAbrdN7neYCg/8WaoWn/ckzCtz+jr70GFfYdlf50OF7387HTg+wiuiqJRFYawwSPpqfqDNYqK7smY/ks2iAudg==}
|
||||||
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
|
engines: {node: '>=14.18.0', npm: '>=8.0.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
@@ -1479,7 +1683,7 @@ packages:
|
|||||||
/rxjs/7.8.0:
|
/rxjs/7.8.0:
|
||||||
resolution: {integrity: sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==}
|
resolution: {integrity: sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib: 2.4.1
|
tslib: 2.5.0
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/safe-buffer/5.2.1:
|
/safe-buffer/5.2.1:
|
||||||
@@ -1613,7 +1817,7 @@ packages:
|
|||||||
/tr46/1.0.1:
|
/tr46/1.0.1:
|
||||||
resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==}
|
resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==}
|
||||||
dependencies:
|
dependencies:
|
||||||
punycode: 2.1.1
|
punycode: 2.3.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/tree-kill/1.2.2:
|
/tree-kill/1.2.2:
|
||||||
@@ -1625,14 +1829,10 @@ packages:
|
|||||||
resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
|
resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/ts-mixer/6.0.2:
|
/ts-mixer/6.0.3:
|
||||||
resolution: {integrity: sha512-zvHx3VM83m2WYCE8XL99uaM7mFwYSkjR2OZti98fabHrwkjsCvgwChda5xctein3xGOyaQhtTeDq/1H/GNvF3A==}
|
resolution: {integrity: sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/ts-pattern/4.0.6:
|
|
||||||
resolution: {integrity: sha512-sFHQYD4KoysBi7e7a2mzDPvRBeqA4w+vEyRE+P5MU9VLq8eEYxgKCgD9RNEAT+itGRWUTYN+hry94GDPLb1/Yw==}
|
|
||||||
dev: false
|
|
||||||
|
|
||||||
/ts-results-es/3.5.0:
|
/ts-results-es/3.5.0:
|
||||||
resolution: {integrity: sha512-W7Vtg9u7QsutEfDbLEJNDlDrYGK7spxab6Je+K9+tjI/ixCM1ouniQmHJX0mZUok5WsWiCGxQy6lIrI//nBzTg==}
|
resolution: {integrity: sha512-W7Vtg9u7QsutEfDbLEJNDlDrYGK7spxab6Je+K9+tjI/ixCM1ouniQmHJX0mZUok5WsWiCGxQy6lIrI//nBzTg==}
|
||||||
dev: false
|
dev: false
|
||||||
@@ -1641,12 +1841,12 @@ packages:
|
|||||||
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
|
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/tslib/2.4.1:
|
/tslib/2.5.0:
|
||||||
resolution: {integrity: sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==}
|
resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==}
|
||||||
|
|
||||||
/tsup/6.5.0_typescript@4.9.4:
|
/tsup/6.6.3_typescript@4.9.5:
|
||||||
resolution: {integrity: sha512-36u82r7rYqRHFkD15R20Cd4ercPkbYmuvRkz3Q1LCm5BsiFNUgpo36zbjVhCOgvjyxNBWNKHsaD5Rl8SykfzNA==}
|
resolution: {integrity: sha512-OLx/jFllYlVeZQ7sCHBuRVEQBBa1tFbouoc/gbYakyipjVQdWy/iQOvmExUA/ewap9iQ7tbJf9pW0PgcEFfJcQ==}
|
||||||
engines: {node: '>=14'}
|
engines: {node: '>=14.18'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@swc/core': ^1
|
'@swc/core': ^1
|
||||||
@@ -1660,34 +1860,34 @@ packages:
|
|||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
bundle-require: 3.1.2_esbuild@0.15.18
|
bundle-require: 4.0.1_esbuild@0.17.11
|
||||||
cac: 6.7.14
|
cac: 6.7.14
|
||||||
chokidar: 3.5.3
|
chokidar: 3.5.3
|
||||||
debug: 4.3.4
|
debug: 4.3.4
|
||||||
esbuild: 0.15.18
|
esbuild: 0.17.11
|
||||||
execa: 5.1.1
|
execa: 5.1.1
|
||||||
globby: 11.1.0
|
globby: 11.1.0
|
||||||
joycon: 3.1.1
|
joycon: 3.1.1
|
||||||
postcss-load-config: 3.1.4
|
postcss-load-config: 3.1.4
|
||||||
resolve-from: 5.0.0
|
resolve-from: 5.0.0
|
||||||
rollup: 3.9.0
|
rollup: 3.19.1
|
||||||
source-map: 0.8.0-beta.0
|
source-map: 0.8.0-beta.0
|
||||||
sucrase: 3.29.0
|
sucrase: 3.29.0
|
||||||
tree-kill: 1.2.2
|
tree-kill: 1.2.2
|
||||||
typescript: 4.9.4
|
typescript: 4.9.5
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
- ts-node
|
- ts-node
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/tsutils/3.21.0_typescript@4.9.4:
|
/tsutils/3.21.0_typescript@4.9.5:
|
||||||
resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
|
resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}
|
||||||
engines: {node: '>= 6'}
|
engines: {node: '>= 6'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
|
typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta'
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib: 1.14.1
|
tslib: 1.14.1
|
||||||
typescript: 4.9.4
|
typescript: 4.9.5
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/type-check/0.4.0:
|
/type-check/0.4.0:
|
||||||
@@ -1702,14 +1902,14 @@ packages:
|
|||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/typescript/4.9.4:
|
/typescript/4.9.5:
|
||||||
resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==}
|
resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==}
|
||||||
engines: {node: '>=4.2.0'}
|
engines: {node: '>=4.2.0'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/undici/5.14.0:
|
/undici/5.20.0:
|
||||||
resolution: {integrity: sha512-yJlHYw6yXPPsuOH0x2Ib1Km61vu4hLiRRQoafs+WUgX1vO64vgnxiCEN9dpIrhZyHFsai3F0AEj4P9zy19enEQ==}
|
resolution: {integrity: sha512-J3j60dYzuo6Eevbawwp1sdg16k5Tf768bxYK4TUJRH7cBM4kFCbf3mOnM/0E3vQYXvpxITbbWmBafaDbxLDz3g==}
|
||||||
engines: {node: '>=12.18'}
|
engines: {node: '>=12.18'}
|
||||||
dependencies:
|
dependencies:
|
||||||
busboy: 1.6.0
|
busboy: 1.6.0
|
||||||
@@ -1718,7 +1918,7 @@ packages:
|
|||||||
/uri-js/4.4.1:
|
/uri-js/4.4.1:
|
||||||
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
punycode: 2.1.1
|
punycode: 2.3.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/util-deprecate/1.0.2:
|
/util-deprecate/1.0.2:
|
||||||
@@ -1759,12 +1959,12 @@ packages:
|
|||||||
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
|
resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/ws/8.11.0:
|
/ws/8.12.1:
|
||||||
resolution: {integrity: sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==}
|
resolution: {integrity: sha512-1qo+M9Ba+xNhPB+YTWUlK6M17brTut5EXbcBaMRN5pH5dFrXz7lzz1ChFSUq3bOUl8yEvSenhHmYUNJxFzdJew==}
|
||||||
engines: {node: '>=10.0.0'}
|
engines: {node: '>=10.0.0'}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
bufferutil: ^4.0.1
|
bufferutil: ^4.0.1
|
||||||
utf-8-validate: ^5.0.2
|
utf-8-validate: '>=5.0.2'
|
||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
bufferutil:
|
bufferutil:
|
||||||
optional: true
|
optional: true
|
||||||
|
|||||||
@@ -9,6 +9,6 @@
|
|||||||
"schedule": ["every weekend"],
|
"schedule": ["every weekend"],
|
||||||
"lockFileMaintenance": {
|
"lockFileMaintenance": {
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"automerge": false
|
"automerge": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
import { writeFile } from 'fs/promises';
|
|
||||||
import { join } from 'path';
|
|
||||||
// A quick script to regenerate package.jsons for each cjs and esm after tsup cleans distributions
|
|
||||||
const locations = process.argv;
|
|
||||||
locations.shift();
|
|
||||||
locations.shift();
|
|
||||||
for (const loc of locations) {
|
|
||||||
if (loc.endsWith('cjs')) {
|
|
||||||
await writeFile(join(loc, 'package.json'), JSON.stringify({ type: 'commonjs' }));
|
|
||||||
} else {
|
|
||||||
await writeFile(join(loc, 'package.json'), JSON.stringify({ type: 'module' }));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { Observable } from 'rxjs';
|
import type { Observable } from 'rxjs';
|
||||||
import type { Logging } from './logging';
|
import type { Logging } from './logging';
|
||||||
import util from 'util';
|
import util from 'util';
|
||||||
|
|
||||||
export interface ErrorHandling {
|
export interface ErrorHandling {
|
||||||
/**
|
/**
|
||||||
* Number of times the process should throw an error until crashing and exiting
|
* Number of times the process should throw an error until crashing and exiting
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type { Processed } from '../../types/handler';
|
|||||||
export interface ModuleManager {
|
export interface ModuleManager {
|
||||||
get<T extends CommandType>(
|
get<T extends CommandType>(
|
||||||
strat: (ms: ModuleStore) => Processed<CommandModuleDefs[T]> | undefined,
|
strat: (ms: ModuleStore) => Processed<CommandModuleDefs[T]> | undefined,
|
||||||
): CommandModuleDefs[T] | undefined;
|
): Processed<CommandModuleDefs[T]> | undefined;
|
||||||
set(strat: (ms: ModuleStore) => void): void;
|
set(strat: (ms: ModuleStore) => void): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
export { single, transient, many } from './lifetimeFunctions';
|
export { single, transient, many } from './lifetimeFunctions';
|
||||||
export { useContainerRaw } from './provider';
|
export { useContainerRaw } from './provider';
|
||||||
|
|||||||
@@ -1,47 +1,57 @@
|
|||||||
import { _const } from '../utilities/functions';
|
import { _const } from '../utilities/functions';
|
||||||
|
|
||||||
type NotFunction = string | number | boolean | null | undefined | bigint |
|
type NotFunction =
|
||||||
readonly any[] | { apply?: never, [k: string]: any } |
|
| string
|
||||||
{ call?: never, [k: string]: any };
|
| number
|
||||||
|
| boolean
|
||||||
|
| null
|
||||||
|
| undefined
|
||||||
|
| bigint
|
||||||
|
| readonly any[]
|
||||||
|
| { apply?: never; [k: string]: any }
|
||||||
|
| { call?: never; [k: string]: any };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @param cb
|
* @param cb
|
||||||
*/
|
*/
|
||||||
export function single<T extends NotFunction>(cb: T) : () => T;
|
export function single<T extends NotFunction>(cb: T): () => T;
|
||||||
/**
|
/**
|
||||||
* New signature
|
* New signature
|
||||||
* @param cb
|
* @param cb
|
||||||
*/
|
*/
|
||||||
export function single<T extends () => unknown>(cb: T) : T;
|
export function single<T extends () => unknown>(cb: T): T;
|
||||||
/**
|
/**
|
||||||
|
* @__PURE__
|
||||||
* Please note that on intellij, the deprecation is for all signatures, which is unintended behavior (and
|
* Please note that on intellij, the deprecation is for all signatures, which is unintended behavior (and
|
||||||
* very annoying).
|
* very annoying).
|
||||||
* For future versions, ensure that single is being passed as a **callback!!**
|
* For future versions, ensure that single is being passed as a **callback!!**
|
||||||
* @param cb
|
* @param cb
|
||||||
*/
|
*/
|
||||||
export function single<T>(cb: T) {
|
export function single<T>(cb: T) {
|
||||||
if(typeof cb === 'function') return cb;
|
if (typeof cb === 'function') return cb;
|
||||||
return () => cb;
|
return () => cb;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @param cb
|
* @param cb
|
||||||
* Deprecated signature
|
* Deprecated signature
|
||||||
*/
|
*/
|
||||||
export function transient<T extends NotFunction>(cb: T) : () => () => T
|
export function transient<T extends NotFunction>(cb: T): () => () => T;
|
||||||
export function transient<T extends () => () => unknown>(cb: T) : T;
|
export function transient<T extends () => () => unknown>(cb: T): T;
|
||||||
/**
|
/**
|
||||||
|
* @__PURE__
|
||||||
* Following iti's singleton and transient implementation,
|
* Following iti's singleton and transient implementation,
|
||||||
* use transient if you want a new dependency every time your container getter is called
|
* use transient if you want a new dependency every time your container getter is called
|
||||||
* @param cb
|
* @param cb
|
||||||
*/
|
*/
|
||||||
export function transient<T>(cb: (() => () => T) | T) {
|
export function transient<T>(cb: (() => () => T) | T) {
|
||||||
if(typeof cb !== 'function') return () => () => cb;
|
if (typeof cb !== 'function') return () => () => cb;
|
||||||
return cb;
|
return cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @__PURE__
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @param value
|
* @param value
|
||||||
* Please use the transient function instead
|
* Please use the transient function instead
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import type { Container } from 'iti';
|
import type { Container } from 'iti';
|
||||||
import { SernError } from '../structures/errors';
|
|
||||||
import type { Dependencies, DependencyConfiguration, MapDeps } from '../../types/handler';
|
import type { Dependencies, DependencyConfiguration, MapDeps } from '../../types/handler';
|
||||||
import SernEmitter from '../sernEmitter';
|
import SernEmitter from '../sernEmitter';
|
||||||
import { DefaultErrorHandling, DefaultLogging, DefaultModuleManager } from '../contracts';
|
import { DefaultErrorHandling, DefaultLogging, DefaultModuleManager } from '../contracts';
|
||||||
import { ModuleStore } from '../structures/moduleStore';
|
|
||||||
import { Result } from 'ts-results-es';
|
import { Result } from 'ts-results-es';
|
||||||
import { BehaviorSubject } from 'rxjs';
|
import { BehaviorSubject } from 'rxjs';
|
||||||
import { createContainer } from 'iti';
|
import { createContainer } from 'iti';
|
||||||
|
import { type Wrapper, ModuleStore, SernError } from '../structures';
|
||||||
|
|
||||||
export const containerSubject = new BehaviorSubject(defaultContainer());
|
export const containerSubject = new BehaviorSubject(defaultContainer());
|
||||||
|
|
||||||
@@ -20,20 +19,18 @@ export function composeRoot<T extends Dependencies>(conf: DependencyConfiguratio
|
|||||||
//Get the current container. This should have no client or possible logger yet.
|
//Get the current container. This should have no client or possible logger yet.
|
||||||
const currentContainer = containerSubject.getValue();
|
const currentContainer = containerSubject.getValue();
|
||||||
const excludeLogger = conf.exclude?.has('@sern/logger');
|
const excludeLogger = conf.exclude?.has('@sern/logger');
|
||||||
if(!excludeLogger) {
|
if (!excludeLogger) {
|
||||||
currentContainer.add({
|
currentContainer.add({
|
||||||
'@sern/logger' : () => new DefaultLogging()
|
'@sern/logger': () => new DefaultLogging(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//Build the container based on the callback provided by the user
|
//Build the container based on the callback provided by the user
|
||||||
const container = conf.build(currentContainer);
|
const container = conf.build(currentContainer);
|
||||||
//Check if the built container contains @sern/client or throw
|
//Check if the built container contains @sern/client or throw
|
||||||
// a runtime exception
|
// a runtime exception
|
||||||
Result
|
Result.wrap(() => container.get('@sern/client')).expect(SernError.MissingRequired);
|
||||||
.wrap(() => container.get('@sern/client'))
|
|
||||||
.expect(SernError.MissingRequired);
|
|
||||||
|
|
||||||
if(!excludeLogger) {
|
if (!excludeLogger) {
|
||||||
container.get('@sern/logger')?.info({ message: 'All dependencies loaded successfully.' });
|
container.get('@sern/logger')?.info({ message: 'All dependencies loaded successfully.' });
|
||||||
}
|
}
|
||||||
//I'm sorry little one
|
//I'm sorry little one
|
||||||
@@ -61,12 +58,29 @@ export function useContainerRaw<T extends Dependencies>() {
|
|||||||
*/
|
*/
|
||||||
function defaultContainer() {
|
function defaultContainer() {
|
||||||
return createContainer()
|
return createContainer()
|
||||||
.add({ '@sern/errors': () => new DefaultErrorHandling()})
|
.add({ '@sern/errors': () => new DefaultErrorHandling() })
|
||||||
.add({ '@sern/store' : () => new ModuleStore()})
|
.add({ '@sern/store': () => new ModuleStore() })
|
||||||
.add(ctx => {
|
.add(ctx => {
|
||||||
return {
|
return {
|
||||||
'@sern/modules': () => new DefaultModuleManager(ctx['@sern/store'])
|
'@sern/modules': () => new DefaultModuleManager(ctx['@sern/store']),
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.add({ '@sern/emitter': () => new SernEmitter()}) as Container<Omit<Dependencies, '@sern/client' | '@sern/logger'>, {}>;
|
.add({ '@sern/emitter': () => new SernEmitter() }) as Container<
|
||||||
}
|
Omit<Dependencies, '@sern/client' | '@sern/logger'>,
|
||||||
|
{}
|
||||||
|
>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function makeFetcher(wrapper: Wrapper) {
|
||||||
|
const requiredDependencyKeys = [
|
||||||
|
'@sern/emitter',
|
||||||
|
'@sern/client',
|
||||||
|
'@sern/errors',
|
||||||
|
'@sern/logger',
|
||||||
|
] as ['@sern/emitter', '@sern/client', '@sern/errors', '@sern/logger'];
|
||||||
|
return <Keys extends (keyof Dependencies)[]>(otherKeys: [...Keys]) =>
|
||||||
|
wrapper.containerConfig.get(...requiredDependencyKeys, ...otherKeys) as MapDeps<
|
||||||
|
Dependencies,
|
||||||
|
[...typeof requiredDependencyKeys, ...Keys]
|
||||||
|
>;
|
||||||
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ export function dispatchAutocomplete(
|
|||||||
const option = treeSearch(interaction, module.options);
|
const option = treeSearch(interaction, module.options);
|
||||||
if (option !== undefined) {
|
if (option !== undefined) {
|
||||||
return {
|
return {
|
||||||
module,
|
module: option.command as Processed<Module>, //autocomplete is not a true "module" warning cast!
|
||||||
args: [interaction],
|
args: [interaction],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
import type Wrapper from '../structures/wrapper';
|
|
||||||
import { Subject, type Observable } from 'rxjs';
|
|
||||||
import type { EventEmitter } from 'events';
|
|
||||||
import type SernEmitter from '../sernEmitter';
|
|
||||||
import type { ErrorHandling, Logging, ModuleManager } from '../contracts';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* why did I make this, definitely going to be changed in the future
|
|
||||||
*/
|
|
||||||
export abstract class EventsHandler<T> {
|
|
||||||
protected payloadSubject = new Subject<T>();
|
|
||||||
protected abstract discordEvent: Observable<unknown>;
|
|
||||||
protected client: EventEmitter;
|
|
||||||
protected emitter: SernEmitter;
|
|
||||||
protected crashHandler: ErrorHandling;
|
|
||||||
protected logger?: Logging;
|
|
||||||
protected modules: ModuleManager;
|
|
||||||
protected constructor({ containerConfig }: Wrapper) {
|
|
||||||
const [client, emitter, crash, modules, logger] = containerConfig.get(
|
|
||||||
'@sern/client',
|
|
||||||
'@sern/emitter',
|
|
||||||
'@sern/errors',
|
|
||||||
'@sern/modules',
|
|
||||||
'@sern/logger',
|
|
||||||
);
|
|
||||||
this.logger = logger as Logging | undefined;
|
|
||||||
this.modules = modules as ModuleManager;
|
|
||||||
this.client = client as EventEmitter;
|
|
||||||
this.emitter = emitter as SernEmitter;
|
|
||||||
this.crashHandler = crash as ErrorHandling;
|
|
||||||
}
|
|
||||||
protected abstract init(): void;
|
|
||||||
protected abstract setState(state: T): void;
|
|
||||||
}
|
|
||||||
@@ -1,135 +1,115 @@
|
|||||||
import type { Interaction } from 'discord.js';
|
import type { Interaction } from 'discord.js';
|
||||||
import { catchError, concatMap, finalize, fromEvent, map, Observable } from 'rxjs';
|
import {
|
||||||
import type Wrapper from '../structures/wrapper';
|
catchError,
|
||||||
import { EventsHandler } from './eventsHandler';
|
concatMap,
|
||||||
import { CommandType, SernError, type ModuleStore } from '../structures';
|
EMPTY,
|
||||||
import { match, P } from 'ts-pattern';
|
filter,
|
||||||
import { contextArgs, interactionArg, dispatchAutocomplete, dispatchCommand } from './dispatchers';
|
finalize,
|
||||||
|
fromEvent,
|
||||||
|
map,
|
||||||
|
Observable,
|
||||||
|
of,
|
||||||
|
OperatorFunction,
|
||||||
|
pipe,
|
||||||
|
} from 'rxjs';
|
||||||
|
import { CommandType, type ModuleStore, SernError } from '../structures';
|
||||||
|
import { contextArgs, dispatchAutocomplete, dispatchCommand, interactionArg } from './dispatchers';
|
||||||
import { executeModule, makeModuleExecutor } from './observableHandling';
|
import { executeModule, makeModuleExecutor } from './observableHandling';
|
||||||
import type { CommandModule } from '../../types/module';
|
import type { CommandModule } from '../../types/module';
|
||||||
import { handleError } from '../contracts/errorHandling';
|
import { ErrorHandling, handleError } from '../contracts/errorHandling';
|
||||||
import SernEmitter from '../sernEmitter';
|
import SernEmitter from '../sernEmitter';
|
||||||
import type { Processed } from '../../types/handler';
|
import type { Processed } from '../../types/handler';
|
||||||
import { useContainerRaw } from '../dependencies';
|
import { useContainerRaw } from '../dependencies';
|
||||||
|
import type { Logging, ModuleManager } from '../contracts';
|
||||||
|
import type { EventEmitter } from 'node:events';
|
||||||
|
|
||||||
export default class InteractionHandler extends EventsHandler<{
|
function makeInteractionProcessor(
|
||||||
|
modules: ModuleManager,
|
||||||
|
): OperatorFunction<Interaction, { module: Processed<CommandModule>; event: Interaction }> {
|
||||||
|
const get = (cb: (ms: ModuleStore) => Processed<CommandModule> | undefined) => {
|
||||||
|
return modules.get(cb);
|
||||||
|
};
|
||||||
|
return pipe(
|
||||||
|
concatMap(event => {
|
||||||
|
if (event.isMessageComponent()) {
|
||||||
|
const module = get(ms =>
|
||||||
|
ms.InteractionHandlers[event.componentType].get(event.customId),
|
||||||
|
);
|
||||||
|
return of({ module, event });
|
||||||
|
} else if (event.isCommand() || event.isAutocomplete()) {
|
||||||
|
const commandName = event.commandName;
|
||||||
|
const module = get(
|
||||||
|
ms =>
|
||||||
|
/**
|
||||||
|
* try to fetch from ApplicationCommands, if nothing, try BothCommands
|
||||||
|
* exists on the API but not sern
|
||||||
|
*/
|
||||||
|
ms.ApplicationCommands[event.commandType].get(commandName) ??
|
||||||
|
ms.BothCommands.get(commandName),
|
||||||
|
);
|
||||||
|
return of({ module, event });
|
||||||
|
} else if (event.isModalSubmit()) {
|
||||||
|
const module = get(ms => ms.ModalSubmit.get(event.customId));
|
||||||
|
return of({ module, event });
|
||||||
|
} else return EMPTY;
|
||||||
|
}),
|
||||||
|
filter(m => m.module !== undefined),
|
||||||
|
) as OperatorFunction<Interaction, { module: Processed<CommandModule>; event: Interaction }>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function makeInteractionCreate([s, client, err, log, modules]: [
|
||||||
|
SernEmitter,
|
||||||
|
EventEmitter,
|
||||||
|
ErrorHandling,
|
||||||
|
Logging | undefined,
|
||||||
|
ModuleManager,
|
||||||
|
]) {
|
||||||
|
//map. If nothing again,this means a slash command
|
||||||
|
const interactionStream$ = fromEvent(client, 'interactionCreate') as Observable<Interaction>;
|
||||||
|
const interactionProcessor = makeInteractionProcessor(modules);
|
||||||
|
return interactionStream$
|
||||||
|
.pipe(
|
||||||
|
interactionProcessor,
|
||||||
|
map(createDispatcher),
|
||||||
|
makeModuleExecutor(module => {
|
||||||
|
s.emit('module.activate', SernEmitter.failure(module, SernError.PluginFailure));
|
||||||
|
}),
|
||||||
|
concatMap(module => executeModule(s, module)),
|
||||||
|
catchError(handleError(err, log)),
|
||||||
|
finalize(() => {
|
||||||
|
log?.info({
|
||||||
|
message: 'interactionCreate stream closed or reached end of lifetime',
|
||||||
|
});
|
||||||
|
useContainerRaw()
|
||||||
|
?.disposeAll()
|
||||||
|
.then(() => log?.info({ message: 'Cleaning container and crashing' }));
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.subscribe();
|
||||||
|
}
|
||||||
|
|
||||||
|
function createDispatcher({
|
||||||
|
module,
|
||||||
|
event,
|
||||||
|
}: {
|
||||||
event: Interaction;
|
event: Interaction;
|
||||||
module: Processed<CommandModule>;
|
module: Processed<CommandModule>;
|
||||||
}> {
|
}) {
|
||||||
protected override discordEvent: Observable<Interaction>;
|
switch(module.type) {
|
||||||
constructor(wrapper: Wrapper) {
|
case CommandType.Text:
|
||||||
super(wrapper);
|
throw Error(SernError.MismatchEvent);
|
||||||
this.discordEvent = <Observable<Interaction>>fromEvent(this.client, 'interactionCreate');
|
case CommandType.Slash: case CommandType.Both : {
|
||||||
this.init();
|
if(event.isAutocomplete()) {
|
||||||
|
|
||||||
this.payloadSubject
|
|
||||||
.pipe(
|
|
||||||
map(this.createDispatcher),
|
|
||||||
makeModuleExecutor(module => {
|
|
||||||
this.emitter.emit(
|
|
||||||
'module.activate',
|
|
||||||
SernEmitter.failure(module, SernError.PluginFailure),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
concatMap(payload => executeModule(this.emitter, payload)),
|
|
||||||
catchError(handleError(this.crashHandler, this.logger)),
|
|
||||||
finalize(() => {
|
|
||||||
this.logger?.info({ message: 'interactionCreate stream closed or reached end of lifetime'});
|
|
||||||
useContainerRaw()
|
|
||||||
?.disposeAll()
|
|
||||||
.then(() => {
|
|
||||||
this.logger?.info({ message: 'Cleaning container and crashing' });
|
|
||||||
});
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.subscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
override init() {
|
|
||||||
const get = (cb: (ms: ModuleStore) => Processed<CommandModule> | undefined) => {
|
|
||||||
return this.modules.get(cb);
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
* Module retrieval:
|
|
||||||
* ModuleStores are mapped by Discord API values and modules mapped
|
|
||||||
* by customId or command name.
|
|
||||||
*/
|
|
||||||
this.discordEvent.subscribe({
|
|
||||||
next: event => {
|
|
||||||
if (event.isMessageComponent()) {
|
|
||||||
const module = get(ms =>
|
|
||||||
ms.InteractionHandlers[event.componentType].get(event.customId),
|
|
||||||
);
|
|
||||||
this.setState({ event, module });
|
|
||||||
} else if (event.isCommand() || event.isAutocomplete()) {
|
|
||||||
const module = get(
|
|
||||||
ms =>
|
|
||||||
/**
|
|
||||||
* try to fetch from ApplicationCommands, if nothing, try BothCommands
|
|
||||||
* map. If nothing again,this means a slash command
|
|
||||||
* exists on the API but not sern
|
|
||||||
*/
|
|
||||||
ms.ApplicationCommands[event.commandType].get(event.commandName) ??
|
|
||||||
ms.BothCommands.get(event.commandName),
|
|
||||||
);
|
|
||||||
this.setState({ event, module });
|
|
||||||
} else if (event.isModalSubmit()) {
|
|
||||||
const module = get(ms => ms.ModalSubmit.get(event.customId));
|
|
||||||
this.setState({ event, module });
|
|
||||||
} else {
|
|
||||||
throw Error('This interaction is not supported yet');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: reason => {
|
|
||||||
this.emitter.emit('error', SernEmitter.failure(undefined, reason));
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected setState(state: { event: Interaction; module: CommandModule | undefined }): void {
|
|
||||||
if (state.module === undefined) {
|
|
||||||
this.emitter.emit(
|
|
||||||
'warning',
|
|
||||||
SernEmitter.warning('Found no module for this interaction'),
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
//if statement above checks already, safe cast
|
|
||||||
this.payloadSubject.next(
|
|
||||||
state as { event: Interaction; module: Processed<CommandModule> },
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected createDispatcher({
|
|
||||||
module,
|
|
||||||
event,
|
|
||||||
}: {
|
|
||||||
event: Interaction;
|
|
||||||
module: Processed<CommandModule>;
|
|
||||||
}) {
|
|
||||||
return (
|
|
||||||
match(module)
|
|
||||||
.with({ type: CommandType.Text }, () =>
|
|
||||||
this.crashHandler.crash(Error(SernError.MismatchEvent)),
|
|
||||||
)
|
|
||||||
//P.union = either CommandType.Slash or CommandType.Both
|
|
||||||
.with({ type: P.union(CommandType.Slash, CommandType.Both) }, module => {
|
|
||||||
if (event.isAutocomplete()) {
|
|
||||||
/**
|
|
||||||
* Autocomplete is a special case that
|
|
||||||
* must be handled separately, since it's
|
|
||||||
* too different from regular command modules
|
|
||||||
*/
|
|
||||||
return dispatchAutocomplete(module, event);
|
|
||||||
} else {
|
|
||||||
return dispatchCommand(module, contextArgs(event));
|
|
||||||
}
|
|
||||||
})
|
|
||||||
/**
|
/**
|
||||||
* Every other command module takes a one argument parameter, its corresponding interaction
|
* Autocomplete is a special case that
|
||||||
* this makes this usage safe
|
* must be handled separately, since it's
|
||||||
*/
|
* too different from regular command modules
|
||||||
.otherwise(mod => dispatchCommand(mod, interactionArg(event)))
|
*/
|
||||||
);
|
return dispatchAutocomplete(module, event);
|
||||||
|
} else {
|
||||||
|
return dispatchCommand(module, contextArgs(event));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default : return dispatchCommand(module, interactionArg(event));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,82 +1,79 @@
|
|||||||
import { EventsHandler } from './eventsHandler';
|
import { catchError, concatMap, EMPTY, finalize, fromEvent, map, of, pipe } from 'rxjs';
|
||||||
import { catchError, concatMap, EMPTY, finalize, fromEvent, map, Observable, of } from 'rxjs';
|
import { type ModuleStore, SernError } from '../structures';
|
||||||
import { type Wrapper, type ModuleStore, SernError } from '../structures';
|
|
||||||
import type { Message } from 'discord.js';
|
import type { Message } from 'discord.js';
|
||||||
import { executeModule, ignoreNonBot, makeModuleExecutor } from './observableHandling';
|
import { executeModule, ignoreNonBot, makeModuleExecutor } from './observableHandling';
|
||||||
import { fmt } from '../utilities/messageHelpers';
|
import { fmt } from '../utilities/messageHelpers';
|
||||||
import type { CommandModule, Module, TextCommand } from '../../types/module';
|
import type { CommandModule, TextCommand } from '../../types/module';
|
||||||
import { handleError } from '../contracts/errorHandling';
|
import { ErrorHandling, handleError } from '../contracts/errorHandling';
|
||||||
import { contextArgs, dispatchCommand } from './dispatchers';
|
import { contextArgs, dispatchCommand } from './dispatchers';
|
||||||
import SernEmitter from '../sernEmitter';
|
import SernEmitter from '../sernEmitter';
|
||||||
import type { Processed } from '../../types/handler';
|
import type { Processed } from '../../types/handler';
|
||||||
import { useContainerRaw } from '../dependencies';
|
import { useContainerRaw } from '../dependencies';
|
||||||
|
import type { Logging, ModuleManager } from '../contracts';
|
||||||
|
import type { EventEmitter } from 'node:events';
|
||||||
|
|
||||||
export default class MessageHandler extends EventsHandler<{
|
/**
|
||||||
module: Processed<Module>;
|
* An operator function that processes a message to fetch a command module and prepares context payload.
|
||||||
args: unknown[];
|
* @param defaultPrefix
|
||||||
}> {
|
* @param get
|
||||||
protected discordEvent: Observable<Message>;
|
*/
|
||||||
|
const createMessageProcessor = (
|
||||||
|
defaultPrefix: string,
|
||||||
|
get: (
|
||||||
|
cb: (ms: ModuleStore) => Processed<CommandModule> | undefined,
|
||||||
|
) => CommandModule | undefined,
|
||||||
|
) =>
|
||||||
|
pipe(
|
||||||
|
ignoreNonBot(defaultPrefix),
|
||||||
|
//This concatMap checks if module is undefined, and if it is, do not continue.
|
||||||
|
// Synonymous to filterMap, but I haven't thought of a generic implementation for filterMap yet
|
||||||
|
concatMap(message => {
|
||||||
|
const [prefix, ...rest] = fmt(message.content, defaultPrefix);
|
||||||
|
const module = get(ms => ms.TextCommands.get(prefix) ?? ms.BothCommands.get(prefix));
|
||||||
|
if (module === undefined) {
|
||||||
|
return EMPTY;
|
||||||
|
}
|
||||||
|
const payload = {
|
||||||
|
args: contextArgs(message, rest),
|
||||||
|
module,
|
||||||
|
};
|
||||||
|
return of(payload);
|
||||||
|
}),
|
||||||
|
map(({ args, module }) => dispatchCommand(module as Processed<TextCommand>, args)),
|
||||||
|
);
|
||||||
|
|
||||||
public constructor(protected wrapper: Wrapper) {
|
export function makeMessageCreate(
|
||||||
super(wrapper);
|
[s, client, err, log, modules]: [
|
||||||
this.discordEvent = <Observable<Message>>fromEvent(this.client, 'messageCreate');
|
SernEmitter,
|
||||||
this.init();
|
EventEmitter,
|
||||||
this.payloadSubject
|
ErrorHandling,
|
||||||
.pipe(
|
Logging | undefined,
|
||||||
makeModuleExecutor(module => {
|
ModuleManager,
|
||||||
this.emitter.emit(
|
],
|
||||||
'module.activate',
|
defaultPrefix?: string,
|
||||||
SernEmitter.failure(module, SernError.PluginFailure),
|
) {
|
||||||
);
|
if (!defaultPrefix) {
|
||||||
}),
|
return EMPTY.subscribe();
|
||||||
concatMap(payload => executeModule(this.emitter, payload)),
|
|
||||||
catchError(handleError(this.crashHandler, this.logger)),
|
|
||||||
finalize(() => {
|
|
||||||
this.logger?.info({ message: 'messageCreate stream closed or reached end of lifetime'});
|
|
||||||
useContainerRaw()
|
|
||||||
?.disposeAll()
|
|
||||||
.then(() => {
|
|
||||||
this.logger?.info({ message: 'Cleaning container and crashing' });
|
|
||||||
});
|
|
||||||
})
|
|
||||||
)
|
|
||||||
.subscribe();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected init(): void {
|
|
||||||
if (this.wrapper.defaultPrefix === undefined) return; //for now, just ignore if prefix doesn't exist
|
|
||||||
const { defaultPrefix } = this.wrapper;
|
|
||||||
const get = (cb: (ms: ModuleStore) => Processed<CommandModule> | undefined) => {
|
|
||||||
return this.modules.get(cb);
|
|
||||||
};
|
|
||||||
this.discordEvent
|
|
||||||
.pipe(
|
|
||||||
ignoreNonBot(this.wrapper.defaultPrefix),
|
|
||||||
//This concatMap checks if module is undefined, and if it is, do not continue.
|
|
||||||
// Synonymous to filterMap, but I haven't thought of a generic implementation for filterMap yet
|
|
||||||
concatMap(message => {
|
|
||||||
const [prefix, ...rest] = fmt(message, defaultPrefix);
|
|
||||||
const module = get(
|
|
||||||
ms => ms.TextCommands.get(prefix) ?? ms.BothCommands.get(prefix),
|
|
||||||
);
|
|
||||||
if (module === undefined) {
|
|
||||||
return EMPTY;
|
|
||||||
}
|
|
||||||
const payload = {
|
|
||||||
args: contextArgs(message, rest),
|
|
||||||
module,
|
|
||||||
};
|
|
||||||
return of(payload);
|
|
||||||
}),
|
|
||||||
map(({ args, module }) => dispatchCommand(module as Processed<TextCommand>, args)),
|
|
||||||
)
|
|
||||||
.subscribe({
|
|
||||||
next: value => this.setState(value),
|
|
||||||
error: reason => this.emitter.emit('error', SernEmitter.failure(reason)),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected setState(state: { module: Processed<Module>; args: unknown[] }) {
|
|
||||||
this.payloadSubject.next(state);
|
|
||||||
}
|
}
|
||||||
|
const get = (cb: (ms: ModuleStore) => Processed<CommandModule> | undefined) => {
|
||||||
|
return modules.get(cb);
|
||||||
|
};
|
||||||
|
const messageStream$ = fromEvent<Message>(client, 'messageCreate');
|
||||||
|
const messageProcessor = createMessageProcessor(defaultPrefix, get);
|
||||||
|
return messageStream$
|
||||||
|
.pipe(
|
||||||
|
messageProcessor,
|
||||||
|
makeModuleExecutor(module => {
|
||||||
|
s.emit('module.activate', SernEmitter.failure(module, SernError.PluginFailure));
|
||||||
|
}),
|
||||||
|
concatMap(payload => executeModule(s, payload)),
|
||||||
|
catchError(handleError(err, log)),
|
||||||
|
finalize(() => {
|
||||||
|
log?.info({ message: 'messageCreate stream closed or reached end of lifetime' });
|
||||||
|
useContainerRaw()
|
||||||
|
?.disposeAll()
|
||||||
|
.then(() => log?.info({ message: 'Cleaning container and crashing' }));
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.subscribe();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
import type { Awaitable, Message } from 'discord.js';
|
import type { Awaitable, Message } from 'discord.js';
|
||||||
import { concatMap, EMPTY, from, Observable, of, pipe, tap, throwError } from 'rxjs';
|
import { concatMap, EMPTY, from, Observable, of, pipe, tap, throwError } from 'rxjs';
|
||||||
import type { SernError } from '../structures';
|
|
||||||
import { Result } from 'ts-results-es';
|
import { Result } from 'ts-results-es';
|
||||||
import type { AnyModule, CommandModule, EventModule, Module } from '../../types/module';
|
import type { CommandModule, EventModule, Module } from '../../types/module';
|
||||||
import { _const as i } from '../utilities/functions';
|
|
||||||
import SernEmitter from '../sernEmitter';
|
import SernEmitter from '../sernEmitter';
|
||||||
import { callPlugin, everyPluginOk, filterMapTo } from './operators';
|
import { callPlugin, everyPluginOk, filterMapTo } from './operators';
|
||||||
import type { Processed } from '../../types/handler';
|
import type { Processed } from '../../types/handler';
|
||||||
import type { VoidResult } from '../../types/plugin';
|
import type { ControlPlugin, VoidResult } from '../../types/plugin';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ignores messages from any person / bot except itself
|
* Ignores messages from any person / bot except itself
|
||||||
@@ -31,27 +29,6 @@ export function ignoreNonBot<T extends Message>(prefix: string) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* If the current value in Result stream is an error, calls callback.
|
|
||||||
* This also extracts the Ok value from Result
|
|
||||||
* @param cb
|
|
||||||
* @returns Observable<{ module: T; absPath: string }>
|
|
||||||
*/
|
|
||||||
export function errTap<T extends AnyModule>(cb: (err: SernError) => void) {
|
|
||||||
return (src: Observable<Result<{ module: T; absPath: string }, SernError>>) =>
|
|
||||||
new Observable<{ module: T; absPath: string }>(subscriber => {
|
|
||||||
return src.subscribe({
|
|
||||||
next(value) {
|
|
||||||
if (value.err) {
|
|
||||||
cb(value.val);
|
|
||||||
} else {
|
|
||||||
subscriber.next(value.val);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wraps the task in a Result as a try / catch.
|
* Wraps the task in a Result as a try / catch.
|
||||||
* if the task is ok, an event is emitted and the stream becomes empty
|
* if the task is ok, an event is emitted and the stream becomes empty
|
||||||
@@ -78,7 +55,7 @@ export function executeModule(
|
|||||||
emitter.emit('module.activate', SernEmitter.success(module));
|
emitter.emit('module.activate', SernEmitter.success(module));
|
||||||
return EMPTY;
|
return EMPTY;
|
||||||
} else {
|
} else {
|
||||||
return throwError(i(SernEmitter.failure(module, result.val)));
|
return throwError(() => SernEmitter.failure(module, result.val));
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@@ -94,7 +71,7 @@ export function executeModule(
|
|||||||
* @returns receiver function for flattening a stream of data
|
* @returns receiver function for flattening a stream of data
|
||||||
*/
|
*/
|
||||||
export function createResultResolver<
|
export function createResultResolver<
|
||||||
T extends Processed<Module>,
|
T extends { execute: (...args: any[]) => any; onEvent: ControlPlugin[] },
|
||||||
Args extends { module: T; [key: string]: unknown },
|
Args extends { module: T; [key: string]: unknown },
|
||||||
Output,
|
Output,
|
||||||
>(config: {
|
>(config: {
|
||||||
@@ -120,7 +97,7 @@ export function createResultResolver<
|
|||||||
* Calls a module's init plugins and checks for Err. If so, call { onFailure } and
|
* Calls a module's init plugins and checks for Err. If so, call { onFailure } and
|
||||||
* ignore the module
|
* ignore the module
|
||||||
*/
|
*/
|
||||||
export function scanModule<
|
export function callInitPlugins<
|
||||||
T extends Processed<CommandModule | EventModule>,
|
T extends Processed<CommandModule | EventModule>,
|
||||||
Args extends { module: T; absPath: string },
|
Args extends { module: T; absPath: string },
|
||||||
>(config: { onFailure?: (module: T) => unknown; onSuccess: (module: Args) => T }) {
|
>(config: { onFailure?: (module: T) => unknown; onSuccess: (module: Args) => T }) {
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import { nameOrFilename } from '../../utilities/functions';
|
|||||||
import type { PluginResult, VoidResult } from '../../../types/plugin';
|
import type { PluginResult, VoidResult } from '../../../types/plugin';
|
||||||
import { guayin } from '../../plugins';
|
import { guayin } from '../../plugins';
|
||||||
import { controller } from '../../sern';
|
import { controller } from '../../sern';
|
||||||
|
import { SernError } from '../../structures';
|
||||||
|
import { Result } from 'ts-results-es';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* if {src} is true, mapTo V, else ignore
|
* if {src} is true, mapTo V, else ignore
|
||||||
@@ -32,7 +34,7 @@ export function callPlugin(args: unknown): OperatorFunction<
|
|||||||
return pipe(
|
return pipe(
|
||||||
concatMap(async plugin => {
|
concatMap(async plugin => {
|
||||||
const isNewPlugin = Reflect.has(plugin, guayin);
|
const isNewPlugin = Reflect.has(plugin, guayin);
|
||||||
if(isNewPlugin) {
|
if (isNewPlugin) {
|
||||||
if (Array.isArray(args)) {
|
if (Array.isArray(args)) {
|
||||||
return plugin.execute(...args);
|
return plugin.execute(...args);
|
||||||
}
|
}
|
||||||
@@ -48,7 +50,7 @@ export function callPlugin(args: unknown): OperatorFunction<
|
|||||||
* operator function that fill the defaults for a module
|
* operator function that fill the defaults for a module
|
||||||
*/
|
*/
|
||||||
export function defineAllFields<T extends AnyModule>() {
|
export function defineAllFields<T extends AnyModule>() {
|
||||||
const fillFields = ({ absPath, module }: { absPath: string; module: T }) => ({
|
const fillFields = ({ module, absPath }: { module: T; absPath: string }) => ({
|
||||||
absPath,
|
absPath,
|
||||||
module: {
|
module: {
|
||||||
name: nameOrFilename(module.name, absPath),
|
name: nameOrFilename(module.name, absPath),
|
||||||
@@ -59,6 +61,27 @@ export function defineAllFields<T extends AnyModule>() {
|
|||||||
return pipe(map(fillFields));
|
return pipe(map(fillFields));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If the current value in Result stream is an error, calls callback.
|
||||||
|
* This also extracts the Ok value from Result
|
||||||
|
* @param cb
|
||||||
|
* @returns Observable<{ module: T; absPath: string }>
|
||||||
|
*/
|
||||||
|
export function errTap<T extends AnyModule>(
|
||||||
|
cb: (err: SernError) => void
|
||||||
|
): OperatorFunction<Result<{ module: T; absPath: string}, SernError>, { module: T; absPath: string }> {
|
||||||
|
return pipe(
|
||||||
|
concatMap(result => {
|
||||||
|
if(result.ok) {
|
||||||
|
return of(result.val);
|
||||||
|
} else {
|
||||||
|
cb(result.val);
|
||||||
|
return EMPTY;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the stream of results is all ok.
|
* Checks if the stream of results is all ok.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,72 +1,63 @@
|
|||||||
import { EventsHandler } from './eventsHandler';
|
import { fromEvent, pipe, switchMap, take } from 'rxjs';
|
||||||
import type Wrapper from '../structures/wrapper';
|
import * as Files from '../module-loading/readFile';
|
||||||
import { concatMap, fromEvent, type Observable, take } from 'rxjs';
|
import { callInitPlugins } from './observableHandling';
|
||||||
import * as Files from '../utilities/readFile';
|
import { CommandType, type ModuleStore, SernError } from '../structures';
|
||||||
import { errTap, scanModule } from './observableHandling';
|
|
||||||
import { CommandType, SernError, type ModuleStore } from '../structures';
|
|
||||||
import { match } from 'ts-pattern';
|
|
||||||
import { Result } from 'ts-results-es';
|
import { Result } from 'ts-results-es';
|
||||||
import { ApplicationCommandType, ComponentType } from 'discord.js';
|
import { ApplicationCommandType, ComponentType } from 'discord.js';
|
||||||
import type { CommandModule } from '../../types/module';
|
import type { CommandModule } from '../../types/module';
|
||||||
import type { Processed } from '../../types/handler';
|
import type { Processed } from '../../types/handler';
|
||||||
import type { ModuleManager } from '../contracts';
|
import type { ErrorHandling, Logging, ModuleManager } from '../contracts';
|
||||||
import { _const, err, ok } from '../utilities/functions';
|
import { err, ok } from '../utilities/functions';
|
||||||
import { defineAllFields } from './operators';
|
import { defineAllFields, errTap } from './operators';
|
||||||
import SernEmitter from '../sernEmitter';
|
import SernEmitter from '../sernEmitter';
|
||||||
|
import type { EventEmitter } from 'node:events';
|
||||||
|
|
||||||
export default class ReadyHandler extends EventsHandler<{
|
|
||||||
module: Processed<CommandModule>;
|
|
||||||
absPath: string;
|
|
||||||
}> {
|
|
||||||
protected discordEvent!: Observable<{ module: CommandModule; absPath: string }>;
|
|
||||||
constructor(wrapper: Wrapper) {
|
|
||||||
super(wrapper);
|
|
||||||
const ready$ = fromEvent(this.client, 'ready').pipe(take(1));
|
|
||||||
this.discordEvent = ready$.pipe(
|
|
||||||
concatMap(() =>
|
|
||||||
Files.buildData<CommandModule>(wrapper.commands).pipe(
|
|
||||||
errTap(reason => {
|
|
||||||
this.emitter.emit(
|
|
||||||
'module.register',
|
|
||||||
SernEmitter.failure(undefined, reason),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
this.init();
|
|
||||||
this.payloadSubject
|
|
||||||
.pipe(
|
|
||||||
scanModule({
|
|
||||||
onFailure: module => {
|
|
||||||
this.emitter.emit(
|
|
||||||
'module.register',
|
|
||||||
SernEmitter.failure(module, SernError.PluginFailure),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
onSuccess: ({ module }) => {
|
|
||||||
this.emitter.emit('module.register', SernEmitter.success(module));
|
|
||||||
return module;
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.subscribe(module => {
|
|
||||||
const res = registerModule(this.modules, module as Processed<CommandModule>);
|
|
||||||
if (res.err) {
|
|
||||||
this.crashHandler.crash(Error(SernError.InvalidModuleType));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
protected init() {
|
function buildCommandModules(
|
||||||
this.discordEvent.pipe(defineAllFields()).subscribe({
|
commandDir: string,
|
||||||
next: value => this.setState(value),
|
sernEmitter: SernEmitter
|
||||||
complete: () => this.payloadSubject.unsubscribe(),
|
) {
|
||||||
|
return pipe(
|
||||||
|
switchMap(() => Files.buildData<CommandModule>(commandDir)),
|
||||||
|
errTap(error => {
|
||||||
|
sernEmitter.emit('module.register', SernEmitter.failure(undefined, error));
|
||||||
|
}),
|
||||||
|
defineAllFields(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export function makeReadyEvent(
|
||||||
|
[sEmitter, client, errorHandler, , moduleManager]: [
|
||||||
|
SernEmitter,
|
||||||
|
EventEmitter,
|
||||||
|
ErrorHandling,
|
||||||
|
Logging | undefined,
|
||||||
|
ModuleManager,
|
||||||
|
],
|
||||||
|
commandDir: string,
|
||||||
|
) {
|
||||||
|
const readyOnce$ = fromEvent(client, 'ready').pipe(take(1));
|
||||||
|
return readyOnce$
|
||||||
|
.pipe(
|
||||||
|
buildCommandModules(commandDir, sEmitter),
|
||||||
|
callInitPlugins({
|
||||||
|
onFailure: module => {
|
||||||
|
sEmitter.emit(
|
||||||
|
'module.register',
|
||||||
|
SernEmitter.failure(module, SernError.PluginFailure),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
onSuccess: ({ module }) => {
|
||||||
|
sEmitter.emit('module.register', SernEmitter.success(module));
|
||||||
|
return module;
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.subscribe(module => {
|
||||||
|
const result = registerModule(moduleManager, module as Processed<CommandModule>);
|
||||||
|
if (result.err) {
|
||||||
|
errorHandler.crash(Error(SernError.InvalidModuleType));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
protected setState(state: { absPath: string; module: Processed<CommandModule> }): void {
|
|
||||||
this.payloadSubject.next(state);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerModule<T extends Processed<CommandModule>>(
|
function registerModule<T extends Processed<CommandModule>>(
|
||||||
@@ -75,45 +66,38 @@ function registerModule<T extends Processed<CommandModule>>(
|
|||||||
): Result<void, void> {
|
): Result<void, void> {
|
||||||
const name = mod.name;
|
const name = mod.name;
|
||||||
const insert = (cb: (ms: ModuleStore) => void) => {
|
const insert = (cb: (ms: ModuleStore) => void) => {
|
||||||
const set = Result.wrap(_const(manager.set(cb)));
|
const set = Result.wrap(() => manager.set(cb));
|
||||||
return set.ok ? ok() : err();
|
return set.ok ? ok() : err();
|
||||||
};
|
};
|
||||||
return match(mod as Processed<CommandModule>)
|
switch(mod.type) {
|
||||||
.with({ type: CommandType.Text }, mod => {
|
case CommandType.Text: {
|
||||||
mod.alias?.forEach(a => insert(ms => ms.TextCommands.set(a, mod)));
|
mod.alias?.forEach(a => insert(ms => ms.TextCommands.set(a, mod)));
|
||||||
return insert(ms => ms.TextCommands.set(name, mod));
|
return insert(ms => ms.TextCommands.set(name, mod));
|
||||||
})
|
}
|
||||||
.with({ type: CommandType.Slash }, mod =>
|
case CommandType.Slash:
|
||||||
insert(ms => ms.ApplicationCommands[ApplicationCommandType.ChatInput].set(name, mod)),
|
return insert(ms => ms.ApplicationCommands[ApplicationCommandType.ChatInput].set(name, mod));
|
||||||
)
|
case CommandType.Both: {
|
||||||
.with({ type: CommandType.Both }, mod => {
|
|
||||||
mod.alias?.forEach(a => insert(ms => ms.TextCommands.set(a, mod)));
|
mod.alias?.forEach(a => insert(ms => ms.TextCommands.set(a, mod)));
|
||||||
return insert(ms => ms.BothCommands.set(name, mod));
|
return insert(ms => ms.BothCommands.set(name, mod));
|
||||||
})
|
}
|
||||||
.with({ type: CommandType.CtxUser }, mod =>
|
case CommandType.CtxUser:
|
||||||
insert(ms => ms.ApplicationCommands[ApplicationCommandType.User].set(name, mod)),
|
return insert(ms => ms.ApplicationCommands[ApplicationCommandType.User].set(name, mod));
|
||||||
)
|
case CommandType.CtxMsg:
|
||||||
.with({ type: CommandType.CtxMsg }, mod =>
|
return insert(ms => ms.ApplicationCommands[ApplicationCommandType.Message].set(name, mod));
|
||||||
insert(ms => ms.ApplicationCommands[ApplicationCommandType.Message].set(name, mod)),
|
case CommandType.Button:
|
||||||
)
|
return insert(ms => ms.InteractionHandlers[ComponentType.Button].set(name, mod));
|
||||||
.with({ type: CommandType.Button }, mod =>
|
case CommandType.StringSelect:
|
||||||
insert(ms => ms.InteractionHandlers[ComponentType.Button].set(name, mod)),
|
return insert(ms => ms.InteractionHandlers[ComponentType.StringSelect].set(name, mod));
|
||||||
)
|
case CommandType.MentionableSelect:
|
||||||
.with({ type: CommandType.StringSelect }, mod =>
|
return insert(ms => ms.InteractionHandlers[ComponentType.MentionableSelect].set(name, mod));
|
||||||
insert(ms => ms.InteractionHandlers[ComponentType.StringSelect].set(name, mod)),
|
case CommandType.UserSelect:
|
||||||
)
|
return insert(ms => ms.InteractionHandlers[ComponentType.UserSelect].set(name, mod));
|
||||||
.with({ type: CommandType.MentionableSelect }, mod =>
|
case CommandType.ChannelSelect:
|
||||||
insert(ms => ms.InteractionHandlers[ComponentType.MentionableSelect].set(name, mod)),
|
return insert(ms => ms.InteractionHandlers[ComponentType.ChannelSelect].set(name, mod));
|
||||||
)
|
case CommandType.RoleSelect:
|
||||||
.with({ type: CommandType.ChannelSelect }, mod =>
|
return insert(ms => ms.InteractionHandlers[ComponentType.RoleSelect].set(name, mod));
|
||||||
insert(ms => ms.InteractionHandlers[ComponentType.ChannelSelect].set(name, mod)),
|
case CommandType.Modal:
|
||||||
)
|
return insert(ms => ms.ModalSubmit.set(name, mod));
|
||||||
.with({ type: CommandType.UserSelect }, mod =>
|
default: return err();
|
||||||
insert(ms => ms.InteractionHandlers[ComponentType.UserSelect].set(name, mod)),
|
}
|
||||||
)
|
|
||||||
.with({ type: CommandType.RoleSelect }, mod =>
|
|
||||||
insert(ms => ms.InteractionHandlers[ComponentType.RoleSelect].set(name, mod)),
|
|
||||||
)
|
|
||||||
.with({ type: CommandType.Modal }, mod => insert(ms => ms.ModalSubmit.set(name, mod)))
|
|
||||||
.otherwise(err);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,69 +1,64 @@
|
|||||||
import { catchError, finalize, map, tap } from 'rxjs';
|
import { catchError, finalize, map, mergeAll } from 'rxjs';
|
||||||
import { buildData } from '../utilities/readFile';
|
import { buildData } from '../module-loading/readFile';
|
||||||
import type { Dependencies, Processed } from '../../types/handler';
|
import type { Dependencies, Processed } from '../../types/handler';
|
||||||
import { errTap, scanModule } from './observableHandling';
|
import { callInitPlugins } from './observableHandling';
|
||||||
import type { CommandModule, EventModule } from '../../types/module';
|
import type { CommandModule, EventModule } from '../../types/module';
|
||||||
import type { EventEmitter } from 'events';
|
import type { EventEmitter } from 'events';
|
||||||
import SernEmitter from '../sernEmitter';
|
import SernEmitter from '../sernEmitter';
|
||||||
import { match } from 'ts-pattern';
|
|
||||||
import type { ErrorHandling, Logging } from '../contracts';
|
import type { ErrorHandling, Logging } from '../contracts';
|
||||||
import { SernError, EventType, type Wrapper } from '../structures';
|
import { SernError, EventType, type Wrapper } from '../structures';
|
||||||
import { eventDispatcher } from './dispatchers';
|
import { eventDispatcher } from './dispatchers';
|
||||||
import { handleError } from '../contracts/errorHandling';
|
import { handleError } from '../contracts/errorHandling';
|
||||||
import { defineAllFields } from './operators';
|
import { defineAllFields, errTap } from './operators';
|
||||||
import { useContainerRaw } from '../dependencies';
|
import { useContainerRaw } from '../dependencies';
|
||||||
|
|
||||||
export function processEvents({ containerConfig, events }: Wrapper) {
|
export function makeEventsHandler(
|
||||||
const [client, errorHandling, sernEmitter, logger] = containerConfig.get(
|
[s, client, err, log]: [SernEmitter, EventEmitter, ErrorHandling, Logging | undefined],
|
||||||
'@sern/client',
|
eventsPath: string,
|
||||||
'@sern/errors',
|
containerGetter: Wrapper['containerConfig'],
|
||||||
'@sern/emitter',
|
) {
|
||||||
'@sern/logger',
|
const lazy = (k: string) => containerGetter.get(k as keyof Dependencies)[0];
|
||||||
) as [EventEmitter, ErrorHandling, SernEmitter, Logging?];
|
const eventStream$ = eventObservable(eventsPath, s);
|
||||||
const lazy = (k: string) => containerConfig.get(k as keyof Dependencies)[0];
|
|
||||||
const eventStream$ = eventObservable$(events!, sernEmitter);
|
|
||||||
|
|
||||||
const eventCreation$ = eventStream$.pipe(
|
const eventCreation$ = eventStream$.pipe(
|
||||||
defineAllFields(),
|
defineAllFields(),
|
||||||
scanModule({
|
callInitPlugins({
|
||||||
onFailure: module => sernEmitter.emit('module.register', SernEmitter.success(module)),
|
onFailure: module => s.emit('module.register', SernEmitter.failure(module, SernError.PluginFailure)),
|
||||||
onSuccess: ({ module }) => {
|
onSuccess: ({ module }) => {
|
||||||
sernEmitter.emit(
|
s.emit('module.register', SernEmitter.success(module));
|
||||||
'module.register',
|
|
||||||
SernEmitter.failure(module, SernError.PluginFailure),
|
|
||||||
);
|
|
||||||
return module;
|
return module;
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
const intoDispatcher = (e: Processed<EventModule | CommandModule>) =>
|
const intoDispatcher = (e: Processed<EventModule | CommandModule>) => {
|
||||||
match(e)
|
switch(e.type) {
|
||||||
.with({ type: EventType.Sern }, m => eventDispatcher(m, sernEmitter))
|
case EventType.Sern: return eventDispatcher(e, s);
|
||||||
.with({ type: EventType.Discord }, m => eventDispatcher(m, client))
|
case EventType.Discord: return eventDispatcher(e, client);
|
||||||
.with({ type: EventType.External }, m => eventDispatcher(m, lazy(m.emitter)))
|
case EventType.External: return eventDispatcher(e, lazy(e.emitter));
|
||||||
.otherwise(() => errorHandling.crash(Error(SernError.InvalidModuleType)));
|
default: err.crash(Error(SernError.InvalidModuleType + ' while creating event handler'));
|
||||||
|
}
|
||||||
|
};
|
||||||
eventCreation$
|
eventCreation$
|
||||||
.pipe(
|
.pipe(
|
||||||
map(intoDispatcher),
|
map(intoDispatcher),
|
||||||
/**
|
/**
|
||||||
* Where all events are turned on
|
* Where all events are turned on
|
||||||
*/
|
*/
|
||||||
tap(dispatcher => dispatcher.subscribe()),
|
mergeAll(),
|
||||||
catchError(handleError(errorHandling, logger)),
|
catchError(handleError(err, log)),
|
||||||
finalize(() => {
|
finalize(() => {
|
||||||
logger?.info({ message: 'an event module reached end of lifetime'});
|
log?.info({ message: 'an event module reached end of lifetime' });
|
||||||
useContainerRaw()
|
useContainerRaw()
|
||||||
?.disposeAll()
|
?.disposeAll()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
logger?.info({ message: 'Cleaning container and crashing' });
|
log?.info({ message: 'Cleaning container and crashing' });
|
||||||
});
|
});
|
||||||
})
|
}),
|
||||||
)
|
)
|
||||||
.subscribe();
|
.subscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
function eventObservable$(events: string, emitter: SernEmitter) {
|
function eventObservable(events: string, emitter: SernEmitter) {
|
||||||
return buildData<EventModule>(events).pipe(
|
return buildData<EventModule>(events).pipe(
|
||||||
errTap(reason => {
|
errTap(reason => {
|
||||||
emitter.emit('module.register', SernEmitter.failure(undefined, reason));
|
emitter.emit('module.register', SernEmitter.failure(undefined, reason));
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { readdirSync, statSync } from 'fs';
|
import { readdirSync, statSync } from 'fs';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { type Observable, from, concatAll } from 'rxjs';
|
import { type Observable, from, mergeAll } from 'rxjs';
|
||||||
import { SernError } from '../structures/errors';
|
import { SernError } from '../structures/errors';
|
||||||
import { type Result, Err, Ok } from 'ts-results-es';
|
import { type Result, Err, Ok } from 'ts-results-es';
|
||||||
|
|
||||||
@@ -18,16 +18,13 @@ function readPath(dir: string, arrayOfFiles: string[] = []): string[] {
|
|||||||
|
|
||||||
return arrayOfFiles;
|
return arrayOfFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const fmtFileName = (n: string) => n.substring(0, n.length - 3);
|
export const fmtFileName = (n: string) => n.substring(0, n.length - 3);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* a directory string is converted into a stream of modules.
|
* a directory string is converted into a stream of modules.
|
||||||
* starts the stream of modules that sern needs to process on init
|
* starts the stream of modules that sern needs to process on init
|
||||||
* @returns {Observable<{ mod: Module; absPath: string; }[]>} data from command files
|
* @returns {Observable<{ mod: Module; absPath: string; }[]>} data from command files
|
||||||
* @param commandDir
|
* @param commandDir
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export function buildData<T>(commandDir: string): Observable<
|
export function buildData<T>(commandDir: string): Observable<
|
||||||
Result<
|
Result<
|
||||||
{
|
{
|
||||||
@@ -41,13 +38,14 @@ export function buildData<T>(commandDir: string): Observable<
|
|||||||
return from(
|
return from(
|
||||||
Promise.all(
|
Promise.all(
|
||||||
commands.map(async absPath => {
|
commands.map(async absPath => {
|
||||||
let module: T | undefined;
|
// prettier-ignore
|
||||||
try {
|
let module: T | undefined
|
||||||
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
/// #if MODE === 'esm'
|
||||||
module = require(absPath).default;
|
= (await import(`file:///` + absPath)).default
|
||||||
} catch {
|
/// #elif MODE === 'cjs'
|
||||||
module = (await import(`file:///` + absPath)).default;
|
= require(absPath).default; // eslint-disable-line
|
||||||
}
|
/// #endif
|
||||||
|
|
||||||
if (module === undefined) {
|
if (module === undefined) {
|
||||||
return Err(SernError.UndefinedModule);
|
return Err(SernError.UndefinedModule);
|
||||||
}
|
}
|
||||||
@@ -57,7 +55,7 @@ export function buildData<T>(commandDir: string): Observable<
|
|||||||
return Ok({ module, absPath });
|
return Ok({ module, absPath });
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
).pipe(concatAll());
|
).pipe(mergeAll());
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getCommands(dir: string): string[] {
|
export function getCommands(dir: string): string[] {
|
||||||
@@ -16,7 +16,8 @@ import type {
|
|||||||
StringSelectCommand,
|
StringSelectCommand,
|
||||||
TextCommand,
|
TextCommand,
|
||||||
UserSelectCommand,
|
UserSelectCommand,
|
||||||
ContextMenuMsg, Module,
|
ContextMenuMsg,
|
||||||
|
Module,
|
||||||
} from '../../types/module';
|
} from '../../types/module';
|
||||||
import type { Args, Payload, Processed, SlashOptions } from '../../types/handler';
|
import type { Args, Payload, Processed, SlashOptions } from '../../types/handler';
|
||||||
import type Context from '../structures/context';
|
import type Context from '../structures/context';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { CommandType, EventType, PluginType } from '../structures/enums';
|
import { CommandType, EventType, PluginType } from '../structures';
|
||||||
import type { Plugin, PluginResult } from '../../types/plugin';
|
import type { Plugin, PluginResult } from '../../types/plugin';
|
||||||
import type { CommandArgs, EventArgs } from './args';
|
import type { CommandArgs, EventArgs } from './args';
|
||||||
import type { ClientEvents } from 'discord.js';
|
import type { ClientEvents } from 'discord.js';
|
||||||
@@ -10,7 +10,7 @@ export function makePlugin<V extends unknown[]>(
|
|||||||
return {
|
return {
|
||||||
type,
|
type,
|
||||||
execute,
|
execute,
|
||||||
[guayin]: undefined
|
[guayin]: undefined,
|
||||||
} as Plugin<V>;
|
} as Plugin<V>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import type Wrapper from './structures/wrapper';
|
import type Wrapper from './structures/wrapper';
|
||||||
import { processEvents } from './events/userDefinedEventsHandling';
|
import { makeEventsHandler } from './events/userDefinedEventsHandling';
|
||||||
import { CommandType, EventType, PluginType } from './structures/enums';
|
import { CommandType, EventType, PluginType } from './structures/enums';
|
||||||
import type { AnyEventPlugin, ControlPlugin, InitPlugin, Plugin } from '../types/plugin';
|
import type { AnyEventPlugin, ControlPlugin, InitPlugin, Plugin } from '../types/plugin';
|
||||||
import InteractionHandler from './events/interactionHandler';
|
import { makeInteractionCreate } from './events/interactionHandler';
|
||||||
import ReadyHandler from './events/readyHandler';
|
import { makeReadyEvent } from './events/readyHandler';
|
||||||
import MessageHandler from './events/messageHandler';
|
import { makeMessageCreate } from './events/messageHandler';
|
||||||
import type {
|
import type {
|
||||||
CommandModule,
|
CommandModule,
|
||||||
CommandModuleDefs,
|
CommandModuleDefs,
|
||||||
@@ -14,7 +14,7 @@ import type {
|
|||||||
InputEvent,
|
InputEvent,
|
||||||
} from '../types/module';
|
} from '../types/module';
|
||||||
import type { Dependencies, DependencyConfiguration } from '../types/handler';
|
import type { Dependencies, DependencyConfiguration } from '../types/handler';
|
||||||
import { composeRoot, useContainer } from './dependencies/provider';
|
import { composeRoot, makeFetcher, useContainer } from './dependencies/provider';
|
||||||
import type { Logging } from './contracts';
|
import type { Logging } from './contracts';
|
||||||
import { err, ok, partition } from './utilities/functions';
|
import { err, ok, partition } from './utilities/functions';
|
||||||
import type { Awaitable, ClientEvents } from 'discord.js';
|
import type { Awaitable, ClientEvents } from 'discord.js';
|
||||||
@@ -37,14 +37,15 @@ import type { Awaitable, ClientEvents } from 'discord.js';
|
|||||||
*/
|
*/
|
||||||
export function init(wrapper: Wrapper) {
|
export function init(wrapper: Wrapper) {
|
||||||
const logger = wrapper.containerConfig.get('@sern/logger')[0] as Logging | undefined;
|
const logger = wrapper.containerConfig.get('@sern/logger')[0] as Logging | undefined;
|
||||||
|
const requiredDependenciesAnd = makeFetcher(wrapper);
|
||||||
const startTime = performance.now();
|
const startTime = performance.now();
|
||||||
const { events } = wrapper;
|
const { events } = wrapper;
|
||||||
if (events !== undefined) {
|
if (events !== undefined) {
|
||||||
processEvents(wrapper);
|
makeEventsHandler(requiredDependenciesAnd([]), events, wrapper.containerConfig);
|
||||||
}
|
}
|
||||||
new ReadyHandler(wrapper);
|
makeReadyEvent(requiredDependenciesAnd(['@sern/modules']), wrapper.commands);
|
||||||
new MessageHandler(wrapper);
|
makeMessageCreate(requiredDependenciesAnd(['@sern/modules']), wrapper.defaultPrefix);
|
||||||
new InteractionHandler(wrapper);
|
makeInteractionCreate(requiredDependenciesAnd(['@sern/modules']));
|
||||||
const endTime = performance.now();
|
const endTime = performance.now();
|
||||||
logger?.info({ message: `sern : ${(endTime - startTime).toFixed(2)} ms` });
|
logger?.info({ message: `sern : ${(endTime - startTime).toFixed(2)} ms` });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import * as Files from './readFile';
|
import * as Files from '../module-loading/readFile';
|
||||||
import { basename } from 'path';
|
import { basename } from 'path';
|
||||||
import { Err, Ok } from 'ts-results-es';
|
import { Err, Ok } from 'ts-results-es';
|
||||||
/**
|
/**
|
||||||
* A function that returns whatever value is provided.
|
* A function that returns whatever value is provided.
|
||||||
* Warning: this evaluates { @param value }. It does not defer a value.
|
* Warning: this evaluates { @param value }. It does not defer a value.
|
||||||
* @param value
|
* @param value
|
||||||
|
* @__PURE__
|
||||||
*/
|
*/
|
||||||
// prettier-ignore
|
// prettier-ignore
|
||||||
export const _const = <T>(value: T) => () => value;
|
export const _const = <T>(value: T) => () => value;
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import type { Message } from 'discord.js';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the first character(s) _[depending on prefix length]_ of the message
|
* Removes the first character(s) _[depending on prefix length]_ of the message
|
||||||
* @param msg
|
* @param msg
|
||||||
@@ -10,6 +8,6 @@ import type { Message } from 'discord.js';
|
|||||||
* console.log(fmt(message, '!'));
|
* console.log(fmt(message, '!'));
|
||||||
* // [ 'ping' ]
|
* // [ 'ping' ]
|
||||||
*/
|
*/
|
||||||
export function fmt(msg: Message, prefix: string): string[] {
|
export function fmt(msg: string, prefix: string): string[] {
|
||||||
return msg.content.slice(prefix.length).trim().split(/\s+/g);
|
return msg.slice(prefix.length).trim().split(/\s+/g);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,4 +15,4 @@ export * from './handler/structures';
|
|||||||
export * from './handler/plugins';
|
export * from './handler/plugins';
|
||||||
export * from './handler/contracts';
|
export * from './handler/contracts';
|
||||||
export { SernEmitter };
|
export { SernEmitter };
|
||||||
export * from './handler/dependencies';
|
export * from './handler/dependencies';
|
||||||
|
|||||||
@@ -62,8 +62,8 @@ export type MapDeps<Deps extends Dependencies, T extends readonly unknown[]> = T
|
|||||||
//Basically, '@sern/client' | '@sern/store' | '@sern/modules' | '@sern/error' | '@sern/emitter' will be provided defaults, and you can exclude the rest
|
//Basically, '@sern/client' | '@sern/store' | '@sern/modules' | '@sern/error' | '@sern/emitter' will be provided defaults, and you can exclude the rest
|
||||||
export type OptionalDependencies = '@sern/logger';
|
export type OptionalDependencies = '@sern/logger';
|
||||||
export type Processed<T> = T & { name: string; description: string };
|
export type Processed<T> = T & { name: string; description: string };
|
||||||
export type Deprecated<Message extends string> = [never, Message]
|
export type Deprecated<Message extends string> = [never, Message];
|
||||||
export interface DependencyConfiguration<T extends Dependencies> {
|
export interface DependencyConfiguration<T extends Dependencies> {
|
||||||
exclude?: Set<OptionalDependencies>;
|
exclude?: Set<OptionalDependencies>;
|
||||||
build: (root: Container<Omit<Dependencies, '@sern/client'>, {}>) => Container<T, {}>
|
build: (root: Container<Omit<Dependencies, '@sern/client'>, {}>) => Container<T, {}>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,13 +19,13 @@ import type {
|
|||||||
MentionableSelectMenuInteraction,
|
MentionableSelectMenuInteraction,
|
||||||
RoleSelectMenuInteraction,
|
RoleSelectMenuInteraction,
|
||||||
StringSelectMenuInteraction,
|
StringSelectMenuInteraction,
|
||||||
|
UserSelectMenuInteraction
|
||||||
} from 'discord.js';
|
} from 'discord.js';
|
||||||
import { CommandType } from '../handler/structures/enums';
|
import { CommandType } from '../handler/structures/enums';
|
||||||
import type { Args, SlashOptions } from './handler';
|
import type { Args, SlashOptions } from './handler';
|
||||||
import type Context from '../handler/structures/context';
|
import type Context from '../handler/structures/context';
|
||||||
import type { InitPlugin, ControlPlugin } from './plugin';
|
import type { InitPlugin, ControlPlugin } from './plugin';
|
||||||
import { EventType } from '../handler/structures/enums';
|
import { EventType } from '../handler/structures/enums';
|
||||||
import type { UserSelectMenuInteraction } from 'discord.js';
|
|
||||||
import type { AnyCommandPlugin, AnyEventPlugin } from './plugin';
|
import type { AnyCommandPlugin, AnyEventPlugin } from './plugin';
|
||||||
import type { SernEventsMapping } from './handler';
|
import type { SernEventsMapping } from './handler';
|
||||||
import type { ClientEvents } from 'discord.js';
|
import type { ClientEvents } from 'discord.js';
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ export type PluginResult = Awaitable<VoidResult>;
|
|||||||
export type VoidResult = Result<void, void>;
|
export type VoidResult = Result<void, void>;
|
||||||
|
|
||||||
export interface Controller {
|
export interface Controller {
|
||||||
next: () => Ok<void>
|
next: () => Ok<void>;
|
||||||
stop: () => Err<void>
|
stop: () => Err<void>;
|
||||||
}
|
}
|
||||||
export interface Plugin<Args extends any[] = any[]> {
|
export interface Plugin<Args extends any[] = any[]> {
|
||||||
type: PluginType;
|
type: PluginType;
|
||||||
@@ -50,7 +50,10 @@ export interface CommandPlugin<T extends CommandType = CommandType> {
|
|||||||
name?: string;
|
name?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
type: PluginType.Command;
|
type: PluginType.Command;
|
||||||
execute: (m: InitArgs<Processed<CommandModule>>, controller?: Deprecated<'Please import controller instead'>) => PluginResult;
|
execute: (
|
||||||
|
m: InitArgs<Processed<CommandModule>>,
|
||||||
|
controller?: Deprecated<'Please import controller instead'>,
|
||||||
|
) => PluginResult;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @deprecated
|
* @deprecated
|
||||||
@@ -60,7 +63,7 @@ export interface EventPlugin<T extends CommandType> {
|
|||||||
name?: string;
|
name?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
type: PluginType.Event;
|
type: PluginType.Event;
|
||||||
execute: (args : CommandArgs<T, PluginType.Event>, controller?: Controller) => PluginResult
|
execute: (args: CommandArgs<T, PluginType.Event>, controller?: Controller) => PluginResult;
|
||||||
}
|
}
|
||||||
export type DiscordEmitterPlugin = Deprecated<'Please view alternatives: '>;
|
export type DiscordEmitterPlugin = Deprecated<'Please view alternatives: '>;
|
||||||
export type ExternalEmitterPlugin = Deprecated<'Please view alternatives: '>;
|
export type ExternalEmitterPlugin = Deprecated<'Please view alternatives: '>;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
import { defineConfig } from 'tsup';
|
import { defineConfig } from 'tsup';
|
||||||
|
import { writeFile } from 'fs/promises';
|
||||||
|
import ifdefPlugin from 'esbuild-ifdef';
|
||||||
const shared = {
|
const shared = {
|
||||||
entry: ['src/index.ts'],
|
entry: ['src/index.ts'],
|
||||||
external: ['discord.js'],
|
external: ['discord.js'],
|
||||||
@@ -12,19 +14,23 @@ export default defineConfig([
|
|||||||
target: 'node16',
|
target: 'node16',
|
||||||
tsconfig: './tsconfig-esm.json',
|
tsconfig: './tsconfig-esm.json',
|
||||||
outDir: './dist/esm',
|
outDir: './dist/esm',
|
||||||
external: ['discord.js'],
|
|
||||||
treeshake: true,
|
treeshake: true,
|
||||||
|
esbuildPlugins: [ifdefPlugin({ variables: { MODE: 'esm' }, verbose: true })],
|
||||||
outExtension() {
|
outExtension() {
|
||||||
return {
|
return {
|
||||||
js: '.mjs',
|
js: '.mjs',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
async onSuccess() {
|
||||||
|
console.log('writing json esm');
|
||||||
|
await writeFile('./dist/esm/package.json', JSON.stringify({ type: 'module' }));
|
||||||
|
},
|
||||||
...shared,
|
...shared,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
format: 'cjs',
|
format: 'cjs',
|
||||||
|
esbuildPlugins: [ifdefPlugin({ variables: { MODE: 'cjs' }, verbose: true })],
|
||||||
splitting: false,
|
splitting: false,
|
||||||
external: ['discord.js'],
|
|
||||||
target: 'node16',
|
target: 'node16',
|
||||||
tsconfig: './tsconfig-cjs.json',
|
tsconfig: './tsconfig-cjs.json',
|
||||||
outDir: './dist/cjs',
|
outDir: './dist/cjs',
|
||||||
@@ -33,6 +39,10 @@ export default defineConfig([
|
|||||||
js: '.cjs',
|
js: '.cjs',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
async onSuccess() {
|
||||||
|
console.log('writing json commonjs');
|
||||||
|
await writeFile('./dist/cjs/package.json', JSON.stringify({ type: 'commonjs' }));
|
||||||
|
},
|
||||||
...shared,
|
...shared,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user