Merge branch 'develop' into sw-notification-action

This commit is contained in:
tamaina 2021-06-29 22:45:12 +09:00
commit a1c45e85cf
332 changed files with 1385 additions and 3411 deletions

View file

@ -5,6 +5,8 @@ import { ApiError } from './error';
import { SchemaType } from '@/misc/schema';
import { AccessToken } from '../../models/entities/access-token';
type NonOptional<T> = T extends undefined ? never : T;
type SimpleUserInfo = {
id: ILocalUser['id'];
host: ILocalUser['host'];
@ -17,11 +19,12 @@ type SimpleUserInfo = {
isSilenced: ILocalUser['isSilenced'];
};
// TODO: defaultが設定されている場合はその型も考慮する
type Params<T extends IEndpointMeta> = {
[P in keyof T['params']]: NonNullable<T['params']>[P]['transform'] extends Function
? ReturnType<NonNullable<T['params']>[P]['transform']>
: ReturnType<NonNullable<T['params']>[P]['validator']['get']>[0];
: NonNullable<T['params']>[P]['default'] extends null | number | string
? NonOptional<ReturnType<NonNullable<T['params']>[P]['validator']['get']>[0]>
: ReturnType<NonNullable<T['params']>[P]['validator']['get']>[0];
};
export type Response = Record<string, any> | void;

View file

@ -8,15 +8,12 @@ export type Param = {
transform?: any;
default?: any;
deprecated?: boolean;
desc?: { [key: string]: string };
ref?: string;
};
export interface IEndpointMeta {
stability?: string; //'deprecated' | 'experimental' | 'stable';
desc?: { [key: string]: string };
tags?: string[];
params?: {

View file

@ -5,11 +5,6 @@ import { AbuseUserReports } from '../../../../models';
import { makePaginationQuery } from '../../common/make-pagination-query';
export const meta = {
desc: {
'ja-JP': '通報一覧を表示します。',
'en-US': 'Show list of abuse user reports.'
},
tags: ['admin'],
requireCredential: true as const,
@ -64,43 +59,36 @@ export const meta = {
type: 'string' as const,
nullable: false as const, optional: false as const,
format: 'id',
description: 'The unique identifier for this User.',
example: 'xxxxxxxxxx',
},
createdAt: {
type: 'string' as const,
nullable: false as const, optional: false as const,
format: 'date-time',
description: 'The date that the abuse user report was created on Misskey.'
},
comment: {
type: 'string' as const,
nullable: false as const, optional: false as const,
description: 'The content of the report.',
},
resolved: {
type: 'boolean' as const,
nullable: false as const, optional: false as const,
description: 'Returns whether this report has been resolved',
example: false
},
reporterId: {
type: 'string' as const,
nullable: false as const, optional: false as const,
format: 'id',
description: 'Reporter\'s user ID.'
},
targetUserId: {
type: 'string' as const,
nullable: false as const, optional: false as const,
format: 'id',
description: 'User ID of the person to be reported.'
},
assigneeId: {
type: 'string' as const,
nullable: true as const, optional: false as const,
format: 'id',
description: 'User ID of the person who responded to the report.'
},
reporter: {
type: 'object' as const,

View file

@ -3,11 +3,6 @@ import { Users } from '../../../../../models';
import { signup } from '../../../common/signup';
export const meta = {
desc: {
'ja-JP': 'アカウントを作成します。',
'en-US': 'Create a account.'
},
tags: ['admin'],
params: {
@ -28,7 +23,6 @@ export const meta = {
token: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Token to access this user.'
}
}
}

View file

@ -4,11 +4,6 @@ import { Announcements } from '../../../../../models';
import { genId } from '@/misc/gen-id';
export const meta = {
desc: {
'ja-JP': 'アナウンスを作成します。',
'en-US': 'Create a announcement.'
},
tags: ['admin'],
requireCredential: true as const,
@ -34,35 +29,29 @@ export const meta = {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id',
description: 'The unique identifier for this Announcement.',
example: 'xxxxxxxxxx',
},
createdAt: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'date-time',
description: 'The date that the Announcement was created.'
},
updatedAt: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'date-time',
description: 'The date that the Announcement was updated.'
},
title: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Announcement title.'
},
text: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Announcement text.'
},
imageUrl: {
type: 'string' as const,
optional: false as const, nullable: true as const,
description: 'Announcement image.'
}
}
}

View file

@ -10,11 +10,6 @@ export const meta = {
requireCredential: true as const,
requireModerator: true,
desc: {
'ja-JP': 'アナウンスを削除します。',
'en-US': 'Delete a announcement.'
},
params: {
id: {
validator: $.type(ID)

View file

@ -5,11 +5,6 @@ import { Announcements, AnnouncementReads } from '../../../../../models';
import { makePaginationQuery } from '../../../common/make-pagination-query';
export const meta = {
desc: {
'ja-JP': 'アナウンスのリストを表示します。',
'en-US': 'List announcements.'
},
tags: ['admin'],
requireCredential: true as const,
@ -41,40 +36,33 @@ export const meta = {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id',
description: 'The unique identifier for this Announcement.',
example: 'xxxxxxxxxx',
},
createdAt: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'date-time',
description: 'The date that the Announcement was created.'
},
updatedAt: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'date-time',
description: 'The date that the Announcement was updated.'
},
text: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Announcement text.'
},
title: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Announcement title.'
},
imageUrl: {
type: 'string' as const,
optional: false as const, nullable: true as const,
description: 'Announcement image.'
},
reads: {
type: 'number' as const,
optional: false as const, nullable: false as const,
description: 'Number of people who read this announcement.'
}
}
}

View file

@ -5,11 +5,6 @@ import { Announcements } from '../../../../../models';
import { ApiError } from '../../../error';
export const meta = {
desc: {
'ja-JP': 'アナウンスの内容を変更します。',
'en-US': 'Update a annoucement.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -5,11 +5,6 @@ import { DriveFiles } from '../../../../models';
import { ID } from '@/misc/cafy-id';
export const meta = {
desc: {
'ja-JP': '対象のユーザーのファイルを全て削除します。',
'en-US': 'Delete all files to specified user.'
},
tags: ['admin'],
requireCredential: true as const,
@ -18,10 +13,6 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーID',
'en-US': 'The user ID which you want to suspend'
}
},
}
};

View file

@ -2,11 +2,6 @@ import define from '../../define';
import { Logs } from '../../../../models';
export const meta = {
desc: {
'ja-JP': 'ログを全て削除します。',
'en-US': 'Delete all logs.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -2,11 +2,6 @@ import define from '../../../define';
import { createCleanRemoteFilesJob } from '../../../../../queue';
export const meta = {
desc: {
'ja-JP': 'キャッシュされたリモートファイルをすべて削除します。',
'en-US': 'Deletes all cached remote files.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -4,11 +4,6 @@ import { deleteFile } from '../../../../../services/drive/delete-file';
import { DriveFiles } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': '使用されていないユーザーのファイルを削除します。',
'en-US': 'Delete the unused user\'s files.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -5,11 +5,6 @@ import { makePaginationQuery } from '../../../common/make-pagination-query';
import { ID } from '@/misc/cafy-id';
export const meta = {
desc: {
'ja-JP': '管理用のドライブの一覧を表示します。',
'en-US': 'Displays a list of management drives.'
},
tags: ['admin'],
requireCredential: false as const,

View file

@ -36,20 +36,17 @@ export const meta = {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id',
description: 'The unique identifier for this Drive file.',
example: 'xxxxxxxxxx',
},
createdAt: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'date-time',
description: 'The date that the Drive file was created on Misskey.'
},
userId: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'id',
description: 'Owner ID of this Drive file.',
example: 'xxxxxxxxxx',
},
userHost: {
@ -60,25 +57,21 @@ export const meta = {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'md5',
description: 'The MD5 hash of this Drive file.',
example: '15eca7fba0480996e2245f5185bf39f2'
},
name: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'The file name with extension.',
example: 'lenna.jpg'
},
type: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'The MIME type of this Drive file.',
example: 'image/jpeg'
},
size: {
type: 'number' as const,
optional: false as const, nullable: false as const,
description: 'The size of this Drive file. (bytes)',
example: 51469
},
comment: {
@ -113,41 +106,34 @@ export const meta = {
storedInternal: {
type: 'boolean' as const,
optional: false as const, nullable: true as const,
description: 'Indicates whether this file is stored in the same location as Misskey itself',
example: true
},
url: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'url',
description: 'The URL of this Drive file.',
},
thumbnailUrl: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'url',
description: 'The thumbnail URL of this Drive file.',
},
webpublicUrl: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'url',
description: 'The public URL of this Drive file.',
},
accessKey: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Access key to access this file'
},
thumbnailAccessKey: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Access key to access this file for thumbnail'
},
webpublicAccessKey: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Access key to access this file for webpublic'
},
uri: {
type: 'string' as const,
@ -161,13 +147,11 @@ export const meta = {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'id',
description: 'The parent folder ID of this Drive file.',
example: 'xxxxxxxxxx',
},
isSensitive: {
type: 'boolean' as const,
optional: false as const, nullable: false as const,
description: 'Whether this Drive file is sensitive.',
},
isLink: {
type: 'boolean' as const,

View file

@ -10,10 +10,6 @@ import rndstr from 'rndstr';
import { publishBroadcastStream } from '../../../../../services/stream';
export const meta = {
desc: {
'ja-JP': 'カスタム絵文字を追加します。'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -7,13 +7,9 @@ import { ApiError } from '../../../error';
import { DriveFile } from '../../../../../models/entities/drive-file';
import { ID } from '@/misc/cafy-id';
import uploadFromUrl from '../../../../../services/drive/upload-from-url';
import { publishBroadcastStream } from '@/services/stream';
export const meta = {
desc: {
'ja-JP': '選択したカスタム絵文字をコピーします。',
'en-US': 'Copies the selected custom emoji.'
},
tags: ['admin'],
requireCredential: true as const,
@ -41,7 +37,6 @@ export const meta = {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id',
description: 'New copied emoji ID'
}
}
}
@ -63,7 +58,7 @@ export default define(meta, async (ps, me) => {
throw new ApiError();
}
const copied = await Emojis.save({
const copied = await Emojis.insert({
id: genId(),
updatedAt: new Date(),
name: emoji.name,
@ -72,10 +67,14 @@ export default define(meta, async (ps, me) => {
url: driveFile.url,
type: driveFile.type,
fileId: driveFile.id,
});
}).then(x => Emojis.findOneOrFail(x.identifiers[0]));
await getConnection().queryResultCache!.remove(['meta_emojis']);
publishBroadcastStream('emojiAdded', {
emoji: await Emojis.pack(copied.id)
});
return {
id: copied.id
};

View file

@ -6,11 +6,6 @@ import { makePaginationQuery } from '../../../common/make-pagination-query';
import { ID } from '@/misc/cafy-id';
export const meta = {
desc: {
'ja-JP': 'リモートのカスタム絵文字一覧を取得します。',
'en-US': 'Gets a list of remote custom emojis.'
},
tags: ['admin'],
requireCredential: true as const,
@ -19,12 +14,12 @@ export const meta = {
params: {
query: {
validator: $.optional.nullable.str,
default: null as any
default: null
},
host: {
validator: $.optional.nullable.str,
default: null as any
default: null
},
limit: {
@ -52,12 +47,10 @@ export const meta = {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id',
description: 'The unique identifier for this Emoji.'
},
aliases: {
type: 'array' as const,
optional: false as const, nullable: false as const,
description: 'List to make it easier to be displayed as a candidate when entering emoji.',
items: {
type: 'string' as const,
optional: false as const, nullable: false as const
@ -66,22 +59,18 @@ export const meta = {
name: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Official name of custom emoji.'
},
category: {
type: 'string' as const,
optional: false as const, nullable: true as const,
description: 'Names categorized in the emoji list.'
},
host: {
type: 'string' as const,
optional: false as const, nullable: true as const,
description: 'If it is another server, the FQDN will be returned here.'
},
url: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Image URL of emoji.'
}
}
}

View file

@ -6,11 +6,6 @@ import { ID } from '@/misc/cafy-id';
import { Emoji } from '../../../../../models/entities/emoji';
export const meta = {
desc: {
'ja-JP': 'カスタム絵文字一覧を取得します。',
'en-US': 'List custom emojis.'
},
tags: ['admin'],
requireCredential: true as const,
@ -19,7 +14,7 @@ export const meta = {
params: {
query: {
validator: $.optional.nullable.str,
default: null as any
default: null
},
limit: {
@ -47,12 +42,10 @@ export const meta = {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id',
description: 'The unique identifier for this Emoji.'
},
aliases: {
type: 'array' as const,
optional: false as const, nullable: false as const,
description: 'List to make it easier to be displayed as a candidate when entering emoji.',
items: {
type: 'string' as const,
optional: false as const, nullable: false as const
@ -61,22 +54,18 @@ export const meta = {
name: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Official name of custom emoji.'
},
category: {
type: 'string' as const,
optional: false as const, nullable: true as const,
description: 'Names categorized in the emoji list.'
},
host: {
type: 'string' as const,
optional: false as const, nullable: true as const,
description: 'If it is another server, the FQDN will be returned here.'
},
url: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Image URL of emoji.'
}
}
}

View file

@ -7,10 +7,6 @@ import { insertModerationLog } from '../../../../../services/insert-moderation-l
import { ApiError } from '../../../error';
export const meta = {
desc: {
'ja-JP': 'カスタム絵文字を削除します。'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -6,10 +6,6 @@ import { getConnection } from 'typeorm';
import { ApiError } from '../../../error';
export const meta = {
desc: {
'ja-JP': 'カスタム絵文字を更新します。'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -4,11 +4,6 @@ import { deleteFile } from '../../../../../services/drive/delete-file';
import { DriveFiles } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したドメインのファイルを全て削除します。',
'en-US': 'Deletes all files in the specified domain.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -4,11 +4,6 @@ import deleteFollowing from '../../../../../services/following/delete';
import { Followings, Users } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したドメインの全ユーザーのフォローを全て解除します。',
'en-US': 'Unfollow all users in the specified domain.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -4,11 +4,6 @@ import { Instances } from '../../../../../models';
import { toPuny } from '@/misc/convert-host';
export const meta = {
desc: {
'ja-JP': '指定したドメインのアクティビティの配信を停止するかを選択します。',
'en-US': 'Select whether to undeliver the activity for the specified domain.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -5,11 +5,6 @@ export const meta = {
requireCredential: true as const,
requireModerator: true,
desc: {
'ja-JP': 'テーブル情報を取得します。',
'en-US': 'Get table stats'
},
tags: ['admin'],
params: {

View file

@ -4,11 +4,6 @@ import { RegistrationTickets } from '../../../../models';
import { genId } from '@/misc/gen-id';
export const meta = {
desc: {
'ja-JP': '招待コードを発行します。',
'en-US': 'Issue an invitation code.'
},
tags: ['admin'],
requireCredential: true as const,
@ -23,7 +18,6 @@ export const meta = {
code: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Give this code to the applicant for registration.',
example: '2ERUA5VR',
maxLength: 8,
minLength: 8

View file

@ -4,11 +4,6 @@ import { Logs } from '../../../../models';
import { Brackets } from 'typeorm';
export const meta = {
desc: {
'ja-JP': 'ログを表示します。',
'en-US': 'Show logs.'
},
tags: ['admin'],
requireCredential: true as const,
@ -22,12 +17,12 @@ export const meta = {
level: {
validator: $.optional.nullable.str,
default: null as any
default: null
},
domain: {
validator: $.optional.nullable.str,
default: null as any
default: null
}
},
@ -42,14 +37,12 @@ export const meta = {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id',
description: 'The unique identifier for this log.',
example: 'xxxxxxxxxx',
},
createdAt: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'date-time',
description: 'The date that the Drive file was created on Misskey.'
},
domain: {
type: 'array' as const,
@ -70,12 +63,10 @@ export const meta = {
machine: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'The name of the running machine.'
},
message: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Log body.'
},
data: {
type: 'object' as const,

View file

@ -4,11 +4,6 @@ import define from '../../../define';
import { Users } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したユーザーをモデレーターにします。',
'en-US': 'Mark a user as moderator.'
},
tags: ['admin'],
requireCredential: true as const,
@ -17,10 +12,6 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーID',
'en-US': 'The user ID'
}
},
}
};

View file

@ -4,11 +4,6 @@ import define from '../../../define';
import { Users } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したユーザーをモデレーター解除します。',
'en-US': 'Unmark a user as moderator.'
},
tags: ['admin'],
requireCredential: true as const,
@ -17,10 +12,6 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーID',
'en-US': 'The user ID'
}
},
}
};

View file

@ -6,11 +6,6 @@ import { getNote } from '../../../common/getters';
import { PromoNotes } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': 'プロモーションを作成します。',
'en-US': 'Create a promotion.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -3,11 +3,6 @@ import { destroy } from '../../../../../queue';
import { insertModerationLog } from '../../../../../services/insert-moderation-log';
export const meta = {
desc: {
'ja-JP': 'ジョブキューを全て削除します。',
'en-US': 'Delete all job queues.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -3,11 +3,6 @@ import { URL } from 'url';
import define from '../../../define';
export const meta = {
desc: {
'ja-JP': '他サーバーへ送るキューの遅延一覧を返します。',
'en-US': 'Returns a list of delays in queues sent to other servers.'
},
tags: ['admin'],
requireCredential: true as const,
@ -26,11 +21,9 @@ export const meta = {
anyOf: [
{
type: 'string' as const,
description: 'FQDN to fediverse server'
},
{
type: 'number' as const,
description: 'Delayed queue counts'
}
]
}

View file

@ -3,11 +3,6 @@ import define from '../../../define';
import { inboxQueue } from '../../../../../queue';
export const meta = {
desc: {
'ja-JP': 'このサーバーへのキューの遅延一覧を返します。',
'en-US': 'Returns a list of queue delays to this server.'
},
tags: ['admin'],
requireCredential: true as const,
@ -26,11 +21,9 @@ export const meta = {
anyOf: [
{
type: 'string' as const,
description: 'FQDN to fediverse server'
},
{
type: 'number' as const,
description: 'Delayed queue counts'
}
]
}

View file

@ -3,11 +3,6 @@ import $ from 'cafy';
import define from '../../../define';
export const meta = {
desc: {
'ja-JP': 'ジョブ一覧を表示します。',
'en-US': 'Display the job list.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -2,11 +2,6 @@ import { deliverQueue, inboxQueue, dbQueue, objectStorageQueue } from '@/queue/q
import define from '../../../define';
export const meta = {
desc: {
'ja-JP': 'キューの状態を返します。',
'en-US': 'Returns the status of the queue.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -5,11 +5,6 @@ import { addRelay } from '../../../../../services/relay';
import { ApiError } from '../../../error';
export const meta = {
desc: {
'ja-JP': 'リレーを追加します。',
'en-US': 'Add relay'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -2,11 +2,6 @@ import define from '../../../define';
import { listRelay } from '../../../../../services/relay';
export const meta = {
desc: {
'ja-JP': 'リレー一覧を表示します。',
'en-US': 'List relay'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -3,11 +3,6 @@ import define from '../../../define';
import { removeRelay } from '../../../../../services/relay';
export const meta = {
desc: {
'ja-JP': 'リレーを削除します。',
'en-US': 'Remove relay'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -6,11 +6,6 @@ import rndstr from 'rndstr';
import { Users, UserProfiles } from '../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したユーザーのパスワードをリセットします。',
'en-US': 'Reset password to specified user.'
},
tags: ['admin'],
requireCredential: true as const,
@ -19,10 +14,6 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーID',
'en-US': 'The user ID which you want to suspend'
}
},
},

View file

@ -4,11 +4,6 @@ import define from '../../define';
import { AbuseUserReports } from '../../../../models';
export const meta = {
desc: {
'ja-JP': '指定した通報を解決済みにします。',
'en-US': 'Marks the specified report as resolved.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -3,11 +3,6 @@ import { driveChart, notesChart, usersChart, instanceChart } from '../../../../s
import { insertModerationLog } from '../../../../services/insert-moderation-log';
export const meta = {
desc: {
'ja-JP': 'チャートを再同期します。',
'en-US': 'Resync the chart.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -3,11 +3,6 @@ import define from '../../define';
import { sendEmail } from '../../../../services/send-email';
export const meta = {
desc: {
'ja-JP': 'メールを送信します。',
'en-US': 'Send a mail.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -8,11 +8,6 @@ export const meta = {
requireCredential: true as const,
requireModerator: true,
desc: {
'ja-JP': 'サーバー情報を表示します。',
'en-US': 'Show server information.'
},
tags: ['admin', 'meta'],
params: {
@ -25,23 +20,19 @@ export const meta = {
machine: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'The name of the running server'
},
os: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'OS used by the server',
example: 'linux'
},
node: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Version of Node.js'
},
psql: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Version of Postgresql'
},
cpu: {
type: 'object' as const,
@ -50,12 +41,10 @@ export const meta = {
model: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'The name of the CPU you are using'
},
cores: {
type: 'number' as const,
optional: false as const, nullable: false as const,
description: 'Number of CPU cores used (number of logical processors)'
}
}
},
@ -67,7 +56,6 @@ export const meta = {
type: 'number' as const,
optional: false as const, nullable: false as const,
format: 'bytes',
description: 'RAM capacity.'
}
}
},
@ -79,13 +67,11 @@ export const meta = {
type: 'number' as const,
optional: false as const, nullable: false as const,
format: 'bytes',
description: 'Total storage capacity.'
},
used: {
type: 'number' as const,
optional: false as const, nullable: false as const,
format: 'bytes',
description: 'Amount of storage used'
}
}
},
@ -96,7 +82,6 @@ export const meta = {
interface: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'The interface name of your network.',
example: 'eth0'
}
}

View file

@ -5,11 +5,6 @@ import { ModerationLogs } from '../../../../models';
import { makePaginationQuery } from '../../common/make-pagination-query';
export const meta = {
desc: {
'ja-JP': 'モデレーションログ一覧を表示します。',
'en-US': 'Display the moderation log list.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -4,11 +4,6 @@ import define from '../../define';
import { Users } from '../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したユーザーの情報を取得します(管理者向け)。',
'en-US': 'Gets the information of the specified user (for administrators).'
},
tags: ['admin'],
requireCredential: true as const,
@ -17,10 +12,6 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーID',
'en-US': 'The user ID which you want to suspend'
}
},
},

View file

@ -3,11 +3,6 @@ import define from '../../define';
import { Users } from '../../../../models';
export const meta = {
desc: {
'ja-JP': '管理者用のユーザー一覧を表示します。',
'en-US': 'Displays a list of users for administrators.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -5,11 +5,6 @@ import { Users } from '../../../../models';
import { insertModerationLog } from '../../../../services/insert-moderation-log';
export const meta = {
desc: {
'ja-JP': '指定したユーザーをサイレンスにします。',
'en-US': 'Make silence a user.'
},
tags: ['admin'],
requireCredential: true as const,
@ -18,10 +13,6 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーID',
'en-US': 'The user ID which you want to make silence'
}
},
}
};

View file

@ -8,11 +8,6 @@ import { insertModerationLog } from '../../../../services/insert-moderation-log'
import { doPostSuspend } from '../../../../services/suspend-user';
export const meta = {
desc: {
'ja-JP': '指定したユーザーを凍結します。',
'en-US': 'Suspend a user.'
},
tags: ['admin'],
requireCredential: true as const,
@ -21,10 +16,6 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーID',
'en-US': 'The user ID which you want to suspend'
}
},
}
};

View file

@ -5,11 +5,6 @@ import { Users } from '../../../../models';
import { insertModerationLog } from '../../../../services/insert-moderation-log';
export const meta = {
desc: {
'ja-JP': '指定したユーザーのサイレンスを解除します。',
'en-US': 'Unsilence a user.'
},
tags: ['admin'],
requireCredential: true as const,
@ -18,10 +13,6 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーID',
'en-US': 'The user ID which you want to unsilence'
}
},
}
};

View file

@ -6,11 +6,6 @@ import { insertModerationLog } from '../../../../services/insert-moderation-log'
import { doPostUnsuspend } from '../../../../services/unsuspend-user';
export const meta = {
desc: {
'ja-JP': '指定したユーザーの凍結を解除します。',
'en-US': 'Unsuspend a user.'
},
tags: ['admin'],
requireCredential: true as const,
@ -19,10 +14,6 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーID',
'en-US': 'The user ID which you want to unsuspend'
}
},
}
};

View file

@ -7,10 +7,6 @@ import { DB_MAX_NOTE_TEXT_LENGTH } from '@/misc/hard-limits';
import { ID } from '@/misc/cafy-id';
export const meta = {
desc: {
'ja-JP': 'インスタンスの設定を更新します。'
},
tags: ['admin'],
requireCredential: true as const,
@ -19,79 +15,46 @@ export const meta = {
params: {
disableRegistration: {
validator: $.optional.nullable.bool,
desc: {
'ja-JP': '招待制か否か'
}
},
disableLocalTimeline: {
validator: $.optional.nullable.bool,
desc: {
'ja-JP': 'ローカルタイムライン(とソーシャルタイムライン)を無効にするか否か'
}
},
disableGlobalTimeline: {
validator: $.optional.nullable.bool,
desc: {
'ja-JP': 'グローバルタイムラインを無効にするか否か'
}
},
useStarForReactionFallback: {
validator: $.optional.nullable.bool,
desc: {
'ja-JP': '不明なリアクションのフォールバックに star リアクションを使うか'
}
},
pinnedUsers: {
validator: $.optional.nullable.arr($.str),
desc: {
'ja-JP': 'ピン留めユーザー'
}
},
hiddenTags: {
validator: $.optional.nullable.arr($.str),
desc: {
'ja-JP': '統計などで無視するハッシュタグ'
}
},
blockedHosts: {
validator: $.optional.nullable.arr($.str),
desc: {
'ja-JP': 'ブロックするホスト'
}
},
mascotImageUrl: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'インスタンスキャラクター画像のURL'
}
},
bannerUrl: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'インスタンスのバナー画像URL'
}
},
errorImageUrl: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'インスタンスのエラー画像URL'
}
},
iconUrl: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'インスタンスのアイコンURL'
}
},
backgroundImageUrl: {
@ -104,116 +67,66 @@ export const meta = {
name: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'インスタンス名'
}
},
description: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'インスタンスの紹介文'
}
},
maxNoteTextLength: {
validator: $.optional.num.min(0).max(DB_MAX_NOTE_TEXT_LENGTH),
desc: {
'ja-JP': '投稿の最大文字数'
}
},
localDriveCapacityMb: {
validator: $.optional.num.min(0),
desc: {
'ja-JP': 'ローカルユーザーひとりあたりのドライブ容量 (メガバイト単位)',
'en-US': 'Drive capacity of a local user (MB)'
}
},
remoteDriveCapacityMb: {
validator: $.optional.num.min(0),
desc: {
'ja-JP': 'リモートユーザーひとりあたりのドライブ容量 (メガバイト単位)',
'en-US': 'Drive capacity of a remote user (MB)'
}
},
cacheRemoteFiles: {
validator: $.optional.bool,
desc: {
'ja-JP': 'リモートのファイルをキャッシュするか否か'
}
},
proxyRemoteFiles: {
validator: $.optional.bool,
desc: {
'ja-JP': 'ローカルにないリモートのファイルをプロキシするか否か'
}
},
enableHcaptcha: {
validator: $.optional.bool,
desc: {
'ja-JP': 'hCaptchaを使用するか否か'
}
},
hcaptchaSiteKey: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'hCaptcha site key'
}
},
hcaptchaSecretKey: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'hCaptcha secret key'
}
},
enableRecaptcha: {
validator: $.optional.bool,
desc: {
'ja-JP': 'reCAPTCHAを使用するか否か'
}
},
recaptchaSiteKey: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'reCAPTCHA site key'
}
},
recaptchaSecretKey: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'reCAPTCHA secret key'
}
},
proxyAccountId: {
validator: $.optional.nullable.type(ID),
desc: {
'ja-JP': 'プロキシアカウントのID'
}
},
maintainerName: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'インスタンスの管理者名'
}
},
maintainerEmail: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'インスタンス管理者の連絡先メールアドレス'
}
},
pinnedPages: {
@ -226,170 +139,98 @@ export const meta = {
langs: {
validator: $.optional.arr($.str),
desc: {
'ja-JP': 'インスタンスの対象言語'
}
},
summalyProxy: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'summalyプロキシURL'
}
},
enableTwitterIntegration: {
validator: $.optional.bool,
desc: {
'ja-JP': 'Twitter連携機能を有効にするか否か'
}
},
twitterConsumerKey: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'TwitterアプリのConsumer key'
}
},
twitterConsumerSecret: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'TwitterアプリのConsumer secret'
}
},
enableGithubIntegration: {
validator: $.optional.bool,
desc: {
'ja-JP': 'GitHub連携機能を有効にするか否か'
}
},
githubClientId: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'GitHubアプリのClient ID'
}
},
githubClientSecret: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'GitHubアプリのClient Secret'
}
},
enableDiscordIntegration: {
validator: $.optional.bool,
desc: {
'ja-JP': 'Discord連携機能を有効にするか否か'
}
},
discordClientId: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'DiscordアプリのClient ID'
}
},
discordClientSecret: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'DiscordアプリのClient Secret'
}
},
enableEmail: {
validator: $.optional.bool,
desc: {
'ja-JP': 'メール配信を有効にするか否か'
}
},
email: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'メール配信する際に利用するメールアドレス'
}
},
smtpSecure: {
validator: $.optional.bool,
desc: {
'ja-JP': 'SMTPサーバがSSLを使用しているか否か'
}
},
smtpHost: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'SMTPサーバのホスト'
}
},
smtpPort: {
validator: $.optional.nullable.num,
desc: {
'ja-JP': 'SMTPサーバのポート'
}
},
smtpUser: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'SMTPサーバのユーザー名'
}
},
smtpPass: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'SMTPサーバのパスワード'
}
},
enableServiceWorker: {
validator: $.optional.bool,
desc: {
'ja-JP': 'ServiceWorkerを有効にするか否か'
}
},
swPublicKey: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'ServiceWorkerのVAPIDキーペアの公開鍵'
}
},
swPrivateKey: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': 'ServiceWorkerのVAPIDキーペアの秘密鍵'
}
},
tosUrl: {
validator: $.optional.nullable.str,
desc: {
'ja-JP': '利用規約のURL'
}
},
repositoryUrl: {
validator: $.optional.str,
desc: {
'ja-JP': 'リポジトリのURL'
}
},
feedbackUrl: {
validator: $.optional.str,
desc: {
'ja-JP': 'フィードバックのURL'
}
},
useObjectStorage: {

View file

@ -4,11 +4,6 @@ import { getConnection } from 'typeorm';
import { insertModerationLog } from '../../../../services/insert-moderation-log';
export const meta = {
desc: {
'ja-JP': 'データベースのメンテナンスを行います。',
'en-US': 'Perform database maintenance.'
},
tags: ['admin'],
requireCredential: true as const,

View file

@ -5,11 +5,6 @@ import { Announcements, AnnouncementReads } from '../../../models';
import { makePaginationQuery } from '../common/make-pagination-query';
export const meta = {
desc: {
'ja-JP': 'アナウンスを表示します。',
'en-US': 'Show announcements.'
},
tags: ['meta'],
requireCredential: false as const,
@ -45,40 +40,33 @@ export const meta = {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id',
description: 'The unique identifier for this Announcement.',
example: 'xxxxxxxxxx',
},
createdAt: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'date-time',
description: 'The date that the Announcement was created.'
},
updatedAt: {
type: 'string' as const,
optional: false as const, nullable: true as const,
format: 'date-time',
description: 'The date that the Announcement was updated.'
},
text: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Announcement text.'
},
title: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'Announcement title.'
},
imageUrl: {
type: 'string' as const,
optional: false as const, nullable: true as const,
description: 'Announcement image.'
},
isRead: {
type: 'boolean' as const,
optional: false as const, nullable: false as const,
description: 'Indicates that you have read this announcement'
}
}
}

View file

@ -7,11 +7,6 @@ import { ApiError } from '../../error';
import { publishInternalEvent } from '../../../../services/stream';
export const meta = {
desc: {
'ja-JP': 'アンテナを作成します。',
'en-US': 'Create a antenna.'
},
tags: ['antennas'],
requireCredential: true as const,

View file

@ -6,11 +6,6 @@ import { Antennas } from '../../../../models';
import { publishInternalEvent } from '../../../../services/stream';
export const meta = {
desc: {
'ja-JP': 'アンテナを削除します。',
'en-US': 'Delete a antenna.'
},
tags: ['antennas'],
requireCredential: true as const,

View file

@ -2,11 +2,6 @@ import define from '../../define';
import { Antennas } from '../../../../models';
export const meta = {
desc: {
'ja-JP': 'アンテナの一覧を取得します。',
'en-US': 'Get a list of antennas.'
},
tags: ['antennas', 'account'],
requireCredential: true as const,

View file

@ -8,11 +8,6 @@ import { generateMutedUserQuery } from '../../common/generate-muted-user-query';
import { ApiError } from '../../error';
export const meta = {
desc: {
'ja-JP': '指定したアンテナのノート一覧を表示します。',
'en-US': 'Displays a list of notes for the specified antenna.'
},
tags: ['antennas', 'account', 'notes'],
requireCredential: true as const,

View file

@ -5,11 +5,6 @@ import { ApiError } from '../../error';
import { Antennas } from '../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したアンテナの情報を取得します。',
'en-US': 'Acquires the information of the specified antenna.'
},
tags: ['antennas', 'account'],
requireCredential: true as const,

View file

@ -6,11 +6,6 @@ import { Antennas, UserLists, UserGroupJoinings } from '../../../../models';
import { publishInternalEvent } from '../../../../services/stream';
export const meta = {
desc: {
'ja-JP': 'アンテナの情報を更新します。',
'en-US': 'Updates the information of the specified antenna.'
},
tags: ['antennas'],
requireCredential: true as const,

View file

@ -6,19 +6,11 @@ import { ApiError } from '../../error';
export const meta = {
tags: ['federation'],
desc: {
'ja-JP': 'URIを指定してActivityPubオブジェクトを参照します。',
'en-US': 'Browse to the ActivityPub object by specifying the URI.'
},
requireCredential: false as const,
params: {
uri: {
validator: $.str,
desc: {
'ja-JP': 'ActivityPubオブジェクトのURI'
}
},
},

View file

@ -10,24 +10,16 @@ import { Users, Notes } from '../../../../models';
import { Note } from '../../../../models/entities/note';
import { User } from '../../../../models/entities/user';
import { fetchMeta } from '@/misc/fetch-meta';
import { validActor, validPost } from '../../../../remote/activitypub/type';
import { isActor, isPost, getApId } from '../../../../remote/activitypub/type';
export const meta = {
tags: ['federation'],
desc: {
'ja-JP': 'URIを指定してActivityPubオブジェクトを参照します。',
'en-US': 'Browse to the ActivityPub object by specifying the URI.'
},
requireCredential: false as const,
params: {
uri: {
validator: $.str,
desc: {
'ja-JP': 'ActivityPubオブジェクトのURI'
}
},
},
@ -154,16 +146,16 @@ async function fetchAny(uri: string) {
}
// それでもみつからなければ新規であるため登録
if (validActor.includes(object.type)) {
const user = await createPerson(object.id);
if (isActor(object)) {
const user = await createPerson(getApId(object));
return {
type: 'User',
object: await Users.pack(user, null, { detail: true })
};
}
if (validPost.includes(object.type)) {
const note = await createNote(object.id, undefined, true);
if (isPost(object)) {
const note = await createNote(getApId(object), undefined, true);
return {
type: 'Note',
object: await Notes.pack(note!, null, { detail: true })

View file

@ -10,44 +10,23 @@ export const meta = {
requireCredential: false as const,
desc: {
'ja-JP': 'アプリを作成します。',
'en-US': 'Create a application.'
},
params: {
name: {
validator: $.str,
desc: {
'ja-JP': 'アプリの名前',
'en-US': 'Name of application'
}
},
description: {
validator: $.str,
desc: {
'ja-JP': 'アプリの説明',
'en-US': 'Description of application'
}
},
permission: {
validator: $.arr($.str).unique(),
desc: {
'ja-JP': 'このアプリに割り当てる権限(権限については"Permissions"を参照)',
'en-US': 'Permissions assigned to this app (see "Permissions" for the permissions)'
}
},
// TODO: Check it is valid url
callbackUrl: {
validator: $.optional.nullable.str,
default: null as any,
desc: {
'ja-JP': 'アプリ認証時にコールバックするURL',
'en-US': 'URL to call back at app authentication'
}
default: null,
},
},

View file

@ -11,18 +11,9 @@ export const meta = {
requireCredential: false as const,
desc: {
'ja-JP': 'アプリを認証するためのトークンを作成します。',
'en-US': 'Generate a token for authorize application.'
},
params: {
appSecret: {
validator: $.str,
desc: {
'ja-JP': 'アプリケーションのシークレットキー',
'en-US': 'The secret key of your application.'
}
}
},
@ -33,13 +24,11 @@ export const meta = {
token: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'セッションのトークン'
},
url: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'url',
description: 'セッションのURL'
},
}
},

View file

@ -11,10 +11,6 @@ export const meta = {
params: {
token: {
validator: $.str,
desc: {
'ja-JP': 'セッションのトークン',
'en-US': 'The token of a session.'
}
}
},

View file

@ -11,18 +11,10 @@ export const meta = {
params: {
appSecret: {
validator: $.str,
desc: {
'ja-JP': 'アプリケーションのシークレットキー',
'en-US': 'The secret key of your application.'
}
},
token: {
validator: $.str,
desc: {
'ja-JP': 'セッションのトークン',
'en-US': 'The token of a session.'
}
}
},
@ -33,14 +25,12 @@ export const meta = {
accessToken: {
type: 'string' as const,
optional: false as const, nullable: false as const,
description: 'ユーザーのアクセストークン',
},
user: {
type: 'object' as const,
optional: false as const, nullable: false as const,
ref: 'User',
description: '認証したユーザー'
},
}
},

View file

@ -8,11 +8,6 @@ import { getUser } from '../../common/getters';
import { Blockings, NoteWatchings, Users } from '../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したユーザーをブロックします。',
'en-US': 'Block a user.'
},
tags: ['account'],
limit: {
@ -27,10 +22,6 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーのID',
'en-US': 'Target user ID'
}
}
},

View file

@ -8,11 +8,6 @@ import { getUser } from '../../common/getters';
import { Blockings, Users } from '../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したユーザーのブロックを解除します。',
'en-US': 'Unblock a user.'
},
tags: ['account'],
limit: {
@ -27,10 +22,6 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーのID',
'en-US': 'Target user ID'
}
}
},
@ -57,72 +48,8 @@ export const meta = {
res: {
type: 'object' as const,
optional: false as const, nullable: false as const,
properties: {
id: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'id',
description: 'The unique identifier for this blocking.',
example: 'xxxxxxxxxx',
},
name: {
type: 'string' as const,
optional: false as const, nullable: true as const
},
username: {
type: 'string' as const,
optional: false as const, nullable: false as const
},
host: {
type: 'string' as const,
optional: false as const, nullable: true as const
},
avatarUrl: {
type: 'string' as const,
optional: false as const, nullable: false as const,
format: 'url'
},
avatarBlurhash: {
type: 'string' as const,
optional: false as const, nullable: true as const
},
avatarColor: {
type: 'any' as const,
optional: false as const, nullable: true as const
},
emojis: {
type: 'array' as const,
optional: false as const, nullable: false as const,
items: {
type: 'object' as const,
nullable: false as const, optional: false as const,
properties: {
name: {
type: 'string' as const,
nullable: false as const, optional: false as const
},
host: {
type: 'string' as const,
nullable: true as const, optional: false as const
},
url: {
type: 'string' as const,
nullable: false as const, optional: false as const,
format: 'url'
},
aliases: {
type: 'array' as const,
nullable: false as const, optional: false as const,
items: {
type: 'string' as const,
nullable: false as const, optional: false as const
}
}
}
}
}
}
}
ref: 'User',
},
};
export default define(meta, async (ps, user) => {

View file

@ -5,11 +5,6 @@ import { Blockings } from '../../../../models';
import { makePaginationQuery } from '../../common/make-pagination-query';
export const meta = {
desc: {
'ja-JP': 'ブロックしているユーザー一覧を取得します。',
'en-US': 'Get blocking users.'
},
tags: ['account'],
requireCredential: true as const,

View file

@ -14,45 +14,27 @@ export const meta = {
params: {
channelId: {
validator: $.type(ID),
desc: {
'ja-JP': 'チャンネルのID'
}
},
limit: {
validator: $.optional.num.range(1, 100),
default: 10,
desc: {
'ja-JP': '最大数'
}
},
sinceId: {
validator: $.optional.type(ID),
desc: {
'ja-JP': '指定すると、その投稿を基点としてより新しい投稿を取得します'
}
},
untilId: {
validator: $.optional.type(ID),
desc: {
'ja-JP': '指定すると、その投稿を基点としてより古い投稿を取得します'
}
},
sinceDate: {
validator: $.optional.num,
desc: {
'ja-JP': '指定した時間を基点としてより新しい投稿を取得します。数値は、1970年1月1日 00:00:00 UTC から指定した日時までの経過時間をミリ秒単位で表します。'
}
},
untilDate: {
validator: $.optional.num,
desc: {
'ja-JP': '指定した時間を基点としてより古い投稿を取得します。数値は、1970年1月1日 00:00:00 UTC から指定した日時までの経過時間をミリ秒単位で表します。'
}
},
},

View file

@ -4,26 +4,16 @@ import { convertLog } from '../../../../services/chart/core';
import { activeUsersChart } from '../../../../services/chart';
export const meta = {
desc: {
'ja-JP': 'アクティブユーザーのチャートを取得します。'
},
tags: ['charts', 'users'],
params: {
span: {
validator: $.str.or(['day', 'hour']),
desc: {
'ja-JP': '集計のスパン (day または hour)'
}
},
limit: {
validator: $.optional.num.range(1, 500),
default: 30,
desc: {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {

View file

@ -4,26 +4,16 @@ import { convertLog } from '../../../../services/chart/core';
import { driveChart } from '../../../../services/chart';
export const meta = {
desc: {
'ja-JP': 'ドライブのチャートを取得します。'
},
tags: ['charts', 'drive'],
params: {
span: {
validator: $.str.or(['day', 'hour']),
desc: {
'ja-JP': '集計のスパン (day または hour)'
}
},
limit: {
validator: $.optional.num.range(1, 500),
default: 30,
desc: {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {

View file

@ -4,26 +4,16 @@ import { convertLog } from '../../../../services/chart/core';
import { federationChart } from '../../../../services/chart';
export const meta = {
desc: {
'ja-JP': 'フェデレーションのチャートを取得します。'
},
tags: ['charts'],
params: {
span: {
validator: $.str.or(['day', 'hour']),
desc: {
'ja-JP': '集計のスパン (day または hour)'
}
},
limit: {
validator: $.optional.num.range(1, 500),
default: 30,
desc: {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {

View file

@ -4,26 +4,16 @@ import { convertLog } from '../../../../services/chart/core';
import { hashtagChart } from '../../../../services/chart';
export const meta = {
desc: {
'ja-JP': 'ハッシュタグごとのチャートを取得します。'
},
tags: ['charts', 'hashtags'],
params: {
span: {
validator: $.str.or(['day', 'hour']),
desc: {
'ja-JP': '集計のスパン (day または hour)'
}
},
limit: {
validator: $.optional.num.range(1, 500),
default: 30,
desc: {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {
@ -33,9 +23,6 @@ export const meta = {
tag: {
validator: $.str,
desc: {
'ja-JP': '対象のハッシュタグ'
}
},
},

View file

@ -4,26 +4,16 @@ import { convertLog } from '../../../../services/chart/core';
import { instanceChart } from '../../../../services/chart';
export const meta = {
desc: {
'ja-JP': 'インスタンスごとのチャートを取得します。'
},
tags: ['charts'],
params: {
span: {
validator: $.str.or(['day', 'hour']),
desc: {
'ja-JP': '集計のスパン (day または hour)'
}
},
limit: {
validator: $.optional.num.range(1, 500),
default: 30,
desc: {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {
@ -33,10 +23,6 @@ export const meta = {
host: {
validator: $.str,
desc: {
'ja-JP': '対象のインスタンスのホスト',
'en-US': 'Target instance host'
}
}
},

View file

@ -4,26 +4,16 @@ import { convertLog } from '../../../../services/chart/core';
import { networkChart } from '../../../../services/chart';
export const meta = {
desc: {
'ja-JP': 'ネットワークのチャートを取得します。'
},
tags: ['charts'],
params: {
span: {
validator: $.str.or(['day', 'hour']),
desc: {
'ja-JP': '集計のスパン (day または hour)'
}
},
limit: {
validator: $.optional.num.range(1, 500),
default: 30,
desc: {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {

View file

@ -4,26 +4,16 @@ import { convertLog } from '../../../../services/chart/core';
import { notesChart } from '../../../../services/chart';
export const meta = {
desc: {
'ja-JP': '投稿のチャートを取得します。'
},
tags: ['charts', 'notes'],
params: {
span: {
validator: $.str.or(['day', 'hour']),
desc: {
'ja-JP': '集計のスパン (day または hour)'
}
},
limit: {
validator: $.optional.num.range(1, 500),
default: 30,
desc: {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {

View file

@ -5,26 +5,16 @@ import { convertLog } from '../../../../../services/chart/core';
import { perUserDriveChart } from '../../../../../services/chart';
export const meta = {
desc: {
'ja-JP': 'ユーザーごとのドライブのチャートを取得します。'
},
tags: ['charts', 'drive', 'users'],
params: {
span: {
validator: $.str.or(['day', 'hour']),
desc: {
'ja-JP': '集計のスパン (day または hour)'
}
},
limit: {
validator: $.optional.num.range(1, 500),
default: 30,
desc: {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {
@ -34,10 +24,6 @@ export const meta = {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーのID',
'en-US': 'Target user ID'
}
}
},

View file

@ -5,26 +5,16 @@ import { convertLog } from '../../../../../services/chart/core';
import { perUserFollowingChart } from '../../../../../services/chart';
export const meta = {
desc: {
'ja-JP': 'ユーザーごとのフォロー/フォロワーのチャートを取得します。'
},
tags: ['charts', 'users', 'following'],
params: {
span: {
validator: $.str.or(['day', 'hour']),
desc: {
'ja-JP': '集計のスパン (day または hour)'
}
},
limit: {
validator: $.optional.num.range(1, 500),
default: 30,
desc: {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {
@ -34,10 +24,6 @@ export const meta = {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーのID',
'en-US': 'Target user ID'
}
}
},

View file

@ -5,26 +5,16 @@ import { convertLog } from '../../../../../services/chart/core';
import { perUserNotesChart } from '../../../../../services/chart';
export const meta = {
desc: {
'ja-JP': 'ユーザーごとの投稿のチャートを取得します。'
},
tags: ['charts', 'users', 'notes'],
params: {
span: {
validator: $.str.or(['day', 'hour']),
desc: {
'ja-JP': '集計のスパン (day または hour)'
}
},
limit: {
validator: $.optional.num.range(1, 500),
default: 30,
desc: {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {
@ -34,10 +24,6 @@ export const meta = {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーのID',
'en-US': 'Target user ID'
}
}
},

View file

@ -5,26 +5,16 @@ import { convertLog } from '../../../../../services/chart/core';
import { perUserReactionsChart } from '../../../../../services/chart';
export const meta = {
desc: {
'ja-JP': 'ユーザーごとの被リアクション数のチャートを取得します。'
},
tags: ['charts', 'users', 'reactions'],
params: {
span: {
validator: $.str.or(['day', 'hour']),
desc: {
'ja-JP': '集計のスパン (day または hour)'
}
},
limit: {
validator: $.optional.num.range(1, 500),
default: 30,
desc: {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {
@ -34,10 +24,6 @@ export const meta = {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーのID',
'en-US': 'Target user ID'
}
}
},

View file

@ -4,26 +4,16 @@ import { convertLog } from '../../../../services/chart/core';
import { usersChart } from '../../../../services/chart';
export const meta = {
desc: {
'ja-JP': 'ユーザーのチャートを取得します。'
},
tags: ['charts', 'users'],
params: {
span: {
validator: $.str.or(['day', 'hour']),
desc: {
'ja-JP': '集計のスパン (day または hour)'
}
},
limit: {
validator: $.optional.num.range(1, 500),
default: 30,
desc: {
'ja-JP': '最大数。例えば 30 を指定したとすると、スパンが"day"の場合は30日分のデータが、スパンが"hour"の場合は30時間分のデータが返ります。'
}
},
offset: {

View file

@ -3,11 +3,6 @@ import { fetchMeta } from '@/misc/fetch-meta';
import { DriveFiles } from '../../../models';
export const meta = {
desc: {
'ja-JP': 'ドライブの情報を取得します。',
'en-US': 'Get drive information.'
},
tags: ['drive', 'account'],
requireCredential: true as const,

View file

@ -5,11 +5,6 @@ import { DriveFiles } from '../../../../models';
import { makePaginationQuery } from '../../common/make-pagination-query';
export const meta = {
desc: {
'ja-JP': 'ドライブのファイル一覧を取得します。',
'en-US': 'Get files of drive.'
},
tags: ['drive'],
requireCredential: true as const,
@ -32,7 +27,7 @@ export const meta = {
folderId: {
validator: $.optional.nullable.type(ID),
default: null as any,
default: null,
},
type: {

View file

@ -5,11 +5,6 @@ import { ApiError } from '../../../error';
import { DriveFiles, Notes } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したドライブのファイルが添付されている投稿一覧を取得します。',
'en-US': 'Get the notes that specified file of drive attached.'
},
tags: ['drive', 'notes'],
requireCredential: true as const,
@ -19,10 +14,6 @@ export const meta = {
params: {
fileId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のファイルID',
'en-US': 'Target file ID'
}
}
},

View file

@ -3,11 +3,6 @@ import define from '../../../define';
import { DriveFiles } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': '与えられたMD5ハッシュ値を持つファイルがドライブに存在するかどうかを返します。',
'en-US': 'Returns whether the file with the given MD5 hash exists in the user\'s drive.'
},
tags: ['drive'],
requireCredential: true as const,
@ -17,9 +12,6 @@ export const meta = {
params: {
md5: {
validator: $.str,
desc: {
'ja-JP': 'ファイルのMD5ハッシュ'
}
}
},

View file

@ -8,11 +8,6 @@ import { ApiError } from '../../../error';
import { DriveFiles } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': 'ドライブにファイルをアップロードします。',
'en-US': 'Upload a file to drive.'
},
tags: ['drive'],
requireCredential: true as const,
@ -29,37 +24,24 @@ export const meta = {
params: {
folderId: {
validator: $.optional.nullable.type(ID),
default: null as any,
desc: {
'ja-JP': 'フォルダID'
}
default: null,
},
name: {
validator: $.optional.nullable.str,
default: null as any,
desc: {
'ja-JP': 'ファイル名(拡張子があるなら含めて)'
}
default: null,
},
isSensitive: {
validator: $.optional.either($.bool, $.str),
default: false,
transform: (v: any): boolean => v === true || v === 'true',
desc: {
'ja-JP': 'このメディアが「閲覧注意」(NSFW)かどうか',
'en-US': 'Whether this media is NSFW'
}
},
force: {
validator: $.optional.either($.bool, $.str),
default: false,
transform: (v: any): boolean => v === true || v === 'true',
desc: {
'ja-JP': 'true にすると、同じハッシュを持つファイルが既にアップロードされていても強制的にファイルを作成します。',
}
}
},

View file

@ -7,11 +7,6 @@ import { ApiError } from '../../../error';
import { DriveFiles } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': 'ドライブのファイルを削除します。',
'en-US': 'Delete a file of drive.'
},
tags: ['drive'],
requireCredential: true as const,
@ -21,10 +16,6 @@ export const meta = {
params: {
fileId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のファイルID',
'en-US': 'Target file ID'
}
}
},

View file

@ -3,10 +3,6 @@ import define from '../../../define';
import { DriveFiles } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': '与えられたMD5ハッシュ値を持つファイルを取得します。',
},
tags: ['drive'],
requireCredential: true as const,
@ -16,9 +12,6 @@ export const meta = {
params: {
md5: {
validator: $.str,
desc: {
'ja-JP': 'ファイルのMD5ハッシュ'
}
}
},

View file

@ -17,10 +17,7 @@ export const meta = {
folderId: {
validator: $.optional.nullable.type(ID),
default: null as any,
desc: {
'ja-JP': 'フォルダID'
}
default: null,
},
},

View file

@ -6,11 +6,6 @@ import { DriveFile } from '../../../../../models/entities/drive-file';
import { DriveFiles } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したドライブのファイルの情報を取得します。',
'en-US': 'Get specified file of drive.'
},
tags: ['drive'],
requireCredential: true as const,
@ -20,18 +15,10 @@ export const meta = {
params: {
fileId: {
validator: $.optional.type(ID),
desc: {
'ja-JP': '対象のファイルID',
'en-US': 'Target file ID'
}
},
url: {
validator: $.optional.str,
desc: {
'ja-JP': '対象のファイルのURL',
'en-US': 'Target file URL'
}
}
},

View file

@ -6,11 +6,6 @@ import { ApiError } from '../../../error';
import { DriveFiles, DriveFolders } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したドライブのファイルの情報を更新します。',
'en-US': 'Update specified file of drive.'
},
tags: ['drive'],
requireCredential: true as const,
@ -20,35 +15,26 @@ export const meta = {
params: {
fileId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のファイルID'
}
},
folderId: {
validator: $.optional.nullable.type(ID),
default: undefined as any,
desc: {
'ja-JP': 'フォルダID'
}
},
name: {
validator: $.optional.str.pipe(DriveFiles.validateFileName),
default: undefined as any,
desc: {
'ja-JP': 'ファイル名',
'en-US': 'Name of the file'
}
},
isSensitive: {
validator: $.optional.bool,
default: undefined as any,
desc: {
'ja-JP': 'このメディアが「閲覧注意」(NSFW)かどうか',
'en-US': 'Whether this media is NSFW'
}
},
comment: {
validator: $.optional.nullable.str,
default: undefined as any,
}
},
@ -92,6 +78,8 @@ export default define(meta, async (ps, user) => {
if (ps.name) file.name = ps.name;
if (ps.comment !== undefined) file.comment = ps.comment;
if (ps.isSensitive !== undefined) file.isSensitive = ps.isSensitive;
if (ps.folderId !== undefined) {
@ -113,6 +101,7 @@ export default define(meta, async (ps, user) => {
await DriveFiles.update(file.id, {
name: file.name,
comment: file.comment,
folderId: file.folderId,
isSensitive: file.isSensitive
});

View file

@ -7,10 +7,6 @@ import { DriveFiles } from '../../../../../models';
import { publishMainStream } from '../../../../../services/stream';
export const meta = {
desc: {
'ja-JP': 'ドライブに指定されたURLに存在するファイルをアップロードします。'
},
tags: ['drive'],
limit: {
@ -30,34 +26,27 @@ export const meta = {
folderId: {
validator: $.optional.nullable.type(ID),
default: null as any,
default: null,
},
isSensitive: {
validator: $.optional.bool,
default: false,
desc: {
'ja-JP': 'このメディアが「閲覧注意」(NSFW)かどうか',
'en-US': 'Whether this media is NSFW'
}
},
comment: {
validator: $.optional.nullable.str,
default: null as any,
default: null,
},
marker: {
validator: $.optional.nullable.str,
default: null as any,
default: null,
},
force: {
validator: $.optional.bool,
default: false,
desc: {
'ja-JP': 'true にすると、同じハッシュを持つファイルが既にアップロードされていても強制的にファイルを作成します。',
}
}
}
};

View file

@ -5,11 +5,6 @@ import { DriveFolders } from '../../../../models';
import { makePaginationQuery } from '../../common/make-pagination-query';
export const meta = {
desc: {
'ja-JP': 'ドライブのフォルダ一覧を取得します。',
'en-US': 'Get folders of drive.'
},
tags: ['drive'],
requireCredential: true as const,
@ -32,7 +27,7 @@ export const meta = {
folderId: {
validator: $.optional.nullable.type(ID),
default: null as any,
default: null,
}
},

View file

@ -7,11 +7,6 @@ import { DriveFolders } from '../../../../../models';
import { genId } from '@/misc/gen-id';
export const meta = {
desc: {
'ja-JP': 'ドライブのフォルダを作成します。',
'en-US': 'Create a folder of drive.'
},
tags: ['drive'],
requireCredential: true as const,
@ -22,18 +17,10 @@ export const meta = {
name: {
validator: $.optional.str.pipe(DriveFolders.validateFolderName),
default: 'Untitled',
desc: {
'ja-JP': 'フォルダ名',
'en-US': 'Folder name'
}
},
parentId: {
validator: $.optional.nullable.type(ID),
desc: {
'ja-JP': '親フォルダID',
'en-US': 'Parent folder ID'
}
}
},

View file

@ -6,11 +6,6 @@ import { ApiError } from '../../../error';
import { DriveFolders, DriveFiles } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したドライブのフォルダを削除します。',
'en-US': 'Delete specified folder of drive.'
},
tags: ['drive'],
requireCredential: true as const,
@ -20,10 +15,6 @@ export const meta = {
params: {
folderId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のフォルダID',
'en-US': 'Target folder ID'
}
}
},

View file

@ -17,10 +17,7 @@ export const meta = {
parentId: {
validator: $.optional.nullable.type(ID),
default: null as any,
desc: {
'ja-JP': 'フォルダID'
}
default: null,
},
},

View file

@ -5,11 +5,6 @@ import { ApiError } from '../../../error';
import { DriveFolders } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したドライブのフォルダの情報を取得します。',
'en-US': 'Get specified folder of drive.'
},
tags: ['drive'],
requireCredential: true as const,
@ -19,10 +14,6 @@ export const meta = {
params: {
folderId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のフォルダID',
'en-US': 'Target folder ID'
}
}
},

View file

@ -6,11 +6,6 @@ import { ApiError } from '../../../error';
import { DriveFolders } from '../../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したドライブのフォルダの情報を更新します。',
'en-US': 'Update specified folder of drive.'
},
tags: ['drive'],
requireCredential: true as const,
@ -20,26 +15,14 @@ export const meta = {
params: {
folderId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のフォルダID',
'en-US': 'Target folder ID'
}
},
name: {
validator: $.optional.str.pipe(DriveFolders.validateFolderName),
desc: {
'ja-JP': 'フォルダ名',
'en-US': 'Folder name'
}
},
parentId: {
validator: $.optional.nullable.type(ID),
desc: {
'ja-JP': '親フォルダID',
'en-US': 'Parent folder ID'
}
}
},

View file

@ -2,11 +2,6 @@ import define from '../define';
import endpoints from '../endpoints';
export const meta = {
desc: {
'ja-JP': '使用できるAPI一覧を返します。',
'en-US': 'Returns a list of available APIs.'
},
requireCredential: false as const,
tags: ['meta'],

View file

@ -5,11 +5,6 @@ import { getRemoteUser } from '../../common/getters';
import { updatePerson } from '../../../../remote/activitypub/models/person';
export const meta = {
desc: {
'ja-JP': '指定されたリモートユーザーの情報を更新します。',
'en-US': 'Update specified remote user information.'
},
tags: ['federation'],
requireCredential: true as const,
@ -17,10 +12,6 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーID',
'en-US': 'The user ID which you want to update'
}
},
}
};

View file

@ -8,11 +8,6 @@ import { getUser } from '../../common/getters';
import { Followings, Users } from '../../../../models';
export const meta = {
desc: {
'ja-JP': '指定したユーザーをフォローします。',
'en-US': 'Follow a user.'
},
tags: ['following', 'users'],
limit: {
@ -27,10 +22,6 @@ export const meta = {
params: {
userId: {
validator: $.type(ID),
desc: {
'ja-JP': '対象のユーザーのID',
'en-US': 'Target user ID'
}
}
},

Some files were not shown because too many files have changed in this diff Show more