diff --git a/lib/src/app/shell/navigation/navigation_settings.dart b/lib/src/app/shell/navigation/navigation_settings.dart index 4dcfe0f5e..9519b0726 100644 --- a/lib/src/app/shell/navigation/navigation_settings.dart +++ b/lib/src/app/shell/navigation/navigation_settings.dart @@ -4,14 +4,6 @@ part of 'navigation_utils.dart'; /// /// Additionally, the [settingToHighlight] parameter can be used to highlight a specific setting when the page is opened. void navigateToSettingPage(BuildContext context, LocalSettings setting, {LocalSettings? settingToHighlight}) { - final routeScope = resolveAccountAwareRouteScope(context, useActiveAccount: true, includeThunderCubit: true); - final account = routeScope.account; - - final gestureCubit = context.read(); - final themeCubit = context.read(); - final reduceAnimations = themeCubit.state.reduceAnimations; - final enableFullScreenSwipeNavigationGesture = gestureCubit.state.enableFullScreenSwipeNavigationGesture; - String pageToNav = { LocalSettingsCategories.posts: SETTINGS_APPEARANCE_POSTS_PAGE, LocalSettingsCategories.comments: SETTINGS_APPEARANCE_COMMENTS_PAGE, @@ -33,6 +25,36 @@ void navigateToSettingPage(BuildContext context, LocalSettings setting, {LocalSe }[setting.category] ?? SETTINGS_GENERAL_PAGE; + final usesEffectiveAccount = { + SETTINGS_ACCOUNT_PAGE, + SETTINGS_ACCOUNT_LANGUAGES_PAGE, + SETTINGS_ACCOUNT_BLOCKLIST_PAGE, + SETTINGS_ACCOUNT_MEDIA_PAGE, + SETTINGS_USER_LABELS_PAGE, + }.contains(pageToNav); + + final routeScope = resolveAccountAwareRouteScope( + context, + useActiveAccount: !usesEffectiveAccount, + includeThunderCubit: true, + ); + + final account = routeScope.account; + + FeatureAccountCubit? inheritedFeatureAccountCubit; + if (usesEffectiveAccount) { + try { + inheritedFeatureAccountCubit = context.read(); + } catch (_) { + inheritedFeatureAccountCubit = null; + } + } + + final gestureCubit = context.read(); + final themeCubit = context.read(); + final reduceAnimations = themeCubit.state.reduceAnimations; + final enableFullScreenSwipeNavigationGesture = gestureCubit.state.enableFullScreenSwipeNavigationGesture; + if (pageToNav == SETTINGS_ABOUT_PAGE) { Navigator.of(context).push( SwipeablePageRoute( @@ -82,13 +104,19 @@ void navigateToSettingPage(BuildContext context, LocalSettings setting, {LocalSe ), ); } else { - final needsAccountSettingsCubit = pageToNav == SETTINGS_ACCOUNT_PAGE || pageToNav == SETTINGS_ACCOUNT_LANGUAGES_PAGE; - final hasAccountSettingsCubit = needsAccountSettingsCubit && context.findAncestorWidgetOfExactType>() != null; - final accountSettingsCubit = !needsAccountSettingsCubit - ? null - : hasAccountSettingsCubit - ? context.read() - : createAccountSettingsCubit(account, initialSiteResponse: routeScope.profileBloc?.state.siteResponse); + final needsAccountSettingsCubit = pageToNav == SETTINGS_ACCOUNT_LANGUAGES_PAGE; + AccountSettingsCubit? inheritedAccountSettingsCubit; + + if (needsAccountSettingsCubit) { + try { + inheritedAccountSettingsCubit = context.read(); + } catch (_) { + inheritedAccountSettingsCubit = null; + } + } + + final accountSettingsCubit = + !needsAccountSettingsCubit ? null : inheritedAccountSettingsCubit ?? createAccountSettingsCubit(account, initialSiteResponse: routeScope.profileBloc?.state.siteResponse); Navigator.of(context).push( SwipeablePageRoute( @@ -98,8 +126,9 @@ void navigateToSettingPage(BuildContext context, LocalSettings setting, {LocalSe builder: (context) => MultiBlocProvider( providers: routeScope.providers( provideThunderCubit: true, - provideFeatureAccountCubit: pageToNav != SETTINGS_ACCOUNT_LANGUAGES_PAGE, + provideFeatureAccountCubit: inheritedFeatureAccountCubit == null, extraProviders: [ + if (inheritedFeatureAccountCubit != null) BlocProvider.value(value: inheritedFeatureAccountCubit), if (accountSettingsCubit != null) BlocProvider.value(value: accountSettingsCubit), ], ), diff --git a/lib/src/features/account/account.dart b/lib/src/features/account/account.dart index 7b7911353..67b8afe69 100644 --- a/lib/src/features/account/account.dart +++ b/lib/src/features/account/account.dart @@ -4,5 +4,6 @@ export 'presentation/widgets/widgets.dart'; export 'presentation/utils/profile_utils.dart'; export 'package:thunder/src/foundation/contracts/account.dart'; export 'domain/models/account_media.dart'; +export 'domain/models/account_settings_update.dart'; export 'domain/repositories/account_repository.dart'; export 'data/repositories/account_repository_impl.dart'; diff --git a/lib/src/features/account/data/repositories/account_repository_impl.dart b/lib/src/features/account/data/repositories/account_repository_impl.dart index 1eadbd219..6ec959cc4 100644 --- a/lib/src/features/account/data/repositories/account_repository_impl.dart +++ b/lib/src/features/account/data/repositories/account_repository_impl.dart @@ -58,37 +58,11 @@ class AccountRepositoryImpl implements AccountRepository { } @override - Future saveSettings({ - String? bio, - String? email, - String? matrixUserId, - String? displayName, - FeedListType? defaultFeedListType, - PostSortType? defaultPostSortType, - bool? showNsfw, - bool? showReadPosts, - bool? showScores, - bool? botAccount, - bool? showBotAccounts, - List? discussionLanguages, - }) async { + Future saveSettings(AccountSettingsUpdate update) async { final l10n = _localizationService.l10n; if (account.anonymous) throw Exception(l10n.userNotLoggedIn); - await _api.saveUserSettings( - bio: bio, - email: email, - matrixUserId: matrixUserId, - displayName: displayName, - defaultFeedListType: defaultFeedListType, - defaultPostSortType: defaultPostSortType, - showNsfw: showNsfw, - showReadPosts: showReadPosts, - showScores: showScores, - botAccount: botAccount, - showBotAccounts: showBotAccounts, - discussionLanguages: discussionLanguages, - ); + await _api.saveUserSettings(update); } @override diff --git a/lib/src/features/account/domain/models/account_settings_update.dart b/lib/src/features/account/domain/models/account_settings_update.dart new file mode 100644 index 000000000..f5966a728 --- /dev/null +++ b/lib/src/features/account/domain/models/account_settings_update.dart @@ -0,0 +1,42 @@ +import 'package:thunder/src/foundation/primitives/primitives.dart'; + +class AccountSettingsUpdate { + const AccountSettingsUpdate({ + this.displayName, + this.bio, + this.defaultFeedListType, + this.defaultPostSortType, + this.showNsfw, + this.showNsfl, + this.showReadPosts, + this.showBotAccounts, + this.discussionLanguages, + }); + + /// The user's display name. + final String? displayName; + + /// The user's bio. + final String? bio; + + /// The user's default feed list type. + final FeedListType? defaultFeedListType; + + /// The user's default post sort type. + final PostSortType? defaultPostSortType; + + /// Whether to show NSFW content. + final bool? showNsfw; + + /// Whether to show NSFL content. + final bool? showNsfl; + + /// Whether to show read posts. + final bool? showReadPosts; + + /// Whether to show bot accounts. + final bool? showBotAccounts; + + /// The user's discussion languages. + final List? discussionLanguages; +} diff --git a/lib/src/features/account/domain/repositories/account_repository.dart b/lib/src/features/account/domain/repositories/account_repository.dart index 7e121030e..6577a503b 100644 --- a/lib/src/features/account/domain/repositories/account_repository.dart +++ b/lib/src/features/account/domain/repositories/account_repository.dart @@ -1,4 +1,5 @@ import 'package:thunder/src/foundation/primitives/primitives.dart'; +import 'package:thunder/src/features/account/domain/models/account_settings_update.dart'; import 'package:thunder/src/features/account/domain/models/account_media.dart'; //// Interface for an account repository @@ -13,20 +14,7 @@ abstract class AccountRepository { Future media({int? page, int? limit}); /// Saves the user's settings. - Future saveSettings({ - String? bio, - String? email, - String? matrixUserId, - String? displayName, - FeedListType? defaultFeedListType, - PostSortType? defaultPostSortType, - bool? showNsfw, - bool? showReadPosts, - bool? showScores, - bool? botAccount, - bool? showBotAccounts, - List? discussionLanguages, - }); + Future saveSettings(AccountSettingsUpdate update); /// Imports the settings to the user's profile. Future importSettings(String settings); diff --git a/lib/src/features/settings/presentation/widgets/discussion_language_selector.dart b/lib/src/features/settings/presentation/widgets/discussion_language_selector.dart index 385239c27..e983d45dc 100644 --- a/lib/src/features/settings/presentation/widgets/discussion_language_selector.dart +++ b/lib/src/features/settings/presentation/widgets/discussion_language_selector.dart @@ -5,11 +5,11 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:thunder/src/foundation/primitives/primitives.dart'; import 'package:thunder/l10n/generated/app_localizations.dart'; -import 'package:thunder/src/features/account/account.dart'; +import 'package:thunder/src/features/session/api.dart'; import 'package:thunder/src/shared/input_dialogs.dart'; import 'package:thunder/src/features/user/user.dart'; import 'package:thunder/src/foundation/config/config.dart'; -import 'package:thunder/packages/ui/ui.dart' show showSnackbar, showThunderDialog; +import 'package:thunder/packages/ui/ui.dart' show showThunderDialog; class DiscussionLanguageSelector extends StatefulWidget { const DiscussionLanguageSelector({super.key}); @@ -24,90 +24,91 @@ class _DiscussionLanguageSelector extends State { final theme = Theme.of(context); final l10n = AppLocalizations.of(context)!; - return BlocConsumer( - listener: (context, state) { - if (state.status == AccountSettingsStatus.failure) { - showSnackbar(state.errorMessage ?? l10n.unexpectedError); - } else if (state.status == AccountSettingsStatus.success) { - context.read().add(FetchProfileSettings()); - } - }, - builder: (context, state) { - final languages = state.siteResponse?.allLanguages ?? const []; - final selectedLanguages = state.siteResponse?.myUser?.discussionLanguages ?? []; - final discussionLanguages = selectedLanguages.map((id) => languages.firstWhere((language) => language.id == id)).toList(); + return AccountSettingsListener( + child: BlocBuilder( + builder: (context, state) { + final updating = state.status == AccountSettingsStatus.updating; - return Scaffold( - floatingActionButton: FloatingActionButton( - onPressed: () => showLanguageInputDialog( - context, - title: l10n.addDiscussionLanguage, - account: context.read().state.account, - excludedLanguageIds: [-1], - suggestions: languages, - onLanguageSelected: (language) { - List updatedDiscussionLanguages = List.from(discussionLanguages)..add(language); - context.read().updateSettings(discussionLanguages: updatedDiscussionLanguages.map((e) => e.id).toList()); - }, + final languages = state.siteResponse?.allLanguages ?? const []; + final selectedLanguages = state.siteResponse?.myUser?.discussionLanguages ?? []; + final discussionLanguages = selectedLanguages.map((id) => languages.firstWhere((language) => language.id == id)).toList(); + + return Scaffold( + floatingActionButton: FloatingActionButton( + onPressed: updating + ? null + : () => showLanguageInputDialog( + context, + title: l10n.addDiscussionLanguage, + account: resolveEffectiveAccount(context), + excludedLanguageIds: [-1], + suggestions: languages, + onLanguageSelected: (language) { + List updatedDiscussionLanguages = List.from(discussionLanguages)..add(language); + context.read().updateSettings(discussionLanguages: updatedDiscussionLanguages.map((e) => e.id).toList()); + }, + ), + child: const Icon(Icons.add_rounded), ), - child: const Icon(Icons.add_rounded), - ), - body: CustomScrollView( - slivers: [ - SliverAppBar( - pinned: true, - floating: true, - centerTitle: false, - toolbarHeight: APP_BAR_HEIGHT, - scrolledUnderElevation: 0.0, - title: Text(l10n.discussionLanguages), - ), - if (discussionLanguages.isEmpty) - SliverToBoxAdapter( - child: Padding( - padding: const EdgeInsets.only(left: 28.0, right: 20.0, bottom: 20.0), - child: Text( - l10n.noDiscussionLanguages, - style: TextStyle(color: theme.hintColor), + body: CustomScrollView( + slivers: [ + SliverAppBar( + pinned: true, + floating: true, + centerTitle: false, + toolbarHeight: APP_BAR_HEIGHT, + scrolledUnderElevation: 0.0, + title: Text(l10n.discussionLanguages), + ), + if (discussionLanguages.isEmpty) + SliverToBoxAdapter( + child: Padding( + padding: const EdgeInsets.only(left: 28.0, right: 20.0, bottom: 20.0), + child: Text( + l10n.noDiscussionLanguages, + style: TextStyle(color: theme.hintColor), + ), ), ), - ), - SliverList.builder( - itemCount: discussionLanguages.length, - itemBuilder: (context, index) => ListTile( - contentPadding: const EdgeInsetsDirectional.only(start: 20.0, end: 12.0), - title: Text(discussionLanguages[index].name, overflow: TextOverflow.ellipsis), - trailing: IconButton( - icon: Icon(Icons.clear, semanticLabel: l10n.remove), - onPressed: () { - // Warn user against removing 'Undetermined' language when other discussion languages are selected. - // This filters out most content. If no discussion languages are selected, all content is displayed. - if (discussionLanguages[index].id == 0 && discussionLanguages.length > 1) { - showThunderDialog( - context: context, - title: l10n.warning, - contentText: l10n.deselectUndeterminedWarning, - primaryButtonText: l10n.remove, - onPrimaryButtonPressed: (dialogContext, setPrimaryButtonEnabled) { - final updatedDiscussionLanguages = discussionLanguages.where((element) => element != discussionLanguages[index]).toList(); - context.read().updateSettings(discussionLanguages: updatedDiscussionLanguages.map((e) => e.id).toList()); - Navigator.of(dialogContext).pop(); - }, - secondaryButtonText: l10n.cancel, - onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), - ); - } else { - final updatedDiscussionLanguages = discussionLanguages.where((element) => element != discussionLanguages[index]).toList(); - context.read().updateSettings(discussionLanguages: updatedDiscussionLanguages.map((e) => e.id).toList()); - } - }, + SliverList.builder( + itemCount: discussionLanguages.length, + itemBuilder: (context, index) => ListTile( + contentPadding: const EdgeInsetsDirectional.only(start: 20.0, end: 12.0), + title: Text(discussionLanguages[index].name, overflow: TextOverflow.ellipsis), + trailing: IconButton( + icon: Icon(Icons.clear, semanticLabel: l10n.remove), + onPressed: updating + ? null + : () { + // Warn user against removing 'Undetermined' language when other discussion languages are selected. + // This filters out most content. If no discussion languages are selected, all content is displayed. + if (discussionLanguages[index].id == 0 && discussionLanguages.length > 1) { + showThunderDialog( + context: context, + title: l10n.warning, + contentText: l10n.deselectUndeterminedWarning, + primaryButtonText: l10n.remove, + onPrimaryButtonPressed: (dialogContext, setPrimaryButtonEnabled) { + final updatedDiscussionLanguages = discussionLanguages.where((element) => element != discussionLanguages[index]).toList(); + context.read().updateSettings(discussionLanguages: updatedDiscussionLanguages.map((e) => e.id).toList()); + Navigator.of(dialogContext).pop(); + }, + secondaryButtonText: l10n.cancel, + onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), + ); + } else { + final updatedDiscussionLanguages = discussionLanguages.where((element) => element != discussionLanguages[index]).toList(); + context.read().updateSettings(discussionLanguages: updatedDiscussionLanguages.map((e) => e.id).toList()); + } + }, + ), ), ), - ), - ], - ), - ); - }, + ], + ), + ); + }, + ), ); } } diff --git a/lib/src/features/user/presentation/pages/lemmy_user_settings_page.dart b/lib/src/features/user/presentation/pages/lemmy_user_settings_page.dart new file mode 100644 index 000000000..f67fdaa5e --- /dev/null +++ b/lib/src/features/user/presentation/pages/lemmy_user_settings_page.dart @@ -0,0 +1,535 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +import 'package:collection/collection.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_file_dialog/flutter_file_dialog.dart'; +import 'package:html/parser.dart'; +import 'package:markdown/markdown.dart' hide Text; +import 'package:path_provider/path_provider.dart'; + +import 'package:thunder/l10n/generated/app_localizations.dart'; +import 'package:thunder/packages/ui/ui.dart'; +import 'package:thunder/src/app/shell/navigation/link_navigation_utils.dart'; +import 'package:thunder/src/app/shell/navigation/navigation_utils.dart'; +import 'package:thunder/src/features/account/account.dart'; +import 'package:thunder/src/features/session/api.dart'; +import 'package:thunder/src/features/settings/presentation/utils/setting_link_utils.dart'; +import 'package:thunder/src/features/user/presentation/state/account_settings_cubit.dart'; +import 'package:thunder/src/features/user/presentation/widgets/user_settings_page_scaffold.dart'; +import 'package:thunder/src/foundation/config/global_context.dart'; +import 'package:thunder/src/foundation/networking/error_message_utils.dart'; +import 'package:thunder/src/foundation/primitives/enums/enums.dart'; +import 'package:thunder/src/foundation/primitives/models/thunder_user.dart'; +import 'package:thunder/src/shared/sort_picker.dart'; + +/// Lemmy account settings page. +class LemmyUserSettingsPage extends StatefulWidget { + /// The setting to be highlighted when searching. + final LocalSettings? settingToHighlight; + + const LemmyUserSettingsPage({super.key, this.settingToHighlight}); + + @override + State createState() => _LemmyUserSettingsPageState(); +} + +class _LemmyUserSettingsPageState extends State { + final TextEditingController displayNameTextController = TextEditingController(); + final TextEditingController bioTextController = TextEditingController(); + + final GlobalKey settingToHighlightKey = GlobalKey(); + LocalSettings? settingToHighlight; + + @override + void initState() { + super.initState(); + + if (widget.settingToHighlight != null) { + setState(() => settingToHighlight = widget.settingToHighlight); + + Timer(const Duration(milliseconds: 500), () { + if (settingToHighlightKey.currentContext != null) { + Scrollable.ensureVisible( + settingToHighlightKey.currentContext!, + duration: const Duration(milliseconds: 250), + curve: Curves.easeInOut, + ); + } + + Timer(const Duration(seconds: 1), () { + if (mounted) setState(() => settingToHighlight = null); + }); + }); + } + } + + @override + void dispose() { + displayNameTextController.dispose(); + bioTextController.dispose(); + super.dispose(); + } + + List> _feedTypeOptions() { + return const [ + ListPickerItem( + icon: Icons.view_list_rounded, + label: 'Subscribed', + payload: FeedListType.subscribed, + ), + ListPickerItem( + icon: Icons.home_rounded, + label: 'All', + payload: FeedListType.all, + ), + ListPickerItem( + icon: Icons.grid_view_rounded, + label: 'Local', + payload: FeedListType.local, + ), + ]; + } + + ListPickerItem _currentFeedTypeOption( + FeedListType? currentType, + ) { + return _feedTypeOptions().firstWhereOrNull( + (item) => item.payload == currentType, + ) ?? + const ListPickerItem( + icon: Icons.view_list_rounded, + label: 'Subscribed', + payload: FeedListType.subscribed, + ); + } + + ListPickerItem _currentSortOption( + Account account, + PostSortType? currentSortType, + ) { + final options = [ + ...getDefaultPostSortTypeItems(account: account), + ...getTopPostSortTypeItems(account: account), + ]; + + if (currentSortType == null) return options.first; + + return options.firstWhereOrNull((item) => item.payload == currentSortType) ?? + allPostSortTypeItems.firstWhere( + (item) => item.payload == currentSortType, + orElse: () => ListPickerItem( + payload: currentSortType, + icon: Icons.sort_rounded, + label: currentSortType.value, + capitalizeLabel: false, + ), + ); + } + + @override + Widget build(BuildContext context) { + final l10n = GlobalContext.l10n; + final account = resolveEffectiveAccount(context); + + return UserSettingsPageScaffold( + childrenBuilder: (context, state) { + final theme = Theme.of(context); + final isUpdating = state.status == AccountSettingsStatus.updating; + final myUser = state.siteResponse?.myUser; + final localUser = myUser?.localUserView.localUser; + final person = myUser?.localUserView.person; + final currentFeedTypeOption = _currentFeedTypeOption(localUser?.defaultListingType); + final currentSortOption = _currentSortOption(account, localUser?.defaultSortType); + + return [ + UserSettingsSectionHeader(title: l10n.general), + ThunderSettingsTile( + leading: const Icon(Icons.person_rounded), + title: l10n.displayName, + subtitle: person?.displayName?.isNotEmpty == true ? person?.displayName : l10n.noDisplayNameSet, + trailing: const Padding(padding: EdgeInsets.all(20.0)), + onTap: isUpdating ? null : () => _editDisplayName(context, person), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting(context, LocalSettings.accountDisplayName), + highlighted: settingToHighlight == LocalSettings.accountDisplayName, + ), + ThunderSettingsTile( + leading: const Icon(Icons.note_rounded), + title: l10n.profileBio, + subtitle: person?.bio?.isNotEmpty == true ? parse(markdownToHtml(person?.bio ?? '')).documentElement?.text.trim() : l10n.noProfileBioSet, + subtitleMaxLines: 1, + trailing: const Padding(padding: EdgeInsets.all(20.0)), + onTap: isUpdating ? null : () => _editBio(context, person), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting(context, LocalSettings.accountProfileBio), + highlighted: settingToHighlight == LocalSettings.accountProfileBio, + ), + UserSettingsSectionHeader( + title: l10n.feedSettings, + description: l10n.settingOverrideLabel, + ), + ThunderListOption( + title: l10n.defaultFeedSortType, + value: currentSortOption, + options: getDefaultPostSortTypeItems(account: account), + leading: const Icon(Icons.sort_rounded), + onChanged: (_) async {}, + disabled: isUpdating, + isBottomModalScrollControlled: true, + customListPicker: SortPicker( + account: account, + title: l10n.defaultFeedSortType, + onSelect: (value) async { + context.read().updateSettings( + defaultPostSortType: value.payload, + ); + }, + previouslySelected: localUser?.defaultSortType, + ), + valueDisplay: Row( + children: [ + Icon(currentSortOption.icon, size: 13), + const SizedBox(width: 4), + Text( + currentSortOption.label, + style: theme.textTheme.titleSmall, + ), + ], + ), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountDefaultFeedSortType, + ), + highlighted: settingToHighlight == LocalSettings.accountDefaultFeedSortType, + ), + ThunderToggleOption( + title: l10n.showNsfwContent, + value: localUser?.showNsfw, + iconEnabled: Icons.no_adult_content, + iconDisabled: Icons.no_adult_content, + onChanged: (value) => context.read().updateSettings(showNsfw: value), + disabled: isUpdating, + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountShowNsfwContent, + ), + highlighted: settingToHighlight == LocalSettings.accountShowNsfwContent, + ), + ThunderToggleOption( + title: l10n.showReadPosts, + value: localUser?.showReadPosts, + iconEnabled: Icons.fact_check_rounded, + iconDisabled: Icons.fact_check_outlined, + onChanged: (value) => context.read().updateSettings(showReadPosts: value), + disabled: isUpdating, + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountShowReadPosts, + ), + highlighted: settingToHighlight == LocalSettings.accountShowReadPosts, + ), + ThunderToggleOption( + title: l10n.showBotAccounts, + value: localUser?.showBotAccounts, + iconEnabled: Thunder.robot, + iconDisabled: Thunder.robot, + iconSpacing: 14.0, + onChanged: (value) => context.read().updateSettings(showBotAccounts: value), + disabled: isUpdating, + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountShowBotAccounts, + ), + highlighted: settingToHighlight == LocalSettings.accountShowBotAccounts, + ), + ThunderListOption( + title: l10n.defaultFeedType, + value: currentFeedTypeOption, + options: _feedTypeOptions(), + leading: const Icon(Icons.filter_alt_rounded), + disabled: isUpdating, + onChanged: (value) async => context.read().updateSettings(defaultFeedListType: value.payload), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountDefaultFeedType, + ), + highlighted: settingToHighlight == LocalSettings.accountDefaultFeedType, + ), + UserSettingsSectionHeader(title: l10n.contentManagement), + ThunderSettingsTile( + leading: const Icon(Icons.language_rounded), + title: l10n.discussionLanguages, + trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), + onTap: isUpdating + ? null + : () => navigateToSettingPage( + context, + LocalSettings.settingsPageAccountLanguages, + ), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting(context, LocalSettings.discussionLanguages), + highlighted: settingToHighlight == LocalSettings.discussionLanguages, + ), + ThunderSettingsTile( + leading: const Icon(Icons.block_rounded), + title: l10n.blockSettingLabel, + trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), + onTap: () => navigateToSettingPage( + context, + LocalSettings.settingsPageAccountBlocks, + ), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting(context, LocalSettings.accountBlocks), + highlighted: settingToHighlight == LocalSettings.accountBlocks, + ), + UserSettingsSectionHeader( + title: l10n.importExportSettings, + description: l10n.importExportLemmyAccountSettingsSubtitle, + ), + ThunderSettingsTile( + leading: const Icon(Icons.file_download_rounded), + title: l10n.exportLemmyAccountSettingsDescription, + trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), + onTap: () => _exportSettings(context), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountExportSettings, + ), + highlighted: settingToHighlight == LocalSettings.accountExportSettings, + ), + ThunderSettingsTile( + leading: const Icon(Icons.file_upload_rounded), + title: l10n.importLemmyAccountSettingsDescription, + trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), + onTap: () => _importSettings(context), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountImportSettings, + ), + highlighted: settingToHighlight == LocalSettings.accountImportSettings, + ), + UserSettingsSectionHeader(title: l10n.dangerZone), + ThunderSettingsTile( + leading: const Icon(Icons.password), + title: l10n.changePassword, + trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), + onTap: () => _openInstanceSettings( + context, + title: l10n.changePassword, + contentText: l10n.changePasswordWarning, + ), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountChangePassword, + ), + highlighted: settingToHighlight == LocalSettings.accountChangePassword, + ), + ThunderSettingsTile( + leading: const Icon(Icons.delete_forever_rounded), + title: l10n.deleteAccount, + trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), + onTap: () => _openInstanceSettings( + context, + title: l10n.deleteAccount, + contentText: l10n.deleteAccountDescription, + ), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountDeleteAccount, + ), + highlighted: settingToHighlight == LocalSettings.accountDeleteAccount, + ), + ThunderSettingsTile( + leading: const Icon(Icons.hide_image_rounded), + title: l10n.manageMedia, + trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), + onTap: () => navigateToSettingPage( + context, + LocalSettings.settingsPageAccountMedia, + ), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountManageMedia, + ), + highlighted: settingToHighlight == LocalSettings.accountManageMedia, + ), + ]; + }, + ); + } + + void _editDisplayName(BuildContext context, ThunderUser? person) { + final l10n = GlobalContext.l10n; + displayNameTextController.text = person?.displayName ?? ''; + + showThunderDialog( + context: context, + title: l10n.displayName, + contentWidgetBuilder: (_) => TextField( + controller: displayNameTextController, + decoration: InputDecoration(hintText: l10n.displayName), + ), + primaryButtonText: l10n.save, + onPrimaryButtonPressed: (dialogContext, _) { + context.read().updateSettings( + displayName: displayNameTextController.text, + ); + Navigator.of(dialogContext).pop(); + }, + secondaryButtonText: l10n.cancel, + onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), + ); + } + + void _editBio(BuildContext context, ThunderUser? person) { + final l10n = GlobalContext.l10n; + bioTextController.text = person?.bio ?? ''; + + showThunderDialog( + context: context, + title: l10n.profileBio, + contentWidgetBuilder: (_) => TextField( + controller: bioTextController, + minLines: 8, + maxLines: 8, + keyboardType: TextInputType.multiline, + decoration: InputDecoration( + border: const OutlineInputBorder(), + hintText: l10n.profileBio, + ), + ), + primaryButtonText: l10n.save, + onPrimaryButtonPressed: (dialogContext, _) { + context.read().updateSettings( + bio: bioTextController.text, + ); + Navigator.of(dialogContext).pop(); + }, + secondaryButtonText: l10n.cancel, + onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), + ); + } + + Future _exportSettings(BuildContext context) async { + final l10n = GlobalContext.l10n; + + dynamic exportSettings; + try { + final account = resolveEffectiveAccount(context); + exportSettings = await AccountRepositoryImpl(account: account).exportSettings(); + } catch (e) { + showSnackbar(getExceptionErrorMessage(e)); + return; + } + + try { + final initialFilePath = (await getApplicationDocumentsDirectory()).path; + final initialFileName = 'lemmy_user_settings_${DateTime.now().toUtc().toIso8601String().replaceAll(':', '').replaceAll('-', '')}.json'; + final filePath = '$initialFilePath/$initialFileName'; + + final file = File(filePath); + await file.writeAsString(jsonEncode(exportSettings)); + + final savedFilePath = await FlutterFileDialog.saveFile( + params: SaveFileDialogParams( + mimeTypesFilter: const ['application/json'], + sourceFilePath: filePath, + fileName: initialFileName, + ), + ); + + if (savedFilePath?.isNotEmpty == true) { + showSnackbar(l10n.accountSettingsExportedSuccessfully(savedFilePath!)); + } else { + showSnackbar(l10n.errorSavingAccountSettings); + } + } catch (e) { + showSnackbar('${l10n.errorSavingAccountSettings} $e'); + } + } + + Future _importSettings(BuildContext context) async { + final l10n = GlobalContext.l10n; + late final String importSettings; + + try { + final filePath = await FlutterFileDialog.pickFile( + params: const OpenFileDialogParams( + fileExtensionsFilter: ['json'], + ), + ); + + if (filePath != null) { + importSettings = await File(filePath).readAsString(); + } else { + showSnackbar(l10n.errorLoadingAccountSettings); + return; + } + } catch (e) { + if (e is FormatException) { + showSnackbar(l10n.errorParsingJson); + } else if ((e as PlatformException?)?.code == 'invalid_file_extension') { + showSnackbar(l10n.youMustSelectAJsonFile); + } else { + showSnackbar('${l10n.errorLoadingAccountSettings} $e'); + } + return; + } + + try { + final appL10n = AppLocalizations.of(GlobalContext.context)!; + final account = resolveEffectiveAccount(context); + final success = await AccountRepositoryImpl(account: account).importSettings( + importSettings, + ); + + if (success) { + showSnackbar(appL10n.accountSettingsImportedSuccessfully); + context.read().add(FetchProfileSettings()); + } else { + showSnackbar(appL10n.errorImportingAccountSettings); + } + } catch (e) { + showSnackbar(getExceptionErrorMessage(e)); + } + } + + Future _openInstanceSettings( + BuildContext context, { + required String title, + required String contentText, + }) async { + final l10n = GlobalContext.l10n; + + showThunderDialog( + context: context, + title: title, + contentText: contentText, + secondaryButtonText: l10n.cancel, + onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), + primaryButtonText: l10n.confirm, + onPrimaryButtonPressed: (dialogContext, _) async { + if (!context.mounted) return; + + Navigator.of(context).pop(); + final account = resolveEffectiveAccount(context); + handleLink(context, url: 'https://${account.instance}/settings'); + }, + ); + } +} diff --git a/lib/src/features/user/presentation/pages/piefed_user_settings_page.dart b/lib/src/features/user/presentation/pages/piefed_user_settings_page.dart new file mode 100644 index 000000000..d5fc8454b --- /dev/null +++ b/lib/src/features/user/presentation/pages/piefed_user_settings_page.dart @@ -0,0 +1,423 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; + +import 'package:collection/collection.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:html/parser.dart'; +import 'package:markdown/markdown.dart' hide Text; + +import 'package:thunder/packages/ui/ui.dart'; +import 'package:thunder/src/app/shell/navigation/link_navigation_utils.dart'; +import 'package:thunder/src/app/shell/navigation/navigation_utils.dart'; +import 'package:thunder/src/features/account/account.dart'; +import 'package:thunder/src/features/session/api.dart'; +import 'package:thunder/src/features/settings/presentation/utils/setting_link_utils.dart'; +import 'package:thunder/src/features/user/presentation/state/account_settings_cubit.dart'; +import 'package:thunder/src/features/user/presentation/widgets/user_settings_page_scaffold.dart'; +import 'package:thunder/src/foundation/config/global_context.dart'; +import 'package:thunder/src/foundation/primitives/enums/enums.dart'; +import 'package:thunder/src/foundation/primitives/models/thunder_language.dart'; +import 'package:thunder/src/shared/sort_picker.dart'; + +/// PieFed account settings page. +class PiefedUserSettingsPage extends StatefulWidget { + /// The setting to be highlighted when searching. + final LocalSettings? settingToHighlight; + + const PiefedUserSettingsPage({super.key, this.settingToHighlight}); + + @override + State createState() => _PiefedUserSettingsPageState(); +} + +class _PiefedUserSettingsPageState extends State { + final TextEditingController bioTextController = TextEditingController(); + + final GlobalKey settingToHighlightKey = GlobalKey(); + LocalSettings? settingToHighlight; + + @override + void initState() { + super.initState(); + + if (widget.settingToHighlight != null) { + setState(() => settingToHighlight = widget.settingToHighlight); + + Timer(const Duration(milliseconds: 500), () { + if (settingToHighlightKey.currentContext != null) { + Scrollable.ensureVisible( + settingToHighlightKey.currentContext!, + duration: const Duration(milliseconds: 250), + curve: Curves.easeInOut, + ); + } + + Timer(const Duration(seconds: 1), () { + if (mounted) setState(() => settingToHighlight = null); + }); + }); + } + } + + @override + void dispose() { + bioTextController.dispose(); + super.dispose(); + } + + List> _defaultSortOptions(Account account) { + const allowedSortTypes = { + PostSortType.hot, + PostSortType.new_, + PostSortType.active, + PostSortType.old, + PostSortType.scaled, + }; + + return [ + ...getDefaultPostSortTypeItems(account: account), + ...getTopPostSortTypeItems(account: account), + ].where((item) => allowedSortTypes.contains(item.payload)).toList(); + } + + List> _feedTypeOptions(Account account) { + return FeedListType.values + .where( + (type) => type.platform == null || type.platform == account.platform, + ) + .map( + (type) => ListPickerItem( + payload: type, + icon: switch (type) { + FeedListType.all => Icons.home_rounded, + FeedListType.local => Icons.grid_view_rounded, + FeedListType.subscribed => Icons.view_list_rounded, + FeedListType.popular => Icons.local_fire_department_rounded, + FeedListType.moderating || FeedListType.moderatorView => Icons.gavel_rounded, + }, + label: type.value, + capitalizeLabel: false, + ), + ) + .toList(); + } + + ListPickerItem _currentFeedTypeOption( + Account account, + FeedListType? currentType, + ) { + return _feedTypeOptions(account).firstWhereOrNull( + (item) => item.payload == currentType, + ) ?? + ListPickerItem( + payload: currentType ?? FeedListType.subscribed, + icon: Icons.feed_rounded, + label: currentType?.value ?? FeedListType.subscribed.value, + capitalizeLabel: false, + ); + } + + ListPickerItem _currentSortOption({ + required Account account, + required PostSortType? currentSortType, + }) { + final options = _defaultSortOptions(account); + + if (currentSortType == null) return options.first; + + return options.firstWhereOrNull((item) => item.payload == currentSortType) ?? + allPostSortTypeItems.firstWhere( + (item) => item.payload == currentSortType, + orElse: () => ListPickerItem( + payload: currentSortType, + icon: Icons.sort_rounded, + label: currentSortType.value, + capitalizeLabel: false, + ), + ); + } + + String _discussionLanguagesSubtitle( + List allLanguages, + List selectedLanguageIds, + ) { + final l10n = GlobalContext.l10n; + + if (selectedLanguageIds.isEmpty) return l10n.noDiscussionLanguages; + + final names = selectedLanguageIds.map((id) { + return allLanguages.firstWhereOrNull((language) => language.id == id)?.name ?? id.toString(); + }).toList(); + + return names.join(', '); + } + + @override + Widget build(BuildContext context) { + final l10n = GlobalContext.l10n; + final account = resolveEffectiveAccount(context); + + return UserSettingsPageScaffold( + childrenBuilder: (context, state) { + final theme = Theme.of(context); + final isUpdating = state.status == AccountSettingsStatus.updating; + final myUser = state.siteResponse?.myUser; + final localUser = myUser?.localUserView.localUser; + final person = myUser?.localUserView.person; + final currentFeedTypeOption = _currentFeedTypeOption(account, localUser?.defaultListingType); + final currentSortOption = _currentSortOption( + account: account, + currentSortType: localUser?.defaultSortType, + ); + final languages = state.siteResponse?.allLanguages ?? const []; + final selectedLanguageIds = myUser?.discussionLanguages ?? const []; + + return [ + UserSettingsSectionHeader(title: l10n.general), + ThunderSettingsTile( + leading: const Icon(Icons.note_rounded), + title: l10n.profileBio, + subtitle: person?.bio?.isNotEmpty == true ? parse(markdownToHtml(person?.bio ?? '')).documentElement?.text.trim() : l10n.noProfileBioSet, + subtitleMaxLines: 1, + trailing: const Padding(padding: EdgeInsets.all(20.0)), + onTap: isUpdating ? null : () => _editBio(context, person?.bio), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting(context, LocalSettings.accountProfileBio), + highlighted: settingToHighlight == LocalSettings.accountProfileBio, + ), + UserSettingsSectionHeader( + title: l10n.feedSettings, + description: l10n.settingOverrideLabel, + ), + ThunderListOption( + title: l10n.defaultFeedSortType, + value: currentSortOption, + options: _defaultSortOptions(account), + leading: const Icon(Icons.sort_rounded), + onChanged: (_) async {}, + disabled: isUpdating, + isBottomModalScrollControlled: true, + customListPicker: BottomSheetListPicker( + title: l10n.defaultFeedSortType, + items: _defaultSortOptions(account), + previouslySelected: localUser?.defaultSortType, + onSelect: (value) async { + context.read().updateSettings( + defaultPostSortType: value.payload, + ); + }, + ), + valueDisplay: Row( + children: [ + Icon(currentSortOption.icon, size: 13), + const SizedBox(width: 4), + Text( + currentSortOption.label, + style: theme.textTheme.titleSmall, + ), + ], + ), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountDefaultFeedSortType, + ), + highlighted: settingToHighlight == LocalSettings.accountDefaultFeedSortType, + ), + ThunderToggleOption( + title: l10n.showNsfwContent, + value: localUser?.showNsfw, + iconEnabled: Icons.no_adult_content, + iconDisabled: Icons.no_adult_content, + onChanged: (value) => context.read().updateSettings(showNsfw: value), + disabled: isUpdating, + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountShowNsfwContent, + ), + highlighted: settingToHighlight == LocalSettings.accountShowNsfwContent, + ), + ThunderToggleOption( + title: 'Show NSFL', + value: localUser?.showNsfl, + iconEnabled: Icons.warning_amber_rounded, + iconDisabled: Icons.warning_amber_outlined, + onChanged: (value) => context.read().updateSettings(showNsfl: value), + disabled: isUpdating, + highlighted: false, + ), + ThunderToggleOption( + title: l10n.showReadPosts, + value: localUser?.showReadPosts, + iconEnabled: Icons.fact_check_rounded, + iconDisabled: Icons.fact_check_outlined, + onChanged: (value) => context.read().updateSettings(showReadPosts: value), + disabled: isUpdating, + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountShowReadPosts, + ), + highlighted: settingToHighlight == LocalSettings.accountShowReadPosts, + ), + ThunderToggleOption( + title: l10n.showBotAccounts, + value: localUser?.showBotAccounts, + iconEnabled: Thunder.robot, + iconDisabled: Thunder.robot, + iconSpacing: 14.0, + onChanged: (value) => context.read().updateSettings(showBotAccounts: value), + disabled: isUpdating, + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountShowBotAccounts, + ), + highlighted: settingToHighlight == LocalSettings.accountShowBotAccounts, + ), + ThunderListOption( + title: l10n.defaultFeedType, + value: currentFeedTypeOption, + options: _feedTypeOptions(account), + leading: const Icon(Icons.filter_alt_rounded), + disabled: true, + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountDefaultFeedType, + ), + highlighted: settingToHighlight == LocalSettings.accountDefaultFeedType, + ), + UserSettingsSectionHeader(title: l10n.contentManagement), + ThunderSettingsTile( + leading: const Icon(Icons.language_rounded), + title: l10n.discussionLanguages, + subtitle: _discussionLanguagesSubtitle( + languages, + selectedLanguageIds, + ), + subtitleMaxLines: 2, + enabled: false, + highlightKey: settingToHighlightKey, + highlighted: settingToHighlight == LocalSettings.discussionLanguages, + ), + ThunderSettingsTile( + leading: const Icon(Icons.block_rounded), + title: l10n.blockSettingLabel, + trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), + onTap: () => navigateToSettingPage( + context, + LocalSettings.settingsPageAccountBlocks, + ), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting(context, LocalSettings.accountBlocks), + highlighted: settingToHighlight == LocalSettings.accountBlocks, + ), + UserSettingsSectionHeader(title: l10n.dangerZone), + ThunderSettingsTile( + leading: const Icon(Icons.password), + title: l10n.changePassword, + trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), + onTap: () => _openInstanceSettings( + context, + title: l10n.changePassword, + contentText: l10n.changePasswordWarning, + ), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountChangePassword, + ), + highlighted: settingToHighlight == LocalSettings.accountChangePassword, + ), + ThunderSettingsTile( + leading: const Icon(Icons.delete_forever_rounded), + title: l10n.deleteAccount, + trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), + onTap: () => _openInstanceSettings( + context, + title: l10n.deleteAccount, + contentText: l10n.deleteAccountDescription, + ), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountDeleteAccount, + ), + highlighted: settingToHighlight == LocalSettings.accountDeleteAccount, + ), + ThunderSettingsTile( + leading: const Icon(Icons.hide_image_rounded), + title: l10n.manageMedia, + trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), + onTap: () => navigateToSettingPage( + context, + LocalSettings.settingsPageAccountMedia, + ), + highlightKey: settingToHighlightKey, + onLongPress: () => shareLocalSetting( + context, + LocalSettings.accountManageMedia, + ), + highlighted: settingToHighlight == LocalSettings.accountManageMedia, + ), + ]; + }, + ); + } + + void _editBio(BuildContext context, String? bio) { + final l10n = GlobalContext.l10n; + bioTextController.text = bio ?? ''; + + showThunderDialog( + context: context, + title: l10n.profileBio, + contentWidgetBuilder: (_) => TextField( + controller: bioTextController, + minLines: 8, + maxLines: 8, + keyboardType: TextInputType.multiline, + decoration: InputDecoration( + border: const OutlineInputBorder(), + hintText: l10n.profileBio, + ), + ), + primaryButtonText: l10n.save, + onPrimaryButtonPressed: (dialogContext, _) { + context.read().updateSettings( + bio: bioTextController.text, + ); + Navigator.of(dialogContext).pop(); + }, + secondaryButtonText: l10n.cancel, + onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), + ); + } + + Future _openInstanceSettings( + BuildContext context, { + required String title, + required String contentText, + }) async { + final l10n = GlobalContext.l10n; + + showThunderDialog( + context: context, + title: title, + contentText: contentText, + secondaryButtonText: l10n.cancel, + onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), + primaryButtonText: l10n.confirm, + onPrimaryButtonPressed: (dialogContext, _) async { + if (!context.mounted) return; + + Navigator.of(context).pop(); + final account = resolveEffectiveAccount(context); + handleLink(context, url: 'https://${account.instance}/user/settings'); + }, + ); + } +} diff --git a/lib/src/features/user/presentation/pages/user_settings_page.dart b/lib/src/features/user/presentation/pages/user_settings_page.dart index 33755ec7e..ef4b0796e 100644 --- a/lib/src/features/user/presentation/pages/user_settings_page.dart +++ b/lib/src/features/user/presentation/pages/user_settings_page.dart @@ -1,602 +1,41 @@ -import "dart:async"; -import "dart:convert"; -import "dart:io"; +import 'package:flutter/material.dart'; -import "package:flutter/material.dart"; -import "package:flutter/services.dart"; +import 'package:flutter_bloc/flutter_bloc.dart'; -import "package:flutter_bloc/flutter_bloc.dart"; -import "package:flutter_file_dialog/flutter_file_dialog.dart"; -import "package:html/parser.dart"; -import "package:path_provider/path_provider.dart"; -import 'package:markdown/markdown.dart' hide Text; - -import "package:thunder/src/foundation/primitives/models/thunder_local_user.dart"; -import "package:thunder/src/foundation/primitives/models/thunder_site_response.dart"; -import 'package:thunder/l10n/generated/app_localizations.dart'; +import 'package:thunder/src/app/wiring/state_factories.dart'; import 'package:thunder/src/features/account/account.dart'; -import "package:thunder/src/foundation/primitives/enums/enums.dart"; -import "package:thunder/src/shared/sort_picker.dart"; -import "package:thunder/src/features/user/user.dart"; -import "package:thunder/src/foundation/config/app_constants.dart"; -import "package:thunder/src/foundation/networking/error_message_utils.dart"; -import "package:thunder/src/foundation/config/global_context.dart"; -import 'package:thunder/src/app/shell/navigation/link_navigation_utils.dart'; -import 'package:thunder/src/features/settings/presentation/utils/setting_link_utils.dart'; -import "package:thunder/src/app/shell/navigation/navigation_utils.dart"; -import 'package:thunder/packages/ui/ui.dart'; - -/// A widget that displays the user's account settings. These settings are synchronized with the instance and should be preferred over the app settings. -class UserSettingsPage extends StatefulWidget { - /// The setting to be highlighted when searching +import 'package:thunder/src/features/session/api.dart'; +import 'package:thunder/src/features/user/presentation/pages/lemmy_user_settings_page.dart'; +import 'package:thunder/src/features/user/presentation/pages/piefed_user_settings_page.dart'; +import 'package:thunder/src/foundation/primitives/enums/enums.dart'; + +/// Routes the account settings view to the platform-specific implementation. +class UserSettingsPage extends StatelessWidget { + /// The setting to be highlighted when searching. final LocalSettings? settingToHighlight; const UserSettingsPage({super.key, this.settingToHighlight}); - @override - State createState() => _UserSettingsPageState(); -} - -class _UserSettingsPageState extends State { - /// Text controller for the user's display name - TextEditingController displayNameTextController = TextEditingController(); - - /// Text controller for the profile bio - TextEditingController bioTextController = TextEditingController(); - - /// Text controller for the user's email - TextEditingController emailTextController = TextEditingController(); - - /// Text controller for the user's matrix id - TextEditingController matrixUserTextController = TextEditingController(); - - GlobalKey settingToHighlightKey = GlobalKey(); - LocalSettings? settingToHighlight; - - @override - void initState() { - super.initState(); - - if (widget.settingToHighlight != null) { - setState(() => settingToHighlight = widget.settingToHighlight); - - // Need some delay to finish building, even though we're in a post-frame callback. - Timer(const Duration(milliseconds: 500), () { - if (settingToHighlightKey.currentContext != null) { - // Ensure that the selected setting is visible on the screen - Scrollable.ensureVisible( - settingToHighlightKey.currentContext!, - duration: const Duration(milliseconds: 250), - curve: Curves.easeInOut, - ); - } - - // Give time for the highlighting to appear, then turn it off - Timer(const Duration(seconds: 1), () { - setState(() => settingToHighlight = null); - }); - }); - } - } - @override Widget build(BuildContext context) { - final theme = Theme.of(context); - final l10n = GlobalContext.l10n; - - final account = context.read().state.account; - - // TODO: Add support for Piefed account settings - if (account.platform == ThreadiversePlatform.piefed) { - return Scaffold( - appBar: AppBar(title: Text(l10n.accountSettings)), - body: const Center(child: Text("This feature is not yet available.")), - ); - } - - return PopScope( - onPopInvokedWithResult: (didPop, result) { - if (didPop) context.read().add(FetchProfileSettings()); - }, - child: Scaffold( - body: SafeArea( - top: false, - child: BlocListener( - listenWhen: (_, state) => state.status == ProfileStatus.success && state.siteResponse != null, - listener: (context, state) { - if (!context.mounted) return; - context.read().hydrateFromProfile(state.siteResponse); + return BlocBuilder( + builder: (context, state) { + final account = state.effectiveAccount; + + return KeyedSubtree( + key: ValueKey('user-settings-${account.id}-${account.instance}-${account.platform?.name ?? 'unknown'}-${account.anonymous}'), + child: MultiBlocProvider( + providers: [ + BlocProvider(create: (_) => createProfileBloc(account)..add(InitializeAuth())), + BlocProvider(create: (_) => createAccountSettingsCubit(account)), + ], + child: switch (account.platform) { + ThreadiversePlatform.piefed => PiefedUserSettingsPage(settingToHighlight: settingToHighlight), + _ => LemmyUserSettingsPage(settingToHighlight: settingToHighlight), }, - child: BlocConsumer( - listener: (context, state) { - if (state.status == AccountSettingsStatus.failure) { - showSnackbar(state.errorMessage ?? l10n.unexpectedError); - } else if (state.status == AccountSettingsStatus.success) { - context.read().add(FetchProfileSettings()); - } - }, - builder: (context, state) { - ThunderSiteResponse? siteResponse = state.siteResponse; - - ThunderMyUser? myUser = siteResponse?.myUser; - ThunderLocalUser? localUser = myUser?.localUserView.localUser; - ThunderUser? person = myUser?.localUserView.person; - - return CustomScrollView( - physics: state.status == AccountSettingsStatus.notLoggedIn ? const NeverScrollableScrollPhysics() : null, - slivers: [ - SliverAppBar( - pinned: true, - floating: true, - centerTitle: false, - toolbarHeight: APP_BAR_HEIGHT, - title: Text(l10n.accountSettings), - actions: [ - IconButton( - icon: const Icon(Icons.people_alt_rounded), - onPressed: () => showProfileModalSheet(context), - ), - ], - ), - switch (state.status) { - AccountSettingsStatus.notLoggedIn => const SliverFillRemaining(hasScrollBody: false, child: AccountPlaceholder()), - AccountSettingsStatus.initial => const SliverFillRemaining( - hasScrollBody: false, - child: Center( - child: CircularProgressIndicator(), - ), - ), - _ => SliverList.list( - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const UserIndicator(), - IconButton( - icon: const Icon(Icons.logout_rounded), - onPressed: () => showProfileModalSheet(context, showLogoutDialog: true), - ), - ], - ), - ), - Padding( - padding: const EdgeInsets.only(top: 0, bottom: 8.0, left: 16.0, right: 16.0), - child: Text( - l10n.userSettingDescription, - style: theme.textTheme.bodyMedium!.copyWith( - fontWeight: FontWeight.w400, - color: theme.colorScheme.onSurface.withValues(alpha: 0.75), - ), - ), - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), - child: Text(l10n.general, style: theme.textTheme.titleMedium), - ), - ThunderSettingsTile( - leading: Icon(Icons.person_rounded), - title: l10n.displayName, - subtitle: person?.displayName?.isNotEmpty == true ? person?.displayName : l10n.noDisplayNameSet, - trailing: const Padding(padding: EdgeInsets.all(20.0)), - onTap: () { - displayNameTextController.text = person?.displayName ?? ""; - showThunderDialog( - context: context, - title: l10n.displayName, - contentWidgetBuilder: (setPrimaryButtonEnabled) => TextField( - controller: displayNameTextController, - decoration: InputDecoration(hintText: l10n.displayName), - ), - primaryButtonText: l10n.save, - onPrimaryButtonPressed: (dialogContext, _) { - context.read().updateSettings(displayName: displayNameTextController.text); - Navigator.of(dialogContext).pop(); - }, - secondaryButtonText: l10n.cancel, - onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), - ); - }, - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountDisplayName), - highlighted: settingToHighlight == LocalSettings.accountDisplayName), - ThunderSettingsTile( - leading: Icon(Icons.note_rounded), - title: l10n.profileBio, - subtitle: person?.bio?.isNotEmpty == true ? parse(markdownToHtml(person?.bio ?? "")).documentElement?.text.trim() : l10n.noProfileBioSet, - subtitleMaxLines: 1, - trailing: const Padding(padding: EdgeInsets.all(20.0)), - onTap: () { - bioTextController.text = person?.bio ?? ""; - showThunderDialog( - context: context, - title: l10n.profileBio, - contentWidgetBuilder: (setPrimaryButtonEnabled) => TextField( - controller: bioTextController, - minLines: 8, - maxLines: 8, - keyboardType: TextInputType.multiline, - decoration: InputDecoration( - border: const OutlineInputBorder(), - hintText: l10n.profileBio, - ), - ), - primaryButtonText: l10n.save, - onPrimaryButtonPressed: (dialogContext, _) { - context.read().updateSettings(bio: bioTextController.text); - Navigator.of(dialogContext).pop(); - }, - secondaryButtonText: l10n.cancel, - onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), - ); - }, - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountProfileBio), - highlighted: settingToHighlight == LocalSettings.accountProfileBio), - ThunderSettingsTile( - leading: Icon(Icons.email_rounded), - title: l10n.email, - subtitle: localUser?.email?.isNotEmpty == true ? localUser?.email : l10n.noEmailSet, - trailing: const Padding(padding: EdgeInsets.all(20.0)), - onTap: () { - emailTextController.text = localUser?.email ?? ""; - showThunderDialog( - context: context, - title: l10n.email, - contentWidgetBuilder: (setPrimaryButtonEnabled) => TextField( - controller: emailTextController, - decoration: InputDecoration(hintText: l10n.email), - keyboardType: TextInputType.emailAddress, - ), - primaryButtonText: l10n.save, - onPrimaryButtonPressed: (dialogContext, _) { - context.read().updateSettings(email: emailTextController.text); - Navigator.of(dialogContext).pop(); - }, - secondaryButtonText: l10n.cancel, - onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), - ); - }, - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountEmail), - highlighted: settingToHighlight == LocalSettings.accountEmail), - ThunderSettingsTile( - leading: Icon(Icons.person_rounded), - title: l10n.matrixUser, - subtitle: person?.matrixUserId?.isNotEmpty == true ? person?.matrixUserId : l10n.noMatrixUserSet, - trailing: const Padding(padding: EdgeInsets.all(20.0)), - onTap: () { - matrixUserTextController.text = person?.matrixUserId ?? ""; - showThunderDialog( - context: context, - title: l10n.matrixUser, - contentWidgetBuilder: (setPrimaryButtonEnabled) => TextField( - controller: matrixUserTextController, - decoration: const InputDecoration(hintText: "@user:instance"), - ), - primaryButtonText: l10n.save, - onPrimaryButtonPressed: (dialogContext, _) { - context.read().updateSettings(matrixUserId: matrixUserTextController.text); - Navigator.of(dialogContext).pop(); - }, - secondaryButtonText: l10n.cancel, - onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), - ); - }, - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountMatrixUser), - highlighted: settingToHighlight == LocalSettings.accountMatrixUser), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), - child: Text(l10n.feedSettings, style: theme.textTheme.titleMedium), - ), - Padding( - padding: const EdgeInsets.only(top: 0, bottom: 8.0, left: 16.0, right: 16.0), - child: Text( - l10n.settingOverrideLabel, - style: theme.textTheme.bodyMedium!.copyWith( - fontWeight: FontWeight.w400, - color: theme.colorScheme.onSurface.withValues(alpha: 0.75), - ), - ), - ), - ThunderListOption( - title: l10n.defaultFeedType, - value: ListPickerItem(label: localUser?.defaultListingType?.value ?? "", icon: Icons.feed, payload: localUser?.defaultListingType), - options: [ - ListPickerItem(icon: Icons.view_list_rounded, label: FeedListType.subscribed.value, payload: FeedListType.subscribed), - ListPickerItem(icon: Icons.home_rounded, label: FeedListType.all.value, payload: FeedListType.all), - ListPickerItem(icon: Icons.grid_view_rounded, label: FeedListType.local.value, payload: FeedListType.local), - ], - leading: Icon(Icons.filter_alt_rounded), - onChanged: (value) async => context.read().updateSettings(defaultFeedListType: value.payload), - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountDefaultFeedType), - highlighted: settingToHighlight == LocalSettings.accountDefaultFeedType), - ThunderListOption( - title: l10n.defaultFeedSortType, - value: ListPickerItem( - label: localUser?.defaultSortType?.name ?? "", - icon: Icons.local_fire_department_rounded, - payload: localUser?.defaultSortType, - ), - options: [...getDefaultPostSortTypeItems(account: account), ...getTopPostSortTypeItems(account: account)], - leading: Icon(Icons.sort_rounded), - onChanged: (_) async {}, - isBottomModalScrollControlled: true, - customListPicker: SortPicker( - account: account, - title: l10n.defaultFeedSortType, - onSelect: (value) async { - context.read().updateSettings(defaultPostSortType: value.payload); - }, - previouslySelected: localUser?.defaultSortType, - ), - valueDisplay: Row( - children: [ - Icon(allPostSortTypeItems.firstWhere((item) => item.payload == localUser?.defaultSortType).icon, size: 13), - const SizedBox(width: 4), - Text( - allPostSortTypeItems.firstWhere((item) => item.payload == localUser?.defaultSortType).label, - style: theme.textTheme.titleSmall, - ), - ], - ), - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountDefaultFeedSortType), - highlighted: settingToHighlight == LocalSettings.accountDefaultFeedSortType), - ThunderToggleOption( - title: l10n.showNsfwContent, - value: localUser?.showNsfw, - iconEnabled: Icons.no_adult_content, - iconDisabled: Icons.no_adult_content, - onChanged: (bool value) => context.read().updateSettings(showNsfw: value), - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountShowNsfwContent), - highlighted: settingToHighlight == LocalSettings.accountShowNsfwContent), - ThunderToggleOption( - title: l10n.showScores, - value: localUser?.showScores, - iconEnabled: Icons.onetwothree_rounded, - iconDisabled: Icons.onetwothree_rounded, - onChanged: (bool value) => {context.read().updateSettings(showScores: value)}, - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountShowScores), - highlighted: settingToHighlight == LocalSettings.accountShowScores), - ThunderToggleOption( - title: l10n.showReadPosts, - value: localUser?.showReadPosts, - iconEnabled: Icons.fact_check_rounded, - iconDisabled: Icons.fact_check_outlined, - onChanged: (bool value) => {context.read().updateSettings(showReadPosts: value)}, - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountShowReadPosts), - highlighted: settingToHighlight == LocalSettings.accountShowReadPosts), - ThunderToggleOption( - title: l10n.bot, - value: person?.botAccount, - iconEnabled: Thunder.robot, - iconDisabled: Thunder.robot, - iconSpacing: 14.0, - onChanged: (bool value) => {context.read().updateSettings(botAccount: value)}, - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountIsBot), - highlighted: settingToHighlight == LocalSettings.accountIsBot), - ThunderToggleOption( - title: l10n.showBotAccounts, - value: localUser?.showBotAccounts, - iconEnabled: Thunder.robot, - iconDisabled: Thunder.robot, - iconSpacing: 14.0, - onChanged: (bool value) => {context.read().updateSettings(showBotAccounts: value)}, - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountShowBotAccounts), - highlighted: settingToHighlight == LocalSettings.accountShowBotAccounts), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), - child: Text(l10n.contentManagement, style: theme.textTheme.titleMedium), - ), - ThunderSettingsTile( - leading: Icon(Icons.language_rounded), - title: l10n.discussionLanguages, - trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), - onTap: () => navigateToSettingPage(context, LocalSettings.settingsPageAccountLanguages), - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.discussionLanguages), - highlighted: settingToHighlight == LocalSettings.discussionLanguages), - ThunderSettingsTile( - leading: Icon(Icons.block_rounded), - title: l10n.blockSettingLabel, - trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), - onTap: () => navigateToSettingPage(context, LocalSettings.settingsPageAccountBlocks), - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountBlocks), - highlighted: settingToHighlight == LocalSettings.accountBlocks), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text(l10n.importExportSettings, style: theme.textTheme.titleMedium), - Text(l10n.importExportLemmyAccountSettingsSubtitle), - ], - ), - ), - ThunderSettingsTile( - leading: Icon(Icons.file_download_rounded), - title: l10n.exportLemmyAccountSettingsDescription, - trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), - onTap: () async { - dynamic exportSettings; - try { - final account = context.read().state.account; - exportSettings = await AccountRepositoryImpl(account: account).exportSettings(); - } catch (e) { - // Catch rate-limit errors - showSnackbar(getExceptionErrorMessage(e)); - return; - } - - try { - final String initialFilePath = (await getApplicationDocumentsDirectory()).path; - // Use the same naming convention as the web UI - String initialFileName = 'lemmy_user_settings_${DateTime.now().toUtc().toIso8601String().replaceAll(":", "").replaceAll("-", "")}.json'; - final filePath = '$initialFilePath/$initialFileName'; - - final File file = File(filePath); - await file.writeAsString(jsonEncode(exportSettings)); - - final String? savedFilePath = await FlutterFileDialog.saveFile( - params: SaveFileDialogParams( - mimeTypesFilter: ['application/json'], - sourceFilePath: filePath, - fileName: initialFileName, - ), - ); - - if (savedFilePath?.isNotEmpty == true) { - showSnackbar(l10n.accountSettingsExportedSuccessfully(savedFilePath!)); - } else { - showSnackbar(l10n.errorSavingAccountSettings); - } - } catch (e) { - showSnackbar('${l10n.errorSavingAccountSettings} $e'); - } - }, - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountExportSettings), - highlighted: settingToHighlight == LocalSettings.accountExportSettings), - ThunderSettingsTile( - leading: Icon(Icons.file_upload_rounded), - title: l10n.importLemmyAccountSettingsDescription, - trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), - onTap: () async { - String importSettings; - - try { - final filePath = await FlutterFileDialog.pickFile( - params: const OpenFileDialogParams( - fileExtensionsFilter: ['json'], - ), - ); - - if (filePath != null) { - importSettings = await File(filePath).readAsString(); - } else { - showSnackbar(l10n.errorLoadingAccountSettings); - return; - } - } catch (e) { - if (e is FormatException) { - showSnackbar(l10n.errorParsingJson); - } else if ((e as PlatformException?)?.code == "invalid_file_extension") { - showSnackbar(l10n.youMustSelectAJsonFile); - } else { - showSnackbar('${l10n.errorLoadingAccountSettings} $e'); - } - return; - } - - try { - final l10n = AppLocalizations.of(GlobalContext.context)!; - final account = context.read().state.account; - final success = await AccountRepositoryImpl(account: account).importSettings(importSettings); - - if (success) { - showSnackbar(l10n.accountSettingsImportedSuccessfully); - context.read().add(FetchProfileSettings()); - } else { - showSnackbar(l10n.errorImportingAccountSettings); - } - } catch (e) { - showSnackbar(getExceptionErrorMessage(e)); - } - }, - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountImportSettings), - highlighted: settingToHighlight == LocalSettings.accountImportSettings, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), - child: Text(l10n.dangerZone, style: theme.textTheme.titleMedium), - ), - ThunderSettingsTile( - leading: Icon(Icons.password), - title: l10n.changePassword, - trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), - onTap: () async { - showThunderDialog( - context: context, - title: l10n.changePassword, - contentText: l10n.changePasswordWarning, - onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), - secondaryButtonText: l10n.cancel, - onPrimaryButtonPressed: (dialogContext, _) async { - if (context.mounted) { - Navigator.of(context).pop(); - final account = context.read().state.account; - - handleLink(context, url: "https://${account.instance}/settings"); - } - }, - primaryButtonText: l10n.confirm, - ); - }, - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountChangePassword), - highlighted: settingToHighlight == LocalSettings.accountChangePassword, - ), - ThunderSettingsTile( - leading: Icon(Icons.delete_forever_rounded), - title: l10n.deleteAccount, - trailing: const SizedBox(height: 42.0, child: Icon(Icons.chevron_right_rounded)), - onTap: () async { - showThunderDialog( - context: context, - title: l10n.deleteAccount, - contentText: l10n.deleteAccountDescription, - secondaryButtonText: l10n.cancel, - onSecondaryButtonPressed: (dialogContext) => Navigator.of(dialogContext).pop(), - primaryButtonText: l10n.confirm, - onPrimaryButtonPressed: (dialogContext, _) async { - if (context.mounted) { - Navigator.of(context).pop(); - final account = context.read().state.account; - - handleLink(context, url: "https://${account.instance}/settings"); - } - }, - ); - }, - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountDeleteAccount), - highlighted: settingToHighlight == LocalSettings.accountDeleteAccount, - ), - ThunderSettingsTile( - leading: Icon(Icons.hide_image_rounded), - title: l10n.manageMedia, - trailing: const SizedBox( - height: 42.0, - child: Icon(Icons.chevron_right_rounded), - ), - onTap: () => navigateToSettingPage(context, LocalSettings.settingsPageAccountMedia), - highlightKey: settingToHighlightKey, - onLongPress: () => shareLocalSetting(context, LocalSettings.accountManageMedia), - highlighted: settingToHighlight == LocalSettings.accountManageMedia, - ), - const SizedBox(height: 100.0), - ], - ), - } - ], - ); - }, - ), ), - ), - ), + ); + }, ); } } diff --git a/lib/src/features/user/presentation/state/account_settings_cubit.dart b/lib/src/features/user/presentation/state/account_settings_cubit.dart index 71c6a2812..7231a1d42 100644 --- a/lib/src/features/user/presentation/state/account_settings_cubit.dart +++ b/lib/src/features/user/presentation/state/account_settings_cubit.dart @@ -85,17 +85,16 @@ class AccountSettingsCubit extends Cubit { Future updateSettings({ String? displayName, String? bio, - String? email, - String? matrixUserId, FeedListType? defaultFeedListType, PostSortType? defaultPostSortType, bool? showNsfw, + bool? showNsfl, bool? showReadPosts, - bool? showScores, - bool? botAccount, bool? showBotAccounts, List? discussionLanguages, }) async { + if (state.status == AccountSettingsStatus.updating) return; + final originalSiteResponse = state.siteResponse; try { @@ -117,47 +116,49 @@ class AccountSettingsCubit extends Cubit { )); } - final localUser = originalSiteResponse!.myUser!.localUserView.localUser.copyWith( - email: email ?? originalSiteResponse.myUser!.localUserView.localUser.email, - showReadPosts: showReadPosts ?? originalSiteResponse.myUser!.localUserView.localUser.showReadPosts, - showScores: showScores ?? originalSiteResponse.myUser!.localUserView.localUser.showScores, - showBotAccounts: showBotAccounts ?? originalSiteResponse.myUser!.localUserView.localUser.showBotAccounts, - showNsfw: showNsfw ?? originalSiteResponse.myUser!.localUserView.localUser.showNsfw, - defaultListingType: defaultFeedListType ?? originalSiteResponse.myUser!.localUserView.localUser.defaultListingType, - defaultSortType: defaultPostSortType ?? originalSiteResponse.myUser!.localUserView.localUser.defaultSortType, + final myUser = originalSiteResponse!.myUser!; + + final localUser = myUser.localUserView.localUser.copyWith( + showNsfw: showNsfw ?? myUser.localUserView.localUser.showNsfw, + showNsfl: showNsfl ?? myUser.localUserView.localUser.showNsfl, + showReadPosts: showReadPosts ?? myUser.localUserView.localUser.showReadPosts, + showBotAccounts: showBotAccounts ?? myUser.localUserView.localUser.showBotAccounts, + defaultListingType: defaultFeedListType ?? myUser.localUserView.localUser.defaultListingType, + defaultSortType: defaultPostSortType ?? myUser.localUserView.localUser.defaultSortType, ); final updatedSiteResponse = originalSiteResponse.copyWith( - myUser: originalSiteResponse.myUser!.copyWith( - localUserView: originalSiteResponse.myUser!.localUserView.copyWith( - person: originalSiteResponse.myUser!.localUserView.person.copyWith( - botAccount: botAccount ?? originalSiteResponse.myUser!.localUserView.person.botAccount, - bio: bio ?? originalSiteResponse.myUser!.localUserView.person.bio, - displayName: displayName ?? originalSiteResponse.myUser!.localUserView.person.displayName, - matrixUserId: matrixUserId ?? originalSiteResponse.myUser!.localUserView.person.matrixUserId, + myUser: myUser.copyWith( + localUserView: myUser.localUserView.copyWith( + person: myUser.localUserView.person.copyWith( + bio: bio ?? myUser.localUserView.person.bio, + displayName: displayName ?? myUser.localUserView.person.displayName, ), localUser: localUser, ), - discussionLanguages: discussionLanguages ?? originalSiteResponse.myUser!.discussionLanguages, + discussionLanguages: discussionLanguages ?? myUser.discussionLanguages, ), ); - emit(state.copyWith(status: AccountSettingsStatus.ready, siteResponse: updatedSiteResponse, errorMessage: '', errorReason: null)); - emit(state.copyWith(status: AccountSettingsStatus.updating, errorMessage: '', errorReason: null)); + emit(state.copyWith( + status: AccountSettingsStatus.updating, + siteResponse: updatedSiteResponse, + errorMessage: '', + errorReason: null, + )); await accountRepository.saveSettings( - bio: bio, - email: email, - matrixUserId: matrixUserId, - displayName: displayName, - defaultFeedListType: defaultFeedListType, - defaultPostSortType: defaultPostSortType, - showNsfw: showNsfw, - showReadPosts: showReadPosts, - showScores: showScores, - botAccount: botAccount, - showBotAccounts: showBotAccounts, - discussionLanguages: discussionLanguages, + AccountSettingsUpdate( + displayName: displayName, + bio: bio, + defaultFeedListType: defaultFeedListType, + defaultPostSortType: defaultPostSortType, + showNsfw: showNsfw, + showNsfl: showNsfl, + showReadPosts: showReadPosts, + showBotAccounts: showBotAccounts, + discussionLanguages: discussionLanguages, + ), ); emit(state.copyWith(status: AccountSettingsStatus.success, errorMessage: '', errorReason: null)); diff --git a/lib/src/features/user/presentation/widgets/account_picker_sheet.dart b/lib/src/features/user/presentation/widgets/account_picker_sheet.dart new file mode 100644 index 000000000..4d8af40c3 --- /dev/null +++ b/lib/src/features/user/presentation/widgets/account_picker_sheet.dart @@ -0,0 +1,91 @@ +import 'package:flutter/material.dart'; + +import 'package:thunder/src/features/account/account.dart'; +import 'package:thunder/src/foundation/config/global_context.dart'; + +Future showAccountPickerSheet( + BuildContext context, { + required Account currentAccount, + String? title, +}) { + return showModalBottomSheet( + context: context, + showDragHandle: true, + builder: (context) => AccountPickerSheet( + currentAccount: currentAccount, + title: title, + ), + ); +} + +class AccountPickerSheet extends StatefulWidget { + const AccountPickerSheet({ + super.key, + required this.currentAccount, + this.title, + }); + + final Account currentAccount; + final String? title; + + @override + State createState() => _AccountPickerSheetState(); +} + +class _AccountPickerSheetState extends State { + List _accounts = []; + + @override + void initState() { + super.initState(); + WidgetsBinding.instance.addPostFrameCallback((_) => _loadAccounts()); + } + + Future _loadAccounts() async { + try { + final accounts = await Account.accounts().then( + (accounts) => accounts.where((account) => account.id != widget.currentAccount.id).toList(), + ); + + if (!mounted) return; + setState(() => _accounts = accounts); + } catch (e) { + if (!mounted) return; + setState(() => _accounts = []); + debugPrint('Failed to load accounts: $e'); + } + } + + @override + Widget build(BuildContext context) { + final l10n = GlobalContext.l10n; + final theme = Theme.of(context); + + return SafeArea( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + child: Text(widget.title ?? l10n.account(2), style: theme.textTheme.titleLarge), + ), + _accounts.isEmpty + ? Center(child: Text(l10n.noAccountsAdded)) + : ListView.builder( + shrinkWrap: true, + itemCount: _accounts.length, + itemBuilder: (context, index) { + final account = _accounts[index]; + return ListTile( + title: Text(account.username ?? '-', style: theme.textTheme.titleMedium), + subtitle: Text(account.instance), + onTap: () => Navigator.of(context).pop(account), + ); + }, + ), + ], + ), + ); + } +} diff --git a/lib/src/features/user/presentation/widgets/account_settings_listener.dart b/lib/src/features/user/presentation/widgets/account_settings_listener.dart new file mode 100644 index 000000000..5d66ec771 --- /dev/null +++ b/lib/src/features/user/presentation/widgets/account_settings_listener.dart @@ -0,0 +1,34 @@ +import 'package:flutter/widgets.dart'; + +import 'package:flutter_bloc/flutter_bloc.dart'; + +import 'package:thunder/packages/ui/ui.dart' show showSnackbar; +import 'package:thunder/src/features/account/account.dart'; +import 'package:thunder/src/features/user/presentation/state/account_settings_cubit.dart'; +import 'package:thunder/src/foundation/config/global_context.dart'; + +/// A widget that listens to the [AccountSettingsCubit] and shows a snackbar on failure or success. +/// When the account settings are successfully updated, it also triggers a refresh of the profile settings in the [ProfileBloc]. +class AccountSettingsListener extends StatelessWidget { + const AccountSettingsListener({super.key, required this.child}); + + /// The child widget to wrap with the account settings listener. + final Widget child; + + @override + Widget build(BuildContext context) { + final l10n = GlobalContext.l10n; + + return BlocListener( + listenWhen: (previous, current) => previous.status != current.status && (current.status == AccountSettingsStatus.failure || current.status == AccountSettingsStatus.success), + listener: (context, state) { + if (state.status == AccountSettingsStatus.failure) { + showSnackbar(state.errorMessage ?? l10n.unexpectedError); + } else if (state.status == AccountSettingsStatus.success) { + context.read().add(FetchProfileSettings()); + } + }, + child: child, + ); + } +} diff --git a/lib/src/features/user/presentation/widgets/user_selector.dart b/lib/src/features/user/presentation/widgets/user_selector.dart index 59ffd74b3..7e15015e8 100644 --- a/lib/src/features/user/presentation/widgets/user_selector.dart +++ b/lib/src/features/user/presentation/widgets/user_selector.dart @@ -7,6 +7,7 @@ import 'package:thunder/src/features/post/post.dart'; import 'package:thunder/src/features/session/api.dart'; import 'package:thunder/src/features/user/user.dart'; import 'package:thunder/src/foundation/config/global_context.dart'; +import 'package:thunder/src/features/user/presentation/widgets/account_picker_sheet.dart'; import 'package:thunder/packages/ui/ui.dart' show showSnackbar; /// A widget that displays the currently selected user account with the ability to switch between accounts. @@ -181,10 +182,9 @@ class _UserSelectorState extends State { Future _switchProfile() async { if (!widget.enableAccountSwitching) return; - final newAccount = await showModalBottomSheet( - context: context, - showDragHandle: true, - builder: (context) => _UserProfileSelector(widget.account), + final newAccount = await showAccountPickerSheet( + context, + currentAccount: widget.account, ); if (newAccount == null || !mounted || widget.account.id == newAccount.id) { @@ -270,72 +270,3 @@ class _UserSelectorState extends State { ); } } - -/// Modal bottom sheet widget for selecting user accounts -class _UserProfileSelector extends StatefulWidget { - /// The current account - final Account account; - - const _UserProfileSelector(this.account); - - @override - State<_UserProfileSelector> createState() => _UserProfileSelectorState(); -} - -class _UserProfileSelectorState extends State<_UserProfileSelector> { - /// The list of available user accounts - List _accounts = []; - - @override - void initState() { - super.initState(); - WidgetsBinding.instance.addPostFrameCallback((_) => _loadAccounts()); - } - - /// Loads all available user accounts - Future _loadAccounts() async { - try { - final accounts = await Account.accounts().then((accounts) => accounts.where((account) => account.id != widget.account.id).toList()); - - if (!mounted) return; - setState(() => _accounts = accounts); - } catch (e) { - if (!mounted) return; - setState(() => _accounts = []); - debugPrint('Failed to load accounts: $e'); - } - } - - @override - Widget build(BuildContext context) { - final l10n = GlobalContext.l10n; - final theme = Theme.of(context); - - return SafeArea( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), - child: Text(l10n.account(2), style: theme.textTheme.titleLarge), - ), - _accounts.isEmpty - ? Center(child: Text(l10n.noAccountsAdded)) - : ListView.builder( - shrinkWrap: true, - itemCount: _accounts.length, - itemBuilder: (context, index) { - final account = _accounts[index]; - return ListTile( - title: Text(account.username ?? '-', style: theme.textTheme.titleMedium), - subtitle: Text(account.instance), - onTap: () => Navigator.of(context).pop(account), - ); - }, - ), - ], - ), - ); - } -} diff --git a/lib/src/features/user/presentation/widgets/user_settings_page_scaffold.dart b/lib/src/features/user/presentation/widgets/user_settings_page_scaffold.dart new file mode 100644 index 000000000..a2301cd80 --- /dev/null +++ b/lib/src/features/user/presentation/widgets/user_settings_page_scaffold.dart @@ -0,0 +1,192 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_bloc/flutter_bloc.dart'; + +import 'package:thunder/src/features/account/account.dart'; +import 'package:thunder/src/features/session/api.dart'; +import 'package:thunder/src/features/user/presentation/state/account_settings_cubit.dart'; +import 'package:thunder/src/features/user/presentation/widgets/account_picker_sheet.dart'; +import 'package:thunder/src/features/user/presentation/widgets/account_settings_listener.dart'; +import 'package:thunder/src/features/user/presentation/widgets/user_indicator.dart'; +import 'package:thunder/src/foundation/config/app_constants.dart'; +import 'package:thunder/src/foundation/config/global_context.dart'; + +typedef UserSettingsChildrenBuilder = List Function( + BuildContext context, + AccountSettingsState state, +); + +/// Shared scaffold and loading shell for account settings pages. +class UserSettingsPageScaffold extends StatelessWidget { + const UserSettingsPageScaffold({ + super.key, + required this.childrenBuilder, + }); + + final UserSettingsChildrenBuilder childrenBuilder; + + @override + Widget build(BuildContext context) { + final l10n = GlobalContext.l10n; + + return Scaffold( + body: SafeArea( + top: false, + child: BlocListener( + listenWhen: (_, state) => state.status == ProfileStatus.success && state.siteResponse != null, + listener: (context, state) { + if (!context.mounted) return; + context.read().hydrateFromProfile( + state.siteResponse, + ); + }, + child: AccountSettingsListener( + child: BlocBuilder( + builder: (context, state) { + final isUpdating = state.status == AccountSettingsStatus.updating; + + return CustomScrollView( + physics: state.status == AccountSettingsStatus.notLoggedIn ? const NeverScrollableScrollPhysics() : null, + slivers: [ + SliverAppBar( + pinned: true, + floating: true, + centerTitle: false, + toolbarHeight: APP_BAR_HEIGHT, + title: Text(l10n.accountSettings), + actions: [ + if (isUpdating) + const Padding( + padding: EdgeInsets.symmetric(horizontal: 12.0), + child: Center( + child: SizedBox( + width: 18, + height: 18, + child: CircularProgressIndicator(strokeWidth: 2), + ), + ), + ), + IconButton( + icon: const Icon(Icons.people_alt_rounded), + onPressed: () async { + final selectedAccount = await showAccountPickerSheet( + context, + currentAccount: resolveEffectiveAccount(context), + title: l10n.account(2), + ); + + if (!context.mounted || selectedAccount == null) { + return; + } + context.read().setOverride(selectedAccount); + }, + ), + ], + ), + switch (state.status) { + AccountSettingsStatus.notLoggedIn => const SliverFillRemaining( + hasScrollBody: false, + child: AccountPlaceholder(), + ), + AccountSettingsStatus.initial => const SliverFillRemaining( + hasScrollBody: false, + child: Center( + child: CircularProgressIndicator(), + ), + ), + _ => SliverList.list( + children: [ + const _AccountSummaryHeader(), + ...childrenBuilder(context, state), + const SizedBox(height: 100.0), + ], + ), + }, + ], + ); + }, + ), + ), + ), + ), + ); + } +} + +class _AccountSummaryHeader extends StatelessWidget { + const _AccountSummaryHeader(); + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final l10n = GlobalContext.l10n; + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const UserIndicator(), + IconButton( + icon: const Icon(Icons.logout_rounded), + onPressed: () => showProfileModalSheet(context, showLogoutDialog: true), + ), + ], + ), + ), + Padding( + padding: const EdgeInsets.only(top: 0, bottom: 8.0, left: 16.0, right: 16.0), + child: Text( + l10n.userSettingDescription, + style: theme.textTheme.bodyMedium!.copyWith( + fontWeight: FontWeight.w400, + color: theme.colorScheme.onSurface.withValues(alpha: 0.75), + ), + ), + ), + ], + ); + } +} + +/// Shared section header for account settings groups. +class UserSettingsSectionHeader extends StatelessWidget { + const UserSettingsSectionHeader({ + super.key, + required this.title, + this.description, + }); + + final String title; + final String? description; + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(title, style: theme.textTheme.titleMedium), + if (description != null) + Padding( + padding: const EdgeInsets.only(top: 4.0), + child: Text( + description!, + style: theme.textTheme.bodyMedium!.copyWith( + fontWeight: FontWeight.w400, + color: theme.colorScheme.onSurface.withValues(alpha: 0.75), + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/src/features/user/user.dart b/lib/src/features/user/user.dart index d0cd6b242..ea730dff0 100644 --- a/lib/src/features/user/user.dart +++ b/lib/src/features/user/user.dart @@ -7,6 +7,7 @@ export 'presentation/pages/media_management_page.dart'; export 'presentation/pages/user_settings_block_page.dart'; export 'presentation/pages/user_settings_page.dart'; export 'presentation/widgets/user_action_bottom_sheet.dart'; +export 'presentation/widgets/account_settings_listener.dart'; export 'presentation/widgets/user_header/user_header.dart'; export 'presentation/widgets/user_header/user_header_actions.dart'; export 'presentation/widgets/user_indicator.dart'; diff --git a/lib/src/foundation/networking/lemmy/base_lemmy_api_client.dart b/lib/src/foundation/networking/lemmy/base_lemmy_api_client.dart index 0c1633e4f..eca68e1e2 100644 --- a/lib/src/foundation/networking/lemmy/base_lemmy_api_client.dart +++ b/lib/src/foundation/networking/lemmy/base_lemmy_api_client.dart @@ -15,6 +15,7 @@ import 'package:thunder/src/foundation/primitives/models/thunder_community.dart' import 'package:thunder/src/foundation/primitives/enums/modlog_action_type.dart'; import 'package:thunder/src/foundation/primitives/models/thunder_post.dart'; import 'package:thunder/src/foundation/primitives/models/thunder_user.dart'; +import 'package:thunder/src/features/account/domain/models/account_settings_update.dart'; /// Base class for Lemmy API clients, containing shared parsing helpers. /// Endpoint implementations live in version-specific clients. @@ -430,20 +431,7 @@ abstract class BaseLemmyApiClient extends BaseApiClient implements ThunderApiCli // ============================================================= @override - Future saveUserSettings({ - String? bio, - String? email, - String? matrixUserId, - String? displayName, - FeedListType? defaultFeedListType, - PostSortType? defaultPostSortType, - bool? showNsfw, - bool? showReadPosts, - bool? showScores, - bool? botAccount, - bool? showBotAccounts, - List? discussionLanguages, - }) async { + Future saveUserSettings(AccountSettingsUpdate update) async { throw UnimplementedError('Lemmy endpoints are implemented in version-specific clients.'); } diff --git a/lib/src/foundation/networking/lemmy/lemmy_v3_api_client.dart b/lib/src/foundation/networking/lemmy/lemmy_v3_api_client.dart index cb0ee3b2d..f80942499 100644 --- a/lib/src/foundation/networking/lemmy/lemmy_v3_api_client.dart +++ b/lib/src/foundation/networking/lemmy/lemmy_v3_api_client.dart @@ -22,6 +22,7 @@ import 'package:thunder/src/foundation/primitives/models/thunder_community.dart' import 'package:thunder/src/foundation/primitives/enums/modlog_action_type.dart'; import 'package:thunder/src/foundation/primitives/models/thunder_post.dart'; import 'package:thunder/src/foundation/primitives/models/thunder_user.dart'; +import 'package:thunder/src/features/account/domain/models/account_settings_update.dart'; /// Lemmy API client for version 0.19.x (v3 API). /// @@ -757,33 +758,16 @@ class LemmyV3ApiClient extends BaseLemmyApiClient { // ============================================================= @override - Future saveUserSettings({ - String? bio, - String? email, - String? matrixUserId, - String? displayName, - FeedListType? defaultFeedListType, - PostSortType? defaultPostSortType, - bool? showNsfw, - bool? showReadPosts, - bool? showScores, - bool? botAccount, - bool? showBotAccounts, - List? discussionLanguages, - }) async { + Future saveUserSettings(AccountSettingsUpdate update) async { await request(HttpMethod.put, '$basePath/user/save_user_settings', { - 'bio': bio, - 'email': email, - 'matrix_user_id': matrixUserId, - 'display_name': displayName, - 'default_listing_type': defaultFeedListType?.value, - 'default_sort_type': defaultPostSortType?.value, - 'show_nsfw': showNsfw, - 'show_read_posts': showReadPosts, - 'show_scores': showScores, - 'bot_account': botAccount, - 'show_bot_accounts': showBotAccounts, - 'discussion_languages': discussionLanguages, + 'display_name': update.displayName, + 'bio': update.bio, + 'default_listing_type': update.defaultFeedListType?.value, + 'default_sort_type': update.defaultPostSortType?.value, + 'show_nsfw': update.showNsfw, + 'show_read_posts': update.showReadPosts, + 'show_bot_accounts': update.showBotAccounts, + 'discussion_languages': update.discussionLanguages, }); } diff --git a/lib/src/foundation/networking/piefed/piefed_api_client.dart b/lib/src/foundation/networking/piefed/piefed_api_client.dart index 77af1224d..9e512ec09 100644 --- a/lib/src/foundation/networking/piefed/piefed_api_client.dart +++ b/lib/src/foundation/networking/piefed/piefed_api_client.dart @@ -21,6 +21,7 @@ import 'package:thunder/src/foundation/primitives/models/thunder_community.dart' import 'package:thunder/src/foundation/primitives/enums/modlog_action_type.dart'; import 'package:thunder/src/foundation/primitives/models/thunder_post.dart'; import 'package:thunder/src/foundation/primitives/models/thunder_user.dart'; +import 'package:thunder/src/features/account/domain/models/account_settings_update.dart'; /// PieFed API client for the `/api/alpha` endpoints. class PiefedApiClient extends BaseApiClient implements ThunderApiClient { @@ -1168,24 +1169,14 @@ class PiefedApiClient extends BaseApiClient implements ThunderApiClient { // ============================================================= @override - Future saveUserSettings({ - String? bio, - String? email, - String? matrixUserId, - String? displayName, - FeedListType? defaultFeedListType, - PostSortType? defaultPostSortType, - bool? showNsfw, - bool? showReadPosts, - bool? showScores, - bool? botAccount, - bool? showBotAccounts, - List? discussionLanguages, - }) async { + Future saveUserSettings(AccountSettingsUpdate update) async { await request(HttpMethod.put, '$basePath/user/save_user_settings', { - 'bio': bio, - 'show_nsfw': showNsfw, - 'show_read_posts': showReadPosts, + 'bio': update.bio, + 'default_sort_type': update.defaultPostSortType?.value, + 'bot_visibility': update.showBotAccounts == null ? null : (update.showBotAccounts! ? 'Show' : 'Hide'), + 'show_nsfw': update.showNsfw, + 'show_nsfl': update.showNsfl, + 'show_read_posts': update.showReadPosts, }); } diff --git a/lib/src/foundation/networking/thunder_api_client.dart b/lib/src/foundation/networking/thunder_api_client.dart index fabcfb0d6..dd731bb86 100644 --- a/lib/src/foundation/networking/thunder_api_client.dart +++ b/lib/src/foundation/networking/thunder_api_client.dart @@ -14,6 +14,7 @@ import 'package:thunder/src/foundation/primitives/models/thunder_community.dart' import 'package:thunder/src/foundation/primitives/enums/modlog_action_type.dart'; import 'package:thunder/src/foundation/primitives/models/thunder_post.dart'; import 'package:thunder/src/foundation/primitives/models/thunder_user.dart'; +import 'package:thunder/src/features/account/domain/models/account_settings_update.dart'; /// Response from getting a single post. typedef GetPostResponse = ({ @@ -374,20 +375,7 @@ abstract class ThunderApiClient { // ============================================================= /// Save user settings. - Future saveUserSettings({ - String? bio, - String? email, - String? matrixUserId, - String? displayName, - FeedListType? defaultFeedListType, - PostSortType? defaultPostSortType, - bool? showNsfw, - bool? showReadPosts, - bool? showScores, - bool? botAccount, - bool? showBotAccounts, - List? discussionLanguages, - }); + Future saveUserSettings(AccountSettingsUpdate update); /// Import settings from a backup. Future importSettings(String settings); diff --git a/lib/src/foundation/primitives/models/thunder_local_user.dart b/lib/src/foundation/primitives/models/thunder_local_user.dart index 86d937938..276ac1b7b 100644 --- a/lib/src/foundation/primitives/models/thunder_local_user.dart +++ b/lib/src/foundation/primitives/models/thunder_local_user.dart @@ -1,7 +1,7 @@ import 'package:collection/collection.dart'; -import 'package:thunder/src/foundation/primitives/enums/post_sort_type.dart'; import 'package:thunder/src/foundation/primitives/enums/feed_list_type.dart'; +import 'package:thunder/src/foundation/primitives/enums/post_sort_type.dart'; class ThunderLocalUser { /// The local user's email. @@ -10,6 +10,9 @@ class ThunderLocalUser { /// Whether to show NSFW content. final bool showNsfw; + /// Whether to show NSFL content. + final bool? showNsfl; + /// The local user's default sort type. final PostSortType? defaultSortType; @@ -28,6 +31,7 @@ class ThunderLocalUser { ThunderLocalUser({ this.email, required this.showNsfw, + this.showNsfl, this.defaultSortType, this.defaultListingType, required this.showScores, @@ -38,6 +42,7 @@ class ThunderLocalUser { ThunderLocalUser copyWith({ String? email, bool? showNsfw, + bool? showNsfl, PostSortType? defaultSortType, FeedListType? defaultListingType, bool? showScores, @@ -47,6 +52,7 @@ class ThunderLocalUser { return ThunderLocalUser( email: email ?? this.email, showNsfw: showNsfw ?? this.showNsfw, + showNsfl: showNsfl ?? this.showNsfl, defaultSortType: defaultSortType ?? this.defaultSortType, defaultListingType: defaultListingType ?? this.defaultListingType, showScores: showScores ?? this.showScores, @@ -59,6 +65,7 @@ class ThunderLocalUser { return ThunderLocalUser( email: localUser['email'], showNsfw: localUser['show_nsfw'], + showNsfl: null, defaultSortType: localUser['default_sort_type'] != null ? PostSortType.values.firstWhereOrNull((e) => e.value == localUser['default_sort_type']) : null, defaultListingType: localUser['default_listing_type'] != null ? FeedListType.values.firstWhereOrNull((e) => e.value == localUser['default_listing_type']) : null, showScores: localUser['show_scores'], @@ -71,6 +78,7 @@ class ThunderLocalUser { return ThunderLocalUser( // email:localUser['email'], showNsfw: localUser['show_nsfw'], + showNsfl: localUser['show_nsfl'], defaultSortType: localUser['default_sort_type'] != null ? PostSortType.values.firstWhereOrNull((e) => e.value == localUser['default_sort_type']) : null, defaultListingType: localUser['default_listing_type'] != null ? FeedListType.values.firstWhereOrNull((e) => e.value == localUser['default_listing_type']) : null, showScores: localUser['show_scores'], diff --git a/lib/src/foundation/primitives/models/thunder_my_user.dart b/lib/src/foundation/primitives/models/thunder_my_user.dart index 70fbe2d14..3a2691bd0 100644 --- a/lib/src/foundation/primitives/models/thunder_my_user.dart +++ b/lib/src/foundation/primitives/models/thunder_my_user.dart @@ -133,6 +133,7 @@ class ThunderMyUser { final follows = myUser['follows']; final moderates = myUser['moderates']; final communityBlocks = myUser['community_blocks']; + final discussionLanguages = myUser['discussion_languages']; final instanceBlocks = myUser['instance_blocks']; final personBlocks = myUser['person_blocks']; final localUserView = myUser['local_user_view']; @@ -144,6 +145,7 @@ class ThunderMyUser { communityBlocks: communityBlocks.map((b) => ThunderCommunity.fromPiefedCommunity(b['community'])).toList(), instanceBlocks: instanceBlocks.map((b) => ThunderInstanceBlock.fromPiefedBlock(b)).toList(), personBlocks: personBlocks.map((b) => ThunderUser.fromPiefedUser(b['target'])).toList(), + discussionLanguages: discussionLanguages?.map((language) => language['id'] as int).toList(), ); } } diff --git a/lib/src/foundation/primitives/models/thunder_site_response.dart b/lib/src/foundation/primitives/models/thunder_site_response.dart index 2580f6dd8..326d49b4a 100644 --- a/lib/src/foundation/primitives/models/thunder_site_response.dart +++ b/lib/src/foundation/primitives/models/thunder_site_response.dart @@ -76,7 +76,7 @@ class ThunderSiteResponse { version: response['version'], myUser: myUser != null ? ThunderMyUser.fromPiefedMyUser(myUser) : null, allLanguages: allLanguages.map((l) => ThunderLanguage.fromPiefedLanguage(l)).toList(), - discussionLanguages: discussionLanguages?.cast(), + discussionLanguages: discussionLanguages?.map((language) => language['id'] as int).toList(), // taglines: taglines.map((t) => ThunderTagline.fromPiefedTagline(t)).toList(), ); } diff --git a/spec/lemmy_0_19_11.json b/spec/lemmy_0_19_11.json new file mode 100644 index 000000000..a17c6b155 --- /dev/null +++ b/spec/lemmy_0_19_11.json @@ -0,0 +1,10247 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "Unofficial Lemmy OpenAPI Documentation", + "version": "v0.19.11", + "license": { + "name": "AGPLv3", + "url": "https://www.gnu.org/licenses/agpl-3.0.en.html#license-text" + }, + "x-logo": { + "url": "https://raw.githubusercontent.com/LemmyNet/lemmy-ui/main/src/assets/icons/favicon.svg", + "altText": "Lemmy Icon", + "href": "https://github.com/MV-GH/lemmy_openapi_spec" + }, + "contact": { + "url": "https://github.com/MV-GH/lemmy_openapi_spec" + } + }, + "servers": [ + { + "url": "https://lemmy.ml/api/v3" + }, + { + "url": "https://enterprise.lemmy.ml/api/v3" + }, + { + "url": "https://ds9.lemmy.ml/api/v3" + }, + { + "url": "https://voyager.lemmy.ml/api/v3" + } + ], + "security": [ + { + "bearerAuth": [] + }, + { + "cookieAuth": [] + } + ], + "paths": { + "/site": { + "get": { + "summary": "Gets the site, and your user data.", + "tags": [ + "Site" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetSiteResponse" + } + } + } + } + } + }, + "post": { + "tags": [ + "Site" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateSite" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SiteResponse" + } + } + } + } + }, + "summary": "Create your site." + }, + "put": { + "summary": "Edit your site.", + "tags": [ + "Site" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditSite" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SiteResponse" + } + } + } + } + } + } + }, + "/modlog": { + "get": { + "summary": "Get the modlog.", + "tags": [ + "Miscellaneous" + ], + "parameters": [ + { + "name": "GetModlog", + "explode": true, + "in": "query", + "schema": { + "$ref": "#/components/schemas/GetModlog" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetModlogResponse" + } + } + } + } + } + } + }, + "/search": { + "get": { + "tags": [ + "Miscellaneous" + ], + "summary": "Search lemmy.", + "parameters": [ + { + "name": "Search", + "in": "query", + "explode": true, + "schema": { + "$ref": "#/components/schemas/Search" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchResponse" + } + } + } + } + } + } + }, + "/resolve_object": { + "get": { + "tags": [ + "Miscellaneous" + ], + "parameters": [ + { + "name": "ResolveObject", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ResolveObject" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveObjectResponse" + } + } + } + } + }, + "summary": "Fetch a non-local / federated object." + } + }, + "/community": { + "get": { + "tags": [ + "Community" + ], + "parameters": [ + { + "name": "GetCommunity", + "explode": true, + "in": "query", + "schema": { + "$ref": "#/components/schemas/GetCommunity" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommunityResponse" + } + } + } + } + }, + "summary": "Get / fetch a community." + }, + "post": { + "tags": [ + "Community" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCommunity" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityResponse" + } + } + } + } + }, + "summary": "Create a new community." + }, + "put": { + "tags": [ + "Community" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditCommunity" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityResponse" + } + } + } + } + }, + "summary": "Edit a community." + } + }, + "/community/hide": { + "put": { + "tags": [ + "Community", + "Admin" + ], + "summary": "Hide a community from public / \"All\" view. Admins only.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HideCommunity" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/community/list": { + "get": { + "tags": [ + "Community" + ], + "parameters": [ + { + "name": "ListCommunities", + "in": "query", + "explode": true, + "schema": { + "$ref": "#/components/schemas/ListCommunities" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCommunitiesResponse" + } + } + } + } + }, + "summary": "List communities, with various filters." + } + }, + "/community/follow": { + "post": { + "tags": [ + "Community" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FollowCommunity" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityResponse" + } + } + } + } + }, + "summary": "Follow / subscribe to a community." + } + }, + "/community/block": { + "post": { + "tags": [ + "Community" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BlockCommunity" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BlockCommunityResponse" + } + } + } + } + }, + "summary": "Block a community." + } + }, + "/community/delete": { + "post": { + "tags": [ + "Community" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCommunity" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityResponse" + } + } + } + } + }, + "summary": "Delete a community." + } + }, + "/community/remove": { + "post": { + "tags": [ + "Community", + "Mod" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoveCommunity" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityResponse" + } + } + } + } + }, + "summary": "A moderator remove for a community." + } + }, + "/community/transfer": { + "post": { + "tags": [ + "Community", + "Mod" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TransferCommunity" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityResponse" + } + } + } + } + }, + "summary": "Transfer your community to an existing moderator." + } + }, + "/community/ban_user": { + "post": { + "tags": [ + "Community", + "Mod" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BanFromCommunity" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BanFromCommunityResponse" + } + } + } + } + }, + "summary": "Ban a user from a community." + } + }, + "/community/mod": { + "post": { + "tags": [ + "Community", + "Mod" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddModToCommunity" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddModToCommunityResponse" + } + } + } + } + }, + "summary": "Add a moderator to your community." + } + }, + "/federated_instances": { + "get": { + "tags": [ + "Miscellaneous" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetFederatedInstancesResponse" + } + } + } + } + }, + "summary": "Fetch federated instances." + } + }, + "/post": { + "get": { + "tags": [ + "Post" + ], + "parameters": [ + { + "name": "GetPost", + "in": "query", + "explode": true, + "schema": { + "$ref": "#/components/schemas/GetPost" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostResponse" + } + } + } + } + }, + "summary": "Get / fetch a post." + }, + "put": { + "tags": [ + "Post" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditPost" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostResponse" + } + } + } + } + }, + "summary": "Edit a post." + }, + "post": { + "tags": [ + "Post" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePost" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostResponse" + } + } + } + } + }, + "summary": "Create a post." + } + }, + "/post/list": { + "get": { + "tags": [ + "Post" + ], + "parameters": [ + { + "name": "GetPosts", + "explode": true, + "in": "query", + "schema": { + "$ref": "#/components/schemas/GetPosts" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostsResponse" + } + } + } + } + }, + "summary": "Get / fetch posts, with various filters." + } + }, + "/post/delete": { + "post": { + "tags": [ + "Post" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletePost" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostResponse" + } + } + } + } + }, + "summary": "Delete a post." + } + }, + "/post/remove": { + "post": { + "tags": [ + "Post" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemovePost" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostResponse" + } + } + } + } + }, + "summary": "A moderator remove for a post." + } + }, + "/post/mark_as_read": { + "post": { + "tags": [ + "Post" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MarkPostAsRead" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + }, + "summary": "Mark a post as read." + } + }, + "/post/lock": { + "post": { + "tags": [ + "Post" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LockPost" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostResponse" + } + } + } + } + }, + "summary": "A moderator can lock a post ( IE disable new comments )." + } + }, + "/post/feature": { + "post": { + "tags": [ + "Post" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeaturePost" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostResponse" + } + } + } + } + }, + "summary": "A moderator can feature a community post ( IE stick it to the top of a community )." + } + }, + "/post/like": { + "post": { + "tags": [ + "Post" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePostLike" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostResponse" + } + } + } + } + }, + "summary": "Like / vote on a post." + } + }, + "/post/save": { + "put": { + "tags": [ + "Post" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavePost" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostResponse" + } + } + } + } + }, + "summary": "Save a post." + } + }, + "/post/report": { + "post": { + "tags": [ + "Post" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePostReport" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostReportResponse" + } + } + } + } + }, + "summary": "Report a post." + } + }, + "/post/report/resolve": { + "put": { + "tags": [ + "Post" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolvePostReport" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostReportResponse" + } + } + } + } + }, + "summary": "Resolve a post report. Only a mod can do this." + } + }, + "/post/report/list": { + "get": { + "tags": [ + "Post" + ], + "parameters": [ + { + "name": "ListPostReports", + "explode": true, + "in": "query", + "schema": { + "$ref": "#/components/schemas/ListPostReports" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPostReportsResponse" + } + } + } + } + }, + "summary": "List post reports." + } + }, + "/post/site_metadata": { + "get": { + "tags": [ + "Post" + ], + "parameters": [ + { + "name": "GetSiteMetadata", + "in": "query", + "explode": true, + "schema": { + "$ref": "#/components/schemas/GetSiteMetadata" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetSiteMetadataResponse" + } + } + } + } + }, + "summary": "Fetch metadata for any given site." + } + }, + "/comment": { + "get": { + "tags": [ + "Comment" + ], + "parameters": [ + { + "name": "GetComment", + "in": "query", + "explode": true, + "schema": { + "$ref": "#/components/schemas/GetComment" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommentResponse" + } + } + } + } + }, + "summary": "Get / fetch comment." + }, + "post": { + "tags": [ + "Comment" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateComment" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommentResponse" + } + } + } + } + }, + "summary": "Create a comment." + }, + "put": { + "tags": [ + "Comment" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditComment" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommentResponse" + } + } + } + } + }, + "summary": "Edit a comment." + } + }, + "/comment/list": { + "get": { + "tags": [ + "Comment" + ], + "parameters": [ + { + "in": "query", + "name": "GetComments", + "schema": { + "$ref": "#/components/schemas/GetComments" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommentsResponse" + } + } + } + } + }, + "summary": "Get / fetch comments." + } + }, + "/comment/delete": { + "post": { + "tags": [ + "Comment" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteComment" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommentResponse" + } + } + } + } + }, + "summary": "Delete a comment." + } + }, + "/comment/remove": { + "post": { + "tags": [ + "Comment" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoveComment" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommentResponse" + } + } + } + } + }, + "summary": "A moderator remove for a comment." + } + }, + "/comment/mark_as_read": { + "post": { + "tags": [ + "Comment" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MarkCommentReplyAsRead" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommentReplyResponse" + } + } + } + } + }, + "summary": "Mark a comment as read." + } + }, + "/comment/distinguish": { + "post": { + "tags": [ + "Comment" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DistinguishComment" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommentResponse" + } + } + } + } + }, + "summary": "Distinguishes a comment (speak as moderator)" + } + }, + "/comment/like": { + "post": { + "tags": [ + "Post" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCommentLike" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommentResponse" + } + } + } + } + }, + "summary": "Like / vote on a comment." + } + }, + "/comment/save": { + "put": { + "tags": [ + "Comment" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SaveComment" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommentResponse" + } + } + } + } + }, + "summary": "Save a comment." + } + }, + "/comment/report": { + "post": { + "tags": [ + "Comment" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCommentReport" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommentReportResponse" + } + } + } + } + }, + "summary": "Report a comment." + } + }, + "/comment/report/resolve": { + "put": { + "tags": [ + "Comment" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveCommentReport" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommentReportResponse" + } + } + } + } + }, + "summary": "Resolve a comment report. Only a mod can do this." + } + }, + "/comment/report/list": { + "get": { + "tags": [ + "Comment" + ], + "parameters": [ + { + "name": "ListCommentReports", + "in": "query", + "schema": { + "$ref": "#/components/schemas/ListCommentReports" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCommentReportsResponse" + } + } + } + } + }, + "summary": "List comment reports." + } + }, + "/private_message": { + "put": { + "tags": [ + "PrivateMessage" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditPrivateMessage" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateMessageResponse" + } + } + } + } + }, + "summary": "Edit a private message." + }, + "post": { + "tags": [ + "PrivateMessage" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePrivateMessage" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateMessageResponse" + } + } + } + } + }, + "summary": "Create a private message." + } + }, + "/private_message/list": { + "get": { + "tags": [ + "PrivateMessage" + ], + "parameters": [ + { + "in": "query", + "name": "GetPrivateMessages", + "schema": { + "$ref": "#/components/schemas/GetPrivateMessages" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateMessagesResponse" + } + } + } + } + }, + "summary": "Get / fetch private messages." + } + }, + "/private_message/delete": { + "post": { + "tags": [ + "PrivateMessage" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletePrivateMessage" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateMessageResponse" + } + } + } + } + }, + "summary": "Delete a private message." + } + }, + "/private_message/mark_as_read": { + "post": { + "tags": [ + "PrivateMessage" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MarkPrivateMessageAsRead" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateMessageResponse" + } + } + } + } + }, + "summary": "Mark a private message as read." + } + }, + "/private_message/report": { + "post": { + "tags": [ + "PrivateMessage" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePrivateMessageReport" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateMessageReportResponse" + } + } + } + } + }, + "summary": "Create a report for a private message." + } + }, + "/private_message/report/resolve": { + "put": { + "tags": [ + "PrivateMessage" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolvePrivateMessageReport" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateMessageReportResponse" + } + } + } + } + }, + "summary": "Resolve a report for a private message." + } + }, + "/private_message/report/list": { + "get": { + "tags": [ + "PrivateMessage" + ], + "parameters": [ + { + "name": "ListPrivateMessageReports", + "in": "query", + "explode": true, + "schema": { + "$ref": "#/components/schemas/ListPrivateMessageReports" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPrivateMessageReportsResponse" + } + } + } + } + }, + "summary": "List private message reports." + } + }, + "/user": { + "get": { + "tags": [ + "User" + ], + "parameters": [ + { + "name": "GetPersonDetails", + "in": "query", + "explode": true, + "schema": { + "$ref": "#/components/schemas/GetPersonDetails" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPersonDetailsResponse" + } + } + } + } + }, + "summary": "Get the details for a person." + } + }, + "/user/register": { + "post": { + "tags": [ + "User" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Register" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginResponse", + "description": "JWT will be empty if registration requires email verification or application approval" + } + } + } + }, + "400": { + "description": "BAD REQUEST", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponseRegistration" + } + } + } + } + }, + "summary": "Register a new user." + } + }, + "/user/get_captcha": { + "get": { + "tags": [ + "User" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCaptchaResponse" + } + } + } + } + }, + "summary": "Fetch a Captcha." + } + }, + "/user/mention": { + "get": { + "tags": [ + "User" + ], + "parameters": [ + { + "name": "GetPersonMentions", + "in": "query", + "explode": true, + "schema": { + "$ref": "#/components/schemas/GetPersonMentions" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPersonMentionsResponse" + } + } + } + } + }, + "summary": "Get mentions for your user." + } + }, + "/user/mention/mark_as_read": { + "post": { + "tags": [ + "User" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MarkPersonMentionAsRead" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PersonMentionResponse" + } + } + } + } + }, + "summary": "Mark a person mention as read." + } + }, + "/user/replies": { + "get": { + "tags": [ + "User" + ], + "parameters": [ + { + "name": "GetReplies", + "in": "query", + "explode": true, + "schema": { + "$ref": "#/components/schemas/GetReplies" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetRepliesResponse" + } + } + } + } + }, + "summary": "Get comment replies." + } + }, + "/user/ban": { + "post": { + "tags": [ + "User", + "Admin" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BanPerson" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BanPersonResponse" + } + } + } + } + }, + "summary": "Ban a person from your site." + } + }, + "/user/banned": { + "get": { + "tags": [ + "User", + "Admin" + ], + "operationId": "getBannedPersons", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BannedPersonsResponse" + } + } + } + } + }, + "summary": "Get a list of banned users" + } + }, + "/user/block": { + "post": { + "tags": [ + "User", + "Admin" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BlockPerson" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BlockPersonResponse" + } + } + } + } + }, + "summary": "Block a person." + } + }, + "/user/login": { + "post": { + "tags": [ + "User" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Login" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginResponse" + } + } + } + }, + "400": { + "description": "BAD REQUEST", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errorResponseLogin" + } + } + } + } + }, + "summary": "Log into lemmy." + } + }, + "/user/delete_account": { + "post": { + "tags": [ + "User" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteAccount" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + }, + "summary": "Delete your account." + } + }, + "/user/password_reset": { + "post": { + "tags": [ + "User" + ], + "operationId": "resetPassword", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PasswordReset" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + }, + "summary": "Reset your password." + } + }, + "/user/password_change": { + "post": { + "tags": [ + "User" + ], + "operationId": "changePasswordAfterReset", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PasswordChangeAfterReset" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + }, + "summary": "Change your password from an email / token based reset." + } + }, + "/user/mark_all_as_read": { + "post": { + "tags": [ + "User" + ], + "operationId": "markAllAsRead", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetRepliesResponse" + } + } + } + } + }, + "summary": "Mark all replies as read." + } + }, + "/user/save_user_settings": { + "put": { + "tags": [ + "User" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SaveUserSettings" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + }, + "summary": "Save your user settings." + } + }, + "/user/change_password": { + "put": { + "tags": [ + "User" + ], + "operationId": "changePassword", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ChangePassword" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginResponse" + } + } + } + } + }, + "summary": "Change your user password." + } + }, + "/user/report_count": { + "get": { + "tags": [ + "User" + ], + "parameters": [ + { + "in": "query", + "name": "GetReportCount", + "explode": true, + "schema": { + "$ref": "#/components/schemas/GetReportCount" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetReportCountResponse" + } + } + } + } + }, + "summary": "Get counts for your reports" + } + }, + "/user/unread_count": { + "get": { + "tags": [ + "User" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetUnreadCountResponse" + } + } + } + } + }, + "summary": "Get your unread counts" + } + }, + "/user/verify_email": { + "post": { + "tags": [ + "User" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/VerifyEmail" + } + } + } + }, + "responses": { + "200": { + "description": "Ok" + } + }, + "summary": "Verify your email" + } + }, + "/user/leave_admin": { + "post": { + "tags": [ + "User", + "Admin" + ], + "operationId": "leaveAdmin", + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetSiteResponse" + } + } + } + } + }, + "summary": "Leave the Site admins." + } + }, + "/user/donation_dialog_shown": { + "post": { + "tags": [ + "User" + ], + "operationId": "markDonationDialogShown", + "responses": { + "200": { + "description": "Ok" + } + }, + "summary": "Mark donation dialog as shown." + } + }, + "/admin/add": { + "post": { + "tags": [ + "Admin" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddAdmin" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AddAdminResponse" + } + } + } + } + }, + "summary": "Add an admin to your site." + } + }, + "/admin/registration_application/count": { + "get": { + "tags": [ + "Admin" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetUnreadRegistrationApplicationCountResponse" + } + } + } + } + }, + "summary": "Get the unread registration applications count." + } + }, + "/admin/registration_application/list": { + "get": { + "tags": [ + "Admin" + ], + "parameters": [ + { + "in": "query", + "explode": true, + "name": "ListRegistrationApplications", + "schema": { + "$ref": "#/components/schemas/ListRegistrationApplications" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListRegistrationApplicationsResponse" + } + } + } + } + }, + "summary": "List the registration applications." + } + }, + "/admin/registration_application/approve": { + "put": { + "tags": [ + "Admin" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApproveRegistrationApplication" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegistrationApplicationResponse" + } + } + } + } + }, + "summary": "Approve a registration application" + } + }, + "/admin/purge/person": { + "post": { + "tags": [ + "Admin" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurgePerson" + } + } + } + }, + "responses": { + "200": { + "description": "Ok" + } + }, + "summary": "Purge / Delete a person from the database." + } + }, + "/admin/purge/community": { + "post": { + "tags": [ + "Admin" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurgeCommunity" + } + } + } + }, + "responses": { + "200": { + "description": "Ok" + } + }, + "summary": "Purge / Delete a community from the database." + } + }, + "/admin/purge/post": { + "post": { + "tags": [ + "Admin" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurgePost" + } + } + } + }, + "responses": { + "200": { + "description": "Ok" + } + }, + "summary": "Purge / Delete a post from the database." + } + }, + "/admin/purge/comment": { + "post": { + "tags": [ + "Admin" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PurgeComment" + } + } + } + }, + "responses": { + "200": { + "description": "Ok" + } + }, + "summary": "Purge / Delete a comment from the database." + } + }, + "/custom_emoji": { + "put": { + "tags": [ + "CustomEmoji" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditCustomEmoji" + } + } + } + }, + "responses": { + "200": { + "description": "Ok", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomEmojiResponse" + } + } + } + } + }, + "summary": "Edit an existing custom emoji" + }, + "post": { + "tags": [ + "CustomEmoji" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCustomEmoji" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CustomEmojiResponse" + } + } + } + } + }, + "summary": "Create a new custom emoji" + } + }, + "/custom_emoji/delete": { + "post": { + "tags": [ + "CustomEmoji" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCustomEmoji" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + }, + "summary": "Delete a custom emoji" + } + }, + "/site/block": { + "post": { + "tags": [ + "Site", + "User" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BlockInstance" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BlockInstanceResponse" + } + } + } + } + }, + "summary": "Block an instance." + } + }, + "/user/totp/generate": { + "post": { + "tags": [ + "User" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GenerateTotpSecretResponse" + } + } + } + } + }, + "summary": "Generate a TOTP / two-factor secret.\r\r Afterwards you need to call `/user/totp/update` with a valid token to enable it." + } + }, + "/user/totp/update": { + "post": { + "tags": [ + "User" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTotp" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UpdateTotpResponse" + } + } + } + } + }, + "summary": "Enable / Disable TOTP / two-factor authentication.\r\r To enable, you need to first call `/user/totp/generate` and then pass a valid token to this.\r\r Disabling is only possible if 2FA was previously enabled. Again it is necessary to pass a valid token." + } + }, + "/user/export_settings": { + "get": { + "tags": [ + "User" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ExportUserSettingsResponse" + } + } + } + } + }, + "summary": "Export a backup of your user settings, including your saved content,\r followed communities, and blocks." + } + }, + "/user/import_settings": { + "post": { + "tags": [ + "User" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImportUserSettings" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + }, + "summary": "Import a backup of your user settings." + } + }, + "/user/list_logins": { + "get": { + "tags": [ + "User" + ], + "operationId": "listLogins", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LoginToken" + } + } + } + } + } + }, + "summary": "List login tokens for your user" + } + }, + "/user/validate_auth": { + "get": { + "tags": [ + "User" + ], + "operationId": "validateAuth", + "responses": { + "200": { + "description": "OK" + }, + "401": { + "description": "Unauthorized" + } + }, + "summary": "Returns an error message if your auth token is invalid" + } + }, + "/user/logout": { + "post": { + "security": [ + { + "bearerAuth": [] + }, + { + "cookieAuth": [] + } + ], + "tags": [ + "User" + ], + "operationId": "logout", + "responses": { + "200": { + "description": "OK" + } + }, + "summary": "Invalidate the currently used auth token." + } + }, + "/post/like/list": { + "get": { + "tags": [ + "Admin" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPostLikes" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPostLikesResponse" + } + } + } + } + }, + "summary": "List a post's likes. Admin-only." + } + }, + "/comment/like/list": { + "get": { + "tags": [ + "Admin" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCommentLikes" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCommentLikesResponse" + } + } + } + } + }, + "summary": "List a comment's likes. Admin-only." + } + }, + "/account/list_media": { + "get": { + "tags": [ + "User" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMedia" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMediaResponse" + } + } + } + } + }, + "summary": "List all the media for your user" + } + }, + "/admin/list_all_media": { + "get": { + "tags": [ + "Admin" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMedia" + } + } + } + }, + "operationId": "listAllMedia", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListMediaResponse" + } + } + } + } + }, + "summary": "List all the media known to your instance." + } + }, + "/post/hide": { + "post": { + "tags": [ + "Post" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HidePost" + } + } + } + }, + "responses": { + "200": { + "description": "OK" + } + }, + "summary": "Hide a post from list views." + } + }, + "/admin/registration_application": { + "get": { + "tags": [ + "Admin" + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetRegistrationApplication" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegistrationApplicationResponse" + } + } + } + } + }, + "summary": "Get the application a user submitted when they first registered their account" + } + } + }, + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + }, + "cookieAuth": { + "type": "apiKey", + "in": "cookie", + "name": "auth" + } + }, + "schemas": { + "errorResponseRegistration": { + "properties": { + "error": { + "type": "string", + "enum": [ + "registration_closed", + "email_required", + "registration_application_answer_required", + "passwords_do_not_match", + "captcha_incorrect", + "email_already_exists", + "user_already_exists" + ] + } + } + }, + "errorResponseLogin": { + "properties": { + "error": { + "type": "string", + "enum": [ + "incorrect_login", + "email_not_verified", + "registration_denied", + "registration_application_pending", + "registration_application_is_pending", + "missing_totp_token", + "incorrect_totp_token" + ] + } + } + }, + "ExportUserSettingsResponse": { + "type": "string" + }, + "ImportUserSettings": { + "type": "string" + }, + "SiteId": { + "title": "SiteId", + "type": "integer" + }, + "InstanceId": { + "title": "InstanceId", + "type": "integer" + }, + "Site": { + "properties": { + "id": { + "$ref": "#/components/schemas/SiteId", + "title": "Site.id" + }, + "name": { + "title": "Site.name", + "type": "string" + }, + "sidebar": { + "title": "Site.sidebar", + "type": "string" + }, + "published": { + "title": "Site.published", + "type": "string" + }, + "updated": { + "title": "Site.updated", + "type": "string" + }, + "icon": { + "title": "Site.icon", + "type": "string" + }, + "banner": { + "title": "Site.banner", + "type": "string" + }, + "description": { + "title": "Site.description", + "type": "string" + }, + "actor_id": { + "title": "Site.actor_id", + "type": "string" + }, + "last_refreshed_at": { + "title": "Site.last_refreshed_at", + "type": "string" + }, + "inbox_url": { + "title": "Site.inbox_url", + "type": "string" + }, + "public_key": { + "title": "Site.public_key", + "type": "string" + }, + "instance_id": { + "$ref": "#/components/schemas/InstanceId", + "title": "Site.instance_id" + }, + "content_warning": { + "title": "Site.content_warning", + "type": "string" + } + }, + "required": [ + "id", + "name", + "published", + "actor_id", + "last_refreshed_at", + "inbox_url", + "public_key", + "instance_id" + ], + "additionalProperties": false, + "title": "Site", + "type": "object" + }, + "LocalSiteId": { + "title": "LocalSiteId", + "type": "integer" + }, + "ListingType": { + "enum": [ + "All", + "Local", + "Subscribed", + "ModeratorView" + ], + "title": "ListingType", + "type": "string" + }, + "RegistrationMode": { + "enum": [ + "Closed", + "RequireApplication", + "Open" + ], + "title": "RegistrationMode", + "type": "string" + }, + "PostListingMode": { + "enum": [ + "List", + "Card", + "SmallCard" + ], + "title": "PostListingMode", + "type": "string" + }, + "SortType": { + "enum": [ + "Active", + "Hot", + "New", + "Old", + "TopDay", + "TopWeek", + "TopMonth", + "TopYear", + "TopAll", + "MostComments", + "NewComments", + "TopHour", + "TopSixHour", + "TopTwelveHour", + "TopThreeMonths", + "TopSixMonths", + "TopNineMonths", + "Controversial", + "Scaled" + ], + "title": "SortType", + "type": "string" + }, + "LocalSite": { + "properties": { + "id": { + "$ref": "#/components/schemas/LocalSiteId", + "title": "LocalSite.id" + }, + "site_id": { + "$ref": "#/components/schemas/SiteId", + "title": "LocalSite.site_id" + }, + "site_setup": { + "title": "LocalSite.site_setup", + "type": "boolean" + }, + "enable_downvotes": { + "title": "LocalSite.enable_downvotes", + "type": "boolean" + }, + "enable_nsfw": { + "title": "LocalSite.enable_nsfw", + "type": "boolean" + }, + "community_creation_admin_only": { + "title": "LocalSite.community_creation_admin_only", + "type": "boolean" + }, + "require_email_verification": { + "title": "LocalSite.require_email_verification", + "type": "boolean" + }, + "application_question": { + "title": "LocalSite.application_question", + "type": "string" + }, + "private_instance": { + "title": "LocalSite.private_instance", + "type": "boolean" + }, + "default_theme": { + "title": "LocalSite.default_theme", + "type": "string" + }, + "default_post_listing_type": { + "$ref": "#/components/schemas/ListingType", + "title": "LocalSite.default_post_listing_type" + }, + "legal_information": { + "title": "LocalSite.legal_information", + "type": "string" + }, + "hide_modlog_mod_names": { + "title": "LocalSite.hide_modlog_mod_names", + "type": "boolean" + }, + "application_email_admins": { + "title": "LocalSite.application_email_admins", + "type": "boolean" + }, + "slur_filter_regex": { + "title": "LocalSite.slur_filter_regex", + "type": "string" + }, + "actor_name_max_length": { + "title": "LocalSite.actor_name_max_length", + "type": "integer" + }, + "federation_enabled": { + "title": "LocalSite.federation_enabled", + "type": "boolean" + }, + "captcha_enabled": { + "title": "LocalSite.captcha_enabled", + "type": "boolean" + }, + "captcha_difficulty": { + "title": "LocalSite.captcha_difficulty", + "type": "string" + }, + "published": { + "title": "LocalSite.published", + "type": "string" + }, + "updated": { + "title": "LocalSite.updated", + "type": "string" + }, + "registration_mode": { + "$ref": "#/components/schemas/RegistrationMode", + "title": "LocalSite.registration_mode" + }, + "reports_email_admins": { + "title": "LocalSite.reports_email_admins", + "type": "boolean" + }, + "federation_signed_fetch": { + "title": "LocalSite.federation_signed_fetch", + "type": "boolean" + }, + "default_post_listing_mode": { + "$ref": "#/components/schemas/PostListingMode", + "title": "LocalSite.default_post_listing_mode" + }, + "default_sort_type": { + "$ref": "#/components/schemas/SortType", + "title": "LocalSite.default_sort_type" + } + }, + "required": [ + "id", + "site_id", + "site_setup", + "enable_downvotes", + "enable_nsfw", + "community_creation_admin_only", + "require_email_verification", + "private_instance", + "default_theme", + "default_post_listing_type", + "hide_modlog_mod_names", + "application_email_admins", + "actor_name_max_length", + "federation_enabled", + "captcha_enabled", + "captcha_difficulty", + "published", + "registration_mode", + "reports_email_admins", + "federation_signed_fetch", + "default_post_listing_mode", + "default_sort_type" + ], + "additionalProperties": false, + "title": "LocalSite", + "type": "object" + }, + "LocalSiteRateLimit": { + "properties": { + "local_site_id": { + "$ref": "#/components/schemas/LocalSiteId", + "title": "LocalSiteRateLimit.local_site_id" + }, + "message": { + "title": "LocalSiteRateLimit.message", + "type": "integer" + }, + "message_per_second": { + "title": "LocalSiteRateLimit.message_per_second", + "type": "integer" + }, + "post": { + "title": "LocalSiteRateLimit.post", + "type": "integer" + }, + "post_per_second": { + "title": "LocalSiteRateLimit.post_per_second", + "type": "integer" + }, + "register": { + "title": "LocalSiteRateLimit.register", + "type": "integer" + }, + "register_per_second": { + "title": "LocalSiteRateLimit.register_per_second", + "type": "integer" + }, + "image": { + "title": "LocalSiteRateLimit.image", + "type": "integer" + }, + "image_per_second": { + "title": "LocalSiteRateLimit.image_per_second", + "type": "integer" + }, + "comment": { + "title": "LocalSiteRateLimit.comment", + "type": "integer" + }, + "comment_per_second": { + "title": "LocalSiteRateLimit.comment_per_second", + "type": "integer" + }, + "search": { + "title": "LocalSiteRateLimit.search", + "type": "integer" + }, + "search_per_second": { + "title": "LocalSiteRateLimit.search_per_second", + "type": "integer" + }, + "published": { + "title": "LocalSiteRateLimit.published", + "type": "string" + }, + "updated": { + "title": "LocalSiteRateLimit.updated", + "type": "string" + }, + "import_user_settings": { + "title": "LocalSiteRateLimit.import_user_settings", + "type": "integer" + }, + "import_user_settings_per_second": { + "title": "LocalSiteRateLimit.import_user_settings_per_second", + "type": "integer" + } + }, + "required": [ + "local_site_id", + "message", + "message_per_second", + "post", + "post_per_second", + "register", + "register_per_second", + "image", + "image_per_second", + "comment", + "comment_per_second", + "search", + "search_per_second", + "published", + "import_user_settings", + "import_user_settings_per_second" + ], + "additionalProperties": false, + "title": "LocalSiteRateLimit", + "type": "object" + }, + "SiteAggregates": { + "properties": { + "site_id": { + "$ref": "#/components/schemas/SiteId", + "title": "SiteAggregates.site_id" + }, + "users": { + "title": "SiteAggregates.users", + "type": "integer" + }, + "posts": { + "title": "SiteAggregates.posts", + "type": "integer" + }, + "comments": { + "title": "SiteAggregates.comments", + "type": "integer" + }, + "communities": { + "title": "SiteAggregates.communities", + "type": "integer" + }, + "users_active_day": { + "title": "SiteAggregates.users_active_day", + "type": "integer" + }, + "users_active_week": { + "title": "SiteAggregates.users_active_week", + "type": "integer" + }, + "users_active_month": { + "title": "SiteAggregates.users_active_month", + "type": "integer" + }, + "users_active_half_year": { + "title": "SiteAggregates.users_active_half_year", + "type": "integer" + } + }, + "required": [ + "site_id", + "users", + "posts", + "comments", + "communities", + "users_active_day", + "users_active_week", + "users_active_month", + "users_active_half_year" + ], + "additionalProperties": false, + "title": "SiteAggregates", + "type": "object" + }, + "SiteView": { + "properties": { + "site": { + "$ref": "#/components/schemas/Site", + "title": "SiteView.site" + }, + "local_site": { + "$ref": "#/components/schemas/LocalSite", + "title": "SiteView.local_site" + }, + "local_site_rate_limit": { + "$ref": "#/components/schemas/LocalSiteRateLimit", + "title": "SiteView.local_site_rate_limit" + }, + "counts": { + "$ref": "#/components/schemas/SiteAggregates", + "title": "SiteView.counts" + } + }, + "required": [ + "site", + "local_site", + "local_site_rate_limit", + "counts" + ], + "additionalProperties": false, + "title": "SiteView", + "type": "object" + }, + "PersonId": { + "title": "PersonId", + "type": "integer" + }, + "Person": { + "properties": { + "id": { + "$ref": "#/components/schemas/PersonId", + "title": "Person.id" + }, + "name": { + "title": "Person.name", + "type": "string" + }, + "display_name": { + "title": "Person.display_name", + "type": "string" + }, + "avatar": { + "title": "Person.avatar", + "type": "string" + }, + "banned": { + "title": "Person.banned", + "type": "boolean" + }, + "published": { + "title": "Person.published", + "type": "string" + }, + "updated": { + "title": "Person.updated", + "type": "string" + }, + "actor_id": { + "title": "Person.actor_id", + "type": "string" + }, + "bio": { + "title": "Person.bio", + "type": "string" + }, + "local": { + "title": "Person.local", + "type": "boolean" + }, + "banner": { + "title": "Person.banner", + "type": "string" + }, + "deleted": { + "title": "Person.deleted", + "type": "boolean" + }, + "matrix_user_id": { + "title": "Person.matrix_user_id", + "type": "string" + }, + "bot_account": { + "title": "Person.bot_account", + "type": "boolean" + }, + "ban_expires": { + "title": "Person.ban_expires", + "type": "string" + }, + "instance_id": { + "$ref": "#/components/schemas/InstanceId", + "title": "Person.instance_id" + } + }, + "required": [ + "id", + "name", + "banned", + "published", + "actor_id", + "local", + "deleted", + "bot_account", + "instance_id" + ], + "additionalProperties": false, + "title": "Person", + "type": "object" + }, + "PersonAggregates": { + "properties": { + "person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "PersonAggregates.person_id" + }, + "post_count": { + "title": "PersonAggregates.post_count", + "type": "integer" + }, + "comment_count": { + "title": "PersonAggregates.comment_count", + "type": "integer" + } + }, + "required": [ + "person_id", + "post_count", + "comment_count" + ], + "additionalProperties": false, + "title": "PersonAggregates", + "type": "object" + }, + "PersonView": { + "properties": { + "person": { + "$ref": "#/components/schemas/Person", + "title": "PersonView.person" + }, + "counts": { + "$ref": "#/components/schemas/PersonAggregates", + "title": "PersonView.counts" + }, + "is_admin": { + "title": "PersonView.is_admin", + "type": "boolean" + } + }, + "required": [ + "person", + "counts", + "is_admin" + ], + "additionalProperties": false, + "title": "PersonView", + "type": "object" + }, + "LocalUserId": { + "title": "LocalUserId", + "type": "integer" + }, + "LocalUser": { + "properties": { + "id": { + "$ref": "#/components/schemas/LocalUserId", + "title": "LocalUser.id" + }, + "person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "LocalUser.person_id" + }, + "email": { + "title": "LocalUser.email", + "type": "string" + }, + "show_nsfw": { + "title": "LocalUser.show_nsfw", + "type": "boolean" + }, + "theme": { + "title": "LocalUser.theme", + "type": "string" + }, + "default_sort_type": { + "$ref": "#/components/schemas/SortType", + "title": "LocalUser.default_sort_type" + }, + "default_listing_type": { + "$ref": "#/components/schemas/ListingType", + "title": "LocalUser.default_listing_type" + }, + "interface_language": { + "title": "LocalUser.interface_language", + "type": "string" + }, + "show_avatars": { + "title": "LocalUser.show_avatars", + "type": "boolean" + }, + "send_notifications_to_email": { + "title": "LocalUser.send_notifications_to_email", + "type": "boolean" + }, + "show_scores": { + "title": "LocalUser.show_scores", + "type": "boolean" + }, + "show_bot_accounts": { + "title": "LocalUser.show_bot_accounts", + "type": "boolean" + }, + "show_read_posts": { + "title": "LocalUser.show_read_posts", + "type": "boolean" + }, + "email_verified": { + "title": "LocalUser.email_verified", + "type": "boolean" + }, + "accepted_application": { + "title": "LocalUser.accepted_application", + "type": "boolean" + }, + "open_links_in_new_tab": { + "title": "LocalUser.open_links_in_new_tab", + "type": "boolean" + }, + "blur_nsfw": { + "title": "LocalUser.blur_nsfw", + "type": "boolean" + }, + "auto_expand": { + "title": "LocalUser.auto_expand", + "type": "boolean" + }, + "infinite_scroll_enabled": { + "title": "LocalUser.infinite_scroll_enabled", + "type": "boolean" + }, + "admin": { + "title": "LocalUser.admin", + "type": "boolean" + }, + "post_listing_mode": { + "$ref": "#/components/schemas/PostListingMode", + "title": "LocalUser.post_listing_mode" + }, + "totp_2fa_enabled": { + "title": "LocalUser.totp_2fa_enabled", + "type": "boolean" + }, + "enable_keyboard_navigation": { + "title": "LocalUser.enable_keyboard_navigation", + "type": "boolean" + }, + "enable_animated_images": { + "title": "LocalUser.enable_animated_images", + "type": "boolean" + }, + "collapse_bot_comments": { + "title": "LocalUser.collapse_bot_comments", + "type": "boolean" + }, + "last_donation_notification": { + "title": "LocalUser.last_donation_notification", + "type": "string" + } + }, + "required": [ + "id", + "person_id", + "show_nsfw", + "theme", + "default_sort_type", + "default_listing_type", + "interface_language", + "show_avatars", + "send_notifications_to_email", + "show_scores", + "show_bot_accounts", + "show_read_posts", + "email_verified", + "accepted_application", + "open_links_in_new_tab", + "blur_nsfw", + "auto_expand", + "infinite_scroll_enabled", + "admin", + "post_listing_mode", + "totp_2fa_enabled", + "enable_keyboard_navigation", + "enable_animated_images", + "collapse_bot_comments", + "last_donation_notification" + ], + "additionalProperties": false, + "title": "LocalUser", + "type": "object" + }, + "LocalUserVoteDisplayMode": { + "properties": { + "local_user_id": { + "$ref": "#/components/schemas/LocalUserId", + "title": "LocalUserVoteDisplayMode.local_user_id" + }, + "score": { + "title": "LocalUserVoteDisplayMode.score", + "type": "boolean" + }, + "upvotes": { + "title": "LocalUserVoteDisplayMode.upvotes", + "type": "boolean" + }, + "downvotes": { + "title": "LocalUserVoteDisplayMode.downvotes", + "type": "boolean" + }, + "upvote_percentage": { + "title": "LocalUserVoteDisplayMode.upvote_percentage", + "type": "boolean" + } + }, + "required": [ + "local_user_id", + "score", + "upvotes", + "downvotes", + "upvote_percentage" + ], + "additionalProperties": false, + "title": "LocalUserVoteDisplayMode", + "type": "object" + }, + "LocalUserView": { + "properties": { + "local_user": { + "$ref": "#/components/schemas/LocalUser", + "title": "LocalUserView.local_user" + }, + "local_user_vote_display_mode": { + "$ref": "#/components/schemas/LocalUserVoteDisplayMode", + "title": "LocalUserView.local_user_vote_display_mode" + }, + "person": { + "$ref": "#/components/schemas/Person", + "title": "LocalUserView.person" + }, + "counts": { + "$ref": "#/components/schemas/PersonAggregates", + "title": "LocalUserView.counts" + } + }, + "required": [ + "local_user", + "local_user_vote_display_mode", + "person", + "counts" + ], + "additionalProperties": false, + "title": "LocalUserView", + "type": "object" + }, + "CommunityId": { + "title": "CommunityId", + "type": "integer" + }, + "CommunityVisibility": { + "enum": [ + "Public", + "LocalOnly" + ], + "title": "CommunityVisibility", + "type": "string" + }, + "Community": { + "properties": { + "id": { + "$ref": "#/components/schemas/CommunityId", + "title": "Community.id" + }, + "name": { + "title": "Community.name", + "type": "string" + }, + "title": { + "title": "Community.title", + "type": "string" + }, + "description": { + "title": "Community.description", + "type": "string" + }, + "removed": { + "title": "Community.removed", + "type": "boolean" + }, + "published": { + "title": "Community.published", + "type": "string" + }, + "updated": { + "title": "Community.updated", + "type": "string" + }, + "deleted": { + "title": "Community.deleted", + "type": "boolean" + }, + "nsfw": { + "title": "Community.nsfw", + "type": "boolean" + }, + "actor_id": { + "title": "Community.actor_id", + "type": "string" + }, + "local": { + "title": "Community.local", + "type": "boolean" + }, + "icon": { + "title": "Community.icon", + "type": "string" + }, + "banner": { + "title": "Community.banner", + "type": "string" + }, + "hidden": { + "title": "Community.hidden", + "type": "boolean" + }, + "posting_restricted_to_mods": { + "title": "Community.posting_restricted_to_mods", + "type": "boolean" + }, + "instance_id": { + "$ref": "#/components/schemas/InstanceId", + "title": "Community.instance_id" + }, + "visibility": { + "$ref": "#/components/schemas/CommunityVisibility", + "title": "Community.visibility" + } + }, + "required": [ + "id", + "name", + "title", + "removed", + "published", + "deleted", + "nsfw", + "actor_id", + "local", + "hidden", + "posting_restricted_to_mods", + "instance_id", + "visibility" + ], + "additionalProperties": false, + "title": "Community", + "type": "object" + }, + "CommunityFollowerView": { + "properties": { + "community": { + "$ref": "#/components/schemas/Community", + "title": "CommunityFollowerView.community" + }, + "follower": { + "$ref": "#/components/schemas/Person", + "title": "CommunityFollowerView.follower" + } + }, + "required": [ + "community", + "follower" + ], + "additionalProperties": false, + "title": "CommunityFollowerView", + "type": "object" + }, + "CommunityModeratorView": { + "properties": { + "community": { + "$ref": "#/components/schemas/Community", + "title": "CommunityModeratorView.community" + }, + "moderator": { + "$ref": "#/components/schemas/Person", + "title": "CommunityModeratorView.moderator" + } + }, + "required": [ + "community", + "moderator" + ], + "additionalProperties": false, + "title": "CommunityModeratorView", + "type": "object" + }, + "CommunityBlockView": { + "properties": { + "person": { + "$ref": "#/components/schemas/Person", + "title": "CommunityBlockView.person" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "CommunityBlockView.community" + } + }, + "required": [ + "person", + "community" + ], + "additionalProperties": false, + "title": "CommunityBlockView", + "type": "object" + }, + "Instance": { + "properties": { + "id": { + "$ref": "#/components/schemas/InstanceId", + "title": "Instance.id" + }, + "domain": { + "title": "Instance.domain", + "type": "string" + }, + "published": { + "title": "Instance.published", + "type": "string" + }, + "updated": { + "title": "Instance.updated", + "type": "string" + }, + "software": { + "title": "Instance.software", + "type": "string" + }, + "version": { + "title": "Instance.version", + "type": "string" + } + }, + "required": [ + "id", + "domain", + "published" + ], + "additionalProperties": false, + "title": "Instance", + "type": "object" + }, + "InstanceBlockView": { + "properties": { + "person": { + "$ref": "#/components/schemas/Person", + "title": "InstanceBlockView.person" + }, + "instance": { + "$ref": "#/components/schemas/Instance", + "title": "InstanceBlockView.instance" + }, + "site": { + "$ref": "#/components/schemas/Site", + "title": "InstanceBlockView.site" + } + }, + "required": [ + "person", + "instance" + ], + "additionalProperties": false, + "title": "InstanceBlockView", + "type": "object" + }, + "PersonBlockView": { + "properties": { + "person": { + "$ref": "#/components/schemas/Person", + "title": "PersonBlockView.person" + }, + "target": { + "$ref": "#/components/schemas/Person", + "title": "PersonBlockView.target" + } + }, + "required": [ + "person", + "target" + ], + "additionalProperties": false, + "title": "PersonBlockView", + "type": "object" + }, + "LanguageId": { + "title": "LanguageId", + "type": "integer" + }, + "MyUserInfo": { + "properties": { + "local_user_view": { + "$ref": "#/components/schemas/LocalUserView", + "title": "MyUserInfo.local_user_view" + }, + "follows": { + "items": { + "$ref": "#/components/schemas/CommunityFollowerView" + }, + "title": "MyUserInfo.follows", + "type": "array" + }, + "moderates": { + "items": { + "$ref": "#/components/schemas/CommunityModeratorView" + }, + "title": "MyUserInfo.moderates", + "type": "array" + }, + "community_blocks": { + "items": { + "$ref": "#/components/schemas/CommunityBlockView" + }, + "title": "MyUserInfo.community_blocks", + "type": "array" + }, + "instance_blocks": { + "items": { + "$ref": "#/components/schemas/InstanceBlockView" + }, + "title": "MyUserInfo.instance_blocks", + "type": "array" + }, + "person_blocks": { + "items": { + "$ref": "#/components/schemas/PersonBlockView" + }, + "title": "MyUserInfo.person_blocks", + "type": "array" + }, + "discussion_languages": { + "items": { + "$ref": "#/components/schemas/LanguageId" + }, + "title": "MyUserInfo.discussion_languages", + "type": "array" + } + }, + "required": [ + "local_user_view", + "follows", + "moderates", + "community_blocks", + "instance_blocks", + "person_blocks", + "discussion_languages" + ], + "additionalProperties": false, + "title": "MyUserInfo", + "type": "object" + }, + "Language": { + "properties": { + "id": { + "$ref": "#/components/schemas/LanguageId", + "title": "Language.id" + }, + "code": { + "title": "Language.code", + "type": "string" + }, + "name": { + "title": "Language.name", + "type": "string" + } + }, + "required": [ + "id", + "code", + "name" + ], + "additionalProperties": false, + "title": "Language", + "type": "object" + }, + "Tagline": { + "properties": { + "id": { + "title": "Tagline.id", + "type": "integer" + }, + "local_site_id": { + "$ref": "#/components/schemas/LocalSiteId", + "title": "Tagline.local_site_id" + }, + "content": { + "title": "Tagline.content", + "type": "string" + }, + "published": { + "title": "Tagline.published", + "type": "string" + }, + "updated": { + "title": "Tagline.updated", + "type": "string" + } + }, + "required": [ + "id", + "local_site_id", + "content", + "published" + ], + "additionalProperties": false, + "title": "Tagline", + "type": "object" + }, + "CustomEmojiId": { + "title": "CustomEmojiId", + "type": "integer" + }, + "CustomEmoji": { + "properties": { + "id": { + "$ref": "#/components/schemas/CustomEmojiId", + "title": "CustomEmoji.id" + }, + "local_site_id": { + "$ref": "#/components/schemas/LocalSiteId", + "title": "CustomEmoji.local_site_id" + }, + "shortcode": { + "title": "CustomEmoji.shortcode", + "type": "string" + }, + "image_url": { + "title": "CustomEmoji.image_url", + "type": "string" + }, + "alt_text": { + "title": "CustomEmoji.alt_text", + "type": "string" + }, + "category": { + "title": "CustomEmoji.category", + "type": "string" + }, + "published": { + "title": "CustomEmoji.published", + "type": "string" + }, + "updated": { + "title": "CustomEmoji.updated", + "type": "string" + } + }, + "required": [ + "id", + "local_site_id", + "shortcode", + "image_url", + "alt_text", + "category", + "published" + ], + "additionalProperties": false, + "title": "CustomEmoji", + "type": "object" + }, + "CustomEmojiKeyword": { + "properties": { + "custom_emoji_id": { + "$ref": "#/components/schemas/CustomEmojiId", + "title": "CustomEmojiKeyword.custom_emoji_id" + }, + "keyword": { + "title": "CustomEmojiKeyword.keyword", + "type": "string" + } + }, + "required": [ + "custom_emoji_id", + "keyword" + ], + "additionalProperties": false, + "title": "CustomEmojiKeyword", + "type": "object" + }, + "CustomEmojiView": { + "properties": { + "custom_emoji": { + "$ref": "#/components/schemas/CustomEmoji", + "title": "CustomEmojiView.custom_emoji" + }, + "keywords": { + "items": { + "$ref": "#/components/schemas/CustomEmojiKeyword" + }, + "title": "CustomEmojiView.keywords", + "type": "array" + } + }, + "required": [ + "custom_emoji", + "keywords" + ], + "additionalProperties": false, + "title": "CustomEmojiView", + "type": "object" + }, + "LocalSiteUrlBlocklist": { + "properties": { + "id": { + "title": "LocalSiteUrlBlocklist.id", + "type": "integer" + }, + "url": { + "title": "LocalSiteUrlBlocklist.url", + "type": "string" + }, + "published": { + "title": "LocalSiteUrlBlocklist.published", + "type": "string" + }, + "updated": { + "title": "LocalSiteUrlBlocklist.updated", + "type": "string" + } + }, + "required": [ + "id", + "url", + "published" + ], + "additionalProperties": false, + "title": "LocalSiteUrlBlocklist", + "type": "object" + }, + "GetSiteResponse": { + "properties": { + "site_view": { + "$ref": "#/components/schemas/SiteView", + "title": "GetSiteResponse.site_view" + }, + "admins": { + "items": { + "$ref": "#/components/schemas/PersonView" + }, + "title": "GetSiteResponse.admins", + "type": "array" + }, + "version": { + "title": "GetSiteResponse.version", + "type": "string" + }, + "my_user": { + "$ref": "#/components/schemas/MyUserInfo", + "title": "GetSiteResponse.my_user" + }, + "all_languages": { + "items": { + "$ref": "#/components/schemas/Language" + }, + "title": "GetSiteResponse.all_languages", + "type": "array" + }, + "discussion_languages": { + "items": { + "$ref": "#/components/schemas/LanguageId" + }, + "title": "GetSiteResponse.discussion_languages", + "type": "array" + }, + "taglines": { + "items": { + "$ref": "#/components/schemas/Tagline" + }, + "title": "GetSiteResponse.taglines", + "type": "array" + }, + "custom_emojis": { + "items": { + "$ref": "#/components/schemas/CustomEmojiView" + }, + "title": "GetSiteResponse.custom_emojis", + "type": "array" + }, + "blocked_urls": { + "items": { + "$ref": "#/components/schemas/LocalSiteUrlBlocklist" + }, + "title": "GetSiteResponse.blocked_urls", + "type": "array" + } + }, + "required": [ + "site_view", + "admins", + "version", + "all_languages", + "discussion_languages", + "taglines", + "custom_emojis", + "blocked_urls" + ], + "additionalProperties": false, + "title": "GetSiteResponse", + "type": "object" + }, + "EditSite": { + "properties": { + "name": { + "title": "EditSite.name", + "type": "string" + }, + "sidebar": { + "title": "EditSite.sidebar", + "type": "string" + }, + "description": { + "title": "EditSite.description", + "type": "string" + }, + "icon": { + "title": "EditSite.icon", + "type": "string" + }, + "banner": { + "title": "EditSite.banner", + "type": "string" + }, + "enable_downvotes": { + "title": "EditSite.enable_downvotes", + "type": "boolean" + }, + "enable_nsfw": { + "title": "EditSite.enable_nsfw", + "type": "boolean" + }, + "community_creation_admin_only": { + "title": "EditSite.community_creation_admin_only", + "type": "boolean" + }, + "require_email_verification": { + "title": "EditSite.require_email_verification", + "type": "boolean" + }, + "application_question": { + "title": "EditSite.application_question", + "type": "string" + }, + "private_instance": { + "title": "EditSite.private_instance", + "type": "boolean" + }, + "default_theme": { + "title": "EditSite.default_theme", + "type": "string" + }, + "default_post_listing_type": { + "$ref": "#/components/schemas/ListingType", + "title": "EditSite.default_post_listing_type" + }, + "default_sort_type": { + "$ref": "#/components/schemas/SortType", + "title": "EditSite.default_sort_type" + }, + "legal_information": { + "title": "EditSite.legal_information", + "type": "string" + }, + "application_email_admins": { + "title": "EditSite.application_email_admins", + "type": "boolean" + }, + "hide_modlog_mod_names": { + "title": "EditSite.hide_modlog_mod_names", + "type": "boolean" + }, + "discussion_languages": { + "items": { + "$ref": "#/components/schemas/LanguageId" + }, + "title": "EditSite.discussion_languages", + "type": "array" + }, + "slur_filter_regex": { + "title": "EditSite.slur_filter_regex", + "type": "string" + }, + "actor_name_max_length": { + "title": "EditSite.actor_name_max_length", + "type": "integer" + }, + "rate_limit_message": { + "title": "EditSite.rate_limit_message", + "type": "integer" + }, + "rate_limit_message_per_second": { + "title": "EditSite.rate_limit_message_per_second", + "type": "integer" + }, + "rate_limit_post": { + "title": "EditSite.rate_limit_post", + "type": "integer" + }, + "rate_limit_post_per_second": { + "title": "EditSite.rate_limit_post_per_second", + "type": "integer" + }, + "rate_limit_register": { + "title": "EditSite.rate_limit_register", + "type": "integer" + }, + "rate_limit_register_per_second": { + "title": "EditSite.rate_limit_register_per_second", + "type": "integer" + }, + "rate_limit_image": { + "title": "EditSite.rate_limit_image", + "type": "integer" + }, + "rate_limit_image_per_second": { + "title": "EditSite.rate_limit_image_per_second", + "type": "integer" + }, + "rate_limit_comment": { + "title": "EditSite.rate_limit_comment", + "type": "integer" + }, + "rate_limit_comment_per_second": { + "title": "EditSite.rate_limit_comment_per_second", + "type": "integer" + }, + "rate_limit_search": { + "title": "EditSite.rate_limit_search", + "type": "integer" + }, + "rate_limit_search_per_second": { + "title": "EditSite.rate_limit_search_per_second", + "type": "integer" + }, + "federation_enabled": { + "title": "EditSite.federation_enabled", + "type": "boolean" + }, + "federation_debug": { + "title": "EditSite.federation_debug", + "type": "boolean" + }, + "captcha_enabled": { + "title": "EditSite.captcha_enabled", + "type": "boolean" + }, + "captcha_difficulty": { + "title": "EditSite.captcha_difficulty", + "type": "string" + }, + "allowed_instances": { + "items": { + "type": "string" + }, + "title": "EditSite.allowed_instances", + "type": "array" + }, + "blocked_instances": { + "items": { + "type": "string" + }, + "title": "EditSite.blocked_instances", + "type": "array" + }, + "blocked_urls": { + "items": { + "type": "string" + }, + "title": "EditSite.blocked_urls", + "type": "array" + }, + "taglines": { + "items": { + "type": "string" + }, + "title": "EditSite.taglines", + "type": "array" + }, + "registration_mode": { + "$ref": "#/components/schemas/RegistrationMode", + "title": "EditSite.registration_mode" + }, + "reports_email_admins": { + "title": "EditSite.reports_email_admins", + "type": "boolean" + }, + "content_warning": { + "title": "EditSite.content_warning", + "type": "string" + }, + "default_post_listing_mode": { + "$ref": "#/components/schemas/PostListingMode", + "title": "EditSite.default_post_listing_mode" + } + }, + "additionalProperties": false, + "title": "EditSite", + "type": "object" + }, + "SiteResponse": { + "properties": { + "site_view": { + "$ref": "#/components/schemas/SiteView", + "title": "SiteResponse.site_view" + }, + "taglines": { + "items": { + "$ref": "#/components/schemas/Tagline" + }, + "title": "SiteResponse.taglines", + "type": "array" + } + }, + "required": [ + "site_view", + "taglines" + ], + "additionalProperties": false, + "title": "SiteResponse", + "type": "object" + }, + "CreateSite": { + "properties": { + "name": { + "title": "CreateSite.name", + "type": "string" + }, + "sidebar": { + "title": "CreateSite.sidebar", + "type": "string" + }, + "description": { + "title": "CreateSite.description", + "type": "string" + }, + "icon": { + "title": "CreateSite.icon", + "type": "string" + }, + "banner": { + "title": "CreateSite.banner", + "type": "string" + }, + "enable_downvotes": { + "title": "CreateSite.enable_downvotes", + "type": "boolean" + }, + "enable_nsfw": { + "title": "CreateSite.enable_nsfw", + "type": "boolean" + }, + "community_creation_admin_only": { + "title": "CreateSite.community_creation_admin_only", + "type": "boolean" + }, + "require_email_verification": { + "title": "CreateSite.require_email_verification", + "type": "boolean" + }, + "application_question": { + "title": "CreateSite.application_question", + "type": "string" + }, + "private_instance": { + "title": "CreateSite.private_instance", + "type": "boolean" + }, + "default_theme": { + "title": "CreateSite.default_theme", + "type": "string" + }, + "default_post_listing_type": { + "$ref": "#/components/schemas/ListingType", + "title": "CreateSite.default_post_listing_type" + }, + "default_sort_type": { + "$ref": "#/components/schemas/SortType", + "title": "CreateSite.default_sort_type" + }, + "legal_information": { + "title": "CreateSite.legal_information", + "type": "string" + }, + "application_email_admins": { + "title": "CreateSite.application_email_admins", + "type": "boolean" + }, + "hide_modlog_mod_names": { + "title": "CreateSite.hide_modlog_mod_names", + "type": "boolean" + }, + "discussion_languages": { + "items": { + "$ref": "#/components/schemas/LanguageId" + }, + "title": "CreateSite.discussion_languages", + "type": "array" + }, + "slur_filter_regex": { + "title": "CreateSite.slur_filter_regex", + "type": "string" + }, + "actor_name_max_length": { + "title": "CreateSite.actor_name_max_length", + "type": "integer" + }, + "rate_limit_message": { + "title": "CreateSite.rate_limit_message", + "type": "integer" + }, + "rate_limit_message_per_second": { + "title": "CreateSite.rate_limit_message_per_second", + "type": "integer" + }, + "rate_limit_post": { + "title": "CreateSite.rate_limit_post", + "type": "integer" + }, + "rate_limit_post_per_second": { + "title": "CreateSite.rate_limit_post_per_second", + "type": "integer" + }, + "rate_limit_register": { + "title": "CreateSite.rate_limit_register", + "type": "integer" + }, + "rate_limit_register_per_second": { + "title": "CreateSite.rate_limit_register_per_second", + "type": "integer" + }, + "rate_limit_image": { + "title": "CreateSite.rate_limit_image", + "type": "integer" + }, + "rate_limit_image_per_second": { + "title": "CreateSite.rate_limit_image_per_second", + "type": "integer" + }, + "rate_limit_comment": { + "title": "CreateSite.rate_limit_comment", + "type": "integer" + }, + "rate_limit_comment_per_second": { + "title": "CreateSite.rate_limit_comment_per_second", + "type": "integer" + }, + "rate_limit_search": { + "title": "CreateSite.rate_limit_search", + "type": "integer" + }, + "rate_limit_search_per_second": { + "title": "CreateSite.rate_limit_search_per_second", + "type": "integer" + }, + "federation_enabled": { + "title": "CreateSite.federation_enabled", + "type": "boolean" + }, + "federation_debug": { + "title": "CreateSite.federation_debug", + "type": "boolean" + }, + "captcha_enabled": { + "title": "CreateSite.captcha_enabled", + "type": "boolean" + }, + "captcha_difficulty": { + "title": "CreateSite.captcha_difficulty", + "type": "string" + }, + "allowed_instances": { + "items": { + "type": "string" + }, + "title": "CreateSite.allowed_instances", + "type": "array" + }, + "blocked_instances": { + "items": { + "type": "string" + }, + "title": "CreateSite.blocked_instances", + "type": "array" + }, + "taglines": { + "items": { + "type": "string" + }, + "title": "CreateSite.taglines", + "type": "array" + }, + "registration_mode": { + "$ref": "#/components/schemas/RegistrationMode", + "title": "CreateSite.registration_mode" + }, + "content_warning": { + "title": "CreateSite.content_warning", + "type": "string" + }, + "default_post_listing_mode": { + "$ref": "#/components/schemas/PostListingMode", + "title": "CreateSite.default_post_listing_mode" + } + }, + "required": [ + "name" + ], + "additionalProperties": false, + "title": "CreateSite", + "type": "object" + }, + "ModlogActionType": { + "enum": [ + "All", + "ModRemovePost", + "ModLockPost", + "ModFeaturePost", + "ModRemoveComment", + "ModRemoveCommunity", + "ModBanFromCommunity", + "ModAddCommunity", + "ModTransferCommunity", + "ModAdd", + "ModBan", + "ModHideCommunity", + "AdminPurgePerson", + "AdminPurgeCommunity", + "AdminPurgePost", + "AdminPurgeComment" + ], + "title": "ModlogActionType", + "type": "string" + }, + "PostId": { + "title": "PostId", + "type": "integer" + }, + "CommentId": { + "title": "CommentId", + "type": "integer" + }, + "GetModlog": { + "properties": { + "mod_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "GetModlog.mod_person_id" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "GetModlog.community_id" + }, + "page": { + "title": "GetModlog.page", + "type": "integer" + }, + "limit": { + "title": "GetModlog.limit", + "type": "integer" + }, + "type_": { + "$ref": "#/components/schemas/ModlogActionType", + "title": "GetModlog.type_" + }, + "other_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "GetModlog.other_person_id" + }, + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "GetModlog.post_id" + }, + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "GetModlog.comment_id" + } + }, + "additionalProperties": false, + "title": "GetModlog", + "type": "object" + }, + "ModRemovePost": { + "properties": { + "id": { + "title": "ModRemovePost.id", + "type": "integer" + }, + "mod_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModRemovePost.mod_person_id" + }, + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "ModRemovePost.post_id" + }, + "reason": { + "title": "ModRemovePost.reason", + "type": "string" + }, + "removed": { + "title": "ModRemovePost.removed", + "type": "boolean" + }, + "when_": { + "title": "ModRemovePost.when_", + "type": "string" + } + }, + "required": [ + "id", + "mod_person_id", + "post_id", + "removed", + "when_" + ], + "additionalProperties": false, + "title": "ModRemovePost", + "type": "object" + }, + "Post": { + "properties": { + "id": { + "$ref": "#/components/schemas/PostId", + "title": "Post.id" + }, + "name": { + "title": "Post.name", + "type": "string" + }, + "url": { + "title": "Post.url", + "type": "string" + }, + "body": { + "title": "Post.body", + "type": "string" + }, + "creator_id": { + "$ref": "#/components/schemas/PersonId", + "title": "Post.creator_id" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "Post.community_id" + }, + "removed": { + "title": "Post.removed", + "type": "boolean" + }, + "locked": { + "title": "Post.locked", + "type": "boolean" + }, + "published": { + "title": "Post.published", + "type": "string" + }, + "updated": { + "title": "Post.updated", + "type": "string" + }, + "deleted": { + "title": "Post.deleted", + "type": "boolean" + }, + "nsfw": { + "title": "Post.nsfw", + "type": "boolean" + }, + "embed_title": { + "title": "Post.embed_title", + "type": "string" + }, + "embed_description": { + "title": "Post.embed_description", + "type": "string" + }, + "thumbnail_url": { + "title": "Post.thumbnail_url", + "type": "string" + }, + "ap_id": { + "title": "Post.ap_id", + "type": "string" + }, + "local": { + "title": "Post.local", + "type": "boolean" + }, + "embed_video_url": { + "title": "Post.embed_video_url", + "type": "string" + }, + "language_id": { + "$ref": "#/components/schemas/LanguageId", + "title": "Post.language_id" + }, + "featured_community": { + "title": "Post.featured_community", + "type": "boolean" + }, + "featured_local": { + "title": "Post.featured_local", + "type": "boolean" + }, + "url_content_type": { + "title": "Post.url_content_type", + "type": "string" + }, + "alt_text": { + "title": "Post.alt_text", + "type": "string" + } + }, + "required": [ + "id", + "name", + "creator_id", + "community_id", + "removed", + "locked", + "published", + "deleted", + "nsfw", + "ap_id", + "local", + "language_id", + "featured_community", + "featured_local" + ], + "additionalProperties": false, + "title": "Post", + "type": "object" + }, + "ModRemovePostView": { + "properties": { + "mod_remove_post": { + "$ref": "#/components/schemas/ModRemovePost", + "title": "ModRemovePostView.mod_remove_post" + }, + "moderator": { + "$ref": "#/components/schemas/Person", + "title": "ModRemovePostView.moderator" + }, + "post": { + "$ref": "#/components/schemas/Post", + "title": "ModRemovePostView.post" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "ModRemovePostView.community" + } + }, + "required": [ + "mod_remove_post", + "post", + "community" + ], + "additionalProperties": false, + "title": "ModRemovePostView", + "type": "object" + }, + "ModLockPost": { + "properties": { + "id": { + "title": "ModLockPost.id", + "type": "integer" + }, + "mod_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModLockPost.mod_person_id" + }, + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "ModLockPost.post_id" + }, + "locked": { + "title": "ModLockPost.locked", + "type": "boolean" + }, + "when_": { + "title": "ModLockPost.when_", + "type": "string" + } + }, + "required": [ + "id", + "mod_person_id", + "post_id", + "locked", + "when_" + ], + "additionalProperties": false, + "title": "ModLockPost", + "type": "object" + }, + "ModLockPostView": { + "properties": { + "mod_lock_post": { + "$ref": "#/components/schemas/ModLockPost", + "title": "ModLockPostView.mod_lock_post" + }, + "moderator": { + "$ref": "#/components/schemas/Person", + "title": "ModLockPostView.moderator" + }, + "post": { + "$ref": "#/components/schemas/Post", + "title": "ModLockPostView.post" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "ModLockPostView.community" + } + }, + "required": [ + "mod_lock_post", + "post", + "community" + ], + "additionalProperties": false, + "title": "ModLockPostView", + "type": "object" + }, + "ModFeaturePost": { + "properties": { + "id": { + "title": "ModFeaturePost.id", + "type": "integer" + }, + "mod_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModFeaturePost.mod_person_id" + }, + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "ModFeaturePost.post_id" + }, + "featured": { + "title": "ModFeaturePost.featured", + "type": "boolean" + }, + "when_": { + "title": "ModFeaturePost.when_", + "type": "string" + }, + "is_featured_community": { + "title": "ModFeaturePost.is_featured_community", + "type": "boolean" + } + }, + "required": [ + "id", + "mod_person_id", + "post_id", + "featured", + "when_", + "is_featured_community" + ], + "additionalProperties": false, + "title": "ModFeaturePost", + "type": "object" + }, + "ModFeaturePostView": { + "properties": { + "mod_feature_post": { + "$ref": "#/components/schemas/ModFeaturePost", + "title": "ModFeaturePostView.mod_feature_post" + }, + "moderator": { + "$ref": "#/components/schemas/Person", + "title": "ModFeaturePostView.moderator" + }, + "post": { + "$ref": "#/components/schemas/Post", + "title": "ModFeaturePostView.post" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "ModFeaturePostView.community" + } + }, + "required": [ + "mod_feature_post", + "post", + "community" + ], + "additionalProperties": false, + "title": "ModFeaturePostView", + "type": "object" + }, + "ModRemoveComment": { + "properties": { + "id": { + "title": "ModRemoveComment.id", + "type": "integer" + }, + "mod_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModRemoveComment.mod_person_id" + }, + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "ModRemoveComment.comment_id" + }, + "reason": { + "title": "ModRemoveComment.reason", + "type": "string" + }, + "removed": { + "title": "ModRemoveComment.removed", + "type": "boolean" + }, + "when_": { + "title": "ModRemoveComment.when_", + "type": "string" + } + }, + "required": [ + "id", + "mod_person_id", + "comment_id", + "removed", + "when_" + ], + "additionalProperties": false, + "title": "ModRemoveComment", + "type": "object" + }, + "Comment": { + "properties": { + "id": { + "$ref": "#/components/schemas/CommentId", + "title": "Comment.id" + }, + "creator_id": { + "$ref": "#/components/schemas/PersonId", + "title": "Comment.creator_id" + }, + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "Comment.post_id" + }, + "content": { + "title": "Comment.content", + "type": "string" + }, + "removed": { + "title": "Comment.removed", + "type": "boolean" + }, + "published": { + "title": "Comment.published", + "type": "string" + }, + "updated": { + "title": "Comment.updated", + "type": "string" + }, + "deleted": { + "title": "Comment.deleted", + "type": "boolean" + }, + "ap_id": { + "title": "Comment.ap_id", + "type": "string" + }, + "local": { + "title": "Comment.local", + "type": "boolean" + }, + "path": { + "title": "Comment.path", + "type": "string" + }, + "distinguished": { + "title": "Comment.distinguished", + "type": "boolean" + }, + "language_id": { + "$ref": "#/components/schemas/LanguageId", + "title": "Comment.language_id" + } + }, + "required": [ + "id", + "creator_id", + "post_id", + "content", + "removed", + "published", + "deleted", + "ap_id", + "local", + "path", + "distinguished", + "language_id" + ], + "additionalProperties": false, + "title": "Comment", + "type": "object" + }, + "ModRemoveCommentView": { + "properties": { + "mod_remove_comment": { + "$ref": "#/components/schemas/ModRemoveComment", + "title": "ModRemoveCommentView.mod_remove_comment" + }, + "moderator": { + "$ref": "#/components/schemas/Person", + "title": "ModRemoveCommentView.moderator" + }, + "comment": { + "$ref": "#/components/schemas/Comment", + "title": "ModRemoveCommentView.comment" + }, + "commenter": { + "$ref": "#/components/schemas/Person", + "title": "ModRemoveCommentView.commenter" + }, + "post": { + "$ref": "#/components/schemas/Post", + "title": "ModRemoveCommentView.post" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "ModRemoveCommentView.community" + } + }, + "required": [ + "mod_remove_comment", + "comment", + "commenter", + "post", + "community" + ], + "additionalProperties": false, + "title": "ModRemoveCommentView", + "type": "object" + }, + "ModRemoveCommunity": { + "properties": { + "id": { + "title": "ModRemoveCommunity.id", + "type": "integer" + }, + "mod_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModRemoveCommunity.mod_person_id" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "ModRemoveCommunity.community_id" + }, + "reason": { + "title": "ModRemoveCommunity.reason", + "type": "string" + }, + "removed": { + "title": "ModRemoveCommunity.removed", + "type": "boolean" + }, + "when_": { + "title": "ModRemoveCommunity.when_", + "type": "string" + } + }, + "required": [ + "id", + "mod_person_id", + "community_id", + "removed", + "when_" + ], + "additionalProperties": false, + "title": "ModRemoveCommunity", + "type": "object" + }, + "ModRemoveCommunityView": { + "properties": { + "mod_remove_community": { + "$ref": "#/components/schemas/ModRemoveCommunity", + "title": "ModRemoveCommunityView.mod_remove_community" + }, + "moderator": { + "$ref": "#/components/schemas/Person", + "title": "ModRemoveCommunityView.moderator" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "ModRemoveCommunityView.community" + } + }, + "required": [ + "mod_remove_community", + "community" + ], + "additionalProperties": false, + "title": "ModRemoveCommunityView", + "type": "object" + }, + "ModBanFromCommunity": { + "properties": { + "id": { + "title": "ModBanFromCommunity.id", + "type": "integer" + }, + "mod_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModBanFromCommunity.mod_person_id" + }, + "other_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModBanFromCommunity.other_person_id" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "ModBanFromCommunity.community_id" + }, + "reason": { + "title": "ModBanFromCommunity.reason", + "type": "string" + }, + "banned": { + "title": "ModBanFromCommunity.banned", + "type": "boolean" + }, + "expires": { + "title": "ModBanFromCommunity.expires", + "type": "string" + }, + "when_": { + "title": "ModBanFromCommunity.when_", + "type": "string" + } + }, + "required": [ + "id", + "mod_person_id", + "other_person_id", + "community_id", + "banned", + "when_" + ], + "additionalProperties": false, + "title": "ModBanFromCommunity", + "type": "object" + }, + "ModBanFromCommunityView": { + "properties": { + "mod_ban_from_community": { + "$ref": "#/components/schemas/ModBanFromCommunity", + "title": "ModBanFromCommunityView.mod_ban_from_community" + }, + "moderator": { + "$ref": "#/components/schemas/Person", + "title": "ModBanFromCommunityView.moderator" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "ModBanFromCommunityView.community" + }, + "banned_person": { + "$ref": "#/components/schemas/Person", + "title": "ModBanFromCommunityView.banned_person" + } + }, + "required": [ + "mod_ban_from_community", + "community", + "banned_person" + ], + "additionalProperties": false, + "title": "ModBanFromCommunityView", + "type": "object" + }, + "ModBan": { + "properties": { + "id": { + "title": "ModBan.id", + "type": "integer" + }, + "mod_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModBan.mod_person_id" + }, + "other_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModBan.other_person_id" + }, + "reason": { + "title": "ModBan.reason", + "type": "string" + }, + "banned": { + "title": "ModBan.banned", + "type": "boolean" + }, + "expires": { + "title": "ModBan.expires", + "type": "string" + }, + "when_": { + "title": "ModBan.when_", + "type": "string" + } + }, + "required": [ + "id", + "mod_person_id", + "other_person_id", + "banned", + "when_" + ], + "additionalProperties": false, + "title": "ModBan", + "type": "object" + }, + "ModBanView": { + "properties": { + "mod_ban": { + "$ref": "#/components/schemas/ModBan", + "title": "ModBanView.mod_ban" + }, + "moderator": { + "$ref": "#/components/schemas/Person", + "title": "ModBanView.moderator" + }, + "banned_person": { + "$ref": "#/components/schemas/Person", + "title": "ModBanView.banned_person" + } + }, + "required": [ + "mod_ban", + "banned_person" + ], + "additionalProperties": false, + "title": "ModBanView", + "type": "object" + }, + "ModAddCommunity": { + "properties": { + "id": { + "title": "ModAddCommunity.id", + "type": "integer" + }, + "mod_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModAddCommunity.mod_person_id" + }, + "other_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModAddCommunity.other_person_id" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "ModAddCommunity.community_id" + }, + "removed": { + "title": "ModAddCommunity.removed", + "type": "boolean" + }, + "when_": { + "title": "ModAddCommunity.when_", + "type": "string" + } + }, + "required": [ + "id", + "mod_person_id", + "other_person_id", + "community_id", + "removed", + "when_" + ], + "additionalProperties": false, + "title": "ModAddCommunity", + "type": "object" + }, + "ModAddCommunityView": { + "properties": { + "mod_add_community": { + "$ref": "#/components/schemas/ModAddCommunity", + "title": "ModAddCommunityView.mod_add_community" + }, + "moderator": { + "$ref": "#/components/schemas/Person", + "title": "ModAddCommunityView.moderator" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "ModAddCommunityView.community" + }, + "modded_person": { + "$ref": "#/components/schemas/Person", + "title": "ModAddCommunityView.modded_person" + } + }, + "required": [ + "mod_add_community", + "community", + "modded_person" + ], + "additionalProperties": false, + "title": "ModAddCommunityView", + "type": "object" + }, + "ModTransferCommunity": { + "properties": { + "id": { + "title": "ModTransferCommunity.id", + "type": "integer" + }, + "mod_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModTransferCommunity.mod_person_id" + }, + "other_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModTransferCommunity.other_person_id" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "ModTransferCommunity.community_id" + }, + "when_": { + "title": "ModTransferCommunity.when_", + "type": "string" + } + }, + "required": [ + "id", + "mod_person_id", + "other_person_id", + "community_id", + "when_" + ], + "additionalProperties": false, + "title": "ModTransferCommunity", + "type": "object" + }, + "ModTransferCommunityView": { + "properties": { + "mod_transfer_community": { + "$ref": "#/components/schemas/ModTransferCommunity", + "title": "ModTransferCommunityView.mod_transfer_community" + }, + "moderator": { + "$ref": "#/components/schemas/Person", + "title": "ModTransferCommunityView.moderator" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "ModTransferCommunityView.community" + }, + "modded_person": { + "$ref": "#/components/schemas/Person", + "title": "ModTransferCommunityView.modded_person" + } + }, + "required": [ + "mod_transfer_community", + "community", + "modded_person" + ], + "additionalProperties": false, + "title": "ModTransferCommunityView", + "type": "object" + }, + "ModAdd": { + "properties": { + "id": { + "title": "ModAdd.id", + "type": "integer" + }, + "mod_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModAdd.mod_person_id" + }, + "other_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModAdd.other_person_id" + }, + "removed": { + "title": "ModAdd.removed", + "type": "boolean" + }, + "when_": { + "title": "ModAdd.when_", + "type": "string" + } + }, + "required": [ + "id", + "mod_person_id", + "other_person_id", + "removed", + "when_" + ], + "additionalProperties": false, + "title": "ModAdd", + "type": "object" + }, + "ModAddView": { + "properties": { + "mod_add": { + "$ref": "#/components/schemas/ModAdd", + "title": "ModAddView.mod_add" + }, + "moderator": { + "$ref": "#/components/schemas/Person", + "title": "ModAddView.moderator" + }, + "modded_person": { + "$ref": "#/components/schemas/Person", + "title": "ModAddView.modded_person" + } + }, + "required": [ + "mod_add", + "modded_person" + ], + "additionalProperties": false, + "title": "ModAddView", + "type": "object" + }, + "AdminPurgePerson": { + "properties": { + "id": { + "title": "AdminPurgePerson.id", + "type": "integer" + }, + "admin_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "AdminPurgePerson.admin_person_id" + }, + "reason": { + "title": "AdminPurgePerson.reason", + "type": "string" + }, + "when_": { + "title": "AdminPurgePerson.when_", + "type": "string" + } + }, + "required": [ + "id", + "admin_person_id", + "when_" + ], + "additionalProperties": false, + "title": "AdminPurgePerson", + "type": "object" + }, + "AdminPurgePersonView": { + "properties": { + "admin_purge_person": { + "$ref": "#/components/schemas/AdminPurgePerson", + "title": "AdminPurgePersonView.admin_purge_person" + }, + "admin": { + "$ref": "#/components/schemas/Person", + "title": "AdminPurgePersonView.admin" + } + }, + "required": [ + "admin_purge_person" + ], + "additionalProperties": false, + "title": "AdminPurgePersonView", + "type": "object" + }, + "AdminPurgeCommunity": { + "properties": { + "id": { + "title": "AdminPurgeCommunity.id", + "type": "integer" + }, + "admin_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "AdminPurgeCommunity.admin_person_id" + }, + "reason": { + "title": "AdminPurgeCommunity.reason", + "type": "string" + }, + "when_": { + "title": "AdminPurgeCommunity.when_", + "type": "string" + } + }, + "required": [ + "id", + "admin_person_id", + "when_" + ], + "additionalProperties": false, + "title": "AdminPurgeCommunity", + "type": "object" + }, + "AdminPurgeCommunityView": { + "properties": { + "admin_purge_community": { + "$ref": "#/components/schemas/AdminPurgeCommunity", + "title": "AdminPurgeCommunityView.admin_purge_community" + }, + "admin": { + "$ref": "#/components/schemas/Person", + "title": "AdminPurgeCommunityView.admin" + } + }, + "required": [ + "admin_purge_community" + ], + "additionalProperties": false, + "title": "AdminPurgeCommunityView", + "type": "object" + }, + "AdminPurgePost": { + "properties": { + "id": { + "title": "AdminPurgePost.id", + "type": "integer" + }, + "admin_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "AdminPurgePost.admin_person_id" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "AdminPurgePost.community_id" + }, + "reason": { + "title": "AdminPurgePost.reason", + "type": "string" + }, + "when_": { + "title": "AdminPurgePost.when_", + "type": "string" + } + }, + "required": [ + "id", + "admin_person_id", + "community_id", + "when_" + ], + "additionalProperties": false, + "title": "AdminPurgePost", + "type": "object" + }, + "AdminPurgePostView": { + "properties": { + "admin_purge_post": { + "$ref": "#/components/schemas/AdminPurgePost", + "title": "AdminPurgePostView.admin_purge_post" + }, + "admin": { + "$ref": "#/components/schemas/Person", + "title": "AdminPurgePostView.admin" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "AdminPurgePostView.community" + } + }, + "required": [ + "admin_purge_post", + "community" + ], + "additionalProperties": false, + "title": "AdminPurgePostView", + "type": "object" + }, + "AdminPurgeComment": { + "properties": { + "id": { + "title": "AdminPurgeComment.id", + "type": "integer" + }, + "admin_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "AdminPurgeComment.admin_person_id" + }, + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "AdminPurgeComment.post_id" + }, + "reason": { + "title": "AdminPurgeComment.reason", + "type": "string" + }, + "when_": { + "title": "AdminPurgeComment.when_", + "type": "string" + } + }, + "required": [ + "id", + "admin_person_id", + "post_id", + "when_" + ], + "additionalProperties": false, + "title": "AdminPurgeComment", + "type": "object" + }, + "AdminPurgeCommentView": { + "properties": { + "admin_purge_comment": { + "$ref": "#/components/schemas/AdminPurgeComment", + "title": "AdminPurgeCommentView.admin_purge_comment" + }, + "admin": { + "$ref": "#/components/schemas/Person", + "title": "AdminPurgeCommentView.admin" + }, + "post": { + "$ref": "#/components/schemas/Post", + "title": "AdminPurgeCommentView.post" + } + }, + "required": [ + "admin_purge_comment", + "post" + ], + "additionalProperties": false, + "title": "AdminPurgeCommentView", + "type": "object" + }, + "ModHideCommunity": { + "properties": { + "id": { + "title": "ModHideCommunity.id", + "type": "integer" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "ModHideCommunity.community_id" + }, + "mod_person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "ModHideCommunity.mod_person_id" + }, + "when_": { + "title": "ModHideCommunity.when_", + "type": "string" + }, + "reason": { + "title": "ModHideCommunity.reason", + "type": "string" + }, + "hidden": { + "title": "ModHideCommunity.hidden", + "type": "boolean" + } + }, + "required": [ + "id", + "community_id", + "mod_person_id", + "when_", + "hidden" + ], + "additionalProperties": false, + "title": "ModHideCommunity", + "type": "object" + }, + "ModHideCommunityView": { + "properties": { + "mod_hide_community": { + "$ref": "#/components/schemas/ModHideCommunity", + "title": "ModHideCommunityView.mod_hide_community" + }, + "admin": { + "$ref": "#/components/schemas/Person", + "title": "ModHideCommunityView.admin" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "ModHideCommunityView.community" + } + }, + "required": [ + "mod_hide_community", + "community" + ], + "additionalProperties": false, + "title": "ModHideCommunityView", + "type": "object" + }, + "GetModlogResponse": { + "properties": { + "removed_posts": { + "items": { + "$ref": "#/components/schemas/ModRemovePostView" + }, + "title": "GetModlogResponse.removed_posts", + "type": "array" + }, + "locked_posts": { + "items": { + "$ref": "#/components/schemas/ModLockPostView" + }, + "title": "GetModlogResponse.locked_posts", + "type": "array" + }, + "featured_posts": { + "items": { + "$ref": "#/components/schemas/ModFeaturePostView" + }, + "title": "GetModlogResponse.featured_posts", + "type": "array" + }, + "removed_comments": { + "items": { + "$ref": "#/components/schemas/ModRemoveCommentView" + }, + "title": "GetModlogResponse.removed_comments", + "type": "array" + }, + "removed_communities": { + "items": { + "$ref": "#/components/schemas/ModRemoveCommunityView" + }, + "title": "GetModlogResponse.removed_communities", + "type": "array" + }, + "banned_from_community": { + "items": { + "$ref": "#/components/schemas/ModBanFromCommunityView" + }, + "title": "GetModlogResponse.banned_from_community", + "type": "array" + }, + "banned": { + "items": { + "$ref": "#/components/schemas/ModBanView" + }, + "title": "GetModlogResponse.banned", + "type": "array" + }, + "added_to_community": { + "items": { + "$ref": "#/components/schemas/ModAddCommunityView" + }, + "title": "GetModlogResponse.added_to_community", + "type": "array" + }, + "transferred_to_community": { + "items": { + "$ref": "#/components/schemas/ModTransferCommunityView" + }, + "title": "GetModlogResponse.transferred_to_community", + "type": "array" + }, + "added": { + "items": { + "$ref": "#/components/schemas/ModAddView" + }, + "title": "GetModlogResponse.added", + "type": "array" + }, + "admin_purged_persons": { + "items": { + "$ref": "#/components/schemas/AdminPurgePersonView" + }, + "title": "GetModlogResponse.admin_purged_persons", + "type": "array" + }, + "admin_purged_communities": { + "items": { + "$ref": "#/components/schemas/AdminPurgeCommunityView" + }, + "title": "GetModlogResponse.admin_purged_communities", + "type": "array" + }, + "admin_purged_posts": { + "items": { + "$ref": "#/components/schemas/AdminPurgePostView" + }, + "title": "GetModlogResponse.admin_purged_posts", + "type": "array" + }, + "admin_purged_comments": { + "items": { + "$ref": "#/components/schemas/AdminPurgeCommentView" + }, + "title": "GetModlogResponse.admin_purged_comments", + "type": "array" + }, + "hidden_communities": { + "items": { + "$ref": "#/components/schemas/ModHideCommunityView" + }, + "title": "GetModlogResponse.hidden_communities", + "type": "array" + } + }, + "required": [ + "removed_posts", + "locked_posts", + "featured_posts", + "removed_comments", + "removed_communities", + "banned_from_community", + "banned", + "added_to_community", + "transferred_to_community", + "added", + "admin_purged_persons", + "admin_purged_communities", + "admin_purged_posts", + "admin_purged_comments", + "hidden_communities" + ], + "additionalProperties": false, + "title": "GetModlogResponse", + "type": "object" + }, + "SearchType": { + "enum": [ + "All", + "Comments", + "Posts", + "Communities", + "Users", + "Url" + ], + "title": "SearchType", + "type": "string" + }, + "Search": { + "properties": { + "q": { + "title": "Search.q", + "type": "string" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "Search.community_id" + }, + "community_name": { + "title": "Search.community_name", + "type": "string" + }, + "creator_id": { + "$ref": "#/components/schemas/PersonId", + "title": "Search.creator_id" + }, + "type_": { + "$ref": "#/components/schemas/SearchType", + "title": "Search.type_" + }, + "sort": { + "$ref": "#/components/schemas/SortType", + "title": "Search.sort" + }, + "listing_type": { + "$ref": "#/components/schemas/ListingType", + "title": "Search.listing_type" + }, + "page": { + "title": "Search.page", + "type": "integer" + }, + "limit": { + "title": "Search.limit", + "type": "integer" + }, + "post_title_only": { + "title": "Search.post_title_only", + "type": "boolean" + } + }, + "required": [ + "q" + ], + "additionalProperties": false, + "title": "Search", + "type": "object" + }, + "CommentAggregates": { + "properties": { + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "CommentAggregates.comment_id" + }, + "score": { + "title": "CommentAggregates.score", + "type": "integer" + }, + "upvotes": { + "title": "CommentAggregates.upvotes", + "type": "integer" + }, + "downvotes": { + "title": "CommentAggregates.downvotes", + "type": "integer" + }, + "published": { + "title": "CommentAggregates.published", + "type": "string" + }, + "child_count": { + "title": "CommentAggregates.child_count", + "type": "integer" + } + }, + "required": [ + "comment_id", + "score", + "upvotes", + "downvotes", + "published", + "child_count" + ], + "additionalProperties": false, + "title": "CommentAggregates", + "type": "object" + }, + "SubscribedType": { + "enum": [ + "Subscribed", + "NotSubscribed", + "Pending" + ], + "title": "SubscribedType", + "type": "string" + }, + "CommentView": { + "properties": { + "comment": { + "$ref": "#/components/schemas/Comment", + "title": "CommentView.comment" + }, + "creator": { + "$ref": "#/components/schemas/Person", + "title": "CommentView.creator" + }, + "post": { + "$ref": "#/components/schemas/Post", + "title": "CommentView.post" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "CommentView.community" + }, + "counts": { + "$ref": "#/components/schemas/CommentAggregates", + "title": "CommentView.counts" + }, + "creator_banned_from_community": { + "title": "CommentView.creator_banned_from_community", + "type": "boolean" + }, + "banned_from_community": { + "title": "CommentView.banned_from_community", + "type": "boolean" + }, + "creator_is_moderator": { + "title": "CommentView.creator_is_moderator", + "type": "boolean" + }, + "creator_is_admin": { + "title": "CommentView.creator_is_admin", + "type": "boolean" + }, + "subscribed": { + "$ref": "#/components/schemas/SubscribedType", + "title": "CommentView.subscribed" + }, + "saved": { + "title": "CommentView.saved", + "type": "boolean" + }, + "creator_blocked": { + "title": "CommentView.creator_blocked", + "type": "boolean" + }, + "my_vote": { + "title": "CommentView.my_vote", + "type": "integer" + } + }, + "required": [ + "comment", + "creator", + "post", + "community", + "counts", + "creator_banned_from_community", + "banned_from_community", + "creator_is_moderator", + "creator_is_admin", + "subscribed", + "saved", + "creator_blocked" + ], + "additionalProperties": false, + "title": "CommentView", + "type": "object" + }, + "ImageDetails": { + "properties": { + "link": { + "title": "ImageDetails.link", + "type": "string" + }, + "width": { + "title": "ImageDetails.width", + "type": "integer" + }, + "height": { + "title": "ImageDetails.height", + "type": "integer" + }, + "content_type": { + "title": "ImageDetails.content_type", + "type": "string" + } + }, + "required": [ + "link", + "width", + "height", + "content_type" + ], + "additionalProperties": false, + "title": "ImageDetails", + "type": "object" + }, + "PostAggregates": { + "properties": { + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "PostAggregates.post_id" + }, + "comments": { + "title": "PostAggregates.comments", + "type": "integer" + }, + "score": { + "title": "PostAggregates.score", + "type": "integer" + }, + "upvotes": { + "title": "PostAggregates.upvotes", + "type": "integer" + }, + "downvotes": { + "title": "PostAggregates.downvotes", + "type": "integer" + }, + "published": { + "title": "PostAggregates.published", + "type": "string" + }, + "newest_comment_time": { + "title": "PostAggregates.newest_comment_time", + "type": "string" + } + }, + "required": [ + "post_id", + "comments", + "score", + "upvotes", + "downvotes", + "published", + "newest_comment_time" + ], + "additionalProperties": false, + "title": "PostAggregates", + "type": "object" + }, + "PostView": { + "properties": { + "post": { + "$ref": "#/components/schemas/Post", + "title": "PostView.post" + }, + "creator": { + "$ref": "#/components/schemas/Person", + "title": "PostView.creator" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "PostView.community" + }, + "image_details": { + "$ref": "#/components/schemas/ImageDetails", + "title": "PostView.image_details" + }, + "creator_banned_from_community": { + "title": "PostView.creator_banned_from_community", + "type": "boolean" + }, + "banned_from_community": { + "title": "PostView.banned_from_community", + "type": "boolean" + }, + "creator_is_moderator": { + "title": "PostView.creator_is_moderator", + "type": "boolean" + }, + "creator_is_admin": { + "title": "PostView.creator_is_admin", + "type": "boolean" + }, + "counts": { + "$ref": "#/components/schemas/PostAggregates", + "title": "PostView.counts" + }, + "subscribed": { + "$ref": "#/components/schemas/SubscribedType", + "title": "PostView.subscribed" + }, + "saved": { + "title": "PostView.saved", + "type": "boolean" + }, + "read": { + "title": "PostView.read", + "type": "boolean" + }, + "hidden": { + "title": "PostView.hidden", + "type": "boolean" + }, + "creator_blocked": { + "title": "PostView.creator_blocked", + "type": "boolean" + }, + "my_vote": { + "title": "PostView.my_vote", + "type": "integer" + }, + "unread_comments": { + "title": "PostView.unread_comments", + "type": "integer" + } + }, + "required": [ + "post", + "creator", + "community", + "creator_banned_from_community", + "banned_from_community", + "creator_is_moderator", + "creator_is_admin", + "counts", + "subscribed", + "saved", + "read", + "hidden", + "creator_blocked", + "unread_comments" + ], + "additionalProperties": false, + "title": "PostView", + "type": "object" + }, + "CommunityAggregates": { + "properties": { + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "CommunityAggregates.community_id" + }, + "subscribers": { + "title": "CommunityAggregates.subscribers", + "type": "integer" + }, + "posts": { + "title": "CommunityAggregates.posts", + "type": "integer" + }, + "comments": { + "title": "CommunityAggregates.comments", + "type": "integer" + }, + "published": { + "title": "CommunityAggregates.published", + "type": "string" + }, + "users_active_day": { + "title": "CommunityAggregates.users_active_day", + "type": "integer" + }, + "users_active_week": { + "title": "CommunityAggregates.users_active_week", + "type": "integer" + }, + "users_active_month": { + "title": "CommunityAggregates.users_active_month", + "type": "integer" + }, + "users_active_half_year": { + "title": "CommunityAggregates.users_active_half_year", + "type": "integer" + }, + "subscribers_local": { + "title": "CommunityAggregates.subscribers_local", + "type": "integer" + } + }, + "required": [ + "community_id", + "subscribers", + "posts", + "comments", + "published", + "users_active_day", + "users_active_week", + "users_active_month", + "users_active_half_year", + "subscribers_local" + ], + "additionalProperties": false, + "title": "CommunityAggregates", + "type": "object" + }, + "CommunityView": { + "properties": { + "community": { + "$ref": "#/components/schemas/Community", + "title": "CommunityView.community" + }, + "subscribed": { + "$ref": "#/components/schemas/SubscribedType", + "title": "CommunityView.subscribed" + }, + "blocked": { + "title": "CommunityView.blocked", + "type": "boolean" + }, + "counts": { + "$ref": "#/components/schemas/CommunityAggregates", + "title": "CommunityView.counts" + }, + "banned_from_community": { + "title": "CommunityView.banned_from_community", + "type": "boolean" + } + }, + "required": [ + "community", + "subscribed", + "blocked", + "counts", + "banned_from_community" + ], + "additionalProperties": false, + "title": "CommunityView", + "type": "object" + }, + "SearchResponse": { + "properties": { + "type_": { + "$ref": "#/components/schemas/SearchType", + "title": "SearchResponse.type_" + }, + "comments": { + "items": { + "$ref": "#/components/schemas/CommentView" + }, + "title": "SearchResponse.comments", + "type": "array" + }, + "posts": { + "items": { + "$ref": "#/components/schemas/PostView" + }, + "title": "SearchResponse.posts", + "type": "array" + }, + "communities": { + "items": { + "$ref": "#/components/schemas/CommunityView" + }, + "title": "SearchResponse.communities", + "type": "array" + }, + "users": { + "items": { + "$ref": "#/components/schemas/PersonView" + }, + "title": "SearchResponse.users", + "type": "array" + } + }, + "required": [ + "type_", + "comments", + "posts", + "communities", + "users" + ], + "additionalProperties": false, + "title": "SearchResponse", + "type": "object" + }, + "ResolveObject": { + "properties": { + "q": { + "title": "ResolveObject.q", + "type": "string" + } + }, + "required": [ + "q" + ], + "additionalProperties": false, + "title": "ResolveObject", + "type": "object" + }, + "ResolveObjectResponse": { + "properties": { + "comment": { + "$ref": "#/components/schemas/CommentView", + "title": "ResolveObjectResponse.comment" + }, + "post": { + "$ref": "#/components/schemas/PostView", + "title": "ResolveObjectResponse.post" + }, + "community": { + "$ref": "#/components/schemas/CommunityView", + "title": "ResolveObjectResponse.community" + }, + "person": { + "$ref": "#/components/schemas/PersonView", + "title": "ResolveObjectResponse.person" + } + }, + "additionalProperties": false, + "title": "ResolveObjectResponse", + "type": "object" + }, + "GetCommunity": { + "properties": { + "id": { + "$ref": "#/components/schemas/CommunityId", + "title": "GetCommunity.id" + }, + "name": { + "title": "GetCommunity.name", + "type": "string" + } + }, + "additionalProperties": false, + "title": "GetCommunity", + "type": "object" + }, + "GetCommunityResponse": { + "properties": { + "community_view": { + "$ref": "#/components/schemas/CommunityView", + "title": "GetCommunityResponse.community_view" + }, + "site": { + "$ref": "#/components/schemas/Site", + "title": "GetCommunityResponse.site" + }, + "moderators": { + "items": { + "$ref": "#/components/schemas/CommunityModeratorView" + }, + "title": "GetCommunityResponse.moderators", + "type": "array" + }, + "discussion_languages": { + "items": { + "$ref": "#/components/schemas/LanguageId" + }, + "title": "GetCommunityResponse.discussion_languages", + "type": "array" + } + }, + "required": [ + "community_view", + "moderators", + "discussion_languages" + ], + "additionalProperties": false, + "title": "GetCommunityResponse", + "type": "object" + }, + "EditCommunity": { + "properties": { + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "EditCommunity.community_id" + }, + "title": { + "title": "EditCommunity.title", + "type": "string" + }, + "description": { + "title": "EditCommunity.description", + "type": "string" + }, + "icon": { + "title": "EditCommunity.icon", + "type": "string" + }, + "banner": { + "title": "EditCommunity.banner", + "type": "string" + }, + "nsfw": { + "title": "EditCommunity.nsfw", + "type": "boolean" + }, + "posting_restricted_to_mods": { + "title": "EditCommunity.posting_restricted_to_mods", + "type": "boolean" + }, + "discussion_languages": { + "items": { + "$ref": "#/components/schemas/LanguageId" + }, + "title": "EditCommunity.discussion_languages", + "type": "array" + }, + "visibility": { + "$ref": "#/components/schemas/CommunityVisibility", + "title": "EditCommunity.visibility" + } + }, + "required": [ + "community_id" + ], + "additionalProperties": false, + "title": "EditCommunity", + "type": "object" + }, + "CommunityResponse": { + "properties": { + "community_view": { + "$ref": "#/components/schemas/CommunityView", + "title": "CommunityResponse.community_view" + }, + "discussion_languages": { + "items": { + "$ref": "#/components/schemas/LanguageId" + }, + "title": "CommunityResponse.discussion_languages", + "type": "array" + } + }, + "required": [ + "community_view", + "discussion_languages" + ], + "additionalProperties": false, + "title": "CommunityResponse", + "type": "object" + }, + "CreateCommunity": { + "properties": { + "name": { + "title": "CreateCommunity.name", + "type": "string" + }, + "title": { + "title": "CreateCommunity.title", + "type": "string" + }, + "description": { + "title": "CreateCommunity.description", + "type": "string" + }, + "icon": { + "title": "CreateCommunity.icon", + "type": "string" + }, + "banner": { + "title": "CreateCommunity.banner", + "type": "string" + }, + "nsfw": { + "title": "CreateCommunity.nsfw", + "type": "boolean" + }, + "posting_restricted_to_mods": { + "title": "CreateCommunity.posting_restricted_to_mods", + "type": "boolean" + }, + "discussion_languages": { + "items": { + "$ref": "#/components/schemas/LanguageId" + }, + "title": "CreateCommunity.discussion_languages", + "type": "array" + }, + "visibility": { + "$ref": "#/components/schemas/CommunityVisibility", + "title": "CreateCommunity.visibility" + } + }, + "required": [ + "name", + "title" + ], + "additionalProperties": false, + "title": "CreateCommunity", + "type": "object" + }, + "HideCommunity": { + "properties": { + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "HideCommunity.community_id" + }, + "hidden": { + "title": "HideCommunity.hidden", + "type": "boolean" + }, + "reason": { + "title": "HideCommunity.reason", + "type": "string" + } + }, + "required": [ + "community_id", + "hidden" + ], + "additionalProperties": false, + "title": "HideCommunity", + "type": "object" + }, + "ListCommunities": { + "properties": { + "type_": { + "$ref": "#/components/schemas/ListingType", + "title": "ListCommunities.type_" + }, + "sort": { + "$ref": "#/components/schemas/SortType", + "title": "ListCommunities.sort" + }, + "show_nsfw": { + "title": "ListCommunities.show_nsfw", + "type": "boolean" + }, + "page": { + "title": "ListCommunities.page", + "type": "integer" + }, + "limit": { + "title": "ListCommunities.limit", + "type": "integer" + } + }, + "additionalProperties": false, + "title": "ListCommunities", + "type": "object" + }, + "ListCommunitiesResponse": { + "properties": { + "communities": { + "items": { + "$ref": "#/components/schemas/CommunityView" + }, + "title": "ListCommunitiesResponse.communities", + "type": "array" + } + }, + "required": [ + "communities" + ], + "additionalProperties": false, + "title": "ListCommunitiesResponse", + "type": "object" + }, + "FollowCommunity": { + "properties": { + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "FollowCommunity.community_id" + }, + "follow": { + "title": "FollowCommunity.follow", + "type": "boolean" + } + }, + "required": [ + "community_id", + "follow" + ], + "additionalProperties": false, + "title": "FollowCommunity", + "type": "object" + }, + "BlockCommunity": { + "properties": { + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "BlockCommunity.community_id" + }, + "block": { + "title": "BlockCommunity.block", + "type": "boolean" + } + }, + "required": [ + "community_id", + "block" + ], + "additionalProperties": false, + "title": "BlockCommunity", + "type": "object" + }, + "BlockCommunityResponse": { + "properties": { + "community_view": { + "$ref": "#/components/schemas/CommunityView", + "title": "BlockCommunityResponse.community_view" + }, + "blocked": { + "title": "BlockCommunityResponse.blocked", + "type": "boolean" + } + }, + "required": [ + "community_view", + "blocked" + ], + "additionalProperties": false, + "title": "BlockCommunityResponse", + "type": "object" + }, + "DeleteCommunity": { + "properties": { + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "DeleteCommunity.community_id" + }, + "deleted": { + "title": "DeleteCommunity.deleted", + "type": "boolean" + } + }, + "required": [ + "community_id", + "deleted" + ], + "additionalProperties": false, + "title": "DeleteCommunity", + "type": "object" + }, + "RemoveCommunity": { + "properties": { + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "RemoveCommunity.community_id" + }, + "removed": { + "title": "RemoveCommunity.removed", + "type": "boolean" + }, + "reason": { + "title": "RemoveCommunity.reason", + "type": "string" + } + }, + "required": [ + "community_id", + "removed" + ], + "additionalProperties": false, + "title": "RemoveCommunity", + "type": "object" + }, + "TransferCommunity": { + "properties": { + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "TransferCommunity.community_id" + }, + "person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "TransferCommunity.person_id" + } + }, + "required": [ + "community_id", + "person_id" + ], + "additionalProperties": false, + "title": "TransferCommunity", + "type": "object" + }, + "BanFromCommunity": { + "properties": { + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "BanFromCommunity.community_id" + }, + "person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "BanFromCommunity.person_id" + }, + "ban": { + "title": "BanFromCommunity.ban", + "type": "boolean" + }, + "remove_data": { + "title": "BanFromCommunity.remove_data", + "type": "boolean" + }, + "reason": { + "title": "BanFromCommunity.reason", + "type": "string" + }, + "expires": { + "title": "BanFromCommunity.expires", + "type": "integer" + } + }, + "required": [ + "community_id", + "person_id", + "ban" + ], + "additionalProperties": false, + "title": "BanFromCommunity", + "type": "object" + }, + "BanFromCommunityResponse": { + "properties": { + "person_view": { + "$ref": "#/components/schemas/PersonView", + "title": "BanFromCommunityResponse.person_view" + }, + "banned": { + "title": "BanFromCommunityResponse.banned", + "type": "boolean" + } + }, + "required": [ + "person_view", + "banned" + ], + "additionalProperties": false, + "title": "BanFromCommunityResponse", + "type": "object" + }, + "AddModToCommunity": { + "properties": { + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "AddModToCommunity.community_id" + }, + "person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "AddModToCommunity.person_id" + }, + "added": { + "title": "AddModToCommunity.added", + "type": "boolean" + } + }, + "required": [ + "community_id", + "person_id", + "added" + ], + "additionalProperties": false, + "title": "AddModToCommunity", + "type": "object" + }, + "AddModToCommunityResponse": { + "properties": { + "moderators": { + "items": { + "$ref": "#/components/schemas/CommunityModeratorView" + }, + "title": "AddModToCommunityResponse.moderators", + "type": "array" + } + }, + "required": [ + "moderators" + ], + "additionalProperties": false, + "title": "AddModToCommunityResponse", + "type": "object" + }, + "ActivityId": { + "title": "ActivityId", + "type": "integer" + }, + "ReadableFederationState": { + "properties": { + "instance_id": { + "$ref": "#/components/schemas/InstanceId", + "title": "ReadableFederationState.instance_id" + }, + "last_successful_id": { + "$ref": "#/components/schemas/ActivityId", + "title": "ReadableFederationState.last_successful_id" + }, + "last_successful_published_time": { + "title": "ReadableFederationState.last_successful_published_time", + "type": "string" + }, + "fail_count": { + "title": "ReadableFederationState.fail_count", + "type": "integer" + }, + "last_retry": { + "title": "ReadableFederationState.last_retry", + "type": "string" + }, + "next_retry": { + "title": "ReadableFederationState.next_retry", + "type": "string" + } + }, + "required": [ + "instance_id", + "fail_count" + ], + "additionalProperties": false, + "title": "ReadableFederationState", + "type": "object" + }, + "InstanceWithFederationState": { + "properties": { + "id": { + "$ref": "#/components/schemas/InstanceId", + "title": "InstanceWithFederationState.id" + }, + "domain": { + "title": "InstanceWithFederationState.domain", + "type": "string" + }, + "published": { + "title": "InstanceWithFederationState.published", + "type": "string" + }, + "updated": { + "title": "InstanceWithFederationState.updated", + "type": "string" + }, + "software": { + "title": "InstanceWithFederationState.software", + "type": "string" + }, + "version": { + "title": "InstanceWithFederationState.version", + "type": "string" + }, + "federation_state": { + "$ref": "#/components/schemas/ReadableFederationState", + "title": "InstanceWithFederationState.federation_state" + } + }, + "required": [ + "id", + "domain", + "published" + ], + "additionalProperties": false, + "title": "InstanceWithFederationState", + "type": "object" + }, + "FederatedInstances": { + "properties": { + "linked": { + "items": { + "$ref": "#/components/schemas/InstanceWithFederationState" + }, + "title": "FederatedInstances.linked", + "type": "array" + }, + "allowed": { + "items": { + "$ref": "#/components/schemas/InstanceWithFederationState" + }, + "title": "FederatedInstances.allowed", + "type": "array" + }, + "blocked": { + "items": { + "$ref": "#/components/schemas/InstanceWithFederationState" + }, + "title": "FederatedInstances.blocked", + "type": "array" + } + }, + "required": [ + "linked", + "allowed", + "blocked" + ], + "additionalProperties": false, + "title": "FederatedInstances", + "type": "object" + }, + "GetFederatedInstancesResponse": { + "properties": { + "federated_instances": { + "$ref": "#/components/schemas/FederatedInstances", + "title": "GetFederatedInstancesResponse.federated_instances" + } + }, + "additionalProperties": false, + "title": "GetFederatedInstancesResponse", + "type": "object" + }, + "GetPost": { + "properties": { + "id": { + "$ref": "#/components/schemas/PostId", + "title": "GetPost.id" + }, + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "GetPost.comment_id" + } + }, + "additionalProperties": false, + "title": "GetPost", + "type": "object" + }, + "GetPostResponse": { + "properties": { + "post_view": { + "$ref": "#/components/schemas/PostView", + "title": "GetPostResponse.post_view" + }, + "community_view": { + "$ref": "#/components/schemas/CommunityView", + "title": "GetPostResponse.community_view" + }, + "moderators": { + "items": { + "$ref": "#/components/schemas/CommunityModeratorView" + }, + "title": "GetPostResponse.moderators", + "type": "array" + }, + "cross_posts": { + "items": { + "$ref": "#/components/schemas/PostView" + }, + "title": "GetPostResponse.cross_posts", + "type": "array" + } + }, + "required": [ + "post_view", + "community_view", + "moderators", + "cross_posts" + ], + "additionalProperties": false, + "title": "GetPostResponse", + "type": "object" + }, + "EditPost": { + "properties": { + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "EditPost.post_id" + }, + "name": { + "title": "EditPost.name", + "type": "string" + }, + "url": { + "title": "EditPost.url", + "type": "string" + }, + "body": { + "title": "EditPost.body", + "type": "string" + }, + "alt_text": { + "title": "EditPost.alt_text", + "type": "string" + }, + "nsfw": { + "title": "EditPost.nsfw", + "type": "boolean" + }, + "language_id": { + "$ref": "#/components/schemas/LanguageId", + "title": "EditPost.language_id" + }, + "custom_thumbnail": { + "title": "EditPost.custom_thumbnail", + "type": "string" + } + }, + "required": [ + "post_id" + ], + "additionalProperties": false, + "title": "EditPost", + "type": "object" + }, + "PostResponse": { + "properties": { + "post_view": { + "$ref": "#/components/schemas/PostView", + "title": "PostResponse.post_view" + } + }, + "required": [ + "post_view" + ], + "additionalProperties": false, + "title": "PostResponse", + "type": "object" + }, + "CreatePost": { + "properties": { + "name": { + "title": "CreatePost.name", + "type": "string" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "CreatePost.community_id" + }, + "url": { + "title": "CreatePost.url", + "type": "string" + }, + "body": { + "title": "CreatePost.body", + "type": "string" + }, + "alt_text": { + "title": "CreatePost.alt_text", + "type": "string" + }, + "honeypot": { + "title": "CreatePost.honeypot", + "type": "string" + }, + "nsfw": { + "title": "CreatePost.nsfw", + "type": "boolean" + }, + "language_id": { + "$ref": "#/components/schemas/LanguageId", + "title": "CreatePost.language_id" + }, + "custom_thumbnail": { + "title": "CreatePost.custom_thumbnail", + "type": "string" + } + }, + "required": [ + "name", + "community_id" + ], + "additionalProperties": false, + "title": "CreatePost", + "type": "object" + }, + "PaginationCursor": { + "title": "PaginationCursor", + "type": "string" + }, + "GetPosts": { + "properties": { + "type_": { + "$ref": "#/components/schemas/ListingType", + "title": "GetPosts.type_" + }, + "sort": { + "$ref": "#/components/schemas/SortType", + "title": "GetPosts.sort" + }, + "page": { + "title": "GetPosts.page", + "type": "integer" + }, + "limit": { + "title": "GetPosts.limit", + "type": "integer" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "GetPosts.community_id" + }, + "community_name": { + "title": "GetPosts.community_name", + "type": "string" + }, + "saved_only": { + "title": "GetPosts.saved_only", + "type": "boolean" + }, + "liked_only": { + "title": "GetPosts.liked_only", + "type": "boolean" + }, + "disliked_only": { + "title": "GetPosts.disliked_only", + "type": "boolean" + }, + "show_hidden": { + "title": "GetPosts.show_hidden", + "type": "boolean" + }, + "show_read": { + "title": "GetPosts.show_read", + "type": "boolean" + }, + "show_nsfw": { + "title": "GetPosts.show_nsfw", + "type": "boolean" + }, + "page_cursor": { + "$ref": "#/components/schemas/PaginationCursor", + "title": "GetPosts.page_cursor" + } + }, + "additionalProperties": false, + "title": "GetPosts", + "type": "object" + }, + "GetPostsResponse": { + "properties": { + "posts": { + "items": { + "$ref": "#/components/schemas/PostView" + }, + "title": "GetPostsResponse.posts", + "type": "array" + }, + "next_page": { + "$ref": "#/components/schemas/PaginationCursor", + "title": "GetPostsResponse.next_page" + } + }, + "required": [ + "posts" + ], + "additionalProperties": false, + "title": "GetPostsResponse", + "type": "object" + }, + "DeletePost": { + "properties": { + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "DeletePost.post_id" + }, + "deleted": { + "title": "DeletePost.deleted", + "type": "boolean" + } + }, + "required": [ + "post_id", + "deleted" + ], + "additionalProperties": false, + "title": "DeletePost", + "type": "object" + }, + "RemovePost": { + "properties": { + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "RemovePost.post_id" + }, + "removed": { + "title": "RemovePost.removed", + "type": "boolean" + }, + "reason": { + "title": "RemovePost.reason", + "type": "string" + } + }, + "required": [ + "post_id", + "removed" + ], + "additionalProperties": false, + "title": "RemovePost", + "type": "object" + }, + "MarkPostAsRead": { + "properties": { + "post_ids": { + "items": { + "$ref": "#/components/schemas/PostId" + }, + "title": "MarkPostAsRead.post_ids", + "type": "array" + }, + "read": { + "title": "MarkPostAsRead.read", + "type": "boolean" + } + }, + "required": [ + "post_ids", + "read" + ], + "additionalProperties": false, + "title": "MarkPostAsRead", + "type": "object" + }, + "LockPost": { + "properties": { + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "LockPost.post_id" + }, + "locked": { + "title": "LockPost.locked", + "type": "boolean" + } + }, + "required": [ + "post_id", + "locked" + ], + "additionalProperties": false, + "title": "LockPost", + "type": "object" + }, + "PostFeatureType": { + "enum": [ + "Local", + "Community" + ], + "title": "PostFeatureType", + "type": "string" + }, + "FeaturePost": { + "properties": { + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "FeaturePost.post_id" + }, + "featured": { + "title": "FeaturePost.featured", + "type": "boolean" + }, + "feature_type": { + "$ref": "#/components/schemas/PostFeatureType", + "title": "FeaturePost.feature_type" + } + }, + "required": [ + "post_id", + "featured", + "feature_type" + ], + "additionalProperties": false, + "title": "FeaturePost", + "type": "object" + }, + "CreatePostLike": { + "properties": { + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "CreatePostLike.post_id" + }, + "score": { + "title": "CreatePostLike.score", + "type": "integer" + } + }, + "required": [ + "post_id", + "score" + ], + "additionalProperties": false, + "title": "CreatePostLike", + "type": "object" + }, + "SavePost": { + "properties": { + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "SavePost.post_id" + }, + "save": { + "title": "SavePost.save", + "type": "boolean" + } + }, + "required": [ + "post_id", + "save" + ], + "additionalProperties": false, + "title": "SavePost", + "type": "object" + }, + "CreatePostReport": { + "properties": { + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "CreatePostReport.post_id" + }, + "reason": { + "title": "CreatePostReport.reason", + "type": "string" + } + }, + "required": [ + "post_id", + "reason" + ], + "additionalProperties": false, + "title": "CreatePostReport", + "type": "object" + }, + "PostReportId": { + "title": "PostReportId", + "type": "integer" + }, + "PostReport": { + "properties": { + "id": { + "$ref": "#/components/schemas/PostReportId", + "title": "PostReport.id" + }, + "creator_id": { + "$ref": "#/components/schemas/PersonId", + "title": "PostReport.creator_id" + }, + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "PostReport.post_id" + }, + "original_post_name": { + "title": "PostReport.original_post_name", + "type": "string" + }, + "original_post_url": { + "title": "PostReport.original_post_url", + "type": "string" + }, + "original_post_body": { + "title": "PostReport.original_post_body", + "type": "string" + }, + "reason": { + "title": "PostReport.reason", + "type": "string" + }, + "resolved": { + "title": "PostReport.resolved", + "type": "boolean" + }, + "resolver_id": { + "$ref": "#/components/schemas/PersonId", + "title": "PostReport.resolver_id" + }, + "published": { + "title": "PostReport.published", + "type": "string" + }, + "updated": { + "title": "PostReport.updated", + "type": "string" + } + }, + "required": [ + "id", + "creator_id", + "post_id", + "original_post_name", + "reason", + "resolved", + "published" + ], + "additionalProperties": false, + "title": "PostReport", + "type": "object" + }, + "PostReportView": { + "properties": { + "post_report": { + "$ref": "#/components/schemas/PostReport", + "title": "PostReportView.post_report" + }, + "post": { + "$ref": "#/components/schemas/Post", + "title": "PostReportView.post" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "PostReportView.community" + }, + "creator": { + "$ref": "#/components/schemas/Person", + "title": "PostReportView.creator" + }, + "post_creator": { + "$ref": "#/components/schemas/Person", + "title": "PostReportView.post_creator" + }, + "creator_banned_from_community": { + "title": "PostReportView.creator_banned_from_community", + "type": "boolean" + }, + "creator_is_moderator": { + "title": "PostReportView.creator_is_moderator", + "type": "boolean" + }, + "creator_is_admin": { + "title": "PostReportView.creator_is_admin", + "type": "boolean" + }, + "subscribed": { + "$ref": "#/components/schemas/SubscribedType", + "title": "PostReportView.subscribed" + }, + "saved": { + "title": "PostReportView.saved", + "type": "boolean" + }, + "read": { + "title": "PostReportView.read", + "type": "boolean" + }, + "hidden": { + "title": "PostReportView.hidden", + "type": "boolean" + }, + "creator_blocked": { + "title": "PostReportView.creator_blocked", + "type": "boolean" + }, + "my_vote": { + "title": "PostReportView.my_vote", + "type": "integer" + }, + "unread_comments": { + "title": "PostReportView.unread_comments", + "type": "integer" + }, + "counts": { + "$ref": "#/components/schemas/PostAggregates", + "title": "PostReportView.counts" + }, + "resolver": { + "$ref": "#/components/schemas/Person", + "title": "PostReportView.resolver" + } + }, + "required": [ + "post_report", + "post", + "community", + "creator", + "post_creator", + "creator_banned_from_community", + "creator_is_moderator", + "creator_is_admin", + "subscribed", + "saved", + "read", + "hidden", + "creator_blocked", + "unread_comments", + "counts" + ], + "additionalProperties": false, + "title": "PostReportView", + "type": "object" + }, + "PostReportResponse": { + "properties": { + "post_report_view": { + "$ref": "#/components/schemas/PostReportView", + "title": "PostReportResponse.post_report_view" + } + }, + "required": [ + "post_report_view" + ], + "additionalProperties": false, + "title": "PostReportResponse", + "type": "object" + }, + "ResolvePostReport": { + "properties": { + "report_id": { + "$ref": "#/components/schemas/PostReportId", + "title": "ResolvePostReport.report_id" + }, + "resolved": { + "title": "ResolvePostReport.resolved", + "type": "boolean" + } + }, + "required": [ + "report_id", + "resolved" + ], + "additionalProperties": false, + "title": "ResolvePostReport", + "type": "object" + }, + "ListPostReports": { + "properties": { + "page": { + "title": "ListPostReports.page", + "type": "integer" + }, + "limit": { + "title": "ListPostReports.limit", + "type": "integer" + }, + "unresolved_only": { + "title": "ListPostReports.unresolved_only", + "type": "boolean" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "ListPostReports.community_id" + }, + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "ListPostReports.post_id" + } + }, + "additionalProperties": false, + "title": "ListPostReports", + "type": "object" + }, + "ListPostReportsResponse": { + "properties": { + "post_reports": { + "items": { + "$ref": "#/components/schemas/PostReportView" + }, + "title": "ListPostReportsResponse.post_reports", + "type": "array" + } + }, + "required": [ + "post_reports" + ], + "additionalProperties": false, + "title": "ListPostReportsResponse", + "type": "object" + }, + "GetSiteMetadata": { + "properties": { + "url": { + "title": "GetSiteMetadata.url", + "type": "string" + } + }, + "required": [ + "url" + ], + "additionalProperties": false, + "title": "GetSiteMetadata", + "type": "object" + }, + "LinkMetadata": { + "properties": { + "title": { + "title": "LinkMetadata.title", + "type": "string" + }, + "description": { + "title": "LinkMetadata.description", + "type": "string" + }, + "image": { + "title": "LinkMetadata.image", + "type": "string" + }, + "embed_video_url": { + "title": "LinkMetadata.embed_video_url", + "type": "string" + }, + "content_type": { + "title": "LinkMetadata.content_type", + "type": "string" + } + }, + "additionalProperties": false, + "title": "LinkMetadata", + "type": "object" + }, + "GetSiteMetadataResponse": { + "properties": { + "metadata": { + "$ref": "#/components/schemas/LinkMetadata", + "title": "GetSiteMetadataResponse.metadata" + } + }, + "required": [ + "metadata" + ], + "additionalProperties": false, + "title": "GetSiteMetadataResponse", + "type": "object" + }, + "GetComment": { + "properties": { + "id": { + "$ref": "#/components/schemas/CommentId", + "title": "GetComment.id" + } + }, + "required": [ + "id" + ], + "additionalProperties": false, + "title": "GetComment", + "type": "object" + }, + "CommentResponse": { + "properties": { + "comment_view": { + "$ref": "#/components/schemas/CommentView", + "title": "CommentResponse.comment_view" + }, + "recipient_ids": { + "items": { + "$ref": "#/components/schemas/LocalUserId" + }, + "title": "CommentResponse.recipient_ids", + "type": "array" + } + }, + "required": [ + "comment_view", + "recipient_ids" + ], + "additionalProperties": false, + "title": "CommentResponse", + "type": "object" + }, + "EditComment": { + "properties": { + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "EditComment.comment_id" + }, + "content": { + "title": "EditComment.content", + "type": "string" + }, + "language_id": { + "$ref": "#/components/schemas/LanguageId", + "title": "EditComment.language_id" + } + }, + "required": [ + "comment_id" + ], + "additionalProperties": false, + "title": "EditComment", + "type": "object" + }, + "CreateComment": { + "properties": { + "content": { + "title": "CreateComment.content", + "type": "string" + }, + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "CreateComment.post_id" + }, + "parent_id": { + "$ref": "#/components/schemas/CommentId", + "title": "CreateComment.parent_id" + }, + "language_id": { + "$ref": "#/components/schemas/LanguageId", + "title": "CreateComment.language_id" + } + }, + "required": [ + "content", + "post_id" + ], + "additionalProperties": false, + "title": "CreateComment", + "type": "object" + }, + "CommentSortType": { + "enum": [ + "Hot", + "Top", + "New", + "Old", + "Controversial" + ], + "title": "CommentSortType", + "type": "string" + }, + "GetComments": { + "properties": { + "type_": { + "$ref": "#/components/schemas/ListingType", + "title": "GetComments.type_" + }, + "sort": { + "$ref": "#/components/schemas/CommentSortType", + "title": "GetComments.sort" + }, + "max_depth": { + "title": "GetComments.max_depth", + "type": "integer" + }, + "page": { + "title": "GetComments.page", + "type": "integer" + }, + "limit": { + "title": "GetComments.limit", + "type": "integer" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "GetComments.community_id" + }, + "community_name": { + "title": "GetComments.community_name", + "type": "string" + }, + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "GetComments.post_id" + }, + "parent_id": { + "$ref": "#/components/schemas/CommentId", + "title": "GetComments.parent_id" + }, + "saved_only": { + "title": "GetComments.saved_only", + "type": "boolean" + }, + "liked_only": { + "title": "GetComments.liked_only", + "type": "boolean" + }, + "disliked_only": { + "title": "GetComments.disliked_only", + "type": "boolean" + } + }, + "additionalProperties": false, + "title": "GetComments", + "type": "object" + }, + "GetCommentsResponse": { + "properties": { + "comments": { + "items": { + "$ref": "#/components/schemas/CommentView" + }, + "title": "GetCommentsResponse.comments", + "type": "array" + } + }, + "required": [ + "comments" + ], + "additionalProperties": false, + "title": "GetCommentsResponse", + "type": "object" + }, + "DeleteComment": { + "properties": { + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "DeleteComment.comment_id" + }, + "deleted": { + "title": "DeleteComment.deleted", + "type": "boolean" + } + }, + "required": [ + "comment_id", + "deleted" + ], + "additionalProperties": false, + "title": "DeleteComment", + "type": "object" + }, + "RemoveComment": { + "properties": { + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "RemoveComment.comment_id" + }, + "removed": { + "title": "RemoveComment.removed", + "type": "boolean" + }, + "reason": { + "title": "RemoveComment.reason", + "type": "string" + } + }, + "required": [ + "comment_id", + "removed" + ], + "additionalProperties": false, + "title": "RemoveComment", + "type": "object" + }, + "CommentReplyId": { + "title": "CommentReplyId", + "type": "integer" + }, + "MarkCommentReplyAsRead": { + "properties": { + "comment_reply_id": { + "$ref": "#/components/schemas/CommentReplyId", + "title": "MarkCommentReplyAsRead.comment_reply_id" + }, + "read": { + "title": "MarkCommentReplyAsRead.read", + "type": "boolean" + } + }, + "required": [ + "comment_reply_id", + "read" + ], + "additionalProperties": false, + "title": "MarkCommentReplyAsRead", + "type": "object" + }, + "CommentReply": { + "properties": { + "id": { + "$ref": "#/components/schemas/CommentReplyId", + "title": "CommentReply.id" + }, + "recipient_id": { + "$ref": "#/components/schemas/PersonId", + "title": "CommentReply.recipient_id" + }, + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "CommentReply.comment_id" + }, + "read": { + "title": "CommentReply.read", + "type": "boolean" + }, + "published": { + "title": "CommentReply.published", + "type": "string" + } + }, + "required": [ + "id", + "recipient_id", + "comment_id", + "read", + "published" + ], + "additionalProperties": false, + "title": "CommentReply", + "type": "object" + }, + "CommentReplyView": { + "properties": { + "comment_reply": { + "$ref": "#/components/schemas/CommentReply", + "title": "CommentReplyView.comment_reply" + }, + "comment": { + "$ref": "#/components/schemas/Comment", + "title": "CommentReplyView.comment" + }, + "creator": { + "$ref": "#/components/schemas/Person", + "title": "CommentReplyView.creator" + }, + "post": { + "$ref": "#/components/schemas/Post", + "title": "CommentReplyView.post" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "CommentReplyView.community" + }, + "recipient": { + "$ref": "#/components/schemas/Person", + "title": "CommentReplyView.recipient" + }, + "counts": { + "$ref": "#/components/schemas/CommentAggregates", + "title": "CommentReplyView.counts" + }, + "creator_banned_from_community": { + "title": "CommentReplyView.creator_banned_from_community", + "type": "boolean" + }, + "banned_from_community": { + "title": "CommentReplyView.banned_from_community", + "type": "boolean" + }, + "creator_is_moderator": { + "title": "CommentReplyView.creator_is_moderator", + "type": "boolean" + }, + "creator_is_admin": { + "title": "CommentReplyView.creator_is_admin", + "type": "boolean" + }, + "subscribed": { + "$ref": "#/components/schemas/SubscribedType", + "title": "CommentReplyView.subscribed" + }, + "saved": { + "title": "CommentReplyView.saved", + "type": "boolean" + }, + "creator_blocked": { + "title": "CommentReplyView.creator_blocked", + "type": "boolean" + }, + "my_vote": { + "title": "CommentReplyView.my_vote", + "type": "integer" + } + }, + "required": [ + "comment_reply", + "comment", + "creator", + "post", + "community", + "recipient", + "counts", + "creator_banned_from_community", + "banned_from_community", + "creator_is_moderator", + "creator_is_admin", + "subscribed", + "saved", + "creator_blocked" + ], + "additionalProperties": false, + "title": "CommentReplyView", + "type": "object" + }, + "CommentReplyResponse": { + "properties": { + "comment_reply_view": { + "$ref": "#/components/schemas/CommentReplyView", + "title": "CommentReplyResponse.comment_reply_view" + } + }, + "required": [ + "comment_reply_view" + ], + "additionalProperties": false, + "title": "CommentReplyResponse", + "type": "object" + }, + "DistinguishComment": { + "properties": { + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "DistinguishComment.comment_id" + }, + "distinguished": { + "title": "DistinguishComment.distinguished", + "type": "boolean" + } + }, + "required": [ + "comment_id", + "distinguished" + ], + "additionalProperties": false, + "title": "DistinguishComment", + "type": "object" + }, + "CreateCommentLike": { + "properties": { + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "CreateCommentLike.comment_id" + }, + "score": { + "title": "CreateCommentLike.score", + "type": "integer" + } + }, + "required": [ + "comment_id", + "score" + ], + "additionalProperties": false, + "title": "CreateCommentLike", + "type": "object" + }, + "SaveComment": { + "properties": { + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "SaveComment.comment_id" + }, + "save": { + "title": "SaveComment.save", + "type": "boolean" + } + }, + "required": [ + "comment_id", + "save" + ], + "additionalProperties": false, + "title": "SaveComment", + "type": "object" + }, + "CreateCommentReport": { + "properties": { + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "CreateCommentReport.comment_id" + }, + "reason": { + "title": "CreateCommentReport.reason", + "type": "string" + } + }, + "required": [ + "comment_id", + "reason" + ], + "additionalProperties": false, + "title": "CreateCommentReport", + "type": "object" + }, + "CommentReportId": { + "title": "CommentReportId", + "type": "integer" + }, + "CommentReport": { + "properties": { + "id": { + "$ref": "#/components/schemas/CommentReportId", + "title": "CommentReport.id" + }, + "creator_id": { + "$ref": "#/components/schemas/PersonId", + "title": "CommentReport.creator_id" + }, + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "CommentReport.comment_id" + }, + "original_comment_text": { + "title": "CommentReport.original_comment_text", + "type": "string" + }, + "reason": { + "title": "CommentReport.reason", + "type": "string" + }, + "resolved": { + "title": "CommentReport.resolved", + "type": "boolean" + }, + "resolver_id": { + "$ref": "#/components/schemas/PersonId", + "title": "CommentReport.resolver_id" + }, + "published": { + "title": "CommentReport.published", + "type": "string" + }, + "updated": { + "title": "CommentReport.updated", + "type": "string" + } + }, + "required": [ + "id", + "creator_id", + "comment_id", + "original_comment_text", + "reason", + "resolved", + "published" + ], + "additionalProperties": false, + "title": "CommentReport", + "type": "object" + }, + "CommentReportView": { + "properties": { + "comment_report": { + "$ref": "#/components/schemas/CommentReport", + "title": "CommentReportView.comment_report" + }, + "comment": { + "$ref": "#/components/schemas/Comment", + "title": "CommentReportView.comment" + }, + "post": { + "$ref": "#/components/schemas/Post", + "title": "CommentReportView.post" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "CommentReportView.community" + }, + "creator": { + "$ref": "#/components/schemas/Person", + "title": "CommentReportView.creator" + }, + "comment_creator": { + "$ref": "#/components/schemas/Person", + "title": "CommentReportView.comment_creator" + }, + "counts": { + "$ref": "#/components/schemas/CommentAggregates", + "title": "CommentReportView.counts" + }, + "creator_banned_from_community": { + "title": "CommentReportView.creator_banned_from_community", + "type": "boolean" + }, + "creator_is_moderator": { + "title": "CommentReportView.creator_is_moderator", + "type": "boolean" + }, + "creator_is_admin": { + "title": "CommentReportView.creator_is_admin", + "type": "boolean" + }, + "creator_blocked": { + "title": "CommentReportView.creator_blocked", + "type": "boolean" + }, + "subscribed": { + "$ref": "#/components/schemas/SubscribedType", + "title": "CommentReportView.subscribed" + }, + "saved": { + "title": "CommentReportView.saved", + "type": "boolean" + }, + "my_vote": { + "title": "CommentReportView.my_vote", + "type": "integer" + }, + "resolver": { + "$ref": "#/components/schemas/Person", + "title": "CommentReportView.resolver" + } + }, + "required": [ + "comment_report", + "comment", + "post", + "community", + "creator", + "comment_creator", + "counts", + "creator_banned_from_community", + "creator_is_moderator", + "creator_is_admin", + "creator_blocked", + "subscribed", + "saved" + ], + "additionalProperties": false, + "title": "CommentReportView", + "type": "object" + }, + "CommentReportResponse": { + "properties": { + "comment_report_view": { + "$ref": "#/components/schemas/CommentReportView", + "title": "CommentReportResponse.comment_report_view" + } + }, + "required": [ + "comment_report_view" + ], + "additionalProperties": false, + "title": "CommentReportResponse", + "type": "object" + }, + "ResolveCommentReport": { + "properties": { + "report_id": { + "$ref": "#/components/schemas/CommentReportId", + "title": "ResolveCommentReport.report_id" + }, + "resolved": { + "title": "ResolveCommentReport.resolved", + "type": "boolean" + } + }, + "required": [ + "report_id", + "resolved" + ], + "additionalProperties": false, + "title": "ResolveCommentReport", + "type": "object" + }, + "ListCommentReports": { + "properties": { + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "ListCommentReports.comment_id" + }, + "page": { + "title": "ListCommentReports.page", + "type": "integer" + }, + "limit": { + "title": "ListCommentReports.limit", + "type": "integer" + }, + "unresolved_only": { + "title": "ListCommentReports.unresolved_only", + "type": "boolean" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "ListCommentReports.community_id" + } + }, + "additionalProperties": false, + "title": "ListCommentReports", + "type": "object" + }, + "ListCommentReportsResponse": { + "properties": { + "comment_reports": { + "items": { + "$ref": "#/components/schemas/CommentReportView" + }, + "title": "ListCommentReportsResponse.comment_reports", + "type": "array" + } + }, + "required": [ + "comment_reports" + ], + "additionalProperties": false, + "title": "ListCommentReportsResponse", + "type": "object" + }, + "PrivateMessageId": { + "title": "PrivateMessageId", + "type": "integer" + }, + "EditPrivateMessage": { + "properties": { + "private_message_id": { + "$ref": "#/components/schemas/PrivateMessageId", + "title": "EditPrivateMessage.private_message_id" + }, + "content": { + "title": "EditPrivateMessage.content", + "type": "string" + } + }, + "required": [ + "private_message_id", + "content" + ], + "additionalProperties": false, + "title": "EditPrivateMessage", + "type": "object" + }, + "PrivateMessage": { + "properties": { + "id": { + "$ref": "#/components/schemas/PrivateMessageId", + "title": "PrivateMessage.id" + }, + "creator_id": { + "$ref": "#/components/schemas/PersonId", + "title": "PrivateMessage.creator_id" + }, + "recipient_id": { + "$ref": "#/components/schemas/PersonId", + "title": "PrivateMessage.recipient_id" + }, + "content": { + "title": "PrivateMessage.content", + "type": "string" + }, + "deleted": { + "title": "PrivateMessage.deleted", + "type": "boolean" + }, + "read": { + "title": "PrivateMessage.read", + "type": "boolean" + }, + "published": { + "title": "PrivateMessage.published", + "type": "string" + }, + "updated": { + "title": "PrivateMessage.updated", + "type": "string" + }, + "ap_id": { + "title": "PrivateMessage.ap_id", + "type": "string" + }, + "local": { + "title": "PrivateMessage.local", + "type": "boolean" + } + }, + "required": [ + "id", + "creator_id", + "recipient_id", + "content", + "deleted", + "read", + "published", + "ap_id", + "local" + ], + "additionalProperties": false, + "title": "PrivateMessage", + "type": "object" + }, + "PrivateMessageView": { + "properties": { + "private_message": { + "$ref": "#/components/schemas/PrivateMessage", + "title": "PrivateMessageView.private_message" + }, + "creator": { + "$ref": "#/components/schemas/Person", + "title": "PrivateMessageView.creator" + }, + "recipient": { + "$ref": "#/components/schemas/Person", + "title": "PrivateMessageView.recipient" + } + }, + "required": [ + "private_message", + "creator", + "recipient" + ], + "additionalProperties": false, + "title": "PrivateMessageView", + "type": "object" + }, + "PrivateMessageResponse": { + "properties": { + "private_message_view": { + "$ref": "#/components/schemas/PrivateMessageView", + "title": "PrivateMessageResponse.private_message_view" + } + }, + "required": [ + "private_message_view" + ], + "additionalProperties": false, + "title": "PrivateMessageResponse", + "type": "object" + }, + "CreatePrivateMessage": { + "properties": { + "content": { + "title": "CreatePrivateMessage.content", + "type": "string" + }, + "recipient_id": { + "$ref": "#/components/schemas/PersonId", + "title": "CreatePrivateMessage.recipient_id" + } + }, + "required": [ + "content", + "recipient_id" + ], + "additionalProperties": false, + "title": "CreatePrivateMessage", + "type": "object" + }, + "GetPrivateMessages": { + "properties": { + "unread_only": { + "title": "GetPrivateMessages.unread_only", + "type": "boolean" + }, + "page": { + "title": "GetPrivateMessages.page", + "type": "integer" + }, + "limit": { + "title": "GetPrivateMessages.limit", + "type": "integer" + }, + "creator_id": { + "$ref": "#/components/schemas/PersonId", + "title": "GetPrivateMessages.creator_id" + } + }, + "additionalProperties": false, + "title": "GetPrivateMessages", + "type": "object" + }, + "PrivateMessagesResponse": { + "properties": { + "private_messages": { + "items": { + "$ref": "#/components/schemas/PrivateMessageView" + }, + "title": "PrivateMessagesResponse.private_messages", + "type": "array" + } + }, + "required": [ + "private_messages" + ], + "additionalProperties": false, + "title": "PrivateMessagesResponse", + "type": "object" + }, + "DeletePrivateMessage": { + "properties": { + "private_message_id": { + "$ref": "#/components/schemas/PrivateMessageId", + "title": "DeletePrivateMessage.private_message_id" + }, + "deleted": { + "title": "DeletePrivateMessage.deleted", + "type": "boolean" + } + }, + "required": [ + "private_message_id", + "deleted" + ], + "additionalProperties": false, + "title": "DeletePrivateMessage", + "type": "object" + }, + "MarkPrivateMessageAsRead": { + "properties": { + "private_message_id": { + "$ref": "#/components/schemas/PrivateMessageId", + "title": "MarkPrivateMessageAsRead.private_message_id" + }, + "read": { + "title": "MarkPrivateMessageAsRead.read", + "type": "boolean" + } + }, + "required": [ + "private_message_id", + "read" + ], + "additionalProperties": false, + "title": "MarkPrivateMessageAsRead", + "type": "object" + }, + "CreatePrivateMessageReport": { + "properties": { + "private_message_id": { + "$ref": "#/components/schemas/PrivateMessageId", + "title": "CreatePrivateMessageReport.private_message_id" + }, + "reason": { + "title": "CreatePrivateMessageReport.reason", + "type": "string" + } + }, + "required": [ + "private_message_id", + "reason" + ], + "additionalProperties": false, + "title": "CreatePrivateMessageReport", + "type": "object" + }, + "PrivateMessageReportId": { + "title": "PrivateMessageReportId", + "type": "integer" + }, + "PrivateMessageReport": { + "properties": { + "id": { + "$ref": "#/components/schemas/PrivateMessageReportId", + "title": "PrivateMessageReport.id" + }, + "creator_id": { + "$ref": "#/components/schemas/PersonId", + "title": "PrivateMessageReport.creator_id" + }, + "private_message_id": { + "$ref": "#/components/schemas/PrivateMessageId", + "title": "PrivateMessageReport.private_message_id" + }, + "original_pm_text": { + "title": "PrivateMessageReport.original_pm_text", + "type": "string" + }, + "reason": { + "title": "PrivateMessageReport.reason", + "type": "string" + }, + "resolved": { + "title": "PrivateMessageReport.resolved", + "type": "boolean" + }, + "resolver_id": { + "$ref": "#/components/schemas/PersonId", + "title": "PrivateMessageReport.resolver_id" + }, + "published": { + "title": "PrivateMessageReport.published", + "type": "string" + }, + "updated": { + "title": "PrivateMessageReport.updated", + "type": "string" + } + }, + "required": [ + "id", + "creator_id", + "private_message_id", + "original_pm_text", + "reason", + "resolved", + "published" + ], + "additionalProperties": false, + "title": "PrivateMessageReport", + "type": "object" + }, + "PrivateMessageReportView": { + "properties": { + "private_message_report": { + "$ref": "#/components/schemas/PrivateMessageReport", + "title": "PrivateMessageReportView.private_message_report" + }, + "private_message": { + "$ref": "#/components/schemas/PrivateMessage", + "title": "PrivateMessageReportView.private_message" + }, + "private_message_creator": { + "$ref": "#/components/schemas/Person", + "title": "PrivateMessageReportView.private_message_creator" + }, + "creator": { + "$ref": "#/components/schemas/Person", + "title": "PrivateMessageReportView.creator" + }, + "resolver": { + "$ref": "#/components/schemas/Person", + "title": "PrivateMessageReportView.resolver" + } + }, + "required": [ + "private_message_report", + "private_message", + "private_message_creator", + "creator" + ], + "additionalProperties": false, + "title": "PrivateMessageReportView", + "type": "object" + }, + "PrivateMessageReportResponse": { + "properties": { + "private_message_report_view": { + "$ref": "#/components/schemas/PrivateMessageReportView", + "title": "PrivateMessageReportResponse.private_message_report_view" + } + }, + "required": [ + "private_message_report_view" + ], + "additionalProperties": false, + "title": "PrivateMessageReportResponse", + "type": "object" + }, + "ResolvePrivateMessageReport": { + "properties": { + "report_id": { + "$ref": "#/components/schemas/PrivateMessageReportId", + "title": "ResolvePrivateMessageReport.report_id" + }, + "resolved": { + "title": "ResolvePrivateMessageReport.resolved", + "type": "boolean" + } + }, + "required": [ + "report_id", + "resolved" + ], + "additionalProperties": false, + "title": "ResolvePrivateMessageReport", + "type": "object" + }, + "ListPrivateMessageReports": { + "properties": { + "page": { + "title": "ListPrivateMessageReports.page", + "type": "integer" + }, + "limit": { + "title": "ListPrivateMessageReports.limit", + "type": "integer" + }, + "unresolved_only": { + "title": "ListPrivateMessageReports.unresolved_only", + "type": "boolean" + } + }, + "additionalProperties": false, + "title": "ListPrivateMessageReports", + "type": "object" + }, + "ListPrivateMessageReportsResponse": { + "properties": { + "private_message_reports": { + "items": { + "$ref": "#/components/schemas/PrivateMessageReportView" + }, + "title": "ListPrivateMessageReportsResponse.private_message_reports", + "type": "array" + } + }, + "required": [ + "private_message_reports" + ], + "additionalProperties": false, + "title": "ListPrivateMessageReportsResponse", + "type": "object" + }, + "GetPersonDetails": { + "properties": { + "person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "GetPersonDetails.person_id" + }, + "username": { + "title": "GetPersonDetails.username", + "type": "string" + }, + "sort": { + "$ref": "#/components/schemas/SortType", + "title": "GetPersonDetails.sort" + }, + "page": { + "title": "GetPersonDetails.page", + "type": "integer" + }, + "limit": { + "title": "GetPersonDetails.limit", + "type": "integer" + }, + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "GetPersonDetails.community_id" + }, + "saved_only": { + "title": "GetPersonDetails.saved_only", + "type": "boolean" + } + }, + "additionalProperties": false, + "title": "GetPersonDetails", + "type": "object" + }, + "GetPersonDetailsResponse": { + "properties": { + "person_view": { + "$ref": "#/components/schemas/PersonView", + "title": "GetPersonDetailsResponse.person_view" + }, + "site": { + "$ref": "#/components/schemas/Site", + "title": "GetPersonDetailsResponse.site" + }, + "comments": { + "items": { + "$ref": "#/components/schemas/CommentView" + }, + "title": "GetPersonDetailsResponse.comments", + "type": "array" + }, + "posts": { + "items": { + "$ref": "#/components/schemas/PostView" + }, + "title": "GetPersonDetailsResponse.posts", + "type": "array" + }, + "moderates": { + "items": { + "$ref": "#/components/schemas/CommunityModeratorView" + }, + "title": "GetPersonDetailsResponse.moderates", + "type": "array" + } + }, + "required": [ + "person_view", + "comments", + "posts", + "moderates" + ], + "additionalProperties": false, + "title": "GetPersonDetailsResponse", + "type": "object" + }, + "Register": { + "properties": { + "username": { + "title": "Register.username", + "type": "string" + }, + "password": { + "title": "Register.password", + "type": "string" + }, + "password_verify": { + "title": "Register.password_verify", + "type": "string" + }, + "show_nsfw": { + "title": "Register.show_nsfw", + "type": "boolean" + }, + "email": { + "title": "Register.email", + "type": "string" + }, + "captcha_uuid": { + "title": "Register.captcha_uuid", + "type": "string" + }, + "captcha_answer": { + "title": "Register.captcha_answer", + "type": "string" + }, + "honeypot": { + "title": "Register.honeypot", + "type": "string" + }, + "answer": { + "title": "Register.answer", + "type": "string" + } + }, + "required": [ + "username", + "password", + "password_verify" + ], + "additionalProperties": false, + "title": "Register", + "type": "object" + }, + "LoginResponse": { + "properties": { + "jwt": { + "title": "LoginResponse.jwt", + "type": "string" + }, + "registration_created": { + "title": "LoginResponse.registration_created", + "type": "boolean" + }, + "verify_email_sent": { + "title": "LoginResponse.verify_email_sent", + "type": "boolean" + } + }, + "required": [ + "registration_created", + "verify_email_sent" + ], + "additionalProperties": false, + "title": "LoginResponse", + "type": "object" + }, + "CaptchaResponse": { + "properties": { + "png": { + "title": "CaptchaResponse.png", + "type": "string" + }, + "wav": { + "title": "CaptchaResponse.wav", + "type": "string" + }, + "uuid": { + "title": "CaptchaResponse.uuid", + "type": "string" + } + }, + "required": [ + "png", + "wav", + "uuid" + ], + "additionalProperties": false, + "title": "CaptchaResponse", + "type": "object" + }, + "GetCaptchaResponse": { + "properties": { + "ok": { + "$ref": "#/components/schemas/CaptchaResponse", + "title": "GetCaptchaResponse.ok" + } + }, + "additionalProperties": false, + "title": "GetCaptchaResponse", + "type": "object" + }, + "GetPersonMentions": { + "properties": { + "sort": { + "$ref": "#/components/schemas/CommentSortType", + "title": "GetPersonMentions.sort" + }, + "page": { + "title": "GetPersonMentions.page", + "type": "integer" + }, + "limit": { + "title": "GetPersonMentions.limit", + "type": "integer" + }, + "unread_only": { + "title": "GetPersonMentions.unread_only", + "type": "boolean" + } + }, + "additionalProperties": false, + "title": "GetPersonMentions", + "type": "object" + }, + "PersonMentionId": { + "title": "PersonMentionId", + "type": "integer" + }, + "PersonMention": { + "properties": { + "id": { + "$ref": "#/components/schemas/PersonMentionId", + "title": "PersonMention.id" + }, + "recipient_id": { + "$ref": "#/components/schemas/PersonId", + "title": "PersonMention.recipient_id" + }, + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "PersonMention.comment_id" + }, + "read": { + "title": "PersonMention.read", + "type": "boolean" + }, + "published": { + "title": "PersonMention.published", + "type": "string" + } + }, + "required": [ + "id", + "recipient_id", + "comment_id", + "read", + "published" + ], + "additionalProperties": false, + "title": "PersonMention", + "type": "object" + }, + "PersonMentionView": { + "properties": { + "person_mention": { + "$ref": "#/components/schemas/PersonMention", + "title": "PersonMentionView.person_mention" + }, + "comment": { + "$ref": "#/components/schemas/Comment", + "title": "PersonMentionView.comment" + }, + "creator": { + "$ref": "#/components/schemas/Person", + "title": "PersonMentionView.creator" + }, + "post": { + "$ref": "#/components/schemas/Post", + "title": "PersonMentionView.post" + }, + "community": { + "$ref": "#/components/schemas/Community", + "title": "PersonMentionView.community" + }, + "recipient": { + "$ref": "#/components/schemas/Person", + "title": "PersonMentionView.recipient" + }, + "counts": { + "$ref": "#/components/schemas/CommentAggregates", + "title": "PersonMentionView.counts" + }, + "creator_banned_from_community": { + "title": "PersonMentionView.creator_banned_from_community", + "type": "boolean" + }, + "banned_from_community": { + "title": "PersonMentionView.banned_from_community", + "type": "boolean" + }, + "creator_is_moderator": { + "title": "PersonMentionView.creator_is_moderator", + "type": "boolean" + }, + "creator_is_admin": { + "title": "PersonMentionView.creator_is_admin", + "type": "boolean" + }, + "subscribed": { + "$ref": "#/components/schemas/SubscribedType", + "title": "PersonMentionView.subscribed" + }, + "saved": { + "title": "PersonMentionView.saved", + "type": "boolean" + }, + "creator_blocked": { + "title": "PersonMentionView.creator_blocked", + "type": "boolean" + }, + "my_vote": { + "title": "PersonMentionView.my_vote", + "type": "integer" + } + }, + "required": [ + "person_mention", + "comment", + "creator", + "post", + "community", + "recipient", + "counts", + "creator_banned_from_community", + "banned_from_community", + "creator_is_moderator", + "creator_is_admin", + "subscribed", + "saved", + "creator_blocked" + ], + "additionalProperties": false, + "title": "PersonMentionView", + "type": "object" + }, + "GetPersonMentionsResponse": { + "properties": { + "mentions": { + "items": { + "$ref": "#/components/schemas/PersonMentionView" + }, + "title": "GetPersonMentionsResponse.mentions", + "type": "array" + } + }, + "required": [ + "mentions" + ], + "additionalProperties": false, + "title": "GetPersonMentionsResponse", + "type": "object" + }, + "MarkPersonMentionAsRead": { + "properties": { + "person_mention_id": { + "$ref": "#/components/schemas/PersonMentionId", + "title": "MarkPersonMentionAsRead.person_mention_id" + }, + "read": { + "title": "MarkPersonMentionAsRead.read", + "type": "boolean" + } + }, + "required": [ + "person_mention_id", + "read" + ], + "additionalProperties": false, + "title": "MarkPersonMentionAsRead", + "type": "object" + }, + "PersonMentionResponse": { + "properties": { + "person_mention_view": { + "$ref": "#/components/schemas/PersonMentionView", + "title": "PersonMentionResponse.person_mention_view" + } + }, + "required": [ + "person_mention_view" + ], + "additionalProperties": false, + "title": "PersonMentionResponse", + "type": "object" + }, + "GetReplies": { + "properties": { + "sort": { + "$ref": "#/components/schemas/CommentSortType", + "title": "GetReplies.sort" + }, + "page": { + "title": "GetReplies.page", + "type": "integer" + }, + "limit": { + "title": "GetReplies.limit", + "type": "integer" + }, + "unread_only": { + "title": "GetReplies.unread_only", + "type": "boolean" + } + }, + "additionalProperties": false, + "title": "GetReplies", + "type": "object" + }, + "GetRepliesResponse": { + "properties": { + "replies": { + "items": { + "$ref": "#/components/schemas/CommentReplyView" + }, + "title": "GetRepliesResponse.replies", + "type": "array" + } + }, + "required": [ + "replies" + ], + "additionalProperties": false, + "title": "GetRepliesResponse", + "type": "object" + }, + "BanPerson": { + "properties": { + "person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "BanPerson.person_id" + }, + "ban": { + "title": "BanPerson.ban", + "type": "boolean" + }, + "remove_data": { + "title": "BanPerson.remove_data", + "type": "boolean" + }, + "reason": { + "title": "BanPerson.reason", + "type": "string" + }, + "expires": { + "title": "BanPerson.expires", + "type": "integer" + } + }, + "required": [ + "person_id", + "ban" + ], + "additionalProperties": false, + "title": "BanPerson", + "type": "object" + }, + "BanPersonResponse": { + "properties": { + "person_view": { + "$ref": "#/components/schemas/PersonView", + "title": "BanPersonResponse.person_view" + }, + "banned": { + "title": "BanPersonResponse.banned", + "type": "boolean" + } + }, + "required": [ + "person_view", + "banned" + ], + "additionalProperties": false, + "title": "BanPersonResponse", + "type": "object" + }, + "BannedPersonsResponse": { + "properties": { + "banned": { + "items": { + "$ref": "#/components/schemas/PersonView" + }, + "title": "BannedPersonsResponse.banned", + "type": "array" + } + }, + "required": [ + "banned" + ], + "additionalProperties": false, + "title": "BannedPersonsResponse", + "type": "object" + }, + "BlockPerson": { + "properties": { + "person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "BlockPerson.person_id" + }, + "block": { + "title": "BlockPerson.block", + "type": "boolean" + } + }, + "required": [ + "person_id", + "block" + ], + "additionalProperties": false, + "title": "BlockPerson", + "type": "object" + }, + "BlockPersonResponse": { + "properties": { + "person_view": { + "$ref": "#/components/schemas/PersonView", + "title": "BlockPersonResponse.person_view" + }, + "blocked": { + "title": "BlockPersonResponse.blocked", + "type": "boolean" + } + }, + "required": [ + "person_view", + "blocked" + ], + "additionalProperties": false, + "title": "BlockPersonResponse", + "type": "object" + }, + "Login": { + "properties": { + "username_or_email": { + "title": "Login.username_or_email", + "type": "string" + }, + "password": { + "title": "Login.password", + "type": "string" + }, + "totp_2fa_token": { + "title": "Login.totp_2fa_token", + "type": "string" + } + }, + "required": [ + "username_or_email", + "password" + ], + "additionalProperties": false, + "title": "Login", + "type": "object" + }, + "DeleteAccount": { + "properties": { + "password": { + "title": "DeleteAccount.password", + "type": "string" + }, + "delete_content": { + "title": "DeleteAccount.delete_content", + "type": "boolean" + } + }, + "required": [ + "password", + "delete_content" + ], + "additionalProperties": false, + "title": "DeleteAccount", + "type": "object" + }, + "PasswordReset": { + "properties": { + "email": { + "title": "PasswordReset.email", + "type": "string" + } + }, + "required": [ + "email" + ], + "additionalProperties": false, + "title": "PasswordReset", + "type": "object" + }, + "PasswordChangeAfterReset": { + "properties": { + "token": { + "title": "PasswordChangeAfterReset.token", + "type": "string" + }, + "password": { + "title": "PasswordChangeAfterReset.password", + "type": "string" + }, + "password_verify": { + "title": "PasswordChangeAfterReset.password_verify", + "type": "string" + } + }, + "required": [ + "token", + "password", + "password_verify" + ], + "additionalProperties": false, + "title": "PasswordChangeAfterReset", + "type": "object" + }, + "SaveUserSettings": { + "properties": { + "show_nsfw": { + "title": "SaveUserSettings.show_nsfw", + "type": "boolean" + }, + "blur_nsfw": { + "title": "SaveUserSettings.blur_nsfw", + "type": "boolean" + }, + "auto_expand": { + "title": "SaveUserSettings.auto_expand", + "type": "boolean" + }, + "theme": { + "title": "SaveUserSettings.theme", + "type": "string" + }, + "default_sort_type": { + "$ref": "#/components/schemas/SortType", + "title": "SaveUserSettings.default_sort_type" + }, + "default_listing_type": { + "$ref": "#/components/schemas/ListingType", + "title": "SaveUserSettings.default_listing_type" + }, + "interface_language": { + "title": "SaveUserSettings.interface_language", + "type": "string" + }, + "avatar": { + "title": "SaveUserSettings.avatar", + "type": "string" + }, + "banner": { + "title": "SaveUserSettings.banner", + "type": "string" + }, + "display_name": { + "title": "SaveUserSettings.display_name", + "type": "string" + }, + "email": { + "title": "SaveUserSettings.email", + "type": "string" + }, + "bio": { + "title": "SaveUserSettings.bio", + "type": "string" + }, + "matrix_user_id": { + "title": "SaveUserSettings.matrix_user_id", + "type": "string" + }, + "show_avatars": { + "title": "SaveUserSettings.show_avatars", + "type": "boolean" + }, + "send_notifications_to_email": { + "title": "SaveUserSettings.send_notifications_to_email", + "type": "boolean" + }, + "bot_account": { + "title": "SaveUserSettings.bot_account", + "type": "boolean" + }, + "show_bot_accounts": { + "title": "SaveUserSettings.show_bot_accounts", + "type": "boolean" + }, + "show_read_posts": { + "title": "SaveUserSettings.show_read_posts", + "type": "boolean" + }, + "discussion_languages": { + "items": { + "$ref": "#/components/schemas/LanguageId" + }, + "title": "SaveUserSettings.discussion_languages", + "type": "array" + }, + "open_links_in_new_tab": { + "title": "SaveUserSettings.open_links_in_new_tab", + "type": "boolean" + }, + "infinite_scroll_enabled": { + "title": "SaveUserSettings.infinite_scroll_enabled", + "type": "boolean" + }, + "post_listing_mode": { + "$ref": "#/components/schemas/PostListingMode", + "title": "SaveUserSettings.post_listing_mode" + }, + "enable_keyboard_navigation": { + "title": "SaveUserSettings.enable_keyboard_navigation", + "type": "boolean" + }, + "enable_animated_images": { + "title": "SaveUserSettings.enable_animated_images", + "type": "boolean" + }, + "collapse_bot_comments": { + "title": "SaveUserSettings.collapse_bot_comments", + "type": "boolean" + }, + "show_scores": { + "title": "SaveUserSettings.show_scores", + "type": "boolean" + }, + "show_upvotes": { + "title": "SaveUserSettings.show_upvotes", + "type": "boolean" + }, + "show_downvotes": { + "title": "SaveUserSettings.show_downvotes", + "type": "boolean" + }, + "show_upvote_percentage": { + "title": "SaveUserSettings.show_upvote_percentage", + "type": "boolean" + } + }, + "additionalProperties": false, + "title": "SaveUserSettings", + "type": "object" + }, + "ChangePassword": { + "properties": { + "new_password": { + "title": "ChangePassword.new_password", + "type": "string" + }, + "new_password_verify": { + "title": "ChangePassword.new_password_verify", + "type": "string" + }, + "old_password": { + "title": "ChangePassword.old_password", + "type": "string" + } + }, + "required": [ + "new_password", + "new_password_verify", + "old_password" + ], + "additionalProperties": false, + "title": "ChangePassword", + "type": "object" + }, + "GetReportCount": { + "properties": { + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "GetReportCount.community_id" + } + }, + "additionalProperties": false, + "title": "GetReportCount", + "type": "object" + }, + "GetReportCountResponse": { + "properties": { + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "GetReportCountResponse.community_id" + }, + "comment_reports": { + "title": "GetReportCountResponse.comment_reports", + "type": "integer" + }, + "post_reports": { + "title": "GetReportCountResponse.post_reports", + "type": "integer" + }, + "private_message_reports": { + "title": "GetReportCountResponse.private_message_reports", + "type": "integer" + } + }, + "required": [ + "comment_reports", + "post_reports" + ], + "additionalProperties": false, + "title": "GetReportCountResponse", + "type": "object" + }, + "GetUnreadCountResponse": { + "properties": { + "replies": { + "title": "GetUnreadCountResponse.replies", + "type": "integer" + }, + "mentions": { + "title": "GetUnreadCountResponse.mentions", + "type": "integer" + }, + "private_messages": { + "title": "GetUnreadCountResponse.private_messages", + "type": "integer" + } + }, + "required": [ + "replies", + "mentions", + "private_messages" + ], + "additionalProperties": false, + "title": "GetUnreadCountResponse", + "type": "object" + }, + "VerifyEmail": { + "properties": { + "token": { + "title": "VerifyEmail.token", + "type": "string" + } + }, + "required": [ + "token" + ], + "additionalProperties": false, + "title": "VerifyEmail", + "type": "object" + }, + "AddAdmin": { + "properties": { + "person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "AddAdmin.person_id" + }, + "added": { + "title": "AddAdmin.added", + "type": "boolean" + } + }, + "required": [ + "person_id", + "added" + ], + "additionalProperties": false, + "title": "AddAdmin", + "type": "object" + }, + "AddAdminResponse": { + "properties": { + "admins": { + "items": { + "$ref": "#/components/schemas/PersonView" + }, + "title": "AddAdminResponse.admins", + "type": "array" + } + }, + "required": [ + "admins" + ], + "additionalProperties": false, + "title": "AddAdminResponse", + "type": "object" + }, + "GetUnreadRegistrationApplicationCountResponse": { + "properties": { + "registration_applications": { + "title": "GetUnreadRegistrationApplicationCountResponse.registration_applications", + "type": "integer" + } + }, + "required": [ + "registration_applications" + ], + "additionalProperties": false, + "title": "GetUnreadRegistrationApplicationCountResponse", + "type": "object" + }, + "ListRegistrationApplications": { + "properties": { + "unread_only": { + "title": "ListRegistrationApplications.unread_only", + "type": "boolean" + }, + "page": { + "title": "ListRegistrationApplications.page", + "type": "integer" + }, + "limit": { + "title": "ListRegistrationApplications.limit", + "type": "integer" + } + }, + "additionalProperties": false, + "title": "ListRegistrationApplications", + "type": "object" + }, + "RegistrationApplicationId": { + "title": "RegistrationApplicationId", + "type": "integer" + }, + "RegistrationApplication": { + "properties": { + "id": { + "$ref": "#/components/schemas/RegistrationApplicationId", + "title": "RegistrationApplication.id" + }, + "local_user_id": { + "$ref": "#/components/schemas/LocalUserId", + "title": "RegistrationApplication.local_user_id" + }, + "answer": { + "title": "RegistrationApplication.answer", + "type": "string" + }, + "admin_id": { + "$ref": "#/components/schemas/PersonId", + "title": "RegistrationApplication.admin_id" + }, + "deny_reason": { + "title": "RegistrationApplication.deny_reason", + "type": "string" + }, + "published": { + "title": "RegistrationApplication.published", + "type": "string" + } + }, + "required": [ + "id", + "local_user_id", + "answer", + "published" + ], + "additionalProperties": false, + "title": "RegistrationApplication", + "type": "object" + }, + "RegistrationApplicationView": { + "properties": { + "registration_application": { + "$ref": "#/components/schemas/RegistrationApplication", + "title": "RegistrationApplicationView.registration_application" + }, + "creator_local_user": { + "$ref": "#/components/schemas/LocalUser", + "title": "RegistrationApplicationView.creator_local_user" + }, + "creator": { + "$ref": "#/components/schemas/Person", + "title": "RegistrationApplicationView.creator" + }, + "admin": { + "$ref": "#/components/schemas/Person", + "title": "RegistrationApplicationView.admin" + } + }, + "required": [ + "registration_application", + "creator_local_user", + "creator" + ], + "additionalProperties": false, + "title": "RegistrationApplicationView", + "type": "object" + }, + "ListRegistrationApplicationsResponse": { + "properties": { + "registration_applications": { + "items": { + "$ref": "#/components/schemas/RegistrationApplicationView" + }, + "title": "ListRegistrationApplicationsResponse.registration_applications", + "type": "array" + } + }, + "required": [ + "registration_applications" + ], + "additionalProperties": false, + "title": "ListRegistrationApplicationsResponse", + "type": "object" + }, + "ApproveRegistrationApplication": { + "properties": { + "id": { + "$ref": "#/components/schemas/RegistrationApplicationId", + "title": "ApproveRegistrationApplication.id" + }, + "approve": { + "title": "ApproveRegistrationApplication.approve", + "type": "boolean" + }, + "deny_reason": { + "title": "ApproveRegistrationApplication.deny_reason", + "type": "string" + } + }, + "required": [ + "id", + "approve" + ], + "additionalProperties": false, + "title": "ApproveRegistrationApplication", + "type": "object" + }, + "RegistrationApplicationResponse": { + "properties": { + "registration_application": { + "$ref": "#/components/schemas/RegistrationApplicationView", + "title": "RegistrationApplicationResponse.registration_application" + } + }, + "required": [ + "registration_application" + ], + "additionalProperties": false, + "title": "RegistrationApplicationResponse", + "type": "object" + }, + "PurgePerson": { + "properties": { + "person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "PurgePerson.person_id" + }, + "reason": { + "title": "PurgePerson.reason", + "type": "string" + } + }, + "required": [ + "person_id" + ], + "additionalProperties": false, + "title": "PurgePerson", + "type": "object" + }, + "PurgeCommunity": { + "properties": { + "community_id": { + "$ref": "#/components/schemas/CommunityId", + "title": "PurgeCommunity.community_id" + }, + "reason": { + "title": "PurgeCommunity.reason", + "type": "string" + } + }, + "required": [ + "community_id" + ], + "additionalProperties": false, + "title": "PurgeCommunity", + "type": "object" + }, + "PurgePost": { + "properties": { + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "PurgePost.post_id" + }, + "reason": { + "title": "PurgePost.reason", + "type": "string" + } + }, + "required": [ + "post_id" + ], + "additionalProperties": false, + "title": "PurgePost", + "type": "object" + }, + "PurgeComment": { + "properties": { + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "PurgeComment.comment_id" + }, + "reason": { + "title": "PurgeComment.reason", + "type": "string" + } + }, + "required": [ + "comment_id" + ], + "additionalProperties": false, + "title": "PurgeComment", + "type": "object" + }, + "EditCustomEmoji": { + "properties": { + "id": { + "$ref": "#/components/schemas/CustomEmojiId", + "title": "EditCustomEmoji.id" + }, + "category": { + "title": "EditCustomEmoji.category", + "type": "string" + }, + "image_url": { + "title": "EditCustomEmoji.image_url", + "type": "string" + }, + "alt_text": { + "title": "EditCustomEmoji.alt_text", + "type": "string" + }, + "keywords": { + "items": { + "type": "string" + }, + "title": "EditCustomEmoji.keywords", + "type": "array" + } + }, + "required": [ + "id", + "category", + "image_url", + "alt_text", + "keywords" + ], + "additionalProperties": false, + "title": "EditCustomEmoji", + "type": "object" + }, + "CustomEmojiResponse": { + "properties": { + "custom_emoji": { + "$ref": "#/components/schemas/CustomEmojiView", + "title": "CustomEmojiResponse.custom_emoji" + } + }, + "required": [ + "custom_emoji" + ], + "additionalProperties": false, + "title": "CustomEmojiResponse", + "type": "object" + }, + "CreateCustomEmoji": { + "properties": { + "category": { + "title": "CreateCustomEmoji.category", + "type": "string" + }, + "shortcode": { + "title": "CreateCustomEmoji.shortcode", + "type": "string" + }, + "image_url": { + "title": "CreateCustomEmoji.image_url", + "type": "string" + }, + "alt_text": { + "title": "CreateCustomEmoji.alt_text", + "type": "string" + }, + "keywords": { + "items": { + "type": "string" + }, + "title": "CreateCustomEmoji.keywords", + "type": "array" + } + }, + "required": [ + "category", + "shortcode", + "image_url", + "alt_text", + "keywords" + ], + "additionalProperties": false, + "title": "CreateCustomEmoji", + "type": "object" + }, + "DeleteCustomEmoji": { + "properties": { + "id": { + "$ref": "#/components/schemas/CustomEmojiId", + "title": "DeleteCustomEmoji.id" + } + }, + "required": [ + "id" + ], + "additionalProperties": false, + "title": "DeleteCustomEmoji", + "type": "object" + }, + "BlockInstance": { + "properties": { + "instance_id": { + "$ref": "#/components/schemas/InstanceId", + "title": "BlockInstance.instance_id" + }, + "block": { + "title": "BlockInstance.block", + "type": "boolean" + } + }, + "required": [ + "instance_id", + "block" + ], + "additionalProperties": false, + "title": "BlockInstance", + "type": "object" + }, + "BlockInstanceResponse": { + "properties": { + "blocked": { + "title": "BlockInstanceResponse.blocked", + "type": "boolean" + } + }, + "required": [ + "blocked" + ], + "additionalProperties": false, + "title": "BlockInstanceResponse", + "type": "object" + }, + "GenerateTotpSecretResponse": { + "properties": { + "totp_secret_url": { + "title": "GenerateTotpSecretResponse.totp_secret_url", + "type": "string" + } + }, + "required": [ + "totp_secret_url" + ], + "additionalProperties": false, + "title": "GenerateTotpSecretResponse", + "type": "object" + }, + "UpdateTotp": { + "properties": { + "totp_token": { + "title": "UpdateTotp.totp_token", + "type": "string" + }, + "enabled": { + "title": "UpdateTotp.enabled", + "type": "boolean" + } + }, + "required": [ + "totp_token", + "enabled" + ], + "additionalProperties": false, + "title": "UpdateTotp", + "type": "object" + }, + "UpdateTotpResponse": { + "properties": { + "enabled": { + "title": "UpdateTotpResponse.enabled", + "type": "boolean" + } + }, + "required": [ + "enabled" + ], + "additionalProperties": false, + "title": "UpdateTotpResponse", + "type": "object" + }, + "LoginToken": { + "properties": { + "user_id": { + "$ref": "#/components/schemas/LocalUserId", + "title": "LoginToken.user_id" + }, + "published": { + "title": "LoginToken.published", + "type": "string" + }, + "ip": { + "title": "LoginToken.ip", + "type": "string" + }, + "user_agent": { + "title": "LoginToken.user_agent", + "type": "string" + } + }, + "required": [ + "user_id", + "published" + ], + "additionalProperties": false, + "title": "LoginToken", + "type": "object" + }, + "ListPostLikes": { + "properties": { + "post_id": { + "$ref": "#/components/schemas/PostId", + "title": "ListPostLikes.post_id" + }, + "page": { + "title": "ListPostLikes.page", + "type": "integer" + }, + "limit": { + "title": "ListPostLikes.limit", + "type": "integer" + } + }, + "required": [ + "post_id" + ], + "additionalProperties": false, + "title": "ListPostLikes", + "type": "object" + }, + "VoteView": { + "properties": { + "creator": { + "$ref": "#/components/schemas/Person", + "title": "VoteView.creator" + }, + "creator_banned_from_community": { + "title": "VoteView.creator_banned_from_community", + "type": "boolean" + }, + "score": { + "title": "VoteView.score", + "type": "integer" + } + }, + "required": [ + "creator", + "creator_banned_from_community", + "score" + ], + "additionalProperties": false, + "title": "VoteView", + "type": "object" + }, + "ListPostLikesResponse": { + "properties": { + "post_likes": { + "items": { + "$ref": "#/components/schemas/VoteView" + }, + "title": "ListPostLikesResponse.post_likes", + "type": "array" + } + }, + "required": [ + "post_likes" + ], + "additionalProperties": false, + "title": "ListPostLikesResponse", + "type": "object" + }, + "ListCommentLikes": { + "properties": { + "comment_id": { + "$ref": "#/components/schemas/CommentId", + "title": "ListCommentLikes.comment_id" + }, + "page": { + "title": "ListCommentLikes.page", + "type": "integer" + }, + "limit": { + "title": "ListCommentLikes.limit", + "type": "integer" + } + }, + "required": [ + "comment_id" + ], + "additionalProperties": false, + "title": "ListCommentLikes", + "type": "object" + }, + "ListCommentLikesResponse": { + "properties": { + "comment_likes": { + "items": { + "$ref": "#/components/schemas/VoteView" + }, + "title": "ListCommentLikesResponse.comment_likes", + "type": "array" + } + }, + "required": [ + "comment_likes" + ], + "additionalProperties": false, + "title": "ListCommentLikesResponse", + "type": "object" + }, + "ListMedia": { + "properties": { + "page": { + "title": "ListMedia.page", + "type": "integer" + }, + "limit": { + "title": "ListMedia.limit", + "type": "integer" + } + }, + "additionalProperties": false, + "title": "ListMedia", + "type": "object" + }, + "LocalImage": { + "properties": { + "local_user_id": { + "$ref": "#/components/schemas/LocalUserId", + "title": "LocalImage.local_user_id" + }, + "pictrs_alias": { + "title": "LocalImage.pictrs_alias", + "type": "string" + }, + "pictrs_delete_token": { + "title": "LocalImage.pictrs_delete_token", + "type": "string" + }, + "published": { + "title": "LocalImage.published", + "type": "string" + } + }, + "required": [ + "pictrs_alias", + "pictrs_delete_token", + "published" + ], + "additionalProperties": false, + "title": "LocalImage", + "type": "object" + }, + "LocalImageView": { + "properties": { + "local_image": { + "$ref": "#/components/schemas/LocalImage", + "title": "LocalImageView.local_image" + }, + "person": { + "$ref": "#/components/schemas/Person", + "title": "LocalImageView.person" + } + }, + "required": [ + "local_image", + "person" + ], + "additionalProperties": false, + "title": "LocalImageView", + "type": "object" + }, + "ListMediaResponse": { + "properties": { + "images": { + "items": { + "$ref": "#/components/schemas/LocalImageView" + }, + "title": "ListMediaResponse.images", + "type": "array" + } + }, + "required": [ + "images" + ], + "additionalProperties": false, + "title": "ListMediaResponse", + "type": "object" + }, + "HidePost": { + "properties": { + "post_ids": { + "items": { + "$ref": "#/components/schemas/PostId" + }, + "title": "HidePost.post_ids", + "type": "array" + }, + "hide": { + "title": "HidePost.hide", + "type": "boolean" + } + }, + "required": [ + "post_ids", + "hide" + ], + "additionalProperties": false, + "title": "HidePost", + "type": "object" + }, + "GetRegistrationApplication": { + "properties": { + "person_id": { + "$ref": "#/components/schemas/PersonId", + "title": "GetRegistrationApplication.person_id" + } + }, + "required": [ + "person_id" + ], + "additionalProperties": false, + "title": "GetRegistrationApplication", + "type": "object" + } + } + } +} \ No newline at end of file diff --git a/spec/piefed_1_6.json b/spec/piefed_1_6.json new file mode 100644 index 000000000..6cdc2d065 --- /dev/null +++ b/spec/piefed_1_6.json @@ -0,0 +1,11973 @@ +{ + "security": [ + { + "bearerAuth": [] + } + ], + "components": { + "securitySchemes": { + "bearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + }, + "schemas": { + "Error": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "description": "Error code" + }, + "status": { + "type": "string", + "description": "Error name" + }, + "message": { + "type": "string", + "description": "Error message" + }, + "errors": { + "type": "object", + "description": "Errors", + "additionalProperties": {} + } + } + }, + "PaginationMetadata": { + "type": "object", + "properties": { + "total": { + "type": "integer" + }, + "total_pages": { + "type": "integer" + }, + "first_page": { + "type": "integer" + }, + "last_page": { + "type": "integer" + }, + "page": { + "type": "integer" + }, + "previous_page": { + "type": "integer" + }, + "next_page": { + "type": "integer" + } + } + }, + "DefaultError": { + "type": "object", + "properties": { + "message": { + "type": "string" + } + } + }, + "PersonAggregates": { + "type": "object", + "properties": { + "comment_count": { + "type": "integer" + }, + "person_id": { + "type": "integer" + }, + "post_count": { + "type": "integer" + } + }, + "required": [ + "comment_count", + "person_id", + "post_count" + ] + }, + "UserExtraField": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "label": { + "type": "string", + "example": "Pronouns" + }, + "text": { + "type": "string", + "example": "he/him, she/her, they/them, etc." + } + }, + "required": [ + "id", + "label", + "text" + ] + }, + "Person": { + "type": "object", + "properties": { + "actor_id": { + "type": "string", + "example": "https://piefed.social/u/rimu" + }, + "banned": { + "type": "boolean" + }, + "bot": { + "type": "boolean" + }, + "deleted": { + "type": "boolean" + }, + "id": { + "type": "integer" + }, + "instance_id": { + "type": "integer" + }, + "local": { + "type": "boolean" + }, + "user_name": { + "type": "string" + }, + "about": { + "type": "string", + "format": "markdown" + }, + "about_html": { + "type": "string", + "format": "html" + }, + "avatar": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "banner": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "extra_fields": { + "type": "array", + "maxItems": 4, + "items": { + "$ref": "#/components/schemas/UserExtraField" + } + }, + "note": { + "type": "string", + "maxLength": 50 + }, + "flair": { + "type": "string" + }, + "published": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "title": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "actor_id", + "banned", + "bot", + "deleted", + "id", + "instance_id", + "local", + "user_name" + ] + }, + "PersonView": { + "type": "object", + "properties": { + "activity_alert": { + "type": "boolean" + }, + "counts": { + "$ref": "#/components/schemas/PersonAggregates" + }, + "is_admin": { + "type": "boolean" + }, + "person": { + "$ref": "#/components/schemas/Person" + } + }, + "required": [ + "activity_alert", + "counts", + "is_admin", + "person" + ] + }, + "LanguageView": { + "type": "object", + "properties": { + "code": { + "type": "string", + "example": "en" + }, + "id": { + "type": "integer", + "example": "2" + }, + "name": { + "type": "string", + "example": "English" + } + } + }, + "Site": { + "type": "object", + "properties": { + "actor_id": { + "type": "string", + "format": "url", + "example": "https://piefed.social" + }, + "announcement_md": { + "type": "string", + "description": "The banner at the top of the home page", + "format": "markdown" + }, + "announcement": { + "type": "string", + "description": "The banner at the top of the home page", + "format": "html" + }, + "name": { + "type": "string" + }, + "all_languages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LanguageView" + } + }, + "description": { + "type": "string" + }, + "enable_downvotes": { + "type": "boolean" + }, + "icon": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "registration_mode": { + "type": "string", + "enum": [ + "Closed", + "RequireApplication", + "Open" + ] + }, + "sidebar": { + "type": "string", + "format": "html" + }, + "sidebar_md": { + "type": "string", + "format": "markdown" + }, + "user_count": { + "type": "integer" + } + }, + "required": [ + "actor_id", + "name" + ] + }, + "Community": { + "type": "object", + "properties": { + "actor_id": { + "type": "string", + "format": "url", + "example": "https://piefed.social/c/piefed_meta" + }, + "ap_domain": { + "type": "string", + "example": "piefed.social" + }, + "deleted": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "id": { + "type": "integer" + }, + "instance_id": { + "type": "integer" + }, + "local": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "nsfw": { + "type": "boolean" + }, + "ai_generated": { + "type": "boolean" + }, + "published": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "removed": { + "type": "boolean" + }, + "restricted_to_mods": { + "type": "boolean" + }, + "title": { + "type": "string" + }, + "banned": { + "type": "boolean" + }, + "question_answer": { + "type": "boolean" + }, + "banner": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "description": { + "type": "string", + "format": "markdown" + }, + "icon": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "posting_warning": { + "type": [ + "string", + "null" + ] + }, + "updated": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "actor_id", + "ai_generated", + "deleted", + "hidden", + "id", + "instance_id", + "local", + "name", + "nsfw", + "published", + "removed", + "restricted_to_mods", + "title" + ] + }, + "CommunityBlockView": { + "type": "object", + "properties": { + "community": { + "$ref": "#/components/schemas/Community" + }, + "person": { + "$ref": "#/components/schemas/Person" + } + } + }, + "CommunityFollowerView": { + "type": "object", + "properties": { + "community": { + "$ref": "#/components/schemas/Community" + }, + "follower": { + "$ref": "#/components/schemas/Person" + } + }, + "required": [ + "community", + "follower" + ] + }, + "Instance": { + "type": "object", + "properties": { + "domain": { + "type": "string", + "example": "piefed.social" + }, + "id": { + "type": "integer" + }, + "published": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "software": { + "type": "string" + }, + "updated": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "version": { + "type": "string" + } + }, + "required": [ + "domain", + "id", + "published" + ] + }, + "InstanceBlockView": { + "type": "object", + "properties": { + "instance": { + "$ref": "#/components/schemas/Instance" + }, + "person": { + "$ref": "#/components/schemas/Person" + } + }, + "required": [ + "instance", + "person" + ] + }, + "LocalUser": { + "type": "object", + "properties": { + "accept_private_messages": { + "type": "string", + "enum": [ + "None", + "Local", + "Trusted", + "All" + ], + "description": "Accept private messages from nobody, local users only, \"trusted\" instances, or any instance" + }, + "bot_visibility": { + "type": "string", + "enum": [ + "Show", + "Blur", + "Hide", + "Transparent" + ] + }, + "ai_visibility": { + "type": "string", + "enum": [ + "Show", + "Hide", + "Label", + "Transparent" + ] + }, + "community_keyword_filter": { + "type": "array", + "description": "Filter out communities with these words in their name", + "items": { + "type": "string" + } + }, + "default_comment_sort_type": { + "type": "string", + "enum": [ + "Hot", + "Top", + "TopAll", + "New", + "Old", + "Controversial" + ] + }, + "default_listing_type": { + "type": "string", + "enum": [ + "All", + "Local", + "Subscribed", + "Popular", + "Moderating", + "ModeratorView" + ] + }, + "default_sort_type": { + "type": "string", + "enum": [ + "Active", + "Hot", + "New", + "Top", + "TopHour", + "TopSixHour", + "TopTwelveHour", + "TopDay", + "TopWeek", + "TopMonth", + "TopThreeMonths", + "TopSixMonths", + "TopNineMonths", + "TopYear", + "TopAll", + "Scaled", + "Old", + "Relevance", + "TopPosts", + "TopSubscribers", + "NewFederated", + "OldFederated" + ] + }, + "email_unread": { + "type": "boolean", + "description": "Receive email about missed notifications (if set up by local admin)" + }, + "federate_votes": { + "type": "boolean", + "description": "If false, votes are only counted on local instance instead of federated remotely" + }, + "feed_auto_follow": { + "type": "boolean", + "description": "Automatically follow communities in a subscribed feed" + }, + "feed_auto_leave": { + "type": "boolean", + "description": "Automatically leave communities when unsubscribing from a feed. Does not impact communities joined outside of a feed auto-follow." + }, + "hide_low_quality": { + "type": "boolean", + "description": "Hide posts from communities marked as low-quality by the local instance admin" + }, + "indexable": { + "type": "boolean", + "description": "If posts can show up in search results" + }, + "newsletter": { + "type": "boolean", + "description": "Subscribe to the email newsletter that the local instance admin can send" + }, + "nsfl_visibility": { + "type": "string", + "enum": [ + "Show", + "Blur", + "Hide", + "Transparent" + ] + }, + "nsfw_visibility": { + "type": "string", + "enum": [ + "Show", + "Blur", + "Hide", + "Transparent" + ] + }, + "reply_collapse_threshold": { + "type": "integer", + "description": "Collapse replies with a score at or below this level" + }, + "reply_hide_threshold": { + "type": "integer", + "description": "Hide replies with a score at or below this level" + }, + "searchable": { + "type": "boolean", + "description": "If profile shows up in the user list on the instance" + }, + "show_bot_accounts": { + "type": "boolean", + "description": "True for any visibility option other than Hide" + }, + "show_nsfl": { + "type": "boolean", + "description": "True for any visibility option other than Hide" + }, + "show_nsfw": { + "type": "boolean", + "description": "True for any visibility option other than Hide" + }, + "show_read_posts": { + "type": "boolean" + }, + "show_scores": { + "type": "boolean" + } + }, + "required": [ + "accept_private_messages", + "ai_visibility", + "bot_visibility", + "default_comment_sort_type", + "default_listing_type", + "email_unread", + "federate_votes", + "feed_auto_follow", + "feed_auto_leave", + "hide_low_quality", + "indexable", + "newsletter", + "nsfl_visibility", + "nsfw_visibility", + "reply_collapse_threshold", + "reply_hide_threshold", + "searchable", + "show_bot_accounts", + "show_nsfl", + "show_nsfw", + "show_read_posts", + "show_scores" + ] + }, + "LocalUserView": { + "type": "object", + "properties": { + "counts": { + "$ref": "#/components/schemas/PersonAggregates" + }, + "local_user": { + "$ref": "#/components/schemas/LocalUser" + }, + "person": { + "$ref": "#/components/schemas/Person" + } + }, + "required": [ + "counts", + "local_user", + "person" + ] + }, + "CommunityModeratorView": { + "type": "object", + "properties": { + "community": { + "$ref": "#/components/schemas/Community" + }, + "moderator": { + "$ref": "#/components/schemas/Person" + } + }, + "required": [ + "community", + "moderator" + ] + }, + "PersonBlockView": { + "type": "object", + "properties": { + "person": { + "$ref": "#/components/schemas/Person" + }, + "target": { + "$ref": "#/components/schemas/Person" + } + }, + "required": [ + "person", + "target" + ] + }, + "MyUserInfo": { + "type": "object", + "properties": { + "community_blocks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityBlockView" + } + }, + "discussion_languages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LanguageView" + } + }, + "follows": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityFollowerView" + } + }, + "instance_blocks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InstanceBlockView" + } + }, + "local_user_view": { + "$ref": "#/components/schemas/LocalUserView" + }, + "moderates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityModeratorView" + } + }, + "person_blocks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonBlockView" + } + } + }, + "required": [ + "community_blocks", + "discussion_languages", + "follows", + "instance_blocks", + "local_user_view", + "moderates", + "person_blocks" + ] + }, + "GetSiteResponse": { + "type": "object", + "properties": { + "admins": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonView" + } + }, + "site": { + "$ref": "#/components/schemas/Site" + }, + "version": { + "type": "string", + "title": "Software version" + }, + "my_user": { + "$ref": "#/components/schemas/MyUserInfo" + } + }, + "required": [ + "admins", + "site", + "version" + ] + }, + "GetSiteVersionResponse": { + "type": "object", + "properties": { + "version": { + "type": "string" + } + }, + "required": [ + "version" + ] + }, + "BlockInstanceRequest": { + "type": "object", + "properties": { + "block": { + "type": "boolean" + }, + "instance_id": { + "type": "integer" + } + }, + "required": [ + "block", + "instance_id" + ] + }, + "BlockInstanceResponse": { + "type": "object", + "properties": { + "blocked": { + "type": "boolean" + } + }, + "required": [ + "blocked" + ] + }, + "GetSiteInstanceChooserResponse": { + "type": "object", + "properties": { + "language": { + "$ref": "#/components/schemas/LanguageView" + }, + "nsfw": { + "type": "boolean" + }, + "newbie_friendly": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "elevator_pitch": { + "type": "string" + }, + "description": { + "type": "string" + }, + "about": { + "type": "string" + }, + "sidebar": { + "type": "string" + }, + "logo_url": { + "type": "string", + "format": "url" + }, + "maturity": { + "type": "string" + }, + "tos_url": { + "type": "string", + "format": "url" + }, + "mau": { + "type": "integer" + }, + "can_make_communities": { + "type": "boolean" + }, + "defederation": { + "type": "array", + "items": { + "type": "string" + } + }, + "trusts": { + "type": "array", + "items": { + "type": "string" + } + }, + "registration_mode": { + "type": "string" + } + }, + "required": [ + "about", + "can_make_communities", + "defederation", + "description", + "elevator_pitch", + "language", + "logo_url", + "maturity", + "mau", + "name", + "newbie_friendly", + "nsfw", + "registration_mode", + "sidebar", + "tos_url", + "trusts" + ] + }, + "GetSiteInstanceChooserSearchResponseItem": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "domain": { + "type": "string" + }, + "elevator_pitch": { + "type": "string" + }, + "description": { + "type": "string" + }, + "about": { + "type": "string" + }, + "sidebar": { + "type": "string" + }, + "logo_url": { + "type": "string", + "format": "url" + }, + "maturity": { + "type": "string" + }, + "tos_url": { + "type": "string", + "format": "url" + }, + "uptime": { + "type": "string" + }, + "mau": { + "type": "integer" + }, + "can_make_communities": { + "type": "boolean" + }, + "newbie_friendly": { + "type": "boolean" + }, + "defederation": { + "type": "array", + "items": { + "type": "string" + } + }, + "trusts": { + "type": "array", + "items": { + "type": "string" + } + }, + "registration_mode": { + "type": "string" + }, + "language": { + "type": "string" + }, + "monthsmonitored": { + "type": "integer" + } + }, + "required": [ + "about", + "can_make_communities", + "defederation", + "description", + "domain", + "elevator_pitch", + "id", + "language", + "logo_url", + "maturity", + "mau", + "monthsmonitored", + "name", + "newbie_friendly", + "registration_mode", + "sidebar", + "tos_url", + "trusts", + "uptime" + ] + }, + "GetSiteInstanceChooserSearchResponse": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetSiteInstanceChooserSearchResponseItem" + } + } + }, + "required": [ + "result" + ] + }, + "CommunityAggregates": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "post_count": { + "type": "integer" + }, + "post_reply_count": { + "type": "integer" + }, + "published": { + "type": "string" + }, + "subscriptions_count": { + "type": "integer" + }, + "total_subscriptions_count": { + "type": "integer" + }, + "active_daily": { + "type": "integer" + }, + "active_weekly": { + "type": "integer" + }, + "active_monthly": { + "type": "integer" + }, + "active_6monthly": { + "type": "integer" + } + }, + "required": [ + "id", + "post_count", + "post_reply_count", + "published", + "subscriptions_count", + "total_subscriptions_count" + ] + }, + "CommunityFlair": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "community_id": { + "type": "integer" + }, + "flair_title": { + "type": "string" + }, + "text_color": { + "type": "string", + "example": "#000000", + "description": "Hex color code for the text of the flair" + }, + "background_color": { + "type": "string", + "example": "#DEDDDA", + "description": "Hex color code for the background of the flair" + }, + "blur_images": { + "type": "boolean" + }, + "ap_id": { + "type": [ + "string", + "null" + ], + "description": "Legacy tags that existed prior to 1.2 and some tags for remote communities might not have a defined ap_id", + "format": "url" + } + }, + "required": [ + "ap_id", + "background_color", + "blur_images", + "community_id", + "flair_title", + "id", + "text_color" + ] + }, + "CommunityView": { + "type": "object", + "properties": { + "activity_alert": { + "type": "boolean" + }, + "blocked": { + "type": "boolean" + }, + "community": { + "$ref": "#/components/schemas/Community" + }, + "counts": { + "$ref": "#/components/schemas/CommunityAggregates" + }, + "subscribed": { + "type": "string", + "enum": [ + "Subscribed", + "NotSubscribed", + "Pending" + ] + }, + "flair_list": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityFlair" + } + } + }, + "required": [ + "activity_alert", + "blocked", + "community", + "counts", + "subscribed" + ] + }, + "PostAggregates": { + "type": "object", + "properties": { + "comments": { + "type": "integer" + }, + "downvotes": { + "type": "integer" + }, + "newest_comment_time": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "post_id": { + "type": "integer" + }, + "published": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "score": { + "type": "integer" + }, + "upvotes": { + "type": "integer" + }, + "cross_posts": { + "type": "integer" + } + }, + "required": [ + "comments", + "cross_posts", + "downvotes", + "newest_comment_time", + "post_id", + "published", + "score", + "upvotes" + ] + }, + "WidthHeight": { + "type": "object", + "properties": { + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + } + } + }, + "MiniCrossPosts": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "reply_count": { + "type": "integer" + }, + "community_name": { + "type": "string" + } + } + }, + "Reactions": { + "type": "object", + "properties": { + "url": { + "type": [ + "string", + "null" + ] + }, + "token": { + "type": "string" + }, + "authors": { + "type": "array", + "items": { + "type": "string" + } + }, + "count": { + "type": "integer" + } + } + }, + "PostEvent": { + "type": "object", + "properties": { + "start": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "end": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "timezone": { + "type": "string", + "example": "America/New_York" + }, + "max_attendees": { + "type": "integer", + "default": 0 + }, + "participant_count": { + "type": "integer", + "default": 0 + }, + "full": { + "type": "boolean", + "default": false + }, + "online_link": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "join_mode": { + "type": "string", + "example": "free", + "description": "free, restricted, external, invite" + }, + "external_participation_url": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "anonymous_participation": { + "type": "boolean", + "default": false + }, + "online": { + "type": "boolean", + "default": false + }, + "buy_tickets_link": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "event_fee_currency": { + "type": "string", + "example": "USD" + }, + "event_fee_amount": { + "type": "number", + "default": 0 + }, + "location": { + "type": [ + "object", + "null" + ], + "description": "JSON object containing location details", + "additionalProperties": {} + } + }, + "required": [ + "start" + ] + }, + "PollChoice": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "choice_text": { + "type": "string" + }, + "sort_order": { + "type": "integer" + }, + "num_votes": { + "type": "integer", + "default": 0, + "description": "Value is ignored when creating/editing a poll" + } + }, + "required": [ + "choice_text", + "id", + "sort_order" + ] + }, + "PostPoll": { + "type": "object", + "properties": { + "end_poll": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "mode": { + "type": "string", + "enum": [ + "single", + "multiple" + ], + "example": "single", + "description": "single or multiple - determines whether people can vote for one or multiple options" + }, + "local_only": { + "type": "boolean", + "default": false + }, + "latest_vote": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "choices": { + "type": "array", + "maxItems": 10, + "items": { + "$ref": "#/components/schemas/PollChoice" + } + }, + "my_votes": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "required": [ + "choices", + "mode" + ] + }, + "Post": { + "type": "object", + "properties": { + "ap_id": { + "type": "string" + }, + "community_id": { + "type": "integer" + }, + "deleted": { + "type": "boolean" + }, + "id": { + "type": "integer" + }, + "language_id": { + "type": "integer" + }, + "local": { + "type": "boolean" + }, + "locked": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "ai_generated": { + "type": "boolean" + }, + "published": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "removed": { + "type": "boolean" + }, + "sticky": { + "type": "boolean" + }, + "instance_sticky": { + "type": "boolean" + }, + "title": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "alt_text": { + "type": "string" + }, + "body": { + "type": "string", + "format": "markdown" + }, + "small_thumbnail_url": { + "type": "string", + "format": "url" + }, + "thumbnail_url": { + "type": "string", + "format": "url" + }, + "updated": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "url": { + "type": "string", + "format": "url" + }, + "image_details": { + "$ref": "#/components/schemas/WidthHeight" + }, + "cross_posts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MiniCrossPosts" + } + }, + "post_type": { + "type": "string", + "enum": [ + "Link", + "Discussion", + "Image", + "Video", + "Poll", + "Event" + ] + }, + "tags": { + "type": [ + "string", + "null" + ] + }, + "flair": { + "type": [ + "string", + "null" + ] + }, + "emoji_reactions": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/Reactions" + } + }, + "event": { + "$ref": "#/components/schemas/PostEvent" + }, + "poll": { + "$ref": "#/components/schemas/PostPoll" + } + }, + "required": [ + "ai_generated", + "ap_id", + "community_id", + "deleted", + "id", + "instance_sticky", + "language_id", + "local", + "locked", + "nsfw", + "post_type", + "published", + "removed", + "sticky", + "title", + "user_id" + ] + }, + "PostView": { + "type": "object", + "properties": { + "banned_from_community": { + "type": "boolean" + }, + "community": { + "$ref": "#/components/schemas/Community" + }, + "counts": { + "$ref": "#/components/schemas/PostAggregates" + }, + "creator": { + "$ref": "#/components/schemas/Person" + }, + "creator_banned_from_community": { + "type": "boolean" + }, + "creator_is_admin": { + "type": "boolean" + }, + "creator_is_moderator": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "post": { + "$ref": "#/components/schemas/Post" + }, + "read": { + "type": "boolean" + }, + "saved": { + "type": "boolean" + }, + "subscribed": { + "type": "string", + "enum": [ + "Subscribed", + "NotSubscribed", + "Pending" + ] + }, + "unread_comments": { + "type": "integer" + }, + "activity_alert": { + "type": "boolean" + }, + "alt_text": { + "type": "string" + }, + "my_vote": { + "type": "integer" + }, + "flair_list": { + "type": "array", + "description": "See also the simpler 'flair' on post which can be used when editing", + "items": { + "$ref": "#/components/schemas/CommunityFlair" + } + }, + "can_auth_user_moderate": { + "type": "boolean" + } + }, + "required": [ + "banned_from_community", + "community", + "counts", + "creator", + "creator_banned_from_community", + "creator_is_admin", + "creator_is_moderator", + "hidden", + "post", + "read", + "saved", + "subscribed", + "unread_comments" + ] + }, + "Comment": { + "type": "object", + "properties": { + "ap_id": { + "type": "string", + "format": "url" + }, + "body": { + "type": "string", + "format": "markdown" + }, + "deleted": { + "type": "boolean" + }, + "id": { + "type": "integer" + }, + "language_id": { + "type": "integer" + }, + "local": { + "type": "boolean" + }, + "path": { + "type": "string" + }, + "post_id": { + "type": "integer" + }, + "published": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "removed": { + "type": "boolean" + }, + "user_id": { + "type": "integer" + }, + "distinguished": { + "type": "boolean" + }, + "updated": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "locked": { + "type": "boolean" + }, + "answer": { + "type": "boolean" + }, + "emoji_reactions": { + "type": [ + "array", + "null" + ], + "items": { + "$ref": "#/components/schemas/Reactions" + } + } + }, + "required": [ + "ap_id", + "body", + "deleted", + "id", + "language_id", + "local", + "path", + "post_id", + "published", + "removed", + "user_id" + ], + "additionalProperties": true + }, + "CommentAggregates": { + "type": "object", + "properties": { + "child_count": { + "type": "integer" + }, + "comment_id": { + "type": "integer" + }, + "downvotes": { + "type": "integer" + }, + "published": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "score": { + "type": "integer" + }, + "upvotes": { + "type": "integer" + } + }, + "required": [ + "child_count", + "comment_id", + "downvotes", + "published", + "score", + "upvotes" + ] + }, + "CommentView": { + "type": "object", + "properties": { + "activity_alert": { + "type": "boolean" + }, + "banned_from_community": { + "type": "boolean" + }, + "comment": { + "$ref": "#/components/schemas/Comment" + }, + "community": { + "$ref": "#/components/schemas/Community" + }, + "counts": { + "$ref": "#/components/schemas/CommentAggregates" + }, + "creator": { + "$ref": "#/components/schemas/Person" + }, + "creator_banned_from_community": { + "type": "boolean" + }, + "creator_blocked": { + "type": "boolean" + }, + "creator_is_admin": { + "type": "boolean" + }, + "creator_is_moderator": { + "type": "boolean" + }, + "post": { + "$ref": "#/components/schemas/Post" + }, + "saved": { + "type": "boolean" + }, + "subscribed": { + "type": "string", + "enum": [ + "Subscribed", + "NotSubscribed", + "Pending" + ], + "description": "Indicates whether auth'ed user is subscribed to the community this comment is in or not." + }, + "my_vote": { + "type": "integer" + }, + "can_auth_user_moderate": { + "type": "boolean" + } + }, + "required": [ + "activity_alert", + "banned_from_community", + "comment", + "community", + "counts", + "creator", + "creator_banned_from_community", + "creator_blocked", + "creator_is_admin", + "creator_is_moderator", + "post", + "saved", + "subscribed" + ] + }, + "SearchResponse": { + "type": "object", + "properties": { + "type_": { + "type": "string", + "enum": [ + "Communities", + "Posts", + "Users", + "Url", + "Comments" + ] + }, + "communities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityView" + } + }, + "posts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PostView" + } + }, + "users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonView" + } + }, + "comments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommentView" + } + } + }, + "required": [ + "comments", + "communities", + "posts", + "type_", + "users" + ] + }, + "FeedView": { + "type": "object", + "properties": { + "actor_id": { + "type": "string", + "format": "url" + }, + "ap_domain": { + "type": "string" + }, + "children": { + "type": "array", + "description": "Always empty list for resolve_object endpoint", + "items": { + "$ref": "#/components/schemas/FeedView" + } + }, + "communities": { + "type": "array", + "description": "Always empty list for resolve_object endpoint", + "items": { + "$ref": "#/components/schemas/Community" + } + }, + "communities_count": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "is_instance_feed": { + "type": "boolean" + }, + "local": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "nsfl": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "owner": { + "type": "boolean", + "description": "Is the authorized user the creator of the feed?" + }, + "public": { + "type": "boolean" + }, + "published": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "show_posts_from_children": { + "type": "boolean" + }, + "subscribed": { + "type": "boolean" + }, + "subscriptions_count": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "updated": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "user_id": { + "type": "integer", + "description": "user_id of the feed creator/owner" + }, + "banner": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "description": { + "type": [ + "string", + "null" + ], + "format": "markdown" + }, + "description_html": { + "type": [ + "string", + "null" + ], + "format": "html" + }, + "icon": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "parent_feed_id": { + "type": [ + "integer", + "null" + ] + } + }, + "required": [ + "actor_id", + "ap_domain", + "children", + "communities", + "communities_count", + "id", + "is_instance_feed", + "local", + "name", + "nsfl", + "nsfw", + "owner", + "public", + "published", + "show_posts_from_children", + "subscribed", + "subscriptions_count", + "title", + "updated", + "user_id" + ] + }, + "ResolveObjectResponse": { + "type": "object", + "properties": { + "comment": { + "$ref": "#/components/schemas/CommentView" + }, + "post": { + "$ref": "#/components/schemas/PostView" + }, + "community": { + "$ref": "#/components/schemas/CommunityView" + }, + "person": { + "$ref": "#/components/schemas/PersonView" + }, + "feed": { + "$ref": "#/components/schemas/FeedView" + } + } + }, + "InstanceWithoutFederationState": { + "type": "object", + "properties": { + "domain": { + "type": "string" + }, + "id": { + "type": "integer" + }, + "published": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "software": { + "type": "string" + }, + "updated": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "version": { + "type": "string" + } + }, + "required": [ + "domain", + "id", + "published" + ] + }, + "FederatedInstancesView": { + "type": "object", + "properties": { + "allowed": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InstanceWithoutFederationState" + } + }, + "blocked": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InstanceWithoutFederationState" + } + }, + "linked": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InstanceWithoutFederationState" + } + } + }, + "required": [ + "allowed", + "blocked", + "linked" + ] + }, + "GetFederatedInstancesResponse": { + "type": "object", + "properties": { + "federated_instances": { + "$ref": "#/components/schemas/FederatedInstancesView" + } + } + }, + "GetSuggestCompletionResponse": { + "type": "object", + "properties": { + "result": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "required": [ + "result" + ] + }, + "ModRemovePost": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "mod_person_id": { + "type": [ + "integer", + "null" + ] + }, + "post_id": { + "type": [ + "integer", + "null" + ] + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "removed": { + "type": "boolean" + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "id", + "mod_person_id", + "post_id", + "removed", + "when_" + ] + }, + "ModRemovePostView": { + "type": "object", + "properties": { + "mod_remove_post": { + "$ref": "#/components/schemas/ModRemovePost" + }, + "moderator": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + }, + "post": { + "anyOf": [ + { + "$ref": "#/components/schemas/Post" + }, + { + "type": "null" + } + ] + }, + "community": { + "anyOf": [ + { + "$ref": "#/components/schemas/Community" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "mod_remove_post" + ] + }, + "ModLockPost": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "mod_person_id": { + "type": [ + "integer", + "null" + ] + }, + "post_id": { + "type": [ + "integer", + "null" + ] + }, + "locked": { + "type": "boolean" + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "id", + "locked", + "mod_person_id", + "post_id", + "when_" + ] + }, + "ModLockPostView": { + "type": "object", + "properties": { + "mod_lock_post": { + "$ref": "#/components/schemas/ModLockPost" + }, + "moderator": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + }, + "post": { + "anyOf": [ + { + "$ref": "#/components/schemas/Post" + }, + { + "type": "null" + } + ] + }, + "community": { + "anyOf": [ + { + "$ref": "#/components/schemas/Community" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "mod_lock_post" + ] + }, + "ModFeaturePost": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "mod_person_id": { + "type": [ + "integer", + "null" + ] + }, + "post_id": { + "type": [ + "integer", + "null" + ] + }, + "featured": { + "type": "boolean" + }, + "is_featured_community": { + "type": "boolean" + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "featured", + "id", + "is_featured_community", + "mod_person_id", + "post_id", + "when_" + ] + }, + "ModFeaturePostView": { + "type": "object", + "properties": { + "mod_feature_post": { + "$ref": "#/components/schemas/ModFeaturePost" + }, + "moderator": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + }, + "post": { + "anyOf": [ + { + "$ref": "#/components/schemas/Post" + }, + { + "type": "null" + } + ] + }, + "community": { + "anyOf": [ + { + "$ref": "#/components/schemas/Community" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "mod_feature_post" + ] + }, + "ModRemoveComment": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "mod_person_id": { + "type": [ + "integer", + "null" + ] + }, + "comment_id": { + "type": [ + "integer", + "null" + ] + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "removed": { + "type": "boolean" + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "comment_id", + "id", + "mod_person_id", + "removed", + "when_" + ] + }, + "ModRemoveCommentView": { + "type": "object", + "properties": { + "mod_remove_comment": { + "$ref": "#/components/schemas/ModRemoveComment" + }, + "moderator": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + }, + "comment": { + "anyOf": [ + { + "$ref": "#/components/schemas/Comment" + }, + { + "type": "null" + } + ] + }, + "commenter": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + }, + "post": { + "anyOf": [ + { + "$ref": "#/components/schemas/Post" + }, + { + "type": "null" + } + ] + }, + "community": { + "anyOf": [ + { + "$ref": "#/components/schemas/Community" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "mod_remove_comment" + ] + }, + "ModRemoveCommunity": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "mod_person_id": { + "type": [ + "integer", + "null" + ] + }, + "community_id": { + "type": [ + "integer", + "null" + ] + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "removed": { + "type": "boolean" + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "community_id", + "id", + "mod_person_id", + "removed", + "when_" + ] + }, + "ModRemoveCommunityView": { + "type": "object", + "properties": { + "mod_remove_community": { + "$ref": "#/components/schemas/ModRemoveCommunity" + }, + "moderator": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + }, + "community": { + "anyOf": [ + { + "$ref": "#/components/schemas/Community" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "mod_remove_community" + ] + }, + "ModBanFromCommunity": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "mod_person_id": { + "type": [ + "integer", + "null" + ] + }, + "other_person_id": { + "type": [ + "integer", + "null" + ] + }, + "community_id": { + "type": [ + "integer", + "null" + ] + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "banned": { + "type": "boolean" + }, + "expires": { + "type": [ + "string", + "null" + ], + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "banned", + "community_id", + "id", + "mod_person_id", + "other_person_id", + "when_" + ] + }, + "ModBanFromCommunityView": { + "type": "object", + "properties": { + "mod_ban_from_community": { + "$ref": "#/components/schemas/ModBanFromCommunity" + }, + "moderator": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + }, + "community": { + "anyOf": [ + { + "$ref": "#/components/schemas/Community" + }, + { + "type": "null" + } + ] + }, + "banned_person": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "mod_ban_from_community" + ] + }, + "ModBan": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "mod_person_id": { + "type": [ + "integer", + "null" + ] + }, + "other_person_id": { + "type": [ + "integer", + "null" + ] + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "banned": { + "type": "boolean" + }, + "expires": { + "type": [ + "string", + "null" + ], + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "banned", + "id", + "mod_person_id", + "other_person_id", + "when_" + ] + }, + "ModBanView": { + "type": "object", + "properties": { + "mod_ban": { + "$ref": "#/components/schemas/ModBan" + }, + "moderator": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + }, + "banned_person": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "mod_ban" + ] + }, + "ModAddCommunity": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "mod_person_id": { + "type": [ + "integer", + "null" + ] + }, + "other_person_id": { + "type": [ + "integer", + "null" + ] + }, + "community_id": { + "type": [ + "integer", + "null" + ] + }, + "removed": { + "type": "boolean" + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "community_id", + "id", + "mod_person_id", + "other_person_id", + "removed", + "when_" + ] + }, + "ModAddCommunityView": { + "type": "object", + "properties": { + "mod_add_community": { + "$ref": "#/components/schemas/ModAddCommunity" + }, + "moderator": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + }, + "community": { + "anyOf": [ + { + "$ref": "#/components/schemas/Community" + }, + { + "type": "null" + } + ] + }, + "modded_person": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "mod_add_community" + ] + }, + "ModTransferCommunity": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "mod_person_id": { + "type": [ + "integer", + "null" + ] + }, + "other_person_id": { + "type": [ + "integer", + "null" + ] + }, + "community_id": { + "type": [ + "integer", + "null" + ] + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "community_id", + "id", + "mod_person_id", + "other_person_id", + "when_" + ] + }, + "ModTransferCommunityView": { + "type": "object", + "properties": { + "mod_transfer_community": { + "$ref": "#/components/schemas/ModTransferCommunity" + }, + "moderator": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + }, + "community": { + "$ref": "#/components/schemas/Community" + }, + "modded_person": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "community", + "mod_transfer_community" + ] + }, + "ModAdd": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "mod_person_id": { + "type": [ + "integer", + "null" + ] + }, + "other_person_id": { + "type": [ + "integer", + "null" + ] + }, + "removed": { + "type": "boolean" + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "id", + "mod_person_id", + "other_person_id", + "removed", + "when_" + ] + }, + "ModAddView": { + "type": "object", + "properties": { + "mod_add": { + "$ref": "#/components/schemas/ModAdd" + }, + "moderator": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + }, + "modded_person": { + "anyOf": [ + { + "$ref": "#/components/schemas/Person" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "mod_add" + ] + }, + "AdminPurgePerson": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "admin_person_id": { + "type": "integer" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "admin_person_id", + "id", + "when_" + ] + }, + "AdminPurgePersonView": { + "type": "object", + "properties": { + "admin_purge_person": { + "$ref": "#/components/schemas/AdminPurgePerson" + }, + "admin": { + "$ref": "#/components/schemas/Person" + } + }, + "required": [ + "admin_purge_person" + ] + }, + "AdminPurgeCommunity": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "admin_person_id": { + "type": "integer" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "admin_person_id", + "id", + "when_" + ] + }, + "AdminPurgeCommunityView": { + "type": "object", + "properties": { + "admin_purge_community": { + "$ref": "#/components/schemas/AdminPurgeCommunity" + }, + "admin": { + "$ref": "#/components/schemas/Person" + } + }, + "required": [ + "admin_purge_community" + ] + }, + "AdminPurgePost": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "admin_person_id": { + "type": "integer" + }, + "community_id": { + "type": [ + "integer", + "null" + ] + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "admin_person_id", + "community_id", + "id", + "when_" + ] + }, + "AdminPurgePostView": { + "type": "object", + "properties": { + "admin_purge_post": { + "$ref": "#/components/schemas/AdminPurgePost" + }, + "admin": { + "$ref": "#/components/schemas/Person" + }, + "community": { + "$ref": "#/components/schemas/Community" + } + }, + "required": [ + "admin_purge_post", + "community" + ] + }, + "AdminPurgeComment": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "admin_person_id": { + "type": "integer" + }, + "post_id": { + "type": "integer" + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "admin_person_id", + "id", + "post_id", + "when_" + ] + }, + "AdminPurgeCommentView": { + "type": "object", + "properties": { + "admin_purge_comment": { + "$ref": "#/components/schemas/AdminPurgeComment" + }, + "admin": { + "$ref": "#/components/schemas/Person" + }, + "post": { + "$ref": "#/components/schemas/Post" + } + }, + "required": [ + "admin_purge_comment", + "post" + ] + }, + "ModHideCommunity": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "community_id": { + "type": [ + "integer", + "null" + ] + }, + "mod_person_id": { + "type": [ + "integer", + "null" + ] + }, + "reason": { + "type": [ + "string", + "null" + ] + }, + "hidden": { + "type": "boolean" + }, + "when_": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "community_id", + "hidden", + "id", + "mod_person_id", + "when_" + ] + }, + "ModHideCommunityView": { + "type": "object", + "properties": { + "mod_hide_community": { + "$ref": "#/components/schemas/ModHideCommunity" + }, + "admin": { + "$ref": "#/components/schemas/Person" + }, + "community": { + "$ref": "#/components/schemas/Community" + } + }, + "required": [ + "community", + "mod_hide_community" + ] + }, + "GetModLogResponse": { + "type": "object", + "properties": { + "removed_posts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModRemovePostView" + } + }, + "locked_posts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModLockPostView" + } + }, + "featured_posts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModFeaturePostView" + } + }, + "removed_comments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModRemoveCommentView" + } + }, + "removed_communities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModRemoveCommunityView" + } + }, + "banned_from_community": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModBanFromCommunityView" + } + }, + "banned": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModBanView" + } + }, + "added_to_community": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModAddCommunityView" + } + }, + "transferred_to_community": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModTransferCommunityView" + } + }, + "added": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModAddView" + } + }, + "admin_purged_persons": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AdminPurgePersonView" + } + }, + "admin_purged_communities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AdminPurgeCommunityView" + } + }, + "admin_purged_posts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AdminPurgePostView" + } + }, + "admin_purged_comments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/AdminPurgeCommentView" + } + }, + "hidden_communities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ModHideCommunityView" + } + } + }, + "required": [ + "added", + "added_to_community", + "admin_purged_comments", + "admin_purged_communities", + "admin_purged_persons", + "admin_purged_posts", + "banned", + "banned_from_community", + "featured_posts", + "hidden_communities", + "locked_posts", + "removed_comments", + "removed_communities", + "removed_posts", + "transferred_to_community" + ] + }, + "GetCommunityResponse": { + "type": "object", + "properties": { + "community_view": { + "$ref": "#/components/schemas/CommunityView" + }, + "discussion_languages": { + "type": "array", + "items": { + "type": "integer" + } + }, + "moderators": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityModeratorView" + } + }, + "site": { + "$ref": "#/components/schemas/Site" + } + }, + "required": [ + "community_view", + "discussion_languages", + "moderators" + ] + }, + "ListCommunitiesResponse": { + "type": "object", + "properties": { + "communities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityView" + } + }, + "next_page": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "communities" + ] + }, + "FollowCommunityRequest": { + "type": "object", + "properties": { + "community_id": { + "type": "integer" + }, + "follow": { + "type": "boolean" + } + }, + "required": [ + "community_id", + "follow" + ] + }, + "CommunityResponse": { + "type": "object", + "properties": { + "community_view": { + "$ref": "#/components/schemas/CommunityView" + }, + "discussion_languages": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "required": [ + "community_view", + "discussion_languages" + ] + }, + "UserMeResponse": { + "type": "object", + "properties": { + "community_blocks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityBlockView" + } + }, + "discussion_languages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LanguageView" + } + }, + "follows": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityFollowerView" + } + }, + "instance_blocks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/InstanceBlockView" + } + }, + "local_user_view": { + "$ref": "#/components/schemas/LocalUserView" + }, + "moderates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityModeratorView" + } + }, + "person_blocks": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PersonBlockView" + } + } + }, + "required": [ + "community_blocks", + "discussion_languages", + "follows", + "instance_blocks", + "local_user_view", + "moderates", + "person_blocks" + ] + }, + "BlockCommunityRequest": { + "type": "object", + "properties": { + "block": { + "type": "boolean" + }, + "community_id": { + "type": "integer" + } + }, + "required": [ + "block", + "community_id" + ] + }, + "BlockCommunityResponse": { + "type": "object", + "properties": { + "community_view": { + "$ref": "#/components/schemas/CommunityView" + }, + "blocked": { + "type": "boolean" + } + }, + "required": [ + "blocked", + "community_view" + ] + }, + "CreateCommunityRequest": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "title": { + "type": "string" + }, + "banner_url": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "description": { + "type": "string", + "format": "markdown" + }, + "discussion_languages": { + "type": "array", + "items": { + "type": "integer" + } + }, + "icon_url": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "local_only": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "question_answer": { + "type": "boolean" + }, + "restricted_to_mods": { + "type": "boolean" + }, + "rules": { + "type": "string" + } + }, + "required": [ + "name", + "title" + ] + }, + "EditCommunityRequest": { + "type": "object", + "properties": { + "community_id": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "banner_url": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "description": { + "type": "string", + "format": "markdown" + }, + "discussion_languages": { + "type": "array", + "items": { + "type": "integer" + } + }, + "icon_url": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "local_only": { + "type": "boolean" + }, + "nsfw": { + "type": "boolean" + }, + "restricted_to_mods": { + "type": "boolean" + }, + "question_answer": { + "type": "boolean" + }, + "rules": { + "type": "string" + } + }, + "required": [ + "community_id" + ] + }, + "SubscribeCommunityRequest": { + "type": "object", + "properties": { + "community_id": { + "type": "integer" + }, + "subscribe": { + "type": "boolean" + } + }, + "required": [ + "community_id", + "subscribe" + ] + }, + "DeleteCommunityRequest": { + "type": "object", + "properties": { + "community_id": { + "type": "integer" + }, + "deleted": { + "type": "boolean" + } + }, + "required": [ + "community_id", + "deleted" + ] + }, + "ModCommunityRequest": { + "type": "object", + "properties": { + "added": { + "type": "boolean" + }, + "community_id": { + "type": "integer" + }, + "person_id": { + "type": "integer" + } + }, + "required": [ + "added", + "community_id", + "person_id" + ] + }, + "ModCommunityResponse": { + "type": "object", + "properties": { + "moderators": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityModeratorView" + } + } + }, + "required": [ + "moderators" + ] + }, + "CommunityModerationBanItem": { + "type": "object", + "properties": { + "banned_by": { + "$ref": "#/components/schemas/Person" + }, + "banned_user": { + "$ref": "#/components/schemas/Person" + }, + "community": { + "$ref": "#/components/schemas/Community" + }, + "expired": { + "type": "boolean" + }, + "expired_at": { + "type": [ + "string", + "null" + ], + "example": "2025-06-07T02:29:07.980084Z, null=permanent ban", + "format": "datetime" + }, + "expires_at": { + "type": [ + "string", + "null" + ], + "example": "2025-06-07T02:29:07.980084Z, null=permanent ban", + "format": "datetime" + }, + "reason": { + "type": "string" + } + } + }, + "CommunityModerationBansListResponse": { + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityModerationBanItem" + } + }, + "next_page": { + "type": [ + "string", + "null" + ] + } + } + }, + "CommunityModerationUnbanRequest": { + "type": "object", + "properties": { + "community_id": { + "type": "integer" + }, + "user_id": { + "type": "integer" + } + }, + "required": [ + "community_id", + "user_id" + ] + }, + "CommunityModerationBanRequest": { + "type": "object", + "properties": { + "community_id": { + "type": "integer" + }, + "reason": { + "type": "string" + }, + "user_id": { + "type": "integer" + }, + "expires_at": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "permanent": { + "type": "boolean" + } + }, + "required": [ + "community_id", + "reason", + "user_id" + ] + }, + "CommunityModerationNsfwRequest": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "nsfw_status": { + "type": "boolean" + } + }, + "required": [ + "nsfw_status", + "post_id" + ] + }, + "CommunityFlairCreateRequest": { + "type": "object", + "properties": { + "community_id": { + "type": "integer" + }, + "flair_title": { + "type": "string" + }, + "text_color": { + "type": "string", + "default": "#000000", + "example": "#000 or #000000", + "description": "Hex color code for the text of the flair." + }, + "background_color": { + "type": "string", + "default": "#DEDDDA", + "example": "#fff or #FFFFFF", + "description": "Hex color code for the background of the flair." + }, + "blur_images": { + "type": "boolean", + "default": false + } + }, + "required": [ + "community_id", + "flair_title" + ] + }, + "CommunityFlairCreateResponse": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "community_id": { + "type": "integer" + }, + "flair_title": { + "type": "string" + }, + "text_color": { + "type": "string", + "example": "#000000", + "description": "Hex color code for the text of the flair" + }, + "background_color": { + "type": "string", + "example": "#DEDDDA", + "description": "Hex color code for the background of the flair" + }, + "blur_images": { + "type": "boolean" + }, + "ap_id": { + "type": [ + "string", + "null" + ], + "description": "Legacy tags that existed prior to 1.2 and some tags for remote communities might not have a defined ap_id", + "format": "url" + } + }, + "required": [ + "ap_id", + "background_color", + "blur_images", + "community_id", + "flair_title", + "id", + "text_color" + ] + }, + "CommunityFlairEditRequest": { + "type": "object", + "properties": { + "flair_id": { + "type": "integer" + }, + "flair_title": { + "type": "string" + }, + "text_color": { + "type": "string", + "example": "#000 or #000000", + "description": "Hex color code for the text of the flair." + }, + "background_color": { + "type": "string", + "example": "#fff or #FFFFFF", + "description": "Hex color code for the background of the flair." + }, + "blur_images": { + "type": "boolean" + } + }, + "required": [ + "flair_id" + ] + }, + "CommunityFlairEditResponse": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "community_id": { + "type": "integer" + }, + "flair_title": { + "type": "string" + }, + "text_color": { + "type": "string", + "example": "#000000", + "description": "Hex color code for the text of the flair" + }, + "background_color": { + "type": "string", + "example": "#DEDDDA", + "description": "Hex color code for the background of the flair" + }, + "blur_images": { + "type": "boolean" + }, + "ap_id": { + "type": [ + "string", + "null" + ], + "description": "Legacy tags that existed prior to 1.2 and some tags for remote communities might not have a defined ap_id", + "format": "url" + } + }, + "required": [ + "ap_id", + "background_color", + "blur_images", + "community_id", + "flair_title", + "id", + "text_color" + ] + }, + "CommunityFlairDeleteRequest": { + "type": "object", + "properties": { + "flair_id": { + "type": "integer" + } + }, + "required": [ + "flair_id" + ] + }, + "CommunityFlairDeleteResponse": { + "type": "object", + "properties": { + "community_view": { + "$ref": "#/components/schemas/CommunityView" + }, + "discussion_languages": { + "type": "array", + "items": { + "type": "integer" + } + }, + "moderators": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityModeratorView" + } + }, + "site": { + "$ref": "#/components/schemas/Site" + } + }, + "required": [ + "community_view", + "discussion_languages", + "moderators" + ] + }, + "FeedListResponse": { + "type": "object", + "properties": { + "feeds": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FeedView" + } + } + }, + "required": [ + "feeds" + ] + }, + "FollowFeedRequest": { + "type": "object", + "properties": { + "feed_id": { + "type": "integer" + }, + "follow": { + "type": "boolean" + } + }, + "required": [ + "feed_id", + "follow" + ] + }, + "CreateFeedRequest": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "URL-safe name/slug for the feed" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string", + "format": "markdown" + }, + "icon_url": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "banner_url": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "nsfw": { + "type": "boolean" + }, + "nsfl": { + "type": "boolean" + }, + "public": { + "type": "boolean", + "default": true, + "description": "Whether the feed is publicly visible" + }, + "communities": { + "type": "string", + "description": "Newline-separated list of community ap_ids to include in the feed" + }, + "is_instance_feed": { + "type": "boolean", + "description": "Whether this is an instance-level feed (admin only)" + }, + "show_child_posts": { + "type": "boolean", + "description": "Whether to show posts from child feeds" + }, + "parent_feed_id": { + "type": [ + "integer", + "null" + ], + "description": "ID of parent feed, if any" + } + }, + "required": [ + "name", + "title" + ] + }, + "EditFeedRequest": { + "type": "object", + "properties": { + "feed_id": { + "type": "integer" + }, + "url": { + "type": "string", + "description": "URL-safe name/slug for the feed" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string", + "format": "markdown" + }, + "icon_url": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "banner_url": { + "type": [ + "string", + "null" + ], + "format": "url" + }, + "nsfw": { + "type": "boolean" + }, + "nsfl": { + "type": "boolean" + }, + "public": { + "type": "boolean" + }, + "communities": { + "type": "string", + "description": "Newline-separated list of community ap_ids; omit to keep existing communities" + }, + "is_instance_feed": { + "type": "boolean" + }, + "show_child_posts": { + "type": "boolean" + }, + "parent_feed_id": { + "type": [ + "integer", + "null" + ] + } + }, + "required": [ + "feed_id" + ] + }, + "DeleteFeedRequest": { + "type": "object", + "properties": { + "feed_id": { + "type": "integer" + }, + "deleted": { + "type": "boolean" + } + }, + "required": [ + "deleted", + "feed_id" + ] + }, + "TopicView": { + "type": "object", + "properties": { + "children": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TopicView" + } + }, + "communities": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Community" + } + }, + "communities_count": { + "type": "integer" + }, + "id": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "show_posts_from_children": { + "type": "boolean" + }, + "title": { + "type": "string" + }, + "parent_topic_id": { + "type": [ + "integer", + "null" + ] + } + }, + "required": [ + "children", + "communities", + "communities_count", + "id", + "name", + "show_posts_from_children", + "title" + ] + }, + "TopicListResponse": { + "type": "object", + "properties": { + "topics": { + "type": "array", + "items": { + "$ref": "#/components/schemas/TopicView" + } + } + }, + "required": [ + "topics" + ] + }, + "DomainBlockRequest": { + "type": "object", + "properties": { + "block": { + "type": "boolean" + }, + "domain": { + "type": "string" + } + }, + "required": [ + "block", + "domain" + ] + }, + "DomainBlockResponse": { + "type": "object", + "properties": { + "blocked": { + "type": "boolean" + } + }, + "required": [ + "blocked" + ] + }, + "GetUserResponse": { + "type": "object", + "properties": { + "comments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommentView" + } + }, + "moderates": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityModeratorView" + } + }, + "person_view": { + "$ref": "#/components/schemas/PersonView" + }, + "posts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PostView" + } + }, + "site": { + "$ref": "#/components/schemas/Site" + } + }, + "required": [ + "comments", + "moderates", + "person_view", + "posts" + ] + }, + "UserLoginRequest": { + "type": "object", + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string" + } + }, + "required": [ + "password", + "username" + ] + }, + "UserLoginResponse": { + "type": "object", + "properties": { + "jwt": { + "type": "string" + } + }, + "required": [ + "jwt" + ] + }, + "UserUnreadCountsResponse": { + "type": "object", + "properties": { + "mentions": { + "type": "integer", + "description": "Post and comment mentions" + }, + "private_messages": { + "type": "integer" + }, + "replies": { + "type": "integer", + "description": "Replies to posts and comments" + }, + "other": { + "type": "integer", + "description": "Any other type of notification (reports, activity alerts, etc.)" + } + }, + "required": [ + "mentions", + "other", + "private_messages", + "replies" + ] + }, + "CommentReply": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "comment_id": { + "type": "integer" + }, + "published": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "read": { + "type": "boolean" + }, + "recipient_id": { + "type": "integer" + } + }, + "required": [ + "comment_id", + "id", + "published", + "read", + "recipient_id" + ] + }, + "CommentReplyView": { + "type": "object", + "properties": { + "activity_alert": { + "type": "boolean" + }, + "comment": { + "$ref": "#/components/schemas/Comment" + }, + "comment_reply": { + "$ref": "#/components/schemas/CommentReply" + }, + "community": { + "$ref": "#/components/schemas/Community" + }, + "counts": { + "$ref": "#/components/schemas/CommentAggregates" + }, + "creator": { + "$ref": "#/components/schemas/Person" + }, + "creator_banned_from_community": { + "type": "boolean" + }, + "creator_blocked": { + "type": "boolean" + }, + "creator_is_admin": { + "type": "boolean" + }, + "creator_is_moderator": { + "type": "boolean" + }, + "my_vote": { + "type": "integer" + }, + "post": { + "$ref": "#/components/schemas/Post" + }, + "recipient": { + "$ref": "#/components/schemas/Person" + }, + "saved": { + "type": "boolean" + }, + "subscribed": { + "type": "string", + "enum": [ + "Subscribed", + "NotSubscribed", + "Pending" + ] + } + }, + "required": [ + "activity_alert", + "comment", + "comment_reply", + "community", + "counts", + "creator", + "creator_banned_from_community", + "creator_blocked", + "creator_is_admin", + "creator_is_moderator", + "my_vote", + "post", + "recipient", + "saved", + "subscribed" + ] + }, + "UserRepliesResponse": { + "type": "object", + "properties": { + "next_page": { + "type": [ + "string", + "null" + ] + }, + "replies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommentReplyView" + } + } + }, + "required": [ + "replies" + ] + }, + "UserMentionsResponse": { + "type": "object", + "properties": { + "next_page": { + "type": [ + "string", + "null" + ] + }, + "replies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommentReplyView" + } + } + }, + "required": [ + "replies" + ] + }, + "MediaView": { + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "url" + }, + "name": { + "type": "string" + } + } + }, + "UserMediaResponse": { + "type": "object", + "properties": { + "next_page": { + "type": [ + "string", + "null" + ] + }, + "media": { + "type": "array", + "items": { + "$ref": "#/components/schemas/MediaView" + } + } + }, + "required": [ + "media" + ] + }, + "UserBlockRequest": { + "type": "object", + "properties": { + "block": { + "type": "boolean" + }, + "person_id": { + "type": "integer" + } + }, + "required": [ + "block", + "person_id" + ] + }, + "UserBlockResponse": { + "type": "object", + "properties": { + "blocked": { + "type": "boolean" + }, + "person_view": { + "$ref": "#/components/schemas/PersonView" + } + }, + "required": [ + "blocked", + "person_view" + ] + }, + "UserMarkAllReadResponse": { + "type": "object", + "properties": { + "replies": { + "type": "array", + "description": "Should be empty list", + "items": { + "$ref": "#/components/schemas/CommentReplyView" + } + } + }, + "required": [ + "replies" + ] + }, + "UserSubscribeRequest": { + "type": "object", + "properties": { + "person_id": { + "type": "integer" + }, + "subscribe": { + "type": "boolean" + } + }, + "required": [ + "person_id", + "subscribe" + ] + }, + "UserSubscribeResponse": { + "type": "object", + "properties": { + "person_view": { + "$ref": "#/components/schemas/PersonView" + }, + "subscribed": { + "type": "boolean" + } + }, + "required": [ + "person_view", + "subscribed" + ] + }, + "NewUserExtraField": { + "type": "object", + "properties": { + "id": { + "type": [ + "integer", + "null" + ], + "description": "Pass an id of an existing extra field with null/missing/empty label or text to remove a field. Pass an id of an existing extra field with both label and text to edit an existing extra field." + }, + "label": { + "type": [ + "string", + "null" + ], + "description": "Pass a label and text without an id to create a new extra field." + }, + "text": { + "type": [ + "string", + "null" + ], + "description": "Pass a label and text without an id to create a new extra field." + } + } + }, + "UserSaveSettingsRequest": { + "type": "object", + "properties": { + "accept_private_messages": { + "type": "string", + "enum": [ + "None", + "Local", + "Trusted", + "All" + ], + "description": "Accept private messages from nobody, local users only, \"trusted\" instances, or any instance" + }, + "avatar": { + "type": [ + "string", + "null" + ], + "format": "url", + "description": "Pass a null value to remove the image" + }, + "bio": { + "type": "string", + "format": "markdown" + }, + "bot": { + "type": "boolean", + "description": "This user is a bot" + }, + "bot_visibility": { + "type": "string", + "enum": [ + "Show", + "Blur", + "Hide", + "Transparent" + ] + }, + "community_keyword_filter": { + "type": [ + "array", + "null" + ], + "description": "Filter out communities with these words in their name. Pass null to remove any filters.", + "items": { + "type": "string" + } + }, + "cover": { + "type": [ + "string", + "null" + ], + "format": "url", + "description": "Pass a null value to remove the image" + }, + "default_comment_sort_type": { + "type": "string", + "enum": [ + "Hot", + "Top", + "New", + "Old" + ] + }, + "default_sort_type": { + "type": "string", + "enum": [ + "Hot", + "Top", + "New", + "Active", + "Old", + "Scaled" + ] + }, + "email_unread": { + "type": "boolean", + "description": "Receive email about missed notifications (if set up by local admin)" + }, + "extra_fields": { + "type": "array", + "description": "A user can't have more than four total extra fields.", + "items": { + "$ref": "#/components/schemas/NewUserExtraField" + } + }, + "federate_votes": { + "type": "boolean", + "description": "If false, votes are only counted on local instance instead of federated remotely" + }, + "feed_auto_follow": { + "type": "boolean", + "description": "Automatically follow communities in a subscribed feed" + }, + "feed_auto_leave": { + "type": "boolean", + "description": "Automatically leave communities when unsubscribing from a feed. Does not impact communities joined outside of a feed auto-follow." + }, + "hide_low_quality": { + "type": "boolean", + "description": "Hide posts from communities marked as low-quality by the local instance admin" + }, + "indexable": { + "type": "boolean", + "description": "If posts can show up in search results" + }, + "newsletter": { + "type": "boolean", + "description": "Subscribe to the email newsletter that the local instance admin can send" + }, + "nsfl_visibility": { + "type": "string", + "enum": [ + "Show", + "Blur", + "Hide", + "Transparent" + ], + "description": "Overrides the show_nsfl field if provided" + }, + "nsfw_visibility": { + "type": "string", + "enum": [ + "Show", + "Blur", + "Hide", + "Transparent" + ], + "description": "Overrides the show_nsfw field if provided" + }, + "genai_visibility": { + "type": "string", + "enum": [ + "Show", + "Hide", + "Label", + "Transparent" + ], + "description": "Overrides the show_genai field if provided" + }, + "reply_collapse_threshold": { + "type": "integer", + "description": "Collapse replies with a score at or below this level" + }, + "reply_hide_threshold": { + "type": "integer", + "description": "Hide replies with a score at or below this level" + }, + "show_nsfw": { + "type": "boolean" + }, + "show_nsfl": { + "type": "boolean" + }, + "show_read_posts": { + "type": "boolean" + }, + "searchable": { + "type": "boolean", + "description": "If profile shows up in the user list on the instance" + } + } + }, + "UserSaveSettingsResponse": { + "type": "object", + "properties": { + "my_user": { + "$ref": "#/components/schemas/MyUserInfo" + } + } + }, + "UserNotificationsCounts": { + "type": "object", + "properties": { + "unread": { + "type": "integer" + }, + "read": { + "type": "integer" + }, + "total": { + "type": "integer" + } + }, + "required": [ + "read", + "total", + "unread" + ] + }, + "UserNotificationItemView": { + "type": "object", + "properties": { + "author": { + "description": "returned for all notif types", + "$ref": "#/components/schemas/Person" + }, + "notif_body": { + "type": "string", + "description": "returned for all notif types" + }, + "notif_id": { + "type": "integer", + "description": "returned for all notif types" + }, + "notif_subtype": { + "type": "string", + "description": "returned for all notif types" + }, + "notif_type": { + "type": "integer", + "description": "returned for all notif types" + }, + "status": { + "type": "string", + "enum": [ + "Unread", + "Read" + ], + "description": "returned for all notif types" + }, + "comment": { + "description": "returned for notif_types: 3, 4, 6 (comment_mention subtype)", + "$ref": "#/components/schemas/Comment" + }, + "comment_view": { + "description": "returned for notif_types: 3, 4, 6 (comment_mention subtype)", + "$ref": "#/components/schemas/CommentView" + }, + "comment_id": { + "type": "integer", + "description": "returned for notif_types: 3, 4, 6 (comment_mention subtype)" + }, + "community": { + "description": "returned for notif_type 1", + "$ref": "#/components/schemas/Community" + }, + "post": { + "description": "returned for notif_types: 0, 1, 2, 3, 4, 5, 6 (post_mention subtype)", + "$ref": "#/components/schemas/PostView" + }, + "post_id": { + "type": "integer", + "description": "returned for notif_types: 0, 1, 2, 3, 4, 5, 6 (post_mention subtype)" + } + }, + "required": [ + "author", + "notif_body", + "notif_id", + "notif_subtype", + "notif_type", + "status" + ] + }, + "UserNotificationsResponse": { + "type": "object", + "properties": { + "counts": { + "$ref": "#/components/schemas/UserNotificationsCounts" + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserNotificationItemView" + } + }, + "status": { + "type": "string", + "enum": [ + "All", + "Unread", + "Read", + "New" + ] + }, + "username": { + "type": "string" + }, + "next_page": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "counts", + "items", + "status", + "username" + ] + }, + "UserNotificationStateRequest": { + "type": "object", + "properties": { + "notif_id": { + "type": "integer" + }, + "read_state": { + "type": "boolean", + "description": "true sets notification as read, false marks it unread" + } + }, + "required": [ + "notif_id", + "read_state" + ] + }, + "UserNotificationsCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "integer" + } + }, + "required": [ + "count" + ] + }, + "UserMarkAllNotifsReadResponse": { + "type": "object", + "properties": { + "mark_all_notifications_as_read": { + "type": "string", + "example": "complete" + } + }, + "required": [ + "mark_all_notifications_as_read" + ] + }, + "UserSetFlairRequest": { + "type": "object", + "properties": { + "community_id": { + "type": "integer" + }, + "flair_text": { + "type": [ + "string", + "null" + ], + "maxLength": 50, + "description": "Either omit or set to null to remove existing flair" + } + }, + "required": [ + "community_id" + ] + }, + "UserSetFlairResponse": { + "type": "object", + "properties": { + "person_view": { + "$ref": "#/components/schemas/PersonView" + } + } + }, + "UserSetNoteRequest": { + "type": "object", + "properties": { + "person_id": { + "type": "integer" + }, + "note": { + "type": [ + "string", + "null" + ], + "maxLength": 50, + "description": "Pass a value of null to remove existing note" + } + }, + "required": [ + "note", + "person_id" + ] + }, + "UserSetNoteResponse": { + "type": "object", + "properties": { + "person_view": { + "$ref": "#/components/schemas/PersonView" + } + } + }, + "UserBanRequest": { + "type": "object", + "properties": { + "person_id": { + "type": "integer" + }, + "ban_ip_address": { + "type": [ + "boolean", + "null" + ] + }, + "purge_content": { + "type": [ + "boolean", + "null" + ] + }, + "reason": { + "type": [ + "string", + "null" + ], + "maxLength": 50, + "description": "Note to add to modlog" + } + }, + "required": [ + "ban_ip_address", + "person_id", + "purge_content", + "reason" + ] + }, + "UserBanResponse": { + "type": "object", + "properties": { + "person_view": { + "$ref": "#/components/schemas/PersonView" + } + } + }, + "UserUnbanRequest": { + "type": "object", + "properties": { + "person_id": { + "type": "integer" + } + }, + "required": [ + "person_id" + ] + }, + "ListCommentsResponse": { + "type": "object", + "properties": { + "comments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommentView" + } + }, + "next_page": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "comments" + ] + }, + "LikeCommentRequest": { + "type": "object", + "properties": { + "comment_id": { + "type": "integer" + }, + "score": { + "type": "integer", + "example": 1, + "description": "-1 to downvote, 1 to upvote, 0 to revert previous vote" + }, + "private": { + "type": "boolean", + "default": false, + "description": "private votes are not federated to other instances" + }, + "emoji": { + "type": "string" + } + }, + "required": [ + "comment_id", + "score" + ] + }, + "GetCommentResponse": { + "type": "object", + "properties": { + "comment_view": { + "$ref": "#/components/schemas/CommentView" + } + }, + "required": [ + "comment_view" + ] + }, + "SaveCommentRequest": { + "type": "object", + "properties": { + "comment_id": { + "type": "integer" + }, + "save": { + "type": "boolean" + } + }, + "required": [ + "comment_id", + "save" + ] + }, + "SubscribeCommentRequest": { + "type": "object", + "properties": { + "comment_id": { + "type": "integer" + }, + "subscribe": { + "type": "boolean" + } + }, + "required": [ + "comment_id", + "subscribe" + ] + }, + "CreateCommentRequest": { + "type": "object", + "properties": { + "body": { + "type": "string" + }, + "post_id": { + "type": "integer" + }, + "parent_id": { + "type": "integer" + }, + "language_id": { + "type": "integer" + } + }, + "required": [ + "body", + "post_id" + ] + }, + "EditCommentRequest": { + "type": "object", + "properties": { + "body": { + "type": "string" + }, + "comment_id": { + "type": "integer" + }, + "language_id": { + "type": "integer" + }, + "distinguished": { + "type": "boolean", + "default": false, + "description": "Visibly mark reply as from a moderator in the web UI" + } + }, + "required": [ + "body", + "comment_id" + ] + }, + "DeleteCommentRequest": { + "type": "object", + "properties": { + "comment_id": { + "type": "integer" + }, + "deleted": { + "type": "boolean" + } + }, + "required": [ + "comment_id", + "deleted" + ] + }, + "ReportCommentRequest": { + "type": "object", + "properties": { + "comment_id": { + "type": "integer" + }, + "reason": { + "type": "string" + }, + "description": { + "type": "string" + }, + "report_remote": { + "type": "boolean", + "default": true, + "description": "Also send report to originating instance" + } + }, + "required": [ + "comment_id", + "reason" + ] + }, + "CommentReport": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "creator_id": { + "type": "integer" + }, + "comment_id": { + "type": "integer" + }, + "original_comment_text": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "resolved": { + "type": "boolean" + }, + "published": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "updated": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "comment_id", + "creator_id", + "id", + "published", + "resolved" + ] + }, + "CommentReportView": { + "type": "object", + "properties": { + "activity_alert": { + "type": "boolean" + }, + "banned_from_community": { + "type": "boolean" + }, + "comment": { + "$ref": "#/components/schemas/Comment" + }, + "community": { + "$ref": "#/components/schemas/Community" + }, + "counts": { + "$ref": "#/components/schemas/CommentAggregates" + }, + "creator": { + "$ref": "#/components/schemas/Person" + }, + "creator_banned_from_community": { + "type": "boolean" + }, + "creator_blocked": { + "type": "boolean" + }, + "creator_is_admin": { + "type": "boolean" + }, + "creator_is_moderator": { + "type": "boolean" + }, + "post": { + "$ref": "#/components/schemas/Post" + }, + "saved": { + "type": "boolean" + }, + "subscribed": { + "type": "string", + "enum": [ + "Subscribed", + "NotSubscribed", + "Pending" + ], + "description": "Indicates whether auth'ed user is subscribed to the community this comment is in or not." + }, + "my_vote": { + "type": "integer" + }, + "can_auth_user_moderate": { + "type": "boolean" + }, + "comment_report": { + "$ref": "#/components/schemas/CommentReport" + }, + "comment_creator": { + "$ref": "#/components/schemas/Person" + } + }, + "required": [ + "activity_alert", + "banned_from_community", + "comment", + "comment_creator", + "comment_report", + "community", + "counts", + "creator", + "creator_banned_from_community", + "creator_blocked", + "creator_is_admin", + "creator_is_moderator", + "post", + "saved", + "subscribed" + ] + }, + "GetCommentReportResponse": { + "type": "object", + "properties": { + "comment_report_view": { + "$ref": "#/components/schemas/CommentReportView" + } + }, + "required": [ + "comment_report_view" + ] + }, + "RemoveCommentRequest": { + "type": "object", + "properties": { + "comment_id": { + "type": "integer" + }, + "removed": { + "type": "boolean" + }, + "reason": { + "type": "string" + } + }, + "required": [ + "comment_id", + "removed" + ] + }, + "MarkCommentAsReadRequest": { + "type": "object", + "properties": { + "comment_reply_id": { + "type": "integer" + }, + "read": { + "type": "boolean" + } + }, + "required": [ + "comment_reply_id", + "read" + ] + }, + "GetCommentReplyResponse": { + "type": "object", + "properties": { + "comment_reply_view": { + "$ref": "#/components/schemas/CommentReplyView" + } + }, + "required": [ + "comment_reply_view" + ] + }, + "MarkCommentAsAnswerRequest": { + "type": "object", + "properties": { + "comment_reply_id": { + "type": "integer" + }, + "answer": { + "type": "boolean" + } + }, + "required": [ + "answer", + "comment_reply_id" + ] + }, + "LockCommentRequest": { + "type": "object", + "properties": { + "comment_id": { + "type": "integer" + }, + "locked": { + "type": "boolean" + } + }, + "required": [ + "comment_id", + "locked" + ] + }, + "CommentLikeView": { + "type": "object", + "properties": { + "score": { + "type": "integer" + }, + "creator_banned_from_community": { + "type": "boolean" + }, + "creator_banned": { + "type": "boolean" + }, + "creator": { + "$ref": "#/components/schemas/Person" + } + }, + "required": [ + "creator", + "creator_banned", + "creator_banned_from_community", + "score" + ] + }, + "ListCommentLikesResponse": { + "type": "object", + "properties": { + "comment_likes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommentLikeView" + } + }, + "next_page": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "comment_likes" + ] + }, + "ListPostsResponse": { + "type": "object", + "properties": { + "posts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PostView" + } + }, + "next_page": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "posts" + ] + }, + "GetPostResponse": { + "type": "object", + "properties": { + "post_view": { + "$ref": "#/components/schemas/PostView" + }, + "community_view": { + "$ref": "#/components/schemas/CommunityView" + }, + "moderators": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CommunityModeratorView" + } + }, + "cross_posts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PostView" + } + } + }, + "required": [ + "post_view" + ] + }, + "PostReplyView": { + "type": "object", + "properties": { + "activity_alert": { + "type": "boolean" + }, + "banned_from_community": { + "type": "boolean" + }, + "comment": { + "$ref": "#/components/schemas/Comment" + }, + "community": { + "$ref": "#/components/schemas/Community" + }, + "counts": { + "$ref": "#/components/schemas/CommentAggregates" + }, + "creator": { + "$ref": "#/components/schemas/Person" + }, + "creator_banned_from_community": { + "type": "boolean" + }, + "creator_blocked": { + "type": "boolean" + }, + "creator_is_admin": { + "type": "boolean" + }, + "creator_is_moderator": { + "type": "boolean" + }, + "post": { + "$ref": "#/components/schemas/Post" + }, + "saved": { + "type": "boolean" + }, + "subscribed": { + "type": "string", + "enum": [ + "Subscribed", + "NotSubscribed", + "Pending" + ], + "description": "Indicates whether auth'ed user is subscribed to the community this comment is in or not." + }, + "my_vote": { + "type": "integer" + }, + "can_auth_user_moderate": { + "type": "boolean" + }, + "replies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PostReplyView" + } + } + }, + "required": [ + "activity_alert", + "banned_from_community", + "comment", + "counts", + "creator", + "creator_banned_from_community", + "creator_blocked", + "creator_is_admin", + "creator_is_moderator", + "saved", + "subscribed" + ] + }, + "GetPostRepliesResponse": { + "type": "object", + "properties": { + "comments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PostReplyView" + } + }, + "next_page": { + "type": [ + "string", + "null" + ] + } + } + }, + "SiteMetadataView": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "image": { + "type": "string" + }, + "embed_video_url": { + "type": "string" + } + } + }, + "GetSiteMetadataResponse": { + "type": "object", + "properties": { + "metadata": { + "$ref": "#/components/schemas/SiteMetadataView" + } + }, + "required": [ + "metadata" + ] + }, + "LikePostRequest": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "score": { + "type": "integer" + }, + "private": { + "type": "boolean" + }, + "emoji": { + "type": "string" + } + }, + "required": [ + "post_id", + "score" + ] + }, + "SavePostRequest": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "save": { + "type": "boolean" + } + }, + "required": [ + "post_id", + "save" + ] + }, + "SubscribePostRequest": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "subscribe": { + "type": "boolean" + } + }, + "required": [ + "post_id", + "subscribe" + ] + }, + "CreatePostRequest": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "community_id": { + "type": "integer" + }, + "alt_text": { + "type": "string", + "description": "Will be used for image posts or link posts that point to images" + }, + "body": { + "type": "string" + }, + "url": { + "type": "string", + "format": "url" + }, + "nsfw": { + "type": "boolean" + }, + "ai_generated": { + "type": "boolean" + }, + "language_id": { + "type": "integer" + }, + "event": { + "anyOf": [ + { + "$ref": "#/components/schemas/PostEvent" + }, + { + "type": "null" + } + ] + }, + "poll": { + "anyOf": [ + { + "$ref": "#/components/schemas/PostPoll" + }, + { + "type": "null" + } + ] + } + }, + "required": [ + "community_id", + "title" + ] + }, + "EditPostRequest": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "alt_text": { + "type": [ + "string", + "null" + ], + "description": "Pass null to remove the existing alt text" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "url": { + "type": [ + "string", + "null" + ], + "description": "Pass value of null to remove the post url", + "format": "url" + }, + "nsfw": { + "type": "boolean" + }, + "language_id": { + "type": "integer" + }, + "event": { + "anyOf": [ + { + "$ref": "#/components/schemas/PostEvent" + }, + { + "type": "null" + } + ] + }, + "poll": { + "anyOf": [ + { + "$ref": "#/components/schemas/PostPoll" + }, + { + "type": "null" + } + ] + }, + "tags": { + "type": [ + "string", + "null" + ], + "description": "Hashtags, separated by commas with no hash character" + }, + "flair": { + "type": [ + "string", + "null" + ], + "description": "Flair, separated by commas with no hash character" + } + }, + "required": [ + "post_id" + ] + }, + "DeletePostRequest": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "deleted": { + "type": "boolean" + } + }, + "required": [ + "deleted", + "post_id" + ] + }, + "ReportPostRequest": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "reason": { + "type": "string" + }, + "description": { + "type": "string" + }, + "report_remote": { + "type": "boolean", + "default": true, + "description": "Also send report to originating instance" + } + }, + "required": [ + "post_id", + "reason" + ] + }, + "PostReport": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "creator_id": { + "type": "integer" + }, + "post_id": { + "type": "integer" + }, + "original_post_name": { + "type": "string" + }, + "original_post_body": { + "type": "string" + }, + "reason": { + "type": "string" + }, + "resolved": { + "type": "boolean" + }, + "published": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + } + }, + "required": [ + "creator_id", + "id", + "original_post_body", + "original_post_name", + "post_id", + "reason", + "resolved" + ] + }, + "PostReportView": { + "type": "object", + "properties": { + "post_report": { + "$ref": "#/components/schemas/PostReport" + }, + "post": { + "$ref": "#/components/schemas/Post" + }, + "community": { + "$ref": "#/components/schemas/Community" + }, + "creator": { + "$ref": "#/components/schemas/Person" + }, + "post_creator": { + "$ref": "#/components/schemas/Person" + }, + "counts": { + "$ref": "#/components/schemas/PostAggregates" + }, + "creator_banned_from_community": { + "type": "boolean" + }, + "creator_is_moderator": { + "type": "boolean" + }, + "creator_is_admin": { + "type": "boolean" + }, + "creator_blocked": { + "type": "boolean" + }, + "subscribed": { + "type": "string", + "enum": [ + "Subscribed", + "NotSubscribed", + "Pending" + ] + }, + "saved": { + "type": "boolean" + } + }, + "required": [ + "community", + "counts", + "creator", + "creator_banned_from_community", + "creator_blocked", + "creator_is_admin", + "creator_is_moderator", + "post", + "post_creator", + "post_report", + "saved", + "subscribed" + ] + }, + "PostReportResponse": { + "type": "object", + "properties": { + "post_report_view": { + "$ref": "#/components/schemas/PostReportView" + } + }, + "required": [ + "post_report_view" + ] + }, + "LockPostRequest": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "locked": { + "type": "boolean" + } + }, + "required": [ + "locked", + "post_id" + ] + }, + "HidePostRequest": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "hidden": { + "type": "boolean" + } + }, + "required": [ + "hidden", + "post_id" + ] + }, + "FeaturePostRequest": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "featured": { + "type": "boolean" + }, + "feature_type": { + "type": "string", + "default": "Community", + "enum": [ + "Community", + "Local" + ] + } + }, + "required": [ + "featured", + "post_id" + ] + }, + "RemovePostRequest": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "removed": { + "type": "boolean" + }, + "reason": { + "type": "string" + } + }, + "required": [ + "post_id", + "removed" + ] + }, + "MarkPostAsReadRequest": { + "type": "object", + "properties": { + "read": { + "type": "boolean" + }, + "post_id": { + "type": "integer" + }, + "post_ids": { + "type": "array", + "items": { + "type": "integer" + } + } + }, + "required": [ + "read" + ] + }, + "SuccessResponse": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + }, + "required": [ + "success" + ] + }, + "PostLikeView": { + "type": "object", + "properties": { + "score": { + "type": "integer" + }, + "creator_banned_from_community": { + "type": "boolean" + }, + "creator_banned": { + "type": "boolean" + }, + "creator": { + "$ref": "#/components/schemas/Person" + } + }, + "required": [ + "creator", + "creator_banned", + "creator_banned_from_community", + "score" + ] + }, + "ListPostLikesResponse": { + "type": "object", + "properties": { + "post_likes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PostLikeView" + } + }, + "next_page": { + "type": [ + "string", + "null" + ] + } + }, + "required": [ + "post_likes" + ] + }, + "PostSetFlairRequest": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "flair_id_list": { + "type": [ + "array", + "null" + ], + "description": "A list of all the flair id to assign to the post. Either pass an empty list or null to remove flair", + "items": { + "type": "integer" + } + } + }, + "required": [ + "post_id" + ] + }, + "PostSetFlairResponse": { + "type": "object", + "properties": { + "banned_from_community": { + "type": "boolean" + }, + "community": { + "$ref": "#/components/schemas/Community" + }, + "counts": { + "$ref": "#/components/schemas/PostAggregates" + }, + "creator": { + "$ref": "#/components/schemas/Person" + }, + "creator_banned_from_community": { + "type": "boolean" + }, + "creator_is_admin": { + "type": "boolean" + }, + "creator_is_moderator": { + "type": "boolean" + }, + "hidden": { + "type": "boolean" + }, + "post": { + "$ref": "#/components/schemas/Post" + }, + "read": { + "type": "boolean" + }, + "saved": { + "type": "boolean" + }, + "subscribed": { + "type": "string", + "enum": [ + "Subscribed", + "NotSubscribed", + "Pending" + ] + }, + "unread_comments": { + "type": "integer" + }, + "activity_alert": { + "type": "boolean" + }, + "alt_text": { + "type": "string" + }, + "my_vote": { + "type": "integer" + }, + "flair_list": { + "type": "array", + "description": "See also the simpler 'flair' on post which can be used when editing", + "items": { + "$ref": "#/components/schemas/CommunityFlair" + } + }, + "can_auth_user_moderate": { + "type": "boolean" + } + }, + "required": [ + "banned_from_community", + "community", + "counts", + "creator", + "creator_banned_from_community", + "creator_is_admin", + "creator_is_moderator", + "hidden", + "post", + "read", + "saved", + "subscribed", + "unread_comments" + ] + }, + "PollVoteRequest": { + "type": "object", + "properties": { + "post_id": { + "type": "integer" + }, + "choice_id": { + "type": "array", + "description": "Must have a length of 1 for a poll in single vote mode.", + "items": { + "type": "integer" + } + } + }, + "required": [ + "choice_id", + "post_id" + ] + }, + "PollVoteResponse": { + "type": "object", + "properties": { + "post_view": { + "$ref": "#/components/schemas/PostView" + } + }, + "required": [ + "post_view" + ] + }, + "ImageUploadRequest": { + "type": "object", + "properties": { + "file": { + "type": "string", + "format": "binary" + } + }, + "required": [ + "file" + ] + }, + "ImageUploadResponse": { + "type": "object", + "properties": { + "url": { + "type": "string", + "format": "url" + }, + "liked_only": { + "type": "boolean" + }, + "saved_only": { + "type": "boolean" + }, + "q": { + "type": "string" + } + }, + "required": [ + "url" + ] + }, + "ImageDeleteRequest": { + "type": "object", + "properties": { + "file": { + "type": "string" + } + }, + "required": [ + "file" + ] + }, + "ImageDeleteResponse": { + "type": "object", + "properties": { + "result": { + "type": "string" + } + }, + "required": [ + "result" + ] + }, + "PrivateMessage": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "creator_id": { + "type": "integer" + }, + "recipient_id": { + "type": "integer" + }, + "content": { + "type": "string" + }, + "deleted": { + "type": "boolean" + }, + "read": { + "type": "boolean" + }, + "published": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "ap_id": { + "type": "string", + "format": "url" + }, + "local": { + "type": "boolean" + } + }, + "required": [ + "ap_id", + "content", + "creator_id", + "deleted", + "id", + "local", + "published", + "read", + "recipient_id" + ] + }, + "PrivateMessageView": { + "type": "object", + "properties": { + "private_message": { + "$ref": "#/components/schemas/PrivateMessage" + }, + "creator": { + "$ref": "#/components/schemas/Person" + }, + "recipient": { + "$ref": "#/components/schemas/Person" + }, + "conversation_id": { + "type": "integer" + } + }, + "required": [ + "creator", + "private_message", + "recipient" + ] + }, + "ListPrivateMessagesResponse": { + "type": "object", + "properties": { + "private_messages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PrivateMessageView" + } + } + }, + "required": [ + "private_messages" + ] + }, + "GetPrivateMessageConversationResponse": { + "type": "object", + "properties": { + "private_messages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PrivateMessageView" + } + } + }, + "required": [ + "private_messages" + ] + }, + "LeaveConversationRequest": { + "type": "object", + "properties": { + "conversation_id": { + "type": "integer" + } + }, + "required": [ + "conversation_id" + ] + }, + "CreatePrivateMessageRequest": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "recipient_id": { + "type": "integer" + } + }, + "required": [ + "content", + "recipient_id" + ] + }, + "PrivateMessageResponse": { + "type": "object", + "properties": { + "private_message_view": { + "$ref": "#/components/schemas/PrivateMessageView" + } + }, + "required": [ + "private_message_view" + ] + }, + "EditPrivateMessageRequest": { + "type": "object", + "properties": { + "private_message_id": { + "type": "integer" + }, + "content": { + "type": "string" + } + }, + "required": [ + "content", + "private_message_id" + ] + }, + "MarkPrivateMessageAsReadRequest": { + "type": "object", + "properties": { + "private_message_id": { + "type": "integer" + }, + "read": { + "type": "boolean" + } + }, + "required": [ + "private_message_id", + "read" + ] + }, + "DeletePrivateMessageRequest": { + "type": "object", + "properties": { + "private_message_id": { + "type": "integer" + }, + "deleted": { + "type": "boolean" + } + }, + "required": [ + "deleted", + "private_message_id" + ] + }, + "ReportPrivateMessageRequest": { + "type": "object", + "properties": { + "private_message_id": { + "type": "integer" + }, + "reason": { + "type": "string" + } + }, + "required": [ + "private_message_id", + "reason" + ] + }, + "UserRegistration": { + "type": "object", + "properties": { + "answer": { + "type": [ + "string", + "null" + ] + }, + "applied_at": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "country_code": { + "type": "string" + }, + "email": { + "type": [ + "string", + "null" + ] + }, + "ip_address": { + "type": [ + "string", + "null" + ] + }, + "throwaway_email": { + "type": "boolean" + }, + "user_id": { + "type": "integer" + }, + "user_name": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "approved", + "awaiting review" + ] + }, + "approved_by": { + "$ref": "#/components/schemas/Person" + }, + "approved_at": { + "type": "string", + "example": "2025-06-07T02:29:07.980084Z", + "format": "datetime" + }, + "referrer": { + "type": "string" + } + }, + "required": [ + "answer", + "email", + "ip_address", + "status", + "user_id", + "user_name" + ] + }, + "GetRegistrationListResponse": { + "type": "object", + "properties": { + "registrations": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserRegistration" + } + } + }, + "required": [ + "registrations" + ] + }, + "RegistrationApproveRequest": { + "type": "object", + "properties": { + "approve": { + "type": "boolean" + }, + "user_id": { + "type": "integer" + } + }, + "required": [ + "approve", + "user_id" + ] + } + }, + "responses": { + "UNPROCESSABLE_ENTITY": { + "description": "Unprocessable Entity", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + }, + "servers": [ + { + "url": "https://piefed.social", + "description": "This instance" + }, + { + "url": "https://crust.piefed.social", + "description": "Development instance" + }, + { + "url": "https://piefed.social" + }, + { + "url": "https://preferred.social" + }, + { + "url": "https://feddit.online" + }, + { + "url": "https://piefed.world" + } + ], + "info": { + "title": "PieFed 1.6 Alpha API", + "contact": { + "name": "Developer", + "url": "https://codeberg.org/rimu/pyfedi" + }, + "license": { + "name": "AGPLv3", + "url": "https://www.gnu.org/licenses/agpl-3.0.en.html#license-text" + }, + "version": "alpha 1.6" + }, + "paths": { + "/api/alpha/site": { + "get": { + "responses": { + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetSiteResponse" + } + } + } + } + }, + "tags": [ + "Site" + ], + "summary": "Gets the site, and your user data." + } + }, + "/api/alpha/site/version": { + "get": { + "responses": { + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetSiteVersionResponse" + } + } + } + } + }, + "tags": [ + "Site" + ], + "summary": "Gets version of PieFed." + } + }, + "/api/alpha/site/block": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BlockInstanceResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BlockInstanceRequest" + } + } + } + }, + "tags": [ + "Site" + ], + "summary": "Block an instance." + } + }, + "/api/alpha/site/instance_chooser": { + "get": { + "responses": { + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetSiteInstanceChooserResponse" + } + } + } + } + }, + "tags": [ + "Site" + ], + "summary": "Gets the site info for use by other instances in the Instance Chooser functionality." + } + }, + "/api/alpha/site/instance_chooser_search": { + "get": { + "parameters": [ + { + "in": "query", + "name": "q", + "schema": { + "type": "string" + }, + "required": false + }, + { + "in": "query", + "name": "nsfw", + "schema": { + "type": "string" + }, + "required": false + }, + { + "in": "query", + "name": "language", + "schema": { + "type": "string" + }, + "required": false + }, + { + "in": "query", + "name": "newbie", + "schema": { + "type": "string" + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetSiteInstanceChooserSearchResponse" + } + } + } + } + }, + "tags": [ + "Site" + ], + "summary": "Search for other instances." + } + }, + "/api/alpha/search": { + "get": { + "parameters": [ + { + "in": "query", + "name": "q", + "schema": { + "type": "string" + }, + "required": true + }, + { + "in": "query", + "name": "type_", + "schema": { + "type": "string", + "enum": [ + "Communities", + "Posts", + "Users", + "Url", + "Comments" + ] + }, + "required": true + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "listing_type", + "description": "Only some types are supported for each `type_`.\n\n- `Comments` and `Communities`: `Popular` will return the same results as `All`.\n- `Users`: only `Local` will differ from `All`.\n- `Posts` and `Url`: These types are equivalent.", + "schema": { + "type": "string", + "enum": [ + "All", + "Local", + "Subscribed", + "Popular", + "Moderating", + "ModeratorView" + ] + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "sort", + "description": "Only some sorting options supported for each `type_`. `NewFederated` and `OldFederated` are equivalent to `New` and `Old` respectively for each type except for `Communities`.\n\n- `Comments`: `Scaled` is not supported and `Hot` will be returned instead.\n- `Communities`: `Top` sorts that are not present in `/community/list` are equivalent to `Top`.\n- `Users`: only `New`, `Old`, and `Top` (by number of posts, all `Top` sorts are equivalent) are supported. Otherwise will be sorted by user id.\n- `Posts` and `Url`: These types are equivalent. `TopPosts` and `TopSubscribers` are equivalent to `Top`.", + "schema": { + "type": "string", + "enum": [ + "Active", + "Hot", + "New", + "Top", + "TopHour", + "TopSixHour", + "TopTwelveHour", + "TopDay", + "TopWeek", + "TopMonth", + "TopThreeMonths", + "TopSixMonths", + "TopNineMonths", + "TopYear", + "TopAll", + "Scaled", + "Old", + "Relevance", + "TopPosts", + "TopSubscribers", + "NewFederated", + "OldFederated" + ] + }, + "required": false + }, + { + "in": "query", + "name": "community_name", + "schema": { + "type": "string" + }, + "required": false + }, + { + "in": "query", + "name": "community_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "minimum_upvotes", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "nsfw", + "schema": { + "type": "string", + "enum": [ + "Exclude", + "Include", + "Only" + ] + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SearchResponse" + } + } + } + } + }, + "tags": [ + "Misc" + ], + "summary": "Search PieFed." + } + }, + "/api/alpha/resolve_object": { + "get": { + "parameters": [ + { + "in": "query", + "name": "q", + "schema": { + "type": "string" + }, + "required": true + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ResolveObjectResponse" + } + } + } + } + }, + "tags": [ + "Misc" + ], + "summary": "Fetch a non-local / federated object." + } + }, + "/api/alpha/federated_instances": { + "get": { + "responses": { + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetFederatedInstancesResponse" + } + } + } + } + }, + "tags": [ + "Misc" + ], + "summary": "Fetch federated instances." + } + }, + "/api/alpha/suggest_completion": { + "get": { + "parameters": [ + { + "in": "query", + "name": "q", + "schema": { + "type": "string" + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetSuggestCompletionResponse" + } + } + } + } + }, + "tags": [ + "Misc" + ], + "summary": "Suggest people and communities while users type." + } + }, + "/api/alpha/modlog": { + "get": { + "parameters": [ + { + "in": "query", + "name": "mod_person_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "community_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "type_", + "schema": { + "type": "string", + "enum": [ + "All", + "ModRemovePost", + "ModLockPost", + "ModFeaturePost", + "ModRemoveComment", + "ModRemoveCommunity", + "ModBanFromCommunity", + "ModAddCommunity", + "ModTransferCommunity", + "ModAdd", + "ModBan", + "ModHideCommunity", + "AdminPurgePerson", + "AdminPurgeCommunity", + "AdminPurgePost", + "AdminPurgeComment" + ] + }, + "required": false + }, + { + "in": "query", + "name": "other_person_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "post_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "comment_id", + "schema": { + "type": "integer" + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetModLogResponse" + } + } + } + } + }, + "tags": [ + "Misc" + ], + "summary": "Get modlog." + } + }, + "/api/alpha/community": { + "get": { + "parameters": [ + { + "in": "query", + "name": "id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "name", + "schema": { + "type": "string" + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommunityResponse" + } + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Get / fetch a community." + }, + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCommunityRequest" + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Create a new community." + }, + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditCommunityRequest" + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Edit community." + } + }, + "/api/alpha/community/list": { + "get": { + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "show_nsfw", + "schema": { + "type": "boolean" + }, + "required": false + }, + { + "in": "query", + "name": "sort", + "schema": { + "type": "string", + "enum": [ + "Hot", + "Top", + "New", + "Old", + "Active", + "TopAll", + "TopPosts", + "TopSubscribers", + "NewFederated", + "OldFederated" + ] + }, + "required": false + }, + { + "in": "query", + "name": "type_", + "schema": { + "type": "string", + "enum": [ + "All", + "Local", + "Subscribed", + "Moderating", + "ModeratorView" + ] + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCommunitiesResponse" + } + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "List communities, with various filters." + } + }, + "/api/alpha/community/follow": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FollowCommunityRequest" + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Follow / subscribe to a community." + } + }, + "/api/alpha/community/leave_all": { + "post": { + "responses": { + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserMeResponse" + } + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Leave all communities and feeds for which the user is not a moderator or owner." + } + }, + "/api/alpha/community/block": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BlockCommunityResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/BlockCommunityRequest" + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Block a community." + } + }, + "/api/alpha/community/subscribe": { + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscribeCommunityRequest" + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Subscribe to activities in a community." + } + }, + "/api/alpha/community/delete": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCommunityRequest" + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Delete a community." + } + }, + "/api/alpha/community/mod": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModCommunityResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ModCommunityRequest" + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Add or remove a moderator for your community." + } + }, + "/api/alpha/community/moderate/bans": { + "get": { + "parameters": [ + { + "in": "query", + "name": "community_id", + "schema": { + "type": "integer" + }, + "required": true + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 10 + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1 + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityModerationBansListResponse" + } + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Get the list of banned users for a community." + } + }, + "/api/alpha/community/moderate/unban": { + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityModerationBanItem" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityModerationUnbanRequest" + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Unban a user from a community." + } + }, + "/api/alpha/community/moderate/ban": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityModerationBanItem" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityModerationBanRequest" + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Ban a user from a community." + } + }, + "/api/alpha/community/moderate/post/nsfw": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostView" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityModerationNsfwRequest" + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Mark or unmark a post as NSFW." + } + }, + "/api/alpha/community/flair": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityFlairCreateResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityFlairCreateRequest" + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Create a new post flair in the community" + }, + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityFlairEditResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityFlairEditRequest" + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Edit an existing post flair in the community" + } + }, + "/api/alpha/community/flair/delete": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityFlairDeleteResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CommunityFlairDeleteRequest" + } + } + } + }, + "tags": [ + "Community" + ], + "summary": "Delete a post flair in a community" + } + }, + "/api/alpha/feed": { + "get": { + "parameters": [ + { + "in": "query", + "name": "id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "name", + "schema": { + "type": "string" + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedView" + } + } + } + } + }, + "tags": [ + "Feed" + ], + "summary": "Get a feed" + }, + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedView" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateFeedRequest" + } + } + } + }, + "tags": [ + "Feed" + ], + "summary": "Create a new feed." + }, + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedView" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditFeedRequest" + } + } + } + }, + "tags": [ + "Feed" + ], + "summary": "Edit feed." + } + }, + "/api/alpha/feed/list": { + "get": { + "parameters": [ + { + "in": "query", + "name": "include_communities", + "description": "include list of communities in each feed with result", + "schema": { + "type": "boolean", + "default": true + }, + "required": false + }, + { + "in": "query", + "name": "mine_only", + "description": "only return feeds created by the authorized user", + "schema": { + "type": "boolean", + "default": false + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedListResponse" + } + } + } + } + }, + "tags": [ + "Feed" + ], + "summary": "Get list of feeds" + } + }, + "/api/alpha/feed/follow": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedView" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FollowFeedRequest" + } + } + } + }, + "tags": [ + "Feed" + ], + "summary": "Follow / subscribe / leave / unsubscribe to a feed." + } + }, + "/api/alpha/feed/delete": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeedView" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteFeedRequest" + } + } + } + }, + "tags": [ + "Feed" + ], + "summary": "Delete a feed." + } + }, + "/api/alpha/topic/list": { + "get": { + "parameters": [ + { + "in": "query", + "name": "include_communities", + "description": "include list of communities in each topic with result", + "schema": { + "type": "boolean", + "default": true + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TopicListResponse" + } + } + } + } + }, + "tags": [ + "Topic" + ], + "summary": "Get list of topics" + } + }, + "/api/alpha/domain/block": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DomainBlockResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DomainBlockRequest" + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Block or unblock a domain" + } + }, + "/api/alpha/user": { + "get": { + "parameters": [ + { + "in": "query", + "name": "person_id", + "description": "One of either person_id or username must be specified", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "username", + "description": "One of either person_id or username must be specified", + "schema": { + "type": "string" + }, + "required": false + }, + { + "in": "query", + "name": "sort", + "schema": { + "type": "string", + "enum": [ + "Active", + "Hot", + "New", + "Top", + "TopHour", + "TopSixHour", + "TopTwelveHour", + "TopDay", + "TopWeek", + "TopMonth", + "TopThreeMonths", + "TopSixMonths", + "TopNineMonths", + "TopYear", + "TopAll", + "Scaled", + "Old", + "Relevance", + "TopPosts", + "TopSubscribers", + "NewFederated", + "OldFederated" + ] + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1 + }, + "required": false + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 20 + }, + "required": false + }, + { + "in": "query", + "name": "community_id", + "description": "Limit posts/comments to just a single community", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "saved_only", + "schema": { + "type": "boolean", + "default": false + }, + "required": false + }, + { + "in": "query", + "name": "include_content", + "schema": { + "type": "boolean", + "default": false + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetUserResponse" + } + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Get the details for a person" + } + }, + "/api/alpha/user/me": { + "get": { + "responses": { + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserMeResponse" + } + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Get the details for the current user" + } + }, + "/api/alpha/user/login": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserLoginResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserLoginRequest" + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Log into PieFed" + } + }, + "/api/alpha/user/unread_count": { + "get": { + "responses": { + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserUnreadCountsResponse" + } + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Get your unread counts" + } + }, + "/api/alpha/user/replies": { + "get": { + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 10 + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1 + }, + "required": false + }, + { + "in": "query", + "name": "sort", + "schema": { + "type": "string", + "default": "New", + "enum": [ + "Hot", + "Top", + "TopAll", + "New", + "Old", + "Controversial" + ] + }, + "required": false + }, + { + "in": "query", + "name": "unread_only", + "schema": { + "type": "boolean", + "default": true + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserRepliesResponse" + } + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Get comment replies" + } + }, + "/api/alpha/user/mentions": { + "get": { + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 10 + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1 + }, + "required": false + }, + { + "in": "query", + "name": "sort", + "schema": { + "type": "string", + "default": "New", + "enum": [ + "Hot", + "Top", + "TopAll", + "New", + "Old", + "Controversial" + ] + }, + "required": false + }, + { + "in": "query", + "name": "unread_only", + "schema": { + "type": "boolean", + "default": true + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserMentionsResponse" + } + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Get mentions of your account made in comments" + } + }, + "/api/alpha/user/media": { + "get": { + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 10 + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1 + }, + "required": false + }, + { + "in": "query", + "name": "sort", + "schema": { + "type": "string", + "default": "New", + "enum": [ + "Hot", + "Top", + "TopAll", + "New", + "Old", + "Controversial" + ] + }, + "required": false + }, + { + "in": "query", + "name": "unread_only", + "schema": { + "type": "boolean", + "default": true + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserMediaResponse" + } + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Get media the current user has uploaded" + } + }, + "/api/alpha/user/block": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserBlockResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserBlockRequest" + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Block or unblock a person" + } + }, + "/api/alpha/user/mark_all_as_read": { + "post": { + "responses": { + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserMarkAllReadResponse" + } + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Mark all notifications and messages as read" + } + }, + "/api/alpha/user/subscribe": { + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSubscribeResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSubscribeRequest" + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Subscribe or unsubscribe to activites of another user" + } + }, + "/api/alpha/user/save_user_settings": { + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSaveSettingsResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSaveSettingsRequest" + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Save your user settings" + } + }, + "/api/alpha/user/notifications": { + "get": { + "parameters": [ + { + "in": "query", + "name": "status", + "schema": { + "type": "string", + "enum": [ + "All", + "Unread", + "Read", + "New" + ] + }, + "required": true + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 10 + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1 + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserNotificationsResponse" + } + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Get your user notifications (not all notification types supported yet)" + } + }, + "/api/alpha/user/notification_state": { + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserNotificationItemView" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserNotificationStateRequest" + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Set the read status of a given notification (not all notification types supported yet)" + } + }, + "/api/alpha/user/notifications_count": { + "get": { + "responses": { + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserNotificationsCountResponse" + } + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Get user unread notifications count" + } + }, + "/api/alpha/user/mark_all_notifications_read": { + "put": { + "responses": { + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserMarkAllNotifsReadResponse" + } + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Mark all notifications as read" + } + }, + "/api/alpha/user/verify_credentials": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserLoginRequest" + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Verify username/password credentials" + } + }, + "/api/alpha/user/set_flair": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSetFlairResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSetFlairRequest" + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Set your flair for a community" + } + }, + "/api/alpha/user/note": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSetNoteResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserSetNoteRequest" + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Set a note for a user" + } + }, + "/api/alpha/user/ban": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserBanResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserBanRequest" + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Ban a user" + } + }, + "/api/alpha/user/unban": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserBanResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserUnbanRequest" + } + } + } + }, + "tags": [ + "User" + ], + "summary": "Unban a user" + } + }, + "/api/alpha/comment/list": { + "get": { + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 10 + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1 + }, + "required": false + }, + { + "in": "query", + "name": "sort", + "schema": { + "type": "string", + "default": "New", + "enum": [ + "Hot", + "Top", + "TopAll", + "New", + "Old", + "Controversial" + ] + }, + "required": false + }, + { + "in": "query", + "name": "liked_only", + "schema": { + "type": "boolean" + }, + "required": false + }, + { + "in": "query", + "name": "saved_only", + "schema": { + "type": "boolean" + }, + "required": false + }, + { + "in": "query", + "name": "person_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "community_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "post_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "parent_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "max_depth", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "depth_first", + "description": "guarantee parent comments are on the same page as any fetched comments", + "schema": { + "type": "boolean" + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCommentsResponse" + } + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "List comments, with various filters." + } + }, + "/api/alpha/comment/like": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommentResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LikeCommentRequest" + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "Like / vote on a comment." + } + }, + "/api/alpha/comment/save": { + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommentResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SaveCommentRequest" + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "Save a comment." + } + }, + "/api/alpha/comment/subscribe": { + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommentResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscribeCommentRequest" + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "Subscribe to a comment." + } + }, + "/api/alpha/comment": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommentResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateCommentRequest" + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "Create a comment." + }, + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommentResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditCommentRequest" + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "Edit a comment." + }, + "get": { + "parameters": [ + { + "in": "query", + "name": "id", + "schema": { + "type": "integer" + }, + "required": true + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommentResponse" + } + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "Get / fetch a comment." + } + }, + "/api/alpha/comment/delete": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommentResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteCommentRequest" + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "Delete a comment." + } + }, + "/api/alpha/comment/report": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommentReportResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportCommentRequest" + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "Report a comment." + } + }, + "/api/alpha/comment/remove": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommentResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemoveCommentRequest" + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "Remove a comment as a moderator." + } + }, + "/api/alpha/comment/mark_as_read": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommentReplyResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MarkCommentAsReadRequest" + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "Mark a comment reply as read." + } + }, + "/api/alpha/comment/mark_as_answer": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommentReplyResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MarkCommentAsAnswerRequest" + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "Mark a comment as the preferred answer to a question." + } + }, + "/api/alpha/comment/lock": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetCommentResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LockCommentRequest" + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "Lock a comment chain as a moderator." + } + }, + "/api/alpha/comment/like/list": { + "get": { + "parameters": [ + { + "in": "query", + "name": "comment_id", + "schema": { + "type": "integer" + }, + "required": true + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1 + }, + "required": false + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 50 + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListCommentLikesResponse" + } + } + } + } + }, + "tags": [ + "Comment" + ], + "summary": "View comment votes as a moderator." + } + }, + "/api/alpha/post/list": { + "get": { + "parameters": [ + { + "in": "query", + "name": "q", + "schema": { + "type": "string" + }, + "required": false + }, + { + "in": "query", + "name": "sort", + "schema": { + "type": "string", + "default": "Hot", + "enum": [ + "Hot", + "Top", + "TopHour", + "TopSixHour", + "TopTwelveHour", + "TopWeek", + "TopDay", + "TopMonth", + "TopThreeMonths", + "TopSixMonths", + "TopNineMonths", + "TopYear", + "TopAll", + "New", + "Old", + "Scaled", + "Active" + ] + }, + "required": false + }, + { + "in": "query", + "name": "type_", + "schema": { + "type": "string", + "default": "All", + "enum": [ + "All", + "Local", + "Subscribed", + "Popular", + "Moderating", + "ModeratorView" + ] + }, + "required": false + }, + { + "in": "query", + "name": "community_name", + "schema": { + "type": "string" + }, + "required": false + }, + { + "in": "query", + "name": "community_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "saved_only", + "schema": { + "type": "boolean", + "default": false + }, + "required": false + }, + { + "in": "query", + "name": "person_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 50 + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1 + }, + "required": false + }, + { + "in": "query", + "name": "liked_only", + "schema": { + "type": "boolean", + "default": false + }, + "required": false + }, + { + "in": "query", + "name": "feed_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "topic_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "ignore_sticky", + "description": "Ignores a post's sticky state when sorting", + "schema": { + "type": "boolean", + "default": false + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPostsResponse" + } + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "List posts." + } + }, + "/api/alpha/post/list2": { + "get": { + "parameters": [ + { + "in": "query", + "name": "q", + "schema": { + "type": "string" + }, + "required": false + }, + { + "in": "query", + "name": "sort", + "schema": { + "type": "string", + "default": "Hot", + "enum": [ + "Hot", + "Top", + "TopHour", + "TopSixHour", + "TopTwelveHour", + "TopWeek", + "TopDay", + "TopMonth", + "TopThreeMonths", + "TopSixMonths", + "TopNineMonths", + "TopYear", + "TopAll", + "New", + "Old", + "Scaled", + "Active" + ] + }, + "required": false + }, + { + "in": "query", + "name": "type_", + "schema": { + "type": "string", + "default": "All", + "enum": [ + "All", + "Local", + "Subscribed", + "Popular", + "Moderating", + "ModeratorView" + ] + }, + "required": false + }, + { + "in": "query", + "name": "community_name", + "schema": { + "type": "string" + }, + "required": false + }, + { + "in": "query", + "name": "community_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "saved_only", + "schema": { + "type": "boolean", + "default": false + }, + "required": false + }, + { + "in": "query", + "name": "person_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 50 + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "string", + "default": "" + }, + "required": false + }, + { + "in": "query", + "name": "liked_only", + "schema": { + "type": "boolean", + "default": false + }, + "required": false + }, + { + "in": "query", + "name": "feed_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "topic_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "ignore_sticky", + "description": "Ignores a post's sticky state when sorting", + "schema": { + "type": "boolean", + "default": false + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPostsResponse" + } + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "List posts. For testing only, do not use." + } + }, + "/api/alpha/post": { + "get": { + "parameters": [ + { + "in": "query", + "name": "id", + "schema": { + "type": "integer" + }, + "required": true + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostResponse" + } + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Get/fetch a post" + }, + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePostRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Create a new post." + }, + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditPostRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Edit a post." + } + }, + "/api/alpha/post/replies": { + "get": { + "parameters": [ + { + "in": "query", + "name": "post_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "parent_id", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "sort", + "schema": { + "type": "string", + "enum": [ + "Hot", + "Top", + "TopAll", + "New", + "Old", + "Controversial" + ] + }, + "required": false + }, + { + "in": "query", + "name": "max_depth", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "string" + }, + "required": false + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostRepliesResponse" + } + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Get replies/comments for a post with nested structure." + } + }, + "/api/alpha/post/site_metadata": { + "get": { + "parameters": [ + { + "in": "query", + "name": "url", + "schema": { + "type": "string" + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetSiteMetadataResponse" + } + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Get metadata about a url." + } + }, + "/api/alpha/post/like": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LikePostRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Like or unlike a post." + } + }, + "/api/alpha/post/save": { + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavePostRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Save or unsave a post." + } + }, + "/api/alpha/post/subscribe": { + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SubscribePostRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Subscribe or unsubscribe to a post." + } + }, + "/api/alpha/post/delete": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletePostRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Delete or restore a post." + } + }, + "/api/alpha/post/report": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostReportResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportPostRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Report a post." + } + }, + "/api/alpha/post/lock": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LockPostRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Lock or unlock a post." + } + }, + "/api/alpha/post/hide": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HidePostRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Hide or unhide a post." + } + }, + "/api/alpha/post/feature": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/FeaturePostRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Feature or unfeature a post." + } + }, + "/api/alpha/post/remove": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPostResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RemovePostRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Remove or restore a post as a moderator." + } + }, + "/api/alpha/post/mark_as_read": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SuccessResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MarkPostAsReadRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Mark one or more posts as read or unread." + } + }, + "/api/alpha/post/like/list": { + "get": { + "parameters": [ + { + "in": "query", + "name": "post_id", + "schema": { + "type": "integer" + }, + "required": true + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1 + }, + "required": false + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 50 + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPostLikesResponse" + } + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "View post votes as a moderator." + } + }, + "/api/alpha/post/assign_flair": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostSetFlairResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostSetFlairRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Add/remove flair from a post" + } + }, + "/api/alpha/post/poll_vote": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PollVoteResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PollVoteRequest" + } + } + } + }, + "tags": [ + "Post" + ], + "summary": "Vote in a poll" + } + }, + "/api/alpha/upload/image": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImageUploadResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/ImageUploadRequest" + } + } + } + }, + "tags": [ + "Upload" + ], + "summary": "Upload a general image." + } + }, + "/api/alpha/upload/community_image": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImageUploadResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/ImageUploadRequest" + } + } + } + }, + "tags": [ + "Upload" + ], + "summary": "Upload a community image." + } + }, + "/api/alpha/upload/user_image": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImageUploadResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "$ref": "#/components/schemas/ImageUploadRequest" + } + } + } + }, + "tags": [ + "Upload" + ], + "summary": "Upload a user image." + } + }, + "/api/alpha/image/delete": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImageDeleteResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImageDeleteRequest" + } + } + } + }, + "tags": [ + "Upload" + ], + "summary": "Delete a user image." + } + }, + "/api/alpha/private_message/list": { + "get": { + "parameters": [ + { + "in": "query", + "name": "page", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "unread_only", + "schema": { + "type": "boolean" + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ListPrivateMessagesResponse" + } + } + } + } + }, + "tags": [ + "Private Message" + ], + "summary": "List private messages." + } + }, + "/api/alpha/private_message/conversation": { + "get": { + "parameters": [ + { + "in": "query", + "name": "person_id", + "description": "One of either person_id or conversation_id must be specified", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "conversation_id", + "description": "One of either person_id or conversation_id must be specified", + "schema": { + "type": "integer" + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1 + }, + "required": false + }, + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 10 + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetPrivateMessageConversationResponse" + } + } + } + } + }, + "tags": [ + "Private Message" + ], + "summary": "Get conversation with a specific person." + } + }, + "/api/alpha/private_message/conversation/leave": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LeaveConversationRequest" + } + } + } + }, + "tags": [ + "Private Message" + ], + "summary": "Leave a conversation" + } + }, + "/api/alpha/private_message": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "429": { + "description": "Too Many Requests", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateMessageResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreatePrivateMessageRequest" + } + } + } + }, + "tags": [ + "Private Message" + ], + "summary": "Create a new private message." + }, + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateMessageResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditPrivateMessageRequest" + } + } + } + }, + "tags": [ + "Private Message" + ], + "summary": "Edit a private message." + } + }, + "/api/alpha/private_message/mark_as_read": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateMessageResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/MarkPrivateMessageAsReadRequest" + } + } + } + }, + "tags": [ + "Private Message" + ], + "summary": "Mark a private message as read or unread." + } + }, + "/api/alpha/private_message/delete": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateMessageResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeletePrivateMessageRequest" + } + } + } + }, + "tags": [ + "Private Message" + ], + "summary": "Delete or restore a private message." + } + }, + "/api/alpha/private_message/report": { + "post": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PrivateMessageResponse" + } + } + } + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportPrivateMessageRequest" + } + } + } + }, + "tags": [ + "Private Message" + ], + "summary": "Report a private message." + } + }, + "/api/alpha/admin/registration_application/list": { + "get": { + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "default": 30 + }, + "required": false + }, + { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1 + }, + "required": false + }, + { + "in": "query", + "name": "pending_only", + "schema": { + "type": "boolean", + "default": true + }, + "required": false + }, + { + "in": "query", + "name": "sort", + "schema": { + "type": "string", + "default": "New", + "enum": [ + "Old", + "New" + ] + }, + "required": false + } + ], + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetRegistrationListResponse" + } + } + } + } + }, + "tags": [ + "Admin" + ], + "summary": "Get the list of applications ready for admin review" + } + }, + "/api/alpha/admin/registration_application/approve": { + "put": { + "responses": { + "422": { + "$ref": "#/components/responses/UNPROCESSABLE_ENTITY" + }, + "400": { + "description": "Bad Request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DefaultError" + } + } + } + }, + "200": { + "description": "OK" + } + }, + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegistrationApproveRequest" + } + } + } + }, + "tags": [ + "Admin" + ], + "summary": "Approve or deny a registration" + } + } + }, + "tags": [ + { + "name": "Site", + "description": "" + }, + { + "name": "Misc", + "description": "" + }, + { + "name": "Community", + "description": "" + }, + { + "name": "Feed", + "description": "" + }, + { + "name": "Topic", + "description": "" + }, + { + "name": "User", + "description": "" + }, + { + "name": "Comment", + "description": "" + }, + { + "name": "Post", + "description": "" + }, + { + "name": "Upload", + "description": "" + }, + { + "name": "Private Message", + "description": "" + }, + { + "name": "Admin", + "description": "" + } + ], + "openapi": "3.1.1" +} \ No newline at end of file