Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Mk:api()の第三引数にnullを渡せるように #11871

Closed

Conversation

Sayamame-beans
Copy link
Member

@Sayamame-beans Sayamame-beans commented Sep 22, 2023

What

Mk:api()の第三引数にnullを渡すことが出来るようにしました。
これにより、トークン無しでエンドポイントを叩けるようになり、リモートサーバーのAPIを利用する際に便利です。

Why

Close #11495

Additional info (optional)

AiScript側のutils( https://github.com/syuilo/aiscript/blob/06d9c4f67a5231d06d64654a4647a0047585cf94/src/interpreter/util.ts )でnullを許容したままタイプチェックする方法が無さそうでしたので、とりあえずMisskey側で中身がnullかどうか確認し、nullでない場合には従来通りutils.assertString()が呼び出されるように実装しています。
そのため、実際にはnullを許容するにも関わらず、nullやstring以外の値が渡された場合の例外文はExpect string, but got~となってしまいます。

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@github-actions github-actions bot added the packages/frontend Client side specific issue/PR label Sep 22, 2023
@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.11% 🎉

Comparison is base (c25d663) 78.88% compared to head (a4ee21a) 79.00%.
Report is 3 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #11871      +/-   ##
===========================================
+ Coverage    78.88%   79.00%   +0.11%     
===========================================
  Files          929      930       +1     
  Lines        98280    98344      +64     
  Branches      7823     7849      +26     
===========================================
+ Hits         77530    77696     +166     
+ Misses       20750    20648     -102     

see 15 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sayamame-beans
Copy link
Member Author

Sayamame-beans commented Sep 22, 2023

(未テストです)

@Sayamame-beans Sayamame-beans marked this pull request as ready for review September 22, 2023 19:23
@Sayamame-beans
Copy link
Member Author

動作確認が出来ました

@Sayamame-beans
Copy link
Member Author

#11883 により目的が達成されなくなったのでCloseします。

@Sayamame-beans Sayamame-beans deleted the issue-11495 branch November 28, 2023 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/frontend Client side specific issue/PR
Projects
None yet
1 participant