mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-07-18 10:54:52 +02:00
Compare commits
178 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06539db1a0 | ||
|
|
de10890bd8 | ||
|
|
8dc5375d55 | ||
|
|
1d23076191 | ||
|
|
cbdc061891 | ||
|
|
9536d76b61 | ||
|
|
7a030901c8 | ||
|
|
bcc02047ca | ||
|
|
c61616388e | ||
|
|
499486f559 | ||
|
|
179d231fd8 | ||
|
|
2e4a391eda | ||
|
|
3d214fee4b | ||
|
|
509a4c7955 | ||
|
|
c754046eaf | ||
|
|
92571d9133 | ||
|
|
add425abdb | ||
|
|
1890d9e2ee | ||
|
|
83f2926f0c | ||
|
|
738ced81ec | ||
|
|
b22c1ae520 | ||
|
|
e2e7489b1f | ||
|
|
6ae7b8303d | ||
|
|
55f40af51c | ||
|
|
7a784cea3b | ||
|
|
f86cccec0c | ||
|
|
9d90a28d76 | ||
|
|
1724cf7c17 | ||
|
|
d64d92ccf5 | ||
|
|
f64ced8677 | ||
|
|
db1c0468aa | ||
|
|
77c5d3276a | ||
|
|
ec2b1ec3f0 | ||
|
|
85bf76dd98 | ||
|
|
bfa326af2c | ||
|
|
534c47935a | ||
|
|
31a6f2b421 | ||
|
|
66c106722c | ||
|
|
9d0204f2fa | ||
|
|
fceb0e2158 | ||
|
|
14e7caaa5d | ||
|
|
744e009690 | ||
|
|
713dcd9083 | ||
|
|
e03ec67b5c | ||
|
|
7e27e2757f | ||
|
|
f05c5ff617 | ||
|
|
1afb26f04a | ||
|
|
7873905cde | ||
|
|
41a9100477 | ||
|
|
b8cc1eb993 | ||
|
|
adbbfd9dc2 | ||
|
|
84da99d56c | ||
|
|
aaf8f09cfd | ||
|
|
6da464fd1b | ||
|
|
efaa41ba49 | ||
|
|
67e8e1d819 | ||
|
|
532f8f8e4c | ||
|
|
0109e8e57c | ||
|
|
6e720b2798 | ||
|
|
d3f2a97dd4 | ||
|
|
9f7b04b0ec | ||
|
|
c4118c78b7 | ||
|
|
84147c558f | ||
|
|
4cb51a2d32 | ||
|
|
4727780a3d | ||
|
|
df20f5063d | ||
|
|
d2a5f4c5c1 | ||
|
|
64ba85aa9b | ||
|
|
51c33989fe | ||
|
|
4713822122 | ||
|
|
e10de62a7a | ||
|
|
14b235e3a4 | ||
|
|
eb4aac3902 | ||
|
|
180bf33a28 | ||
|
|
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 |
@@ -41,10 +41,6 @@ redis:
|
||||
port: 6379
|
||||
pass: example-pass
|
||||
|
||||
recaptcha:
|
||||
site_key: example-site-key
|
||||
secret_key: example-secret-key
|
||||
|
||||
# If enabled:
|
||||
# Server will not cache remote files (Using direct link instead).
|
||||
# You can save your storage.
|
||||
@@ -67,6 +63,11 @@ preventCache: false
|
||||
# port: 9200
|
||||
# pass: null
|
||||
|
||||
# reCAPTCHA
|
||||
# recaptcha:
|
||||
# site_key: example-site-key
|
||||
# secret_key: example-secret-key
|
||||
|
||||
# ServiceWorker
|
||||
# sw:
|
||||
# # Public key of VAPID
|
||||
|
||||
9
.github/ISSUE_TEMPLATE
vendored
9
.github/ISSUE_TEMPLATE
vendored
@@ -1,7 +1,16 @@
|
||||
<!--
|
||||
Thanks for your contribution.
|
||||
|
||||
When you report a bug or suggest a new feature, please include these information.
|
||||
* Your browser
|
||||
* Desktop version or mobile version
|
||||
|
||||
--------
|
||||
|
||||
Misskeyへの貢献ありがとうございます。
|
||||
|
||||
バグの報告や提案などで、可能であれば以下の情報を含めてください。
|
||||
* お使いのブラウザ
|
||||
* デスクトップ版Misskeyかモバイル版Misskeyか
|
||||
|
||||
-->
|
||||
|
||||
14
README.md
14
README.md
@@ -7,7 +7,7 @@
|
||||
[![][dependencies-badge]][dependencies-link]
|
||||
[](http://makeapullrequest.com) [](https://greenkeeper.io/)
|
||||
|
||||
> Lead Maintainer: [syuilo][syuilo-link]
|
||||
**Microblogging. Redefined.**
|
||||
|
||||
**[Misskey](https://misskey.xyz)** is a completely open source,
|
||||
ultimately sophisticated professional microblogging software.
|
||||
@@ -44,9 +44,9 @@ If you want to...
|
||||
|
||||
:heart: Backers & Sponsors
|
||||
----------------------------------------------------------------
|
||||
| ![][nagarus-icon] | ![][dansup-icon] |
|
||||
|:-:|:-:|
|
||||
| [nagarus][nagarus-link] | [dansup][dansup-link] |
|
||||
| <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/619786/32cf01444db24e578cd1982c197f6fc6/1?token-time=2145916800&token-hash=tB1e_r8RlZ5sFL0KV_e8dugapxatNBRK1Z3h67TO1g8%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/12378075/0156f769e20f412594fa6b87d85fe228/1?token-time=2145916800&token-hash=IsIJRUXszzoD6-7pDnRY8I05T9nSznc4GTaxj7C9SwU%3D"> | <img src="https://c10.patreonusercontent.com/3/eyJoIjoxMDAsInciOjEwMH0%3D/patreon-media/p/user/4503830/ccf2cc867ea64de0b524bb2e24b9a1cb/1?token-time=2145916800&token-hash=S1zP0QyLU52Dqq6dtc9qNYyWfW86XrYHiR4NMbeOrnA%3D"> |
|
||||
|:-:|:-:|:-:|
|
||||
| [Gargron](https://www.patreon.com/mastodon) | [39ff](https://www.patreon.com/user/creators?u=12378075) | [dansup](https://www.patreon.com/dansup) |
|
||||
|
||||
:four_leaf_clover: Copyright
|
||||
----------------------------------------------------------------
|
||||
@@ -73,9 +73,3 @@ Misskey is an open-source software licensed under the [GNU AGPLv3](LICENSE).
|
||||
|
||||
[syuilo-link]: https://syuilo.com
|
||||
[syuilo-icon]: https://avatars2.githubusercontent.com/u/4439005?v=3&s=70
|
||||
|
||||
[nagarus-link]: https://www.patreon.com/user/creators?u=11601413
|
||||
[nagarus-icon]: https://c10.patreonusercontent.com/3/eyJ2IjoiMSIsInciOjIwMH0%3D/patreon-media/user/11601413/20cb15f209924302b399b99d3c98b850?token-time=2145916800&token-hash=IO31nK6VZCMWBWU2VAk2c824BX2QZ4DNPKyHHZXS0iw%3D
|
||||
[dansup-link]: https://www.patreon.com/dansup
|
||||
[dansup-icon]: https://c10.patreonusercontent.com/3/eyJ2IjoiMSIsInciOjIwMH0%3D/patreon-media/user/4503830/ccf2cc867ea64de0b524bb2e24b9a1cb?token-time=2145916800&token-hash=opXAM_pnhUTuN1jCA6p_Nn_YsaqohY465YFjWFqMEEE%3D
|
||||
|
||||
|
||||
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`にあります。
|
||||
@@ -48,9 +48,9 @@ In root :
|
||||
4. `git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)` Checkout to the [latest release](https://github.com/syuilo/misskey/releases/latest)
|
||||
5. `npm install` Install misskey dependencies.
|
||||
|
||||
*5.* reCAPTCHA tokens
|
||||
*(optional)* reCAPTCHA tokens
|
||||
----------------------------------------------------------------
|
||||
Misskey requires reCAPTCHA tokens.
|
||||
If you want to enable reCAPTCHA, you need to generate reCAPTCHA tokens:
|
||||
Please visit https://www.google.com/recaptcha/intro/ and generate keys.
|
||||
|
||||
*(optional)* Generating VAPID keys
|
||||
@@ -63,13 +63,12 @@ npm install web-push -g
|
||||
web-push generate-vapid-keys
|
||||
```
|
||||
|
||||
|
||||
*6.* Make configuration file
|
||||
*5.* Make configuration file
|
||||
----------------------------------------------------------------
|
||||
1. `cp .config/example.yml .config/default.yml` Copy the `.config/example.yml` and rename it to `default.yml`.
|
||||
2. Edit `default.yml`
|
||||
|
||||
*7.* Build Misskey
|
||||
*6.* Build Misskey
|
||||
----------------------------------------------------------------
|
||||
|
||||
Build misskey with the following:
|
||||
@@ -85,7 +84,7 @@ If you're still encountering errors about some modules, use node-gyp:
|
||||
3. `node-gyp build`
|
||||
4. `npm run build`
|
||||
|
||||
*8.* That is it.
|
||||
*7.* That is it.
|
||||
----------------------------------------------------------------
|
||||
Well done! Now, you have an environment that run to Misskey.
|
||||
|
||||
|
||||
@@ -47,10 +47,10 @@ adduser --disabled-password --disabled-login misskey
|
||||
4. `git checkout $(git tag -l | grep -v 'rc[0-9]*$' | sort -V | tail -n 1)` [最新のリリース](https://github.com/syuilo/misskey/releases/latest)を確認
|
||||
5. `npm install` Misskeyの依存パッケージをインストール
|
||||
|
||||
*5.* reCAPTCHAトークン
|
||||
*(オプション)* reCAPTCHAトークン
|
||||
----------------------------------------------------------------
|
||||
MisskeyはreCAPTCHAトークンを必要とします。
|
||||
https://www.google.com/recaptcha/intro/ にアクセスしてトークンを生成してください。
|
||||
reCAPTCHAを有効にする場合、reCAPTCHAトークンを取得する必要があります。
|
||||
https://www.google.com/recaptcha/intro/ にアクセスしてトークンを取得してください。
|
||||
|
||||
*(オプション)* VAPIDキーペアの生成
|
||||
----------------------------------------------------------------
|
||||
@@ -61,12 +61,12 @@ npm install web-push -g
|
||||
web-push generate-vapid-keys
|
||||
```
|
||||
|
||||
*6.* Make configuration file
|
||||
*5.* 設定ファイルを作成する
|
||||
----------------------------------------------------------------
|
||||
1. `cp .config/example.yml .config/default.yml` `.config/example.yml`をコピーし名前を`default.yml`にする。
|
||||
2. `default.yml` を編集する。
|
||||
|
||||
*7.* Misskeyのビルド
|
||||
*6.* Misskeyのビルド
|
||||
----------------------------------------------------------------
|
||||
|
||||
次のコマンドでMisskeyをビルドしてください:
|
||||
@@ -81,8 +81,7 @@ Debianをお使いであれば、`build-essential`パッケージをインスト
|
||||
3. `node-gyp build`
|
||||
4. `npm run build`
|
||||
|
||||
|
||||
*6.* 以上です!
|
||||
*7.* 以上です!
|
||||
----------------------------------------------------------------
|
||||
お疲れ様でした。これでMisskeyを動かす準備は整いました。
|
||||
|
||||
|
||||
24
gulpfile.ts
24
gulpfile.ts
@@ -23,7 +23,6 @@ const uglifyes = require('uglify-es');
|
||||
|
||||
const locales = require('./locales');
|
||||
import { fa } from './src/misc/fa';
|
||||
const client = require('./built/client/meta.json');
|
||||
import config from './src/config';
|
||||
|
||||
const uglify = uglifyComposer(uglifyes, console);
|
||||
@@ -46,8 +45,6 @@ gulp.task('build', [
|
||||
'doc'
|
||||
]);
|
||||
|
||||
gulp.task('rebuild', ['clean', 'build']);
|
||||
|
||||
gulp.task('build:ts', () => {
|
||||
const tsProject = ts.createProject('./tsconfig.json');
|
||||
|
||||
@@ -84,12 +81,12 @@ gulp.task('lint', () =>
|
||||
);
|
||||
|
||||
gulp.task('format', () =>
|
||||
gulp.src('./src/**/*.ts')
|
||||
.pipe(tslint({
|
||||
formatter: 'verbose',
|
||||
fix: true
|
||||
}))
|
||||
.pipe(tslint.report())
|
||||
gulp.src('./src/**/*.ts')
|
||||
.pipe(tslint({
|
||||
formatter: 'verbose',
|
||||
fix: true
|
||||
}))
|
||||
.pipe(tslint.report())
|
||||
);
|
||||
|
||||
gulp.task('mocha', () =>
|
||||
@@ -117,8 +114,9 @@ gulp.task('build:client', [
|
||||
'copy:client'
|
||||
]);
|
||||
|
||||
gulp.task('build:client:script', () =>
|
||||
gulp.src(['./src/client/app/boot.js', './src/client/app/safe.js'])
|
||||
gulp.task('build:client:script', () => {
|
||||
const client = require('./built/client/meta.json');
|
||||
return gulp.src(['./src/client/app/boot.js', './src/client/app/safe.js'])
|
||||
.pipe(replace('VERSION', JSON.stringify(client.version)))
|
||||
.pipe(replace('API', JSON.stringify(config.api_url)))
|
||||
.pipe(replace('ENV', JSON.stringify(env)))
|
||||
@@ -126,8 +124,8 @@ gulp.task('build:client:script', () =>
|
||||
.pipe(isProduction ? uglify({
|
||||
toplevel: true
|
||||
} as any) : gutil.noop())
|
||||
.pipe(gulp.dest('./built/client/assets/')) as any
|
||||
);
|
||||
.pipe(gulp.dest('./built/client/assets/'));
|
||||
});
|
||||
|
||||
gulp.task('build:client:styles', () =>
|
||||
gulp.src('./src/client/app/init.css')
|
||||
|
||||
@@ -288,6 +288,8 @@ desktop/views/components/drive.file.vue:
|
||||
banner: "バナー"
|
||||
contextmenu:
|
||||
rename: "名前を変更"
|
||||
mark-as-sensitive: "閲覧注意に設定"
|
||||
unmark-as-sensitive: "閲覧注意を解除"
|
||||
copy-url: "URLをコピー"
|
||||
download: "ダウンロード"
|
||||
else-files: "その他..."
|
||||
@@ -331,6 +333,12 @@ desktop/views/components/drive.vue:
|
||||
create-folder: "フォルダーを作成"
|
||||
upload: "ファイルをアップロード"
|
||||
url-upload: "URLからアップロード"
|
||||
desktop/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -725,6 +733,12 @@ mobile/views/components/drive.file-detail.vue:
|
||||
move: "移動"
|
||||
hash: "ハッシュ (md5)"
|
||||
exif: "EXIF"
|
||||
mobile/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -934,7 +948,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: "型"
|
||||
|
||||
@@ -288,6 +288,8 @@ desktop/views/components/drive.file.vue:
|
||||
banner: "Banner"
|
||||
contextmenu:
|
||||
rename: "Umbenennen"
|
||||
mark-as-sensitive: "閲覧注意に設定"
|
||||
unmark-as-sensitive: "閲覧注意を解除"
|
||||
copy-url: "URL kopieren"
|
||||
download: "Download"
|
||||
else-files: "Anderes…"
|
||||
@@ -331,6 +333,12 @@ desktop/views/components/drive.vue:
|
||||
create-folder: "Ein Verzeichnis erstellen"
|
||||
upload: "Eine Datei hochladen"
|
||||
url-upload: "Von einer URL hochladen"
|
||||
desktop/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/follow-button.vue:
|
||||
following: "Folge ich"
|
||||
follow: "Folgen"
|
||||
@@ -725,6 +733,12 @@ mobile/views/components/drive.file-detail.vue:
|
||||
move: "移動"
|
||||
hash: "ハッシュ (md5)"
|
||||
exif: "EXIF"
|
||||
mobile/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -934,7 +948,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: "型"
|
||||
|
||||
@@ -288,6 +288,8 @@ desktop/views/components/drive.file.vue:
|
||||
banner: "Banner"
|
||||
contextmenu:
|
||||
rename: "Rename"
|
||||
mark-as-sensitive: "Mark as 'sensitive'"
|
||||
unmark-as-sensitive: "Unmark as 'sensitive'"
|
||||
copy-url: "Copy URL"
|
||||
download: "Download"
|
||||
else-files: "Others"
|
||||
@@ -331,6 +333,12 @@ desktop/views/components/drive.vue:
|
||||
create-folder: "Create a folder"
|
||||
upload: "Upload a file"
|
||||
url-upload: "Upload from a URL"
|
||||
desktop/views/components/media-image.vue:
|
||||
sensitive: "The content is NSFW"
|
||||
click-to-show: "Click to show"
|
||||
desktop/views/components/media-video.vue:
|
||||
sensitive: "The content is NSFW"
|
||||
click-to-show: "Click to show"
|
||||
desktop/views/components/follow-button.vue:
|
||||
following: "Following"
|
||||
follow: "Follow"
|
||||
@@ -725,6 +733,12 @@ mobile/views/components/drive.file-detail.vue:
|
||||
move: "Move"
|
||||
hash: "Hash (md5)"
|
||||
exif: "EXIF"
|
||||
mobile/views/components/media-image.vue:
|
||||
sensitive: "The content is NSFW"
|
||||
click-to-show: "Click to show"
|
||||
mobile/views/components/media-video.vue:
|
||||
sensitive: "The content is NSFW"
|
||||
click-to-show: "Click to show"
|
||||
mobile/views/components/follow-button.vue:
|
||||
following: "Following"
|
||||
follow: "Follow"
|
||||
@@ -934,7 +948,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"
|
||||
|
||||
@@ -288,6 +288,8 @@ desktop/views/components/drive.file.vue:
|
||||
banner: "Banner"
|
||||
contextmenu:
|
||||
rename: "Renombrar"
|
||||
mark-as-sensitive: "閲覧注意に設定"
|
||||
unmark-as-sensitive: "閲覧注意を解除"
|
||||
copy-url: "Copia la URL"
|
||||
download: "Descargar"
|
||||
else-files: "Otros"
|
||||
@@ -331,6 +333,12 @@ desktop/views/components/drive.vue:
|
||||
create-folder: "Crear una carpeta"
|
||||
upload: "Subir fichero"
|
||||
url-upload: "Subir desde una URL"
|
||||
desktop/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/follow-button.vue:
|
||||
following: "Siguiendo"
|
||||
follow: "Sigue"
|
||||
@@ -725,6 +733,12 @@ mobile/views/components/drive.file-detail.vue:
|
||||
move: "移動"
|
||||
hash: "ハッシュ (md5)"
|
||||
exif: "EXIF"
|
||||
mobile/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -934,7 +948,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: "型"
|
||||
|
||||
@@ -288,6 +288,8 @@ desktop/views/components/drive.file.vue:
|
||||
banner: "Bannière"
|
||||
contextmenu:
|
||||
rename: "Renommer"
|
||||
mark-as-sensitive: "閲覧注意に設定"
|
||||
unmark-as-sensitive: "閲覧注意を解除"
|
||||
copy-url: "Copier l'URL"
|
||||
download: "Télécharger"
|
||||
else-files: "Autres..."
|
||||
@@ -331,6 +333,12 @@ desktop/views/components/drive.vue:
|
||||
create-folder: "Créer un dossier"
|
||||
upload: "Uploader un fichier"
|
||||
url-upload: "Uploader d'un URL"
|
||||
desktop/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/follow-button.vue:
|
||||
following: "Abonnements"
|
||||
follow: "Suivre"
|
||||
@@ -725,6 +733,12 @@ mobile/views/components/drive.file-detail.vue:
|
||||
move: "Déplacer"
|
||||
hash: "Hash (md5)"
|
||||
exif: "EXIF"
|
||||
mobile/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/follow-button.vue:
|
||||
following: "Abonnements"
|
||||
follow: "Suivre"
|
||||
@@ -934,7 +948,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"
|
||||
|
||||
@@ -288,6 +288,8 @@ desktop/views/components/drive.file.vue:
|
||||
banner: "バナー"
|
||||
contextmenu:
|
||||
rename: "名前を変更"
|
||||
mark-as-sensitive: "閲覧注意に設定"
|
||||
unmark-as-sensitive: "閲覧注意を解除"
|
||||
copy-url: "URLをコピー"
|
||||
download: "ダウンロード"
|
||||
else-files: "その他..."
|
||||
@@ -331,6 +333,12 @@ desktop/views/components/drive.vue:
|
||||
create-folder: "フォルダーを作成"
|
||||
upload: "ファイルをアップロード"
|
||||
url-upload: "URLからアップロード"
|
||||
desktop/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -725,6 +733,12 @@ mobile/views/components/drive.file-detail.vue:
|
||||
move: "移動"
|
||||
hash: "ハッシュ (md5)"
|
||||
exif: "EXIF"
|
||||
mobile/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -934,7 +948,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: "型"
|
||||
|
||||
@@ -330,6 +330,8 @@ desktop/views/components/drive.file.vue:
|
||||
banner: "バナー"
|
||||
contextmenu:
|
||||
rename: "名前を変更"
|
||||
mark-as-sensitive: "閲覧注意に設定"
|
||||
unmark-as-sensitive: "閲覧注意を解除"
|
||||
copy-url: "URLをコピー"
|
||||
download: "ダウンロード"
|
||||
else-files: "その他..."
|
||||
@@ -377,6 +379,14 @@ desktop/views/components/drive.vue:
|
||||
upload: "ファイルをアップロード"
|
||||
url-upload: "URLからアップロード"
|
||||
|
||||
desktop/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
|
||||
desktop/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
|
||||
desktop/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -853,6 +863,14 @@ mobile/views/components/drive.file-detail.vue:
|
||||
hash: "ハッシュ (md5)"
|
||||
exif: "EXIF"
|
||||
|
||||
mobile/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
|
||||
mobile/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
|
||||
mobile/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -1098,7 +1116,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: "型"
|
||||
|
||||
@@ -288,6 +288,8 @@ desktop/views/components/drive.file.vue:
|
||||
banner: "バナー"
|
||||
contextmenu:
|
||||
rename: "名前を変更"
|
||||
mark-as-sensitive: "閲覧注意に設定"
|
||||
unmark-as-sensitive: "閲覧注意を解除"
|
||||
copy-url: "URLをコピー"
|
||||
download: "ダウンロード"
|
||||
else-files: "その他..."
|
||||
@@ -331,6 +333,12 @@ desktop/views/components/drive.vue:
|
||||
create-folder: "フォルダーを作成"
|
||||
upload: "ファイルをアップロード"
|
||||
url-upload: "URLからアップロード"
|
||||
desktop/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -725,6 +733,12 @@ mobile/views/components/drive.file-detail.vue:
|
||||
move: "移動"
|
||||
hash: "ハッシュ (md5)"
|
||||
exif: "EXIF"
|
||||
mobile/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -934,7 +948,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"
|
||||
@@ -288,6 +288,8 @@ desktop/views/components/drive.file.vue:
|
||||
banner: "Baner"
|
||||
contextmenu:
|
||||
rename: "Zmień nazwę"
|
||||
mark-as-sensitive: "閲覧注意に設定"
|
||||
unmark-as-sensitive: "閲覧注意を解除"
|
||||
copy-url: "Skopiuj adres"
|
||||
download: "Pobierz"
|
||||
else-files: "Inne"
|
||||
@@ -331,6 +333,12 @@ desktop/views/components/drive.vue:
|
||||
create-folder: "Utwórz katalog"
|
||||
upload: "Wyślij plik"
|
||||
url-upload: "Wyślij z adresu URL"
|
||||
desktop/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/follow-button.vue:
|
||||
following: "Śledzisz"
|
||||
follow: "Śledź"
|
||||
@@ -557,7 +565,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:
|
||||
@@ -725,6 +733,12 @@ mobile/views/components/drive.file-detail.vue:
|
||||
move: "Przenieś"
|
||||
hash: "Hash (md5)"
|
||||
exif: "EXIF"
|
||||
mobile/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/follow-button.vue:
|
||||
following: "Śledzisz"
|
||||
follow: "Śledź"
|
||||
@@ -820,7 +834,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 +948,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"
|
||||
|
||||
@@ -288,6 +288,8 @@ desktop/views/components/drive.file.vue:
|
||||
banner: "バナー"
|
||||
contextmenu:
|
||||
rename: "名前を変更"
|
||||
mark-as-sensitive: "閲覧注意に設定"
|
||||
unmark-as-sensitive: "閲覧注意を解除"
|
||||
copy-url: "URLをコピー"
|
||||
download: "ダウンロード"
|
||||
else-files: "その他..."
|
||||
@@ -331,6 +333,12 @@ desktop/views/components/drive.vue:
|
||||
create-folder: "フォルダーを作成"
|
||||
upload: "ファイルをアップロード"
|
||||
url-upload: "URLからアップロード"
|
||||
desktop/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -725,6 +733,12 @@ mobile/views/components/drive.file-detail.vue:
|
||||
move: "移動"
|
||||
hash: "ハッシュ (md5)"
|
||||
exif: "EXIF"
|
||||
mobile/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -934,7 +948,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: "型"
|
||||
|
||||
@@ -288,6 +288,8 @@ desktop/views/components/drive.file.vue:
|
||||
banner: "バナー"
|
||||
contextmenu:
|
||||
rename: "名前を変更"
|
||||
mark-as-sensitive: "閲覧注意に設定"
|
||||
unmark-as-sensitive: "閲覧注意を解除"
|
||||
copy-url: "URLをコピー"
|
||||
download: "ダウンロード"
|
||||
else-files: "その他..."
|
||||
@@ -331,6 +333,12 @@ desktop/views/components/drive.vue:
|
||||
create-folder: "フォルダーを作成"
|
||||
upload: "ファイルをアップロード"
|
||||
url-upload: "URLからアップロード"
|
||||
desktop/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -725,6 +733,12 @@ mobile/views/components/drive.file-detail.vue:
|
||||
move: "移動"
|
||||
hash: "ハッシュ (md5)"
|
||||
exif: "EXIF"
|
||||
mobile/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -934,7 +948,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: "型"
|
||||
|
||||
@@ -288,6 +288,8 @@ desktop/views/components/drive.file.vue:
|
||||
banner: "バナー"
|
||||
contextmenu:
|
||||
rename: "名前を変更"
|
||||
mark-as-sensitive: "閲覧注意に設定"
|
||||
unmark-as-sensitive: "閲覧注意を解除"
|
||||
copy-url: "URLをコピー"
|
||||
download: "ダウンロード"
|
||||
else-files: "その他..."
|
||||
@@ -331,6 +333,12 @@ desktop/views/components/drive.vue:
|
||||
create-folder: "フォルダーを作成"
|
||||
upload: "ファイルをアップロード"
|
||||
url-upload: "URLからアップロード"
|
||||
desktop/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
desktop/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -725,6 +733,12 @@ mobile/views/components/drive.file-detail.vue:
|
||||
move: "移動"
|
||||
hash: "ハッシュ (md5)"
|
||||
exif: "EXIF"
|
||||
mobile/views/components/media-image.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/media-video.vue:
|
||||
sensitive: "閲覧注意"
|
||||
click-to-show: "クリックして表示"
|
||||
mobile/views/components/follow-button.vue:
|
||||
following: "フォロー中"
|
||||
follow: "フォロー"
|
||||
@@ -934,7 +948,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: "型"
|
||||
|
||||
18135
package-lock.json
generated
18135
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
21
package.json
21
package.json
@@ -1,20 +1,18 @@
|
||||
{
|
||||
"name": "misskey",
|
||||
"author": "syuilo <i@syuilo.com>",
|
||||
"version": "4.20.0",
|
||||
"clientVersion": "1.0.7257",
|
||||
"version": "4.26.0",
|
||||
"clientVersion": "1.0.7435",
|
||||
"codename": "nighthike",
|
||||
"main": "./built/index.js",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"start": "node ./built",
|
||||
"debug": "DEBUG=misskey:* node ./built",
|
||||
"swagger": "node ./swagger.js",
|
||||
"build": "webpack && gulp build",
|
||||
"webpack": "webpack",
|
||||
"watch": "webpack --watch",
|
||||
"gulp": "gulp build",
|
||||
"rebuild": "gulp rebuild",
|
||||
"clean": "gulp clean",
|
||||
"cleanall": "gulp cleanall",
|
||||
"lint": "gulp lint",
|
||||
@@ -79,7 +77,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",
|
||||
@@ -100,7 +98,7 @@
|
||||
"dompurify": "1.0.5",
|
||||
"elasticsearch": "15.1.1",
|
||||
"element-ui": "2.4.4",
|
||||
"emojilib": "2.2.12",
|
||||
"emojilib": "2.3.0",
|
||||
"escape-regexp": "0.0.1",
|
||||
"eslint": "5.0.1",
|
||||
"eslint-plugin-vue": "4.7.0",
|
||||
@@ -128,6 +126,7 @@
|
||||
"highlight.js": "9.12.0",
|
||||
"html-minifier": "3.5.19",
|
||||
"http-signature": "1.2.0",
|
||||
"insert-text-at-cursor": "0.1.1",
|
||||
"is-root": "2.0.0",
|
||||
"is-url": "1.2.4",
|
||||
"jquery": "3.3.1",
|
||||
@@ -181,13 +180,14 @@
|
||||
"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",
|
||||
"stylus": "0.54.5",
|
||||
"stylus-loader": "3.0.2",
|
||||
"summaly": "2.0.6",
|
||||
"swagger-jsdoc": "1.9.7",
|
||||
"swagger-jsdoc": "1.10.2",
|
||||
"syuilo-password-strength": "0.0.1",
|
||||
"textarea-caret": "3.1.0",
|
||||
"tmp": "0.0.33",
|
||||
@@ -204,16 +204,17 @@
|
||||
"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.6",
|
||||
"vue-router": "3.0.1",
|
||||
"vue-style-loader": "4.1.1",
|
||||
"vue-template-compiler": "2.5.16",
|
||||
"vuedraggable": "2.16.0",
|
||||
"vuex": "3.0.1",
|
||||
"vuex-persistedstate": "2.5.4",
|
||||
"web-push": "3.3.2",
|
||||
"webfinger.js": "2.6.6",
|
||||
"webpack": "4.16.0",
|
||||
"webpack-cli": "3.0.8",
|
||||
"webpack": "4.16.1",
|
||||
"webpack-cli": "3.1.0",
|
||||
"websocket": "1.0.26",
|
||||
"ws": "5.2.2",
|
||||
"xev": "2.0.1"
|
||||
|
||||
@@ -39,13 +39,17 @@ export default Vue.extend({
|
||||
dark: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
smooth: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
now: new Date(),
|
||||
clock: null,
|
||||
enabled: true,
|
||||
|
||||
graduationsPadding: 0.5,
|
||||
handsPadding: 1,
|
||||
@@ -74,6 +78,9 @@ export default Vue.extend({
|
||||
return themeColor;
|
||||
},
|
||||
|
||||
ms(): number {
|
||||
return this.now.getMilliseconds() * this.smooth;
|
||||
}
|
||||
s(): number {
|
||||
return this.now.getSeconds();
|
||||
},
|
||||
@@ -85,13 +92,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 +113,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: {
|
||||
|
||||
@@ -7,6 +7,11 @@
|
||||
<span class="username">@{{ user | acct }}</span>
|
||||
</li>
|
||||
</ol>
|
||||
<ol class="hashtags" ref="suggests" v-if="hashtags.length > 0">
|
||||
<li v-for="hashtag in hashtags" @click="complete(type, hashtag)" @keydown="onKeydown" tabindex="-1">
|
||||
<span class="name">{{ hashtag }}</span>
|
||||
</li>
|
||||
</ol>
|
||||
<ol class="emojis" ref="suggests" v-if="emojis.length > 0">
|
||||
<li v-for="emoji in emojis" @click="complete(type, emoji.emoji)" @keydown="onKeydown" tabindex="-1">
|
||||
<span class="emoji">{{ emoji.emoji }}</span>
|
||||
@@ -48,33 +53,33 @@ emjdb.sort((a, b) => a.name.length - b.name.length);
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['type', 'q', 'textarea', 'complete', 'close', 'x', 'y'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
fetching: true,
|
||||
users: [],
|
||||
hashtags: [],
|
||||
emojis: [],
|
||||
select: -1,
|
||||
emojilib
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
items(): HTMLCollection {
|
||||
return (this.$refs.suggests as Element).children;
|
||||
}
|
||||
},
|
||||
|
||||
updated() {
|
||||
//#region 位置調整
|
||||
const margin = 32;
|
||||
|
||||
if (this.x + this.$el.offsetWidth > window.innerWidth - margin) {
|
||||
this.$el.style.left = (this.x - this.$el.offsetWidth) + 'px';
|
||||
this.$el.style.marginLeft = '-16px';
|
||||
if (this.x + this.$el.offsetWidth > window.innerWidth) {
|
||||
this.$el.style.left = (window.innerWidth - this.$el.offsetWidth) + 'px';
|
||||
} else {
|
||||
this.$el.style.left = this.x + 'px';
|
||||
this.$el.style.marginLeft = '0';
|
||||
}
|
||||
|
||||
if (this.y + this.$el.offsetHeight > window.innerHeight - margin) {
|
||||
if (this.y + this.$el.offsetHeight > window.innerHeight) {
|
||||
this.$el.style.top = (this.y - this.$el.offsetHeight) + 'px';
|
||||
this.$el.style.marginTop = '0';
|
||||
} else {
|
||||
@@ -83,6 +88,7 @@ export default Vue.extend({
|
||||
}
|
||||
//#endregion
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.textarea.addEventListener('keydown', this.onKeydown);
|
||||
|
||||
@@ -100,6 +106,7 @@ export default Vue.extend({
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
this.textarea.removeEventListener('keydown', this.onKeydown);
|
||||
|
||||
@@ -107,6 +114,7 @@ export default Vue.extend({
|
||||
el.removeEventListener('mousedown', this.onMousedown);
|
||||
});
|
||||
},
|
||||
|
||||
methods: {
|
||||
exec() {
|
||||
this.select = -1;
|
||||
@@ -117,7 +125,8 @@ export default Vue.extend({
|
||||
}
|
||||
|
||||
if (this.type == 'user') {
|
||||
const cache = sessionStorage.getItem(this.q);
|
||||
const cacheKey = 'autocomplete:user:' + this.q;
|
||||
const cache = sessionStorage.getItem(cacheKey);
|
||||
if (cache) {
|
||||
const users = JSON.parse(cache);
|
||||
this.users = users;
|
||||
@@ -131,7 +140,26 @@ export default Vue.extend({
|
||||
this.fetching = false;
|
||||
|
||||
// キャッシュ
|
||||
sessionStorage.setItem(this.q, JSON.stringify(users));
|
||||
sessionStorage.setItem(cacheKey, JSON.stringify(users));
|
||||
});
|
||||
}
|
||||
} else if (this.type == 'hashtag') {
|
||||
const cacheKey = 'autocomplete:hashtag:' + this.q;
|
||||
const cache = sessionStorage.getItem(cacheKey);
|
||||
if (cache) {
|
||||
const hashtags = JSON.parse(cache);
|
||||
this.hashtags = hashtags;
|
||||
this.fetching = false;
|
||||
} else {
|
||||
(this as any).api('hashtags/search', {
|
||||
query: this.q,
|
||||
limit: 30
|
||||
}).then(hashtags => {
|
||||
this.hashtags = hashtags;
|
||||
this.fetching = false;
|
||||
|
||||
// キャッシュ
|
||||
sessionStorage.setItem(cacheKey, JSON.stringify(hashtags));
|
||||
});
|
||||
}
|
||||
} else if (this.type == 'emoji') {
|
||||
@@ -231,6 +259,7 @@ export default Vue.extend({
|
||||
root(isDark)
|
||||
position fixed
|
||||
z-index 65535
|
||||
max-width 100%
|
||||
margin-top calc(1em + 8px)
|
||||
overflow hidden
|
||||
background isDark ? #313543 : #fff
|
||||
@@ -248,7 +277,8 @@ root(isDark)
|
||||
list-style none
|
||||
|
||||
> li
|
||||
display block
|
||||
display flex
|
||||
align-items center
|
||||
padding 4px 12px
|
||||
white-space nowrap
|
||||
overflow hidden
|
||||
@@ -259,7 +289,13 @@ root(isDark)
|
||||
&, *
|
||||
user-select none
|
||||
|
||||
*
|
||||
overflow hidden
|
||||
text-overflow ellipsis
|
||||
|
||||
&:hover
|
||||
background isDark ? rgba(#fff, 0.1) : rgba(#000, 0.1)
|
||||
|
||||
&[data-selected='true']
|
||||
background $theme-color
|
||||
|
||||
@@ -275,7 +311,6 @@ root(isDark)
|
||||
> .users > li
|
||||
|
||||
.avatar
|
||||
vertical-align middle
|
||||
min-width 28px
|
||||
min-height 28px
|
||||
max-width 28px
|
||||
@@ -284,14 +319,18 @@ root(isDark)
|
||||
border-radius 100%
|
||||
|
||||
.name
|
||||
vertical-align middle
|
||||
margin 0 8px 0 0
|
||||
color isDark ? rgba(#fff, 0.8) : rgba(#000, 0.8)
|
||||
|
||||
.username
|
||||
vertical-align middle
|
||||
color isDark ? rgba(#fff, 0.3) : rgba(#000, 0.3)
|
||||
|
||||
> .hashtags > li
|
||||
|
||||
.name
|
||||
margin 0 8px 0 0
|
||||
color isDark ? rgba(#fff, 0.8) : rgba(#000, 0.8)
|
||||
|
||||
> .emojis > li
|
||||
|
||||
.emoji
|
||||
@@ -300,11 +339,11 @@ root(isDark)
|
||||
width 24px
|
||||
|
||||
.name
|
||||
color rgba(#000, 0.8)
|
||||
color isDark ? rgba(#fff, 0.8) : rgba(#000, 0.8)
|
||||
|
||||
.alias
|
||||
margin 0 0 0 8px
|
||||
color rgba(#000, 0.3)
|
||||
color isDark ? rgba(#fff, 0.3) : rgba(#000, 0.3)
|
||||
|
||||
.mk-autocomplete[data-darkmode]
|
||||
root(true)
|
||||
|
||||
@@ -46,33 +46,45 @@ export default Vue.extend({
|
||||
display grid
|
||||
grid-gap 4px
|
||||
|
||||
> *
|
||||
overflow hidden
|
||||
border-radius 4px
|
||||
|
||||
&[data-count="1"]
|
||||
grid-template-rows 1fr
|
||||
|
||||
&[data-count="2"]
|
||||
grid-template-columns 1fr 1fr
|
||||
grid-template-rows 1fr
|
||||
|
||||
&[data-count="3"]
|
||||
grid-template-columns 1fr 0.5fr
|
||||
grid-template-rows 1fr 1fr
|
||||
:nth-child(1)
|
||||
|
||||
> *:nth-child(1)
|
||||
grid-row 1 / 3
|
||||
:nth-child(3)
|
||||
|
||||
> *:nth-child(3)
|
||||
grid-column 2 / 3
|
||||
grid-row 2 / 3
|
||||
|
||||
&[data-count="4"]
|
||||
grid-template-columns 1fr 1fr
|
||||
grid-template-rows 1fr 1fr
|
||||
|
||||
:nth-child(1)
|
||||
> *:nth-child(1)
|
||||
grid-column 1 / 2
|
||||
grid-row 1 / 2
|
||||
:nth-child(2)
|
||||
|
||||
> *:nth-child(2)
|
||||
grid-column 2 / 3
|
||||
grid-row 1 / 2
|
||||
:nth-child(3)
|
||||
|
||||
> *:nth-child(3)
|
||||
grid-column 1 / 2
|
||||
grid-row 2 / 3
|
||||
:nth-child(4)
|
||||
|
||||
> *:nth-child(4)
|
||||
grid-column 2 / 3
|
||||
grid-row 2 / 3
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<div class="content">
|
||||
<div class="balloon" :data-no-text="message.text == null">
|
||||
<p class="read" v-if="isMe && message.isRead">%i18n:@is-read%</p>
|
||||
<button class="delete-button" v-if="isMe" title="%i18n:common.delete%">
|
||||
<!-- <button class="delete-button" v-if="isMe" title="%i18n:common.delete%">
|
||||
<img src="/assets/desktop/messaging/delete.png" alt="Delete"/>
|
||||
</button>
|
||||
</button> -->
|
||||
<div class="content" v-if="!message.isDeleted">
|
||||
<misskey-flavored-markdown class="text" v-if="message.text" ref="text" :text="message.text" :i="$store.state.i"/>
|
||||
<div class="file" v-if="message.file">
|
||||
|
||||
@@ -29,11 +29,7 @@
|
||||
<p slot="text" v-if="passwordRetypeState == 'not-match'" style="color:#FF1161">%fa:exclamation-triangle .fw% %i18n:@password-not-matched%</p>
|
||||
</div>
|
||||
</ui-input>
|
||||
<div class="g-recaptcha" :data-sitekey="recaptchaSitekey" style="margin: 16px 0;"></div>
|
||||
<label class="agree-tou" style="display: block; margin: 16px 0;">
|
||||
<input name="agree-tou" type="checkbox" required/>
|
||||
<p><a :href="touUrl" target="_blank">利用規約</a>に同意する</p>
|
||||
</label>
|
||||
<div v-if="recaptchaSitekey != null" class="g-recaptcha" :data-sitekey="recaptchaSitekey" style="margin: 16px 0;"></div>
|
||||
<ui-button type="submit">%i18n:@create%</ui-button>
|
||||
</form>
|
||||
</template>
|
||||
@@ -41,7 +37,7 @@
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
const getPasswordStrength = require('syuilo-password-strength');
|
||||
import { host, url, docsUrl, lang, recaptchaSitekey } from '../../../config';
|
||||
import { host, url, recaptchaSitekey } from '../../../config';
|
||||
|
||||
export default Vue.extend({
|
||||
data() {
|
||||
@@ -51,7 +47,6 @@ export default Vue.extend({
|
||||
password: '',
|
||||
retypedPassword: '',
|
||||
url,
|
||||
touUrl: `${docsUrl}/${lang}/tou`,
|
||||
recaptchaSitekey,
|
||||
usernameState: null,
|
||||
passwordStrength: '',
|
||||
@@ -115,7 +110,7 @@ export default Vue.extend({
|
||||
(this as any).api('signup', {
|
||||
username: this.username,
|
||||
password: this.password,
|
||||
'g-recaptcha-response': (window as any).grecaptcha.getResponse()
|
||||
'g-recaptcha-response': recaptchaSitekey != null ? (window as any).grecaptcha.getResponse() : null
|
||||
}).then(() => {
|
||||
(this as any).api('signin', {
|
||||
username: this.username,
|
||||
@@ -126,15 +121,19 @@ export default Vue.extend({
|
||||
}).catch(() => {
|
||||
alert('%i18n:@some-error%');
|
||||
|
||||
(window as any).grecaptcha.reset();
|
||||
if (recaptchaSitekey != null) {
|
||||
(window as any).grecaptcha.reset();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const head = document.getElementsByTagName('head')[0];
|
||||
const script = document.createElement('script');
|
||||
script.setAttribute('src', 'https://www.google.com/recaptcha/api.js');
|
||||
head.appendChild(script);
|
||||
if (recaptchaSitekey != null) {
|
||||
const head = document.getElementsByTagName('head')[0];
|
||||
const script = document.createElement('script');
|
||||
script.setAttribute('src', 'https://www.google.com/recaptcha/api.js');
|
||||
head.appendChild(script);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -144,22 +143,4 @@ export default Vue.extend({
|
||||
|
||||
.mk-signup
|
||||
min-width 302px
|
||||
|
||||
.agree-tou
|
||||
padding 4px
|
||||
border-radius 4px
|
||||
|
||||
&:hover
|
||||
background #f4f4f4
|
||||
|
||||
&:active
|
||||
background #eee
|
||||
|
||||
&, *
|
||||
cursor pointer
|
||||
|
||||
p
|
||||
display inline
|
||||
color #555
|
||||
|
||||
</style>
|
||||
|
||||
@@ -67,15 +67,27 @@ class Autocomplete {
|
||||
* テキスト入力時
|
||||
*/
|
||||
private onInput() {
|
||||
const caret = this.textarea.selectionStart;
|
||||
const text = this.text.substr(0, caret);
|
||||
const caretPos = this.textarea.selectionStart;
|
||||
const text = this.text.substr(0, caretPos);
|
||||
|
||||
const mentionIndex = text.lastIndexOf('@');
|
||||
const hashtagIndex = text.lastIndexOf('#');
|
||||
const emojiIndex = text.lastIndexOf(':');
|
||||
|
||||
const start = Math.min(
|
||||
mentionIndex == -1 ? Infinity : mentionIndex,
|
||||
hashtagIndex == -1 ? Infinity : hashtagIndex,
|
||||
emojiIndex == -1 ? Infinity : emojiIndex);
|
||||
|
||||
if (start == Infinity) return;
|
||||
|
||||
const isMention = mentionIndex == start;
|
||||
const isHashtag = hashtagIndex == start;
|
||||
const isEmoji = emojiIndex == start;
|
||||
|
||||
let opened = false;
|
||||
|
||||
if (mentionIndex != -1 && mentionIndex > emojiIndex) {
|
||||
if (isMention) {
|
||||
const username = text.substr(mentionIndex + 1);
|
||||
if (username != '' && username.match(/^[a-zA-Z0-9_]+$/)) {
|
||||
this.open('user', username);
|
||||
@@ -83,7 +95,15 @@ class Autocomplete {
|
||||
}
|
||||
}
|
||||
|
||||
if (emojiIndex != -1 && emojiIndex > mentionIndex) {
|
||||
if (isHashtag || opened == false) {
|
||||
const hashtag = text.substr(hashtagIndex + 1);
|
||||
if (hashtag != '' && !hashtag.includes(' ') && !hashtag.includes('\n')) {
|
||||
this.open('hashtag', hashtag);
|
||||
opened = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (isEmoji || opened == false) {
|
||||
const emoji = text.substr(emojiIndex + 1);
|
||||
if (emoji != '' && emoji.match(/^[\+\-a-z0-9_]+$/)) {
|
||||
this.open('emoji', emoji);
|
||||
@@ -173,6 +193,22 @@ class Autocomplete {
|
||||
const pos = trimmedBefore.length + (value.username.length + 2);
|
||||
this.textarea.setSelectionRange(pos, pos);
|
||||
});
|
||||
} else if (type == 'hashtag') {
|
||||
const source = this.text;
|
||||
|
||||
const before = source.substr(0, caret);
|
||||
const trimmedBefore = before.substring(0, before.lastIndexOf('#'));
|
||||
const after = source.substr(caret);
|
||||
|
||||
// 挿入
|
||||
this.text = trimmedBefore + '#' + value + ' ' + after;
|
||||
|
||||
// キャレットを戻す
|
||||
this.vm.$nextTick(() => {
|
||||
this.textarea.focus();
|
||||
const pos = trimmedBefore.length + (value.length + 2);
|
||||
this.textarea.setSelectionRange(pos, pos);
|
||||
});
|
||||
} else if (type == 'emoji') {
|
||||
const source = this.text;
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="mkw-analog-clock">
|
||||
<mk-widget-container :naked="props.naked" :show-header="false">
|
||||
<mk-widget-container :naked="!(props.design % 2)" :show-header="false">
|
||||
<div class="mkw-analog-clock--body">
|
||||
<mk-analog-clock :dark="$store.state.device.darkmode"/>
|
||||
<mk-analog-clock :dark="$store.state.device.darkmode" :smooth="!(props.design && ~props.design)"/>
|
||||
</div>
|
||||
</mk-widget-container>
|
||||
</div>
|
||||
@@ -13,12 +13,13 @@ import define from '../../../common/define-widget';
|
||||
export default define({
|
||||
name: 'analog-clock',
|
||||
props: () => ({
|
||||
naked: false
|
||||
design: -1
|
||||
})
|
||||
}).extend({
|
||||
methods: {
|
||||
func() {
|
||||
this.props.naked = !this.props.naked;
|
||||
if (++this.props.design > 2)
|
||||
this.props.design = -1;
|
||||
this.save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,6 +175,7 @@ root(isDark)
|
||||
> .val
|
||||
height 4px
|
||||
background $theme-color
|
||||
transition width .3s cubic-bezier(0.23, 1, 0.32, 1)
|
||||
|
||||
&:nth-child(1)
|
||||
> .meter > .val
|
||||
|
||||
@@ -35,10 +35,7 @@ import Vue from 'vue';
|
||||
const eachMonthDays = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
||||
|
||||
function isLeapYear(year) {
|
||||
return (year % 400 == 0) ? true :
|
||||
(year % 100 == 0) ? false :
|
||||
(year % 4 == 0) ? true :
|
||||
false;
|
||||
return !(year % (year % 25 ? 4 : 16));
|
||||
}
|
||||
|
||||
export default Vue.extend({
|
||||
|
||||
@@ -68,6 +68,11 @@ export default Vue.extend({
|
||||
icon: '%fa:i-cursor%',
|
||||
action: this.rename
|
||||
}, {
|
||||
type: 'item',
|
||||
text: this.file.isSensitive ? '%i18n:@contextmenu.unmark-as-sensitive%' : '%i18n:@contextmenu.mark-as-sensitive%',
|
||||
icon: this.file.isSensitive ? '%fa:R eye%' : '%fa:R eye-slash%',
|
||||
action: this.toggleSensitive
|
||||
}, null, {
|
||||
type: 'item',
|
||||
text: '%i18n:@contextmenu.copy-url%',
|
||||
icon: '%fa:link%',
|
||||
@@ -149,6 +154,13 @@ export default Vue.extend({
|
||||
});
|
||||
},
|
||||
|
||||
toggleSensitive() {
|
||||
(this as any).api('drive/files/update', {
|
||||
fileId: this.file.id,
|
||||
isSensitive: !this.file.isSensitive
|
||||
});
|
||||
},
|
||||
|
||||
copyUrl() {
|
||||
copyToClipboard(this.file.url);
|
||||
(this as any).apis.dialog({
|
||||
|
||||
@@ -10,7 +10,10 @@
|
||||
<span class="separator" v-if="folder != null">%fa:angle-right%</span>
|
||||
<span class="folder current" v-if="folder != null">{{ folder.name }}</span>
|
||||
</div>
|
||||
<input class="search" type="search" placeholder=" %i18n:@search%"/>
|
||||
<!--
|
||||
TODO: #343
|
||||
<input class="search" type="search" placeholder=" %i18n:@search%"/>
|
||||
-->
|
||||
</nav>
|
||||
<div class="main" :class="{ uploading: uploadings.length > 0, fetching }"
|
||||
ref="main"
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<template>
|
||||
<a class="mk-media-image"
|
||||
<div class="ldwbgwstjsdgcjruamauqdrffetqudry" v-if="image.isSensitive && hide" @click="hide = false">
|
||||
<div>
|
||||
<b>%fa:exclamation-triangle% %i18n:@sensitive%</b>
|
||||
<span>%i18n:@click-to-show%</span>
|
||||
</div>
|
||||
</div>
|
||||
<a class="lcjomzwbohoelkxsnuqjiaccdbdfiazy" v-else
|
||||
:href="image.url"
|
||||
@mousemove="onMousemove"
|
||||
@mouseleave="onMouseleave"
|
||||
@@ -21,6 +27,10 @@ export default Vue.extend({
|
||||
},
|
||||
raw: {
|
||||
default: false
|
||||
},
|
||||
hide: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -56,16 +66,30 @@ export default Vue.extend({
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.mk-media-image
|
||||
.lcjomzwbohoelkxsnuqjiaccdbdfiazy
|
||||
display block
|
||||
cursor zoom-in
|
||||
overflow hidden
|
||||
width 100%
|
||||
height 100%
|
||||
background-position center
|
||||
border-radius 4px
|
||||
|
||||
&:not(:hover)
|
||||
background-size cover
|
||||
|
||||
.ldwbgwstjsdgcjruamauqdrffetqudry
|
||||
display flex
|
||||
justify-content center
|
||||
align-items center
|
||||
background #111
|
||||
color #fff
|
||||
|
||||
> div
|
||||
display table-cell
|
||||
text-align center
|
||||
font-size 12px
|
||||
|
||||
> b
|
||||
display block
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
<template>
|
||||
<video class="mk-media-video"
|
||||
<div class="uofhebxjdgksfmltszlxurtjnjjsvioh" v-if="video.isSensitive && hide" @click="hide = false">
|
||||
<div>
|
||||
<b>%fa:exclamation-triangle% %i18n:@sensitive%</b>
|
||||
<span>%i18n:@click-to-show%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="vwxdhznewyashiknzolsoihtlpicqepe" v-else>
|
||||
<video class="video"
|
||||
:src="video.url"
|
||||
:title="video.name"
|
||||
controls
|
||||
@dblclick.prevent="onClick"
|
||||
ref="video"
|
||||
v-if="inlinePlayable" />
|
||||
<a class="mk-media-video-thumbnail"
|
||||
<a class="thumbnail"
|
||||
:href="video.url"
|
||||
:style="imageStyle"
|
||||
@click.prevent="onClick"
|
||||
@@ -14,6 +21,7 @@
|
||||
v-else>
|
||||
%fa:R play-circle%
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -21,7 +29,19 @@ import Vue from 'vue';
|
||||
import MkMediaVideoDialog from './media-video-dialog.vue';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['video', 'inlinePlayable'],
|
||||
props: {
|
||||
video: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
inlinePlayable: {
|
||||
default: false
|
||||
},
|
||||
hide: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
imageStyle(): any {
|
||||
return {
|
||||
@@ -47,22 +67,39 @@ export default Vue.extend({
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.mk-media-video
|
||||
display block
|
||||
width 100%
|
||||
height 100%
|
||||
border-radius 4px
|
||||
.vwxdhznewyashiknzolsoihtlpicqepe
|
||||
.video
|
||||
display block
|
||||
width 100%
|
||||
height 100%
|
||||
border-radius 4px
|
||||
|
||||
.mk-media-video-thumbnail
|
||||
.thumbnail
|
||||
display flex
|
||||
justify-content center
|
||||
align-items center
|
||||
font-size 3.5em
|
||||
|
||||
cursor zoom-in
|
||||
overflow hidden
|
||||
background-position center
|
||||
background-size cover
|
||||
width 100%
|
||||
height 100%
|
||||
|
||||
.uofhebxjdgksfmltszlxurtjnjjsvioh
|
||||
display flex
|
||||
justify-content center
|
||||
align-items center
|
||||
font-size 3.5em
|
||||
background #111
|
||||
color #fff
|
||||
|
||||
> div
|
||||
display table-cell
|
||||
text-align center
|
||||
font-size 12px
|
||||
|
||||
> b
|
||||
display block
|
||||
|
||||
cursor zoom-in
|
||||
overflow hidden
|
||||
background-position center
|
||||
background-size cover
|
||||
width 100%
|
||||
height 100%
|
||||
</style>
|
||||
|
||||
@@ -56,10 +56,10 @@
|
||||
<button @click="menu" ref="menuButton">
|
||||
%fa:ellipsis-h%
|
||||
</button>
|
||||
<button title="%i18n:@detail">
|
||||
<!-- <button title="%i18n:@detail">
|
||||
<template v-if="!isDetailOpened">%fa:caret-down%</template>
|
||||
<template v-if="isDetailOpened">%fa:caret-up%</template>
|
||||
</button>
|
||||
</button> -->
|
||||
</footer>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
<span v-for="u in visibleUsers">{{ u | userName }}<a @click="removeVisibleUser(u)">[x]</a></span>
|
||||
<a @click="addVisibleUser">+ユーザーを追加</a>
|
||||
</div>
|
||||
<div class="hashtags" v-if="recentHashtags.length > 0">
|
||||
<a v-for="tag in recentHashtags" @click="addTag(tag)">#{{ tag }}</a>
|
||||
</div>
|
||||
<input v-show="useCw" v-model="cw" placeholder="内容への注釈 (オプション)">
|
||||
<textarea :class="{ with: (files.length != 0 || poll) }"
|
||||
ref="text" v-model="text" :disabled="posting"
|
||||
@@ -46,6 +49,7 @@
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import insertTextAtCursor from 'insert-text-at-cursor';
|
||||
import * as XDraggable from 'vuedraggable';
|
||||
import getKao from '../../../common/scripts/get-kao';
|
||||
import MkVisibilityChooser from '../../../common/views/components/visibility-chooser.vue';
|
||||
@@ -91,7 +95,8 @@ export default Vue.extend({
|
||||
visibility: 'public',
|
||||
visibleUsers: [],
|
||||
autocomplete: null,
|
||||
draghover: false
|
||||
draghover: false,
|
||||
recentHashtags: JSON.parse(localStorage.getItem('hashtags') || '[]')
|
||||
};
|
||||
},
|
||||
|
||||
@@ -183,6 +188,10 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
methods: {
|
||||
addTag(tag: string) {
|
||||
insertTextAtCursor(this.$refs.text, ` #${tag} `);
|
||||
},
|
||||
|
||||
watch() {
|
||||
this.$watch('text', () => this.saveDraft());
|
||||
this.$watch('poll', () => this.saveDraft());
|
||||
@@ -370,6 +379,13 @@ export default Vue.extend({
|
||||
}).then(() => {
|
||||
this.posting = false;
|
||||
});
|
||||
|
||||
if (this.text && this.text != '') {
|
||||
const hashtags = parse(this.text).filter(x => x.type == 'hashtag').map(x => x.hashtag);
|
||||
let history = JSON.parse(localStorage.getItem('hashtags') || '[]') as string[];
|
||||
history = history.filter(x => !hashtags.includes(x));
|
||||
localStorage.setItem('hashtags', JSON.stringify(hashtags.concat(history)));
|
||||
}
|
||||
},
|
||||
|
||||
saveDraft() {
|
||||
@@ -478,6 +494,10 @@ root(isDark)
|
||||
margin-right 16px
|
||||
color isDark ? #fff : #666
|
||||
|
||||
> .hashtags
|
||||
> *
|
||||
margin-right 8px
|
||||
|
||||
> .medias
|
||||
margin 0
|
||||
padding 0
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<div :class="$style.loading" v-if="fetching">
|
||||
<mk-ellipsis-icon/>
|
||||
</div>
|
||||
<p :class="$style.notAvailable" v-if="!fetching && notAvailable">検索機能を利用することができません。</p>
|
||||
<p :class="$style.empty" v-if="!fetching && empty">%fa:search%「{{ q }}」に関する投稿は見つかりませんでした。</p>
|
||||
<mk-notes ref="timeline" :class="$style.notes" :more="existMore ? more : null"/>
|
||||
</mk-ui>
|
||||
@@ -24,7 +25,8 @@ export default Vue.extend({
|
||||
moreFetching: false,
|
||||
existMore: false,
|
||||
offset: 0,
|
||||
empty: false
|
||||
empty: false,
|
||||
notAvailable: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -71,7 +73,11 @@ export default Vue.extend({
|
||||
res(notes);
|
||||
this.fetching = false;
|
||||
Progress.done();
|
||||
}, rej);
|
||||
}, (e: string) => {
|
||||
this.fetching = false;
|
||||
Progress.done();
|
||||
if (e === 'searching not available') this.notAvailable = true;
|
||||
});
|
||||
}));
|
||||
},
|
||||
more() {
|
||||
@@ -130,4 +136,18 @@ export default Vue.extend({
|
||||
font-size 3em
|
||||
color #ccc
|
||||
|
||||
|
||||
.notAvailable
|
||||
display block
|
||||
margin 0 auto
|
||||
padding 32px
|
||||
max-width 400px
|
||||
text-align center
|
||||
color #999
|
||||
|
||||
> [data-fa]
|
||||
display block
|
||||
margin-bottom 16px
|
||||
font-size 3em
|
||||
color #ccc
|
||||
</style>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="mkw-notifications">
|
||||
<mk-widget-container :show-header="!props.compact">
|
||||
<template slot="header">%fa:R bell%%i18n:@title%</template>
|
||||
<button slot="func" title="%i18n:@settings%" @click="settings">%fa:cog%</button>
|
||||
<!-- <button slot="func" title="%i18n:@settings%" @click="settings">%fa:cog%</button> -->
|
||||
|
||||
<mk-notifications :class="$style.notifications"/>
|
||||
</mk-widget-container>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<template>
|
||||
<a class="mk-media-image" :href="image.url" target="_blank" :style="style" :title="image.name"></a>
|
||||
<div class="qjewsnkgzzxlxtzncydssfbgjibiehcy" v-if="image.isSensitive && hide" @click="hide = false">
|
||||
<div>
|
||||
<b>%fa:exclamation-triangle% %i18n:@sensitive%</b>
|
||||
<span>%i18n:@click-to-show%</span>
|
||||
</div>
|
||||
</div>
|
||||
<a class="gqnyydlzavusgskkfvwvjiattxdzsqlf" v-else :href="image.url" target="_blank" :style="style" :title="image.name"></a>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -13,6 +19,10 @@ export default Vue.extend({
|
||||
},
|
||||
raw: {
|
||||
default: false
|
||||
},
|
||||
hide: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -35,13 +45,27 @@ export default Vue.extend({
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.mk-media-image
|
||||
.gqnyydlzavusgskkfvwvjiattxdzsqlf
|
||||
display block
|
||||
overflow hidden
|
||||
width 100%
|
||||
height 100%
|
||||
background-position center
|
||||
background-size cover
|
||||
border-radius 4px
|
||||
|
||||
.qjewsnkgzzxlxtzncydssfbgjibiehcy
|
||||
display flex
|
||||
justify-content center
|
||||
align-items center
|
||||
background #111
|
||||
color #fff
|
||||
|
||||
> div
|
||||
display table-cell
|
||||
text-align center
|
||||
font-size 12px
|
||||
|
||||
> b
|
||||
display block
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,17 +1,32 @@
|
||||
<template>
|
||||
<a class="mk-media-video"
|
||||
:href="video.url"
|
||||
target="_blank"
|
||||
:style="imageStyle"
|
||||
:title="video.name">
|
||||
%fa:R play-circle%
|
||||
</a>
|
||||
<div class="icozogqfvdetwohsdglrbswgrejoxbdj" v-if="video.isSensitive && hide" @click="hide = false">
|
||||
<div>
|
||||
<b>%fa:exclamation-triangle% %i18n:@sensitive%</b>
|
||||
<span>%i18n:@click-to-show%</span>
|
||||
</div>
|
||||
</div>
|
||||
<a class="kkjnbbplepmiyuadieoenjgutgcmtsvu" v-else
|
||||
:href="video.url"
|
||||
target="_blank"
|
||||
:style="imageStyle"
|
||||
:title="video.name">
|
||||
%fa:R play-circle%
|
||||
</a>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue'
|
||||
export default Vue.extend({
|
||||
props: ['video'],
|
||||
props: {
|
||||
video: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
hide: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
imageStyle(): any {
|
||||
return {
|
||||
@@ -22,7 +37,7 @@ export default Vue.extend({
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.mk-media-video
|
||||
.kkjnbbplepmiyuadieoenjgutgcmtsvu
|
||||
display flex
|
||||
justify-content center
|
||||
align-items center
|
||||
@@ -33,4 +48,20 @@ export default Vue.extend({
|
||||
background-size cover
|
||||
width 100%
|
||||
height 100%
|
||||
|
||||
.icozogqfvdetwohsdglrbswgrejoxbdj
|
||||
display flex
|
||||
justify-content center
|
||||
align-items center
|
||||
background #111
|
||||
color #fff
|
||||
|
||||
> div
|
||||
display table-cell
|
||||
text-align center
|
||||
font-size 12px
|
||||
|
||||
> b
|
||||
display block
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,47 +1,53 @@
|
||||
<template>
|
||||
<div class="mk-post-form">
|
||||
<header>
|
||||
<button class="cancel" @click="cancel">%fa:times%</button>
|
||||
<div>
|
||||
<span class="text-count" :class="{ over: text.length > 1000 }">{{ 1000 - text.length }}</span>
|
||||
<span class="geo" v-if="geo">%fa:map-marker-alt%</span>
|
||||
<button class="submit" :disabled="!canPost" @click="post">{{ submitText }}</button>
|
||||
</div>
|
||||
</header>
|
||||
<div class="form">
|
||||
<mk-note-preview v-if="reply" :note="reply"/>
|
||||
<mk-note-preview v-if="renote" :note="renote"/>
|
||||
<div v-if="visibility == 'specified'" class="visibleUsers">
|
||||
<span v-for="u in visibleUsers">{{ u | userName }}<a @click="removeVisibleUser(u)">[x]</a></span>
|
||||
<a @click="addVisibleUser">+%i18n:@add-visible-user%</a>
|
||||
<header>
|
||||
<button class="cancel" @click="cancel">%fa:times%</button>
|
||||
<div>
|
||||
<span class="text-count" :class="{ over: text.length > 1000 }">{{ 1000 - text.length }}</span>
|
||||
<span class="geo" v-if="geo">%fa:map-marker-alt%</span>
|
||||
<button class="submit" :disabled="!canPost" @click="post">{{ submitText }}</button>
|
||||
</div>
|
||||
</header>
|
||||
<div class="form">
|
||||
<mk-note-preview v-if="reply" :note="reply"/>
|
||||
<mk-note-preview v-if="renote" :note="renote"/>
|
||||
<div v-if="visibility == 'specified'" class="visibleUsers">
|
||||
<span v-for="u in visibleUsers">{{ u | userName }}<a @click="removeVisibleUser(u)">[x]</a></span>
|
||||
<a @click="addVisibleUser">+%i18n:@add-visible-user%</a>
|
||||
</div>
|
||||
<input v-show="useCw" v-model="cw" placeholder="%i18n:@cw-placeholder%">
|
||||
<textarea v-model="text" ref="text" :disabled="posting" :placeholder="placeholder" v-autocomplete="'text'"></textarea>
|
||||
<div class="attaches" v-show="files.length != 0">
|
||||
<x-draggable class="files" :list="files" :options="{ animation: 150 }">
|
||||
<div class="file" v-for="file in files" :key="file.id">
|
||||
<div class="img" :style="`background-image: url(${file.url}?thumbnail&size=128)`" @click="detachMedia(file)"></div>
|
||||
</div>
|
||||
</x-draggable>
|
||||
</div>
|
||||
<mk-poll-editor v-if="poll" ref="poll" @destroyed="poll = false"/>
|
||||
<mk-uploader ref="uploader" @uploaded="attachMedia" @change="onChangeUploadings"/>
|
||||
<footer>
|
||||
<button class="upload" @click="chooseFile">%fa:upload%</button>
|
||||
<button class="drive" @click="chooseFileFromDrive">%fa:cloud%</button>
|
||||
<button class="kao" @click="kao">%fa:R smile%</button>
|
||||
<button class="poll" @click="poll = true">%fa:chart-pie%</button>
|
||||
<button class="poll" @click="useCw = !useCw">%fa:eye-slash%</button>
|
||||
<button class="geo" @click="geo ? removeGeo() : setGeo()">%fa:map-marker-alt%</button>
|
||||
<button class="visibility" @click="setVisibility" ref="visibilityButton">%fa:lock%</button>
|
||||
</footer>
|
||||
<input ref="file" class="file" type="file" accept="image/*" multiple="multiple" @change="onChangeFile"/>
|
||||
</div>
|
||||
<input v-show="useCw" v-model="cw" placeholder="%i18n:@cw-placeholder%">
|
||||
<textarea v-model="text" ref="text" :disabled="posting" :placeholder="placeholder"></textarea>
|
||||
<div class="attaches" v-show="files.length != 0">
|
||||
<x-draggable class="files" :list="files" :options="{ animation: 150 }">
|
||||
<div class="file" v-for="file in files" :key="file.id">
|
||||
<div class="img" :style="`background-image: url(${file.url}?thumbnail&size=128)`" @click="detachMedia(file)"></div>
|
||||
</div>
|
||||
</x-draggable>
|
||||
</div>
|
||||
<mk-poll-editor v-if="poll" ref="poll" @destroyed="poll = false"/>
|
||||
<mk-uploader ref="uploader" @uploaded="attachMedia" @change="onChangeUploadings"/>
|
||||
<footer>
|
||||
<button class="upload" @click="chooseFile">%fa:upload%</button>
|
||||
<button class="drive" @click="chooseFileFromDrive">%fa:cloud%</button>
|
||||
<button class="kao" @click="kao">%fa:R smile%</button>
|
||||
<button class="poll" @click="poll = true">%fa:chart-pie%</button>
|
||||
<button class="poll" @click="useCw = !useCw">%fa:eye-slash%</button>
|
||||
<button class="geo" @click="geo ? removeGeo() : setGeo()">%fa:map-marker-alt%</button>
|
||||
<button class="visibility" @click="setVisibility" ref="visibilityButton">%fa:lock%</button>
|
||||
</footer>
|
||||
<input ref="file" class="file" type="file" accept="image/*" multiple="multiple" @change="onChangeFile"/>
|
||||
</div>
|
||||
<div class="hashtags" v-if="recentHashtags.length > 0">
|
||||
<a v-for="tag in recentHashtags" @click="addTag(tag)">#{{ tag }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import insertTextAtCursor from 'insert-text-at-cursor';
|
||||
import * as XDraggable from 'vuedraggable';
|
||||
import MkVisibilityChooser from '../../../common/views/components/visibility-chooser.vue';
|
||||
import getKao from '../../../common/scripts/get-kao';
|
||||
@@ -85,7 +91,8 @@ export default Vue.extend({
|
||||
visibility: 'public',
|
||||
visibleUsers: [],
|
||||
useCw: false,
|
||||
cw: null
|
||||
cw: null,
|
||||
recentHashtags: JSON.parse(localStorage.getItem('hashtags') || '[]')
|
||||
};
|
||||
},
|
||||
|
||||
@@ -161,6 +168,10 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
methods: {
|
||||
addTag(tag: string) {
|
||||
insertTextAtCursor(this.$refs.text, ` #${tag} `);
|
||||
},
|
||||
|
||||
focus() {
|
||||
(this.$refs.text as any).focus();
|
||||
},
|
||||
@@ -281,6 +292,13 @@ export default Vue.extend({
|
||||
}).catch(err => {
|
||||
this.posting = false;
|
||||
});
|
||||
|
||||
if (this.text && this.text != '') {
|
||||
const hashtags = parse(this.text).filter(x => x.type == 'hashtag').map(x => x.hashtag);
|
||||
let history = JSON.parse(localStorage.getItem('hashtags') || '[]') as string[];
|
||||
history = history.filter(x => !hashtags.includes(x));
|
||||
localStorage.setItem('hashtags', JSON.stringify(hashtags.concat(history)));
|
||||
}
|
||||
},
|
||||
|
||||
cancel() {
|
||||
@@ -302,146 +320,156 @@ root(isDark)
|
||||
max-width 500px
|
||||
width calc(100% - 16px)
|
||||
margin 8px auto
|
||||
background isDark ? #282C37 : #fff
|
||||
border-radius 8px
|
||||
box-shadow 0 0 2px rgba(#000, 0.1)
|
||||
|
||||
@media (min-width 500px)
|
||||
margin 16px auto
|
||||
width calc(100% - 32px)
|
||||
box-shadow 0 8px 32px rgba(#000, 0.1)
|
||||
|
||||
> .form
|
||||
box-shadow 0 8px 32px rgba(#000, 0.1)
|
||||
|
||||
@media (min-width 600px)
|
||||
margin 32px auto
|
||||
|
||||
> header
|
||||
z-index 1000
|
||||
height 50px
|
||||
box-shadow 0 1px 0 0 isDark ? rgba(#000, 0.2) : rgba(#000, 0.1)
|
||||
|
||||
> .cancel
|
||||
padding 0
|
||||
width 50px
|
||||
line-height 50px
|
||||
font-size 24px
|
||||
color isDark ? #9baec8 : #555
|
||||
|
||||
> div
|
||||
position absolute
|
||||
top 0
|
||||
right 0
|
||||
color #657786
|
||||
|
||||
> .text-count
|
||||
line-height 50px
|
||||
|
||||
> .geo
|
||||
margin 0 8px
|
||||
line-height 50px
|
||||
|
||||
> .submit
|
||||
margin 8px
|
||||
padding 0 16px
|
||||
line-height 34px
|
||||
vertical-align bottom
|
||||
color $theme-color-foreground
|
||||
background $theme-color
|
||||
border-radius 4px
|
||||
|
||||
&:disabled
|
||||
opacity 0.7
|
||||
|
||||
> .form
|
||||
max-width 500px
|
||||
margin 0 auto
|
||||
background isDark ? #282C37 : #fff
|
||||
border-radius 8px
|
||||
box-shadow 0 0 2px rgba(#000, 0.1)
|
||||
|
||||
> .mk-note-preview
|
||||
padding 16px
|
||||
|
||||
> .visibleUsers
|
||||
margin-bottom 8px
|
||||
font-size 14px
|
||||
|
||||
> span
|
||||
margin-right 16px
|
||||
color isDark ? #fff : #666
|
||||
|
||||
> input
|
||||
z-index 1
|
||||
|
||||
> input
|
||||
> textarea
|
||||
display block
|
||||
padding 12px
|
||||
margin 0
|
||||
width 100%
|
||||
font-size 16px
|
||||
color isDark ? #fff : #333
|
||||
background isDark ? #191d23 : #fff
|
||||
border none
|
||||
border-radius 0
|
||||
> header
|
||||
z-index 1000
|
||||
height 50px
|
||||
box-shadow 0 1px 0 0 isDark ? rgba(#000, 0.2) : rgba(#000, 0.1)
|
||||
|
||||
&:disabled
|
||||
opacity 0.5
|
||||
|
||||
> textarea
|
||||
max-width 100%
|
||||
min-width 100%
|
||||
min-height 80px
|
||||
|
||||
> .attaches
|
||||
|
||||
> .files
|
||||
display block
|
||||
margin 0
|
||||
padding 4px
|
||||
list-style none
|
||||
|
||||
&:after
|
||||
content ""
|
||||
display block
|
||||
clear both
|
||||
|
||||
> .file
|
||||
display block
|
||||
float left
|
||||
margin 0
|
||||
padding 0
|
||||
border solid 4px transparent
|
||||
|
||||
> .img
|
||||
width 64px
|
||||
height 64px
|
||||
background-size cover
|
||||
background-position center center
|
||||
|
||||
> .mk-uploader
|
||||
margin 8px 0 0 0
|
||||
padding 8px
|
||||
|
||||
> .file
|
||||
display none
|
||||
|
||||
> footer
|
||||
white-space nowrap
|
||||
overflow auto
|
||||
-webkit-overflow-scrolling touch
|
||||
overflow-scrolling touch
|
||||
|
||||
> *
|
||||
display inline-block
|
||||
> .cancel
|
||||
padding 0
|
||||
margin 0
|
||||
width 48px
|
||||
height 48px
|
||||
font-size 20px
|
||||
width 50px
|
||||
line-height 50px
|
||||
font-size 24px
|
||||
color isDark ? #9baec8 : #555
|
||||
|
||||
> div
|
||||
position absolute
|
||||
top 0
|
||||
right 0
|
||||
color #657786
|
||||
background transparent
|
||||
outline none
|
||||
|
||||
> .text-count
|
||||
line-height 50px
|
||||
|
||||
> .geo
|
||||
margin 0 8px
|
||||
line-height 50px
|
||||
|
||||
> .submit
|
||||
margin 8px
|
||||
padding 0 16px
|
||||
line-height 34px
|
||||
vertical-align bottom
|
||||
color $theme-color-foreground
|
||||
background $theme-color
|
||||
border-radius 4px
|
||||
|
||||
&:disabled
|
||||
opacity 0.7
|
||||
|
||||
> .form
|
||||
max-width 500px
|
||||
margin 0 auto
|
||||
|
||||
> .mk-note-preview
|
||||
padding 16px
|
||||
|
||||
> .visibleUsers
|
||||
margin-bottom 8px
|
||||
font-size 14px
|
||||
|
||||
> span
|
||||
margin-right 16px
|
||||
color isDark ? #fff : #666
|
||||
|
||||
> input
|
||||
z-index 1
|
||||
|
||||
> input
|
||||
> textarea
|
||||
display block
|
||||
padding 12px
|
||||
margin 0
|
||||
width 100%
|
||||
font-size 16px
|
||||
color isDark ? #fff : #333
|
||||
background isDark ? #191d23 : #fff
|
||||
border none
|
||||
border-radius 0
|
||||
box-shadow none
|
||||
box-shadow 0 1px 0 0 isDark ? rgba(#000, 0.2) : rgba(#000, 0.1)
|
||||
|
||||
&:disabled
|
||||
opacity 0.5
|
||||
|
||||
> textarea
|
||||
max-width 100%
|
||||
min-width 100%
|
||||
min-height 80px
|
||||
|
||||
> .attaches
|
||||
|
||||
> .files
|
||||
display block
|
||||
margin 0
|
||||
padding 4px
|
||||
list-style none
|
||||
|
||||
&:after
|
||||
content ""
|
||||
display block
|
||||
clear both
|
||||
|
||||
> .file
|
||||
display block
|
||||
float left
|
||||
margin 0
|
||||
padding 0
|
||||
border solid 4px transparent
|
||||
|
||||
> .img
|
||||
width 64px
|
||||
height 64px
|
||||
background-size cover
|
||||
background-position center center
|
||||
|
||||
> .mk-uploader
|
||||
margin 8px 0 0 0
|
||||
padding 8px
|
||||
|
||||
> .file
|
||||
display none
|
||||
|
||||
> footer
|
||||
white-space nowrap
|
||||
overflow auto
|
||||
-webkit-overflow-scrolling touch
|
||||
overflow-scrolling touch
|
||||
|
||||
> *
|
||||
display inline-block
|
||||
padding 0
|
||||
margin 0
|
||||
width 48px
|
||||
height 48px
|
||||
font-size 20px
|
||||
color #657786
|
||||
background transparent
|
||||
outline none
|
||||
border none
|
||||
border-radius 0
|
||||
box-shadow none
|
||||
|
||||
> .hashtags
|
||||
margin 8px
|
||||
|
||||
> *
|
||||
margin-right 8px
|
||||
|
||||
.mk-post-form[data-darkmode]
|
||||
root(true)
|
||||
|
||||
@@ -40,7 +40,7 @@ export type Source = {
|
||||
port: number;
|
||||
pass: string;
|
||||
};
|
||||
recaptcha: {
|
||||
recaptcha?: {
|
||||
site_key: string;
|
||||
secret_key: string;
|
||||
};
|
||||
|
||||
@@ -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,69 +5,86 @@ 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:
|
||||
ja: "フォルダ"
|
||||
en: "The folder of this file"
|
||||
|
||||
sensitive:
|
||||
type: "boolean"
|
||||
optional: true
|
||||
desc:
|
||||
ja: "このメディアが「閲覧注意」(NSFW)かどうか"
|
||||
en: "Whether this media is NSFW"
|
||||
|
||||
@@ -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,13 +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
|
||||
|
||||
section
|
||||
margin 32px 0
|
||||
width 850px
|
||||
max-width calc(100% - 330px)
|
||||
|
||||
h1
|
||||
margin 0 0 24px 0
|
||||
@@ -22,18 +19,18 @@ main
|
||||
border-bottom solid 2px #eee
|
||||
|
||||
h2
|
||||
margin 0 0 24px 0
|
||||
margin 1em 0 24px 0
|
||||
padding 0 0 16px 0
|
||||
font-size 1.4em
|
||||
border-bottom solid 1px #eee
|
||||
|
||||
h3
|
||||
margin 0
|
||||
margin 1em 0 0 0
|
||||
padding 0
|
||||
font-size 1.25em
|
||||
|
||||
h4
|
||||
margin 0
|
||||
margin 1em 0 0 0
|
||||
|
||||
p
|
||||
margin 1em 0
|
||||
@@ -44,6 +41,7 @@ main
|
||||
border-top solid 2px #eee
|
||||
|
||||
> small
|
||||
display block
|
||||
margin 16px 0 0 0
|
||||
color #aaa
|
||||
|
||||
@@ -53,13 +51,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 +83,6 @@ nav
|
||||
padding 16px
|
||||
|
||||
table
|
||||
display block
|
||||
width 100%
|
||||
max-width 100%
|
||||
overflow auto
|
||||
@@ -106,10 +107,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 +118,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
|
||||
|
||||
## ホーム
|
||||
自分のフォローしているユーザーの投稿
|
||||
|
||||
## ローカル
|
||||
全てのローカルユーザーの「ホーム」指定されていない投稿
|
||||
|
||||
## ソーシャル
|
||||
自分のフォローしているユーザーの投稿と、全てのローカルユーザーの「ホーム」指定されていない投稿
|
||||
|
||||
## グローバル
|
||||
全てのローカルユーザーの「ホーム」指定されていない投稿と、サーバーに届いた全てのリモートユーザーの「ホーム」指定されていない投稿
|
||||
@@ -33,6 +33,7 @@ export type IMetadata = {
|
||||
url?: string;
|
||||
deletedAt?: Date;
|
||||
isMetaOnly?: boolean;
|
||||
isSensitive?: boolean;
|
||||
};
|
||||
|
||||
export type IDriveFile = {
|
||||
|
||||
13
src/models/hashtag.ts
Normal file
13
src/models/hashtag.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import * as mongo from 'mongodb';
|
||||
import db from '../db/mongodb';
|
||||
|
||||
const Hashtag = db.get<IHashtags>('hashtags');
|
||||
Hashtag.createIndex('tag', { unique: true });
|
||||
Hashtag.createIndex('mentionedUserIdsCount');
|
||||
export default Hashtag;
|
||||
|
||||
export interface IHashtags {
|
||||
tag: string;
|
||||
mentionedUserIds: mongo.ObjectID[];
|
||||
mentionedUserIdsCount: number;
|
||||
}
|
||||
@@ -108,6 +108,7 @@ export interface ILocalUser extends IUserBase {
|
||||
|
||||
export interface IRemoteUser extends IUserBase {
|
||||
inbox: string;
|
||||
sharedInbox?: string;
|
||||
endpoints: string[];
|
||||
uri: string;
|
||||
url?: string;
|
||||
|
||||
@@ -16,7 +16,7 @@ export async function createImage(actor: IRemoteUser, value: any): Promise<IDriv
|
||||
return null;
|
||||
}
|
||||
|
||||
const image = await new Resolver().resolve(value);
|
||||
const image = await new Resolver().resolve(value) as any;
|
||||
|
||||
if (image.url == null) {
|
||||
throw new Error('invalid image: url not privided');
|
||||
@@ -24,7 +24,7 @@ export async function createImage(actor: IRemoteUser, value: any): Promise<IDriv
|
||||
|
||||
log(`Creating the Image: ${image.url}`);
|
||||
|
||||
return await uploadFromUrl(image.url, actor, null, image.url);
|
||||
return await uploadFromUrl(image.url, actor, null, image.url, image.sensitive);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -117,6 +117,7 @@ export async function createPerson(value: any, resolver?: Resolver): Promise<IUs
|
||||
publicKeyPem: person.publicKey.publicKeyPem
|
||||
},
|
||||
inbox: person.inbox,
|
||||
sharedInbox: person.sharedInbox,
|
||||
endpoints: person.endpoints,
|
||||
uri: person.id,
|
||||
url: person.url,
|
||||
@@ -239,6 +240,8 @@ export async function updatePerson(value: string | IObject, resolver?: Resolver)
|
||||
await User.update({ _id: exist._id }, {
|
||||
$set: {
|
||||
updatedAt: new Date(),
|
||||
inbox: person.inbox,
|
||||
sharedInbox: person.sharedInbox,
|
||||
avatarId: avatar ? avatar._id : null,
|
||||
bannerId: banner ? banner._id : null,
|
||||
avatarUrl: avatar && avatar.metadata.isMetaOnly ? avatar.metadata.url : null,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import config from '../../../config';
|
||||
import { IDriveFile } from '../../../models/drive-file';
|
||||
|
||||
export default (fileId: IDriveFile['_id']) => ({
|
||||
export default (file: IDriveFile) => ({
|
||||
type: 'Image',
|
||||
url: `${config.drive_url}/${fileId}`
|
||||
url: `${config.drive_url}/${file._id}`,
|
||||
sensitive: file.metadata.isSensitive
|
||||
});
|
||||
|
||||
@@ -4,10 +4,16 @@ import config from '../../../config';
|
||||
import { ILocalUser } from '../../../models/user';
|
||||
import toHtml from '../../../mfm/html';
|
||||
import parse from '../../../mfm/parse';
|
||||
import DriveFile from '../../../models/drive-file';
|
||||
|
||||
export default (user: ILocalUser) => {
|
||||
export default async (user: ILocalUser) => {
|
||||
const id = `${config.url}/users/${user._id}`;
|
||||
|
||||
const [avatar, banner] = await Promise.all([
|
||||
DriveFile.findOne({ _id: user.avatarId }),
|
||||
DriveFile.findOne({ _id: user.bannerId })
|
||||
]);
|
||||
|
||||
return {
|
||||
type: user.isBot ? 'Service' : 'Person',
|
||||
id,
|
||||
@@ -18,8 +24,8 @@ export default (user: ILocalUser) => {
|
||||
preferredUsername: user.username,
|
||||
name: user.name,
|
||||
summary: toHtml(parse(user.description)),
|
||||
icon: user.avatarId && renderImage(user.avatarId),
|
||||
image: user.bannerId && renderImage(user.bannerId),
|
||||
icon: user.avatarId && renderImage(avatar),
|
||||
image: user.bannerId && renderImage(banner),
|
||||
manuallyApprovesFollowers: user.isLocked,
|
||||
publicKey: renderKey(user)
|
||||
};
|
||||
|
||||
@@ -47,6 +47,7 @@ export interface IPerson extends IObject {
|
||||
preferredUsername: string;
|
||||
manuallyApprovesFollowers: boolean;
|
||||
inbox: string;
|
||||
sharedInbox?: string;
|
||||
publicKey: any;
|
||||
followers: any;
|
||||
following: any;
|
||||
|
||||
@@ -111,13 +111,13 @@ router.get('/users/:user/publickey', async ctx => {
|
||||
});
|
||||
|
||||
// user
|
||||
function userInfo(ctx: Router.IRouterContext, user: IUser) {
|
||||
async function userInfo(ctx: Router.IRouterContext, user: IUser) {
|
||||
if (user === null) {
|
||||
ctx.status = 404;
|
||||
return;
|
||||
}
|
||||
|
||||
ctx.body = pack(renderPerson(user as ILocalUser));
|
||||
ctx.body = pack(await renderPerson(user as ILocalUser));
|
||||
}
|
||||
|
||||
router.get('/users/:user', async ctx => {
|
||||
@@ -128,7 +128,7 @@ router.get('/users/:user', async ctx => {
|
||||
host: null
|
||||
});
|
||||
|
||||
userInfo(ctx, user);
|
||||
await userInfo(ctx, user);
|
||||
});
|
||||
|
||||
router.get('/@:user', async (ctx, next) => {
|
||||
@@ -139,7 +139,7 @@ router.get('/@:user', async (ctx, next) => {
|
||||
host: null
|
||||
});
|
||||
|
||||
userInfo(ctx, user);
|
||||
await userInfo(ctx, user);
|
||||
});
|
||||
//#endregion
|
||||
|
||||
|
||||
@@ -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,33 @@
|
||||
import endpoints, { Endpoint } from './endpoints';
|
||||
import { performance } from 'perf_hooks';
|
||||
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 +36,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);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,13 @@ export default (endpoint: string | Endpoint, user: IUser, app: IApp, data: any,
|
||||
|
||||
// API invoking
|
||||
try {
|
||||
const a = performance.now();
|
||||
res = await exec(data, user, app);
|
||||
const b = performance.now();
|
||||
|
||||
if (b - a > 500) {
|
||||
console.warn(`SLOW API CALL DETECTED: ${ep.name}`);
|
||||
}
|
||||
} catch (e) {
|
||||
rej(e);
|
||||
return;
|
||||
|
||||
@@ -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,45 @@
|
||||
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'
|
||||
}
|
||||
}),
|
||||
|
||||
isSensitive: $.bool.optional.note({
|
||||
default: false,
|
||||
desc: {
|
||||
ja: 'このメディアが「閲覧注意」(NSFW)かどうか',
|
||||
en: 'Whether this media is NSFW'
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a file
|
||||
@@ -27,17 +64,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, false, false, null, null, ps.isSensitive);
|
||||
|
||||
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);
|
||||
|
||||
@@ -3,19 +3,58 @@ import DriveFolder from '../../../../../models/drive-folder';
|
||||
import DriveFile, { validateFileName, pack } from '../../../../../models/drive-file';
|
||||
import { publishDriveStream } from '../../../../../stream';
|
||||
import { ILocalUser } from '../../../../../models/user';
|
||||
import getParams from '../../../get-params';
|
||||
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: '指定したドライブのファイルの情報を更新します。',
|
||||
en: 'Update specified file of drive.'
|
||||
},
|
||||
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'drive-write',
|
||||
|
||||
params: {
|
||||
fileId: $.type(ID).note({
|
||||
desc: {
|
||||
ja: '対象のファイルID'
|
||||
}
|
||||
}),
|
||||
|
||||
folderId: $.type(ID).optional.nullable.note({
|
||||
default: undefined,
|
||||
desc: {
|
||||
ja: 'フォルダID'
|
||||
}
|
||||
}),
|
||||
|
||||
name: $.str.optional.pipe(validateFileName).note({
|
||||
default: undefined,
|
||||
desc: {
|
||||
ja: 'ファイル名',
|
||||
en: 'Name of the file'
|
||||
}
|
||||
}),
|
||||
|
||||
isSensitive: $.bool.optional.note({
|
||||
default: undefined,
|
||||
desc: {
|
||||
ja: 'このメディアが「閲覧注意」(NSFW)かどうか',
|
||||
en: 'Whether this media is NSFW'
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Update a file
|
||||
*/
|
||||
export default (params: any, user: ILocalUser) => new Promise(async (res, rej) => {
|
||||
// Get 'fileId' parameter
|
||||
const [fileId, fileIdErr] = $.type(ID).get(params.fileId);
|
||||
if (fileIdErr) return rej('invalid fileId param');
|
||||
const [ps, psErr] = getParams(meta, params);
|
||||
if (psErr) return rej(psErr);
|
||||
|
||||
// Fetch file
|
||||
const file = await DriveFile
|
||||
.findOne({
|
||||
_id: fileId,
|
||||
_id: ps.fileId,
|
||||
'metadata.userId': user._id
|
||||
});
|
||||
|
||||
@@ -23,23 +62,18 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
|
||||
return rej('file-not-found');
|
||||
}
|
||||
|
||||
// Get 'name' parameter
|
||||
const [name, nameErr] = $.str.optional.pipe(validateFileName).get(params.name);
|
||||
if (nameErr) return rej('invalid name param');
|
||||
if (name) file.filename = name;
|
||||
if (ps.name) file.filename = ps.name;
|
||||
|
||||
// Get 'folderId' parameter
|
||||
const [folderId, folderIdErr] = $.type(ID).optional.nullable.get(params.folderId);
|
||||
if (folderIdErr) return rej('invalid folderId param');
|
||||
if (ps.isSensitive) file.metadata.isSensitive = ps.isSensitive;
|
||||
|
||||
if (folderId !== undefined) {
|
||||
if (folderId === null) {
|
||||
if (ps.folderId !== undefined) {
|
||||
if (ps.folderId === null) {
|
||||
file.metadata.folderId = null;
|
||||
} else {
|
||||
// Fetch folder
|
||||
const folder = await DriveFolder
|
||||
.findOne({
|
||||
_id: folderId,
|
||||
_id: ps.folderId,
|
||||
userId: user._id
|
||||
});
|
||||
|
||||
@@ -54,7 +88,8 @@ export default (params: any, user: ILocalUser) => new Promise(async (res, rej) =
|
||||
await DriveFile.update(file._id, {
|
||||
$set: {
|
||||
filename: file.filename,
|
||||
'metadata.folderId': file.metadata.folderId
|
||||
'metadata.folderId': file.metadata.folderId,
|
||||
'metadata.isSensitive': file.metadata.isSensitive
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
52
src/server/api/endpoints/hashtags/search.ts
Normal file
52
src/server/api/endpoints/hashtags/search.ts
Normal file
@@ -0,0 +1,52 @@
|
||||
import $ from 'cafy';
|
||||
import Hashtag from '../../../../models/hashtag';
|
||||
import getParams from '../../get-params';
|
||||
const escapeRegexp = require('escape-regexp');
|
||||
|
||||
export const meta = {
|
||||
desc: {
|
||||
ja: 'ハッシュタグを検索します。'
|
||||
},
|
||||
|
||||
requireCredential: false,
|
||||
|
||||
params: {
|
||||
limit: $.num.optional.range(1, 100).note({
|
||||
default: 10,
|
||||
desc: {
|
||||
ja: '最大数'
|
||||
}
|
||||
}),
|
||||
|
||||
query: $.str.note({
|
||||
desc: {
|
||||
ja: 'クエリ'
|
||||
}
|
||||
}),
|
||||
|
||||
offset: $.num.optional.min(0).note({
|
||||
default: 0,
|
||||
desc: {
|
||||
ja: 'オフセット'
|
||||
}
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export default (params: any) => new Promise(async (res, rej) => {
|
||||
const [ps, psErr] = getParams(meta, params);
|
||||
if (psErr) throw psErr;
|
||||
|
||||
const hashtags = await Hashtag
|
||||
.find({
|
||||
tag: new RegExp('^' + escapeRegexp(ps.query.toLowerCase()))
|
||||
}, {
|
||||
sort: {
|
||||
count: -1
|
||||
},
|
||||
limit: ps.limit,
|
||||
skip: ps.offset
|
||||
});
|
||||
|
||||
res(hashtags.map(tag => tag.tag));
|
||||
});
|
||||
@@ -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);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user