126 lines
3.5 KiB
JavaScript
126 lines
3.5 KiB
JavaScript
function _ts_decorate(decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
}
|
|
function _ts_metadata(k, v) {
|
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
}
|
|
import { Column, Entity, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm";
|
|
import { id } from "../id.js";
|
|
import { User } from "./user.js";
|
|
export let ShogiGame = class ShogiGame {
|
|
id;
|
|
startedAt;
|
|
endedAt;
|
|
user1Id;
|
|
user1;
|
|
user2Id;
|
|
user2;
|
|
user1Ready;
|
|
user2Ready;
|
|
sente;
|
|
isStarted;
|
|
isEnded;
|
|
winnerId;
|
|
surrenderedUserId;
|
|
sfen;
|
|
logs;
|
|
};
|
|
_ts_decorate([
|
|
PrimaryColumn(id()),
|
|
_ts_metadata("design:type", String)
|
|
], ShogiGame.prototype, "id", void 0);
|
|
_ts_decorate([
|
|
Column("timestamp with time zone", {
|
|
nullable: true
|
|
}),
|
|
_ts_metadata("design:type", Object)
|
|
], ShogiGame.prototype, "startedAt", void 0);
|
|
_ts_decorate([
|
|
Column("timestamp with time zone", {
|
|
nullable: true
|
|
}),
|
|
_ts_metadata("design:type", Object)
|
|
], ShogiGame.prototype, "endedAt", void 0);
|
|
_ts_decorate([
|
|
Column(id()),
|
|
_ts_metadata("design:type", Object)
|
|
], ShogiGame.prototype, "user1Id", void 0);
|
|
_ts_decorate([
|
|
ManyToOne(()=>User, {
|
|
onDelete: "CASCADE"
|
|
}),
|
|
JoinColumn(),
|
|
_ts_metadata("design:type", Object)
|
|
], ShogiGame.prototype, "user1", void 0);
|
|
_ts_decorate([
|
|
Column(id()),
|
|
_ts_metadata("design:type", Object)
|
|
], ShogiGame.prototype, "user2Id", void 0);
|
|
_ts_decorate([
|
|
ManyToOne(()=>User, {
|
|
onDelete: "CASCADE"
|
|
}),
|
|
JoinColumn(),
|
|
_ts_metadata("design:type", Object)
|
|
], ShogiGame.prototype, "user2", void 0);
|
|
_ts_decorate([
|
|
Column("boolean", {
|
|
default: false
|
|
}),
|
|
_ts_metadata("design:type", Boolean)
|
|
], ShogiGame.prototype, "user1Ready", void 0);
|
|
_ts_decorate([
|
|
Column("boolean", {
|
|
default: false
|
|
}),
|
|
_ts_metadata("design:type", Boolean)
|
|
], ShogiGame.prototype, "user2Ready", void 0);
|
|
_ts_decorate([
|
|
Column("integer", {
|
|
nullable: true
|
|
}),
|
|
_ts_metadata("design:type", Object)
|
|
], ShogiGame.prototype, "sente", void 0);
|
|
_ts_decorate([
|
|
Column("boolean", {
|
|
default: false
|
|
}),
|
|
_ts_metadata("design:type", Boolean)
|
|
], ShogiGame.prototype, "isStarted", void 0);
|
|
_ts_decorate([
|
|
Column("boolean", {
|
|
default: false
|
|
}),
|
|
_ts_metadata("design:type", Boolean)
|
|
], ShogiGame.prototype, "isEnded", void 0);
|
|
_ts_decorate([
|
|
Column({
|
|
...id(),
|
|
nullable: true
|
|
}),
|
|
_ts_metadata("design:type", Object)
|
|
], ShogiGame.prototype, "winnerId", void 0);
|
|
_ts_decorate([
|
|
Column({
|
|
...id(),
|
|
nullable: true
|
|
}),
|
|
_ts_metadata("design:type", Object)
|
|
], ShogiGame.prototype, "surrenderedUserId", void 0);
|
|
_ts_decorate([
|
|
Column("text"),
|
|
_ts_metadata("design:type", String)
|
|
], ShogiGame.prototype, "sfen", void 0);
|
|
_ts_decorate([
|
|
Column("jsonb", {
|
|
default: []
|
|
}),
|
|
_ts_metadata("design:type", typeof Array === "undefined" ? Object : Array)
|
|
], ShogiGame.prototype, "logs", void 0);
|
|
ShogiGame = _ts_decorate([
|
|
Entity("shogi_game")
|
|
], ShogiGame);
|