2023-05-04 10:56:24 +00:00
|
|
|
import type { JSONSchema7 } from 'schema-type';
|
2023-05-02 17:31:17 +00:00
|
|
|
|
2023-05-02 16:51:41 +00:00
|
|
|
export const packedNoteSchema = {
|
2023-05-04 10:57:55 +00:00
|
|
|
$id: 'https://misskey-hub.net/api/schemas/Note',
|
2023-05-02 16:51:41 +00:00
|
|
|
|
|
|
|
type: 'object',
|
|
|
|
properties: {
|
2023-05-04 10:57:55 +00:00
|
|
|
id: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
|
2023-05-02 16:51:41 +00:00
|
|
|
createdAt: {
|
|
|
|
type: 'string',
|
|
|
|
format: 'date-time',
|
|
|
|
},
|
|
|
|
deletedAt: {
|
|
|
|
oneOf: [{
|
|
|
|
type: 'string',
|
|
|
|
format: 'date-time',
|
|
|
|
}, { type: 'null' }],
|
|
|
|
},
|
|
|
|
text: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
cw: {
|
|
|
|
oneOf: [{ type: 'string' }, { type: 'null' }],
|
|
|
|
},
|
|
|
|
userId: {
|
2023-05-04 10:57:55 +00:00
|
|
|
$ref: 'https://misskey-hub.net/api/schemas/Id',
|
2023-05-02 16:51:41 +00:00
|
|
|
},
|
|
|
|
user: {
|
2023-05-04 10:57:55 +00:00
|
|
|
$ref: 'https://misskey-hub.net/api/schemas/UserLite',
|
2023-05-02 16:51:41 +00:00
|
|
|
},
|
|
|
|
replyId: {
|
2023-05-04 10:57:55 +00:00
|
|
|
oneOf: [{ $ref: 'https://misskey-hub.net/api/schemas/Id' }, { type: 'null' }],
|
2023-05-02 16:51:41 +00:00
|
|
|
},
|
|
|
|
renoteId: {
|
2023-05-04 10:57:55 +00:00
|
|
|
oneOf: [{ $ref: 'https://misskey-hub.net/api/schemas/Id' }, { type: 'null' }],
|
2023-05-02 16:51:41 +00:00
|
|
|
},
|
|
|
|
reply: {
|
2023-05-04 10:57:55 +00:00
|
|
|
oneOf: [{ $ref: 'https://misskey-hub.net/api/schemas/Note' }, { type: 'null' }],
|
2023-05-02 16:51:41 +00:00
|
|
|
},
|
|
|
|
renote: {
|
2023-05-04 10:57:55 +00:00
|
|
|
oneOf: [{ $ref: 'https://misskey-hub.net/api/schemas/Note' }, { type: 'null' }],
|
2023-05-02 16:51:41 +00:00
|
|
|
},
|
|
|
|
isHidden: {
|
|
|
|
type: 'boolean',
|
|
|
|
},
|
|
|
|
visibility: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
mentions: {
|
|
|
|
type: 'array',
|
2023-05-04 10:57:55 +00:00
|
|
|
items: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
|
2023-05-02 16:51:41 +00:00
|
|
|
},
|
|
|
|
visibleUserIds: {
|
|
|
|
type: 'array',
|
2023-05-04 10:57:55 +00:00
|
|
|
items: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
|
2023-05-02 16:51:41 +00:00
|
|
|
},
|
|
|
|
fileIds: {
|
|
|
|
type: 'array',
|
2023-05-04 10:57:55 +00:00
|
|
|
items: { $ref: 'https://misskey-hub.net/api/schemas/Id' },
|
2023-05-02 16:51:41 +00:00
|
|
|
},
|
|
|
|
files: {
|
|
|
|
type: 'array',
|
2023-05-04 10:57:55 +00:00
|
|
|
items: { $ref: 'https://misskey-hub.net/api/schemas/DriveFile' },
|
2023-05-02 16:51:41 +00:00
|
|
|
},
|
|
|
|
tags: {
|
|
|
|
type: 'array',
|
2023-05-04 10:56:24 +00:00
|
|
|
items: { type: 'string' },
|
2023-05-02 16:51:41 +00:00
|
|
|
},
|
|
|
|
poll: {
|
2023-05-04 10:57:55 +00:00
|
|
|
oneOf: [{ $ref: 'https://misskey-hub.net/api/schemas/Poll' }, { type: 'null' }],
|
2023-05-02 16:51:41 +00:00
|
|
|
},
|
|
|
|
channelId: {
|
2023-05-04 10:57:55 +00:00
|
|
|
oneOf: [{ $ref: 'https://misskey-hub.net/api/schemas/Id' }, { type: 'null' }],
|
2023-05-02 16:51:41 +00:00
|
|
|
},
|
|
|
|
channel: {
|
|
|
|
oneOf: [{
|
|
|
|
type: 'object',
|
|
|
|
properties: {
|
|
|
|
id: { type: 'string' },
|
|
|
|
name: { type: 'string' },
|
|
|
|
color: { type: 'string' },
|
|
|
|
},
|
|
|
|
required: ['id', 'name', 'color'],
|
|
|
|
}, { type: 'null' }],
|
|
|
|
},
|
|
|
|
localOnly: {
|
|
|
|
type: 'boolean',
|
|
|
|
},
|
|
|
|
reactionAcceptance: {
|
|
|
|
oneOf: [{
|
|
|
|
enum: ['likeOnly', 'likeOnlyForRemote']
|
|
|
|
}, { type: 'null' }],
|
|
|
|
},
|
|
|
|
reactions: {
|
|
|
|
type: 'object',
|
|
|
|
},
|
|
|
|
renoteCount: {
|
|
|
|
type: 'number',
|
|
|
|
},
|
|
|
|
repliesCount: {
|
|
|
|
type: 'number',
|
|
|
|
},
|
|
|
|
uri: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
url: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
myReaction: {
|
|
|
|
type: 'object',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
required: [
|
|
|
|
'id',
|
|
|
|
'createdAt',
|
|
|
|
'text',
|
|
|
|
'userId',
|
|
|
|
'user',
|
|
|
|
'visibility',
|
|
|
|
'reactionAcceptance',
|
|
|
|
'reactions',
|
|
|
|
'renoteCount',
|
|
|
|
'repliesCount',
|
|
|
|
],
|
2023-05-04 10:56:24 +00:00
|
|
|
} as const satisfies JSONSchema7Definition;
|