From 511f736ac176369a2cada9c4ad711c143aeece41 Mon Sep 17 00:00:00 2001 From: HunteRoi Date: Wed, 10 Apr 2024 17:45:57 +0200 Subject: [PATCH 1/4] chore: rework global DX --- .github/workflows/build.yml | 17 + .prettierrc | 5 - docs/api-docs/assets/navigation.js | 2 +- docs/api-docs/assets/search.js | 2 +- .../api-docs/classes/VerificationManager.html | 12 +- docs/api-docs/enums/UserStatus.html | 8 +- .../enums/VerificationManagerEvents.html | 6 +- docs/api-docs/index.html | 2 +- docs/api-docs/interfaces/ISenderAPI.html | 8 +- docs/api-docs/interfaces/IStoringSystem.html | 10 +- docs/api-docs/interfaces/IUser.html | 22 +- docs/api-docs/interfaces/SenderAPIData.html | 5 + .../interfaces/VerificationOptions.html | 20 +- docs/api-docs/modules.html | 4 +- docs/api-docs/types/SenderAPIData.html | 3 - eslint.config.js | 1 + package.json | 63 +-- src/VerificationManager.ts | 11 +- src/services/JSONDatabaseService.ts | 1 + src/services/SendGridService.ts | 6 +- src/types/IUser.ts | 1 + src/types/SenderAPI.ts | 5 +- src/types/StoringSystem.ts | 2 + tsconfig.json | 30 +- tslint.json | 9 - typedoc.config.js | 11 + yarn.lock | 384 +++++++++--------- 27 files changed, 326 insertions(+), 324 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .prettierrc create mode 100644 docs/api-docs/interfaces/SenderAPIData.html delete mode 100644 docs/api-docs/types/SenderAPIData.html delete mode 100644 tslint.json create mode 100644 typedoc.config.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..00843da --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,17 @@ +name: Build + +on: + pull_request: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + - run: yarn diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index e97ea1b..0000000 --- a/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "tabWidth": 2, - "useTabs": false, - "singleQuote": true -} diff --git a/docs/api-docs/assets/navigation.js b/docs/api-docs/assets/navigation.js index 1f64236..4c122df 100644 --- a/docs/api-docs/assets/navigation.js +++ b/docs/api-docs/assets/navigation.js @@ -1 +1 @@ -window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACpXQPQvCQAwG4P+SuVgt1I9ugg4dRKHoIg6hRnvYXsslFUX879LF62ktuGR53zyQ7B8gdBOIYMtkEkGpGTyoUDKIgHRdsG+TQSZFDh5clD5CNH167+0dGXVSKYoq9Qo1nsksr6TlC/tZ/Mu2apojM3W6rjgK2mackD6SmW9iSyktZE6YEvs2dpEgHDuIlEbpc3JnoeIH1K70Ys2bu40m6Vtt376umsmdUEevj33/YIGCFpR7Rew74YcynE1GYfA8vAAqeh2zXQIAAA==" \ No newline at end of file +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAACpXQwQqCQBAG4HeZsyQJRXgL6uAhCqQu0WHQMZd0lZ0xiujdw4uruApd5vL/8zHM9QNCL4EQzkwmFpSGwYMaJYcQSDcl+zZZ5FIW4MFD6RTCzdfrti9kVKYSFFXpA2q8k9k/ScsImyz+ZVs1KZCZnO5QXAZ9M4pJp2S2p8hSSguZDBNi38ZDJFitB4hURul7/GahcgLqV2ax9s1uo03mVrtjdyjoJAaNOar/xmPdTnaCjt6Yvf0A9OTTX14CAAA=" \ No newline at end of file diff --git a/docs/api-docs/assets/search.js b/docs/api-docs/assets/search.js index 4c1961a..b8a0692 100644 --- a/docs/api-docs/assets/search.js +++ b/docs/api-docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAACrWaS2/bRhDHv8vqSsjah563JC2KHNIGTZseCCOgpbVNVKIEkpZjGP7uxSxfM9QsRVHuJUHCmfnP7G93drnUq0j3z5lYha/i3zjZiJWaLOdyqgKRRDsrVuKbTTY2/fD18y9RHolAPKVbsRL5y8FmN+TZ+DHfbUUg1tsoy2wmVkK8BVXU2XSqZ3XMHz/A/2ywUW2HYgbiEKU2yU9Sa8TkRJlaa73f9FYal8Y95MZlbh5V91df1dJ4kKqaNsP6ubatpeMkt+l9tLbZTfO0k5SamEUdMbPJpkesUWnHV4DS8uWd79M4efj2kuV2x+thi/75pzby5H8Sb1Ta+mogKXbIfXy5RNBZXyP5nMa57atYGV8qiFn9ndmU1YMHnWTIAtngbsKGGZUmnmRdHn3WPB+8c6V3Bo/WeXyMcrv5dF6lbTtcLt4nf8U7m+XR7tBPtOUxQPopsylpZLweMhsoEvOLlErEHauzSyDLo/wpOyNQGw0QSO6A7qdou7Xn6miZDhL7btP4/qWnXMu4n2DTXeDBNzp+NnnaZTfNg+4l3zSOg002cfLQHWfUWPGpooRYFTf37RmR2ugCDdwD3aDGa7fE/jjAn+z0Ysz690foT7/ZxKZDVUa+CHzRXE09j2+DkxmfOd9x0fiqfIP4GKXROrdp9s9jnNttnOXvlvWYD35lJWeOlVubPOSP71dDHe//TXsX/fwddb6P9n6f2j+t73TpraU7zpCJTc5SNk336RebZdHDZbO75Xh1ImUXHJLKievVyURbOKi+fB2eky/Ce6X2wfXzKzJrB7g6sWO0jd2Zb0hSjPPVCcXJVSmx7kOSkmrBbqNfoiR6QC8WZewbxqZzD51KhbbQJMvTp3W+7x93RJ3Ol1gl7tuBtjH49Jev7Icon7y6kzeUs9rI42r1Y3HuvEif+AzJoHNq/Xq0Sd4+xnrt+p5qYTf8lNoob585uyOPiF/vWssavJkUp/3LM6n93iUTeFkbMibE790y+fAcxfnliVRu75cH92bSJ5Hul5ULM3EnlcuSqFwu1r8NRJxs7E+xeoV+kMX7RKyEGuvxUgTiPrbbDVw8V3el6/1uBzFvy2ffLTRhsChMbiYiCCeBNuPZdH57G4SVh3vg/sOZSRGEMlDL8dQsiZkkZkoEoeLMFDHTIgg1J6qJmRFBaDgzQ8ymIginnNmUmM1EEM44sxkxm4sgnHNmc2K2EEG44MwWxGwpgnDJmS3p8MJoS5aDbIFwJCRrSVlILwxJaUgYdanYkBSIhIGXLDlJmUgYe8nCkxSLhOGXLD9JyUggIFmEksKRAEGyFCXlI4GDZEFKikg5RCxLRREp4KBYmKq1XBwiFqaijBSAUCwjRRkpAKFYRooyUlPfolYUkQIOioWpKCIFHBQLU1FECjgoFqaiiBRwUCxMRRFp4KBYmJoi0g4RC1NTRBo4aBambjU119VYmJoi0sBBszA1RaQBhOZbJWWkAYRmGWnKSAMIzTLSlJEGEJplpCkjDSA0y0hTRgZAaJaRoYwMgNAsI0MZGQBhWEaGMjIAwrCMTGvvcZsPy8hQRgZAGJaRoYwMgDD8jlYwcrv70aa53XwudvkwrG8GX8WPcuuX1dHjVUixen0LhJrC32/Nhg//AoH6Y0nxbQbFUCiI7vaO90nefPVAMTSKYbpiEGmF8lfK51bcIhTeu+r9uAmiJ00QfSZIeX/DRFFLFEV6ojSXks/NpSSKYVA5M1+M8h0UFTBF0nOfW4sagqYK8tJXO7iuy5M/UkUFG2/B+419qK8j99UtN0oDgVc+8BDlWL4ENa4GcTP+3NGFAUoejbT2jXTxhRNNUrxafBWX53GUJpIyPinnxc2qORqepce5vP6BUeKmNyKtfSMcZ+5HANEhJqmjzL2OxVfprPxxQOM8a5x9VcdP7ms1GmGEVE48XtWtOBoltACUbwHsop/JnZvK7nb6zt1Op+XtNIqF8lYLT6zinQiNMRpinwvSJiUjwtKrd1dMf8Z9gdx9E6T+bIfKRCOtfHO5o9shWe0DVfxko3FClfoggcsdWeVIyDc6bYRoNvg2M3Bpd0SNyOsuLbdO2s0BjadvPKqv2IgekpS+MYFFcrr1GTTnjK9M51pclSBP1BCMb12D52nPN6gDGt9Mr34NgMpERKSvGTS/U0COqAPJriKZoUXbk/IR6eybqFbtq/WI7ld21SU5ioEbgy9/JoYtb0NRJLQOjLccFInba/Ge31nRy8naQGtX+9pM+fulxgshYH1uA3GID3YbJ1aswtu3t/8AOhgQy+8oAAA="; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAACrWaS2/bRhDHv8vqSsjeh2RJNyctihzSBk2bHgjBoKW1vahECSQtxzD83YvhQ5yhZimSci8JEs5/Xr99cak3kexeUrEI38S/Ll6LhZpMAxFHWysW4ruN1za5/fbllyiLRCCek41YCBdnNnmIVja9Igbjp2y7EYFYbaI0talYCPEeVG7ltTJHv6vd2nZzNypNkc9A7KPExtlJfp5g+V/dgpWm/YLhhn05GnER66etrVLXZnb0mNp43cHXqLTjU0dp+fLOdomLH7+/ppnd8vGwRff8Ext58j/xNyptfTWQFFvCfXrtEzC3viTkS+IydoBxESvjvgExq79Tm7Dx4EH3Sbj2zOnazag08SSb59FzhiPnrTO71Xm0ytwhyuz68/koTdvh4dwu/sttbZpF2323oA3FgNDPqU186xeKh8wGBnH8JKUhXMvsbAuQZlH2nJ4JcDQaECC+B7qfo83GnqujYToo2A+buIfXjuEaxt0C1qsLPPhO+2fj5216VT9on/L1wrG38drFj+1+RrUVnypKiI2Sj317JsjRqEcMvAbmTXWrfIr9sYc/2eHFmPU7pPxmY5sMjTLyeeCL5mqqU5tOJrqu/+4ue92zq0K/ZMZHR51zGvNV+Zr4FCXRKrNJ+s+Ty+zGpdmHZT3mnV9YSdUST0EbGz9mTx9Xw9Hf/5v2Nvr5O1r5PtmHXWL/tL7TpbeWdj9DBjY5S9kk2SVfbZpGj/1Gd0N4cSLlKjgklRPpxclEGziovn4bnpPPw0eldpuv5xdk1nRwcWKHaOPyM9+QpBjxxQm5+KKUWPmQpKSasdvo1yiOHtGLRen7irFp3UMnUqEtNE6z5HmV7br7HVHR+RKrxH070MaBpnv4yn5I5JNXd/KGcjY2Ulwc/VCcO3vFJ5ohGbQOrV8PNs6ax1ivXddTLeyGnxMbZc0zZ7vnEdF1rrWswZtJcdrvn8lR9yGZwMvakJ4Q3YdlcvsSuax/IpXs4/Lg3ky6JNL+stIzk/yk0i+JStI7/jIQLl7bn2LxButB6naxWAg11uO5CMSDs5s1XP1WV6Sr3XYLPpflsx8WFmGwKEyurkUQXgfajI25WS6DsFLkD/L/yM2kCEIZqPlY6zkxk8RMiSBUnDdFzLQIQs2ZaWJmRBAazswQs4kIwglnNiFmUxGEU85sSsxuRBDecGY3xGwmgnDGmc2I2VwE4Zwzm9P2Qrcly0E2QPhJUBQSWi4l65LSkNB1yWKTFIiExkuWnKRMJPResvAkxSKh/ZLlJykZCQQki1BSOBIgSJaipHwkcJAsSEkRqRwRy1JRRApAKBamakyXfL6wjBRlpACE4qcWZaQAhGIZKcpIAQjFMlKUkQIQimWkKCMFIBTLSFFGCkAolpGijBSAUCwjRRlpAKFYRpoy0gBCs4w0ZaQBhGYZ6caqli9rLCNNGWkAofkVkDLSAEKzjDRlpAGEZhlpykgDCM0y0pSRBhCaZaQpIw0gNMtIU0YGQGiWkaGMDIAwLCNDGRkAYVhGhjIyAMKwjExj88l3H5aRoYwMgDD8RlUwyjftg00yu/5SbN5heLzwexN35Y6udHWkeBPKiMXb+3u9g8O/wPXx60fxsaVWS1mrpWpXu12c1Z8xkA+FfOg2HzTxa5S49MmKa4FCva1eeGsnGjnRZ5yUFzKMFzVHXq49Xupbxpf6lhH5MKicic9H+VKJCpig0FOfrEkNNRyMAiF9tYN0VR7lUVRUsPEWvFvbx+P94q66tkYlI/DKBx68HMq3mlpqEDfjzx3dAKDkUae1r9PFJ0vUMhRQ+iouD9goTRTK+ELlKm5U3aD2zDzi8j4HusQNb9Rh7euwS/Ov+tHeESlSeoXFZ+a0/Npfi9Gg9FXtnvPPz7UGDam5R1NdcqMeoUjKN/y30c/4Ph/I+WXzfX7ZnJSXzcjXFPm68fgqXnGQCGl8EhSbDCkUT3rj3ReDn5Gj4SF9w+P4FQ7pUKOVbyS3rHUzJPeBKn6BUYtQpT5IILkncxzV5+tOEyGebi2S5nqoUX66LVY+S5pLA1oZfO2sPkojCmjgSl9PYIqcbnwGTU3jKzOXFjcfSIlGq/HNalCervgG7RnGN9Krj/uoTERE+paC+mcHSIiKlG1FMq1FI1T6Rmjrqolq1b5aD+i6ZFvdeSMfeP305c/4sOXlJvKEytHecpAnbqdFFanWil5P5gaahtq3zJQ/R6pVKGdWswzE3u3txsVWLMLl+/t/knD+aEAoAAA="; \ No newline at end of file diff --git a/docs/api-docs/classes/VerificationManager.html b/docs/api-docs/classes/VerificationManager.html index aa188f2..7ce207a 100644 --- a/docs/api-docs/classes/VerificationManager.html +++ b/docs/api-docs/classes/VerificationManager.html @@ -1,6 +1,6 @@ -VerificationManager | @hunteroi/discord-verification

The manager handling verification (generating, sending and verifying the user's code).

+VerificationManager | @hunteroi/discord-verification

The manager handling verification (generating, sending and verifying the user's code).

Export

VerificationManager

-

Type Parameters

Hierarchy

  • EventEmitter
    • VerificationManager

Constructors

Type Parameters

Hierarchy

  • EventEmitter
    • VerificationManager

Constructors

Properties

Methods

sendCode verifyCode @@ -13,14 +13,14 @@ invalidCodeMessage: (user: TUser, invalidCode: string) => Your code ${invalidCode} is invalid! }]

Returns VerificationManager<TUser>

Memberof

VerificationManager

-

Properties

client: Client<boolean>

The Discord client instance.

+

Properties

client: Client<boolean>

The Discord client instance.

Memberof

VerificationManager

-

Methods

  • Sends the code via the communication service to the user based on the provided data. +

Methods

  • Sends the code via the communication service to the user based on the provided data. Saves the user, their code and their data into the database.

    Parameters

    • userid: string
    • data: any

    Returns Promise<string>

    the result of the operation as a string, based on the result of the call to one of the manager's options' methods.

    Memberof

    VerificationManager

    -
  • Verifies the provided code for the provided user. Increments the number of tries of that specific users.

    Parameters

    • userid: string
    • code: string

    Returns Promise<string>

    the result of the operation as a string, based on the result of the call to one of the manager's options' methods.

    Memberof

    VerificationManager

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/api-docs/enums/UserStatus.html b/docs/api-docs/enums/UserStatus.html index 9a4bcec..5e282bb 100644 --- a/docs/api-docs/enums/UserStatus.html +++ b/docs/api-docs/enums/UserStatus.html @@ -1,6 +1,6 @@ -UserStatus | @hunteroi/discord-verification

The different user statuses (either pending or active).

-

Export

Enumeration Members

active +UserStatus | @hunteroi/discord-verification

The different user statuses (either pending or active).

+

Export

Enumeration Members

Enumeration Members

active: 1

The user is verified and active.

-
pending: 0

The user verification is pending.

-
\ No newline at end of file +
pending: 0

The user verification is pending.

+
\ No newline at end of file diff --git a/docs/api-docs/enums/VerificationManagerEvents.html b/docs/api-docs/enums/VerificationManagerEvents.html index 6db3f09..cdb7354 100644 --- a/docs/api-docs/enums/VerificationManagerEvents.html +++ b/docs/api-docs/enums/VerificationManagerEvents.html @@ -1,8 +1,8 @@ -VerificationManagerEvents | @hunteroi/discord-verification

Enumeration VerificationManagerEvents

The events emitted by the VerificationManager on specific actions.

-

Export

Enumeration Members

codeCreate +VerificationManagerEvents | @hunteroi/discord-verification

Enumeration VerificationManagerEvents

The events emitted by the VerificationManager on specific actions.

+

Export

Enumeration Members

codeCreate: "codeCreate"
codeVerify: "codeVerify"
error: "error"
userActive: "userActive"
userAwait: "userAwait"
userCreate: "userCreate"
\ No newline at end of file +

Enumeration Members

codeCreate: "codeCreate"
codeVerify: "codeVerify"
error: "error"
userActive: "userActive"
userAwait: "userAwait"
userCreate: "userCreate"
\ No newline at end of file diff --git a/docs/api-docs/index.html b/docs/api-docs/index.html index d362eff..03ef71a 100644 --- a/docs/api-docs/index.html +++ b/docs/api-docs/index.html @@ -1,4 +1,4 @@ -@hunteroi/discord-verification

@hunteroi/discord-verification

release version +@hunteroi/discord-verification

@hunteroi/discord-verification

release version nb downloads npm

discord-verification

A framework to integrate a verification system with your Discord guild built with DiscordJS.

    diff --git a/docs/api-docs/interfaces/ISenderAPI.html b/docs/api-docs/interfaces/ISenderAPI.html index a2aba2c..1e391cc 100644 --- a/docs/api-docs/interfaces/ISenderAPI.html +++ b/docs/api-docs/interfaces/ISenderAPI.html @@ -1,6 +1,6 @@ -ISenderAPI | @hunteroi/discord-verification

    The contract of a sender service.

    +ISenderAPI | @hunteroi/discord-verification

    The contract of a sender service.

    Export

    ISenderAPI

    -
    interface ISenderAPI {
        send(data): Promise<void>;
    }

    Methods

    interface ISenderAPI {
        send(data): Promise<void>;
    }

    Methods

    Methods

    • Sends data to a user via a specific flow.

      -

      Parameters

      Returns Promise<void>

      Memberof

      ISenderAPI

      -
    \ No newline at end of file +

    Parameters

    Returns Promise<void>

    Memberof

    ISenderAPI

    +
\ No newline at end of file diff --git a/docs/api-docs/interfaces/IStoringSystem.html b/docs/api-docs/interfaces/IStoringSystem.html index 822205a..963fbb3 100644 --- a/docs/api-docs/interfaces/IStoringSystem.html +++ b/docs/api-docs/interfaces/IStoringSystem.html @@ -1,14 +1,14 @@ -IStoringSystem | @hunteroi/discord-verification

Interface IStoringSystem<TUser>

The contract of a storing service.

+IStoringSystem | @hunteroi/discord-verification

Interface IStoringSystem<TUser>

The contract of a storing service.

Export

IStoringSystem

-
interface IStoringSystem<TUser> {
    read(userid): Promise<undefined | null | TUser>;
    readBy(filters): Promise<undefined | null | TUser>;
    readBy(callback): Promise<undefined | null | TUser>;
    readBy(argument): Promise<undefined | null | TUser>;
    write(user): Promise<void>;
}

Type Parameters

Methods

interface IStoringSystem<TUser> {
    read(userid): Promise<undefined | null | TUser>;
    readBy(filters): Promise<undefined | null | TUser>;
    readBy(callback): Promise<undefined | null | TUser>;
    readBy(argument): Promise<undefined | null | TUser>;
    write(user): Promise<void>;
}

Type Parameters

Methods

Methods

  • Reads the storing system to get the user based on its unique identifier.

    Parameters

    • userid: string

    Returns Promise<undefined | null | TUser>

    the user or nothing

    Memberof

    IStoringSystem

    -
  • Reads the storing system to get the user based on filters.

    Parameters

    • filters: Map<string, any>

    Returns Promise<undefined | null | TUser>

    the user or nothing

    Memberof

    IStoringSystem

    -
  • Parameters

    • callback: ((user, index) => boolean)
        • (user, index): boolean
        • Parameters

          • user: TUser
          • index: string | number

          Returns boolean

    Returns Promise<undefined | null | TUser>

  • Parameters

    • argument: Map<string, any> | ((user, index) => boolean)

    Returns Promise<undefined | null | TUser>

  • Writes a user into the storing system.

    +
  • Parameters

    • callback: ((user, index) => boolean)
        • (user, index): boolean
        • Parameters

          • user: TUser
          • index: string | number

          Returns boolean

    Returns Promise<undefined | null | TUser>

  • Parameters

    • argument: Map<string, any> | ((user, index) => boolean)

    Returns Promise<undefined | null | TUser>

  • Writes a user into the storing system.

    Parameters

    Returns Promise<void>

    Memberof

    IStoringSystem

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/api-docs/interfaces/IUser.html b/docs/api-docs/interfaces/IUser.html index c1dd076..7e2225b 100644 --- a/docs/api-docs/interfaces/IUser.html +++ b/docs/api-docs/interfaces/IUser.html @@ -1,6 +1,6 @@ -IUser | @hunteroi/discord-verification

Represents a user.

+IUser | @hunteroi/discord-verification

Represents a user.

Export

IUser

-
interface IUser {
    activatedCode?: null | string;
    activationTimestamp?: number;
    code: null | string;
    data: any;
    nbCodeCalled: number;
    nbVerifyCalled: number;
    status: UserStatus;
    userid: string;
    username: string;
}

Properties

interface IUser {
    activatedCode?: null | string;
    activationTimestamp?: number;
    code: null | string;
    data: any;
    nbCodeCalled: number;
    nbVerifyCalled: number;
    status: UserStatus;
    userid: string;
    username: string;
}

Properties

Properties

activatedCode?: null | string

The used code that verified the user.

Memberof

IUser

-
activationTimestamp?: number

The timestamp marking the activation of the user.

+
activationTimestamp?: number

The timestamp marking the activation of the user.

Memberof

IUser

-
code: null | string

The generated code to verify that user.

+
code: null | string

The generated code to verify that user.

Memberof

IUser

-
data: any

The data used to send the code. Could be an email, a phone number or any +

data: any

The data used to send the code. Could be an email, a phone number or any complex information. Type should match what is expected from the sender API.

Memberof

IUser

-
nbCodeCalled: number

The number of times the generation of a code for that user is initiated.

+
nbCodeCalled: number

The number of times the generation of a code for that user is initiated.

Memberof

IUser

-
nbVerifyCalled: number

The number of times the verification of a code for that user is initiated.

+
nbVerifyCalled: number

The number of times the verification of a code for that user is initiated.

Memberof

IUser

-
status: UserStatus

The status of the user.

+
status: UserStatus

The status of the user.

Memberof

IUser

-
userid: string

The user Discord ID.

+
userid: string

The user Discord ID.

Memberof

IUser

-
username: string

The user name.

+
username: string

The user name.

Memberof

IUser

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/api-docs/interfaces/SenderAPIData.html b/docs/api-docs/interfaces/SenderAPIData.html new file mode 100644 index 0000000..85f3ec3 --- /dev/null +++ b/docs/api-docs/interfaces/SenderAPIData.html @@ -0,0 +1,5 @@ +SenderAPIData | @hunteroi/discord-verification
interface SenderAPIData {
    code: string;
    name: string;
    [prop: string]: any;
}

Indexable

[prop: string]: any

Properties

Properties

code: string

The code to send.

+
name: string

The user name for message customization.

+
\ No newline at end of file diff --git a/docs/api-docs/interfaces/VerificationOptions.html b/docs/api-docs/interfaces/VerificationOptions.html index 0ee102f..618d4a8 100644 --- a/docs/api-docs/interfaces/VerificationOptions.html +++ b/docs/api-docs/interfaces/VerificationOptions.html @@ -1,6 +1,6 @@ -VerificationOptions | @hunteroi/discord-verification

Interface VerificationOptions<TUser>

The VerificationManager options.

+VerificationOptions | @hunteroi/discord-verification

Interface VerificationOptions<TUser>

The VerificationManager options.

Export

VerificationOptions

-
interface VerificationOptions<TUser> {
    codeGenerationOptions: {
        charactersWhitelist?: string;
        length: number;
    };
    maxNbCodeCalledBeforeResend: number;
    alreadyActiveMessage(user): string;
    alreadyPendingMessage(user): string;
    errorMessage(user, error): string;
    invalidCodeMessage(user, invalidCode): string;
    pendingMessage(user): string;
    validCodeMessage(user, validCode): string;
}

Type Parameters

Properties

interface VerificationOptions<TUser> {
    codeGenerationOptions: {
        charactersWhitelist?: string;
        length: number;
    };
    maxNbCodeCalledBeforeResend: number;
    alreadyActiveMessage(user): string;
    alreadyPendingMessage(user): string;
    errorMessage(user, error): string;
    invalidCodeMessage(user, invalidCode): string;
    pendingMessage(user): string;
    validCodeMessage(user, validCode): string;
}

Type Parameters

Properties

Methods

Type declaration

  • Optional charactersWhitelist?: string

    The whitelist of characters used to generate the code.

  • length: number

    The required length of the code.

Memberof

VerificationOptions

-
maxNbCodeCalledBeforeResend: number

The maximum number of calls before resending the code to the user via the communication service.

+
maxNbCodeCalledBeforeResend: number

The maximum number of calls before resending the code to the user via the communication service.

Memberof

VerificationOptions

-

Methods

  • Formats the message sent once the user tries to generate a code when they are already verified.

    +

Methods

  • Formats the message sent once the user tries to generate a code when they are already verified.

    Parameters

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent once the user tries to generate a code when it's already sent to them.

    +
  • Formats the message sent once the user tries to generate a code when it's already sent to them.

    Parameters

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent when calling the communication service throws an error.

    +
  • Formats the message sent when calling the communication service throws an error.

    Parameters

    • user: TUser
    • error: unknown

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent once the code is checked and invalid.

    Parameters

    • user: undefined | null | TUser
    • invalidCode: string

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent for the first time when the user's code has just been sent.

    +
  • Formats the message sent for the first time when the user's code has just been sent.

    Parameters

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent once the code is checked and valid.

    Parameters

    • user: undefined | null | TUser
    • validCode: string

    Returns string

    the message

    Memberof

    VerificationOptions

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/api-docs/modules.html b/docs/api-docs/modules.html index 0316ec8..4e89cb9 100644 --- a/docs/api-docs/modules.html +++ b/docs/api-docs/modules.html @@ -1,9 +1,9 @@ -@hunteroi/discord-verification

@hunteroi/discord-verification

Index

Enumerations

UserStatus +@hunteroi/discord-verification

@hunteroi/discord-verification

Index

Enumerations

Classes

Interfaces

Type Aliases

\ No newline at end of file diff --git a/docs/api-docs/types/SenderAPIData.html b/docs/api-docs/types/SenderAPIData.html deleted file mode 100644 index 1bfbf5a..0000000 --- a/docs/api-docs/types/SenderAPIData.html +++ /dev/null @@ -1,3 +0,0 @@ -SenderAPIData | @hunteroi/discord-verification
SenderAPIData: {
    code: string;
    name: string;
    [prop: string]: any;
}

Type declaration

  • [prop: string]: any
  • code: string

    The code to send.

    -
  • name: string

    The user name for message customization.

    -
\ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js index ff8bf3a..354081b 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -6,6 +6,7 @@ import tseslint from 'typescript-eslint'; export default tseslint.config( eslint.configs.recommended, ...tseslint.configs.recommended, + ...tseslint.configs.stylistic, { rules: { "@typescript-eslint/no-unused-vars": "warn", diff --git a/package.json b/package.json index 54df71a..ac84328 100644 --- a/package.json +++ b/package.json @@ -1,43 +1,17 @@ { - "name": "@hunteroi/discord-verification", - "version": "1.4.1", - "type": "module", - "description": "A framework to integrate a verification system with your Discord guild built with DiscordJS", - "main": "lib/index.js", - "scripts": { - "build": "tsc", - "build:docs": "typedoc", - "prepublish": "yarn build:docs", - "format": "npx prettier --write \"src/**/*.ts\" \"src/**/*.js\" \"examples/**/*.ts\" \"examples/**/*.js\"", - "lint": "eslint ./src", - "start": "yarn build & node ./examples/index.js" - }, - "repository": "git://github.com/hunteroi/discord-verification.git", - "keywords": [ - "verification", - "discordjs", - "authentication" - ], "author": "HunteRoi (https://tinaeldevresse.eu/)", - "funding": "https://github.com/sponsors/hunteroi", - "engines": { - "node": ">=20.x" - }, - "license": "MIT", "bugs": { "url": "https://github.com/hunteroi/discord-verification/issues" }, - "homepage": "https://github.com/hunteroi/discord-verification#readme", - "dependencies": { - "@sendgrid/mail": "^7.7.0", - "discord.js": "14.x" - }, + "description": "A framework to integrate a verification system with your Discord guild built with DiscordJS", "devDependencies": { "@eslint/js": "^9.0.0", + "@sendgrid/mail": "^8.1.3", "@types/node": "^20.12.7", "@types/node-json-db": "^0.9.3", "@types/sqlite3": "^3.1.11", "discord-sync-commands": "^0.3.0", + "discord.js": "^14.14.1", "eslint": "^9.0.0", "node-json-db": "^2.3.0", "typedoc": "^0.25.13", @@ -47,7 +21,34 @@ "directories": { "lib": "lib" }, + "engines": { + "node": ">=20.x" + }, "files": [ "lib/**/*" - ] -} + ], + "funding": "https://github.com/sponsors/hunteroi", + "homepage": "https://github.com/hunteroi/discord-verification#readme", + "keywords": [ + "verification", + "discordjs", + "authentication" + ], + "license": "MIT", + "main": "lib/index.js", + "name": "@hunteroi/discord-verification", + "peerDependencies": { + "@sendgrid/mail": "8.x", + "discord.js": "14.x" + }, + "repository": "git://github.com/hunteroi/discord-verification.git", + "scripts": { + "build": "tsc", + "build:docs": "typedoc", + "lint": "eslint ./src", + "prepublish": "yarn lint && yarn build && yarn build:docs", + "start": "yarn build & node ./examples/index.js" + }, + "type": "module", + "version": "1.4.2" +} \ No newline at end of file diff --git a/src/VerificationManager.ts b/src/VerificationManager.ts index 1a2f511..4e618f2 100644 --- a/src/VerificationManager.ts +++ b/src/VerificationManager.ts @@ -61,7 +61,7 @@ export class VerificationManager extends EventEmitter { length: 6, }, maxNbCodeCalledBeforeResend: 3, - errorMessage: (user: TUser, error: unknown) => + errorMessage: (user: TUser) => `An error occured when trying to send something to ${user?.username}!`, pendingMessage: (user: TUser) => `The verification code has just been sent to ${user.data}.`, @@ -71,7 +71,7 @@ export class VerificationManager extends EventEmitter { `You are already verified with the email ${user.data}!`, validCodeMessage: (user: TUser, validCode: string) => `Your code ${validCode} is valid! Welcome ${user.username}!`, - invalidCodeMessage: (user: TUser, invalidCode: string) => + invalidCodeMessage: (_, invalidCode: string) => `Your code ${invalidCode} is invalid!`, } ) { @@ -101,7 +101,7 @@ export class VerificationManager extends EventEmitter { options.maxNbCodeCalledBeforeResend = 3; } if (!options.errorMessage) { - options.errorMessage = (user: TUser, error: unknown) => `An error occured when trying to send something to ${user?.username}!`; + options.errorMessage = (user: TUser) => `An error occured when trying to send something to ${user?.username}!`; } if (!options.pendingMessage) { options.pendingMessage = (user: TUser) => `The verification code has just been sent to ${user.data}.`; @@ -110,13 +110,13 @@ export class VerificationManager extends EventEmitter { options.alreadyPendingMessage = (user: TUser) => `You already have a verification code pending! It was sent to ${user.data}.`; } if (!options.alreadyActiveMessage) { - options.alreadyActiveMessage = (user: TUser) => `An account is already verified with this data!`; + options.alreadyActiveMessage = () => `An account is already verified with this data!`; } if (!options.validCodeMessage) { options.validCodeMessage = (user: TUser, validCode: string) => `Your code ${validCode} is valid! Welcome ${user.username}!`; } if (!options.invalidCodeMessage) { - options.invalidCodeMessage = (user: TUser, invalidCode: string) => `Your code ${invalidCode} is invalid!`; + options.invalidCodeMessage = (_, invalidCode: string) => `Your code ${invalidCode} is invalid!`; } } @@ -129,6 +129,7 @@ export class VerificationManager extends EventEmitter { * @return {Promise} the result of the operation as a string, based on the result of the call to one of the manager's options' methods. * @memberof VerificationManager */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any public async sendCode(userid: Snowflake, data: any): Promise { let user: TUser | undefined | null = await this.#storingSystem.read(userid); if (!user) user = await this.#storingSystem.readBy(new Map([['data', data]])); diff --git a/src/services/JSONDatabaseService.ts b/src/services/JSONDatabaseService.ts index 83a6a33..ea0b53d 100644 --- a/src/services/JSONDatabaseService.ts +++ b/src/services/JSONDatabaseService.ts @@ -53,6 +53,7 @@ export class JSONDatabaseService implements IStoringSystem { * @return {Promise} the user or nothing * @memberof JSONDatabaseService */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any readBy(argument: Map | ((user: UserModel, index: number | string) => boolean)): Promise { if (argument instanceof Map) { return this.readBy(user => { diff --git a/src/services/SendGridService.ts b/src/services/SendGridService.ts index 3943222..51df1ce 100644 --- a/src/services/SendGridService.ts +++ b/src/services/SendGridService.ts @@ -3,7 +3,7 @@ import { MailDataRequired, MailService } from '@sendgrid/mail'; import { ISenderAPI, SenderAPIData } from '../types'; export type SendGridMailData = MailDataRequired; -export type SendGridOptions = { +export interface SendGridOptions { /** * SendGrid API key. * @@ -18,7 +18,7 @@ export type SendGridOptions = { * @type {SendGridMailData} */ mailData: SendGridMailData; -}; +} /** * The SendGrid communication service. Used to send the code via email. @@ -56,7 +56,7 @@ export class SendGridService implements ISenderAPI { const message = { ...this.#options.mailData, ...data - } as MailDataRequired; + } as SendGridMailData; if (this.#options.mailData.templateId) { message.templateId = this.#options.mailData.templateId; diff --git a/src/types/IUser.ts b/src/types/IUser.ts index a43bc9d..5fb1024 100644 --- a/src/types/IUser.ts +++ b/src/types/IUser.ts @@ -16,6 +16,7 @@ export interface IUser { * @type {*} * @memberof IUser */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any data: any; /** diff --git a/src/types/SenderAPI.ts b/src/types/SenderAPI.ts index e0f9972..e9bbee4 100644 --- a/src/types/SenderAPI.ts +++ b/src/types/SenderAPI.ts @@ -1,4 +1,4 @@ -export type SenderAPIData = { +export interface SenderAPIData { /** * The code to send. * @@ -13,8 +13,9 @@ export type SenderAPIData = { */ name: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any [prop: string]: any; -}; +} /** * The contract of a sender service. diff --git a/src/types/StoringSystem.ts b/src/types/StoringSystem.ts index abcc105..4783049 100644 --- a/src/types/StoringSystem.ts +++ b/src/types/StoringSystem.ts @@ -26,9 +26,11 @@ export interface IStoringSystem { * @return {(Promise)} the user or nothing * @memberof IStoringSystem */ + /* eslint-disable @typescript-eslint/no-explicit-any */ readBy(filters: Map): Promise; readBy(callback: (user: TUser, index: number | string) => boolean): Promise; readBy(argument: Map | ((user: TUser, index: number | string) => boolean)): Promise; + /* eslint-enable @typescript-eslint/no-explicit-any */ /** * Writes a user into the storing system. diff --git a/tsconfig.json b/tsconfig.json index 086e491..72e9a86 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,23 +1,21 @@ { "compilerOptions": { - "target": "es6", - "module": "commonjs", + "baseUrl": "./src", "declaration": true, + "esModuleInterop": true, + "module": "commonjs", "outDir": "./lib", - "strict": true, "resolveJsonModule": true, - "strictNullChecks": true, - "esModuleInterop": true, "skipLibCheck": true, + "strict": true, + "strictNullChecks": true, + "target": "es6" }, - "include": ["src/**/*"], - "exclude": ["lib/*", "node_modules/*"], - "typedocOptions": { - "entryPoints": ["src/index.ts"], - "out": "docs/api-docs", - "exclude": ["node_modules"], - "excludePrivate": true, - "hideGenerator": true, - "excludeExternals": true - } -} + "exclude": [ + "lib/*", + "node_modules/*" + ], + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 4052ddc..0000000 --- a/tslint.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": ["tslint:recommended", "tslint-config-prettier"], - "jsRules": { - "no-unused-expression": true - }, - "rules": {}, - "rulesDirectory": [] -} diff --git a/typedoc.config.js b/typedoc.config.js new file mode 100644 index 0000000..c10a666 --- /dev/null +++ b/typedoc.config.js @@ -0,0 +1,11 @@ +/** @type {import('typedoc').TypeDocOptions} */ +export default { + "entryPoints": ["src/index.ts"], + "out": "docs/api-docs", + "hideGenerator": true, + "excludePrivate": true, + "excludeExternals": true, + "navigationLinks": { + "GitHub": "https://github.com/hunteroi/discord-verification" + } +} diff --git a/yarn.lock b/yarn.lock index 69c5c1c..e432e92 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18,28 +18,33 @@ ts-mixer "^6.0.0" tslib "^2.3.0" -"@discordjs/builders@^1.5.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.5.0.tgz#f6dd4684e46707eb600eabdfdacd3b44c9e924cd" - integrity sha512-7XxT78mnNBPigHn2y6KAXkicxIBFtZREGWaRZ249EC1l6gBUEP8IyVY5JTciIjJArxkF+tg675aZvsTNTKBpmA== +"@discordjs/builders@^1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.7.0.tgz#e2478c7e55b0f4c40837edb8f102bce977323a37" + integrity sha512-GDtbKMkg433cOZur8Dv6c25EHxduNIBsxeHrsRoIM8+AwmEZ8r0tEpckx/sHwTLwQPOF3e2JWloZh9ofCaMfAw== dependencies: - "@discordjs/formatters" "^0.2.0" - "@discordjs/util" "^0.2.0" - "@sapphire/shapeshift" "^3.8.1" - discord-api-types "^0.37.35" + "@discordjs/formatters" "^0.3.3" + "@discordjs/util" "^1.0.2" + "@sapphire/shapeshift" "^3.9.3" + discord-api-types "0.37.61" fast-deep-equal "^3.1.3" ts-mixer "^6.0.3" - tslib "^2.5.0" + tslib "^2.6.2" + +"@discordjs/collection@1.5.3": + version "1.5.3" + resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-1.5.3.tgz#5a1250159ebfff9efa4f963cfa7e97f1b291be18" + integrity sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ== "@discordjs/collection@^0.2.1": version "0.2.4" resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-0.2.4.tgz#c8ff2250430dcec7324dd4aafd1ccbcbdfa9ac14" integrity sha512-PVrEJH+V6Ob0OwfagYQ/57kwt/HNEJxt5jqY4P+S3st9y29t9iokdnGMQoJXG5VEMAQIPbzu9Snw1F6yE8PdLA== -"@discordjs/collection@^1.4.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-1.4.0.tgz#6b5d5429db0691a3f5a962c21f6bc7859eef3333" - integrity sha512-hiOJyk2CPFf1+FL3a4VKCuu1f448LlROVuu8nLz1+jCOAPokUcdFAV+l4pd3B3h6uJlJQSASoZzrdyNdjdtfzQ== +"@discordjs/collection@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-2.0.0.tgz#409b80c74eb8486cc4ee6a9b83426aaff1380f8c" + integrity sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w== "@discordjs/form-data@^3.0.1": version "3.0.1" @@ -50,31 +55,47 @@ combined-stream "^1.0.8" mime-types "^2.1.12" -"@discordjs/formatters@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@discordjs/formatters/-/formatters-0.2.0.tgz#a861d9c385dfc6c7294e44c5441beee933820a4f" - integrity sha512-vn4oMSXuMZUm8ITqVOtvE7/fMMISj4cI5oLsR09PEQXHKeKDAMLltG/DWeeIs7Idfy6V8Fk3rn1e69h7NfzuNA== +"@discordjs/formatters@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@discordjs/formatters/-/formatters-0.3.3.tgz#b16fdd79bb819680ab7e519193004e9dc124a749" + integrity sha512-wTcI1Q5cps1eSGhl6+6AzzZkBBlVrBdc9IUhJbijRgVjCNIIIZPgqnUj3ntFODsHrdbGU8BEG9XmDQmgEEYn3w== dependencies: - discord-api-types "^0.37.35" + discord-api-types "0.37.61" -"@discordjs/rest@^1.6.0": - version "1.6.0" - resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-1.6.0.tgz#d77c9b5533f6d2079468d4fd497d3fabeb529c20" - integrity sha512-HGvqNCZ5Z5j0tQHjmT1lFvE5ETO4hvomJ1r0cbnpC1zM23XhCpZ9wgTCiEmaxKz05cyf2CI9p39+9LL+6Yz1bA== +"@discordjs/rest@^2.1.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-2.2.0.tgz#f4ec00d3faff965c00a879b7e87bb4b6f4446966" + integrity sha512-nXm9wT8oqrYFRMEqTXQx9DUTeEtXUDMmnUKIhZn6O2EeDY9VCdwj23XCPq7fkqMPKdF7ldAfeVKyxxFdbZl59A== dependencies: - "@discordjs/collection" "^1.4.0" - "@discordjs/util" "^0.2.0" + "@discordjs/collection" "^2.0.0" + "@discordjs/util" "^1.0.2" "@sapphire/async-queue" "^1.5.0" - "@sapphire/snowflake" "^3.4.0" - discord-api-types "^0.37.35" - file-type "^18.2.1" - tslib "^2.5.0" - undici "^5.20.0" + "@sapphire/snowflake" "^3.5.1" + "@vladfrangu/async_event_emitter" "^2.2.2" + discord-api-types "0.37.61" + magic-bytes.js "^1.5.0" + tslib "^2.6.2" + undici "5.27.2" + +"@discordjs/util@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@discordjs/util/-/util-1.0.2.tgz#dc1896d764452b1bd9707eb9aa99ccfbb30bd1c0" + integrity sha512-IRNbimrmfb75GMNEjyznqM1tkI7HrZOf14njX7tCAAUetyZM1Pr8hX/EK2lxBCOgWDRmigbp24fD1hdMfQK5lw== -"@discordjs/util@^0.2.0": - version "0.2.0" - resolved "https://registry.yarnpkg.com/@discordjs/util/-/util-0.2.0.tgz#91b590dae3934ffa5fe34530afc5212c569d6751" - integrity sha512-/8qNbebFzLWKOOg+UV+RB8itp4SmU5jw0tBUD3ifElW6rYNOj1Ku5JaSW7lLl/WgjjxF01l/1uQPCzkwr110vg== +"@discordjs/ws@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@discordjs/ws/-/ws-1.0.2.tgz#3933b12d4686aabf6a95dfe5fb6e744342a661d1" + integrity sha512-+XI82Rm2hKnFwAySXEep4A7Kfoowt6weO6381jgW+wVdTpMS/56qCvoXyFRY0slcv7c/U8My2PwIB2/wEaAh7Q== + dependencies: + "@discordjs/collection" "^2.0.0" + "@discordjs/rest" "^2.1.0" + "@discordjs/util" "^1.0.2" + "@sapphire/async-queue" "^1.5.0" + "@types/ws" "^8.5.9" + "@vladfrangu/async_event_emitter" "^2.2.2" + discord-api-types "0.37.61" + tslib "^2.6.2" + ws "^8.14.2" "@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": version "4.4.0" @@ -108,6 +129,11 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.0.0.tgz#1a9e4b4c96d8c7886e0110ed310a0135144a1691" integrity sha512-RThY/MnKrhubF6+s1JflwUjPEsnCEmYCWwqa/aRISKWNXGZ9epUwft4bUMM35SdKF9xvBrLydAM1RDHd1Z//ZQ== +"@fastify/busboy@^2.0.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" + integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== + "@humanwhocodes/config-array@^0.12.3": version "0.12.3" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.12.3.tgz#a6216d90f81a30bedd1d4b5d799b47241f318072" @@ -153,52 +179,52 @@ resolved "https://registry.yarnpkg.com/@sapphire/async-queue/-/async-queue-1.5.0.tgz#2f255a3f186635c4fb5a2381e375d3dfbc5312d8" integrity sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA== -"@sapphire/shapeshift@^3.8.1": - version "3.8.1" - resolved "https://registry.yarnpkg.com/@sapphire/shapeshift/-/shapeshift-3.8.1.tgz#b98dc6a7180f9b38219267917b2e6fa33f9ec656" - integrity sha512-xG1oXXBhCjPKbxrRTlox9ddaZTvVpOhYLmKmApD/vIWOV1xEYXnpoFs68zHIZBGbqztq6FrUPNPerIrO1Hqeaw== +"@sapphire/shapeshift@^3.9.3": + version "3.9.7" + resolved "https://registry.yarnpkg.com/@sapphire/shapeshift/-/shapeshift-3.9.7.tgz#43e23243cac8a0c046bf1e73baf3dbf407d33a0c" + integrity sha512-4It2mxPSr4OGn4HSQWGmhFMsNFGfFVhWeRPCRwbH972Ek2pzfGRZtb0pJ4Ze6oIzcyh2jw7nUDa6qGlWofgd9g== dependencies: fast-deep-equal "^3.1.3" lodash "^4.17.21" -"@sapphire/snowflake@^3.4.0": - version "3.4.0" - resolved "https://registry.yarnpkg.com/@sapphire/snowflake/-/snowflake-3.4.0.tgz#25c012158a9feea2256c718985dbd6c1859a5022" - integrity sha512-zZxymtVO6zeXVMPds+6d7gv/OfnCc25M1Z+7ZLB0oPmeMTPeRWVPQSS16oDJy5ZsyCOLj7M6mbZml5gWXcVRNw== +"@sapphire/snowflake@3.5.1": + version "3.5.1" + resolved "https://registry.yarnpkg.com/@sapphire/snowflake/-/snowflake-3.5.1.tgz#254521c188b49e8b2d4cc048b475fb2b38737fec" + integrity sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA== + +"@sapphire/snowflake@^3.5.1": + version "3.5.3" + resolved "https://registry.yarnpkg.com/@sapphire/snowflake/-/snowflake-3.5.3.tgz#0c102aa2ec5b34f806e9bc8625fc6a5e1d0a0c6a" + integrity sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ== -"@sendgrid/client@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@sendgrid/client/-/client-7.7.0.tgz#f8f67abd604205a0d0b1af091b61517ef465fdbf" - integrity sha512-SxH+y8jeAQSnDavrTD0uGDXYIIkFylCo+eDofVmZLQ0f862nnqbC3Vd1ej6b7Le7lboyzQF6F7Fodv02rYspuA== +"@sendgrid/client@^8.1.3": + version "8.1.3" + resolved "https://registry.yarnpkg.com/@sendgrid/client/-/client-8.1.3.tgz#51fd4a318627c4b615ff98e35609e98486a3bd6f" + integrity sha512-mRwTticRZIdUTsnyzvlK6dMu3jni9ci9J+dW/6fMMFpGRAJdCJlivFVYQvqk8kRS3RnFzS7sf6BSmhLl1ldDhA== dependencies: - "@sendgrid/helpers" "^7.7.0" - axios "^0.26.0" + "@sendgrid/helpers" "^8.0.0" + axios "^1.6.8" -"@sendgrid/helpers@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@sendgrid/helpers/-/helpers-7.7.0.tgz#93fb4b6e2f0dc65080440d6a784cc93e8e148757" - integrity sha512-3AsAxfN3GDBcXoZ/y1mzAAbKzTtUZ5+ZrHOmWQ279AuaFXUNCh9bPnRpN504bgveTqoW+11IzPg3I0WVgDINpw== +"@sendgrid/helpers@^8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@sendgrid/helpers/-/helpers-8.0.0.tgz#f74bf9743bacafe4c8573be46166130c604c0fc1" + integrity sha512-Ze7WuW2Xzy5GT5WRx+yEv89fsg/pgy3T1E3FS0QEx0/VvRmigMZ5qyVGhJz4SxomegDkzXv/i0aFPpHKN8qdAA== dependencies: deepmerge "^4.2.2" -"@sendgrid/mail@^7.7.0": - version "7.7.0" - resolved "https://registry.yarnpkg.com/@sendgrid/mail/-/mail-7.7.0.tgz#aba09f5ce2e9d8ceee92284c3ea8b4a90b0e38fe" - integrity sha512-5+nApPE9wINBvHSUxwOxkkQqM/IAAaBYoP9hw7WwgDNQPxraruVqHizeTitVtKGiqWCKm2mnjh4XGN3fvFLqaw== +"@sendgrid/mail@^8.1.3": + version "8.1.3" + resolved "https://registry.yarnpkg.com/@sendgrid/mail/-/mail-8.1.3.tgz#d371cbddcd2e8ca9469a68d1ed0c6b3a5c365e5e" + integrity sha512-Wg5iKSUOER83/cfY6rbPa+o3ChnYzWwv1OcsR8gCV8SKi+sUPIMroildimlnb72DBkQxcbylxng1W7f0RIX7MQ== dependencies: - "@sendgrid/client" "^7.7.0" - "@sendgrid/helpers" "^7.7.0" + "@sendgrid/client" "^8.1.3" + "@sendgrid/helpers" "^8.0.0" "@sindresorhus/is@^4.0.1": version "4.6.0" resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== -"@tokenizer/token@^0.3.0": - version "0.3.0" - resolved "https://registry.yarnpkg.com/@tokenizer/token/-/token-0.3.0.tgz#fe98a93fe789247e998c75e74e9c7c63217aa276" - integrity sha512-OvjF+z51L3ov0OyAU0duzsYuvO01PH7x4t6DJx+guahgTnBHkhJdG7soQeTSFLWN3efnHyibZ4Z8l2EuWwJN3A== - "@types/json-schema@^7.0.15": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" @@ -235,6 +261,13 @@ dependencies: "@types/node" "*" +"@types/ws@8.5.9": + version "8.5.9" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.9.tgz#384c489f99c83225a53f01ebc3eddf3b8e202a8c" + integrity sha512-jbdrY0a8lxfdTp/+r7Z4CkycbOFN8WX+IOchLJr3juT/xzbJ8URyTVSJ/hvNdadTgM1mnedb47n+Y31GsFnQlg== + dependencies: + "@types/node" "*" + "@types/ws@^7.4.7": version "7.4.7" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" @@ -242,10 +275,10 @@ dependencies: "@types/node" "*" -"@types/ws@^8.5.4": - version "8.5.4" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.4.tgz#bb10e36116d6e570dd943735f86c933c1587b8a5" - integrity sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg== +"@types/ws@^8.5.9": + version "8.5.10" + resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.10.tgz#4acfb517970853fa6574a3a6886791d04a396787" + integrity sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A== dependencies: "@types/node" "*" @@ -335,6 +368,11 @@ "@typescript-eslint/types" "7.6.0" eslint-visitor-keys "^3.4.3" +"@vladfrangu/async_event_emitter@^2.2.2": + version "2.2.4" + resolved "https://registry.yarnpkg.com/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.4.tgz#d3537432c6db6444680a596271dff8ea407343b3" + integrity sha512-ButUPz9E9cXMLgvAW8aLAKKJJsPu1dY1/l/E8xzLFuysowXygs6GBcyunK9rnGC4zTsnIc2mQo71rGw9U+Ykug== + acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -392,12 +430,14 @@ atomically@^1.7.0: resolved "https://registry.yarnpkg.com/atomically/-/atomically-1.7.0.tgz#c07a0458432ea6dbc9a3506fffa424b48bccaafe" integrity sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w== -axios@^0.26.0: - version "0.26.1" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9" - integrity sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA== +axios@^1.6.8: + version "1.6.8" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" + integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== dependencies: - follow-redirects "^1.14.8" + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" balanced-match@^1.0.0: version "1.0.2" @@ -426,13 +466,6 @@ braces@^3.0.2: dependencies: fill-range "^7.0.1" -busboy@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" - integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== - dependencies: - streamsearch "^1.1.0" - callsites@^3.0.0, callsites@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -492,9 +525,9 @@ deep-is@^0.1.3: integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== deepmerge@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" - integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + version "4.3.1" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" + integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== delayed-stream@~1.0.0: version "1.0.0" @@ -508,16 +541,16 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" +discord-api-types@0.37.61: + version "0.37.61" + resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.61.tgz#9dd8e58c624237e6f1b23be2d29579af268b8c5b" + integrity sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw== + discord-api-types@^0.22.0: version "0.22.0" resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.22.0.tgz#34dc57fe8e016e5eaac5e393646cd42a7e1ccc2a" integrity sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg== -discord-api-types@^0.37.35: - version "0.37.36" - resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.36.tgz#650a8f66dce2c5e54a8c2275db74a0bb7936430d" - integrity sha512-Nlxmp10UpVr/utgZ9uODQvG2Or+5w7LFrvFMswyeKC9l/+UaqGT6H0OVgEFhu9GEO4U6K7NNO5W8Carv7irnCA== - discord-sync-commands@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/discord-sync-commands/-/discord-sync-commands-0.3.0.tgz#471d711a7c6cbcccb7ab29e29bb53d68d02d0dfa" @@ -525,24 +558,25 @@ discord-sync-commands@^0.3.0: dependencies: discord.js discordjs/discord.js#refs/pull/6414/head -discord.js@14.x: - version "14.8.0" - resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.8.0.tgz#0e5def8a95a22018844cdfc0f63b9806392da79b" - integrity sha512-UOxYtc/YnV7jAJ2gISluJyYeBw4e+j8gWn+IoqG8unaHAVuvZ13DdYN0M1f9fbUgUvSarV798inIrYFtDNDjwQ== - dependencies: - "@discordjs/builders" "^1.5.0" - "@discordjs/collection" "^1.4.0" - "@discordjs/formatters" "^0.2.0" - "@discordjs/rest" "^1.6.0" - "@discordjs/util" "^0.2.0" - "@sapphire/snowflake" "^3.4.0" - "@types/ws" "^8.5.4" - discord-api-types "^0.37.35" - fast-deep-equal "^3.1.3" - lodash.snakecase "^4.1.1" - tslib "^2.5.0" - undici "^5.20.0" - ws "^8.12.1" +discord.js@^14.14.1: + version "14.14.1" + resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.14.1.tgz#9a2bea23bba13819705ab87612837610abce9ee3" + integrity sha512-/hUVzkIerxKHyRKopJy5xejp4MYKDPTszAnpYxzVVv4qJYf+Tkt+jnT2N29PIPschicaEEpXwF2ARrTYHYwQ5w== + dependencies: + "@discordjs/builders" "^1.7.0" + "@discordjs/collection" "1.5.3" + "@discordjs/formatters" "^0.3.3" + "@discordjs/rest" "^2.1.0" + "@discordjs/util" "^1.0.2" + "@discordjs/ws" "^1.0.2" + "@sapphire/snowflake" "3.5.1" + "@types/ws" "8.5.9" + discord-api-types "0.37.61" + fast-deep-equal "3.1.3" + lodash.snakecase "4.1.1" + tslib "2.6.2" + undici "5.27.2" + ws "8.14.2" discord.js@discordjs/discord.js#refs/pull/6414/head: version "13.2.0-dev" @@ -660,7 +694,7 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: +fast-deep-equal@3.1.3, fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== @@ -700,15 +734,6 @@ file-entry-cache@^8.0.0: dependencies: flat-cache "^4.0.0" -file-type@^18.2.1: - version "18.2.1" - resolved "https://registry.yarnpkg.com/file-type/-/file-type-18.2.1.tgz#6d8f1fa3b079606f6ecf89483346f55fcd2c671b" - integrity sha512-Yw5MtnMv7vgD2/6Bjmmuegc8bQEVA9GmAyaR18bMYWKqsWDG9wgYZ1j4I6gNMF5Y5JBDcUcjRQqNQx7Y8uotcg== - dependencies: - readable-web-to-node-stream "^3.0.2" - strtok3 "^7.0.0" - token-types "^5.0.1" - fill-range@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" @@ -737,10 +762,19 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== -follow-redirects@^1.14.8: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== +follow-redirects@^1.15.6: + version "1.15.6" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" glob-parent@^5.1.2: version "5.1.2" @@ -783,11 +817,6 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -ieee754@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" - integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== - ignore@^5.2.0, ignore@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" @@ -806,11 +835,6 @@ imurmurhash@^0.1.4: resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== -inherits@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - is-extglob@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" @@ -902,7 +926,7 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.snakecase@^4.1.1: +lodash.snakecase@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" integrity sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw== @@ -924,6 +948,11 @@ lunr@^2.3.9: resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== +magic-bytes.js@^1.5.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/magic-bytes.js/-/magic-bytes.js-1.10.0.tgz#c41cf4bc2f802992b05e64962411c9dd44fdef92" + integrity sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ== + marked@^4.3.0: version "4.3.0" resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" @@ -1060,11 +1089,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -peek-readable@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/peek-readable/-/peek-readable-5.0.0.tgz#7ead2aff25dc40458c60347ea76cfdfd63efdfec" - integrity sha512-YtCKvLUOvwtMGmrniQPdO7MwPjgkFBtFIrmfSbYmYuq3tKDV/mcfAhBth1+C3ru7uXIZasc/pHnb+YDYNkkj4A== - picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -1075,6 +1099,11 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + punycode@^2.1.0: version "2.3.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" @@ -1085,22 +1114,6 @@ queue-microtask@^1.2.2: resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== -readable-stream@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" - integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== - dependencies: - inherits "^2.0.3" - string_decoder "^1.1.1" - util-deprecate "^1.0.1" - -readable-web-to-node-stream@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/readable-web-to-node-stream/-/readable-web-to-node-stream-3.0.2.tgz#5d52bb5df7b54861fd48d015e93a2cb87b3ee0bb" - integrity sha512-ePeK6cc1EcKLEhJFt/AebMCLL+GgSKhuygrZ/GLaKZYEecIgIECf4UaUuaByiGtzckwR4ain9VzUh95T1exYGw== - dependencies: - readable-stream "^3.6.0" - resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -1123,11 +1136,6 @@ rwlock@^5.0.0: resolved "https://registry.yarnpkg.com/rwlock/-/rwlock-5.0.0.tgz#888d6a77a3351cc1a209204ef2ee1722093836cf" integrity sha512-XgzRqLMfCcm9QfZuPav9cV3Xin5TRcIlp4X/SH3CvB+x5D2AakdlEepfJKDd8ByncvfpcxNWdRZVUl38PS6ZJg== -safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - semver@^7.6.0: version "7.6.0" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" @@ -1162,18 +1170,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -streamsearch@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" - integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== - -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -1186,14 +1182,6 @@ strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -strtok3@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/strtok3/-/strtok3-7.0.0.tgz#868c428b4ade64a8fd8fee7364256001c1a4cbe5" - integrity sha512-pQ+V+nYQdC5H3Q7qBZAz/MO6lwGhoC2gOAjuouGf/VO0m7vQRh8QNMl2Uf6SwAtzZ9bOw3UIeBukEGNJl5dtXQ== - dependencies: - "@tokenizer/token" "^0.3.0" - peek-readable "^5.0.0" - supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -1213,14 +1201,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -token-types@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/token-types/-/token-types-5.0.1.tgz#aa9d9e6b23c420a675e55413b180635b86a093b4" - integrity sha512-Y2fmSnZjQdDb9W4w4r1tswlMHylzWIeOKpx0aZH9BgGtACHhrk3OkT52AzwcuqTRBZtvvnTjDBh8eynMulu8Vg== - dependencies: - "@tokenizer/token" "^0.3.0" - ieee754 "^1.2.1" - tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" @@ -1241,16 +1221,16 @@ ts-mixer@^6.0.3: resolved "https://registry.yarnpkg.com/ts-mixer/-/ts-mixer-6.0.3.tgz#69bd50f406ff39daa369885b16c77a6194c7cae6" integrity sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ== +tslib@2.6.2, tslib@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + tslib@^2.3.0: version "2.4.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== -tslib@^2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" - integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== - type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" @@ -1292,12 +1272,12 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -undici@^5.20.0: - version "5.21.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.21.0.tgz#b00dfc381f202565ab7f52023222ab862bb2494f" - integrity sha512-HOjK8l6a57b2ZGXOcUsI5NLfoTrfmbOl90ixJDl0AEFG4wgHNDQxtZy15/ZQp7HhjkpaGlp/eneMgtsu1dIlUA== +undici@5.27.2: + version "5.27.2" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.27.2.tgz#a270c563aea5b46cc0df2550523638c95c5d4411" + integrity sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ== dependencies: - busboy "^1.6.0" + "@fastify/busboy" "^2.0.0" uri-js@^4.2.2: version "4.4.1" @@ -1306,11 +1286,6 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" -util-deprecate@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - vali-date@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/vali-date/-/vali-date-1.0.0.tgz#1b904a59609fb328ef078138420934f6b86709a6" @@ -1346,15 +1321,20 @@ which@^2.0.1: dependencies: isexe "^2.0.0" +ws@8.14.2: + version "8.14.2" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" + integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g== + ws@^7.5.1: version "7.5.9" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== -ws@^8.12.1: - version "8.13.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0" - integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA== +ws@^8.14.2: + version "8.16.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4" + integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ== yallist@^4.0.0: version "4.0.0" From 89807e46651572d8daa9182dc9296ecb8e4303a0 Mon Sep 17 00:00:00 2001 From: HunteRoi Date: Wed, 10 Apr 2024 18:33:51 +0200 Subject: [PATCH 2/4] chore: use biomejs instead of eslint --- .vscode/settings.json | 8 + biome.json | 24 + .../api-docs/classes/VerificationManager.html | 10 +- docs/api-docs/enums/UserStatus.html | 6 +- .../enums/VerificationManagerEvents.html | 4 +- docs/api-docs/interfaces/ISenderAPI.html | 4 +- docs/api-docs/interfaces/IStoringSystem.html | 8 +- docs/api-docs/interfaces/IUser.html | 20 +- docs/api-docs/interfaces/SenderAPIData.html | 6 +- .../interfaces/VerificationOptions.html | 18 +- eslint.config.js | 16 - package.json | 8 +- src/VerificationManager.ts | 425 ++++----- src/VerificationManagerEvents.ts | 12 +- src/index.ts | 6 +- src/services/CodeGeneratorService.ts | 59 +- src/services/JSONDatabaseService.ts | 149 +-- src/services/SendGridService.ts | 100 +- src/types/IUser.ts | 134 +-- src/types/SenderAPI.ts | 42 +- src/types/StoringSystem.ts | 62 +- src/types/UserStatus.ts | 16 +- src/types/VerificationOptions.ts | 155 ++-- src/types/index.ts | 12 +- yarn.lock | 857 ++---------------- 25 files changed, 737 insertions(+), 1424 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 biome.json delete mode 100644 eslint.config.js diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..cd6fc20 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "editor.codeActionsOnSave": { + "quickfix.biome": "explicit", + "source.organizeImports.biome": "explicit" + }, + "editor.defaultFormatter": "biomejs.biome", + "editor.formatOnSave": true +} \ No newline at end of file diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..a58e954 --- /dev/null +++ b/biome.json @@ -0,0 +1,24 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.6.4/schema.json", + "organizeImports": { + "enabled": true + }, + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true, + "defaultBranch": "master" + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 4, + "lineEnding": "lf" + } +} diff --git a/docs/api-docs/classes/VerificationManager.html b/docs/api-docs/classes/VerificationManager.html index 7ce207a..9289d86 100644 --- a/docs/api-docs/classes/VerificationManager.html +++ b/docs/api-docs/classes/VerificationManager.html @@ -1,6 +1,6 @@ VerificationManager | @hunteroi/discord-verification

The manager handling verification (generating, sending and verifying the user's code).

Export

VerificationManager

-

Type Parameters

Hierarchy

  • EventEmitter
    • VerificationManager

Constructors

Type Parameters

Hierarchy

  • EventEmitter
    • VerificationManager

Constructors

Properties

Methods

sendCode verifyCode @@ -13,14 +13,14 @@ invalidCodeMessage: (user: TUser, invalidCode: string) => Your code ${invalidCode} is invalid! }]

Returns VerificationManager<TUser>

Memberof

VerificationManager

-

Properties

client: Client<boolean>

The Discord client instance.

+

Properties

client: Client<boolean>

The Discord client instance.

Memberof

VerificationManager

-

Methods

  • Sends the code via the communication service to the user based on the provided data. +

Methods

  • Sends the code via the communication service to the user based on the provided data. Saves the user, their code and their data into the database.

    Parameters

    • userid: string
    • data: any

    Returns Promise<string>

    the result of the operation as a string, based on the result of the call to one of the manager's options' methods.

    Memberof

    VerificationManager

    -
  • Verifies the provided code for the provided user. Increments the number of tries of that specific users.

    Parameters

    • userid: string
    • code: string

    Returns Promise<string>

    the result of the operation as a string, based on the result of the call to one of the manager's options' methods.

    Memberof

    VerificationManager

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/api-docs/enums/UserStatus.html b/docs/api-docs/enums/UserStatus.html index 5e282bb..8a84e7b 100644 --- a/docs/api-docs/enums/UserStatus.html +++ b/docs/api-docs/enums/UserStatus.html @@ -1,6 +1,6 @@ UserStatus | @hunteroi/discord-verification

The different user statuses (either pending or active).

-

Export

Enumeration Members

Export

Enumeration Members

Enumeration Members

active: 1

The user is verified and active.

-
pending: 0

The user verification is pending.

-
\ No newline at end of file +
pending: 0

The user verification is pending.

+
\ No newline at end of file diff --git a/docs/api-docs/enums/VerificationManagerEvents.html b/docs/api-docs/enums/VerificationManagerEvents.html index cdb7354..ea4b368 100644 --- a/docs/api-docs/enums/VerificationManagerEvents.html +++ b/docs/api-docs/enums/VerificationManagerEvents.html @@ -1,8 +1,8 @@ VerificationManagerEvents | @hunteroi/discord-verification

Enumeration VerificationManagerEvents

The events emitted by the VerificationManager on specific actions.

-

Export

Enumeration Members

Export

Enumeration Members

codeCreate: "codeCreate"
codeVerify: "codeVerify"
error: "error"
userActive: "userActive"
userAwait: "userAwait"
userCreate: "userCreate"
\ No newline at end of file +

Enumeration Members

codeCreate: "codeCreate"
codeVerify: "codeVerify"
error: "error"
userActive: "userActive"
userAwait: "userAwait"
userCreate: "userCreate"
\ No newline at end of file diff --git a/docs/api-docs/interfaces/ISenderAPI.html b/docs/api-docs/interfaces/ISenderAPI.html index 1e391cc..486fb69 100644 --- a/docs/api-docs/interfaces/ISenderAPI.html +++ b/docs/api-docs/interfaces/ISenderAPI.html @@ -1,6 +1,6 @@ ISenderAPI | @hunteroi/discord-verification

The contract of a sender service.

Export

ISenderAPI

-
interface ISenderAPI {
    send(data): Promise<void>;
}

Methods

interface ISenderAPI {
    send(data): Promise<void>;
}

Methods

Methods

\ No newline at end of file +
\ No newline at end of file diff --git a/docs/api-docs/interfaces/IStoringSystem.html b/docs/api-docs/interfaces/IStoringSystem.html index 963fbb3..f49b0e9 100644 --- a/docs/api-docs/interfaces/IStoringSystem.html +++ b/docs/api-docs/interfaces/IStoringSystem.html @@ -1,14 +1,14 @@ IStoringSystem | @hunteroi/discord-verification

Interface IStoringSystem<TUser>

The contract of a storing service.

Export

IStoringSystem

-
interface IStoringSystem<TUser> {
    read(userid): Promise<undefined | null | TUser>;
    readBy(filters): Promise<undefined | null | TUser>;
    readBy(callback): Promise<undefined | null | TUser>;
    readBy(argument): Promise<undefined | null | TUser>;
    write(user): Promise<void>;
}

Type Parameters

Methods

interface IStoringSystem<TUser> {
    read(userid): Promise<undefined | null | TUser>;
    readBy(filters): Promise<undefined | null | TUser>;
    readBy(callback): Promise<undefined | null | TUser>;
    readBy(argument): Promise<undefined | null | TUser>;
    write(user): Promise<void>;
}

Type Parameters

Methods

Methods

  • Reads the storing system to get the user based on its unique identifier.

    Parameters

    • userid: string

    Returns Promise<undefined | null | TUser>

    the user or nothing

    Memberof

    IStoringSystem

    -
  • Reads the storing system to get the user based on filters.

    Parameters

    • filters: Map<string, any>

    Returns Promise<undefined | null | TUser>

    the user or nothing

    Memberof

    IStoringSystem

    -
  • Parameters

    • callback: ((user, index) => boolean)
        • (user, index): boolean
        • Parameters

          • user: TUser
          • index: string | number

          Returns boolean

    Returns Promise<undefined | null | TUser>

  • Parameters

    • argument: Map<string, any> | ((user, index) => boolean)

    Returns Promise<undefined | null | TUser>

  • Writes a user into the storing system.

    +
  • Parameters

    • callback: ((user, index) => boolean)
        • (user, index): boolean
        • Parameters

          • user: TUser
          • index: string | number

          Returns boolean

    Returns Promise<undefined | null | TUser>

  • Parameters

    • argument: Map<string, any> | ((user, index) => boolean)

    Returns Promise<undefined | null | TUser>

  • Writes a user into the storing system.

    Parameters

    Returns Promise<void>

    Memberof

    IStoringSystem

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/api-docs/interfaces/IUser.html b/docs/api-docs/interfaces/IUser.html index 7e2225b..b85a6a9 100644 --- a/docs/api-docs/interfaces/IUser.html +++ b/docs/api-docs/interfaces/IUser.html @@ -1,6 +1,6 @@ IUser | @hunteroi/discord-verification

Represents a user.

Export

IUser

-
interface IUser {
    activatedCode?: null | string;
    activationTimestamp?: number;
    code: null | string;
    data: any;
    nbCodeCalled: number;
    nbVerifyCalled: number;
    status: UserStatus;
    userid: string;
    username: string;
}

Properties

interface IUser {
    activatedCode?: null | string;
    activationTimestamp?: number;
    code: null | string;
    data: any;
    nbCodeCalled: number;
    nbVerifyCalled: number;
    status: UserStatus;
    userid: string;
    username: string;
}

Properties

Properties

activatedCode?: null | string

The used code that verified the user.

Memberof

IUser

-
activationTimestamp?: number

The timestamp marking the activation of the user.

+
activationTimestamp?: number

The timestamp marking the activation of the user.

Memberof

IUser

-
code: null | string

The generated code to verify that user.

+
code: null | string

The generated code to verify that user.

Memberof

IUser

-
data: any

The data used to send the code. Could be an email, a phone number or any +

data: any

The data used to send the code. Could be an email, a phone number or any complex information. Type should match what is expected from the sender API.

Memberof

IUser

-
nbCodeCalled: number

The number of times the generation of a code for that user is initiated.

+
nbCodeCalled: number

The number of times the generation of a code for that user is initiated.

Memberof

IUser

-
nbVerifyCalled: number

The number of times the verification of a code for that user is initiated.

+
nbVerifyCalled: number

The number of times the verification of a code for that user is initiated.

Memberof

IUser

-
status: UserStatus

The status of the user.

+
status: UserStatus

The status of the user.

Memberof

IUser

-
userid: string

The user Discord ID.

+
userid: string

The user Discord ID.

Memberof

IUser

-
username: string

The user name.

+
username: string

The user name.

Memberof

IUser

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/api-docs/interfaces/SenderAPIData.html b/docs/api-docs/interfaces/SenderAPIData.html index 85f3ec3..255062c 100644 --- a/docs/api-docs/interfaces/SenderAPIData.html +++ b/docs/api-docs/interfaces/SenderAPIData.html @@ -1,5 +1,5 @@ -SenderAPIData | @hunteroi/discord-verification
interface SenderAPIData {
    code: string;
    name: string;
    [prop: string]: any;
}

Indexable

[prop: string]: any

Properties

code +SenderAPIData | @hunteroi/discord-verification
interface SenderAPIData {
    code: string;
    name: string;
    [prop: string]: any;
}

Indexable

[prop: string]: any

Properties

Properties

code: string

The code to send.

-
name: string

The user name for message customization.

-
\ No newline at end of file +
name: string

The user name for message customization.

+
\ No newline at end of file diff --git a/docs/api-docs/interfaces/VerificationOptions.html b/docs/api-docs/interfaces/VerificationOptions.html index 618d4a8..ee377e5 100644 --- a/docs/api-docs/interfaces/VerificationOptions.html +++ b/docs/api-docs/interfaces/VerificationOptions.html @@ -1,6 +1,6 @@ VerificationOptions | @hunteroi/discord-verification

Interface VerificationOptions<TUser>

The VerificationManager options.

Export

VerificationOptions

-
interface VerificationOptions<TUser> {
    codeGenerationOptions: {
        charactersWhitelist?: string;
        length: number;
    };
    maxNbCodeCalledBeforeResend: number;
    alreadyActiveMessage(user): string;
    alreadyPendingMessage(user): string;
    errorMessage(user, error): string;
    invalidCodeMessage(user, invalidCode): string;
    pendingMessage(user): string;
    validCodeMessage(user, validCode): string;
}

Type Parameters

Properties

interface VerificationOptions<TUser> {
    codeGenerationOptions: {
        charactersWhitelist?: string;
        length: number;
    };
    maxNbCodeCalledBeforeResend: number;
    alreadyActiveMessage(user): string;
    alreadyPendingMessage(user): string;
    errorMessage(user, error): string;
    invalidCodeMessage(user, invalidCode): string;
    pendingMessage(user): string;
    validCodeMessage(user, validCode): string;
}

Type Parameters

Properties

Methods

Type declaration

  • Optional charactersWhitelist?: string

    The whitelist of characters used to generate the code.

  • length: number

    The required length of the code.

Memberof

VerificationOptions

-
maxNbCodeCalledBeforeResend: number

The maximum number of calls before resending the code to the user via the communication service.

+
maxNbCodeCalledBeforeResend: number

The maximum number of calls before resending the code to the user via the communication service.

Memberof

VerificationOptions

-

Methods

  • Formats the message sent once the user tries to generate a code when they are already verified.

    +

Methods

  • Formats the message sent once the user tries to generate a code when they are already verified.

    Parameters

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent once the user tries to generate a code when it's already sent to them.

    +
  • Formats the message sent once the user tries to generate a code when it's already sent to them.

    Parameters

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent when calling the communication service throws an error.

    +
  • Formats the message sent when calling the communication service throws an error.

    Parameters

    • user: TUser
    • error: unknown

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent once the code is checked and invalid.

    Parameters

    • user: undefined | null | TUser
    • invalidCode: string

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent for the first time when the user's code has just been sent.

    +
  • Formats the message sent for the first time when the user's code has just been sent.

    Parameters

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent once the code is checked and valid.

    Parameters

    • user: undefined | null | TUser
    • validCode: string

    Returns string

    the message

    Memberof

    VerificationOptions

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js deleted file mode 100644 index 354081b..0000000 --- a/eslint.config.js +++ /dev/null @@ -1,16 +0,0 @@ -// @ts-check - -import eslint from '@eslint/js'; -import tseslint from 'typescript-eslint'; - -export default tseslint.config( - eslint.configs.recommended, - ...tseslint.configs.recommended, - ...tseslint.configs.stylistic, - { - rules: { - "@typescript-eslint/no-unused-vars": "warn", - "@typescript-eslint/no-explicit-any": "warn", - } - } -); \ No newline at end of file diff --git a/package.json b/package.json index ac84328..7a5440c 100644 --- a/package.json +++ b/package.json @@ -5,18 +5,16 @@ }, "description": "A framework to integrate a verification system with your Discord guild built with DiscordJS", "devDependencies": { - "@eslint/js": "^9.0.0", + "@biomejs/biome": "1.6.4", "@sendgrid/mail": "^8.1.3", "@types/node": "^20.12.7", "@types/node-json-db": "^0.9.3", "@types/sqlite3": "^3.1.11", "discord-sync-commands": "^0.3.0", "discord.js": "^14.14.1", - "eslint": "^9.0.0", "node-json-db": "^2.3.0", "typedoc": "^0.25.13", - "typescript": "^5.4.4", - "typescript-eslint": "^7.6.0" + "typescript": "^5.4.4" }, "directories": { "lib": "lib" @@ -45,7 +43,7 @@ "scripts": { "build": "tsc", "build:docs": "typedoc", - "lint": "eslint ./src", + "lint": "biome check --apply ./src", "prepublish": "yarn lint && yarn build && yarn build:docs", "start": "yarn build & node ./examples/index.js" }, diff --git a/src/VerificationManager.ts b/src/VerificationManager.ts index 4e618f2..5b2d9fc 100644 --- a/src/VerificationManager.ts +++ b/src/VerificationManager.ts @@ -1,15 +1,15 @@ -import { Client, Snowflake } from 'discord.js'; -import EventEmitter from 'events'; +import EventEmitter from "node:events"; +import type { Client, Snowflake } from "discord.js"; -import { CodeGeneratorService } from './services/CodeGeneratorService'; +import { VerificationManagerEvents } from "./VerificationManagerEvents"; +import { CodeGeneratorService } from "./services/CodeGeneratorService"; import { - VerificationOptions, - ISenderAPI, - IStoringSystem, - IUser, - UserStatus, -} from './types'; -import { VerificationManagerEvents } from './VerificationManagerEvents'; + type ISenderAPI, + type IStoringSystem, + type IUser, + UserStatus, + type VerificationOptions, +} from "./types"; /** * The manager handling verification (generating, sending and verifying the user's code). @@ -20,221 +20,242 @@ import { VerificationManagerEvents } from './VerificationManagerEvents'; * @template TUser */ export class VerificationManager extends EventEmitter { - readonly #options: VerificationOptions; - readonly #storingSystem: IStoringSystem; - readonly #senderAPI: ISenderAPI; - readonly #codeGenerator: CodeGeneratorService; + readonly #options: VerificationOptions; + readonly #storingSystem: IStoringSystem; + readonly #senderAPI: ISenderAPI; + readonly #codeGenerator: CodeGeneratorService; - /** - * The Discord client instance. - * - * @type {Client} - * @memberof VerificationManager - */ - public readonly client: Client; + /** + * The Discord client instance. + * + * @type {Client} + * @memberof VerificationManager + */ + public readonly client: Client; - /** - * Creates an instance of VerificationManager. - * @param {Client} client - * @param {IStoringSystem} storingSystem - * @param {ISenderAPI} senderAPI - * @param {VerificationOptions} [options={ - * codeGenerationOptions: { - * length: 6 - * }, - * maxNbCodeCalledBeforeResend: 3, - * errorMessage: (user: TUser, error: unknown) => `An error occured when trying to send something to ${user?.username}!` - * pendingMessage: (user: TUser) => `The verification code has just been sent to ${user.data}.`, - * alreadyPendingMessage: (user: TUser) => `You already have a verification code pending! It was sent to ${user.data}.`, - * alreadyActiveMessage: (user: TUser) => `You are already verified with the email ${user.data}!`, - * validCodeMessage: (user: TUser, validCode: string) => `Your code ${validCode} is valid! Welcome ${user.username}!`, - * invalidCodeMessage: (user: TUser, invalidCode: string) => `Your code ${invalidCode} is invalid!` - * }] - * @memberof VerificationManager - */ - constructor( - client: Client, - storingSystem: IStoringSystem, - senderAPI: ISenderAPI, - options: VerificationOptions = { - codeGenerationOptions: { - length: 6, - }, - maxNbCodeCalledBeforeResend: 3, - errorMessage: (user: TUser) => - `An error occured when trying to send something to ${user?.username}!`, - pendingMessage: (user: TUser) => - `The verification code has just been sent to ${user.data}.`, - alreadyPendingMessage: (user: TUser) => - `You already have a verification code pending! It was sent to ${user.data}.`, - alreadyActiveMessage: (user: TUser) => - `You are already verified with the email ${user.data}!`, - validCodeMessage: (user: TUser, validCode: string) => - `Your code ${validCode} is valid! Welcome ${user.username}!`, - invalidCodeMessage: (_, invalidCode: string) => - `Your code ${invalidCode} is invalid!`, - } - ) { - super(); + /** + * Creates an instance of VerificationManager. + * @param {Client} client + * @param {IStoringSystem} storingSystem + * @param {ISenderAPI} senderAPI + * @param {VerificationOptions} [options={ + * codeGenerationOptions: { + * length: 6 + * }, + * maxNbCodeCalledBeforeResend: 3, + * errorMessage: (user: TUser, error: unknown) => `An error occured when trying to send something to ${user?.username}!` + * pendingMessage: (user: TUser) => `The verification code has just been sent to ${user.data}.`, + * alreadyPendingMessage: (user: TUser) => `You already have a verification code pending! It was sent to ${user.data}.`, + * alreadyActiveMessage: (user: TUser) => `You are already verified with the email ${user.data}!`, + * validCodeMessage: (user: TUser, validCode: string) => `Your code ${validCode} is valid! Welcome ${user.username}!`, + * invalidCodeMessage: (user: TUser, invalidCode: string) => `Your code ${invalidCode} is invalid!` + * }] + * @memberof VerificationManager + */ + constructor( + client: Client, + storingSystem: IStoringSystem, + senderAPI: ISenderAPI, + options: VerificationOptions = { + codeGenerationOptions: { + length: 6, + }, + maxNbCodeCalledBeforeResend: 3, + errorMessage: (user: TUser) => + `An error occured when trying to send something to ${user?.username}!`, + pendingMessage: (user: TUser) => + `The verification code has just been sent to ${user.data}.`, + alreadyPendingMessage: (user: TUser) => + `You already have a verification code pending! It was sent to ${user.data}.`, + alreadyActiveMessage: (user: TUser) => + `You are already verified with the email ${user.data}!`, + validCodeMessage: (user: TUser, validCode: string) => + `Your code ${validCode} is valid! Welcome ${user.username}!`, + invalidCodeMessage: (_, invalidCode: string) => + `Your code ${invalidCode} is invalid!`, + }, + ) { + super(); - if (!client) throw 'Client is required'; - if (!storingSystem) throw 'StoringSystem is required'; - if (!senderAPI) throw 'SenderAPI is required'; - this.#validateOptions(options); + if (!client) throw "Client is required"; + if (!storingSystem) throw "StoringSystem is required"; + if (!senderAPI) throw "SenderAPI is required"; + this.#validateOptions(options); - this.client = client; - this.#options = options; - this.#storingSystem = storingSystem; - this.#senderAPI = senderAPI; - this.#codeGenerator = new CodeGeneratorService( - this.#options.codeGenerationOptions.charactersWhitelist - ); - } + this.client = client; + this.#options = options; + this.#storingSystem = storingSystem; + this.#senderAPI = senderAPI; + this.#codeGenerator = new CodeGeneratorService( + this.#options.codeGenerationOptions.charactersWhitelist, + ); + } - #validateOptions(options: VerificationOptions) { - if (!options) throw "'options' is required"; + #validateOptions(options: VerificationOptions) { + if (!options) throw "'options' is required"; - if (!options.codeGenerationOptions || !options.codeGenerationOptions.length) { - options.codeGenerationOptions = { ...(options.codeGenerationOptions ?? {}), length: 6 }; - } - if (!options.maxNbCodeCalledBeforeResend) { - options.maxNbCodeCalledBeforeResend = 3; - } - if (!options.errorMessage) { - options.errorMessage = (user: TUser) => `An error occured when trying to send something to ${user?.username}!`; - } - if (!options.pendingMessage) { - options.pendingMessage = (user: TUser) => `The verification code has just been sent to ${user.data}.`; - } - if (!options.alreadyPendingMessage) { - options.alreadyPendingMessage = (user: TUser) => `You already have a verification code pending! It was sent to ${user.data}.`; - } - if (!options.alreadyActiveMessage) { - options.alreadyActiveMessage = () => `An account is already verified with this data!`; - } - if (!options.validCodeMessage) { - options.validCodeMessage = (user: TUser, validCode: string) => `Your code ${validCode} is valid! Welcome ${user.username}!`; - } - if (!options.invalidCodeMessage) { - options.invalidCodeMessage = (_, invalidCode: string) => `Your code ${invalidCode} is invalid!`; + if ( + !options.codeGenerationOptions || + !options.codeGenerationOptions.length + ) { + options.codeGenerationOptions = { + ...(options.codeGenerationOptions ?? {}), + length: 6, + }; + } + if (!options.maxNbCodeCalledBeforeResend) { + options.maxNbCodeCalledBeforeResend = 3; + } + if (!options.errorMessage) { + options.errorMessage = (user: TUser) => + `An error occured when trying to send something to ${user?.username}!`; + } + if (!options.pendingMessage) { + options.pendingMessage = (user: TUser) => + `The verification code has just been sent to ${user.data}.`; + } + if (!options.alreadyPendingMessage) { + options.alreadyPendingMessage = (user: TUser) => + `You already have a verification code pending! It was sent to ${user.data}.`; + } + if (!options.alreadyActiveMessage) { + options.alreadyActiveMessage = () => + "An account is already verified with this data!"; + } + if (!options.validCodeMessage) { + options.validCodeMessage = (user: TUser, validCode: string) => + `Your code ${validCode} is valid! Welcome ${user.username}!`; + } + if (!options.invalidCodeMessage) { + options.invalidCodeMessage = (_, invalidCode: string) => + `Your code ${invalidCode} is invalid!`; + } } - } - /** - * Sends the code via the communication service to the user based on the provided data. - * Saves the user, their code and their data into the database. - * - * @param {Snowflake} userid - * @param {*} data - * @return {Promise} the result of the operation as a string, based on the result of the call to one of the manager's options' methods. - * @memberof VerificationManager - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - public async sendCode(userid: Snowflake, data: any): Promise { - let user: TUser | undefined | null = await this.#storingSystem.read(userid); - if (!user) user = await this.#storingSystem.readBy(new Map([['data', data]])); + /** + * Sends the code via the communication service to the user based on the provided data. + * Saves the user, their code and their data into the database. + * + * @param {Snowflake} userid + * @param {*} data + * @return {Promise} the result of the operation as a string, based on the result of the call to one of the manager's options' methods. + * @memberof VerificationManager + */ + // biome-ignore lint: data could be anything + public async sendCode(userid: Snowflake, data: any): Promise { + let user: TUser | undefined | null = + await this.#storingSystem.read(userid); + if (!user) + user = await this.#storingSystem.readBy(new Map([["data", data]])); - if (!user) { - const discordUser = await this.client.users.fetch(userid); - const code = this.#codeGenerator.generateCode( - this.#options.codeGenerationOptions.length - ); - this.emit(VerificationManagerEvents.codeCreate, code); + if (!user) { + const discordUser = await this.client.users.fetch(userid); + const code = this.#codeGenerator.generateCode( + this.#options.codeGenerationOptions.length, + ); + this.emit(VerificationManagerEvents.codeCreate, code); - user = { - userid, - username: discordUser.username, - data, - status: UserStatus.pending, - code, - nbCodeCalled: 1, - nbVerifyCalled: 0, - } as TUser; + user = { + userid, + username: discordUser.username, + data, + status: UserStatus.pending, + code, + nbCodeCalled: 1, + nbVerifyCalled: 0, + } as TUser; - try { - await this.#senderAPI.send({ - ...data, - name: user.username, - code - }); + try { + await this.#senderAPI.send({ + ...data, + name: user.username, + code, + }); - await this.#storingSystem.write(user); - this.emit(VerificationManagerEvents.userCreate, user); + await this.#storingSystem.write(user); + this.emit(VerificationManagerEvents.userCreate, user); - this.emit(VerificationManagerEvents.userAwait, user); - return this.#options.pendingMessage(user); - } - catch (error: unknown) { - this.emit(VerificationManagerEvents.error, user, error); - return this.#options.errorMessage(user, error); - } + this.emit(VerificationManagerEvents.userAwait, user); + return this.#options.pendingMessage(user); + } catch (error: unknown) { + this.emit(VerificationManagerEvents.error, user, error); + return this.#options.errorMessage(user, error); + } + } else if ( + user && + user.userid === userid && + user.status === UserStatus.pending + ) { + user.nbCodeCalled++; + await this.#storingSystem.write(user); - } else if (user && user.userid === userid && user.status === UserStatus.pending) { - user.nbCodeCalled++; - await this.#storingSystem.write(user); + if ( + user.nbCodeCalled % + this.#options.maxNbCodeCalledBeforeResend === + 0 + ) { + try { + await this.#senderAPI.send({ + ...user.data, + name: user.username, + code: user.code, + }); + } catch (error: unknown) { + this.emit(VerificationManagerEvents.error, user, error); + return this.#options.errorMessage(user, error); + } + } - if (user.nbCodeCalled % this.#options.maxNbCodeCalledBeforeResend === 0) { - try { - await this.#senderAPI.send({ - ...user.data, - name: user.username, - code: user.code, - }); - } - catch (error: unknown) { - this.emit(VerificationManagerEvents.error, user, error); - return this.#options.errorMessage(user, error); + this.emit(VerificationManagerEvents.userAwait, user); + return this.#options.alreadyPendingMessage(user); + } else { + this.emit(VerificationManagerEvents.userActive, user); + return this.#options.alreadyActiveMessage(user); } - } - - this.emit(VerificationManagerEvents.userAwait, user); - return this.#options.alreadyPendingMessage(user); - } else { - this.emit(VerificationManagerEvents.userActive, user); - return this.#options.alreadyActiveMessage(user); } - } - /** - * Verifies the provided code for the provided user. - * Increments the number of tries of that specific users. - * - * @param {string} userid - * @param {string} code - * @return {Promise} the result of the operation as a string, based on the result of the call to one of the manager's options' methods. - * @memberof VerificationManager - */ - public async verifyCode(userid: string, code: string): Promise { - let isVerified = false; + /** + * Verifies the provided code for the provided user. + * Increments the number of tries of that specific users. + * + * @param {string} userid + * @param {string} code + * @return {Promise} the result of the operation as a string, based on the result of the call to one of the manager's options' methods. + * @memberof VerificationManager + */ + public async verifyCode(userid: string, code: string): Promise { + let isVerified = false; - const user: TUser | undefined | null = await this.#storingSystem.read(userid); + const user: TUser | undefined | null = + await this.#storingSystem.read(userid); - if (user) { - user.nbVerifyCalled++; + if (user) { + user.nbVerifyCalled++; - isVerified = user.status === UserStatus.pending && user.code === code.trim(); - if (isVerified) { - user.status = UserStatus.active; - user.activatedCode = user.code; - user.activationTimestamp = Date.now(); - user.code = null; - } + isVerified = + user.status === UserStatus.pending && user.code === code.trim(); + if (isVerified) { + user.status = UserStatus.active; + user.activatedCode = user.code; + user.activationTimestamp = Date.now(); + user.code = null; + } - await this.#storingSystem.write(user); - } + await this.#storingSystem.write(user); + } - this.emit( - VerificationManagerEvents.codeVerify, - user, - userid, - code, - isVerified - ); + this.emit( + VerificationManagerEvents.codeVerify, + user, + userid, + code, + isVerified, + ); - return isVerified - ? this.#options.validCodeMessage(user, code) - : this.#options.invalidCodeMessage(user, code); - } + return isVerified + ? this.#options.validCodeMessage(user, code) + : this.#options.invalidCodeMessage(user, code); + } } /** @@ -295,4 +316,4 @@ export class VerificationManager extends EventEmitter { * @param {unknown} error * @example * manager.on(VerificationManagerEvents.error, (user, error) => {}); - */ \ No newline at end of file + */ diff --git a/src/VerificationManagerEvents.ts b/src/VerificationManagerEvents.ts index 5ea2992..853e4c6 100644 --- a/src/VerificationManagerEvents.ts +++ b/src/VerificationManagerEvents.ts @@ -5,12 +5,12 @@ * @enum {number} */ export enum VerificationManagerEvents { - codeCreate = 'codeCreate', - codeVerify = 'codeVerify', + codeCreate = "codeCreate", + codeVerify = "codeVerify", - userCreate = 'userCreate', - userAwait = 'userAwait', - userActive = 'userActive', + userCreate = "userCreate", + userAwait = "userAwait", + userActive = "userActive", - error = "error" + error = "error", } diff --git a/src/index.ts b/src/index.ts index a344c0f..567aefa 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ -export * from './types'; -export * from './VerificationManager'; -export * from './VerificationManagerEvents'; +export * from "./types"; +export * from "./VerificationManager"; +export * from "./VerificationManagerEvents"; diff --git a/src/services/CodeGeneratorService.ts b/src/services/CodeGeneratorService.ts index 2734f6d..954e739 100644 --- a/src/services/CodeGeneratorService.ts +++ b/src/services/CodeGeneratorService.ts @@ -5,38 +5,39 @@ * @class CodeGeneratorService */ export class CodeGeneratorService { - readonly #characters: string; + readonly #characters: string; - /** - * Creates an instance of CodeGeneratorService. - * @param {string} charactersWhitelist default = '0123456789' - * @memberof CodeGeneratorService - */ - constructor(charactersWhitelist?: string) { - this.#characters = charactersWhitelist || '0123456789'; - } + /** + * Creates an instance of CodeGeneratorService. + * @param {string} charactersWhitelist default = '0123456789' + * @memberof CodeGeneratorService + */ + constructor(charactersWhitelist?: string) { + this.#characters = charactersWhitelist || "0123456789"; + } - /** - * Generates a code of {length} characters based on the whitelist. - * - * @param {number} length - * @return {string} the code - * @memberof CodeGeneratorService - */ - generateCode(length: number): string { - if (isNaN(length)) throw new TypeError('Length must be a number'); - if (length < 1) throw new RangeError('Length must be at least 1'); + /** + * Generates a code of {length} characters based on the whitelist. + * + * @param {number} length + * @return {string} the code + * @memberof CodeGeneratorService + */ + generateCode(length: number): string { + if (Number.isNaN(length)) + throw new TypeError("Length must be a number"); + if (length < 1) throw new RangeError("Length must be at least 1"); - let code = ''; - for (let i = 0; i < length; i++) { - code += this.#getCharacterAtRandomPosition(); + let code = ""; + for (let i = 0; i < length; i++) { + code += this.#getCharacterAtRandomPosition(); + } + return code.trim(); } - return code.trim(); - } - #getCharacterAtRandomPosition(): string { - return this.#characters.charAt( - Math.floor(Math.random() * this.#characters.length) - ); - } + #getCharacterAtRandomPosition(): string { + return this.#characters.charAt( + Math.floor(Math.random() * this.#characters.length), + ); + } } diff --git a/src/services/JSONDatabaseService.ts b/src/services/JSONDatabaseService.ts index ea0b53d..c1f4aec 100644 --- a/src/services/JSONDatabaseService.ts +++ b/src/services/JSONDatabaseService.ts @@ -1,7 +1,7 @@ -import { Snowflake } from 'discord.js'; -import { Config, JsonDB } from 'node-json-db'; +import type { Snowflake } from "discord.js"; +import { Config, JsonDB } from "node-json-db"; -import { IStoringSystem, IUser } from '../types'; +import type { IStoringSystem, IUser } from "../types"; export type UserModel = IUser; @@ -13,77 +13,92 @@ export type UserModel = IUser; * @implements {IStoringSystem} */ export class JSONDatabaseService implements IStoringSystem { - readonly #database: JsonDB; - readonly #rootPath: string; + readonly #database: JsonDB; + readonly #rootPath: string; - /** - * Creates an instance of JSONDatabaseService. - * @param {string} filePath - * @memberof JSONDatabaseService - */ - constructor(filePath: string) { - this.#rootPath = '/users'; - this.#database = new JsonDB(new Config(filePath, true, true, '/')); - } + /** + * Creates an instance of JSONDatabaseService. + * @param {string} filePath + * @memberof JSONDatabaseService + */ + constructor(filePath: string) { + this.#rootPath = "/users"; + this.#database = new JsonDB(new Config(filePath, true, true, "/")); + } - /** - * Creates the tables if they do not exist yet. - * - * @memberof JSONDatabaseService - */ - init() { - if (!this.#database.exists(this.#rootPath)) { - this.#database.push(this.#rootPath, []); + /** + * Creates the tables if they do not exist yet. + * + * @memberof JSONDatabaseService + */ + init() { + if (!this.#database.exists(this.#rootPath)) { + this.#database.push(this.#rootPath, []); + } } - } - /** - * @inherit - * @param {Snowflake} userid - * @return {Promise} the user - * @memberof JSONDatabaseService - */ - read(userid: Snowflake): Promise { - return this.#database.find(this.#rootPath, (user: UserModel) => user.userid === userid); - } + /** + * @inherit + * @param {Snowflake} userid + * @return {Promise} the user + * @memberof JSONDatabaseService + */ + read(userid: Snowflake): Promise { + return this.#database.find( + this.#rootPath, + (user: UserModel) => user.userid === userid, + ); + } - /** - * @inherit - * @param {Map | ((user: IUser, index: number | string) => boolean)} argument - * @return {Promise} the user or nothing - * @memberof JSONDatabaseService - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - readBy(argument: Map | ((user: UserModel, index: number | string) => boolean)): Promise { - if (argument instanceof Map) { - return this.readBy(user => { - const isValidProperty = (prop: string): prop is keyof UserModel => prop in user; + /** + * @inherit + * @param {Map | ((user: IUser, index: number | string) => boolean)} argument + * @return {Promise} the user or nothing + * @memberof JSONDatabaseService + */ + readBy( + argument: // biome-ignore lint: a filter could be anything + | Map + | ((user: UserModel, index: number | string) => boolean), + ): Promise { + if (argument instanceof Map) { + return this.readBy((user) => { + const isValidProperty = ( + prop: string, + ): prop is keyof UserModel => prop in user; - let returnValue = true; - for (const [property, value] of argument) { - if (isValidProperty(property)) { - const dataFromUser = JSON.stringify(user[property]); - const dataFromValue = JSON.stringify(value); - returnValue = returnValue && dataFromUser === dataFromValue; - console.log(dataFromUser, dataFromValue, returnValue); - } - } + let returnValue = true; + for (const [property, value] of argument) { + if (isValidProperty(property)) { + const dataFromUser = JSON.stringify(user[property]); + const dataFromValue = JSON.stringify(value); + returnValue = + returnValue && dataFromUser === dataFromValue; + console.log(dataFromUser, dataFromValue, returnValue); + } + } - return returnValue; - }); - } - else { - return this.#database.find(this.#rootPath, argument); + return returnValue; + }); + } + return this.#database.find(this.#rootPath, argument); } - } - /** - * @inherit - * @param {UserModel} user - * @memberof JSONDatabaseService - */ - async write(user: UserModel): Promise { - const index = await this.#database.getIndex(this.#rootPath, user.userid, 'userid'); - await this.#database.push(`${this.#rootPath}[${index !== -1 ? index.toString() : ''}]`, user, true); - } + /** + * @inherit + * @param {UserModel} user + * @memberof JSONDatabaseService + */ + async write(user: UserModel): Promise { + const index = await this.#database.getIndex( + this.#rootPath, + user.userid, + "userid", + ); + await this.#database.push( + `${this.#rootPath}[${index !== -1 ? index.toString() : ""}]`, + user, + true, + ); + } } diff --git a/src/services/SendGridService.ts b/src/services/SendGridService.ts index 51df1ce..c6d1334 100644 --- a/src/services/SendGridService.ts +++ b/src/services/SendGridService.ts @@ -1,23 +1,23 @@ -import { MailDataRequired, MailService } from '@sendgrid/mail'; +import { type MailDataRequired, MailService } from "@sendgrid/mail"; -import { ISenderAPI, SenderAPIData } from '../types'; +import type { ISenderAPI, SenderAPIData } from "../types"; export type SendGridMailData = MailDataRequired; export interface SendGridOptions { - /** - * SendGrid API key. - * - * @type {string} - */ - apiKey: string; + /** + * SendGrid API key. + * + * @type {string} + */ + apiKey: string; - /** - * Mail data used by SendGrid for customization and stuff. - * See @sendgrid/mail docs for more information. - * - * @type {SendGridMailData} - */ - mailData: SendGridMailData; + /** + * Mail data used by SendGrid for customization and stuff. + * See @sendgrid/mail docs for more information. + * + * @type {SendGridMailData} + */ + mailData: SendGridMailData; } /** @@ -28,46 +28,46 @@ export interface SendGridOptions { * @implements {ISenderAPI} */ export class SendGridService implements ISenderAPI { - readonly #options: SendGridOptions; - readonly #mailService: MailService; + readonly #options: SendGridOptions; + readonly #mailService: MailService; - /** - * Creates an instance of SendGridService. - * @param {SendGridOptions} options - * @memberof SendGridService - */ - constructor(options: SendGridOptions) { - if (!options || !options.apiKey) { - throw `Cannot instanciate a MailService. + /** + * Creates an instance of SendGridService. + * @param {SendGridOptions} options + * @memberof SendGridService + */ + constructor(options: SendGridOptions) { + if (!options || !options.apiKey) { + throw `Cannot instanciate a MailService. That means you might have forgotten to add options including the apiKey.`; - } + } - this.#options = options; - this.#mailService = new MailService(); - this.#mailService.setApiKey(this.#options.apiKey); - } + this.#options = options; + this.#mailService = new MailService(); + this.#mailService.setApiKey(this.#options.apiKey); + } - /** - * @inherit - * @param {SenderAPIData} { name, code, ...data } The required data to send information through SendGrid. - * @memberof SendGridService - */ - async send({ name, code, ...data }: SenderAPIData) { - const message = { - ...this.#options.mailData, - ...data - } as SendGridMailData; + /** + * @inherit + * @param {SenderAPIData} { name, code, ...data } The required data to send information through SendGrid. + * @memberof SendGridService + */ + async send({ name, code, ...data }: SenderAPIData) { + const message = { + ...this.#options.mailData, + ...data, + } as SendGridMailData; - if (this.#options.mailData.templateId) { - message.templateId = this.#options.mailData.templateId; - message.dynamicTemplateData = { code, name }; - } + if (this.#options.mailData.templateId) { + message.templateId = this.#options.mailData.templateId; + message.dynamicTemplateData = { code, name }; + } - try { - await this.#mailService.send(message, false); - } catch (error) { - console.error(error); - throw error; // forces the VerificationManager flow to stop and return an error message. + try { + await this.#mailService.send(message, false); + } catch (error) { + console.error(error); + throw error; // forces the VerificationManager flow to stop and return an error message. + } } - } } diff --git a/src/types/IUser.ts b/src/types/IUser.ts index 5fb1024..3cf3262 100644 --- a/src/types/IUser.ts +++ b/src/types/IUser.ts @@ -1,6 +1,6 @@ -import { Snowflake } from 'discord.js'; +import type { Snowflake } from "discord.js"; -import { UserStatus } from '.'; +import type { UserStatus } from "."; /** * Represents a user. @@ -9,77 +9,77 @@ import { UserStatus } from '.'; * @interface IUser */ export interface IUser { - /** - * The data used to send the code. Could be an email, a phone number or any - * complex information. Type should match what is expected from the sender API. - * - * @type {*} - * @memberof IUser - */ - // eslint-disable-next-line @typescript-eslint/no-explicit-any - data: any; + /** + * The data used to send the code. Could be an email, a phone number or any + * complex information. Type should match what is expected from the sender API. + * + * @type {*} + * @memberof IUser + */ + // biome-ignore lint: any data could be sent + data: any; - /** - * The generated code to verify that user. - * - * @type {string | null} - * @memberof IUser - */ - code: string | null; + /** + * The generated code to verify that user. + * + * @type {string | null} + * @memberof IUser + */ + code: string | null; - /** - * The used code that verified the user. - * - * @type {string | null} - * @memberof IUser - */ - activatedCode?: string | null; + /** + * The used code that verified the user. + * + * @type {string | null} + * @memberof IUser + */ + activatedCode?: string | null; - /** - * The timestamp marking the activation of the user. - * - * @type {EpochTimeStamp} - * @memberof IUser - */ - activationTimestamp?: EpochTimeStamp; + /** + * The timestamp marking the activation of the user. + * + * @type {EpochTimeStamp} + * @memberof IUser + */ + activationTimestamp?: EpochTimeStamp; - /** - * The user name. - * - * @type {string} - * @memberof IUser - */ - username: string; + /** + * The user name. + * + * @type {string} + * @memberof IUser + */ + username: string; - /** - * The user Discord ID. - * - * @type {Snowflake} - * @memberof IUser - */ - userid: Snowflake; + /** + * The user Discord ID. + * + * @type {Snowflake} + * @memberof IUser + */ + userid: Snowflake; - /** - * The status of the user. - * - * @type {UserStatus} - * @memberof IUser - */ - status: UserStatus; + /** + * The status of the user. + * + * @type {UserStatus} + * @memberof IUser + */ + status: UserStatus; - /** - * The number of times the generation of a code for that user is initiated. - * - * @type {number} - * @memberof IUser - */ - nbCodeCalled: number; + /** + * The number of times the generation of a code for that user is initiated. + * + * @type {number} + * @memberof IUser + */ + nbCodeCalled: number; - /** - * The number of times the verification of a code for that user is initiated. - * - * @type {number} - * @memberof IUser - */ - nbVerifyCalled: number; + /** + * The number of times the verification of a code for that user is initiated. + * + * @type {number} + * @memberof IUser + */ + nbVerifyCalled: number; } diff --git a/src/types/SenderAPI.ts b/src/types/SenderAPI.ts index e9bbee4..284acd5 100644 --- a/src/types/SenderAPI.ts +++ b/src/types/SenderAPI.ts @@ -1,20 +1,20 @@ export interface SenderAPIData { - /** - * The code to send. - * - * @type {string} - */ - code: string; + /** + * The code to send. + * + * @type {string} + */ + code: string; - /** - * The user name for message customization. - * - * @type {string} - */ - name: string; + /** + * The user name for message customization. + * + * @type {string} + */ + name: string; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - [prop: string]: any; + // biome-ignore lint: any data could be sent + [prop: string]: any; } /** @@ -24,11 +24,11 @@ export interface SenderAPIData { * @interface ISenderAPI */ export interface ISenderAPI { - /** - * Sends data to a user via a specific flow. - * - * @param {SenderAPIData} data - * @memberof ISenderAPI - */ - send(data: SenderAPIData): Promise; + /** + * Sends data to a user via a specific flow. + * + * @param {SenderAPIData} data + * @memberof ISenderAPI + */ + send(data: SenderAPIData): Promise; } diff --git a/src/types/StoringSystem.ts b/src/types/StoringSystem.ts index 4783049..5f09eed 100644 --- a/src/types/StoringSystem.ts +++ b/src/types/StoringSystem.ts @@ -1,6 +1,6 @@ -import { Snowflake } from 'discord.js'; +import type { Snowflake } from "discord.js"; -import { IUser } from '.'; +import type { IUser } from "."; /** * The contract of a storing service. @@ -10,33 +10,37 @@ import { IUser } from '.'; * @template TUser */ export interface IStoringSystem { - /** - * Reads the storing system to get the user based on its unique identifier. - * - * @param {Snowflake} userid - * @return {Promise} the user or nothing - * @memberof IStoringSystem - */ - read(userid: Snowflake): Promise; + /** + * Reads the storing system to get the user based on its unique identifier. + * + * @param {Snowflake} userid + * @return {Promise} the user or nothing + * @memberof IStoringSystem + */ + read(userid: Snowflake): Promise; - /** - * Reads the storing system to get the user based on filters. - * - * @param {Map} filters - * @return {(Promise)} the user or nothing - * @memberof IStoringSystem - */ - /* eslint-disable @typescript-eslint/no-explicit-any */ - readBy(filters: Map): Promise; - readBy(callback: (user: TUser, index: number | string) => boolean): Promise; - readBy(argument: Map | ((user: TUser, index: number | string) => boolean)): Promise; - /* eslint-enable @typescript-eslint/no-explicit-any */ + /** + * Reads the storing system to get the user based on filters. + * + * @param {Map} filters + * @return {(Promise)} the user or nothing + * @memberof IStoringSystem + */ + // biome-ignore lint: a filter could be anything + readBy(filters: Map): Promise; + readBy( + callback: (user: TUser, index: number | string) => boolean, + ): Promise; + readBy( + argument: // biome-ignore lint: a filter could be anything + Map | ((user: TUser, index: number | string) => boolean), + ): Promise; - /** - * Writes a user into the storing system. - * - * @param {TUser} user - * @memberof IStoringSystem - */ - write(user: TUser): Promise; + /** + * Writes a user into the storing system. + * + * @param {TUser} user + * @memberof IStoringSystem + */ + write(user: TUser): Promise; } diff --git a/src/types/UserStatus.ts b/src/types/UserStatus.ts index dfd2442..e4a7863 100644 --- a/src/types/UserStatus.ts +++ b/src/types/UserStatus.ts @@ -5,13 +5,13 @@ * @enum {number} */ export enum UserStatus { - /** - * The user verification is pending. - */ - pending, + /** + * The user verification is pending. + */ + pending = 0, - /** - * The user is verified and active. - */ - active + /** + * The user is verified and active. + */ + active = 1, } diff --git a/src/types/VerificationOptions.ts b/src/types/VerificationOptions.ts index 72d82c1..ef543e1 100644 --- a/src/types/VerificationOptions.ts +++ b/src/types/VerificationOptions.ts @@ -1,4 +1,4 @@ -import { IUser } from '.'; +import type { IUser } from "."; /** * The {@link VerificationManager} options. @@ -8,93 +8,96 @@ import { IUser } from '.'; * @template TUser */ export interface VerificationOptions { - /** - * The options related to the code generation. - * - * @type {{ - * charactersWhitelist?: string; - * length: number; - * }} - * @memberof VerificationOptions - */ - codeGenerationOptions: { /** - * The whitelist of characters used to generate the code. + * The options related to the code generation. * - * @type {string} + * @type {{ + * charactersWhitelist?: string; + * length: number; + * }} + * @memberof VerificationOptions */ - charactersWhitelist?: string; + codeGenerationOptions: { + /** + * The whitelist of characters used to generate the code. + * + * @type {string} + */ + charactersWhitelist?: string; + + /** + * The required length of the code. + * + * @type {number} + */ + length: number; + }; /** - * The required length of the code. + * The maximum number of calls before resending the code to the user via the communication service. * * @type {number} + * @memberof VerificationOptions */ - length: number; - }; - - /** - * The maximum number of calls before resending the code to the user via the communication service. - * - * @type {number} - * @memberof VerificationOptions - */ - maxNbCodeCalledBeforeResend: number; + maxNbCodeCalledBeforeResend: number; - /** - * Formats the message sent when calling the communication service throws an error. - * - * @param {TUser} user - * @param {unknown} error - * @return {string} the message - * @memberof VerificationOptions - */ - errorMessage(user: TUser, error: unknown): string; + /** + * Formats the message sent when calling the communication service throws an error. + * + * @param {TUser} user + * @param {unknown} error + * @return {string} the message + * @memberof VerificationOptions + */ + errorMessage(user: TUser, error: unknown): string; - /** - * Formats the message sent for the first time when the user's code has just been sent. - * - * @param {TUser} user - * @return {string} the message - * @memberof VerificationOptions - */ - pendingMessage(user: TUser): string; + /** + * Formats the message sent for the first time when the user's code has just been sent. + * + * @param {TUser} user + * @return {string} the message + * @memberof VerificationOptions + */ + pendingMessage(user: TUser): string; - /** - * Formats the message sent once the user tries to generate a code when it's already sent to them. - * - * @param {TUser} user - * @return {string} the message - * @memberof VerificationOptions - */ - alreadyPendingMessage(user: TUser): string; + /** + * Formats the message sent once the user tries to generate a code when it's already sent to them. + * + * @param {TUser} user + * @return {string} the message + * @memberof VerificationOptions + */ + alreadyPendingMessage(user: TUser): string; - /** - * Formats the message sent once the user tries to generate a code when they are already verified. - * - * @param {TUser} user - * @return {string} the message - * @memberof VerificationOptions - */ - alreadyActiveMessage(user: TUser): string; + /** + * Formats the message sent once the user tries to generate a code when they are already verified. + * + * @param {TUser} user + * @return {string} the message + * @memberof VerificationOptions + */ + alreadyActiveMessage(user: TUser): string; - /** - * Formats the message sent once the code is checked and valid. - * - * @param {TUser| undefined | null} user - * @param {string} validCode - * @return {string} the message - * @memberof VerificationOptions - */ - validCodeMessage(user: TUser | undefined | null, validCode: string): string; + /** + * Formats the message sent once the code is checked and valid. + * + * @param {TUser| undefined | null} user + * @param {string} validCode + * @return {string} the message + * @memberof VerificationOptions + */ + validCodeMessage(user: TUser | undefined | null, validCode: string): string; - /** - * Formats the message sent once the code is checked and invalid. - * - * @param {TUser| undefined | null} user - * @param {string} invalidCode - * @return {string} the message - * @memberof VerificationOptions - */ - invalidCodeMessage(user: TUser | undefined | null, invalidCode: string): string; + /** + * Formats the message sent once the code is checked and invalid. + * + * @param {TUser| undefined | null} user + * @param {string} invalidCode + * @return {string} the message + * @memberof VerificationOptions + */ + invalidCodeMessage( + user: TUser | undefined | null, + invalidCode: string, + ): string; } diff --git a/src/types/index.ts b/src/types/index.ts index f9e1930..00d6ac9 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,6 +1,6 @@ -export * from './SenderAPI'; -export * from './StoringSystem'; -export * from './IUser'; -export * from './IUser'; -export * from './UserStatus'; -export * from './VerificationOptions'; +export * from "./SenderAPI"; +export * from "./StoringSystem"; +export * from "./IUser"; +export * from "./IUser"; +export * from "./UserStatus"; +export * from "./VerificationOptions"; diff --git a/yarn.lock b/yarn.lock index e432e92..912127b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,59 @@ # yarn lockfile v1 -"@aashutoshrathi/word-wrap@^1.2.3": - version "1.2.6" - resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" - integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== +"@biomejs/biome@1.6.4": + version "1.6.4" + resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-1.6.4.tgz#d09ab44c1df2a0cbbbb15901779a164beacd356d" + integrity sha512-3groVd2oWsLC0ZU+XXgHSNbq31lUcOCBkCcA7sAQGBopHcmL+jmmdoWlY3S61zIh+f2mqQTQte1g6PZKb3JJjA== + optionalDependencies: + "@biomejs/cli-darwin-arm64" "1.6.4" + "@biomejs/cli-darwin-x64" "1.6.4" + "@biomejs/cli-linux-arm64" "1.6.4" + "@biomejs/cli-linux-arm64-musl" "1.6.4" + "@biomejs/cli-linux-x64" "1.6.4" + "@biomejs/cli-linux-x64-musl" "1.6.4" + "@biomejs/cli-win32-arm64" "1.6.4" + "@biomejs/cli-win32-x64" "1.6.4" + +"@biomejs/cli-darwin-arm64@1.6.4": + version "1.6.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.6.4.tgz#a2b07cacb0d2769ae5545b6a3cf40907fbfd4ab0" + integrity sha512-2WZef8byI9NRzGajGj5RTrroW9BxtfbP9etigW1QGAtwu/6+cLkdPOWRAs7uFtaxBNiKFYA8j/BxV5zeAo5QOQ== + +"@biomejs/cli-darwin-x64@1.6.4": + version "1.6.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.6.4.tgz#476720d731864508312b12fbef62a35609ef5f96" + integrity sha512-uo1zgM7jvzcoDpF6dbGizejDLCqNpUIRkCj/oEK0PB0NUw8re/cn1EnxuOLZqDpn+8G75COLQTOx8UQIBBN/Kg== + +"@biomejs/cli-linux-arm64-musl@1.6.4": + version "1.6.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-1.6.4.tgz#403f5889a4ec290e35a0b910c1c26723373cf5fc" + integrity sha512-Hp8Jwt6rjj0wCcYAEN6/cfwrrPLLlGOXZ56Lei4Pt4jy39+UuPeAVFPeclrrCfxyL1wQ2xPrhd/saTHSL6DoJg== + +"@biomejs/cli-linux-arm64@1.6.4": + version "1.6.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.6.4.tgz#7eff2af0fc5d9af9affc963bb594ec2ebf89668f" + integrity sha512-wAOieaMNIpLrxGc2/xNvM//CIZg7ueWy3V5A4T7gDZ3OL/Go27EKE59a+vMKsBCYmTt7jFl4yHz0TUkUbodA/w== + +"@biomejs/cli-linux-x64-musl@1.6.4": + version "1.6.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-1.6.4.tgz#aeca8dd886b19b7779dfb43898ec896c71da279f" + integrity sha512-wqi0hr8KAx5kBO0B+m5u8QqiYFFBJOSJVSuRqTeGWW+GYLVUtXNidykNqf1JsW6jJDpbkSp2xHKE/bTlVaG2Kg== + +"@biomejs/cli-linux-x64@1.6.4": + version "1.6.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-1.6.4.tgz#545b205dea20195b1fa64f5a0e60331a70133518" + integrity sha512-qTWhuIw+/ePvOkjE9Zxf5OqSCYxtAvcTJtVmZT8YQnmY2I62JKNV2m7tf6O5ViKZUOP0mOQ6NgqHKcHH1eT8jw== + +"@biomejs/cli-win32-arm64@1.6.4": + version "1.6.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.6.4.tgz#2c377c0965749d01280baac6cb273bcbe11cd652" + integrity sha512-Wp3FiEeF6v6C5qMfLkHwf4YsoNHr/n0efvoC8jCKO/kX05OXaVExj+1uVQ1eGT7Pvx0XVm/TLprRO0vq/V6UzA== + +"@biomejs/cli-win32-x64@1.6.4": + version "1.6.4" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-1.6.4.tgz#317fed21b863d43778665d42a41cbd0f94351051" + integrity sha512-mz183Di5hTSGP7KjNWEhivcP1wnHLGmOxEROvoFsIxMYtDhzJDad4k5gI/1JbmA0xe4n52vsgqo09tBhrMT/Zg== "@discordjs/builders@^0.5.0": version "0.5.0" @@ -97,83 +146,11 @@ tslib "^2.6.2" ws "^8.14.2" -"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0": - version "4.4.0" - resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" - integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== - dependencies: - eslint-visitor-keys "^3.3.0" - -"@eslint-community/regexpp@^4.10.0", "@eslint-community/regexpp@^4.6.1": - version "4.10.0" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.10.0.tgz#548f6de556857c8bb73bbee70c35dc82a2e74d63" - integrity sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA== - -"@eslint/eslintrc@^3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-3.0.2.tgz#36180f8e85bf34d2fe3ccc2261e8e204a411ab4e" - integrity sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg== - dependencies: - ajv "^6.12.4" - debug "^4.3.2" - espree "^10.0.1" - globals "^14.0.0" - ignore "^5.2.0" - import-fresh "^3.2.1" - js-yaml "^4.1.0" - minimatch "^3.1.2" - strip-json-comments "^3.1.1" - -"@eslint/js@9.0.0", "@eslint/js@^9.0.0": - version "9.0.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-9.0.0.tgz#1a9e4b4c96d8c7886e0110ed310a0135144a1691" - integrity sha512-RThY/MnKrhubF6+s1JflwUjPEsnCEmYCWwqa/aRISKWNXGZ9epUwft4bUMM35SdKF9xvBrLydAM1RDHd1Z//ZQ== - "@fastify/busboy@^2.0.0": version "2.1.1" resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== -"@humanwhocodes/config-array@^0.12.3": - version "0.12.3" - resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.12.3.tgz#a6216d90f81a30bedd1d4b5d799b47241f318072" - integrity sha512-jsNnTBlMWuTpDkeE3on7+dWJi0D6fdDfeANj/w7MpS8ztROCoLvIO2nG0CcFj+E4k8j4QrSTh4Oryi3i2G669g== - dependencies: - "@humanwhocodes/object-schema" "^2.0.3" - debug "^4.3.1" - minimatch "^3.0.5" - -"@humanwhocodes/module-importer@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" - integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== - -"@humanwhocodes/object-schema@^2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz#4a2868d75d6d6963e423bcf90b7fd1be343409d3" - integrity sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA== - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - "@sapphire/async-queue@^1.1.4", "@sapphire/async-queue@^1.5.0": version "1.5.0" resolved "https://registry.yarnpkg.com/@sapphire/async-queue/-/async-queue-1.5.0.tgz#2f255a3f186635c4fb5a2381e375d3dfbc5312d8" @@ -225,11 +202,6 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== -"@types/json-schema@^7.0.15": - version "7.0.15" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" - integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== - "@types/node-json-db@^0.9.3": version "0.9.3" resolved "https://registry.yarnpkg.com/@types/node-json-db/-/node-json-db-0.9.3.tgz#511534e10d2595f67c65869e14848383c059bbe0" @@ -249,11 +221,6 @@ dependencies: undici-types "~5.26.4" -"@types/semver@^7.5.8": - version "7.5.8" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" - integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== - "@types/sqlite3@^3.1.11": version "3.1.11" resolved "https://registry.yarnpkg.com/@types/sqlite3/-/sqlite3-3.1.11.tgz#845044b81585f1fcc143ee8d963ca5da63d0e768" @@ -282,144 +249,16 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.6.0.tgz#1f5df5cda490a0bcb6fbdd3382e19f1241024242" - integrity sha512-gKmTNwZnblUdnTIJu3e9kmeRRzV2j1a/LUO27KNNAnIC5zjy1aSvXSRp4rVNlmAoHlQ7HzX42NbKpcSr4jF80A== - dependencies: - "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "7.6.0" - "@typescript-eslint/type-utils" "7.6.0" - "@typescript-eslint/utils" "7.6.0" - "@typescript-eslint/visitor-keys" "7.6.0" - debug "^4.3.4" - graphemer "^1.4.0" - ignore "^5.3.1" - natural-compare "^1.4.0" - semver "^7.6.0" - ts-api-utils "^1.3.0" - -"@typescript-eslint/parser@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.6.0.tgz#0aca5de3045d68b36e88903d15addaf13d040a95" - integrity sha512-usPMPHcwX3ZoPWnBnhhorc14NJw9J4HpSXQX4urF2TPKG0au0XhJoZyX62fmvdHONUkmyUe74Hzm1//XA+BoYg== - dependencies: - "@typescript-eslint/scope-manager" "7.6.0" - "@typescript-eslint/types" "7.6.0" - "@typescript-eslint/typescript-estree" "7.6.0" - "@typescript-eslint/visitor-keys" "7.6.0" - debug "^4.3.4" - -"@typescript-eslint/scope-manager@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.6.0.tgz#1e9972f654210bd7500b31feadb61a233f5b5e9d" - integrity sha512-ngttyfExA5PsHSx0rdFgnADMYQi+Zkeiv4/ZxGYUWd0nLs63Ha0ksmp8VMxAIC0wtCFxMos7Lt3PszJssG/E6w== - dependencies: - "@typescript-eslint/types" "7.6.0" - "@typescript-eslint/visitor-keys" "7.6.0" - -"@typescript-eslint/type-utils@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.6.0.tgz#644f75075f379827d25fe0713e252ccd4e4a428c" - integrity sha512-NxAfqAPNLG6LTmy7uZgpK8KcuiS2NZD/HlThPXQRGwz6u7MDBWRVliEEl1Gj6U7++kVJTpehkhZzCJLMK66Scw== - dependencies: - "@typescript-eslint/typescript-estree" "7.6.0" - "@typescript-eslint/utils" "7.6.0" - debug "^4.3.4" - ts-api-utils "^1.3.0" - -"@typescript-eslint/types@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.6.0.tgz#53dba7c30c87e5f10a731054266dd905f1fbae38" - integrity sha512-h02rYQn8J+MureCvHVVzhl69/GAfQGPQZmOMjG1KfCl7o3HtMSlPaPUAPu6lLctXI5ySRGIYk94clD/AUMCUgQ== - -"@typescript-eslint/typescript-estree@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.6.0.tgz#112a3775563799fd3f011890ac8322f80830ac17" - integrity sha512-+7Y/GP9VuYibecrCQWSKgl3GvUM5cILRttpWtnAu8GNL9j11e4tbuGZmZjJ8ejnKYyBRb2ddGQ3rEFCq3QjMJw== - dependencies: - "@typescript-eslint/types" "7.6.0" - "@typescript-eslint/visitor-keys" "7.6.0" - debug "^4.3.4" - globby "^11.1.0" - is-glob "^4.0.3" - minimatch "^9.0.4" - semver "^7.6.0" - ts-api-utils "^1.3.0" - -"@typescript-eslint/utils@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.6.0.tgz#e400d782280b6f724c8a1204269d984c79202282" - integrity sha512-x54gaSsRRI+Nwz59TXpCsr6harB98qjXYzsRxGqvA5Ue3kQH+FxS7FYU81g/omn22ML2pZJkisy6Q+ElK8pBCA== - dependencies: - "@eslint-community/eslint-utils" "^4.4.0" - "@types/json-schema" "^7.0.15" - "@types/semver" "^7.5.8" - "@typescript-eslint/scope-manager" "7.6.0" - "@typescript-eslint/types" "7.6.0" - "@typescript-eslint/typescript-estree" "7.6.0" - semver "^7.6.0" - -"@typescript-eslint/visitor-keys@7.6.0": - version "7.6.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.6.0.tgz#d1ce13145844379021e1f9bd102c1d78946f4e76" - integrity sha512-4eLB7t+LlNUmXzfOu1VAIAdkjbu5xNSerURS9X/S5TUKWFRpXRQZbmtPqgKmYx8bj3J0irtQXSiWAOY82v+cgw== - dependencies: - "@typescript-eslint/types" "7.6.0" - eslint-visitor-keys "^3.4.3" - "@vladfrangu/async_event_emitter@^2.2.2": version "2.2.4" resolved "https://registry.yarnpkg.com/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.4.tgz#d3537432c6db6444680a596271dff8ea407343b3" integrity sha512-ButUPz9E9cXMLgvAW8aLAKKJJsPu1dY1/l/E8xzLFuysowXygs6GBcyunK9rnGC4zTsnIc2mQo71rGw9U+Ykug== -acorn-jsx@^5.3.2: - version "5.3.2" - resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" - integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== - -acorn@^8.11.3: - version "8.11.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" - integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== - -ajv@^6.12.4: - version "6.12.6" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - ansi-sequence-parser@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz#e0aa1cdcbc8f8bb0b5bca625aac41f5f056973cf" integrity sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg== -ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -argparse@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" - integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -444,14 +283,6 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - brace-expansion@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" @@ -459,38 +290,11 @@ brace-expansion@^2.0.1: dependencies: balanced-match "^1.0.0" -braces@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -callsites@^3.0.0, callsites@^3.1.0: +callsites@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -chalk@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -498,32 +302,6 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== - -cross-spawn@^7.0.2: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -deep-is@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" - integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== - deepmerge@^4.2.2: version "4.3.1" resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" @@ -534,13 +312,6 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - discord-api-types@0.37.61: version "0.37.61" resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.61.tgz#9dd8e58c624237e6f1b23be2d29579af268b8c5b" @@ -598,170 +369,11 @@ dot-prop@^6.0.1: dependencies: is-obj "^2.0.0" -escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - -eslint-scope@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-8.0.1.tgz#a9601e4b81a0b9171657c343fb13111688963cfc" - integrity sha512-pL8XjgP4ZOmmwfFE8mEhSxA7ZY4C+LWyqjQ3o4yWkkmD0qcMT9kkW3zWHOczhWcjTSgqycYAgwSlXvZltv65og== - dependencies: - esrecurse "^4.3.0" - estraverse "^5.2.0" - -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" - integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== - -eslint-visitor-keys@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz#e3adc021aa038a2a8e0b2f8b0ce8f66b9483b1fb" - integrity sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw== - -eslint@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.0.0.tgz#6270548758e390343f78c8afd030566d86927d40" - integrity sha512-IMryZ5SudxzQvuod6rUdIUz29qFItWx281VhtFVc2Psy/ZhlCeD/5DT6lBIJ4H3G+iamGJoTln1v+QSuPw0p7Q== - dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@eslint-community/regexpp" "^4.6.1" - "@eslint/eslintrc" "^3.0.2" - "@eslint/js" "9.0.0" - "@humanwhocodes/config-array" "^0.12.3" - "@humanwhocodes/module-importer" "^1.0.1" - "@nodelib/fs.walk" "^1.2.8" - ajv "^6.12.4" - chalk "^4.0.0" - cross-spawn "^7.0.2" - debug "^4.3.2" - escape-string-regexp "^4.0.0" - eslint-scope "^8.0.1" - eslint-visitor-keys "^4.0.0" - espree "^10.0.1" - esquery "^1.4.2" - esutils "^2.0.2" - fast-deep-equal "^3.1.3" - file-entry-cache "^8.0.0" - find-up "^5.0.0" - glob-parent "^6.0.2" - graphemer "^1.4.0" - ignore "^5.2.0" - imurmurhash "^0.1.4" - is-glob "^4.0.0" - is-path-inside "^3.0.3" - json-stable-stringify-without-jsonify "^1.0.1" - levn "^0.4.1" - lodash.merge "^4.6.2" - minimatch "^3.1.2" - natural-compare "^1.4.0" - optionator "^0.9.3" - strip-ansi "^6.0.1" - text-table "^0.2.0" - -espree@^10.0.1: - version "10.0.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-10.0.1.tgz#600e60404157412751ba4a6f3a2ee1a42433139f" - integrity sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww== - dependencies: - acorn "^8.11.3" - acorn-jsx "^5.3.2" - eslint-visitor-keys "^4.0.0" - -esquery@^1.4.2: - version "1.5.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" - integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== - dependencies: - estraverse "^5.1.0" - -esrecurse@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" - integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== - dependencies: - estraverse "^5.2.0" - -estraverse@^5.1.0, estraverse@^5.2.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" - integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== - -esutils@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" - integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== - -fast-deep-equal@3.1.3, fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: +fast-deep-equal@3.1.3, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-glob@^3.2.9: - version "3.3.2" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" - integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-json-stable-stringify@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fast-levenshtein@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" - integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== - -fastq@^1.6.0: - version "1.17.1" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47" - integrity sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w== - dependencies: - reusify "^1.0.4" - -file-entry-cache@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-8.0.0.tgz#7787bddcf1131bffb92636c69457bbc0edd6d81f" - integrity sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ== - dependencies: - flat-cache "^4.0.0" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== - dependencies: - locate-path "^6.0.0" - path-exists "^4.0.0" - -flat-cache@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-4.0.1.tgz#0ece39fcb14ee012f4b0410bd33dd9c1f011127c" - integrity sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw== - dependencies: - flatted "^3.2.9" - keyv "^4.5.4" - -flatted@^3.2.9: - version "3.3.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" - integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== - follow-redirects@^1.15.6: version "1.15.6" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" @@ -776,156 +388,21 @@ form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" -glob-parent@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob-parent@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" - integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== - dependencies: - is-glob "^4.0.3" - -globals@^14.0.0: - version "14.0.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-14.0.0.tgz#898d7413c29babcf6bafe56fcadded858ada724e" - integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== - -globby@^11.1.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" - integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.2.9" - ignore "^5.2.0" - merge2 "^1.4.1" - slash "^3.0.0" - -graphemer@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" - integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -ignore@^5.2.0, ignore@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef" - integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw== - -import-fresh@^3.2.1: - version "3.3.0" - resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" - integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== - dependencies: - parent-module "^1.0.0" - resolve-from "^4.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - is-obj@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== -is-path-inside@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" - integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== - -js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - -json-buffer@3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" - integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== - -json-schema-traverse@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" - integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== - -json-stable-stringify-without-jsonify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" - integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== - jsonc-parser@^3.2.0: version "3.2.1" resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.1.tgz#031904571ccf929d7670ee8c547545081cb37f1a" integrity sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA== -keyv@^4.5.4: - version "4.5.4" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" - integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== - dependencies: - json-buffer "3.0.1" - -levn@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" - integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== - dependencies: - prelude-ls "^1.2.1" - type-check "~0.4.0" - -locate-path@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" - integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== - dependencies: - p-locate "^5.0.0" - lodash.isequal@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== -lodash.merge@^4.6.2: - version "4.6.2" - resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" - integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== - lodash.snakecase@4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" @@ -936,13 +413,6 @@ lodash@^4.17.21: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - lunr@^2.3.9: version "2.3.9" resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" @@ -958,19 +428,6 @@ marked@^4.3.0: resolved "https://registry.yarnpkg.com/marked/-/marked-4.3.0.tgz#796362821b019f734054582038b116481b456cf3" integrity sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A== -merge2@^1.3.0, merge2@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -micromatch@^4.0.4: - version "4.0.5" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" - integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== - dependencies: - braces "^3.0.2" - picomatch "^2.3.1" - mime-db@1.52.0: version "1.52.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" @@ -983,30 +440,13 @@ mime-types@^2.1.12: dependencies: mime-db "1.52.0" -minimatch@^3.0.5, minimatch@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^9.0.3, minimatch@^9.0.4: +minimatch@^9.0.3: version "9.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.4.tgz#8e49c731d1749cbec05050ee5145147b32496a51" integrity sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw== dependencies: brace-expansion "^2.0.1" -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== - node-fetch@^2.6.1: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" @@ -1029,18 +469,6 @@ node-json-db@^2.3.0: dependencies: rwlock "^5.0.0" -optionator@^0.9.3: - version "0.9.3" - resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" - integrity sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg== - dependencies: - "@aashutoshrathi/word-wrap" "^1.2.3" - deep-is "^0.1.3" - fast-levenshtein "^2.0.6" - levn "^0.4.1" - prelude-ls "^1.2.1" - type-check "^0.4.0" - ow@^0.27.0: version "0.27.0" resolved "https://registry.yarnpkg.com/ow/-/ow-0.27.0.tgz#d44da088e8184fa11de64b5813206f9f86ab68d0" @@ -1053,108 +481,16 @@ ow@^0.27.0: type-fest "^1.2.1" vali-date "^1.0.0" -p-limit@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" - integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== - dependencies: - p-limit "^3.0.2" - -parent-module@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" - integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== - dependencies: - callsites "^3.0.0" - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -prelude-ls@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" - integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== - proxy-from-env@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== -punycode@^2.1.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" - integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -resolve-from@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" - integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - rwlock@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/rwlock/-/rwlock-5.0.0.tgz#888d6a77a3351cc1a209204ef2ee1722093836cf" integrity sha512-XgzRqLMfCcm9QfZuPav9cV3Xin5TRcIlp4X/SH3CvB+x5D2AakdlEepfJKDd8ByncvfpcxNWdRZVUl38PS6ZJg== -semver@^7.6.0: - version "7.6.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.0.tgz#1a46a4db4bffcccd97b743b5005c8325f23d4e2d" - integrity sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg== - dependencies: - lru-cache "^6.0.0" - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - shiki@^0.14.7: version "0.14.7" resolved "https://registry.yarnpkg.com/shiki/-/shiki-0.14.7.tgz#c3c9e1853e9737845f1d2ef81b31bcfb07056d4e" @@ -1165,52 +501,11 @@ shiki@^0.14.7: vscode-oniguruma "^1.7.0" vscode-textmate "^8.0.0" -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -text-table@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" - integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== -ts-api-utils@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" - integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== - ts-mixer@^6.0.0: version "6.0.2" resolved "https://registry.yarnpkg.com/ts-mixer/-/ts-mixer-6.0.2.tgz#3e4e4bb8daffb24435f6980b15204cb5b287e016" @@ -1231,13 +526,6 @@ tslib@^2.3.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== -type-check@^0.4.0, type-check@~0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" - integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== - dependencies: - prelude-ls "^1.2.1" - type-fest@^1.2.1: version "1.4.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-1.4.0.tgz#e9fb813fe3bf1744ec359d55d1affefa76f14be1" @@ -1253,15 +541,6 @@ typedoc@^0.25.13: minimatch "^9.0.3" shiki "^0.14.7" -typescript-eslint@^7.6.0: - version "7.6.0" - resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-7.6.0.tgz#12dd1de864bedc39df8180ea44a585571586291b" - integrity sha512-LY6vH6F1l5jpGqRtU+uK4+mOecIb4Cd4kaz1hAiJrgnNiHUA8wiw8BkJyYS+MRLM69F1QuSKwtGlQqnGl1Rc6w== - dependencies: - "@typescript-eslint/eslint-plugin" "7.6.0" - "@typescript-eslint/parser" "7.6.0" - "@typescript-eslint/utils" "7.6.0" - typescript@^5.4.4: version "5.4.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.4.4.tgz#eb2471e7b0a5f1377523700a21669dce30c2d952" @@ -1279,13 +558,6 @@ undici@5.27.2: dependencies: "@fastify/busboy" "^2.0.0" -uri-js@^4.2.2: - version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" - integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== - dependencies: - punycode "^2.1.0" - vali-date@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/vali-date/-/vali-date-1.0.0.tgz#1b904a59609fb328ef078138420934f6b86709a6" @@ -1314,13 +586,6 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - ws@8.14.2: version "8.14.2" resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" @@ -1335,13 +600,3 @@ ws@^8.14.2: version "8.16.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4" integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From 31e7fa0e078ef3a30c8288ec1bfaa77e6b54b6c0 Mon Sep 17 00:00:00 2001 From: HunteRoi Date: Thu, 20 Jun 2024 03:41:15 +0200 Subject: [PATCH 3/4] chore: example in ts, switch from CJS to ECM --- .gitignore | 10 +- .../api-docs/classes/VerificationManager.html | 10 +- docs/api-docs/enums/UserStatus.html | 6 +- .../enums/VerificationManagerEvents.html | 4 +- docs/api-docs/interfaces/ISenderAPI.html | 4 +- docs/api-docs/interfaces/IStoringSystem.html | 8 +- docs/api-docs/interfaces/IUser.html | 20 +- docs/api-docs/interfaces/SenderAPIData.html | 6 +- .../interfaces/VerificationOptions.html | 18 +- examples/{index.js => index.ts} | 27 +-- package.json | 8 +- src/VerificationManager.ts | 6 +- src/index.ts | 6 +- src/services/JSONDatabaseService.ts | 2 +- src/services/SendGridService.ts | 2 +- src/types/IUser.ts | 2 +- src/types/StoringSystem.ts | 2 +- src/types/VerificationOptions.ts | 2 +- src/types/index.ts | 11 +- tsconfig.json | 5 +- typedoc.config.js | 14 +- yarn.lock | 201 ++++++++---------- 22 files changed, 175 insertions(+), 199 deletions(-) rename examples/{index.js => index.ts} (80%) diff --git a/.gitignore b/.gitignore index eb82d94..b1513de 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,9 @@ # Node -node_modules +node_modules/ # Compiled files -lib - -# Tests -**test** +lib/ +examples/index.js # Database examples/db.json - -examples/example.js \ No newline at end of file diff --git a/docs/api-docs/classes/VerificationManager.html b/docs/api-docs/classes/VerificationManager.html index 9289d86..96c5cbf 100644 --- a/docs/api-docs/classes/VerificationManager.html +++ b/docs/api-docs/classes/VerificationManager.html @@ -1,6 +1,6 @@ VerificationManager | @hunteroi/discord-verification

The manager handling verification (generating, sending and verifying the user's code).

Export

VerificationManager

-

Type Parameters

Hierarchy

  • EventEmitter
    • VerificationManager

Constructors

Type Parameters

Hierarchy

  • EventEmitter
    • VerificationManager

Constructors

Properties

Methods

sendCode verifyCode @@ -13,14 +13,14 @@ invalidCodeMessage: (user: TUser, invalidCode: string) => Your code ${invalidCode} is invalid! }]

Returns VerificationManager<TUser>

Memberof

VerificationManager

-

Properties

client: Client<boolean>

The Discord client instance.

+

Properties

client: Client<boolean>

The Discord client instance.

Memberof

VerificationManager

-

Methods

  • Sends the code via the communication service to the user based on the provided data. +

Methods

  • Sends the code via the communication service to the user based on the provided data. Saves the user, their code and their data into the database.

    Parameters

    • userid: string
    • data: any

    Returns Promise<string>

    the result of the operation as a string, based on the result of the call to one of the manager's options' methods.

    Memberof

    VerificationManager

    -
  • Verifies the provided code for the provided user. Increments the number of tries of that specific users.

    Parameters

    • userid: string
    • code: string

    Returns Promise<string>

    the result of the operation as a string, based on the result of the call to one of the manager's options' methods.

    Memberof

    VerificationManager

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/api-docs/enums/UserStatus.html b/docs/api-docs/enums/UserStatus.html index 8a84e7b..2aa0efd 100644 --- a/docs/api-docs/enums/UserStatus.html +++ b/docs/api-docs/enums/UserStatus.html @@ -1,6 +1,6 @@ UserStatus | @hunteroi/discord-verification

The different user statuses (either pending or active).

-

Export

Enumeration Members

Export

Enumeration Members

Enumeration Members

active: 1

The user is verified and active.

-
pending: 0

The user verification is pending.

-
\ No newline at end of file +
pending: 0

The user verification is pending.

+
\ No newline at end of file diff --git a/docs/api-docs/enums/VerificationManagerEvents.html b/docs/api-docs/enums/VerificationManagerEvents.html index ea4b368..4dabb27 100644 --- a/docs/api-docs/enums/VerificationManagerEvents.html +++ b/docs/api-docs/enums/VerificationManagerEvents.html @@ -1,8 +1,8 @@ VerificationManagerEvents | @hunteroi/discord-verification

Enumeration VerificationManagerEvents

The events emitted by the VerificationManager on specific actions.

-

Export

Enumeration Members

Export

Enumeration Members

codeCreate: "codeCreate"
codeVerify: "codeVerify"
error: "error"
userActive: "userActive"
userAwait: "userAwait"
userCreate: "userCreate"
\ No newline at end of file +

Enumeration Members

codeCreate: "codeCreate"
codeVerify: "codeVerify"
error: "error"
userActive: "userActive"
userAwait: "userAwait"
userCreate: "userCreate"
\ No newline at end of file diff --git a/docs/api-docs/interfaces/ISenderAPI.html b/docs/api-docs/interfaces/ISenderAPI.html index 486fb69..eb83c53 100644 --- a/docs/api-docs/interfaces/ISenderAPI.html +++ b/docs/api-docs/interfaces/ISenderAPI.html @@ -1,6 +1,6 @@ ISenderAPI | @hunteroi/discord-verification

The contract of a sender service.

Export

ISenderAPI

-
interface ISenderAPI {
    send(data): Promise<void>;
}

Methods

interface ISenderAPI {
    send(data): Promise<void>;
}

Methods

Methods

\ No newline at end of file +
\ No newline at end of file diff --git a/docs/api-docs/interfaces/IStoringSystem.html b/docs/api-docs/interfaces/IStoringSystem.html index f49b0e9..2f5200f 100644 --- a/docs/api-docs/interfaces/IStoringSystem.html +++ b/docs/api-docs/interfaces/IStoringSystem.html @@ -1,14 +1,14 @@ IStoringSystem | @hunteroi/discord-verification

Interface IStoringSystem<TUser>

The contract of a storing service.

Export

IStoringSystem

-
interface IStoringSystem<TUser> {
    read(userid): Promise<undefined | null | TUser>;
    readBy(filters): Promise<undefined | null | TUser>;
    readBy(callback): Promise<undefined | null | TUser>;
    readBy(argument): Promise<undefined | null | TUser>;
    write(user): Promise<void>;
}

Type Parameters

Methods

interface IStoringSystem<TUser> {
    read(userid): Promise<undefined | null | TUser>;
    readBy(filters): Promise<undefined | null | TUser>;
    readBy(callback): Promise<undefined | null | TUser>;
    readBy(argument): Promise<undefined | null | TUser>;
    write(user): Promise<void>;
}

Type Parameters

Methods

Methods

  • Reads the storing system to get the user based on its unique identifier.

    Parameters

    • userid: string

    Returns Promise<undefined | null | TUser>

    the user or nothing

    Memberof

    IStoringSystem

    -
  • Reads the storing system to get the user based on filters.

    Parameters

    • filters: Map<string, any>

    Returns Promise<undefined | null | TUser>

    the user or nothing

    Memberof

    IStoringSystem

    -
  • Parameters

    • callback: ((user, index) => boolean)
        • (user, index): boolean
        • Parameters

          • user: TUser
          • index: string | number

          Returns boolean

    Returns Promise<undefined | null | TUser>

  • Parameters

    • argument: Map<string, any> | ((user, index) => boolean)

    Returns Promise<undefined | null | TUser>

  • Writes a user into the storing system.

    +
  • Parameters

    • callback: ((user, index) => boolean)
        • (user, index): boolean
        • Parameters

          • user: TUser
          • index: string | number

          Returns boolean

    Returns Promise<undefined | null | TUser>

  • Parameters

    • argument: Map<string, any> | ((user, index) => boolean)

    Returns Promise<undefined | null | TUser>

  • Writes a user into the storing system.

    Parameters

    Returns Promise<void>

    Memberof

    IStoringSystem

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/api-docs/interfaces/IUser.html b/docs/api-docs/interfaces/IUser.html index b85a6a9..a4777d8 100644 --- a/docs/api-docs/interfaces/IUser.html +++ b/docs/api-docs/interfaces/IUser.html @@ -1,6 +1,6 @@ IUser | @hunteroi/discord-verification

Represents a user.

Export

IUser

-
interface IUser {
    activatedCode?: null | string;
    activationTimestamp?: number;
    code: null | string;
    data: any;
    nbCodeCalled: number;
    nbVerifyCalled: number;
    status: UserStatus;
    userid: string;
    username: string;
}

Properties

interface IUser {
    activatedCode?: null | string;
    activationTimestamp?: number;
    code: null | string;
    data: any;
    nbCodeCalled: number;
    nbVerifyCalled: number;
    status: UserStatus;
    userid: string;
    username: string;
}

Properties

Properties

activatedCode?: null | string

The used code that verified the user.

Memberof

IUser

-
activationTimestamp?: number

The timestamp marking the activation of the user.

+
activationTimestamp?: number

The timestamp marking the activation of the user.

Memberof

IUser

-
code: null | string

The generated code to verify that user.

+
code: null | string

The generated code to verify that user.

Memberof

IUser

-
data: any

The data used to send the code. Could be an email, a phone number or any +

data: any

The data used to send the code. Could be an email, a phone number or any complex information. Type should match what is expected from the sender API.

Memberof

IUser

-
nbCodeCalled: number

The number of times the generation of a code for that user is initiated.

+
nbCodeCalled: number

The number of times the generation of a code for that user is initiated.

Memberof

IUser

-
nbVerifyCalled: number

The number of times the verification of a code for that user is initiated.

+
nbVerifyCalled: number

The number of times the verification of a code for that user is initiated.

Memberof

IUser

-
status: UserStatus

The status of the user.

+
status: UserStatus

The status of the user.

Memberof

IUser

-
userid: string

The user Discord ID.

+
userid: string

The user Discord ID.

Memberof

IUser

-
username: string

The user name.

+
username: string

The user name.

Memberof

IUser

-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/api-docs/interfaces/SenderAPIData.html b/docs/api-docs/interfaces/SenderAPIData.html index 255062c..a696473 100644 --- a/docs/api-docs/interfaces/SenderAPIData.html +++ b/docs/api-docs/interfaces/SenderAPIData.html @@ -1,5 +1,5 @@ -SenderAPIData | @hunteroi/discord-verification
interface SenderAPIData {
    code: string;
    name: string;
    [prop: string]: any;
}

Indexable

[prop: string]: any

Properties

code +SenderAPIData | @hunteroi/discord-verification
interface SenderAPIData {
    code: string;
    name: string;
    [prop: string]: any;
}

Indexable

[prop: string]: any

Properties

Properties

code: string

The code to send.

-
name: string

The user name for message customization.

-
\ No newline at end of file +
name: string

The user name for message customization.

+
\ No newline at end of file diff --git a/docs/api-docs/interfaces/VerificationOptions.html b/docs/api-docs/interfaces/VerificationOptions.html index ee377e5..4334a34 100644 --- a/docs/api-docs/interfaces/VerificationOptions.html +++ b/docs/api-docs/interfaces/VerificationOptions.html @@ -1,6 +1,6 @@ VerificationOptions | @hunteroi/discord-verification

Interface VerificationOptions<TUser>

The VerificationManager options.

Export

VerificationOptions

-
interface VerificationOptions<TUser> {
    codeGenerationOptions: {
        charactersWhitelist?: string;
        length: number;
    };
    maxNbCodeCalledBeforeResend: number;
    alreadyActiveMessage(user): string;
    alreadyPendingMessage(user): string;
    errorMessage(user, error): string;
    invalidCodeMessage(user, invalidCode): string;
    pendingMessage(user): string;
    validCodeMessage(user, validCode): string;
}

Type Parameters

Properties

interface VerificationOptions<TUser> {
    codeGenerationOptions: {
        charactersWhitelist?: string;
        length: number;
    };
    maxNbCodeCalledBeforeResend: number;
    alreadyActiveMessage(user): string;
    alreadyPendingMessage(user): string;
    errorMessage(user, error): string;
    invalidCodeMessage(user, invalidCode): string;
    pendingMessage(user): string;
    validCodeMessage(user, validCode): string;
}

Type Parameters

Properties

Methods

Type declaration

  • Optional charactersWhitelist?: string

    The whitelist of characters used to generate the code.

  • length: number

    The required length of the code.

Memberof

VerificationOptions

-
maxNbCodeCalledBeforeResend: number

The maximum number of calls before resending the code to the user via the communication service.

+
maxNbCodeCalledBeforeResend: number

The maximum number of calls before resending the code to the user via the communication service.

Memberof

VerificationOptions

-

Methods

  • Formats the message sent once the user tries to generate a code when they are already verified.

    +

Methods

  • Formats the message sent once the user tries to generate a code when they are already verified.

    Parameters

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent once the user tries to generate a code when it's already sent to them.

    +
  • Formats the message sent once the user tries to generate a code when it's already sent to them.

    Parameters

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent when calling the communication service throws an error.

    +
  • Formats the message sent when calling the communication service throws an error.

    Parameters

    • user: TUser
    • error: unknown

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent once the code is checked and invalid.

    Parameters

    • user: undefined | null | TUser
    • invalidCode: string

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent for the first time when the user's code has just been sent.

    +
  • Formats the message sent for the first time when the user's code has just been sent.

    Parameters

    Returns string

    the message

    Memberof

    VerificationOptions

    -
  • Formats the message sent once the code is checked and valid.

    Parameters

    • user: undefined | null | TUser
    • validCode: string

    Returns string

    the message

    Memberof

    VerificationOptions

    -
\ No newline at end of file +
\ No newline at end of file diff --git a/examples/index.js b/examples/index.ts similarity index 80% rename from examples/index.js rename to examples/index.ts index edf115e..e99ef39 100644 --- a/examples/index.js +++ b/examples/index.ts @@ -1,13 +1,10 @@ -const { Client, IntentsBitField, SlashCommandBuilder } = require('discord.js'); -const synchronizeSlashCommands = require('discord-sync-commands'); -const { join } = require('path'); +import { join } from 'node:path'; +import synchronizeSlashCommands from 'discord-sync-commands'; +import { Client, IntentsBitField, SlashCommandBuilder } from 'discord.js'; -const { - VerificationManager, - VerificationManagerEvents -} = require('../lib'); -const { JSONDatabaseService } = require('../lib/services/JSONDatabaseService'); -const { SendGridService } = require('../lib/services/SendGridService'); +import { VerificationManager, VerificationManagerEvents } from '../lib/index.js'; +import { JSONDatabaseService } from '../lib/services/JSONDatabaseService.js'; +import { SendGridService } from '../lib/services/SendGridService.js'; const client = new Client({ intents: [ @@ -55,15 +52,19 @@ const sgMail = new SendGridService({ const manager = new VerificationManager(client, db, sgMail, { - errorMessage: (user, error) => `Could not send the code to ${user.data.to} because of the following error: ${error.message}!`, + codeGenerationOptions: { + length: 6, + }, + maxNbCodeCalledBeforeResend: 3, + errorMessage: (user, error: Error) => `Could not send the code to ${user.data.to} because of the following error: ${error.message}!`, pendingMessage: (user) => `The verification code has just been sent to ${user.data.to}.`, alreadyPendingMessage: (user) => `You already have a verification code pending! It was sent to ${user.data.to}.`, alreadyActiveMessage: (user) => - `An account is already verified with this data!`, + "An account is already verified with this data!", validCodeMessage: (user, validCode) => - `Your code ${validCode} is valid! Welcome ${user.username}!`, + `Your code ${validCode} is valid! Welcome ${user?.username}!`, invalidCodeMessage: (user, invalidCode) => `Your code ${invalidCode} is invalid!`, }); @@ -73,7 +74,7 @@ client.once('ready', () => { }); client.on('interactionCreate', async (interaction) => { - if (interaction.isCommand()) { + if (interaction.isChatInputCommand()) { await interaction.deferReply({ ephemeral: true }); let feedback = 'Unknown command!'; diff --git a/package.json b/package.json index 7a5440c..b88b31d 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "@types/node-json-db": "^0.9.3", "@types/sqlite3": "^3.1.11", "discord-sync-commands": "^0.3.0", - "discord.js": "^14.14.1", + "discord.js": "^14.15.3", "node-json-db": "^2.3.0", "typedoc": "^0.25.13", "typescript": "^5.4.4" @@ -45,8 +45,8 @@ "build:docs": "typedoc", "lint": "biome check --apply ./src", "prepublish": "yarn lint && yarn build && yarn build:docs", - "start": "yarn build & node ./examples/index.js" + "start": "yarn build && tsc ./examples/index.ts --target esnext --module nodenext --moduleResolution nodenext && node ./examples/index.js" }, "type": "module", - "version": "1.4.2" -} \ No newline at end of file + "version": "1.5.0" +} diff --git a/src/VerificationManager.ts b/src/VerificationManager.ts index 5b2d9fc..735d58b 100644 --- a/src/VerificationManager.ts +++ b/src/VerificationManager.ts @@ -1,15 +1,15 @@ import EventEmitter from "node:events"; import type { Client, Snowflake } from "discord.js"; -import { VerificationManagerEvents } from "./VerificationManagerEvents"; -import { CodeGeneratorService } from "./services/CodeGeneratorService"; +import { VerificationManagerEvents } from "./VerificationManagerEvents.js"; +import { CodeGeneratorService } from "./services/CodeGeneratorService.js"; import { type ISenderAPI, type IStoringSystem, type IUser, UserStatus, type VerificationOptions, -} from "./types"; +} from "./types/index.js"; /** * The manager handling verification (generating, sending and verifying the user's code). diff --git a/src/index.ts b/src/index.ts index 567aefa..3bda2c1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ -export * from "./types"; -export * from "./VerificationManager"; -export * from "./VerificationManagerEvents"; +export * from "./types/index.js"; +export * from "./VerificationManager.js"; +export * from "./VerificationManagerEvents.js"; diff --git a/src/services/JSONDatabaseService.ts b/src/services/JSONDatabaseService.ts index c1f4aec..9904c53 100644 --- a/src/services/JSONDatabaseService.ts +++ b/src/services/JSONDatabaseService.ts @@ -1,7 +1,7 @@ import type { Snowflake } from "discord.js"; import { Config, JsonDB } from "node-json-db"; -import type { IStoringSystem, IUser } from "../types"; +import type { IStoringSystem, IUser } from "../types/index.js"; export type UserModel = IUser; diff --git a/src/services/SendGridService.ts b/src/services/SendGridService.ts index c6d1334..366d18f 100644 --- a/src/services/SendGridService.ts +++ b/src/services/SendGridService.ts @@ -1,6 +1,6 @@ import { type MailDataRequired, MailService } from "@sendgrid/mail"; -import type { ISenderAPI, SenderAPIData } from "../types"; +import type { ISenderAPI, SenderAPIData } from "../types/index.js"; export type SendGridMailData = MailDataRequired; export interface SendGridOptions { diff --git a/src/types/IUser.ts b/src/types/IUser.ts index 3cf3262..577c190 100644 --- a/src/types/IUser.ts +++ b/src/types/IUser.ts @@ -1,6 +1,6 @@ import type { Snowflake } from "discord.js"; -import type { UserStatus } from "."; +import type { UserStatus } from "./UserStatus.js"; /** * Represents a user. diff --git a/src/types/StoringSystem.ts b/src/types/StoringSystem.ts index 5f09eed..6899685 100644 --- a/src/types/StoringSystem.ts +++ b/src/types/StoringSystem.ts @@ -1,6 +1,6 @@ import type { Snowflake } from "discord.js"; -import type { IUser } from "."; +import type { IUser } from "./IUser.js"; /** * The contract of a storing service. diff --git a/src/types/VerificationOptions.ts b/src/types/VerificationOptions.ts index ef543e1..33a095d 100644 --- a/src/types/VerificationOptions.ts +++ b/src/types/VerificationOptions.ts @@ -1,4 +1,4 @@ -import type { IUser } from "."; +import type { IUser } from "./IUser.js"; /** * The {@link VerificationManager} options. diff --git a/src/types/index.ts b/src/types/index.ts index 00d6ac9..441692f 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,6 +1,5 @@ -export * from "./SenderAPI"; -export * from "./StoringSystem"; -export * from "./IUser"; -export * from "./IUser"; -export * from "./UserStatus"; -export * from "./VerificationOptions"; +export * from "./SenderAPI.js"; +export * from "./StoringSystem.js"; +export * from "./IUser.js"; +export * from "./UserStatus.js"; +export * from "./VerificationOptions.js"; diff --git a/tsconfig.json b/tsconfig.json index 72e9a86..a1907d8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,13 +3,14 @@ "baseUrl": "./src", "declaration": true, "esModuleInterop": true, - "module": "commonjs", "outDir": "./lib", "resolveJsonModule": true, "skipLibCheck": true, "strict": true, "strictNullChecks": true, - "target": "es6" + "target": "ESNext", + "module": "NodeNext", + "moduleResolution": "NodeNext" }, "exclude": [ "lib/*", diff --git a/typedoc.config.js b/typedoc.config.js index c10a666..defa071 100644 --- a/typedoc.config.js +++ b/typedoc.config.js @@ -1,11 +1,11 @@ /** @type {import('typedoc').TypeDocOptions} */ export default { - "entryPoints": ["src/index.ts"], - "out": "docs/api-docs", - "hideGenerator": true, - "excludePrivate": true, - "excludeExternals": true, - "navigationLinks": { - "GitHub": "https://github.com/hunteroi/discord-verification" + entryPoints: ["src/index.ts"], + out: "docs/api-docs", + hideGenerator: true, + excludePrivate: true, + excludeExternals: true, + navigationLinks: { + GitHub: "https://github.com/hunteroi/discord-verification" } } diff --git a/yarn.lock b/yarn.lock index 912127b..319c7c1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -67,17 +67,17 @@ ts-mixer "^6.0.0" tslib "^2.3.0" -"@discordjs/builders@^1.7.0": - version "1.7.0" - resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.7.0.tgz#e2478c7e55b0f4c40837edb8f102bce977323a37" - integrity sha512-GDtbKMkg433cOZur8Dv6c25EHxduNIBsxeHrsRoIM8+AwmEZ8r0tEpckx/sHwTLwQPOF3e2JWloZh9ofCaMfAw== - dependencies: - "@discordjs/formatters" "^0.3.3" - "@discordjs/util" "^1.0.2" - "@sapphire/shapeshift" "^3.9.3" - discord-api-types "0.37.61" +"@discordjs/builders@^1.8.2": + version "1.8.2" + resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.8.2.tgz#535d970331ee40f20dec9ef8079e43092f323ce9" + integrity sha512-6wvG3QaCjtMu0xnle4SoOIeFB4y6fKMN6WZfy3BMKJdQQtPLik8KGzDwBVL/+wTtcE/ZlFjgEk74GublyEVZ7g== + dependencies: + "@discordjs/formatters" "^0.4.0" + "@discordjs/util" "^1.1.0" + "@sapphire/shapeshift" "^3.9.7" + discord-api-types "0.37.83" fast-deep-equal "^3.1.3" - ts-mixer "^6.0.3" + ts-mixer "^6.0.4" tslib "^2.6.2" "@discordjs/collection@1.5.3": @@ -90,10 +90,10 @@ resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-0.2.4.tgz#c8ff2250430dcec7324dd4aafd1ccbcbdfa9ac14" integrity sha512-PVrEJH+V6Ob0OwfagYQ/57kwt/HNEJxt5jqY4P+S3st9y29t9iokdnGMQoJXG5VEMAQIPbzu9Snw1F6yE8PdLA== -"@discordjs/collection@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-2.0.0.tgz#409b80c74eb8486cc4ee6a9b83426aaff1380f8c" - integrity sha512-YTWIXLrf5FsrLMycpMM9Q6vnZoR/lN2AWX23/Cuo8uOOtS8eHB2dyQaaGnaF8aZPYnttf2bkLMcXn/j6JUOi3w== +"@discordjs/collection@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@discordjs/collection/-/collection-2.1.0.tgz#f327d944ab2dcf9a1f674470a481f78a120a5e3b" + integrity sha512-mLcTACtXUuVgutoznkh6hS3UFqYirDYAg5Dc1m8xn6OvPjetnUlf/xjtqnnc47OwWdaoCQnHmHh9KofhD6uRqw== "@discordjs/form-data@^3.0.1": version "3.0.1" @@ -104,59 +104,59 @@ combined-stream "^1.0.8" mime-types "^2.1.12" -"@discordjs/formatters@^0.3.3": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@discordjs/formatters/-/formatters-0.3.3.tgz#b16fdd79bb819680ab7e519193004e9dc124a749" - integrity sha512-wTcI1Q5cps1eSGhl6+6AzzZkBBlVrBdc9IUhJbijRgVjCNIIIZPgqnUj3ntFODsHrdbGU8BEG9XmDQmgEEYn3w== - dependencies: - discord-api-types "0.37.61" - -"@discordjs/rest@^2.1.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-2.2.0.tgz#f4ec00d3faff965c00a879b7e87bb4b6f4446966" - integrity sha512-nXm9wT8oqrYFRMEqTXQx9DUTeEtXUDMmnUKIhZn6O2EeDY9VCdwj23XCPq7fkqMPKdF7ldAfeVKyxxFdbZl59A== - dependencies: - "@discordjs/collection" "^2.0.0" - "@discordjs/util" "^1.0.2" - "@sapphire/async-queue" "^1.5.0" - "@sapphire/snowflake" "^3.5.1" - "@vladfrangu/async_event_emitter" "^2.2.2" - discord-api-types "0.37.61" - magic-bytes.js "^1.5.0" +"@discordjs/formatters@^0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@discordjs/formatters/-/formatters-0.4.0.tgz#066a2c2163b26ac066e6f621f17445be9690c6a9" + integrity sha512-fJ06TLC1NiruF35470q3Nr1bi95BdvKFAF+T5bNfZJ4bNdqZ3VZ+Ttg6SThqTxm6qumSG3choxLBHMC69WXNXQ== + dependencies: + discord-api-types "0.37.83" + +"@discordjs/rest@^2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@discordjs/rest/-/rest-2.3.0.tgz#06d37c7fb54a9be61134b5bbb201abd760343472" + integrity sha512-C1kAJK8aSYRv3ZwMG8cvrrW4GN0g5eMdP8AuN8ODH5DyOCbHgJspze1my3xHOAgwLJdKUbWNVyAeJ9cEdduqIg== + dependencies: + "@discordjs/collection" "^2.1.0" + "@discordjs/util" "^1.1.0" + "@sapphire/async-queue" "^1.5.2" + "@sapphire/snowflake" "^3.5.3" + "@vladfrangu/async_event_emitter" "^2.2.4" + discord-api-types "0.37.83" + magic-bytes.js "^1.10.0" tslib "^2.6.2" - undici "5.27.2" + undici "6.13.0" -"@discordjs/util@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@discordjs/util/-/util-1.0.2.tgz#dc1896d764452b1bd9707eb9aa99ccfbb30bd1c0" - integrity sha512-IRNbimrmfb75GMNEjyznqM1tkI7HrZOf14njX7tCAAUetyZM1Pr8hX/EK2lxBCOgWDRmigbp24fD1hdMfQK5lw== +"@discordjs/util@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@discordjs/util/-/util-1.1.0.tgz#dcffd2b61aab8eadd66bea67811bc34fc769bb2a" + integrity sha512-IndcI5hzlNZ7GS96RV3Xw1R2kaDuXEp7tRIy/KlhidpN/BQ1qh1NZt3377dMLTa44xDUNKT7hnXkA/oUAzD/lg== -"@discordjs/ws@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@discordjs/ws/-/ws-1.0.2.tgz#3933b12d4686aabf6a95dfe5fb6e744342a661d1" - integrity sha512-+XI82Rm2hKnFwAySXEep4A7Kfoowt6weO6381jgW+wVdTpMS/56qCvoXyFRY0slcv7c/U8My2PwIB2/wEaAh7Q== - dependencies: - "@discordjs/collection" "^2.0.0" - "@discordjs/rest" "^2.1.0" - "@discordjs/util" "^1.0.2" - "@sapphire/async-queue" "^1.5.0" - "@types/ws" "^8.5.9" - "@vladfrangu/async_event_emitter" "^2.2.2" - discord-api-types "0.37.61" +"@discordjs/ws@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@discordjs/ws/-/ws-1.1.1.tgz#bffbfd46838258ab09054ed98ddef1a36f6507a3" + integrity sha512-PZ+vLpxGCRtmr2RMkqh8Zp+BenUaJqlS6xhgWKEZcgC/vfHLEzpHtKkB0sl3nZWpwtcKk6YWy+pU3okL2I97FA== + dependencies: + "@discordjs/collection" "^2.1.0" + "@discordjs/rest" "^2.3.0" + "@discordjs/util" "^1.1.0" + "@sapphire/async-queue" "^1.5.2" + "@types/ws" "^8.5.10" + "@vladfrangu/async_event_emitter" "^2.2.4" + discord-api-types "0.37.83" tslib "^2.6.2" - ws "^8.14.2" - -"@fastify/busboy@^2.0.0": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" - integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== + ws "^8.16.0" -"@sapphire/async-queue@^1.1.4", "@sapphire/async-queue@^1.5.0": +"@sapphire/async-queue@^1.1.4": version "1.5.0" resolved "https://registry.yarnpkg.com/@sapphire/async-queue/-/async-queue-1.5.0.tgz#2f255a3f186635c4fb5a2381e375d3dfbc5312d8" integrity sha512-JkLdIsP8fPAdh9ZZjrbHWR/+mZj0wvKS5ICibcLrRI1j84UmLMshx5n9QmL8b95d4onJ2xxiyugTgSAX7AalmA== -"@sapphire/shapeshift@^3.9.3": +"@sapphire/async-queue@^1.5.2": + version "1.5.2" + resolved "https://registry.yarnpkg.com/@sapphire/async-queue/-/async-queue-1.5.2.tgz#2982dce16e5b8b1ea792604d20c23c0585877b97" + integrity sha512-7X7FFAA4DngXUl95+hYbUF19bp1LGiffjJtu7ygrZrbdCSsdDDBaSjB7Akw0ZbOu6k0xpXyljnJ6/RZUvLfRdg== + +"@sapphire/shapeshift@^3.9.7": version "3.9.7" resolved "https://registry.yarnpkg.com/@sapphire/shapeshift/-/shapeshift-3.9.7.tgz#43e23243cac8a0c046bf1e73baf3dbf407d33a0c" integrity sha512-4It2mxPSr4OGn4HSQWGmhFMsNFGfFVhWeRPCRwbH972Ek2pzfGRZtb0pJ4Ze6oIzcyh2jw7nUDa6qGlWofgd9g== @@ -164,12 +164,7 @@ fast-deep-equal "^3.1.3" lodash "^4.17.21" -"@sapphire/snowflake@3.5.1": - version "3.5.1" - resolved "https://registry.yarnpkg.com/@sapphire/snowflake/-/snowflake-3.5.1.tgz#254521c188b49e8b2d4cc048b475fb2b38737fec" - integrity sha512-BxcYGzgEsdlG0dKAyOm0ehLGm2CafIrfQTZGWgkfKYbj+pNNsorZ7EotuZukc2MT70E0UbppVbtpBrqpzVzjNA== - -"@sapphire/snowflake@^3.5.1": +"@sapphire/snowflake@3.5.3", "@sapphire/snowflake@^3.5.3": version "3.5.3" resolved "https://registry.yarnpkg.com/@sapphire/snowflake/-/snowflake-3.5.3.tgz#0c102aa2ec5b34f806e9bc8625fc6a5e1d0a0c6a" integrity sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ== @@ -228,13 +223,6 @@ dependencies: "@types/node" "*" -"@types/ws@8.5.9": - version "8.5.9" - resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.9.tgz#384c489f99c83225a53f01ebc3eddf3b8e202a8c" - integrity sha512-jbdrY0a8lxfdTp/+r7Z4CkycbOFN8WX+IOchLJr3juT/xzbJ8URyTVSJ/hvNdadTgM1mnedb47n+Y31GsFnQlg== - dependencies: - "@types/node" "*" - "@types/ws@^7.4.7": version "7.4.7" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-7.4.7.tgz#f7c390a36f7a0679aa69de2d501319f4f8d9b702" @@ -242,14 +230,14 @@ dependencies: "@types/node" "*" -"@types/ws@^8.5.9": +"@types/ws@^8.5.10": version "8.5.10" resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.5.10.tgz#4acfb517970853fa6574a3a6886791d04a396787" integrity sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A== dependencies: "@types/node" "*" -"@vladfrangu/async_event_emitter@^2.2.2": +"@vladfrangu/async_event_emitter@^2.2.4": version "2.2.4" resolved "https://registry.yarnpkg.com/@vladfrangu/async_event_emitter/-/async_event_emitter-2.2.4.tgz#d3537432c6db6444680a596271dff8ea407343b3" integrity sha512-ButUPz9E9cXMLgvAW8aLAKKJJsPu1dY1/l/E8xzLFuysowXygs6GBcyunK9rnGC4zTsnIc2mQo71rGw9U+Ykug== @@ -312,10 +300,10 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== -discord-api-types@0.37.61: - version "0.37.61" - resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.61.tgz#9dd8e58c624237e6f1b23be2d29579af268b8c5b" - integrity sha512-o/dXNFfhBpYHpQFdT6FWzeO7pKc838QeeZ9d91CfVAtpr5XLK4B/zYxQbYgPdoMiTDvJfzcsLW5naXgmHGDNXw== +discord-api-types@0.37.83: + version "0.37.83" + resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.37.83.tgz#a22a799729ceded8176ea747157837ddf4708b1f" + integrity sha512-urGGYeWtWNYMKnYlZnOnDHm8fVRffQs3U0SpE8RHeiuLKb/u92APS8HoQnPTFbnXmY1vVnXjXO4dOxcAn3J+DA== discord-api-types@^0.22.0: version "0.22.0" @@ -329,25 +317,23 @@ discord-sync-commands@^0.3.0: dependencies: discord.js discordjs/discord.js#refs/pull/6414/head -discord.js@^14.14.1: - version "14.14.1" - resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.14.1.tgz#9a2bea23bba13819705ab87612837610abce9ee3" - integrity sha512-/hUVzkIerxKHyRKopJy5xejp4MYKDPTszAnpYxzVVv4qJYf+Tkt+jnT2N29PIPschicaEEpXwF2ARrTYHYwQ5w== +discord.js@^14.15.3: + version "14.15.3" + resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.15.3.tgz#b2a67a1a4ef192be498fb8b6784224a42906f1be" + integrity sha512-/UJDQO10VuU6wQPglA4kz2bw2ngeeSbogiIPx/TsnctfzV/tNf+q+i1HlgtX1OGpeOBpJH9erZQNO5oRM2uAtQ== dependencies: - "@discordjs/builders" "^1.7.0" + "@discordjs/builders" "^1.8.2" "@discordjs/collection" "1.5.3" - "@discordjs/formatters" "^0.3.3" - "@discordjs/rest" "^2.1.0" - "@discordjs/util" "^1.0.2" - "@discordjs/ws" "^1.0.2" - "@sapphire/snowflake" "3.5.1" - "@types/ws" "8.5.9" - discord-api-types "0.37.61" + "@discordjs/formatters" "^0.4.0" + "@discordjs/rest" "^2.3.0" + "@discordjs/util" "^1.1.0" + "@discordjs/ws" "^1.1.1" + "@sapphire/snowflake" "3.5.3" + discord-api-types "0.37.83" fast-deep-equal "3.1.3" lodash.snakecase "4.1.1" tslib "2.6.2" - undici "5.27.2" - ws "8.14.2" + undici "6.13.0" discord.js@discordjs/discord.js#refs/pull/6414/head: version "13.2.0-dev" @@ -418,7 +404,7 @@ lunr@^2.3.9: resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.9.tgz#18b123142832337dd6e964df1a5a7707b25d35e1" integrity sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow== -magic-bytes.js@^1.5.0: +magic-bytes.js@^1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/magic-bytes.js/-/magic-bytes.js-1.10.0.tgz#c41cf4bc2f802992b05e64962411c9dd44fdef92" integrity sha512-/k20Lg2q8LE5xiaaSkMXk4sfvI+9EGEykFS4b0CHHGWqDYU0bGUFSwchNOMA56D7TCs9GwVTkqe9als1/ns8UQ== @@ -511,10 +497,10 @@ ts-mixer@^6.0.0: resolved "https://registry.yarnpkg.com/ts-mixer/-/ts-mixer-6.0.2.tgz#3e4e4bb8daffb24435f6980b15204cb5b287e016" integrity sha512-zvHx3VM83m2WYCE8XL99uaM7mFwYSkjR2OZti98fabHrwkjsCvgwChda5xctein3xGOyaQhtTeDq/1H/GNvF3A== -ts-mixer@^6.0.3: - version "6.0.3" - resolved "https://registry.yarnpkg.com/ts-mixer/-/ts-mixer-6.0.3.tgz#69bd50f406ff39daa369885b16c77a6194c7cae6" - integrity sha512-k43M7uCG1AkTyxgnmI5MPwKoUvS/bRvLvUb7+Pgpdlmok8AoqmUaZxUUw8zKM5B1lqZrt41GjYgnvAi0fppqgQ== +ts-mixer@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/ts-mixer/-/ts-mixer-6.0.4.tgz#1da39ceabc09d947a82140d9f09db0f84919ca28" + integrity sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA== tslib@2.6.2, tslib@^2.6.2: version "2.6.2" @@ -551,12 +537,10 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -undici@5.27.2: - version "5.27.2" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.27.2.tgz#a270c563aea5b46cc0df2550523638c95c5d4411" - integrity sha512-iS857PdOEy/y3wlM3yRp+6SNQQ6xU0mmZcwRSriqk+et/cwWAtwmIGf6WkoDN2EK/AMdCO/dfXzIwi+rFMrjjQ== - dependencies: - "@fastify/busboy" "^2.0.0" +undici@6.13.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-6.13.0.tgz#7edbf4b7f3aac5f8a681d515151bf55cb3589d72" + integrity sha512-Q2rtqmZWrbP8nePMq7mOJIN98M0fYvSgV89vwl/BQRT4mDOeY2GXZngfGpcBBhtky3woM7G24wZV3Q304Bv6cw== vali-date@^1.0.0: version "1.0.0" @@ -586,17 +570,12 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -ws@8.14.2: - version "8.14.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" - integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g== - ws@^7.5.1: version "7.5.9" resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== -ws@^8.14.2: - version "8.16.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4" - integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ== +ws@^8.16.0: + version "8.17.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" + integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== From 02f82453434a7ed5aabc8ef53c2dfe57035b6d39 Mon Sep 17 00:00:00 2001 From: HunteRoi Date: Thu, 20 Jun 2024 04:14:01 +0200 Subject: [PATCH 4/4] fix(example): __dirname is not ECM compliant, valid synchronizeSlashCommand's options, anonymize email --- examples/index.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/examples/index.ts b/examples/index.ts index e99ef39..d069c47 100644 --- a/examples/index.ts +++ b/examples/index.ts @@ -6,6 +6,10 @@ import { VerificationManager, VerificationManagerEvents } from '../lib/index.js' import { JSONDatabaseService } from '../lib/services/JSONDatabaseService.js'; import { SendGridService } from '../lib/services/SendGridService.js'; +function anonymizeEmail(email: string) { + return email.slice(0, 2) + '\\*'.repeat(email.slice(3, email.indexOf('@')).length) + email.slice(email.indexOf('@')); +} + const client = new Client({ intents: [ IntentsBitField.Flags.Guilds, @@ -36,10 +40,10 @@ synchronizeSlashCommands( .setRequired(true) ), ], - { guild: 'GUILD_ID' } + { guildId: 'GUILD_ID' } ); -const db = new JSONDatabaseService(join(__dirname, 'db.json')); +const db = new JSONDatabaseService(join(import.meta.dirname, 'db.json')); db.init(); const sgMail = new SendGridService({ @@ -56,11 +60,11 @@ const manager = new VerificationManager(client, db, sgMail, length: 6, }, maxNbCodeCalledBeforeResend: 3, - errorMessage: (user, error: Error) => `Could not send the code to ${user.data.to} because of the following error: ${error.message}!`, + errorMessage: (user, error: Error) => `Could not send the code to ${anonymizeEmail(user.data.to)} because of the following error: ${error.message}!`, pendingMessage: (user) => - `The verification code has just been sent to ${user.data.to}.`, + `The verification code has just been sent to ${anonymizeEmail(user.data.to)}.`, alreadyPendingMessage: (user) => - `You already have a verification code pending! It was sent to ${user.data.to}.`, + `You already have a verification code pending! It was sent to ${anonymizeEmail(user.data.to)}.`, alreadyActiveMessage: (user) => "An account is already verified with this data!", validCodeMessage: (user, validCode) =>