486 Commits

Author SHA1 Message Date
Zane Helton
9143c1d408 Refactor /github endpoint into it's own file 2025-06-29 10:46:16 -04:00
Zane Helton
82642d0e97 Capitalize ref_type when using in embed
The GitHub API provides `ref_type` as lowercase. For consistency, this
adds a utility function and makes use of it when formatting the `create`
event from GitHub.

tag => Tag
branch => Branch
2025-06-29 03:56:01 -04:00
Zane Helton
77dd481742 Implement webhook handler for GitHub
I've created a middleware that runs when `/github` is appended to the
webhook URL. The middleware parses the GitHub webhook and turns it into
usable embeds.
2025-06-29 03:18:43 -04:00
Zane Helton
33fde3bc4a Fix the creation of guilds from templates
The biggest hold-up was missing fields (`premium_tier`,
`welcome_screen`, etc.) but it looks like someone has provided a
helpful function called `createGuild(...)` to provide sensible default
values.

This commit fixes the errors related to creating a guild from a
template. I've also refactored the code to include roles and channels in
the template.

To make sure that the @everyone role is cloned correctly, when
creating the guild from a template, we check if the role's ID
matches the template's `source_guild_id`. If it does, we set the
@everyone role to the new guild's ID.
2025-06-29 13:27:14 +10:00
Zane Helton
eec2a8ba85 Set premium_tier to 0 when creating guild from template
I think we'll need to discuss the proper way to provide default values
here. `premium_tier` for example should never be provided from the
template so it's fine going after the spread operator.

This commit still doesn't allow guilds to be created from template
because the next error is that `welcome_screen` doesn't exist. Our
options:

1. Provide default values in the ORM
2. Provide default values in the guild creation process
3. Throw an error if the template is missing values

Resolves: #1283 but creates a new issue
2025-06-29 13:27:14 +10:00
Zane Helton
ff692c19b7 Await guild creation to fix a race condition
`Promise.all(...)` runs these simultaneously, yet role depends on the
guild to be created first. This can lead to a race condition. I've
awaited role creation too because the call to `Member.addToGuild(...)`
relies on the role to be created.
2025-06-29 13:27:14 +10:00
Zane Helton
4772731a17 Fix PATCH Template route implementation
The previous PATCH implementation was creating a new template rather
than editing the existing template. This resulted in all requests
failing because it was missing more than one required field.

Resolves: #1281
2025-06-29 13:25:22 +10:00
Zane Helton
c0f9c22e67 Add validation to date_of_birth registration field
Resolves: #1020
2025-06-28 17:08:00 +10:00
dank074
526a8da8f5
add webrtc support (#1284)
Co-authored-by: MaddyUnderStars <46743919+MaddyUnderStars@users.noreply.github.com>
2025-06-22 12:41:13 +10:00
MathMan05
f03c6209a4 send the real index 2025-05-28 08:46:35 +02:00
MathMan05
e219c1a33a code relies on things done in a certain order
This makes sure that the code gets done in the order that is expected
2025-05-28 08:46:35 +02:00
MathMan05
4f6211ce50 remove missed log 2025-05-28 08:46:35 +02:00
MathMan05
04ddfadbb6 sort array to make algorithm happy 2025-05-28 08:46:35 +02:00
MathMan05
91361ea9c6 fix another stupid bug 2025-05-28 08:46:35 +02:00
MathMan05
1550ccd099 don't set possition if sent 2025-05-28 08:46:35 +02:00
MathMan05
246b493d76 remove logs 2025-05-28 08:46:35 +02:00
MathMan05
af70a7f21b channel is nullable fixes 2025-05-28 08:46:35 +02:00
MathMan05
a4c50ae922 forgot to test on rebuild 2025-05-28 08:46:35 +02:00
MathMan05
a9bff7554a fix moving channels 2025-05-28 08:46:35 +02:00
Puyodead1
080b2c7d38 Implement signed cdn urls 2025-05-03 12:30:22 +02:00
dank074
bb84bc83e5 add author to query in pins API 2025-04-09 18:42:56 -05:00
Emma [it/its]@Rory&
126a881f31 Prettier 2025-04-09 16:38:03 +02:00
MathMan05
d267b08ab5
stupid fix 2025-04-03 12:53:03 -05:00
MathMan05
99cc009670
fix password reset bug
Not sure if this'll work, but made a pull so y'all could see the issue
2025-04-03 12:52:11 -05:00
root
d8b1a8484c Validate Name for webhooks enforced more 2025-03-25 16:02:47 -07:00
root
cabc49a1ba Added can_recover_account value to /api/policies/instance/config 2025-03-25 11:26:36 -07:00
root
541af2045d Added better user configuration and removed extra logging 2025-03-25 11:15:14 -07:00
root
d0948c0e49 Updated error message for empty webhook update body 2025-03-24 07:29:56 -07:00
root
859edb9a27 Added Name Validation utility function 2025-03-24 07:26:26 -07:00
root
b03888fd62 Merge branch 'master' of https://github.com/spacebarchat/server into update_webhooks 2025-03-23 16:33:24 -07:00
root
336b2df1d7 Fixed errors in authorization for webhooks with tokens 2025-03-23 16:28:25 -07:00
MathMan05
90287748ce
Update index.ts 2025-03-23 13:13:03 -05:00
MathMan05
109bf0da7c
fix minor bug 2025-03-22 23:03:33 -05:00
root
dda930d501 Added in date wrap on generate-registration-tokens.ts 2025-03-19 09:36:13 -07:00
Puyodead1
8c7fabfe40
implement hubs routes 2025-01-07 21:12:43 -05:00
dank074
f5d6394c38 run prettier 2024-11-19 14:19:40 -06:00
Cyber
9384138dd4
Merge branch 'master' into fix/user-profile-colors 2024-11-14 07:58:16 +01:00
dank074
f499507698 turn off eslint rules causing issues 2024-11-13 19:05:54 -06:00
CyberL1
a11f3c0409 fix: return user profile theme colors as numbers 2024-11-12 13:48:52 +01:00
MathMan05
6a0d0f4185
Fix the broken delete API 2024-10-29 17:42:52 -05:00
Emma [it/its]@Rory&
168758924c Update some patches, switch to node-fetch-commonjs, more updates 2024-10-28 00:32:15 +01:00
Cyber
246e80c095 fix: self nick change response 2024-09-03 14:13:52 +02:00
TomatoCake
ff1ed0d744 Fix uploading of emojis 2024-09-02 19:39:32 +02:00
TomatoCake
e807037145 Add more application properties 2024-08-31 11:04:18 +02:00
Cyber
c62748cbf0 fix: display pinned message author 2024-08-28 08:17:54 +02:00
TomatoCake
dc81bcf900 Run prettier 2024-08-24 08:46:04 +02:00
TomatoCake
74f20898a3 Add method to NO_AUTHORIZATION_ROUTES 2024-08-24 08:43:22 +02:00
TomatoCake
eca4f1b56c Listing & creation of Developer Portal teams 2024-08-24 07:37:34 +02:00
TomatoCake
73b57750a0 Fix updating vanity URL & retrieving widget.json 2024-08-23 18:01:35 +02:00
TomatoCake
e2cf9fd23e Run prettier 2024-08-22 05:33:25 +02:00