Merge remote-tracking branch 'misskey-dev/develop' into io

This commit is contained in:
まっちゃとーにゅ
2024-01-23 04:10:51 +09:00
266 changed files with 20375 additions and 6619 deletions

View File

@@ -1,11 +1,11 @@
import './autogen/apiClientJSDoc';
import './autogen/apiClientJSDoc.js';
import { SwitchCaseResponseType } from './api.types';
import type { Endpoints } from './api.types';
import { SwitchCaseResponseType } from './api.types.js';
import type { Endpoints } from './api.types.js';
export {
SwitchCaseResponseType,
} from './api.types';
} from './api.types.js';
const MK_API_ERROR = Symbol();

View File

@@ -1,6 +1,6 @@
import { Endpoints as Gen } from './autogen/endpoint';
import { UserDetailed } from './autogen/models';
import { UsersShowRequest } from './autogen/entities';
import { Endpoints as Gen } from './autogen/endpoint.js';
import { UserDetailed } from './autogen/models.js';
import { UsersShowRequest } from './autogen/entities.js';
import {
SigninRequest,
SigninResponse,
@@ -8,7 +8,7 @@ import {
SignupPendingResponse,
SignupRequest,
SignupResponse,
} from './entities';
} from './entities.js';
type Overwrite<T, U extends { [Key in keyof T]?: unknown }> = Omit<
T,

View File

@@ -1,6 +1,5 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-13T04:31:38.782Z
* version: 2024.1.0-io
*/
import type { SwitchCaseResponseType } from '../api.js';
@@ -4062,5 +4061,71 @@ declare module '../api.js' {
params: P,
credential?: string | null,
): Promise<SwitchCaseResponseType<E, P>>;
/**
* No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:account*
*/
request<E extends 'reversi/cancel-match', P extends Endpoints[E]['req']>(
endpoint: E,
params: P,
credential?: string | null,
): Promise<SwitchCaseResponseType<E, P>>;
/**
* No description provided.
*
* **Credential required**: *No*
*/
request<E extends 'reversi/games', P extends Endpoints[E]['req']>(
endpoint: E,
params: P,
credential?: string | null,
): Promise<SwitchCaseResponseType<E, P>>;
/**
* No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:account*
*/
request<E extends 'reversi/match', P extends Endpoints[E]['req']>(
endpoint: E,
params: P,
credential?: string | null,
): Promise<SwitchCaseResponseType<E, P>>;
/**
* No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:account*
*/
request<E extends 'reversi/invitations', P extends Endpoints[E]['req']>(
endpoint: E,
params: P,
credential?: string | null,
): Promise<SwitchCaseResponseType<E, P>>;
/**
* No description provided.
*
* **Credential required**: *No*
*/
request<E extends 'reversi/show-game', P extends Endpoints[E]['req']>(
endpoint: E,
params: P,
credential?: string | null,
): Promise<SwitchCaseResponseType<E, P>>;
/**
* No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:account*
*/
request<E extends 'reversi/surrender', P extends Endpoints[E]['req']>(
endpoint: E,
params: P,
credential?: string | null,
): Promise<SwitchCaseResponseType<E, P>>;
}
}

View File

@@ -1,6 +1,5 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-13T04:31:38.778Z
* version: 2024.1.0-io
*/
import type {
@@ -552,6 +551,16 @@ import type {
BubbleGameRegisterResponse,
BubbleGameRankingRequest,
BubbleGameRankingResponse,
ReversiCancelMatchRequest,
ReversiCancelMatchResponse,
ReversiGamesRequest,
ReversiGamesResponse,
ReversiMatchRequest,
ReversiMatchResponse,
ReversiInvitationsResponse,
ReversiShowGameRequest,
ReversiShowGameResponse,
ReversiSurrenderRequest,
} from './entities.js';
export type Endpoints = {
@@ -920,4 +929,10 @@ export type Endpoints = {
'retention': { req: EmptyRequest; res: RetentionResponse };
'bubble-game/register': { req: BubbleGameRegisterRequest; res: BubbleGameRegisterResponse };
'bubble-game/ranking': { req: BubbleGameRankingRequest; res: BubbleGameRankingResponse };
'reversi/cancel-match': { req: ReversiCancelMatchRequest; res: ReversiCancelMatchResponse };
'reversi/games': { req: ReversiGamesRequest; res: ReversiGamesResponse };
'reversi/match': { req: ReversiMatchRequest; res: ReversiMatchResponse };
'reversi/invitations': { req: EmptyRequest; res: ReversiInvitationsResponse };
'reversi/show-game': { req: ReversiShowGameRequest; res: ReversiShowGameResponse };
'reversi/surrender': { req: ReversiSurrenderRequest; res: EmptyResponse };
}

View File

@@ -1,6 +1,5 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-13T04:31:38.775Z
* version: 2024.1.0-io
*/
import { operations } from './types.js';
@@ -554,3 +553,13 @@ export type BubbleGameRegisterRequest = operations['bubble-game/register']['requ
export type BubbleGameRegisterResponse = operations['bubble-game/register']['responses']['200']['content']['application/json'];
export type BubbleGameRankingRequest = operations['bubble-game/ranking']['requestBody']['content']['application/json'];
export type BubbleGameRankingResponse = operations['bubble-game/ranking']['responses']['200']['content']['application/json'];
export type ReversiCancelMatchRequest = operations['reversi/cancel-match']['requestBody']['content']['application/json'];
export type ReversiCancelMatchResponse = operations['reversi/cancel-match']['responses']['200']['content']['application/json'];
export type ReversiGamesRequest = operations['reversi/games']['requestBody']['content']['application/json'];
export type ReversiGamesResponse = operations['reversi/games']['responses']['200']['content']['application/json'];
export type ReversiMatchRequest = operations['reversi/match']['requestBody']['content']['application/json'];
export type ReversiMatchResponse = operations['reversi/match']['responses']['200']['content']['application/json'];
export type ReversiInvitationsResponse = operations['reversi/invitations']['responses']['200']['content']['application/json'];
export type ReversiShowGameRequest = operations['reversi/show-game']['requestBody']['content']['application/json'];
export type ReversiShowGameResponse = operations['reversi/show-game']['responses']['200']['content']['application/json'];
export type ReversiSurrenderRequest = operations['reversi/surrender']['requestBody']['content']['application/json'];

View File

@@ -1,6 +1,5 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-13T04:31:38.773Z
* version: 2024.1.0-io
*/
import { components } from './types.js';
@@ -46,5 +45,7 @@ export type FlashLike = components['schemas']['FlashLike'];
export type Signin = components['schemas']['Signin'];
export type RoleLite = components['schemas']['RoleLite'];
export type Role = components['schemas']['Role'];
export type ReversiGameLite = components['schemas']['ReversiGameLite'];
export type ReversiGameDetailed = components['schemas']['ReversiGameDetailed'];
export type AbuseUserReport = components['schemas']['AbuseUserReport'];
export type ModerationLog = components['schemas']['ModerationLog'];

View File

@@ -2,8 +2,7 @@
/* eslint @typescript-eslint/no-explicit-any: 0 */
/*
* version: 2023.12.2
* generatedAt: 2024-01-13T04:31:38.633Z
* version: 2024.1.0-io
*/
/**
@@ -3517,6 +3516,60 @@ export type paths = {
*/
post: operations['bubble-game/ranking'];
};
'/reversi/cancel-match': {
/**
* reversi/cancel-match
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:account*
*/
post: operations['reversi/cancel-match'];
};
'/reversi/games': {
/**
* reversi/games
* @description No description provided.
*
* **Credential required**: *No*
*/
post: operations['reversi/games'];
};
'/reversi/match': {
/**
* reversi/match
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:account*
*/
post: operations['reversi/match'];
};
'/reversi/invitations': {
/**
* reversi/invitations
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:account*
*/
post: operations['reversi/invitations'];
};
'/reversi/show-game': {
/**
* reversi/show-game
* @description No description provided.
*
* **Credential required**: *No*
*/
post: operations['reversi/show-game'];
};
'/reversi/surrender': {
/**
* reversi/surrender
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:account*
*/
post: operations['reversi/surrender'];
};
};
export type webhooks = Record<string, never>;
@@ -4509,6 +4562,74 @@ export type components = {
};
usersCount: number;
});
ReversiGameLite: {
/** Format: id */
id: string;
/** Format: date-time */
createdAt: string;
/** Format: date-time */
startedAt: string | null;
/** Format: date-time */
endedAt: string | null;
isStarted: boolean;
isEnded: boolean;
/** Format: id */
user1Id: string;
/** Format: id */
user2Id: string;
user1: components['schemas']['User'];
user2: components['schemas']['User'];
/** Format: id */
winnerId: string | null;
winner: components['schemas']['User'] | null;
/** Format: id */
surrenderedUserId: string | null;
/** Format: id */
timeoutUserId: string | null;
black: number | null;
bw: string;
isLlotheo: boolean;
canPutEverywhere: boolean;
loopedBoard: boolean;
timeLimitForEachTurn: number;
};
ReversiGameDetailed: {
/** Format: id */
id: string;
/** Format: date-time */
createdAt: string;
/** Format: date-time */
startedAt: string | null;
/** Format: date-time */
endedAt: string | null;
isStarted: boolean;
isEnded: boolean;
form1: Record<string, never> | null;
form2: Record<string, never> | null;
user1Ready: boolean;
user2Ready: boolean;
/** Format: id */
user1Id: string;
/** Format: id */
user2Id: string;
user1: components['schemas']['User'];
user2: components['schemas']['User'];
/** Format: id */
winnerId: string | null;
winner: components['schemas']['User'] | null;
/** Format: id */
surrenderedUserId: string | null;
/** Format: id */
timeoutUserId: string | null;
black: number | null;
bw: string;
isLlotheo: boolean;
canPutEverywhere: boolean;
loopedBoard: boolean;
timeLimitForEachTurn: number;
logs: unknown[][];
map: string[];
};
AbuseUserReport: {
/**
* Format: id
@@ -26042,5 +26163,325 @@ export type operations = {
};
};
};
/**
* reversi/cancel-match
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:account*
*/
'reversi/cancel-match': {
requestBody: {
content: {
'application/json': {
/** Format: misskey:id */
userId?: string | null;
};
};
};
responses: {
/** @description OK (with results) */
200: {
content: {
'application/json': unknown;
};
};
/** @description Client error */
400: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Authentication error */
401: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Forbidden error */
403: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description I'm Ai */
418: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Internal server error */
500: {
content: {
'application/json': components['schemas']['Error'];
};
};
};
};
/**
* reversi/games
* @description No description provided.
*
* **Credential required**: *No*
*/
'reversi/games': {
requestBody: {
content: {
'application/json': {
/** @default 10 */
limit?: number;
/** Format: misskey:id */
sinceId?: string;
/** Format: misskey:id */
untilId?: string;
/** @default false */
my?: boolean;
};
};
};
responses: {
/** @description OK (with results) */
200: {
content: {
'application/json': components['schemas']['ReversiGameLite'][];
};
};
/** @description Client error */
400: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Authentication error */
401: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Forbidden error */
403: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description I'm Ai */
418: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Internal server error */
500: {
content: {
'application/json': components['schemas']['Error'];
};
};
};
};
/**
* reversi/match
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:account*
*/
'reversi/match': {
requestBody: {
content: {
'application/json': {
/** Format: misskey:id */
userId?: string | null;
};
};
};
responses: {
/** @description OK (with results) */
200: {
content: {
'application/json': unknown;
};
};
/** @description Client error */
400: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Authentication error */
401: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Forbidden error */
403: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description I'm Ai */
418: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Internal server error */
500: {
content: {
'application/json': components['schemas']['Error'];
};
};
};
};
/**
* reversi/invitations
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:account*
*/
'reversi/invitations': {
responses: {
/** @description OK (with results) */
200: {
content: {
'application/json': components['schemas']['UserLite'][];
};
};
/** @description Client error */
400: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Authentication error */
401: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Forbidden error */
403: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description I'm Ai */
418: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Internal server error */
500: {
content: {
'application/json': components['schemas']['Error'];
};
};
};
};
/**
* reversi/show-game
* @description No description provided.
*
* **Credential required**: *No*
*/
'reversi/show-game': {
requestBody: {
content: {
'application/json': {
/** Format: misskey:id */
gameId: string;
};
};
};
responses: {
/** @description OK (with results) */
200: {
content: {
'application/json': components['schemas']['ReversiGameDetailed'];
};
};
/** @description Client error */
400: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Authentication error */
401: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Forbidden error */
403: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description I'm Ai */
418: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Internal server error */
500: {
content: {
'application/json': components['schemas']['Error'];
};
};
};
};
/**
* reversi/surrender
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *read:account*
*/
'reversi/surrender': {
requestBody: {
content: {
'application/json': {
/** Format: misskey:id */
gameId: string;
};
};
};
responses: {
/** @description OK (without any results) */
204: {
content: never;
};
/** @description Client error */
400: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Authentication error */
401: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Forbidden error */
403: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description I'm Ai */
418: {
content: {
'application/json': components['schemas']['Error'];
};
};
/** @description Internal server error */
500: {
content: {
'application/json': components['schemas']['Error'];
};
};
};
};
};

View File

@@ -1,8 +1,8 @@
import { ModerationLogPayloads } from './consts.js';
import { Announcement, EmojiDetailed, MeDetailed, Page, User, UserDetailed } from './autogen/models';
import { Announcement, EmojiDetailed, MeDetailed, MeDetailedOnly, Page, User, UserDetailed } from './autogen/models.js';
export * from './autogen/entities';
export * from './autogen/models';
export * from './autogen/entities.js';
export * from './autogen/models.js';
export type ID = string;
export type DateString = string;

View File

@@ -1,7 +1,9 @@
import { EventEmitter } from 'eventemitter3';
import ReconnectingWebsocket from 'reconnecting-websocket';
import _ReconnectingWebsocket from 'reconnecting-websocket';
import type { BroadcastEvents, Channels } from './streaming.types.js';
const ReconnectingWebsocket = _ReconnectingWebsocket as unknown as typeof _ReconnectingWebsocket['default'];
export function urlQuery(obj: Record<string, string | number | boolean | undefined>): string {
const params = Object.entries(obj)
.filter(([, v]) => Array.isArray(v) ? v.length : v !== undefined)
@@ -24,7 +26,7 @@ type StreamEvents = {
* Misskey stream connection
*/
export default class Stream extends EventEmitter<StreamEvents> {
private stream: ReconnectingWebsocket;
private stream: _ReconnectingWebsocket.default;
public state: 'initializing' | 'reconnecting' | 'connected' = 'initializing';
private sharedConnectionPools: Pool[] = [];
private sharedConnections: SharedConnection[] = [];