Compare commits
104 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
935a254c97 | ||
|
|
3c678f0e92 | ||
|
|
a053e1c1de | ||
|
|
b8fa1751ba | ||
|
|
c4243d54a9 | ||
|
|
1767f54fed | ||
|
|
7e465cdbbe | ||
|
|
47f67fcba9 | ||
|
|
3fff20fb13 | ||
|
|
06a2d87129 | ||
|
|
a8076e306a | ||
|
|
05e5829260 | ||
|
|
5a91416f34 | ||
|
|
70db1d0066 | ||
|
|
26c936d19e | ||
|
|
3b0ae3f80d | ||
|
|
2570d85543 | ||
|
|
b274c4160e | ||
|
|
f9d5d9e30b | ||
|
|
8cdf5ff6df | ||
|
|
409ebf6e14 | ||
|
|
a3d34ba919 | ||
|
|
242bb1a428 | ||
|
|
4a25ed0627 | ||
|
|
f65fbf9d55 | ||
|
|
6169acd478 | ||
|
|
481f1a7c36 | ||
|
|
16726789da | ||
|
|
e71f650ade | ||
|
|
e8a7f571e1 | ||
|
|
3117c8a98f | ||
|
|
90b845f3db | ||
|
|
f5dd972e38 | ||
|
|
4b210e1a6a | ||
|
|
1a7eb3c1df | ||
|
|
52f84d8603 | ||
|
|
f92d218c0c | ||
|
|
81c5ece8a9 | ||
|
|
a97bc38f3e | ||
|
|
aacfb5e221 | ||
|
|
f88ac3c04e | ||
|
|
1fb53acc46 | ||
|
|
ae3b0d5437 | ||
|
|
f9b2da1bb0 | ||
|
|
d0bea052ad | ||
|
|
c012faa958 | ||
|
|
c8cfd1ee65 | ||
|
|
e8da0bcd80 | ||
|
|
591ff9095a | ||
|
|
6df91d3078 | ||
|
|
288c14efce | ||
|
|
ee8d636ca8 | ||
|
|
a3ceecae91 | ||
|
|
5ad89a3b3d | ||
|
|
e1089cc18d | ||
|
|
f9e780187c | ||
|
|
42cbe96a14 | ||
|
|
1f23b11dcc | ||
|
|
ad3b4bbd58 | ||
|
|
455f4ffa27 | ||
|
|
1d867b8aca | ||
|
|
1f9c18e615 | ||
|
|
5bf439851d | ||
|
|
9df3f99a1c | ||
|
|
f41232703b | ||
|
|
abc4e53943 | ||
|
|
f846508fc1 | ||
|
|
7343003287 | ||
|
|
25ca3d610b | ||
|
|
9d286786d4 | ||
|
|
91037ebdd6 | ||
|
|
26b2eafea0 | ||
|
|
432beedd94 | ||
|
|
3a919bab45 | ||
|
|
11af9b808d | ||
|
|
af35335772 | ||
|
|
7b9047cc82 | ||
|
|
4cad36572c | ||
|
|
b5625a4550 | ||
|
|
ec41d8053c | ||
|
|
284cfe6989 | ||
|
|
ad8f363c5d | ||
|
|
3d3cf73c30 | ||
|
|
fd9bd28361 | ||
|
|
d2919dece0 | ||
|
|
a86442bff7 | ||
|
|
4b915d43cf | ||
|
|
b20c3d84a6 | ||
|
|
d2bbf5ffc4 | ||
|
|
4ef9411f35 | ||
|
|
168d13d6e6 | ||
|
|
1e921a9fd5 | ||
|
|
9e438ed674 | ||
|
|
3a02a7dad8 | ||
|
|
1744316656 | ||
|
|
1e4a86da8e | ||
|
|
2b31b6a6b0 | ||
|
|
c7a3f40eba | ||
|
|
8b9710df9f | ||
|
|
ce6f750fa5 | ||
|
|
468eb02ff3 | ||
|
|
dfca7f1340 | ||
|
|
7bfa56d199 | ||
|
|
c579cbdf10 |
6
docs/README.md
Normal file
6
docs/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Docs
|
||||
These docs are for contributors of Misskey or admins of instance of Misskey.
|
||||
Docs for users are located in `src/docs`.
|
||||
|
||||
これらのドキュメントはMisskeyの開発者またはMisskeyインスタンス運営者向けです。
|
||||
利用者向けのドキュメントは`src/docs`にあります。
|
||||
@@ -934,7 +934,16 @@ docs:
|
||||
properties: "プロパティ"
|
||||
endpoints:
|
||||
params: "パラメータ"
|
||||
no-params: "パラメータはありません"
|
||||
res: "レスポンス"
|
||||
require-credential: "このエンドポイントは認証情報が必須です。"
|
||||
require-permission: "このエンドポイントは{permission}の権限を必要とします。"
|
||||
has-limit: "レートリミットがあります。"
|
||||
duration-limit: "直近{duration}ミリ秒の間のこのエンドポイントへのリクエスト数の合計が{max}を超える場合はリクエストできません。"
|
||||
min-interval-limit: "前回のリクエストから{interval}ミリ秒経っていない場合はリクエストできません。"
|
||||
show-src: "このエンドポイントのソースコードも閲覧できます。"
|
||||
show-src-link: "コードをGitHubで見る"
|
||||
generated: "このドキュメントはAPI定義に基づき自動生成されています。"
|
||||
props:
|
||||
name: "名前"
|
||||
type: "型"
|
||||
|
||||
@@ -934,7 +934,16 @@ docs:
|
||||
properties: "プロパティ"
|
||||
endpoints:
|
||||
params: "パラメータ"
|
||||
no-params: "パラメータはありません"
|
||||
res: "レスポンス"
|
||||
require-credential: "このエンドポイントは認証情報が必須です。"
|
||||
require-permission: "このエンドポイントは{permission}の権限を必要とします。"
|
||||
has-limit: "レートリミットがあります。"
|
||||
duration-limit: "直近{duration}ミリ秒の間のこのエンドポイントへのリクエスト数の合計が{max}を超える場合はリクエストできません。"
|
||||
min-interval-limit: "前回のリクエストから{interval}ミリ秒経っていない場合はリクエストできません。"
|
||||
show-src: "このエンドポイントのソースコードも閲覧できます。"
|
||||
show-src-link: "コードをGitHubで見る"
|
||||
generated: "このドキュメントはAPI定義に基づき自動生成されています。"
|
||||
props:
|
||||
name: "名前"
|
||||
type: "型"
|
||||
|
||||
@@ -934,7 +934,16 @@ docs:
|
||||
properties: "Properties"
|
||||
endpoints:
|
||||
params: "Parameters"
|
||||
no-params: "No parameter."
|
||||
res: "Response"
|
||||
require-credential: "This endpoint requires the authentication information."
|
||||
require-permission: "This endpoint requires {permission} permission."
|
||||
has-limit: "There is a rate limit."
|
||||
duration-limit: "You can't request when a frequency of a request in during {duration} milliseconds exceeds {max} times."
|
||||
min-interval-limit: "You can't request before {interval} milliseconds has passed since previous request."
|
||||
show-src: "You can view source code for this endpoint."
|
||||
show-src-link: "See the code on GitHub"
|
||||
generated: "This doc is generated by an API definition."
|
||||
props:
|
||||
name: "Name"
|
||||
type: "Type"
|
||||
|
||||
@@ -934,7 +934,16 @@ docs:
|
||||
properties: "プロパティ"
|
||||
endpoints:
|
||||
params: "パラメータ"
|
||||
no-params: "パラメータはありません"
|
||||
res: "レスポンス"
|
||||
require-credential: "このエンドポイントは認証情報が必須です。"
|
||||
require-permission: "このエンドポイントは{permission}の権限を必要とします。"
|
||||
has-limit: "レートリミットがあります。"
|
||||
duration-limit: "直近{duration}ミリ秒の間のこのエンドポイントへのリクエスト数の合計が{max}を超える場合はリクエストできません。"
|
||||
min-interval-limit: "前回のリクエストから{interval}ミリ秒経っていない場合はリクエストできません。"
|
||||
show-src: "このエンドポイントのソースコードも閲覧できます。"
|
||||
show-src-link: "コードをGitHubで見る"
|
||||
generated: "このドキュメントはAPI定義に基づき自動生成されています。"
|
||||
props:
|
||||
name: "名前"
|
||||
type: "型"
|
||||
|
||||
@@ -934,7 +934,16 @@ docs:
|
||||
properties: "Propriétés"
|
||||
endpoints:
|
||||
params: "Paramètres"
|
||||
no-params: "パラメータはありません"
|
||||
res: "Réponse"
|
||||
require-credential: "このエンドポイントは認証情報が必須です。"
|
||||
require-permission: "このエンドポイントは{permission}の権限を必要とします。"
|
||||
has-limit: "レートリミットがあります。"
|
||||
duration-limit: "直近{duration}ミリ秒の間のこのエンドポイントへのリクエスト数の合計が{max}を超える場合はリクエストできません。"
|
||||
min-interval-limit: "前回のリクエストから{interval}ミリ秒経っていない場合はリクエストできません。"
|
||||
show-src: "このエンドポイントのソースコードも閲覧できます。"
|
||||
show-src-link: "コードをGitHubで見る"
|
||||
generated: "このドキュメントはAPI定義に基づき自動生成されています。"
|
||||
props:
|
||||
name: "Nom"
|
||||
type: "Type"
|
||||
|
||||
@@ -934,7 +934,16 @@ docs:
|
||||
properties: "プロパティ"
|
||||
endpoints:
|
||||
params: "パラメータ"
|
||||
no-params: "パラメータはありません"
|
||||
res: "レスポンス"
|
||||
require-credential: "このエンドポイントは認証情報が必須です。"
|
||||
require-permission: "このエンドポイントは{permission}の権限を必要とします。"
|
||||
has-limit: "レートリミットがあります。"
|
||||
duration-limit: "直近{duration}ミリ秒の間のこのエンドポイントへのリクエスト数の合計が{max}を超える場合はリクエストできません。"
|
||||
min-interval-limit: "前回のリクエストから{interval}ミリ秒経っていない場合はリクエストできません。"
|
||||
show-src: "このエンドポイントのソースコードも閲覧できます。"
|
||||
show-src-link: "コードをGitHubで見る"
|
||||
generated: "このドキュメントはAPI定義に基づき自動生成されています。"
|
||||
props:
|
||||
name: "名前"
|
||||
type: "型"
|
||||
|
||||
@@ -1098,7 +1098,16 @@ docs:
|
||||
properties: "プロパティ"
|
||||
endpoints:
|
||||
params: "パラメータ"
|
||||
no-params: "パラメータはありません"
|
||||
res: "レスポンス"
|
||||
require-credential: "このエンドポイントは認証情報が必須です。"
|
||||
require-permission: "このエンドポイントは{permission}の権限を必要とします。"
|
||||
has-limit: "レートリミットがあります。"
|
||||
duration-limit: "直近{duration}ミリ秒の間のこのエンドポイントへのリクエスト数の合計が{max}を超える場合はリクエストできません。"
|
||||
min-interval-limit: "前回のリクエストから{interval}ミリ秒経っていない場合はリクエストできません。"
|
||||
show-src: "このエンドポイントのソースコードも閲覧できます。"
|
||||
show-src-link: "コードをGitHubで見る"
|
||||
generated: "このドキュメントはAPI定義に基づき自動生成されています。"
|
||||
props:
|
||||
name: "名前"
|
||||
type: "型"
|
||||
|
||||
@@ -934,7 +934,16 @@ docs:
|
||||
properties: "プロパティ"
|
||||
endpoints:
|
||||
params: "パラメータ"
|
||||
no-params: "パラメータはありません"
|
||||
res: "レスポンス"
|
||||
require-credential: "このエンドポイントは認証情報が必須です。"
|
||||
require-permission: "このエンドポイントは{permission}の権限を必要とします。"
|
||||
has-limit: "レートリミットがあります。"
|
||||
duration-limit: "直近{duration}ミリ秒の間のこのエンドポイントへのリクエスト数の合計が{max}を超える場合はリクエストできません。"
|
||||
min-interval-limit: "前回のリクエストから{interval}ミリ秒経っていない場合はリクエストできません。"
|
||||
show-src: "このエンドポイントのソースコードも閲覧できます。"
|
||||
show-src-link: "コードをGitHubで見る"
|
||||
generated: "このドキュメントはAPI定義に基づき自動生成されています。"
|
||||
props:
|
||||
name: "名前"
|
||||
type: "型"
|
||||
|
||||
@@ -85,7 +85,7 @@ common:
|
||||
widgets: "Widżety"
|
||||
home: "Strona główna"
|
||||
local: "Lokalne"
|
||||
hybrid: "ソーシャル"
|
||||
hybrid: "Społeczność"
|
||||
global: "Globalne"
|
||||
notifications: "Powiadomienia"
|
||||
list: "Listy"
|
||||
@@ -557,7 +557,7 @@ desktop/views/components/taskmanager.vue:
|
||||
desktop/views/components/timeline.vue:
|
||||
home: "Strona główna"
|
||||
local: "Lokalne"
|
||||
hybrid: "ソーシャル"
|
||||
hybrid: "Społeczność"
|
||||
global: "Globalne"
|
||||
list: "Listy"
|
||||
desktop/views/components/ui.header.vue:
|
||||
@@ -820,7 +820,7 @@ mobile/views/pages/following.vue:
|
||||
mobile/views/pages/home.vue:
|
||||
home: "Strona główna"
|
||||
local: "Lokalne"
|
||||
hybrid: "ソーシャル"
|
||||
hybrid: "Społeczność"
|
||||
global: "Globalne"
|
||||
mobile/views/pages/messaging.vue:
|
||||
messaging: "Wiadomości"
|
||||
@@ -934,7 +934,16 @@ docs:
|
||||
properties: "Właściwości"
|
||||
endpoints:
|
||||
params: "Parametry"
|
||||
no-params: "パラメータはありません"
|
||||
res: "Odpowiedź"
|
||||
require-credential: "このエンドポイントは認証情報が必須です。"
|
||||
require-permission: "このエンドポイントは{permission}の権限を必要とします。"
|
||||
has-limit: "レートリミットがあります。"
|
||||
duration-limit: "直近{duration}ミリ秒の間のこのエンドポイントへのリクエスト数の合計が{max}を超える場合はリクエストできません。"
|
||||
min-interval-limit: "前回のリクエストから{interval}ミリ秒経っていない場合はリクエストできません。"
|
||||
show-src: "このエンドポイントのソースコードも閲覧できます。"
|
||||
show-src-link: "Zobacz kod na GitHubie"
|
||||
generated: "このドキュメントはAPI定義に基づき自動生成されています。"
|
||||
props:
|
||||
name: "Nazwa"
|
||||
type: "Rodzaj"
|
||||
|
||||
@@ -934,7 +934,16 @@ docs:
|
||||
properties: "プロパティ"
|
||||
endpoints:
|
||||
params: "パラメータ"
|
||||
no-params: "パラメータはありません"
|
||||
res: "レスポンス"
|
||||
require-credential: "このエンドポイントは認証情報が必須です。"
|
||||
require-permission: "このエンドポイントは{permission}の権限を必要とします。"
|
||||
has-limit: "レートリミットがあります。"
|
||||
duration-limit: "直近{duration}ミリ秒の間のこのエンドポイントへのリクエスト数の合計が{max}を超える場合はリクエストできません。"
|
||||
min-interval-limit: "前回のリクエストから{interval}ミリ秒経っていない場合はリクエストできません。"
|
||||
show-src: "このエンドポイントのソースコードも閲覧できます。"
|
||||
show-src-link: "コードをGitHubで見る"
|
||||
generated: "このドキュメントはAPI定義に基づき自動生成されています。"
|
||||
props:
|
||||
name: "名前"
|
||||
type: "型"
|
||||
|
||||
@@ -934,7 +934,16 @@ docs:
|
||||
properties: "プロパティ"
|
||||
endpoints:
|
||||
params: "パラメータ"
|
||||
no-params: "パラメータはありません"
|
||||
res: "レスポンス"
|
||||
require-credential: "このエンドポイントは認証情報が必須です。"
|
||||
require-permission: "このエンドポイントは{permission}の権限を必要とします。"
|
||||
has-limit: "レートリミットがあります。"
|
||||
duration-limit: "直近{duration}ミリ秒の間のこのエンドポイントへのリクエスト数の合計が{max}を超える場合はリクエストできません。"
|
||||
min-interval-limit: "前回のリクエストから{interval}ミリ秒経っていない場合はリクエストできません。"
|
||||
show-src: "このエンドポイントのソースコードも閲覧できます。"
|
||||
show-src-link: "コードをGitHubで見る"
|
||||
generated: "このドキュメントはAPI定義に基づき自動生成されています。"
|
||||
props:
|
||||
name: "名前"
|
||||
type: "型"
|
||||
|
||||
@@ -934,7 +934,16 @@ docs:
|
||||
properties: "プロパティ"
|
||||
endpoints:
|
||||
params: "パラメータ"
|
||||
no-params: "パラメータはありません"
|
||||
res: "レスポンス"
|
||||
require-credential: "このエンドポイントは認証情報が必須です。"
|
||||
require-permission: "このエンドポイントは{permission}の権限を必要とします。"
|
||||
has-limit: "レートリミットがあります。"
|
||||
duration-limit: "直近{duration}ミリ秒の間のこのエンドポイントへのリクエスト数の合計が{max}を超える場合はリクエストできません。"
|
||||
min-interval-limit: "前回のリクエストから{interval}ミリ秒経っていない場合はリクエストできません。"
|
||||
show-src: "このエンドポイントのソースコードも閲覧できます。"
|
||||
show-src-link: "コードをGitHubで見る"
|
||||
generated: "このドキュメントはAPI定義に基づき自動生成されています。"
|
||||
props:
|
||||
name: "名前"
|
||||
type: "型"
|
||||
|
||||
123
package-lock.json
generated
123
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"version": "4.19.1",
|
||||
"version": "4.22.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -169,6 +169,11 @@
|
||||
"resolved": "https://registry.npmjs.org/@types/deep-equal/-/deep-equal-1.0.1.tgz",
|
||||
"integrity": "sha512-mMUu4nWHLBlHtxXY17Fg6+ucS/MnndyOWyOe7MmwkoMYxvfQU2ajtRaEvqSUv+aVkMqH/C0NCI8UoVfRNQ10yg=="
|
||||
},
|
||||
"@types/elasticsearch": {
|
||||
"version": "5.0.25",
|
||||
"resolved": "https://registry.npmjs.org/@types/elasticsearch/-/elasticsearch-5.0.25.tgz",
|
||||
"integrity": "sha512-3orDxdC3+J2Q3yO08aUyqg9S8upDu3PFP3A8+Hz8SvfticVof20NfMP1lmWQfwxwX62jv/L/zWDrW83TFugNBg=="
|
||||
},
|
||||
"@types/events": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/events/-/events-1.2.0.tgz",
|
||||
@@ -636,9 +641,9 @@
|
||||
"integrity": "sha512-h8KW3wSd3/l4oKRGYPxExCaos5VmjcnwDG3RK25tfcoWQR9iLmM9UbwvF1Pd+UT5aY1Z3LdQGt4xU0u9Zk/C2Q=="
|
||||
},
|
||||
"@types/tapable": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/tapable/-/tapable-1.0.3.tgz",
|
||||
"integrity": "sha512-yz2OUW/HSKZnA2/hdxg5xoHxLbnzAbl1g5UW1eAJSYxVl2BmwKHt72w7Lfl4RU+BL/OWp/cGfSw+GPdN5kfqYg=="
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/tapable/-/tapable-1.0.4.tgz",
|
||||
"integrity": "sha512-78AdXtlhpCHT0K3EytMpn4JNxaf5tbqbLcbIRoQIHzpTIyjpxLQKRoxU55ujBXAtg3Nl2h/XWvfDa9dsMOd0pQ=="
|
||||
},
|
||||
"@types/through2": {
|
||||
"version": "2.0.33",
|
||||
@@ -683,9 +688,9 @@
|
||||
}
|
||||
},
|
||||
"@types/webpack": {
|
||||
"version": "4.4.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.4.5.tgz",
|
||||
"integrity": "sha512-CFRuLijysw6RK6ET+UozUMXO5DX57rXa7rYCr4h5pvI6YN6XQwIlyVNShGJpyRg3dWcoNfufTwH+HmjEcCkxRg==",
|
||||
"version": "4.4.7",
|
||||
"resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.4.7.tgz",
|
||||
"integrity": "sha512-nwjQSPaVdEyM60ZfE/+SadTEgsuP7uXfHZ2n7c/a+G5f7K7esdlCu4f+po4DPfjJN7LeDC0e7kr4uOzLg5VOGw==",
|
||||
"requires": {
|
||||
"@types/node": "*",
|
||||
"@types/tapable": "*",
|
||||
@@ -721,9 +726,9 @@
|
||||
}
|
||||
},
|
||||
"@vue/component-compiler-utils": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-1.3.1.tgz",
|
||||
"integrity": "sha512-IyjJW6ToMitgAhp3xh22QiEW8JvHfLyzlyY/J+GjJ71miod9tNsy6xT2ckm/VirlhPMfeM43kgYZe34jhmmzpw==",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@vue/component-compiler-utils/-/component-compiler-utils-2.1.0.tgz",
|
||||
"integrity": "sha512-CEAYcnQsO42aKnIOQdzTLonpa936Tl8sJSHciMzNgy/p+tvqycjwK9Knm6vUrkVE/fWV2NVcNWI+fmvUPxkxWQ==",
|
||||
"requires": {
|
||||
"consolidate": "^0.15.1",
|
||||
"hash-sum": "^1.0.2",
|
||||
@@ -731,7 +736,7 @@
|
||||
"merge-source-map": "^1.1.0",
|
||||
"postcss": "^6.0.20",
|
||||
"postcss-selector-parser": "^3.1.1",
|
||||
"prettier": "^1.13.0",
|
||||
"prettier": "^1.13.7",
|
||||
"source-map": "^0.5.6",
|
||||
"vue-template-es2015-compiler": "^1.6.0"
|
||||
},
|
||||
@@ -5086,6 +5091,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"eslint-plugin-vue": {
|
||||
"version": "4.7.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-4.7.0.tgz",
|
||||
"integrity": "sha512-SVu9wZ5ptK0bMROx5avzHPJjNtG2qi6L150Mo2elstPvGNvjvSG6pkMmIdJzlSkhfpmg9fqSu/q/XRIQY8sW+g==",
|
||||
"requires": {
|
||||
"vue-eslint-parser": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"eslint-scope": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz",
|
||||
@@ -7792,6 +7805,11 @@
|
||||
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.12.0.tgz",
|
||||
"integrity": "sha1-5tnb5Xy+/mB1HwKvM2GVhwyQwB4="
|
||||
},
|
||||
"highlightjs": {
|
||||
"version": "9.10.0",
|
||||
"resolved": "https://registry.npmjs.org/highlightjs/-/highlightjs-9.10.0.tgz",
|
||||
"integrity": "sha1-/Km3jdqjsavKidbD7hBa0nCoAZA="
|
||||
},
|
||||
"hmac-drbg": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
|
||||
@@ -15235,6 +15253,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"showdown-highlightjs-extension": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/showdown-highlightjs-extension/-/showdown-highlightjs-extension-0.1.2.tgz",
|
||||
"integrity": "sha1-D8kBkCg8GuA/xMzM4/G+alpY5M4=",
|
||||
"requires": {
|
||||
"highlightjs": "^9.8.0"
|
||||
}
|
||||
},
|
||||
"shvl": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/shvl/-/shvl-1.3.1.tgz",
|
||||
@@ -17441,6 +17467,54 @@
|
||||
"cropperjs": "^1.1.3"
|
||||
}
|
||||
},
|
||||
"vue-eslint-parser": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-2.0.3.tgz",
|
||||
"integrity": "sha512-ZezcU71Owm84xVF6gfurBQUGg8WQ+WZGxgDEQu1IHFBZNx7BFZg3L1yHxrCBNNwbwFtE1GuvfJKMtb6Xuwc/Bw==",
|
||||
"requires": {
|
||||
"debug": "^3.1.0",
|
||||
"eslint-scope": "^3.7.1",
|
||||
"eslint-visitor-keys": "^1.0.0",
|
||||
"espree": "^3.5.2",
|
||||
"esquery": "^1.0.0",
|
||||
"lodash": "^4.17.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"acorn-jsx": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz",
|
||||
"integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=",
|
||||
"requires": {
|
||||
"acorn": "^3.0.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"acorn": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz",
|
||||
"integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo="
|
||||
}
|
||||
}
|
||||
},
|
||||
"eslint-scope": {
|
||||
"version": "3.7.3",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz",
|
||||
"integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==",
|
||||
"requires": {
|
||||
"esrecurse": "^4.1.0",
|
||||
"estraverse": "^4.1.1"
|
||||
}
|
||||
},
|
||||
"espree": {
|
||||
"version": "3.5.4",
|
||||
"resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz",
|
||||
"integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==",
|
||||
"requires": {
|
||||
"acorn": "^5.5.0",
|
||||
"acorn-jsx": "^3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"vue-functional-data-merge": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmjs.org/vue-functional-data-merge/-/vue-functional-data-merge-2.0.6.tgz",
|
||||
@@ -17466,11 +17540,11 @@
|
||||
}
|
||||
},
|
||||
"vue-loader": {
|
||||
"version": "15.2.4",
|
||||
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.2.4.tgz",
|
||||
"integrity": "sha512-9Wqa7oL+NaNQHnBdJQjqd+NdRpcJmDUZ/y4HgeBX1Kky+j3HsG/tV4IqprmPsjO1wIhP1VZJg5AInuDebfHA6w==",
|
||||
"version": "15.2.5",
|
||||
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.2.5.tgz",
|
||||
"integrity": "sha512-mphtHNMO0DgiPfoIlQtYKtEgLYlTZmZzluj8TQjz+7ePqFMo670cPaMsEP0tF6U8oVnIJJ2I4v76GFq34Vwddw==",
|
||||
"requires": {
|
||||
"@vue/component-compiler-utils": "^1.2.1",
|
||||
"@vue/component-compiler-utils": "^2.0.0",
|
||||
"hash-sum": "^1.0.2",
|
||||
"loader-utils": "^1.1.0",
|
||||
"vue-hot-reload-api": "^2.3.0",
|
||||
@@ -17626,9 +17700,9 @@
|
||||
"integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg=="
|
||||
},
|
||||
"webpack": {
|
||||
"version": "4.16.0",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-4.16.0.tgz",
|
||||
"integrity": "sha512-oNx9djAd6uAcccyfqN3hyXLNMjZHiRySZmBQ4c8FNmf1SNJGhx7n9TSvHNyXxgToRdH65g/Q97s94Ip9N6F7xg==",
|
||||
"version": "4.16.1",
|
||||
"resolved": "https://registry.npmjs.org/webpack/-/webpack-4.16.1.tgz",
|
||||
"integrity": "sha512-6jpzObU18y7lXDJz7XCLvzgrqcJ0rZ2jhKvnTivza9gM2GvPW93xxtmEll2GgmdC0zVQAtbHrH/9BtyMjSDZfA==",
|
||||
"requires": {
|
||||
"@webassemblyjs/ast": "1.5.13",
|
||||
"@webassemblyjs/helper-module-context": "1.5.13",
|
||||
@@ -17641,7 +17715,7 @@
|
||||
"ajv-keywords": "^3.1.0",
|
||||
"chrome-trace-event": "^1.0.0",
|
||||
"enhanced-resolve": "^4.1.0",
|
||||
"eslint-scope": "^3.7.1",
|
||||
"eslint-scope": "^4.0.0",
|
||||
"json-parse-better-errors": "^1.0.2",
|
||||
"loader-runner": "^2.3.0",
|
||||
"loader-utils": "^1.1.0",
|
||||
@@ -17655,17 +17729,6 @@
|
||||
"uglifyjs-webpack-plugin": "^1.2.4",
|
||||
"watchpack": "^1.5.0",
|
||||
"webpack-sources": "^1.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"eslint-scope": {
|
||||
"version": "3.7.3",
|
||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz",
|
||||
"integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==",
|
||||
"requires": {
|
||||
"esrecurse": "^4.1.0",
|
||||
"estraverse": "^4.1.1"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"webpack-cli": {
|
||||
|
||||
11
package.json
11
package.json
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"author": "syuilo <i@syuilo.com>",
|
||||
"version": "4.20.0",
|
||||
"clientVersion": "1.0.7257",
|
||||
"version": "4.22.1",
|
||||
"clientVersion": "1.0.7361",
|
||||
"codename": "nighthike",
|
||||
"main": "./built/index.js",
|
||||
"private": true,
|
||||
@@ -79,7 +79,7 @@
|
||||
"@types/speakeasy": "2.0.2",
|
||||
"@types/tmp": "0.0.33",
|
||||
"@types/uuid": "3.4.3",
|
||||
"@types/webpack": "4.4.6",
|
||||
"@types/webpack": "4.4.7",
|
||||
"@types/webpack-stream": "3.2.10",
|
||||
"@types/websocket": "0.0.39",
|
||||
"@types/ws": "5.1.2",
|
||||
@@ -181,6 +181,7 @@
|
||||
"sass-loader": "7.0.3",
|
||||
"seedrandom": "2.4.3",
|
||||
"showdown": "1.8.6",
|
||||
"showdown-highlightjs-extension": "0.1.2",
|
||||
"single-line-log": "1.1.2",
|
||||
"speakeasy": "2.0.0",
|
||||
"style-loader": "0.21.0",
|
||||
@@ -204,7 +205,7 @@
|
||||
"vue-cropperjs": "2.2.1",
|
||||
"vue-js-modal": "1.3.16",
|
||||
"vue-json-tree-view": "2.1.4",
|
||||
"vue-loader": "15.2.4",
|
||||
"vue-loader": "15.2.5",
|
||||
"vue-router": "3.0.1",
|
||||
"vue-template-compiler": "2.5.16",
|
||||
"vuedraggable": "2.16.0",
|
||||
@@ -212,7 +213,7 @@
|
||||
"vuex-persistedstate": "2.5.4",
|
||||
"web-push": "3.3.2",
|
||||
"webfinger.js": "2.6.6",
|
||||
"webpack": "4.16.0",
|
||||
"webpack": "4.16.1",
|
||||
"webpack-cli": "3.0.8",
|
||||
"websocket": "1.0.26",
|
||||
"ws": "5.2.2",
|
||||
|
||||
@@ -45,7 +45,7 @@ export default Vue.extend({
|
||||
data() {
|
||||
return {
|
||||
now: new Date(),
|
||||
clock: null,
|
||||
enabled: true,
|
||||
|
||||
graduationsPadding: 0.5,
|
||||
handsPadding: 1,
|
||||
@@ -74,6 +74,9 @@ export default Vue.extend({
|
||||
return themeColor;
|
||||
},
|
||||
|
||||
ms(): number {
|
||||
return this.now.getMilliseconds();
|
||||
}
|
||||
s(): number {
|
||||
return this.now.getSeconds();
|
||||
},
|
||||
@@ -85,13 +88,13 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
hAngle(): number {
|
||||
return Math.PI * (this.h % 12 + this.m / 60) / 6;
|
||||
return Math.PI * (this.h % 12 + (this.m + (this.s + this.ms / 1000) / 60) / 60) / 6;
|
||||
},
|
||||
mAngle(): number {
|
||||
return Math.PI * (this.m + this.s / 60) / 30;
|
||||
return Math.PI * (this.m + (this.s + this.ms / 1000) / 60) / 30;
|
||||
},
|
||||
sAngle(): number {
|
||||
return Math.PI * this.s / 30;
|
||||
return Math.PI * (this.s + this.ms / 1000) / 30;
|
||||
},
|
||||
|
||||
graduations(): any {
|
||||
@@ -106,11 +109,17 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.clock = setInterval(this.tick, 1000);
|
||||
const update = () => {
|
||||
if (this.enabled) {
|
||||
this.tick();
|
||||
requestAnimationFrame(update);
|
||||
}
|
||||
};
|
||||
update();
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
clearInterval(this.clock);
|
||||
this.enabled = false;
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
@@ -6,12 +6,14 @@
|
||||
color #fff
|
||||
background #222e40
|
||||
border-radius 4px
|
||||
overflow auto
|
||||
white-space nowrap
|
||||
|
||||
> .method
|
||||
display inline-block
|
||||
margin 0 8px 0 0
|
||||
padding 0 6px
|
||||
color #f4fcff
|
||||
color #fff
|
||||
background #17afc7
|
||||
border-radius 4px
|
||||
user-select none
|
||||
|
||||
@@ -5,7 +5,7 @@ block meta
|
||||
link(rel="stylesheet" href="/docs/assets/api/endpoints/style.css")
|
||||
|
||||
block main
|
||||
h1= endpoint
|
||||
h1= title
|
||||
|
||||
p#url
|
||||
span.method POST
|
||||
@@ -14,25 +14,63 @@ block main
|
||||
| /
|
||||
span.path= url.path
|
||||
|
||||
p#desc= desc[lang] || desc['ja']
|
||||
if endpoint.desc
|
||||
p#desc= endpoint.desc[lang] || endpoint.desc['ja']
|
||||
|
||||
section
|
||||
h2= i18n('docs.api.endpoints.params')
|
||||
+propTable(params)
|
||||
if endpoint.requireCredential
|
||||
div.ui.info: p
|
||||
i.fas.fa-id-card-alt(style="margin-right: 4px")
|
||||
= i18n('docs.api.endpoints.require-credential')
|
||||
|
||||
if paramDefs
|
||||
each paramDef in paramDefs
|
||||
section(id= paramDef.name)
|
||||
h3= paramDef.name
|
||||
+propTable(paramDef.params)
|
||||
if endpoint.kind
|
||||
div.ui.info: p
|
||||
i.fas.fa-unlock-alt(style="margin-right: 4px")
|
||||
!= i18n('docs.api.endpoints.require-permission').replace('{permission}', `<code>${endpoint.kind}</code>`)
|
||||
|
||||
if endpoint.limit
|
||||
div.ui.info.warn: p
|
||||
i.far.fa-clock(style="margin-right: 4px")
|
||||
b!= i18n('docs.api.endpoints.has-limit')
|
||||
if endpoint.limit.duration
|
||||
!= i18n('docs.api.endpoints.duration-limit').replace('{duration}', endpoint.limit.duration).replace('{max}', endpoint.limit.max)
|
||||
if endpoint.limit.minInterval
|
||||
!= i18n('docs.api.endpoints.min-interval-limit').replace('{interval}', endpoint.limit.minInterval)
|
||||
|
||||
if params && Object.keys(params).length > 0
|
||||
section
|
||||
h2= i18n('docs.api.endpoints.params')
|
||||
+propTable(params)
|
||||
|
||||
if paramDefs
|
||||
each paramDef in paramDefs
|
||||
section(id= paramDef.name)
|
||||
h3= paramDef.name
|
||||
+propTable(paramDef.params)
|
||||
if params && Object.keys(params).length == 0
|
||||
section
|
||||
h2= i18n('docs.api.endpoints.params')
|
||||
p= i18n('docs.api.endpoints.no-params')
|
||||
|
||||
if res
|
||||
section
|
||||
h2= i18n('docs.api.endpoints.res')
|
||||
+propTable(res)
|
||||
|
||||
if resDefs
|
||||
each resDef in resDefs
|
||||
section(id= resDef.name)
|
||||
h3= resDef.name
|
||||
+propTable(resDef.props)
|
||||
if resProps
|
||||
+propTable(resProps)
|
||||
|
||||
if resDefs
|
||||
each resDef in resDefs
|
||||
section(id= resDef.name)
|
||||
h3= resDef.name
|
||||
+propTable(resDef.props)
|
||||
else
|
||||
if res.type.startsWith('entity')
|
||||
a(href=`/docs/${lang}/api/entities/${kebab(res.entity)}`)= res.entity
|
||||
|
||||
block footer
|
||||
div.ui.info: p
|
||||
i.fas.fa-info-circle(style="margin-right: 4px")
|
||||
= i18n('docs.api.endpoints.generated')
|
||||
p
|
||||
= i18n('docs.api.endpoints.show-src')
|
||||
a(href=src target="_blank")= i18n('docs.api.endpoints.show-src-link')
|
||||
|
||||
@@ -5,67 +5,77 @@ desc:
|
||||
en: "A file of Drive."
|
||||
|
||||
props:
|
||||
- name: "id"
|
||||
id:
|
||||
type: "id"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "ファイルID"
|
||||
en: "The ID of this file"
|
||||
- name: "createdAt"
|
||||
|
||||
createdAt:
|
||||
type: "date"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "アップロード日時"
|
||||
en: "The upload date of this file"
|
||||
- name: "userId"
|
||||
|
||||
userId:
|
||||
type: "id(User)"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "所有者ID"
|
||||
en: "The ID of the owner of this file"
|
||||
- name: "user"
|
||||
|
||||
user:
|
||||
type: "entity(User)"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "所有者"
|
||||
en: "The owner of this file"
|
||||
- name: "name"
|
||||
|
||||
name:
|
||||
type: "string"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "ファイル名"
|
||||
en: "The name of this file"
|
||||
- name: "md5"
|
||||
|
||||
md5:
|
||||
type: "string"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "ファイルのMD5ハッシュ値"
|
||||
en: "The md5 hash value of this file"
|
||||
- name: "type"
|
||||
|
||||
type:
|
||||
type: "string"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "ファイルの種類"
|
||||
en: "The type of this file"
|
||||
- name: "datasize"
|
||||
|
||||
datasize:
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "ファイルサイズ(bytes)"
|
||||
en: "The size of this file (bytes)"
|
||||
- name: "url"
|
||||
|
||||
url:
|
||||
type: "string"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "ファイルのURL"
|
||||
en: "The URL of this file"
|
||||
- name: "folderId"
|
||||
|
||||
folderId:
|
||||
type: "id(DriveFolder)"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "フォルダID"
|
||||
en: "The ID of the folder of this file"
|
||||
- name: "folder"
|
||||
|
||||
folder:
|
||||
type: "entity(DriveFolder)"
|
||||
optional: true
|
||||
desc:
|
||||
|
||||
@@ -5,163 +5,185 @@ desc:
|
||||
en: "A note."
|
||||
|
||||
props:
|
||||
- name: "id"
|
||||
id:
|
||||
type: "id"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "投稿ID"
|
||||
en: "The ID of this note"
|
||||
- name: "createdAt"
|
||||
|
||||
createdAt:
|
||||
type: "date"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "投稿日時"
|
||||
en: "The posted date of this note"
|
||||
- name: "viaMobile"
|
||||
|
||||
viaMobile:
|
||||
type: "boolean"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "モバイル端末から投稿したか否か(自己申告であることに留意)"
|
||||
en: "Whether this note sent via a mobile device"
|
||||
- name: "text"
|
||||
|
||||
text:
|
||||
type: "string"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "投稿の本文"
|
||||
en: "The text of this note"
|
||||
- name: "mediaIds"
|
||||
|
||||
mediaIds:
|
||||
type: "id(DriveFile)[]"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "添付されているメディアのID (なければレスポンスでは空配列)"
|
||||
en: "The IDs of the attached media (empty array for response if no media is attached)"
|
||||
- name: "media"
|
||||
|
||||
media:
|
||||
type: "entity(DriveFile)[]"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "添付されているメディア"
|
||||
en: "The attached media"
|
||||
- name: "userId"
|
||||
|
||||
userId:
|
||||
type: "id(User)"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "投稿者ID"
|
||||
en: "The ID of author of this note"
|
||||
- name: "user"
|
||||
|
||||
user:
|
||||
type: "entity(User)"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "投稿者"
|
||||
en: "The author of this note"
|
||||
- name: "myReaction"
|
||||
|
||||
myReaction:
|
||||
type: "string"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "この投稿に対する自分の<a href='/docs/api/reactions'>リアクション</a>"
|
||||
en: "The your <a href='/docs/api/reactions'>reaction</a> of this note"
|
||||
- name: "reactionCounts"
|
||||
|
||||
reactionCounts:
|
||||
type: "object"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "<a href='/docs/api/reactions'>リアクション</a>をキーとし、この投稿に対するそのリアクションの数を値としたオブジェクト"
|
||||
- name: "replyId"
|
||||
|
||||
replyId:
|
||||
type: "id(Note)"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "返信した投稿のID"
|
||||
en: "The ID of the replyed note"
|
||||
- name: "reply"
|
||||
|
||||
reply:
|
||||
type: "entity(Note)"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "返信した投稿"
|
||||
en: "The replyed note"
|
||||
- name: "renoteId"
|
||||
|
||||
renoteId:
|
||||
type: "id(Note)"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "引用した投稿のID"
|
||||
en: "The ID of the quoted note"
|
||||
- name: "renote"
|
||||
|
||||
renote:
|
||||
type: "entity(Note)"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "引用した投稿"
|
||||
en: "The quoted note"
|
||||
- name: "poll"
|
||||
|
||||
poll:
|
||||
type: "object"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "投票"
|
||||
en: "The poll"
|
||||
defName: "poll"
|
||||
def:
|
||||
- name: "choices"
|
||||
|
||||
props:
|
||||
choices:
|
||||
type: "object[]"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "投票の選択肢"
|
||||
en: "The choices of this poll"
|
||||
defName: "choice"
|
||||
def:
|
||||
- name: "id"
|
||||
|
||||
props:
|
||||
id:
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "選択肢ID"
|
||||
en: "The ID of this choice"
|
||||
- name: "isVoted"
|
||||
|
||||
isVoted:
|
||||
type: "boolean"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "自分がこの選択肢に投票したかどうか"
|
||||
en: "Whether you voted to this choice"
|
||||
- name: "text"
|
||||
|
||||
text:
|
||||
type: "string"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "選択肢本文"
|
||||
en: "The text of this choice"
|
||||
- name: "votes"
|
||||
|
||||
votes:
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "この選択肢に投票された数"
|
||||
en: "The number voted for this choice"
|
||||
- name: "geo"
|
||||
geo:
|
||||
type: "object"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "位置情報"
|
||||
en: "Geo location"
|
||||
defName: "geo"
|
||||
def:
|
||||
- name: "coordinates"
|
||||
|
||||
props:
|
||||
coordinates:
|
||||
type: "number[]"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "座標。最初に経度:-180〜180で表す。最後に緯度:-90〜90で表す。"
|
||||
- name: "altitude"
|
||||
|
||||
altitude:
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "高度。メートル単位で表す。"
|
||||
- name: "accuracy"
|
||||
|
||||
accuracy:
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "緯度、経度の精度。メートル単位で表す。"
|
||||
- name: "altitudeAccuracy"
|
||||
|
||||
altitudeAccuracy:
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "高度の精度。メートル単位で表す。"
|
||||
- name: "heading"
|
||||
|
||||
heading:
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "方角。0〜360の角度で表す。0が北、90が東、180が南、270が西。"
|
||||
- name: "speed"
|
||||
|
||||
speed:
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
|
||||
@@ -1,168 +0,0 @@
|
||||
name: "Note"
|
||||
|
||||
desc:
|
||||
ja: "投稿。"
|
||||
en: "A note."
|
||||
|
||||
props:
|
||||
- name: "id"
|
||||
type: "id"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "投稿ID"
|
||||
en: "The ID of this note"
|
||||
- name: "createdAt"
|
||||
type: "date"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "投稿日時"
|
||||
en: "The posted date of this note"
|
||||
- name: "viaMobile"
|
||||
type: "boolean"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "モバイル端末から投稿したか否か(自己申告であることに留意)"
|
||||
en: "Whether this note sent via a mobile device"
|
||||
- name: "text"
|
||||
type: "string"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "投稿の本文 (ローカルの場合Markdown風のフォーマット)"
|
||||
en: "The text of this note (in Markdown like format if local)"
|
||||
- name: "mediaIds"
|
||||
type: "id(DriveFile)[]"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "添付されているメディアのID (なければレスポンスでは空配列)"
|
||||
en: "The IDs of the attached media (empty array for response if no media is attached)"
|
||||
- name: "media"
|
||||
type: "entity(DriveFile)[]"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "添付されているメディア"
|
||||
en: "The attached media"
|
||||
- name: "userId"
|
||||
type: "id(User)"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "投稿者ID"
|
||||
en: "The ID of author of this note"
|
||||
- name: "user"
|
||||
type: "entity(User)"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "投稿者"
|
||||
en: "The author of this note"
|
||||
- name: "myReaction"
|
||||
type: "string"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "この投稿に対する自分の<a href='/docs/api/reactions'>リアクション</a>"
|
||||
en: "The your <a href='/docs/api/reactions'>reaction</a> of this note"
|
||||
- name: "reactionCounts"
|
||||
type: "object"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "<a href='/docs/api/reactions'>リアクション</a>をキーとし、この投稿に対するそのリアクションの数を値としたオブジェクト"
|
||||
- name: "replyId"
|
||||
type: "id(Note)"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "返信した投稿のID"
|
||||
en: "The ID of the replyed note"
|
||||
- name: "reply"
|
||||
type: "entity(Note)"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "返信した投稿"
|
||||
en: "The replyed note"
|
||||
- name: "renoteId"
|
||||
type: "id(Note)"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "引用した投稿のID"
|
||||
en: "The ID of the quoted note"
|
||||
- name: "renote"
|
||||
type: "entity(Note)"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "引用した投稿"
|
||||
en: "The quoted note"
|
||||
- name: "poll"
|
||||
type: "object"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "投票"
|
||||
en: "The poll"
|
||||
defName: "poll"
|
||||
def:
|
||||
- name: "choices"
|
||||
type: "object[]"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "投票の選択肢"
|
||||
en: "The choices of this poll"
|
||||
defName: "choice"
|
||||
def:
|
||||
- name: "id"
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "選択肢ID"
|
||||
en: "The ID of this choice"
|
||||
- name: "isVoted"
|
||||
type: "boolean"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "自分がこの選択肢に投票したかどうか"
|
||||
en: "Whether you voted to this choice"
|
||||
- name: "text"
|
||||
type: "string"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "選択肢本文"
|
||||
en: "The text of this choice"
|
||||
- name: "votes"
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "この選択肢に投票された数"
|
||||
en: "The number voted for this choice"
|
||||
- name: "geo"
|
||||
type: "object"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "位置情報"
|
||||
en: "Geo location"
|
||||
defName: "geo"
|
||||
def:
|
||||
- name: "coordinates"
|
||||
type: "number[]"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "座標。最初に経度:-180〜180で表す。最後に緯度:-90〜90で表す。"
|
||||
- name: "altitude"
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "高度。メートル単位で表す。"
|
||||
- name: "accuracy"
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "緯度、経度の精度。メートル単位で表す。"
|
||||
- name: "altitudeAccuracy"
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "高度の精度。メートル単位で表す。"
|
||||
- name: "heading"
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "方角。0〜360の角度で表す。0が北、90が東、180が南、270が西。"
|
||||
- name: "speed"
|
||||
type: "number"
|
||||
optional: false
|
||||
desc:
|
||||
ja: "速度。メートル / 秒数で表す。"
|
||||
@@ -135,6 +135,7 @@ props:
|
||||
desc:
|
||||
ja: "連携されているTwitterアカウント情報"
|
||||
en: "The info of the connected twitter account of this user"
|
||||
|
||||
props:
|
||||
userId:
|
||||
type: "string"
|
||||
@@ -142,6 +143,7 @@ props:
|
||||
desc:
|
||||
ja: "ユーザーID"
|
||||
en: "The user ID"
|
||||
|
||||
screenName:
|
||||
type: "string"
|
||||
optional: false
|
||||
@@ -162,6 +164,7 @@ props:
|
||||
desc:
|
||||
ja: "プロフィール"
|
||||
en: "The profile of this user"
|
||||
|
||||
props:
|
||||
location:
|
||||
type: "string"
|
||||
@@ -169,6 +172,7 @@ props:
|
||||
desc:
|
||||
ja: "場所"
|
||||
en: "The location of this user"
|
||||
|
||||
birthday:
|
||||
type: "string"
|
||||
optional: true
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
mixin type(prop)
|
||||
i= prop.type
|
||||
if prop.kind == 'id'
|
||||
if prop.entity
|
||||
| (
|
||||
a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity
|
||||
| ID)
|
||||
else
|
||||
| (ID)
|
||||
else if prop.kind == 'entity'
|
||||
| (
|
||||
a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity
|
||||
| )
|
||||
else if prop.kind == 'object'
|
||||
if prop.hasDef
|
||||
| (
|
||||
a(href=`#${prop.name}`)= prop.name
|
||||
| )
|
||||
else if prop.kind == 'date'
|
||||
| (Date)
|
||||
|
||||
mixin propTable(props)
|
||||
table.props
|
||||
thead: tr
|
||||
@@ -9,23 +30,5 @@ mixin propTable(props)
|
||||
tr
|
||||
td.name= prop.name
|
||||
td.type
|
||||
i= prop.type
|
||||
if prop.kind == 'id'
|
||||
if prop.entity
|
||||
| (
|
||||
a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity
|
||||
| ID)
|
||||
else
|
||||
| (ID)
|
||||
else if prop.kind == 'entity'
|
||||
| (
|
||||
a(href=`/docs/${lang}/api/entities/${kebab(prop.entity)}`)= prop.entity
|
||||
| )
|
||||
else if prop.kind == 'object'
|
||||
if prop.hasDef
|
||||
| (
|
||||
a(href=`#${prop.name}`)= prop.name
|
||||
| )
|
||||
else if prop.kind == 'date'
|
||||
| (Date)
|
||||
+type(prop)
|
||||
td.desc!= prop.desc ? prop.desc[lang] || prop.desc['ja'] : null
|
||||
|
||||
@@ -2,3 +2,8 @@ extends ./base
|
||||
|
||||
block main
|
||||
!= html
|
||||
|
||||
block footer
|
||||
p
|
||||
= i18n('docs.edit-this-page-on-github')
|
||||
a(href=src target="_blank")= i18n('docs.edit-this-page-on-github-link')
|
||||
|
||||
@@ -7,6 +7,8 @@ html(lang= lang)
|
||||
title
|
||||
| #{title} | Misskey Docs
|
||||
link(rel="stylesheet" href="/docs/assets/style.css")
|
||||
link(rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css")
|
||||
script(src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js")
|
||||
link(rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous")
|
||||
block meta
|
||||
|
||||
@@ -25,7 +27,7 @@ html(lang= lang)
|
||||
li Endpoints
|
||||
ul
|
||||
each endpoint in endpoints
|
||||
li: a(href=`/docs/${lang}/api/endpoints/${kebab(endpoint)}`)= endpoint
|
||||
li: a(href=`/docs/${lang}/api/endpoints/${kebab(endpoint.name)}`)= endpoint.name
|
||||
main
|
||||
article
|
||||
block main
|
||||
@@ -33,7 +35,5 @@ html(lang= lang)
|
||||
| !{content}
|
||||
|
||||
footer
|
||||
p
|
||||
| %i18n:docs.edit-this-page-on-github%
|
||||
a(href=src target="_blank") %i18n:docs.edit-this-page-on-github-link%
|
||||
block footer
|
||||
small= copyright
|
||||
|
||||
8
src/docs/follow.ja.md
Normal file
8
src/docs/follow.ja.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# フォロー
|
||||
ユーザーをフォローすると、タイムラインにそのユーザーの投稿が表示されるようになります。ただし、他のユーザーに対する返信は含まれません。
|
||||
ユーザーをフォローするには、ユーザーページの「フォロー」ボタンをクリックします。フォローを解除するには、もう一度クリックします。
|
||||
|
||||
## ストーキング
|
||||
ユーザーをフォローしている状態では、さらに「ストーキング」モードをオンにすることができます。ストーキングを行うと、タイムラインにそのユーザーの全ての投稿が表示されるようになります。つまり、他のユーザーに対する返信も含まれることになります。
|
||||
ストーキングするには、ユーザーページの「ストークする」をクリックします。ストーキングをやめるには、もう一度クリックします。
|
||||
ストーキングしていることは相手に通知されません。
|
||||
13
src/docs/mute.ja.md
Normal file
13
src/docs/mute.ja.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# ミュート
|
||||
|
||||
ユーザーをミュートすると、そのユーザーに関する次のコンテンツがMisskeyに表示されなくなります:
|
||||
|
||||
* タイムラインや投稿の検索結果内の、そのユーザーの投稿(およびそれらの投稿に対する返信やRenote)
|
||||
* そのユーザーからの通知
|
||||
* メッセージ履歴一覧内の、そのユーザーとのメッセージ履歴
|
||||
|
||||
ユーザーをミュートするには、対象のユーザーのユーザーページに表示されている「ミュート」ボタンを押します。
|
||||
|
||||
ミュートを行ったことは相手に通知されず、ミュートされていることを知ることもできません。
|
||||
|
||||
設定>ミュート から、自分がミュートしているユーザー一覧を確認することができます。
|
||||
165
src/docs/reversi-bot.ja.md
Normal file
165
src/docs/reversi-bot.ja.md
Normal file
@@ -0,0 +1,165 @@
|
||||
# MisskeyリバーシBotの開発
|
||||
Misskeyのリバーシ機能に対応したBotの開発方法をここに記します。
|
||||
|
||||
1. `reversi`ストリームに以下のパラメータを付けて接続する:
|
||||
* `i`: botアカウントのAPIキー
|
||||
|
||||
2. 対局への招待が来たら、ストリームから`invited`イベントが流れてくる
|
||||
* イベントの中身に、`parent`という名前で対局へ誘ってきたユーザーの情報が含まれている
|
||||
|
||||
3. `reversi/match`へ、`user_id`として`parent`の`id`が含まれたリクエストを送信する
|
||||
|
||||
4. 上手くいくとゲーム情報が返ってくるので、`reversi-game`ストリームへ、以下のパラメータを付けて接続する:
|
||||
* `i`: botアカウントのAPIキー
|
||||
* `game`: `game`の`id`
|
||||
|
||||
5. この間、相手がゲームの設定を変更するとその都度`update-settings`イベントが流れてくるので、必要であれば何かしらの処理を行う
|
||||
|
||||
6. 設定に満足したら、`{ type: 'accept' }`メッセージをストリームに送信する
|
||||
|
||||
7. ゲームが開始すると、`started`イベントが流れてくる
|
||||
* イベントの中身にはゲーム情報が含まれている
|
||||
|
||||
8. 石を打つには、ストリームに`{ type: 'set', pos: <位置> }`を送信する(位置の計算方法は後述)
|
||||
|
||||
9. 相手または自分が石を打つと、ストリームから`set`イベントが流れてくる
|
||||
* `color`として石の色が含まれている
|
||||
* `pos`として位置情報が含まれている
|
||||
|
||||
## 位置の計算法
|
||||
8x8のマップを考える場合、各マスの位置(Posと呼びます)は次のようになっています:
|
||||
```
|
||||
+--+--+--+--+--+--+--+--+
|
||||
| 0| 1| 2| 3| 4| 5| 6| 7|
|
||||
+--+--+--+--+--+--+--+--+
|
||||
| 8| 9|10|11|12|13|14|15|
|
||||
+--+--+--+--+--+--+--+--+
|
||||
|16|17|18|19|20|21|22|23|
|
||||
...
|
||||
```
|
||||
|
||||
### X,Y座標 から Pos に変換する
|
||||
```
|
||||
pos = x + (y * mapWidth)
|
||||
```
|
||||
`mapWidth`は、ゲーム情報の`settings.map`から、次のようにして計算できます:
|
||||
```
|
||||
mapWidth = settings.map[0].length
|
||||
```
|
||||
|
||||
### Pos から X,Y座標 に変換する
|
||||
```
|
||||
x = pos % mapWidth
|
||||
y = Math.floor(pos / mapWidth)
|
||||
```
|
||||
|
||||
## マップ情報
|
||||
マップ情報は、ゲーム情報の`settings.map`に入っています。
|
||||
文字列の配列になっており、ひとつひとつの文字がマス情報を表しています。
|
||||
それをもとにマップのデザインを知る事が出来ます:
|
||||
* `(スペース)` ... マス無し
|
||||
* `-` ... マス
|
||||
* `b` ... 初期配置される黒石
|
||||
* `w` ... 初期配置される白石
|
||||
|
||||
例えば、4*4の次のような単純なマップがあるとします:
|
||||
```text
|
||||
+---+---+---+---+
|
||||
| | | | |
|
||||
+---+---+---+---+
|
||||
| | ○ | ● | |
|
||||
+---+---+---+---+
|
||||
| | ● | ○ | |
|
||||
+---+---+---+---+
|
||||
| | | | |
|
||||
+---+---+---+---+
|
||||
```
|
||||
|
||||
この場合、マップデータはこのようになります:
|
||||
```javascript
|
||||
['----', '-wb-', '-bw-', '----']
|
||||
```
|
||||
|
||||
## ユーザーにフォームを提示して対話可能Botを作成する
|
||||
ユーザーとのコミュニケーションを行うため、ゲームの設定画面でユーザーにフォームを提示することができます。
|
||||
例えば、Botの強さをユーザーが設定できるようにする、といったシナリオが考えられます。
|
||||
|
||||
フォームを提示するには、`reversi-game`ストリームに次のメッセージを送信します:
|
||||
```javascript
|
||||
{
|
||||
type: 'init-form',
|
||||
body: [フォームコントロールの配列]
|
||||
}
|
||||
```
|
||||
|
||||
フォームコントロールの配列については今から説明します。
|
||||
フォームコントロールは、次のようなオブジェクトです:
|
||||
```javascript
|
||||
{
|
||||
id: 'button1',
|
||||
type: 'button',
|
||||
label: 'Enable hoge',
|
||||
value: false
|
||||
}
|
||||
```
|
||||
`id` ... コントロールのID。
|
||||
`type` ... コントロールの種類。後述します。
|
||||
`label` ... コントロールと一緒に表記するテキスト。
|
||||
`value` ... コントロールのデフォルト値。
|
||||
|
||||
### フォームの操作を受け取る
|
||||
ユーザーがフォームを操作すると、ストリームから`update-form`イベントが流れてきます。
|
||||
イベントの中身には、コントロールのIDと、ユーザーが設定した値が含まれています。
|
||||
例えば、上で示したボタンをユーザーがオンにしたとすると、次のイベントが流れてきます:
|
||||
```javascript
|
||||
{
|
||||
id: 'button1',
|
||||
value: true
|
||||
}
|
||||
```
|
||||
|
||||
### フォームコントロールの種類
|
||||
#### ボタン
|
||||
type: `button`
|
||||
ボタンを表示します。何かの機能をオン/オフさせたい場合に有用です。
|
||||
|
||||
##### プロパティ
|
||||
`desc` ... ボタンの詳細な説明。
|
||||
|
||||
#### ラジオボタン
|
||||
type: `radio`
|
||||
ラジオボタンを表示します。選択肢を提示するのに有用です。例えば、Botの強さを設定させるなどです。
|
||||
|
||||
##### プロパティ
|
||||
`items` ... ラジオボタンの選択肢。例:
|
||||
```javascript
|
||||
items: [{
|
||||
label: '弱',
|
||||
value: 1
|
||||
}, {
|
||||
label: '中',
|
||||
value: 2
|
||||
}, {
|
||||
label: '強',
|
||||
value: 3
|
||||
}]
|
||||
```
|
||||
|
||||
#### テキストボックス
|
||||
type: `textbox`
|
||||
テキストボックスを表示します。ユーザーになにか入力させる一般的な用途に利用できます。
|
||||
|
||||
## ユーザーにメッセージを表示する
|
||||
設定画面でユーザーと対話する、フォーム以外のもうひとつの方法がこれです。ユーザーになにかメッセージを表示することができます。
|
||||
例えば、ユーザーがBotの対応していないモードやマップを選択したとき、警告を表示するなどです。
|
||||
メッセージを表示するには、次のメッセージをストリームに送信します:
|
||||
```javascript
|
||||
{
|
||||
type: 'message',
|
||||
body: {
|
||||
text: 'メッセージ内容',
|
||||
type: 'メッセージの種類'
|
||||
}
|
||||
}
|
||||
```
|
||||
メッセージの種類: `success`, `info`, `warning`, `error`。
|
||||
@@ -7,10 +7,10 @@ body
|
||||
word-break break-word
|
||||
|
||||
main
|
||||
margin 0 0 0 256px
|
||||
margin 0 0 0 330px
|
||||
padding 64px
|
||||
width 100%
|
||||
max-width 800px
|
||||
width 850px
|
||||
max-width calc(100% - 330px)
|
||||
|
||||
section
|
||||
margin 32px 0
|
||||
@@ -44,6 +44,7 @@ main
|
||||
border-top solid 2px #eee
|
||||
|
||||
> small
|
||||
display block
|
||||
margin 16px 0 0 0
|
||||
color #aaa
|
||||
|
||||
@@ -53,13 +54,17 @@ nav
|
||||
z-index 10000
|
||||
top 0
|
||||
left 0
|
||||
width 256px
|
||||
width 330px
|
||||
height 100%
|
||||
overflow auto
|
||||
padding 32px
|
||||
background #fff
|
||||
border-right solid 2px #eee
|
||||
|
||||
ul
|
||||
padding 0
|
||||
margin 0
|
||||
|
||||
@media (max-width 1025px)
|
||||
main
|
||||
margin 0
|
||||
@@ -81,7 +86,6 @@ nav
|
||||
padding 16px
|
||||
|
||||
table
|
||||
display block
|
||||
width 100%
|
||||
max-width 100%
|
||||
overflow auto
|
||||
@@ -106,10 +110,9 @@ table
|
||||
min-width 128px
|
||||
|
||||
code
|
||||
display inline-block
|
||||
padding 8px 10px
|
||||
padding 4px 8px
|
||||
font-family Consolas, 'Courier New', Courier, Monaco, monospace
|
||||
color #295c92
|
||||
//color #295c92
|
||||
background #f2f2f2
|
||||
border-radius 4px
|
||||
|
||||
@@ -118,3 +121,4 @@ pre
|
||||
|
||||
> code
|
||||
display block
|
||||
padding 16px
|
||||
|
||||
15
src/docs/timelines.ja.md
Normal file
15
src/docs/timelines.ja.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# タイムラインの比較
|
||||
|
||||
https://docs.google.com/spreadsheets/d/1lxQ2ugKrhz58Bg96HTDK_2F98BUritkMyIiBkOByjHA/edit?usp=sharing
|
||||
|
||||
## ホーム
|
||||
自分のフォローしているユーザーの投稿
|
||||
|
||||
## ローカル
|
||||
全てのローカルユーザーの「ホーム」指定されていない投稿
|
||||
|
||||
## ソーシャル
|
||||
自分のフォローしているユーザーの投稿と、全てのローカルユーザーの「ホーム」指定されていない投稿
|
||||
|
||||
## グローバル
|
||||
全てのローカルユーザーの「ホーム」指定されていない投稿と、サーバーに届いた全てのリモートユーザーの「ホーム」指定されていない投稿
|
||||
@@ -1,12 +1,12 @@
|
||||
import * as Koa from 'koa';
|
||||
|
||||
import { Endpoint } from './endpoints';
|
||||
import { IEndpoint } from './endpoints';
|
||||
import authenticate from './authenticate';
|
||||
import call from './call';
|
||||
import { IUser } from '../../models/user';
|
||||
import { IApp } from '../../models/app';
|
||||
|
||||
export default async (endpoint: Endpoint, ctx: Koa.Context) => {
|
||||
export default async (endpoint: IEndpoint, ctx: Koa.Context) => {
|
||||
const body = ctx.is('multipart/form-data') ? (ctx.req as any).body : ctx.request.body;
|
||||
|
||||
const reply = (x?: any, y?: any) => {
|
||||
@@ -37,7 +37,7 @@ export default async (endpoint: Endpoint, ctx: Koa.Context) => {
|
||||
|
||||
// API invoking
|
||||
try {
|
||||
res = await call(endpoint, user, app, body, (ctx.req as any).file);
|
||||
res = await call(endpoint.name, user, app, body, (ctx.req as any).file);
|
||||
} catch (e) {
|
||||
reply(400, e);
|
||||
return;
|
||||
|
||||
@@ -1,33 +1,32 @@
|
||||
import endpoints, { Endpoint } from './endpoints';
|
||||
import limitter from './limitter';
|
||||
import { IUser } from '../../models/user';
|
||||
import { IApp } from '../../models/app';
|
||||
import endpoints from './endpoints';
|
||||
|
||||
export default (endpoint: string | Endpoint, user: IUser, app: IApp, data: any, file?: any) => new Promise<any>(async (ok, rej) => {
|
||||
export default (endpoint: string, user: IUser, app: IApp, data: any, file?: any) => new Promise<any>(async (ok, rej) => {
|
||||
const isSecure = user != null && app == null;
|
||||
|
||||
const epName = typeof endpoint === 'string' ? endpoint : endpoint.name;
|
||||
const ep = endpoints.find(e => e.name === epName);
|
||||
const ep = endpoints.find(e => e.name === endpoint);
|
||||
|
||||
if (ep.secure && !isSecure) {
|
||||
if (ep.meta.secure && !isSecure) {
|
||||
return rej('ACCESS_DENIED');
|
||||
}
|
||||
|
||||
if (ep.withCredential && user == null) {
|
||||
if (ep.meta.requireCredential && user == null) {
|
||||
return rej('SIGNIN_REQUIRED');
|
||||
}
|
||||
|
||||
if (ep.withCredential && user.isSuspended) {
|
||||
if (ep.meta.requireCredential && user.isSuspended) {
|
||||
return rej('YOUR_ACCOUNT_HAS_BEEN_SUSPENDED');
|
||||
}
|
||||
|
||||
if (app && ep.kind) {
|
||||
if (!app.permission.some(p => p === ep.kind)) {
|
||||
if (app && ep.meta.kind) {
|
||||
if (!app.permission.some(p => p === ep.meta.kind)) {
|
||||
return rej('PERMISSION_DENIED');
|
||||
}
|
||||
}
|
||||
|
||||
if (ep.withCredential && ep.limit) {
|
||||
if (ep.meta.requireCredential && ep.meta.limit) {
|
||||
try {
|
||||
await limitter(ep, user); // Rate limit
|
||||
} catch (e) {
|
||||
@@ -36,9 +35,9 @@ export default (endpoint: string | Endpoint, user: IUser, app: IApp, data: any,
|
||||
}
|
||||
}
|
||||
|
||||
let exec = require(`${__dirname}/endpoints/${ep.name}`).default;
|
||||
let exec = ep.exec;
|
||||
|
||||
if (ep.withFile && file) {
|
||||
if (ep.meta.withFile && file) {
|
||||
exec = exec.bind(null, file);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
const ms = require('ms');
|
||||
import * as path from 'path';
|
||||
import * as glob from 'glob';
|
||||
|
||||
/**
|
||||
* エンドポイントを表します。
|
||||
*/
|
||||
export type Endpoint = {
|
||||
export interface IEndpointMeta {
|
||||
desc?: any;
|
||||
|
||||
/**
|
||||
* エンドポイント名
|
||||
*/
|
||||
name: string;
|
||||
params?: any;
|
||||
|
||||
res?: any;
|
||||
|
||||
/**
|
||||
* このエンドポイントにリクエストするのにユーザー情報が必須か否か
|
||||
* 省略した場合は false として解釈されます。
|
||||
*/
|
||||
withCredential?: boolean;
|
||||
requireCredential?: boolean;
|
||||
|
||||
/**
|
||||
* エンドポイントのリミテーションに関するやつ
|
||||
@@ -63,597 +61,26 @@ export type Endpoint = {
|
||||
* パーミッションの実現に利用されます。
|
||||
*/
|
||||
kind?: string;
|
||||
};
|
||||
}
|
||||
|
||||
const endpoints: Endpoint[] = [
|
||||
{
|
||||
name: 'meta'
|
||||
},
|
||||
{
|
||||
name: 'stats'
|
||||
},
|
||||
{
|
||||
name: 'username/available'
|
||||
},
|
||||
{
|
||||
name: 'my/apps',
|
||||
withCredential: true
|
||||
},
|
||||
{
|
||||
name: 'app/create',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1day'),
|
||||
max: 3
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'app/show'
|
||||
},
|
||||
{
|
||||
name: 'app/name_id/available'
|
||||
},
|
||||
{
|
||||
name: 'auth/session/generate'
|
||||
},
|
||||
{
|
||||
name: 'auth/session/show'
|
||||
},
|
||||
{
|
||||
name: 'auth/session/userkey'
|
||||
},
|
||||
{
|
||||
name: 'auth/accept',
|
||||
withCredential: true,
|
||||
secure: true
|
||||
},
|
||||
{
|
||||
name: 'auth/deny',
|
||||
withCredential: true,
|
||||
secure: true
|
||||
},
|
||||
{
|
||||
name: 'aggregation/notes',
|
||||
},
|
||||
{
|
||||
name: 'aggregation/users',
|
||||
},
|
||||
{
|
||||
name: 'aggregation/users/activity',
|
||||
},
|
||||
{
|
||||
name: 'aggregation/users/note',
|
||||
},
|
||||
{
|
||||
name: 'aggregation/users/followers'
|
||||
},
|
||||
{
|
||||
name: 'aggregation/users/following'
|
||||
},
|
||||
{
|
||||
name: 'aggregation/users/reaction'
|
||||
},
|
||||
{
|
||||
name: 'aggregation/notes/renote'
|
||||
},
|
||||
{
|
||||
name: 'aggregation/notes/reply'
|
||||
},
|
||||
{
|
||||
name: 'aggregation/notes/reaction'
|
||||
},
|
||||
{
|
||||
name: 'aggregation/notes/reactions'
|
||||
},
|
||||
export interface IEndpoint {
|
||||
name: string;
|
||||
exec: any;
|
||||
meta: IEndpointMeta;
|
||||
}
|
||||
|
||||
{
|
||||
name: 'sw/register',
|
||||
withCredential: true
|
||||
},
|
||||
const files = glob.sync('**/*.js', {
|
||||
cwd: path.resolve(__dirname + '/endpoints/')
|
||||
});
|
||||
|
||||
{
|
||||
name: 'i',
|
||||
withCredential: true
|
||||
},
|
||||
{
|
||||
name: 'i/2fa/register',
|
||||
withCredential: true,
|
||||
secure: true
|
||||
},
|
||||
{
|
||||
name: 'i/2fa/unregister',
|
||||
withCredential: true,
|
||||
secure: true
|
||||
},
|
||||
{
|
||||
name: 'i/2fa/done',
|
||||
withCredential: true,
|
||||
secure: true
|
||||
},
|
||||
{
|
||||
name: 'i/update',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1day'),
|
||||
max: 50
|
||||
},
|
||||
kind: 'account-write'
|
||||
},
|
||||
{
|
||||
name: 'i/update_home',
|
||||
withCredential: true,
|
||||
secure: true
|
||||
},
|
||||
{
|
||||
name: 'i/update_mobile_home',
|
||||
withCredential: true,
|
||||
secure: true
|
||||
},
|
||||
{
|
||||
name: 'i/update_widget',
|
||||
withCredential: true,
|
||||
secure: true
|
||||
},
|
||||
{
|
||||
name: 'i/change_password',
|
||||
withCredential: true,
|
||||
secure: true
|
||||
},
|
||||
{
|
||||
name: 'i/regenerate_token',
|
||||
withCredential: true,
|
||||
secure: true
|
||||
},
|
||||
{
|
||||
name: 'i/update_client_setting',
|
||||
withCredential: true,
|
||||
secure: true
|
||||
},
|
||||
{
|
||||
name: 'i/pin',
|
||||
kind: 'account-write'
|
||||
},
|
||||
{
|
||||
name: 'i/appdata/get',
|
||||
withCredential: true
|
||||
},
|
||||
{
|
||||
name: 'i/appdata/set',
|
||||
withCredential: true
|
||||
},
|
||||
{
|
||||
name: 'i/signin_history',
|
||||
withCredential: true,
|
||||
kind: 'account-read'
|
||||
},
|
||||
{
|
||||
name: 'i/authorized_apps',
|
||||
withCredential: true,
|
||||
secure: true
|
||||
},
|
||||
const endpoints: IEndpoint[] = files.map(f => {
|
||||
const ep = require('./endpoints/' + f);
|
||||
|
||||
{
|
||||
name: 'i/notifications',
|
||||
withCredential: true,
|
||||
kind: 'notification-read'
|
||||
},
|
||||
|
||||
{
|
||||
name: 'i/favorites',
|
||||
withCredential: true,
|
||||
kind: 'favorites-read'
|
||||
},
|
||||
|
||||
{
|
||||
name: 'games/reversi/match',
|
||||
withCredential: true
|
||||
},
|
||||
|
||||
{
|
||||
name: 'games/reversi/match/cancel',
|
||||
withCredential: true
|
||||
},
|
||||
|
||||
{
|
||||
name: 'games/reversi/invitations',
|
||||
withCredential: true
|
||||
},
|
||||
|
||||
{
|
||||
name: 'games/reversi/games',
|
||||
withCredential: true
|
||||
},
|
||||
|
||||
{
|
||||
name: 'games/reversi/games/show'
|
||||
},
|
||||
|
||||
{
|
||||
name: 'mute/create',
|
||||
withCredential: true,
|
||||
kind: 'account/write'
|
||||
},
|
||||
{
|
||||
name: 'mute/delete',
|
||||
withCredential: true,
|
||||
kind: 'account/write'
|
||||
},
|
||||
{
|
||||
name: 'mute/list',
|
||||
withCredential: true,
|
||||
kind: 'account/read'
|
||||
},
|
||||
|
||||
{
|
||||
name: 'notifications/delete',
|
||||
withCredential: true,
|
||||
kind: 'notification-write'
|
||||
},
|
||||
{
|
||||
name: 'notifications/delete_all',
|
||||
withCredential: true,
|
||||
kind: 'notification-write'
|
||||
},
|
||||
{
|
||||
name: 'notifications/mark_as_read_all',
|
||||
withCredential: true,
|
||||
kind: 'notification-write'
|
||||
},
|
||||
|
||||
{
|
||||
name: 'drive',
|
||||
withCredential: true,
|
||||
kind: 'drive-read'
|
||||
},
|
||||
{
|
||||
name: 'drive/stream',
|
||||
withCredential: true,
|
||||
kind: 'drive-read'
|
||||
},
|
||||
{
|
||||
name: 'drive/files',
|
||||
withCredential: true,
|
||||
kind: 'drive-read'
|
||||
},
|
||||
{
|
||||
name: 'drive/files/create',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
},
|
||||
withFile: true,
|
||||
kind: 'drive-write'
|
||||
},
|
||||
{
|
||||
name: 'drive/files/upload_from_url',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 10
|
||||
},
|
||||
kind: 'drive-write'
|
||||
},
|
||||
{
|
||||
name: 'drive/files/show',
|
||||
withCredential: true,
|
||||
kind: 'drive-read'
|
||||
},
|
||||
{
|
||||
name: 'drive/files/find',
|
||||
withCredential: true,
|
||||
kind: 'drive-read'
|
||||
},
|
||||
{
|
||||
name: 'drive/files/delete',
|
||||
withCredential: true,
|
||||
kind: 'drive-write'
|
||||
},
|
||||
{
|
||||
name: 'drive/files/update',
|
||||
withCredential: true,
|
||||
kind: 'drive-write'
|
||||
},
|
||||
{
|
||||
name: 'drive/folders',
|
||||
withCredential: true,
|
||||
kind: 'drive-read'
|
||||
},
|
||||
{
|
||||
name: 'drive/folders/create',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 50
|
||||
},
|
||||
kind: 'drive-write'
|
||||
},
|
||||
{
|
||||
name: 'drive/folders/show',
|
||||
withCredential: true,
|
||||
kind: 'drive-read'
|
||||
},
|
||||
{
|
||||
name: 'drive/folders/find',
|
||||
withCredential: true,
|
||||
kind: 'drive-read'
|
||||
},
|
||||
{
|
||||
name: 'drive/folders/update',
|
||||
withCredential: true,
|
||||
kind: 'drive-write'
|
||||
},
|
||||
|
||||
{
|
||||
name: 'users'
|
||||
},
|
||||
{
|
||||
name: 'users/show'
|
||||
},
|
||||
{
|
||||
name: 'users/search'
|
||||
},
|
||||
{
|
||||
name: 'users/search_by_username'
|
||||
},
|
||||
{
|
||||
name: 'users/notes'
|
||||
},
|
||||
{
|
||||
name: 'users/following'
|
||||
},
|
||||
{
|
||||
name: 'users/followers'
|
||||
},
|
||||
{
|
||||
name: 'users/recommendation',
|
||||
withCredential: true,
|
||||
kind: 'account-read'
|
||||
},
|
||||
{
|
||||
name: 'users/get_frequently_replied_users'
|
||||
},
|
||||
|
||||
{
|
||||
name: 'users/lists/show',
|
||||
withCredential: true,
|
||||
kind: 'account-read'
|
||||
},
|
||||
{
|
||||
name: 'users/lists/create',
|
||||
withCredential: true,
|
||||
kind: 'account-write'
|
||||
},
|
||||
{
|
||||
name: 'users/lists/push',
|
||||
withCredential: true,
|
||||
kind: 'account-write'
|
||||
},
|
||||
{
|
||||
name: 'users/lists/list',
|
||||
withCredential: true,
|
||||
kind: 'account-read'
|
||||
},
|
||||
|
||||
{
|
||||
name: 'following/create',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
},
|
||||
kind: 'following-write'
|
||||
},
|
||||
{
|
||||
name: 'following/delete',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
},
|
||||
kind: 'following-write'
|
||||
},
|
||||
{
|
||||
name: 'following/requests/accept',
|
||||
withCredential: true,
|
||||
kind: 'following-write'
|
||||
},
|
||||
{
|
||||
name: 'following/requests/reject',
|
||||
withCredential: true,
|
||||
kind: 'following-write'
|
||||
},
|
||||
{
|
||||
name: 'following/requests/cancel',
|
||||
withCredential: true,
|
||||
kind: 'following-write'
|
||||
},
|
||||
{
|
||||
name: 'following/requests/list',
|
||||
withCredential: true,
|
||||
kind: 'following-read'
|
||||
},
|
||||
{
|
||||
name: 'following/stalk',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
},
|
||||
kind: 'following-write'
|
||||
},
|
||||
{
|
||||
name: 'following/unstalk',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
},
|
||||
kind: 'following-write'
|
||||
},
|
||||
|
||||
{
|
||||
name: 'notes'
|
||||
},
|
||||
{
|
||||
name: 'notes/show'
|
||||
},
|
||||
{
|
||||
name: 'notes/replies'
|
||||
},
|
||||
{
|
||||
name: 'notes/conversation'
|
||||
},
|
||||
{
|
||||
name: 'notes/create',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 300,
|
||||
minInterval: ms('1second')
|
||||
},
|
||||
kind: 'note-write'
|
||||
},
|
||||
{
|
||||
name: 'notes/delete',
|
||||
withCredential: true,
|
||||
kind: 'note-write'
|
||||
},
|
||||
{
|
||||
name: 'notes/renotes'
|
||||
},
|
||||
{
|
||||
name: 'notes/search'
|
||||
},
|
||||
{
|
||||
name: 'notes/search_by_tag'
|
||||
},
|
||||
{
|
||||
name: 'notes/timeline',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('10minutes'),
|
||||
max: 100
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'notes/local-timeline',
|
||||
limit: {
|
||||
duration: ms('10minutes'),
|
||||
max: 100
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'notes/hybrid-timeline',
|
||||
limit: {
|
||||
duration: ms('10minutes'),
|
||||
max: 100
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'notes/global-timeline',
|
||||
limit: {
|
||||
duration: ms('10minutes'),
|
||||
max: 100
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'notes/user-list-timeline',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('10minutes'),
|
||||
max: 100
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'notes/mentions',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('10minutes'),
|
||||
max: 100
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'notes/trend',
|
||||
withCredential: true
|
||||
},
|
||||
{
|
||||
name: 'notes/categorize',
|
||||
withCredential: true
|
||||
},
|
||||
{
|
||||
name: 'notes/reactions',
|
||||
withCredential: true
|
||||
},
|
||||
{
|
||||
name: 'notes/reactions/create',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 300
|
||||
},
|
||||
kind: 'reaction-write'
|
||||
},
|
||||
{
|
||||
name: 'notes/reactions/delete',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
},
|
||||
kind: 'reaction-write'
|
||||
},
|
||||
{
|
||||
name: 'notes/favorites/create',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
},
|
||||
kind: 'favorite-write'
|
||||
},
|
||||
{
|
||||
name: 'notes/favorites/delete',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
},
|
||||
kind: 'favorite-write'
|
||||
},
|
||||
{
|
||||
name: 'notes/polls/vote',
|
||||
withCredential: true,
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
},
|
||||
kind: 'vote-write'
|
||||
},
|
||||
{
|
||||
name: 'notes/polls/recommendation',
|
||||
withCredential: true
|
||||
},
|
||||
|
||||
{
|
||||
name: 'hashtags/trend'
|
||||
},
|
||||
|
||||
{
|
||||
name: 'messaging/history',
|
||||
withCredential: true,
|
||||
kind: 'messaging-read'
|
||||
},
|
||||
{
|
||||
name: 'messaging/messages',
|
||||
withCredential: true,
|
||||
kind: 'messaging-read'
|
||||
},
|
||||
{
|
||||
name: 'messaging/messages/create',
|
||||
withCredential: true,
|
||||
kind: 'messaging-write'
|
||||
}
|
||||
];
|
||||
return {
|
||||
name: f.replace('.js', ''),
|
||||
exec: ep.default,
|
||||
meta: ep.meta || {}
|
||||
};
|
||||
});
|
||||
|
||||
export default endpoints;
|
||||
|
||||
@@ -3,6 +3,10 @@ import $ from 'cafy';
|
||||
import App, { isValidNameId, pack } from '../../../../models/app';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true
|
||||
};
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /app/create:
|
||||
|
||||
@@ -6,6 +6,11 @@ import AuthSess from '../../../../models/auth-session';
|
||||
import AccessToken from '../../../../models/access-token';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
secure: true
|
||||
};
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /auth/accept:
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
import DriveFile from '../../../models/drive-file';
|
||||
import { ILocalUser } from '../../../models/user';
|
||||
|
||||
/**
|
||||
* Get drive information
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'ドライブの情報を取得します。',
|
||||
en: 'Get drive information.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-read'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Calculate drive usage
|
||||
const usage = await DriveFile
|
||||
|
||||
@@ -2,9 +2,17 @@ import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||
import DriveFile, { pack } from '../../../../models/drive-file';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Get drive files
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'ドライブのファイル一覧を取得します。',
|
||||
en: 'Get files of drive.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-read'
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
|
||||
@@ -1,8 +1,37 @@
|
||||
import * as fs from 'fs';
|
||||
const ms = require('ms');
|
||||
import $ from 'cafy'; import ID from '../../../../../misc/cafy-id';
|
||||
import { validateFileName, pack } from '../../../../../models/drive-file';
|
||||
import create from '../../../../../services/drive/add-file';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
import getParams from '../../../get-params';
|
||||
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'ドライブにファイルをアップロードします。',
|
||||
en: 'Upload a file to drive.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
},
|
||||
|
||||
withFile: true,
|
||||
|
||||
kind: 'drive-write',
|
||||
|
||||
params: {
|
||||
folderId: $.type(ID).optional.nullable.note({
|
||||
default: null,
|
||||
desc: {
|
||||
ja: 'フォルダID'
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a file
|
||||
@@ -27,17 +56,19 @@ export default async (file: any, params: any, user: ILocalUser): Promise<any> =>
|
||||
name = null;
|
||||
}
|
||||
|
||||
// Get 'folderId' parameter
|
||||
const [folderId = null, folderIdErr] = $.type(ID).optional.nullable.get(params.folderId);
|
||||
if (folderIdErr) throw 'invalid folderId param';
|
||||
|
||||
function cleanup() {
|
||||
fs.unlink(file.path, () => {});
|
||||
}
|
||||
|
||||
const [ps, psErr] = getParams(meta, params);
|
||||
if (psErr) {
|
||||
cleanup();
|
||||
throw psErr;
|
||||
}
|
||||
|
||||
try {
|
||||
// Create file
|
||||
const driveFile = await create(user, file.path, name, null, folderId);
|
||||
const driveFile = await create(user, file.path, name, null, ps.folderId);
|
||||
|
||||
cleanup();
|
||||
|
||||
|
||||
@@ -4,9 +4,17 @@ import del from '../../../../../services/drive/delete-file';
|
||||
import { publishDriveStream } from '../../../../../stream';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Delete a file
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'ドライブのファイルを削除します。',
|
||||
en: 'Delete a file of drive.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-write'
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => {
|
||||
// Get 'fileId' parameter
|
||||
const [fileId, fileIdErr] = $.type(ID).get(params.fileId);
|
||||
|
||||
@@ -2,9 +2,12 @@ import $ from 'cafy'; import ID from '../../../../../misc/cafy-id';
|
||||
import DriveFile, { pack } from '../../../../../models/drive-file';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Find a file(s)
|
||||
*/
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-read'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'name' parameter
|
||||
const [name, nameErr] = $.str.get(params.name);
|
||||
|
||||
@@ -2,9 +2,17 @@ import $ from 'cafy'; import ID from '../../../../../misc/cafy-id';
|
||||
import DriveFile, { pack } from '../../../../../models/drive-file';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Show a file
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定したドライブのファイルの情報を取得します。',
|
||||
en: 'Get specified file of drive.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-read'
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => {
|
||||
// Get 'fileId' parameter
|
||||
const [fileId, fileIdErr] = $.type(ID).get(params.fileId);
|
||||
|
||||
@@ -4,9 +4,17 @@ import DriveFile, { validateFileName, pack } from '../../../../../models/drive-f
|
||||
import { publishDriveStream } from '../../../../../stream';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Update a file
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定したドライブのファイルの情報を更新します。',
|
||||
en: 'Update specified file of drive.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'fileId' parameter
|
||||
const [fileId, fileIdErr] = $.type(ID).get(params.fileId);
|
||||
|
||||
@@ -1,11 +1,24 @@
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
import $ from 'cafy'; import ID from '../../../../../misc/cafy-id';
|
||||
const ms = require('ms');
|
||||
import { pack } from '../../../../../models/drive-file';
|
||||
import uploadFromUrl from '../../../../../services/drive/upload-from-url';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'ドライブに指定されたURLに存在するファイルをアップロードします。'
|
||||
},
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 10
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-write'
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a file from a URL
|
||||
*/
|
||||
|
||||
@@ -2,9 +2,17 @@ import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||
import DriveFolder, { pack } from '../../../../models/drive-folder';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Get drive folders
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'ドライブのフォルダ一覧を取得します。',
|
||||
en: 'Get folders of drive.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-read'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
|
||||
@@ -3,9 +3,17 @@ import DriveFolder, { isValidFolderName, pack } from '../../../../../models/driv
|
||||
import { publishDriveStream } from '../../../../../stream';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Create drive folder
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'ドライブのフォルダを作成します。',
|
||||
en: 'Create a folder of drive.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'name' parameter
|
||||
const [name = '無題のフォルダー', nameErr] = $.str.optional.pipe(isValidFolderName).get(params.name);
|
||||
|
||||
@@ -2,9 +2,12 @@ import $ from 'cafy'; import ID from '../../../../../misc/cafy-id';
|
||||
import DriveFolder, { pack } from '../../../../../models/drive-folder';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Find a folder(s)
|
||||
*/
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-read'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'name' parameter
|
||||
const [name, nameErr] = $.str.get(params.name);
|
||||
|
||||
@@ -2,9 +2,16 @@ import $ from 'cafy'; import ID from '../../../../../misc/cafy-id';
|
||||
import DriveFolder, { pack } from '../../../../../models/drive-folder';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Show a folder
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定したドライブのフォルダの情報を取得します。'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-read'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'folderId' parameter
|
||||
const [folderId, folderIdErr] = $.type(ID).get(params.folderId);
|
||||
|
||||
@@ -3,9 +3,17 @@ import DriveFolder, { isValidFolderName, pack } from '../../../../../models/driv
|
||||
import { publishDriveStream } from '../../../../../stream';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Update a folder
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定したドライブのフォルダの情報を更新します。',
|
||||
en: 'Update specified folder of drive.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'folderId' parameter
|
||||
const [folderId, folderIdErr] = $.type(ID).get(params.folderId);
|
||||
|
||||
@@ -2,9 +2,12 @@ import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||
import DriveFile, { pack } from '../../../../models/drive-file';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Get drive stream
|
||||
*/
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-read'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
|
||||
@@ -1,11 +1,25 @@
|
||||
import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||
const ms = require('ms');
|
||||
import User, { pack, ILocalUser } from '../../../../models/user';
|
||||
import Following from '../../../../models/following';
|
||||
import create from '../../../../services/following/create';
|
||||
|
||||
/**
|
||||
* Follow a user
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定したユーザーをフォローします。',
|
||||
en: 'Follow a user.'
|
||||
},
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'following-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
const follower = user;
|
||||
|
||||
|
||||
@@ -1,11 +1,25 @@
|
||||
import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||
const ms = require('ms');
|
||||
import User, { pack, ILocalUser } from '../../../../models/user';
|
||||
import Following from '../../../../models/following';
|
||||
import deleteFollowing from '../../../../services/following/delete';
|
||||
|
||||
/**
|
||||
* Unfollow a user
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定したユーザーのフォローを解除します。',
|
||||
en: 'Unfollow a user.'
|
||||
},
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 100
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'following-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
const follower = user;
|
||||
|
||||
|
||||
@@ -2,9 +2,17 @@ import $ from 'cafy'; import ID from '../../../../../misc/cafy-id';
|
||||
import acceptFollowRequest from '../../../../../services/following/requests/accept';
|
||||
import User, { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Accept a follow request
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '自分に届いた、指定したフォローリクエストを承認します。',
|
||||
en: 'Accept a follow request.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'following-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'userId' parameter
|
||||
const [followerId, followerIdErr] = $.type(ID).get(params.userId);
|
||||
|
||||
@@ -2,9 +2,17 @@ import $ from 'cafy'; import ID from '../../../../../misc/cafy-id';
|
||||
import cancelFollowRequest from '../../../../../services/following/requests/cancel';
|
||||
import User, { pack, ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Cancel a follow request
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '自分が作成した、指定したフォローリクエストをキャンセルします。',
|
||||
en: 'Cancel a follow request.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'following-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'userId' parameter
|
||||
const [followeeId, followeeIdErr] = $.type(ID).get(params.userId);
|
||||
|
||||
@@ -2,9 +2,17 @@
|
||||
import FollowRequest, { pack } from '../../../../../models/follow-request';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Get all pending received follow requests
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '自分に届いたフォローリクエストの一覧を取得します。',
|
||||
en: 'Get all pending received follow requests.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'following-read'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
const reqs = await FollowRequest.find({
|
||||
followeeId: user._id
|
||||
|
||||
@@ -2,9 +2,17 @@ import $ from 'cafy'; import ID from '../../../../../misc/cafy-id';
|
||||
import rejectFollowRequest from '../../../../../services/following/requests/reject';
|
||||
import User, { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Reject a follow request
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '自分に届いた、指定したフォローリクエストを拒否します。',
|
||||
en: 'Reject a follow request.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'following-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'userId' parameter
|
||||
const [followerId, followerIdErr] = $.type(ID).get(params.userId);
|
||||
|
||||
@@ -2,9 +2,17 @@ import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||
import Following from '../../../../models/following';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Stalk a user
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定したユーザーをストーキングします。',
|
||||
en: 'Stalk a user.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'following-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
const follower = user;
|
||||
|
||||
|
||||
@@ -2,9 +2,17 @@ import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||
import Following from '../../../../models/following';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Unstalk a user
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定したユーザーのストーキングをやめます。',
|
||||
en: 'Unstalk a user.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'following-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
const follower = user;
|
||||
|
||||
|
||||
@@ -2,6 +2,10 @@ import $ from 'cafy'; import ID from '../../../../../misc/cafy-id';
|
||||
import ReversiGame, { pack } from '../../../../../models/games/reversi/game';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'my' parameter
|
||||
const [my = false, myErr] = $.bool.optional.get(params.my);
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import Matching, { pack as packMatching } from '../../../../../models/games/reversi/matching';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Find session
|
||||
const invitations = await Matching.find({
|
||||
|
||||
@@ -5,6 +5,10 @@ import User, { ILocalUser } from '../../../../../models/user';
|
||||
import publishUserStream, { publishReversiStream } from '../../../../../stream';
|
||||
import { eighteight } from '../../../../../games/reversi/maps';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'userId' parameter
|
||||
const [childId, childIdErr] = $.type(ID).get(params.userId);
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import Matching from '../../../../../../models/games/reversi/matching';
|
||||
import { ILocalUser } from '../../../../../../models/user';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
await Matching.remove({
|
||||
parentId: user._id
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
import User, { pack, ILocalUser } from '../../../models/user';
|
||||
import { IApp } from '../../../models/app';
|
||||
|
||||
/**
|
||||
* Show myself
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '自分のアカウント情報を取得します。'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
params: {},
|
||||
|
||||
res: {
|
||||
type: 'entity',
|
||||
entity: 'User'
|
||||
}
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser, app: IApp) => new Promise(async (res, rej) => {
|
||||
const isSecure = user != null && app == null;
|
||||
|
||||
|
||||
@@ -2,6 +2,11 @@ import $ from 'cafy';
|
||||
import * as speakeasy from 'speakeasy';
|
||||
import User, { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
secure: true
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'token' parameter
|
||||
const [token, tokenErr] = $.str.get(params.token);
|
||||
|
||||
@@ -5,6 +5,11 @@ import * as QRCode from 'qrcode';
|
||||
import User, { ILocalUser } from '../../../../../models/user';
|
||||
import config from '../../../../../config';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
secure: true
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'password' parameter
|
||||
const [password, passwordErr] = $.str.get(params.password);
|
||||
|
||||
@@ -2,6 +2,11 @@ import $ from 'cafy';
|
||||
import * as bcrypt from 'bcryptjs';
|
||||
import User, { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
secure: true
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'password' parameter
|
||||
const [password, passwordErr] = $.str.get(params.password);
|
||||
|
||||
@@ -3,9 +3,11 @@ import AccessToken from '../../../../models/access-token';
|
||||
import { pack } from '../../../../models/app';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Get authorized apps of my account
|
||||
*/
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
secure: true
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
|
||||
@@ -2,9 +2,11 @@ import $ from 'cafy';
|
||||
import * as bcrypt from 'bcryptjs';
|
||||
import User, { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Change password
|
||||
*/
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
secure: true
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'currentPasword' parameter
|
||||
const [currentPassword, currentPasswordErr] = $.str.get(params.currentPasword);
|
||||
|
||||
@@ -2,9 +2,17 @@ import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||
import Favorite, { pack } from '../../../../models/favorite';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Get favorited notes
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'お気に入りに登録した投稿一覧を取得します。',
|
||||
en: 'Get favorited notes'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'favorites-read'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
|
||||
@@ -4,9 +4,11 @@ import User, { ILocalUser } from '../../../../models/user';
|
||||
import event from '../../../../stream';
|
||||
import generateUserToken from '../../common/generate-native-user-token';
|
||||
|
||||
/**
|
||||
* Regenerate native token
|
||||
*/
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
secure: true
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'password' parameter
|
||||
const [password, passwordErr] = $.str.get(params.password);
|
||||
|
||||
@@ -2,9 +2,11 @@ import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||
import Signin, { pack } from '../../../../models/signin';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Get signin history of my account
|
||||
*/
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
secure: true
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
|
||||
@@ -5,9 +5,17 @@ import DriveFile from '../../../../models/drive-file';
|
||||
import acceptAllFollowRequests from '../../../../services/following/requests/accept-all';
|
||||
import { IApp } from '../../../../models/app';
|
||||
|
||||
/**
|
||||
* Update myself
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'アカウント情報を更新します。',
|
||||
en: 'Update myself'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'account-write'
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser, app: IApp) => new Promise(async (res, rej) => {
|
||||
const isSecure = user != null && app == null;
|
||||
|
||||
|
||||
@@ -2,9 +2,11 @@ import $ from 'cafy';
|
||||
import User, { ILocalUser } from '../../../../models/user';
|
||||
import event from '../../../../stream';
|
||||
|
||||
/**
|
||||
* Update myself
|
||||
*/
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
secure: true
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'name' parameter
|
||||
const [name, nameErr] = $.str.get(params.name);
|
||||
|
||||
@@ -2,6 +2,11 @@ import $ from 'cafy';
|
||||
import User, { ILocalUser } from '../../../../models/user';
|
||||
import event from '../../../../stream';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
secure: true
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'home' parameter
|
||||
const [home, homeErr] = $.arr($.obj({
|
||||
|
||||
@@ -2,6 +2,11 @@ import $ from 'cafy';
|
||||
import User, { ILocalUser } from '../../../../models/user';
|
||||
import event from '../../../../stream';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
secure: true
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'home' parameter
|
||||
const [home, homeErr] = $.arr($.obj({
|
||||
|
||||
@@ -2,6 +2,11 @@ import $ from 'cafy';
|
||||
import User, { ILocalUser } from '../../../../models/user';
|
||||
import event from '../../../../stream';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true,
|
||||
secure: true
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'id' parameter
|
||||
const [id, idErr] = $.str.get(params.id);
|
||||
|
||||
@@ -4,9 +4,17 @@ import Mute from '../../../../models/mute';
|
||||
import { pack } from '../../../../models/messaging-message';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Show messaging history
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'Messagingの履歴を取得します。',
|
||||
en: 'Show messaging history.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'messaging-read'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
|
||||
@@ -4,9 +4,17 @@ import User, { ILocalUser } from '../../../../models/user';
|
||||
import { pack } from '../../../../models/messaging-message';
|
||||
import read from '../../common/read-messaging-message';
|
||||
|
||||
/**
|
||||
* Get messages
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定したユーザーとのMessagingのメッセージ一覧を取得します。',
|
||||
en: 'Get messages of messaging.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'messaging-read'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'userId' parameter
|
||||
const [recipientId, recipientIdErr] = $.type(ID).get(params.userId);
|
||||
|
||||
@@ -11,9 +11,17 @@ import { publishMessagingStream, publishMessagingIndexStream } from '../../../..
|
||||
import pushSw from '../../../../../push-sw';
|
||||
import config from '../../../../../config';
|
||||
|
||||
/**
|
||||
* Create a message
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定したユーザーへMessagingのメッセージを送信します。',
|
||||
en: 'Create a message of messaging.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'messaging-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'userId' parameter
|
||||
const [recipientId, recipientIdErr] = $.type(ID).get(params.userId);
|
||||
|
||||
@@ -2,9 +2,17 @@ import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||
import User, { ILocalUser } from '../../../../models/user';
|
||||
import Mute from '../../../../models/mute';
|
||||
|
||||
/**
|
||||
* Mute a user
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'ユーザーをミュートします。',
|
||||
en: 'Mute a user'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'account/write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
const muter = user;
|
||||
|
||||
|
||||
@@ -2,9 +2,17 @@ import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||
import User, { ILocalUser } from '../../../../models/user';
|
||||
import Mute from '../../../../models/mute';
|
||||
|
||||
/**
|
||||
* Unmute a user
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'ユーザーのミュートを解除します。',
|
||||
en: 'Unmute a user'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'account/write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
const muter = user;
|
||||
|
||||
|
||||
@@ -3,9 +3,17 @@ import Mute from '../../../../models/mute';
|
||||
import { pack, ILocalUser } from '../../../../models/user';
|
||||
import { getFriendIds } from '../../common/get-friends';
|
||||
|
||||
/**
|
||||
* Get muted users of a user
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'ミュートしているユーザー一覧を取得します。',
|
||||
en: 'Get muted users.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'account/read'
|
||||
};
|
||||
|
||||
export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'iknow' parameter
|
||||
const [iknow = false, iknowErr] = $.bool.optional.get(params.iknow);
|
||||
|
||||
@@ -2,9 +2,15 @@ import $ from 'cafy';
|
||||
import App, { pack } from '../../../../models/app';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Get my apps
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '自分のアプリケーション一覧を取得します。',
|
||||
en: 'Get my apps'
|
||||
},
|
||||
|
||||
requireCredential: true
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import $ from 'cafy'; import ID from '../../../../misc/cafy-id';
|
||||
const ms = require('ms');
|
||||
import Note, { INote, isValidText, isValidCw, pack } from '../../../../models/note';
|
||||
import User, { ILocalUser, IUser } from '../../../../models/user';
|
||||
import DriveFile, { IDriveFile } from '../../../../models/drive-file';
|
||||
@@ -7,12 +8,20 @@ import { IApp } from '../../../../models/app';
|
||||
import getParams from '../../get-params';
|
||||
|
||||
export const meta = {
|
||||
name: 'notes/create',
|
||||
|
||||
desc: {
|
||||
ja: '投稿します。'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
max: 300,
|
||||
minInterval: ms('1second')
|
||||
},
|
||||
|
||||
kind: 'note-write',
|
||||
|
||||
params: {
|
||||
visibility: $.str.optional.or(['public', 'home', 'followers', 'specified', 'private']).note({
|
||||
default: 'public',
|
||||
|
||||
@@ -3,9 +3,17 @@ import Note from '../../../../models/note';
|
||||
import deleteNote from '../../../../services/note/delete';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Delete a note
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定した投稿を削除します。',
|
||||
en: 'Delete a note.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'note-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'noteId' parameter
|
||||
const [noteId, noteIdErr] = $.type(ID).get(params.noteId);
|
||||
|
||||
@@ -3,9 +3,17 @@ import Favorite from '../../../../../models/favorite';
|
||||
import Note from '../../../../../models/note';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Favorite a note
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定した投稿をお気に入りに登録します。',
|
||||
en: 'Favorite a note.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'favorite-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'noteId' parameter
|
||||
const [noteId, noteIdErr] = $.type(ID).get(params.noteId);
|
||||
|
||||
@@ -3,9 +3,17 @@ import Favorite from '../../../../../models/favorite';
|
||||
import Note from '../../../../../models/note';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Unfavorite a note
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定した投稿のお気に入りを解除します。',
|
||||
en: 'Unfavorite a note.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'favorite-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'noteId' parameter
|
||||
const [noteId, noteIdErr] = $.type(ID).get(params.noteId);
|
||||
|
||||
@@ -4,9 +4,15 @@ import { getFriendIds } from '../../common/get-friends';
|
||||
import { pack } from '../../../../models/note';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Get mentions of myself
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '自分に言及している投稿の一覧を取得します。',
|
||||
en: 'Get mentions of myself.'
|
||||
},
|
||||
|
||||
requireCredential: true
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'following' parameter
|
||||
const [following = false, followingError] =
|
||||
|
||||
@@ -3,9 +3,15 @@ import Vote from '../../../../../models/poll-vote';
|
||||
import Note, { pack } from '../../../../../models/note';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Get recommended polls
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'おすすめのアンケート一覧を取得します。',
|
||||
en: 'Get recommended polls.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
|
||||
@@ -7,9 +7,17 @@ import { publishNoteStream } from '../../../../../stream';
|
||||
import notify from '../../../../../notify';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Vote poll of a note
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定した投稿のアンケートに投票します。',
|
||||
en: 'Vote poll of a note.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'vote-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'noteId' parameter
|
||||
const [noteId, noteIdErr] = $.type(ID).get(params.noteId);
|
||||
|
||||
@@ -3,9 +3,15 @@ import Note from '../../../../models/note';
|
||||
import Reaction, { pack } from '../../../../models/note-reaction';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Show reactions of a note
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定した投稿のリアクション一覧を取得します。',
|
||||
en: 'Show reactions of a note.'
|
||||
},
|
||||
|
||||
requireCredential: true
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'noteId' parameter
|
||||
const [noteId, noteIdErr] = $.type(ID).get(params.noteId);
|
||||
@@ -46,6 +52,5 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
|
||||
});
|
||||
|
||||
// Serialize
|
||||
res(await Promise.all(reactions.map(async reaction =>
|
||||
await pack(reaction, user))));
|
||||
res(await Promise.all(reactions.map(reaction => pack(reaction, user))));
|
||||
});
|
||||
|
||||
@@ -6,12 +6,15 @@ import { ILocalUser } from '../../../../../models/user';
|
||||
import getParams from '../../../get-params';
|
||||
|
||||
export const meta = {
|
||||
name: 'notes/reactions/create',
|
||||
|
||||
desc: {
|
||||
ja: '投稿にリアクションします。'
|
||||
ja: '指定した投稿にリアクションします。',
|
||||
en: 'React to a note.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'reaction-write',
|
||||
|
||||
params: {
|
||||
noteId: $.type(ID).note({
|
||||
desc: {
|
||||
@@ -27,9 +30,6 @@ export const meta = {
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* React to a note
|
||||
*/
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
const [ps, psErr] = getParams(meta, params);
|
||||
if (psErr) return rej(psErr);
|
||||
|
||||
@@ -3,9 +3,17 @@ import Reaction from '../../../../../models/note-reaction';
|
||||
import Note from '../../../../../models/note';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Unreact to a note
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定した投稿へのリアクションを取り消します。',
|
||||
en: 'Unreact to a note.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'reaction-write'
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'noteId' parameter
|
||||
const [noteId, noteIdErr] = $.type(ID).get(params.noteId);
|
||||
|
||||
@@ -7,12 +7,12 @@ import { ILocalUser } from '../../../../models/user';
|
||||
import getParams from '../../get-params';
|
||||
|
||||
export const meta = {
|
||||
name: 'notes/timeline',
|
||||
|
||||
desc: {
|
||||
ja: 'タイムラインを取得します。'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
params: {
|
||||
limit: $.num.optional.range(1, 100).note({
|
||||
default: 10,
|
||||
|
||||
@@ -3,9 +3,15 @@ import $ from 'cafy';
|
||||
import Note, { pack } from '../../../../models/note';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Get trend notes
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '人気の投稿の一覧を取得します。',
|
||||
en: 'Get trend notes.'
|
||||
},
|
||||
|
||||
requireCredential: true
|
||||
};
|
||||
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
|
||||
@@ -5,9 +5,15 @@ import { pack } from '../../../../models/note';
|
||||
import UserList from '../../../../models/user-list';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
/**
|
||||
* Get timeline of a user list
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定したユーザーリストのタイムラインを取得します。',
|
||||
en: 'Get timeline of a user list.'
|
||||
},
|
||||
|
||||
requireCredential: true
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => {
|
||||
// Get 'limit' parameter
|
||||
const [limit = 10, limitErr] = $.num.optional.range(1, 100).get(params.limit);
|
||||
|
||||
@@ -2,6 +2,17 @@ import Notification from '../../../../models/notification';
|
||||
import event from '../../../../stream';
|
||||
import User, { ILocalUser } from '../../../../models/user';
|
||||
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '全ての通知を既読にします。',
|
||||
en: 'Mark as read all notifications.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'notification-write'
|
||||
};
|
||||
|
||||
/**
|
||||
* Mark as read all notifications
|
||||
*/
|
||||
|
||||
@@ -2,6 +2,10 @@ import $ from 'cafy';
|
||||
import Subscription from '../../../../models/sw-subscription';
|
||||
import { ILocalUser } from '../../../../models/user';
|
||||
|
||||
export const meta = {
|
||||
requireCredential: true
|
||||
};
|
||||
|
||||
/**
|
||||
* subscribe service worker
|
||||
*/
|
||||
|
||||
@@ -2,9 +2,17 @@ import $ from 'cafy';
|
||||
import UserList, { pack } from '../../../../../models/user-list';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Create a user list
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'ユーザーリストを作成します。',
|
||||
en: 'Create a user list'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'account-write'
|
||||
};
|
||||
|
||||
export default async (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'title' parameter
|
||||
const [title, titleErr] = $.str.range(1, 100).get(params.title);
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
import UserList, { pack } from '../../../../../models/user-list';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
|
||||
/**
|
||||
* Add a user to a user list
|
||||
*/
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '自分の作成したユーザーリスト一覧を取得します。'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'account-read'
|
||||
};
|
||||
|
||||
export default async (params: any, me: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Fetch lists
|
||||
const userLists = await UserList.find({
|
||||
|
||||
@@ -6,6 +6,17 @@ import ap from '../../../../../remote/activitypub/renderer';
|
||||
import renderFollow from '../../../../../remote/activitypub/renderer/follow';
|
||||
import { deliver } from '../../../../../queue';
|
||||
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定したユーザーリストに指定したユーザーを追加します。',
|
||||
en: 'Add a user to a user list.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'account-write'
|
||||
};
|
||||
|
||||
/**
|
||||
* Add a user to a user list
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user