|
|
@ -262,12 +262,24 @@ class CoreClient { |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final headers = <String, String>{}; |
|
|
|
final headers = <String, String>{}; |
|
|
|
Uint8List? body; |
|
|
|
Uint8List? body; |
|
|
|
|
|
|
|
if (file != '') { |
|
|
|
queryParameters['file'] = file.toString(); |
|
|
|
queryParameters['file'] = file.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (x != 32) { |
|
|
|
queryParameters['x'] = x.toString(); |
|
|
|
queryParameters['x'] = x.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (y != 32) { |
|
|
|
queryParameters['y'] = y.toString(); |
|
|
|
queryParameters['y'] = y.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (a != 0) { |
|
|
|
queryParameters['a'] = a.toString(); |
|
|
|
queryParameters['a'] = a.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (forceIcon != 1) { |
|
|
|
queryParameters['forceIcon'] = forceIcon.toString(); |
|
|
|
queryParameters['forceIcon'] = forceIcon.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (mode != 'fill') { |
|
|
|
queryParameters['mode'] = mode.toString(); |
|
|
|
queryParameters['mode'] = mode.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
final response = await rootClient.doRequest( |
|
|
|
final response = await rootClient.doRequest( |
|
|
|
'get', |
|
|
|
'get', |
|
|
|
Uri(path: path, queryParameters: queryParameters).toString(), |
|
|
|
Uri(path: path, queryParameters: queryParameters).toString(), |
|
|
@ -584,12 +596,24 @@ class NewsClient { |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final headers = <String, String>{}; |
|
|
|
final headers = <String, String>{}; |
|
|
|
Uint8List? body; |
|
|
|
Uint8List? body; |
|
|
|
|
|
|
|
if (type != 3) { |
|
|
|
queryParameters['type'] = type.toString(); |
|
|
|
queryParameters['type'] = type.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (id != 0) { |
|
|
|
queryParameters['id'] = id.toString(); |
|
|
|
queryParameters['id'] = id.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (getRead != 1) { |
|
|
|
queryParameters['getRead'] = getRead.toString(); |
|
|
|
queryParameters['getRead'] = getRead.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (batchSize != -1) { |
|
|
|
queryParameters['batchSize'] = batchSize.toString(); |
|
|
|
queryParameters['batchSize'] = batchSize.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (offset != 0) { |
|
|
|
queryParameters['offset'] = offset.toString(); |
|
|
|
queryParameters['offset'] = offset.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (oldestFirst != 0) { |
|
|
|
queryParameters['oldestFirst'] = oldestFirst.toString(); |
|
|
|
queryParameters['oldestFirst'] = oldestFirst.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
final response = await rootClient.doRequest( |
|
|
|
final response = await rootClient.doRequest( |
|
|
|
'get', |
|
|
|
'get', |
|
|
|
Uri(path: path, queryParameters: queryParameters).toString(), |
|
|
|
Uri(path: path, queryParameters: queryParameters).toString(), |
|
|
@ -611,9 +635,15 @@ class NewsClient { |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final headers = <String, String>{}; |
|
|
|
final headers = <String, String>{}; |
|
|
|
Uint8List? body; |
|
|
|
Uint8List? body; |
|
|
|
|
|
|
|
if (type != 3) { |
|
|
|
queryParameters['type'] = type.toString(); |
|
|
|
queryParameters['type'] = type.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (id != 0) { |
|
|
|
queryParameters['id'] = id.toString(); |
|
|
|
queryParameters['id'] = id.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (lastModified != 0) { |
|
|
|
queryParameters['lastModified'] = lastModified.toString(); |
|
|
|
queryParameters['lastModified'] = lastModified.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
final response = await rootClient.doRequest( |
|
|
|
final response = await rootClient.doRequest( |
|
|
|
'get', |
|
|
|
'get', |
|
|
|
Uri(path: path, queryParameters: queryParameters).toString(), |
|
|
|
Uri(path: path, queryParameters: queryParameters).toString(), |
|
|
@ -719,9 +749,15 @@ class NotesClient { |
|
|
|
if (category != null) { |
|
|
|
if (category != null) { |
|
|
|
queryParameters['category'] = category.toString(); |
|
|
|
queryParameters['category'] = category.toString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (exclude != '') { |
|
|
|
queryParameters['exclude'] = exclude.toString(); |
|
|
|
queryParameters['exclude'] = exclude.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (pruneBefore != 0) { |
|
|
|
queryParameters['pruneBefore'] = pruneBefore.toString(); |
|
|
|
queryParameters['pruneBefore'] = pruneBefore.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (chunkSize != 0) { |
|
|
|
queryParameters['chunkSize'] = chunkSize.toString(); |
|
|
|
queryParameters['chunkSize'] = chunkSize.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
if (chunkCursor != null) { |
|
|
|
if (chunkCursor != null) { |
|
|
|
queryParameters['chunkCursor'] = chunkCursor.toString(); |
|
|
|
queryParameters['chunkCursor'] = chunkCursor.toString(); |
|
|
|
} |
|
|
|
} |
|
|
@ -753,11 +789,21 @@ class NotesClient { |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
final headers = <String, String>{}; |
|
|
|
final headers = <String, String>{}; |
|
|
|
Uint8List? body; |
|
|
|
Uint8List? body; |
|
|
|
|
|
|
|
if (category != '') { |
|
|
|
queryParameters['category'] = category.toString(); |
|
|
|
queryParameters['category'] = category.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (title != '') { |
|
|
|
queryParameters['title'] = title.toString(); |
|
|
|
queryParameters['title'] = title.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (content != '') { |
|
|
|
queryParameters['content'] = content.toString(); |
|
|
|
queryParameters['content'] = content.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (modified != 0) { |
|
|
|
queryParameters['modified'] = modified.toString(); |
|
|
|
queryParameters['modified'] = modified.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (favorite != 0) { |
|
|
|
queryParameters['favorite'] = favorite.toString(); |
|
|
|
queryParameters['favorite'] = favorite.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
final response = await rootClient.doRequest( |
|
|
|
final response = await rootClient.doRequest( |
|
|
|
'post', |
|
|
|
'post', |
|
|
|
Uri(path: path, queryParameters: queryParameters).toString(), |
|
|
|
Uri(path: path, queryParameters: queryParameters).toString(), |
|
|
@ -780,7 +826,9 @@ class NotesClient { |
|
|
|
final headers = <String, String>{}; |
|
|
|
final headers = <String, String>{}; |
|
|
|
Uint8List? body; |
|
|
|
Uint8List? body; |
|
|
|
path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); |
|
|
|
path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); |
|
|
|
|
|
|
|
if (exclude != '') { |
|
|
|
queryParameters['exclude'] = exclude.toString(); |
|
|
|
queryParameters['exclude'] = exclude.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
if (ifNoneMatch != null) { |
|
|
|
if (ifNoneMatch != null) { |
|
|
|
headers['If-None-Match'] = ifNoneMatch.toString(); |
|
|
|
headers['If-None-Match'] = ifNoneMatch.toString(); |
|
|
|
} |
|
|
|
} |
|
|
@ -822,7 +870,9 @@ class NotesClient { |
|
|
|
if (category != null) { |
|
|
|
if (category != null) { |
|
|
|
queryParameters['category'] = category.toString(); |
|
|
|
queryParameters['category'] = category.toString(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (favorite != 0) { |
|
|
|
queryParameters['favorite'] = favorite.toString(); |
|
|
|
queryParameters['favorite'] = favorite.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
if (ifMatch != null) { |
|
|
|
if (ifMatch != null) { |
|
|
|
headers['If-Match'] = ifMatch.toString(); |
|
|
|
headers['If-Match'] = ifMatch.toString(); |
|
|
|
} |
|
|
|
} |
|
|
@ -1023,7 +1073,9 @@ class NotificationsClient { |
|
|
|
Uint8List? body; |
|
|
|
Uint8List? body; |
|
|
|
path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId.toString())); |
|
|
|
path = path.replaceAll('{userId}', Uri.encodeQueryComponent(userId.toString())); |
|
|
|
queryParameters['shortMessage'] = shortMessage.toString(); |
|
|
|
queryParameters['shortMessage'] = shortMessage.toString(); |
|
|
|
|
|
|
|
if (longMessage != '') { |
|
|
|
queryParameters['longMessage'] = longMessage.toString(); |
|
|
|
queryParameters['longMessage'] = longMessage.toString(); |
|
|
|
|
|
|
|
} |
|
|
|
final response = await rootClient.doRequest( |
|
|
|
final response = await rootClient.doRequest( |
|
|
|
'post', |
|
|
|
'post', |
|
|
|
Uri(path: path, queryParameters: queryParameters).toString(), |
|
|
|
Uri(path: path, queryParameters: queryParameters).toString(), |
|
|
|