diff options
| author | NoriDev <m1nthing2322@gmail.com> | 2024-10-31 13:52:01 +0900 |
|---|---|---|
| committer | Marie <github@yuugi.dev> | 2024-12-09 05:31:03 +0100 |
| commit | 2528508cff9d8c90abd33e46b15220a49a00e2e2 (patch) | |
| tree | 1a7aa5717656fc29e67eed0f86feb5fec33d8f1e /packages/backend/src/models/NoteSchedule.ts | |
| parent | merge: Implement new SkRateLimiterServer with Leaky Bucket rate limits (resol... (diff) | |
| download | sharkey-2528508cff9d8c90abd33e46b15220a49a00e2e2.tar.gz sharkey-2528508cff9d8c90abd33e46b15220a49a00e2e2.tar.bz2 sharkey-2528508cff9d8c90abd33e46b15220a49a00e2e2.zip | |
feat: 노트 게시를 예약할 수 있음 (yojo-art/cherrypick#483, [Type4ny-Project/Type4ny@271c872c](https://github.com/Type4ny-Project/Type4ny/commit/271c872c97f215ef5d8e0be62251dd422a52e5b1))
Diffstat (limited to 'packages/backend/src/models/NoteSchedule.ts')
| -rw-r--r-- | packages/backend/src/models/NoteSchedule.ts | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/packages/backend/src/models/NoteSchedule.ts b/packages/backend/src/models/NoteSchedule.ts new file mode 100644 index 0000000000..97ffe32ffa --- /dev/null +++ b/packages/backend/src/models/NoteSchedule.ts @@ -0,0 +1,60 @@ +/* + * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { Entity, Index, Column, PrimaryColumn } from 'typeorm'; +import { MiNote } from '@/models/Note.js'; +import { id } from './util/id.js'; +import { MiUser } from './User.js'; +import { MiChannel } from './Channel.js'; +import type { MiDriveFile } from './DriveFile.js'; + +type MinimumUser = { + id: MiUser['id']; + host: MiUser['host']; + username: MiUser['username']; + uri: MiUser['uri']; +}; + +export type MiScheduleNoteType={ + /** Date.toISOString() */ + createdAt: string; + visibility: 'public' | 'home' | 'followers' | 'specified'; + visibleUsers: MinimumUser[]; + channel?: MiChannel['id']; + poll: { + multiple: boolean; + choices: string[]; + /** Date.toISOString() */ + expiresAt: string | null + } | undefined; + renote?: MiNote['id']; + localOnly: boolean; + cw?: string | null; + reactionAcceptance: 'likeOnly' | 'likeOnlyForRemote' | 'nonSensitiveOnly' | 'nonSensitiveOnlyForLocalLikeOnlyForRemote' | null; + files: MiDriveFile['id'][]; + text?: string | null; + reply?: MiNote['id']; + apMentions?: MinimumUser[] | null; + apHashtags?: string[] | null; + apEmojis?: string[] | null; +} + +@Entity('note_schedule') +export class MiNoteSchedule { + @PrimaryColumn(id()) + public id: string; + + @Column('jsonb') + public note: MiScheduleNoteType; + + @Index() + @Column('varchar', { + length: 260, + }) + public userId: MiUser['id']; + + @Column('timestamp with time zone') + public scheduledAt: Date; +} |