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