-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
enhance(misskey-js): miauth checkの型を追加 #14885
Open
kakkokari-gtyih
wants to merge
5
commits into
misskey-dev:develop
Choose a base branch
from
kakkokari-gtyih:fix-add-miauthcheck-ep
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+71
−40
Open
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
99e74cc
fix(misskey-js): miauth checkの型を追加
kakkokari-gtyih 96fe778
Update Changelog
kakkokari-gtyih b328c15
fix user type
kakkokari-gtyih 576e0bc
Update Changelog
kakkokari-gtyih a4e4799
api.jsonに出力されないエンドポイントはoverwriteを介さないように
kakkokari-gtyih File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここ消して治るなら
Overwrite
の検査でtypescriptの回数制限に達した可能性あるかも(よく知らないけどなんか型チェックが一定の複雑度を超えると打ち切りが発生することがあるらしい?よくわからないけど。メモ化とかの都合もあって色々複雑らしいというのを聞いたことがある)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
足してるだけのもの(自動生成で生成されないとわかっているもの)は単に
|
でつなげるようにすればいい?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
その方が良い可能性が高いと思います
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あーでもSwitchCaseResponseTypeの適用はここじゃないのか。場合によっては変わらないかも
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overwriteから出したけど変わらなかった
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SwitchCaseResponseType側をいい感じにする必要がありそうか....
ちょっと調べてみる
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ちょっといろいろ調べた感じ、複雑性は関係なかった。
miauth/${string}/check
が${string}timeline
(timeline testで使われてるタイムラインエンドポイントの表現)とマッチする扱いをtypescript compilerに受けて、戻り値の方がcomponents['schemas']['Note'][] | MiAuthCheckResponse
になる扱いを受けてるっぽいので、miauth/${string}/check
の${string}
をいい感じに変えるといいかもしれないけどmiauthの仕様的には変えられないか。またはテスト側の型の宣言を
('antennas/notes' | 'notes/global-timeline' | 'notes/timeline' | 'notes/hybrid-timeline' | 'notes/local-timeline' | 'roles/notes' | 'notes/search-by-tag' | 'notes/user-list-timeline')
にする事もできる。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.typescriptlang.org/play/?#code/FAMwrgdgxgLglgewgAgE4FMZlRAzgFTgFt0AbOCdAUQgBMAHBCmAOQEMSAKASgC5kABgBIA3rhioKAcwC+AenglylAchHBkaTNhTCRAWTYwAFgDpUbOgiI95ishXQCA3MBnBQkWIhQYsOXH04AEEwEwBhY3QoAGsaBiYIVg50Hn4BIjg2MOM5UXFJCFk5KCjY1XVNPx1BTOyTPIMjMwsrG255UuiYlzcPKCRxZAAjdPyJaTtiBxVkAF4tfzxCJUd4xmZ2Lm5XAbwYZDZ0upzGgsmSsp75kedNOTlkdFRUBFQPGABPenRkdcSYLgbpVkAByGDocQKabKdCg-gABgANBowRDxAAmaGrSjw5DI1GghAmZ5POgbJJ4jEozQAbXQ9GOWVO40KxS65QAuvwAIxI5APZAQBBPF5vQ4HdEwDHIOAgZADIgkJJ9YBfH7IFYzajkgFAhYxdCfBDy-7MIEAMkErIu9lhvUFmk0AD0APzIfqDSWQmAIgD6CP4WthZqS+rBJwaUsu3VBAsez1e7z2Qyl-p5-ENxtNuvNN1Bkdy0Y5MVBnv2yClPIDQZha1zYZu1QCQVCESuoeS23joqTwBT3vE1YzyCzJr+DcBTe0LZCOUi3U7W1S3HLqZ9GP4ndwtOD9YS5s5TwAHhC6ECEch3RIwL9+CA2KRcL8Fjf0LsvZWfQBmLeTnd7pQ25Hugp7oOe+IAD48lelaoLeyD3o+z43G+rhAA
もう少し調べてみたら代入チェックではちゃんと互換性ないと判断されるのに
Container[Key]
では互換性があるって認識されるっぽい。一貫性の無い動作ではある気がするしtypescriptにバグ報告しても良い可能性はあるかも(修正されるかは置いといて)
追記: templete literal typeのintersection typeがneverにならないのがroot causeっぽい気がしました
https://www.typescriptlang.org/play/?#code/GYVwdgxgLglg9mABGApgNxQJwBQEoBcy6WiA3olABaZwDuyIANowNyIC+AUJxAgM5QKKAQFZCAAwC2MAIYgqAegAkpAZhhgA5uwURKKCAGtxiAGSJxKtRu0LYklIw0oTAXiIYcuFpwULEAQEAegD8nEA
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typescriptの方針的に
`miauth/${string}/check` & `${string}timeline`
を never にするかは不透明なので、'antennas/notes' | 'notes/global-timeline' | 'notes/timeline' | 'notes/hybrid-timeline' | 'notes/local-timeline' | 'roles/notes' | 'notes/search-by-tag' | 'notes/user-list-timeline'
に書き換えたほうが良さそう。また、Notesとしてmisskey jsのchangesとして書いておいたほうが良さそう。
keyof Misskey.Endpoints & `${string}timeline`
みたいなのは動かなくなるかもしれないよって