jld3103
1 year ago
52 changed files with 409 additions and 138 deletions
@ -1,4 +1,3 @@
|
||||
export 'package:neon/src/models/account.dart' hide Credentials, LoginQRcode; |
||||
export 'package:neon/src/models/app_ids.dart'; |
||||
export 'package:neon/src/models/app_implementation.dart'; |
||||
export 'package:neon/src/models/notifications_interface.dart'; |
||||
|
@ -1,6 +0,0 @@
|
||||
sealed class AppIDs { |
||||
static const files = 'files'; |
||||
static const news = 'news'; |
||||
static const notes = 'notes'; |
||||
static const notifications = 'notifications'; |
||||
} |
@ -0,0 +1,62 @@
|
||||
// ignore_for_file: depend_on_referenced_packages |
||||
import 'dart:io'; |
||||
|
||||
import 'package:collection/collection.dart'; |
||||
import 'package:dynamite/src/helpers/dart_helpers.dart'; |
||||
import 'package:path/path.dart' as p; |
||||
|
||||
void main() { |
||||
final files = |
||||
Directory('lib/src/api').listSync().cast<File>().where((final file) => file.path.endsWith('.openapi.dart')); |
||||
|
||||
final idStatements = <String>[]; |
||||
final exportStatements = <String>[ |
||||
"export 'ids.dart';", |
||||
"export 'src/client.dart';", |
||||
"export 'webdav.dart';", |
||||
]; |
||||
|
||||
for (final file in files) { |
||||
final basename = p.basename(file.path); |
||||
final id = basename.substring(0, basename.length - 13); |
||||
final variablePrefix = toDartName(id); |
||||
final classPrefix = toDartName(id, uppercaseFirstCharacter: true); |
||||
|
||||
idStatements.add(" static const $variablePrefix = '$id';"); |
||||
exportStatements.add("export '$id.dart';"); |
||||
|
||||
final exports = ["export 'src/api/$id.openapi.dart';"]; |
||||
if (File('lib/src/helpers/$id.dart').existsSync()) { |
||||
exports.add("export 'src/helpers/$id.dart';"); |
||||
} |
||||
|
||||
File('lib/$id.dart').writeAsStringSync(''' |
||||
import 'package:nextcloud/src/api/$id.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
${exports.join('\n')} |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension ${classPrefix}Extension on NextcloudClient { |
||||
static final _$variablePrefix = Expando<${classPrefix}Client>(); |
||||
|
||||
/// Client for the $id APIs |
||||
${classPrefix}Client get $variablePrefix => _$variablePrefix[this] ??= ${classPrefix}Client.fromClient(this); |
||||
} |
||||
'''); |
||||
} |
||||
|
||||
File('lib/ids.dart').writeAsStringSync(''' |
||||
// ignore_for_file: public_member_api_docs |
||||
|
||||
final class AppIDs { |
||||
${idStatements.join('\n')} |
||||
} |
||||
'''); |
||||
|
||||
File('lib/nextcloud.dart').writeAsStringSync(''' |
||||
export 'package:dynamite_runtime/http_client.dart' show CookieJar, DynamiteApiException, DynamiteRawResponse, DynamiteResponse; |
||||
|
||||
${exportStatements.sorted((final a, final b) => a.compareTo(b)).join('\n')} |
||||
'''); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/comments.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/comments.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension CommentsExtension on NextcloudClient { |
||||
static final _comments = Expando<CommentsClient>(); |
||||
|
||||
/// Client for the comments APIs |
||||
CommentsClient get comments => _comments[this] ??= CommentsClient.fromClient(this); |
||||
} |
@ -0,0 +1,13 @@
|
||||
import 'package:nextcloud/src/api/core.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/core.openapi.dart'; |
||||
export 'src/helpers/core.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension CoreExtension on NextcloudClient { |
||||
static final _core = Expando<CoreClient>(); |
||||
|
||||
/// Client for the core APIs |
||||
CoreClient get core => _core[this] ??= CoreClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/dashboard.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/dashboard.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension DashboardExtension on NextcloudClient { |
||||
static final _dashboard = Expando<DashboardClient>(); |
||||
|
||||
/// Client for the dashboard APIs |
||||
DashboardClient get dashboard => _dashboard[this] ??= DashboardClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/dav.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/dav.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension DavExtension on NextcloudClient { |
||||
static final _dav = Expando<DavClient>(); |
||||
|
||||
/// Client for the dav APIs |
||||
DavClient get dav => _dav[this] ??= DavClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/files.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/files.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension FilesExtension on NextcloudClient { |
||||
static final _files = Expando<FilesClient>(); |
||||
|
||||
/// Client for the files APIs |
||||
FilesClient get files => _files[this] ??= FilesClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/files_external.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/files_external.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension FilesExternalExtension on NextcloudClient { |
||||
static final _filesExternal = Expando<FilesExternalClient>(); |
||||
|
||||
/// Client for the files_external APIs |
||||
FilesExternalClient get filesExternal => _filesExternal[this] ??= FilesExternalClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/files_reminders.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/files_reminders.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension FilesRemindersExtension on NextcloudClient { |
||||
static final _filesReminders = Expando<FilesRemindersClient>(); |
||||
|
||||
/// Client for the files_reminders APIs |
||||
FilesRemindersClient get filesReminders => _filesReminders[this] ??= FilesRemindersClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/files_sharing.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/files_sharing.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension FilesSharingExtension on NextcloudClient { |
||||
static final _filesSharing = Expando<FilesSharingClient>(); |
||||
|
||||
/// Client for the files_sharing APIs |
||||
FilesSharingClient get filesSharing => _filesSharing[this] ??= FilesSharingClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/files_trashbin.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/files_trashbin.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension FilesTrashbinExtension on NextcloudClient { |
||||
static final _filesTrashbin = Expando<FilesTrashbinClient>(); |
||||
|
||||
/// Client for the files_trashbin APIs |
||||
FilesTrashbinClient get filesTrashbin => _filesTrashbin[this] ??= FilesTrashbinClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/files_versions.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/files_versions.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension FilesVersionsExtension on NextcloudClient { |
||||
static final _filesVersions = Expando<FilesVersionsClient>(); |
||||
|
||||
/// Client for the files_versions APIs |
||||
FilesVersionsClient get filesVersions => _filesVersions[this] ??= FilesVersionsClient.fromClient(this); |
||||
} |
@ -0,0 +1,25 @@
|
||||
// ignore_for_file: public_member_api_docs |
||||
|
||||
final class AppIDs { |
||||
static const filesSharing = 'files_sharing'; |
||||
static const filesVersions = 'files_versions'; |
||||
static const files = 'files'; |
||||
static const updatenotification = 'updatenotification'; |
||||
static const dashboard = 'dashboard'; |
||||
static const uppush = 'uppush'; |
||||
static const settings = 'settings'; |
||||
static const dav = 'dav'; |
||||
static const userStatus = 'user_status'; |
||||
static const notifications = 'notifications'; |
||||
static const notes = 'notes'; |
||||
static const news = 'news'; |
||||
static const core = 'core'; |
||||
static const filesTrashbin = 'files_trashbin'; |
||||
static const comments = 'comments'; |
||||
static const sharebymail = 'sharebymail'; |
||||
static const filesExternal = 'files_external'; |
||||
static const filesReminders = 'files_reminders'; |
||||
static const provisioningApi = 'provisioning_api'; |
||||
static const theming = 'theming'; |
||||
static const weatherStatus = 'weather_status'; |
||||
} |
@ -0,0 +1,13 @@
|
||||
import 'package:nextcloud/src/api/news.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/news.openapi.dart'; |
||||
export 'src/helpers/news.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension NewsExtension on NextcloudClient { |
||||
static final _news = Expando<NewsClient>(); |
||||
|
||||
/// Client for the news APIs |
||||
NewsClient get news => _news[this] ??= NewsClient.fromClient(this); |
||||
} |
@ -1,32 +1,27 @@
|
||||
export 'package:crypton/crypton.dart' show RSAKeypair, RSAPrivateKey, RSAPublicKey; |
||||
export 'package:dynamite_runtime/http_client.dart' |
||||
show CookieJar, DynamiteApiException, DynamiteRawResponse, DynamiteResponse; |
||||
|
||||
export 'src/api/comments.openapi.dart'; |
||||
export 'src/api/core.openapi.dart'; |
||||
export 'src/api/dashboard.openapi.dart'; |
||||
export 'src/api/dav.openapi.dart'; |
||||
export 'src/api/files.openapi.dart'; |
||||
export 'src/api/files_external.openapi.dart'; |
||||
export 'src/api/files_reminders.openapi.dart'; |
||||
export 'src/api/files_sharing.openapi.dart'; |
||||
export 'src/api/files_trashbin.openapi.dart'; |
||||
export 'src/api/files_versions.openapi.dart'; |
||||
export 'src/api/news.openapi.dart'; |
||||
export 'src/api/notes.openapi.dart'; |
||||
export 'src/api/notifications.openapi.dart'; |
||||
export 'src/api/provisioning_api.openapi.dart'; |
||||
export 'src/api/settings.openapi.dart'; |
||||
export 'src/api/sharebymail.openapi.dart'; |
||||
export 'src/api/theming.openapi.dart'; |
||||
export 'src/api/updatenotification.openapi.dart'; |
||||
export 'src/api/uppush.openapi.dart'; |
||||
export 'src/api/user_status.openapi.dart'; |
||||
export 'src/api/weather_status.openapi.dart'; |
||||
export 'comments.dart'; |
||||
export 'core.dart'; |
||||
export 'dashboard.dart'; |
||||
export 'dav.dart'; |
||||
export 'files.dart'; |
||||
export 'files_external.dart'; |
||||
export 'files_reminders.dart'; |
||||
export 'files_sharing.dart'; |
||||
export 'files_trashbin.dart'; |
||||
export 'files_versions.dart'; |
||||
export 'ids.dart'; |
||||
export 'news.dart'; |
||||
export 'notes.dart'; |
||||
export 'notifications.dart'; |
||||
export 'provisioning_api.dart'; |
||||
export 'settings.dart'; |
||||
export 'sharebymail.dart'; |
||||
export 'src/client.dart'; |
||||
export 'src/helpers/core.dart'; |
||||
export 'src/helpers/news.dart'; |
||||
export 'src/helpers/notes.dart'; |
||||
export 'src/helpers/notifications.dart'; |
||||
export 'src/webdav/client.dart'; |
||||
export 'src/webdav/file.dart'; |
||||
export 'src/webdav/props.dart'; |
||||
export 'src/webdav/webdav.dart'; |
||||
export 'theming.dart'; |
||||
export 'updatenotification.dart'; |
||||
export 'uppush.dart'; |
||||
export 'user_status.dart'; |
||||
export 'weather_status.dart'; |
||||
export 'webdav.dart'; |
||||
|
@ -0,0 +1,13 @@
|
||||
import 'package:nextcloud/src/api/notes.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/notes.openapi.dart'; |
||||
export 'src/helpers/notes.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension NotesExtension on NextcloudClient { |
||||
static final _notes = Expando<NotesClient>(); |
||||
|
||||
/// Client for the notes APIs |
||||
NotesClient get notes => _notes[this] ??= NotesClient.fromClient(this); |
||||
} |
@ -0,0 +1,13 @@
|
||||
import 'package:nextcloud/src/api/notifications.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/notifications.openapi.dart'; |
||||
export 'src/helpers/notifications.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension NotificationsExtension on NextcloudClient { |
||||
static final _notifications = Expando<NotificationsClient>(); |
||||
|
||||
/// Client for the notifications APIs |
||||
NotificationsClient get notifications => _notifications[this] ??= NotificationsClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/provisioning_api.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/provisioning_api.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension ProvisioningApiExtension on NextcloudClient { |
||||
static final _provisioningApi = Expando<ProvisioningApiClient>(); |
||||
|
||||
/// Client for the provisioning_api APIs |
||||
ProvisioningApiClient get provisioningApi => _provisioningApi[this] ??= ProvisioningApiClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/settings.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/settings.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension SettingsExtension on NextcloudClient { |
||||
static final _settings = Expando<SettingsClient>(); |
||||
|
||||
/// Client for the settings APIs |
||||
SettingsClient get settings => _settings[this] ??= SettingsClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/sharebymail.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/sharebymail.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension SharebymailExtension on NextcloudClient { |
||||
static final _sharebymail = Expando<SharebymailClient>(); |
||||
|
||||
/// Client for the sharebymail APIs |
||||
SharebymailClient get sharebymail => _sharebymail[this] ??= SharebymailClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/theming.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/theming.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension ThemingExtension on NextcloudClient { |
||||
static final _theming = Expando<ThemingClient>(); |
||||
|
||||
/// Client for the theming APIs |
||||
ThemingClient get theming => _theming[this] ??= ThemingClient.fromClient(this); |
||||
} |
@ -0,0 +1,13 @@
|
||||
import 'package:nextcloud/src/api/updatenotification.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/updatenotification.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension UpdatenotificationExtension on NextcloudClient { |
||||
static final _updatenotification = Expando<UpdatenotificationClient>(); |
||||
|
||||
/// Client for the updatenotification APIs |
||||
UpdatenotificationClient get updatenotification => |
||||
_updatenotification[this] ??= UpdatenotificationClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/uppush.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/uppush.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension UppushExtension on NextcloudClient { |
||||
static final _uppush = Expando<UppushClient>(); |
||||
|
||||
/// Client for the uppush APIs |
||||
UppushClient get uppush => _uppush[this] ??= UppushClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/user_status.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/user_status.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension UserStatusExtension on NextcloudClient { |
||||
static final _userStatus = Expando<UserStatusClient>(); |
||||
|
||||
/// Client for the user_status APIs |
||||
UserStatusClient get userStatus => _userStatus[this] ??= UserStatusClient.fromClient(this); |
||||
} |
@ -0,0 +1,12 @@
|
||||
import 'package:nextcloud/src/api/weather_status.openapi.dart'; |
||||
import 'package:nextcloud/src/client.dart'; |
||||
|
||||
export 'src/api/weather_status.openapi.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension WeatherStatusExtension on NextcloudClient { |
||||
static final _weatherStatus = Expando<WeatherStatusClient>(); |
||||
|
||||
/// Client for the weather_status APIs |
||||
WeatherStatusClient get weatherStatus => _weatherStatus[this] ??= WeatherStatusClient.fromClient(this); |
||||
} |
@ -0,0 +1,15 @@
|
||||
import 'package:nextcloud/src/client.dart'; |
||||
import 'package:nextcloud/src/webdav/client.dart'; |
||||
|
||||
export 'src/webdav/client.dart'; |
||||
export 'src/webdav/file.dart'; |
||||
export 'src/webdav/props.dart'; |
||||
export 'src/webdav/webdav.dart'; |
||||
|
||||
// ignore: public_member_api_docs |
||||
extension WebDAVExtension on NextcloudClient { |
||||
static final _webdav = Expando<WebDavClient>(); |
||||
|
||||
/// Client for WebDAV |
||||
WebDavClient get webdav => _webdav[this] ??= WebDavClient(this); |
||||
} |
Loading…
Reference in new issue