2020-08-05 23:21:26 +02:00
|
|
|
import 'package:flutter/foundation.dart';
|
2020-08-10 00:42:31 +02:00
|
|
|
import 'package:lemmur/client/models/captcha.dart';
|
2020-08-10 19:47:44 +02:00
|
|
|
import 'package:lemmur/client/models/comment.dart';
|
|
|
|
import 'package:lemmur/client/models/user.dart';
|
2020-08-09 23:32:42 +02:00
|
|
|
import '../models/private_message.dart';
|
2020-08-05 23:21:26 +02:00
|
|
|
|
2020-08-06 22:06:53 +02:00
|
|
|
import 'main.dart';
|
2020-08-05 23:21:26 +02:00
|
|
|
|
2020-08-06 22:06:53 +02:00
|
|
|
extension UserEndpoint on V1 {
|
2020-08-05 23:21:26 +02:00
|
|
|
/// POST /user/login
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#login
|
2020-08-10 19:47:44 +02:00
|
|
|
/// returns jwt
|
|
|
|
Future<String> login({
|
2020-08-05 23:21:26 +02:00
|
|
|
String usernameOrEmail,
|
|
|
|
String password,
|
|
|
|
}) {
|
|
|
|
assert(usernameOrEmail != null, password != null);
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /user/register
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#register
|
2020-08-10 19:47:44 +02:00
|
|
|
/// returns jwt
|
|
|
|
Future<String> register({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required String username,
|
|
|
|
String email,
|
|
|
|
String password,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// GET /user/get_captcha
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#get-captcha
|
2020-08-09 23:24:06 +02:00
|
|
|
Future<Captcha> getCaptcha() {
|
2020-08-05 23:21:26 +02:00
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// GET /user
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#get-user-details
|
2020-08-10 19:47:44 +02:00
|
|
|
Future<UserDetails> getUserDetails({
|
2020-08-05 23:21:26 +02:00
|
|
|
int userId,
|
|
|
|
String username,
|
|
|
|
@required String sort,
|
|
|
|
int page,
|
|
|
|
int limit,
|
|
|
|
int communityId,
|
|
|
|
bool savedOnly,
|
|
|
|
String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// PUT /save_user_settings
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#save-user-settings
|
2020-08-10 19:47:44 +02:00
|
|
|
/// returns jwt
|
|
|
|
Future<String> saveUserSettings({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required bool showNsfw,
|
|
|
|
@required String theme,
|
|
|
|
@required int defaultSortType,
|
|
|
|
@required int defaultListingType,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// GET /user/replies
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#get-replies--inbox
|
2020-08-10 19:47:44 +02:00
|
|
|
Future<List<ReplyView>> getReplies({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required String sort,
|
|
|
|
int page,
|
|
|
|
int limit,
|
|
|
|
@required bool unreadOnly,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// GET /user/mentions
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#get-user-mentions
|
2020-08-10 19:47:44 +02:00
|
|
|
Future<List<UserMentionView>> getUserMentions({
|
2020-08-05 23:21:26 +02:00
|
|
|
String sort,
|
|
|
|
@required int page,
|
|
|
|
@required int limit,
|
|
|
|
bool unreadOnly,
|
|
|
|
String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /user/mention/mark_as_read
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#mark-user-mention-as-read
|
2020-08-10 19:47:44 +02:00
|
|
|
Future<UserMentionView> markUserMentionAsRead({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required int userMentionId,
|
|
|
|
@required bool read,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// GET /private_message/list
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#get-private-messages
|
2020-08-09 23:32:42 +02:00
|
|
|
Future<List<PrivateMessageView>> getPrivateMessages({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required bool unreadOnly,
|
|
|
|
int page,
|
|
|
|
int limit,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /private_message
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#create-private-message
|
2020-08-09 23:32:42 +02:00
|
|
|
Future<PrivateMessageView> createPrivateMessage({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required String content,
|
|
|
|
@required int recipientId,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// PUT /private_message
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#edit-private-message
|
2020-08-09 23:32:42 +02:00
|
|
|
Future<PrivateMessageView> editPrivateMessage({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required int editId,
|
|
|
|
@required String content,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /private_message/delete
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#delete-private-message
|
2020-08-09 23:32:42 +02:00
|
|
|
Future<PrivateMessageView> deletePrivateMessage({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required int editId,
|
|
|
|
@required bool deleted,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /private_message/mark_as_read
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#mark-private-message-as-read
|
2020-08-09 23:32:42 +02:00
|
|
|
Future<PrivateMessageView> markPrivateMessageAsRead({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required int editId,
|
|
|
|
@required bool read,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /user/mark_all_as_read
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#mark-all-as-read
|
2020-08-10 19:47:44 +02:00
|
|
|
Future<List<ReplyView>> markAllAsRead({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// POST /user/delete_account
|
|
|
|
/// https://dev.lemmy.ml/docs/contributing_websocket_http_api.html#delete-account
|
2020-08-10 19:47:44 +02:00
|
|
|
/// returns jwt
|
|
|
|
Future<String> deleteAccount({
|
2020-08-05 23:21:26 +02:00
|
|
|
@required String password,
|
|
|
|
@required String auth,
|
|
|
|
}) {
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
}
|