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 = { export const packedEmojiSimpleSchema = {
$id: 'https://misskey-hub.net/api/schemas/EmojiSimple',
type: 'object', type: 'object',
properties: { properties: {
aliases: { aliases: {
type: 'array', type: 'array',
optional: false, nullable: false, items: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
items: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
}, },
name: { name: {
type: 'string', type: 'string',
optional: false, nullable: false,
}, },
category: { category: {
type: 'string', type: ['string', 'null'],
optional: false, nullable: true,
}, },
url: { url: {
type: 'string', type: 'string',
optional: false, nullable: false,
}, },
}, },
} as const; required: [
'aliases',
'name',
'category',
'url',
],
} as const satisfies JSONSchema7Definition;
export const packedEmojiDetailedSchema = { export const packedEmojiDetailedSchema = {
$id: 'https://misskey-hub.net/api/schemas/EmojiDetailed',
type: 'object', type: 'object',
properties: { allOf: [{
id: { $ref: 'https://misskey-hub.net/api/schemas/EmojiSimple',
type: 'string', }, {
optional: false, nullable: false, type: 'object',
format: 'id', properties: {
}, id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
aliases: { host: {
type: 'array', type: ['string', 'null'],
optional: false, nullable: false, description: 'The local host is represented with `null`.',
items: {
type: 'string',
optional: false, nullable: false,
format: 'id',
}, },
license: {
type: ['string', 'null'],
}
}, },
name: { required: [
type: 'string', 'id',
optional: false, nullable: false, 'host',
}, 'license',
category: { ],
type: 'string', }],
optional: false, nullable: true, } as const satisfies JSONSchema7Definition;
},
host: {
type: 'string',
optional: false, nullable: true,
description: 'The local host is represented with `null`.',
},
url: {
type: 'string',
optional: false, nullable: false,
},
license: {
type: 'string',
optional: false, nullable: true,
},
},
} as const;