merge: DeepLX-JS support (!396)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/396 Closes #324 Approved-by: Amelia Yukii <amelia.yukii@shourai.de> Approved-by: dakkar <dakkar@thenautilus.net>
This commit is contained in:
commit
d3d0e510d8
16 changed files with 315 additions and 29 deletions
18
packages/backend/migration/1706232992000-deeplx.js
Normal file
18
packages/backend/migration/1706232992000-deeplx.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and other misskey contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export class Deeplx1706232992000 {
|
||||
name = 'Deeplx1706232992000';
|
||||
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "deeplFreeMode" boolean NOT NULL DEFAULT false`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "deeplFreeInstance" character varying(1024)`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "deeplFreeMode"`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "deeplFreeInstance"`);
|
||||
}
|
||||
}
|
|
@ -353,6 +353,17 @@ export class MiMeta {
|
|||
})
|
||||
public deeplIsPro: boolean;
|
||||
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
})
|
||||
public deeplFreeMode: boolean;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 1024,
|
||||
nullable: true,
|
||||
})
|
||||
public deeplFreeInstance: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 1024,
|
||||
nullable: true,
|
||||
|
|
|
@ -395,6 +395,14 @@ export const meta = {
|
|||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
deeplFreeMode: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
deeplFreeInstance: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
defaultDarkTheme: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
|
@ -576,6 +584,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
objectStorageS3ForcePathStyle: instance.objectStorageS3ForcePathStyle,
|
||||
deeplAuthKey: instance.deeplAuthKey,
|
||||
deeplIsPro: instance.deeplIsPro,
|
||||
deeplFreeMode: instance.deeplFreeMode,
|
||||
deeplFreeInstance: instance.deeplFreeInstance,
|
||||
enableIpLogging: instance.enableIpLogging,
|
||||
enableActiveEmailValidation: instance.enableActiveEmailValidation,
|
||||
enableVerifymailApi: instance.enableVerifymailApi,
|
||||
|
|
|
@ -91,6 +91,8 @@ export const paramDef = {
|
|||
summalyProxy: { type: 'string', nullable: true },
|
||||
deeplAuthKey: { type: 'string', nullable: true },
|
||||
deeplIsPro: { type: 'boolean' },
|
||||
deeplFreeMode: { type: 'boolean' },
|
||||
deeplFreeInstance: { type: 'string', nullable: true },
|
||||
enableEmail: { type: 'boolean' },
|
||||
email: { type: 'string', nullable: true },
|
||||
smtpSecure: { type: 'boolean' },
|
||||
|
@ -479,6 +481,18 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
set.deeplIsPro = ps.deeplIsPro;
|
||||
}
|
||||
|
||||
if (ps.deeplFreeMode !== undefined) {
|
||||
set.deeplFreeMode = ps.deeplFreeMode;
|
||||
}
|
||||
|
||||
if (ps.deeplFreeInstance !== undefined) {
|
||||
if (ps.deeplFreeInstance === '') {
|
||||
set.deeplFreeInstance = null;
|
||||
} else {
|
||||
set.deeplFreeInstance = ps.deeplFreeInstance;
|
||||
}
|
||||
}
|
||||
|
||||
if (ps.enableIpLogging !== undefined) {
|
||||
set.enableIpLogging = ps.enableIpLogging;
|
||||
}
|
||||
|
|
|
@ -411,7 +411,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
enableEmail: instance.enableEmail,
|
||||
enableServiceWorker: instance.enableServiceWorker,
|
||||
|
||||
translatorAvailable: instance.deeplAuthKey != null,
|
||||
translatorAvailable: instance.deeplAuthKey != null || instance.deeplFreeMode && instance.deeplFreeInstance,
|
||||
|
||||
serverRules: instance.serverRules,
|
||||
|
||||
|
|
|
@ -81,19 +81,23 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
|
||||
const instance = await this.metaService.fetch();
|
||||
|
||||
if (instance.deeplAuthKey == null) {
|
||||
if (instance.deeplAuthKey == null && !instance.deeplFreeMode) {
|
||||
return 204; // TODO: 良い感じのエラー返す
|
||||
}
|
||||
|
||||
if (instance.deeplFreeMode && !instance.deeplFreeInstance) {
|
||||
return 204;
|
||||
}
|
||||
|
||||
let targetLang = ps.targetLang;
|
||||
if (targetLang.includes('-')) targetLang = targetLang.split('-')[0];
|
||||
|
||||
const params = new URLSearchParams();
|
||||
params.append('auth_key', instance.deeplAuthKey);
|
||||
if (instance.deeplAuthKey) params.append('auth_key', instance.deeplAuthKey);
|
||||
params.append('text', note.text);
|
||||
params.append('target_lang', targetLang);
|
||||
|
||||
const endpoint = instance.deeplIsPro ? 'https://api.deepl.com/v2/translate' : 'https://api-free.deepl.com/v2/translate';
|
||||
const endpoint = instance.deeplFreeMode && instance.deeplFreeInstance ? instance.deeplFreeInstance : instance.deeplIsPro ? 'https://api.deepl.com/v2/translate' : 'https://api-free.deepl.com/v2/translate';
|
||||
|
||||
const res = await this.httpRequestService.send(endpoint, {
|
||||
method: 'POST',
|
||||
|
@ -103,18 +107,37 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
},
|
||||
body: params.toString(),
|
||||
});
|
||||
if (instance.deeplAuthKey) {
|
||||
const json = (await res.json()) as {
|
||||
translations: {
|
||||
detected_source_language: string;
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
|
||||
const json = (await res.json()) as {
|
||||
translations: {
|
||||
detected_source_language: string;
|
||||
text: string;
|
||||
}[];
|
||||
};
|
||||
return {
|
||||
sourceLang: json.translations[0].detected_source_language,
|
||||
text: json.translations[0].text,
|
||||
};
|
||||
} else {
|
||||
const json = (await res.json()) as {
|
||||
code: number,
|
||||
message: string,
|
||||
data: string,
|
||||
source_lang: string,
|
||||
target_lang: string,
|
||||
alternatives: string[],
|
||||
};
|
||||
|
||||
return {
|
||||
sourceLang: json.translations[0].detected_source_language,
|
||||
text: json.translations[0].text,
|
||||
};
|
||||
const languageNames = new Intl.DisplayNames(['en'], {
|
||||
type: 'language',
|
||||
});
|
||||
|
||||
return {
|
||||
sourceLang: languageNames.of(json.source_lang),
|
||||
text: json.data,
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,14 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkSwitch v-model="deeplIsPro">
|
||||
<template #label>Pro account</template>
|
||||
</MkSwitch>
|
||||
<MkSwitch v-model="deeplFreeMode">
|
||||
<template #label>{{ i18n.ts.deeplFreeMode }}</template>
|
||||
</MkSwitch>
|
||||
<MkInput v-if="deeplFreeMode" v-model="deeplFreeInstance" :placeholder="'example.com/translate'">
|
||||
<template #prefix><i class="ph-globe-simple ph-bold ph-lg"></i></template>
|
||||
<template #label>DeepLX-JS URL</template>
|
||||
<template #caption>{{ i18n.ts.deeplFreeModeDescription }}</template>
|
||||
</MkInput>
|
||||
</div>
|
||||
</FormSection>
|
||||
</FormSuspense>
|
||||
|
@ -49,17 +57,23 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
|
|||
|
||||
const deeplAuthKey = ref<string>('');
|
||||
const deeplIsPro = ref<boolean>(false);
|
||||
const deeplFreeMode = ref<boolean>(false);
|
||||
const deeplFreeInstance = ref<string>('');
|
||||
|
||||
async function init() {
|
||||
const meta = await misskeyApi('admin/meta');
|
||||
deeplAuthKey.value = meta.deeplAuthKey;
|
||||
deeplIsPro.value = meta.deeplIsPro;
|
||||
deeplFreeMode.value = meta.deeplFreeMode;
|
||||
deeplFreeInstance.value = meta.deeplFreeInstance;
|
||||
}
|
||||
|
||||
function save() {
|
||||
os.apiWithDialog('admin/update-meta', {
|
||||
deeplAuthKey: deeplAuthKey.value,
|
||||
deeplIsPro: deeplIsPro.value,
|
||||
deeplFreeMode: deeplFreeMode.value,
|
||||
deeplFreeInstance: deeplFreeInstance.value,
|
||||
}).then(() => {
|
||||
fetchInstance();
|
||||
});
|
||||
|
|
|
@ -85,6 +85,9 @@ type AdminAnnouncementsListResponse = operations['admin/announcements/list']['re
|
|||
// @public (undocumented)
|
||||
type AdminAnnouncementsUpdateRequest = operations['admin/announcements/update']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminApproveUserRequest = operations['admin/approve-user']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminAvatarDecorationsCreateRequest = operations['admin/avatar-decorations/create']['requestBody']['content']['application/json'];
|
||||
|
||||
|
@ -208,6 +211,9 @@ type AdminInviteListResponse = operations['admin/invite/list']['responses']['200
|
|||
// @public (undocumented)
|
||||
type AdminMetaResponse = operations['admin/meta']['responses']['200']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminNsfwUserRequest = operations['admin/nsfw-user']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminPromoCreateRequest = operations['admin/promo/create']['requestBody']['content']['application/json'];
|
||||
|
||||
|
@ -304,15 +310,24 @@ type AdminShowUsersRequest = operations['admin/show-users']['requestBody']['cont
|
|||
// @public (undocumented)
|
||||
type AdminShowUsersResponse = operations['admin/show-users']['responses']['200']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminSilenceUserRequest = operations['admin/silence-user']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminSuspendUserRequest = operations['admin/suspend-user']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminUnnsfwUserRequest = operations['admin/unnsfw-user']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminUnsetUserAvatarRequest = operations['admin/unset-user-avatar']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminUnsetUserBannerRequest = operations['admin/unset-user-banner']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminUnsilenceUserRequest = operations['admin/unsilence-user']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type AdminUnsuspendUserRequest = operations['admin/unsuspend-user']['requestBody']['content']['application/json'];
|
||||
|
||||
|
@ -594,6 +609,13 @@ export type Channels = {
|
|||
};
|
||||
receives: null;
|
||||
};
|
||||
bubbleTimeline: {
|
||||
params: null;
|
||||
events: {
|
||||
note: (payload: Note) => void;
|
||||
};
|
||||
receives: null;
|
||||
};
|
||||
userList: {
|
||||
params: {
|
||||
listId: string;
|
||||
|
@ -1165,7 +1187,12 @@ declare namespace entities {
|
|||
AdminShowUserResponse,
|
||||
AdminShowUsersRequest,
|
||||
AdminShowUsersResponse,
|
||||
AdminNsfwUserRequest,
|
||||
AdminUnnsfwUserRequest,
|
||||
AdminSilenceUserRequest,
|
||||
AdminUnsilenceUserRequest,
|
||||
AdminSuspendUserRequest,
|
||||
AdminApproveUserRequest,
|
||||
AdminUnsuspendUserRequest,
|
||||
AdminUpdateMetaRequest,
|
||||
AdminDeleteAccountRequest,
|
||||
|
@ -1393,6 +1420,7 @@ declare namespace entities {
|
|||
IGalleryPostsResponse,
|
||||
IImportBlockingRequest,
|
||||
IImportFollowingRequest,
|
||||
IImportNotesRequest,
|
||||
IImportMutingRequest,
|
||||
IImportUserListsRequest,
|
||||
IImportAntennasRequest,
|
||||
|
@ -1410,6 +1438,7 @@ declare namespace entities {
|
|||
IRegenerateTokenRequest,
|
||||
IRegistryGetAllRequest,
|
||||
IRegistryGetAllResponse,
|
||||
IRegistryGetUnsecureRequest,
|
||||
IRegistryGetDetailRequest,
|
||||
IRegistryGetDetailResponse,
|
||||
IRegistryGetRequest,
|
||||
|
@ -1477,6 +1506,8 @@ declare namespace entities {
|
|||
NotesFeaturedResponse,
|
||||
NotesGlobalTimelineRequest,
|
||||
NotesGlobalTimelineResponse,
|
||||
NotesBubbleTimelineRequest,
|
||||
NotesBubbleTimelineResponse,
|
||||
NotesHybridTimelineRequest,
|
||||
NotesHybridTimelineResponse,
|
||||
NotesLocalTimelineRequest,
|
||||
|
@ -1490,6 +1521,7 @@ declare namespace entities {
|
|||
NotesReactionsResponse,
|
||||
NotesReactionsCreateRequest,
|
||||
NotesReactionsDeleteRequest,
|
||||
NotesLikeRequest,
|
||||
NotesRenotesRequest,
|
||||
NotesRenotesResponse,
|
||||
NotesRepliesRequest,
|
||||
|
@ -1511,6 +1543,10 @@ declare namespace entities {
|
|||
NotesUnrenoteRequest,
|
||||
NotesUserListTimelineRequest,
|
||||
NotesUserListTimelineResponse,
|
||||
NotesEditRequest,
|
||||
NotesEditResponse,
|
||||
NotesVersionsRequest,
|
||||
NotesVersionsResponse,
|
||||
NotificationsCreateRequest,
|
||||
PagePushRequest,
|
||||
PagesCreateRequest,
|
||||
|
@ -1619,6 +1655,7 @@ declare namespace entities {
|
|||
FetchExternalResourcesRequest,
|
||||
FetchExternalResourcesResponse,
|
||||
RetentionResponse,
|
||||
SponsorsRequest,
|
||||
BubbleGameRegisterRequest,
|
||||
BubbleGameRegisterResponse,
|
||||
BubbleGameRankingRequest,
|
||||
|
@ -2016,6 +2053,9 @@ type IImportFollowingRequest = operations['i/import-following']['requestBody']['
|
|||
// @public (undocumented)
|
||||
type IImportMutingRequest = operations['i/import-muting']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type IImportNotesRequest = operations['i/import-notes']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type IImportUserListsRequest = operations['i/import-user-lists']['requestBody']['content']['application/json'];
|
||||
|
||||
|
@ -2097,6 +2137,9 @@ type IRegistryGetRequest = operations['i/registry/get']['requestBody']['content'
|
|||
// @public (undocumented)
|
||||
type IRegistryGetResponse = operations['i/registry/get']['responses']['200']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type IRegistryGetUnsecureRequest = operations['i/registry/get-unsecure']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type IRegistryKeysRequest = operations['i/registry/keys']['requestBody']['content']['application/json'];
|
||||
|
||||
|
@ -2196,6 +2239,9 @@ type ModerationLog = {
|
|||
} & ({
|
||||
type: 'updateServerSettings';
|
||||
info: ModerationLogPayloads['updateServerSettings'];
|
||||
} | {
|
||||
type: 'approve';
|
||||
info: ModerationLogPayloads['approve'];
|
||||
} | {
|
||||
type: 'suspend';
|
||||
info: ModerationLogPayloads['suspend'];
|
||||
|
@ -2307,7 +2353,7 @@ type ModerationLog = {
|
|||
});
|
||||
|
||||
// @public (undocumented)
|
||||
export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "unsuspend", "updateUserNote", "addCustomEmoji", "updateCustomEmoji", "deleteCustomEmoji", "assignRole", "unassignRole", "createRole", "updateRole", "deleteRole", "clearQueue", "promoteQueue", "deleteDriveFile", "deleteNote", "createGlobalAnnouncement", "createUserAnnouncement", "updateGlobalAnnouncement", "updateUserAnnouncement", "deleteGlobalAnnouncement", "deleteUserAnnouncement", "resetPassword", "suspendRemoteInstance", "unsuspendRemoteInstance", "markSensitiveDriveFile", "unmarkSensitiveDriveFile", "resolveAbuseReport", "createInvitation", "createAd", "updateAd", "deleteAd", "createAvatarDecoration", "updateAvatarDecoration", "deleteAvatarDecoration", "unsetUserAvatar", "unsetUserBanner"];
|
||||
export const moderationLogTypes: readonly ["updateServerSettings", "suspend", "approve", "unsuspend", "updateUserNote", "addCustomEmoji", "updateCustomEmoji", "deleteCustomEmoji", "assignRole", "unassignRole", "createRole", "updateRole", "deleteRole", "clearQueue", "promoteQueue", "deleteDriveFile", "deleteNote", "createGlobalAnnouncement", "createUserAnnouncement", "updateGlobalAnnouncement", "updateUserAnnouncement", "deleteGlobalAnnouncement", "deleteUserAnnouncement", "resetPassword", "suspendRemoteInstance", "unsuspendRemoteInstance", "markSensitiveDriveFile", "unmarkSensitiveDriveFile", "resolveAbuseReport", "createInvitation", "createAd", "updateAd", "deleteAd", "createAvatarDecoration", "updateAvatarDecoration", "deleteAvatarDecoration", "unsetUserAvatar", "unsetUserBanner"];
|
||||
|
||||
// @public (undocumented)
|
||||
type MuteCreateRequest = operations['mute/create']['requestBody']['content']['application/json'];
|
||||
|
@ -2342,6 +2388,12 @@ type NoteFavorite = components['schemas']['NoteFavorite'];
|
|||
// @public (undocumented)
|
||||
type NoteReaction = components['schemas']['NoteReaction'];
|
||||
|
||||
// @public (undocumented)
|
||||
type NotesBubbleTimelineRequest = operations['notes/bubble-timeline']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type NotesBubbleTimelineResponse = operations['notes/bubble-timeline']['responses']['200']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type NotesChildrenRequest = operations['notes/children']['requestBody']['content']['application/json'];
|
||||
|
||||
|
@ -2369,6 +2421,12 @@ type NotesCreateResponse = operations['notes/create']['responses']['200']['conte
|
|||
// @public (undocumented)
|
||||
type NotesDeleteRequest = operations['notes/delete']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type NotesEditRequest = operations['notes/edit']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type NotesEditResponse = operations['notes/edit']['responses']['200']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type NotesFavoritesCreateRequest = operations['notes/favorites/create']['requestBody']['content']['application/json'];
|
||||
|
||||
|
@ -2393,6 +2451,9 @@ type NotesHybridTimelineRequest = operations['notes/hybrid-timeline']['requestBo
|
|||
// @public (undocumented)
|
||||
type NotesHybridTimelineResponse = operations['notes/hybrid-timeline']['responses']['200']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type NotesLikeRequest = operations['notes/like']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type NotesLocalTimelineRequest = operations['notes/local-timeline']['requestBody']['content']['application/json'];
|
||||
|
||||
|
@ -2495,6 +2556,12 @@ type NotesUserListTimelineRequest = operations['notes/user-list-timeline']['requ
|
|||
// @public (undocumented)
|
||||
type NotesUserListTimelineResponse = operations['notes/user-list-timeline']['responses']['200']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type NotesVersionsRequest = operations['notes/versions']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type NotesVersionsResponse = operations['notes/versions']['responses']['200']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
export const noteVisibilities: readonly ["public", "home", "followers", "specified"];
|
||||
|
||||
|
@ -2553,7 +2620,7 @@ type PagesUpdateRequest = operations['pages/update']['requestBody']['content']['
|
|||
function parse(acct: string): Acct;
|
||||
|
||||
// @public (undocumented)
|
||||
export const permissions: readonly ["read:account", "write:account", "read:blocks", "write:blocks", "read:drive", "write:drive", "read:favorites", "write:favorites", "read:following", "write:following", "read:messaging", "write:messaging", "read:mutes", "write:mutes", "write:notes", "read:notifications", "write:notifications", "read:reactions", "write:reactions", "write:votes", "read:pages", "write:pages", "write:page-likes", "read:page-likes", "read:user-groups", "write:user-groups", "read:channels", "write:channels", "read:gallery", "write:gallery", "read:gallery-likes", "write:gallery-likes", "read:flash", "write:flash", "read:flash-likes", "write:flash-likes", "read:admin:abuse-user-reports", "write:admin:delete-account", "write:admin:delete-all-files-of-a-user", "read:admin:index-stats", "read:admin:table-stats", "read:admin:user-ips", "read:admin:meta", "write:admin:reset-password", "write:admin:resolve-abuse-user-report", "write:admin:send-email", "read:admin:server-info", "read:admin:show-moderation-log", "read:admin:show-user", "read:admin:show-users", "write:admin:suspend-user", "write:admin:unset-user-avatar", "write:admin:unset-user-banner", "write:admin:unsuspend-user", "write:admin:meta", "write:admin:user-note", "write:admin:roles", "read:admin:roles", "write:admin:relays", "read:admin:relays", "write:admin:invite-codes", "read:admin:invite-codes", "write:admin:announcements", "read:admin:announcements", "write:admin:avatar-decorations", "read:admin:avatar-decorations", "write:admin:federation", "write:admin:account", "read:admin:account", "write:admin:emoji", "read:admin:emoji", "write:admin:queue", "read:admin:queue", "write:admin:promo", "write:admin:drive", "read:admin:drive", "write:admin:ad", "read:admin:ad", "write:invite-codes", "read:invite-codes", "write:clip-favorite", "read:clip-favorite", "read:federation", "write:report-abuse"];
|
||||
export const permissions: readonly ["read:account", "write:account", "read:blocks", "write:blocks", "read:drive", "write:drive", "read:favorites", "write:favorites", "read:following", "write:following", "read:messaging", "write:messaging", "read:mutes", "write:mutes", "write:notes", "read:notifications", "write:notifications", "read:reactions", "write:reactions", "write:votes", "read:pages", "write:pages", "write:page-likes", "read:page-likes", "read:user-groups", "write:user-groups", "read:channels", "write:channels", "read:gallery", "write:gallery", "read:gallery-likes", "write:gallery-likes", "read:flash", "write:flash", "read:flash-likes", "write:flash-likes", "read:admin:abuse-user-reports", "write:admin:delete-account", "write:admin:delete-all-files-of-a-user", "read:admin:index-stats", "read:admin:table-stats", "read:admin:user-ips", "read:admin:meta", "write:admin:reset-password", "write:admin:resolve-abuse-user-report", "write:admin:send-email", "read:admin:server-info", "read:admin:show-moderation-log", "read:admin:show-user", "read:admin:show-users", "write:admin:suspend-user", "write:admin:approve-user", "write:admin:nsfw-user", "write:admin:unnsfw-user", "write:admin:silence-user", "write:admin:unsilence-user", "write:admin:unset-user-avatar", "write:admin:unset-user-banner", "write:admin:unsuspend-user", "write:admin:meta", "write:admin:user-note", "write:admin:roles", "read:admin:roles", "write:admin:relays", "read:admin:relays", "write:admin:invite-codes", "read:admin:invite-codes", "write:admin:announcements", "read:admin:announcements", "write:admin:avatar-decorations", "read:admin:avatar-decorations", "write:admin:federation", "write:admin:account", "read:admin:account", "write:admin:emoji", "read:admin:emoji", "write:admin:queue", "read:admin:queue", "write:admin:promo", "write:admin:drive", "read:admin:drive", "write:admin:ad", "read:admin:ad", "write:invite-codes", "read:invite-codes", "write:clip-favorite", "read:clip-favorite", "read:federation", "write:report-abuse"];
|
||||
|
||||
// @public (undocumented)
|
||||
type PingResponse = operations['ping']['responses']['200']['content']['application/json'];
|
||||
|
@ -2746,6 +2813,9 @@ type SignupResponse = MeDetailed & {
|
|||
token: string;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
type SponsorsRequest = operations['sponsors']['requestBody']['content']['application/json'];
|
||||
|
||||
// @public (undocumented)
|
||||
type StatsResponse = operations['stats']['responses']['200']['content']['application/json'];
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* version: 2024.2.0-beta.6
|
||||
* generatedAt: 2024-01-24T07:32:10.455Z
|
||||
* version: 2024.2.0-beta2
|
||||
* generatedAt: 2024-01-26T20:30:18.423Z
|
||||
*/
|
||||
|
||||
import type { SwitchCaseResponseType } from '../api.js';
|
||||
|
@ -691,6 +691,50 @@ declare module '../api.js' {
|
|||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:nsfw-user*
|
||||
*/
|
||||
request<E extends 'admin/nsfw-user', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:unnsfw-user*
|
||||
*/
|
||||
request<E extends 'admin/unnsfw-user', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:silence-user*
|
||||
*/
|
||||
request<E extends 'admin/silence-user', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:unsilence-user*
|
||||
*/
|
||||
request<E extends 'admin/unsilence-user', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
|
@ -702,6 +746,17 @@ declare module '../api.js' {
|
|||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:approve-user*
|
||||
*/
|
||||
request<E extends 'admin/approve-user', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
|
@ -2514,6 +2569,17 @@ declare module '../api.js' {
|
|||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *read:account*
|
||||
*/
|
||||
request<E extends 'i/registry/get-unsecure', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
|
@ -2993,6 +3059,17 @@ declare module '../api.js' {
|
|||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *No*
|
||||
*/
|
||||
request<E extends 'notes/bubble-timeline', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
|
@ -4053,8 +4130,9 @@ declare module '../api.js' {
|
|||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/** No description provided.
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:account*
|
||||
*/
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* version: 2024.2.0-beta.6
|
||||
* generatedAt: 2024-01-24T07:32:10.453Z
|
||||
* version: 2024.2.0-beta2
|
||||
* generatedAt: 2024-01-26T20:30:18.421Z
|
||||
*/
|
||||
|
||||
import type {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* version: 2024.2.0-beta.6
|
||||
* generatedAt: 2024-01-24T07:32:10.452Z
|
||||
* version: 2024.2.0-beta2
|
||||
* generatedAt: 2024-01-26T20:30:18.419Z
|
||||
*/
|
||||
|
||||
import { operations } from './types.js';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* version: 2024.2.0-beta.6
|
||||
* generatedAt: 2024-01-24T07:32:10.450Z
|
||||
* version: 2024.2.0-beta2
|
||||
* generatedAt: 2024-01-26T20:30:18.418Z
|
||||
*/
|
||||
|
||||
import { components } from './types.js';
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
/* eslint @typescript-eslint/no-explicit-any: 0 */
|
||||
|
||||
/*
|
||||
* version: 2024.2.0-beta.6
|
||||
* generatedAt: 2024-01-24T07:32:10.370Z
|
||||
* version: 2024.2.0-beta2
|
||||
* generatedAt: 2024-01-26T20:30:18.319Z
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -4784,6 +4784,8 @@ export type operations = {
|
|||
backgroundImageUrl: string | null;
|
||||
deeplAuthKey: string | null;
|
||||
deeplIsPro: boolean;
|
||||
deeplFreeMode: boolean;
|
||||
deeplFreeInstance: string | null;
|
||||
defaultDarkTheme: string | null;
|
||||
defaultLightTheme: string | null;
|
||||
description: string | null;
|
||||
|
@ -8795,6 +8797,8 @@ export type operations = {
|
|||
summalyProxy?: string | null;
|
||||
deeplAuthKey?: string | null;
|
||||
deeplIsPro?: boolean;
|
||||
deeplFreeMode?: boolean;
|
||||
deeplFreeInstance?: string | null;
|
||||
enableEmail?: boolean;
|
||||
email?: string | null;
|
||||
smtpSecure?: boolean;
|
||||
|
@ -14101,6 +14105,7 @@ export type operations = {
|
|||
subscribing?: boolean | null;
|
||||
publishing?: boolean | null;
|
||||
nsfw?: boolean | null;
|
||||
bubble?: boolean | null;
|
||||
/** @default 30 */
|
||||
limit?: number;
|
||||
/** @default 0 */
|
||||
|
@ -26440,9 +26445,40 @@ export type operations = {
|
|||
204: {
|
||||
content: never;
|
||||
};
|
||||
/** @description Client error */
|
||||
400: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
/** @description Authentication error */
|
||||
401: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
/** @description Forbidden error */
|
||||
403: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
/** @description I'm Ai */
|
||||
418: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
/** @description Internal server error */
|
||||
500: {
|
||||
content: {
|
||||
'application/json': components['schemas']['Error'];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
/** bubble-game/register
|
||||
/**
|
||||
* bubble-game/register
|
||||
* @description No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:account*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue