forked from misskey-dev/misskey
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from team-shahu/feat/schedule-note
feat: 予約投稿の実装
- Loading branch information
Showing
51 changed files
with
1,649 additions
and
31 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* SPDX-FileCopyrightText: syuilo and misskey-project | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
*/ | ||
|
||
export class ScheduleNote1699437894737 { | ||
name = 'ScheduleNote1699437894737' | ||
|
||
async up(queryRunner) { | ||
await queryRunner.query(`CREATE TABLE "note_schedule" ("id" character varying(32) NOT NULL, "note" jsonb NOT NULL, "userId" character varying(260) NOT NULL, "scheduledAt" TIMESTAMP WITH TIME ZONE NOT NULL, CONSTRAINT "PK_3a1ae2db41988f4994268218436" PRIMARY KEY ("id"))`); | ||
await queryRunner.query(`CREATE INDEX "IDX_e798958c40009bf0cdef4f28b5" ON "note_schedule" ("userId") `); | ||
} | ||
|
||
async down(queryRunner) { | ||
await queryRunner.query(`DROP TABLE "note_schedule"`); | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* 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={ | ||
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; | ||
} |
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.