-
-
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
Feat: プラグインのスクリプトとデータを端末間で同期をできるように #12302
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #12302 +/- ##
========================================
Coverage 78.80% 78.81%
========================================
Files 946 947 +1
Lines 102271 102318 +47
Branches 8263 8265 +2
========================================
+ Hits 80596 80637 +41
- Misses 21675 21681 +6 ☔ View full report in Codecov by Sentry. |
このPRによるapi.jsonの差分 差分はこちら--- base
+++ head
@@ -36312,6 +36312,159 @@
}
}
},
+ "/i/registry/remove-all-keys-in-scope": {
+ "post": {
+ "operationId": "i/registry/remove-all-keys-in-scope",
+ "summary": "i/registry/remove-all-keys-in-scope",
+ "description": "No description provided.\n\n**Credential required**: *Yes*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/i/registry/remove-all-keys-in-scope.ts"
+ },
+ "security": [
+ {
+ "ApiKeyAuth": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "scope": {
+ "type": "array",
+ "default": [],
+ "items": {
+ "type": "string",
+ "pattern": "^[a-zA-Z0-9_]+$"
+ }
+ },
+ "domain": {
+ "type": "string",
+ "nullable": true
+ }
+ },
+ "required": [
+ "scope"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "204": {
+ "description": "OK (without any results)"
+ },
+ "400": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INVALID_PARAM": {
+ "value": {
+ "error": {
+ "message": "Invalid param.",
+ "code": "INVALID_PARAM",
+ "id": "3d81ceae-475f-4600-b2a8-2bc116157532"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "CREDENTIAL_REQUIRED": {
+ "value": {
+ "error": {
+ "message": "Credential required.",
+ "code": "CREDENTIAL_REQUIRED",
+ "id": "1384574d-a912-4b81-8601-c7b1c4085df1"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Forbidden error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "AUTHENTICATION_FAILED": {
+ "value": {
+ "error": {
+ "message": "Authentication failed. Please ensure your token is correct.",
+ "code": "AUTHENTICATION_FAILED",
+ "id": "b0a7f5f8-dc2f-4171-b91f-de88ad238e14"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "418": {
+ "description": "I'm Ai",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "I_AM_AI": {
+ "value": {
+ "error": {
+ "message": "You sent a request to Ai-chan, Misskey's showgirl, instead of the server.",
+ "code": "I_AM_AI",
+ "id": "60c46cd1-f23a-46b1-bebe-5d2b73951a84"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "500": {
+ "description": "Internal server error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "INTERNAL_ERROR": {
+ "value": {
+ "error": {
+ "message": "Internal error occurred. Please contact us if the error persists.",
+ "code": "INTERNAL_ERROR",
+ "id": "5d37dbcb-891e-41ca-a3d6-e690c97775ac"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/i/registry/set": {
"post": {
"operationId": "i/registry/set", |
最後の引数はオプションオブジェクトにした方が拡張性が高そう |
プラグインってIDが設定されていたと思うけど、それは使わずにハッシュを新たに生成するのはなぜかしら? |
<2023.11.0時点のコード>
プラグインをインストールするときに生成されるidはuuidで一意性は保証されていますが
|
あー今ってプラグインのID設定必須じゃないのか |
import { $i } from '@/account.js'; | ||
|
||
type ScriptType = 'widget' | 'plugins' | 'flash'; | ||
export type ScriptData = { type: ScriptType; id?: string; fromAccount?: boolean }; |
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.
ScriptDataという名前だとどういうものが入るのか分かりにくいかも
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.
scriptMetadataだと本来のメタデータと被ってしまうのでstorageMetadataとかですかね... storageの保存・読み込みする際に使う情報という意味で
This comment was marked as outdated.
This comment was marked as outdated.
畳まれている部分をめちゃくちゃ見逃しているコメントをしました、良さそう |
プラグインのidが指定されている場合にはそちらを優先するような挙動はさすがに複雑すぎるかしら |
MisskeyHubにプラグインストアができる可能性があるのでユーザー内で完結しない可能性がある ただ、MisskeyHubではそれはそれで別にこのidと同じものを使わなくてもいいので別に問題はないか |
これを考えた初めVSCodeのextension IDみたいなの( |
ただあまりハイフンが入ってるidを入れるのであればscopeのフォーマット制限を緩和させるか、そもそもidにハイフンが入らないようにするかの2択になると思います。(idに区切りとして |
メタデータにidが指定されていればそちらを優先するようにしました🙏 |
やっぱり欲しい気がする |
コンフリ解決も含めて何かもう少し改善できそうな点がありそうなら改善した上でしたいですね もうほぼ半年前のものですし |
What
プラグインのスクリプトと設定、
Mk:load
やMk:save
などの情報を端末間で同期をできるようにしました。また、Mk:load
とMk:save
を端末間で共有するにあたりWidgetとPlayもMk:load
とMk:save
のデータを端末間で共有できるようにしました。Why
resolve #12209, resolve #11919
Additional info (optional)
Checklist