This commit is contained in:
tamaina 2023-05-10 14:53:26 +00:00
parent 5bb2d71231
commit 66447d13c1

View file

@ -1,67 +1,54 @@
import type { JSONSchema7Definition } from 'schema-type';
export const packedEmojiSimpleSchema = {
$id: 'https://misskey-hub.net/api/schemas/EmojiSimple',
type: 'object',
properties: {
aliases: {
type: 'array',
optional: false, nullable: false,
items: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
items: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
},
name: {
type: 'string',
optional: false, nullable: false,
},
category: {
type: 'string',
optional: false, nullable: true,
type: ['string', 'null'],
},
url: {
type: 'string',
optional: false, nullable: false,
},
},
} as const;
required: [
'aliases',
'name',
'category',
'url',
],
} as const satisfies JSONSchema7Definition;
export const packedEmojiDetailedSchema = {
$id: 'https://misskey-hub.net/api/schemas/EmojiDetailed',
type: 'object',
allOf: [{
$ref: 'https://misskey-hub.net/api/schemas/EmojiSimple',
}, {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
aliases: {
type: 'array',
optional: false, nullable: false,
items: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
},
name: {
type: 'string',
optional: false, nullable: false,
},
category: {
type: 'string',
optional: false, nullable: true,
},
id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
host: {
type: 'string',
optional: false, nullable: true,
type: ['string', 'null'],
description: 'The local host is represented with `null`.',
},
url: {
type: 'string',
optional: false, nullable: false,
},
license: {
type: 'string',
optional: false, nullable: true,
type: ['string', 'null'],
}
},
},
} as const;
required: [
'id',
'host',
'license',
],
}],
} as const satisfies JSONSchema7Definition;