133 lines
3.4 KiB
JavaScript
133 lines
3.4 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 { PrimaryColumn, Entity, Index, Column } from "typeorm";
|
|
import { id } from "../id.js";
|
|
export let Emoji = class Emoji {
|
|
id;
|
|
updatedAt;
|
|
name;
|
|
host;
|
|
category;
|
|
originalUrl;
|
|
publicUrl;
|
|
uri;
|
|
// publicUrlの方のtypeが入る
|
|
// (mime)
|
|
type;
|
|
aliases;
|
|
license;
|
|
glyph;
|
|
width;
|
|
height;
|
|
};
|
|
_ts_decorate([
|
|
PrimaryColumn(id()),
|
|
_ts_metadata("design:type", String)
|
|
], Emoji.prototype, "id", void 0);
|
|
_ts_decorate([
|
|
Column("timestamp with time zone", {
|
|
nullable: true
|
|
}),
|
|
_ts_metadata("design:type", Object)
|
|
], Emoji.prototype, "updatedAt", void 0);
|
|
_ts_decorate([
|
|
Index(),
|
|
Column("varchar", {
|
|
length: 128
|
|
}),
|
|
_ts_metadata("design:type", String)
|
|
], Emoji.prototype, "name", void 0);
|
|
_ts_decorate([
|
|
Index(),
|
|
Column("varchar", {
|
|
length: 512,
|
|
nullable: true
|
|
}),
|
|
_ts_metadata("design:type", Object)
|
|
], Emoji.prototype, "host", void 0);
|
|
_ts_decorate([
|
|
Column("varchar", {
|
|
length: 128,
|
|
nullable: true
|
|
}),
|
|
_ts_metadata("design:type", Object)
|
|
], Emoji.prototype, "category", void 0);
|
|
_ts_decorate([
|
|
Column("varchar", {
|
|
length: 512
|
|
}),
|
|
_ts_metadata("design:type", String)
|
|
], Emoji.prototype, "originalUrl", void 0);
|
|
_ts_decorate([
|
|
Column("varchar", {
|
|
length: 512,
|
|
default: ""
|
|
}),
|
|
_ts_metadata("design:type", String)
|
|
], Emoji.prototype, "publicUrl", void 0);
|
|
_ts_decorate([
|
|
Column("varchar", {
|
|
length: 512,
|
|
nullable: true
|
|
}),
|
|
_ts_metadata("design:type", Object)
|
|
], Emoji.prototype, "uri", void 0);
|
|
_ts_decorate([
|
|
Column("varchar", {
|
|
length: 64,
|
|
nullable: true
|
|
}),
|
|
_ts_metadata("design:type", Object)
|
|
], Emoji.prototype, "type", void 0);
|
|
_ts_decorate([
|
|
Column("varchar", {
|
|
array: true,
|
|
length: 128,
|
|
default: "{}"
|
|
}),
|
|
_ts_metadata("design:type", Array)
|
|
], Emoji.prototype, "aliases", void 0);
|
|
_ts_decorate([
|
|
Column("varchar", {
|
|
length: 1024,
|
|
nullable: true
|
|
}),
|
|
_ts_metadata("design:type", Object)
|
|
], Emoji.prototype, "license", void 0);
|
|
_ts_decorate([
|
|
Column("boolean", {
|
|
default: false
|
|
}),
|
|
_ts_metadata("design:type", Boolean)
|
|
], Emoji.prototype, "glyph", void 0);
|
|
_ts_decorate([
|
|
Column("integer", {
|
|
nullable: true,
|
|
comment: "Image width"
|
|
}),
|
|
_ts_metadata("design:type", Object)
|
|
], Emoji.prototype, "width", void 0);
|
|
_ts_decorate([
|
|
Column("integer", {
|
|
nullable: true,
|
|
comment: "Image height"
|
|
}),
|
|
_ts_metadata("design:type", Object)
|
|
], Emoji.prototype, "height", void 0);
|
|
Emoji = _ts_decorate([
|
|
Entity(),
|
|
Index([
|
|
"name",
|
|
"host"
|
|
], {
|
|
unique: true
|
|
})
|
|
], Emoji);
|