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 = {
$id: 'https://misskey-hub.net/api/schemas/App',
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
},
id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
name: {
type: 'string',
optional: false, nullable: false,
},
callbackUrl: {
type: 'string',
optional: false, nullable: true,
type: ['string', 'null'],
},
permission: {
type: 'array',
optional: false, nullable: false,
items: {
type: 'string',
optional: false, nullable: false,
},
},
secret: {
type: 'string',
optional: true, nullable: false,
},
isAuthorized: {
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 = {
$id: 'https://misskey-hub.net/api/schemas/Blocking',
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
createdAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
blockeeId: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
blockee: {
type: 'object',
optional: false, nullable: false,
ref: 'UserDetailed',
},
blockeeId: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
blockee: { $ref: 'https://misskey-hub.net/api/schemas/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 = {
$id: 'https://misskey-hub.net/api/schemas/Channel',
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
createdAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
lastNotedAt: {
type: 'string',
optional: false, nullable: true,
format: 'date-time',
oneOf: [{
type: 'string',
format: 'date-time',
}, {
type: 'null',
}],
},
name: {
type: 'string',
optional: false, nullable: false,
},
description: {
type: 'string',
nullable: true, optional: false,
type: ['string', 'null'],
},
bannerUrl: {
type: 'string',
format: 'url',
nullable: true, optional: false,
oneOf: [{
type: 'string',
format: 'url',
}, {
type: 'null',
}],
},
isArchived: {
type: 'boolean',
optional: false, nullable: false,
},
notesCount: {
type: 'number',
nullable: false, optional: false,
},
usersCount: {
type: 'number',
nullable: false, optional: false,
},
isFollowing: {
type: 'boolean',
optional: true, nullable: false,
},
isFavorited: {
type: 'boolean',
optional: true, nullable: false,
},
userId: {
type: 'string',
nullable: true, optional: false,
format: 'id',
oneOf: [{
$ref: 'https://misskey-hub.net/api/schemas/Id',
}, {
type: 'null',
}],
},
pinnedNoteIds: {
type: 'array',
nullable: false, optional: false,
items: {
type: 'string',
format: 'id',
$ref: 'https://misskey-hub.net/api/schemas/Id',
},
},
color: {
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;