This commit is contained in:
syuilo
2024-01-18 20:59:21 +09:00
parent 58f4d5d790
commit 1259fabd7f
21 changed files with 1297 additions and 55 deletions

View File

@@ -3,7 +3,107 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
export const packedReversiGameSchema = {
export const packedReversiGameLiteSchema = {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
createdAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
startedAt: {
type: 'string',
optional: false, nullable: true,
format: 'date-time',
},
isStarted: {
type: 'boolean',
optional: false, nullable: false,
},
isEnded: {
type: 'boolean',
optional: false, nullable: false,
},
form1: {
type: 'any',
optional: false, nullable: true,
},
form2: {
type: 'any',
optional: false, nullable: true,
},
user1Accepted: {
type: 'boolean',
optional: false, nullable: false,
},
user2Accepted: {
type: 'boolean',
optional: false, nullable: false,
},
user1Id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
user2Id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
user1: {
type: 'object',
optional: false, nullable: false,
ref: 'User',
},
user2: {
type: 'object',
optional: false, nullable: false,
ref: 'User',
},
winnerId: {
type: 'string',
optional: false, nullable: true,
format: 'id',
},
winner: {
type: 'object',
optional: false, nullable: true,
ref: 'User',
},
surrendered: {
type: 'string',
optional: false, nullable: true,
format: 'id',
},
black: {
type: 'number',
optional: false, nullable: true,
},
bw: {
type: 'string',
optional: false, nullable: false,
},
isLlotheo: {
type: 'boolean',
optional: false, nullable: false,
},
canPutEverywhere: {
type: 'boolean',
optional: false, nullable: false,
},
loopedBoard: {
type: 'boolean',
optional: false, nullable: false,
},
},
} as const;
export const packedReversiGameDetailedSchema = {
type: 'object',
properties: {
id: {
@@ -102,10 +202,10 @@ export const packedReversiGameSchema = {
},
logs: {
type: 'array',
optional: true, nullable: false,
optional: false, nullable: false,
items: {
type: 'object',
optional: true, nullable: false,
optional: false, nullable: false,
properties: {
at: {
type: 'string',
@@ -125,7 +225,7 @@ export const packedReversiGameSchema = {
},
map: {
type: 'array',
optional: true, nullable: false,
optional: false, nullable: false,
items: {
type: 'string',
optional: false, nullable: false,