Commit Graph

4871 Commits

Author SHA1 Message Date
ITOH
7c031df875 refactor(rest)!: remove falsy token check (#2949)
* refactor(rest): remove falsy token check
This is in favour for interaction only bots, which still need rest but cannot provide a valid bot token.
If you want to use rest for your normal bot it should be your own responsibility to pass a valid token.

Further more `applicationId` is now a required property since we cannot extract the id from the token anymore.

* forgot to commit that

* fix error

* make appid optional again

* app id throw error if undefined

* fix test
2023-04-02 21:39:08 +02:00
ITOH
5e1e56146e fix: eslint no async error (#2947)
* fix: eslint no async error

* just ignore
2023-04-02 19:47:29 +02:00
ITOH
7c51f731cb refactor(rest): improve unauthorized readability (#2946)
Currently we use a double negation in the code which makes it harder to understand what it actually does.

Therefore the check has been changed to be understood easier.
2023-04-02 16:54:36 +00:00
ITOH
7b5d99e5dd refactor(rest): interaction handling (#2944)
* refactor(rest): interaction handling
Currently some interaction handling uses `sendRequest` directly.
This adds the `runThroughQueue` option, which prevents the request to be handled by a queue effectively giving the same effect as using `sendRequest` directly.
This prevents code repetition and supports future endpoints which might not have a rate limit too.

Further more all interaction related endpoints have now been set to not send the bots authorization header.

* fix invalid file

* fix eslint

* fix: followups have a rate limit

* fix awaiting
2023-04-02 16:27:48 +00:00
ITOH
66869ce00b refactor(utils)!: remove unused files utility (#2945)
Since we have changed how files get send to the rest proxy, we do not need this utility anymore.
2023-04-02 16:21:48 +00:00
ITOH
1cb1b09460 refactor!(rest): rest proxy attachment sending (#2924)
* refactor!(rest): rest proxy attachment sending
Currently attachments get encoded as base64 before being send to the proxy. This is not really necessary, instead we can just send `FormData` to the proxy.

* fix lint
2023-04-02 15:43:08 +00:00
Jonathan Ho
7a69c02d13 feat(site): add back benchmark to site (also change cpu model) (#2939)
* ci: add concurrency for deploy site

* feat(site): add benchmark

* refactor(bench): overwrite old result with new

* Update packages/benchmark/src/generateMessage.ts

Co-authored-by: ITOH <to@itoh.at>

* Update scripts/generateMessage.js

Co-authored-by: ITOH <to@itoh.at>

* Update site.yml

---------

Co-authored-by: ITOH <to@itoh.at>
2023-04-02 15:39:52 +00:00
ITOH
17a52fec1b fix(rest, types)!: support auditlog reason (#2940)
* fix(rest, types)!: support auditlog reason
Improved the consistency by separating the audit log reason to an optional function parameter.
Also added support for 100% documented reason endpoints.

* missing stuff

* fix this

* fix e3e
2023-04-02 15:38:06 +00:00
ITOH
92e25959ef build: update turbo (#2942) 2023-04-02 15:29:15 +00:00
ITOH
7b0964d24a fix(README): dd logo path (#2943) 2023-04-02 15:20:26 +00:00
ITOH
56946047c1 fix(README): dd logo path (#2941) 2023-04-02 15:38:08 +02:00
ITOH
bb5e15d808 trigger tests 2023-04-02 15:30:26 +02:00
Skillz4Killz
dea9d1d152 fix(transformers): message transformer using different style (#2916)
* fix(transformers): message transformer using different style

* fix: more bench tests

* fix(bench): token can not be empty

* more desired props

* fix: bug on message.id props

* fix: transfomrer errors on bench

---------

Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>
2023-04-01 21:26:46 -05:00
Jonathan Ho
782a778a1d ci: add git reset before store benchmark (#2938) 2023-04-02 02:25:01 +00:00
Jonathan Ho
9c7b2b832e Fix(bench): wrong location (#2932)
* Update commentBenchResult.yml

* ci: fix ext

* refactor(bench): better table
2023-04-01 23:27:54 +00:00
ITOH
6359972e38 docs(rest): webhook names cannot contain 'discord' (#2936)
Closes: https://github.com/discordeno/discordeno/issues/2928
2023-04-01 19:18:59 +00:00
ITOH
bcfeb5b6ae feat(bot,types): add Guild.maxStageVideoChannelUsers (#2935)
Closes: https://github.com/discordeno/discordeno/issues/2927
2023-04-01 19:18:26 +00:00
ITOH
6890b34d84 feat(types)!: add guild expression & view monetization permissions (#2934)
Closes: https://github.com/discordeno/discordeno/issues/2926
2023-04-01 19:16:14 +00:00
ITOH
92ba532e6c style: fix helix language formatting 2023-04-01 14:16:59 +02:00
Jonathan Ho
a29e45218d feat(bench): commit benchmark benchies (#2918)
* refactor(bench): better readdir

* Update retryBenchmark.yml

* Update benchmark.yml

* Update benchmark.yml

* Update benchmark.yml

* Update benchmark.yml

* ci: comment the result

* ci: fix missing data
2023-04-01 04:53:35 +00:00
ITOH
05fc3fbeba style: format (#2925) 2023-04-01 02:46:46 +02:00
Skillz
4d3a2f7665 Merge branch 'main' of https://github.com/discordeno/discordeno into main 2023-03-31 18:02:28 -05:00
Skillz
13d59a8274 feat: open api schema generator for typings 2023-03-31 18:02:26 -05:00
ITOH
f6a9d96ab2 feat(types): add ApplicationFlags.ApplicationAutoModerationRuleCreateBadge (#2921)
Closes: https://github.com/discordeno/discordeno/issues/2920
2023-03-31 20:53:09 +00:00
ITOH
6120c79c3c ci: add name to labeler workflow (#2922) 2023-03-31 20:51:19 +00:00
ITOH
f5abd83cc5 fix(bot,rest,types)!: attachment sending (#2917)
* fix(bot,rest,types)!: attachment sending

* apply code suggestions

* forgot to add that

* this should not be there i guess

* maybe spell it right

* actually revert the attachments rename

* Change how method gets passed

* more stuff

* improve function name
2023-03-31 20:50:53 +00:00
Jonathan Ho
18150174ae chore(all): add dev guide (#2919) 2023-03-31 16:11:27 +00:00
Jonathan Ho
aba7de6e3b benchmark test (#2830)
* ci: test

* ci: add script

* ci: change to js

* ci: test

* ci: fix error

* ci: fix script

* chore: add benchmark

* ci: fix need input

* fix: read file with dir

* ci: change push to trigger on main only

* ci: try new method

* ci: fix "true"

* chore: fix set output

* fix: set output

* ci: increase number of try

* chore: clean up dir

* fix needs

* bench: add memory bench

* bench: import memory bench

* bench: fix v19 syntax

* bench: more fix

* bench: add filter

* bench: minor fix

* ci: read file in sync

* chore: yarn install

* chore: add db to ignore

* refactor(bench): use loader

* bench: only bench on one event

* bench: add type to db event

* chore(bench): better type

* bench: add rest simplifyUrl bench

* chore: add microtime

* refactor: add fall back

* Revert "ci: change push to trigger on main only"

This reverts commit 04df971025.

* chore: yarn install

* ci: trigger push event only on main branch

* chore(bench): use node-fetch

* refactor(bench): make it work with other function and event

* chore(bench): better name
2023-03-31 07:57:53 +00:00
dependabot[bot]
2578beaca7 chore(deps): bump json5 from 1.0.1 to 1.0.2 (#2784)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: ITOH <to@itoh.at>
2023-03-31 01:46:46 +00:00
Jonathan Ho
abe8c0fa29 ci: add run e2e test on merge group (#2915) 2023-03-31 01:45:02 +00:00
ITOH
65f60af35e ci: move tests into one single workflow file (#2911)
* try

* remove lint

* ci: run checks for pushes only to the main branch

* fix readme

---------

Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>
2023-03-30 19:36:58 +00:00
ITOH
f41fe4dbb5 ci: add automatic pr labeler (#2912)
* ci: add automatic pr labeler

* ci: add specific pr target types for the labeler
2023-03-30 19:34:38 +00:00
ITOH
678063993a Delete docs directory 2023-03-30 20:58:16 +02:00
ITOH
1093befcad fix(website): move to new url (#2914) 2023-03-30 18:09:02 +00:00
ITOH
84396492a6 fix(website): CNAME (#2913) 2023-03-30 18:08:25 +00:00
ITOH
d757773e95 perf(rest): remove regex check from RestManager.simplifyUrl (#2910)
Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>
2023-03-30 10:05:01 -05:00
ITOH
4fe621ef76 fix(utils): leaky bucket slow refill test (#2907)
* fix(utils): leaky bucket slow refill test

* fix the fix

* remove left comments

* Update packages/utils/tests/bucket.spec.ts

Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>

---------

Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>
2023-03-30 09:54:37 -05:00
ITOH
fdf0d53f9e refactor(rest)!: improve RestManager.createRequest (#2906)
* refactor(rest): simplify `manager.simplifyUrl`
The changes improve readability and performance by a small margin.

* refactor(rest)!: improve `RestManager.createRequest`
- AuditLog Reasons: options.body.reason => options.reason
- options.body can now be FormData

* forgot those

* suggestions

---------

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2023-03-30 09:54:02 -05:00
Skillz4Killz
701d8b6dbb chore: remove client pkg (#2903)
* chore: remove client pkg

* yarn install

* fix: yarn install

---------

Co-authored-by: ITOH <to@itoh.at>
2023-03-30 09:48:19 -05:00
ITOH
7fae8c0315 refactor(rest): simplify manager.simplifyUrl (#2905)
* refactor(rest): simplify `manager.simplifyUrl`
The changes improve readability and performance by a small margin.

* fix tests
2023-03-29 22:35:17 +02:00
ITOH
efcc966adf chore(.github): add leads to CODEOWNERS (#2904)
* chore(.github): add leads to CODEOWNERS

* GitHub Error

* Update CODEOWNERS

* Update .github/CODEOWNERS

* Update .github/CODEOWNERS

* Update CODEOWNERS

* Update .github/CODEOWNERS

Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>

---------

Co-authored-by: meister03 <69507874+meister03@users.noreply.github.com>
Co-authored-by: Jonathan Ho <heiheiho000@gmail.com>
2023-03-29 15:22:22 -05:00
ITOH
cb27cae74b Create CNAME 2023-03-29 20:25:50 +02:00
ITOH
28cbcee61d fix(client): remove 2023-03-29 19:14:20 +02:00
ITOH
69d818cf84 fix(bot): channel transformer managed 2023-03-29 19:08:19 +02:00
ITOH
9d01eff6fd feat(website): move to discordeno.js.org (#2902) 2023-03-29 11:01:28 -05:00
ITOH
bfd1936581 feat(bot,client,types): add role subscriptions (#2899)
Closes: https://github.com/discordeno/discordeno/issues/2859

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2023-03-29 10:49:04 -05:00
ITOH
a715140df6 feat(client,rest,types): add GetAuditLog.after (#2898)
* feat(client,rest,types): add `GetAuditLog.after`

closes: https://github.com/discordeno/discordeno/issues/2860

* Apply suggestions from code review

---------

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2023-03-29 10:46:21 -05:00
ITOH
08fb3fc5b5 feat(client,types): add FormLayout enum (#2900) 2023-03-29 10:45:15 -05:00
ITOH
6d43ca11a7 feat(bot,types): add Channel.managed (#2897)
Closes: https://github.com/discordeno/discordeno/issues/2871

Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
2023-03-29 10:41:05 -05:00
Skillz4Killz
810f87ff17 docs(README): remove beginner only clause & old docs link (#2901) 2023-03-29 17:35:38 +02:00