Browse Source

tool,specs,nextcloud,neon: Use required object properties

pull/93/head
jld3103 2 years ago
parent
commit
d4cf0908b2
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 2
      packages/neon/integration_test/screenshot_test.dart
  2. 2
      packages/neon/lib/src/app.dart
  3. 10
      packages/neon/lib/src/apps/news/blocs/articles.dart
  4. 6
      packages/neon/lib/src/apps/news/blocs/news.dart
  5. 4
      packages/neon/lib/src/apps/news/dialogs/feed_show_url.dart
  6. 16
      packages/neon/lib/src/apps/news/pages/article.dart
  7. 2
      packages/neon/lib/src/apps/news/pages/feed.dart
  8. 2
      packages/neon/lib/src/apps/news/pages/folder.dart
  9. 6
      packages/neon/lib/src/apps/news/sort/articles.dart
  10. 4
      packages/neon/lib/src/apps/news/sort/feeds.dart
  11. 2
      packages/neon/lib/src/apps/news/sort/folders.dart
  12. 20
      packages/neon/lib/src/apps/news/widgets/articles_view.dart
  13. 4
      packages/neon/lib/src/apps/news/widgets/feed_icon.dart
  14. 18
      packages/neon/lib/src/apps/news/widgets/feeds_view.dart
  15. 2
      packages/neon/lib/src/apps/news/widgets/folder_select.dart
  16. 12
      packages/neon/lib/src/apps/news/widgets/folders_view.dart
  17. 2
      packages/neon/lib/src/apps/notes/dialogs/create_note.dart
  18. 2
      packages/neon/lib/src/apps/notes/dialogs/select_category.dart
  19. 8
      packages/neon/lib/src/apps/notes/pages/note.dart
  20. 4
      packages/neon/lib/src/apps/notes/sort/notes.dart
  21. 2
      packages/neon/lib/src/apps/notes/widgets/categories_view.dart
  22. 30
      packages/neon/lib/src/apps/notes/widgets/notes_view.dart
  23. 2
      packages/neon/lib/src/apps/notifications/blocs/notifications.dart
  24. 12
      packages/neon/lib/src/apps/notifications/pages/main.dart
  25. 4
      packages/neon/lib/src/blocs/apps.dart
  26. 6
      packages/neon/lib/src/blocs/apps.rxb.g.dart
  27. 8
      packages/neon/lib/src/blocs/capabilities.dart
  28. 6
      packages/neon/lib/src/blocs/capabilities.rxb.g.dart
  29. 4
      packages/neon/lib/src/blocs/login.dart
  30. 2
      packages/neon/lib/src/blocs/push_notifications.dart
  31. 2
      packages/neon/lib/src/blocs/user_details.dart
  32. 2
      packages/neon/lib/src/blocs/user_status.dart
  33. 24
      packages/neon/lib/src/pages/home/home.dart
  34. 2
      packages/neon/lib/src/pages/home/widgets/server_status.dart
  35. 12
      packages/neon/lib/src/pages/login/login.dart
  36. 8
      packages/neon/lib/src/pages/settings/account_specific_settings.dart
  37. 10
      packages/neon/lib/src/utils/push_utils.dart
  38. 6
      packages/neon/lib/src/utils/theme.dart
  39. 6
      packages/nextcloud/lib/src/helpers.dart
  40. 3282
      packages/nextcloud/lib/src/nextcloud.openapi.dart
  41. 1564
      packages/nextcloud/lib/src/nextcloud.openapi.g.dart
  42. 560
      packages/nextcloud/lib/src/nextcloud.openapi.json
  43. 12
      packages/nextcloud/lib/src/version_supported.dart
  44. 40
      packages/nextcloud/test/core_test.dart
  45. 98
      packages/nextcloud/test/news_test.dart
  46. 18
      packages/nextcloud/test/notes_test.dart
  47. 91
      packages/nextcloud/test/notifications_test.dart
  48. 16
      packages/nextcloud/test/provisioning_api_test.dart
  49. 161
      packages/nextcloud/test/user_status_test.dart
  50. 289
      specs/core.json
  51. 88
      specs/news.json
  52. 63
      specs/notes.json
  53. 74
      specs/notifications.json
  54. 59
      specs/provisioning_api.json
  55. 97
      specs/user_status.json
  56. 6
      tool/generate-nextcloud.sh

2
packages/neon/integration_test/screenshot_test.dart

@ -311,7 +311,7 @@ Future main() async {
final folder = await account.client.news.createFolder(name: 'test');
await account.client.news.addFeed(
url: nasaFeedURL,
folderId: folder.folders!.single.id,
folderId: folder.folders.single.id,
);
await pumpAppPage(

2
packages/neon/lib/src/app.dart

@ -23,7 +23,7 @@ class NeonApp extends StatefulWidget {
// ignore: prefer_mixin
class _NeonAppState extends State<NeonApp> with WidgetsBindingObserver {
final _navigatorKey = GlobalKey<NavigatorState>();
CoreServerCapabilitiesOcsDataCapabilitiesTheming? _userTheme;
CoreServerCapabilities_Ocs_Data_Capabilities_Theming? _userTheme;
final _platformBrightness = BehaviorSubject<Brightness>.seeded(
WidgetsBinding.instance.window.platformBrightness,
);

10
packages/neon/lib/src/apps/news/blocs/articles.dart

@ -70,7 +70,7 @@ class NewsArticlesBloc extends $NewsArticlesBloc {
_$markArticleAsReadEvent.listen((final article) {
_wrapArticleAction((final client) async {
await client.news.markArticleAsRead(itemId: article.id!);
await client.news.markArticleAsRead(itemId: article.id);
// TODO
//_articleUpdateController.add(article..unread = false);
});
@ -78,7 +78,7 @@ class NewsArticlesBloc extends $NewsArticlesBloc {
_$markArticleAsUnreadEvent.listen((final article) {
_wrapArticleAction((final client) async {
await client.news.markArticleAsUnread(itemId: article.id!);
await client.news.markArticleAsUnread(itemId: article.id);
// TODO
//_articleUpdateController.add(article..unread = true);
});
@ -87,7 +87,7 @@ class NewsArticlesBloc extends $NewsArticlesBloc {
_$starArticleEvent.listen((final article) {
_wrapArticleAction((final client) async {
await client.news.starArticle(
itemId: article.id!,
itemId: article.id,
);
// TODO
//_articleUpdateController.add(article..starred = true);
@ -97,7 +97,7 @@ class NewsArticlesBloc extends $NewsArticlesBloc {
_$unstarArticleEvent.listen((final article) {
_wrapArticleAction((final client) async {
await client.news.unstarArticle(
itemId: article.id!,
itemId: article.id,
);
// TODO
//_articleUpdateController.add(article..starred = false);
@ -165,7 +165,7 @@ class NewsArticlesBloc extends $NewsArticlesBloc {
id: id ?? 0,
getRead: getRead ?? true ? 1 : 0,
),
(final response) => response.items!,
(final response) => response.items,
previousData: _articlesSubject.valueOrNull?.data,
)
.listen(_articlesSubject.add);

6
packages/neon/lib/src/apps/news/blocs/news.dart

@ -140,7 +140,7 @@ class NewsBloc extends $NewsBloc {
if (result.data != null) {
final type = mainArticlesBloc.filterType.valueOrNull;
_unreadCounterSubject
.add(result.data!.where((final a) => type == FilterType.starred ? a.starred! : a.unread!).length);
.add(result.data!.where((final a) => type == FilterType.starred ? a.starred : a.unread).length);
}
});
@ -186,7 +186,7 @@ class NewsBloc extends $NewsBloc {
client.id,
'news-folders',
() async => client.news.listFolders(),
(final response) => response.folders!,
(final response) => response.folders,
previousData: _foldersSubject.valueOrNull?.data,
)
.listen(_foldersSubject.add);
@ -202,7 +202,7 @@ class NewsBloc extends $NewsBloc {
if (response.newestItemId != null) {
_newestItemId = response.newestItemId!;
}
return response.feeds!;
return response.feeds;
},
previousData: _feedsSubject.valueOrNull?.data,
).listen(_feedsSubject.add);

4
packages/neon/lib/src/apps/news/dialogs/feed_show_url.dart

@ -15,13 +15,13 @@ class NewsFeedShowURLDialog extends StatefulWidget {
class _NewsFeedShowURLDialogState extends State<NewsFeedShowURLDialog> {
@override
Widget build(final BuildContext context) => AlertDialog(
title: Text(widget.feed.url!),
title: Text(widget.feed.url),
actions: [
ElevatedButton(
onPressed: () async {
await Clipboard.setData(
ClipboardData(
text: widget.feed.url!,
text: widget.feed.url,
),
);
if (mounted) {

16
packages/neon/lib/src/apps/news/pages/article.dart

@ -56,12 +56,12 @@ class _NewsArticlePageState extends State<NewsArticlePage> {
}
void _startMarkAsReadTimer() {
if (article.unread!) {
if (article.unread) {
if (widget.bloc.newsBloc.options.articleDisableMarkAsReadTimeoutOption.value) {
widget.bloc.markArticleAsRead(article);
} else {
_markAsReadTimer = Timer(const Duration(seconds: 3), () {
if (article.unread!) {
if (article.unread) {
widget.bloc.markArticleAsRead(article);
}
});
@ -81,7 +81,7 @@ class _NewsArticlePageState extends State<NewsArticlePage> {
return (await _webviewController!.currentUrl())!;
}
return article.url!;
return article.url;
}
@override
@ -103,23 +103,23 @@ class _NewsArticlePageState extends State<NewsArticlePage> {
actions: [
IconButton(
onPressed: () async {
if (article.starred!) {
if (article.starred) {
widget.bloc.unstarArticle(article);
} else {
widget.bloc.starArticle(article);
}
},
icon: Icon(article.starred! ? Icons.star : Icons.star_outline),
icon: Icon(article.starred ? Icons.star : Icons.star_outline),
),
IconButton(
onPressed: () async {
if (article.unread!) {
if (article.unread) {
widget.bloc.markArticleAsRead(article);
} else {
widget.bloc.markArticleAsUnread(article);
}
},
icon: Icon(article.unread! ? MdiIcons.email : MdiIcons.emailMarkAsUnread),
icon: Icon(article.unread ? MdiIcons.email : MdiIcons.emailMarkAsUnread),
),
IconButton(
onPressed: () async {
@ -147,7 +147,7 @@ class _NewsArticlePageState extends State<NewsArticlePage> {
javascriptMode: JavascriptMode.unrestricted,
onWebViewCreated: (final controller) async {
_webviewController = controller;
await controller.loadUrl(article.url!);
await controller.loadUrl(article.url);
},
onPageStarted: (final _) {
setState(() {

2
packages/neon/lib/src/apps/news/pages/feed.dart

@ -14,7 +14,7 @@ class NewsFeedPage extends StatelessWidget {
Widget build(final BuildContext context) => Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: Text(feed.title!),
title: Text(feed.title),
),
body: NewsArticlesView(
bloc: NewsArticlesBloc(

2
packages/neon/lib/src/apps/news/pages/folder.dart

@ -14,7 +14,7 @@ class NewsFolderPage extends StatelessWidget {
Widget build(final BuildContext context) => Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: Text(folder.name!),
title: Text(folder.name),
),
body: NewsFolderView(
bloc: bloc,

6
packages/neon/lib/src/apps/news/sort/articles.dart

@ -2,9 +2,9 @@ part of '../app.dart';
final articlesSortBox = SortBox<ArticlesSortProperty, NewsArticle>(
{
ArticlesSortProperty.publishDate: (final article) => article.pubDate!,
ArticlesSortProperty.alphabetical: (final article) => article.title!.toLowerCase(),
ArticlesSortProperty.byFeed: (final article) => article.feedId!,
ArticlesSortProperty.publishDate: (final article) => article.pubDate,
ArticlesSortProperty.alphabetical: (final article) => article.title.toLowerCase(),
ArticlesSortProperty.byFeed: (final article) => article.feedId,
},
{
ArticlesSortProperty.alphabetical: Box(ArticlesSortProperty.publishDate, SortBoxOrder.descending),

4
packages/neon/lib/src/apps/news/sort/feeds.dart

@ -2,8 +2,8 @@ part of '../app.dart';
final feedsSortBox = SortBox<FeedsSortProperty, NewsFeed>(
{
FeedsSortProperty.alphabetical: (final feed) => feed.title!.toLowerCase(),
FeedsSortProperty.unreadCount: (final feed) => feed.unreadCount!,
FeedsSortProperty.alphabetical: (final feed) => feed.title.toLowerCase(),
FeedsSortProperty.unreadCount: (final feed) => feed.unreadCount ?? 0,
},
{
FeedsSortProperty.alphabetical: Box(FeedsSortProperty.unreadCount, SortBoxOrder.descending),

2
packages/neon/lib/src/apps/news/sort/folders.dart

@ -2,7 +2,7 @@ part of '../app.dart';
final foldersSortBox = SortBox<FoldersSortProperty, FolderFeedsWrapper>(
{
FoldersSortProperty.alphabetical: (final folderFeedsWrapper) => folderFeedsWrapper.folder.name!.toLowerCase(),
FoldersSortProperty.alphabetical: (final folderFeedsWrapper) => folderFeedsWrapper.folder.name.toLowerCase(),
FoldersSortProperty.unreadCount: (final folderFeedsWrapper) => feedsUnreadCountSum(folderFeedsWrapper.feeds),
},
{

20
packages/neon/lib/src/apps/news/widgets/articles_view.dart

@ -139,8 +139,8 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
children: [
Flexible(
child: Text(
article.title!,
style: article.unread!
article.title,
style: article.unread
? null
: Theme.of(context).textTheme.subtitle1!.copyWith(color: Theme.of(context).disabledColor),
),
@ -170,7 +170,7 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
),
),
RelativeTime(
date: DateTime.fromMillisecondsSinceEpoch(article.pubDate! * 1000),
date: DateTime.fromMillisecondsSinceEpoch(article.pubDate * 1000),
style: const TextStyle(
fontWeight: FontWeight.w300,
fontSize: 12,
@ -181,7 +181,7 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
),
Flexible(
child: Text(
feed.title!,
feed.title,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
@ -190,11 +190,11 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
),
trailing: IconButton(
icon: Icon(
article.starred! ? Icons.star : Icons.star_outline,
article.starred ? Icons.star : Icons.star_outline,
color: Theme.of(context).colorScheme.primary,
),
onPressed: () {
if (article.starred!) {
if (article.starred) {
bloc.unstarArticle(article);
} else {
bloc.starArticle(article);
@ -202,7 +202,7 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
},
),
onLongPress: () {
if (article.unread!) {
if (article.unread) {
bloc.markArticleAsRead(article);
} else {
bloc.markArticleAsUnread(article);
@ -212,7 +212,7 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
final viewType = bloc.newsBloc.options.articleViewTypeOption.value;
String? bodyData;
try {
bodyData = _fixArticleBody(article.body!);
bodyData = _fixArticleBody(article.body);
} catch (e, s) {
debugPrint(e.toString());
debugPrint(s.toString());
@ -241,11 +241,11 @@ class _NewsArticlesViewState extends State<NewsArticlesView> {
),
);
} else {
if (article.unread!) {
if (article.unread) {
bloc.markArticleAsRead(article);
}
await launchUrlString(
article.url!,
article.url,
mode: LaunchMode.externalApplication,
);
}

4
packages/neon/lib/src/apps/news/widgets/feed_icon.dart

@ -18,9 +18,9 @@ class NewsFeedIcon extends StatelessWidget {
width: size,
height: size,
borderRadius: borderRadius,
child: feed.faviconLink != null && feed.faviconLink != ''
child: feed.faviconLink != ''
? CachedURLImage(
url: feed.faviconLink!,
url: feed.faviconLink,
height: size,
width: size,
iconColor: Theme.of(context).colorScheme.primary,

18
packages/neon/lib/src/apps/news/widgets/feeds_view.dart

@ -89,7 +89,7 @@ class NewsFeedsView extends StatelessWidget {
) =>
ListTile(
title: Text(
feed.title!,
feed.title,
style: feed.unreadCount! == 0
? Theme.of(context).textTheme.subtitle1!.copyWith(color: Theme.of(context).disabledColor)
: null,
@ -104,7 +104,7 @@ class NewsFeedsView extends StatelessWidget {
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (feed.updateErrorCount! > 0) ...[
if (feed.updateErrorCount > 0) ...[
IconButton(
iconSize: 30,
onPressed: () async {
@ -116,7 +116,7 @@ class NewsFeedsView extends StatelessWidget {
);
},
icon: Text(
feed.updateErrorCount!.toString(),
feed.updateErrorCount.toString(),
style: const TextStyle(
color: Colors.red,
),
@ -157,19 +157,19 @@ class NewsFeedsView extends StatelessWidget {
case NewsFeedAction.delete:
if (await showConfirmationDialog(
context,
AppLocalizations.of(context).newsRemoveFeedConfirm(feed.title!),
AppLocalizations.of(context).newsRemoveFeedConfirm(feed.title),
)) {
bloc.removeFeed(feed.id!);
bloc.removeFeed(feed.id);
}
break;
case NewsFeedAction.rename:
final result = await showRenameDialog(
context: context,
title: AppLocalizations.of(context).newsRenameFeed,
value: feed.title!,
value: feed.title,
);
if (result != null) {
bloc.renameFeed(feed.id!, result);
bloc.renameFeed(feed.id, result);
}
break;
case NewsFeedAction.move:
@ -181,7 +181,7 @@ class NewsFeedsView extends StatelessWidget {
),
);
if (result != null) {
bloc.moveFeed(feed.id!, result[0]);
bloc.moveFeed(feed.id, result[0]);
}
break;
}
@ -191,7 +191,7 @@ class NewsFeedsView extends StatelessWidget {
),
onLongPress: () {
if (feed.unreadCount! > 0) {
bloc.markFeedAsRead(feed.id!);
bloc.markFeedAsRead(feed.id);
}
},
onTap: () async {

2
packages/neon/lib/src/apps/news/widgets/folder_select.dart

@ -25,7 +25,7 @@ class NewsFolderSelect extends StatelessWidget {
...folders.map(
(final f) => DropdownMenuItem<NewsFolder>(
value: f,
child: Text(f.name!),
child: Text(f.name),
),
),
],

12
packages/neon/lib/src/apps/news/widgets/folders_view.dart

@ -87,7 +87,7 @@ class NewsFoldersView extends StatelessWidget {
final unreadCount = feedsUnreadCountSum(folderFeedsWrapper.feeds);
return ListTile(
title: Text(
folderFeedsWrapper.folder.name!,
folderFeedsWrapper.folder.name,
style: unreadCount == 0
? Theme.of(context).textTheme.subtitle1!.copyWith(color: Theme.of(context).disabledColor)
: null,
@ -129,19 +129,19 @@ class NewsFoldersView extends StatelessWidget {
case NewsFolderAction.delete:
if (await showConfirmationDialog(
context,
AppLocalizations.of(context).newsDeleteFolderConfirm(folderFeedsWrapper.folder.name!),
AppLocalizations.of(context).newsDeleteFolderConfirm(folderFeedsWrapper.folder.name),
)) {
bloc.deleteFolder(folderFeedsWrapper.folder.id!);
bloc.deleteFolder(folderFeedsWrapper.folder.id);
}
break;
case NewsFolderAction.rename:
final result = await showRenameDialog(
context: context,
title: AppLocalizations.of(context).newsRenameFolder,
value: folderFeedsWrapper.folder.name!,
value: folderFeedsWrapper.folder.name,
);
if (result != null) {
bloc.renameFolder(folderFeedsWrapper.folder.id!, result);
bloc.renameFolder(folderFeedsWrapper.folder.id, result);
}
break;
}
@ -149,7 +149,7 @@ class NewsFoldersView extends StatelessWidget {
),
onLongPress: () {
if (unreadCount > 0) {
bloc.markFolderAsRead(folderFeedsWrapper.folder.id!);
bloc.markFolderAsRead(folderFeedsWrapper.folder.id);
}
},
onTap: () async {

2
packages/neon/lib/src/apps/notes/dialogs/create_note.dart

@ -71,7 +71,7 @@ class _NotesCreateNoteDialogState extends State<NotesCreateNoteDialog> {
),
if (notesData != null) ...[
NotesCategorySelect(
categories: notesData.map((final note) => note.category!).toSet().toList(),
categories: notesData.map((final note) => note.category).toSet().toList(),
onChanged: (final category) {
selectedCategory = category;
},

2
packages/neon/lib/src/apps/notes/dialogs/select_category.dart

@ -59,7 +59,7 @@ class _NotesSelectCategoryDialogState extends State<NotesSelectCategoryDialog> {
),
if (notesData != null) ...[
NotesCategorySelect(
categories: notesData.map((final note) => note.category!).toSet().toList(),
categories: notesData.map((final note) => note.category).toSet().toList(),
initialValue: widget.note.category,
onChanged: (final category) {
selectedCategory = category;

8
packages/neon/lib/src/apps/notes/pages/note.dart

@ -36,8 +36,8 @@ class _NotesNotePageState extends State<NotesNotePage> {
if (updatedTitle != null || updatedCategory != null || updatedContent != null) {
widget.bloc.updateNote(
_note.id!,
_note.etag!,
_note.id,
_note.etag,
title: updatedTitle,
category: updatedCategory,
content: updatedContent,
@ -75,7 +75,7 @@ class _NotesNotePageState extends State<NotesNotePage> {
await Wakelock.enable();
}
if (widget.bloc.options.defaultNoteViewTypeOption.value == DefaultNoteViewType.edit ||
widget.note.content!.isEmpty) {
widget.note.content.isEmpty) {
setState(() {
_showEditor = true;
});
@ -157,7 +157,7 @@ class _NotesNotePageState extends State<NotesNotePage> {
},
icon: Icon(
MdiIcons.tag,
color: _note.category!.isNotEmpty ? NotesCategoryColor.compute(_note.category!) : null,
color: _note.category.isNotEmpty ? NotesCategoryColor.compute(_note.category) : null,
),
),
],

4
packages/neon/lib/src/apps/notes/sort/notes.dart

@ -2,8 +2,8 @@ part of '../app.dart';
final notesSortBox = SortBox<NotesSortProperty, NotesNote>(
{
NotesSortProperty.alphabetical: (final note) => note.title!.toLowerCase(),
NotesSortProperty.lastModified: (final note) => note.modified!,
NotesSortProperty.alphabetical: (final note) => note.title.toLowerCase(),
NotesSortProperty.lastModified: (final note) => note.modified,
},
{
NotesSortProperty.alphabetical: Box(NotesSortProperty.lastModified, SortBoxOrder.descending),

2
packages/neon/lib/src/apps/notes/widgets/categories_view.dart

@ -24,7 +24,7 @@ class NotesCategoriesView extends StatelessWidget {
sortPropertyOption: bloc.options.categoriesSortPropertyOption,
sortBoxOrderOption: bloc.options.categoriesSortBoxOrderOption,
input: notesData
?.map((final note) => note.category!)
?.map((final note) => note.category)
.toSet()
.map(
(final category) => NoteCategory(

30
packages/neon/lib/src/apps/notes/widgets/notes_view.dart

@ -46,15 +46,15 @@ class NotesView extends StatelessWidget {
sortPropertyOption: bloc.options.notesSortPropertyOption,
sortBoxOrderOption: bloc.options.notesSortBoxOrderOption,
input: category != null
? notesData?.where((final note) => note.favorite! && note.category == category).toList()
: notesData?.where((final note) => note.favorite!).toList(),
? notesData?.where((final note) => note.favorite && note.category == category).toList()
: notesData?.where((final note) => note.favorite).toList(),
builder: (final context, final sortedFavorites) => SortBoxBuilder<NotesSortProperty, NotesNote>(
sortBox: notesSortBox,
sortPropertyOption: bloc.options.notesSortPropertyOption,
sortBoxOrderOption: bloc.options.notesSortBoxOrderOption,
input: category != null
? notesData?.where((final note) => !note.favorite! && note.category == category).toList()
: notesData?.where((final note) => !note.favorite!).toList(),
? notesData?.where((final note) => !note.favorite && note.category == category).toList()
: notesData?.where((final note) => !note.favorite).toList(),
builder: (final context, final sortedNonFavorites) => CustomListView<NotesNote>(
scrollKey: 'notes-notes',
withFloatingActionButton: true,
@ -86,38 +86,38 @@ class NotesView extends StatelessWidget {
final NotesNote note,
) =>
ListTile(
title: Text(note.title!),
title: Text(note.title),
subtitle: Row(
children: [
RelativeTime(
date: DateTime.fromMillisecondsSinceEpoch(note.modified! * 1000),
date: DateTime.fromMillisecondsSinceEpoch(note.modified * 1000),
),
if (note.category! != '') ...[
if (note.category != '') ...[
const SizedBox(
width: 8,
),
Icon(
MdiIcons.tag,
size: 14,
color: NotesCategoryColor.compute(note.category!),
color: NotesCategoryColor.compute(note.category),
),
const SizedBox(
width: 2,
),
Text(note.category!),
Text(note.category),
],
],
),
trailing: IconButton(
icon: Icon(
note.favorite! ? Icons.star : Icons.star_outline,
note.favorite ? Icons.star : Icons.star_outline,
color: Theme.of(context).colorScheme.primary,
),
onPressed: () {
bloc.updateNote(
note.id!,
note.etag!,
favorite: !note.favorite!,
note.id,
note.etag,
favorite: !note.favorite,
);
},
),
@ -134,10 +134,10 @@ class NotesView extends StatelessWidget {
onLongPress: () async {
final result = await showConfirmationDialog(
context,
AppLocalizations.of(context).notesDeleteNoteConfirm(note.title!),
AppLocalizations.of(context).notesDeleteNoteConfirm(note.title),
);
if (result) {
bloc.deleteNote(note.id!);
bloc.deleteNote(note.id);
}
},
);

2
packages/neon/lib/src/apps/notifications/blocs/notifications.dart

@ -65,7 +65,7 @@ class NotificationsBloc extends $NotificationsBloc {
_client.id,
'notifications-notifications',
() async => _client.notifications.listNotifications(),
(final response) => response.ocs!.data!,
(final response) => response.ocs.data,
previousData: _notificationsSubject.valueOrNull?.data,
)
.listen(_notificationsSubject.add);

12
packages/neon/lib/src/apps/notifications/pages/main.dart

@ -68,13 +68,13 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
.toList();
return ListTile(
title: Text(notification.subject!),
title: Text(notification.subject),
subtitle: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (notification.message!.isNotEmpty) ...[
if (notification.message.isNotEmpty) ...[
Text(
notification.message!,
notification.message,
overflow: TextOverflow.ellipsis,
),
const SizedBox(
@ -82,7 +82,7 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
),
],
RelativeTime(
date: DateTime.parse(notification.datetime!),
date: DateTime.parse(notification.datetime),
),
],
),
@ -96,7 +96,7 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
width: 40,
height: 40,
child: CachedURLImage(
url: notification.icon!,
url: notification.icon,
width: 40,
height: 40,
svgColor: Theme.of(context).colorScheme.primary,
@ -124,7 +124,7 @@ class _NotificationsMainPageState extends State<NotificationsMainPage> {
}
},
onLongPress: () {
widget.bloc.deleteNotification(notification.notificationId!);
widget.bloc.deleteNotification(notification.notificationId);
},
);
}

4
packages/neon/lib/src/blocs/apps.dart

@ -10,7 +10,7 @@ import 'package:rxdart/rxdart.dart';
part 'apps.rxb.g.dart';
typedef NextcloudApp = CoreNavigationAppsOcsData;
typedef NextcloudApp = CoreNavigationApps_Ocs_Data;
abstract class AppsBlocEvents {
void refresh();
@ -105,7 +105,7 @@ class AppsBloc extends $AppsBloc {
_account.client.id,
'apps-apps',
() async => _account.client.core.getNavigationApps(),
(final response) => response.ocs!.data!,
(final response) => response.ocs.data,
previousData: _appsSubject.valueOrNull?.data,
)
.listen(_appsSubject.add);

6
packages/neon/lib/src/blocs/apps.rxb.g.dart

@ -25,7 +25,7 @@ abstract class $AppsBloc extends RxBlocBase implements AppsBlocEvents, AppsBlocS
final _$setActiveAppEvent = PublishSubject<String?>();
/// The state of [apps] implemented in [_mapToAppsState]
late final BehaviorSubject<Result<List<CoreNavigationAppsOcsData>>> _appsState = _mapToAppsState();
late final BehaviorSubject<Result<List<CoreNavigationApps_Ocs_Data>>> _appsState = _mapToAppsState();
/// The state of [appImplementations] implemented in
/// [_mapToAppImplementationsState]
@ -42,7 +42,7 @@ abstract class $AppsBloc extends RxBlocBase implements AppsBlocEvents, AppsBlocS
void setActiveApp(String? appID) => _$setActiveAppEvent.add(appID);
@override
BehaviorSubject<Result<List<CoreNavigationAppsOcsData>>> get apps => _appsState;
BehaviorSubject<Result<List<CoreNavigationApps_Ocs_Data>>> get apps => _appsState;
@override
BehaviorSubject<Result<List<AppImplementation<RxBlocBase, NextcloudAppSpecificOptions>>>> get appImplementations =>
@ -51,7 +51,7 @@ abstract class $AppsBloc extends RxBlocBase implements AppsBlocEvents, AppsBlocS
@override
BehaviorSubject<String?> get activeAppID => _activeAppIDState;
BehaviorSubject<Result<List<CoreNavigationAppsOcsData>>> _mapToAppsState();
BehaviorSubject<Result<List<CoreNavigationApps_Ocs_Data>>> _mapToAppsState();
BehaviorSubject<Result<List<AppImplementation<RxBlocBase, NextcloudAppSpecificOptions>>>>
_mapToAppImplementationsState();

8
packages/neon/lib/src/blocs/capabilities.dart

@ -8,8 +8,8 @@ import 'package:rxdart/rxdart.dart';
part 'capabilities.rxb.g.dart';
typedef Capabilities = CoreServerCapabilitiesOcsData;
typedef NextcloudTheme = CoreServerCapabilitiesOcsDataCapabilitiesTheming;
typedef Capabilities = CoreServerCapabilities_Ocs_Data;
typedef NextcloudTheme = CoreServerCapabilities_Ocs_Data_Capabilities_Theming;
abstract class CapabilitiesBlocEvents {
void refresh();
@ -32,11 +32,11 @@ class CapabilitiesBloc extends $CapabilitiesBloc {
void _loadCapabilities() {
_requestManager
.wrapNextcloud<CoreServerCapabilitiesOcsData, CoreServerCapabilities>(
.wrapNextcloud<CoreServerCapabilities_Ocs_Data, CoreServerCapabilities>(
_client.id,
'capabilities',
() async => _client.core.getCapabilities(),
(final response) => response.ocs!.data!,
(final response) => response.ocs.data,
previousData: _capabilitiesSubject.valueOrNull?.data,
)
.listen(_capabilitiesSubject.add);

6
packages/neon/lib/src/blocs/capabilities.rxb.g.dart

@ -23,15 +23,15 @@ abstract class $CapabilitiesBloc extends RxBlocBase
final _$refreshEvent = PublishSubject<void>();
/// The state of [capabilities] implemented in [_mapToCapabilitiesState]
late final BehaviorSubject<Result<CoreServerCapabilitiesOcsData>> _capabilitiesState = _mapToCapabilitiesState();
late final BehaviorSubject<Result<CoreServerCapabilities_Ocs_Data>> _capabilitiesState = _mapToCapabilitiesState();
@override
void refresh() => _$refreshEvent.add(null);
@override
BehaviorSubject<Result<CoreServerCapabilitiesOcsData>> get capabilities => _capabilitiesState;
BehaviorSubject<Result<CoreServerCapabilities_Ocs_Data>> get capabilities => _capabilitiesState;
BehaviorSubject<Result<CoreServerCapabilitiesOcsData>> _mapToCapabilitiesState();
BehaviorSubject<Result<CoreServerCapabilities_Ocs_Data>> _mapToCapabilitiesState();
@override
CapabilitiesBlocEvents get events => this;

4
packages/neon/lib/src/blocs/login.dart

@ -40,7 +40,7 @@ class LoginBloc extends $LoginBloc {
);
final status = await client.core.getStatus();
if (status.maintenance!) {
if (status.maintenance) {
_serverConnectionStateSubject.add(ServerConnectionState.maintenanceMode);
return;
}
@ -53,7 +53,7 @@ class LoginBloc extends $LoginBloc {
_cancelPollTimer();
_pollTimer = Timer.periodic(const Duration(seconds: 2), (final _) async {
try {
final result = await client.core.getLoginFlowResult(token: init.poll!.token!);
final result = await client.core.getLoginFlowResult(token: init.poll.token);
_cancelPollTimer();
_loginFlowResultSubject.add(result);
} catch (e) {

2
packages/neon/lib/src/blocs/push_notifications.dart

@ -80,7 +80,7 @@ class PushNotificationsBloc extends $PushNotificationsBloc {
await account.client.notifications.registerDeviceAtPushProxy(
endpoint,
subscription.ocs!.data!,
subscription.ocs.data,
proxyServerForClient,
);

2
packages/neon/lib/src/blocs/user_details.dart

@ -33,7 +33,7 @@ class UserDetailsBloc extends $UserDetailsBloc {
_client.id,
'user-details',
() async => _client.provisioningApi.getCurrentUser(),
(final response) => response.ocs!.data!,
(final response) => response.ocs.data,
previousData: _userDetailsSubject.valueOrNull?.data,
)
.listen(_userDetailsSubject.add);

2
packages/neon/lib/src/blocs/user_status.dart

@ -44,7 +44,7 @@ class UserStatusBloc extends $UserStatusBloc {
_account.client.id,
'user-status',
() async => _account.client.userStatus.getStatus(),
(final response) => response.ocs?.data?.userStatus,
(final response) => response.ocs.data.userStatus,
previousData: _userStatusSubject.valueOrNull?.data,
)
.listen(_userStatusSubject.add);

24
packages/neon/lib/src/pages/home/home.dart

@ -51,7 +51,7 @@ class _HomePageState extends State<HomePage> with tray.TrayListener, WindowListe
);
_capabilitiesBloc.capabilities.listen((final result) async {
if (result.data != null) {
widget.onThemeChanged(result.data!.capabilities!.theming!);
widget.onThemeChanged(result.data!.capabilities.theming!);
// ignore cached version and prevent duplicate dialogs
if (result is ResultSuccess) {
@ -161,7 +161,7 @@ class _HomePageState extends State<HomePage> with tray.TrayListener, WindowListe
final allAppImplementations = Provider.of<List<AppImplementation>>(context, listen: false);
final matchingAppImplementations = allAppImplementations.where((final a) => a.id == notification.app);
if (matchingAppImplementations.isNotEmpty) {
_appsBloc.setActiveApp(notification.app!);
_appsBloc.setActiveApp(notification.app);
return true;
}
@ -183,7 +183,7 @@ class _HomePageState extends State<HomePage> with tray.TrayListener, WindowListe
final allAppImplementations = Provider.of<List<AppImplementation>>(context, listen: false);
final matchingAppImplementations =
allAppImplementations.where((final a) => a.id == notification.subject!.app);
allAppImplementations.where((final a) => a.id == notification.subject.app);
late AppImplementation appImplementation;
if (matchingAppImplementations.isNotEmpty) {
@ -193,7 +193,7 @@ class _HomePageState extends State<HomePage> with tray.TrayListener, WindowListe
}
if (appImplementation.id != 'notifications') {
_appsBloc.getAppBloc<NotificationsBloc>(appImplementation).deleteNotification(notification.subject!.nid!);
_appsBloc.getAppBloc<NotificationsBloc>(appImplementation).deleteNotification(notification.subject.nid);
}
await _openAppFromExternal(appImplementation.id);
}
@ -435,18 +435,16 @@ class _HomePageState extends State<HomePage> with tray.TrayListener, WindowListe
children: [
if (capabilitiesData != null) ...[
Text(
capabilitiesData.capabilities!.theming!.name!,
capabilitiesData.capabilities.theming!.name,
style: DefaultTextStyle.of(context).style.copyWith(
color: Theme.of(context).appBarTheme.foregroundColor,
),
),
if (capabilitiesData.capabilities!.theming!.logo != null) ...[
Flexible(
child: CachedURLImage(
url: capabilitiesData.capabilities!.theming!.logo!,
),
Flexible(
child: CachedURLImage(
url: capabilitiesData.capabilities.theming!.logo,
),
],
),
] else ...[
ExceptionWidget(
capabilitiesError,
@ -626,9 +624,9 @@ class _HomePageState extends State<HomePage> with tray.TrayListener, WindowListe
leading: isQuickBar
? Container(
padding: const EdgeInsets.all(5),
child: capabilitiesData?.capabilities?.theming?.logo != null
child: capabilitiesData?.capabilities.theming?.logo != null
? CachedURLImage(
url: capabilitiesData!.capabilities!.theming!.logo!,
url: capabilitiesData!.capabilities.theming!.logo,
)
: null,
)

2
packages/neon/lib/src/pages/home/widgets/server_status.dart

@ -20,7 +20,7 @@ class _ServerStatusState extends State<ServerStatus> {
WidgetsBinding.instance.addPostFrameCallback((final _) async {
try {
final status = await widget.account.client.core.getStatus();
if (status.maintenance! && mounted) {
if (status.maintenance && mounted) {
ExceptionWidget.showSnackbar(context, AppLocalizations.of(context).errorServerInMaintenanceMode);
}
} catch (e) {

12
packages/neon/lib/src/pages/login/login.dart

@ -34,7 +34,7 @@ class _LoginPageState extends State<LoginPage> {
if (init != null && !Provider.of<NeonPlatform>(context, listen: false).canUseWebView) {
WidgetsBinding.instance.addPostFrameCallback((final _) async {
await launchUrlString(
init.login!,
init.login,
mode: LaunchMode.externalApplication,
webViewConfiguration: WebViewConfiguration(
headers: _buildHeaders(context, Provider.of<Env?>(context, listen: false)),
@ -47,9 +47,9 @@ class _LoginPageState extends State<LoginPage> {
_loginBloc.loginFlowResult.listen((final result) async {
if (result != null) {
final account = Account(
serverURL: result.server!,
username: result.loginName!,
appPassword: result.appPassword!,
serverURL: result.server,
username: result.loginName,
appPassword: result.appPassword,
)..setupClient(await PackageInfo.fromPlatform());
if (!mounted) {
@ -64,7 +64,7 @@ class _LoginPageState extends State<LoginPage> {
for (final a in accountsBloc.accounts.value) {
if (a.id == account.id) {
ExceptionWidget.showSnackbar(context, AppLocalizations.of(context).errorAccountAlreadyExists);
_loginBloc.setServerURL(result.server!);
_loginBloc.setServerURL(result.server);
return;
}
}
@ -155,7 +155,7 @@ class _LoginPageState extends State<LoginPage> {
onWebViewCreated: (final controller) async {
_webViewController = controller;
final url =
(await _loginBloc.loginFlowInit.firstWhere((final init) => init != null))!.login!;
(await _loginBloc.loginFlowInit.firstWhere((final init) => init != null))!.login;
if (mounted) {
await _webViewController!.loadUrl(
url,

8
packages/neon/lib/src/pages/settings/account_specific_settings.dart

@ -60,7 +60,7 @@ class AccountSpecificSettingsPage extends StatelessWidget {
children: [
if (userDetailsData != null) ...[
LinearProgressIndicator(
value: userDetailsData.quota!.relative! / 100,
value: userDetailsData.quota.relative / 100,
backgroundColor: Theme.of(context).colorScheme.primary.withOpacity(0.3),
),
const SizedBox(
@ -68,9 +68,9 @@ class AccountSpecificSettingsPage extends StatelessWidget {
),
Text(
AppLocalizations.of(context).accountOptionsQuotaUsedOf(
filesize(userDetailsData.quota!.used!, 1),
filesize(userDetailsData.quota!.total!, 1),
userDetailsData.quota!.relative!.toString(),
filesize(userDetailsData.quota.used, 1),
filesize(userDetailsData.quota.total, 1),
userDetailsData.quota.relative.toString(),
),
),
],

10
packages/neon/lib/src/utils/push_utils.dart

@ -56,11 +56,11 @@ class PushUtils {
subject: decryptPushNotificationSubject(keypair.privateKey, data['subject']! as String),
);
if (notification.subject!.delete ?? false) {
if (notification.subject.delete ?? false) {
await localNotificationsPlugin.cancel(_getNotificationID(instance, notification));
return;
}
if (notification.subject!.deleteAll ?? false) {
if (notification.subject.deleteAll ?? false) {
await localNotificationsPlugin.cancelAll();
return;
}
@ -80,7 +80,7 @@ class PushUtils {
final allAppImplementations = getAppImplementations(sharedPreferences, requestManager, platform);
final matchingAppImplementations =
allAppImplementations.where((final a) => a.id == notification.subject!.app!).toList();
allAppImplementations.where((final a) => a.id == notification.subject.app).toList();
late AppImplementation app;
if (matchingAppImplementations.isNotEmpty) {
app = matchingAppImplementations.single;
@ -93,7 +93,7 @@ class PushUtils {
await localNotificationsPlugin.show(
_getNotificationID(instance, notification),
appName,
notification.subject!.subject!,
notification.subject.subject,
NotificationDetails(
android: AndroidNotificationDetails(
app.id,
@ -122,5 +122,5 @@ class PushUtils {
final String instance,
final NotificationsPushNotification notification,
) =>
sha256.convert(utf8.encode('$instance${notification.subject!.nid!}')).bytes.reduce((final a, final b) => a + b);
sha256.convert(utf8.encode('$instance${notification.subject.nid}')).bytes.reduce((final a, final b) => a + b);
}

6
packages/neon/lib/src/utils/theme.dart

@ -4,7 +4,7 @@ const themePrimaryColor = Color(0xFFF37736);
const themeOnPrimaryColor = Color(0xFFFFFFFF);
ThemeData getThemeFromNextcloudTheme(
final CoreServerCapabilitiesOcsDataCapabilitiesTheming? nextcloudTheme,
final CoreServerCapabilities_Ocs_Data_Capabilities_Theming? nextcloudTheme,
final ThemeMode themeMode,
final Brightness platformBrightness, {
required final bool oledAsDark,
@ -12,8 +12,8 @@ ThemeData getThemeFromNextcloudTheme(
var primaryColor = themePrimaryColor;
var onPrimaryColor = themeOnPrimaryColor;
if (nextcloudTheme != null) {
primaryColor = HexColor(nextcloudTheme.color!);
onPrimaryColor = HexColor(nextcloudTheme.colorText!);
primaryColor = HexColor(nextcloudTheme.color);
onPrimaryColor = HexColor(nextcloudTheme.colorText);
}
late final Brightness selectBrightness;

6
packages/nextcloud/lib/src/helpers.dart

@ -33,9 +33,9 @@ extension NextcloudNotificationsPushProxy on NotificationsClient {
Uri(
queryParameters: {
'pushToken': pushToken,
'deviceIdentifier': subscription.deviceIdentifier!,
'deviceIdentifierSignature': subscription.signature!,
'userPublicKey': subscription.publicKey!,
'deviceIdentifier': subscription.deviceIdentifier,
'deviceIdentifierSignature': subscription.signature,
'userPublicKey': subscription.publicKey,
},
).query,
),

3282
packages/nextcloud/lib/src/nextcloud.openapi.dart

File diff suppressed because it is too large Load Diff

1564
packages/nextcloud/lib/src/nextcloud.openapi.g.dart

File diff suppressed because it is too large Load Diff

560
packages/nextcloud/lib/src/nextcloud.openapi.json

File diff suppressed because it is too large Load Diff

12
packages/nextcloud/lib/src/version_supported.dart

@ -3,8 +3,8 @@ part of '../nextcloud.dart';
// ignore: public_member_api_docs
extension CoreVersionSupported on CoreClient {
/// Checks if the app on the server is supported by the client
Future<bool> isSupported([final CoreServerCapabilitiesOcsData? capabilities]) async =>
(capabilities ?? (await getCapabilities()).ocs!.data!).version!.major! == 24;
Future<bool> isSupported([final CoreServerCapabilities_Ocs_Data? capabilities]) async =>
(capabilities ?? (await getCapabilities()).ocs.data).version.major == 24;
}
// ignore: public_member_api_docs
@ -19,11 +19,11 @@ extension NewsVersionSupported on NewsClient {
// ignore: public_member_api_docs
extension NotesVersionSupported on NotesClient {
/// Checks if the app on the server is supported by the client
Future<bool> isSupported([final CoreServerCapabilitiesOcsData? capabilities]) async =>
(capabilities ?? (await rootClient.core.getCapabilities()).ocs!.data!)
.capabilities!
Future<bool> isSupported([final CoreServerCapabilities_Ocs_Data? capabilities]) async =>
(capabilities ?? (await rootClient.core.getCapabilities()).ocs.data)
.capabilities
.notes!
.apiVersion!
.apiVersion
.map(Version.parse)
.where((final version) => version.major == 1)
.isNotEmpty;

40
packages/nextcloud/test/core_test.dart

@ -35,30 +35,30 @@ Future main() async {
test('Get capabilities', () async {
final capabilities = await client.core.getCapabilities();
expect(capabilities.ocs!.data!.version!.major.toString(), nextcloudVersion.split('.')[0]);
expect(capabilities.ocs!.data!.version!.string, nextcloudVersion);
expect(capabilities.ocs!.data!.capabilities!.theming!.name, 'Nextcloud');
expect(capabilities.ocs!.data!.capabilities!.theming!.url, 'https://nextcloud.com');
expect(capabilities.ocs!.data!.capabilities!.theming!.slogan, 'a safe home for all your data');
expect(capabilities.ocs!.data!.capabilities!.theming!.color, '#0082c9');
expect(capabilities.ocs!.data!.capabilities!.theming!.colorText, '#ffffff');
expect(capabilities.ocs!.data!.capabilities!.theming!.logo, isNotEmpty);
expect(capabilities.ocs!.data!.capabilities!.theming!.background, isNotEmpty);
expect(capabilities.ocs!.data!.capabilities!.theming!.backgroundPlain, false);
expect(capabilities.ocs!.data!.capabilities!.theming!.backgroundDefault, true);
expect(capabilities.ocs!.data!.capabilities!.theming!.logoheader, isNotEmpty);
expect(capabilities.ocs!.data!.capabilities!.theming!.favicon, isNotEmpty);
expect(capabilities.ocs.data.version.major.toString(), nextcloudVersion.split('.')[0]);
expect(capabilities.ocs.data.version.string, nextcloudVersion);
expect(capabilities.ocs.data.capabilities.theming!.name, 'Nextcloud');
expect(capabilities.ocs.data.capabilities.theming!.url, 'https://nextcloud.com');
expect(capabilities.ocs.data.capabilities.theming!.slogan, 'a safe home for all your data');
expect(capabilities.ocs.data.capabilities.theming!.color, '#0082c9');
expect(capabilities.ocs.data.capabilities.theming!.colorText, '#ffffff');
expect(capabilities.ocs.data.capabilities.theming!.logo, isNotEmpty);
expect(capabilities.ocs.data.capabilities.theming!.background, isNotEmpty);
expect(capabilities.ocs.data.capabilities.theming!.backgroundPlain, false);
expect(capabilities.ocs.data.capabilities.theming!.backgroundDefault, true);
expect(capabilities.ocs.data.capabilities.theming!.logoheader, isNotEmpty);
expect(capabilities.ocs.data.capabilities.theming!.favicon, isNotEmpty);
});
test('Get navigation apps', () async {
final navigationApps = await client.core.getNavigationApps();
expect(navigationApps.ocs!.data, hasLength(6));
expect(navigationApps.ocs!.data![0].id, 'dashboard');
expect(navigationApps.ocs!.data![1].id, 'files');
expect(navigationApps.ocs!.data![2].id, 'photos');
expect(navigationApps.ocs!.data![3].id, 'activity');
expect(navigationApps.ocs!.data![4].id, 'notes');
expect(navigationApps.ocs!.data![5].id, 'news');
expect(navigationApps.ocs.data, hasLength(6));
expect(navigationApps.ocs.data[0].id, 'dashboard');
expect(navigationApps.ocs.data[1].id, 'files');
expect(navigationApps.ocs.data[2].id, 'photos');
expect(navigationApps.ocs.data[3].id, 'activity');
expect(navigationApps.ocs.data[4].id, 'notes');
expect(navigationApps.ocs.data[5].id, 'news');
});
});
}

98
packages/nextcloud/test/news_test.dart

@ -38,18 +38,18 @@ Future main() async {
expect(response.starredCount, null);
expect(response.newestItemId, isNotNull);
expect(response.feeds, hasLength(1));
expect(response.feeds![0].url, wikipediaFeedURL);
expect(response.feeds[0].url, wikipediaFeedURL);
response = await client.news.listFeeds();
expect(response.starredCount, 0);
expect(response.newestItemId, isNotNull);
expect(response.feeds, hasLength(1));
expect(response.feeds![0].url, wikipediaFeedURL);
expect(response.feeds[0].url, wikipediaFeedURL);
});
test('Rename feed', () async {
var response = await addWikipediaFeed();
expect(response.feeds![0].title, 'Wikipedia featured articles feed');
expect(response.feeds[0].title, 'Wikipedia featured articles feed');
await client.news.renameFeed(
feedId: 1,
@ -57,7 +57,7 @@ Future main() async {
);
response = await client.news.listFeeds();
expect(response.feeds![0].title, 'test1');
expect(response.feeds[0].title, 'test1');
});
test('Move feed to folder', () async {
@ -70,20 +70,20 @@ Future main() async {
final response = await client.news.listFolders();
expect(response.folders, hasLength(1));
expect(response.folders![0].id, 1);
expect(response.folders![0].name, 'test1');
expect(response.folders![0].opened, true);
expect(response.folders![0].feeds, hasLength(0));
expect(response.folders[0].id, 1);
expect(response.folders[0].name, 'test1');
expect(response.folders[0].opened, true);
expect(response.folders[0].feeds, hasLength(0));
});
test('Mark feed as read', () async {
final feedsResponse = await addWikipediaFeed();
var articlesResponse = await client.news.listArticles(type: NewsListType.unread.code);
expect(articlesResponse.items!.length, greaterThan(0));
expect(articlesResponse.items.length, greaterThan(0));
await client.news.markFeedAsRead(
feedId: feedsResponse.feeds![0].id!,
feedId: feedsResponse.feeds[0].id,
newestItemId: feedsResponse.newestItemId!,
);
@ -98,11 +98,11 @@ Future main() async {
await addWikipediaFeed();
response = await client.news.listArticles();
expect(response.items!.length, greaterThan(0));
expect(response.items![0].body, isNotNull);
expect(response.items![0].feedId, 1);
expect(response.items![0].unread, true);
expect(response.items![0].starred, false);
expect(response.items.length, greaterThan(0));
expect(response.items[0].body, isNotNull);
expect(response.items[0].feedId, 1);
expect(response.items[0].unread, true);
expect(response.items[0].starred, false);
});
test('List updated articles', () async {
@ -114,17 +114,17 @@ Future main() async {
await addWikipediaFeed();
var response = await client.news.listArticles();
final wikipediaArticles = response.items!.length;
final wikipediaArticles = response.items.length;
expect(wikipediaArticles, greaterThan(0));
await addNasaFeed();
response = await client.news.listArticles();
final nasaArticles = response.items!.length - wikipediaArticles;
final nasaArticles = response.items.length - wikipediaArticles;
expect(nasaArticles, greaterThan(0));
response = await client.news.listUpdatedArticles(
lastModified: response.items![response.items!.length - 1 - nasaArticles].lastModified!,
lastModified: response.items[response.items.length - 1 - nasaArticles].lastModified,
);
expect(response.items, hasLength(nasaArticles));
});
@ -133,11 +133,11 @@ Future main() async {
await addWikipediaFeed();
var response = await client.news.listArticles(type: NewsListType.unread.code);
final unreadArticles = response.items!.length;
final unreadArticles = response.items.length;
expect(unreadArticles, greaterThan(0));
await client.news.markArticleAsRead(
itemId: response.items![0].id!,
itemId: response.items[0].id,
);
response = await client.news.listArticles(type: NewsListType.unread.code);
expect(response.items, hasLength(unreadArticles - 1));
@ -147,13 +147,13 @@ Future main() async {
await addWikipediaFeed();
var response = await client.news.listArticles(type: NewsListType.unread.code);
final readArticle = response.items![0];
await client.news.markArticleAsRead(itemId: readArticle.id!);
final readArticle = response.items[0];
await client.news.markArticleAsRead(itemId: readArticle.id);
response = await client.news.listArticles(type: NewsListType.unread.code);
final unreadArticles = response.items!.length;
final unreadArticles = response.items.length;
expect(unreadArticles, greaterThan(0));
await client.news.markArticleAsUnread(itemId: readArticle.id!);
await client.news.markArticleAsUnread(itemId: readArticle.id);
response = await client.news.listArticles(type: NewsListType.unread.code);
expect(response.items, hasLength(unreadArticles + 1));
});
@ -162,12 +162,12 @@ Future main() async {
await addWikipediaFeed();
var response = await client.news.listArticles(type: NewsListType.starred.code);
final starredArticles = response.items!.length;
final starredArticles = response.items.length;
expect(starredArticles, 0);
response = await client.news.listArticles();
await client.news.starArticle(
itemId: response.items![0].id!,
itemId: response.items[0].id,
);
response = await client.news.listArticles(type: NewsListType.starred.code);
expect(response.items, hasLength(1));
@ -177,16 +177,16 @@ Future main() async {
await addWikipediaFeed();
var response = await client.news.listArticles();
final item = response.items![0];
final item = response.items[0];
await client.news.starArticle(
itemId: item.id!,
itemId: item.id,
);
response = await client.news.listArticles(type: NewsListType.starred.code);
expect(response.items, hasLength(1));
await client.news.unstarArticle(
itemId: item.id!,
itemId: item.id,
);
response = await client.news.listArticles(type: NewsListType.starred.code);
expect(response.items, hasLength(0));
@ -198,17 +198,17 @@ Future main() async {
response = await client.news.createFolder(name: 'test1');
expect(response.folders, hasLength(1));
expect(response.folders![0].id, 1);
expect(response.folders![0].name, 'test1');
expect(response.folders![0].opened, true);
expect(response.folders![0].feeds, hasLength(0));
expect(response.folders[0].id, 1);
expect(response.folders[0].name, 'test1');
expect(response.folders[0].opened, true);
expect(response.folders[0].feeds, hasLength(0));
response = await client.news.listFolders();
expect(response.folders, hasLength(1));
expect(response.folders![0].id, 1);
expect(response.folders![0].name, 'test1');
expect(response.folders![0].opened, true);
expect(response.folders![0].feeds, hasLength(0));
expect(response.folders[0].id, 1);
expect(response.folders[0].name, 'test1');
expect(response.folders[0].opened, true);
expect(response.folders[0].feeds, hasLength(0));
});
test('List folders', () async {
@ -220,14 +220,14 @@ Future main() async {
response = response = await client.news.listFolders();
expect(response.folders, hasLength(2));
expect(response.folders![0].id, 1);
expect(response.folders![0].name, 'test1');
expect(response.folders![0].opened, true);
expect(response.folders![0].feeds, hasLength(0));
expect(response.folders![1].id, 2);
expect(response.folders![1].name, 'test2');
expect(response.folders![1].opened, true);
expect(response.folders![1].feeds, hasLength(0));
expect(response.folders[0].id, 1);
expect(response.folders[0].name, 'test1');
expect(response.folders[0].opened, true);
expect(response.folders[0].feeds, hasLength(0));
expect(response.folders[1].id, 2);
expect(response.folders[1].name, 'test2');
expect(response.folders[1].opened, true);
expect(response.folders[1].feeds, hasLength(0));
});
test('Add feed to folder', () async {
@ -236,8 +236,8 @@ Future main() async {
expect(response.starredCount, null);
expect(response.newestItemId, isNotNull);
expect(response.feeds, hasLength(1));
expect(response.feeds![0].folderId, 1);
expect(response.feeds![0].url, wikipediaFeedURL);
expect(response.feeds[0].folderId, 1);
expect(response.feeds[0].url, wikipediaFeedURL);
});
test('Mark folder as read', () async {
@ -245,10 +245,10 @@ Future main() async {
final feedsResponse = await addWikipediaFeed(1);
var articlesResponse = await client.news.listArticles(type: NewsListType.unread.code);
expect(articlesResponse.items!.length, greaterThan(0));
expect(articlesResponse.items.length, greaterThan(0));
await client.news.markFolderAsRead(
folderId: foldersResponse.folders![0].id!,
folderId: foldersResponse.folders[0].id,
newestItemId: feedsResponse.newestItemId!,
);

18
packages/nextcloud/test/notes_test.dart

@ -61,13 +61,13 @@ Future main() async {
test('Get note', () async {
final response = await client.notes.getNote(
id: (await client.notes.createNote(title: 'a')).id!,
id: (await client.notes.createNote(title: 'a')).id,
);
expect(response.title, 'a');
});
test('Update note', () async {
final id = (await client.notes.createNote(title: 'a')).id!;
final id = (await client.notes.createNote(title: 'a')).id;
await client.notes.updateNote(
id: id,
title: 'b',
@ -80,13 +80,13 @@ Future main() async {
test('Update note fail changed on server', () async {
final response = await client.notes.createNote(title: 'a');
await client.notes.updateNote(
id: response.id!,
id: response.id,
title: 'b',
ifMatch: '"${response.etag}"',
);
expect(
() => client.notes.updateNote(
id: response.id!,
id: response.id,
title: 'c',
ifMatch: '"${response.etag}"',
),
@ -95,7 +95,7 @@ Future main() async {
});
test('Delete note', () async {
final id = (await client.notes.createNote(title: 'a')).id!;
final id = (await client.notes.createNote(title: 'a')).id;
var response = await client.notes.getNotes();
expect(response, hasLength(1));
@ -110,7 +110,7 @@ Future main() async {
final response = await client.notes.getSettings();
expect(response.notesPath, 'Notes');
expect(response.fileSuffix, '.txt');
expect(response.noteMode, NotesSettingsNoteMode.edit);
expect(response.noteMode, NotesSettings_NoteMode.edit);
});
test('Update settings', () async {
@ -118,17 +118,17 @@ Future main() async {
notesSettings: NotesSettings(
notesPath: 'Test Notes',
fileSuffix: '.md',
noteMode: NotesSettingsNoteMode.preview,
noteMode: NotesSettings_NoteMode.preview,
),
);
expect(response.notesPath, 'Test Notes');
expect(response.fileSuffix, '.md');
expect(response.noteMode, NotesSettingsNoteMode.preview);
expect(response.noteMode, NotesSettings_NoteMode.preview);
response = await client.notes.getSettings();
expect(response.notesPath, 'Test Notes');
expect(response.fileSuffix, '.md');
expect(response.noteMode, NotesSettingsNoteMode.preview);
expect(response.noteMode, NotesSettings_NoteMode.preview);
});
});
}

91
packages/nextcloud/test/notifications_test.dart

@ -38,22 +38,22 @@ Future main() async {
final startTime = DateTime.now().toUtc();
final response = await client.notifications.listNotifications();
expect(response.ocs!.data, hasLength(1));
expect(response.ocs!.data![0].notificationId, 1);
expect(response.ocs!.data![0].app, 'admin_notifications');
expect(response.ocs!.data![0].user, 'admin');
expectDateInReasonableTimeRange(DateTime.parse(response.ocs!.data![0].datetime!), startTime);
expect(response.ocs!.data![0].objectType, 'admin_notifications');
expect(response.ocs!.data![0].objectId, isNotNull);
expect(response.ocs!.data![0].subject, '123');
expect(response.ocs!.data![0].message, '456');
expect(response.ocs!.data![0].link, '');
expect(response.ocs!.data![0].subjectRich, '');
expect(response.ocs!.data![0].subjectRichParameters!.mapStringDynamic, null);
expect(response.ocs!.data![0].messageRich, '');
expect(response.ocs!.data![0].messageRichParameters!.mapStringDynamic, null);
expect(response.ocs!.data![0].icon, isNotEmpty);
expect(response.ocs!.data![0].actions, hasLength(0));
expect(response.ocs.data, hasLength(1));
expect(response.ocs.data[0].notificationId, 1);
expect(response.ocs.data[0].app, 'admin_notifications');
expect(response.ocs.data[0].user, 'admin');
expectDateInReasonableTimeRange(DateTime.parse(response.ocs.data[0].datetime), startTime);
expect(response.ocs.data[0].objectType, 'admin_notifications');
expect(response.ocs.data[0].objectId, isNotNull);
expect(response.ocs.data[0].subject, '123');
expect(response.ocs.data[0].message, '456');
expect(response.ocs.data[0].link, '');
expect(response.ocs.data[0].subjectRich, '');
expect(response.ocs.data[0].subjectRichParameters.mapStringDynamic, null);
expect(response.ocs.data[0].messageRich, '');
expect(response.ocs.data[0].messageRichParameters.mapStringDynamic, null);
expect(response.ocs.data[0].icon, isNotEmpty);
expect(response.ocs.data[0].actions, hasLength(0));
});
test('Get notification', () async {
@ -61,21 +61,21 @@ Future main() async {
final startTime = DateTime.now().toUtc();
final response = await client.notifications.getNotification(id: 1);
expect(response.ocs!.data!.notificationId, 1);
expect(response.ocs!.data!.app, 'admin_notifications');
expect(response.ocs!.data!.user, 'admin');
expectDateInReasonableTimeRange(DateTime.parse(response.ocs!.data!.datetime!), startTime);
expect(response.ocs!.data!.objectType, 'admin_notifications');
expect(response.ocs!.data!.objectId, isNotNull);
expect(response.ocs!.data!.subject, '123');
expect(response.ocs!.data!.message, '456');
expect(response.ocs!.data!.link, '');
expect(response.ocs!.data!.subjectRich, '');
expect(response.ocs!.data!.subjectRichParameters!.mapStringDynamic, null);
expect(response.ocs!.data!.messageRich, '');
expect(response.ocs!.data!.messageRichParameters!.mapStringDynamic, null);
expect(response.ocs!.data!.icon, isNotEmpty);
expect(response.ocs!.data!.actions, hasLength(0));
expect(response.ocs.data.notificationId, 1);
expect(response.ocs.data.app, 'admin_notifications');
expect(response.ocs.data.user, 'admin');
expectDateInReasonableTimeRange(DateTime.parse(response.ocs.data.datetime), startTime);
expect(response.ocs.data.objectType, 'admin_notifications');
expect(response.ocs.data.objectId, isNotNull);
expect(response.ocs.data.subject, '123');
expect(response.ocs.data.message, '456');
expect(response.ocs.data.link, '');
expect(response.ocs.data.subjectRich, '');
expect(response.ocs.data.subjectRichParameters.mapStringDynamic, null);
expect(response.ocs.data.messageRich, '');
expect(response.ocs.data.messageRichParameters.mapStringDynamic, null);
expect(response.ocs.data.icon, isNotEmpty);
expect(response.ocs.data.actions, hasLength(0));
});
test('Delete notification', () async {
@ -83,7 +83,7 @@ Future main() async {
await client.notifications.deleteNotification(id: 1);
final response = await client.notifications.listNotifications();
expect(response.ocs!.data, hasLength(0));
expect(response.ocs.data, hasLength(0));
});
test('Delete all notifications', () async {
@ -92,7 +92,7 @@ Future main() async {
await client.notifications.deleteAllNotifications();
final response = await client.notifications.listNotifications();
expect(response.ocs!.data, hasLength(0));
expect(response.ocs.data, hasLength(0));
});
});
@ -139,12 +139,13 @@ Future main() async {
devicePublicKey: keypair.publicKey.toFormattedPEM(),
proxyServer: 'http://host.docker.internal:$port/',
))
.ocs!
.data!;
.ocs
.data;
expect(subscription.publicKey, hasLength(451));
RSAPublicKey.fromPEM(subscription.publicKey!);
RSAPublicKey.fromPEM(subscription.publicKey);
expect(subscription.deviceIdentifier, isNotEmpty);
expect(subscription.signature, isNotEmpty);
expect(subscription.message, isNull);
final deviceCompleter = Completer();
final notificationCompleter = Completer();
@ -195,11 +196,21 @@ Future main() async {
});
test('Remove push device', () async {
await client.notifications.registerDevice(
pushTokenHash: '789',
devicePublicKey: generateKeypair().publicKey.toFormattedPEM(),
const pushToken = '789';
final keypair = generateKeypair();
final subscription = (await client.notifications.registerDevice(
pushTokenHash: client.notifications.generatePushTokenHash(pushToken),
devicePublicKey: keypair.publicKey.toFormattedPEM(),
proxyServer: 'https://example.com/',
);
))
.ocs
.data;
expect(subscription.publicKey, hasLength(451));
RSAPublicKey.fromPEM(subscription.publicKey);
expect(subscription.deviceIdentifier, isNotEmpty);
expect(subscription.signature, isNotEmpty);
expect(subscription.message, isNull);
await client.notifications.removeDevice();
});

16
packages/nextcloud/test/provisioning_api_test.dart

@ -13,18 +13,18 @@ Future main() async {
test('Get current user', () async {
final user = await client.provisioningApi.getCurrentUser();
expect(user.ocs!.data!.id, 'user1');
expect(user.ocs!.data!.getDisplayName(), 'User One');
expect(user.ocs!.data!.displaynameScope, 'v2-federated');
expect(user.ocs!.data!.language, 'en');
expect(user.ocs.data.id, 'user1');
expect(user.ocs.data.getDisplayName(), 'User One');
expect(user.ocs.data.displaynameScope, 'v2-federated');
expect(user.ocs.data.language, 'en');
});
test('Get user by username', () async {
final user = await client.provisioningApi.getUser(userId: 'user1');
expect(user.ocs!.data!.id, 'user1');
expect(user.ocs!.data!.getDisplayName(), 'User One');
expect(user.ocs!.data!.displaynameScope, 'v2-federated');
expect(user.ocs!.data!.language, 'en');
expect(user.ocs.data.id, 'user1');
expect(user.ocs.data.getDisplayName(), 'User One');
expect(user.ocs.data.displaynameScope, 'v2-federated');
expect(user.ocs.data.language, 'en');
});
});
}

161
packages/nextcloud/test/user_status_test.dart

@ -14,45 +14,47 @@ Future main() async {
test('Find all predefined statuses', () async {
final expectedStatusIDs = ['meeting', 'commuting', 'remote-work', 'sick-leave', 'vacationing'];
final response = await client.userStatus.findAllPredefinedStatuses();
expect(response.ocs!.data, hasLength(5));
final responseIDs = response.ocs!.data!.map((final status) => status.id!);
expect(response.ocs.data, hasLength(5));
final responseIDs = response.ocs.data.map((final status) => status.id);
expect(expectedStatusIDs.map(responseIDs.contains).contains(false), false);
for (final status in response.ocs!.data!) {
for (final status in response.ocs.data) {
expect(status.icon, isNotNull);
expect(status.message, isNotNull);
}
final meeting = response.ocs!.data!.singleWhere((final s) => s.id == 'meeting').clearAt!.userStatusClearAt!;
expect(meeting.type, UserStatusClearAtType.period);
expect(meeting.time!.int_, 3600);
final meeting = response.ocs.data.singleWhere((final s) => s.id == 'meeting').clearAt.userStatusClearAt!;
expect(meeting.type, UserStatusClearAt_Type.period);
expect(meeting.time.int_, 3600);
final commuting = response.ocs!.data!.singleWhere((final s) => s.id == 'commuting').clearAt!.userStatusClearAt!;
expect(commuting.type, UserStatusClearAtType.period);
expect(commuting.time!.int_, 1800);
final commuting = response.ocs.data.singleWhere((final s) => s.id == 'commuting').clearAt.userStatusClearAt!;
expect(commuting.type, UserStatusClearAt_Type.period);
expect(commuting.time.int_, 1800);
final remoteWork =
response.ocs!.data!.singleWhere((final s) => s.id == 'remote-work').clearAt!.userStatusClearAt!;
expect(remoteWork.type, UserStatusClearAtType.endOf);
expect(remoteWork.time!.userStatusClearAtTime0, UserStatusClearAtTime0.day);
final remoteWork = response.ocs.data.singleWhere((final s) => s.id == 'remote-work').clearAt.userStatusClearAt!;
expect(remoteWork.type, UserStatusClearAt_Type.endOf);
expect(remoteWork.time.userStatusClearAtTime0, UserStatusClearAt_Time0.day);
final sickLeave = response.ocs!.data!.singleWhere((final s) => s.id == 'sick-leave').clearAt!.userStatusClearAt!;
expect(sickLeave.type, UserStatusClearAtType.endOf);
expect(sickLeave.time!.userStatusClearAtTime0, UserStatusClearAtTime0.day);
final sickLeave = response.ocs.data.singleWhere((final s) => s.id == 'sick-leave').clearAt.userStatusClearAt!;
expect(sickLeave.type, UserStatusClearAt_Type.endOf);
expect(sickLeave.time.userStatusClearAtTime0, UserStatusClearAt_Time0.day);
expect(response.ocs!.data!.singleWhere((final s) => s.id == 'vacationing').clearAt, null);
final vacationing = response.ocs.data.singleWhere((final s) => s.id == 'vacationing').clearAt;
expect(vacationing.userStatusClearAt, null);
expect(vacationing.int_, null);
});
test('Set status', () async {
final response = await client.userStatus.setStatus(statusType: UserStatusType.online);
expect(response.ocs!.data!.userStatus!.userId, 'user1');
expect(response.ocs!.data!.userStatus!.message, null);
expect(response.ocs!.data!.userStatus!.messageId, null);
expect(response.ocs!.data!.userStatus!.messageIsPredefined, false);
expect(response.ocs!.data!.userStatus!.icon, null);
expect(response.ocs!.data!.userStatus!.clearAt, null);
expect(response.ocs!.data!.userStatus!.status, UserStatusType.online);
expect(response.ocs!.data!.userStatus!.statusIsUserDefined, true);
expect(response.ocs.data.userStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, null);
expect(response.ocs.data.userStatus!.messageId, null);
expect(response.ocs.data.userStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatus!.icon, null);
expect(response.ocs.data.userStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatus!.clearAt.int_, null);
expect(response.ocs.data.userStatus!.status, UserStatusType.online);
expect(response.ocs.data.userStatus!.statusIsUserDefined, true);
});
test('Get status', () async {
@ -61,29 +63,31 @@ Future main() async {
await client.userStatus.setStatus(statusType: UserStatusType.online);
final response = await client.userStatus.getStatus();
expect(response.ocs!.data!.userStatus!.userId, 'user1');
expect(response.ocs!.data!.userStatus!.message, null);
expect(response.ocs!.data!.userStatus!.messageId, null);
expect(response.ocs!.data!.userStatus!.messageIsPredefined, false);
expect(response.ocs!.data!.userStatus!.icon, null);
expect(response.ocs!.data!.userStatus!.clearAt, null);
expect(response.ocs!.data!.userStatus!.status, UserStatusType.online);
expect(response.ocs!.data!.userStatus!.statusIsUserDefined, true);
expect(response.ocs.data.userStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, null);
expect(response.ocs.data.userStatus!.messageId, null);
expect(response.ocs.data.userStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatus!.icon, null);
expect(response.ocs.data.userStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatus!.clearAt.int_, null);
expect(response.ocs.data.userStatus!.status, UserStatusType.online);
expect(response.ocs.data.userStatus!.statusIsUserDefined, true);
});
test('Find all statuses', () async {
var response = await client.userStatus.findAllStatuses();
expect(response.ocs!.data, hasLength(0));
expect(response.ocs.data, hasLength(0));
await client.userStatus.setStatus(statusType: UserStatusType.online);
response = await client.userStatus.findAllStatuses();
expect(response.ocs!.data, hasLength(1));
expect(response.ocs!.data![0].userId, 'user1');
expect(response.ocs!.data![0].message, null);
expect(response.ocs!.data![0].icon, null);
expect(response.ocs!.data![0].clearAt, null);
expect(response.ocs!.data![0].status, UserStatusType.online);
expect(response.ocs.data, hasLength(1));
expect(response.ocs.data[0].userId, 'user1');
expect(response.ocs.data[0].message, null);
expect(response.ocs.data[0].icon, null);
expect(response.ocs.data[0].clearAt.userStatusClearAt, null);
expect(response.ocs.data[0].clearAt.int_, null);
expect(response.ocs.data[0].status, UserStatusType.online);
});
test('Find status', () async {
@ -91,11 +95,12 @@ Future main() async {
await client.userStatus.setStatus(statusType: UserStatusType.online);
final response = await client.userStatus.findStatus(userId: 'user1');
expect(response.ocs!.data!.userStatusPublicUserStatus!.userId, 'user1');
expect(response.ocs!.data!.userStatusPublicUserStatus!.message, null);
expect(response.ocs!.data!.userStatusPublicUserStatus!.icon, null);
expect(response.ocs!.data!.userStatusPublicUserStatus!.clearAt, null);
expect(response.ocs!.data!.userStatusPublicUserStatus!.status, UserStatusType.online);
expect(response.ocs.data.userStatusPublicUserStatus!.userId, 'user1');
expect(response.ocs.data.userStatusPublicUserStatus!.message, null);
expect(response.ocs.data.userStatusPublicUserStatus!.icon, null);
expect(response.ocs.data.userStatusPublicUserStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatusPublicUserStatus!.clearAt.int_, null);
expect(response.ocs.data.userStatusPublicUserStatus!.status, UserStatusType.online);
});
test('Set predefined message', () async {
@ -104,14 +109,14 @@ Future main() async {
messageId: 'meeting',
clearAt: clearAt,
);
expect(response.ocs!.data!.userStatus!.userId, 'user1');
expect(response.ocs!.data!.userStatus!.message, null);
expect(response.ocs!.data!.userStatus!.messageId, 'meeting');
expect(response.ocs!.data!.userStatus!.messageIsPredefined, true);
expect(response.ocs!.data!.userStatus!.icon, null);
expect(response.ocs!.data!.userStatus!.clearAt!.int_, clearAt);
expect(response.ocs!.data!.userStatus!.status, UserStatusType.offline);
expect(response.ocs!.data!.userStatus!.statusIsUserDefined, false);
expect(response.ocs.data.userStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, null);
expect(response.ocs.data.userStatus!.messageId, 'meeting');
expect(response.ocs.data.userStatus!.messageIsPredefined, true);
expect(response.ocs.data.userStatus!.icon, null);
expect(response.ocs.data.userStatus!.clearAt.int_, clearAt);
expect(response.ocs.data.userStatus!.status, UserStatusType.offline);
expect(response.ocs.data.userStatus!.statusIsUserDefined, false);
});
test('Set custom message', () async {
@ -121,14 +126,14 @@ Future main() async {
message: 'bla',
clearAt: clearAt,
);
expect(response.ocs!.data!.userStatus!.userId, 'user1');
expect(response.ocs!.data!.userStatus!.message, 'bla');
expect(response.ocs!.data!.userStatus!.messageId, null);
expect(response.ocs!.data!.userStatus!.messageIsPredefined, false);
expect(response.ocs!.data!.userStatus!.icon, '😀');
expect(response.ocs!.data!.userStatus!.clearAt!.int_, clearAt);
expect(response.ocs!.data!.userStatus!.status, UserStatusType.offline);
expect(response.ocs!.data!.userStatus!.statusIsUserDefined, false);
expect(response.ocs.data.userStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, 'bla');
expect(response.ocs.data.userStatus!.messageId, null);
expect(response.ocs.data.userStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatus!.icon, '😀');
expect(response.ocs.data.userStatus!.clearAt.int_, clearAt);
expect(response.ocs.data.userStatus!.status, UserStatusType.offline);
expect(response.ocs.data.userStatus!.statusIsUserDefined, false);
});
test('Clear message', () async {
@ -141,28 +146,30 @@ Future main() async {
await client.userStatus.clearMessage();
final response = await client.userStatus.getStatus();
expect(response.ocs!.data!.userStatus!.userId, 'user1');
expect(response.ocs!.data!.userStatus!.message, null);
expect(response.ocs!.data!.userStatus!.messageId, null);
expect(response.ocs!.data!.userStatus!.messageIsPredefined, false);
expect(response.ocs!.data!.userStatus!.icon, null);
expect(response.ocs!.data!.userStatus!.clearAt, null);
expect(response.ocs!.data!.userStatus!.status, UserStatusType.offline);
expect(response.ocs!.data!.userStatus!.statusIsUserDefined, false);
expect(response.ocs.data.userStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, null);
expect(response.ocs.data.userStatus!.messageId, null);
expect(response.ocs.data.userStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatus!.icon, null);
expect(response.ocs.data.userStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatus!.clearAt.int_, null);
expect(response.ocs.data.userStatus!.status, UserStatusType.offline);
expect(response.ocs.data.userStatus!.statusIsUserDefined, false);
});
test('Heartbeat', () async {
await client.userStatus.heartbeat(status: UserStatusType.online);
final response = await client.userStatus.getStatus();
expect(response.ocs!.data!.userStatus!.userId, 'user1');
expect(response.ocs!.data!.userStatus!.message, null);
expect(response.ocs!.data!.userStatus!.messageId, null);
expect(response.ocs!.data!.userStatus!.messageIsPredefined, false);
expect(response.ocs!.data!.userStatus!.icon, null);
expect(response.ocs!.data!.userStatus!.clearAt, null);
expect(response.ocs!.data!.userStatus!.status, UserStatusType.online);
expect(response.ocs!.data!.userStatus!.statusIsUserDefined, false);
expect(response.ocs.data.userStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, null);
expect(response.ocs.data.userStatus!.messageId, null);
expect(response.ocs.data.userStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatus!.icon, null);
expect(response.ocs.data.userStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatus!.clearAt.int_, null);
expect(response.ocs.data.userStatus!.status, UserStatusType.online);
expect(response.ocs.data.userStatus!.statusIsUserDefined, false);
});
});
}

289
specs/core.json

@ -36,6 +36,12 @@
"schemas": {
"OCSMeta": {
"type": "object",
"required": [
"status",
"statuscode",
"totalitems",
"itemsperpage"
],
"properties": {
"status": {
"type": "string"
@ -56,6 +62,16 @@
},
"CoreServerStatus": {
"type": "object",
"required": [
"installed",
"maintenance",
"needsDbUpgrade",
"version",
"versionstring",
"edition",
"productname",
"extendedSupport"
],
"properties": {
"installed": {
"type": "boolean"
@ -85,18 +101,37 @@
},
"CoreServerCapabilities": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "object",
"required": [
"version",
"capabilities"
],
"properties": {
"version": {
"type": "object",
"required": [
"major",
"minor",
"micro",
"string",
"edition",
"extendedSupport"
],
"properties": {
"major": {
"type": "integer"
@ -120,9 +155,21 @@
},
"capabilities": {
"type": "object",
"required": [
"core",
"bruteforce",
"metadataAvailable",
"files",
"ocm",
"dav"
],
"properties": {
"core": {
"type": "object",
"required": [
"pollinterval",
"webdav-root"
],
"properties": {
"pollinterval": {
"type": "integer"
@ -134,6 +181,9 @@
},
"bruteforce": {
"type": "object",
"required": [
"delay"
],
"properties": {
"delay": {
"type": "integer"
@ -142,6 +192,9 @@
},
"metadataAvailable": {
"type": "object",
"required": [
"size"
],
"properties": {
"size": {
"type": "array",
@ -153,6 +206,14 @@
},
"files": {
"type": "object",
"required": [
"bigfilechunking",
"blacklisted_files",
"directEditing",
"comments",
"undelete",
"versioning"
],
"properties": {
"bigfilechunking": {
"type": "boolean"
@ -165,6 +226,10 @@
},
"directEditing": {
"type": "object",
"required": [
"url",
"etag"
],
"properties": {
"url": {
"type": "string"
@ -187,6 +252,9 @@
},
"activity": {
"type": "object",
"required": [
"apiv2"
],
"properties": {
"apiv2": {
"type": "array",
@ -198,12 +266,22 @@
},
"circles": {
"type": "object",
"required": [
"version",
"status",
"settings",
"circle",
"member"
],
"properties": {
"version": {
"type": "string"
},
"status": {
"type": "object",
"required": [
"globalScale"
],
"properties": {
"globalScale": {
"type": "boolean"
@ -212,6 +290,12 @@
},
"settings": {
"type": "object",
"required": [
"frontendEnabled",
"allowedCircles",
"allowedUserTypes",
"membersLimit"
],
"properties": {
"frontendEnabled": {
"type": "boolean"
@ -229,15 +313,27 @@
},
"circle": {
"type": "object",
"required": [
"constants",
"config"
],
"properties": {
"constants": {
"type": "object",
"required": [
"flags",
"source"
],
"properties": {
"flags": {
"type": "object"
},
"source": {
"type": "object",
"required": [
"core",
"extra"
],
"properties": {
"core": {
"type": "object"
@ -251,6 +347,10 @@
},
"config": {
"type": "object",
"required": [
"coreFlags",
"systemFlags"
],
"properties": {
"coreFlags": {
"type": "array",
@ -270,9 +370,16 @@
},
"member": {
"type": "object",
"required": [
"constants",
"type"
],
"properties": {
"constants": {
"type": "object",
"required": [
"level"
],
"properties": {
"level": {
"type": "object"
@ -288,6 +395,12 @@
},
"ocm": {
"type": "object",
"required": [
"enabled",
"apiVersion",
"endPoint",
"resourceTypes"
],
"properties": {
"enabled": {
"type": "boolean"
@ -302,6 +415,11 @@
"type": "array",
"items": {
"type": "object",
"required": [
"name",
"shareTypes",
"protocols"
],
"properties": {
"name": {
"type": "string"
@ -314,6 +432,9 @@
},
"protocols": {
"type": "object",
"required": [
"webdav"
],
"properties": {
"webdav": {
"type": "string"
@ -327,6 +448,9 @@
},
"dav": {
"type": "object",
"required": [
"chunking"
],
"properties": {
"chunking": {
"type": "string"
@ -335,18 +459,45 @@
},
"files_sharing": {
"type": "object",
"required": [
"api_enabled",
"public",
"resharing",
"user",
"group_sharing",
"group",
"default_permissions",
"federation",
"sharee",
"sharebymail"
],
"properties": {
"api_enabled": {
"type": "boolean"
},
"public": {
"type": "object",
"required": [
"enabled",
"password",
"expire_date",
"multiple_links",
"expire_date_internal",
"expire_date_remote",
"send_mail",
"upload",
"upload_files_drop"
],
"properties": {
"enabled": {
"type": "boolean"
},
"password": {
"type": "object",
"required": [
"enforced",
"askForOptionalPassword"
],
"properties": {
"enforced": {
"type": "boolean"
@ -358,6 +509,9 @@
},
"expire_date": {
"type": "object",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean"
@ -369,6 +523,9 @@
},
"expire_date_internal": {
"type": "object",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean"
@ -377,6 +534,9 @@
},
"expire_date_remote": {
"type": "object",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean"
@ -399,12 +559,19 @@
},
"user": {
"type": "object",
"required": [
"send_mail",
"expire_date"
],
"properties": {
"send_mail": {
"type": "boolean"
},
"expire_date": {
"type": "object",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean"
@ -418,12 +585,19 @@
},
"group": {
"type": "object",
"required": [
"enabled",
"expire_date"
],
"properties": {
"enabled": {
"type": "boolean"
},
"expire_date": {
"type": "object",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean"
@ -437,6 +611,12 @@
},
"federation": {
"type": "object",
"required": [
"outgoing",
"incoming",
"expire_date",
"expire_date_supported"
],
"properties": {
"outgoing": {
"type": "boolean"
@ -446,6 +626,9 @@
},
"expire_date": {
"type": "object",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean"
@ -454,6 +637,9 @@
},
"expire_date_supported": {
"type": "object",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean"
@ -464,6 +650,10 @@
},
"sharee": {
"type": "object",
"required": [
"query_lookup_default",
"always_show_unique"
],
"properties": {
"query_lookup_default": {
"type": "boolean"
@ -475,6 +665,13 @@
},
"sharebymail": {
"type": "object",
"required": [
"enabled",
"send_password_by_mail",
"upload_files_drop",
"password",
"expire_date"
],
"properties": {
"enabled": {
"type": "boolean"
@ -484,6 +681,9 @@
},
"upload_files_drop": {
"type": "object",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean"
@ -492,6 +692,10 @@
},
"password": {
"type": "object",
"required": [
"enabled",
"enforced"
],
"properties": {
"enabled": {
"type": "boolean"
@ -503,6 +707,10 @@
},
"expire_date": {
"type": "object",
"required": [
"enabled",
"enforced"
],
"properties": {
"enabled": {
"type": "boolean"
@ -518,6 +726,10 @@
},
"notes": {
"type": "object",
"required": [
"api_version",
"version"
],
"properties": {
"api_version": {
"type": "array",
@ -532,6 +744,11 @@
},
"notifications": {
"type": "object",
"required": [
"ocs-endpoints",
"push",
"admin-notifications"
],
"properties": {
"ocs-endpoints": {
"type": "array",
@ -555,6 +772,14 @@
},
"password_policy": {
"type": "object",
"required": [
"minLength",
"enforceNonCommonPassword",
"enforceNumericCharacters",
"enforceSpecialCharacters",
"enforceUpperLowerCase",
"api"
],
"properties": {
"minLength": {
"type": "integer"
@ -573,6 +798,10 @@
},
"api": {
"type": "object",
"required": [
"generate",
"validate"
],
"properties": {
"generate": {
"type": "string"
@ -586,6 +815,12 @@
},
"provisioning_api": {
"type": "object",
"required": [
"version",
"AccountPropertyScopesVersion",
"AccountPropertyScopesFederatedEnabled",
"AccountPropertyScopesPublishedEnabled"
],
"properties": {
"version": {
"type": "string"
@ -603,6 +838,22 @@
},
"theming": {
"type": "object",
"required": [
"name",
"url",
"slogan",
"color",
"color-text",
"color-element",
"color-element-bright",
"color-element-dark",
"logo",
"background",
"background-plain",
"background-default",
"logoheader",
"favicon"
],
"properties": {
"name": {
"type": "string"
@ -650,6 +901,10 @@
},
"user_status": {
"type": "object",
"required": [
"enabled",
"supports_emoji"
],
"properties": {
"enabled": {
"type": "boolean"
@ -661,6 +916,9 @@
},
"weather_status": {
"type": "object",
"required": [
"enabled"
],
"properties": {
"enabled": {
"type": "boolean"
@ -677,9 +935,16 @@
},
"CoreNavigationApps": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
@ -688,6 +953,17 @@
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"order",
"href",
"icon",
"type",
"name",
"active",
"classes",
"unread"
],
"properties": {
"id": {
"type": "string"
@ -733,9 +1009,17 @@
},
"CoreLoginFlowInit": {
"type": "object",
"required": [
"poll",
"login"
],
"properties": {
"poll": {
"type": "object",
"required": [
"token",
"endpoint"
],
"properties": {
"token": {
"type": "string"
@ -752,6 +1036,11 @@
},
"CoreLoginFlowResult": {
"type": "object",
"required": [
"server",
"loginName",
"appPassword"
],
"properties": {
"server": {
"type": "string"

88
specs/news.json

@ -34,8 +34,37 @@
],
"components": {
"schemas": {
"OCSMeta": {
"type": "object",
"required": [
"status",
"statuscode",
"totalitems",
"itemsperpage"
],
"properties": {
"status": {
"type": "string"
},
"statuscode": {
"type": "integer"
},
"message": {
"type": "string"
},
"totalitems": {
"type": "string"
},
"itemsperpage": {
"type": "string"
}
}
},
"NewsListFeeds": {
"type": "object",
"required": [
"feeds"
],
"properties": {
"starredCount": {
"type": "integer"
@ -53,6 +82,17 @@
},
"NewsFeed": {
"type": "object",
"required": [
"id",
"url",
"title",
"faviconLink",
"added",
"ordering",
"pinned",
"updateErrorCount",
"items"
],
"properties": {
"id": {
"type": "integer"
@ -100,6 +140,22 @@
},
"NewsArticle": {
"type": "object",
"required": [
"id",
"guid",
"guidHash",
"url",
"title",
"pubDate",
"body",
"feedId",
"unread",
"starred",
"lastModified",
"rtl",
"fingerprint",
"contentHash"
],
"properties": {
"id": {
"type": "integer"
@ -165,6 +221,9 @@
},
"NewsListArticles": {
"type": "object",
"required": [
"items"
],
"properties": {
"items": {
"type": "array",
@ -176,6 +235,9 @@
},
"NewsListFolders": {
"type": "object",
"required": [
"folders"
],
"properties": {
"folders": {
"type": "array",
@ -187,6 +249,12 @@
},
"NewsFolder": {
"type": "object",
"required": [
"id",
"name",
"opened",
"feeds"
],
"properties": {
"id": {
"type": "integer"
@ -206,26 +274,6 @@
}
}
}
},
"OCSMeta": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"statuscode": {
"type": "integer"
},
"message": {
"type": "string"
},
"totalitems": {
"type": "string"
},
"itemsperpage": {
"type": "string"
}
}
}
},
"securitySchemes": {

63
specs/notes.json

@ -34,8 +34,46 @@
],
"components": {
"schemas": {
"OCSMeta": {
"type": "object",
"required": [
"status",
"statuscode",
"totalitems",
"itemsperpage"
],
"properties": {
"status": {
"type": "string"
},
"statuscode": {
"type": "integer"
},
"message": {
"type": "string"
},
"totalitems": {
"type": "string"
},
"itemsperpage": {
"type": "string"
}
}
},
"NotesNote": {
"type": "object",
"required": [
"id",
"etag",
"readonly",
"content",
"title",
"category",
"favorite",
"modified",
"error",
"errorType"
],
"properties": {
"id": {
"type": "integer"
@ -71,6 +109,11 @@
},
"NotesSettings": {
"type": "object",
"required": [
"notesPath",
"fileSuffix",
"noteMode"
],
"properties": {
"notesPath": {
"type": "string"
@ -86,26 +129,6 @@
]
}
}
},
"OCSMeta": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"statuscode": {
"type": "integer"
},
"message": {
"type": "string"
},
"totalitems": {
"type": "string"
},
"itemsperpage": {
"type": "string"
}
}
}
},
"securitySchemes": {

74
specs/notifications.json

@ -36,6 +36,12 @@
"schemas": {
"OCSMeta": {
"type": "object",
"required": [
"status",
"statuscode",
"totalitems",
"itemsperpage"
],
"properties": {
"status": {
"type": "string"
@ -56,9 +62,16 @@
},
"NotificationsEmpty": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
@ -75,6 +88,23 @@
},
"NotificationsNotification": {
"type": "object",
"required": [
"notification_id",
"app",
"user",
"datetime",
"object_type",
"object_id",
"subject",
"message",
"link",
"subjectRich",
"subjectRichParameters",
"messageRich",
"messageRichParameters",
"icon",
"actions"
],
"properties": {
"notification_id": {
"type": "integer"
@ -138,6 +168,11 @@
},
"NotificationsNotificationAction": {
"type": "object",
"required": [
"label",
"link",
"type"
],
"properties": {
"label": {
"type": "string"
@ -155,9 +190,16 @@
},
"NotificationsListNotifications": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
@ -174,9 +216,16 @@
},
"NotificationsGetNotification": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
@ -190,6 +239,11 @@
},
"NotificationsPushServerSubscription": {
"type": "object",
"required": [
"publicKey",
"deviceIdentifier",
"signature"
],
"properties": {
"publicKey": {
"type": "string"
@ -207,9 +261,16 @@
},
"NotificationsPushServerRegistration": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
@ -223,6 +284,12 @@
},
"NotificationsPushNotification": {
"type": "object",
"required": [
"accountID",
"priority",
"type",
"subject"
],
"properties": {
"accountID": {
"type": "string"
@ -240,6 +307,13 @@
},
"NotificationsPushNotificationDecryptedSubject": {
"type": "object",
"required": [
"nid",
"app",
"subject",
"type",
"id"
],
"properties": {
"nid": {
"type": "integer"

59
specs/provisioning_api.json

@ -36,6 +36,12 @@
"schemas": {
"OCSMeta": {
"type": "object",
"required": [
"status",
"statuscode",
"totalitems",
"itemsperpage"
],
"properties": {
"status": {
"type": "string"
@ -56,9 +62,16 @@
},
"ProvisioningApiUser": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
@ -72,6 +85,41 @@
},
"ProvisioningApiUserDetails": {
"type": "object",
"required": [
"storageLocation",
"id",
"lastLogin",
"backend",
"subadmin",
"quota",
"avatarScope",
"emailScope",
"additional_mail",
"additional_mailScope",
"displaynameScope",
"phone",
"phoneScope",
"address",
"addressScope",
"website",
"websiteScope",
"twitter",
"twitterScope",
"organisation",
"organisationScope",
"role",
"roleScope",
"headline",
"headlineScope",
"biography",
"biographyScope",
"profile_enabled",
"profile_enabledScope",
"groups",
"language",
"locale",
"backendCapabilities"
],
"properties": {
"enabled": {
"type": "boolean"
@ -96,6 +144,13 @@
},
"quota": {
"type": "object",
"required": [
"free",
"used",
"total",
"relative",
"quota"
],
"properties": {
"free": {
"type": "integer"
@ -212,6 +267,10 @@
},
"backendCapabilities": {
"type": "object",
"required": [
"setDisplayName",
"setPassword"
],
"properties": {
"setDisplayName": {
"type": "boolean"

97
specs/user_status.json

@ -36,6 +36,12 @@
"schemas": {
"OCSMeta": {
"type": "object",
"required": [
"status",
"statuscode",
"totalitems",
"itemsperpage"
],
"properties": {
"status": {
"type": "string"
@ -56,9 +62,16 @@
},
"UserStatusPredefinedStatuses": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
@ -75,6 +88,12 @@
},
"UserStatusPredefinedStatus": {
"type": "object",
"required": [
"id",
"icon",
"message",
"clearAt"
],
"properties": {
"id": {
"type": "string"
@ -86,23 +105,24 @@
"type": "string"
},
"clearAt": {
"$ref": "#/components/schemas/UserStatusClearAtWrap"
"anyOf": [
{
"$ref": "#/components/schemas/UserStatusClearAt"
},
{
"type": "integer",
"description": "Time as unix timestamp"
}
]
}
}
},
"UserStatusClearAtWrap": {
"oneOf": [
{
"$ref": "#/components/schemas/UserStatusClearAt"
},
{
"type": "integer",
"description": "Time as unix timestamp"
}
]
},
"UserStatusClearAt": {
"type": "object",
"required": [
"type",
"time"
],
"properties": {
"type": {
"type": "string",
@ -140,9 +160,16 @@
},
"UserStatusGetUserStatus": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
@ -160,9 +187,16 @@
},
"UserStatusFindAllStatuses": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
@ -179,9 +213,16 @@
},
"UserStatusFindStatus": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
@ -199,6 +240,13 @@
},
"UserStatus": {
"type": "object",
"required": [
"userId",
"messageIsPredefined",
"clearAt",
"status",
"statusIsUserDefined"
],
"properties": {
"userId": {
"type": "string"
@ -216,7 +264,15 @@
"type": "string"
},
"clearAt": {
"$ref": "#/components/schemas/UserStatusClearAtWrap"
"anyOf": [
{
"$ref": "#/components/schemas/UserStatusClearAt"
},
{
"type": "integer",
"description": "Time as unix timestamp"
}
]
},
"status": {
"$ref": "#/components/schemas/UserStatusType"
@ -228,6 +284,11 @@
},
"UserStatusPublicUserStatus": {
"type": "object",
"required": [
"userId",
"clearAt",
"status"
],
"properties": {
"userId": {
"type": "string"
@ -239,7 +300,15 @@
"type": "string"
},
"clearAt": {
"$ref": "#/components/schemas/UserStatusClearAtWrap"
"anyOf": [
{
"$ref": "#/components/schemas/UserStatusClearAt"
},
{
"type": "integer",
"description": "Time as unix timestamp"
}
]
},
"status": {
"$ref": "#/components/schemas/UserStatusType"

6
tool/generate-nextcloud.sh

@ -71,6 +71,12 @@ for codename in ${codenames[*]}; do
.components.schemas.OCSMeta =
{
type: "object",
required: [
"status",
"statuscode",
"totalitems",
"itemsperpage"
],
properties: {
status: {
type: "string"

Loading…
Cancel
Save