From ab4fbc9916fafd9ba9c9b688bfca85688cac3511 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sun, 15 Oct 2023 14:55:34 +0200 Subject: [PATCH 1/3] feat(nextcloud): Export BytesStreamExtension from dynamite_runtime Signed-off-by: jld3103 --- packages/nextcloud/lib/nextcloud.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nextcloud/lib/nextcloud.dart b/packages/nextcloud/lib/nextcloud.dart index aa37e686..7f9fc397 100644 --- a/packages/nextcloud/lib/nextcloud.dart +++ b/packages/nextcloud/lib/nextcloud.dart @@ -1,6 +1,6 @@ export 'package:dynamite_runtime/content_string.dart'; export 'package:dynamite_runtime/http_client.dart' - show CookieJar, DynamiteApiException, DynamiteRawResponse, DynamiteResponse; + show BytesStreamExtension, CookieJar, DynamiteApiException, DynamiteRawResponse, DynamiteResponse; export 'ids.dart'; export 'src/client.dart'; From f369b732aab598d0692d52cf2e66025dc3bddddb Mon Sep 17 00:00:00 2001 From: jld3103 Date: Thu, 19 Oct 2023 09:27:43 +0200 Subject: [PATCH 2/3] refactor(dynamite,dynamite_runtime): Separate injecting base values when executing requests Signed-off-by: jld3103 --- .../dynamite/lib/src/builder/client.dart | 2 +- .../lib/src/dynamite_client.dart | 26 +++++- .../nextcloud/lib/src/api/core.openapi.dart | 90 +++++++++---------- .../lib/src/api/dashboard.openapi.dart | 6 +- .../nextcloud/lib/src/api/dav.openapi.dart | 2 +- .../nextcloud/lib/src/api/files.openapi.dart | 26 +++--- .../lib/src/api/files_external.openapi.dart | 2 +- .../lib/src/api/files_reminders.openapi.dart | 6 +- .../lib/src/api/files_sharing.openapi.dart | 42 ++++----- .../lib/src/api/files_trashbin.openapi.dart | 2 +- .../lib/src/api/files_versions.openapi.dart | 2 +- .../nextcloud/lib/src/api/news.openapi.dart | 36 ++++---- .../nextcloud/lib/src/api/notes.openapi.dart | 14 +-- .../lib/src/api/notifications.openapi.dart | 20 ++--- .../lib/src/api/provisioning_api.openapi.dart | 86 +++++++++--------- .../lib/src/api/settings.openapi.dart | 2 +- .../lib/src/api/theming.openapi.dart | 22 ++--- .../src/api/updatenotification.openapi.dart | 2 +- .../nextcloud/lib/src/api/uppush.openapi.dart | 22 ++--- .../lib/src/api/user_status.openapi.dart | 20 ++--- .../lib/src/api/weather_status.openapi.dart | 14 +-- 21 files changed, 232 insertions(+), 212 deletions(-) diff --git a/packages/dynamite/dynamite/lib/src/builder/client.dart b/packages/dynamite/dynamite/lib/src/builder/client.dart index d3f9a03c..df128553 100644 --- a/packages/dynamite/dynamite/lib/src/builder/client.dart +++ b/packages/dynamite/dynamite/lib/src/builder/client.dart @@ -363,7 +363,7 @@ Iterable buildTags( code.writeln(''' return DynamiteRawResponse<$returnDataType, $returnHeadersType>( - response: $client.doRequest( + response: $client.executeRequest( '$httpMethod', _uri, _headers, diff --git a/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart b/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart index c5704cf2..9f158d6e 100644 --- a/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart +++ b/packages/dynamite/dynamite_runtime/lib/src/dynamite_client.dart @@ -405,13 +405,17 @@ class DynamiteClient { final List authentications; /// Makes a request against a given [path]. - Future doRequest( + /// + /// The query parameters of the [baseURL] are added. + /// The [path] is resolved against the path of the [baseURL]. + /// All [baseHeaders] are added to the request. + Future executeRequest( final String method, final Uri path, final Map headers, final Uint8List? body, final Set? validStatuses, - ) async { + ) { final queryParameters = { ...baseURL.queryParametersAll, ...path.queryParametersAll, @@ -420,9 +424,25 @@ class DynamiteClient { path: '${baseURL.path}${path.path}', queryParameters: queryParameters.isNotEmpty ? queryParameters : null, ); + return executeRawRequest( + method, + uri, + {...?baseHeaders, ...headers}, + body, + validStatuses, + ); + } + /// Executes a HTTP request against give full [uri]. + Future executeRawRequest( + final String method, + final Uri uri, + final Map headers, + final Uint8List? body, + final Set? validStatuses, + ) async { final request = await httpClient.openUrl(method, uri); - for (final header in {...?baseHeaders, ...headers}.entries) { + for (final header in headers.entries) { request.headers.add(header.key, header.value); } if (body != null) { diff --git a/packages/nextcloud/lib/src/api/core.openapi.dart b/packages/nextcloud/lib/src/api/core.openapi.dart index 7e779595..9d5efec6 100644 --- a/packages/nextcloud/lib/src/api/core.openapi.dart +++ b/packages/nextcloud/lib/src/api/core.openapi.dart @@ -110,7 +110,7 @@ class Client extends DynamiteClient { final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'get', uri, headers, @@ -200,7 +200,7 @@ class AppPasswordClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -284,7 +284,7 @@ class AppPasswordClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -368,7 +368,7 @@ class AppPasswordClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -502,7 +502,7 @@ class AutoCompleteClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -597,7 +597,7 @@ class AvatarClient { path = path.replaceAll('{size}', Uri.encodeQueryComponent(size.toString())); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -685,7 +685,7 @@ class AvatarClient { path = path.replaceAll('{size}', Uri.encodeQueryComponent(size.toString())); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -769,7 +769,7 @@ class ClientFlowLoginV2Client { queryParameters['token'] = token; final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -836,7 +836,7 @@ class ClientFlowLoginV2Client { // coverage:ignore-end final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -932,7 +932,7 @@ class CollaborationResourcesClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1024,7 +1024,7 @@ class CollaborationResourcesClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1122,7 +1122,7 @@ class CollaborationResourcesClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -1226,7 +1226,7 @@ class CollaborationResourcesClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -1330,7 +1330,7 @@ class CollaborationResourcesClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -1428,7 +1428,7 @@ class CollaborationResourcesClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1536,7 +1536,7 @@ class CollaborationResourcesClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -1633,7 +1633,7 @@ class GuestAvatarClient { path = path.replaceAll('{size}', Uri.encodeQueryComponent(size)); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1733,7 +1733,7 @@ class GuestAvatarClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1829,7 +1829,7 @@ class HoverCardClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1927,7 +1927,7 @@ class NavigationClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -2019,7 +2019,7 @@ class NavigationClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -2095,7 +2095,7 @@ class OcmClient { // coverage:ignore-end final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -2181,7 +2181,7 @@ class OcsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -2327,7 +2327,7 @@ class PreviewClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -2467,7 +2467,7 @@ class PreviewClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -2579,7 +2579,7 @@ class ProfileApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -2663,7 +2663,7 @@ class ReferenceClient { path = path.replaceAll('{referenceId}', Uri.encodeQueryComponent(referenceId)); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -2757,7 +2757,7 @@ class ReferenceApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -2853,7 +2853,7 @@ class ReferenceApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -2957,7 +2957,7 @@ class ReferenceApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -3039,7 +3039,7 @@ class ReferenceApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -3135,7 +3135,7 @@ class ReferenceApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -3221,7 +3221,7 @@ class TextProcessingApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -3331,7 +3331,7 @@ class TextProcessingApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -3421,7 +3421,7 @@ class TextProcessingApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -3513,7 +3513,7 @@ class TextProcessingApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -3611,7 +3611,7 @@ class TextProcessingApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -3697,7 +3697,7 @@ class TranslationApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -3803,7 +3803,7 @@ class TranslationApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -3899,7 +3899,7 @@ class UnifiedSearchClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -4032,7 +4032,7 @@ class UnifiedSearchClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -4118,7 +4118,7 @@ class WhatsNewClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -4208,7 +4208,7 @@ class WhatsNewClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -4292,7 +4292,7 @@ class WipeClient { queryParameters['token'] = token; final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -4370,7 +4370,7 @@ class WipeClient { queryParameters['token'] = token; final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, diff --git a/packages/nextcloud/lib/src/api/dashboard.openapi.dart b/packages/nextcloud/lib/src/api/dashboard.openapi.dart index c7299643..95f23d78 100644 --- a/packages/nextcloud/lib/src/api/dashboard.openapi.dart +++ b/packages/nextcloud/lib/src/api/dashboard.openapi.dart @@ -112,7 +112,7 @@ class DashboardApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -223,7 +223,7 @@ class DashboardApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -334,7 +334,7 @@ class DashboardApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, diff --git a/packages/nextcloud/lib/src/api/dav.openapi.dart b/packages/nextcloud/lib/src/api/dav.openapi.dart index f755a32c..91984db7 100644 --- a/packages/nextcloud/lib/src/api/dav.openapi.dart +++ b/packages/nextcloud/lib/src/api/dav.openapi.dart @@ -131,7 +131,7 @@ class DirectClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, diff --git a/packages/nextcloud/lib/src/api/files.openapi.dart b/packages/nextcloud/lib/src/api/files.openapi.dart index 5d9518f9..ee3ad386 100644 --- a/packages/nextcloud/lib/src/api/files.openapi.dart +++ b/packages/nextcloud/lib/src/api/files.openapi.dart @@ -139,7 +139,7 @@ class ApiClient { path = path.replaceAll('{file}', Uri.encodeQueryComponent(file)); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -225,7 +225,7 @@ class DirectEditingClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -321,7 +321,7 @@ class DirectEditingClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -429,7 +429,7 @@ class DirectEditingClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -541,7 +541,7 @@ class DirectEditingClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -637,7 +637,7 @@ class OpenLocalEditorClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -733,7 +733,7 @@ class OpenLocalEditorClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -817,7 +817,7 @@ class TemplateClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -923,7 +923,7 @@ class TemplateClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -1023,7 +1023,7 @@ class TemplateClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -1127,7 +1127,7 @@ class TransferOwnershipClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -1219,7 +1219,7 @@ class TransferOwnershipClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -1311,7 +1311,7 @@ class TransferOwnershipClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, diff --git a/packages/nextcloud/lib/src/api/files_external.openapi.dart b/packages/nextcloud/lib/src/api/files_external.openapi.dart index 90d5d2ef..dd66c366 100644 --- a/packages/nextcloud/lib/src/api/files_external.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_external.openapi.dart @@ -113,7 +113,7 @@ class ApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, diff --git a/packages/nextcloud/lib/src/api/files_reminders.openapi.dart b/packages/nextcloud/lib/src/api/files_reminders.openapi.dart index 871cfb9e..c8b43e4c 100644 --- a/packages/nextcloud/lib/src/api/files_reminders.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_reminders.openapi.dart @@ -128,7 +128,7 @@ class ApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -237,7 +237,7 @@ class ApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -336,7 +336,7 @@ class ApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, diff --git a/packages/nextcloud/lib/src/api/files_sharing.openapi.dart b/packages/nextcloud/lib/src/api/files_sharing.openapi.dart index 1d2de538..3e692b84 100644 --- a/packages/nextcloud/lib/src/api/files_sharing.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_sharing.openapi.dart @@ -121,7 +121,7 @@ class DeletedShareapiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -211,7 +211,7 @@ class DeletedShareapiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -309,7 +309,7 @@ class PublicPreviewClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -433,7 +433,7 @@ class PublicPreviewClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -519,7 +519,7 @@ class RemoteClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -601,7 +601,7 @@ class RemoteClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -691,7 +691,7 @@ class RemoteClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -781,7 +781,7 @@ class RemoteClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -871,7 +871,7 @@ class RemoteClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -963,7 +963,7 @@ class RemoteClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -1077,7 +1077,7 @@ class ShareInfoClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -1207,7 +1207,7 @@ class ShareapiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1383,7 +1383,7 @@ class ShareapiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -1475,7 +1475,7 @@ class ShareapiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path0, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1557,7 +1557,7 @@ class ShareapiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1655,7 +1655,7 @@ class ShareapiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1821,7 +1821,7 @@ class ShareapiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -1913,7 +1913,7 @@ class ShareapiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -2005,7 +2005,7 @@ class ShareapiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -2146,7 +2146,7 @@ class ShareesapiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -2245,7 +2245,7 @@ class ShareesapiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, diff --git a/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart b/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart index 51c4b574..6572f925 100644 --- a/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart @@ -141,7 +141,7 @@ class PreviewClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, diff --git a/packages/nextcloud/lib/src/api/files_versions.openapi.dart b/packages/nextcloud/lib/src/api/files_versions.openapi.dart index 054bc9e7..c4fe0b6d 100644 --- a/packages/nextcloud/lib/src/api/files_versions.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_versions.openapi.dart @@ -141,7 +141,7 @@ class PreviewClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, diff --git a/packages/nextcloud/lib/src/api/news.openapi.dart b/packages/nextcloud/lib/src/api/news.openapi.dart index 3bfc20b4..63a8493f 100644 --- a/packages/nextcloud/lib/src/api/news.openapi.dart +++ b/packages/nextcloud/lib/src/api/news.openapi.dart @@ -88,7 +88,7 @@ class Client extends DynamiteClient { // coverage:ignore-end final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'get', uri, headers, @@ -153,7 +153,7 @@ class Client extends DynamiteClient { // coverage:ignore-end final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'get', uri, headers, @@ -227,7 +227,7 @@ class Client extends DynamiteClient { queryParameters['name'] = name; final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'post', uri, headers, @@ -307,7 +307,7 @@ class Client extends DynamiteClient { queryParameters['name'] = name; final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'put', uri, headers, @@ -373,7 +373,7 @@ class Client extends DynamiteClient { path = path.replaceAll('{folderId}', Uri.encodeQueryComponent(folderId.toString())); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'delete', uri, headers, @@ -453,7 +453,7 @@ class Client extends DynamiteClient { queryParameters['newestItemId'] = newestItemId.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'post', uri, headers, @@ -518,7 +518,7 @@ class Client extends DynamiteClient { // coverage:ignore-end final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'get', uri, headers, @@ -604,7 +604,7 @@ class Client extends DynamiteClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'post', uri, headers, @@ -670,7 +670,7 @@ class Client extends DynamiteClient { path = path.replaceAll('{feedId}', Uri.encodeQueryComponent(feedId.toString())); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'delete', uri, headers, @@ -752,7 +752,7 @@ class Client extends DynamiteClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'post', uri, headers, @@ -832,7 +832,7 @@ class Client extends DynamiteClient { queryParameters['feedTitle'] = feedTitle; final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'post', uri, headers, @@ -912,7 +912,7 @@ class Client extends DynamiteClient { queryParameters['newestItemId'] = newestItemId.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'post', uri, headers, @@ -1032,7 +1032,7 @@ class Client extends DynamiteClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'get', uri, headers, @@ -1128,7 +1128,7 @@ class Client extends DynamiteClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'get', uri, headers, @@ -1194,7 +1194,7 @@ class Client extends DynamiteClient { path = path.replaceAll('{itemId}', Uri.encodeQueryComponent(itemId.toString())); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'post', uri, headers, @@ -1260,7 +1260,7 @@ class Client extends DynamiteClient { path = path.replaceAll('{itemId}', Uri.encodeQueryComponent(itemId.toString())); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'post', uri, headers, @@ -1326,7 +1326,7 @@ class Client extends DynamiteClient { path = path.replaceAll('{itemId}', Uri.encodeQueryComponent(itemId.toString())); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'post', uri, headers, @@ -1392,7 +1392,7 @@ class Client extends DynamiteClient { path = path.replaceAll('{itemId}', Uri.encodeQueryComponent(itemId.toString())); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'post', uri, headers, diff --git a/packages/nextcloud/lib/src/api/notes.openapi.dart b/packages/nextcloud/lib/src/api/notes.openapi.dart index 861f717f..b14b1223 100644 --- a/packages/nextcloud/lib/src/api/notes.openapi.dart +++ b/packages/nextcloud/lib/src/api/notes.openapi.dart @@ -144,7 +144,7 @@ class Client extends DynamiteClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse, void>( - response: doRequest( + response: executeRequest( 'get', uri, headers, @@ -256,7 +256,7 @@ class Client extends DynamiteClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'post', uri, headers, @@ -348,7 +348,7 @@ class Client extends DynamiteClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'get', uri, headers, @@ -472,7 +472,7 @@ class Client extends DynamiteClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'put', uri, headers, @@ -540,7 +540,7 @@ class Client extends DynamiteClient { path = path.replaceAll('{id}', Uri.encodeQueryComponent(id.toString())); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'delete', uri, headers, @@ -605,7 +605,7 @@ class Client extends DynamiteClient { // coverage:ignore-end final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'get', uri, headers, @@ -675,7 +675,7 @@ class Client extends DynamiteClient { as Uint8List; final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'put', uri, headers, diff --git a/packages/nextcloud/lib/src/api/notifications.openapi.dart b/packages/nextcloud/lib/src/api/notifications.openapi.dart index f92b3a0f..4342230c 100644 --- a/packages/nextcloud/lib/src/api/notifications.openapi.dart +++ b/packages/nextcloud/lib/src/api/notifications.openapi.dart @@ -155,7 +155,7 @@ class ApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -254,7 +254,7 @@ class EndpointClient { final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -344,7 +344,7 @@ class EndpointClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -440,7 +440,7 @@ class EndpointClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -538,7 +538,7 @@ class EndpointClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -634,7 +634,7 @@ class EndpointClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -752,7 +752,7 @@ class PushClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -846,7 +846,7 @@ class PushClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -958,7 +958,7 @@ class SettingsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -1068,7 +1068,7 @@ class SettingsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, diff --git a/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart b/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart index 1eb74ef2..32bfc2d1 100644 --- a/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart +++ b/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart @@ -124,7 +124,7 @@ class AppConfigClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -218,7 +218,7 @@ class AppConfigClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -326,7 +326,7 @@ class AppConfigClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -428,7 +428,7 @@ class AppConfigClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -528,7 +528,7 @@ class AppConfigClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -628,7 +628,7 @@ class AppsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -720,7 +720,7 @@ class AppsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -812,7 +812,7 @@ class AppsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -904,7 +904,7 @@ class AppsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -1016,7 +1016,7 @@ class GroupsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1116,7 +1116,7 @@ class GroupsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -1222,7 +1222,7 @@ class GroupsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1315,7 +1315,7 @@ class GroupsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1428,7 +1428,7 @@ class GroupsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1521,7 +1521,7 @@ class GroupsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1612,7 +1612,7 @@ class GroupsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -1717,7 +1717,7 @@ class GroupsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -1810,7 +1810,7 @@ class GroupsClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -1918,7 +1918,7 @@ class PreferencesClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -2014,7 +2014,7 @@ class PreferencesClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -2115,7 +2115,7 @@ class PreferencesClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -2211,7 +2211,7 @@ class PreferencesClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -2323,7 +2323,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -2477,7 +2477,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -2583,7 +2583,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -2687,7 +2687,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -2775,7 +2775,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -2875,7 +2875,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -2963,7 +2963,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -3045,7 +3045,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -3127,7 +3127,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -3215,7 +3215,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -3326,7 +3326,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -3414,7 +3414,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -3502,7 +3502,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -3590,7 +3590,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -3678,7 +3678,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -3774,7 +3774,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -3868,7 +3868,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -3960,7 +3960,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -4058,7 +4058,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -4156,7 +4156,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -4244,7 +4244,7 @@ class UsersClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, diff --git a/packages/nextcloud/lib/src/api/settings.openapi.dart b/packages/nextcloud/lib/src/api/settings.openapi.dart index 0fa5bd4a..c481e827 100644 --- a/packages/nextcloud/lib/src/api/settings.openapi.dart +++ b/packages/nextcloud/lib/src/api/settings.openapi.dart @@ -102,7 +102,7 @@ class LogSettingsClient { // coverage:ignore-end final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, diff --git a/packages/nextcloud/lib/src/api/theming.openapi.dart b/packages/nextcloud/lib/src/api/theming.openapi.dart index 1770d554..6b13999b 100644 --- a/packages/nextcloud/lib/src/api/theming.openapi.dart +++ b/packages/nextcloud/lib/src/api/theming.openapi.dart @@ -116,7 +116,7 @@ class IconClient { path = path.replaceAll('{app}', Uri.encodeQueryComponent(app)); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -196,7 +196,7 @@ class IconClient { path = path.replaceAll('{app}', Uri.encodeQueryComponent(app)); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -287,7 +287,7 @@ class IconClient { path = path.replaceAll('{image}', Uri.encodeQueryComponent(image)); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -393,7 +393,7 @@ class ThemingClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -485,7 +485,7 @@ class ThemingClient { } final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -563,7 +563,7 @@ class ThemingClient { path = path.replaceAll('{app}', Uri.encodeQueryComponent(app)); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -649,7 +649,7 @@ class UserThemeClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -757,7 +757,7 @@ class UserThemeClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'post', uri, headers, @@ -835,7 +835,7 @@ class UserThemeClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -927,7 +927,7 @@ class UserThemeClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -1019,7 +1019,7 @@ class UserThemeClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, diff --git a/packages/nextcloud/lib/src/api/updatenotification.openapi.dart b/packages/nextcloud/lib/src/api/updatenotification.openapi.dart index cb65313b..82f118e2 100644 --- a/packages/nextcloud/lib/src/api/updatenotification.openapi.dart +++ b/packages/nextcloud/lib/src/api/updatenotification.openapi.dart @@ -130,7 +130,7 @@ class ApiClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, diff --git a/packages/nextcloud/lib/src/api/uppush.openapi.dart b/packages/nextcloud/lib/src/api/uppush.openapi.dart index 940f5ef9..36418950 100644 --- a/packages/nextcloud/lib/src/api/uppush.openapi.dart +++ b/packages/nextcloud/lib/src/api/uppush.openapi.dart @@ -91,7 +91,7 @@ class Client extends DynamiteClient { // coverage:ignore-end final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'get', uri, headers, @@ -175,7 +175,7 @@ class Client extends DynamiteClient { queryParameters['keepalive'] = keepalive.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'put', uri, headers, @@ -255,7 +255,7 @@ class Client extends DynamiteClient { queryParameters['deviceName'] = deviceName; final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'put', uri, headers, @@ -331,7 +331,7 @@ class Client extends DynamiteClient { path = path.replaceAll('{deviceId}', Uri.encodeQueryComponent(deviceId)); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'get', uri, headers, @@ -405,7 +405,7 @@ class Client extends DynamiteClient { path = path.replaceAll('{deviceId}', Uri.encodeQueryComponent(deviceId)); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'delete', uri, headers, @@ -493,7 +493,7 @@ class Client extends DynamiteClient { queryParameters['appName'] = appName; final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'put', uri, headers, @@ -565,7 +565,7 @@ class Client extends DynamiteClient { path = path.replaceAll('{token}', Uri.encodeQueryComponent(token)); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'delete', uri, headers, @@ -641,7 +641,7 @@ class Client extends DynamiteClient { path = path.replaceAll('{token}', Uri.encodeQueryComponent(token)); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'get', uri, headers, @@ -713,7 +713,7 @@ class Client extends DynamiteClient { path = path.replaceAll('{token}', Uri.encodeQueryComponent(token)); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'post', uri, headers, @@ -782,7 +782,7 @@ class Client extends DynamiteClient { // coverage:ignore-end final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'get', uri, headers, @@ -851,7 +851,7 @@ class Client extends DynamiteClient { // coverage:ignore-end final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: doRequest( + response: executeRequest( 'post', uri, headers, diff --git a/packages/nextcloud/lib/src/api/user_status.openapi.dart b/packages/nextcloud/lib/src/api/user_status.openapi.dart index ac5138c3..345b4184 100644 --- a/packages/nextcloud/lib/src/api/user_status.openapi.dart +++ b/packages/nextcloud/lib/src/api/user_status.openapi.dart @@ -131,7 +131,7 @@ class HeartbeatClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -219,7 +219,7 @@ class PredefinedStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -323,7 +323,7 @@ class StatusesClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -413,7 +413,7 @@ class StatusesClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -503,7 +503,7 @@ class UserStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -593,7 +593,7 @@ class UserStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -691,7 +691,7 @@ class UserStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -799,7 +799,7 @@ class UserStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -881,7 +881,7 @@ class UserStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, @@ -969,7 +969,7 @@ class UserStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'delete', uri, headers, diff --git a/packages/nextcloud/lib/src/api/weather_status.openapi.dart b/packages/nextcloud/lib/src/api/weather_status.openapi.dart index 7b34f25f..5aefe20b 100644 --- a/packages/nextcloud/lib/src/api/weather_status.openapi.dart +++ b/packages/nextcloud/lib/src/api/weather_status.openapi.dart @@ -118,7 +118,7 @@ class WeatherStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -200,7 +200,7 @@ class WeatherStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -282,7 +282,7 @@ class WeatherStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -388,7 +388,7 @@ class WeatherStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, @@ -472,7 +472,7 @@ class WeatherStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -554,7 +554,7 @@ class WeatherStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'get', uri, headers, @@ -642,7 +642,7 @@ class WeatherStatusClient { headers['OCS-APIRequest'] = oCSAPIRequest.toString(); final uri = Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null); return DynamiteRawResponse( - response: _rootClient.doRequest( + response: _rootClient.executeRequest( 'put', uri, headers, From a61fd04ac8f682f1021688f22948bffc45155e5d Mon Sep 17 00:00:00 2001 From: jld3103 Date: Sun, 15 Oct 2023 14:59:09 +0200 Subject: [PATCH 3/3] refactor(neon): Simplify account handling for API and URL images Signed-off-by: jld3103 --- .../neon/neon/lib/src/widgets/drawer.dart | 2 +- packages/neon/neon/lib/src/widgets/image.dart | 174 ++++++++++++------ .../src/widgets/unified_search_results.dart | 4 +- .../neon/lib/src/widgets/user_avatar.dart | 2 +- .../neon_news/lib/widgets/articles_view.dart | 2 +- .../neon/neon_news/lib/widgets/feed_icon.dart | 2 +- .../neon_notifications/lib/pages/main.dart | 2 +- tool/find-untested-neon-apis.sh | 2 +- 8 files changed, 125 insertions(+), 65 deletions(-) diff --git a/packages/neon/neon/lib/src/widgets/drawer.dart b/packages/neon/neon/lib/src/widgets/drawer.dart index 88c39b14..eb6b6c9a 100644 --- a/packages/neon/neon/lib/src/widgets/drawer.dart +++ b/packages/neon/neon/lib/src/widgets/drawer.dart @@ -154,7 +154,7 @@ class NeonDrawerHeader extends StatelessWidget { ), ), Flexible( - child: NeonCachedImage.url( + child: NeonUrlImage( url: theme.logo, ), ), diff --git a/packages/neon/neon/lib/src/widgets/image.dart b/packages/neon/neon/lib/src/widgets/image.dart index b1ebec7b..74878ed0 100644 --- a/packages/neon/neon/lib/src/widgets/image.dart +++ b/packages/neon/neon/lib/src/widgets/image.dart @@ -33,42 +33,15 @@ typedef ApiImageDownloader = FutureOr> Func /// fetches. /// /// See: -/// * [NeonApiImage] for an image from the [NextcloudClient] +/// * [NeonApiImage] for an image widget from an Nextcloud API endpoint. +/// * [NeonUrlImage] for an image widget from an arbitrary URL. /// * [NeonImageWrapper] for a wrapping widget for images class NeonCachedImage extends StatefulWidget { - /// Prints the data from [image] to the canvas. - /// - /// The data is not persisted in the cache. - NeonCachedImage({ - required final Uint8List image, - required Key super.key, - this.isSvgHint = false, - this.size, - this.fit, - this.svgColorFilter, - this.errorBuilder, - }) : image = Future.value(image); - - /// Fetches the image from [url]. - /// - /// The image is automatically cached. - NeonCachedImage.url({ - required final String url, - final Account? account, - final Key? key, - this.isSvgHint = false, - this.size, - this.fit, - this.svgColorFilter, - this.errorBuilder, - }) : image = _getImageFromUrl(url, account), - super(key: key ?? Key(url)); - /// Custom image implementation. /// /// It is possible to provide custom [reviver] and [writeCache] functions to /// adjust the caching. - NeonCachedImage.custom({ + NeonCachedImage({ required final ImageDownloader getImage, required final String cacheKey, final CacheReviver? reviver, @@ -116,20 +89,6 @@ class NeonCachedImage extends StatefulWidget { /// {@endtemplate} final ErrorWidgetBuilder? errorBuilder; - static Future _getImageFromUrl(final String url, final Account? account) async { - var uri = Uri.parse(url); - if (account != null) { - uri = account.completeUri(uri); - } - final file = await _cacheManager.getSingleFile( - uri.toString(), - headers: account != null && uri.host == account.serverURL.host && account.client.authentications.isNotEmpty - ? account.client.authentications.first.headers - : null, - ); - return file.readAsBytes(); - } - static Future _customImageGetter( final CacheReviver? checkCache, final ImageDownloader getImage, @@ -232,18 +191,16 @@ class _NeonCachedImageState extends State { ); } -/// Nextcloud API image. -/// -/// Extension for [NeonCachedImage] providing a [NextcloudClient] to the caller -/// to retrieve the image. +/// A widget painting an Image fetched from the Nextcloud API. /// /// See: /// * [NeonCachedImage] for a customized image +/// * [NeonUrlImage] for an image widget from an arbitrary URL. /// * [NeonImageWrapper] for a wrapping widget for images class NeonApiImage extends StatelessWidget { - /// Creates a new Neon API image with the active account. + /// Creates a new Neon API image fetching the image with the currently active account. /// - /// Use [NeonApiImage.custom] to specify fetching the image with a different account. + /// See [NeonApiImage.withAccount] to fetch the image using a specific account. const NeonApiImage({ required this.getImage, required this.cacheKey, @@ -257,10 +214,10 @@ class NeonApiImage extends StatelessWidget { super.key, }) : account = null; - /// Creates a new Neon API image for a given account. + /// Creates a new Neon API image fetching the image with the given [account]. /// - /// Use [NeonApiImage] to fetch the image with the currently active account. - const NeonApiImage.custom({ + /// See [NeonApiImage] to fetch the image using the currently active account. + const NeonApiImage.withAccount({ required this.getImage, required this.cacheKey, required Account this.account, @@ -274,10 +231,9 @@ class NeonApiImage extends StatelessWidget { super.key, }); - /// Optional account to use for the request. + /// The account to use for the request. /// /// Defaults to the currently active account in [AccountsBloc.activeAccount]. - /// Use the [NeonApiImage.custom] constructor to specify a different account. final Account? account; /// Image downloader. @@ -311,7 +267,7 @@ class NeonApiImage extends StatelessWidget { Widget build(final BuildContext context) { final account = this.account ?? NeonProvider.of(context).activeAccount.value!; - return NeonCachedImage.custom( + return NeonCachedImage( getImage: () async { final response = await getImage(account.client); return response.body; @@ -328,13 +284,117 @@ class NeonApiImage extends StatelessWidget { } } +/// A widget painting an Image fetched from an arbitrary URL. +/// +/// See: +/// * [NeonCachedImage] for a customized image +/// * [NeonApiImage] for an image widget from an Nextcloud API endpoint. +/// * [NeonImageWrapper] for a wrapping widget for images +class NeonUrlImage extends StatelessWidget { + /// Creates a new Neon URL image with the active account. + /// + /// See [NeonUrlImage.withAccount] for using a specific account. + const NeonUrlImage({ + required this.url, + this.reviver, + this.writeCache, + this.isSvgHint = false, + this.size, + this.fit, + this.svgColorFilter, + this.errorBuilder, + super.key, + }) : account = null; + + /// Creates a new Neon URL image with the given [account]. + /// + /// See [NeonUrlImage] for using the active account. + const NeonUrlImage.withAccount({ + required this.url, + required Account this.account, + this.reviver, + this.writeCache, + this.isSvgHint = false, + this.size, + this.fit, + this.svgColorFilter, + this.errorBuilder, + super.key, + }); + + /// The account to use for the request. + /// + /// Defaults to the currently active account in [AccountsBloc.activeAccount]. + final Account? account; + + /// Image url. + final String url; + + /// Custom cache reviver function. + final CacheReviver? reviver; + + /// Custom cache writer function. + final CacheWriter? writeCache; + + /// {@macro NeonCachedImage.svgHint} + final bool isSvgHint; + + /// {@macro NeonCachedImage.size} + final Size? size; + + /// {@macro NeonCachedImage.fit} + final BoxFit? fit; + + /// {@macro NeonCachedImage.svgColorFilter} + final ColorFilter? svgColorFilter; + + /// {@macro NeonCachedImage.errorBuilder} + final ErrorWidgetBuilder? errorBuilder; + + @override + Widget build(final BuildContext context) { + final account = this.account ?? NeonProvider.of(context).activeAccount.value!; + + return NeonCachedImage( + getImage: () async { + final uri = account.completeUri(Uri.parse(url)); + final headers = {}; + + // Only send the authentication headers when sending the request to the server of the account + if (uri.toString().startsWith(account.serverURL.toString()) && account.client.authentications.isNotEmpty) { + headers.addAll(account.client.authentications.first.headers); + } + + final response = await account.client.executeRawRequest( + 'GET', + uri, + headers, + null, + const {200}, + ); + + return response.bytes; + }, + cacheKey: '${account.id}-$url', + reviver: reviver, + writeCache: writeCache, + isSvgHint: isSvgHint, + size: size, + fit: fit, + svgColorFilter: svgColorFilter, + errorBuilder: errorBuilder, + ); + } +} + /// Nextcloud image wrapper widget. /// /// Wraps a child (most commonly an image) into a uniformly styled container. /// /// See: /// * [NeonCachedImage] for a customized image -/// * [NeonApiImage] for an image widget from a [NextcloudClient]. +/// * [NeonApiImage] for an image widget from an Nextcloud API endpoint. +/// * [NeonUrlImage] for an image widget from an arbitrary URL. class NeonImageWrapper extends StatelessWidget { /// Creates a new image wrapper. const NeonImageWrapper({ diff --git a/packages/neon/neon/lib/src/widgets/unified_search_results.dart b/packages/neon/neon/lib/src/widgets/unified_search_results.dart index d6e193c5..166f3c2e 100644 --- a/packages/neon/neon/lib/src/widgets/unified_search_results.dart +++ b/packages/neon/neon/lib/src/widgets/unified_search_results.dart @@ -110,7 +110,7 @@ class NeonUnifiedSearchResults extends StatelessWidget { Widget _buildThumbnail(final BuildContext context, final Account account, final core.UnifiedSearchResultEntry entry) { if (entry.thumbnailUrl.isNotEmpty) { - return NeonCachedImage.url( + return NeonUrlImage.withAccount( size: const Size.square(largeIconSize), url: entry.thumbnailUrl, account: account, @@ -128,7 +128,7 @@ class NeonUnifiedSearchResults extends StatelessWidget { final core.UnifiedSearchResultEntry entry, ) { if (entry.icon.startsWith('/')) { - return NeonCachedImage.url( + return NeonUrlImage.withAccount( size: Size.square(IconTheme.of(context).size!), url: entry.icon, account: account, diff --git a/packages/neon/neon/lib/src/widgets/user_avatar.dart b/packages/neon/neon/lib/src/widgets/user_avatar.dart index ca320b4f..c9877480 100644 --- a/packages/neon/neon/lib/src/widgets/user_avatar.dart +++ b/packages/neon/neon/lib/src/widgets/user_avatar.dart @@ -59,7 +59,7 @@ class _UserAvatarState extends State { radius: size / 2, backgroundColor: widget.backgroundColor, child: ClipOval( - child: NeonApiImage.custom( + child: NeonApiImage.withAccount( account: widget.account, cacheKey: 'avatar-${widget.username}-$brightness$pixelSize', getImage: (final client) async => switch (brightness) { diff --git a/packages/neon/neon_news/lib/widgets/articles_view.dart b/packages/neon/neon_news/lib/widgets/articles_view.dart index 358eac44..2132dc2b 100644 --- a/packages/neon/neon_news/lib/widgets/articles_view.dart +++ b/packages/neon/neon_news/lib/widgets/articles_view.dart @@ -117,7 +117,7 @@ class _NewsArticlesViewState extends State { ), ), if (article.mediaThumbnail != null) ...[ - NeonCachedImage.url( + NeonUrlImage( url: article.mediaThumbnail!, size: const Size(100, 50), fit: BoxFit.cover, diff --git a/packages/neon/neon_news/lib/widgets/feed_icon.dart b/packages/neon/neon_news/lib/widgets/feed_icon.dart index 7c6d120f..c325cccc 100644 --- a/packages/neon/neon_news/lib/widgets/feed_icon.dart +++ b/packages/neon/neon_news/lib/widgets/feed_icon.dart @@ -20,7 +20,7 @@ class NewsFeedIcon extends StatelessWidget { size: Size.square(size), borderRadius: borderRadius, child: faviconLink != null && faviconLink.isNotEmpty - ? NeonCachedImage.url( + ? NeonUrlImage( url: faviconLink, size: Size.square(size), ) diff --git a/packages/neon/neon_notifications/lib/pages/main.dart b/packages/neon/neon_notifications/lib/pages/main.dart index 2e54945d..21c6ee5f 100644 --- a/packages/neon/neon_notifications/lib/pages/main.dart +++ b/packages/neon/neon_notifications/lib/pages/main.dart @@ -81,7 +81,7 @@ class _NotificationsMainPageState extends State { ) : SizedBox.fromSize( size: const Size.square(largeIconSize), - child: NeonCachedImage.url( + child: NeonUrlImage( url: notification.icon!, size: const Size.square(largeIconSize), svgColorFilter: ColorFilter.mode(Theme.of(context).colorScheme.primary, BlendMode.srcIn), diff --git a/tool/find-untested-neon-apis.sh b/tool/find-untested-neon-apis.sh index 57dfbfb1..cecb299c 100755 --- a/tool/find-untested-neon-apis.sh +++ b/tool/find-untested-neon-apis.sh @@ -4,7 +4,7 @@ cd "$(dirname "$0")/.." function find_apis() { path="$1" - grep -r "$path" --include "*\.dart" -e "client\.[^.]*.[^(]*(" -oh | sed "s/^client\.//" | sed "s/($//" | sed "s/Raw$//" | sort | uniq + grep -r "$path" --include "*\.dart" -e "client\.[^.]*.[^(]*(" -oh | sed "s/^client\.//" | sed "s/($//" | sed "s/Raw$//" | grep -v "^executeRawRequest" | sort | uniq } used_apis=("$(find_apis "packages/neon")")