This commit is contained in:
tamaina 2023-05-10 14:58:45 +00:00
parent 66447d13c1
commit 49e32ebf2b

View file

@ -1,97 +1,112 @@
import type { JSONSchema7Definition } from 'schema-type';
export const packedFederationInstanceSchema = { export const packedFederationInstanceSchema = {
$id: 'https://misskey-hub.net/api/schemas/FederationInstance',
type: 'object', type: 'object',
properties: { properties: {
id: { id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
type: 'string',
optional: false, nullable: false,
format: 'id',
},
firstRetrievedAt: { firstRetrievedAt: {
type: 'string', type: 'string',
optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
host: { host: {
type: 'string', type: 'string',
optional: false, nullable: false, examples: 'misskey.example.com',
example: 'misskey.example.com',
}, },
usersCount: { usersCount: {
type: 'number', type: 'number',
optional: false, nullable: false,
}, },
notesCount: { notesCount: {
type: 'number', type: 'number',
optional: false, nullable: false,
}, },
followingCount: { followingCount: {
type: 'number', type: 'number',
optional: false, nullable: false,
}, },
followersCount: { followersCount: {
type: 'number', type: 'number',
optional: false, nullable: false,
}, },
isNotResponding: { isNotResponding: {
type: 'boolean', type: 'boolean',
optional: false, nullable: false,
}, },
isSuspended: { isSuspended: {
type: 'boolean', type: 'boolean',
optional: false, nullable: false,
}, },
isBlocked: { isBlocked: {
type: 'boolean', type: 'boolean',
optional: false, nullable: false,
}, },
softwareName: { softwareName: {
type: 'string', type: ['string', 'null'],
optional: false, nullable: true, examples: 'misskey',
example: 'misskey',
}, },
softwareVersion: { softwareVersion: {
type: 'string', type: ['string', 'null'],
optional: false, nullable: true,
}, },
openRegistrations: { openRegistrations: {
type: 'boolean', type: ['boolean', 'null'],
optional: false, nullable: true, examples: true,
example: true,
}, },
name: { name: {
type: 'string', type: ['string', 'null'],
optional: false, nullable: true,
}, },
description: { description: {
type: 'string', type: ['string', 'null'],
optional: false, nullable: true,
}, },
maintainerName: { maintainerName: {
type: 'string', type: ['string', 'null'],
optional: false, nullable: true,
}, },
maintainerEmail: { maintainerEmail: {
type: 'string', type: ['string', 'null'],
optional: false, nullable: true,
}, },
iconUrl: { iconUrl: {
oneOf: [{
type: 'string', type: 'string',
optional: false, nullable: true,
format: 'url', format: 'url',
}, {
type: 'null',
}],
}, },
faviconUrl: { faviconUrl: {
oneOf: [{
type: 'string', type: 'string',
optional: false, nullable: true,
format: 'url', format: 'url',
}, {
type: 'null',
}],
}, },
themeColor: { themeColor: {
type: 'string', type: ['string', 'null'],
optional: false, nullable: true,
}, },
infoUpdatedAt: { infoUpdatedAt: {
oneOf: [{
type: 'string', type: 'string',
optional: false, nullable: true,
format: 'date-time', format: 'date-time',
}, {
type: 'null',
}],
}, },
}, },
} as const; required: [
'id',
'firstRetrievedAt',
'host',
'usersCount',
'notesCount',
'followingCount',
'followersCount',
'isNotResponding',
'isSuspended',
'isBlocked',
'softwareName',
'softwareVersion',
'openRegistrations',
'name',
'description',
'maintainerName',
'maintainerEmail',
'iconUrl',
'faviconUrl',
'themeColor',
'infoUpdatedAt',
],
} as const satisfies JSONSchema7Definition;