Commit graph

31 commits

Author SHA1 Message Date
syuilo d17298d3b5 fix(test): make chart tests working 2022-06-05 20:37:24 +09:00
Johann150 804fa33535
refactor: improve code quality (#8751)
* remove unnecessary if

`Array.prototype.some` already returns a boolean so an if to return
true or false is completely unnecessary in this case.

* perf: use count instead of find

When using `count` instead of `findOneBy`, the data is not
unnecessarily loaded.

* remove duplicate null check

The variable is checked for null in the lines above and the function
returns if so. Therefore, it can not be null at this point.

* simplify `getJsonSchema`

Because the assigned value is `null` and the used keys are only
shallow, use of `nestedProperty.set` seems inappropriate. Because the
value is not read, the initial for loop can be replaced by a `for..in`
loop.

Since all keys will be assigned `null`, the condition of the ternary
expression in the nested function will always be true. Therefore the
recursion case will never happen. With this the nested function can be
eliminated.

* remove duplicate condition

The code above already checks `dragging` and returns if it is truthy.
Checking it again later is therefore unnecessary.

To make this more obvious the `return` is removed in favour of using
an if...else construct.

* remove impossible "unknown" time

The `ago` variable will always be a number and all non-negative numbers
are already covered by other cases, the negative case is handled with
`future` so there is no case when `unkown` could be achieved.
2022-05-29 15:15:52 +09:00
syuilo 1c67c26bd8
refactor: migrate to typeorm 3.0 (#8443)
* wip

* wip

* wip

* Update following.ts

* wip

* wip

* wip

* Update resolve-user.ts

* maxQueryExecutionTime

* wip

* wip
2022-03-26 15:34:00 +09:00
syuilo b929bffea5 fix federation chart 2022-03-08 22:56:46 +09:00
syuilo 513c83e374 delete needless instance drive columns 2022-03-07 21:20:14 +09:00
syuilo ec64b5ea0b feat: add active to federation chart 2022-03-07 15:10:16 +09:00
syuilo 82f9d5501b fix query error 2022-03-04 18:18:37 +09:00
syuilo 271854e345 enhance(chart): better federation pub/sub calculation 2022-03-04 16:26:10 +09:00
syuilo b67f1287c6 fix federation chart pubsub 2022-03-04 15:32:50 +09:00
syuilo d071d18dd7
refactor: Use ESM (#8358)
* wip

* wip

* fix

* clean up

* Update tsconfig.json

* Update activitypub.ts

* wip
2022-02-27 11:07:39 +09:00
syuilo a28daf7f44 feat: add pub & sub item for federation chart 2022-02-23 16:17:16 +09:00
syuilo 510de87607
refactor: use ajv instead of cafy (#8324)
* wip

* wip

* Update abuse-user-reports.ts

* Update files.ts

* Update list-remote.ts

* Update list.ts

* Update show-users.ts

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update update.ts

* Update search.ts

* Update reactions.ts

* Update search.ts

* wip

* wip

* wip

* wip

* Update update.ts

* Update relation.ts

* Update available.ts

* wip

* wip

* wip

* Update packages/backend/src/server/api/define.ts

Co-authored-by: Johann150 <johann.galle@protonmail.com>

* Update define.ts

* Update define.ts

* typo

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update update.ts

* wip

* Update signup.ts

* Update call.ts

* minimum for limit

* type

* remove needless annotation

* wip

* Update signup.ts

* wip

* wip

* fix

* Update create.ts

Co-authored-by: Johann150 <johann.galle@protonmail.com>
2022-02-19 14:05:32 +09:00
syuilo 0cee1dfbd6 refactor: better getChart result type 2022-02-18 22:29:23 +09:00
syuilo 93cb26e879 refactor: fix types 2022-02-13 12:46:52 +09:00
syuilo 51aad804d6 refactor: fix types 2022-02-13 01:39:58 +09:00
syuilo 0afebcfd9e enhance: improve federation chart 2022-02-10 17:45:12 +09:00
syuilo 3e1de8203d fix(server): チャートのcleanでエラーが出る可能性がある問題を修正 2022-02-09 03:55:49 +09:00
syuilo 12ca0f9a63 fix(server): チャートのresyncでエラーが出る問題を修正
Fix #8274
2022-02-09 03:51:43 +09:00
syuilo 7fcd9435f3 feat: introduce intersection calculation of charts 2022-02-09 03:46:58 +09:00
syuilo f4e28983a1 feat: improve federation chart 2022-02-08 23:43:51 +09:00
syuilo adf3493af8 feat: notes/instance/perUserNotesチャートに添付ファイル付きノートの数を追加 2022-02-08 23:12:37 +09:00
syuilo 1da7be6334 chore: remove unused code 2022-02-08 22:49:44 +09:00
syuilo efe62eb303 fix 2022-02-06 08:39:23 +09:00
syuilo cc7a1808ec imprpve active users chart 2022-02-06 06:24:06 +09:00
syuilo be15c8f437
fix chart clean 2022-02-06 02:16:52 +09:00
syuilo c1b264e4e9
Improve chart engine (#8253)
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update core.ts

* wip

* wip

* #7361

* delete network chart

* federationChart強化 apRequestChart追加

* tweak
2022-02-06 00:13:52 +09:00
tamaina efb0ffc4ec
refactor: APIエンドポイントファイルの定義を良い感じにする (#8154)
* Fix API Schema Error

* Delete SimpleSchema/SimpleObj
and Move schemas to dedicated files

* Userのスキーマを分割してみる

* define packMany type

* add ,

* Ensure enum schema and Make "as const" put once

* test?

* Revert "test?"

This reverts commit 97dc9bfa70851bfb7d1cf38e883f8df20fb78b79.

* Revert "Fix API Schema Error"

This reverts commit 21b6176d974ed8e3eb73723ad21a105c5d297323.

* ✌️

* clean up

* test?

* wip

* wip

* better schema def

* ✌️

* fix

* add minLength property

* wip

* wip

* wip

* anyOf/oneOf/allOfに対応? ~ relation.ts

* refactor!

* Define MinimumSchema

* wip

* wip

* anyOf/oneOf/allOfが動作するようにUnionSchemaTypeを修正

* anyOf/oneOf/allOfが動作するようにUnionSchemaTypeを修正

* Update packages/backend/src/misc/schema.ts

Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>

* fix

* array oneOfをより正確な型に

* array oneOfをより正確な型に

* wip

* ✌️

* なんかもういろいろ

* remove

* very good schema

* api schema

* wip

* refactor: awaitAllの型定義を変えてみる

* fix

* specify types in awaitAll

* specify types in awaitAll

* ✌️

* wip

* ...

* ✌️

* AllowDateはやめておく

* 不必要なoptional: false, nullable: falseを廃止

* Packedが展開されないように

* 続packed

* wip

* define note type

* wip

* UserDetailedをMeDetailedかUserDetailedNotMeかを区別できるように

* wip

* wip

* wip specify user type of other schemas

* ok

* convertSchemaToOpenApiSchemaを改修

* convertSchemaToOpenApiSchemaを改修

* Fix

* fix

* ✌️

* wip

* 分割代入ではなくallOfで定義するように

Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
2022-01-18 22:27:10 +09:00
syuilo 0be4e10462 enhance(backend): improve chart engine 2021-12-14 18:12:37 +09:00
syuilo c69b72e199 fix lint 2021-12-09 23:58:30 +09:00
syuilo b9eaf906e7 fix lint errors 2021-11-12 10:52:10 +09:00
syuilo 0e4a111f81 refactoring
Resolve #7779
2021-11-12 02:02:25 +09:00