refactor: noteのjson-schemaの型を改善

This commit is contained in:
yukineko 2024-01-08 23:15:02 +09:00
parent c81934563a
commit ad846c33d9
No known key found for this signature in database
GPG Key ID: E5BACB72109B7B90
6 changed files with 35 additions and 9 deletions

View File

@ -154,6 +154,11 @@ export const packedNoteSchema = {
emojis: {
type: 'object',
optional: true, nullable: false,
additionalProperties: {
anyOf: [{
type: 'string',
}],
},
},
channelId: {
type: 'string',
@ -199,9 +204,23 @@ export const packedNoteSchema = {
type: 'string',
optional: false, nullable: true,
},
reactionEmojis: {
type: 'object',
optional: false, nullable: false,
additionalProperties: {
anyOf: [{
type: 'string',
}],
},
},
reactions: {
type: 'object',
optional: false, nullable: false,
additionalProperties: {
anyOf: [{
type: 'number',
}],
},
},
renoteCount: {
type: 'number',
@ -233,7 +252,7 @@ export const packedNoteSchema = {
},
myReaction: {
type: 'object',
type: 'string',
optional: true, nullable: true,
},
},

View File

@ -1,6 +1,6 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-08T13:32:03.180Z
* generatedAt: 2024-01-08T14:11:08.390Z
*/
import type { SwitchCaseResponseType } from '../api.js';

View File

@ -1,6 +1,6 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-08T13:32:03.177Z
* generatedAt: 2024-01-08T14:11:08.386Z
*/
import type {

View File

@ -1,6 +1,6 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-08T13:32:03.174Z
* generatedAt: 2024-01-08T14:11:08.384Z
*/
import { operations } from './types.js';

View File

@ -1,6 +1,6 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-08T13:32:03.173Z
* generatedAt: 2024-01-08T14:11:08.383Z
*/
import { components } from './types.js';

View File

@ -3,7 +3,7 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-08T13:32:03.048Z
* generatedAt: 2024-01-08T14:11:08.253Z
*/
/**
@ -3801,7 +3801,9 @@ export type components = {
votes: number;
}[];
}) | null;
emojis?: Record<string, never>;
emojis?: {
[key: string]: string;
};
/**
* Format: id
* @example xxxxxxxxxx
@ -3817,14 +3819,19 @@ export type components = {
}) | null;
localOnly?: boolean;
reactionAcceptance: string | null;
reactions: Record<string, never>;
reactionEmojis: {
[key: string]: string;
};
reactions: {
[key: string]: number;
};
renoteCount: number;
repliesCount: number;
uri?: string;
url?: string;
reactionAndUserPairCache?: string[];
clippedCount?: number;
myReaction?: Record<string, unknown> | null;
myReaction?: string | null;
};
NoteReaction: {
/**