This commit is contained in:
tamaina 2023-05-10 14:32:46 +00:00
parent d328a8cefc
commit 9699bac704
3 changed files with 66 additions and 59 deletions

View file

@ -1,33 +1,34 @@
import type { JSONSchema7Definition } from 'schema-type';
export const packedAppSchema = { export const packedAppSchema = {
$id: 'https://misskey-hub.net/api/schemas/App',
type: 'object', type: 'object',
properties: { properties: {
id: { id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
type: 'string',
optional: false, nullable: false,
},
name: { name: {
type: 'string', type: 'string',
optional: false, nullable: false,
}, },
callbackUrl: { callbackUrl: {
type: 'string', type: ['string', 'null'],
optional: false, nullable: true,
}, },
permission: { permission: {
type: 'array', type: 'array',
optional: false, nullable: false,
items: { items: {
type: 'string', type: 'string',
optional: false, nullable: false,
}, },
}, },
secret: { secret: {
type: 'string', type: 'string',
optional: true, nullable: false,
}, },
isAuthorized: { isAuthorized: {
type: 'boolean', type: 'boolean',
optional: true, nullable: false,
}, },
}, },
} as const; required: [
'id',
'name',
'callbackUrl',
'permission',
],
} as const satisfies JSONSchema7Definition;

View file

@ -1,26 +1,22 @@
import type { JSONSchema7Definition } from 'schema-type';
export const packedBlockingSchema = { export const packedBlockingSchema = {
$id: 'https://misskey-hub.net/api/schemas/Blocking',
type: 'object', type: 'object',
properties: { properties: {
id: { id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
createdAt: { createdAt: {
type: 'string', type: 'string',
optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
blockeeId: { blockeeId: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
type: 'string', blockee: { $ref: 'https://misskey-hub.net/api/schemas/UserDetailed' },
optional: false, nullable: false,
format: 'id',
},
blockee: {
type: 'object',
optional: false, nullable: false,
ref: 'UserDetailed',
},
}, },
} as const; required: [
'id',
'createdAt',
'blockeeId',
'blockee',
],
} as const satisfies JSONSchema7Definition;

View file

@ -1,71 +1,81 @@
import type { JSONSchema7Definition } from 'schema-type';
export const packedChannelSchema = { export const packedChannelSchema = {
$id: 'https://misskey-hub.net/api/schemas/Channel',
type: 'object', type: 'object',
properties: { properties: {
id: { id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
createdAt: { createdAt: {
type: 'string', type: 'string',
optional: false, nullable: false,
format: 'date-time', format: 'date-time',
}, },
lastNotedAt: { lastNotedAt: {
type: 'string', oneOf: [{
optional: false, nullable: true, type: 'string',
format: 'date-time', format: 'date-time',
}, {
type: 'null',
}],
}, },
name: { name: {
type: 'string', type: 'string',
optional: false, nullable: false,
}, },
description: { description: {
type: 'string', type: ['string', 'null'],
nullable: true, optional: false,
}, },
bannerUrl: { bannerUrl: {
type: 'string', oneOf: [{
format: 'url', type: 'string',
nullable: true, optional: false, format: 'url',
}, {
type: 'null',
}],
}, },
isArchived: { isArchived: {
type: 'boolean', type: 'boolean',
optional: false, nullable: false,
}, },
notesCount: { notesCount: {
type: 'number', type: 'number',
nullable: false, optional: false,
}, },
usersCount: { usersCount: {
type: 'number', type: 'number',
nullable: false, optional: false,
}, },
isFollowing: { isFollowing: {
type: 'boolean', type: 'boolean',
optional: true, nullable: false,
}, },
isFavorited: { isFavorited: {
type: 'boolean', type: 'boolean',
optional: true, nullable: false,
}, },
userId: { userId: {
type: 'string', oneOf: [{
nullable: true, optional: false, $ref: 'https://misskey-hub.net/api/schemas/Id',
format: 'id', }, {
type: 'null',
}],
}, },
pinnedNoteIds: { pinnedNoteIds: {
type: 'array', type: 'array',
nullable: false, optional: false,
items: { items: {
type: 'string', $ref: 'https://misskey-hub.net/api/schemas/Id',
format: 'id',
}, },
}, },
color: { color: {
type: 'string', type: 'string',
optional: false, nullable: false,
}, },
}, },
} as const; required: [
'id',
'createdAt',
'lastNotedAt',
'name',
'description',
'bannerUrl',
'isArchived',
'notesCount',
'usersCount',
'userId',
'pinnedNoteIds',
'color',
],
} as const satisfies JSONSchema7Definition;