diff --git a/packages/backend/src/server/api/EndpointsModule.ts b/packages/backend/src/server/api/EndpointsModule.ts index 5c89606051..61dd7a70de 100644 --- a/packages/backend/src/server/api/EndpointsModule.ts +++ b/packages/backend/src/server/api/EndpointsModule.ts @@ -285,11 +285,11 @@ import * as ep___notes_children from './endpoints/notes/children.js'; import * as ep___notes_clips from './endpoints/notes/clips.js'; import * as ep___notes_conversation from './endpoints/notes/conversation.js'; import * as ep___notes_create from './endpoints/notes/create.js'; -import * as ep___notes_schedule_create from './endpoints/notes/create-schedule.js'; -import * as ep___notes_schedule_list from './endpoints/notes/list-schedule.js'; +import * as ep___notes_schedule_create from './endpoints/notes/schedule/create.js'; +import * as ep___notes_schedule_list from './endpoints/notes/schedule/list.js'; +import * as ep___notes_schedule_delete from './endpoints/notes/schedule/delete.js'; import * as ep___notes_delete from './endpoints/notes/delete.js'; import * as ep___notes_update from './endpoints/notes/update.js'; -import * as ep___notes_schedule_delete from './endpoints/notes/delete-schedule.js'; import * as ep___notes_favorites_create from './endpoints/notes/favorites/create.js'; import * as ep___notes_favorites_delete from './endpoints/notes/favorites/delete.js'; import * as ep___notes_featured from './endpoints/notes/featured.js'; @@ -698,11 +698,11 @@ const $notes_children: Provider = { provide: 'ep:notes/children', useClass: ep__ const $notes_clips: Provider = { provide: 'ep:notes/clips', useClass: ep___notes_clips.default }; const $notes_conversation: Provider = { provide: 'ep:notes/conversation', useClass: ep___notes_conversation.default }; const $notes_create: Provider = { provide: 'ep:notes/create', useClass: ep___notes_create.default }; -const $notes_schedule_create: Provider = { provide: 'ep:notes/create-schedule', useClass: ep___notes_schedule_create.default }; -const $notes_schedule_list: Provider = { provide: 'ep:notes/list-schedule', useClass: ep___notes_schedule_list.default }; +const $notes_schedule_create: Provider = { provide: 'ep:notes/schedule/create', useClass: ep___notes_schedule_create.default }; +const $notes_schedule_list: Provider = { provide: 'ep:notes/schedule/list', useClass: ep___notes_schedule_list.default }; +const $notes_schedule_delete: Provider = { provide: 'ep:notes/schedule/delete', useClass: ep___notes_schedule_delete.default }; const $notes_delete: Provider = { provide: 'ep:notes/delete', useClass: ep___notes_delete.default }; const $notes_update: Provider = { provide: 'ep:notes/update', useClass: ep___notes_update.default }; -const $notes_schedule_delete: Provider = { provide: 'ep:notes/delete-schedule', useClass: ep___notes_schedule_delete.default }; const $notes_favorites_create: Provider = { provide: 'ep:notes/favorites/create', useClass: ep___notes_favorites_create.default }; const $notes_favorites_delete: Provider = { provide: 'ep:notes/favorites/delete', useClass: ep___notes_favorites_delete.default }; const $notes_featured: Provider = { provide: 'ep:notes/featured', useClass: ep___notes_featured.default }; diff --git a/packages/backend/src/server/api/endpoints.ts b/packages/backend/src/server/api/endpoints.ts index 12e3a29fbb..31653f37e3 100644 --- a/packages/backend/src/server/api/endpoints.ts +++ b/packages/backend/src/server/api/endpoints.ts @@ -290,11 +290,11 @@ import * as ep___notes_children from './endpoints/notes/children.js'; import * as ep___notes_clips from './endpoints/notes/clips.js'; import * as ep___notes_conversation from './endpoints/notes/conversation.js'; import * as ep___notes_create from './endpoints/notes/create.js'; -import * as ep___notes_schedule_create from './endpoints/notes/create-schedule.js'; -import * as ep___notes_schedule_list from './endpoints/notes/list-schedule.js'; +import * as ep___notes_schedule_create from './endpoints/notes/schedule/create.js'; +import * as ep___notes_schedule_list from './endpoints/notes/schedule/list.js'; +import * as ep___notes_schedule_delete from './endpoints/notes/schedule/delete.js'; import * as ep___notes_delete from './endpoints/notes/delete.js'; import * as ep___notes_update from './endpoints/notes/update.js'; -import * as ep___notes_schedule_delete from './endpoints/notes/delete-schedule.js'; import * as ep___notes_favorites_create from './endpoints/notes/favorites/create.js'; import * as ep___notes_favorites_delete from './endpoints/notes/favorites/delete.js'; import * as ep___notes_featured from './endpoints/notes/featured.js'; @@ -701,11 +701,11 @@ const eps = [ ['notes/clips', ep___notes_clips], ['notes/conversation', ep___notes_conversation], ['notes/create', ep___notes_create], - ['notes/create-schedule', ep___notes_schedule_create], - ['notes/list-schedule', ep___notes_schedule_list], + ['notes/schedule/create', ep___notes_schedule_create], + ['notes/schedule/list', ep___notes_schedule_list], + ['notes/schedule/delete', ep___notes_schedule_delete], ['notes/delete', ep___notes_delete], ['notes/update', ep___notes_update], - ['notes/delete-schedule', ep___notes_schedule_delete], ['notes/favorites/create', ep___notes_favorites_create], ['notes/favorites/delete', ep___notes_favorites_delete], ['notes/featured', ep___notes_featured], diff --git a/packages/backend/src/server/api/endpoints/notes/create-schedule.ts b/packages/backend/src/server/api/endpoints/notes/schedule/create.ts similarity index 99% rename from packages/backend/src/server/api/endpoints/notes/create-schedule.ts rename to packages/backend/src/server/api/endpoints/notes/schedule/create.ts index 9c7418e6b7..15f313458d 100644 --- a/packages/backend/src/server/api/endpoints/notes/create-schedule.ts +++ b/packages/backend/src/server/api/endpoints/notes/schedule/create.ts @@ -27,7 +27,7 @@ import { DI } from '@/di-symbols.js'; import { QueueService } from '@/core/QueueService.js'; import { MiNoteSchedule } from '@/models/_.js'; import { IdService } from '@/core/IdService.js'; -import { ApiError } from '../../error.js'; +import { ApiError } from '../../../error.js'; export const meta = { tags: ['notes'], diff --git a/packages/backend/src/server/api/endpoints/notes/delete-schedule.ts b/packages/backend/src/server/api/endpoints/notes/schedule/delete.ts similarity index 98% rename from packages/backend/src/server/api/endpoints/notes/delete-schedule.ts rename to packages/backend/src/server/api/endpoints/notes/schedule/delete.ts index f9398576d3..bcc05bb84d 100644 --- a/packages/backend/src/server/api/endpoints/notes/delete-schedule.ts +++ b/packages/backend/src/server/api/endpoints/notes/schedule/delete.ts @@ -13,6 +13,7 @@ export const meta = { tags: ['notes'], requireCredential: true, + kind: 'write:notes', limit: { duration: ms('1hour'), diff --git a/packages/backend/src/server/api/endpoints/notes/list-schedule.ts b/packages/backend/src/server/api/endpoints/notes/schedule/list.ts similarity index 100% rename from packages/backend/src/server/api/endpoints/notes/list-schedule.ts rename to packages/backend/src/server/api/endpoints/notes/schedule/list.ts diff --git a/packages/cherrypick-js/etc/cherrypick-js.api.md b/packages/cherrypick-js/etc/cherrypick-js.api.md index 9470b7cade..23c8b0ec07 100644 --- a/packages/cherrypick-js/etc/cherrypick-js.api.md +++ b/packages/cherrypick-js/etc/cherrypick-js.api.md @@ -1609,12 +1609,12 @@ declare namespace entities { NotesConversationResponse, NotesCreateRequest, NotesCreateResponse, - NotesCreateScheduleRequest, - NotesListScheduleRequest, - NotesListScheduleResponse, + NotesScheduleCreateRequest, + NotesScheduleListRequest, + NotesScheduleListResponse, + NotesScheduleDeleteRequest, NotesDeleteRequest, NotesUpdateRequest, - NotesDeleteScheduleRequest, NotesFavoritesCreateRequest, NotesFavoritesDeleteRequest, NotesFeaturedRequest, @@ -2671,15 +2671,9 @@ type NotesCreateRequest = operations['notes___create']['requestBody']['content'] // @public (undocumented) type NotesCreateResponse = operations['notes___create']['responses']['200']['content']['application/json']; -// @public (undocumented) -type NotesCreateScheduleRequest = operations['notes___create-schedule']['requestBody']['content']['application/json']; - // @public (undocumented) type NotesDeleteRequest = operations['notes___delete']['requestBody']['content']['application/json']; -// @public (undocumented) -type NotesDeleteScheduleRequest = operations['notes___delete-schedule']['requestBody']['content']['application/json']; - // @public (undocumented) type NotesEventsSearchRequest = operations['notes___events___search']['requestBody']['content']['application/json']; @@ -2710,12 +2704,6 @@ type NotesHybridTimelineRequest = operations['notes___hybrid-timeline']['request // @public (undocumented) type NotesHybridTimelineResponse = operations['notes___hybrid-timeline']['responses']['200']['content']['application/json']; -// @public (undocumented) -type NotesListScheduleRequest = operations['notes___list-schedule']['requestBody']['content']['application/json']; - -// @public (undocumented) -type NotesListScheduleResponse = operations['notes___list-schedule']['responses']['200']['content']['application/json']; - // @public (undocumented) type NotesLocalTimelineRequest = operations['notes___local-timeline']['requestBody']['content']['application/json']; @@ -2767,6 +2755,18 @@ type NotesRequest = operations['notes']['requestBody']['content']['application/j // @public (undocumented) type NotesResponse = operations['notes']['responses']['200']['content']['application/json']; +// @public (undocumented) +type NotesScheduleCreateRequest = operations['notes___schedule___create']['requestBody']['content']['application/json']; + +// @public (undocumented) +type NotesScheduleDeleteRequest = operations['notes___schedule___delete']['requestBody']['content']['application/json']; + +// @public (undocumented) +type NotesScheduleListRequest = operations['notes___schedule___list']['requestBody']['content']['application/json']; + +// @public (undocumented) +type NotesScheduleListResponse = operations['notes___schedule___list']['responses']['200']['content']['application/json']; + // @public (undocumented) type NotesSearchByTagRequest = operations['notes___search-by-tag']['requestBody']['content']['application/json']; diff --git a/packages/cherrypick-js/src/autogen/apiClientJSDoc.ts b/packages/cherrypick-js/src/autogen/apiClientJSDoc.ts index 3028d67f71..f6ea02e21b 100644 --- a/packages/cherrypick-js/src/autogen/apiClientJSDoc.ts +++ b/packages/cherrypick-js/src/autogen/apiClientJSDoc.ts @@ -3116,7 +3116,7 @@ declare module '../api.js' { * * **Credential required**: *Yes* / **Permission**: *write:notes* */ - request( + request( endpoint: E, params: P, credential?: string | null, @@ -3127,7 +3127,7 @@ declare module '../api.js' { * * **Credential required**: *Yes* / **Permission**: *read:account* */ - request( + request( endpoint: E, params: P, credential?: string | null, @@ -3136,9 +3136,9 @@ declare module '../api.js' { /** * No description provided. * - * **Credential required**: *Yes* / **Permission**: *write:notes* + * **Credential required**: *Yes* */ - request( + request( endpoint: E, params: P, credential?: string | null, @@ -3149,7 +3149,7 @@ declare module '../api.js' { * * **Credential required**: *Yes* / **Permission**: *write:notes* */ - request( + request( endpoint: E, params: P, credential?: string | null, @@ -3158,9 +3158,9 @@ declare module '../api.js' { /** * No description provided. * - * **Credential required**: *Yes* + * **Credential required**: *Yes* / **Permission**: *write:notes* */ - request( + request( endpoint: E, params: P, credential?: string | null, diff --git a/packages/cherrypick-js/src/autogen/endpoint.ts b/packages/cherrypick-js/src/autogen/endpoint.ts index 88efd0f4d0..1f4e3aa5df 100644 --- a/packages/cherrypick-js/src/autogen/endpoint.ts +++ b/packages/cherrypick-js/src/autogen/endpoint.ts @@ -413,12 +413,12 @@ import type { NotesConversationResponse, NotesCreateRequest, NotesCreateResponse, - NotesCreateScheduleRequest, - NotesListScheduleRequest, - NotesListScheduleResponse, + NotesScheduleCreateRequest, + NotesScheduleListRequest, + NotesScheduleListResponse, + NotesScheduleDeleteRequest, NotesDeleteRequest, NotesUpdateRequest, - NotesDeleteScheduleRequest, NotesFavoritesCreateRequest, NotesFavoritesDeleteRequest, NotesFeaturedRequest, @@ -891,11 +891,11 @@ export type Endpoints = { 'notes/clips': { req: NotesClipsRequest; res: NotesClipsResponse }; 'notes/conversation': { req: NotesConversationRequest; res: NotesConversationResponse }; 'notes/create': { req: NotesCreateRequest; res: NotesCreateResponse }; - 'notes/create-schedule': { req: NotesCreateScheduleRequest; res: EmptyResponse }; - 'notes/list-schedule': { req: NotesListScheduleRequest; res: NotesListScheduleResponse }; + 'notes/schedule/create': { req: NotesScheduleCreateRequest; res: EmptyResponse }; + 'notes/schedule/list': { req: NotesScheduleListRequest; res: NotesScheduleListResponse }; + 'notes/schedule/delete': { req: NotesScheduleDeleteRequest; res: EmptyResponse }; 'notes/delete': { req: NotesDeleteRequest; res: EmptyResponse }; 'notes/update': { req: NotesUpdateRequest; res: EmptyResponse }; - 'notes/delete-schedule': { req: NotesDeleteScheduleRequest; res: EmptyResponse }; 'notes/favorites/create': { req: NotesFavoritesCreateRequest; res: EmptyResponse }; 'notes/favorites/delete': { req: NotesFavoritesDeleteRequest; res: EmptyResponse }; 'notes/featured': { req: NotesFeaturedRequest; res: NotesFeaturedResponse }; @@ -1303,11 +1303,11 @@ export const endpointReqTypes: Record(); async function deleteScheduleNote() { - await os.apiWithDialog('notes/delete-schedule', { noteId: props.note.id }) + await os.apiWithDialog('notes/schedule/delete', { noteId: props.note.id }) .then(() => { isDeleted.value = true; }); } async function editScheduleNote() { - await misskeyApi('notes/delete-schedule', { noteId: props.note.id }) + await misskeyApi('notes/schedule/delete', { noteId: props.note.id }) .then(() => { isDeleted.value = true; }); diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 83fa076e3a..b07385e74a 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -834,7 +834,7 @@ async function post(ev?: MouseEvent) { } posting.value = true; - misskeyApi(props.updateMode ? 'notes/update' : (postData.schedule ? 'notes/create-schedule' : 'notes/create'), postData, token).then(() => { + misskeyApi(props.updateMode ? 'notes/update' : (postData.schedule ? 'notes/schedule/create' : 'notes/create'), postData, token).then(() => { if (props.freezeAfterPosted) { posted.value = true; } else { diff --git a/packages/frontend/src/components/MkSchedulePostListDialog.vue b/packages/frontend/src/components/MkSchedulePostListDialog.vue index 5ad15f06e2..efa1e07f55 100644 --- a/packages/frontend/src/components/MkSchedulePostListDialog.vue +++ b/packages/frontend/src/components/MkSchedulePostListDialog.vue @@ -50,7 +50,7 @@ const cancel = () => { }; const paginationEl = ref(); const pagination: Paging = { - endpoint: 'notes/list-schedule', + endpoint: 'notes/schedule/list', limit: 10, };