Commit Graph

22 Commits

Author SHA1 Message Date
naskya fca48b2a81
refactor (backend): port safe-for-sql, sql-like-escape to backend-rs 2024-04-14 20:29:44 +09:00
naskya 52ebc2d8dc
feat: emoji moderators 2024-02-20 17:41:45 +09:00
ThatOneCalculator 623cadf981
Revert "chore: lint import order"
This reverts commit 8d3c35c0c6.
2023-12-04 23:12:10 -08:00
ThatOneCalculator 8d3c35c0c6
chore: lint import order 2023-11-26 12:33:46 -08:00
naskya adee17b85a
chore: organize backend imports
* remove unused/duplicate imports
* replace paths like "../../../define.js" to be more readable
* add missing @types packages
2023-10-30 18:06:08 +09:00
naskya c7943ca177
.js 2023-05-23 14:07:35 +09:00
MeiMei 910b06c35a
fix: Escape SQL LIKE
* SQL LIKE escape
2023-05-23 13:56:16 +09:00
Namekuji 3ddcffd169
enhance: emoji width and height 2023-05-19 22:26:13 -04:00
naskya 1c0d4546f7 feat: set license information for custom emojis (#9719)
Closes: #9711 (please check this issue first)

I cherry-picked two commits ([1](8ae9d2eaa8), [2](ed51209172)) from [Misskey](https://github.com/misskey-dev/misskey) and made a few changes.
「ライセンス」should be written as "License" in the following screenshots, but it has not yet been translated.

It would be nice if we could include multiple lines of text, but I just ported what's been implemented so far in Misskey not to mess things up.

This is my first pull request (aside from typo correction). Feel free to point out any issues!

![](https://cdn.discordapp.com/attachments/823878222897741868/1086372711841935440/2023-03-18_042011.png)
![](https://cdn.discordapp.com/attachments/823878222897741868/1086373178214981853/01.png)
![](https://cdn.discordapp.com/attachments/823878222897741868/1086373336709341246/2023-03-18_042629.png)

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Co-authored-by: naskya <m@naskya.net>
Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9719
Co-authored-by: naskya <naskya@noreply.codeberg.org>
Co-committed-by: naskya <naskya@noreply.codeberg.org>
2023-03-19 07:22:28 +00:00
ThatOneCalculator abf47e54f3
clean up w/ rome 2023-01-16 11:19:20 -08:00
ThatOneCalculator 7c2dabd047
no more eslint 2023-01-12 20:54:33 -08:00
ThatOneCalculator 6b00abf05c
refactor: 🎨 rome 2023-01-12 20:40:33 -08:00
Johann150 c8935b32f8
fix: validation (better #8456) (#8461)
* Revert "revert 484e023c0"

This reverts commit c03b70c949.

* also allow pure renote

* fix checks for pure renote
2022-04-03 13:57:26 +09:00
syuilo c03b70c949 revert 484e023c0 2022-04-02 16:47:53 +09:00
Johann150 484e023c0c
enhance(doc): required input fields (#8456)
* remove empty file

If the endpoint is to be implemented later, the file can be added back,
but for now it is confusing to have an empty file.

* enhance(doc): document defaults

Default for `isPublic` is based on the database schema default value.
Defaults for `local` and `withFiles` are based on the behaviour of the endpoint.

* enhance(doc): explain nullable emoji category

* fix: make nullable if default is null

* enhance(doc): explain mute attribute expiresAt

* fix: define required fields

- `notes/create`: the default for `text` has been removed because ajv can not handle
  `default` inside of `anyOf`, see
  https://ajv.js.org/guide/modifying-data.html#assigning-defaults
  and the default value cannot be `null` if text is `nullable: false` in the `anyOf`
  first alternative.
- `notes/create`: The `mediaIds` property has been marked as deprecated because it
  has the same behaviour as using `fileIds`, but the implementation tries to handlè
  `fileIds` first.
- The result schema for `admin/emoji/list` has been altered because the `host`
  property will always be `null` as it is filtered this way in the database query.
  See packages/backend/src/server/api/endpoints/admin/emoji/list.ts line 67.

* enhance(doc): explain nullable hostname

* update changelog

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2022-04-02 15:04:36 +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
tamaina fcfb5ef0a3
Fix ajv (#8333)
* wip

* ✌️

* use ajv/dist/core

* revert try

* clean up
2022-02-20 13:15:40 +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
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 97dc9bfa70.

* Revert "Fix API Schema Error"

This reverts commit 21b6176d97.

* ✌️

* 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 4a64280a7c lint 2022-01-03 02:12:50 +09:00
syuilo c69b72e199 fix lint 2021-12-09 23:58:30 +09:00
syuilo 0e4a111f81 refactoring
Resolve #7779
2021-11-12 02:02:25 +09:00
Renamed from src/server/api/endpoints/admin/emoji/list.ts (Browse further)