diff --git a/api/assets/schemas.json b/api/assets/schemas.json
index 023f2092..03a2db07 100644
--- a/api/assets/schemas.json
+++ b/api/assets/schemas.json
@@ -21,7 +21,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"login",
"password"
@@ -64,7 +63,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"consent",
"username"
@@ -133,7 +131,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -158,7 +155,6 @@
"type": "integer"
}
},
- "additionalProperties": false,
"definitions": {
"ChannelPermissionOverwriteType": {
"enum": [
@@ -210,7 +206,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -233,8 +228,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -251,8 +245,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -269,15 +262,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -294,8 +285,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -359,7 +349,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -383,8 +372,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -417,7 +405,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -440,7 +427,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -498,8 +484,7 @@
"replied_user": {
"type": "boolean"
}
- },
- "additionalProperties": false
+ }
},
"message_reference": {
"type": "object",
@@ -517,7 +502,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"channel_id",
"message_id"
@@ -532,7 +516,6 @@
"items": {}
}
},
- "additionalProperties": false,
"definitions": {
"ChannelPermissionOverwriteType": {
"enum": [
@@ -584,7 +567,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -607,8 +589,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -625,8 +606,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -643,15 +623,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -668,8 +646,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -733,7 +710,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -757,8 +733,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -791,7 +766,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -814,7 +788,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -855,7 +828,6 @@
"type": "integer"
}
},
- "additionalProperties": false,
"definitions": {
"ChannelPermissionOverwriteType": {
"enum": [
@@ -907,7 +879,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -930,8 +901,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -948,8 +918,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -966,15 +935,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -991,8 +958,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -1056,7 +1022,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -1080,8 +1045,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -1114,7 +1078,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -1137,7 +1100,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -1157,7 +1119,6 @@
"type": "integer"
}
},
- "additionalProperties": false,
"definitions": {
"ChannelPermissionOverwriteType": {
"enum": [
@@ -1209,7 +1170,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -1232,8 +1192,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -1250,8 +1209,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -1268,15 +1226,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -1293,8 +1249,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -1358,7 +1313,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -1382,8 +1336,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -1416,7 +1369,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -1439,7 +1391,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -1459,7 +1410,6 @@
}
}
},
- "additionalProperties": false,
"required": [
"messages"
],
@@ -1514,7 +1464,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -1537,8 +1486,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -1555,8 +1503,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -1573,15 +1520,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -1598,8 +1543,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -1663,7 +1607,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -1687,8 +1630,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -1721,7 +1663,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -1744,7 +1685,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -1770,7 +1710,6 @@
"$ref": "#/definitions/ChannelPermissionOverwriteType"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -1828,7 +1767,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -1851,8 +1789,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -1869,8 +1806,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -1887,15 +1823,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -1912,8 +1846,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -1977,7 +1910,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -2001,8 +1933,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -2035,7 +1966,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -2058,7 +1988,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -2079,7 +2008,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"avatar",
"name"
@@ -2135,7 +2063,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -2158,8 +2085,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -2176,8 +2102,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -2194,15 +2119,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -2219,8 +2142,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -2284,7 +2206,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -2308,8 +2229,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -2342,7 +2262,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -2365,7 +2284,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -2385,7 +2303,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"definitions": {
"ChannelPermissionOverwriteType": {
"enum": [
@@ -2437,7 +2354,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -2460,8 +2376,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -2478,8 +2393,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -2496,15 +2410,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -2521,8 +2433,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -2586,7 +2497,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -2610,8 +2520,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -2644,7 +2553,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -2667,7 +2575,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -2695,7 +2602,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"id"
]
@@ -2751,7 +2657,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -2774,8 +2679,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -2792,8 +2696,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -2810,15 +2713,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -2835,8 +2736,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -2900,7 +2800,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -2924,8 +2823,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -2958,7 +2856,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -2981,7 +2878,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -3023,7 +2919,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"name"
],
@@ -3078,7 +2973,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -3101,8 +2995,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -3119,8 +3012,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -3137,15 +3029,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -3162,8 +3052,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -3227,7 +3116,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -3251,8 +3139,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -3285,7 +3172,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -3308,7 +3194,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -3389,7 +3274,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"name"
],
@@ -3444,7 +3328,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -3467,8 +3350,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -3485,8 +3367,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -3503,15 +3384,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -3528,8 +3407,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -3593,7 +3471,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -3617,8 +3494,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -3651,7 +3527,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -3674,7 +3549,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -3694,7 +3568,6 @@
}
}
},
- "additionalProperties": false,
"definitions": {
"ChannelPermissionOverwriteType": {
"enum": [
@@ -3746,7 +3619,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -3769,8 +3641,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -3787,8 +3658,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -3805,15 +3675,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -3830,8 +3698,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -3895,7 +3762,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -3919,8 +3785,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -3953,7 +3818,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -3976,7 +3840,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -3993,7 +3856,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"nick"
],
@@ -4048,7 +3910,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -4071,8 +3932,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -4089,8 +3949,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -4107,15 +3966,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -4132,8 +3989,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -4197,7 +4053,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -4221,8 +4076,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -4255,7 +4109,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -4278,7 +4131,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -4310,7 +4162,6 @@
"type": "integer"
}
},
- "additionalProperties": false,
"definitions": {
"ChannelPermissionOverwriteType": {
"enum": [
@@ -4362,7 +4213,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -4385,8 +4235,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -4403,8 +4252,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -4421,15 +4269,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -4446,8 +4292,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -4511,7 +4356,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -4535,8 +4379,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -4569,7 +4412,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -4592,7 +4434,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -4614,7 +4455,6 @@
"type": "integer"
}
},
- "additionalProperties": false,
"required": [
"id",
"position"
@@ -4671,7 +4511,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -4694,8 +4533,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -4712,8 +4550,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -4730,15 +4567,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -4755,8 +4590,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -4820,7 +4654,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -4844,8 +4677,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -4878,7 +4710,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -4901,7 +4732,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -4921,7 +4751,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"name"
],
@@ -4976,7 +4805,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -4999,8 +4827,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -5017,8 +4844,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -5035,15 +4861,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -5060,8 +4884,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -5125,7 +4948,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -5149,8 +4971,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -5183,7 +5004,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -5206,7 +5026,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -5226,7 +5045,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"name"
],
@@ -5281,7 +5099,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -5304,8 +5121,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -5322,8 +5138,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -5340,15 +5155,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -5365,8 +5178,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -5430,7 +5242,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -5454,8 +5265,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -5488,7 +5298,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -5511,7 +5320,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -5530,7 +5338,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"definitions": {
"ChannelPermissionOverwriteType": {
"enum": [
@@ -5582,7 +5389,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -5605,8 +5411,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -5623,8 +5428,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -5641,15 +5445,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -5666,8 +5468,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -5731,7 +5532,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -5755,8 +5555,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -5789,7 +5588,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -5812,7 +5610,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -5848,7 +5645,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"channel_id"
],
@@ -5903,7 +5699,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -5926,8 +5721,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -5944,8 +5738,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -5962,15 +5755,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -5987,8 +5778,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -6052,7 +5842,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -6076,8 +5865,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -6110,7 +5898,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -6133,7 +5920,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -6164,7 +5950,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"channel_id",
"description",
@@ -6179,7 +5964,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"definitions": {
"ChannelPermissionOverwriteType": {
"enum": [
@@ -6231,7 +6015,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -6254,8 +6037,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -6272,8 +6054,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -6290,15 +6071,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -6315,8 +6094,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -6380,7 +6158,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -6404,8 +6181,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -6438,7 +6214,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -6461,7 +6236,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -6481,7 +6255,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"channel_id",
"enabled"
@@ -6537,7 +6310,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -6560,8 +6332,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -6578,8 +6349,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -6596,15 +6366,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -6621,8 +6389,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -6686,7 +6453,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -6710,8 +6476,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -6744,7 +6509,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -6767,7 +6531,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -6790,7 +6553,6 @@
]
}
},
- "additionalProperties": false,
"required": [
"name"
],
@@ -6845,7 +6607,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -6868,8 +6629,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -6886,8 +6646,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -6904,15 +6663,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -6929,8 +6686,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -6994,7 +6750,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -7018,8 +6773,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -7052,7 +6806,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -7075,7 +6828,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -7103,7 +6855,6 @@
"format": "date-time"
}
},
- "additionalProperties": false,
"required": [
"connected_accounts",
"user"
@@ -7159,7 +6910,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -7182,8 +6932,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -7200,8 +6949,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -7218,15 +6966,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -7243,8 +6989,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -7308,7 +7053,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -7332,8 +7076,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -7366,7 +7109,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -7389,7 +7131,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -7412,7 +7153,6 @@
}
}
},
- "additionalProperties": false,
"required": [
"recipients"
],
@@ -7467,7 +7207,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -7490,8 +7229,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -7508,8 +7246,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -7526,15 +7263,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -7551,8 +7286,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -7616,7 +7350,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -7640,8 +7373,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -7674,7 +7406,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -7697,7 +7428,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -7744,7 +7474,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"definitions": {
"ChannelPermissionOverwriteType": {
"enum": [
@@ -7796,7 +7525,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -7819,8 +7547,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -7837,8 +7564,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -7855,15 +7581,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -7880,8 +7604,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -7945,7 +7668,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -7969,8 +7691,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -8003,7 +7724,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -8026,7 +7746,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -8049,7 +7768,6 @@
"type": "number"
}
},
- "additionalProperties": false,
"definitions": {
"ChannelPermissionOverwriteType": {
"enum": [
@@ -8101,7 +7819,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -8124,8 +7841,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -8142,8 +7858,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -8160,15 +7875,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -8185,8 +7898,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -8250,7 +7962,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -8274,8 +7985,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -8308,7 +8018,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -8331,7 +8040,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -8351,7 +8059,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"discriminator",
"username"
@@ -8407,7 +8114,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -8430,8 +8136,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -8448,8 +8153,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -8466,15 +8170,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -8491,8 +8193,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -8556,7 +8257,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -8580,8 +8280,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -8614,7 +8313,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -8637,7 +8335,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
@@ -8683,8 +8380,7 @@
"text": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"default_guilds_restricted": {
"type": "boolean"
@@ -8711,7 +8407,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"all"
]
@@ -8743,7 +8438,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"color",
"guild_ids",
@@ -8811,7 +8505,6 @@
"type": "integer"
}
},
- "additionalProperties": false,
"required": [
"afk_timeout",
"allow_accessibility_detection",
@@ -8896,7 +8589,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"text"
]
@@ -8919,8 +8611,7 @@
"url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"author": {
"type": "object",
@@ -8937,8 +8628,7 @@
"proxy_icon_url": {
"type": "string"
}
- },
- "additionalProperties": false
+ }
},
"fields": {
"type": "array",
@@ -8955,15 +8645,13 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"value"
]
}
}
- },
- "additionalProperties": false
+ }
},
"EmbedImage": {
"type": "object",
@@ -8980,8 +8668,7 @@
"width": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"ChannelModifySchema": {
"type": "object",
@@ -9045,7 +8732,6 @@
"type": "string"
}
},
- "additionalProperties": false,
"required": [
"allow",
"deny",
@@ -9069,8 +8755,7 @@
"default_auto_archive_duration": {
"type": "integer"
}
- },
- "additionalProperties": false
+ }
},
"UserPublic": {
"type": "object",
@@ -9103,7 +8788,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"bio",
"bot",
@@ -9126,7 +8810,6 @@
"type": "boolean"
}
},
- "additionalProperties": false,
"required": [
"name",
"type",
diff --git a/api/scripts/generate_schema.js b/api/scripts/generate_schema.js
index fc787c22..c12f6b1a 100644
--- a/api/scripts/generate_schema.js
+++ b/api/scripts/generate_schema.js
@@ -30,6 +30,15 @@ const Excluded = [
"supertest.Response"
];
+function modify(obj) {
+ delete obj.additionalProperties;
+ for (var k in obj) {
+ if (typeof obj[k] === "object" && obj[k] !== null) {
+ modify(obj[k]);
+ }
+ }
+}
+
function main() {
const program = TJS.getProgramFromFiles(walk(path.join(__dirname, "..", "src", "routes")), compilerOptions);
const generator = TJS.buildGenerator(program, settings);
@@ -47,6 +56,8 @@ function main() {
definitions = { ...definitions, [name]: { ...part } };
}
+ modify(definitions);
+
fs.writeFileSync(schemaPath, JSON.stringify(definitions, null, 4));
}
diff --git a/api/src/middlewares/Authentication.ts b/api/src/middlewares/Authentication.ts
index a300c786..5a082751 100644
--- a/api/src/middlewares/Authentication.ts
+++ b/api/src/middlewares/Authentication.ts
@@ -1,6 +1,6 @@
import { NextFunction, Request, Response } from "express";
import { HTTPError } from "lambert-server";
-import { checkToken, Config } from "@fosscord/util";
+import { checkToken, Config, Rights } from "@fosscord/util";
export const NO_AUTHORIZATION_ROUTES = [
"/auth/login",
@@ -21,6 +21,7 @@ declare global {
user_id: string;
user_bot: boolean;
token: string;
+ rights: Rights;
}
}
}
@@ -46,6 +47,7 @@ export async function Authentication(req: Request, res: Response, next: NextFunc
req.token = decoded;
req.user_id = decoded.id;
req.user_bot = user.bot;
+ req.rights = new Rights(Number(user.rights));
return next();
} catch (error: any) {
return next(new HTTPError(error?.toString(), 400));
diff --git a/api/src/routes/applications/#id/entitlements.ts b/api/src/routes/applications/#id/entitlements.ts
new file mode 100644
index 00000000..1152e500
--- /dev/null
+++ b/api/src/routes/applications/#id/entitlements.ts
@@ -0,0 +1,12 @@
+import { Router, Response, Request } from "express";
+import { route } from "@fosscord/api";
+
+const router = Router();
+
+router.get("/", route({}), (req: Request, res: Response) => {
+ // TODO:
+ //const { exclude_consumed } = req.query;
+ res.status(200).send([]);
+});
+
+export default router;
diff --git a/api/src/routes/auth/register.ts b/api/src/routes/auth/register.ts
index 9c058399..1344c994 100644
--- a/api/src/routes/auth/register.ts
+++ b/api/src/routes/auth/register.ts
@@ -50,6 +50,15 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re
const { register, security } = Config.get();
const ip = getIpAdress(req);
+ if (register.disabled) {
+ throw FieldErrors({
+ email: {
+ code: "DISABLED",
+ message: "registration is disabled on this instance"
+ }
+ });
+ }
+
if (register.blockProxies) {
if (isProxy(await IPAnalysis(ip))) {
console.log(`proxy ${ip} blocked from registration`);
@@ -202,6 +211,7 @@ router.post("/", route({ body: "RegisterSchema" }), async (req: Request, res: Re
disabled: false,
deleted: false,
email: email,
+ rights: "0",
nsfw_allowed: true, // TODO: depending on age
public_flags: "0",
flags: "0", // TODO: generate
diff --git a/api/src/routes/channels/#channel_id/messages/#message_id/crosspost.ts b/api/src/routes/channels/#channel_id/messages/#message_id/crosspost.ts
index 6753e832..de0c01f1 100644
--- a/api/src/routes/channels/#channel_id/messages/#message_id/crosspost.ts
+++ b/api/src/routes/channels/#channel_id/messages/#message_id/crosspost.ts
@@ -1,8 +1,30 @@
import { Router, Response, Request } from "express";
+import { route } from "@fosscord/api";
const router = Router();
-// TODO:
-// router.post("/", (req: Request, res: Response) => {});
+router.post("/", route({ permission: "MANAGE_MESSAGES" }), (req: Request, res: Response) => {
+ // TODO:
+ res.json({
+ id: "",
+ type: 0,
+ content: "",
+ channel_id: "",
+ author: {id: "",
+ username: "",
+ avatar: "",
+ discriminator: "", public_flags: 64},
+ attachments: [],
+ embeds: [],
+ mentions: [],
+ mention_roles: [],
+ pinned: false,
+ mention_everyone: false,
+ tts: false,
+ timestamp: "",
+ edited_timestamp: null,
+ flags: 1, components: []}).status(200);
+});
export default router;
+
diff --git a/api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts b/api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts
index f2b83d40..6b6a66b2 100644
--- a/api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts
+++ b/api/src/routes/channels/#channel_id/messages/#message_id/reactions.ts
@@ -124,7 +124,7 @@ router.put("/:emoji/:user_id", route({ permission: "READ_MESSAGE_HISTORY" }), as
already_added.count++;
} else message.reactions.push({ count: 1, emoji, user_ids: [req.user_id] });
- await Message.update({ id: message_id, channel_id }, message);
+ await message.save();
const member = channel.guild_id && (await Member.findOneOrFail({ id: req.user_id }));
@@ -165,7 +165,7 @@ router.delete("/:emoji/:user_id", route({}), async (req: Request, res: Response)
if (already_added.count <= 0) message.reactions.remove(already_added);
- await Message.update({ id: message_id, channel_id }, message);
+ await message.save();
await emitEvent({
event: "MESSAGE_REACTION_REMOVE",
diff --git a/api/src/routes/discoverable-guilds.ts b/api/src/routes/discoverable-guilds.ts
index f667eb2a..b626b084 100644
--- a/api/src/routes/discoverable-guilds.ts
+++ b/api/src/routes/discoverable-guilds.ts
@@ -1,16 +1,18 @@
-import { Guild } from "@fosscord/util";
+import { Guild, Config } from "@fosscord/util";
+
import { Router, Request, Response } from "express";
import { route } from "@fosscord/api";
+
const router = Router();
router.get("/", route({}), async (req: Request, res: Response) => {
const { limit } = req.params;
-
+ var showAllGuilds = Config.get().guild.showAllGuildsInDiscovery;
// ! this only works using SQL querys
// TODO: implement this with default typeorm query
// const guilds = await Guild.find({ where: { features: "DISCOVERABLE" } }); //, take: Math.abs(Number(limit)) });
- const guilds = await Guild.find({ where: `"features" LIKE 'COMMUNITY'`, take: Math.abs(Number(limit)) });
+ const guilds = showAllGuilds ? await Guild.find({take: Math.abs(Number(limit || 20))}) : await Guild.find({ where: `"features" LIKE '%COMMUNITY%'`, take: Math.abs(Number(limit || 20)) });
res.send({ guilds: guilds });
});
diff --git a/api/src/routes/discovery.ts b/api/src/routes/discovery.ts
new file mode 100644
index 00000000..9e6e0164
--- /dev/null
+++ b/api/src/routes/discovery.ts
@@ -0,0 +1,12 @@
+import { Router, Response, Request } from "express";
+import { route } from "@fosscord/api";
+
+const router = Router();
+
+router.get("/categories", route({}), (req: Request, res: Response) => {
+ // TODO:
+ //const { locale, primary_only } = req.query;
+ res.json([]).status(200);
+});
+
+export default router;
diff --git a/api/src/routes/store/skus.ts b/api/src/routes/stage-instances.ts
index 7d0e12eb..411e95bf 100644
--- a/api/src/routes/store/skus.ts
+++ b/api/src/routes/stage-instances.ts
@@ -3,9 +3,8 @@ import { route } from "@fosscord/api";
const router: Router = Router();
-router.get("/skus/:id", route({}), async (req: Request, res: Response) => {
+router.get("/", route({}), async (req: Request, res: Response) => {
//TODO
- const { id } = req.params;
res.json([]).status(200);
});
diff --git a/api/src/routes/store/published-listings/applications.ts b/api/src/routes/store/published-listings/applications.ts
new file mode 100644
index 00000000..f06a01e4
--- /dev/null
+++ b/api/src/routes/store/published-listings/applications.ts
@@ -0,0 +1,79 @@
+import { Request, Response, Router } from "express";
+import { route } from "@fosscord/api";
+
+const router: Router = Router();
+
+router.get("/:id", route({}), async (req: Request, res: Response) => {
+ //TODO
+ const id = req.params.id;
+ res.json({
+ id: "",
+ summary: "",
+ sku: {
+ id: "",
+ type: 1,
+ dependent_sku_id: null,
+ application_id: "",
+ manifets_labels: [],
+ access_type: 2,
+ name: "",
+ features: [],
+ relase_date: "",
+ premium: false,
+ slug: "",
+ flags: 4,
+ genres: [],
+ legal_notice: "",
+ application: {
+ id: "",
+ name: "",
+ icon: "",
+ description: "",
+ summary: "",
+ cover_image: "",
+ primary_sku_id: "",
+ hook: true,
+ slug: "",
+ guild_id: "",
+ bot_public: "",
+ bot_require_code_grant: false,
+ verify_key: "",
+ publishers: [
+ {
+ id: "",
+ name: ""
+ }
+ ],
+ developers: [
+ {
+ id: "",
+ name: ""
+ }
+ ],
+ system_requirements: {},
+ show_age_gate: false,
+ price: {
+ amount: 0,
+ currency: "EUR"
+ },
+ locales: []
+ },
+ tagline: "",
+ description: "",
+ carousel_items: [
+ {
+ asset_id: ""
+ }
+ ],
+ header_logo_dark_theme: {}, //{id: "", size: 4665, mime_type: "image/gif", width 160, height: 160}
+ header_logo_light_theme: {},
+ box_art: {},
+ thumbnail: {},
+ header_background: {},
+ hero_background: {},
+ assets: []
+ }
+ }).status(200);
+});
+
+export default router;
diff --git a/api/src/routes/store/published-listings/applications/#id/subscription-plans.ts b/api/src/routes/store/published-listings/applications/#id/subscription-plans.ts
new file mode 100644
index 00000000..77f949d9
--- /dev/null
+++ b/api/src/routes/store/published-listings/applications/#id/subscription-plans.ts
@@ -0,0 +1,24 @@
+import { Request, Response, Router } from "express";
+import { route } from "@fosscord/api";
+
+const router: Router = Router();
+
+router.get("/", route({}), async (req: Request, res: Response) => {
+ //TODO
+ res.json([
+ {
+ id: "",
+ name: "",
+ interval: 1,
+ interval_count: 1,
+ tax_inclusive: true,
+ sku_id: "",
+ fallback_price: 499,
+ fallback_currency: "eur",
+ currency: "eur",
+ price: 4199,
+ price_tier: null
+ }]).status(200);
+});
+
+export default router;
diff --git a/api/src/routes/store/published-listings/skus.ts b/api/src/routes/store/published-listings/skus.ts
new file mode 100644
index 00000000..f06a01e4
--- /dev/null
+++ b/api/src/routes/store/published-listings/skus.ts
@@ -0,0 +1,79 @@
+import { Request, Response, Router } from "express";
+import { route } from "@fosscord/api";
+
+const router: Router = Router();
+
+router.get("/:id", route({}), async (req: Request, res: Response) => {
+ //TODO
+ const id = req.params.id;
+ res.json({
+ id: "",
+ summary: "",
+ sku: {
+ id: "",
+ type: 1,
+ dependent_sku_id: null,
+ application_id: "",
+ manifets_labels: [],
+ access_type: 2,
+ name: "",
+ features: [],
+ relase_date: "",
+ premium: false,
+ slug: "",
+ flags: 4,
+ genres: [],
+ legal_notice: "",
+ application: {
+ id: "",
+ name: "",
+ icon: "",
+ description: "",
+ summary: "",
+ cover_image: "",
+ primary_sku_id: "",
+ hook: true,
+ slug: "",
+ guild_id: "",
+ bot_public: "",
+ bot_require_code_grant: false,
+ verify_key: "",
+ publishers: [
+ {
+ id: "",
+ name: ""
+ }
+ ],
+ developers: [
+ {
+ id: "",
+ name: ""
+ }
+ ],
+ system_requirements: {},
+ show_age_gate: false,
+ price: {
+ amount: 0,
+ currency: "EUR"
+ },
+ locales: []
+ },
+ tagline: "",
+ description: "",
+ carousel_items: [
+ {
+ asset_id: ""
+ }
+ ],
+ header_logo_dark_theme: {}, //{id: "", size: 4665, mime_type: "image/gif", width 160, height: 160}
+ header_logo_light_theme: {},
+ box_art: {},
+ thumbnail: {},
+ header_background: {},
+ hero_background: {},
+ assets: []
+ }
+ }).status(200);
+});
+
+export default router;
diff --git a/api/src/routes/store/published-listings/skus/#sku_id/subscription-plans.ts b/api/src/routes/store/published-listings/skus/#sku_id/subscription-plans.ts
new file mode 100644
index 00000000..54c01607
--- /dev/null
+++ b/api/src/routes/store/published-listings/skus/#sku_id/subscription-plans.ts
@@ -0,0 +1,25 @@
+import { Request, Response, Router } from "express";
+import { route } from "@fosscord/api";
+
+const router: Router = Router();
+
+const skus = new Map([
+ ["521842865731534868", [{"id": "511651856145973248", "name": "Premium Monthly (Legacy)", "interval": 1, "interval_count": 1, "tax_inclusive": true, "sku_id": "521842865731534868", "currency": "usd", "price": 0, "price_tier": null}, {"id": "511651860671627264", "name": "Premium Yearly (Legacy)", "interval": 2, "interval_count": 1, "tax_inclusive": true, "sku_id": "521842865731534868", "currency": "usd", "price": 0, "price_tier": null}]],
+ ["521846918637420545", [{"id": "511651871736201216", "name": "Premium Classic Monthly", "interval": 1, "interval_count": 1, "tax_inclusive": true, "sku_id": "521846918637420545", "currency": "usd", "price": 0, "price_tier": null}, {"id": "511651876987469824", "name": "Premium Classic Yearly", "interval": 2, "interval_count": 1, "tax_inclusive": true, "sku_id": "521846918637420545", "currency": "usd", "price": 0, "price_tier": null}]],
+ ["521847234246082599", [{"id": "642251038925127690", "name": "Premium Quarterly", "interval": 1, "interval_count": 3, "tax_inclusive": true, "sku_id": "521847234246082599", "currency": "usd", "price": 0, "price_tier": null}, {"id": "511651880837840896", "name": "Premium Monthly", "interval": 1, "interval_count": 1, "tax_inclusive": true, "sku_id": "521847234246082599", "currency": "usd", "price": 0, "price_tier": null}, {"id": "511651885459963904", "name": "Premium Yearly", "interval": 2, "interval_count": 1, "tax_inclusive": true, "sku_id": "521847234246082599", "currency": "usd", "price": 0, "price_tier": null}]],
+ ["590663762298667008", [{"id": "590665532894740483", "name": "Server Boost Monthly", "interval": 1, "interval_count": 1, "tax_inclusive": true, "sku_id": "590663762298667008", "discount_price": 0, "currency": "usd", "price": 0, "price_tier": null}, {"id": "590665538238152709", "name": "Server Boost Yearly", "interval": 2, "interval_count": 1, "tax_inclusive": true, "sku_id": "590663762298667008", "discount_price": 0, "currency": "usd", "price": 0, "price_tier": null}]],
+]);
+
+router.get("/", route({}), async (req: Request, res: Response) => {
+ // TODO: add the ability to add custom
+ const { sku_id } = req.params;
+
+ if(!skus.has(sku_id)) {
+ console.log(`Request for invalid SKU ${sku_id}! Please report this!`);
+ res.sendStatus(404);
+ } else {
+ res.json(skus.get(sku_id)).status(200);
+ }
+});
+
+export default router;
diff --git a/api/src/routes/users/@me/activities/statistics/applications.ts b/api/src/routes/users/@me/activities/statistics/applications.ts
new file mode 100644
index 00000000..834be35c
--- /dev/null
+++ b/api/src/routes/users/@me/activities/statistics/applications.ts
@@ -0,0 +1,11 @@
+import { Router, Response, Request } from "express";
+import { route } from "@fosscord/api";
+
+const router = Router();
+
+router.get("/", route({}), (req: Request, res: Response) => {
+ // TODO:
+ res.json([]).status(200)
+});
+
+export default router;
diff --git a/api/src/routes/users/@me/billing/payment-sources.ts b/api/src/routes/users/@me/billing/payment-sources.ts
new file mode 100644
index 00000000..834be35c
--- /dev/null
+++ b/api/src/routes/users/@me/billing/payment-sources.ts
@@ -0,0 +1,11 @@
+import { Router, Response, Request } from "express";
+import { route } from "@fosscord/api";
+
+const router = Router();
+
+router.get("/", route({}), (req: Request, res: Response) => {
+ // TODO:
+ res.json([]).status(200)
+});
+
+export default router;
diff --git a/api/src/routes/users/@me/email-settings.ts b/api/src/routes/users/@me/email-settings.ts
new file mode 100644
index 00000000..2d961a0e
--- /dev/null
+++ b/api/src/routes/users/@me/email-settings.ts
@@ -0,0 +1,19 @@
+import { Router, Response, Request } from "express";
+import { route } from "@fosscord/api";
+
+const router = Router();
+
+router.get("/", route({}), (req: Request, res: Response) => {
+ // TODO:
+ res.json({
+ categories: {
+ social: true,
+ communication: true,
+ tips: false,
+ updates_and_announcements: false,
+ recommendations_and_events: false },
+ initialized: false
+ }).status(200);
+});
+
+export default router;
diff --git a/api/src/routes/users/@me/entitlements.ts b/api/src/routes/users/@me/entitlements.ts
new file mode 100644
index 00000000..341e2b4c
--- /dev/null
+++ b/api/src/routes/users/@me/entitlements.ts
@@ -0,0 +1,11 @@
+import { Router, Response, Request } from "express";
+import { route } from "@fosscord/api";
+
+const router = Router();
+
+router.get("/gifts", route({}), (req: Request, res: Response) => {
+ // TODO:
+ res.json([]).status(200);
+});
+
+export default router;
diff --git a/api/src/routes/users/@me/guilds/premium/subscription-slots.ts b/api/src/routes/users/@me/guilds/premium/subscription-slots.ts
new file mode 100644
index 00000000..014df8af
--- /dev/null
+++ b/api/src/routes/users/@me/guilds/premium/subscription-slots.ts
@@ -0,0 +1,11 @@
+import { Router, Response, Request } from "express";
+import { route } from "@fosscord/api";
+
+const router = Router();
+
+router.get("/", route({}), (req: Request, res: Response) => {
+ // TODO:
+ res.json([]).status(200);
+});
+
+export default router;
diff --git a/api/src/routes/store/applications.ts b/api/src/routes/users/@me/notes.ts
index 352c1752..2ef27bc0 100644
--- a/api/src/routes/store/applications.ts
+++ b/api/src/routes/users/@me/notes.ts
@@ -3,10 +3,12 @@ import { route } from "@fosscord/api";
const router: Router = Router();
-router.get("/applications/:id", route({}), async (req: Request, res: Response) => {
+router.put("/:id", route({}), async (req: Request, res: Response) => {
//TODO
- const { id } = req.params;
- res.json([]).status(200);
+ res.json({
+ message: "400: Bad Request",
+ code: 0
+ }).status(400);
});
export default router;
diff --git a/api/src/util/route.ts b/api/src/util/route.ts
index 45882d8a..3e967e2a 100644
--- a/api/src/util/route.ts
+++ b/api/src/util/route.ts
@@ -1,4 +1,15 @@
-import { DiscordApiErrors, EVENT, Event, EventData, getPermission, PermissionResolvable, Permissions } from "@fosscord/util";
+import {
+ DiscordApiErrors,
+ EVENT,
+ Event,
+ EventData,
+ FosscordApiErrors,
+ getPermission,
+ PermissionResolvable,
+ Permissions,
+ RightResolvable,
+ Rights
+} from "@fosscord/util";
import { NextFunction, Request, Response } from "express";
import fs from "fs";
import path from "path";
@@ -33,6 +44,7 @@ export type RouteResponse = { status?: number; body?: `${string}Response`; heade
export interface RouteOptions {
permission?: PermissionResolvable;
+ right?: RightResolvable;
body?: `${string}Schema`; // typescript interface name
test?: {
response?: RouteResponse;
@@ -89,6 +101,13 @@ export function route(opts: RouteOptions) {
}
}
+ if (opts.right) {
+ const required = new Rights(opts.right);
+ if (!req.rights || !req.rights.has(required)) {
+ throw FosscordApiErrors.MISSING_RIGHTS.withParams(opts.right as string);
+ }
+ }
+
if (validate) {
const valid = validate(normalizeBody(req.body));
if (!valid) {
|