diff --git a/.gitmodules b/.gitmodules index 0eb5a928..14144531 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,3 +13,6 @@ [submodule "external/nextcloud-notifications"] path = external/nextcloud-notifications url = https://github.com/nextcloud/notifications +[submodule "external/nextcloud-uppush"] + path = external/nextcloud-uppush + url = git@github.com:UP-NextPush/server-app.git diff --git a/external/nextcloud-uppush b/external/nextcloud-uppush new file mode 160000 index 00000000..ea2264cc --- /dev/null +++ b/external/nextcloud-uppush @@ -0,0 +1 @@ +Subproject commit ea2264cc05443f295a662030ad13c4a40c744eb9 diff --git a/packages/neon/integration_test/screenshot_test.dart b/packages/neon/integration_test/screenshot_test.dart index f07ce56f..c6ff344c 100644 --- a/packages/neon/integration_test/screenshot_test.dart +++ b/packages/neon/integration_test/screenshot_test.dart @@ -132,6 +132,11 @@ Future pumpAppPage( sharedPreferences, disabled: true, ); + final nextPushBloc = NextPushBloc( + accountsBloc, + globalOptions, + disabled: true, + ); // ignore: close_sinks final userThemeStream = BehaviorSubject(); @@ -163,6 +168,9 @@ Future pumpAppPage( Provider( create: (final _) => firstLaunchBloc, ), + Provider( + create: (final _) => nextPushBloc, + ), Provider>( create: (final _) => allAppImplementations, ), diff --git a/packages/neon/lib/l10n/en.arb b/packages/neon/lib/l10n/en.arb index e0fcb88f..b5802a01 100644 --- a/packages/neon/lib/l10n/en.arb +++ b/packages/neon/lib/l10n/en.arb @@ -51,6 +51,10 @@ "showSlashHide": "Show/Hide", "exit": "Exit", "disabled": "Disabled", + "firstLaunchGoToSettingsToEnablePushNotifications": "Go to the settings to enable push notifications", + "nextPushSupported": "NextPush is supported!", + "nextPushSupportedText": "NextPush is a FOSS way of receiving push notifications using the UnifiedPush protocol via a Nextcloud instance.\nYou can install NextPush from the F-Droid app store.", + "nextPushSupportedInstall": "Install NextPush", "settings": "Settings", "settingsApps": "Apps", "settingsExport": "Export settings", @@ -65,7 +69,6 @@ } } }, - "settingsGoToSettingsToEnablePushNotifications": "Go to the settings to enable push notifications", "optionsCategoryGeneral": "General", "optionsCategoryTheme": "Theme", "optionsCategoryPushNotifications": "Push notifications", diff --git a/packages/neon/lib/l10n/localizations.dart b/packages/neon/lib/l10n/localizations.dart index f7febc86..0a1ae2f9 100644 --- a/packages/neon/lib/l10n/localizations.dart +++ b/packages/neon/lib/l10n/localizations.dart @@ -269,6 +269,30 @@ abstract class AppLocalizations { /// **'Disabled'** String get disabled; + /// No description provided for @firstLaunchGoToSettingsToEnablePushNotifications. + /// + /// In en, this message translates to: + /// **'Go to the settings to enable push notifications'** + String get firstLaunchGoToSettingsToEnablePushNotifications; + + /// No description provided for @nextPushSupported. + /// + /// In en, this message translates to: + /// **'NextPush is supported!'** + String get nextPushSupported; + + /// No description provided for @nextPushSupportedText. + /// + /// In en, this message translates to: + /// **'NextPush is a FOSS way of receiving push notifications using the UnifiedPush protocol via a Nextcloud instance.\nYou can install NextPush from the F-Droid app store.'** + String get nextPushSupportedText; + + /// No description provided for @nextPushSupportedInstall. + /// + /// In en, this message translates to: + /// **'Install NextPush'** + String get nextPushSupportedInstall; + /// No description provided for @settings. /// /// In en, this message translates to: @@ -311,12 +335,6 @@ abstract class AppLocalizations { /// **'Do you want to reset all settings for {name}?'** String settingsResetForConfirmation(String name); - /// No description provided for @settingsGoToSettingsToEnablePushNotifications. - /// - /// In en, this message translates to: - /// **'Go to the settings to enable push notifications'** - String get settingsGoToSettingsToEnablePushNotifications; - /// No description provided for @optionsCategoryGeneral. /// /// In en, this message translates to: diff --git a/packages/neon/lib/l10n/localizations_en.dart b/packages/neon/lib/l10n/localizations_en.dart index 4f0bb430..917ca1ec 100644 --- a/packages/neon/lib/l10n/localizations_en.dart +++ b/packages/neon/lib/l10n/localizations_en.dart @@ -103,6 +103,19 @@ class AppLocalizationsEn extends AppLocalizations { @override String get disabled => 'Disabled'; + @override + String get firstLaunchGoToSettingsToEnablePushNotifications => 'Go to the settings to enable push notifications'; + + @override + String get nextPushSupported => 'NextPush is supported!'; + + @override + String get nextPushSupportedText => + 'NextPush is a FOSS way of receiving push notifications using the UnifiedPush protocol via a Nextcloud instance.\nYou can install NextPush from the F-Droid app store.'; + + @override + String get nextPushSupportedInstall => 'Install NextPush'; + @override String get settings => 'Settings'; @@ -126,9 +139,6 @@ class AppLocalizationsEn extends AppLocalizations { return 'Do you want to reset all settings for $name?'; } - @override - String get settingsGoToSettingsToEnablePushNotifications => 'Go to the settings to enable push notifications'; - @override String get optionsCategoryGeneral => 'General'; diff --git a/packages/neon/lib/main.dart b/packages/neon/lib/main.dart index a01d0d7a..aa848470 100644 --- a/packages/neon/lib/main.dart +++ b/packages/neon/lib/main.dart @@ -55,6 +55,7 @@ Future main() async { platform, ); final firstLaunchBloc = FirstLaunchBloc(sharedPreferences); + final nextPushBloc = NextPushBloc(accountsBloc, globalOptions); runApp( MultiProvider( @@ -83,6 +84,9 @@ Future main() async { Provider( create: (final _) => firstLaunchBloc, ), + Provider( + create: (final _) => nextPushBloc, + ), Provider>( create: (final _) => allAppImplementations, ), diff --git a/packages/neon/lib/src/app.dart b/packages/neon/lib/src/app.dart index cf5b2dbd..51f70b21 100644 --- a/packages/neon/lib/src/app.dart +++ b/packages/neon/lib/src/app.dart @@ -27,6 +27,7 @@ class _NeonAppState extends State with WidgetsBindingObserver, tray.Tra late NeonPlatform _platform; late GlobalOptions _globalOptions; late AccountsBloc _accountsBloc; + final _globalPopups = const GlobalPopups(); NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_Theming? _nextcloudTheme; final _platformBrightness = BehaviorSubject.seeded(WidgetsBinding.instance.window.platformBrightness); @@ -71,13 +72,18 @@ class _NeonAppState extends State with WidgetsBindingObserver, tray.Tra name: 'home', ); Widget builder(final context) => Scaffold( - body: HomePage( - account: activeAccount, - onThemeChanged: (final nextcloudTheme) { - setState(() { - _nextcloudTheme = nextcloudTheme; - }); - }, + body: Stack( + children: [ + _globalPopups, + HomePage( + account: activeAccount, + onThemeChanged: (final nextcloudTheme) { + setState(() { + _nextcloudTheme = nextcloudTheme; + }); + }, + ), + ], ), ); await _navigatorKey.currentState!.pushAndRemoveUntil( diff --git a/packages/neon/lib/src/blocs/next_push.dart b/packages/neon/lib/src/blocs/next_push.dart new file mode 100644 index 00000000..28027cf2 --- /dev/null +++ b/packages/neon/lib/src/blocs/next_push.dart @@ -0,0 +1,77 @@ +part of '../neon.dart'; + +abstract class NextPushBlocEvents {} + +abstract class NextPushBlocStates { + BehaviorSubject get onNextPushSupported; +} + +class NextPushBloc extends Bloc implements NextPushBlocEvents, NextPushBlocStates { + NextPushBloc( + this._accountsBloc, + this._globalOptions, { + final bool disabled = false, + }) { + if (disabled) { + return; + } + Rx.merge([ + _globalOptions.pushNotificationsEnabled.stream, + _globalOptions.pushNotificationsDistributor.stream, + _globalOptions.pushNotificationsDistributor.values, + _accountsBloc.accounts, + ]).debounceTime(const Duration(milliseconds: 100)).listen((final _) async { + if (!_globalOptions.pushNotificationsEnabled.enabled.hasValue || + !_globalOptions.pushNotificationsEnabled.enabled.value || + !_globalOptions.pushNotificationsEnabled.hasValue || + !_globalOptions.pushNotificationsEnabled.value) { + return; + } + if (_globalOptions.pushNotificationsDistributor.value != null) { + return; + } + if (_globalOptions.pushNotificationsDistributor.values.value.containsKey(unifiedPushNextPushID)) { + // NextPush is already installed + return; + } + + var supported = false; + for (final account in _accountsBloc.accounts.value) { + if (!_supported.containsKey(account)) { + try { + _supported[account] = (await account.client.unifiedPushProvider.check()).success; + } catch (e, s) { + debugPrint(e.toString()); + debugPrint(s.toString()); + _supported[account] = false; + } + } + if (_supported[account]!) { + supported = true; + break; + } + } + + if (!supported) { + return; + } + + if (onNextPushSupported.hasValue) { + return; + } + onNextPushSupported.add(null); + }); + } + + final AccountsBloc _accountsBloc; + final GlobalOptions _globalOptions; + final _supported = {}; + + @override + void dispose() { + unawaited(onNextPushSupported.close()); + } + + @override + BehaviorSubject onNextPushSupported = BehaviorSubject(); +} diff --git a/packages/neon/lib/src/neon.dart b/packages/neon/lib/src/neon.dart index 84b72364..e6c9e37f 100644 --- a/packages/neon/lib/src/neon.dart +++ b/packages/neon/lib/src/neon.dart @@ -52,6 +52,7 @@ part 'blocs/apps.dart'; part 'blocs/capabilities.dart'; part 'blocs/first_launch.dart'; part 'blocs/login.dart'; +part 'blocs/next_push.dart'; part 'blocs/push_notifications.dart'; part 'blocs/user_details.dart'; part 'blocs/user_status.dart'; @@ -71,6 +72,7 @@ part 'utils/confirmation_dialog.dart'; part 'utils/env.dart'; part 'utils/global.dart'; part 'utils/global_options.dart'; +part 'utils/global_popups.dart'; part 'utils/hex_color.dart'; part 'utils/localizations.dart'; part 'utils/missing_permission_exception.dart'; diff --git a/packages/neon/lib/src/pages/home.dart b/packages/neon/lib/src/pages/home.dart index bc0e14f9..77a90d39 100644 --- a/packages/neon/lib/src/pages/home.dart +++ b/packages/neon/lib/src/pages/home.dart @@ -24,7 +24,6 @@ class _HomePageState extends State { late AccountsBloc _accountsBloc; late AppsBloc _appsBloc; late CapabilitiesBloc _capabilitiesBloc; - late FirstLaunchBloc _firstLaunchBloc; @override void initState() { @@ -34,7 +33,6 @@ class _HomePageState extends State { _accountsBloc = Provider.of(context, listen: false); _appsBloc = _accountsBloc.getAppsBloc(widget.account); _capabilitiesBloc = _accountsBloc.getCapabilitiesBloc(widget.account); - _firstLaunchBloc = Provider.of(context, listen: false); _appsBloc.openNotifications.listen((final _) async { final notificationsAppImplementation = _appsBloc.notificationsAppImplementation.valueOrNull; @@ -98,24 +96,6 @@ class _HomePageState extends State { } }); - _firstLaunchBloc.onFirstLaunch.listen((final _) { - ScaffoldMessenger.of(context).showSnackBar( - SnackBar( - content: Text(AppLocalizations.of(context).settingsGoToSettingsToEnablePushNotifications), - action: SnackBarAction( - label: AppLocalizations.of(context).settings, - onPressed: () async { - await Navigator.of(context).push( - MaterialPageRoute( - builder: (final context) => const SettingsPage(), - ), - ); - }, - ), - ), - ); - }); - unawaited(_checkMaintenanceMode()); } diff --git a/packages/neon/lib/src/utils/global_options.dart b/packages/neon/lib/src/utils/global_options.dart index 5df411c4..8845faf9 100644 --- a/packages/neon/lib/src/utils/global_options.dart +++ b/packages/neon/lib/src/utils/global_options.dart @@ -1,5 +1,7 @@ part of '../neon.dart'; +const unifiedPushNextPushID = 'org.unifiedpush.distributor.nextpush'; + class GlobalOptions { GlobalOptions( this._storage, @@ -63,7 +65,7 @@ class GlobalOptions { 'io.heckel.ntfy': (final context) => AppLocalizations.of(context).globalOptionsPushNotificationsDistributorNtfy, 'org.unifiedpush.distributor.fcm': (final context) => AppLocalizations.of(context).globalOptionsPushNotificationsDistributorFCMUP, - 'org.unifiedpush.distributor.nextpush': (final context) => + unifiedPushNextPushID: (final context) => AppLocalizations.of(context).globalOptionsPushNotificationsDistributorNextPush, 'org.unifiedpush.distributor.noprovider2push': (final context) => AppLocalizations.of(context).globalOptionsPushNotificationsDistributorNoProvider2Push, diff --git a/packages/neon/lib/src/utils/global_popups.dart b/packages/neon/lib/src/utils/global_popups.dart new file mode 100644 index 00000000..5669d96a --- /dev/null +++ b/packages/neon/lib/src/utils/global_popups.dart @@ -0,0 +1,72 @@ +part of '../neon.dart'; + +class GlobalPopups extends StatefulWidget { + const GlobalPopups({ + super.key, + }); + + @override + State createState() => _GlobalPopupsState(); +} + +class _GlobalPopupsState extends State { + late FirstLaunchBloc _firstLaunchBloc; + late NextPushBloc _nextPushBloc; + + @override + void initState() { + super.initState(); + + _firstLaunchBloc = Provider.of(context, listen: false); + _nextPushBloc = Provider.of(context, listen: false); + + _firstLaunchBloc.onFirstLaunch.listen((final _) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text(AppLocalizations.of(context).firstLaunchGoToSettingsToEnablePushNotifications), + action: SnackBarAction( + label: AppLocalizations.of(context).settings, + onPressed: () async { + await Navigator.of(context).push( + MaterialPageRoute( + builder: (final context) => const SettingsPage(), + ), + ); + }, + ), + ), + ); + }); + + _nextPushBloc.onNextPushSupported.listen((final _) async { + await showDialog( + context: context, + builder: (final context) => AlertDialog( + title: Text(AppLocalizations.of(context).nextPushSupported), + content: Text(AppLocalizations.of(context).nextPushSupportedText), + actions: [ + OutlinedButton( + onPressed: () { + Navigator.of(context).pop(); + }, + child: Text(AppLocalizations.of(context).no), + ), + ElevatedButton( + onPressed: () { + Navigator.of(context).pop(); + launchUrlString( + 'https://f-droid.org/packages/$unifiedPushNextPushID', + mode: LaunchMode.externalApplication, + ); + }, + child: Text(AppLocalizations.of(context).nextPushSupportedInstall), + ), + ], + ), + ); + }); + } + + @override + Widget build(final BuildContext context) => Container(); +} diff --git a/packages/nextcloud/lib/src/nextcloud.openapi.dart b/packages/nextcloud/lib/src/nextcloud.openapi.dart index 8a392ccf..7c0bde82 100644 --- a/packages/nextcloud/lib/src/nextcloud.openapi.dart +++ b/packages/nextcloud/lib/src/nextcloud.openapi.dart @@ -157,6 +157,7 @@ class NextcloudClient { NextcloudNotesClient get notes => NextcloudNotesClient(this); NextcloudNotificationsClient get notifications => NextcloudNotificationsClient(this); NextcloudProvisioningApiClient get provisioningApi => NextcloudProvisioningApiClient(this); + NextcloudUnifiedPushProviderClient get unifiedPushProvider => NextcloudUnifiedPushProviderClient(this); NextcloudUserStatusClient get userStatus => NextcloudUserStatusClient(this); } @@ -1177,6 +1178,240 @@ class NextcloudProvisioningApiClient { } } +class NextcloudUnifiedPushProviderClient { + NextcloudUnifiedPushProviderClient(this.rootClient); + + final NextcloudClient rootClient; + + /// Check if the UnifiedPush provider is present + Future check() async { + var path = '/index.php/apps/uppush'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + final response = await rootClient.doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), + headers, + body, + ); + if (response.statusCode == 200) { + return NextcloudUnifiedPushProviderCheckResponse200ApplicationJson.fromJson( + json.decode(utf8.decode(response.body) as String) as Map); + } + throw NextcloudApiException.fromResponse(response); // coverage:ignore-line + } + + /// Set keepalive interval. + Future setKeepalive( + {required String keepalive}) async { + var path = '/index.php/apps/uppush/keepalive'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + queryParameters['keepalive'] = keepalive; + final response = await rootClient.doRequest( + 'put', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), + headers, + body, + ); + if (response.statusCode == 200) { + return NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson.fromJson( + json.decode(utf8.decode(response.body) as String) as Map); + } + throw NextcloudApiException.fromResponse(response); // coverage:ignore-line + } + + /// Request to create a new deviceId. + Future createDevice( + {required String deviceName}) async { + var path = '/index.php/apps/uppush/device'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + queryParameters['deviceName'] = deviceName; + final response = await rootClient.doRequest( + 'put', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), + headers, + body, + ); + if (response.statusCode == 200) { + return NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson.fromJson( + json.decode(utf8.decode(response.body) as String) as Map); + } + throw NextcloudApiException.fromResponse(response); // coverage:ignore-line + } + + /// Request to get push messages. + + /// This is a public page since it has to be handle by the non-connected app (NextPush app and not Nextcloud-app) + Future syncDevice( + {required String deviceId}) async { + var path = '/index.php/apps/uppush/device/{deviceId}'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + path = path.replaceAll('{deviceId}', Uri.encodeQueryComponent(deviceId)); + final response = await rootClient.doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), + headers, + body, + ); + if (response.statusCode == 401) { + return NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson.fromJson( + json.decode(utf8.decode(response.body) as String) as Map); + } + throw NextcloudApiException.fromResponse(response); // coverage:ignore-line + } + + /// Delete a device. + Future deleteDevice( + {required String deviceId}) async { + var path = '/index.php/apps/uppush/device/{deviceId}'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + path = path.replaceAll('{deviceId}', Uri.encodeQueryComponent(deviceId)); + final response = await rootClient.doRequest( + 'delete', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), + headers, + body, + ); + if (response.statusCode == 200) { + return NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson.fromJson( + json.decode(utf8.decode(response.body) as String) as Map); + } + throw NextcloudApiException.fromResponse(response); // coverage:ignore-line + } + + /// Create an authorization token for a new 3rd party service. + Future createApp({ + required String deviceId, + required String appName, + }) async { + var path = '/index.php/apps/uppush/app'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + queryParameters['deviceId'] = deviceId; + queryParameters['appName'] = appName; + final response = await rootClient.doRequest( + 'put', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), + headers, + body, + ); + if (response.statusCode == 200) { + return NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson.fromJson( + json.decode(utf8.decode(response.body) as String) as Map); + } + throw NextcloudApiException.fromResponse(response); // coverage:ignore-line + } + + /// Delete an authorization token. + Future deleteApp({required String token}) async { + var path = '/index.php/apps/uppush/app/{token}'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + path = path.replaceAll('{token}', Uri.encodeQueryComponent(token)); + final response = await rootClient.doRequest( + 'delete', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), + headers, + body, + ); + if (response.statusCode == 200) { + return NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson.fromJson( + json.decode(utf8.decode(response.body) as String) as Map); + } + throw NextcloudApiException.fromResponse(response); // coverage:ignore-line + } + + /// Unifiedpush discovery Following specifications + Future unifiedpushDiscovery( + {required String token}) async { + var path = '/index.php/apps/uppush/push/{token}'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + path = path.replaceAll('{token}', Uri.encodeQueryComponent(token)); + final response = await rootClient.doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), + headers, + body, + ); + if (response.statusCode == 200) { + return NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson.fromJson( + json.decode(utf8.decode(response.body) as String) as Map); + } + throw NextcloudApiException.fromResponse(response); // coverage:ignore-line + } + + /// Receive notifications from 3rd parties. + Future push({required String token}) async { + var path = '/index.php/apps/uppush/push/{token}'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + path = path.replaceAll('{token}', Uri.encodeQueryComponent(token)); + final response = await rootClient.doRequest( + 'post', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), + headers, + body, + ); + if (response.statusCode == 201) { + return NextcloudUnifiedPushProviderPushResponse201ApplicationJson.fromJson( + json.decode(utf8.decode(response.body) as String) as Map); + } + throw NextcloudApiException.fromResponse(response); // coverage:ignore-line + } + + /// Matrix Gateway discovery + Future gatewayMatrixDiscovery() async { + var path = '/index.php/apps/uppush/gateway/matrix'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + final response = await rootClient.doRequest( + 'get', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), + headers, + body, + ); + if (response.statusCode == 200) { + return NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson.fromJson( + json.decode(utf8.decode(response.body) as String) as Map); + } + throw NextcloudApiException.fromResponse(response); // coverage:ignore-line + } + + /// Matrix Gateway + Future gatewayMatrix() async { + var path = '/index.php/apps/uppush/gateway/matrix'; + final queryParameters = {}; + final headers = {}; + Uint8List? body; + final response = await rootClient.doRequest( + 'post', + Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(), + headers, + body, + ); + if (response.statusCode == 200) { + return NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson.fromJson( + json.decode(utf8.decode(response.body) as String) as Map); + } + throw NextcloudApiException.fromResponse(response); // coverage:ignore-line + } +} + class NextcloudUserStatusClient { NextcloudUserStatusClient(this.rootClient); @@ -4523,6 +4758,338 @@ class NextcloudProvisioningApiUser { static String? toJsonString(NextcloudProvisioningApiUser? data) => data == null ? null : json.encode(data.toJson()); } +@JsonSerializable() +class NextcloudUnifiedPushProviderCheckResponse200ApplicationJson { + NextcloudUnifiedPushProviderCheckResponse200ApplicationJson({required this.success}); + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderCheckResponse200ApplicationJson.fromJson(Map json) => + _$NextcloudUnifiedPushProviderCheckResponse200ApplicationJsonFromJson(json); + // coverage:ignore-end + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderCheckResponse200ApplicationJson.fromJsonString(String data) => + NextcloudUnifiedPushProviderCheckResponse200ApplicationJson.fromJson(json.decode(data) as Map); + // coverage:ignore-end + + final bool success; + + // coverage:ignore-start + Map toJson() => _$NextcloudUnifiedPushProviderCheckResponse200ApplicationJsonToJson(this); + // coverage:ignore-end + static String? toJsonString(NextcloudUnifiedPushProviderCheckResponse200ApplicationJson? data) => + data == null ? null : json.encode(data.toJson()); +} + +@JsonSerializable() +class NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson { + NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson({required this.success}); + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson.fromJson(Map json) => + _$NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJsonFromJson(json); + // coverage:ignore-end + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson.fromJsonString(String data) => + NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson.fromJson( + json.decode(data) as Map); + // coverage:ignore-end + + final bool success; + + // coverage:ignore-start + Map toJson() => _$NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJsonToJson(this); + // coverage:ignore-end + static String? toJsonString(NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson? data) => + data == null ? null : json.encode(data.toJson()); +} + +@JsonSerializable() +class NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson { + NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson({ + required this.success, + required this.deviceId, + }); + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson.fromJson(Map json) => + _$NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJsonFromJson(json); + // coverage:ignore-end + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson.fromJsonString(String data) => + NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson.fromJson( + json.decode(data) as Map); + // coverage:ignore-end + + final bool success; + + final String deviceId; + + // coverage:ignore-start + Map toJson() => _$NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJsonToJson(this); + // coverage:ignore-end + static String? toJsonString(NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson? data) => + data == null ? null : json.encode(data.toJson()); +} + +@JsonSerializable() +class NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson { + NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson({required this.success}); + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson.fromJson(Map json) => + _$NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJsonFromJson(json); + // coverage:ignore-end + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson.fromJsonString(String data) => + NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson.fromJson( + json.decode(data) as Map); + // coverage:ignore-end + + final bool success; + + // coverage:ignore-start + Map toJson() => _$NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJsonToJson(this); + // coverage:ignore-end + static String? toJsonString(NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson? data) => + data == null ? null : json.encode(data.toJson()); +} + +@JsonSerializable() +class NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson { + NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson({required this.success}); + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson.fromJson(Map json) => + _$NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJsonFromJson(json); + // coverage:ignore-end + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson.fromJsonString(String data) => + NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson.fromJson( + json.decode(data) as Map); + // coverage:ignore-end + + final bool success; + + // coverage:ignore-start + Map toJson() => _$NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJsonToJson(this); + // coverage:ignore-end + static String? toJsonString(NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson? data) => + data == null ? null : json.encode(data.toJson()); +} + +@JsonSerializable() +class NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson { + NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson({ + required this.success, + required this.token, + }); + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson.fromJson(Map json) => + _$NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJsonFromJson(json); + // coverage:ignore-end + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson.fromJsonString(String data) => + NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson.fromJson( + json.decode(data) as Map); + // coverage:ignore-end + + final bool success; + + final String token; + + // coverage:ignore-start + Map toJson() => _$NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJsonToJson(this); + // coverage:ignore-end + static String? toJsonString(NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson? data) => + data == null ? null : json.encode(data.toJson()); +} + +@JsonSerializable() +class NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson { + NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson({required this.success}); + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson.fromJson(Map json) => + _$NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJsonFromJson(json); + // coverage:ignore-end + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson.fromJsonString(String data) => + NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson.fromJson( + json.decode(data) as Map); + // coverage:ignore-end + + final bool success; + + // coverage:ignore-start + Map toJson() => _$NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJsonToJson(this); + // coverage:ignore-end + static String? toJsonString(NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson? data) => + data == null ? null : json.encode(data.toJson()); +} + +@JsonSerializable() +class NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush { + NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush({required this.version}); + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson( + Map json) => + _$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_UnifiedpushFromJson(json); + // coverage:ignore-end + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush.fromJsonString( + String data) => + NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson( + json.decode(data) as Map); + // coverage:ignore-end + + final int version; + + // coverage:ignore-start + Map toJson() => + _$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_UnifiedpushToJson(this); + // coverage:ignore-end + static String? toJsonString( + NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush? data) => + data == null ? null : json.encode(data.toJson()); +} + +@JsonSerializable() +class NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson { + NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson({required this.unifiedpush}); + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson.fromJson( + Map json) => + _$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJsonFromJson(json); + // coverage:ignore-end + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson.fromJsonString(String data) => + NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson.fromJson( + json.decode(data) as Map); + // coverage:ignore-end + + final NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush unifiedpush; + + // coverage:ignore-start + Map toJson() => + _$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJsonToJson(this); + // coverage:ignore-end + static String? toJsonString(NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson? data) => + data == null ? null : json.encode(data.toJson()); +} + +@JsonSerializable() +class NextcloudUnifiedPushProviderPushResponse201ApplicationJson { + NextcloudUnifiedPushProviderPushResponse201ApplicationJson({required this.success}); + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderPushResponse201ApplicationJson.fromJson(Map json) => + _$NextcloudUnifiedPushProviderPushResponse201ApplicationJsonFromJson(json); + // coverage:ignore-end + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderPushResponse201ApplicationJson.fromJsonString(String data) => + NextcloudUnifiedPushProviderPushResponse201ApplicationJson.fromJson(json.decode(data) as Map); + // coverage:ignore-end + + final bool success; + + // coverage:ignore-start + Map toJson() => _$NextcloudUnifiedPushProviderPushResponse201ApplicationJsonToJson(this); + // coverage:ignore-end + static String? toJsonString(NextcloudUnifiedPushProviderPushResponse201ApplicationJson? data) => + data == null ? null : json.encode(data.toJson()); +} + +@JsonSerializable() +class NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush { + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush({required this.gateway}); + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson( + Map json) => + _$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_UnifiedpushFromJson(json); + // coverage:ignore-end + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush.fromJsonString( + String data) => + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson( + json.decode(data) as Map); + // coverage:ignore-end + + final String gateway; + + // coverage:ignore-start + Map toJson() => + _$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_UnifiedpushToJson(this); + // coverage:ignore-end + static String? toJsonString( + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush? data) => + data == null ? null : json.encode(data.toJson()); +} + +@JsonSerializable() +class NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson { + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson({required this.unifiedpush}); + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson.fromJson( + Map json) => + _$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJsonFromJson(json); + // coverage:ignore-end + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson.fromJsonString(String data) => + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson.fromJson( + json.decode(data) as Map); + // coverage:ignore-end + + final NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush unifiedpush; + + // coverage:ignore-start + Map toJson() => + _$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJsonToJson(this); + // coverage:ignore-end + static String? toJsonString(NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson? data) => + data == null ? null : json.encode(data.toJson()); +} + +@JsonSerializable() +class NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson { + NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson({required this.rejected}); + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson.fromJson(Map json) => + _$NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJsonFromJson(json); + // coverage:ignore-end + + // coverage:ignore-start + factory NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson.fromJsonString(String data) => + NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson.fromJson( + json.decode(data) as Map); + // coverage:ignore-end + + final List rejected; + + // coverage:ignore-start + Map toJson() => _$NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJsonToJson(this); + // coverage:ignore-end + static String? toJsonString(NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson? data) => + data == null ? null : json.encode(data.toJson()); +} + enum NextcloudUserStatusClearAt_Type { period('period'), @JsonValue('end-of') @@ -5690,6 +6257,88 @@ final _deserializers = { List: (final data) => (data as List) .map((final e) => NextcloudProvisioningApiUserDetails_BackendCapabilities.fromJson(e as Map)) .toList(), + NextcloudUnifiedPushProviderCheckResponse200ApplicationJson: (final data) => + NextcloudUnifiedPushProviderCheckResponse200ApplicationJson.fromJson(data as Map), + List: (final data) => (data as List) + .map((final e) => NextcloudUnifiedPushProviderCheckResponse200ApplicationJson.fromJson(e as Map)) + .toList(), + NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson: (final data) => + NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson.fromJson(data as Map), + List: (final data) => (data as List) + .map((final e) => + NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson.fromJson(e as Map)) + .toList(), + NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson: (final data) => + NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson.fromJson(data as Map), + List: (final data) => (data as List) + .map((final e) => + NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson.fromJson(e as Map)) + .toList(), + NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson: (final data) => + NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson.fromJson(data as Map), + List: (final data) => (data as List) + .map((final e) => + NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson.fromJson(e as Map)) + .toList(), + NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson: (final data) => + NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson.fromJson(data as Map), + List: (final data) => (data as List) + .map((final e) => + NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson.fromJson(e as Map)) + .toList(), + NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson: (final data) => + NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson.fromJson(data as Map), + List: (final data) => (data as List) + .map((final e) => + NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson.fromJson(e as Map)) + .toList(), + NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson: (final data) => + NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson.fromJson(data as Map), + List: (final data) => (data as List) + .map((final e) => + NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson.fromJson(e as Map)) + .toList(), + NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson: (final data) => + NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson.fromJson(data as Map), + List: (final data) => (data as List) + .map((final e) => NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson.fromJson( + e as Map)) + .toList(), + NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush: (final data) => + NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson( + data as Map), + List: (final data) => (data + as List) + .map((final e) => NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson( + e as Map)) + .toList(), + NextcloudUnifiedPushProviderPushResponse201ApplicationJson: (final data) => + NextcloudUnifiedPushProviderPushResponse201ApplicationJson.fromJson(data as Map), + List: (final data) => (data as List) + .map((final e) => NextcloudUnifiedPushProviderPushResponse201ApplicationJson.fromJson(e as Map)) + .toList(), + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson: (final data) => + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson.fromJson( + data as Map), + List: (final data) => (data as List) + .map((final e) => NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson.fromJson( + e as Map)) + .toList(), + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush: (final data) => + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson( + data as Map), + List: (final data) => + (data as List) + .map((final e) => + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson( + e as Map)) + .toList(), + NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson: (final data) => + NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson.fromJson(data as Map), + List: (final data) => (data as List) + .map((final e) => + NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson.fromJson(e as Map)) + .toList(), NextcloudUserStatusGetPublicStatuses: (final data) => NextcloudUserStatusGetPublicStatuses.fromJson(data as Map), List: (final data) => (data as List) @@ -5974,6 +6623,46 @@ final _serializers = { NextcloudProvisioningApiUserDetails_BackendCapabilities: (final data) => data.toJson(), List: (final data) => data.map((final e) => e.toJson()).toList(), + NextcloudUnifiedPushProviderCheckResponse200ApplicationJson: (final data) => data.toJson(), + List: (final data) => + data.map((final e) => e.toJson()).toList(), + NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson: (final data) => data.toJson(), + List: (final data) => + data.map((final e) => e.toJson()).toList(), + NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson: (final data) => data.toJson(), + List: (final data) => + data.map((final e) => e.toJson()).toList(), + NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson: (final data) => data.toJson(), + List: (final data) => + data.map((final e) => e.toJson()).toList(), + NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson: (final data) => data.toJson(), + List: (final data) => + data.map((final e) => e.toJson()).toList(), + NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson: (final data) => data.toJson(), + List: (final data) => + data.map((final e) => e.toJson()).toList(), + NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson: (final data) => data.toJson(), + List: (final data) => + data.map((final e) => e.toJson()).toList(), + NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson: (final data) => data.toJson(), + List: (final data) => + data.map((final e) => e.toJson()).toList(), + NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush: (final data) => data.toJson(), + List: (final data) => + data.map((final e) => e.toJson()).toList(), + NextcloudUnifiedPushProviderPushResponse201ApplicationJson: (final data) => data.toJson(), + List: (final data) => + data.map((final e) => e.toJson()).toList(), + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson: (final data) => data.toJson(), + List: (final data) => + data.map((final e) => e.toJson()).toList(), + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush: (final data) => + data.toJson(), + List: (final data) => + data.map((final e) => e.toJson()).toList(), + NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson: (final data) => data.toJson(), + List: (final data) => + data.map((final e) => e.toJson()).toList(), NextcloudUserStatusGetPublicStatuses: (final data) => data.toJson(), List: (final data) => data.map((final e) => e.toJson()).toList(), NextcloudUserStatusGetPublicStatuses_Ocs: (final data) => data.toJson(), diff --git a/packages/nextcloud/lib/src/nextcloud.openapi.g.dart b/packages/nextcloud/lib/src/nextcloud.openapi.g.dart index 24ecae1e..990a1cf9 100644 --- a/packages/nextcloud/lib/src/nextcloud.openapi.g.dart +++ b/packages/nextcloud/lib/src/nextcloud.openapi.g.dart @@ -1949,6 +1949,235 @@ Map _$NextcloudProvisioningApiUserToJson(NextcloudProvisioningA 'ocs': instance.ocs.toJson(), }; +NextcloudUnifiedPushProviderCheckResponse200ApplicationJson + _$NextcloudUnifiedPushProviderCheckResponse200ApplicationJsonFromJson(Map json) { + $checkKeys( + json, + allowedKeys: const ['success'], + ); + return NextcloudUnifiedPushProviderCheckResponse200ApplicationJson( + success: json['success'] as bool, + ); +} + +Map _$NextcloudUnifiedPushProviderCheckResponse200ApplicationJsonToJson( + NextcloudUnifiedPushProviderCheckResponse200ApplicationJson instance) => + { + 'success': instance.success, + }; + +NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson + _$NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJsonFromJson(Map json) { + $checkKeys( + json, + allowedKeys: const ['success'], + ); + return NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson( + success: json['success'] as bool, + ); +} + +Map _$NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJsonToJson( + NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson instance) => + { + 'success': instance.success, + }; + +NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson + _$NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJsonFromJson(Map json) { + $checkKeys( + json, + allowedKeys: const ['success', 'deviceId'], + ); + return NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson( + success: json['success'] as bool, + deviceId: json['deviceId'] as String, + ); +} + +Map _$NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJsonToJson( + NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson instance) => + { + 'success': instance.success, + 'deviceId': instance.deviceId, + }; + +NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson + _$NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJsonFromJson(Map json) { + $checkKeys( + json, + allowedKeys: const ['success'], + ); + return NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson( + success: json['success'] as bool, + ); +} + +Map _$NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJsonToJson( + NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson instance) => + { + 'success': instance.success, + }; + +NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson + _$NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJsonFromJson(Map json) { + $checkKeys( + json, + allowedKeys: const ['success'], + ); + return NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson( + success: json['success'] as bool, + ); +} + +Map _$NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJsonToJson( + NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson instance) => + { + 'success': instance.success, + }; + +NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson + _$NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJsonFromJson(Map json) { + $checkKeys( + json, + allowedKeys: const ['success', 'token'], + ); + return NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson( + success: json['success'] as bool, + token: json['token'] as String, + ); +} + +Map _$NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJsonToJson( + NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson instance) => + { + 'success': instance.success, + 'token': instance.token, + }; + +NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson + _$NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJsonFromJson(Map json) { + $checkKeys( + json, + allowedKeys: const ['success'], + ); + return NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson( + success: json['success'] as bool, + ); +} + +Map _$NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJsonToJson( + NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson instance) => + { + 'success': instance.success, + }; + +NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush + _$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_UnifiedpushFromJson( + Map json) { + $checkKeys( + json, + allowedKeys: const ['version'], + ); + return NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush( + version: json['version'] as int, + ); +} + +Map _$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_UnifiedpushToJson( + NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush instance) => + { + 'version': instance.version, + }; + +NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson + _$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJsonFromJson(Map json) { + $checkKeys( + json, + allowedKeys: const ['unifiedpush'], + ); + return NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson( + unifiedpush: NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson( + json['unifiedpush'] as Map), + ); +} + +Map _$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJsonToJson( + NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson instance) => + { + 'unifiedpush': instance.unifiedpush.toJson(), + }; + +NextcloudUnifiedPushProviderPushResponse201ApplicationJson + _$NextcloudUnifiedPushProviderPushResponse201ApplicationJsonFromJson(Map json) { + $checkKeys( + json, + allowedKeys: const ['success'], + ); + return NextcloudUnifiedPushProviderPushResponse201ApplicationJson( + success: json['success'] as bool, + ); +} + +Map _$NextcloudUnifiedPushProviderPushResponse201ApplicationJsonToJson( + NextcloudUnifiedPushProviderPushResponse201ApplicationJson instance) => + { + 'success': instance.success, + }; + +NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush + _$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_UnifiedpushFromJson( + Map json) { + $checkKeys( + json, + allowedKeys: const ['gateway'], + ); + return NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush( + gateway: json['gateway'] as String, + ); +} + +Map _$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_UnifiedpushToJson( + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush instance) => + { + 'gateway': instance.gateway, + }; + +NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson + _$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJsonFromJson(Map json) { + $checkKeys( + json, + allowedKeys: const ['unifiedpush'], + ); + return NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson( + unifiedpush: NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson( + json['unifiedpush'] as Map), + ); +} + +Map _$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJsonToJson( + NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson instance) => + { + 'unifiedpush': instance.unifiedpush.toJson(), + }; + +NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson + _$NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJsonFromJson(Map json) { + $checkKeys( + json, + allowedKeys: const ['rejected'], + ); + return NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson( + rejected: (json['rejected'] as List).map((e) => e as String).toList(), + ); +} + +Map _$NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJsonToJson( + NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson instance) => + { + 'rejected': instance.rejected, + }; + NextcloudUserStatusClearAt _$NextcloudUserStatusClearAtFromJson(Map json) { $checkKeys( json, diff --git a/packages/nextcloud/lib/src/nextcloud.openapi.json b/packages/nextcloud/lib/src/nextcloud.openapi.json index 6f360fdc..aacd2154 100644 --- a/packages/nextcloud/lib/src/nextcloud.openapi.json +++ b/packages/nextcloud/lib/src/nextcloud.openapi.json @@ -3419,6 +3419,422 @@ } } }, + "/index.php/apps/uppush": { + "get": { + "tags": [ + "unified_push_provider" + ], + "summary": "Check if the UnifiedPush provider is present", + "operationId": "unified_push_provider-check", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "success" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/keepalive": { + "put": { + "tags": [ + "unified_push_provider" + ], + "summary": "Set keepalive interval.", + "operationId": "unified_push_provider-set-keepalive", + "parameters": [ + { + "name": "keepalive", + "in": "query", + "description": "Keep alive value in seconds", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "success" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/device": { + "put": { + "tags": [ + "unified_push_provider" + ], + "summary": "Request to create a new deviceId.", + "operationId": "unified_push_provider-create-device", + "parameters": [ + { + "name": "deviceName", + "in": "query", + "description": "Name of the device", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "success", + "deviceId" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "deviceId": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/device/{deviceId}": { + "parameters": [ + { + "name": "deviceId", + "in": "path", + "description": "ID of the device", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "tags": [ + "unified_push_provider" + ], + "summary": "Request to get push messages.", + "description": "This is a public page since it has to be handle by the non-connected app (NextPush app and not Nextcloud-app)", + "operationId": "unified_push_provider-sync-device", + "responses": { + "401": { + "description": "Missing permissions to sync device", + "content": { + "application/json": { + "schema": { + "required": [ + "success" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "unified_push_provider" + ], + "summary": "Delete a device.", + "operationId": "unified_push_provider-delete-device", + "responses": { + "200": { + "description": "Device deleted successfully", + "content": { + "application/json": { + "schema": { + "required": [ + "success" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/app": { + "put": { + "tags": [ + "unified_push_provider" + ], + "summary": "Create an authorization token for a new 3rd party service.", + "operationId": "unified_push_provider-create-app", + "parameters": [ + { + "name": "deviceId", + "in": "query", + "description": "ID of the device", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "appName", + "in": "query", + "description": "Name of the app", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "App created successfully", + "content": { + "application/json": { + "schema": { + "required": [ + "success", + "token" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "token": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/app/{token}": { + "parameters": [ + { + "name": "token", + "in": "path", + "description": "Token of the app", + "required": true, + "schema": { + "type": "string" + } + } + ], + "delete": { + "tags": [ + "unified_push_provider" + ], + "summary": "Delete an authorization token.", + "operationId": "unified_push_provider-delete-app", + "responses": { + "200": { + "description": "App deleted successfully", + "content": { + "application/json": { + "schema": { + "required": [ + "success" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/push/{token}": { + "parameters": [ + { + "name": "token", + "in": "path", + "description": "Token of the app to push to", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "tags": [ + "unified_push_provider" + ], + "summary": "Receive notifications from 3rd parties.", + "operationId": "unified_push_provider-push", + "responses": { + "201": { + "description": "Notification pushed successfully", + "content": { + "application/json": { + "schema": { + "required": [ + "success" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "get": { + "tags": [ + "unified_push_provider" + ], + "summary": "Unifiedpush discovery Following specifications", + "operationId": "unified_push_provider-unifiedpush-discovery", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "unifiedpush" + ], + "type": "object", + "properties": { + "unifiedpush": { + "required": [ + "version" + ], + "type": "object", + "properties": { + "version": { + "type": "integer" + } + } + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/gateway/matrix": { + "get": { + "tags": [ + "unified_push_provider" + ], + "summary": "Matrix Gateway discovery", + "operationId": "unified_push_provider-gateway-matrix-discovery", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "unifiedpush" + ], + "type": "object", + "properties": { + "unifiedpush": { + "required": [ + "gateway" + ], + "type": "object", + "properties": { + "gateway": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "unified_push_provider" + ], + "summary": "Matrix Gateway", + "operationId": "unified_push_provider-gateway-matrix", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "rejected" + ], + "type": "object", + "properties": { + "rejected": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, "/ocs/v2.php/apps/user_status/api/v1/statuses": { "get": { "operationId": "get-public-statuses", diff --git a/packages/nextcloud/test/uppush.dart b/packages/nextcloud/test/uppush.dart new file mode 100644 index 00000000..b00c444e --- /dev/null +++ b/packages/nextcloud/test/uppush.dart @@ -0,0 +1,66 @@ +import 'package:test/test.dart'; + +import 'helper.dart'; + +Future main() async { + await run(await getDockerImage()); +} + +Future run(final DockerImage image) async { + group('uppush', () { + late DockerContainer container; + late TestNextcloudClient client; + setUp(() async { + container = await getDockerContainer(image); + client = await getTestClient( + container, + username: 'admin', + password: 'admin', + ); + }); + tearDown(() => container.destroy()); + + test('Is installed', () async { + final response = await client.unifiedPushProvider.check(); + expect(response.success, isTrue); + }); + + test('Set keepalive', () async { + final response = await client.unifiedPushProvider.setKeepalive(keepalive: '10'); + expect(response.success, isTrue); + }); + + test('Create device', () async { + final response = await client.unifiedPushProvider.createDevice(deviceName: 'Test'); + expect(response.success, isTrue); + expect(response.deviceId, isNotEmpty); + }); + + test('Delete device', () async { + final deviceId = (await client.unifiedPushProvider.createDevice(deviceName: 'Test')).deviceId; + + final response = await client.unifiedPushProvider.deleteDevice(deviceId: deviceId); + expect(response.success, isTrue); + }); + + test('Create app', () async { + final deviceId = (await client.unifiedPushProvider.createDevice(deviceName: 'Test')).deviceId; + + final response = await client.unifiedPushProvider.createApp(deviceId: deviceId, appName: 'Test'); + expect(response.success, isTrue); + expect(response.token, isNotEmpty); + }); + + test('UnifiedPush discovery', () async { + final response = await client.unifiedPushProvider.unifiedpushDiscovery(token: 'example'); + expect(response.unifiedpush.version, 1); + }); + + test('Matrix gateway discovery', () async { + final response = await client.unifiedPushProvider.gatewayMatrixDiscovery(); + expect(response.unifiedpush.gateway, 'matrix'); + }); + + // Deleting an app, sending a notification (also via matrix gateway) or listening for notifications is not possible because redis is not set up + }); +} diff --git a/specs/uppush.json b/specs/uppush.json new file mode 100644 index 00000000..8712eacd --- /dev/null +++ b/specs/uppush.json @@ -0,0 +1,444 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "UnifiedPush Provider", + "description": "Use Nextcloud as a push provider for mobile phones' notifications", + "license": { + "name": "agpl" + }, + "version": "1.2.0" + }, + "paths": { + "/index.php/apps/uppush": { + "get": { + "tags": [ + "unified_push_provider" + ], + "summary": "Check if the UnifiedPush provider is present", + "operationId": "unified_push_provider-check", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "success" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/keepalive": { + "put": { + "tags": [ + "unified_push_provider" + ], + "summary": "Set keepalive interval.", + "operationId": "unified_push_provider-set-keepalive", + "parameters": [ + { + "name": "keepalive", + "in": "query", + "description": "Keep alive value in seconds", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "success" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/device": { + "put": { + "tags": [ + "unified_push_provider" + ], + "summary": "Request to create a new deviceId.", + "operationId": "unified_push_provider-create-device", + "parameters": [ + { + "name": "deviceName", + "in": "query", + "description": "Name of the device", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "success", + "deviceId" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "deviceId": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/device/{deviceId}": { + "parameters": [ + { + "name": "deviceId", + "in": "path", + "description": "ID of the device", + "required": true, + "schema": { + "type": "string" + } + } + ], + "get": { + "tags": [ + "unified_push_provider" + ], + "summary": "Request to get push messages.", + "description": "This is a public page since it has to be handle by the non-connected app (NextPush app and not Nextcloud-app)", + "operationId": "unified_push_provider-sync-device", + "responses": { + "401": { + "description": "Missing permissions to sync device", + "content": { + "application/json": { + "schema": { + "required": [ + "success" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "unified_push_provider" + ], + "summary": "Delete a device.", + "operationId": "unified_push_provider-delete-device", + "responses": { + "200": { + "description": "Device deleted successfully", + "content": { + "application/json": { + "schema": { + "required": [ + "success" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/app": { + "put": { + "tags": [ + "unified_push_provider" + ], + "summary": "Create an authorization token for a new 3rd party service.", + "operationId": "unified_push_provider-create-app", + "parameters": [ + { + "name": "deviceId", + "in": "query", + "description": "ID of the device", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "appName", + "in": "query", + "description": "Name of the app", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "App created successfully", + "content": { + "application/json": { + "schema": { + "required": [ + "success", + "token" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "token": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/app/{token}": { + "parameters": [ + { + "name": "token", + "in": "path", + "description": "Token of the app", + "required": true, + "schema": { + "type": "string" + } + } + ], + "delete": { + "tags": [ + "unified_push_provider" + ], + "summary": "Delete an authorization token.", + "operationId": "unified_push_provider-delete-app", + "responses": { + "200": { + "description": "App deleted successfully", + "content": { + "application/json": { + "schema": { + "required": [ + "success" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/push/{token}": { + "parameters": [ + { + "name": "token", + "in": "path", + "description": "Token of the app to push to", + "required": true, + "schema": { + "type": "string" + } + } + ], + "post": { + "tags": [ + "unified_push_provider" + ], + "summary": "Receive notifications from 3rd parties.", + "operationId": "unified_push_provider-push", + "responses": { + "201": { + "description": "Notification pushed successfully", + "content": { + "application/json": { + "schema": { + "required": [ + "success" + ], + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "get": { + "tags": [ + "unified_push_provider" + ], + "summary": "Unifiedpush discovery Following specifications", + "operationId": "unified_push_provider-unifiedpush-discovery", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "unifiedpush" + ], + "type": "object", + "properties": { + "unifiedpush": { + "required": [ + "version" + ], + "type": "object", + "properties": { + "version": { + "type": "integer" + } + } + } + } + } + } + } + } + } + } + }, + "/index.php/apps/uppush/gateway/matrix": { + "get": { + "tags": [ + "unified_push_provider" + ], + "summary": "Matrix Gateway discovery", + "operationId": "unified_push_provider-gateway-matrix-discovery", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "unifiedpush" + ], + "type": "object", + "properties": { + "unifiedpush": { + "required": [ + "gateway" + ], + "type": "object", + "properties": { + "gateway": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "unified_push_provider" + ], + "summary": "Matrix Gateway", + "operationId": "unified_push_provider-gateway-matrix", + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "required": [ + "rejected" + ], + "type": "object", + "properties": { + "rejected": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } + }, + "components": { + "schemas": {}, + "securitySchemes": { + "basic_auth": { + "type": "http", + "scheme": "basic" + } + } + }, + "security": [ + { + "basic_auth": [] + } + ], + "tags": [] +} \ No newline at end of file diff --git a/tool/Dockerfile.dev b/tool/Dockerfile.dev index cbbf9faa..3c2cc700 100644 --- a/tool/Dockerfile.dev +++ b/tool/Dockerfile.dev @@ -13,6 +13,7 @@ RUN OC_PASS="user2" ./occ user:add --password-from-env --display-name "User Two" RUN ./occ app:install news # 21.0.0 RUN ./occ app:install notes # 4.6.0 +RUN ./occ app:install uppush # 1.2.0 RUN ./occ app:enable password_policy # TODO: This stopped working randomly with apache not being able to bind to the port during build. Must be some docker changes? diff --git a/tool/generate-nextcloud.sh b/tool/generate-nextcloud.sh index 71bec3f6..5611b526 100755 --- a/tool/generate-nextcloud.sh +++ b/tool/generate-nextcloud.sh @@ -5,8 +5,8 @@ cd "$(dirname "$0")/.." rm -rf /tmp/nextcloud-neon mkdir -p /tmp/nextcloud-neon -codenames=(core news notes notifications provisioning_api user_status) -prefixes=(Core News Notes Notifications ProvisioningApi UserStatus) +codenames=(core news notes notifications provisioning_api uppush user_status) +prefixes=(Core News Notes Notifications ProvisioningApi UnifiedPushProvider UserStatus) base_spec=/tmp/nextcloud-neon/base.json merged_spec=/tmp/nextcloud-neon/merged.json