Fixed 267U.pre2
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let AbuseUserReport = class AbuseUserReport {
|
||||
id;
|
||||
createdAt;
|
||||
targetUserId;
|
||||
targetUser;
|
||||
reporterId;
|
||||
reporter;
|
||||
assigneeId;
|
||||
assignee;
|
||||
resolved;
|
||||
forwarded;
|
||||
comment;
|
||||
//#region Denormalized fields
|
||||
targetUserHost;
|
||||
reporterHost;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], AbuseUserReport.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the AbuseUserReport."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], AbuseUserReport.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AbuseUserReport.prototype, "targetUserId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AbuseUserReport.prototype, "targetUser", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AbuseUserReport.prototype, "reporterId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AbuseUserReport.prototype, "reporter", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AbuseUserReport.prototype, "assigneeId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "SET NULL"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AbuseUserReport.prototype, "assignee", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], AbuseUserReport.prototype, "resolved", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], AbuseUserReport.prototype, "forwarded", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 2048
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], AbuseUserReport.prototype, "comment", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AbuseUserReport.prototype, "targetUserHost", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AbuseUserReport.prototype, "reporterHost", void 0);
|
||||
AbuseUserReport = _ts_decorate([
|
||||
Entity()
|
||||
], AbuseUserReport);
|
||||
@@ -0,0 +1,132 @@
|
||||
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 { Entity, PrimaryColumn, Index, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { App } from "./app.js";
|
||||
import { id } from "../id.js";
|
||||
export let AccessToken = class AccessToken {
|
||||
id;
|
||||
createdAt;
|
||||
lastUsedAt;
|
||||
token;
|
||||
session;
|
||||
hash;
|
||||
userId;
|
||||
user;
|
||||
appId;
|
||||
app;
|
||||
name;
|
||||
description;
|
||||
iconUrl;
|
||||
permission;
|
||||
fetched;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], AccessToken.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the AccessToken."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], AccessToken.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AccessToken.prototype, "lastUsedAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], AccessToken.prototype, "token", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AccessToken.prototype, "session", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], AccessToken.prototype, "hash", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AccessToken.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AccessToken.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AccessToken.prototype, "appId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>App, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AccessToken.prototype, "app", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AccessToken.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AccessToken.prototype, "description", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AccessToken.prototype, "iconUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], AccessToken.prototype, "permission", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], AccessToken.prototype, "fetched", void 0);
|
||||
AccessToken = _ts_decorate([
|
||||
Entity()
|
||||
], AccessToken);
|
||||
@@ -0,0 +1,64 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { Announcement } from "./announcement.js";
|
||||
import { id } from "../id.js";
|
||||
export let AnnouncementRead = class AnnouncementRead {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
announcementId;
|
||||
announcement;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], AnnouncementRead.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the AnnouncementRead."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], AnnouncementRead.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AnnouncementRead.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AnnouncementRead.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AnnouncementRead.prototype, "announcementId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Announcement, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AnnouncementRead.prototype, "announcement", void 0);
|
||||
AnnouncementRead = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"announcementId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], AnnouncementRead);
|
||||
@@ -0,0 +1,85 @@
|
||||
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 { Entity, Index, Column, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
export let Announcement = class Announcement {
|
||||
id;
|
||||
createdAt;
|
||||
updatedAt;
|
||||
text;
|
||||
title;
|
||||
imageUrl;
|
||||
showPopup;
|
||||
isGoodNews;
|
||||
constructor(data){
|
||||
if (data == null) return;
|
||||
for (const [k, v] of Object.entries(data)){
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Announcement.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Announcement."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Announcement.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The updated date of the Announcement.",
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Announcement.prototype, "updatedAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 8192,
|
||||
nullable: false
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Announcement.prototype, "text", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
nullable: false
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Announcement.prototype, "title", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 1024,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Announcement.prototype, "imageUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Announcement.prototype, "showPopup", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Announcement.prototype, "isGoodNews", void 0);
|
||||
Announcement = _ts_decorate([
|
||||
Entity(),
|
||||
_ts_metadata("design:type", Function),
|
||||
_ts_metadata("design:paramtypes", [
|
||||
typeof Partial === "undefined" ? Object : Partial
|
||||
])
|
||||
], Announcement);
|
||||
@@ -0,0 +1,164 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
import { UserList } from "./user-list.js";
|
||||
import { UserGroupJoining } from "./user-group-joining.js";
|
||||
export let Antenna = class Antenna {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
name;
|
||||
src;
|
||||
userListId;
|
||||
userList;
|
||||
userGroupJoiningId;
|
||||
userGroupJoining;
|
||||
users;
|
||||
instances;
|
||||
keywords;
|
||||
excludeKeywords;
|
||||
caseSensitive;
|
||||
withReplies;
|
||||
withFile;
|
||||
expression;
|
||||
notify;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Antenna.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Antenna."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Antenna.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The owner ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Antenna.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Antenna.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
comment: "The name of the Antenna."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Antenna.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column("enum", {
|
||||
enum: [
|
||||
"home",
|
||||
"all",
|
||||
"users",
|
||||
"list",
|
||||
"group",
|
||||
"instances"
|
||||
]
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Antenna.prototype, "src", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Antenna.prototype, "userListId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>UserList, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Antenna.prototype, "userList", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Antenna.prototype, "userGroupJoiningId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>UserGroupJoining, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Antenna.prototype, "userGroupJoining", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 1024,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Antenna.prototype, "users", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: []
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Antenna.prototype, "instances", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: []
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Antenna.prototype, "keywords", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: []
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Antenna.prototype, "excludeKeywords", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Antenna.prototype, "caseSensitive", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Antenna.prototype, "withReplies", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean"),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Antenna.prototype, "withFile", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 2048,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Antenna.prototype, "expression", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean"),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Antenna.prototype, "notify", void 0);
|
||||
Antenna = _ts_decorate([
|
||||
Entity()
|
||||
], Antenna);
|
||||
@@ -0,0 +1,91 @@
|
||||
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 { Entity, PrimaryColumn, Column, Index, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let App = class App {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
secret;
|
||||
name;
|
||||
description;
|
||||
permission;
|
||||
callbackUrl;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], App.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the App."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], App.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The owner ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], App.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "SET NULL",
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], App.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
comment: "The secret key of the App."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], App.prototype, "secret", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
comment: "The name of the App."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], App.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
comment: "The description of the App."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], App.prototype, "description", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
array: true,
|
||||
comment: "The permission of the App."
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], App.prototype, "permission", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The callbackUrl of the App."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], App.prototype, "callbackUrl", void 0);
|
||||
App = _ts_decorate([
|
||||
Entity()
|
||||
], App);
|
||||
@@ -0,0 +1,70 @@
|
||||
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, JoinColumn, Column, ManyToOne, Index } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let AttestationChallenge = class AttestationChallenge {
|
||||
id;
|
||||
userId;
|
||||
user;
|
||||
challenge;
|
||||
createdAt;
|
||||
registrationChallenge;
|
||||
constructor(data){
|
||||
if (data == null) return;
|
||||
for (const [k, v] of Object.entries(data)){
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], AttestationChallenge.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AttestationChallenge.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AttestationChallenge.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
comment: "Hex-encoded sha256 hash of the challenge."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], AttestationChallenge.prototype, "challenge", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The date challenge was created for expiry purposes."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], AttestationChallenge.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
comment: "Indicates that the challenge is only for registration purposes if true to prevent the challenge for being used as authentication.",
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], AttestationChallenge.prototype, "registrationChallenge", void 0);
|
||||
AttestationChallenge = _ts_decorate([
|
||||
Entity(),
|
||||
_ts_metadata("design:type", Function),
|
||||
_ts_metadata("design:paramtypes", [
|
||||
typeof Partial === "undefined" ? Object : Partial
|
||||
])
|
||||
], AttestationChallenge);
|
||||
@@ -0,0 +1,68 @@
|
||||
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 { Entity, PrimaryColumn, Index, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { App } from "./app.js";
|
||||
import { id } from "../id.js";
|
||||
export let AuthSession = class AuthSession {
|
||||
id;
|
||||
createdAt;
|
||||
token;
|
||||
userId;
|
||||
user;
|
||||
appId;
|
||||
app;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], AuthSession.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the AuthSession."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], AuthSession.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], AuthSession.prototype, "token", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AuthSession.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE",
|
||||
nullable: true
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AuthSession.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AuthSession.prototype, "appId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>App, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], AuthSession.prototype, "app", void 0);
|
||||
AuthSession = _ts_decorate([
|
||||
Entity()
|
||||
], AuthSession);
|
||||
@@ -0,0 +1,114 @@
|
||||
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 { Check, Column, Entity, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { User } from "./user.js";
|
||||
import { Note } from "./note.js";
|
||||
export let Bite = class Bite {
|
||||
id;
|
||||
createdAt;
|
||||
uri;
|
||||
userId;
|
||||
user;
|
||||
userHost;
|
||||
targetUserId;
|
||||
targetUser;
|
||||
targetBiteId;
|
||||
targetBite;
|
||||
targetNoteId;
|
||||
targetNote;
|
||||
replied;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Bite.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Bite.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "null if local"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Bite.prototype, "uri", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Bite.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Bite.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Bite.prototype, "userHost", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Bite.prototype, "targetUserId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>User, {
|
||||
onDelete: "CASCADE",
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Bite.prototype, "targetUser", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Bite.prototype, "targetBiteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>Bite, {
|
||||
onDelete: "CASCADE",
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Bite.prototype, "targetBite", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Bite.prototype, "targetNoteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>Note, {
|
||||
onDelete: "CASCADE",
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Bite.prototype, "targetNote", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: true
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Bite.prototype, "replied", void 0);
|
||||
Bite = _ts_decorate([
|
||||
Entity(),
|
||||
Check(`"targetUserId" IS NOT NULL OR "targetBiteId" IS NOT NULL OR "targetNoteId" IS NOT NULL`)
|
||||
], Bite);
|
||||
@@ -0,0 +1,96 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { UserGroup } from "./user-group.js";
|
||||
import { id } from "../id.js";
|
||||
export let Blocking = class Blocking {
|
||||
id;
|
||||
createdAt;
|
||||
blockeeId;
|
||||
blockee;
|
||||
groupId;
|
||||
group;
|
||||
blockerId;
|
||||
blocker;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Blocking.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Blocking."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Blocking.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The blockee user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Blocking.prototype, "blockeeId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Blocking.prototype, "blockee", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Blocking.prototype, "groupId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>UserGroup, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Blocking.prototype, "group", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The blocker user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Blocking.prototype, "blockerId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Blocking.prototype, "blocker", void 0);
|
||||
Blocking = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"blockerId",
|
||||
"blockeeId"
|
||||
], {
|
||||
unique: true,
|
||||
where: '"groupId" IS NULL'
|
||||
}),
|
||||
Index([
|
||||
"groupId",
|
||||
"blockeeId"
|
||||
], {
|
||||
unique: true,
|
||||
where: '"groupId" IS NOT NULL'
|
||||
})
|
||||
], Blocking);
|
||||
@@ -0,0 +1,96 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { UserGroup } from "./user-group.js";
|
||||
import { id } from "../id.js";
|
||||
export let CallBlocking = class CallBlocking {
|
||||
id;
|
||||
createdAt;
|
||||
blockeeId;
|
||||
blockee;
|
||||
groupId;
|
||||
group;
|
||||
blockerId;
|
||||
blocker;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], CallBlocking.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the CallBlocking."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], CallBlocking.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The call-blocked user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], CallBlocking.prototype, "blockeeId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], CallBlocking.prototype, "blockee", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], CallBlocking.prototype, "groupId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>UserGroup, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], CallBlocking.prototype, "group", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The call-blocking user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], CallBlocking.prototype, "blockerId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], CallBlocking.prototype, "blocker", void 0);
|
||||
CallBlocking = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"blockerId",
|
||||
"blockeeId"
|
||||
], {
|
||||
unique: true,
|
||||
where: '"groupId" IS NULL'
|
||||
}),
|
||||
Index([
|
||||
"groupId",
|
||||
"blockeeId"
|
||||
], {
|
||||
unique: true,
|
||||
where: '"groupId" IS NOT NULL'
|
||||
})
|
||||
], CallBlocking);
|
||||
@@ -0,0 +1,71 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
import { Channel } from "./channel.js";
|
||||
export let ChannelFollowing = class ChannelFollowing {
|
||||
id;
|
||||
createdAt;
|
||||
followeeId;
|
||||
followee;
|
||||
followerId;
|
||||
follower;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], ChannelFollowing.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the ChannelFollowing."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], ChannelFollowing.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The followee channel ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ChannelFollowing.prototype, "followeeId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Channel, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ChannelFollowing.prototype, "followee", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The follower user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ChannelFollowing.prototype, "followerId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ChannelFollowing.prototype, "follower", void 0);
|
||||
ChannelFollowing = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"followerId",
|
||||
"followeeId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], ChannelFollowing);
|
||||
@@ -0,0 +1,63 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { Note } from "./note.js";
|
||||
import { Channel } from "./channel.js";
|
||||
import { id } from "../id.js";
|
||||
export let ChannelNotePining = class ChannelNotePining {
|
||||
id;
|
||||
createdAt;
|
||||
channelId;
|
||||
channel;
|
||||
noteId;
|
||||
note;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], ChannelNotePining.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the ChannelNotePining."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], ChannelNotePining.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ChannelNotePining.prototype, "channelId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Channel, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ChannelNotePining.prototype, "channel", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ChannelNotePining.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ChannelNotePining.prototype, "note", void 0);
|
||||
ChannelNotePining = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"channelId",
|
||||
"noteId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], ChannelNotePining);
|
||||
@@ -0,0 +1,109 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
import { DriveFile } from "./drive-file.js";
|
||||
export let Channel = class Channel {
|
||||
id;
|
||||
createdAt;
|
||||
lastNotedAt;
|
||||
userId;
|
||||
user;
|
||||
name;
|
||||
description;
|
||||
bannerId;
|
||||
banner;
|
||||
notesCount;
|
||||
usersCount;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Channel.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Channel."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Channel.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Channel.prototype, "lastNotedAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The owner ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Channel.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "SET NULL"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Channel.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
comment: "The name of the Channel."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Channel.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 2048,
|
||||
nullable: true,
|
||||
comment: "The description of the Channel."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Channel.prototype, "description", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The ID of banner Channel."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Channel.prototype, "bannerId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>DriveFile, {
|
||||
onDelete: "SET NULL"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Channel.prototype, "banner", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("integer", {
|
||||
default: 0,
|
||||
comment: "The count of notes."
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Channel.prototype, "notesCount", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("integer", {
|
||||
default: 0,
|
||||
comment: "The count of users."
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Channel.prototype, "usersCount", void 0);
|
||||
Channel = _ts_decorate([
|
||||
Entity()
|
||||
], Channel);
|
||||
@@ -0,0 +1,63 @@
|
||||
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 { Entity, Index, JoinColumn, Column, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { Note } from "./note.js";
|
||||
import { Clip } from "./clip.js";
|
||||
import { id } from "../id.js";
|
||||
export let ClipNote = class ClipNote {
|
||||
id;
|
||||
noteId;
|
||||
note;
|
||||
clipId;
|
||||
clip;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], ClipNote.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The note ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ClipNote.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ClipNote.prototype, "note", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The clip ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ClipNote.prototype, "clipId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Clip, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ClipNote.prototype, "clip", void 0);
|
||||
ClipNote = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"noteId",
|
||||
"clipId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], ClipNote);
|
||||
@@ -0,0 +1,70 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let Clip = class Clip {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
name;
|
||||
isPublic;
|
||||
description;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Clip.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Clip."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Clip.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The owner ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Clip.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Clip.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
comment: "The name of the Clip."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Clip.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Clip.prototype, "isPublic", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 2048,
|
||||
nullable: true,
|
||||
comment: "The description of the Clip."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Clip.prototype, "description", void 0);
|
||||
Clip = _ts_decorate([
|
||||
Entity()
|
||||
], Clip);
|
||||
@@ -0,0 +1,286 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { User } from "./user.js";
|
||||
import { DriveFolder } from "./drive-folder.js";
|
||||
import { DB_MAX_IMAGE_COMMENT_LENGTH } from "../../misc/hard-limits.js";
|
||||
export let DriveFile = class DriveFile {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
userHost;
|
||||
md5;
|
||||
name;
|
||||
type;
|
||||
size;
|
||||
comment;
|
||||
blurhash;
|
||||
properties;
|
||||
storedInternal;
|
||||
url;
|
||||
thumbnailUrl;
|
||||
webpublicUrl;
|
||||
webpublicType;
|
||||
accessKey;
|
||||
thumbnailAccessKey;
|
||||
webpublicAccessKey;
|
||||
uri;
|
||||
src;
|
||||
folderId;
|
||||
folder;
|
||||
isSensitive;
|
||||
allowDownload;
|
||||
isDatabase;
|
||||
/**
|
||||
* 外部の(信頼されていない)URLへの直リンクか否か
|
||||
*/ isLink;
|
||||
requestHeaders;
|
||||
requestIp;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], DriveFile.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the DriveFile."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], DriveFile.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The owner ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "SET NULL"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The host of owner. It will be null if the user in local."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "userHost", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 32,
|
||||
comment: "The MD5 hash of the DriveFile."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], DriveFile.prototype, "md5", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
comment: "The file name of the DriveFile."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], DriveFile.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
comment: "The content type (MIME) of the DriveFile."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], DriveFile.prototype, "type", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
comment: "The file size (bytes) of the DriveFile."
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], DriveFile.prototype, "size", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: DB_MAX_IMAGE_COMMENT_LENGTH,
|
||||
nullable: true,
|
||||
comment: "The comment of the DriveFile."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "comment", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true,
|
||||
comment: "The BlurHash string."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "blurhash", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: {},
|
||||
comment: "The any properties of the DriveFile. For example, it includes image width/height."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "properties", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean"),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], DriveFile.prototype, "storedInternal", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
comment: "The URL of the DriveFile."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], DriveFile.prototype, "url", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The URL of the thumbnail of the DriveFile."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "thumbnailUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The URL of the webpublic of the DriveFile."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "webpublicUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "webpublicType", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "accessKey", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "thumbnailAccessKey", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "webpublicAccessKey", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The URI of the DriveFile. it will be null when the DriveFile is local."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "uri", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "src", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The parent folder ID. If null, it means the DriveFile is located in root."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "folderId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>DriveFolder, {
|
||||
onDelete: "SET NULL"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "folder", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the DriveFile is NSFW."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], DriveFile.prototype, "isSensitive", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean", {
|
||||
default: true,
|
||||
comment: "Whether the DriveFile can be downloaded by users other than its owner."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], DriveFile.prototype, "allowDownload", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the DriveFile is a Lua4Frozen database file."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], DriveFile.prototype, "isDatabase", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the DriveFile is direct link to remote server."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], DriveFile.prototype, "isLink", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: {},
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "requestHeaders", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFile.prototype, "requestIp", void 0);
|
||||
DriveFile = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"folderId",
|
||||
"id"
|
||||
])
|
||||
], DriveFile);
|
||||
@@ -0,0 +1,74 @@
|
||||
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 { JoinColumn, ManyToOne, Entity, PrimaryColumn, Index, Column } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let DriveFolder = class DriveFolder {
|
||||
id;
|
||||
createdAt;
|
||||
name;
|
||||
userId;
|
||||
user;
|
||||
parentId;
|
||||
parent;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], DriveFolder.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the DriveFolder."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], DriveFolder.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
comment: "The name of the DriveFolder."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], DriveFolder.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The owner ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFolder.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFolder.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The parent folder ID. If null, it means the DriveFolder is located in root."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFolder.prototype, "parentId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>DriveFolder, {
|
||||
onDelete: "SET NULL"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], DriveFolder.prototype, "parent", void 0);
|
||||
DriveFolder = _ts_decorate([
|
||||
Entity()
|
||||
], DriveFolder);
|
||||
@@ -0,0 +1,132 @@
|
||||
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);
|
||||
@@ -0,0 +1,133 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let FollowRequest = class FollowRequest {
|
||||
id;
|
||||
createdAt;
|
||||
followeeId;
|
||||
followee;
|
||||
followerId;
|
||||
follower;
|
||||
requestId;
|
||||
//#region Denormalized fields
|
||||
followerHost;
|
||||
followerInbox;
|
||||
followerSharedInbox;
|
||||
followeeHost;
|
||||
followeeInbox;
|
||||
followeeSharedInbox;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], FollowRequest.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the FollowRequest."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], FollowRequest.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The followee user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], FollowRequest.prototype, "followeeId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], FollowRequest.prototype, "followee", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The follower user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], FollowRequest.prototype, "followerId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], FollowRequest.prototype, "follower", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true,
|
||||
comment: "id of Follow Activity."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], FollowRequest.prototype, "requestId", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], FollowRequest.prototype, "followerHost", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], FollowRequest.prototype, "followerInbox", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], FollowRequest.prototype, "followerSharedInbox", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], FollowRequest.prototype, "followeeHost", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], FollowRequest.prototype, "followeeInbox", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], FollowRequest.prototype, "followeeSharedInbox", void 0);
|
||||
FollowRequest = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"followerId",
|
||||
"followeeId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], FollowRequest);
|
||||
@@ -0,0 +1,127 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let Following = class Following {
|
||||
id;
|
||||
createdAt;
|
||||
followeeId;
|
||||
followee;
|
||||
followerId;
|
||||
follower;
|
||||
//#region Denormalized fields
|
||||
followerHost;
|
||||
followerInbox;
|
||||
followerSharedInbox;
|
||||
followeeHost;
|
||||
followeeInbox;
|
||||
followeeSharedInbox;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Following.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Following."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Following.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The followee user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Following.prototype, "followeeId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Following.prototype, "followee", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The follower user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Following.prototype, "followerId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Following.prototype, "follower", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Following.prototype, "followerHost", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Following.prototype, "followerInbox", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Following.prototype, "followerSharedInbox", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Following.prototype, "followeeHost", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Following.prototype, "followeeInbox", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Following.prototype, "followeeSharedInbox", void 0);
|
||||
Following = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"followerId",
|
||||
"followeeId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], Following);
|
||||
@@ -0,0 +1,61 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
import { GalleryPost } from "./gallery-post.js";
|
||||
export let GalleryLike = class GalleryLike {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
postId;
|
||||
post;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], GalleryLike.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], GalleryLike.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], GalleryLike.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], GalleryLike.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], GalleryLike.prototype, "postId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>GalleryPost, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], GalleryLike.prototype, "post", void 0);
|
||||
GalleryLike = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"postId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], GalleryLike);
|
||||
@@ -0,0 +1,117 @@
|
||||
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 { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let GalleryPost = class GalleryPost {
|
||||
id;
|
||||
createdAt;
|
||||
updatedAt;
|
||||
title;
|
||||
description;
|
||||
userId;
|
||||
user;
|
||||
fileIds;
|
||||
isSensitive;
|
||||
likedCount;
|
||||
tags;
|
||||
constructor(data){
|
||||
if (data == null) return;
|
||||
for (const [k, v] of Object.entries(data)){
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], GalleryPost.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the GalleryPost."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], GalleryPost.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The updated date of the GalleryPost."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], GalleryPost.prototype, "updatedAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], GalleryPost.prototype, "title", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 2048,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], GalleryPost.prototype, "description", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The ID of author."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], GalleryPost.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], GalleryPost.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], GalleryPost.prototype, "fileIds", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the post is sensitive."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], GalleryPost.prototype, "isSensitive", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("integer", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], GalleryPost.prototype, "likedCount", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], GalleryPost.prototype, "tags", void 0);
|
||||
GalleryPost = _ts_decorate([
|
||||
Entity(),
|
||||
_ts_metadata("design:type", Function),
|
||||
_ts_metadata("design:paramtypes", [
|
||||
typeof Partial === "undefined" ? Object : Partial
|
||||
])
|
||||
], GalleryPost);
|
||||
@@ -0,0 +1,127 @@
|
||||
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 { Entity, PrimaryColumn, Index, Column } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
export let Hashtag = class Hashtag {
|
||||
id;
|
||||
name;
|
||||
mentionedUserIds;
|
||||
mentionedUsersCount;
|
||||
mentionedLocalUserIds;
|
||||
mentionedLocalUsersCount;
|
||||
mentionedRemoteUserIds;
|
||||
mentionedRemoteUsersCount;
|
||||
attachedUserIds;
|
||||
attachedUsersCount;
|
||||
attachedLocalUserIds;
|
||||
attachedLocalUsersCount;
|
||||
attachedRemoteUserIds;
|
||||
attachedRemoteUsersCount;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Hashtag.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Hashtag.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
array: true
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Hashtag.prototype, "mentionedUserIds", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("integer", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Hashtag.prototype, "mentionedUsersCount", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
array: true
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Hashtag.prototype, "mentionedLocalUserIds", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("integer", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Hashtag.prototype, "mentionedLocalUsersCount", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
array: true
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Hashtag.prototype, "mentionedRemoteUserIds", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("integer", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Hashtag.prototype, "mentionedRemoteUsersCount", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
array: true
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Hashtag.prototype, "attachedUserIds", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("integer", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Hashtag.prototype, "attachedUsersCount", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
array: true
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Hashtag.prototype, "attachedLocalUserIds", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("integer", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Hashtag.prototype, "attachedLocalUsersCount", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
array: true
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Hashtag.prototype, "attachedRemoteUserIds", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("integer", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Hashtag.prototype, "attachedRemoteUsersCount", void 0);
|
||||
Hashtag = _ts_decorate([
|
||||
Entity()
|
||||
], Hashtag);
|
||||
@@ -0,0 +1,44 @@
|
||||
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 { Entity, PrimaryColumn, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { Note } from "./note.js";
|
||||
export let HtmlNoteCacheEntry = class HtmlNoteCacheEntry {
|
||||
noteId;
|
||||
note;
|
||||
updatedAt;
|
||||
content;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], HtmlNoteCacheEntry.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], HtmlNoteCacheEntry.prototype, "note", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], HtmlNoteCacheEntry.prototype, "updatedAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("text", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], HtmlNoteCacheEntry.prototype, "content", void 0);
|
||||
HtmlNoteCacheEntry = _ts_decorate([
|
||||
Entity()
|
||||
], HtmlNoteCacheEntry);
|
||||
@@ -0,0 +1,51 @@
|
||||
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 { Entity, PrimaryColumn, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let HtmlUserCacheEntry = class HtmlUserCacheEntry {
|
||||
userId;
|
||||
user;
|
||||
updatedAt;
|
||||
bio;
|
||||
fields;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], HtmlUserCacheEntry.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], HtmlUserCacheEntry.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], HtmlUserCacheEntry.prototype, "updatedAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("text", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], HtmlUserCacheEntry.prototype, "bio", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: []
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], HtmlUserCacheEntry.prototype, "fields", void 0);
|
||||
HtmlUserCacheEntry = _ts_decorate([
|
||||
Entity()
|
||||
], HtmlUserCacheEntry);
|
||||
@@ -0,0 +1,222 @@
|
||||
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 { Entity, PrimaryColumn, Index, Column } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
export let Instance = class Instance {
|
||||
id;
|
||||
/**
|
||||
* このインスタンスを捕捉した日時
|
||||
*/ caughtAt;
|
||||
/**
|
||||
* ホスト
|
||||
*/ host;
|
||||
/**
|
||||
* インスタンスのユーザー数
|
||||
*/ usersCount;
|
||||
/**
|
||||
* インスタンスの投稿数
|
||||
*/ notesCount;
|
||||
/**
|
||||
* このインスタンスのユーザーからフォローされている、自インスタンスのユーザーの数
|
||||
*/ followingCount;
|
||||
/**
|
||||
* このインスタンスのユーザーをフォローしている、自インスタンスのユーザーの数
|
||||
*/ followersCount;
|
||||
/**
|
||||
* 直近のリクエスト送信日時
|
||||
*/ latestRequestSentAt;
|
||||
/**
|
||||
* 直近のリクエスト送信時のHTTPステータスコード
|
||||
*/ latestStatus;
|
||||
/**
|
||||
* 直近のリクエスト受信日時
|
||||
*/ latestRequestReceivedAt;
|
||||
/**
|
||||
* このインスタンスと最後にやり取りした日時
|
||||
*/ lastCommunicatedAt;
|
||||
/**
|
||||
* このインスタンスと不通かどうか
|
||||
*/ isNotResponding;
|
||||
/**
|
||||
* このインスタンスへの配信を停止するか
|
||||
*/ isSuspended;
|
||||
softwareName;
|
||||
softwareVersion;
|
||||
openRegistrations;
|
||||
name;
|
||||
description;
|
||||
maintainerName;
|
||||
maintainerEmail;
|
||||
iconUrl;
|
||||
faviconUrl;
|
||||
themeColor;
|
||||
infoUpdatedAt;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Instance.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The caught date of the Instance."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Instance.prototype, "caughtAt", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
comment: "The host of the Instance."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Instance.prototype, "host", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 0,
|
||||
comment: "The count of the users of the Instance."
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Instance.prototype, "usersCount", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 0,
|
||||
comment: "The count of the notes of the Instance."
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Instance.prototype, "notesCount", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Instance.prototype, "followingCount", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Instance.prototype, "followersCount", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "latestRequestSentAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "latestStatus", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "latestRequestReceivedAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Instance.prototype, "lastCommunicatedAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Instance.prototype, "isNotResponding", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Instance.prototype, "isSuspended", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
nullable: true,
|
||||
comment: "The software of the Instance."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "softwareName", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "softwareVersion", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "openRegistrations", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 4096,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "description", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "maintainerName", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "maintainerEmail", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 4096,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "iconUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 4096,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "faviconUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "themeColor", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Instance.prototype, "infoUpdatedAt", void 0);
|
||||
Instance = _ts_decorate([
|
||||
Entity()
|
||||
], Instance);
|
||||
@@ -0,0 +1,63 @@
|
||||
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, Index, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { Note } from "./note.js";
|
||||
export let InteractionStamp = class InteractionStamp {
|
||||
id;
|
||||
type;
|
||||
targetNoteId;
|
||||
targetNote;
|
||||
noteId;
|
||||
note;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], InteractionStamp.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("enum", {
|
||||
enum: [
|
||||
"quote"
|
||||
]
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], InteractionStamp.prototype, "type", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], InteractionStamp.prototype, "targetNoteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], InteractionStamp.prototype, "targetNote", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], InteractionStamp.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], InteractionStamp.prototype, "note", void 0);
|
||||
InteractionStamp = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"noteId",
|
||||
"targetNoteId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], InteractionStamp);
|
||||
@@ -0,0 +1,78 @@
|
||||
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, Index, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
export let MemorietArchive = class MemorietArchive {
|
||||
id;
|
||||
createdAt;
|
||||
deletedAt;
|
||||
userId;
|
||||
text;
|
||||
cw;
|
||||
fileIds;
|
||||
textLayers;
|
||||
visibility;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], MemorietArchive.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], MemorietArchive.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], MemorietArchive.prototype, "deletedAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MemorietArchive.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
Column("text", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MemorietArchive.prototype, "text", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MemorietArchive.prototype, "cw", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], MemorietArchive.prototype, "fileIds", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: []
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], MemorietArchive.prototype, "textLayers", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 32,
|
||||
default: "home"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MemorietArchive.prototype, "visibility", void 0);
|
||||
MemorietArchive = _ts_decorate([
|
||||
Entity("memoriet_archive")
|
||||
], MemorietArchive);
|
||||
@@ -0,0 +1,69 @@
|
||||
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, Index, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { User } from "./user.js";
|
||||
import { Memoriet } from "./memoriet.js";
|
||||
export let MemorietView = class MemorietView {
|
||||
id;
|
||||
createdAt;
|
||||
viewedAt;
|
||||
memorietId;
|
||||
memoriet;
|
||||
viewerId;
|
||||
viewer;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], MemorietView.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], MemorietView.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], MemorietView.prototype, "viewedAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MemorietView.prototype, "memorietId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>Memoriet, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MemorietView.prototype, "memoriet", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MemorietView.prototype, "viewerId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MemorietView.prototype, "viewer", void 0);
|
||||
MemorietView = _ts_decorate([
|
||||
Entity("memoriet_view"),
|
||||
Index([
|
||||
"memorietId",
|
||||
"viewerId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], MemorietView);
|
||||
@@ -0,0 +1,72 @@
|
||||
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, Index, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { User } from "./user.js";
|
||||
import { Note } from "./note.js";
|
||||
export let Memoriet = class Memoriet {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
noteId;
|
||||
note;
|
||||
expiresAt;
|
||||
textLayers;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Memoriet.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Memoriet.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Memoriet.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Memoriet.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Memoriet.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Memoriet.prototype, "note", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Memoriet.prototype, "expiresAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: []
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Memoriet.prototype, "textLayers", void 0);
|
||||
Memoriet = _ts_decorate([
|
||||
Entity("memoriet")
|
||||
], Memoriet);
|
||||
@@ -0,0 +1,133 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { DriveFile } from "./drive-file.js";
|
||||
import { id } from "../id.js";
|
||||
import { UserGroup } from "./user-group.js";
|
||||
export let MessagingMessage = class MessagingMessage {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
recipientId;
|
||||
recipient;
|
||||
groupId;
|
||||
group;
|
||||
text;
|
||||
isRead;
|
||||
uri;
|
||||
reads;
|
||||
fileId;
|
||||
file;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], MessagingMessage.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the MessagingMessage."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], MessagingMessage.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The sender user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MessagingMessage.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MessagingMessage.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The recipient user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MessagingMessage.prototype, "recipientId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MessagingMessage.prototype, "recipient", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The recipient group ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MessagingMessage.prototype, "groupId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>UserGroup, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MessagingMessage.prototype, "group", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 4096,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MessagingMessage.prototype, "text", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], MessagingMessage.prototype, "isRead", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MessagingMessage.prototype, "uri", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], MessagingMessage.prototype, "reads", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MessagingMessage.prototype, "fileId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>DriveFile, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], MessagingMessage.prototype, "file", void 0);
|
||||
MessagingMessage = _ts_decorate([
|
||||
Entity()
|
||||
], MessagingMessage);
|
||||
@@ -0,0 +1,695 @@
|
||||
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 { Entity, Column, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
export let Meta = class Meta {
|
||||
id;
|
||||
name;
|
||||
description;
|
||||
/**
|
||||
* メンテナの名前
|
||||
*/ maintainerName;
|
||||
/**
|
||||
* メンテナの連絡先
|
||||
*/ maintainerEmail;
|
||||
disableRegistration;
|
||||
disableLocalTimeline;
|
||||
disableRecommendedTimeline;
|
||||
disableGlobalTimeline;
|
||||
defaultReaction;
|
||||
langs;
|
||||
pinnedUsers;
|
||||
recommendedInstances;
|
||||
customMOTD;
|
||||
customSplashIcons;
|
||||
hiddenTags;
|
||||
blockedHosts;
|
||||
silencedHosts;
|
||||
secureMode;
|
||||
privateMode;
|
||||
allowedHosts;
|
||||
pinnedPages;
|
||||
pinnedClipId;
|
||||
themeColor;
|
||||
mascotImageUrl;
|
||||
bannerUrl;
|
||||
backgroundImageUrl;
|
||||
logoImageUrl;
|
||||
errorImageUrl;
|
||||
iconUrl;
|
||||
cacheRemoteFiles;
|
||||
emailRequiredForSignup;
|
||||
enableHcaptcha;
|
||||
hcaptchaSiteKey;
|
||||
hcaptchaSecretKey;
|
||||
enableRecaptcha;
|
||||
recaptchaSiteKey;
|
||||
recaptchaSecretKey;
|
||||
localDriveCapacityMb;
|
||||
remoteDriveCapacityMb;
|
||||
lua4frozenDatabaseCapacityMb;
|
||||
summalyProxy;
|
||||
enableEmail;
|
||||
email;
|
||||
smtpSecure;
|
||||
smtpHost;
|
||||
smtpPort;
|
||||
smtpUser;
|
||||
smtpPass;
|
||||
swPublicKey;
|
||||
swPrivateKey;
|
||||
enableGithubIntegration;
|
||||
githubClientId;
|
||||
githubClientSecret;
|
||||
enableDiscordIntegration;
|
||||
discordClientId;
|
||||
discordClientSecret;
|
||||
deeplAuthKey;
|
||||
deeplIsPro;
|
||||
libreTranslateApiUrl;
|
||||
libreTranslateApiKey;
|
||||
ToSUrl;
|
||||
repositoryUrl;
|
||||
feedbackUrl;
|
||||
defaultLightTheme;
|
||||
defaultDarkTheme;
|
||||
useObjectStorage;
|
||||
objectStorageBucket;
|
||||
objectStoragePrefix;
|
||||
objectStorageBaseUrl;
|
||||
objectStorageEndpoint;
|
||||
objectStorageRegion;
|
||||
objectStorageAccessKey;
|
||||
objectStorageSecretKey;
|
||||
objectStoragePort;
|
||||
objectStorageUseSSL;
|
||||
objectStorageUseProxy;
|
||||
objectStorageSetPublicRead;
|
||||
objectStorageS3ForcePathStyle;
|
||||
enableIpLogging;
|
||||
enableActiveEmailValidation;
|
||||
experimentalFeatures;
|
||||
enableServerMachineStats;
|
||||
enableIdenticonGeneration;
|
||||
donationLink;
|
||||
autofollowedAccount;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn({
|
||||
type: "varchar",
|
||||
length: 32
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Meta.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 1024,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "description", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "maintainerName", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "maintainerEmail", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "disableRegistration", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "disableLocalTimeline", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: true
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "disableRecommendedTimeline", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "disableGlobalTimeline", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
default: "⭐"
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Meta.prototype, "defaultReaction", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Meta.prototype, "langs", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Meta.prototype, "pinnedUsers", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Meta.prototype, "recommendedInstances", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Meta.prototype, "customMOTD", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Meta.prototype, "customSplashIcons", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Meta.prototype, "hiddenTags", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Meta.prototype, "blockedHosts", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Meta.prototype, "silencedHosts", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: true
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "secureMode", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "privateMode", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Meta.prototype, "allowedHosts", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
array: true,
|
||||
default: "{/featured,/channels,/explore,/pages,/about-iceshrimp}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Meta.prototype, "pinnedPages", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "pinnedClipId", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "themeColor", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
default: "/twemoji/1f440.svg"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "mascotImageUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "bannerUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "backgroundImageUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "logoImageUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
default: "/twemoji/1f480.svg"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "errorImageUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "iconUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "cacheRemoteFiles", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "emailRequiredForSignup", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "enableHcaptcha", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "hcaptchaSiteKey", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "hcaptchaSecretKey", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "enableRecaptcha", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "recaptchaSiteKey", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "recaptchaSecretKey", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 1024,
|
||||
comment: "Drive capacity of a local user (MB)"
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Meta.prototype, "localDriveCapacityMb", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 32,
|
||||
comment: "Drive capacity of a remote user (MB)"
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Meta.prototype, "remoteDriveCapacityMb", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 16,
|
||||
comment: "Lua4Frozen database capacity of a local user (MB)"
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Meta.prototype, "lua4frozenDatabaseCapacityMb", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "summalyProxy", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "enableEmail", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "email", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "smtpSecure", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "smtpHost", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "smtpPort", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 1024,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "smtpUser", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 1024,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "smtpPass", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: false
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Meta.prototype, "swPublicKey", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: false
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Meta.prototype, "swPrivateKey", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "enableGithubIntegration", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "githubClientId", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "githubClientSecret", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "enableDiscordIntegration", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "discordClientId", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "discordClientSecret", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "deeplAuthKey", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "deeplIsPro", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "libreTranslateApiUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "libreTranslateApiKey", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "ToSUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
default: "https://iceshrimp.dev/iceshrimp/iceshrimp",
|
||||
nullable: false
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Meta.prototype, "repositoryUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
default: "https://iceshrimp.dev/iceshrimp/iceshrimp/issues/new",
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "feedbackUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 8192,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "defaultLightTheme", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 8192,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "defaultDarkTheme", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "useObjectStorage", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "objectStorageBucket", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "objectStoragePrefix", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "objectStorageBaseUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "objectStorageEndpoint", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "objectStorageRegion", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "objectStorageAccessKey", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "objectStorageSecretKey", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "objectStoragePort", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: true
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "objectStorageUseSSL", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: true
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "objectStorageUseProxy", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "objectStorageSetPublicRead", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: true
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "objectStorageS3ForcePathStyle", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "enableIpLogging", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: true
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "enableActiveEmailValidation", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: {}
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
||||
], Meta.prototype, "experimentalFeatures", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "enableServerMachineStats", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: true
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Meta.prototype, "enableIdenticonGeneration", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "donationLink", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Meta.prototype, "autofollowedAccount", void 0);
|
||||
Meta = _ts_decorate([
|
||||
Entity()
|
||||
], Meta);
|
||||
@@ -0,0 +1,55 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let ModerationLog = class ModerationLog {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
type;
|
||||
info;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], ModerationLog.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the ModerationLog."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], ModerationLog.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ModerationLog.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ModerationLog.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], ModerationLog.prototype, "type", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb"),
|
||||
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
||||
], ModerationLog.prototype, "info", void 0);
|
||||
ModerationLog = _ts_decorate([
|
||||
Entity()
|
||||
], ModerationLog);
|
||||
@@ -0,0 +1,104 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { UserGroup } from "./user-group.js";
|
||||
import { id } from "../id.js";
|
||||
export let Muting = class Muting {
|
||||
id;
|
||||
createdAt;
|
||||
expiresAt;
|
||||
muteeId;
|
||||
mutee;
|
||||
groupId;
|
||||
group;
|
||||
muterId;
|
||||
muter;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Muting.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Muting."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Muting.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Muting.prototype, "expiresAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The mutee user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Muting.prototype, "muteeId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Muting.prototype, "mutee", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Muting.prototype, "groupId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>UserGroup, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Muting.prototype, "group", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The muter user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Muting.prototype, "muterId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Muting.prototype, "muter", void 0);
|
||||
Muting = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"muterId",
|
||||
"muteeId"
|
||||
], {
|
||||
unique: true,
|
||||
where: '"groupId" IS NULL'
|
||||
}),
|
||||
Index([
|
||||
"groupId",
|
||||
"muteeId"
|
||||
], {
|
||||
unique: true,
|
||||
where: '"groupId" IS NOT NULL'
|
||||
})
|
||||
], Muting);
|
||||
@@ -0,0 +1,70 @@
|
||||
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 { Entity, JoinColumn, Column, ManyToOne, PrimaryColumn, Index } from "typeorm";
|
||||
import { Note } from "./note.js";
|
||||
import { id } from "../id.js";
|
||||
export let NoteEdit = class NoteEdit {
|
||||
id;
|
||||
noteId;
|
||||
note;
|
||||
text;
|
||||
cw;
|
||||
fileIds;
|
||||
updatedAt;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], NoteEdit.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The ID of note."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteEdit.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteEdit.prototype, "note", void 0);
|
||||
_ts_decorate([
|
||||
Column("text", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteEdit.prototype, "text", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteEdit.prototype, "cw", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], NoteEdit.prototype, "fileIds", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The updated date of the Note."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], NoteEdit.prototype, "updatedAt", void 0);
|
||||
NoteEdit = _ts_decorate([
|
||||
Entity()
|
||||
], NoteEdit);
|
||||
@@ -0,0 +1,89 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { Note } from "./note.js";
|
||||
import { User } from "./user.js";
|
||||
import { UserGroup } from "./user-group.js";
|
||||
import { id } from "../id.js";
|
||||
export let NoteFavorite = class NoteFavorite {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
groupId;
|
||||
group;
|
||||
noteId;
|
||||
note;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], NoteFavorite.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the NoteFavorite."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], NoteFavorite.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteFavorite.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteFavorite.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteFavorite.prototype, "groupId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>UserGroup, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteFavorite.prototype, "group", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteFavorite.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteFavorite.prototype, "note", void 0);
|
||||
NoteFavorite = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"noteId"
|
||||
], {
|
||||
unique: true,
|
||||
where: '"groupId" IS NULL'
|
||||
}),
|
||||
Index([
|
||||
"groupId",
|
||||
"noteId"
|
||||
], {
|
||||
unique: true,
|
||||
where: '"groupId" IS NOT NULL'
|
||||
})
|
||||
], NoteFavorite);
|
||||
@@ -0,0 +1,99 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { Note } from "./note.js";
|
||||
import { UserGroup } from "./user-group.js";
|
||||
import { id } from "../id.js";
|
||||
export let NoteReaction = class NoteReaction {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
groupId;
|
||||
group;
|
||||
noteId;
|
||||
note;
|
||||
// TODO: 対象noteのuserIdを非正規化したい(「受け取ったリアクション一覧」のようなものを(JOIN無しで)実装したいため)
|
||||
reaction;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], NoteReaction.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the NoteReaction."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], NoteReaction.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteReaction.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteReaction.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteReaction.prototype, "groupId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>UserGroup, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteReaction.prototype, "group", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteReaction.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteReaction.prototype, "note", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 260
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], NoteReaction.prototype, "reaction", void 0);
|
||||
NoteReaction = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"noteId"
|
||||
], {
|
||||
unique: true,
|
||||
where: '"groupId" IS NULL'
|
||||
}),
|
||||
Index([
|
||||
"groupId",
|
||||
"noteId"
|
||||
], {
|
||||
unique: true,
|
||||
where: '"groupId" IS NOT NULL'
|
||||
})
|
||||
], NoteReaction);
|
||||
@@ -0,0 +1,57 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let NoteThreadMuting = class NoteThreadMuting {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
threadId;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], NoteThreadMuting.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], NoteThreadMuting.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id()
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteThreadMuting.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteThreadMuting.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 256
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], NoteThreadMuting.prototype, "threadId", void 0);
|
||||
NoteThreadMuting = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"threadId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], NoteThreadMuting);
|
||||
@@ -0,0 +1,93 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { Note } from "./note.js";
|
||||
import { id } from "../id.js";
|
||||
export let NoteUnread = class NoteUnread {
|
||||
id;
|
||||
userId;
|
||||
user;
|
||||
noteId;
|
||||
note;
|
||||
/**
|
||||
* メンションか否か
|
||||
*/ isMentioned;
|
||||
/**
|
||||
* ダイレクト投稿か否か
|
||||
*/ isSpecified;
|
||||
//#region Denormalized fields
|
||||
noteUserId;
|
||||
noteChannelId;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], NoteUnread.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteUnread.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteUnread.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteUnread.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteUnread.prototype, "note", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean"),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], NoteUnread.prototype, "isMentioned", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean"),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], NoteUnread.prototype, "isSpecified", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteUnread.prototype, "noteUserId", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteUnread.prototype, "noteChannelId", void 0);
|
||||
NoteUnread = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"noteId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], NoteUnread);
|
||||
@@ -0,0 +1,81 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { Note } from "./note.js";
|
||||
import { id } from "../id.js";
|
||||
export let NoteWatching = class NoteWatching {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
noteId;
|
||||
note;
|
||||
//#region Denormalized fields
|
||||
noteUserId;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], NoteWatching.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the NoteWatching."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], NoteWatching.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The watcher ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteWatching.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteWatching.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The target Note ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteWatching.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteWatching.prototype, "note", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], NoteWatching.prototype, "noteUserId", void 0);
|
||||
NoteWatching = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"noteId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], NoteWatching);
|
||||
@@ -0,0 +1,410 @@
|
||||
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 { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { UserGroup } from "./user-group.js";
|
||||
import { id } from "../id.js";
|
||||
import { noteVisibilities } from "../../types.js";
|
||||
import { Channel } from "./channel.js";
|
||||
export let Note = class Note {
|
||||
id;
|
||||
createdAt;
|
||||
replyId;
|
||||
reply;
|
||||
renoteId;
|
||||
renote;
|
||||
threadId;
|
||||
text;
|
||||
name;
|
||||
cw;
|
||||
userId;
|
||||
user;
|
||||
groupId;
|
||||
group;
|
||||
localOnly;
|
||||
renoteCount;
|
||||
repliesCount;
|
||||
viewCount;
|
||||
reactions;
|
||||
/**
|
||||
* public ... 公開
|
||||
* home ... ホームタイムライン(ユーザーページのタイムライン含む)のみに流す
|
||||
* hidden ... only visible on profile (doesnt federate, like local only, but can be fetched via AP like home) <- for now only used for post imports
|
||||
* followers ... フォロワーのみ
|
||||
* specified ... visibleUserIds で指定したユーザーのみ
|
||||
*/ visibility;
|
||||
uri;
|
||||
url;
|
||||
score;
|
||||
fileIds;
|
||||
attachedFileTypes;
|
||||
visibleUserIds;
|
||||
mentions;
|
||||
mentionedRemoteUsers;
|
||||
emojis;
|
||||
tags;
|
||||
hasPoll;
|
||||
channelId;
|
||||
channel;
|
||||
quoteAuthorization;
|
||||
canQuote;
|
||||
//#region Denormalized fields
|
||||
userHost;
|
||||
replyUserId;
|
||||
replyUserHost;
|
||||
renoteUserId;
|
||||
renoteUserHost;
|
||||
updatedAt;
|
||||
//#endregion
|
||||
constructor(data){
|
||||
if (data == null) return;
|
||||
for (const [k, v] of Object.entries(data)){
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Note.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Note."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Note.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The ID of reply target."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "replyId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "reply", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The ID of renote target."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "renoteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "renote", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "threadId", void 0);
|
||||
_ts_decorate([
|
||||
Index('note_text_fts_idx', {
|
||||
synchronize: false
|
||||
}),
|
||||
Column("text", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "text", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "cw", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The ID of author."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The ID of acting group."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "groupId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>UserGroup, {
|
||||
onDelete: "SET NULL"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "group", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Note.prototype, "localOnly", void 0);
|
||||
_ts_decorate([
|
||||
Column("smallint", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Note.prototype, "renoteCount", void 0);
|
||||
_ts_decorate([
|
||||
Column("smallint", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Note.prototype, "repliesCount", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Note.prototype, "viewCount", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: {}
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
||||
], Note.prototype, "reactions", void 0);
|
||||
_ts_decorate([
|
||||
Column("enum", {
|
||||
enum: noteVisibilities
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "visibility", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The URI of a note. it will be null when the note is local."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "uri", void 0);
|
||||
_ts_decorate([
|
||||
Index("IDX_note_url"),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The human readable url of a note. it will be null when the note is local."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "url", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 0,
|
||||
select: false
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Note.prototype, "score", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Note.prototype, "fileIds", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Note.prototype, "attachedFileTypes", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Note.prototype, "visibleUserIds", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Note.prototype, "mentions", void 0);
|
||||
_ts_decorate([
|
||||
Column("text", {
|
||||
default: "[]"
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Note.prototype, "mentionedRemoteUsers", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Note.prototype, "emojis", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Note.prototype, "tags", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Note.prototype, "hasPoll", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The ID of source channel."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "channelId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Channel, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "channel", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "quoteAuthorization", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Note.prototype, "canQuote", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "userHost", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "replyUserId", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "replyUserHost", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "renoteUserId", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "renoteUserHost", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true,
|
||||
comment: "The updated date of the Note."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Note.prototype, "updatedAt", void 0);
|
||||
Note = _ts_decorate([
|
||||
Entity(),
|
||||
Index("IDX_NOTE_TAGS", {
|
||||
synchronize: false
|
||||
}),
|
||||
Index("IDX_NOTE_MENTIONS", {
|
||||
synchronize: false
|
||||
}),
|
||||
Index("IDX_NOTE_VISIBLE_USER_IDS", {
|
||||
synchronize: false
|
||||
}),
|
||||
Index("IDX_note_userId_id", [
|
||||
"userId",
|
||||
"id"
|
||||
]),
|
||||
Index("IDX_note_id_userHost", [
|
||||
"id",
|
||||
"userHost"
|
||||
]),
|
||||
Index("IDX_note_createdAt_userId", [
|
||||
"createdAt",
|
||||
"userId"
|
||||
]),
|
||||
_ts_metadata("design:type", Function),
|
||||
_ts_metadata("design:paramtypes", [
|
||||
typeof Partial === "undefined" ? Object : Partial
|
||||
])
|
||||
], Note);
|
||||
@@ -0,0 +1,240 @@
|
||||
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 { Entity, Index, JoinColumn, ManyToOne, Column, PrimaryColumn } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
import { Note } from "./note.js";
|
||||
import { FollowRequest } from "./follow-request.js";
|
||||
import { UserGroupInvitation } from "./user-group-invitation.js";
|
||||
import { AccessToken } from "./access-token.js";
|
||||
import { notificationTypes } from "../../types.js";
|
||||
import { Bite } from "./bite.js";
|
||||
export let Notification = class Notification {
|
||||
id;
|
||||
createdAt;
|
||||
/**
|
||||
* Notification Recipient ID
|
||||
*/ notifieeId;
|
||||
notifiee;
|
||||
/**
|
||||
* Notification sender (initiator)
|
||||
*/ notifierId;
|
||||
notifier;
|
||||
/**
|
||||
* Notification types:
|
||||
* follow - Follow request
|
||||
* mention - User was referenced in a post.
|
||||
* reply - A post that a user made (or was watching) has been replied to.
|
||||
* renote - A post that a user made (or was watching) has been renoted.
|
||||
* quote - A post that a user made (or was watching) has been quoted and renoted.
|
||||
* reaction - (自分または自分がWatchしている)投稿にリアクションされた
|
||||
* pollVote - (自分または自分がWatchしている)投稿のアンケートに投票された
|
||||
* pollEnded - 自分のアンケートもしくは自分が投票したアンケートが終了した
|
||||
* receiveFollowRequest - フォローリクエストされた
|
||||
* followRequestAccepted - A follow request has been accepted.
|
||||
* groupInvited - グループに招待された
|
||||
* app - App notifications.
|
||||
*/ type;
|
||||
/**
|
||||
* Whether the notification was read.
|
||||
*/ isRead;
|
||||
noteId;
|
||||
note;
|
||||
followRequestId;
|
||||
followRequest;
|
||||
userGroupInvitationId;
|
||||
userGroupInvitation;
|
||||
reaction;
|
||||
choice;
|
||||
/**
|
||||
* App notification body
|
||||
*/ customBody;
|
||||
/**
|
||||
* App notification header
|
||||
* (If omitted, it is expected to be displayed with the app name)
|
||||
*/ customHeader;
|
||||
/**
|
||||
* App notification icon (URL)
|
||||
* (If omitted, it is expected to be displayed as an app icon)
|
||||
*/ customIcon;
|
||||
/**
|
||||
* App notification app (token for)
|
||||
*/ appAccessTokenId;
|
||||
appAccessToken;
|
||||
biteId;
|
||||
bite;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Notification.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Notification."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Notification.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The ID of recipient user of the Notification."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "notifieeId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "notifiee", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The ID of sender user of the Notification."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "notifierId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "notifier", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("enum", {
|
||||
enum: notificationTypes,
|
||||
comment: "The type of the Notification."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "type", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the notification was read."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Notification.prototype, "isRead", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "note", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "followRequestId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>FollowRequest, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "followRequest", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "userGroupInvitationId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>UserGroupInvitation, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "userGroupInvitation", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "reaction", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "choice", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 2048,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "customBody", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "customHeader", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 1024,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "customIcon", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "appAccessTokenId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>AccessToken, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "appAccessToken", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "biteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Bite, {
|
||||
onDelete: "CASCADE",
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Notification.prototype, "bite", void 0);
|
||||
Notification = _ts_decorate([
|
||||
Entity()
|
||||
], Notification);
|
||||
@@ -0,0 +1,82 @@
|
||||
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 { Entity, PrimaryColumn, Column, Index } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
export let OAuthApp = class OAuthApp {
|
||||
id;
|
||||
createdAt;
|
||||
clientId;
|
||||
clientSecret;
|
||||
name;
|
||||
website;
|
||||
scopes;
|
||||
redirectUris;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], OAuthApp.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the OAuth application"
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], OAuthApp.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
comment: "The client id of the OAuth application"
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], OAuthApp.prototype, "clientId", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
comment: "The client secret of the OAuth application"
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], OAuthApp.prototype, "clientSecret", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
comment: "The name of the OAuth application"
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], OAuthApp.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
nullable: true,
|
||||
comment: "The website of the OAuth application"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], OAuthApp.prototype, "website", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
array: true,
|
||||
comment: "The scopes requested by the OAuth application"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], OAuthApp.prototype, "scopes", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
array: true,
|
||||
comment: "The redirect URIs of the OAuth application"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], OAuthApp.prototype, "redirectUris", void 0);
|
||||
OAuthApp = _ts_decorate([
|
||||
Entity('oauth_app')
|
||||
], OAuthApp);
|
||||
@@ -0,0 +1,98 @@
|
||||
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 { Entity, PrimaryColumn, Column, Index, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { OAuthApp } from "./oauth-app.js";
|
||||
import { User } from "./user.js";
|
||||
export let OAuthToken = class OAuthToken {
|
||||
id;
|
||||
createdAt;
|
||||
appId;
|
||||
app;
|
||||
userId;
|
||||
user;
|
||||
code;
|
||||
token;
|
||||
active;
|
||||
scopes;
|
||||
redirectUri;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], OAuthToken.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the OAuth token"
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], OAuthToken.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], OAuthToken.prototype, "appId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>OAuthApp, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", typeof OAuthApp === "undefined" ? Object : OAuthApp)
|
||||
], OAuthToken.prototype, "app", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], OAuthToken.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", typeof User === "undefined" ? Object : User)
|
||||
], OAuthToken.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
comment: "The auth code for the OAuth token"
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], OAuthToken.prototype, "code", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
comment: "The OAuth token"
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], OAuthToken.prototype, "token", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
comment: "Whether or not the token has been activated"
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], OAuthToken.prototype, "active", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
array: true,
|
||||
comment: "The scopes requested by the OAuth token"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], OAuthToken.prototype, "scopes", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
comment: "The redirect URI of the OAuth token"
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], OAuthToken.prototype, "redirectUri", void 0);
|
||||
OAuthToken = _ts_decorate([
|
||||
Entity('oauth_token')
|
||||
], OAuthToken);
|
||||
@@ -0,0 +1,61 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
import { Page } from "./page.js";
|
||||
export let PageLike = class PageLike {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
pageId;
|
||||
page;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], PageLike.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], PageLike.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PageLike.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PageLike.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PageLike.prototype, "pageId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Page, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PageLike.prototype, "page", void 0);
|
||||
PageLike = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"pageId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], PageLike);
|
||||
@@ -0,0 +1,189 @@
|
||||
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 { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
import { DriveFile } from "./drive-file.js";
|
||||
export let Page = class Page {
|
||||
id;
|
||||
createdAt;
|
||||
updatedAt;
|
||||
title;
|
||||
name;
|
||||
summary;
|
||||
alignCenter;
|
||||
isPublic;
|
||||
hideTitleWhenPinned;
|
||||
font;
|
||||
userId;
|
||||
user;
|
||||
eyeCatchingImageId;
|
||||
eyeCatchingImage;
|
||||
content;
|
||||
variables;
|
||||
script;
|
||||
/**
|
||||
* public ... 公開
|
||||
* followers ... フォロワーのみ
|
||||
* specified ... visibleUserIds で指定したユーザーのみ
|
||||
*/ visibility;
|
||||
visibleUserIds;
|
||||
likedCount;
|
||||
constructor(data){
|
||||
if (data == null) return;
|
||||
for (const [k, v] of Object.entries(data)){
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Page.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Page."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Page.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The updated date of the Page."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Page.prototype, "updatedAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Page.prototype, "title", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 256
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Page.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Page.prototype, "summary", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean"),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Page.prototype, "alignCenter", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean"),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Page.prototype, "isPublic", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Page.prototype, "hideTitleWhenPinned", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 32
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Page.prototype, "font", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The ID of author."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Page.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Page.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Page.prototype, "eyeCatchingImageId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>DriveFile, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Page.prototype, "eyeCatchingImage", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: []
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Page.prototype, "content", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: []
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Page.prototype, "variables", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 16384,
|
||||
default: ""
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Page.prototype, "script", void 0);
|
||||
_ts_decorate([
|
||||
Column("enum", {
|
||||
enum: [
|
||||
"public",
|
||||
"followers",
|
||||
"specified"
|
||||
]
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Page.prototype, "visibility", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Page.prototype, "visibleUserIds", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], Page.prototype, "likedCount", void 0);
|
||||
Page = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"name"
|
||||
], {
|
||||
unique: true
|
||||
}),
|
||||
_ts_metadata("design:type", Function),
|
||||
_ts_metadata("design:paramtypes", [
|
||||
typeof Partial === "undefined" ? Object : Partial
|
||||
])
|
||||
], Page);
|
||||
@@ -0,0 +1,53 @@
|
||||
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, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { User } from "./user.js";
|
||||
export let PasswordResetRequest = class PasswordResetRequest {
|
||||
id;
|
||||
createdAt;
|
||||
token;
|
||||
userId;
|
||||
user;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], PasswordResetRequest.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], PasswordResetRequest.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 256
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], PasswordResetRequest.prototype, "token", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id()
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PasswordResetRequest.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PasswordResetRequest.prototype, "user", void 0);
|
||||
PasswordResetRequest = _ts_decorate([
|
||||
Entity()
|
||||
], PasswordResetRequest);
|
||||
@@ -0,0 +1,61 @@
|
||||
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 Plan = class Plan {
|
||||
id;
|
||||
createdAt;
|
||||
updatedAt;
|
||||
name;
|
||||
icon;
|
||||
description;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Plan.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Plan."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Plan.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Plan.prototype, "updatedAt", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Plan.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Plan.prototype, "icon", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
default: ""
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Plan.prototype, "description", void 0);
|
||||
Plan = _ts_decorate([
|
||||
Entity()
|
||||
], Plan);
|
||||
@@ -0,0 +1,71 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { Note } from "./note.js";
|
||||
import { id } from "../id.js";
|
||||
export let PollVote = class PollVote {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
noteId;
|
||||
note;
|
||||
choice;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], PollVote.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the PollVote."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], PollVote.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PollVote.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PollVote.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PollVote.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PollVote.prototype, "note", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer"),
|
||||
_ts_metadata("design:type", Number)
|
||||
], PollVote.prototype, "choice", void 0);
|
||||
PollVote = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"noteId",
|
||||
"choice"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], PollVote);
|
||||
@@ -0,0 +1,98 @@
|
||||
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, JoinColumn, Column, OneToOne } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { Note } from "./note.js";
|
||||
import { noteVisibilities } from "../../types.js";
|
||||
export let Poll = class Poll {
|
||||
noteId;
|
||||
note;
|
||||
expiresAt;
|
||||
multiple;
|
||||
choices;
|
||||
votes;
|
||||
//#region Denormalized fields
|
||||
noteVisibility;
|
||||
userId;
|
||||
userHost;
|
||||
//#endregion
|
||||
constructor(data){
|
||||
if (data == null) return;
|
||||
for (const [k, v] of Object.entries(data)){
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Poll.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
OneToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Poll.prototype, "note", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Poll.prototype, "expiresAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean"),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Poll.prototype, "multiple", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Poll.prototype, "choices", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
array: true
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Poll.prototype, "votes", void 0);
|
||||
_ts_decorate([
|
||||
Column("enum", {
|
||||
enum: noteVisibilities,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Poll.prototype, "noteVisibility", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Poll.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Poll.prototype, "userHost", void 0);
|
||||
Poll = _ts_decorate([
|
||||
Entity(),
|
||||
_ts_metadata("design:type", Function),
|
||||
_ts_metadata("design:paramtypes", [
|
||||
typeof Partial === "undefined" ? Object : Partial
|
||||
])
|
||||
], Poll);
|
||||
@@ -0,0 +1,59 @@
|
||||
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, JoinColumn, Column, OneToOne } from "typeorm";
|
||||
import { Note } from "./note.js";
|
||||
import { id } from "../id.js";
|
||||
export let PromoNote = class PromoNote {
|
||||
noteId;
|
||||
note;
|
||||
expiresAt;
|
||||
totalCredits;
|
||||
remainingCredits;
|
||||
//#region Denormalized fields
|
||||
userId;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PromoNote.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
OneToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PromoNote.prototype, "note", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], PromoNote.prototype, "expiresAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], PromoNote.prototype, "totalCredits", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 0
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], PromoNote.prototype, "remainingCredits", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PromoNote.prototype, "userId", void 0);
|
||||
PromoNote = _ts_decorate([
|
||||
Entity()
|
||||
], PromoNote);
|
||||
@@ -0,0 +1,71 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { Note } from "./note.js";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let PromoRead = class PromoRead {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
noteId;
|
||||
note;
|
||||
readDay;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], PromoRead.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the PromoRead."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], PromoRead.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PromoRead.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PromoRead.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PromoRead.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], PromoRead.prototype, "note", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 10
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], PromoRead.prototype, "readDay", void 0);
|
||||
PromoRead = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"noteId",
|
||||
"readDay"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], PromoRead);
|
||||
@@ -0,0 +1,36 @@
|
||||
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 RegistrationTicket = class RegistrationTicket {
|
||||
id;
|
||||
createdAt;
|
||||
code;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], RegistrationTicket.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], RegistrationTicket.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 64
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], RegistrationTicket.prototype, "code", void 0);
|
||||
RegistrationTicket = _ts_decorate([
|
||||
Entity()
|
||||
], RegistrationTicket);
|
||||
@@ -0,0 +1,90 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let RegistryItem = class RegistryItem {
|
||||
id;
|
||||
createdAt;
|
||||
updatedAt;
|
||||
userId;
|
||||
user;
|
||||
key;
|
||||
value;
|
||||
scope;
|
||||
// サードパーティアプリに開放するときのためのカラム
|
||||
domain;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], RegistryItem.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the RegistryItem."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], RegistryItem.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The updated date of the RegistryItem."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], RegistryItem.prototype, "updatedAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The owner ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], RegistryItem.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], RegistryItem.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 1024,
|
||||
comment: "The key of the RegistryItem."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], RegistryItem.prototype, "key", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: {},
|
||||
nullable: true,
|
||||
comment: "The value of the RegistryItem."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], RegistryItem.prototype, "value", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 1024,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], RegistryItem.prototype, "scope", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], RegistryItem.prototype, "domain", void 0);
|
||||
RegistryItem = _ts_decorate([
|
||||
Entity()
|
||||
], RegistryItem);
|
||||
@@ -0,0 +1,43 @@
|
||||
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 Relay = class Relay {
|
||||
id;
|
||||
inbox;
|
||||
status;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Relay.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: false
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Relay.prototype, "inbox", void 0);
|
||||
_ts_decorate([
|
||||
Column("enum", {
|
||||
enum: [
|
||||
"requesting",
|
||||
"accepted",
|
||||
"rejected"
|
||||
]
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Relay.prototype, "status", void 0);
|
||||
Relay = _ts_decorate([
|
||||
Entity()
|
||||
], Relay);
|
||||
@@ -0,0 +1,70 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { User } from "./user.js";
|
||||
export let RenoteMuting = class RenoteMuting {
|
||||
id;
|
||||
createdAt;
|
||||
muteeId;
|
||||
mutee;
|
||||
muterId;
|
||||
muter;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], RenoteMuting.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Muting."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], RenoteMuting.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The mutee user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], RenoteMuting.prototype, "muteeId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], RenoteMuting.prototype, "mutee", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The muter user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], RenoteMuting.prototype, "muterId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], RenoteMuting.prototype, "muter", void 0);
|
||||
RenoteMuting = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"muterId",
|
||||
"muteeId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], RenoteMuting);
|
||||
@@ -0,0 +1,204 @@
|
||||
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 ReversiGame = class ReversiGame {
|
||||
id;
|
||||
startedAt;
|
||||
endedAt;
|
||||
user1Id;
|
||||
user1;
|
||||
user2Id;
|
||||
user2;
|
||||
user1Ready;
|
||||
user2Ready;
|
||||
black;
|
||||
isStarted;
|
||||
isEnded;
|
||||
winnerId;
|
||||
surrenderedUserId;
|
||||
timeoutUserId;
|
||||
timeLimitForEachTurn;
|
||||
logs;
|
||||
map;
|
||||
bw;
|
||||
noIrregularRules;
|
||||
isLlotheo;
|
||||
canPutEverywhere;
|
||||
loopedBoard;
|
||||
form1;
|
||||
form2;
|
||||
crc32;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], ReversiGame.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true,
|
||||
comment: "The started date of the ReversiGame."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiGame.prototype, "startedAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true,
|
||||
comment: "The ended date of the ReversiGame."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiGame.prototype, "endedAt", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiGame.prototype, "user1Id", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiGame.prototype, "user1", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiGame.prototype, "user2Id", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiGame.prototype, "user2", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], ReversiGame.prototype, "user1Ready", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], ReversiGame.prototype, "user2Ready", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiGame.prototype, "black", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], ReversiGame.prototype, "isStarted", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], ReversiGame.prototype, "isEnded", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiGame.prototype, "winnerId", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiGame.prototype, "surrenderedUserId", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiGame.prototype, "timeoutUserId", void 0);
|
||||
_ts_decorate([
|
||||
Column("smallint", {
|
||||
default: 90
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], ReversiGame.prototype, "timeLimitForEachTurn", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: []
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], ReversiGame.prototype, "logs", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
array: true,
|
||||
length: 64
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], ReversiGame.prototype, "map", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 32
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], ReversiGame.prototype, "bw", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], ReversiGame.prototype, "noIrregularRules", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], ReversiGame.prototype, "isLlotheo", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], ReversiGame.prototype, "canPutEverywhere", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], ReversiGame.prototype, "loopedBoard", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
nullable: true,
|
||||
default: null
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiGame.prototype, "form1", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
nullable: true,
|
||||
default: null
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiGame.prototype, "form2", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 32,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiGame.prototype, "crc32", void 0);
|
||||
ReversiGame = _ts_decorate([
|
||||
Entity("reversi_game")
|
||||
], ReversiGame);
|
||||
@@ -0,0 +1,38 @@
|
||||
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, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
export let ReversiMatching = class ReversiMatching {
|
||||
id;
|
||||
createdAt;
|
||||
parentId;
|
||||
childId;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], ReversiMatching.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the ReversiMatching."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], ReversiMatching.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiMatching.prototype, "parentId", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ReversiMatching.prototype, "childId", void 0);
|
||||
ReversiMatching = _ts_decorate([
|
||||
Entity("reversi_matching")
|
||||
], ReversiMatching);
|
||||
@@ -0,0 +1,85 @@
|
||||
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, Index, JoinColumn, ManyToOne, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { User } from "./user.js";
|
||||
import { Note } from "./note.js";
|
||||
export let ScheduledNote = class ScheduledNote {
|
||||
id;
|
||||
createdAt;
|
||||
scheduledAt;
|
||||
userId;
|
||||
user;
|
||||
status;
|
||||
data;
|
||||
noteId;
|
||||
note;
|
||||
error;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], ScheduledNote.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], ScheduledNote.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], ScheduledNote.prototype, "scheduledAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ScheduledNote.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ScheduledNote.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 16,
|
||||
default: "scheduled"
|
||||
}),
|
||||
_ts_metadata("design:type", typeof ScheduledNoteStatus === "undefined" ? Object : ScheduledNoteStatus)
|
||||
], ScheduledNote.prototype, "status", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb"),
|
||||
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
||||
], ScheduledNote.prototype, "data", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ScheduledNote.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne(()=>Note, {
|
||||
onDelete: "SET NULL"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ScheduledNote.prototype, "note", void 0);
|
||||
_ts_decorate([
|
||||
Column("text", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], ScheduledNote.prototype, "error", void 0);
|
||||
ScheduledNote = _ts_decorate([
|
||||
Entity("scheduled_note")
|
||||
], ScheduledNote);
|
||||
@@ -0,0 +1,125 @@
|
||||
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);
|
||||
@@ -0,0 +1,60 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let Signin = class Signin {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
ip;
|
||||
headers;
|
||||
success;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Signin.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Signin."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Signin.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Signin.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Signin.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Signin.prototype, "ip", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb"),
|
||||
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
||||
], Signin.prototype, "headers", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean"),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Signin.prototype, "success", void 0);
|
||||
Signin = _ts_decorate([
|
||||
Entity()
|
||||
], Signin);
|
||||
@@ -0,0 +1,69 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let SwSubscription = class SwSubscription {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
endpoint;
|
||||
auth;
|
||||
publickey;
|
||||
sendReadMessage;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], SwSubscription.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], SwSubscription.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], SwSubscription.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], SwSubscription.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], SwSubscription.prototype, "endpoint", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], SwSubscription.prototype, "auth", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], SwSubscription.prototype, "publickey", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], SwSubscription.prototype, "sendReadMessage", void 0);
|
||||
SwSubscription = _ts_decorate([
|
||||
Entity()
|
||||
], SwSubscription);
|
||||
@@ -0,0 +1,37 @@
|
||||
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, Column } from "typeorm";
|
||||
export let UsedUsername = class UsedUsername {
|
||||
username;
|
||||
createdAt;
|
||||
constructor(data){
|
||||
if (data == null) return;
|
||||
for (const [k, v] of Object.entries(data)){
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UsedUsername.prototype, "username", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], UsedUsername.prototype, "createdAt", void 0);
|
||||
UsedUsername = _ts_decorate([
|
||||
Entity(),
|
||||
_ts_metadata("design:type", Function),
|
||||
_ts_metadata("design:paramtypes", [
|
||||
typeof Partial === "undefined" ? Object : Partial
|
||||
])
|
||||
], UsedUsername);
|
||||
@@ -0,0 +1,110 @@
|
||||
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, Index, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
export let UserEmoji = class UserEmoji {
|
||||
id;
|
||||
createdAt;
|
||||
name;
|
||||
userId;
|
||||
userGroupId;
|
||||
originalUrl;
|
||||
publicUrl;
|
||||
type;
|
||||
glyph;
|
||||
width;
|
||||
height;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserEmoji.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], UserEmoji.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserEmoji.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserEmoji.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserEmoji.prototype, "userGroupId", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserEmoji.prototype, "originalUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
default: ""
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserEmoji.prototype, "publicUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserEmoji.prototype, "type", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserEmoji.prototype, "glyph", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
nullable: true,
|
||||
comment: "Image width"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserEmoji.prototype, "width", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
nullable: true,
|
||||
comment: "Image height"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserEmoji.prototype, "height", void 0);
|
||||
UserEmoji = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"name",
|
||||
"userId"
|
||||
], {
|
||||
unique: true
|
||||
}),
|
||||
Index([
|
||||
"name",
|
||||
"userGroupId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], UserEmoji);
|
||||
@@ -0,0 +1,70 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { UserGroup } from "./user-group.js";
|
||||
import { id } from "../id.js";
|
||||
export let UserGroupInvitation = class UserGroupInvitation {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
userGroupId;
|
||||
userGroup;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserGroupInvitation.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the UserGroupInvitation."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], UserGroupInvitation.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserGroupInvitation.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserGroupInvitation.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The group ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserGroupInvitation.prototype, "userGroupId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>UserGroup, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserGroupInvitation.prototype, "userGroup", void 0);
|
||||
UserGroupInvitation = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"userGroupId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], UserGroupInvitation);
|
||||
@@ -0,0 +1,70 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { UserGroup } from "./user-group.js";
|
||||
import { id } from "../id.js";
|
||||
export let UserGroupJoining = class UserGroupJoining {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
userGroupId;
|
||||
userGroup;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserGroupJoining.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the UserGroupJoining."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], UserGroupJoining.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserGroupJoining.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserGroupJoining.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The group ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserGroupJoining.prototype, "userGroupId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>UserGroup, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserGroupJoining.prototype, "userGroup", void 0);
|
||||
UserGroupJoining = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"userGroupId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], UserGroupJoining);
|
||||
@@ -0,0 +1,105 @@
|
||||
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 { Entity, Index, JoinColumn, Column, PrimaryColumn, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let UserGroup = class UserGroup {
|
||||
id;
|
||||
createdAt;
|
||||
name;
|
||||
username;
|
||||
userId;
|
||||
user;
|
||||
isPrivate;
|
||||
allowCalls;
|
||||
iconFileId;
|
||||
symbolFileId;
|
||||
constructor(data){
|
||||
if (data == null) return;
|
||||
for (const [k, v] of Object.entries(data)){
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserGroup.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the UserGroup."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], UserGroup.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 256
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserGroup.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 64,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserGroup.prototype, "username", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The ID of owner."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserGroup.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserGroup.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserGroup.prototype, "isPrivate", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: true
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserGroup.prototype, "allowCalls", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserGroup.prototype, "iconFileId", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserGroup.prototype, "symbolFileId", void 0);
|
||||
UserGroup = _ts_decorate([
|
||||
Entity(),
|
||||
_ts_metadata("design:type", Function),
|
||||
_ts_metadata("design:paramtypes", [
|
||||
typeof Partial === "undefined" ? Object : Partial
|
||||
])
|
||||
], UserGroup);
|
||||
@@ -0,0 +1,45 @@
|
||||
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 { Entity, Index, Column, PrimaryGeneratedColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
export let UserIp = class UserIp {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
ip;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryGeneratedColumn(),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserIp.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], UserIp.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserIp.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserIp.prototype, "ip", void 0);
|
||||
UserIp = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"ip"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], UserIp);
|
||||
@@ -0,0 +1,54 @@
|
||||
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, JoinColumn, Column, OneToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let UserKeypair = class UserKeypair {
|
||||
userId;
|
||||
user;
|
||||
publicKey;
|
||||
privateKey;
|
||||
constructor(data){
|
||||
if (data == null) return;
|
||||
for (const [k, v] of Object.entries(data)){
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserKeypair.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
OneToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserKeypair.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 4096
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserKeypair.prototype, "publicKey", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 4096
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserKeypair.prototype, "privateKey", void 0);
|
||||
UserKeypair = _ts_decorate([
|
||||
Entity(),
|
||||
_ts_metadata("design:type", Function),
|
||||
_ts_metadata("design:paramtypes", [
|
||||
typeof Partial === "undefined" ? Object : Partial
|
||||
])
|
||||
], UserKeypair);
|
||||
@@ -0,0 +1,70 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { UserList } from "./user-list.js";
|
||||
import { id } from "../id.js";
|
||||
export let UserListJoining = class UserListJoining {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
userListId;
|
||||
userList;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserListJoining.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the UserListJoining."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], UserListJoining.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserListJoining.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserListJoining.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The list ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserListJoining.prototype, "userListId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>UserList, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserListJoining.prototype, "userList", void 0);
|
||||
UserListJoining = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"userListId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], UserListJoining);
|
||||
@@ -0,0 +1,62 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let UserList = class UserList {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
name;
|
||||
hideFromHomeTl;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserList.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the UserList."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], UserList.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The owner ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserList.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserList.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
comment: "The name of the UserList."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserList.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether posts from list members should be hidden from the home timeline."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserList.prototype, "hideFromHomeTl", void 0);
|
||||
UserList = _ts_decorate([
|
||||
Entity()
|
||||
], UserList);
|
||||
@@ -0,0 +1,63 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { Note } from "./note.js";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let UserNotePining = class UserNotePining {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
noteId;
|
||||
note;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserNotePining.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the UserNotePinings."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], UserNotePining.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserNotePining.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserNotePining.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserNotePining.prototype, "noteId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Note, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserNotePining.prototype, "note", void 0);
|
||||
UserNotePining = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"noteId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], UserNotePining);
|
||||
@@ -0,0 +1,57 @@
|
||||
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 UserPending = class UserPending {
|
||||
id;
|
||||
createdAt;
|
||||
code;
|
||||
username;
|
||||
email;
|
||||
password;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserPending.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone"),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], UserPending.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserPending.prototype, "code", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserPending.prototype, "username", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserPending.prototype, "email", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserPending.prototype, "password", void 0);
|
||||
UserPending = _ts_decorate([
|
||||
Entity()
|
||||
], UserPending);
|
||||
@@ -0,0 +1,71 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { Plan } from "./plan.js";
|
||||
import { id } from "../id.js";
|
||||
export let UserPlan = class UserPlan {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
planId;
|
||||
plan;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserPlan.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the UserPlan."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], UserPlan.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The user ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserPlan.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserPlan.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The plan ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserPlan.prototype, "planId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>Plan, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserPlan.prototype, "plan", void 0);
|
||||
UserPlan = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"userId",
|
||||
"planId"
|
||||
], {
|
||||
unique: true
|
||||
})
|
||||
], UserPlan);
|
||||
@@ -0,0 +1,363 @@
|
||||
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 { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from "typeorm";
|
||||
import { ffVisibility, notificationTypes } from "../../types.js";
|
||||
import { id } from "../id.js";
|
||||
import { User } from "./user.js";
|
||||
import { Page } from "./page.js";
|
||||
export let UserProfile = class UserProfile {
|
||||
userId;
|
||||
user;
|
||||
location;
|
||||
birthday;
|
||||
description;
|
||||
fields;
|
||||
mentions;
|
||||
lang;
|
||||
url;
|
||||
email;
|
||||
emailVerifyCode;
|
||||
emailVerified;
|
||||
emailNotificationTypes;
|
||||
publicReactions;
|
||||
allowCalls;
|
||||
symbolFileId;
|
||||
ffVisibility;
|
||||
twoFactorTempSecret;
|
||||
twoFactorSecret;
|
||||
twoFactorEnabled;
|
||||
securityKeysAvailable;
|
||||
usePasswordLessLogin;
|
||||
password;
|
||||
moderationNote;
|
||||
// TODO: そのうち消す
|
||||
clientData;
|
||||
// TODO: そのうち消す
|
||||
room;
|
||||
autoAcceptFollowed;
|
||||
noCrawle;
|
||||
preventAiLearning;
|
||||
alwaysMarkNsfw;
|
||||
carefulBot;
|
||||
injectFeaturedNote;
|
||||
receiveAnnouncementEmail;
|
||||
pinnedPageId;
|
||||
pinnedPage;
|
||||
integrations;
|
||||
enableWordMute;
|
||||
mutedWords;
|
||||
mutedInstances;
|
||||
mutingNotificationTypes;
|
||||
pronouns;
|
||||
//#region Denormalized fields
|
||||
userHost;
|
||||
//#endregion
|
||||
constructor(data){
|
||||
if (data == null) return;
|
||||
for (const [k, v] of Object.entries(data)){
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
OneToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true,
|
||||
comment: "The location of the User."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "location", void 0);
|
||||
_ts_decorate([
|
||||
Column("char", {
|
||||
length: 10,
|
||||
nullable: true,
|
||||
comment: "The birthday (YYYY-MM-DD) of the User."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "birthday", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 2048,
|
||||
nullable: true,
|
||||
comment: "The description (bio) of the User."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "description", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: []
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], UserProfile.prototype, "fields", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: []
|
||||
}),
|
||||
_ts_metadata("design:type", typeof IMentionedRemoteUsers === "undefined" ? Object : IMentionedRemoteUsers)
|
||||
], UserProfile.prototype, "mentions", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 32,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "lang", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "Remote URL of the user."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "url", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true,
|
||||
comment: "The email address of the User."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "email", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "emailVerifyCode", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "emailVerified", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: [
|
||||
"follow",
|
||||
"receiveFollowRequest",
|
||||
"groupInvited"
|
||||
]
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], UserProfile.prototype, "emailNotificationTypes", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "publicReactions", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "allowCalls", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "symbolFileId", void 0);
|
||||
_ts_decorate([
|
||||
Column("enum", {
|
||||
enum: ffVisibility,
|
||||
default: "public"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "ffVisibility", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "twoFactorTempSecret", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "twoFactorSecret", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "twoFactorEnabled", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "securityKeysAvailable", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "usePasswordLessLogin", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true,
|
||||
comment: "The password hash of the User. It will be null if the origin of the user is local."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "password", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 8192,
|
||||
default: ""
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "moderationNote", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: {},
|
||||
comment: "The client-specific data of the User."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
||||
], UserProfile.prototype, "clientData", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: {},
|
||||
comment: "The room data of the User."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
||||
], UserProfile.prototype, "room", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "autoAcceptFollowed", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether reject index by crawler."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "noCrawle", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: true
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "preventAiLearning", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "alwaysMarkNsfw", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "carefulBot", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: true
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "injectFeaturedNote", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: true
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "receiveAnnouncementEmail", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "pinnedPageId", void 0);
|
||||
_ts_decorate([
|
||||
OneToOne((type)=>Page, {
|
||||
onDelete: "SET NULL"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "pinnedPage", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: {}
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
||||
], UserProfile.prototype, "integrations", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
select: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], UserProfile.prototype, "enableWordMute", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: []
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], UserProfile.prototype, "mutedWords", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: [],
|
||||
comment: "List of instances muted by the user."
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], UserProfile.prototype, "mutedInstances", void 0);
|
||||
_ts_decorate([
|
||||
Column("enum", {
|
||||
enum: notificationTypes,
|
||||
array: true,
|
||||
default: []
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], UserProfile.prototype, "mutingNotificationTypes", void 0);
|
||||
_ts_decorate([
|
||||
Column("jsonb", {
|
||||
default: {},
|
||||
comment: "Language map of user pronouns"
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Record === "undefined" ? Object : Record)
|
||||
], UserProfile.prototype, "pronouns", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "[Denormalized]"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserProfile.prototype, "userHost", void 0);
|
||||
UserProfile = _ts_decorate([
|
||||
Entity(),
|
||||
_ts_metadata("design:type", Function),
|
||||
_ts_metadata("design:paramtypes", [
|
||||
typeof Partial === "undefined" ? Object : Partial
|
||||
])
|
||||
], UserProfile);
|
||||
@@ -0,0 +1,57 @@
|
||||
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, JoinColumn, Column, OneToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let UserPublickey = class UserPublickey {
|
||||
userId;
|
||||
user;
|
||||
keyId;
|
||||
keyPem;
|
||||
constructor(data){
|
||||
if (data == null) return;
|
||||
for (const [k, v] of Object.entries(data)){
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserPublickey.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
OneToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserPublickey.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("varchar", {
|
||||
length: 512
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserPublickey.prototype, "keyId", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 4096
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserPublickey.prototype, "keyPem", void 0);
|
||||
UserPublickey = _ts_decorate([
|
||||
Entity(),
|
||||
_ts_metadata("design:type", Function),
|
||||
_ts_metadata("design:paramtypes", [
|
||||
typeof Partial === "undefined" ? Object : Partial
|
||||
])
|
||||
], UserPublickey);
|
||||
@@ -0,0 +1,71 @@
|
||||
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, JoinColumn, Column, ManyToOne, Index } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let UserSecurityKey = class UserSecurityKey {
|
||||
id;
|
||||
userId;
|
||||
user;
|
||||
publicKey;
|
||||
lastUsed;
|
||||
name;
|
||||
constructor(data){
|
||||
if (data == null) return;
|
||||
for (const [k, v] of Object.entries(data)){
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn("varchar", {
|
||||
comment: "Variable-length id given to navigator.credentials.get()"
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserSecurityKey.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserSecurityKey.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], UserSecurityKey.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
comment: "Variable-length public key used to verify attestations (hex-encoded)."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserSecurityKey.prototype, "publicKey", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The date of the last time the UserSecurityKey was successfully validated."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], UserSecurityKey.prototype, "lastUsed", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
comment: "User-defined name for this key",
|
||||
length: 30
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], UserSecurityKey.prototype, "name", void 0);
|
||||
UserSecurityKey = _ts_decorate([
|
||||
Entity(),
|
||||
_ts_metadata("design:type", Function),
|
||||
_ts_metadata("design:paramtypes", [
|
||||
typeof Partial === "undefined" ? Object : Partial
|
||||
])
|
||||
], UserSecurityKey);
|
||||
@@ -0,0 +1,425 @@
|
||||
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 { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from "typeorm";
|
||||
import { id } from "../id.js";
|
||||
import { DriveFile } from "./drive-file.js";
|
||||
export let User = class User {
|
||||
id;
|
||||
createdAt;
|
||||
updatedAt;
|
||||
lastFetchedAt;
|
||||
lastActiveDate;
|
||||
hideOnlineStatus;
|
||||
username;
|
||||
usernameLower;
|
||||
name;
|
||||
followersCount;
|
||||
followingCount;
|
||||
movedToUri;
|
||||
alsoKnownAs;
|
||||
notesCount;
|
||||
avatarId;
|
||||
avatarUrl;
|
||||
avatarBlurhash;
|
||||
avatar;
|
||||
bannerId;
|
||||
bannerUrl;
|
||||
bannerBlurhash;
|
||||
banner;
|
||||
tags;
|
||||
isSuspended;
|
||||
isSilenced;
|
||||
isLocked;
|
||||
isBot;
|
||||
isCat;
|
||||
speakAsCat;
|
||||
isAdmin;
|
||||
isModerator;
|
||||
isVerified;
|
||||
minorBadges;
|
||||
isExplorable;
|
||||
// アカウントが削除されたかどうかのフラグだが、完全に削除される際は物理削除なので実質削除されるまでの「削除が進行しているかどうか」のフラグ
|
||||
isDeleted;
|
||||
emojis;
|
||||
host;
|
||||
inbox;
|
||||
sharedInbox;
|
||||
featured;
|
||||
uri;
|
||||
followersUri;
|
||||
token;
|
||||
driveCapacityOverrideMb;
|
||||
canBite;
|
||||
constructor(data){
|
||||
if (data == null) return;
|
||||
for (const [k, v] of Object.entries(data)){
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], User.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the User."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], User.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true,
|
||||
comment: "The updated date of the User."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "updatedAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "lastFetchedAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "lastActiveDate", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], User.prototype, "hideOnlineStatus", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
comment: "The username of the User."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], User.prototype, "username", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
select: false,
|
||||
comment: "The username (lowercased) of the User."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], User.prototype, "usernameLower", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true,
|
||||
comment: "The name of the User."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 0,
|
||||
comment: "The count of followers."
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], User.prototype, "followersCount", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 0,
|
||||
comment: "The count of following."
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], User.prototype, "followingCount", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The URI of the new account of the User"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "movedToUri", void 0);
|
||||
_ts_decorate([
|
||||
Column("simple-array", {
|
||||
nullable: true,
|
||||
comment: "URIs the user is known as too"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "alsoKnownAs", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
default: 0,
|
||||
comment: "The count of notes."
|
||||
}),
|
||||
_ts_metadata("design:type", Number)
|
||||
], User.prototype, "notesCount", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The ID of avatar DriveFile."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "avatarId", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The URL of the avatar DriveFile"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "avatarUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true,
|
||||
comment: "The blurhash of the avatar DriveFile"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "avatarBlurhash", void 0);
|
||||
_ts_decorate([
|
||||
OneToOne((type)=>DriveFile, {
|
||||
onDelete: "SET NULL"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "avatar", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true,
|
||||
comment: "The ID of banner DriveFile."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "bannerId", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The URL of the banner DriveFile"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "bannerUrl", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
nullable: true,
|
||||
comment: "The blurhash of the banner DriveFile"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "bannerBlurhash", void 0);
|
||||
_ts_decorate([
|
||||
OneToOne((type)=>DriveFile, {
|
||||
onDelete: "SET NULL"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "banner", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], User.prototype, "tags", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the User is suspended."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], User.prototype, "isSuspended", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the User is silenced."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], User.prototype, "isSilenced", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the User is locked."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], User.prototype, "isLocked", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the User is a bot."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], User.prototype, "isBot", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the User is a cat."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], User.prototype, "isCat", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: true,
|
||||
comment: "Whether to speak as a cat if isCat."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], User.prototype, "speakAsCat", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the User is the admin."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], User.prototype, "isAdmin", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the User is a moderator."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], User.prototype, "isModerator", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the User has an administrator-issued verified badge."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], User.prototype, "isVerified", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 1,
|
||||
array: true,
|
||||
default: "{}",
|
||||
comment: "Self-selected minor-safety badges."
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], User.prototype, "minorBadges", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean", {
|
||||
default: true,
|
||||
comment: "Whether the User is explorable."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], User.prototype, "isExplorable", void 0);
|
||||
_ts_decorate([
|
||||
Column("boolean", {
|
||||
default: false,
|
||||
comment: "Whether the User is deleted."
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], User.prototype, "isDeleted", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], User.prototype, "emojis", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The host of the User. It will be null if the origin of the user is local."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "host", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The inbox URL of the User. It will be null if the origin of the user is local."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "inbox", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The sharedInbox URL of the User. It will be null if the origin of the user is local."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "sharedInbox", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The featured URL of the User. It will be null if the origin of the user is local."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "featured", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The URI of the User. It will be null if the origin of the user is local."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "uri", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 512,
|
||||
nullable: true,
|
||||
comment: "The URI of the user Follower Collection. It will be null if the origin of the user is local."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "followersUri", void 0);
|
||||
_ts_decorate([
|
||||
Index({
|
||||
unique: true
|
||||
}),
|
||||
Column("char", {
|
||||
length: 16,
|
||||
nullable: true,
|
||||
unique: true,
|
||||
comment: "The native access token of the User. It will be null if the origin of the user is local."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "token", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
nullable: true,
|
||||
comment: "Overrides user drive capacity limit"
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], User.prototype, "driveCapacityOverrideMb", void 0);
|
||||
_ts_decorate([
|
||||
Column("enum", {
|
||||
nullable: false,
|
||||
default: "nobody",
|
||||
enum: [
|
||||
"anyone",
|
||||
"followers",
|
||||
"nobody"
|
||||
]
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], User.prototype, "canBite", void 0);
|
||||
User = _ts_decorate([
|
||||
Entity(),
|
||||
Index([
|
||||
"usernameLower",
|
||||
"host"
|
||||
], {
|
||||
unique: true
|
||||
}),
|
||||
_ts_metadata("design:type", Function),
|
||||
_ts_metadata("design:paramtypes", [
|
||||
typeof Partial === "undefined" ? Object : Partial
|
||||
])
|
||||
], User);
|
||||
@@ -0,0 +1,84 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export let VerifiedBadgeRequest = class VerifiedBadgeRequest {
|
||||
id;
|
||||
createdAt;
|
||||
resolvedAt;
|
||||
userId;
|
||||
user;
|
||||
resolverId;
|
||||
resolver;
|
||||
status;
|
||||
comment;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], VerifiedBadgeRequest.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the VerifiedBadgeRequest."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], VerifiedBadgeRequest.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], VerifiedBadgeRequest.prototype, "resolvedAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column(id()),
|
||||
_ts_metadata("design:type", Object)
|
||||
], VerifiedBadgeRequest.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], VerifiedBadgeRequest.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column({
|
||||
...id(),
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], VerifiedBadgeRequest.prototype, "resolverId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "SET NULL"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], VerifiedBadgeRequest.prototype, "resolver", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 16,
|
||||
default: "pending"
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], VerifiedBadgeRequest.prototype, "status", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 2048,
|
||||
default: ""
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], VerifiedBadgeRequest.prototype, "comment", void 0);
|
||||
VerifiedBadgeRequest = _ts_decorate([
|
||||
Entity()
|
||||
], VerifiedBadgeRequest);
|
||||
@@ -0,0 +1,114 @@
|
||||
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, JoinColumn, Column, ManyToOne } from "typeorm";
|
||||
import { User } from "./user.js";
|
||||
import { id } from "../id.js";
|
||||
export const webhookEventTypes = [
|
||||
"mention",
|
||||
"unfollow",
|
||||
"follow",
|
||||
"followed",
|
||||
"note",
|
||||
"reply",
|
||||
"renote",
|
||||
"reaction"
|
||||
];
|
||||
export let Webhook = class Webhook {
|
||||
id;
|
||||
createdAt;
|
||||
userId;
|
||||
user;
|
||||
name;
|
||||
on;
|
||||
url;
|
||||
secret;
|
||||
active;
|
||||
/**
|
||||
* 直近のリクエスト送信日時
|
||||
*/ latestSentAt;
|
||||
/**
|
||||
* 直近のリクエスト送信時のHTTPステータスコード
|
||||
*/ latestStatus;
|
||||
};
|
||||
_ts_decorate([
|
||||
PrimaryColumn(id()),
|
||||
_ts_metadata("design:type", String)
|
||||
], Webhook.prototype, "id", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
comment: "The created date of the Antenna."
|
||||
}),
|
||||
_ts_metadata("design:type", typeof Date === "undefined" ? Object : Date)
|
||||
], Webhook.prototype, "createdAt", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column({
|
||||
...id(),
|
||||
comment: "The owner ID."
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Webhook.prototype, "userId", void 0);
|
||||
_ts_decorate([
|
||||
ManyToOne((type)=>User, {
|
||||
onDelete: "CASCADE"
|
||||
}),
|
||||
JoinColumn(),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Webhook.prototype, "user", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
comment: "The name of the Antenna."
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Webhook.prototype, "name", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("varchar", {
|
||||
length: 128,
|
||||
array: true,
|
||||
default: "{}"
|
||||
}),
|
||||
_ts_metadata("design:type", Array)
|
||||
], Webhook.prototype, "on", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 1024
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Webhook.prototype, "url", void 0);
|
||||
_ts_decorate([
|
||||
Column("varchar", {
|
||||
length: 1024
|
||||
}),
|
||||
_ts_metadata("design:type", String)
|
||||
], Webhook.prototype, "secret", void 0);
|
||||
_ts_decorate([
|
||||
Index(),
|
||||
Column("boolean", {
|
||||
default: true
|
||||
}),
|
||||
_ts_metadata("design:type", Boolean)
|
||||
], Webhook.prototype, "active", void 0);
|
||||
_ts_decorate([
|
||||
Column("timestamp with time zone", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Webhook.prototype, "latestSentAt", void 0);
|
||||
_ts_decorate([
|
||||
Column("integer", {
|
||||
nullable: true
|
||||
}),
|
||||
_ts_metadata("design:type", Object)
|
||||
], Webhook.prototype, "latestStatus", void 0);
|
||||
Webhook = _ts_decorate([
|
||||
Entity()
|
||||
], Webhook);
|
||||
Reference in New Issue
Block a user