Merge tag '2023.9.0' into merge-upstream

This commit is contained in:
riku6460
2023-09-25 12:43:07 +09:00
1235 changed files with 19016 additions and 13835 deletions

View File

@@ -11,7 +11,7 @@
"decoratorMetadata": true
},
"experimental": {
"keepImportAssertions": true
"keepImportAttributes": true
},
"baseUrl": "src",
"paths": {

View File

@@ -17,11 +17,6 @@ export type Acct = {
// @public (undocumented)
type Ad = TODO_2;
// @public (undocumented)
type AdminInstanceMetadata = DetailedInstanceMetadata & {
blockedHosts: string[];
};
// @public (undocumented)
type Announcement = {
id: ID;
@@ -30,13 +25,8 @@ type Announcement = {
text: string;
title: string;
imageUrl: string | null;
display: 'normal' | 'banner' | 'dialog';
icon: 'info' | 'warning' | 'error' | 'success';
needConfirmationToRead: boolean;
closeDuration: number;
displayOrder: number;
forYou: boolean;
isRead?: boolean;
isPrivate: boolean;
};
// @public (undocumented)
@@ -272,9 +262,6 @@ type CustomEmoji = {
url: string;
category: string;
aliases: string[];
isSensitive?: boolean;
roleIdsThatCanBeUsedThisEmojiAsReaction?: string[];
roleIdsThatCanNotBeUsedThisEmojiAsReaction?: string[];
};
// @public (undocumented)
@@ -285,7 +272,6 @@ type DetailedInstanceMetadata = LiteInstanceMetadata & {
pinnedPages: string[];
pinnedClipId: string | null;
cacheRemoteFiles: boolean;
cacheRemoteSensitiveFiles: boolean;
requireSetup: boolean;
proxyAccountName: string | null;
features: Record<string, any>;
@@ -342,10 +328,6 @@ export type Endpoints = {
req: TODO;
res: TODO;
};
'admin/meta': {
req: NoParams;
res: AdminInstanceMetadata;
};
'admin/reset-password': {
req: TODO;
res: TODO;
@@ -442,22 +424,6 @@ export type Endpoints = {
req: TODO;
res: TODO;
};
'admin/abuse-report-resolver/create': {
req: TODO;
res: TODO;
};
'admin/abuse-report-resolver/list': {
req: TODO;
res: TODO;
};
'admin/abuse-report-resolver/update': {
req: TODO;
res: TODO;
};
'admin/abuse-report-resolver/delete': {
req: TODO;
res: TODO;
};
'admin/drive/clean-remote-files': {
req: TODO;
res: TODO;
@@ -516,14 +482,6 @@ export type Endpoints = {
req: TODO;
res: TODO;
};
'admin/invite/create': {
req: TODO;
res: TODO;
};
'admin/invite/list': {
req: TODO;
res: TODO;
};
'admin/moderators/add': {
req: TODO;
res: TODO;
@@ -570,9 +528,11 @@ export type Endpoints = {
};
'announcements': {
req: {
isActive?: boolean;
limit?: number;
offset?: number;
withUnreads?: boolean;
sinceId?: Announcement['id'];
untilId?: Announcement['id'];
privateOnly?: boolean;
};
res: Announcement[];
};
@@ -1002,14 +962,8 @@ export type Endpoints = {
res: TODO;
};
'drive/files/create': {
req: {
folderId?: string;
name?: string;
comment?: string;
isSentisive?: boolean;
force?: boolean;
};
res: DriveFile;
req: TODO;
res: TODO;
};
'drive/files/delete': {
req: {
@@ -1591,28 +1545,6 @@ export type Endpoints = {
req: TODO;
res: TODO;
};
'invite/create': {
req: NoParams;
res: Invite;
};
'invite/delete': {
req: {
inviteId: Invite['id'];
};
res: null;
};
'invite/list': {
req: {
limit?: number;
sinceId?: Invite['id'];
untilId?: Invite['id'];
};
res: Invite[];
};
'invite/limit': {
req: NoParams;
res: InviteLimit;
};
'messaging/history': {
req: {
limit?: number;
@@ -2012,19 +1944,6 @@ export type Endpoints = {
req: TODO;
res: TODO;
};
'signup': {
req: {
username: string;
password: string;
host?: string;
invitationCode?: string;
emailAddress?: string;
'hcaptcha-response'?: string;
'g-recaptcha-response'?: string;
'turnstile-response'?: string;
};
res: MeSignup | null;
};
'stats': {
req: NoParams;
res: Stats;
@@ -2242,8 +2161,6 @@ declare namespace entities {
UserGroup,
UserList,
MeDetailed,
MeDetailedWithSecret,
MeSignup,
DriveFile,
DriveFolder,
GalleryPost,
@@ -2255,7 +2172,6 @@ declare namespace entities {
LiteInstanceMetadata,
DetailedInstanceMetadata,
InstanceMetadata,
AdminInstanceMetadata,
ServerInfo,
Stats,
Page,
@@ -2275,8 +2191,6 @@ declare namespace entities {
Blocking,
Instance,
Signin,
Invite,
InviteLimit,
UserSorting,
OriginType
}
@@ -2347,7 +2261,7 @@ type ID = string;
// @public (undocumented)
type Instance = {
id: ID;
firstRetrievedAt: DateString;
caughtAt: DateString;
host: string;
usersCount: number;
notesCount: number;
@@ -2361,7 +2275,6 @@ type Instance = {
lastCommunicatedAt: DateString;
isNotResponding: boolean;
isSuspended: boolean;
isBlocked: boolean;
softwareName: string | null;
softwareVersion: string | null;
openRegistrations: boolean | null;
@@ -2378,23 +2291,6 @@ type Instance = {
// @public (undocumented)
type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata;
// @public (undocumented)
type Invite = {
id: ID;
code: string;
expiresAt: DateString | null;
createdAt: DateString;
createdBy: UserLite | null;
usedBy: UserLite | null;
usedAt: DateString | null;
used: boolean;
};
// @public (undocumented)
type InviteLimit = {
remaining: number;
};
// @public (undocumented)
function isAPIError(reason: any): reason is APIError;
@@ -2467,7 +2363,6 @@ type MeDetailed = UserDetailed & {
hasUnreadMessagingMessage: boolean;
hasUnreadNotification: boolean;
hasUnreadSpecifiedNotes: boolean;
twoFactorBackupCodes: 'full' | 'partial' | 'none';
hideOnlineStatus: boolean;
injectFeaturedNote: boolean;
integrations: Record<string, any>;
@@ -2477,26 +2372,10 @@ type MeDetailed = UserDetailed & {
mutingNotificationTypes: string[];
noCrawle: boolean;
receiveAnnouncementEmail: boolean;
unreadAnnouncements: Announcement[];
usePasswordLessLogin: boolean;
[other: string]: any;
};
// @public (undocumented)
type MeDetailedWithSecret = MeDetailed & {
email: string;
emailVerified: boolean;
securityKeysList: {
id: string;
name: string;
lastUsed: string;
}[];
};
// @public (undocumented)
type MeSignup = MeDetailedWithSecret & {
token: string;
};
// @public (undocumented)
type MessagingMessage = {
id: ID;
@@ -2783,7 +2662,6 @@ type UserDetailed = UserLite & {
isModerator: boolean;
isMuted: boolean;
isSilenced: boolean;
isLimited: boolean;
isSuspended: boolean;
lang: string | null;
lastFetchedAt?: DateString;
@@ -2797,7 +2675,6 @@ type UserDetailed = UserLite & {
publicReactions: boolean;
securityKeys: boolean;
twoFactorEnabled: boolean;
usePasswordLessLogin: boolean;
updatedAt: DateString | null;
uri: string | null;
url: string | null;
@@ -2844,7 +2721,7 @@ type UserSorting = '+follower' | '-follower' | '+createdAt' | '-createdAt' | '+u
//
// src/api.types.ts:16:32 - (ae-forgotten-export) The symbol "TODO" needs to be exported by the entry point index.d.ts
// src/api.types.ts:18:25 - (ae-forgotten-export) The symbol "NoParams" needs to be exported by the entry point index.d.ts
// src/api.types.ts:633:18 - (ae-forgotten-export) The symbol "ShowUserReq" needs to be exported by the entry point index.d.ts
// src/api.types.ts:596:18 - (ae-forgotten-export) The symbol "ShowUserReq" needs to be exported by the entry point index.d.ts
// src/streaming.types.ts:33:4 - (ae-forgotten-export) The symbol "FIXME" needs to be exported by the entry point index.d.ts
// (No @packageDocumentation comment for this package)

View File

@@ -20,26 +20,26 @@
"url": "git+https://github.com/misskey-dev/misskey.js.git"
},
"devDependencies": {
"@microsoft/api-extractor": "7.36.2",
"@swc/jest": "0.2.26",
"@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",
"@microsoft/api-extractor": "7.37.0",
"@swc/jest": "0.2.29",
"@types/jest": "29.5.5",
"@types/node": "20.6.4",
"@typescript-eslint/eslint-plugin": "6.7.2",
"@typescript-eslint/parser": "6.7.2",
"eslint": "8.50.0",
"jest": "29.7.0",
"jest-fetch-mock": "3.0.3",
"jest-websocket-mock": "2.4.0",
"mock-socket": "9.2.1",
"tsd": "0.28.1",
"typescript": "5.1.6"
"jest-websocket-mock": "2.5.0",
"mock-socket": "9.3.1",
"tsd": "0.29.0",
"typescript": "5.2.2"
},
"files": [
"built"
],
"dependencies": {
"@swc/cli": "0.1.62",
"@swc/core": "1.3.69",
"@swc/core": "1.3.87",
"eventemitter3": "5.0.1",
"reconnecting-websocket": "4.4.0"
}

View File

@@ -538,6 +538,7 @@ export type Endpoints = {
// notifications
'notifications/create': { req: { body: string; header?: string | null; icon?: string | null; }; res: null; };
'notifications/test-notification': { req: NoParams; res: null; };
'notifications/mark-all-as-read': { req: NoParams; res: null; };
// page-push
@@ -625,6 +626,7 @@ export type Endpoints = {
'users/lists/update': { req: { listId: UserList['id']; name: string; }; res: UserList; };
'users/notes': { req: { userId: User['id']; limit?: number; sinceId?: Note['id']; untilId?: Note['id']; sinceDate?: number; untilDate?: number; }; res: Note[]; };
'users/pages': { req: TODO; res: TODO; };
'users/flashs': { req: TODO; res: TODO; };
'users/recommendation': { req: TODO; res: TODO; };
'users/relation': { req: TODO; res: TODO; };
'users/report-abuse': { req: TODO; res: TODO; };

View File

@@ -1,4 +1,4 @@
export const notificationTypes = ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app'] as const;
export const notificationTypes = ['note', 'follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app'] as const;
export const noteVisibilities = ['public', 'home', 'followers', 'specified'] as const;
@@ -39,4 +39,145 @@ export const permissions = [
'write:gallery',
'read:gallery-likes',
'write:gallery-likes',
'read:flash',
'write:flash',
'read:flash-likes',
'write:flash-likes',
];
export const moderationLogTypes = [
'updateServerSettings',
'suspend',
'unsuspend',
'updateUserNote',
'addCustomEmoji',
'updateCustomEmoji',
'deleteCustomEmoji',
'assignRole',
'unassignRole',
'updateRole',
'deleteRole',
'clearQueue',
'promoteQueue',
'deleteDriveFile',
'deleteNote',
'createGlobalAnnouncement',
'createUserAnnouncement',
'updateGlobalAnnouncement',
'updateUserAnnouncement',
'deleteGlobalAnnouncement',
'deleteUserAnnouncement',
'resetPassword',
'suspendRemoteInstance',
'unsuspendRemoteInstance',
'markSensitiveDriveFile',
'unmarkSensitiveDriveFile',
] as const;
export type ModerationLogPayloads = {
updateServerSettings: {
before: any | null;
after: any | null;
};
suspend: {
targetId: string;
};
unsuspend: {
targetId: string;
};
updateUserNote: {
userId: string;
before: string | null;
after: string | null;
};
addCustomEmoji: {
emojiId: string;
emoji: any;
};
updateCustomEmoji: {
emojiId: string;
before: any;
after: any;
};
deleteCustomEmoji: {
emojiId: string;
emoji: any;
};
assignRole: {
userId: string;
roleId: string;
roleName: string;
expiresAt: string | null;
};
unassignRole: {
userId: string;
roleId: string;
roleName: string;
};
updateRole: {
roleId: string;
before: any;
after: any;
};
deleteRole: {
roleId: string;
role: any;
};
clearQueue: Record<string, never>;
promoteQueue: Record<string, never>;
deleteDriveFile: {
fileId: string;
fileUserId: string | null;
};
deleteNote: {
noteId: string;
noteUserId: string;
note: any;
};
createGlobalAnnouncement: {
announcementId: string;
announcement: any;
};
createUserAnnouncement: {
announcementId: string;
announcement: any;
userId: string;
};
updateGlobalAnnouncement: {
announcementId: string;
before: any;
after: any;
};
updateUserAnnouncement: {
announcementId: string;
before: any;
after: any;
};
deleteGlobalAnnouncement: {
announcementId: string;
announcement: any;
};
deleteUserAnnouncement: {
announcementId: string;
announcement: any;
};
resetPassword: {
targetId: string;
};
suspendRemoteInstance: {
id: string;
host: string;
};
unsuspendRemoteInstance: {
id: string;
host: string;
};
markSensitiveDriveFile: {
fileId: string;
fileUserId: string | null;
};
unmarkSensitiveDriveFile: {
fileId: string;
fileUserId: string | null;
};
};

View File

@@ -1,3 +1,5 @@
import { ModerationLogPayloads } from './consts.js';
export type ID = string;
export type DateString = string;
@@ -38,6 +40,7 @@ export type UserDetailed = UserLite & {
description: string | null;
ffVisibility: 'public' | 'followers' | 'private';
fields: {name: string; value: string}[];
verifiedLinks: string[];
followersCount: number;
followingCount: number;
hasPendingFollowRequestFromYou: boolean;
@@ -71,6 +74,7 @@ export type UserDetailed = UserLite & {
updatedAt: DateString | null;
uri: string | null;
url: string | null;
notify: 'normal' | 'none';
};
export type UserGroup = TODO;
@@ -106,7 +110,9 @@ export type MeDetailed = UserDetailed & {
mutingNotificationTypes: string[];
noCrawle: boolean;
receiveAnnouncementEmail: boolean;
usePasswordLessLogin: boolean;
unreadAnnouncements: Announcement[];
twoFactorBackupCodesStock: 'full' | 'partial' | 'none';
[other: string]: any;
};
@@ -176,6 +182,7 @@ export type Note = {
reactions: Record<string, number>;
renoteCount: number;
repliesCount: number;
clippedCount?: number;
poll?: {
expiresAt: DateString | null;
multiple: boolean;
@@ -232,7 +239,12 @@ export type Notification = {
userId: User['id'];
note: Note;
} | {
type: 'pollVote';
type: 'note';
user: User;
userId: User['id'];
note: Note;
} | {
type: 'pollEnded';
user: User;
userId: User['id'];
note: Note;
@@ -258,6 +270,8 @@ export type Notification = {
header?: string | null;
body: string;
icon?: string | null;
} | {
type: 'test';
});
export type MessagingMessage = {
@@ -292,6 +306,7 @@ export type LiteInstanceMetadata = {
maintainerEmail: string | null;
version: string;
name: string | null;
shortName: string | null;
uri: string;
description: string | null;
langs: string[];
@@ -355,6 +370,9 @@ export type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata;
export type AdminInstanceMetadata = DetailedInstanceMetadata & {
// TODO: There are more fields.
blockedHosts: string[];
app192IconUrl: string | null;
app512IconUrl: string | null;
manifestJsonOverride: string;
};
export type ServerInfo = {
@@ -558,3 +576,88 @@ export type UserSorting =
| '+updatedAt'
| '-updatedAt';
export type OriginType = 'combined' | 'local' | 'remote';
export type ModerationLog = {
id: ID;
createdAt: DateString;
userId: User['id'];
user: UserDetailed | null;
} & ({
type: 'updateServerSettings';
info: ModerationLogPayloads['updateServerSettings'];
} | {
type: 'suspend';
info: ModerationLogPayloads['suspend'];
} | {
type: 'unsuspend';
info: ModerationLogPayloads['unsuspend'];
} | {
type: 'updateUserNote';
info: ModerationLogPayloads['updateUserNote'];
} | {
type: 'addCustomEmoji';
info: ModerationLogPayloads['addCustomEmoji'];
} | {
type: 'updateCustomEmoji';
info: ModerationLogPayloads['updateCustomEmoji'];
} | {
type: 'deleteCustomEmoji';
info: ModerationLogPayloads['deleteCustomEmoji'];
} | {
type: 'assignRole';
info: ModerationLogPayloads['assignRole'];
} | {
type: 'unassignRole';
info: ModerationLogPayloads['unassignRole'];
} | {
type: 'updateRole';
info: ModerationLogPayloads['updateRole'];
} | {
type: 'deleteRole';
info: ModerationLogPayloads['deleteRole'];
} | {
type: 'clearQueue';
info: ModerationLogPayloads['clearQueue'];
} | {
type: 'promoteQueue';
info: ModerationLogPayloads['promoteQueue'];
} | {
type: 'deleteDriveFile';
info: ModerationLogPayloads['deleteDriveFile'];
} | {
type: 'deleteNote';
info: ModerationLogPayloads['deleteNote'];
} | {
type: 'createGlobalAnnouncement';
info: ModerationLogPayloads['createGlobalAnnouncement'];
} | {
type: 'createUserAnnouncement';
info: ModerationLogPayloads['createUserAnnouncement'];
} | {
type: 'updateGlobalAnnouncement';
info: ModerationLogPayloads['updateGlobalAnnouncement'];
} | {
type: 'updateUserAnnouncement';
info: ModerationLogPayloads['updateUserAnnouncement'];
} | {
type: 'deleteGlobalAnnouncement';
info: ModerationLogPayloads['deleteGlobalAnnouncement'];
} | {
type: 'deleteUserAnnouncement';
info: ModerationLogPayloads['deleteUserAnnouncement'];
} | {
type: 'resetPassword';
info: ModerationLogPayloads['resetPassword'];
} | {
type: 'suspendRemoteInstance';
info: ModerationLogPayloads['suspendRemoteInstance'];
} | {
type: 'unsuspendRemoteInstance';
info: ModerationLogPayloads['unsuspendRemoteInstance'];
} | {
type: 'markSensitiveDriveFile';
info: ModerationLogPayloads['markSensitiveDriveFile'];
} | {
type: 'unmarkSensitiveDriveFile';
info: ModerationLogPayloads['unmarkSensitiveDriveFile'];
});

View File

@@ -17,10 +17,12 @@ export const notificationTypes = consts.notificationTypes;
export const noteVisibilities = consts.noteVisibilities;
export const mutedNoteReasons = consts.mutedNoteReasons;
export const ffVisibility = consts.ffVisibility;
export const moderationLogTypes = consts.moderationLogTypes;
// api extractor not supported yet
//export * as api from './api.js';
//export * as entities from './entities.js';
import * as api from './api.js';
import * as entities from './entities.js';
export { api, entities };
import * as acct from './acct.js';
export { api, entities, acct };

View File

@@ -2,8 +2,8 @@
"$schema": "http://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "ES2022",
"module": "ES2020",
"moduleResolution": "node16",
"module": "nodenext",
"moduleResolution": "nodenext",
"declaration": true,
"declarationMap": true,
"sourceMap": true,