2023-05-02 17:31:17 +00:00
|
|
|
import type { JSONSchema7Reference } from 'json-schema-to-ts';
|
|
|
|
|
2023-05-02 16:51:41 +00:00
|
|
|
export const packedNoteSchema = {
|
|
|
|
$id: '/schemas/Note',
|
|
|
|
|
|
|
|
type: 'object',
|
|
|
|
properties: {
|
|
|
|
id: {
|
|
|
|
type: 'string',
|
|
|
|
$ref: '/schemas/Id',
|
|
|
|
},
|
|
|
|
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: {
|
|
|
|
type: 'string',
|
|
|
|
$ref: '/schemas/Id',
|
|
|
|
},
|
|
|
|
user: {
|
|
|
|
type: 'object',
|
|
|
|
$ref: '/schemas/UserLite',
|
|
|
|
},
|
|
|
|
replyId: {
|
|
|
|
oneOf: [{
|
|
|
|
type: 'string',
|
|
|
|
$ref: '/schemas/Id',
|
|
|
|
}, { type: 'null' }],
|
|
|
|
},
|
|
|
|
renoteId: {
|
|
|
|
oneOf: [{
|
|
|
|
type: 'string',
|
|
|
|
$ref: '/schemas/Id',
|
|
|
|
}, { type: 'null' }],
|
|
|
|
},
|
|
|
|
reply: {
|
|
|
|
oneOf: [{
|
|
|
|
$ref: '/schemas/Note',
|
|
|
|
}, { type: 'null' }],
|
|
|
|
},
|
|
|
|
renote: {
|
|
|
|
oneOf: [{
|
|
|
|
$ref: '/schemas/Note',
|
|
|
|
}, { type: 'null' }],
|
|
|
|
},
|
|
|
|
isHidden: {
|
|
|
|
type: 'boolean',
|
|
|
|
},
|
|
|
|
visibility: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
mentions: {
|
|
|
|
type: 'array',
|
|
|
|
items: {
|
|
|
|
type: 'string',
|
|
|
|
$ref: '/schemas/Id',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
visibleUserIds: {
|
|
|
|
type: 'array',
|
|
|
|
items: {
|
|
|
|
type: 'string',
|
|
|
|
$ref: '/schemas/Id',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
fileIds: {
|
|
|
|
type: 'array',
|
|
|
|
items: {
|
|
|
|
type: 'string',
|
|
|
|
$ref: '/schemas/Id',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
files: {
|
|
|
|
type: 'array',
|
|
|
|
items: {
|
|
|
|
$ref: '/schemas/DriveFile',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
tags: {
|
|
|
|
type: 'array',
|
|
|
|
items: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
poll: {
|
|
|
|
oneOf: [{
|
|
|
|
type: 'object',
|
|
|
|
$ref: '/schemas/Poll',
|
|
|
|
}, { type: 'null' }],
|
|
|
|
},
|
|
|
|
channelId: {
|
|
|
|
oneOf: [{
|
|
|
|
type: 'string',
|
|
|
|
$ref: '/schemas/Id',
|
|
|
|
}, { type: 'null' }],
|
|
|
|
},
|
|
|
|
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-02 17:31:17 +00:00
|
|
|
} as const satisfies JSONSchema7Reference;
|