This commit is contained in:
tamaina 2023-05-10 15:12:37 +00:00
parent 00b1fd2ee3
commit f3bc232419
3 changed files with 50 additions and 48 deletions

View file

@ -1,34 +1,40 @@
import type { JSONSchema7Definition } from 'schema-type';
export const packedHashtagSchema = { export const packedHashtagSchema = {
$id: 'https://misskey-hub.net/api/schemas/Hashtag',
type: 'object', type: 'object',
properties: { properties: {
tag: { tag: {
type: 'string', type: 'string',
optional: false, nullable: false, examples: 'misskey',
example: 'misskey',
}, },
mentionedUsersCount: { mentionedUsersCount: {
type: 'number', type: 'number',
optional: false, nullable: false,
}, },
mentionedLocalUsersCount: { mentionedLocalUsersCount: {
type: 'number', type: 'number',
optional: false, nullable: false,
}, },
mentionedRemoteUsersCount: { mentionedRemoteUsersCount: {
type: 'number', type: 'number',
optional: false, nullable: false,
}, },
attachedUsersCount: { attachedUsersCount: {
type: 'number', type: 'number',
optional: false, nullable: false,
}, },
attachedLocalUsersCount: { attachedLocalUsersCount: {
type: 'number', type: 'number',
optional: false, nullable: false,
}, },
attachedRemoteUsersCount: { attachedRemoteUsersCount: {
type: 'number', type: 'number',
optional: false, nullable: false,
}, },
}, },
} as const; required: [
'tag',
'mentionedUsersCount',
'mentionedLocalUsersCount',
'mentionedRemoteUsersCount',
'attachedUsersCount',
'attachedLocalUsersCount',
'attachedRemoteUsersCount',
],
} as const satisfies JSONSchema7Definition;

View file

@ -1,31 +1,31 @@
import type { JSONSchema7Definition } from 'schema-type';
export const packedMutingSchema = { export const packedMutingSchema = {
$id: 'https://misskey-hub.net/api/schemas/Muting',
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',
}, },
expiresAt: { expiresAt: {
type: 'string', oneOf: [{
optional: false, nullable: true, type: 'string',
format: 'date-time', format: 'date-time',
}, }, {
muteeId: { type: 'null',
type: 'string', }],
optional: false, nullable: false,
format: 'id',
},
mutee: {
type: 'object',
optional: false, nullable: false,
ref: 'UserDetailed',
}, },
muteeId: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
mutee: { $ref: 'https://misskey-hub.net/api/schemas/UserDetailed' },
}, },
} as const; required: [
'id',
'createdAt',
'expiresAt',
'muteeId',
'mutee',
],
} as const satisfies JSONSchema7Definition;

View file

@ -1,26 +1,22 @@
import type { JSONSchema7Definition } from 'schema-type';
export const packedNoteFavoriteSchema = { export const packedNoteFavoriteSchema = {
$id: 'https://misskey-hub.net/api/schemas/NoteFavorite',
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',
}, },
note: { noteId: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
type: 'object', note: { $ref: 'https://misskey-hub.net/api/schemas/Note' },
optional: false, nullable: false,
ref: 'Note',
},
noteId: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
}, },
} as const; required: [
'id',
'createdAt',
'note',
'noteId',
]
} as const satisfies JSONSchema7Definition;