summaryrefslogtreecommitdiff
path: root/src/models/instance.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-10-24 06:17:55 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-10-24 06:17:55 +0900
commita136715111de5a7822b97d43681d20e494d43505 (patch)
treec451210ecaca628d2c7bb953104710f2fa8569ff /src/models/instance.ts
parent Make max allowed text length configurable (#2992) (diff)
downloadsharkey-a136715111de5a7822b97d43681d20e494d43505.tar.gz
sharkey-a136715111de5a7822b97d43681d20e494d43505.tar.bz2
sharkey-a136715111de5a7822b97d43681d20e494d43505.zip
Implement #2993
Diffstat (limited to 'src/models/instance.ts')
-rw-r--r--src/models/instance.ts35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/models/instance.ts b/src/models/instance.ts
new file mode 100644
index 0000000000..d3906df427
--- /dev/null
+++ b/src/models/instance.ts
@@ -0,0 +1,35 @@
+import * as mongo from 'mongodb';
+import db from '../db/mongodb';
+
+const Instance = db.get<IInstance>('instances');
+Instance.createIndex('host', { unique: true });
+export default Instance;
+
+export interface IInstance {
+ _id: mongo.ObjectID;
+
+ /**
+ * ホスト
+ */
+ host: string;
+
+ /**
+ * このインスタンスを捕捉した日時
+ */
+ caughtAt: Date;
+
+ /**
+ * このインスタンスのシステム (MastodonとかMisskeyとかPleromaとか)
+ */
+ system: string;
+
+ /**
+ * このインスタンスのユーザー数
+ */
+ usersCount: number;
+
+ /**
+ * このインスタンスから受け取った投稿数
+ */
+ notesCount: number;
+}