add: json-schemaのnoteにpollの型定義を追加

This commit is contained in:
yukineko 2024-01-08 22:34:08 +09:00
parent a5c3ec3ad5
commit c81934563a
No known key found for this signature in database
GPG key ID: E5BACB72109B7B90
7 changed files with 49 additions and 7 deletions
packages
backend/src
core/entities
models/json-schema
misskey-js/src/autogen

View file

@ -164,7 +164,7 @@ export class NoteEntityService implements OnModuleInit {
return {
multiple: poll.multiple,
expiresAt: poll.expiresAt,
expiresAt: poll.expiresAt?.toISOString() ?? null,
choices,
};
}

View file

@ -117,6 +117,39 @@ export const packedNoteSchema = {
poll: {
type: 'object',
optional: true, nullable: true,
properties: {
expiresAt: {
type: 'string',
optional: true, nullable: true,
format: 'date-time',
},
multiple: {
type: 'boolean',
optional: false, nullable: false,
},
choices: {
type: 'array',
optional: false, nullable: false,
items: {
type: 'object',
optional: false, nullable: false,
properties: {
isVoted: {
type: 'boolean',
optional: false, nullable: false,
},
text: {
type: 'string',
optional: false, nullable: false,
},
votes: {
type: 'number',
optional: false, nullable: false,
},
},
},
},
},
},
emojis: {
type: 'object',

View file

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

View file

@ -1,6 +1,6 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-08T06:48:05.055Z
* generatedAt: 2024-01-08T13:32:03.177Z
*/
import type {

View file

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

View file

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

View file

@ -3,7 +3,7 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-08T06:48:04.940Z
* generatedAt: 2024-01-08T13:32:03.048Z
*/
/**
@ -3791,7 +3791,16 @@ export type components = {
fileIds?: string[];
files?: components['schemas']['DriveFile'][];
tags?: string[];
poll?: Record<string, unknown> | null;
poll?: ({
/** Format: date-time */
expiresAt?: string | null;
multiple: boolean;
choices: {
isVoted: boolean;
text: string;
votes: number;
}[];
}) | null;
emojis?: Record<string, never>;
/**
* Format: id