Fix export.

This commit is contained in:
Paul
2021-07-27 13:51:45 +01:00
parent 50f083b56b
commit 64603c1b42
2 changed files with 192 additions and 150 deletions
+186 -148
View File
@@ -8371,7 +8371,150 @@
"description": "Just enough user information to list bans.",
"type": "array",
"items": {
"$ref": "#/definitions/Pick<User,\"_id\"|\"username\"|\"avatar\">"
"type": "object",
"properties": {
"_id": {
"description": "Id",
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
"type": "string"
},
"username": {
"description": "Username",
"minLength": 2,
"maxLength": 32,
"pattern": "^[a-zA-Z0-9_.]+$",
"type": "string"
},
"avatar": {
"type": "object",
"properties": {
"_id": {
"description": "Attachment ID",
"minLength": 1,
"maxLength": 128,
"type": "string"
},
"tag": {
"$ref": "#/definitions/AttachmentTag"
},
"size": {
"description": "File size (in bytes)",
"type": "number"
},
"filename": {
"description": "File name",
"type": "string"
},
"metadata": {
"description": "Metadata",
"anyOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"File"
]
}
},
"required": [
"type"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"Text"
]
}
},
"required": [
"type"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"Audio"
]
}
},
"required": [
"type"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"Image"
]
},
"width": {
"type": "number"
},
"height": {
"type": "number"
}
},
"required": [
"height",
"type",
"width"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"Video"
]
},
"width": {
"type": "number"
},
"height": {
"type": "number"
}
},
"required": [
"height",
"type",
"width"
]
}
]
},
"content_type": {
"description": "Content type",
"type": "string"
}
},
"required": [
"_id",
"content_type",
"filename",
"metadata",
"size",
"tag"
]
}
},
"required": [
"_id",
"username"
]
}
},
"bans": {
@@ -8414,153 +8557,6 @@
"users"
],
"definitions": {
"Pick<User,\"_id\"|\"username\"|\"avatar\">": {
"type": "object",
"properties": {
"_id": {
"description": "User ID",
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
"type": "string"
},
"username": {
"description": "Username",
"minLength": 2,
"maxLength": 32,
"pattern": "^[a-zA-Z0-9_.]+$",
"type": "string"
},
"avatar": {
"description": "User avatar",
"type": "object",
"properties": {
"_id": {
"description": "Attachment ID",
"minLength": 1,
"maxLength": 128,
"type": "string"
},
"tag": {
"$ref": "#/definitions/AttachmentTag"
},
"size": {
"description": "File size (in bytes)",
"type": "number"
},
"filename": {
"description": "File name",
"type": "string"
},
"metadata": {
"description": "Metadata",
"anyOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"File"
]
}
},
"required": [
"type"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"Text"
]
}
},
"required": [
"type"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"Audio"
]
}
},
"required": [
"type"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"Image"
]
},
"width": {
"type": "number"
},
"height": {
"type": "number"
}
},
"required": [
"height",
"type",
"width"
]
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"Video"
]
},
"width": {
"type": "number"
},
"height": {
"type": "number"
}
},
"required": [
"height",
"type",
"width"
]
}
]
},
"content_type": {
"description": "Content type",
"type": "string"
}
},
"required": [
"_id",
"content_type",
"filename",
"metadata",
"size",
"tag"
]
}
},
"required": [
"_id",
"username"
]
},
"AttachmentTag": {
"description": "Attachment tag",
"enum": [
@@ -16151,6 +16147,48 @@
}
}
},
"SetSettingsData": {
"type": "object",
"additionalProperties": {
"type": "string"
},
"definitions": {
"AttachmentTag": {
"description": "Attachment tag",
"enum": [
"attachments",
"avatars",
"backgrounds",
"banners",
"icons"
],
"type": "string"
},
"RelationshipStatus": {
"description": "Your relationship with the user",
"enum": [
"Blocked",
"BlockedOther",
"Friend",
"Incoming",
"None",
"Outgoing",
"User"
],
"type": "string"
},
"Presence": {
"description": "User presence",
"enum": [
"Busy",
"Idle",
"Invisible",
"Online"
],
"type": "string"
}
}
},
"Id": {
"description": "Id",
"pattern": "[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}",
+6 -2
View File
@@ -301,15 +301,19 @@ resource('/servers/:server/bans', {
...serverParams,
...await success("Bans", schema`
import type { Id } from './_common';
import type { User } from './Users';
import type { Ban } from './Servers';
import type { Username } from './Users';
import type { Attachment } from './Autumn';
type ${'ServerBans'} = {
/**
* Just enough user information to list bans.
*/
users: Pick<User, '_id' | 'username' | 'avatar'>[]
users: {
_id: Id
username: Username
avatar?: Attachment
}[]
/**
* Ban List