Merge remote-branch 'misskey/develop'
This commit is contained in:
commit
0a61b6aafe
|
@ -73,6 +73,8 @@
|
||||||
- Fix: キャプションが空の画像をクロップするとキャプションにnullという文字列が入ってしまう問題の修正
|
- Fix: キャプションが空の画像をクロップするとキャプションにnullという文字列が入ってしまう問題の修正
|
||||||
- Fix: プロフィールを編集してもリロードするまで反映されない問題を修正
|
- Fix: プロフィールを編集してもリロードするまで反映されない問題を修正
|
||||||
- Fix: エラー画像URLを設定した後解除すると,デフォルトの画像が表示されない問題の修正
|
- Fix: エラー画像URLを設定した後解除すると,デフォルトの画像が表示されない問題の修正
|
||||||
|
- Fix: MkCodeEditorで行がずれていってしまう問題の修正
|
||||||
|
- Fix: Summaly proxy利用時にプレイヤーが動作しないことがあるのを修正 #13196
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
- Enhance: 連合先のレートリミットに引っかかった際にリトライするようになりました
|
- Enhance: 連合先のレートリミットに引っかかった際にリトライするようになりました
|
||||||
|
@ -87,6 +89,7 @@
|
||||||
- Fix: properly handle cc followers
|
- Fix: properly handle cc followers
|
||||||
- Fix: ジョブに関する設定の名前を修正 relashionshipJobPerSec -> relationshipJobPerSec
|
- Fix: ジョブに関する設定の名前を修正 relashionshipJobPerSec -> relationshipJobPerSec
|
||||||
- Fix: コントロールパネル->モデレーション->「誰でも新規登録できるようにする」の初期値をONからOFFに変更 #13122
|
- Fix: コントロールパネル->モデレーション->「誰でも新規登録できるようにする」の初期値をONからOFFに変更 #13122
|
||||||
|
- Enhance: 連合向けのノート配信を軽量化 #13192
|
||||||
|
|
||||||
### Service Worker
|
### Service Worker
|
||||||
- Enhance: オフライン表示のデザインを改善・多言語対応
|
- Enhance: オフライン表示のデザインを改善・多言語対応
|
||||||
|
|
|
@ -281,24 +281,22 @@ You can override the component meta by creating a meta story file (`MyComponent.
|
||||||
```ts
|
```ts
|
||||||
export const argTypes = {
|
export const argTypes = {
|
||||||
scale: {
|
scale: {
|
||||||
control: {
|
control: {
|
||||||
type: 'range',
|
type: 'range',
|
||||||
min: 1,
|
min: 1,
|
||||||
max: 4,
|
max: 4,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
Also, you can use msw to mock API requests in the storybook. Creating a `MyComponent.stories.msw.ts` file to define the mock handlers.
|
Also, you can use msw to mock API requests in the storybook. Creating a `MyComponent.stories.msw.ts` file to define the mock handlers.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { rest } from 'msw';
|
import { HttpResponse, http } from 'msw';
|
||||||
export const handlers = [
|
export const handlers = [
|
||||||
rest.post('/api/notes/timeline', (req, res, ctx) => {
|
http.post('/api/notes/timeline', ({ request }) => {
|
||||||
return res(
|
return HttpResponse.json([]);
|
||||||
ctx.json([]),
|
|
||||||
);
|
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
```
|
```
|
||||||
|
|
|
@ -388,7 +388,7 @@ export class CustomEmojiService implements OnApplicationShutdown {
|
||||||
*/
|
*/
|
||||||
@bindThis
|
@bindThis
|
||||||
public checkDuplicate(name: string): Promise<boolean> {
|
public checkDuplicate(name: string): Promise<boolean> {
|
||||||
return this.emojisRepository.exist({ where: { name, host: IsNull() } });
|
return this.emojisRepository.exists({ where: { name, host: IsNull() } });
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
|
|
@ -419,6 +419,10 @@ export class MfmService {
|
||||||
},
|
},
|
||||||
|
|
||||||
text: (node) => {
|
text: (node) => {
|
||||||
|
if (!node.props.text.match(/[\r\n]/)) {
|
||||||
|
return doc.createTextNode(node.props.text);
|
||||||
|
}
|
||||||
|
|
||||||
const el = doc.createElement('span');
|
const el = doc.createElement('span');
|
||||||
const nodes = node.props.text.split(/\r\n|\r|\n/).map(x => doc.createTextNode(x));
|
const nodes = node.props.text.split(/\r\n|\r|\n/).map(x => doc.createTextNode(x));
|
||||||
|
|
||||||
|
|
|
@ -628,7 +628,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||||
if (data.reply) {
|
if (data.reply) {
|
||||||
// 通知
|
// 通知
|
||||||
if (data.reply.userHost === null) {
|
if (data.reply.userHost === null) {
|
||||||
const isThreadMuted = await this.noteThreadMutingsRepository.exist({
|
const isThreadMuted = await this.noteThreadMutingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
userId: data.reply.userId,
|
userId: data.reply.userId,
|
||||||
threadId: data.reply.threadId ?? data.reply.id,
|
threadId: data.reply.threadId ?? data.reply.id,
|
||||||
|
@ -766,7 +766,7 @@ export class NoteCreateService implements OnApplicationShutdown {
|
||||||
@bindThis
|
@bindThis
|
||||||
private async createMentionedEvents(mentionedUsers: MinimumUser[], note: MiNote, nm: NotificationManager) {
|
private async createMentionedEvents(mentionedUsers: MinimumUser[], note: MiNote, nm: NotificationManager) {
|
||||||
for (const u of mentionedUsers.filter(u => this.userEntityService.isLocalUser(u))) {
|
for (const u of mentionedUsers.filter(u => this.userEntityService.isLocalUser(u))) {
|
||||||
const isThreadMuted = await this.noteThreadMutingsRepository.exist({
|
const isThreadMuted = await this.noteThreadMutingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
userId: u.id,
|
userId: u.id,
|
||||||
threadId: note.threadId ?? note.id,
|
threadId: note.threadId ?? note.id,
|
||||||
|
|
|
@ -49,7 +49,7 @@ export class NoteReadService implements OnApplicationShutdown {
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
// スレッドミュート
|
// スレッドミュート
|
||||||
const isThreadMuted = await this.noteThreadMutingsRepository.exist({
|
const isThreadMuted = await this.noteThreadMutingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
userId: userId,
|
userId: userId,
|
||||||
threadId: note.threadId ?? note.id,
|
threadId: note.threadId ?? note.id,
|
||||||
|
@ -70,7 +70,7 @@ export class NoteReadService implements OnApplicationShutdown {
|
||||||
|
|
||||||
// 2秒経っても既読にならなかったら「未読の投稿がありますよ」イベントを発行する
|
// 2秒経っても既読にならなかったら「未読の投稿がありますよ」イベントを発行する
|
||||||
setTimeout(2000, 'unread note', { signal: this.#shutdownController.signal }).then(async () => {
|
setTimeout(2000, 'unread note', { signal: this.#shutdownController.signal }).then(async () => {
|
||||||
const exist = await this.noteUnreadsRepository.exist({ where: { id: unread.id } });
|
const exist = await this.noteUnreadsRepository.exists({ where: { id: unread.id } });
|
||||||
|
|
||||||
if (!exist) return;
|
if (!exist) return;
|
||||||
|
|
||||||
|
|
|
@ -74,12 +74,12 @@ export class SignupService {
|
||||||
const secret = generateUserToken();
|
const secret = generateUserToken();
|
||||||
|
|
||||||
// Check username duplication
|
// Check username duplication
|
||||||
if (await this.usersRepository.exist({ where: { usernameLower: username.toLowerCase(), host: IsNull() } })) {
|
if (await this.usersRepository.exists({ where: { usernameLower: username.toLowerCase(), host: IsNull() } })) {
|
||||||
throw new Error('DUPLICATED_USERNAME');
|
throw new Error('DUPLICATED_USERNAME');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check deleted username duplication
|
// Check deleted username duplication
|
||||||
if (await this.usedUsernamesRepository.exist({ where: { username: username.toLowerCase() } })) {
|
if (await this.usedUsernamesRepository.exists({ where: { username: username.toLowerCase() } })) {
|
||||||
throw new Error('USED_USERNAME');
|
throw new Error('USED_USERNAME');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,7 +144,7 @@ export class UserFollowingService implements OnModuleInit {
|
||||||
let autoAccept = false;
|
let autoAccept = false;
|
||||||
|
|
||||||
// 鍵アカウントであっても、既にフォローされていた場合はスルー
|
// 鍵アカウントであっても、既にフォローされていた場合はスルー
|
||||||
const isFollowing = await this.followingsRepository.exist({
|
const isFollowing = await this.followingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followerId: follower.id,
|
followerId: follower.id,
|
||||||
followeeId: followee.id,
|
followeeId: followee.id,
|
||||||
|
@ -156,7 +156,7 @@ export class UserFollowingService implements OnModuleInit {
|
||||||
|
|
||||||
// フォローしているユーザーは自動承認オプション
|
// フォローしているユーザーは自動承認オプション
|
||||||
if (!autoAccept && (this.userEntityService.isLocalUser(followee) && followeeProfile.autoAcceptFollowed)) {
|
if (!autoAccept && (this.userEntityService.isLocalUser(followee) && followeeProfile.autoAcceptFollowed)) {
|
||||||
const isFollowed = await this.followingsRepository.exist({
|
const isFollowed = await this.followingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followerId: followee.id,
|
followerId: followee.id,
|
||||||
followeeId: follower.id,
|
followeeId: follower.id,
|
||||||
|
@ -170,7 +170,7 @@ export class UserFollowingService implements OnModuleInit {
|
||||||
if (followee.isLocked && !autoAccept) {
|
if (followee.isLocked && !autoAccept) {
|
||||||
autoAccept = !!(await this.accountMoveService.validateAlsoKnownAs(
|
autoAccept = !!(await this.accountMoveService.validateAlsoKnownAs(
|
||||||
follower,
|
follower,
|
||||||
(oldSrc, newSrc) => this.followingsRepository.exist({
|
(oldSrc, newSrc) => this.followingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followeeId: followee.id,
|
followeeId: followee.id,
|
||||||
followerId: newSrc.id,
|
followerId: newSrc.id,
|
||||||
|
@ -233,7 +233,7 @@ export class UserFollowingService implements OnModuleInit {
|
||||||
|
|
||||||
this.cacheService.userFollowingsCache.refresh(follower.id);
|
this.cacheService.userFollowingsCache.refresh(follower.id);
|
||||||
|
|
||||||
const requestExist = await this.followRequestsRepository.exist({
|
const requestExist = await this.followRequestsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followeeId: followee.id,
|
followeeId: followee.id,
|
||||||
followerId: follower.id,
|
followerId: follower.id,
|
||||||
|
@ -531,7 +531,7 @@ export class UserFollowingService implements OnModuleInit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const requestExist = await this.followRequestsRepository.exist({
|
const requestExist = await this.followRequestsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followeeId: followee.id,
|
followeeId: followee.id,
|
||||||
followerId: follower.id,
|
followerId: follower.id,
|
||||||
|
|
|
@ -683,7 +683,7 @@ export class ApInboxService {
|
||||||
return 'skip: follower not found';
|
return 'skip: follower not found';
|
||||||
}
|
}
|
||||||
|
|
||||||
const isFollowing = await this.followingsRepository.exist({
|
const isFollowing = await this.followingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followerId: follower.id,
|
followerId: follower.id,
|
||||||
followeeId: actor.id,
|
followeeId: actor.id,
|
||||||
|
@ -740,14 +740,14 @@ export class ApInboxService {
|
||||||
return 'skip: フォロー解除しようとしているユーザーはローカルユーザーではありません';
|
return 'skip: フォロー解除しようとしているユーザーはローカルユーザーではありません';
|
||||||
}
|
}
|
||||||
|
|
||||||
const requestExist = await this.followRequestsRepository.exist({
|
const requestExist = await this.followRequestsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followerId: actor.id,
|
followerId: actor.id,
|
||||||
followeeId: followee.id,
|
followeeId: followee.id,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const isFollowing = await this.followingsRepository.exist({
|
const isFollowing = await this.followingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followerId: actor.id,
|
followerId: actor.id,
|
||||||
followeeId: followee.id,
|
followeeId: followee.id,
|
||||||
|
|
|
@ -25,8 +25,21 @@ export class ApMfmService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public getNoteHtml(note: MiNote): string | null {
|
public getNoteHtml(note: MiNote, apAppend?: string) {
|
||||||
if (!note.text) return '';
|
let noMisskeyContent = false;
|
||||||
return this.mfmService.toHtml(mfm.parse(note.text), JSON.parse(note.mentionedRemoteUsers));
|
const srcMfm = (note.text ?? '') + (apAppend ?? '');
|
||||||
|
|
||||||
|
const parsed = mfm.parse(srcMfm);
|
||||||
|
|
||||||
|
if (!apAppend && parsed?.every(n => ['text', 'unicodeEmoji', 'emojiCode', 'mention', 'hashtag', 'url'].includes(n.type))) {
|
||||||
|
noMisskeyContent = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const content = this.mfmService.toHtml(parsed, JSON.parse(note.mentionedRemoteUsers));
|
||||||
|
|
||||||
|
return {
|
||||||
|
content,
|
||||||
|
noMisskeyContent,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -330,7 +330,7 @@ export class ApRendererService {
|
||||||
inReplyToNote = await this.notesRepository.findOneBy({ id: note.replyId });
|
inReplyToNote = await this.notesRepository.findOneBy({ id: note.replyId });
|
||||||
|
|
||||||
if (inReplyToNote != null) {
|
if (inReplyToNote != null) {
|
||||||
const inReplyToUserExist = await this.usersRepository.exist({ where: { id: inReplyToNote.userId } });
|
const inReplyToUserExist = await this.usersRepository.exists({ where: { id: inReplyToNote.userId } });
|
||||||
|
|
||||||
if (inReplyToUserExist) {
|
if (inReplyToUserExist) {
|
||||||
if (inReplyToNote.uri) {
|
if (inReplyToNote.uri) {
|
||||||
|
@ -394,17 +394,15 @@ export class ApRendererService {
|
||||||
poll = await this.pollsRepository.findOneBy({ noteId: note.id });
|
poll = await this.pollsRepository.findOneBy({ noteId: note.id });
|
||||||
}
|
}
|
||||||
|
|
||||||
let apText = text;
|
let apAppend = '';
|
||||||
|
|
||||||
if (quote) {
|
if (quote) {
|
||||||
apText += `\n\nRE: ${quote}`;
|
apAppend += `\n\nRE: ${quote}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const summary = note.cw === '' ? String.fromCharCode(0x200B) : note.cw;
|
const summary = note.cw === '' ? String.fromCharCode(0x200B) : note.cw;
|
||||||
|
|
||||||
const content = this.apMfmService.getNoteHtml(Object.assign({}, note, {
|
const { content, noMisskeyContent } = this.apMfmService.getNoteHtml(note, apAppend);
|
||||||
text: apText,
|
|
||||||
}));
|
|
||||||
|
|
||||||
const emojis = await this.getEmojis(note.emojis);
|
const emojis = await this.getEmojis(note.emojis);
|
||||||
const apemojis = emojis.filter(emoji => !emoji.localOnly).map(emoji => this.renderEmoji(emoji));
|
const apemojis = emojis.filter(emoji => !emoji.localOnly).map(emoji => this.renderEmoji(emoji));
|
||||||
|
@ -417,9 +415,6 @@ export class ApRendererService {
|
||||||
|
|
||||||
const asPoll = poll ? {
|
const asPoll = poll ? {
|
||||||
type: 'Question',
|
type: 'Question',
|
||||||
content: this.apMfmService.getNoteHtml(Object.assign({}, note, {
|
|
||||||
text: text,
|
|
||||||
})),
|
|
||||||
[poll.expiresAt && poll.expiresAt < new Date() ? 'closed' : 'endTime']: poll.expiresAt,
|
[poll.expiresAt && poll.expiresAt < new Date() ? 'closed' : 'endTime']: poll.expiresAt,
|
||||||
[poll.multiple ? 'anyOf' : 'oneOf']: poll.choices.map((text, i) => ({
|
[poll.multiple ? 'anyOf' : 'oneOf']: poll.choices.map((text, i) => ({
|
||||||
type: 'Note',
|
type: 'Note',
|
||||||
|
@ -453,11 +448,13 @@ export class ApRendererService {
|
||||||
attributedTo,
|
attributedTo,
|
||||||
summary: summary ?? undefined,
|
summary: summary ?? undefined,
|
||||||
content: content ?? undefined,
|
content: content ?? undefined,
|
||||||
_misskey_content: text,
|
...(noMisskeyContent ? {} : {
|
||||||
source: {
|
_misskey_content: text,
|
||||||
content: text,
|
source: {
|
||||||
mediaType: 'text/x.misskeymarkdown',
|
content: text,
|
||||||
},
|
mediaType: 'text/x.misskeymarkdown',
|
||||||
|
},
|
||||||
|
}),
|
||||||
_misskey_quote: quote,
|
_misskey_quote: quote,
|
||||||
quoteUrl: quote,
|
quoteUrl: quote,
|
||||||
published: this.idService.parse(note.id).date.toISOString(),
|
published: this.idService.parse(note.id).date.toISOString(),
|
||||||
|
|
|
@ -51,14 +51,14 @@ export class ChannelEntityService {
|
||||||
|
|
||||||
const banner = channel.bannerId ? await this.driveFilesRepository.findOneBy({ id: channel.bannerId }) : null;
|
const banner = channel.bannerId ? await this.driveFilesRepository.findOneBy({ id: channel.bannerId }) : null;
|
||||||
|
|
||||||
const isFollowing = meId ? await this.channelFollowingsRepository.exist({
|
const isFollowing = meId ? await this.channelFollowingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followerId: meId,
|
followerId: meId,
|
||||||
followeeId: channel.id,
|
followeeId: channel.id,
|
||||||
},
|
},
|
||||||
}) : false;
|
}) : false;
|
||||||
|
|
||||||
const isFavorited = meId ? await this.channelFavoritesRepository.exist({
|
const isFavorited = meId ? await this.channelFavoritesRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
userId: meId,
|
userId: meId,
|
||||||
channelId: channel.id,
|
channelId: channel.id,
|
||||||
|
|
|
@ -46,7 +46,7 @@ export class ClipEntityService {
|
||||||
description: clip.description,
|
description: clip.description,
|
||||||
isPublic: clip.isPublic,
|
isPublic: clip.isPublic,
|
||||||
favoritedCount: await this.clipFavoritesRepository.countBy({ clipId: clip.id }),
|
favoritedCount: await this.clipFavoritesRepository.countBy({ clipId: clip.id }),
|
||||||
isFavorited: meId ? await this.clipFavoritesRepository.exist({ where: { clipId: clip.id, userId: meId } }) : undefined,
|
isFavorited: meId ? await this.clipFavoritesRepository.exists({ where: { clipId: clip.id, userId: meId } }) : undefined,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ export class FlashEntityService {
|
||||||
summary: flash.summary,
|
summary: flash.summary,
|
||||||
script: flash.script,
|
script: flash.script,
|
||||||
likedCount: flash.likedCount,
|
likedCount: flash.likedCount,
|
||||||
isLiked: meId ? await this.flashLikesRepository.exist({ where: { flashId: flash.id, userId: meId } }) : undefined,
|
isLiked: meId ? await this.flashLikesRepository.exists({ where: { flashId: flash.id, userId: meId } }) : undefined,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ export class GalleryPostEntityService {
|
||||||
tags: post.tags.length > 0 ? post.tags : undefined,
|
tags: post.tags.length > 0 ? post.tags : undefined,
|
||||||
isSensitive: post.isSensitive,
|
isSensitive: post.isSensitive,
|
||||||
likedCount: post.likedCount,
|
likedCount: post.likedCount,
|
||||||
isLiked: meId ? await this.galleryLikesRepository.exist({ where: { postId: post.id, userId: meId } }) : undefined,
|
isLiked: meId ? await this.galleryLikesRepository.exists({ where: { postId: post.id, userId: meId } }) : undefined,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ export class NoteEntityService implements OnModuleInit {
|
||||||
hide = false;
|
hide = false;
|
||||||
} else {
|
} else {
|
||||||
// フォロワーかどうか
|
// フォロワーかどうか
|
||||||
const isFollowing = await this.followingsRepository.exist({
|
const isFollowing = await this.followingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followeeId: packedNote.userId,
|
followeeId: packedNote.userId,
|
||||||
followerId: meId,
|
followerId: meId,
|
||||||
|
|
|
@ -104,7 +104,7 @@ export class PageEntityService {
|
||||||
eyeCatchingImage: page.eyeCatchingImageId ? await this.driveFileEntityService.pack(page.eyeCatchingImageId) : null,
|
eyeCatchingImage: page.eyeCatchingImageId ? await this.driveFileEntityService.pack(page.eyeCatchingImageId) : null,
|
||||||
attachedFiles: this.driveFileEntityService.packMany((await Promise.all(attachedFiles)).filter((x): x is MiDriveFile => x != null)),
|
attachedFiles: this.driveFileEntityService.packMany((await Promise.all(attachedFiles)).filter((x): x is MiDriveFile => x != null)),
|
||||||
likedCount: page.likedCount,
|
likedCount: page.likedCount,
|
||||||
isLiked: meId ? await this.pageLikesRepository.exist({ where: { pageId: page.id, userId: meId } }) : undefined,
|
isLiked: meId ? await this.pageLikesRepository.exists({ where: { pageId: page.id, userId: meId } }) : undefined,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -158,43 +158,43 @@ export class UserEntityService implements OnModuleInit {
|
||||||
followerId: me,
|
followerId: me,
|
||||||
followeeId: target,
|
followeeId: target,
|
||||||
}),
|
}),
|
||||||
this.followingsRepository.exist({
|
this.followingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followerId: target,
|
followerId: target,
|
||||||
followeeId: me,
|
followeeId: me,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
this.followRequestsRepository.exist({
|
this.followRequestsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followerId: me,
|
followerId: me,
|
||||||
followeeId: target,
|
followeeId: target,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
this.followRequestsRepository.exist({
|
this.followRequestsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followerId: target,
|
followerId: target,
|
||||||
followeeId: me,
|
followeeId: me,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
this.blockingsRepository.exist({
|
this.blockingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
blockerId: me,
|
blockerId: me,
|
||||||
blockeeId: target,
|
blockeeId: target,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
this.blockingsRepository.exist({
|
this.blockingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
blockerId: target,
|
blockerId: target,
|
||||||
blockeeId: me,
|
blockeeId: me,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
this.mutingsRepository.exist({
|
this.mutingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
muterId: me,
|
muterId: me,
|
||||||
muteeId: target,
|
muteeId: target,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
this.renoteMutingsRepository.exist({
|
this.renoteMutingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
muterId: me,
|
muterId: me,
|
||||||
muteeId: target,
|
muteeId: target,
|
||||||
|
@ -251,7 +251,7 @@ export class UserEntityService implements OnModuleInit {
|
||||||
/*
|
/*
|
||||||
const myAntennas = (await this.antennaService.getAntennas()).filter(a => a.userId === userId);
|
const myAntennas = (await this.antennaService.getAntennas()).filter(a => a.userId === userId);
|
||||||
|
|
||||||
const isUnread = (myAntennas.length > 0 ? await this.antennaNotesRepository.exist({
|
const isUnread = (myAntennas.length > 0 ? await this.antennaNotesRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
antennaId: In(myAntennas.map(x => x.id)),
|
antennaId: In(myAntennas.map(x => x.id)),
|
||||||
read: false,
|
read: false,
|
||||||
|
|
|
@ -163,12 +163,12 @@ export class SignupApiService {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (instance.emailRequiredForSignup) {
|
if (instance.emailRequiredForSignup) {
|
||||||
if (await this.usersRepository.exist({ where: { usernameLower: username.toLowerCase(), host: IsNull() } })) {
|
if (await this.usersRepository.exists({ where: { usernameLower: username.toLowerCase(), host: IsNull() } })) {
|
||||||
throw new FastifyReplyError(400, 'DUPLICATED_USERNAME');
|
throw new FastifyReplyError(400, 'DUPLICATED_USERNAME');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check deleted username duplication
|
// Check deleted username duplication
|
||||||
if (await this.usedUsernamesRepository.exist({ where: { username: username.toLowerCase() } })) {
|
if (await this.usedUsernamesRepository.exists({ where: { username: username.toLowerCase() } })) {
|
||||||
throw new FastifyReplyError(400, 'USED_USERNAME');
|
throw new FastifyReplyError(400, 'USED_USERNAME');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
throw e;
|
throw e;
|
||||||
});
|
});
|
||||||
|
|
||||||
const exist = await this.promoNotesRepository.exist({ where: { noteId: note.id } });
|
const exist = await this.promoNotesRepository.exists({ where: { noteId: note.id } });
|
||||||
|
|
||||||
if (exist) {
|
if (exist) {
|
||||||
throw new ApiError(meta.errors.alreadyPromoted);
|
throw new ApiError(meta.errors.alreadyPromoted);
|
||||||
|
|
|
@ -62,7 +62,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
const accessToken = secureRndstr(32);
|
const accessToken = secureRndstr(32);
|
||||||
|
|
||||||
// Fetch exist access token
|
// Fetch exist access token
|
||||||
const exist = await this.accessTokensRepository.exist({
|
const exist = await this.accessTokensRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
appId: session.appId,
|
appId: session.appId,
|
||||||
userId: me.id,
|
userId: me.id,
|
||||||
|
|
|
@ -88,7 +88,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check if already blocking
|
// Check if already blocking
|
||||||
const exist = await this.blockingsRepository.exist({
|
const exist = await this.blockingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
blockerId: blocker.id,
|
blockerId: blocker.id,
|
||||||
blockeeId: blockee.id,
|
blockeeId: blockee.id,
|
||||||
|
|
|
@ -88,7 +88,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check not blocking
|
// Check not blocking
|
||||||
const exist = await this.blockingsRepository.exist({
|
const exist = await this.blockingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
blockerId: blocker.id,
|
blockerId: blocker.id,
|
||||||
blockeeId: blockee.id,
|
blockeeId: blockee.id,
|
||||||
|
|
|
@ -62,7 +62,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
throw new ApiError(meta.errors.noSuchClip);
|
throw new ApiError(meta.errors.noSuchClip);
|
||||||
}
|
}
|
||||||
|
|
||||||
const exist = await this.clipFavoritesRepository.exist({
|
const exist = await this.clipFavoritesRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
clipId: clip.id,
|
clipId: clip.id,
|
||||||
userId: me.id,
|
userId: me.id,
|
||||||
|
|
|
@ -38,7 +38,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
private driveFilesRepository: DriveFilesRepository,
|
private driveFilesRepository: DriveFilesRepository,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const exist = await this.driveFilesRepository.exist({
|
const exist = await this.driveFilesRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
md5: ps.md5,
|
md5: ps.md5,
|
||||||
userId: me.id,
|
userId: me.id,
|
||||||
|
|
|
@ -70,7 +70,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
}
|
}
|
||||||
|
|
||||||
// if already liked
|
// if already liked
|
||||||
const exist = await this.flashLikesRepository.exist({
|
const exist = await this.flashLikesRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
flashId: flash.id,
|
flashId: flash.id,
|
||||||
userId: me.id,
|
userId: me.id,
|
||||||
|
|
|
@ -101,7 +101,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check if already following
|
// Check if already following
|
||||||
const exist = await this.followingsRepository.exist({
|
const exist = await this.followingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followerId: follower.id,
|
followerId: follower.id,
|
||||||
followeeId: followee.id,
|
followeeId: followee.id,
|
||||||
|
|
|
@ -85,7 +85,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check not following
|
// Check not following
|
||||||
const exist = await this.followingsRepository.exist({
|
const exist = await this.followingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followerId: follower.id,
|
followerId: follower.id,
|
||||||
followeeId: followee.id,
|
followeeId: followee.id,
|
||||||
|
|
|
@ -72,7 +72,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
}
|
}
|
||||||
|
|
||||||
// if already liked
|
// if already liked
|
||||||
const exist = await this.galleryLikesRepository.exist({
|
const exist = await this.galleryLikesRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
postId: post.id,
|
postId: post.id,
|
||||||
userId: me.id,
|
userId: me.id,
|
||||||
|
|
|
@ -71,7 +71,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
private downloadService: DownloadService,
|
private downloadService: DownloadService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const userExist = await this.usersRepository.exist({ where: { id: me.id } });
|
const userExist = await this.usersRepository.exists({ where: { id: me.id } });
|
||||||
if (!userExist) throw new ApiError(meta.errors.noSuchUser);
|
if (!userExist) throw new ApiError(meta.errors.noSuchUser);
|
||||||
const file = await this.driveFilesRepository.findOneBy({ id: ps.fileId });
|
const file = await this.driveFilesRepository.findOneBy({ id: ps.fileId });
|
||||||
if (file === null) throw new ApiError(meta.errors.noSuchFile);
|
if (file === null) throw new ApiError(meta.errors.noSuchFile);
|
||||||
|
|
|
@ -34,7 +34,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
if (ps.tokenId) {
|
if (ps.tokenId) {
|
||||||
const tokenExist = await this.accessTokensRepository.exist({ where: { id: ps.tokenId } });
|
const tokenExist = await this.accessTokensRepository.exists({ where: { id: ps.tokenId } });
|
||||||
|
|
||||||
if (tokenExist) {
|
if (tokenExist) {
|
||||||
await this.accessTokensRepository.delete({
|
await this.accessTokensRepository.delete({
|
||||||
|
@ -43,7 +43,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (ps.token) {
|
} else if (ps.token) {
|
||||||
const tokenExist = await this.accessTokensRepository.exist({ where: { token: ps.token } });
|
const tokenExist = await this.accessTokensRepository.exists({ where: { token: ps.token } });
|
||||||
|
|
||||||
if (tokenExist) {
|
if (tokenExist) {
|
||||||
await this.accessTokensRepository.delete({
|
await this.accessTokensRepository.delete({
|
||||||
|
|
|
@ -83,7 +83,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check if already muting
|
// Check if already muting
|
||||||
const exist = await this.mutingsRepository.exist({
|
const exist = await this.mutingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
muterId: muter.id,
|
muterId: muter.id,
|
||||||
muteeId: mutee.id,
|
muteeId: mutee.id,
|
||||||
|
|
|
@ -271,7 +271,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
|
|
||||||
// Check blocking
|
// Check blocking
|
||||||
if (renote.userId !== me.id) {
|
if (renote.userId !== me.id) {
|
||||||
const blockExist = await this.blockingsRepository.exist({
|
const blockExist = await this.blockingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
blockerId: renote.userId,
|
blockerId: renote.userId,
|
||||||
blockeeId: me.id,
|
blockeeId: me.id,
|
||||||
|
@ -319,7 +319,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
|
|
||||||
// Check blocking
|
// Check blocking
|
||||||
if (reply.userId !== me.id) {
|
if (reply.userId !== me.id) {
|
||||||
const blockExist = await this.blockingsRepository.exist({
|
const blockExist = await this.blockingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
blockerId: reply.userId,
|
blockerId: reply.userId,
|
||||||
blockeeId: me.id,
|
blockeeId: me.id,
|
||||||
|
|
|
@ -67,7 +67,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
});
|
});
|
||||||
|
|
||||||
// if already favorited
|
// if already favorited
|
||||||
const exist = await this.noteFavoritesRepository.exist({
|
const exist = await this.noteFavoritesRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
noteId: note.id,
|
noteId: note.id,
|
||||||
userId: me.id,
|
userId: me.id,
|
||||||
|
|
|
@ -70,7 +70,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
}
|
}
|
||||||
|
|
||||||
// if already liked
|
// if already liked
|
||||||
const exist = await this.pageLikesRepository.exist({
|
const exist = await this.pageLikesRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
pageId: page.id,
|
pageId: page.id,
|
||||||
userId: me.id,
|
userId: me.id,
|
||||||
|
|
|
@ -49,7 +49,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
|
|
||||||
const exist = await this.promoReadsRepository.exist({
|
const exist = await this.promoReadsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
noteId: note.id,
|
noteId: note.id,
|
||||||
userId: me.id,
|
userId: me.id,
|
||||||
|
|
|
@ -101,7 +101,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
if (me == null) {
|
if (me == null) {
|
||||||
throw new ApiError(meta.errors.forbidden);
|
throw new ApiError(meta.errors.forbidden);
|
||||||
} else if (me.id !== user.id) {
|
} else if (me.id !== user.id) {
|
||||||
const isFollowing = await this.followingsRepository.exist({
|
const isFollowing = await this.followingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followeeId: user.id,
|
followeeId: user.id,
|
||||||
followerId: me.id,
|
followerId: me.id,
|
||||||
|
|
|
@ -109,7 +109,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
if (me == null) {
|
if (me == null) {
|
||||||
throw new ApiError(meta.errors.forbidden);
|
throw new ApiError(meta.errors.forbidden);
|
||||||
} else if (me.id !== user.id) {
|
} else if (me.id !== user.id) {
|
||||||
const isFollowing = await this.followingsRepository.exist({
|
const isFollowing = await this.followingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
followeeId: user.id,
|
followeeId: user.id,
|
||||||
followerId: me.id,
|
followerId: me.id,
|
||||||
|
|
|
@ -90,7 +90,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
private roleService: RoleService,
|
private roleService: RoleService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const listExist = await this.userListsRepository.exist({
|
const listExist = await this.userListsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
id: ps.listId,
|
id: ps.listId,
|
||||||
isPublic: true,
|
isPublic: true,
|
||||||
|
@ -121,7 +121,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
});
|
});
|
||||||
|
|
||||||
if (currentUser.id !== me.id) {
|
if (currentUser.id !== me.id) {
|
||||||
const blockExist = await this.blockingsRepository.exist({
|
const blockExist = await this.blockingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
blockerId: currentUser.id,
|
blockerId: currentUser.id,
|
||||||
blockeeId: me.id,
|
blockeeId: me.id,
|
||||||
|
@ -132,7 +132,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const exist = await this.userListMembershipsRepository.exist({
|
const exist = await this.userListMembershipsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
userListId: userList.id,
|
userListId: userList.id,
|
||||||
userId: currentUser.id,
|
userId: currentUser.id,
|
||||||
|
|
|
@ -47,7 +47,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
private idService: IdService,
|
private idService: IdService,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const userListExist = await this.userListsRepository.exist({
|
const userListExist = await this.userListsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
id: ps.listId,
|
id: ps.listId,
|
||||||
isPublic: true,
|
isPublic: true,
|
||||||
|
@ -58,7 +58,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
throw new ApiError(meta.errors.noSuchList);
|
throw new ApiError(meta.errors.noSuchList);
|
||||||
}
|
}
|
||||||
|
|
||||||
const exist = await this.userListFavoritesRepository.exist({
|
const exist = await this.userListFavoritesRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
userId: me.id,
|
userId: me.id,
|
||||||
userListId: ps.listId,
|
userListId: ps.listId,
|
||||||
|
|
|
@ -104,7 +104,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
|
|
||||||
// Check blocking
|
// Check blocking
|
||||||
if (user.id !== me.id) {
|
if (user.id !== me.id) {
|
||||||
const blockExist = await this.blockingsRepository.exist({
|
const blockExist = await this.blockingsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
blockerId: user.id,
|
blockerId: user.id,
|
||||||
blockeeId: me.id,
|
blockeeId: me.id,
|
||||||
|
@ -115,7 +115,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const exist = await this.userListMembershipsRepository.exist({
|
const exist = await this.userListMembershipsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
userListId: userList.id,
|
userListId: userList.id,
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
|
|
|
@ -74,7 +74,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
userListId: ps.listId,
|
userListId: ps.listId,
|
||||||
});
|
});
|
||||||
if (me !== null) {
|
if (me !== null) {
|
||||||
additionalProperties.isLiked = await this.userListFavoritesRepository.exist({
|
additionalProperties.isLiked = await this.userListFavoritesRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
userId: me.id,
|
userId: me.id,
|
||||||
userListId: ps.listId,
|
userListId: ps.listId,
|
||||||
|
|
|
@ -45,7 +45,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
|
||||||
private userListFavoritesRepository: UserListFavoritesRepository,
|
private userListFavoritesRepository: UserListFavoritesRepository,
|
||||||
) {
|
) {
|
||||||
super(meta, paramDef, async (ps, me) => {
|
super(meta, paramDef, async (ps, me) => {
|
||||||
const userListExist = await this.userListsRepository.exist({
|
const userListExist = await this.userListsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
id: ps.listId,
|
id: ps.listId,
|
||||||
isPublic: true,
|
isPublic: true,
|
||||||
|
|
|
@ -43,7 +43,7 @@ class UserListChannel extends Channel {
|
||||||
this.withRenotes = params.withRenotes ?? true;
|
this.withRenotes = params.withRenotes ?? true;
|
||||||
|
|
||||||
// Check existence and owner
|
// Check existence and owner
|
||||||
const listExist = await this.userListsRepository.exist({
|
const listExist = await this.userListsRepository.exists({
|
||||||
where: {
|
where: {
|
||||||
id: this.listId,
|
id: this.listId,
|
||||||
userId: this.user!.id,
|
userId: this.user!.id,
|
||||||
|
|
|
@ -216,7 +216,7 @@ describe('OAuth', () => {
|
||||||
assert.ok(location.searchParams.has('code'));
|
assert.ok(location.searchParams.has('code'));
|
||||||
assert.strictEqual(location.searchParams.get('state'), 'state');
|
assert.strictEqual(location.searchParams.get('state'), 'state');
|
||||||
// https://datatracker.ietf.org/doc/html/rfc9207#name-response-parameter-iss
|
// https://datatracker.ietf.org/doc/html/rfc9207#name-response-parameter-iss
|
||||||
assert.strictEqual(location.searchParams.get('iss'), 'http://misskey.local');
|
assert.strictEqual(location.searchParams.get('iss'), 'http://cherrypick.local');
|
||||||
|
|
||||||
const code = new URL(location).searchParams.get('code');
|
const code = new URL(location).searchParams.get('code');
|
||||||
assert.ok(code);
|
assert.ok(code);
|
||||||
|
@ -704,7 +704,7 @@ describe('OAuth', () => {
|
||||||
assert.strictEqual(response.status, 200);
|
assert.strictEqual(response.status, 200);
|
||||||
|
|
||||||
const body = await response.json();
|
const body = await response.json();
|
||||||
assert.strictEqual(body.issuer, 'http://misskey.local');
|
assert.strictEqual(body.issuer, 'http://cherrypick.local');
|
||||||
assert.ok(body.scopes_supported.includes('write:notes'));
|
assert.ok(body.scopes_supported.includes('write:notes'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
44
packages/backend/test/unit/ApMfmService.ts
Normal file
44
packages/backend/test/unit/ApMfmService.ts
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
import * as assert from 'assert';
|
||||||
|
import { Test } from '@nestjs/testing';
|
||||||
|
|
||||||
|
import { CoreModule } from '@/core/CoreModule.js';
|
||||||
|
import { ApMfmService } from '@/core/activitypub/ApMfmService.js';
|
||||||
|
import { GlobalModule } from '@/GlobalModule.js';
|
||||||
|
import { MiNote } from '@/models/Note.js';
|
||||||
|
|
||||||
|
describe('ApMfmService', () => {
|
||||||
|
let apMfmService: ApMfmService;
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
const app = await Test.createTestingModule({
|
||||||
|
imports: [GlobalModule, CoreModule],
|
||||||
|
}).compile();
|
||||||
|
apMfmService = app.get<ApMfmService>(ApMfmService);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('getNoteHtml', () => {
|
||||||
|
test('Do not provide _misskey_content for simple text', () => {
|
||||||
|
const note: MiNote = {
|
||||||
|
text: 'テキスト #タグ @mention 🍊 :emoji: https://example.com',
|
||||||
|
mentionedRemoteUsers: '[]',
|
||||||
|
} as any;
|
||||||
|
|
||||||
|
const { content, noMisskeyContent } = apMfmService.getNoteHtml(note);
|
||||||
|
|
||||||
|
assert.equal(noMisskeyContent, true, 'noMisskeyContent');
|
||||||
|
assert.equal(content, '<p>テキスト <a href="http://cherrypick.local/tags/タグ" rel="tag">#タグ</a> <a href="http://cherrypick.local/@mention" class="u-url mention">@mention</a> 🍊 :emoji: <a href="https://example.com">https://example.com</a></p>', 'content');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Provide _misskey_content for MFM', () => {
|
||||||
|
const note: MiNote = {
|
||||||
|
text: '$[tada foo]',
|
||||||
|
mentionedRemoteUsers: '[]',
|
||||||
|
} as any;
|
||||||
|
|
||||||
|
const { content, noMisskeyContent } = apMfmService.getNoteHtml(note);
|
||||||
|
|
||||||
|
assert.equal(noMisskeyContent, false, 'noMisskeyContent');
|
||||||
|
assert.equal(content, '<p><i>foo</i></p>', 'content');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -33,6 +33,12 @@ describe('MfmService', () => {
|
||||||
const output = '<p><span>foo<br>bar<br>baz</span></p>';
|
const output = '<p><span>foo<br>bar<br>baz</span></p>';
|
||||||
assert.equal(mfmService.toHtml(mfm.parse(input)), output);
|
assert.equal(mfmService.toHtml(mfm.parse(input)), output);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('Do not generate unnecessary span', () => {
|
||||||
|
const input = 'foo $[tada bar]';
|
||||||
|
const output = '<p>foo <i>bar</i></p>';
|
||||||
|
assert.equal(mfmService.toHtml(mfm.parse(input)), output);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('fromHtml', () => {
|
describe('fromHtml', () => {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"name": "cherrypick-js",
|
"name": "cherrypick-js",
|
||||||
"version": "4.7.0-beta.1",
|
"version": "4.7.0-beta.2",
|
||||||
"basedMisskeyVersion": "2024.2.0-beta.8",
|
"basedMisskeyVersion": "2024.2.0-beta.10",
|
||||||
"description": "CherryPick SDK for JavaScript",
|
"description": "CherryPick SDK for JavaScript",
|
||||||
"types": "./built/dts/index.d.ts",
|
"types": "./built/dts/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { type SharedOptions, rest } from 'msw';
|
import { type SharedOptions, http, HttpResponse } from 'msw';
|
||||||
|
|
||||||
export const onUnhandledRequest = ((req, print) => {
|
export const onUnhandledRequest = ((req, print) => {
|
||||||
if (req.url.hostname !== 'localhost' || /^\/(?:client-assets\/|fluent-emojis?\/|iframe.html$|node_modules\/|src\/|sb-|static-assets\/|vite\/)/.test(req.url.pathname)) {
|
if (req.url.hostname !== 'localhost' || /^\/(?:client-assets\/|fluent-emojis?\/|iframe.html$|node_modules\/|src\/|sb-|static-assets\/|vite\/)/.test(req.url.pathname)) {
|
||||||
|
@ -13,19 +13,31 @@ export const onUnhandledRequest = ((req, print) => {
|
||||||
}) satisfies SharedOptions['onUnhandledRequest'];
|
}) satisfies SharedOptions['onUnhandledRequest'];
|
||||||
|
|
||||||
export const commonHandlers = [
|
export const commonHandlers = [
|
||||||
rest.get('/fluent-emoji/:codepoints.png', async (req, res, ctx) => {
|
http.get('/fluent-emoji/:codepoints.png', async ({ params }) => {
|
||||||
const { codepoints } = req.params;
|
const { codepoints } = params;
|
||||||
const value = await fetch(`https://raw.githubusercontent.com/misskey-dev/emojis/main/dist/${codepoints}.png`).then((response) => response.blob());
|
const value = await fetch(`https://raw.githubusercontent.com/misskey-dev/emojis/main/dist/${codepoints}.png`).then((response) => response.blob());
|
||||||
return res(ctx.set('Content-Type', 'image/png'), ctx.body(value));
|
return new HttpResponse(value, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'image/png',
|
||||||
|
},
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
rest.get('/fluent-emojis/:codepoints.png', async (req, res, ctx) => {
|
http.get('/fluent-emojis/:codepoints.png', async ({ params }) => {
|
||||||
const { codepoints } = req.params;
|
const { codepoints } = params;
|
||||||
const value = await fetch(`https://raw.githubusercontent.com/misskey-dev/emojis/main/dist/${codepoints}.png`).then((response) => response.blob());
|
const value = await fetch(`https://raw.githubusercontent.com/misskey-dev/emojis/main/dist/${codepoints}.png`).then((response) => response.blob());
|
||||||
return res(ctx.set('Content-Type', 'image/png'), ctx.body(value));
|
return new HttpResponse(value, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'image/png',
|
||||||
|
},
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
rest.get('/twemoji/:codepoints.svg', async (req, res, ctx) => {
|
http.get('/twemoji/:codepoints.svg', async ({ params }) => {
|
||||||
const { codepoints } = req.params;
|
const { codepoints } = params;
|
||||||
const value = await fetch(`https://unpkg.com/@discordapp/twemoji@15.0.2/dist/svg/${codepoints}.svg`).then((response) => response.blob());
|
const value = await fetch(`https://unpkg.com/@discordapp/twemoji@15.0.2/dist/svg/${codepoints}.svg`).then((response) => response.blob());
|
||||||
return res(ctx.set('Content-Type', 'image/svg+xml'), ctx.body(value));
|
return new HttpResponse(value, {
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'image/svg+xml',
|
||||||
|
},
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
|
|
@ -133,8 +133,8 @@
|
||||||
"happy-dom": "10.0.3",
|
"happy-dom": "10.0.3",
|
||||||
"intersection-observer": "0.12.2",
|
"intersection-observer": "0.12.2",
|
||||||
"micromatch": "4.0.5",
|
"micromatch": "4.0.5",
|
||||||
"msw": "2.1.2",
|
"msw": "2.1.7",
|
||||||
"msw-storybook-addon": "1.10.0",
|
"msw-storybook-addon": "2.0.0-beta.1",
|
||||||
"nodemon": "3.0.3",
|
"nodemon": "3.0.3",
|
||||||
"prettier": "3.2.4",
|
"prettier": "3.2.4",
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { StoryObj } from '@storybook/vue3';
|
import { StoryObj } from '@storybook/vue3';
|
||||||
import { rest } from 'msw';
|
import { HttpResponse, http } from 'msw';
|
||||||
import { abuseUserReport } from '../../.storybook/fakes.js';
|
import { abuseUserReport } from '../../.storybook/fakes.js';
|
||||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||||
import MkAbuseReport from './MkAbuseReport.vue';
|
import MkAbuseReport from './MkAbuseReport.vue';
|
||||||
|
@ -44,9 +44,9 @@ export const Default = {
|
||||||
msw: {
|
msw: {
|
||||||
handlers: [
|
handlers: [
|
||||||
...commonHandlers,
|
...commonHandlers,
|
||||||
rest.post('/api/admin/resolve-abuse-user-report', async (req, res, ctx) => {
|
http.post('/api/admin/resolve-abuse-user-report', async ({ request }) => {
|
||||||
action('POST /api/admin/resolve-abuse-user-report')(await req.json());
|
action('POST /api/admin/resolve-abuse-user-report')(await request.json());
|
||||||
return res(ctx.json({}));
|
return HttpResponse.json({});
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { StoryObj } from '@storybook/vue3';
|
import { StoryObj } from '@storybook/vue3';
|
||||||
import { rest } from 'msw';
|
import { HttpResponse, http } from 'msw';
|
||||||
import { userDetailed } from '../../.storybook/fakes.js';
|
import { userDetailed } from '../../.storybook/fakes.js';
|
||||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||||
import MkAbuseReportWindow from './MkAbuseReportWindow.vue';
|
import MkAbuseReportWindow from './MkAbuseReportWindow.vue';
|
||||||
|
@ -44,9 +44,9 @@ export const Default = {
|
||||||
msw: {
|
msw: {
|
||||||
handlers: [
|
handlers: [
|
||||||
...commonHandlers,
|
...commonHandlers,
|
||||||
rest.post('/api/users/report-abuse', async (req, res, ctx) => {
|
http.post('/api/users/report-abuse', async ({ request }) => {
|
||||||
action('POST /api/users/report-abuse')(await req.json());
|
action('POST /api/users/report-abuse')(await request.json());
|
||||||
return res(ctx.json({}));
|
return HttpResponse.json({});
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||||
import { StoryObj } from '@storybook/vue3';
|
import { StoryObj } from '@storybook/vue3';
|
||||||
import { rest } from 'msw';
|
import { HttpResponse, http } from 'msw';
|
||||||
import { userDetailed } from '../../.storybook/fakes.js';
|
import { userDetailed } from '../../.storybook/fakes.js';
|
||||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||||
import MkAchievements from './MkAchievements.vue';
|
import MkAchievements from './MkAchievements.vue';
|
||||||
|
@ -39,8 +39,8 @@ export const Empty = {
|
||||||
msw: {
|
msw: {
|
||||||
handlers: [
|
handlers: [
|
||||||
...commonHandlers,
|
...commonHandlers,
|
||||||
rest.post('/api/users/achievements', (req, res, ctx) => {
|
http.post('/api/users/achievements', () => {
|
||||||
return res(ctx.json([]));
|
return HttpResponse.json([]);
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -52,8 +52,8 @@ export const All = {
|
||||||
msw: {
|
msw: {
|
||||||
handlers: [
|
handlers: [
|
||||||
...commonHandlers,
|
...commonHandlers,
|
||||||
rest.post('/api/users/achievements', (req, res, ctx) => {
|
http.post('/api/users/achievements', () => {
|
||||||
return res(ctx.json(ACHIEVEMENT_TYPES.map((name) => ({ name, unlockedAt: 0 }))));
|
return HttpResponse.json(ACHIEVEMENT_TYPES.map((name) => ({ name, unlockedAt: 0 })));
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { action } from '@storybook/addon-actions';
|
||||||
import { expect } from '@storybook/jest';
|
import { expect } from '@storybook/jest';
|
||||||
import { userEvent, waitFor, within } from '@storybook/testing-library';
|
import { userEvent, waitFor, within } from '@storybook/testing-library';
|
||||||
import { StoryObj } from '@storybook/vue3';
|
import { StoryObj } from '@storybook/vue3';
|
||||||
import { rest } from 'msw';
|
import { HttpResponse, http } from 'msw';
|
||||||
import { userDetailed } from '../../.storybook/fakes.js';
|
import { userDetailed } from '../../.storybook/fakes.js';
|
||||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||||
import MkAutocomplete from './MkAutocomplete.vue';
|
import MkAutocomplete from './MkAutocomplete.vue';
|
||||||
|
@ -99,11 +99,11 @@ export const User = {
|
||||||
msw: {
|
msw: {
|
||||||
handlers: [
|
handlers: [
|
||||||
...commonHandlers,
|
...commonHandlers,
|
||||||
rest.post('/api/users/search-by-username-and-host', (req, res, ctx) => {
|
http.post('/api/users/search-by-username-and-host', () => {
|
||||||
return res(ctx.json([
|
return HttpResponse.json([
|
||||||
userDetailed('44', 'mizuki', 'misskey-hub.net', 'Mizuki'),
|
userDetailed('44', 'mizuki', 'misskey-hub.net', 'Mizuki'),
|
||||||
userDetailed('49', 'momoko', 'misskey-hub.net', 'Momoko'),
|
userDetailed('49', 'momoko', 'misskey-hub.net', 'Momoko'),
|
||||||
]));
|
]);
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -132,12 +132,12 @@ export const Hashtag = {
|
||||||
msw: {
|
msw: {
|
||||||
handlers: [
|
handlers: [
|
||||||
...commonHandlers,
|
...commonHandlers,
|
||||||
rest.post('/api/hashtags/search', (req, res, ctx) => {
|
http.post('/api/hashtags/search', () => {
|
||||||
return res(ctx.json([
|
return HttpResponse.json([
|
||||||
'気象警報注意報',
|
'気象警報注意報',
|
||||||
'気象警報',
|
'気象警報',
|
||||||
'気象情報',
|
'気象情報',
|
||||||
]));
|
]);
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||||
import { StoryObj } from '@storybook/vue3';
|
import { StoryObj } from '@storybook/vue3';
|
||||||
import { rest } from 'msw';
|
import { HttpResponse, http } from 'msw';
|
||||||
import { userDetailed } from '../../.storybook/fakes.js';
|
import { userDetailed } from '../../.storybook/fakes.js';
|
||||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||||
import MkAvatars from './MkAvatars.vue';
|
import MkAvatars from './MkAvatars.vue';
|
||||||
|
@ -38,12 +38,12 @@ export const Default = {
|
||||||
msw: {
|
msw: {
|
||||||
handlers: [
|
handlers: [
|
||||||
...commonHandlers,
|
...commonHandlers,
|
||||||
rest.post('/api/users/show', (req, res, ctx) => {
|
http.post('/api/users/show', () => {
|
||||||
return res(ctx.json([
|
return HttpResponse.json([
|
||||||
userDetailed('17'),
|
userDetailed('17'),
|
||||||
userDetailed('20'),
|
userDetailed('20'),
|
||||||
userDetailed('18'),
|
userDetailed('18'),
|
||||||
]));
|
]);
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -78,6 +78,7 @@ watch(() => props.lang, (to) => {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
border: 1px solid var(--divider);
|
border: 1px solid var(--divider);
|
||||||
|
font-family: Consolas, Monaco, Andale Mono, Ubuntu Mono, monospace;
|
||||||
|
|
||||||
color: var(--shiki-fallback);
|
color: var(--shiki-fallback);
|
||||||
background-color: var(--shiki-fallback-bg);
|
background-color: var(--shiki-fallback-bg);
|
||||||
|
|
|
@ -25,11 +25,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</Transition>
|
</Transition>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, shallowRef, computed, nextTick, watch } from 'vue';
|
import { ref, shallowRef, computed, nextTick, watch } from 'vue';
|
||||||
import type { Tab } from '@/components/global/MkPageHeader.tabs.vue';
|
import type { Tab } from '@/components/global/MkPageHeader.tabs.vue';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
|
import { isHorizontalSwipeSwiping as isSwiping } from '@/scripts/touch.js';
|
||||||
|
|
||||||
const rootEl = shallowRef<HTMLDivElement>();
|
const rootEl = shallowRef<HTMLDivElement>();
|
||||||
|
|
||||||
|
@ -49,16 +49,16 @@ const shouldAnimate = computed(() => defaultStore.reactiveState.enableHorizontal
|
||||||
// ▼ しきい値 ▼ //
|
// ▼ しきい値 ▼ //
|
||||||
|
|
||||||
// スワイプと判定される最小の距離
|
// スワイプと判定される最小の距離
|
||||||
const MIN_SWIPE_DISTANCE = 50;
|
const MIN_SWIPE_DISTANCE = 20;
|
||||||
|
|
||||||
// スワイプ時の動作を発火する最小の距離
|
// スワイプ時の動作を発火する最小の距離
|
||||||
const SWIPE_DISTANCE_THRESHOLD = 125;
|
const SWIPE_DISTANCE_THRESHOLD = 70;
|
||||||
|
|
||||||
// スワイプを中断するY方向の移動距離
|
// スワイプを中断するY方向の移動距離
|
||||||
const SWIPE_ABORT_Y_THRESHOLD = 75;
|
const SWIPE_ABORT_Y_THRESHOLD = 75;
|
||||||
|
|
||||||
// スワイプできる最大の距離
|
// スワイプできる最大の距離
|
||||||
const MAX_SWIPE_DISTANCE = 150;
|
const MAX_SWIPE_DISTANCE = 120;
|
||||||
|
|
||||||
// ▲ しきい値 ▲ //
|
// ▲ しきい値 ▲ //
|
||||||
|
|
||||||
|
@ -68,7 +68,6 @@ let startScreenY: number | null = null;
|
||||||
const currentTabIndex = computed(() => props.tabs.findIndex(tab => tab.key === tabModel.value));
|
const currentTabIndex = computed(() => props.tabs.findIndex(tab => tab.key === tabModel.value));
|
||||||
|
|
||||||
const pullDistance = ref(0);
|
const pullDistance = ref(0);
|
||||||
const isSwiping = ref(false);
|
|
||||||
const isSwipingForClass = ref(false);
|
const isSwipingForClass = ref(false);
|
||||||
let swipeAborted = false;
|
let swipeAborted = false;
|
||||||
|
|
||||||
|
@ -77,6 +76,8 @@ function touchStart(event: TouchEvent) {
|
||||||
|
|
||||||
if (event.touches.length !== 1) return;
|
if (event.touches.length !== 1) return;
|
||||||
|
|
||||||
|
if (hasSomethingToDoWithXSwipe(event.target as HTMLElement)) return;
|
||||||
|
|
||||||
startScreenX = event.touches[0].screenX;
|
startScreenX = event.touches[0].screenX;
|
||||||
startScreenY = event.touches[0].screenY;
|
startScreenY = event.touches[0].screenY;
|
||||||
}
|
}
|
||||||
|
@ -90,6 +91,8 @@ function touchMove(event: TouchEvent) {
|
||||||
|
|
||||||
if (swipeAborted) return;
|
if (swipeAborted) return;
|
||||||
|
|
||||||
|
if (hasSomethingToDoWithXSwipe(event.target as HTMLElement)) return;
|
||||||
|
|
||||||
let distanceX = event.touches[0].screenX - startScreenX;
|
let distanceX = event.touches[0].screenX - startScreenX;
|
||||||
let distanceY = event.touches[0].screenY - startScreenY;
|
let distanceY = event.touches[0].screenY - startScreenY;
|
||||||
|
|
||||||
|
@ -139,6 +142,8 @@ function touchEnd(event: TouchEvent) {
|
||||||
|
|
||||||
if (!isSwiping.value) return;
|
if (!isSwiping.value) return;
|
||||||
|
|
||||||
|
if (hasSomethingToDoWithXSwipe(event.target as HTMLElement)) return;
|
||||||
|
|
||||||
const distance = event.changedTouches[0].screenX - startScreenX;
|
const distance = event.changedTouches[0].screenX - startScreenX;
|
||||||
|
|
||||||
if (Math.abs(distance) > SWIPE_DISTANCE_THRESHOLD) {
|
if (Math.abs(distance) > SWIPE_DISTANCE_THRESHOLD) {
|
||||||
|
@ -162,6 +167,24 @@ function touchEnd(event: TouchEvent) {
|
||||||
}, 400);
|
}, 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 横スワイプに関与する可能性のある要素を調べる */
|
||||||
|
function hasSomethingToDoWithXSwipe(el: HTMLElement) {
|
||||||
|
if (['INPUT', 'TEXTAREA'].includes(el.tagName)) return true;
|
||||||
|
if (el.isContentEditable) return true;
|
||||||
|
if (el.scrollWidth > el.clientWidth) return true;
|
||||||
|
|
||||||
|
const style = window.getComputedStyle(el);
|
||||||
|
if (['absolute', 'fixed', 'sticky'].includes(style.position)) return true;
|
||||||
|
if (['scroll', 'auto'].includes(style.overflowX)) return true;
|
||||||
|
if (style.touchAction === 'pan-x') return true;
|
||||||
|
|
||||||
|
if (el.parentElement && el.parentElement !== rootEl.value) {
|
||||||
|
return hasSomethingToDoWithXSwipe(el.parentElement);
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const transitionName = ref<'swipeAnimationLeft' | 'swipeAnimationRight' | undefined>(undefined);
|
const transitionName = ref<'swipeAnimationLeft' | 'swipeAnimationRight' | undefined>(undefined);
|
||||||
|
|
||||||
watch(tabModel, (newTab, oldTab) => {
|
watch(tabModel, (newTab, oldTab) => {
|
||||||
|
@ -182,6 +205,7 @@ watch(tabModel, (newTab, oldTab) => {
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
.transitionRoot {
|
.transitionRoot {
|
||||||
|
touch-action: pan-y pinch-zoom;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 100%;
|
grid-template-columns: 100%;
|
||||||
overflow: clip;
|
overflow: clip;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||||
import { StoryObj } from '@storybook/vue3';
|
import { StoryObj } from '@storybook/vue3';
|
||||||
import { rest } from 'msw';
|
import { HttpResponse, http } from 'msw';
|
||||||
import { userDetailed, inviteCode } from '../../.storybook/fakes.js';
|
import { userDetailed, inviteCode } from '../../.storybook/fakes.js';
|
||||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||||
import MkInviteCode from './MkInviteCode.vue';
|
import MkInviteCode from './MkInviteCode.vue';
|
||||||
|
@ -39,8 +39,8 @@ export const Default = {
|
||||||
msw: {
|
msw: {
|
||||||
handlers: [
|
handlers: [
|
||||||
...commonHandlers,
|
...commonHandlers,
|
||||||
rest.post('/api/users/show', (req, res, ctx) => {
|
http.post('/api/users/show', ({ params }) => {
|
||||||
return res(ctx.json(userDetailed(req.params.userId as string)));
|
return HttpResponse.json(userDetailed(params.userId as string));
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -26,6 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
import { onMounted, onUnmounted, ref, shallowRef } from 'vue';
|
import { onMounted, onUnmounted, ref, shallowRef } from 'vue';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { getScrollContainer } from '@/scripts/scroll.js';
|
import { getScrollContainer } from '@/scripts/scroll.js';
|
||||||
|
import { isHorizontalSwipeSwiping } from '@/scripts/touch.js';
|
||||||
import { vibrate } from '@/scripts/vibrate.js';
|
import { vibrate } from '@/scripts/vibrate.js';
|
||||||
import { defaultStore } from '@/store.js';
|
import { defaultStore } from '@/store.js';
|
||||||
|
|
||||||
|
@ -133,7 +134,7 @@ function moveEnd() {
|
||||||
function moving(event: TouchEvent | PointerEvent) {
|
function moving(event: TouchEvent | PointerEvent) {
|
||||||
if (!isPullStart.value || isRefreshing.value || disabled) return;
|
if (!isPullStart.value || isRefreshing.value || disabled) return;
|
||||||
|
|
||||||
if ((scrollEl?.scrollTop ?? 0) > (supportPointerDesktop ? SCROLL_STOP : SCROLL_STOP + pullDistance.value)) {
|
if ((scrollEl?.scrollTop ?? 0) > (supportPointerDesktop ? SCROLL_STOP : SCROLL_STOP + pullDistance.value) || isHorizontalSwipeSwiping.value) {
|
||||||
pullDistance.value = 0;
|
pullDistance.value = 0;
|
||||||
isPullEnd.value = false;
|
isPullEnd.value = false;
|
||||||
moveEnd();
|
moveEnd();
|
||||||
|
@ -152,6 +153,10 @@ function moving(event: TouchEvent | PointerEvent) {
|
||||||
if (event.cancelable) event.preventDefault();
|
if (event.cancelable) event.preventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pullDistance.value > SCROLL_STOP) {
|
||||||
|
event.stopPropagation();
|
||||||
|
}
|
||||||
|
|
||||||
isPullEnd.value = pullDistance.value >= FIRE_THRESHOLD;
|
isPullEnd.value = pullDistance.value >= FIRE_THRESHOLD;
|
||||||
|
|
||||||
if (!isPullEnd.value) isVibrate = false;
|
if (!isPullEnd.value) isVibrate = false;
|
||||||
|
|
|
@ -17,9 +17,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, watch, onMounted, onUnmounted, provide, shallowRef } from 'vue';
|
import { computed, watch, onMounted, onUnmounted, provide, ref, shallowRef } from 'vue';
|
||||||
import Misskey from 'cherrypick-js';
|
import * as Misskey from 'cherrypick-js';
|
||||||
import { Connection } from 'cherrypick-js/built/streaming.js';
|
|
||||||
import MkNotes from '@/components/MkNotes.vue';
|
import MkNotes from '@/components/MkNotes.vue';
|
||||||
import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
|
import MkPullToRefresh from '@/components/MkPullToRefresh.vue';
|
||||||
import { useStream } from '@/stream.js';
|
import { useStream } from '@/stream.js';
|
||||||
|
@ -93,8 +92,8 @@ function prepend(note) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let connection: Connection;
|
let connection: Misskey.ChannelConnection | null = null;
|
||||||
let connection2: Connection;
|
let connection2: Misskey.ChannelConnection | null = null;
|
||||||
let paginationQuery: Paging | null = null;
|
let paginationQuery: Paging | null = null;
|
||||||
|
|
||||||
const stream = useStream();
|
const stream = useStream();
|
||||||
|
@ -162,7 +161,7 @@ function connectChannel() {
|
||||||
roleId: props.role,
|
roleId: props.role,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (props.src !== 'directs' && props.src !== 'mentions') connection.on('note', prepend);
|
if (props.src !== 'directs' && props.src !== 'mentions') connection?.on('note', prepend);
|
||||||
}
|
}
|
||||||
|
|
||||||
function disconnectChannel() {
|
function disconnectChannel() {
|
||||||
|
|
|
@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
v-if="player.url.startsWith('http://') || player.url.startsWith('https://')"
|
v-if="player.url.startsWith('http://') || player.url.startsWith('https://')"
|
||||||
sandbox="allow-popups allow-scripts allow-storage-access-by-user-activation allow-same-origin"
|
sandbox="allow-popups allow-scripts allow-storage-access-by-user-activation allow-same-origin"
|
||||||
scrolling="no"
|
scrolling="no"
|
||||||
:allow="player.allow.join(';')"
|
:allow="player.allow == null ? 'autoplay;encrypted-media;fullscreen' : player.allow.filter(x => ['autoplay', 'clipboard-write', 'fullscreen', 'encrypted-media', 'picture-in-picture', 'web-share'].includes(x)).join(';')"
|
||||||
:class="$style.playerIframe"
|
:class="$style.playerIframe"
|
||||||
:src="player.url + (player.url.match(/\?/) ? '&autoplay=1&auto_play=1' : '?autoplay=1&auto_play=1')"
|
:src="player.url + (player.url.match(/\?/) ? '&autoplay=1&auto_play=1' : '?autoplay=1&auto_play=1')"
|
||||||
:style="{ border: 0 }"
|
:style="{ border: 0 }"
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||||
import { StoryObj } from '@storybook/vue3';
|
import { StoryObj } from '@storybook/vue3';
|
||||||
import { rest } from 'msw';
|
import { HttpResponse, http } from 'msw';
|
||||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||||
import { userDetailed } from '../../.storybook/fakes.js';
|
import { userDetailed } from '../../.storybook/fakes.js';
|
||||||
import MkUserSetupDialog_Follow from './MkUserSetupDialog.Follow.vue';
|
import MkUserSetupDialog_Follow from './MkUserSetupDialog.Follow.vue';
|
||||||
|
@ -38,17 +38,17 @@ export const Default = {
|
||||||
msw: {
|
msw: {
|
||||||
handlers: [
|
handlers: [
|
||||||
...commonHandlers,
|
...commonHandlers,
|
||||||
rest.post('/api/users', (req, res, ctx) => {
|
http.post('/api/users', () => {
|
||||||
return res(ctx.json([
|
return HttpResponse.json([
|
||||||
userDetailed('44'),
|
userDetailed('44'),
|
||||||
userDetailed('49'),
|
userDetailed('49'),
|
||||||
]));
|
]);
|
||||||
}),
|
}),
|
||||||
rest.post('/api/pinned-users', (req, res, ctx) => {
|
http.post('/api/pinned-users', () => {
|
||||||
return res(ctx.json([
|
return HttpResponse.json([
|
||||||
userDetailed('44'),
|
userDetailed('44'),
|
||||||
userDetailed('49'),
|
userDetailed('49'),
|
||||||
]));
|
]);
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -34,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import Misskey from 'cherrypick-js';
|
import * as Misskey from 'cherrypick-js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import MkFolder from '@/components/MkFolder.vue';
|
import MkFolder from '@/components/MkFolder.vue';
|
||||||
import XUser from '@/components/MkUserSetupDialog.User.vue';
|
import XUser from '@/components/MkUserSetupDialog.User.vue';
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||||
import { StoryObj } from '@storybook/vue3';
|
import { StoryObj } from '@storybook/vue3';
|
||||||
import { rest } from 'msw';
|
import { HttpResponse, http } from 'msw';
|
||||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||||
import { userDetailed } from '../../.storybook/fakes.js';
|
import { userDetailed } from '../../.storybook/fakes.js';
|
||||||
import MkUserSetupDialog from './MkUserSetupDialog.vue';
|
import MkUserSetupDialog from './MkUserSetupDialog.vue';
|
||||||
|
@ -38,17 +38,17 @@ export const Default = {
|
||||||
msw: {
|
msw: {
|
||||||
handlers: [
|
handlers: [
|
||||||
...commonHandlers,
|
...commonHandlers,
|
||||||
rest.post('/api/users', (req, res, ctx) => {
|
http.post('/api/users', () => {
|
||||||
return res(ctx.json([
|
return HttpResponse.json([
|
||||||
userDetailed('44'),
|
userDetailed('44'),
|
||||||
userDetailed('49'),
|
userDetailed('49'),
|
||||||
]));
|
]);
|
||||||
}),
|
}),
|
||||||
rest.post('/api/pinned-users', (req, res, ctx) => {
|
http.post('/api/pinned-users', () => {
|
||||||
return res(ctx.json([
|
return HttpResponse.json([
|
||||||
userDetailed('44'),
|
userDetailed('44'),
|
||||||
userDetailed('49'),
|
userDetailed('49'),
|
||||||
]));
|
]);
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
import { expect } from '@storybook/jest';
|
import { expect } from '@storybook/jest';
|
||||||
import { userEvent, waitFor, within } from '@storybook/testing-library';
|
import { userEvent, waitFor, within } from '@storybook/testing-library';
|
||||||
import { StoryObj } from '@storybook/vue3';
|
import { StoryObj } from '@storybook/vue3';
|
||||||
import { rest } from 'msw';
|
import { HttpResponse, http } from 'msw';
|
||||||
import { commonHandlers } from '../../../.storybook/mocks.js';
|
import { commonHandlers } from '../../../.storybook/mocks.js';
|
||||||
import MkUrl from './MkUrl.vue';
|
import MkUrl from './MkUrl.vue';
|
||||||
export const Default = {
|
export const Default = {
|
||||||
|
@ -59,8 +59,8 @@ export const Default = {
|
||||||
msw: {
|
msw: {
|
||||||
handlers: [
|
handlers: [
|
||||||
...commonHandlers,
|
...commonHandlers,
|
||||||
rest.get('/url', (req, res, ctx) => {
|
http.get('/url', () => {
|
||||||
return res(ctx.json({
|
return HttpResponse.json({
|
||||||
title: 'Misskey Hub',
|
title: 'Misskey Hub',
|
||||||
icon: 'https://misskey-hub.net/favicon.ico',
|
icon: 'https://misskey-hub.net/favicon.ico',
|
||||||
description: 'Misskeyはオープンソースの分散型ソーシャルネットワーキングプラットフォームです。',
|
description: 'Misskeyはオープンソースの分散型ソーシャルネットワーキングプラットフォームです。',
|
||||||
|
@ -74,7 +74,7 @@ export const Default = {
|
||||||
sitename: 'misskey-hub.net',
|
sitename: 'misskey-hub.net',
|
||||||
sensitive: false,
|
sensitive: false,
|
||||||
url: 'https://misskey-hub.net/',
|
url: 'https://misskey-hub.net/',
|
||||||
}));
|
});
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -323,13 +323,13 @@ const patronsWithIconWithMisskey = [{
|
||||||
icon: 'https://assets.misskey-hub.net/patrons/302dce2898dd457ba03c3f7dc037900b.jpg',
|
icon: 'https://assets.misskey-hub.net/patrons/302dce2898dd457ba03c3f7dc037900b.jpg',
|
||||||
}, {
|
}, {
|
||||||
name: 'taichan',
|
name: 'taichan',
|
||||||
icon: 'https://assets.misskey-hub.net/patrons/f981ab0159fb4e2c998e05f7263e1cd9.png',
|
icon: 'https://assets.misskey-hub.net/patrons/f981ab0159fb4e2c998e05f7263e1cd9.jpg',
|
||||||
}, {
|
}, {
|
||||||
name: '猫吉よりお',
|
name: '猫吉よりお',
|
||||||
icon: 'https://assets.misskey-hub.net/patrons/a11518b3b34b4536a4bdd7178ba76a7b.png',
|
icon: 'https://assets.misskey-hub.net/patrons/a11518b3b34b4536a4bdd7178ba76a7b.jpg',
|
||||||
}, {
|
}, {
|
||||||
name: '有栖かずみ',
|
name: '有栖かずみ',
|
||||||
icon: 'https://assets.misskey-hub.net/patrons/9240e8e0ba294a8884143e99ac7ed6a0.png',
|
icon: 'https://assets.misskey-hub.net/patrons/9240e8e0ba294a8884143e99ac7ed6a0.jpg',
|
||||||
}];
|
}];
|
||||||
|
|
||||||
const patronsWithCherryPick = [
|
const patronsWithCherryPick = [
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||||
import { StoryObj } from '@storybook/vue3';
|
import { StoryObj } from '@storybook/vue3';
|
||||||
import { rest } from 'msw';
|
import { HttpResponse, http } from 'msw';
|
||||||
import { userDetailed } from '../../../.storybook/fakes.js';
|
import { userDetailed } from '../../../.storybook/fakes.js';
|
||||||
import { commonHandlers } from '../../../.storybook/mocks.js';
|
import { commonHandlers } from '../../../.storybook/mocks.js';
|
||||||
import home_ from './home.vue';
|
import home_ from './home.vue';
|
||||||
|
@ -39,12 +39,13 @@ export const Default = {
|
||||||
msw: {
|
msw: {
|
||||||
handlers: [
|
handlers: [
|
||||||
...commonHandlers,
|
...commonHandlers,
|
||||||
rest.post('/api/users/notes', (req, res, ctx) => {
|
http.post('/api/users/notes', () => {
|
||||||
return res(ctx.json([]));
|
return HttpResponse.json([]);
|
||||||
}),
|
}),
|
||||||
rest.get('/api/charts/user/notes', (req, res, ctx) => {
|
http.get('/api/charts/user/notes', ({ request }) => {
|
||||||
const length = Math.max(Math.min(parseInt(req.url.searchParams.get('limit') ?? '30', 10), 1), 300);
|
const url = new URL(request.url);
|
||||||
return res(ctx.json({
|
const length = Math.max(Math.min(parseInt(url.searchParams.get('limit') ?? '30', 10), 1), 300);
|
||||||
|
return HttpResponse.json({
|
||||||
total: Array.from({ length }, () => 0),
|
total: Array.from({ length }, () => 0),
|
||||||
inc: Array.from({ length }, () => 0),
|
inc: Array.from({ length }, () => 0),
|
||||||
dec: Array.from({ length }, () => 0),
|
dec: Array.from({ length }, () => 0),
|
||||||
|
@ -54,11 +55,12 @@ export const Default = {
|
||||||
renote: Array.from({ length }, () => 0),
|
renote: Array.from({ length }, () => 0),
|
||||||
withFile: Array.from({ length }, () => 0),
|
withFile: Array.from({ length }, () => 0),
|
||||||
},
|
},
|
||||||
}));
|
});
|
||||||
}),
|
}),
|
||||||
rest.get('/api/charts/user/pv', (req, res, ctx) => {
|
http.get('/api/charts/user/pv', ({ request }) => {
|
||||||
const length = Math.max(Math.min(parseInt(req.url.searchParams.get('limit') ?? '30', 10), 1), 300);
|
const url = new URL(request.url);
|
||||||
return res(ctx.json({
|
const length = Math.max(Math.min(parseInt(url.searchParams.get('limit') ?? '30', 10), 1), 300);
|
||||||
|
return HttpResponse.json({
|
||||||
upv: {
|
upv: {
|
||||||
user: Array.from({ length }, () => 0),
|
user: Array.from({ length }, () => 0),
|
||||||
visitor: Array.from({ length }, () => 0),
|
visitor: Array.from({ length }, () => 0),
|
||||||
|
@ -67,7 +69,7 @@ export const Default = {
|
||||||
user: Array.from({ length }, () => 0),
|
user: Array.from({ length }, () => 0),
|
||||||
visitor: Array.from({ length }, () => 0),
|
visitor: Array.from({ length }, () => 0),
|
||||||
},
|
},
|
||||||
}));
|
});
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
import { deviceKind } from '@/scripts/device-kind.js';
|
import { deviceKind } from '@/scripts/device-kind.js';
|
||||||
|
|
||||||
const isTouchSupported = 'maxTouchPoints' in navigator && navigator.maxTouchPoints > 0;
|
const isTouchSupported = 'maxTouchPoints' in navigator && navigator.maxTouchPoints > 0;
|
||||||
|
@ -16,3 +17,6 @@ if (isTouchSupported && !isTouchUsing) {
|
||||||
isTouchUsing = true;
|
isTouchUsing = true;
|
||||||
}, { passive: true });
|
}, { passive: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** (MkHorizontalSwipe) 横スワイプ中か? */
|
||||||
|
export const isHorizontalSwipeSwiping = ref(false);
|
||||||
|
|
|
@ -116,6 +116,34 @@ describe('MkUrlPreview', () => {
|
||||||
assert.strictEqual(iframe?.allow, 'fullscreen;web-share');
|
assert.strictEqual(iframe?.allow, 'fullscreen;web-share');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('A Summaly proxy response without allow falls back to the default', async () => {
|
||||||
|
const iframe = await renderAndOpenPreview({
|
||||||
|
url: 'https://example.local',
|
||||||
|
player: {
|
||||||
|
url: 'https://example.local/player',
|
||||||
|
width: null,
|
||||||
|
height: null,
|
||||||
|
allow: undefined as any,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
assert.exists(iframe, 'iframe should exist');
|
||||||
|
assert.strictEqual(iframe?.allow, 'autoplay;encrypted-media;fullscreen');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Filtering the allow list from the Summaly proxy', async () => {
|
||||||
|
const iframe = await renderAndOpenPreview({
|
||||||
|
url: 'https://example.local',
|
||||||
|
player: {
|
||||||
|
url: 'https://example.local/player',
|
||||||
|
width: null,
|
||||||
|
height: null,
|
||||||
|
allow: ['autoplay', 'camera', 'fullscreen'],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
assert.exists(iframe, 'iframe should exist');
|
||||||
|
assert.strictEqual(iframe?.allow, 'autoplay;fullscreen');
|
||||||
|
});
|
||||||
|
|
||||||
test('Having a player width should keep the fixed aspect ratio', async () => {
|
test('Having a player width should keep the fixed aspect ratio', async () => {
|
||||||
const iframe = await renderAndOpenPreview({
|
const iframe = await renderAndOpenPreview({
|
||||||
url: 'https://example.local',
|
url: 'https://example.local',
|
||||||
|
|
|
@ -1123,11 +1123,11 @@ importers:
|
||||||
specifier: 4.0.5
|
specifier: 4.0.5
|
||||||
version: 4.0.5
|
version: 4.0.5
|
||||||
msw:
|
msw:
|
||||||
specifier: 2.1.2
|
specifier: 2.1.7
|
||||||
version: 2.1.2(typescript@5.3.3)
|
version: 2.1.7(typescript@5.3.3)
|
||||||
msw-storybook-addon:
|
msw-storybook-addon:
|
||||||
specifier: 1.10.0
|
specifier: 2.0.0-beta.1
|
||||||
version: 1.10.0(msw@2.1.2)
|
version: 2.0.0-beta.1(msw@2.1.7)
|
||||||
nodemon:
|
nodemon:
|
||||||
specifier: 3.0.3
|
specifier: 3.0.3
|
||||||
version: 3.0.3
|
version: 3.0.3
|
||||||
|
@ -3265,12 +3265,6 @@ packages:
|
||||||
cookie: 0.5.0
|
cookie: 0.5.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@bundled-es-modules/js-levenshtein@2.0.1:
|
|
||||||
resolution: {integrity: sha512-DERMS3yfbAljKsQc0U2wcqGKUWpdFjwqWuoMugEJlqBnKO180/n+4SR/J8MRDt1AN48X1ovgoD9KrdVXcaa3Rg==}
|
|
||||||
dependencies:
|
|
||||||
js-levenshtein: 1.1.6
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@bundled-es-modules/statuses@1.0.1:
|
/@bundled-es-modules/statuses@1.0.1:
|
||||||
resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==}
|
resolution: {integrity: sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
|
@ -4824,8 +4818,8 @@ packages:
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@mswjs/interceptors@0.25.14:
|
/@mswjs/interceptors@0.25.16:
|
||||||
resolution: {integrity: sha512-2dnIxl+obqIqjoPXTFldhe6pcdOrqiz+GcLaQQ6hmL02OldAF7nIC+rUgTWm+iF6lvmyCVhFFqbgbapNhR8eag==}
|
resolution: {integrity: sha512-8QC8JyKztvoGAdPgyZy49c9vSHHAZjHagwl4RY9E8carULk8ym3iTaiawrT1YoLF/qb449h48f71XDPgkUSOUg==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@open-draft/deferred-promise': 2.2.0
|
'@open-draft/deferred-promise': 2.2.0
|
||||||
|
@ -8185,10 +8179,6 @@ packages:
|
||||||
pretty-format: 29.7.0
|
pretty-format: 29.7.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@types/js-levenshtein@1.1.3:
|
|
||||||
resolution: {integrity: sha512-jd+Q+sD20Qfu9e2aEXogiO3vpOC1PYJOUdyN9gvs4Qrvkg4wF43L5OhqrPeokdv8TL0/mXoYfpkcoGZMNN2pkQ==}
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/@types/js-yaml@4.0.9:
|
/@types/js-yaml@4.0.9:
|
||||||
resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==}
|
resolution: {integrity: sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==}
|
||||||
dev: true
|
dev: true
|
||||||
|
@ -14818,11 +14808,6 @@ packages:
|
||||||
nopt: 6.0.0
|
nopt: 6.0.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/js-levenshtein@1.1.6:
|
|
||||||
resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==}
|
|
||||||
engines: {node: '>=0.10.0'}
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/js-stringify@1.0.2:
|
/js-stringify@1.0.2:
|
||||||
resolution: {integrity: sha512-rtS5ATOo2Q5k1G+DADISilDA6lv79zIiwFd6CcjuIxGKLFm5C+RLImRscVap9k55i+MOZwgliw+NejvkLuGD5g==}
|
resolution: {integrity: sha512-rtS5ATOo2Q5k1G+DADISilDA6lv79zIiwFd6CcjuIxGKLFm5C+RLImRscVap9k55i+MOZwgliw+NejvkLuGD5g==}
|
||||||
|
|
||||||
|
@ -15860,17 +15845,17 @@ packages:
|
||||||
msgpackr-extract: 3.0.2
|
msgpackr-extract: 3.0.2
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/msw-storybook-addon@1.10.0(msw@2.1.2):
|
/msw-storybook-addon@2.0.0-beta.1(msw@2.1.7):
|
||||||
resolution: {integrity: sha512-soCTMTf7DnLeaMnFHPrtVgbyeFTJALVvnDHpzzXpJad+HOzJgQdwU4EAzVfDs1q+X5cVEgxOdAhSMC7ljvnSXg==}
|
resolution: {integrity: sha512-DRyIAMK3waEfC+pKTyiIq68OZfiZ4WZGUVAn6J4YwCRpDdoCvLzzoC2spN0Jgegx4dEmJ7589ATnS14NxqeBig==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
msw: '>=0.35.0 <2.0.0'
|
msw: ^2.0.0
|
||||||
dependencies:
|
dependencies:
|
||||||
is-node-process: 1.2.0
|
is-node-process: 1.2.0
|
||||||
msw: 2.1.2(typescript@5.3.3)
|
msw: 2.1.7(typescript@5.3.3)
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/msw@2.1.2(typescript@5.3.3):
|
/msw@2.1.7(typescript@5.3.3):
|
||||||
resolution: {integrity: sha512-7OKbeZNFQTCPFe++o+zZHMkQRIUi4D/5N1dAD3lOlaV+2Wpv3Srp3VFrFeH+2ftZJbb4jAiC0caZoW1efr80KQ==}
|
resolution: {integrity: sha512-yTIYqEMqDSrdbVMrfmqP6rTKQsnIbglTvVmAHDWwNegyXPXRcV+RjsaFEqubRS266gwWCDLm9YdOkWSKLdDvJQ==}
|
||||||
engines: {node: '>=18'}
|
engines: {node: '>=18'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
|
@ -15881,13 +15866,11 @@ packages:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@bundled-es-modules/cookie': 2.0.0
|
'@bundled-es-modules/cookie': 2.0.0
|
||||||
'@bundled-es-modules/js-levenshtein': 2.0.1
|
|
||||||
'@bundled-es-modules/statuses': 1.0.1
|
'@bundled-es-modules/statuses': 1.0.1
|
||||||
'@mswjs/cookies': 1.1.0
|
'@mswjs/cookies': 1.1.0
|
||||||
'@mswjs/interceptors': 0.25.14
|
'@mswjs/interceptors': 0.25.16
|
||||||
'@open-draft/until': 2.1.0
|
'@open-draft/until': 2.1.0
|
||||||
'@types/cookie': 0.6.0
|
'@types/cookie': 0.6.0
|
||||||
'@types/js-levenshtein': 1.1.3
|
|
||||||
'@types/statuses': 2.0.4
|
'@types/statuses': 2.0.4
|
||||||
chalk: 4.1.2
|
chalk: 4.1.2
|
||||||
chokidar: 3.5.3
|
chokidar: 3.5.3
|
||||||
|
@ -15895,7 +15878,6 @@ packages:
|
||||||
headers-polyfill: 4.0.2
|
headers-polyfill: 4.0.2
|
||||||
inquirer: 8.2.5
|
inquirer: 8.2.5
|
||||||
is-node-process: 1.2.0
|
is-node-process: 1.2.0
|
||||||
js-levenshtein: 1.1.6
|
|
||||||
outvariant: 1.4.2
|
outvariant: 1.4.2
|
||||||
path-to-regexp: 6.2.1
|
path-to-regexp: 6.2.1
|
||||||
strict-event-emitter: 0.5.1
|
strict-event-emitter: 0.5.1
|
||||||
|
|
Loading…
Reference in a new issue