Merge branch 'develop' into mkjs-add-flash

This commit is contained in:
かっこかり 2023-07-31 21:56:35 +09:00 committed by GitHub
commit 9de773e35e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 1447 additions and 1069 deletions

View File

@ -18,7 +18,9 @@
- OAuth 2.0のサポート
### Client
-
- Enhance: 自分が押したリアクションのデザインを改善
- Fix: サーバー情報画面(`/instance-info/{domain}`)でブロックができないのを修正
- Fix: 未読のお知らせの「わかった」をクリック・タップしてもその場で「わかった」が消えない問題を修正
### Server
-

View File

@ -44,7 +44,7 @@
"lodash": "4.17.21"
},
"dependencies": {
"execa": "7.1.1",
"execa": "7.2.0",
"gulp": "4.0.2",
"gulp-cssnano": "2.1.3",
"gulp-rename": "2.0.0",
@ -54,13 +54,13 @@
"typescript": "5.1.6"
},
"devDependencies": {
"@types/gulp": "4.0.10",
"@types/gulp-rename": "2.0.1",
"@typescript-eslint/eslint-plugin": "5.61.0",
"@typescript-eslint/parser": "5.61.0",
"@types/gulp": "4.0.13",
"@types/gulp-rename": "2.0.2",
"@typescript-eslint/eslint-plugin": "6.2.0",
"@typescript-eslint/parser": "6.2.0",
"cross-env": "7.0.3",
"cypress": "12.17.1",
"eslint": "8.45.0",
"cypress": "12.17.2",
"eslint": "8.46.0",
"start-server-and-test": "2.0.0"
},
"optionalDependencies": {

View File

@ -59,25 +59,25 @@
"@aws-sdk/client-s3": "3.367.0",
"@aws-sdk/lib-storage": "3.367.0",
"@aws-sdk/node-http-handler": "3.360.0",
"@bull-board/api": "5.6.1",
"@bull-board/fastify": "5.6.1",
"@bull-board/ui": "5.6.1",
"@bull-board/api": "5.7.1",
"@bull-board/fastify": "5.7.1",
"@bull-board/ui": "5.7.1",
"@discordapp/twemoji": "14.1.2",
"@fastify/accepts": "4.2.0",
"@fastify/cookie": "8.3.0",
"@fastify/cors": "8.3.0",
"@fastify/express": "2.3.0",
"@fastify/http-proxy": "9.2.1",
"@fastify/multipart": "7.7.1",
"@fastify/multipart": "7.7.3",
"@fastify/static": "6.10.2",
"@fastify/view": "8.0.0",
"@nestjs/common": "10.1.0",
"@nestjs/core": "10.1.0",
"@nestjs/testing": "10.1.0",
"@nestjs/common": "10.1.2",
"@nestjs/core": "10.1.2",
"@nestjs/testing": "10.1.2",
"@peertube/http-signature": "1.7.0",
"@sinonjs/fake-timers": "10.3.0",
"@swc/cli": "0.1.62",
"@swc/core": "1.3.70",
"@swc/core": "1.3.72",
"accepts": "1.3.8",
"ajv": "8.12.0",
"archiver": "5.3.1",
@ -85,9 +85,9 @@
"bcryptjs": "2.4.3",
"blurhash": "2.0.5",
"body-parser": "1.20.2",
"bullmq": "4.4.0",
"bullmq": "4.6.3",
"cacheable-lookup": "7.0.0",
"cbor": "9.0.0",
"cbor": "9.0.1",
"chalk": "5.3.0",
"chalk-template": "1.1.0",
"chokidar": "3.5.3",
@ -96,7 +96,7 @@
"content-disposition": "0.5.4",
"date-fns": "2.30.0",
"deep-email-validator": "0.1.21",
"fastify": "4.20.0",
"fastify": "4.21.0",
"feed": "4.2.2",
"file-type": "18.5.0",
"fluent-ffmpeg": "2.1.2",
@ -104,7 +104,7 @@
"got": "13.0.0",
"happy-dom": "10.0.3",
"hpagent": "1.2.0",
"http-link-header": "1.1.0",
"http-link-header": "1.1.1",
"ioredis": "5.3.2",
"ip-cidr": "3.1.0",
"ipaddr.js": "2.1.0",
@ -121,14 +121,14 @@
"misskey-js": "workspace:*",
"ms": "3.0.0-canary.1",
"nested-property": "4.0.0",
"node-fetch": "3.3.1",
"nodemailer": "6.9.3",
"node-fetch": "3.3.2",
"nodemailer": "6.9.4",
"nsfwjs": "2.4.2",
"oauth": "0.10.0",
"oauth2orize": "1.11.1",
"oauth2orize-pkce": "0.1.2",
"os-utils": "0.0.14",
"otpauth": "9.1.3",
"otpauth": "9.1.4",
"parse5": "7.1.2",
"pg": "8.11.1",
"pkce-challenge": "4.0.1",
@ -140,20 +140,20 @@
"qrcode": "1.5.3",
"random-seed": "0.3.0",
"ratelimiter": "3.4.1",
"re2": "1.19.1",
"re2": "1.20.1",
"redis-lock": "0.1.4",
"reflect-metadata": "0.1.13",
"rename": "1.0.4",
"rss-parser": "3.13.0",
"rxjs": "7.8.1",
"sanitize-html": "2.11.0",
"sharp": "0.32.3",
"sharp": "0.32.4",
"sharp-read-bmp": "github:misskey-dev/sharp-read-bmp",
"slacc": "0.0.10",
"strict-event-emitter-types": "2.0.0",
"stringz": "2.1.0",
"summaly": "github:misskey-dev/summaly",
"systeminformation": "5.18.7",
"systeminformation": "5.18.9",
"tinycolor2": "1.6.0",
"tmp": "0.2.1",
"tsc-alias": "1.8.7",
@ -163,13 +163,13 @@
"typescript": "5.1.6",
"ulid": "2.3.0",
"vary": "1.1.2",
"web-push": "3.6.3",
"web-push": "3.6.4",
"ws": "8.13.0",
"xev": "3.0.2"
},
"devDependencies": {
"@jest/globals": "29.6.1",
"@swc/jest": "0.2.26",
"@jest/globals": "29.6.2",
"@swc/jest": "0.2.27",
"@types/accepts": "1.3.5",
"@types/archiver": "5.3.2",
"@types/bcryptjs": "2.4.2",
@ -186,9 +186,9 @@
"@types/jsrsasign": "10.5.8",
"@types/mime-types": "2.1.1",
"@types/ms": "0.7.31",
"@types/node": "20.4.2",
"@types/node": "20.4.5",
"@types/node-fetch": "3.0.3",
"@types/nodemailer": "6.4.8",
"@types/nodemailer": "6.4.9",
"@types/oauth": "0.9.1",
"@types/oauth2orize": "1.11.0",
"@types/oauth2orize-pkce": "0.1.0",
@ -209,15 +209,15 @@
"@types/vary": "1.1.0",
"@types/web-push": "3.3.2",
"@types/ws": "8.5.5",
"@typescript-eslint/eslint-plugin": "5.61.0",
"@typescript-eslint/parser": "5.61.0",
"@typescript-eslint/eslint-plugin": "6.2.0",
"@typescript-eslint/parser": "6.2.0",
"aws-sdk-client-mock": "3.0.0",
"cross-env": "7.0.3",
"eslint": "8.45.0",
"eslint-plugin-import": "2.27.5",
"execa": "7.1.1",
"jest": "29.6.1",
"jest-mock": "29.6.1",
"eslint": "8.46.0",
"eslint-plugin-import": "2.28.0",
"execa": "7.2.0",
"jest": "29.6.2",
"jest-mock": "29.6.2",
"simple-oauth2": "5.0.0"
}
}

View File

@ -197,7 +197,7 @@ function convertRedisOptions(options: RedisOptionsSource, host: string): RedisOp
...options,
password: options.pass,
prefix: options.prefix ?? host,
family: options.family == null ? 0 : options.family,
family: options.family ?? 0,
keyPrefix: `${options.prefix ?? host}:`,
db: options.db ?? 0,
};

View File

@ -574,9 +574,7 @@ export class DriveService {
file.maybePorn = info.porn;
file.isSensitive = user
? this.userEntityService.isLocalUser(user) && profile!.alwaysMarkNsfw ? true :
(sensitive !== null && sensitive !== undefined)
? sensitive
: false
sensitive ?? false
: false;
if (info.sensitive && profile!.autoSensitive) file.isSensitive = true;

View File

@ -108,7 +108,7 @@ export class FetchInstanceMetadataService {
if (name) updates.name = name;
if (description) updates.description = description;
if (icon || favicon) updates.iconUrl = (icon && !icon.includes('data:image/png;base64')) ? icon : favicon;
if (icon ?? favicon) updates.iconUrl = (icon && !icon.includes('data:image/png;base64')) ? icon : favicon;
if (favicon) updates.faviconUrl = favicon;
if (themeColor) updates.themeColor = themeColor;

View File

@ -93,7 +93,7 @@ export class HttpRequestService {
*/
@bindThis
public getAgentByUrl(url: URL, bypassProxy = false): http.Agent | https.Agent {
if (bypassProxy || (this.config.proxyBypassHosts || []).includes(url.hostname)) {
if (bypassProxy || (this.config.proxyBypassHosts ?? []).includes(url.hostname)) {
return url.protocol === 'http:' ? this.http : this.https;
} else {
return url.protocol === 'http:' ? this.httpAgent : this.httpsAgent;

View File

@ -367,7 +367,7 @@ export class NoteCreateService implements OnApplicationShutdown {
name: data.name,
text: data.text,
hasPoll: data.poll != null,
cw: data.cw == null ? null : data.cw,
cw: data.cw ?? null,
tags: tags.map(tag => normalizeForSearch(tag)),
emojis,
userId: user.id,
@ -402,7 +402,7 @@ export class NoteCreateService implements OnApplicationShutdown {
const url = profile != null ? profile.url : null;
return {
uri: u.uri,
url: url == null ? undefined : url,
url: url ?? undefined,
username: u.username,
host: u.host,
} as IMentionedRemoteUsers[0];

View File

@ -200,7 +200,7 @@ export class ApNoteService {
// 引用
let quote: Note | undefined | null = null;
if (note._misskey_quote || note.quoteUrl) {
if (note._misskey_quote ?? note.quoteUrl) {
const tryResolveNote = async (uri: string): Promise<
| { status: 'ok'; res: Note }
| { status: 'permerror' | 'temperror' }

View File

@ -232,7 +232,7 @@ export function createPostgresDataSource(config: Config) {
options: {
host: config.redis.host,
port: config.redis.port,
family: config.redis.family == null ? 0 : config.redis.family,
family: config.redis.family ?? 0,
password: config.redis.pass,
keyPrefix: `${config.redis.prefix}:query:`,
db: config.redis.db ?? 0,

View File

@ -193,7 +193,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
}
let files: DriveFile[] = [];
const fileIds = ps.fileIds != null ? ps.fileIds : ps.mediaIds != null ? ps.mediaIds : null;
const fileIds = ps.fileIds ?? ps.mediaIds ?? null;
if (fileIds != null) {
files = await this.driveFilesRepository.createQueryBuilder('file')
.where('file.userId = :userId AND file.id IN (:...fileIds)', {

View File

@ -117,13 +117,17 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
await this.pagesRepository.update(page.id, {
updatedAt: new Date(),
title: ps.title,
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
name: ps.name === undefined ? page.name : ps.name,
summary: ps.summary === undefined ? page.summary : ps.summary,
content: ps.content,
variables: ps.variables,
script: ps.script,
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
alignCenter: ps.alignCenter === undefined ? page.alignCenter : ps.alignCenter,
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
hideTitleWhenPinned: ps.hideTitleWhenPinned === undefined ? page.hideTitleWhenPinned : ps.hideTitleWhenPinned,
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
font: ps.font === undefined ? page.font : ps.font,
eyeCatchingImageId: ps.eyeCatchingImageId === null
? null

View File

@ -21,9 +21,6 @@ module.exports = {
'allowSingleExtends': true,
},
],
'@typescript-eslint/prefer-nullish-coalescing': [
'error',
],
// window の禁止理由: グローバルスコープと衝突し、予期せぬ結果を招くため
// e の禁止理由: error や event など、複数のキーワードの頭文字であり分かりにくいため
'id-denylist': ['error', 'window', 'e'],

View File

@ -21,9 +21,9 @@
"@rollup/plugin-replace": "5.0.2",
"@rollup/pluginutils": "5.0.2",
"@syuilo/aiscript": "0.15.0",
"@tabler/icons-webfont": "2.25.0",
"@tabler/icons-webfont": "2.30.0",
"@vitejs/plugin-vue": "4.2.3",
"@vue-macros/reactivity-transform": "0.3.15",
"@vue-macros/reactivity-transform": "0.3.16",
"@vue/compiler-sfc": "3.3.4",
"astring": "1.8.6",
"autosize": "6.0.1",
@ -31,13 +31,13 @@
"browser-image-resizer": "github:misskey-dev/browser-image-resizer#v2.2.1-misskey.3",
"buraha": "0.0.1",
"canvas-confetti": "1.6.0",
"chart.js": "4.3.0",
"chart.js": "4.3.2",
"chartjs-adapter-date-fns": "3.0.0",
"chartjs-chart-matrix": "2.0.1",
"chartjs-plugin-gradient": "0.6.1",
"chartjs-plugin-zoom": "2.0.1",
"chromatic": "6.19.9",
"compare-versions": "5.0.3",
"compare-versions": "6.0.0",
"cropperjs": "2.0.0-beta.3",
"date-fns": "2.30.0",
"escape-regexp": "0.0.1",
@ -55,14 +55,14 @@
"prismjs": "1.29.0",
"punycode": "2.3.0",
"querystring": "0.2.1",
"rollup": "3.26.3",
"rollup": "3.27.0",
"s-age": "1.1.2",
"sanitize-html": "2.11.0",
"sass": "1.63.6",
"sass": "1.64.1",
"strict-event-emitter-types": "2.0.0",
"syuilo-password-strength": "0.0.1",
"textarea-caret": "3.1.0",
"three": "0.154.0",
"three": "0.155.0",
"throttle-debounce": "5.0.0",
"tinycolor2": "1.6.0",
"tsc-alias": "1.8.7",
@ -71,7 +71,7 @@
"typescript": "5.1.6",
"uuid": "9.0.0",
"vanilla-tilt": "1.8.0",
"vite": "4.4.4",
"vite": "4.4.7",
"vue": "3.3.4",
"vue-prism-editor": "2.0.0-alpha.2",
"vuedraggable": "next"
@ -103,29 +103,29 @@
"@types/gulp-rename": "2.0.2",
"@types/matter-js": "0.18.5",
"@types/micromatch": "4.0.2",
"@types/node": "20.4.2",
"@types/node": "20.4.5",
"@types/punycode": "2.1.0",
"@types/sanitize-html": "2.9.0",
"@types/testing-library__jest-dom": "5.14.8",
"@types/testing-library__jest-dom": "5.14.9",
"@types/throttle-debounce": "5.0.0",
"@types/tinycolor2": "1.4.3",
"@types/uuid": "9.0.2",
"@types/websocket": "1.0.5",
"@types/ws": "8.5.5",
"@typescript-eslint/eslint-plugin": "5.61.0",
"@typescript-eslint/parser": "5.61.0",
"@typescript-eslint/eslint-plugin": "6.2.0",
"@typescript-eslint/parser": "6.2.0",
"@vitest/coverage-v8": "0.33.0",
"@vue/runtime-core": "3.3.4",
"acorn": "8.10.0",
"cross-env": "7.0.3",
"cypress": "12.17.1",
"eslint": "8.45.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-vue": "9.15.1",
"fast-glob": "3.3.0",
"cypress": "12.17.2",
"eslint": "8.46.0",
"eslint-plugin-import": "2.28.0",
"eslint-plugin-vue": "9.16.1",
"fast-glob": "3.3.1",
"happy-dom": "10.0.3",
"micromatch": "4.0.5",
"msw": "1.2.2",
"msw": "1.2.3",
"msw-storybook-addon": "1.8.0",
"nodemon": "3.0.1",
"prettier": "3.0.0",
@ -139,6 +139,6 @@
"vitest": "0.33.0",
"vitest-fetch-mock": "0.2.2",
"vue-eslint-parser": "9.3.1",
"vue-tsc": "1.8.5"
"vue-tsc": "1.8.8"
}
}

View File

@ -117,13 +117,13 @@ function fetchAccount(token: string, id?: string, forceShowDialog?: boolean): Pr
.then(async res => {
if (res.error) {
if (res.error.id === 'a8c724b3-6e9c-4b46-b1a8-bc3ed6258370') {
// SUSPENDED
// SUSPENDED
if (forceShowDialog || $i && (token === $i.token || id === $i.id)) {
await showSuspendedDialog();
}
} else if (res.error.id === 'e5b3b9f0-2b8f-4b9f-9c1f-8c5c1b2e1b1a') {
// USER_IS_DELETED
// アカウントが削除されている
// USER_IS_DELETED
// アカウントが削除されている
if (forceShowDialog || $i && (token === $i.token || id === $i.id)) {
await alert({
type: 'error',
@ -132,8 +132,8 @@ function fetchAccount(token: string, id?: string, forceShowDialog?: boolean): Pr
});
}
} else if (res.error.id === 'b0a7f5f8-dc2f-4171-b91f-de88ad238e14') {
// AUTHENTICATION_FAILED
// トークンが無効化されていたりアカウントが削除されたりしている
// AUTHENTICATION_FAILED
// トークンが無効化されていたりアカウントが削除されたりしている
if (forceShowDialog || $i && (token === $i.token || id === $i.id)) {
await alert({
type: 'error',

View File

@ -168,10 +168,10 @@ export default defineComponent({
> *:empty {
display: none;
}
> *:not(:last-child) {
margin-bottom: var(--margin);
}
&:not(.date-separated-list-nogap) > *:not(:last-child) {
margin-bottom: var(--margin);
}
}

View File

@ -143,15 +143,13 @@ useTooltip(buttonEl, async (showing) => {
}
}
&.reacted {
background: var(--accent);
&:hover {
background: var(--accent);
}
&.reacted, &.reacted:hover {
background: var(--accentedBg);
color: var(--accent);
border: 1px solid var(--accent);
> .count {
color: var(--fgOnAccent);
color: var(--accent);
}
> .icon {

View File

@ -60,7 +60,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template v-if="showActions">
<div v-if="tweetId" :class="$style.action">
<MkButton :small="true" inline @click="tweetExpanded = true">
<i class="ti ti-brand-twitter"></i> {{ i18n.ts.expandTweet }}
<i class="ti ti-brand-x"></i> {{ i18n.ts.expandTweet }}
</MkButton>
</div>
<div v-if="!playerEnabled && player.url" :class="$style.action">

View File

@ -7,15 +7,15 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkStickyContainer>
<template #header><MkPageHeader :actions="headerActions" :tabs="headerTabs"/></template>
<MkSpacer :contentMax="800">
<MkPagination v-slot="{items}" :pagination="pagination" class="ruryvtyk _gaps_m">
<section v-for="(announcement, i) in items" :key="announcement.id" class="announcement _panel">
<MkPagination ref="paginationEl" v-slot="{items}" :pagination="pagination" class="ruryvtyk _gaps_m">
<section v-for="announcement in items" :key="announcement.id" class="announcement _panel">
<div class="header"><span v-if="$i && !announcement.isRead">🆕 </span>{{ announcement.title }}</div>
<div class="content">
<Mfm :text="announcement.text"/>
<img v-if="announcement.imageUrl" :src="announcement.imageUrl"/>
</div>
<div v-if="$i && !announcement.isRead" class="footer">
<MkButton primary @click="read(items, announcement, i)"><i class="ti ti-check"></i> {{ i18n.ts.gotIt }}</MkButton>
<MkButton primary @click="read(announcement.id)"><i class="ti ti-check"></i> {{ i18n.ts.gotIt }}</MkButton>
</div>
</section>
</MkPagination>
@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
import { } from 'vue';
import { ref } from 'vue';
import MkPagination from '@/components/MkPagination.vue';
import MkButton from '@/components/MkButton.vue';
import * as os from '@/os';
@ -37,13 +37,15 @@ const pagination = {
limit: 10,
};
// TODO:
function read(items, announcement, i) {
items[i] = {
...announcement,
isRead: true,
};
os.api('i/read-announcement', { announcementId: announcement.id });
const paginationEl = ref<InstanceType<typeof MkPagination>>();
function read(id: string) {
if (!paginationEl.value) return;
paginationEl.value.updateItem(id, announcement => {
announcement.isRead = true;
return announcement;
});
os.api('i/read-announcement', { announcementId: id });
}
const headerActions = $computed(() => []);

View File

@ -34,8 +34,8 @@ SPDX-License-Identifier: AGPL-3.0-only
<FormSection v-if="iAmModerator">
<template #label>Moderation</template>
<div class="_gaps_s">
<MkSwitch v-model="suspended" @update:modelValue="toggleSuspend">{{ i18n.ts.stopActivityDelivery }}</MkSwitch>
<MkSwitch v-model="isBlocked" @update:modelValue="toggleBlock">{{ i18n.ts.blockThisInstance }}</MkSwitch>
<MkSwitch v-model="suspended" :disabled="!instance" @update:modelValue="toggleSuspend">{{ i18n.ts.stopActivityDelivery }}</MkSwitch>
<MkSwitch v-model="isBlocked" :disabled="!meta || !instance" @update:modelValue="toggleBlock">{{ i18n.ts.blockThisInstance }}</MkSwitch>
<MkButton @click="refreshMetadata"><i class="ti ti-refresh"></i> Refresh metadata</MkButton>
</div>
</FormSection>
@ -129,7 +129,7 @@ import MkSelect from '@/components/MkSelect.vue';
import MkSwitch from '@/components/MkSwitch.vue';
import * as os from '@/os';
import number from '@/filters/number';
import { iAmModerator } from '@/account';
import { iAmModerator, iAmAdmin } from '@/account';
import { definePageMetadata } from '@/scripts/page-metadata';
import { i18n } from '@/i18n';
import MkUserCardMini from '@/components/MkUserCardMini.vue';
@ -143,11 +143,11 @@ const props = defineProps<{
let tab = $ref('overview');
let chartSrc = $ref('instance-requests');
let meta = $ref<misskey.entities.DetailedInstanceMetadata | null>(null);
let meta = $ref<misskey.entities.AdminInstanceMetadata | null>(null);
let instance = $ref<misskey.entities.Instance | null>(null);
let suspended = $ref(false);
let isBlocked = $ref(false);
let faviconUrl = $ref(null);
let faviconUrl = $ref<string | null>(null);
const usersPagination = {
endpoint: iAmModerator ? 'admin/show-users' : 'users' as const,
@ -160,7 +160,10 @@ const usersPagination = {
offsetMode: true,
};
async function fetch() {
async function fetch(): Promise<void> {
if (iAmAdmin) {
meta = await os.api('admin/meta');
}
instance = await os.api('federation/show-instance', {
host: props.host,
});
@ -169,21 +172,25 @@ async function fetch() {
faviconUrl = getProxiedImageUrlNullable(instance.faviconUrl, 'preview') ?? getProxiedImageUrlNullable(instance.iconUrl, 'preview');
}
async function toggleBlock(ev) {
if (meta == null) return;
async function toggleBlock(): Promise<void> {
if (!meta) throw new Error('No meta?');
if (!instance) throw new Error('No instance?');
const { host } = instance;
await os.api('admin/update-meta', {
blockedHosts: isBlocked ? meta.blockedHosts.concat([instance.host]) : meta.blockedHosts.filter(x => x !== instance.host),
blockedHosts: isBlocked ? meta.blockedHosts.concat([host]) : meta.blockedHosts.filter(x => x !== host),
});
}
async function toggleSuspend(v) {
async function toggleSuspend(): Promise<void> {
if (!instance) throw new Error('No instance?');
await os.api('admin/federation/update-instance', {
host: instance.host,
isSuspended: suspended,
});
}
function refreshMetadata() {
function refreshMetadata(): void {
if (!instance) throw new Error('No instance?');
os.api('admin/federation/refresh-remote-instance-metadata', {
host: instance.host,
});

View File

@ -17,6 +17,11 @@ export type Acct = {
// @public (undocumented)
type Ad = TODO_2;
// @public (undocumented)
type AdminInstanceMetadata = DetailedInstanceMetadata & {
blockedHosts: string[];
};
// @public (undocumented)
type Announcement = {
id: ID;
@ -329,8 +334,8 @@ export type Endpoints = {
res: TODO;
};
'admin/meta': {
req: TODO;
res: TODO;
req: NoParams;
res: AdminInstanceMetadata;
};
'admin/reset-password': {
req: TODO;
@ -2226,6 +2231,7 @@ declare namespace entities {
LiteInstanceMetadata,
DetailedInstanceMetadata,
InstanceMetadata,
AdminInstanceMetadata,
ServerInfo,
Stats,
Page,
@ -2317,7 +2323,7 @@ type ID = string;
// @public (undocumented)
type Instance = {
id: ID;
caughtAt: DateString;
firstRetrievedAt: DateString;
host: string;
usersCount: number;
notesCount: number;
@ -2331,6 +2337,7 @@ type Instance = {
lastCommunicatedAt: DateString;
isNotResponding: boolean;
isSuspended: boolean;
isBlocked: boolean;
softwareName: string | null;
softwareVersion: string | null;
openRegistrations: boolean | null;

View File

@ -20,14 +20,14 @@
"url": "git+https://github.com/misskey-dev/misskey.js.git"
},
"devDependencies": {
"@microsoft/api-extractor": "7.36.2",
"@swc/jest": "0.2.26",
"@microsoft/api-extractor": "7.36.3",
"@swc/jest": "0.2.27",
"@types/jest": "29.5.3",
"@types/node": "20.4.2",
"@typescript-eslint/eslint-plugin": "5.61.0",
"@typescript-eslint/parser": "5.61.0",
"eslint": "8.45.0",
"jest": "29.6.1",
"@types/node": "20.4.5",
"@typescript-eslint/eslint-plugin": "6.2.0",
"@typescript-eslint/parser": "6.2.0",
"eslint": "8.46.0",
"jest": "29.6.2",
"jest-fetch-mock": "3.0.3",
"jest-websocket-mock": "2.4.0",
"mock-socket": "9.2.1",
@ -39,7 +39,7 @@
],
"dependencies": {
"@swc/cli": "0.1.62",
"@swc/core": "1.3.69",
"@swc/core": "1.3.71",
"eventemitter3": "5.0.1",
"reconnecting-websocket": "4.4.0"
}

View File

@ -2,7 +2,7 @@ import type {
Ad, Announcement, Antenna, App, AuthSession, Blocking, Channel, Clip, DateString, DetailedInstanceMetadata, DriveFile, DriveFolder, Following, FollowingFolloweePopulated, FollowingFollowerPopulated, FollowRequest, GalleryPost, Instance,
LiteInstanceMetadata,
MeDetailed,
Note, NoteFavorite, OriginType, Page, ServerInfo, Stats, User, UserDetailed, MeSignup, UserGroup, UserList, UserSorting, Notification, NoteReaction, Signin, MessagingMessage, Invite, InviteLimit,
Note, NoteFavorite, OriginType, Page, ServerInfo, Stats, User, UserDetailed, MeSignup, UserGroup, UserList, UserSorting, Notification, NoteReaction, Signin, MessagingMessage, Invite, InviteLimit, AdminInstanceMetadata,
} from './entities.js';
type TODO = Record<string, any> | null;
@ -20,7 +20,7 @@ export type Endpoints = {
'admin/get-table-stats': { req: TODO; res: TODO; };
'admin/invite': { req: TODO; res: TODO; };
'admin/logs': { req: TODO; res: TODO; };
'admin/meta': { req: TODO; res: TODO; };
'admin/meta': { req: NoParams; res: AdminInstanceMetadata; };
'admin/reset-password': { req: TODO; res: TODO; };
'admin/resolve-abuse-user-report': { req: TODO; res: TODO; };
'admin/resync-chart': { req: TODO; res: TODO; };

View File

@ -346,6 +346,11 @@ export type DetailedInstanceMetadata = LiteInstanceMetadata & {
export type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata;
export type AdminInstanceMetadata = DetailedInstanceMetadata & {
// TODO: There are more fields.
blockedHosts: string[];
};
export type ServerInfo = {
machine: string;
cpu: {
@ -482,7 +487,7 @@ export type Blocking = {
export type Instance = {
id: ID;
caughtAt: DateString;
firstRetrievedAt: DateString;
host: string;
usersCount: number;
notesCount: number;
@ -496,6 +501,7 @@ export type Instance = {
lastCommunicatedAt: DateString;
isNotResponding: boolean;
isSuspended: boolean;
isBlocked: boolean;
softwareName: string | null;
softwareVersion: string | null;
openRegistrations: boolean | null;

View File

@ -64,6 +64,8 @@ module.exports = {
'object-curly-spacing': ['error', 'always'],
'space-infix-ops': ['error'],
'space-before-blocks': ['error', 'always'],
'@typescript-eslint/no-explicit-any': ['warn'],
'@typescript-eslint/no-unused-vars': ['warn'],
'@typescript-eslint/no-unnecessary-condition': ['warn'],
'@typescript-eslint/no-var-requires': ['warn'],
'@typescript-eslint/no-inferrable-types': ['warn'],
@ -75,7 +77,7 @@ module.exports = {
}],
'@typescript-eslint/consistent-type-imports': 'off',
'@typescript-eslint/prefer-nullish-coalescing': [
'error',
'warn',
],
'@typescript-eslint/naming-convention': [
'error',

View File

@ -9,15 +9,15 @@
"lint": "pnpm typecheck && pnpm eslint"
},
"dependencies": {
"esbuild": "0.18.11",
"esbuild": "0.18.17",
"idb-keyval": "6.2.1",
"misskey-js": "workspace:*"
},
"devDependencies": {
"@typescript-eslint/parser": "5.61.0",
"@typescript-eslint/parser": "6.2.0",
"@typescript/lib-webworker": "npm:@types/serviceworker@0.0.67",
"eslint": "8.45.0",
"eslint-plugin-import": "2.27.5",
"eslint": "8.46.0",
"eslint-plugin-import": "2.28.0",
"typescript": "5.1.6"
},
"type": "module"

File diff suppressed because it is too large Load Diff