-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: 予約投稿 #12265
Feat: 予約投稿 #12265
Conversation
Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
redisに保存するようになってるからredis飛んだときとかがあれかもしれない |
で解決できそう(ついでに予約一覧の表示もやりやすくなるかも?) |
Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
このPRによるapi.jsonの差分 差分はこちら--- base
+++ head
@@ -42983,6 +42983,7 @@
"followRequestAccepted",
"roleAssigned",
"achievementEarned",
+ "noteSchedulingFailed",
"app",
"test",
"pollVote",
@@ -43007,6 +43008,7 @@
"followRequestAccepted",
"roleAssigned",
"achievementEarned",
+ "noteSchedulingFailed",
"app",
"test",
"pollVote",
@@ -43222,6 +43224,7 @@
"followRequestAccepted",
"roleAssigned",
"achievementEarned",
+ "noteSchedulingFailed",
"app",
"test",
"pollVote",
@@ -43246,6 +43249,7 @@
"followRequestAccepted",
"roleAssigned",
"achievementEarned",
+ "noteSchedulingFailed",
"app",
"test",
"pollVote",
@@ -52343,6 +52347,17 @@
"required": [
"choices"
]
+ },
+ "schedule": {
+ "type": [
+ "object",
+ "null"
+ ],
+ "properties": {
+ "scheduledAt": {
+ "type": "string"
+ }
+ }
}
},
"if": {
@@ -52358,6 +52373,9 @@
},
"poll": {
"type": "null"
+ },
+ "schedule": {
+ "type": "null"
}
}
},
@@ -52387,8 +52405,27 @@
"type": "object",
"properties": {
"createdNote": {
- "type": "object",
- "$ref": "#/components/schemas/Note"
+ "type": [
+ "object",
+ "null"
+ ],
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/Note"
+ }
+ ]
+ },
+ "scheduledNoteId": {
+ "type": [
+ "string",
+ "null"
+ ]
+ },
+ "scheduledNote": {
+ "type": [
+ "object",
+ "null"
+ ]
}
},
"required": [
@@ -52505,6 +52542,221 @@
}
}
},
+ "CANNOT_CREATE_ALREADY_EXPIRED_SCHEDULE": {
+ "value": {
+ "error": {
+ "message": "Schedule is already expired.",
+ "code": "CANNOT_CREATE_ALREADY_EXPIRED_SCHEDULE",
+ "id": "8a9bfb90-fc7e-4878-a3e8-d97faaf5fb07"
+ }
+ }
+ },
+ "PLEASE_SPECIFY_SCHEDULE_DATE": {
+ "value": {
+ "error": {
+ "message": "Please specify schedule date.",
+ "code": "PLEASE_SPECIFY_SCHEDULE_DATE",
+ "id": "c93a6ad6-f7e2-4156-a0c2-3d03529e5e0f"
+ }
+ }
+ },
+ "NO_SUCH_SCHEDULE": {
+ "value": {
+ "error": {
+ "message": "No such schedule.",
+ "code": "NO_SUCH_SCHEDULE",
+ "id": "44dee229-8da1-4a61-856d-e3a4bbc12032"
+ }
+ }
+ },
+ "ROLE_PERMISSION_DENIED": {
+ "value": {
+ "error": {
+ "message": "You are not assigned to a required role.",
+ "code": "ROLE_PERMISSION_DENIED",
+ "kind": "permission",
+ "id": "7f86f06f-7e15-4057-8561-f4b6d4ac755a"
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "429": {
+ "description": "To many requests",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "RATE_LIMIT_EXCEEDED": {
+ "value": {
+ "error": {
+ "message": "Rate limit exceeded. Please try again later.",
+ "code": "RATE_LIMIT_EXCEEDED",
+ "id": "d5826d14-3982-4d2e-8011-b9e9f02499ef"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/notes/schedule/delete": {
+ "post": {
+ "operationId": "notes/schedule/delete",
+ "summary": "notes/schedule/delete",
+ "description": "No description provided.\n\n**Credential required**: *Yes* / **Permission**: *write:notes*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/notes/schedule/delete.ts"
+ },
+ "tags": [
+ "notes"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "scheduledNoteId": {
+ "type": "string",
+ "format": "misskey:id"
+ }
+ },
+ "required": [
+ "scheduledNoteId"
+ ]
+ }
+ }
+ }
+ },
+ "responses": {
+ "204": {
+ "description": "OK (without any results)"
+ },
+ "400": {
+ "description": "Client error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Error"
+ },
+ "examples": {
+ "NO_SUCH_NOTE": {
+ "value": {
+ "error": {
+ "message": "No such note.",
+ "code": "NO_SUCH_NOTE",
+ "id": "490be23f-8c1f-4796-819f-94cb4f9d1630"
+ }
+ }
+ },
"INVALID_PARAM": {
"value": {
"error": {
@@ -52626,6 +52878,171 @@
}
}
},
+ "/notes/schedule/list": {
+ "post": {
+ "operationId": "notes/schedule/list",
+ "summary": "notes/schedule/list",
+ "description": "No description provided.\n\n**Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.\n**Credential required**: *Yes* / **Permission**: *read:notes*",
+ "externalDocs": {
+ "description": "Source code",
+ "url": "https://github.com/misskey-dev/misskey/blob/develop/packages/backend/src/server/api/endpoints/notes/schedule/list.ts"
+ },
+ "tags": [
+ "notes"
+ ],
+ "security": [
+ {
+ "bearerAuth": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "sinceId": {
+ "type": "string",
+ "format": "misskey:id"
+ },
+ "untilId": {
+ "type": "string",
+ "format": "misskey:id"
+ },
+ "limit": {
+ "type": "integer",
+ "minimum": 1,
+ "maximum": 100,
+ "default": 10
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "OK (with results)",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ }
+ }
+ }
+ }
+ },
+ "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"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
"/notes/delete": {
"post": {
"operationId": "notes/delete",
@@ -76106,6 +76523,9 @@
"canPublicNote": {
"type": "boolean"
},
+ "canScheduleNote": {
+ "type": "boolean"
+ },
"canInvite": {
"type": "boolean"
},
@@ -76174,6 +76594,7 @@
"gtlAvailable",
"ltlAvailable",
"canPublicNote",
+ "canScheduleNote",
"canInvite",
"inviteLimit",
"inviteLimitCycle", |
packages/backend/src/queue/processors/ScheduleNotePostProcessorService.ts
Outdated
Show resolved
Hide resolved
dbに投稿内容を保存するようにした Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
UI周りちょっと見てみてもいいですか? |
やろうとしてること
|
Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
そこ周り少し変更加えたので一回pushします |
(やったけど変なところにpushしてしまったので少々お待ちください) |
くらいかなと |
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.
NoteSchedule --> ScheduledNote
(一括置換)
あーノートというよりスケジュール自体だからいいのか? |
packages/backend/src/server/api/endpoints/notes/schedule/create.ts
Outdated
Show resolved
Hide resolved
…into schedule-note
This reverts commit e2f51e4.
Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
packages/backend/src/queue/processors/ScheduleNotePostProcessorService.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
|
Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
ありがとうございます🙏 |
いけた(ので動作確認だけしたらreadyにできそう) |
submoduleのdiffだけ取っ払いたい |
import { id } from './util/id.js'; | ||
import { MiUser } from './User.js'; | ||
|
||
@Entity('note_schedule') |
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.
クラス名と一致してないわね
What
予約投稿が追加されます。
作業中です。
Why
予約投稿がないと不便だという意見もみられるため?
Additional info (optional)
Checklist