Merge remote-tracking branch 'misskey-original/develop' into develop
# Conflicts: # README.md # packages/frontend/src/components/MkMenu.vue # packages/frontend/src/components/MkNote.vue # packages/frontend/src/components/MkNoteSimple.vue # packages/frontend/src/components/MkPostForm.vue # packages/frontend/src/components/MkSignupDialog.form.vue # packages/frontend/src/pages/custom-emojis-manager.vue # packages/frontend/src/pages/settings/general.vue # packages/frontend/src/pages/timeline.vue # packages/frontend/src/pages/user/home.vue # packages/frontend/src/widgets/WidgetInstanceInfo.vue
This commit is contained in:
commit
487b3089a0
315 changed files with 4855 additions and 1825 deletions
|
|
@ -77,6 +77,17 @@ export class FeaturedService {
|
|||
return Array.from(ranking.keys());
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async removeFromRanking(name: string, windowRange: number, element: string): Promise<void> {
|
||||
const currentWindow = this.getCurrentWindow(windowRange);
|
||||
const previousWindow = currentWindow - 1;
|
||||
|
||||
const redisPipeline = this.redisClient.pipeline();
|
||||
redisPipeline.zrem(`${name}:${currentWindow}`, element);
|
||||
redisPipeline.zrem(`${name}:${previousWindow}`, element);
|
||||
await redisPipeline.exec();
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public updateGlobalNotesRanking(noteId: MiNote['id'], score = 1): Promise<void> {
|
||||
return this.updateRankingOf('featuredGlobalNotesRanking', GLOBAL_NOTES_RANKING_WINDOW, noteId, score);
|
||||
|
|
@ -126,4 +137,9 @@ export class FeaturedService {
|
|||
public getHashtagsRanking(threshold: number): Promise<string[]> {
|
||||
return this.getRankingOf('featuredHashtagsRanking', HASHTAG_RANKING_WINDOW, threshold);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
public removeHashtagsFromRanking(hashtag: string): Promise<void> {
|
||||
return this.removeFromRanking('featuredHashtagsRanking', HASHTAG_RANKING_WINDOW, hashtag);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import { MiMeta } from '@/models/Meta.js';
|
|||
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import type { GlobalEvents } from '@/core/GlobalEventService.js';
|
||||
import { FeaturedService } from '@/core/FeaturedService.js';
|
||||
import type { OnApplicationShutdown } from '@nestjs/common';
|
||||
|
||||
@Injectable()
|
||||
|
|
@ -25,6 +26,7 @@ export class MetaService implements OnApplicationShutdown {
|
|||
@Inject(DI.db)
|
||||
private db: DataSource,
|
||||
|
||||
private featuredService: FeaturedService,
|
||||
private globalEventService: GlobalEventService,
|
||||
) {
|
||||
//this.onMessage = this.onMessage.bind(this);
|
||||
|
|
@ -95,6 +97,8 @@ export class MetaService implements OnApplicationShutdown {
|
|||
|
||||
@bindThis
|
||||
public async update(data: Partial<MiMeta>): Promise<MiMeta> {
|
||||
let before: MiMeta | undefined;
|
||||
|
||||
const updated = await this.db.transaction(async transactionalEntityManager => {
|
||||
const metas = await transactionalEntityManager.find(MiMeta, {
|
||||
order: {
|
||||
|
|
@ -102,10 +106,10 @@ export class MetaService implements OnApplicationShutdown {
|
|||
},
|
||||
});
|
||||
|
||||
const meta = metas[0];
|
||||
before = metas[0];
|
||||
|
||||
if (meta) {
|
||||
await transactionalEntityManager.update(MiMeta, meta.id, data);
|
||||
if (before) {
|
||||
await transactionalEntityManager.update(MiMeta, before.id, data);
|
||||
|
||||
const metas = await transactionalEntityManager.find(MiMeta, {
|
||||
order: {
|
||||
|
|
@ -119,6 +123,21 @@ export class MetaService implements OnApplicationShutdown {
|
|||
}
|
||||
});
|
||||
|
||||
if (data.hiddenTags) {
|
||||
process.nextTick(() => {
|
||||
const hiddenTags = new Set<string>(data.hiddenTags);
|
||||
if (before) {
|
||||
for (const previousHiddenTag of before.hiddenTags) {
|
||||
hiddenTags.delete(previousHiddenTag);
|
||||
}
|
||||
}
|
||||
|
||||
for (const hiddenTag of hiddenTags) {
|
||||
this.featuredService.removeHashtagsFromRanking(hiddenTag);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.globalEventService.publishInternalEvent('metaUpdated', updated);
|
||||
|
||||
return updated;
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||
}
|
||||
|
||||
// Check blocking
|
||||
if (data.renote && data.text == null && data.poll == null && (data.files == null || data.files.length === 0)) {
|
||||
if (this.isQuote(data)) {
|
||||
if (data.renote.userHost === null) {
|
||||
if (data.renote.userId !== user.id) {
|
||||
const blocked = await this.userBlockingService.checkBlocked(data.renote.userId, user.id);
|
||||
|
|
@ -590,7 +590,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||
|
||||
// If it is renote
|
||||
if (data.renote) {
|
||||
const type = data.text ? 'quote' : 'renote';
|
||||
const type = this.isQuote(data) ? 'quote' : 'renote';
|
||||
|
||||
// Notify
|
||||
if (data.renote.userHost === null) {
|
||||
|
|
@ -697,6 +697,12 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||
return false;
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private isQuote(note: Option): note is Option & { renote: MiNote } {
|
||||
// sync with misc/is-quote.ts
|
||||
return !!note.renote && (!!note.text || !!note.cw || (!!note.files && !!note.files.length) || !!note.poll);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private incRenoteCount(renote: MiNote) {
|
||||
this.notesRepository.createQueryBuilder().update()
|
||||
|
|
@ -762,7 +768,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
|||
private async renderNoteOrRenoteActivity(data: Option, note: MiNote) {
|
||||
if (data.localOnly) return null;
|
||||
|
||||
const content = data.renote && data.text == null && data.poll == null && (data.files == null || data.files.length === 0)
|
||||
const content = data.renote && !this.isQuote(data)
|
||||
? this.apRendererService.renderAnnounce(data.renote.uri ? data.renote.uri : `${this.config.url}/notes/${data.renote.id}`, note)
|
||||
: this.apRendererService.renderCreate(await this.apRendererService.renderNote(note, false), note);
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,14 @@
|
|||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import * as Redis from 'ioredis';
|
||||
import { In } from 'typeorm';
|
||||
import type { MiRole, MiRoleAssignment, RoleAssignmentsRepository, RolesRepository, UsersRepository } from '@/models/_.js';
|
||||
import { ModuleRef } from '@nestjs/core';
|
||||
import type {
|
||||
MiRole,
|
||||
MiRoleAssignment,
|
||||
RoleAssignmentsRepository,
|
||||
RolesRepository,
|
||||
UsersRepository,
|
||||
} from '@/models/_.js';
|
||||
import { MemoryKVCache, MemorySingleCache } from '@/misc/cache.js';
|
||||
import type { MiUser } from '@/models/User.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
|
|
@ -16,12 +23,13 @@ import { CacheService } from '@/core/CacheService.js';
|
|||
import type { RoleCondFormulaValue } from '@/models/Role.js';
|
||||
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
||||
import type { GlobalEvents } from '@/core/GlobalEventService.js';
|
||||
import { IdService } from '@/core/IdService.js';
|
||||
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
||||
import { IdService } from '@/core/IdService.js';
|
||||
import { ModerationLogService } from '@/core/ModerationLogService.js';
|
||||
import type { Packed } from '@/misc/json-schema.js';
|
||||
import { FanoutTimelineService } from '@/core/FanoutTimelineService.js';
|
||||
import type { OnApplicationShutdown } from '@nestjs/common';
|
||||
import { NotificationService } from '@/core/NotificationService.js';
|
||||
import type { OnApplicationShutdown, OnModuleInit } from '@nestjs/common';
|
||||
|
||||
export type RolePolicies = {
|
||||
gtlAvailable: boolean;
|
||||
|
|
@ -84,14 +92,17 @@ export const DEFAULT_POLICIES: RolePolicies = {
|
|||
};
|
||||
|
||||
@Injectable()
|
||||
export class RoleService implements OnApplicationShutdown {
|
||||
export class RoleService implements OnApplicationShutdown, OnModuleInit {
|
||||
private rolesCache: MemorySingleCache<MiRole[]>;
|
||||
private roleAssignmentByUserIdCache: MemoryKVCache<MiRoleAssignment[]>;
|
||||
private notificationService: NotificationService;
|
||||
|
||||
public static AlreadyAssignedError = class extends Error {};
|
||||
public static NotAssignedError = class extends Error {};
|
||||
|
||||
constructor(
|
||||
private moduleRef: ModuleRef,
|
||||
|
||||
@Inject(DI.redis)
|
||||
private redisClient: Redis.Redis,
|
||||
|
||||
|
|
@ -126,6 +137,10 @@ export class RoleService implements OnApplicationShutdown {
|
|||
this.redisForSub.on('message', this.onMessage);
|
||||
}
|
||||
|
||||
async onModuleInit() {
|
||||
this.notificationService = this.moduleRef.get(NotificationService.name);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async onMessage(_: string, data: string): Promise<void> {
|
||||
const obj = JSON.parse(data);
|
||||
|
|
@ -436,6 +451,12 @@ export class RoleService implements OnApplicationShutdown {
|
|||
|
||||
this.globalEventService.publishInternalEvent('userRoleAssigned', created);
|
||||
|
||||
if (role.isPublic) {
|
||||
this.notificationService.createNotification(userId, 'roleAssigned', {
|
||||
roleId: roleId,
|
||||
});
|
||||
}
|
||||
|
||||
if (moderator) {
|
||||
const user = await this.usersRepository.findOneByOrFail({ id: userId });
|
||||
this.moderationLogService.log(moderator, 'assignRole', {
|
||||
|
|
|
|||
|
|
@ -3,30 +3,34 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common';
|
||||
import { Inject, Injectable, OnApplicationShutdown, OnModuleInit } from '@nestjs/common';
|
||||
import * as Redis from 'ioredis';
|
||||
import { ModuleRef } from '@nestjs/core';
|
||||
import type { UserListMembershipsRepository } from '@/models/_.js';
|
||||
import type { MiUser } from '@/models/User.js';
|
||||
import type { MiUserList } from '@/models/UserList.js';
|
||||
import type { MiUserListMembership } from '@/models/UserListMembership.js';
|
||||
import { IdService } from '@/core/IdService.js';
|
||||
import type { GlobalEvents } from '@/core/GlobalEventService.js';
|
||||
import { GlobalEventService } from '@/core/GlobalEventService.js';
|
||||
import { DI } from '@/di-symbols.js';
|
||||
import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
||||
import { ProxyAccountService } from '@/core/ProxyAccountService.js';
|
||||
import { bindThis } from '@/decorators.js';
|
||||
import { RoleService } from '@/core/RoleService.js';
|
||||
import { QueueService } from '@/core/QueueService.js';
|
||||
import { RedisKVCache } from '@/misc/cache.js';
|
||||
import type { GlobalEvents } from '@/core/GlobalEventService.js';
|
||||
import { RoleService } from '@/core/RoleService.js';
|
||||
|
||||
@Injectable()
|
||||
export class UserListService implements OnApplicationShutdown {
|
||||
export class UserListService implements OnApplicationShutdown, OnModuleInit {
|
||||
public static TooManyUsersError = class extends Error {};
|
||||
|
||||
public membersCache: RedisKVCache<Set<string>>;
|
||||
private roleService: RoleService;
|
||||
|
||||
constructor(
|
||||
private moduleRef: ModuleRef,
|
||||
|
||||
@Inject(DI.redis)
|
||||
private redisClient: Redis.Redis,
|
||||
|
||||
|
|
@ -38,7 +42,6 @@ export class UserListService implements OnApplicationShutdown {
|
|||
|
||||
private userEntityService: UserEntityService,
|
||||
private idService: IdService,
|
||||
private roleService: RoleService,
|
||||
private globalEventService: GlobalEventService,
|
||||
private proxyAccountService: ProxyAccountService,
|
||||
private queueService: QueueService,
|
||||
|
|
@ -54,6 +57,10 @@ export class UserListService implements OnApplicationShutdown {
|
|||
this.redisForSub.on('message', this.onMessage);
|
||||
}
|
||||
|
||||
async onModuleInit() {
|
||||
this.roleService = this.moduleRef.get(RoleService.name);
|
||||
}
|
||||
|
||||
@bindThis
|
||||
private async onMessage(_: string, data: string): Promise<void> {
|
||||
const obj = JSON.parse(data);
|
||||
|
|
|
|||
|
|
@ -15,8 +15,8 @@ import type { Packed } from '@/misc/json-schema.js';
|
|||
import { bindThis } from '@/decorators.js';
|
||||
import { isNotNull } from '@/misc/is-not-null.js';
|
||||
import { FilterUnionByProperty, notificationTypes } from '@/types.js';
|
||||
import { RoleEntityService } from './RoleEntityService.js';
|
||||
import type { OnModuleInit } from '@nestjs/common';
|
||||
import type { CustomEmojiService } from '../CustomEmojiService.js';
|
||||
import type { UserEntityService } from './UserEntityService.js';
|
||||
import type { NoteEntityService } from './NoteEntityService.js';
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ const NOTE_REQUIRED_GROUPED_NOTIFICATION_TYPES = new Set(['note', 'mention', 're
|
|||
export class NotificationEntityService implements OnModuleInit {
|
||||
private userEntityService: UserEntityService;
|
||||
private noteEntityService: NoteEntityService;
|
||||
private customEmojiService: CustomEmojiService;
|
||||
private roleEntityService: RoleEntityService;
|
||||
|
||||
constructor(
|
||||
private moduleRef: ModuleRef,
|
||||
|
|
@ -43,14 +43,13 @@ export class NotificationEntityService implements OnModuleInit {
|
|||
|
||||
//private userEntityService: UserEntityService,
|
||||
//private noteEntityService: NoteEntityService,
|
||||
//private customEmojiService: CustomEmojiService,
|
||||
) {
|
||||
}
|
||||
|
||||
onModuleInit() {
|
||||
this.userEntityService = this.moduleRef.get('UserEntityService');
|
||||
this.noteEntityService = this.moduleRef.get('NoteEntityService');
|
||||
this.customEmojiService = this.moduleRef.get('CustomEmojiService');
|
||||
this.roleEntityService = this.moduleRef.get('RoleEntityService');
|
||||
}
|
||||
|
||||
@bindThis
|
||||
|
|
@ -81,6 +80,7 @@ export class NotificationEntityService implements OnModuleInit {
|
|||
detail: false,
|
||||
})
|
||||
) : undefined;
|
||||
const role = notification.type === 'roleAssigned' ? await this.roleEntityService.pack(notification.roleId) : undefined;
|
||||
|
||||
return await awaitAll({
|
||||
id: notification.id,
|
||||
|
|
@ -92,6 +92,9 @@ export class NotificationEntityService implements OnModuleInit {
|
|||
...(notification.type === 'reaction' ? {
|
||||
reaction: notification.reaction,
|
||||
} : {}),
|
||||
...(notification.type === 'roleAssigned' ? {
|
||||
role: role,
|
||||
} : {}),
|
||||
...(notification.type === 'achievementEarned' ? {
|
||||
achievement: notification.achievement,
|
||||
} : {}),
|
||||
|
|
@ -216,6 +219,8 @@ export class NotificationEntityService implements OnModuleInit {
|
|||
});
|
||||
}
|
||||
|
||||
const role = notification.type === 'roleAssigned' ? await this.roleEntityService.pack(notification.roleId) : undefined;
|
||||
|
||||
return await awaitAll({
|
||||
id: notification.id,
|
||||
createdAt: new Date(notification.createdAt).toISOString(),
|
||||
|
|
@ -226,6 +231,9 @@ export class NotificationEntityService implements OnModuleInit {
|
|||
...(notification.type === 'reaction' ? {
|
||||
reaction: notification.reaction,
|
||||
} : {}),
|
||||
...(notification.type === 'roleAssigned' ? {
|
||||
role: role,
|
||||
} : {}),
|
||||
...(notification.type === 'achievementEarned' ? {
|
||||
achievement: notification.achievement,
|
||||
} : {}),
|
||||
|
|
|
|||
|
|
@ -332,13 +332,13 @@ export class UserEntityService implements OnModuleInit {
|
|||
const profile = opts.detail ? (opts.userProfile ?? await this.userProfilesRepository.findOneByOrFail({ userId: user.id })) : null;
|
||||
|
||||
const followingCount = profile == null ? null :
|
||||
(profile.ffVisibility === 'public') || isMe ? user.followingCount :
|
||||
(profile.ffVisibility === 'followers') && (relation && relation.isFollowing) ? user.followingCount :
|
||||
(profile.followingVisibility === 'public') || isMe ? user.followingCount :
|
||||
(profile.followingVisibility === 'followers') && (relation && relation.isFollowing) ? user.followingCount :
|
||||
null;
|
||||
|
||||
const followersCount = profile == null ? null :
|
||||
(profile.ffVisibility === 'public') || isMe ? user.followersCount :
|
||||
(profile.ffVisibility === 'followers') && (relation && relation.isFollowing) ? user.followersCount :
|
||||
(profile.followersVisibility === 'public') || isMe ? user.followersCount :
|
||||
(profile.followersVisibility === 'followers') && (relation && relation.isFollowing) ? user.followersCount :
|
||||
null;
|
||||
|
||||
const isModerator = isMe && opts.detail ? this.roleService.isModerator(user) : null;
|
||||
|
|
@ -418,7 +418,8 @@ export class UserEntityService implements OnModuleInit {
|
|||
pinnedPageId: profile!.pinnedPageId,
|
||||
pinnedPage: profile!.pinnedPageId ? this.pageEntityService.pack(profile!.pinnedPageId, me) : null,
|
||||
publicReactions: profile!.publicReactions,
|
||||
ffVisibility: profile!.ffVisibility,
|
||||
followersVisibility: profile!.followersVisibility,
|
||||
followingVisibility: profile!.followingVisibility,
|
||||
twoFactorEnabled: profile!.twoFactorEnabled,
|
||||
usePasswordLessLogin: profile!.usePasswordLessLogin,
|
||||
securityKeys: profile!.twoFactorEnabled
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -7,5 +7,6 @@ import type { MiNote } from '@/models/Note.js';
|
|||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default function(note: MiNote): boolean {
|
||||
// sync with NoteCreateService.isQuote
|
||||
return note.renoteId != null && (note.text != null || note.hasPoll || (note.fileIds != null && note.fileIds.length > 0));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import { packedFlashSchema } from '@/models/json-schema/flash.js';
|
|||
import { packedAnnouncementSchema } from '@/models/json-schema/announcement.js';
|
||||
import { packedSigninSchema } from '@/models/json-schema/signin.js';
|
||||
import { packedRoleLiteSchema, packedRoleSchema } from '@/models/json-schema/role.js';
|
||||
import { packedAdSchema } from '@/models/json-schema/ad.js';
|
||||
|
||||
export const refs = {
|
||||
UserLite: packedUserLiteSchema,
|
||||
|
|
@ -49,6 +50,7 @@ export const refs = {
|
|||
User: packedUserSchema,
|
||||
|
||||
UserList: packedUserListSchema,
|
||||
Ad: packedAdSchema,
|
||||
Announcement: packedAnnouncementSchema,
|
||||
App: packedAppSchema,
|
||||
Note: packedNoteSchema,
|
||||
|
|
|
|||
|
|
@ -3,11 +3,10 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { notificationTypes } from '@/types.js';
|
||||
import { MiUser } from './User.js';
|
||||
import { MiNote } from './Note.js';
|
||||
import { MiFollowRequest } from './FollowRequest.js';
|
||||
import { MiAccessToken } from './AccessToken.js';
|
||||
import { MiRole } from './Role.js';
|
||||
|
||||
export type MiNotification = {
|
||||
type: 'note';
|
||||
|
|
@ -68,6 +67,11 @@ export type MiNotification = {
|
|||
id: string;
|
||||
createdAt: string;
|
||||
notifierId: MiUser['id'];
|
||||
} | {
|
||||
type: 'roleAssigned';
|
||||
id: string;
|
||||
createdAt: string;
|
||||
roleId: MiRole['id'];
|
||||
} | {
|
||||
type: 'achievementEarned';
|
||||
id: string;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
import { Entity, Column, Index, OneToOne, JoinColumn, PrimaryColumn } from 'typeorm';
|
||||
import { obsoleteNotificationTypes, ffVisibility, notificationTypes } from '@/types.js';
|
||||
import { obsoleteNotificationTypes, followingVisibilities, followersVisibilities, notificationTypes } from '@/types.js';
|
||||
import { id } from './util/id.js';
|
||||
import { MiUser } from './User.js';
|
||||
import { MiPage } from './Page.js';
|
||||
|
|
@ -94,10 +94,16 @@ export class MiUserProfile {
|
|||
public publicReactions: boolean;
|
||||
|
||||
@Column('enum', {
|
||||
enum: ffVisibility,
|
||||
enum: followingVisibilities,
|
||||
default: 'public',
|
||||
})
|
||||
public ffVisibility: typeof ffVisibility[number];
|
||||
public followingVisibility: typeof followingVisibilities[number];
|
||||
|
||||
@Column('enum', {
|
||||
enum: followersVisibilities,
|
||||
default: 'public',
|
||||
})
|
||||
public followersVisibility: typeof followersVisibilities[number];
|
||||
|
||||
@Column('varchar', {
|
||||
length: 128, nullable: true,
|
||||
|
|
|
|||
64
packages/backend/src/models/json-schema/ad.ts
Normal file
64
packages/backend/src/models/json-schema/ad.ts
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export const packedAdSchema = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: {
|
||||
type: 'string',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
format: 'id',
|
||||
example: 'xxxxxxxxxx',
|
||||
},
|
||||
expiresAt: {
|
||||
type: 'string',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
format: 'date-time',
|
||||
},
|
||||
startsAt: {
|
||||
type: 'string',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
format: 'date-time',
|
||||
},
|
||||
place: {
|
||||
type: 'string',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
},
|
||||
priority: {
|
||||
type: 'string',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
},
|
||||
ratio: {
|
||||
type: 'number',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
},
|
||||
imageUrl: {
|
||||
type: 'string',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
},
|
||||
memo: {
|
||||
type: 'string',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
},
|
||||
dayOfWeek: {
|
||||
type: 'integer',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
|
@ -74,6 +74,14 @@ export const packedUserLiteSchema = {
|
|||
format: 'url',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
offsetX: {
|
||||
type: 'number',
|
||||
nullable: false, optional: true,
|
||||
},
|
||||
offsetY: {
|
||||
type: 'number',
|
||||
nullable: false, optional: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -312,7 +320,12 @@ export const packedUserDetailedNotMeOnlySchema = {
|
|||
type: 'boolean',
|
||||
nullable: false, optional: false,
|
||||
},
|
||||
ffVisibility: {
|
||||
followingVisibility: {
|
||||
type: 'string',
|
||||
nullable: false, optional: false,
|
||||
enum: ['public', 'followers', 'private'],
|
||||
},
|
||||
followersVisibility: {
|
||||
type: 'string',
|
||||
nullable: false, optional: false,
|
||||
enum: ['public', 'followers', 'private'],
|
||||
|
|
@ -550,9 +563,7 @@ export const packedMeDetailedOnlySchema = {
|
|||
mention: notificationRecieveConfig,
|
||||
reaction: notificationRecieveConfig,
|
||||
pollEnded: notificationRecieveConfig,
|
||||
achievementEarned: notificationRecieveConfig,
|
||||
receiveFollowRequest: notificationRecieveConfig,
|
||||
followRequestAccepted: notificationRecieveConfig,
|
||||
},
|
||||
},
|
||||
emailNotificationTypes: {
|
||||
|
|
|
|||
|
|
@ -156,8 +156,8 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
|||
this.systemQueueWorker
|
||||
.on('active', (job) => systemLogger.debug(`active id=${job.id}`))
|
||||
.on('completed', (job, result) => systemLogger.debug(`completed(${result}) id=${job.id}`))
|
||||
.on('failed', (job, err) => systemLogger.warn(`failed(${err}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }))
|
||||
.on('error', (err: Error) => systemLogger.error(`error ${err}`, { e: renderError(err) }))
|
||||
.on('failed', (job, err) => systemLogger.warn(`failed(${err.stack}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }))
|
||||
.on('error', (err: Error) => systemLogger.error(`error ${err.stack}`, { e: renderError(err) }))
|
||||
.on('stalled', (jobId) => systemLogger.warn(`stalled id=${jobId}`));
|
||||
//#endregion
|
||||
|
||||
|
|
@ -194,8 +194,8 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
|||
this.dbQueueWorker
|
||||
.on('active', (job) => dbLogger.debug(`active id=${job.id}`))
|
||||
.on('completed', (job, result) => dbLogger.debug(`completed(${result}) id=${job.id}`))
|
||||
.on('failed', (job, err) => dbLogger.warn(`failed(${err}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }))
|
||||
.on('error', (err: Error) => dbLogger.error(`error ${err}`, { e: renderError(err) }))
|
||||
.on('failed', (job, err) => dbLogger.warn(`failed(${err.stack}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }))
|
||||
.on('error', (err: Error) => dbLogger.error(`error ${err.stack}`, { e: renderError(err) }))
|
||||
.on('stalled', (jobId) => dbLogger.warn(`stalled id=${jobId}`));
|
||||
//#endregion
|
||||
|
||||
|
|
@ -218,8 +218,8 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
|||
this.deliverQueueWorker
|
||||
.on('active', (job) => deliverLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`))
|
||||
.on('completed', (job, result) => deliverLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`))
|
||||
.on('failed', (job, err) => deliverLogger.warn(`failed(${err}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`))
|
||||
.on('error', (err: Error) => deliverLogger.error(`error ${err}`, { e: renderError(err) }))
|
||||
.on('failed', (job, err) => deliverLogger.warn(`failed(${err.stack}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`))
|
||||
.on('error', (err: Error) => deliverLogger.error(`error ${err.stack}`, { e: renderError(err) }))
|
||||
.on('stalled', (jobId) => deliverLogger.warn(`stalled id=${jobId}`));
|
||||
//#endregion
|
||||
|
||||
|
|
@ -242,8 +242,8 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
|||
this.inboxQueueWorker
|
||||
.on('active', (job) => inboxLogger.debug(`active ${getJobInfo(job, true)}`))
|
||||
.on('completed', (job, result) => inboxLogger.debug(`completed(${result}) ${getJobInfo(job, true)}`))
|
||||
.on('failed', (job, err) => inboxLogger.warn(`failed(${err}) ${getJobInfo(job)} activity=${job ? (job.data.activity ? job.data.activity.id : 'none') : '-'}`, { job, e: renderError(err) }))
|
||||
.on('error', (err: Error) => inboxLogger.error(`error ${err}`, { e: renderError(err) }))
|
||||
.on('failed', (job, err) => inboxLogger.warn(`failed(${err.stack}) ${getJobInfo(job)} activity=${job ? (job.data.activity ? job.data.activity.id : 'none') : '-'}`, { job, e: renderError(err) }))
|
||||
.on('error', (err: Error) => inboxLogger.error(`error ${err.stack}`, { e: renderError(err) }))
|
||||
.on('stalled', (jobId) => inboxLogger.warn(`stalled id=${jobId}`));
|
||||
//#endregion
|
||||
|
||||
|
|
@ -266,8 +266,8 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
|||
this.webhookDeliverQueueWorker
|
||||
.on('active', (job) => webhookLogger.debug(`active ${getJobInfo(job, true)} to=${job.data.to}`))
|
||||
.on('completed', (job, result) => webhookLogger.debug(`completed(${result}) ${getJobInfo(job, true)} to=${job.data.to}`))
|
||||
.on('failed', (job, err) => webhookLogger.warn(`failed(${err}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`))
|
||||
.on('error', (err: Error) => webhookLogger.error(`error ${err}`, { e: renderError(err) }))
|
||||
.on('failed', (job, err) => webhookLogger.warn(`failed(${err.stack}) ${getJobInfo(job)} to=${job ? job.data.to : '-'}`))
|
||||
.on('error', (err: Error) => webhookLogger.error(`error ${err.stack}`, { e: renderError(err) }))
|
||||
.on('stalled', (jobId) => webhookLogger.warn(`stalled id=${jobId}`));
|
||||
//#endregion
|
||||
|
||||
|
|
@ -295,8 +295,8 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
|||
this.relationshipQueueWorker
|
||||
.on('active', (job) => relationshipLogger.debug(`active id=${job.id}`))
|
||||
.on('completed', (job, result) => relationshipLogger.debug(`completed(${result}) id=${job.id}`))
|
||||
.on('failed', (job, err) => relationshipLogger.warn(`failed(${err}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }))
|
||||
.on('error', (err: Error) => relationshipLogger.error(`error ${err}`, { e: renderError(err) }))
|
||||
.on('failed', (job, err) => relationshipLogger.warn(`failed(${err.stack}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }))
|
||||
.on('error', (err: Error) => relationshipLogger.error(`error ${err.stack}`, { e: renderError(err) }))
|
||||
.on('stalled', (jobId) => relationshipLogger.warn(`stalled id=${jobId}`));
|
||||
//#endregion
|
||||
|
||||
|
|
@ -318,8 +318,8 @@ export class QueueProcessorService implements OnApplicationShutdown {
|
|||
this.objectStorageQueueWorker
|
||||
.on('active', (job) => objectStorageLogger.debug(`active id=${job.id}`))
|
||||
.on('completed', (job, result) => objectStorageLogger.debug(`completed(${result}) id=${job.id}`))
|
||||
.on('failed', (job, err) => objectStorageLogger.warn(`failed(${err}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }))
|
||||
.on('error', (err: Error) => objectStorageLogger.error(`error ${err}`, { e: renderError(err) }))
|
||||
.on('failed', (job, err) => objectStorageLogger.warn(`failed(${err.stack}) id=${job ? job.id : '-'}`, { job, e: renderError(err) }))
|
||||
.on('error', (err: Error) => objectStorageLogger.error(`error ${err.stack}`, { e: renderError(err) }))
|
||||
.on('stalled', (jobId) => objectStorageLogger.warn(`stalled id=${jobId}`));
|
||||
//#endregion
|
||||
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ export class ActivityPubServerService {
|
|||
return;
|
||||
}
|
||||
|
||||
const algo = match[1];
|
||||
const algo = match[1].toUpperCase();
|
||||
const digestValue = match[2];
|
||||
|
||||
if (algo !== 'SHA-256') {
|
||||
|
|
@ -195,11 +195,11 @@ export class ActivityPubServerService {
|
|||
//#region Check ff visibility
|
||||
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
|
||||
|
||||
if (profile.ffVisibility === 'private') {
|
||||
if (profile.followersVisibility === 'private') {
|
||||
reply.code(403);
|
||||
reply.header('Cache-Control', 'public, max-age=30');
|
||||
return;
|
||||
} else if (profile.ffVisibility === 'followers') {
|
||||
} else if (profile.followersVisibility === 'followers') {
|
||||
reply.code(403);
|
||||
reply.header('Cache-Control', 'public, max-age=30');
|
||||
return;
|
||||
|
|
@ -287,11 +287,11 @@ export class ActivityPubServerService {
|
|||
//#region Check ff visibility
|
||||
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
|
||||
|
||||
if (profile.ffVisibility === 'private') {
|
||||
if (profile.followingVisibility === 'private') {
|
||||
reply.code(403);
|
||||
reply.header('Cache-Control', 'public, max-age=30');
|
||||
return;
|
||||
} else if (profile.ffVisibility === 'followers') {
|
||||
} else if (profile.followingVisibility === 'followers') {
|
||||
reply.code(403);
|
||||
reply.header('Cache-Control', 'public, max-age=30');
|
||||
return;
|
||||
|
|
@ -493,8 +493,7 @@ export class ActivityPubServerService {
|
|||
|
||||
@bindThis
|
||||
public createServer(fastify: FastifyInstance, options: FastifyPluginOptions, done: (err?: Error) => void) {
|
||||
// addConstraintStrategy の型定義がおかしいため
|
||||
(fastify.addConstraintStrategy as any)({
|
||||
fastify.addConstraintStrategy({
|
||||
name: 'apOrHtml',
|
||||
storage() {
|
||||
const store = {} as any;
|
||||
|
|
|
|||
|
|
@ -61,6 +61,9 @@ export class FileServerService {
|
|||
public createServer(fastify: FastifyInstance, options: FastifyPluginOptions, done: (err?: Error) => void) {
|
||||
fastify.addHook('onRequest', (request, reply, done) => {
|
||||
reply.header('Content-Security-Policy', 'default-src \'none\'; img-src \'self\'; media-src \'self\'; style-src \'unsafe-inline\'');
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
reply.header('Access-Control-Allow-Origin', '*');
|
||||
}
|
||||
done();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { AbuseUserReportEntityService } from '@/core/entities/AbuseUserReportEnt
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import { DI } from '@/di-symbols.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ import { UserEntityService } from '@/core/entities/UserEntityService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { ApiError } from '@/server/api/error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
|
||||
|
|
@ -23,6 +25,11 @@ export const meta = {
|
|||
id: 'cb865949-8af5-4062-a88c-ef55e8786d1d',
|
||||
},
|
||||
},
|
||||
res: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'User',
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
|
|||
|
|
@ -13,8 +13,16 @@ import { ModerationLogService } from '@/core/ModerationLogService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
res: {
|
||||
type: 'object',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
ref: 'Ad',
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
@ -61,7 +69,18 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
ad: ad,
|
||||
});
|
||||
|
||||
return ad;
|
||||
return {
|
||||
id: ad.id,
|
||||
expiresAt: ad.expiresAt.toISOString(),
|
||||
startsAt: ad.startsAt.toISOString(),
|
||||
dayOfWeek: ad.dayOfWeek,
|
||||
url: ad.url,
|
||||
imageUrl: ad.imageUrl,
|
||||
priority: ad.priority,
|
||||
ratio: ad.ratio,
|
||||
place: ad.place,
|
||||
memo: ad.memo,
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,21 @@ import { DI } from '@/di-symbols.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
res: {
|
||||
type: 'array',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
items: {
|
||||
type: 'object',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
ref: 'Ad',
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
@ -44,7 +57,18 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
}
|
||||
const ads = await query.limit(ps.limit).getMany();
|
||||
|
||||
return ads;
|
||||
return ads.map(ad => ({
|
||||
id: ad.id,
|
||||
expiresAt: ad.expiresAt.toISOString(),
|
||||
startsAt: ad.startsAt.toISOString(),
|
||||
dayOfWeek: ad.dayOfWeek,
|
||||
url: ad.url,
|
||||
imageUrl: ad.imageUrl,
|
||||
memo: ad.memo,
|
||||
place: ad.place,
|
||||
priority: ad.priority,
|
||||
ratio: ad.ratio,
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { AnnouncementService } from '@/core/AnnouncementService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ import { IdService } from '@/core/IdService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { AvatarDecorationService } from '@/core/AvatarDecorationService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageAvatarDecorations',
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageAvatarDecorations',
|
||||
errors: {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import { AvatarDecorationService } from '@/core/AvatarDecorationService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageAvatarDecorations',
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageAvatarDecorations',
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { DI } from '@/di-symbols.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { DI } from '@/di-symbols.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { QueueService } from '@/core/QueueService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { DI } from '@/di-symbols.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { DriveFileEntityService } from '@/core/entities/DriveFileEntityService.j
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageCustomEmojis',
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageCustomEmojis',
|
||||
|
||||
|
|
@ -29,6 +31,8 @@ export const meta = {
|
|||
id: 'f7a3462c-4e6e-4069-8421-b9bd4f4c3975',
|
||||
},
|
||||
},
|
||||
|
||||
ref: 'EmojiDetailed',
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageCustomEmojis',
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageCustomEmojis',
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageCustomEmojis',
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import { Endpoint } from '@/server/api/endpoint-base.js';
|
|||
import { QueueService } from '@/core/QueueService.js';
|
||||
|
||||
export const meta = {
|
||||
secure: true,
|
||||
kind: 'write:admin',
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageCustomEmojis',
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import { sqlLikeEscape } from '@/misc/sql-like-escape.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageCustomEmojis',
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import { EmojiEntityService } from '@/core/entities/EmojiEntityService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageCustomEmojis',
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageCustomEmojis',
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageCustomEmojis',
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageCustomEmojis',
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { CustomEmojiService } from '@/core/CustomEmojiService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageCustomEmojis',
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireRolePolicy: 'canManageCustomEmojis',
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { DI } from '@/di-symbols.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { DI } from '@/di-symbols.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { QueueService } from '@/core/QueueService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,19 @@ export const meta = {
|
|||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
tags: ['admin'],
|
||||
res: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
tablename: { type: 'string' },
|
||||
indexname: { type: 'string' },
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ export const meta = {
|
|||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
tags: ['admin'],
|
||||
|
||||
res: {
|
||||
|
|
|
|||
|
|
@ -12,8 +12,29 @@ import { IdService } from '@/core/IdService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
res: {
|
||||
type: 'array',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
items: {
|
||||
type: 'object',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
properties: {
|
||||
ip: { type: 'string' },
|
||||
createdAt: {
|
||||
type: 'string',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
format: 'date-time',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { DI } from '@/di-symbols.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { DEFAULT_POLICIES } from '@/core/RoleService.js';
|
|||
export const meta = {
|
||||
tags: ['meta'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import { QueueService } from '@/core/QueueService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import type { DeliverQueue } from '@/core/QueueModule.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import type { InboxQueue } from '@/core/QueueModule.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import { QueueService } from '@/core/QueueService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import type { DbQueue, DeliverQueue, EndedPollNotificationQueue, InboxQueue, Obj
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { RelayService } from '@/core/RelayService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { RelayService } from '@/core/RelayService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { RoleService } from '@/core/RoleService.js';
|
|||
export const meta = {
|
||||
tags: ['admin', 'role'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import { RoleService } from '@/core/RoleService.js';
|
|||
export const meta = {
|
||||
tags: ['admin', 'role'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { RoleService } from '@/core/RoleService.js';
|
|||
export const meta = {
|
||||
tags: ['admin', 'role'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { RoleEntityService } from '@/core/entities/RoleEntityService.js';
|
|||
export const meta = {
|
||||
tags: ['admin', 'role'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { RoleEntityService } from '@/core/entities/RoleEntityService.js';
|
|||
export const meta = {
|
||||
tags: ['admin', 'role'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { RoleService } from '@/core/RoleService.js';
|
|||
export const meta = {
|
||||
tags: ['admin', 'role'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ import { MetaService } from '@/core/MetaService.js';
|
|||
export const meta = {
|
||||
tags: ['admin', 'role'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ import { RoleService } from '@/core/RoleService.js';
|
|||
export const meta = {
|
||||
tags: ['admin', 'role'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ import { ApiError } from '../../../error.js';
|
|||
export const meta = {
|
||||
tags: ['admin', 'role', 'users'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
requireCredential: false,
|
||||
requireAdmin: true,
|
||||
|
||||
|
|
@ -26,6 +28,20 @@ export const meta = {
|
|||
id: '224eff5e-2488-4b18-b3e7-f50d94421648',
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: { type: 'string', format: 'misskey:id' },
|
||||
createdAt: { type: 'string', format: 'date-time' },
|
||||
user: { ref: 'UserDetailed' },
|
||||
expiresAt: { type: 'string', format: 'date-time', nullable: true },
|
||||
},
|
||||
required: ['id', 'createdAt', 'user'],
|
||||
},
|
||||
}
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
@ -78,7 +94,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
id: assign.id,
|
||||
createdAt: this.idService.parse(assign.id).date.toISOString(),
|
||||
user: await this.userEntityService.pack(assign.user!, me, { detail: true }),
|
||||
expiresAt: assign.expiresAt,
|
||||
expiresAt: assign.expiresAt?.toISOString() ?? null,
|
||||
})));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ import { EmailService } from '@/core/EmailService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ export const meta = {
|
|||
|
||||
tags: ['admin', 'meta'],
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ export const meta = {
|
|||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
res: {
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ export const meta = {
|
|||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
nullable: false, optional: false,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ export const meta = {
|
|||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
|
||||
kind: 'read:admin',
|
||||
|
||||
res: {
|
||||
type: 'array',
|
||||
nullable: false, optional: false,
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ import { QueueService } from '@/core/QueueService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
@ -39,7 +41,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
|||
if (user == null) {
|
||||
throw new Error('user not found');
|
||||
}
|
||||
|
||||
|
||||
if (user.avatarId == null) return;
|
||||
|
||||
await this.usersRepository.update(user.id, {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import { DI } from '@/di-symbols.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { MetaService } from '@/core/MetaService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireAdmin: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ import { ModerationLogService } from '@/core/ModerationLogService.js';
|
|||
export const meta = {
|
||||
tags: ['admin'],
|
||||
|
||||
kind: 'write:admin',
|
||||
|
||||
requireCredential: true,
|
||||
requireModerator: true,
|
||||
} as const;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,23 @@ export const meta = {
|
|||
requireCredential: false,
|
||||
|
||||
tags: ['meta'],
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
nullable: true,
|
||||
properties: {
|
||||
params: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
name: { type: 'string' },
|
||||
type: { type: 'string' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,92 @@ export const meta = {
|
|||
|
||||
allowGet: true,
|
||||
cacheSec: 60 * 60,
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
properties: {
|
||||
topSubInstances: {
|
||||
type: 'array',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
items: {
|
||||
properties: {
|
||||
id: { type: 'string' },
|
||||
firstRetrievedAt: { type: 'string' },
|
||||
host: { type: 'string' },
|
||||
usersCount: { type: 'number' },
|
||||
notesCount: { type: 'number' },
|
||||
followingCount: { type: 'number' },
|
||||
followersCount: { type: 'number' },
|
||||
isNotResponding: { type: 'boolean' },
|
||||
isSuspended: { type: 'boolean' },
|
||||
isBlocked: { type: 'boolean' },
|
||||
softwareName: { type: 'string' },
|
||||
softwareVersion: { type: 'string' },
|
||||
openRegistrations: { type: 'boolean' },
|
||||
name: { type: 'string' },
|
||||
description: { type: 'string' },
|
||||
maintainerName: { type: 'string' },
|
||||
maintainerEmail: { type: 'string' },
|
||||
isSilenced: { type: 'boolean' },
|
||||
iconUrl: { type: 'string' },
|
||||
faviconUrl: { type: 'string' },
|
||||
themeColor: { type: 'string' },
|
||||
infoUpdatedAt: {
|
||||
type: 'string',
|
||||
nullable: true,
|
||||
},
|
||||
latestRequestReceivedAt: {
|
||||
type: 'string',
|
||||
nullable: true,
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
otherFollowersCount: { type: 'number' },
|
||||
topPubInstances: {
|
||||
type: 'array',
|
||||
optional: false,
|
||||
nullable: false,
|
||||
items: {
|
||||
properties: {
|
||||
id: { type: 'string' },
|
||||
firstRetrievedAt: { type: 'string' },
|
||||
host: { type: 'string' },
|
||||
usersCount: { type: 'number' },
|
||||
notesCount: { type: 'number' },
|
||||
followingCount: { type: 'number' },
|
||||
followersCount: { type: 'number' },
|
||||
isNotResponding: { type: 'boolean' },
|
||||
isSuspended: { type: 'boolean' },
|
||||
isBlocked: { type: 'boolean' },
|
||||
softwareName: { type: 'string' },
|
||||
softwareVersion: { type: 'string' },
|
||||
openRegistrations: { type: 'boolean' },
|
||||
name: { type: 'string' },
|
||||
description: { type: 'string' },
|
||||
maintainerName: { type: 'string' },
|
||||
maintainerEmail: { type: 'string' },
|
||||
isSilenced: { type: 'boolean' },
|
||||
iconUrl: { type: 'string' },
|
||||
faviconUrl: { type: 'string' },
|
||||
themeColor: { type: 'string' },
|
||||
infoUpdatedAt: {
|
||||
type: 'string',
|
||||
nullable: true,
|
||||
},
|
||||
latestRequestReceivedAt: {
|
||||
type: 'string',
|
||||
nullable: true,
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
otherFollowingCount: { type: 'number' },
|
||||
},
|
||||
}
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,18 @@ export const meta = {
|
|||
id: '693ba8ba-b486-40df-a174-72f8279b56a4',
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
type: {
|
||||
type: 'string',
|
||||
},
|
||||
data: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,18 @@ export const meta = {
|
|||
requireCredential: false,
|
||||
allowGet: true,
|
||||
cacheSec: 60 * 3,
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
items: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,12 @@ export const meta = {
|
|||
|
||||
errors: {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Flash',
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,16 @@ export const meta = {
|
|||
requireCredential: false,
|
||||
allowGet: true,
|
||||
cacheSec: 60 * 1,
|
||||
res: {
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
properties: {
|
||||
count: {
|
||||
type: 'number',
|
||||
nullable: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
|
|||
|
|
@ -32,6 +32,16 @@ export const meta = {
|
|||
id: '798d6847-b1ed-4f9c-b1f9-163c42655995',
|
||||
},
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object',
|
||||
nullable: false,
|
||||
optional: false,
|
||||
properties: {
|
||||
id: { type: 'string' },
|
||||
name: { type: 'string' },
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const paramDef = {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue