A Proper API #24
Labels
No labels
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: CRSS/Website#24
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
So a proper api is needed since the current few routes are a mess, not to mention the db.
When NOT to design apis and databases:
A few to-dos to do before the api:
Database DesignTypesAPI Design
The current proposed design.
Routes
Current User (only Self)
GET /user/@me
- Get User DataPATCH /user/@me
- Update User DataDELETE /user/@me
- Delete All User DataPOST /user/@me/avatar
- Change AvatarPOST /user/@me/banner
- Change BannerGET /user/@me/sessions
- Get All SessionsDELETE /user/@me/session/[id]
- Log A Session OutOther User
GET /user/[username|id]
- Get User Data (Anyone /Without Email Included/) (Self, Super Admin /With Email Included/)PATCH /user/[username|id]
- Update User Data (Self, Admin)DELETE /user/[username|id]
- Delete All User Data (Self, Super Admin)POST /user/[username|id]/avatar
- Change Avatar (Self, Admin)POST /user/[username|id]/banner
- Change Banner (Self, Admin)PATCH /user/[username|id]/permissions
- Change Banner (Super Admin)Nations
GET /nations
- Get All NationsGET /nation/[code|id]
- Get A NationPATCH /nation/[code|id]
- Update A Nation (Highest in Government, Admin)DELETE /nation/[code|id]
- Delete A Nation (Highest in Government, Super Admin)POST /nation/[code|id]/flag
- Update Flag (Government, Admin)POST /nation
- Establish A Nation (Anyone)Companies
GET /nation/[code|id]/companies
- Get A Nation's CompaniesGET /nation/[code|id]/company/[id]
- Get A CompanyPATCH /nation/[code|id]/company/[id]
- Update A Company (Owner, Government, Admin)DELETE /nation/[code|id]/company/[id]
- Delete A Company (Owner, Government, Super Admin)POST /nation/[code|id]/company
- Start A Company (Citizen, Admin)Government
GET /nation/[code|id]/government
- Get A GovernmentPATCH /nation/[code|id]/government
- Edit A Government (Government, Admin)POST /nation/[code|id]/government/user
- Add A UserPATCH /nation/[code|id]/government/user
- Edit A UserDELETE /nation/[code|id]/government/user
- Remove A UserGallery
GET /gallery
- Get Gallery ImagesGET /gallery/[id]
- Get A Specific ImagePOST /gallery
- Upload An Image (Server Player, Admin)Minecraft
GET /server/status
- Server StatusGET /server/players
- Online PlayersPOST /server/link
- Link A Minecraft Account to a UserAdmin (min. Admin)
GET /admin/users
- Get All UsersPOST /admin/team
- Add Team MemberPOST /admin/supertoken
- Generate A "Super Super Admin" Token (Super Admin)DELETE /admin/sessions
- Log Everyone Out (Super Super Admin) (⚠ Token manually entered to make the request. Not recommended to call unless there were changes to the session system.)Meta
GET /meta
- Basic Info Of The DeploymentGET /meta/team
- Get All Team MembersOther
GET /auth
- Discord Auth HandlerPOST /contact
- Contact FormPermissions
Special Single Use Token
1 << 0
1 << 1
1 << 2