feat: reversi

Resolve #12962
This commit is contained in:
syuilo 2024-01-19 20:51:49 +09:00
parent 678dba9245
commit a637b4e282
56 changed files with 4701 additions and 108 deletions

View file

@ -1623,6 +1623,16 @@ declare namespace entities {
BubbleGameRegisterResponse,
BubbleGameRankingRequest,
BubbleGameRankingResponse,
ReversiCancelMatchRequest,
ReversiCancelMatchResponse,
ReversiGamesRequest,
ReversiGamesResponse,
ReversiMatchRequest,
ReversiMatchResponse,
ReversiInvitationsResponse,
ReversiShowGameRequest,
ReversiShowGameResponse,
ReversiSurrenderRequest,
Error_2 as Error,
UserLite,
UserDetailedNotMeOnly,
@ -1659,7 +1669,9 @@ declare namespace entities {
Flash,
Signin,
RoleLite,
Role
Role,
ReversiGameLite,
ReversiGameDetailed
}
}
export { entities }
@ -2596,6 +2608,42 @@ type ResetPasswordRequest = operations['reset-password']['requestBody']['content
// @public (undocumented)
type RetentionResponse = operations['retention']['responses']['200']['content']['application/json'];
// @public (undocumented)
type ReversiCancelMatchRequest = operations['reversi/cancel-match']['requestBody']['content']['application/json'];
// @public (undocumented)
type ReversiCancelMatchResponse = operations['reversi/cancel-match']['responses']['200']['content']['application/json'];
// @public (undocumented)
type ReversiGameDetailed = components['schemas']['ReversiGameDetailed'];
// @public (undocumented)
type ReversiGameLite = components['schemas']['ReversiGameLite'];
// @public (undocumented)
type ReversiGamesRequest = operations['reversi/games']['requestBody']['content']['application/json'];
// @public (undocumented)
type ReversiGamesResponse = operations['reversi/games']['responses']['200']['content']['application/json'];
// @public (undocumented)
type ReversiInvitationsResponse = operations['reversi/invitations']['responses']['200']['content']['application/json'];
// @public (undocumented)
type ReversiMatchRequest = operations['reversi/match']['requestBody']['content']['application/json'];
// @public (undocumented)
type ReversiMatchResponse = operations['reversi/match']['responses']['200']['content']['application/json'];
// @public (undocumented)
type ReversiShowGameRequest = operations['reversi/show-game']['requestBody']['content']['application/json'];
// @public (undocumented)
type ReversiShowGameResponse = operations['reversi/show-game']['responses']['200']['content']['application/json'];
// @public (undocumented)
type ReversiSurrenderRequest = operations['reversi/surrender']['requestBody']['content']['application/json'];
// @public (undocumented)
type Role = components['schemas']['Role'];

View file

@ -1,6 +1,6 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-13T04:31:38.782Z
* generatedAt: 2024-01-19T11:00:07.160Z
*/
import type { SwitchCaseResponseType } from '../api.js';
@ -4007,5 +4007,71 @@ declare module '../api.js' {
params: P,
credential?: string | null,
): Promise<SwitchCaseResponseType<E, P>>;
/**
* No description provided.
*
* **Credential required**: *Yes* / **Permission**: *write: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**: *write: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**: *write: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,6 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-13T04:31:38.778Z
* generatedAt: 2024-01-19T11:00:07.158Z
*/
import type {
@ -544,6 +544,16 @@ import type {
BubbleGameRegisterResponse,
BubbleGameRankingRequest,
BubbleGameRankingResponse,
ReversiCancelMatchRequest,
ReversiCancelMatchResponse,
ReversiGamesRequest,
ReversiGamesResponse,
ReversiMatchRequest,
ReversiMatchResponse,
ReversiInvitationsResponse,
ReversiShowGameRequest,
ReversiShowGameResponse,
ReversiSurrenderRequest,
} from './entities.js';
export type Endpoints = {
@ -907,4 +917,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,6 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-13T04:31:38.775Z
* generatedAt: 2024-01-19T11:00:07.156Z
*/
import { operations } from './types.js';
@ -546,3 +546,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,6 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-13T04:31:38.773Z
* generatedAt: 2024-01-19T11:00:07.155Z
*/
import { components } from './types.js';
@ -41,3 +41,5 @@ export type Flash = components['schemas']['Flash'];
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'];

View file

@ -3,7 +3,7 @@
/*
* version: 2023.12.2
* generatedAt: 2024-01-13T04:31:38.633Z
* generatedAt: 2024-01-19T11:00:07.077Z
*/
/**
@ -3472,6 +3472,60 @@ export type paths = {
*/
post: operations['bubble-game/ranking'];
};
'/reversi/cancel-match': {
/**
* reversi/cancel-match
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *write: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**: *write: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**: *write:account*
*/
post: operations['reversi/surrender'];
};
};
export type webhooks = Record<string, never>;
@ -4404,6 +4458,72 @@ export type components = {
};
usersCount: number;
});
ReversiGameLite: {
/** Format: id */
id: string;
/** Format: date-time */
createdAt: string;
/** Format: date-time */
startedAt: 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 */
surrendered: string | null;
black: number | null;
bw: string;
isLlotheo: boolean;
canPutEverywhere: boolean;
loopedBoard: boolean;
};
ReversiGameDetailed: {
/** Format: id */
id: string;
/** Format: date-time */
createdAt: string;
/** Format: date-time */
startedAt: 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 */
surrendered: string | null;
black: number | null;
bw: string;
isLlotheo: boolean;
canPutEverywhere: boolean;
loopedBoard: boolean;
logs: {
at: number;
color: boolean;
pos: number;
}[];
map: string[];
};
};
responses: never;
parameters: never;
@ -25542,5 +25662,325 @@ export type operations = {
};
};
};
/**
* reversi/cancel-match
* @description No description provided.
*
* **Credential required**: *Yes* / **Permission**: *write: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**: *write: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**: *write: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'];
};
};
};
};
};