From 119c1c220a315c848abeb68e2d2a622e1b9b0ad8 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Fri, 22 Dec 2023 00:08:05 +0100 Subject: [PATCH] feat(dynamite): generate library for every spec Signed-off-by: Nikolas Rimikis --- .../dynamite/lib/src/builder/serializer.dart | 55 ++++++++++++++----- .../lib/src/helpers/dart_helpers.dart | 4 ++ .../dynamite/lib/src/openapi_builder.dart | 51 +++++++++++++---- packages/dynamite/dynamite/pubspec.yaml | 1 + .../lib/all_of.openapi.dart | 11 ++-- .../lib/any_of.openapi.dart | 17 ++---- .../lib/enum.openapi.dart | 11 ++-- .../lib/headers.openapi.dart | 12 ++-- .../lib/interfaces.openapi.dart | 11 ++-- .../lib/nested_ofs.openapi.dart | 16 ++---- .../lib/one_of.openapi.dart | 17 ++---- .../lib/parameters.openapi.dart | 16 ++---- .../lib/pattern_check.openapi.dart | 11 ++-- .../lib/request_body.openapi.dart | 10 ++-- .../lib/responses.openapi.dart | 9 +-- .../lib/some_of.openapi.dart | 14 ++--- .../lib/type_defs.openapi.dart | 16 ++---- .../lib/types.openapi.dart | 17 ++---- .../lib/petstore.openapi.dart | 10 ++-- .../lib/src/api/comments.openapi.dart | 10 ++-- .../nextcloud/lib/src/api/core.openapi.dart | 18 ++---- .../lib/src/api/dashboard.openapi.dart | 10 ++-- .../nextcloud/lib/src/api/dav.openapi.dart | 10 ++-- .../nextcloud/lib/src/api/files.openapi.dart | 11 ++-- .../lib/src/api/files_external.openapi.dart | 10 ++-- .../lib/src/api/files_reminders.openapi.dart | 10 ++-- .../lib/src/api/files_sharing.openapi.dart | 13 ++--- .../lib/src/api/files_trashbin.openapi.dart | 11 ++-- .../lib/src/api/files_versions.openapi.dart | 11 ++-- .../nextcloud/lib/src/api/news.openapi.dart | 10 ++-- .../nextcloud/lib/src/api/notes.openapi.dart | 11 ++-- .../lib/src/api/notifications.openapi.dart | 10 ++-- .../lib/src/api/provisioning_api.openapi.dart | 16 ++---- .../lib/src/api/settings.openapi.dart | 11 ++-- .../lib/src/api/sharebymail.openapi.dart | 11 ++-- .../nextcloud/lib/src/api/spreed.openapi.dart | 16 ++---- .../lib/src/api/theming.openapi.dart | 11 ++-- .../src/api/updatenotification.openapi.dart | 10 ++-- .../nextcloud/lib/src/api/uppush.openapi.dart | 10 ++-- .../lib/src/api/user_status.openapi.dart | 12 ++-- .../lib/src/api/weather_status.openapi.dart | 10 ++-- 41 files changed, 257 insertions(+), 304 deletions(-) diff --git a/packages/dynamite/dynamite/lib/src/builder/serializer.dart b/packages/dynamite/dynamite/lib/src/builder/serializer.dart index 825c87e245f..6b7bcf847f0 100644 --- a/packages/dynamite/dynamite/lib/src/builder/serializer.dart +++ b/packages/dynamite/dynamite/lib/src/builder/serializer.dart @@ -2,19 +2,44 @@ import 'package:code_builder/code_builder.dart'; import 'package:dynamite/src/builder/state.dart'; List buildSerializer(final State state) => [ - const Code('// coverage:ignore-start'), - const Code('@visibleForTesting'), - const Code('final Serializers serializers = (Serializers().toBuilder()'), - ...state.resolvedTypes - .map((final type) => type.serializers) - .expand((final element) => element) - .toSet() - .map(Code.new), - const Code(').build();'), - const Code(''), - const Code('@visibleForTesting'), - const Code( - 'final Serializers jsonSerializers = (serializers.toBuilder()..add(DynamiteDoubleSerializer())..addPlugin(StandardJsonPlugin())..addPlugin(const HeaderPlugin())..addPlugin(const ContentStringPlugin())).build();', - ), - const Code('// coverage:ignore-end'), + const Code('// coverage:ignore-start\n'), + Field((final b) { + b + ..annotations.add(refer('visibleForTesting')) + ..modifier = FieldModifier.final$ + ..type = refer('Serializers') + ..name = 'serializers'; + + final serializers = + state.resolvedTypes.map((final type) => type.serializers).expand((final element) => element).toSet(); + + final bodyBuilder = StringBuffer() + ..writeln('(Serializers().toBuilder()') + ..writeAll(serializers, '\n') + ..writeln(').build()'); + + b.assignment = Code(bodyBuilder.toString()); + }), + Field((final b) { + b + ..annotations.add(refer('visibleForTesting')) + ..modifier = FieldModifier.final$ + ..type = refer('Serializers') + ..name = 'jsonSerializers'; + + const serializers = [ + '..add(DynamiteDoubleSerializer())', + '..addPlugin(StandardJsonPlugin())', + '..addPlugin(const HeaderPlugin())', + '..addPlugin(const ContentStringPlugin())', + ]; + + final bodyBuilder = StringBuffer() + ..writeln('(serializers.toBuilder()') + ..writeAll(serializers, '\n') + ..writeln(').build()'); + + b.assignment = Code(bodyBuilder.toString()); + }), + const Code('// coverage:ignore-end\n'), ]; diff --git a/packages/dynamite/dynamite/lib/src/helpers/dart_helpers.dart b/packages/dynamite/dynamite/lib/src/helpers/dart_helpers.dart index 9915777bcb7..48bf0a87ded 100644 --- a/packages/dynamite/dynamite/lib/src/helpers/dart_helpers.dart +++ b/packages/dynamite/dynamite/lib/src/helpers/dart_helpers.dart @@ -1,3 +1,5 @@ +import 'package:source_helper/source_helper.dart'; + String toDartName( final String name, { final bool uppercaseFirstCharacter = false, @@ -22,6 +24,8 @@ String toDartName( return result; } +String toLibraryName(final String name) => toDartName(name).snake; + /// Helper methods to work with strings. extension StringUtils on String { /// Capitalizes this string. diff --git a/packages/dynamite/dynamite/lib/src/openapi_builder.dart b/packages/dynamite/dynamite/lib/src/openapi_builder.dart index b72ff267e56..db0a36dd8a6 100644 --- a/packages/dynamite/dynamite/lib/src/openapi_builder.dart +++ b/packages/dynamite/dynamite/lib/src/openapi_builder.dart @@ -2,19 +2,19 @@ import 'dart:async'; import 'dart:convert'; import 'package:build/build.dart'; -import 'package:built_collection/built_collection.dart'; import 'package:checked_yaml/checked_yaml.dart'; import 'package:code_builder/code_builder.dart'; import 'package:dart_style/dart_style.dart'; import 'package:dynamite/src/builder/client.dart'; import 'package:dynamite/src/builder/generate_ofs.dart'; import 'package:dynamite/src/builder/generate_schemas.dart'; -import 'package:dynamite/src/builder/imports.dart'; import 'package:dynamite/src/builder/serializer.dart'; import 'package:dynamite/src/builder/state.dart'; +import 'package:dynamite/src/helpers/dart_helpers.dart'; import 'package:dynamite/src/helpers/version_checker.dart'; import 'package:dynamite/src/models/config.dart'; import 'package:dynamite/src/models/openapi.dart' as openapi; +import 'package:path/path.dart' as p; import 'package:version/version.dart'; class OpenAPIBuilder implements Builder { @@ -78,16 +78,45 @@ class OpenAPIBuilder implements Builder { final state = State(buildConfig); - // Imports need to be generated after everything else so we know if we need the local part directive, - // but they need to be added to the beginning of the output. - final output = ListBuilder() - ..addAll(generateClients(spec, state)) - ..addAll(generateSchemas(spec, state)) - ..addAll(buildOfsExtensions(spec, state)) - ..addAll(buildSerializer(state)) - ..insertAll(0, generateImports(outputId, state)); + final output = Library((final b) { + final analyzerIgnores = state.buildConfig.analyzerIgnores; + if (analyzerIgnores != null) { + b.ignoreForFile.addAll(analyzerIgnores); + } + + b + ..name = toLibraryName(p.basenameWithoutExtension(inputId.path)) + ..directives.addAll([ + Directive.import('dart:convert'), + Directive.import('dart:typed_data'), + Directive.import('package:built_collection/built_collection.dart'), + Directive.import('package:built_value/built_value.dart'), + Directive.import('package:built_value/json_object.dart'), + Directive.import('package:built_value/serializer.dart'), + Directive.import('package:built_value/standard_json_plugin.dart'), + Directive.import('package:collection/collection.dart'), + Directive.import('package:dynamite_runtime/built_value.dart'), + Directive.import('package:dynamite_runtime/http_client.dart'), + Directive.import('package:dynamite_runtime/models.dart'), + Directive.import('package:dynamite_runtime/utils.dart', as: 'dynamite_utils'), + Directive.import('package:meta/meta.dart'), + Directive.import('package:universal_io/io.dart'), + Directive.import('package:uri/uri.dart'), + ]) + ..body.addAll(generateClients(spec, state)) + ..body.addAll(generateSchemas(spec, state)) + ..body.addAll(buildOfsExtensions(spec, state)) + ..body.addAll(buildSerializer(state)); + + // Part directive need to be generated after everything else so we know if we need it. + if (state.hasResolvedBuiltTypes) { + b.directives.add( + Directive.part(p.basename(outputId.changeExtension('.g.dart').path)), + ); + } + }); - var outputString = output.build().map((final e) => e.accept(emitter)).join('\n'); + var outputString = output.accept(emitter).toString(); final coverageIgnores = state.buildConfig.coverageIgnores; if (coverageIgnores != null) { diff --git a/packages/dynamite/dynamite/pubspec.yaml b/packages/dynamite/dynamite/pubspec.yaml index 034deb47465..5ef04c13e00 100644 --- a/packages/dynamite/dynamite/pubspec.yaml +++ b/packages/dynamite/dynamite/pubspec.yaml @@ -17,6 +17,7 @@ dependencies: path: ^1.0.0 pub_semver: ^2.1.0 pubspec_parse: ^1.2.0 + source_helper: ^1.3.0 uri: ^1.0.0 version: ^3.0.0 diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/all_of.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/all_of.openapi.dart index 8ddd2b999ea..e0f3e61ba4c 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/all_of.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/all_of.openapi.dart @@ -1,9 +1,9 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: unused_element +// ignore_for_file: camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case +// ignore_for_file: unused_element + +library all_of_openapi; import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; @@ -137,7 +137,6 @@ final Serializers serializers = (Serializers().toBuilder() ..addBuilderFactory(const FullType(OneValueAllOf), OneValueAllOfBuilder.new) ..add(OneValueAllOf.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/dynamite/dynamite_end_to_end_test/lib/any_of.openapi.dart b/packages/dynamite/dynamite_end_to_end_test/lib/any_of.openapi.dart index 8880569ad6b..cb823ebde7e 100644 --- a/packages/dynamite/dynamite_end_to_end_test/lib/any_of.openapi.dart +++ b/packages/dynamite/dynamite_end_to_end_test/lib/any_of.openapi.dart @@ -1,9 +1,9 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: unused_element +// ignore_for_file: camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case +// ignore_for_file: unused_element + +library any_of_openapi; import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; @@ -15,11 +15,8 @@ import 'package:meta/meta.dart'; part 'any_of.openapi.g.dart'; typedef OneObjectAnyOf = OneObjectAnyOf0; - typedef OneValueAnyOf = String; - typedef AnyOfIntDouble = num; - typedef AnyOfIntDoubleNum = num; @BuiltValue(instantiable: false) @@ -95,11 +92,8 @@ abstract class OneObjectAnyOf0 implements $OneObjectAnyOf0Interface, Built.new) ..addBuilderFactory(const FullType(BuiltList, [FullType(String)]), ListBuilder.new)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/dynamite/dynamite_petstore_example/lib/petstore.openapi.dart b/packages/dynamite/dynamite_petstore_example/lib/petstore.openapi.dart index d74333b9e7b..281a184b707 100644 --- a/packages/dynamite/dynamite_petstore_example/lib/petstore.openapi.dart +++ b/packages/dynamite/dynamite_petstore_example/lib/petstore.openapi.dart @@ -1,8 +1,9 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case +// ignore_for_file: camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library petstore_openapi; + import 'dart:convert'; import 'dart:typed_data'; @@ -386,7 +387,6 @@ final Serializers serializers = (Serializers().toBuilder() ..addBuilderFactory(const FullType(Error), ErrorBuilder.new) ..add(Error.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/comments.openapi.dart b/packages/nextcloud/lib/src/api/comments.openapi.dart index a5daf22a646..300a3dbc7ab 100644 --- a/packages/nextcloud/lib/src/api/comments.openapi.dart +++ b/packages/nextcloud/lib/src/api/comments.openapi.dart @@ -1,9 +1,8 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library comments_openapi; import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; @@ -68,7 +67,6 @@ final Serializers serializers = (Serializers().toBuilder() ..addBuilderFactory(const FullType(Capabilities_Files), Capabilities_FilesBuilder.new) ..add(Capabilities_Files.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/core.openapi.dart b/packages/nextcloud/lib/src/api/core.openapi.dart index 0350fd102e4..9ceabc6c3fd 100644 --- a/packages/nextcloud/lib/src/api/core.openapi.dart +++ b/packages/nextcloud/lib/src/api/core.openapi.dart @@ -1,9 +1,9 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library core_openapi; + import 'dart:typed_data'; import 'package:built_collection/built_collection.dart'; @@ -10758,19 +10758,15 @@ abstract class WipeCheckWipeResponseApplicationJson } typedef AutocompleteResult_Status = ({AutocompleteResult_Status0? autocompleteResultStatus0, String? string}); - typedef NavigationEntry_Order = ({int? $int, String? string}); - typedef SharebymailCapabilities = ({ BuiltList? builtListNever, SharebymailCapabilities0? sharebymailCapabilities0 }); - typedef SpreedPublicCapabilities = ({ BuiltList? builtListNever, SpreedPublicCapabilities0? spreedPublicCapabilities0 }); - typedef OcsGetCapabilitiesResponseApplicationJson_Ocs_Data_Capabilities = ({ CommentsCapabilities? commentsCapabilities, DavCapabilities? davCapabilities, @@ -10787,11 +10783,8 @@ typedef OcsGetCapabilitiesResponseApplicationJson_Ocs_Data_Capabilities = ({ UserStatusCapabilities? userStatusCapabilities, WeatherStatusCapabilities? weatherStatusCapabilities }); - typedef UnifiedSearchSearchCursor = ({int? $int, String? string}); - typedef UnifiedSearchResult_Cursor = ({int? $int, String? string}); - typedef $AutocompleteResultStatus0String = ({AutocompleteResult_Status0? autocompleteResultStatus0, String? string}); extension $AutocompleteResultStatus0StringExtension on $AutocompleteResultStatus0String { @@ -12111,7 +12104,6 @@ final Serializers serializers = (Serializers().toBuilder() ) ..add(WipeCheckWipeResponseApplicationJson.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/dashboard.openapi.dart b/packages/nextcloud/lib/src/api/dashboard.openapi.dart index ce142ec0243..c4839bbc8fd 100644 --- a/packages/nextcloud/lib/src/api/dashboard.openapi.dart +++ b/packages/nextcloud/lib/src/api/dashboard.openapi.dart @@ -1,9 +1,8 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library dashboard_openapi; import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; @@ -767,7 +766,6 @@ final Serializers serializers = (Serializers().toBuilder() MapBuilder.new, )) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/dav.openapi.dart b/packages/nextcloud/lib/src/api/dav.openapi.dart index c0a26f5fae2..dc660ab8478 100644 --- a/packages/nextcloud/lib/src/api/dav.openapi.dart +++ b/packages/nextcloud/lib/src/api/dav.openapi.dart @@ -1,9 +1,8 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library dav_openapi; import 'package:built_value/built_value.dart'; import 'package:built_value/json_object.dart'; @@ -1143,7 +1142,6 @@ final Serializers serializers = (Serializers().toBuilder() ..addBuilderFactory(const FullType(Capabilities_Dav), Capabilities_DavBuilder.new) ..add(Capabilities_Dav.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/files.openapi.dart b/packages/nextcloud/lib/src/api/files.openapi.dart index 14c6285388d..0fd1dd81a0f 100644 --- a/packages/nextcloud/lib/src/api/files.openapi.dart +++ b/packages/nextcloud/lib/src/api/files.openapi.dart @@ -1,9 +1,9 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library files_openapi; + import 'dart:typed_data'; import 'package:built_collection/built_collection.dart'; @@ -2863,7 +2863,6 @@ final Serializers serializers = (Serializers().toBuilder() ..addBuilderFactory(const FullType(Template), TemplateBuilder.new) ..add(Template.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/files_external.openapi.dart b/packages/nextcloud/lib/src/api/files_external.openapi.dart index ec87dc3417c..384ccf9867e 100644 --- a/packages/nextcloud/lib/src/api/files_external.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_external.openapi.dart @@ -1,9 +1,8 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library files_external_openapi; import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; @@ -469,7 +468,6 @@ final Serializers serializers = (Serializers().toBuilder() ..add(StorageConfig_Type.serializer) ..addBuilderFactory(const FullType(BuiltList, [FullType(Mount)]), ListBuilder.new)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/files_reminders.openapi.dart b/packages/nextcloud/lib/src/api/files_reminders.openapi.dart index d69d300b01d..44ffcc585c1 100644 --- a/packages/nextcloud/lib/src/api/files_reminders.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_reminders.openapi.dart @@ -1,9 +1,8 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library files_reminders_openapi; import 'package:built_value/built_value.dart'; import 'package:built_value/json_object.dart'; @@ -630,7 +629,6 @@ final Serializers serializers = (Serializers().toBuilder() ) ..add(ApiRemoveResponseApplicationJson_Ocs.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/files_sharing.openapi.dart b/packages/nextcloud/lib/src/api/files_sharing.openapi.dart index 87a2ce10b2f..a1823b7dc47 100644 --- a/packages/nextcloud/lib/src/api/files_sharing.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_sharing.openapi.dart @@ -1,9 +1,9 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library files_sharing_openapi; + import 'dart:typed_data'; import 'package:built_collection/built_collection.dart'; @@ -4922,9 +4922,7 @@ abstract class Capabilities implements $CapabilitiesInterface, Built? builtListInt, int? $int}); - typedef ShareesapiFindRecommendedShareType = ({BuiltList? builtListInt, int? $int}); - typedef $BuiltListInt = ({BuiltList? builtListInt, int? $int}); extension $BuiltListIntExtension on $BuiltListInt { @@ -5304,7 +5302,6 @@ final Serializers serializers = (Serializers().toBuilder() ..addBuilderFactory(const FullType(Capabilities_FilesSharing_Sharee), Capabilities_FilesSharing_ShareeBuilder.new) ..add(Capabilities_FilesSharing_Sharee.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart b/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart index dad7a17783d..1dcb600b981 100644 --- a/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart @@ -1,9 +1,9 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library files_trashbin_openapi; + import 'dart:typed_data'; import 'package:built_value/built_value.dart'; @@ -215,7 +215,6 @@ final Serializers serializers = (Serializers().toBuilder() ..addBuilderFactory(const FullType(Capabilities_Files), Capabilities_FilesBuilder.new) ..add(Capabilities_Files.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/files_versions.openapi.dart b/packages/nextcloud/lib/src/api/files_versions.openapi.dart index 620df2ea591..3707f744896 100644 --- a/packages/nextcloud/lib/src/api/files_versions.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_versions.openapi.dart @@ -1,9 +1,9 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library files_versions_openapi; + import 'dart:typed_data'; import 'package:built_value/built_value.dart'; @@ -219,7 +219,6 @@ final Serializers serializers = (Serializers().toBuilder() ..addBuilderFactory(const FullType(Capabilities_Files), Capabilities_FilesBuilder.new) ..add(Capabilities_Files.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/news.openapi.dart b/packages/nextcloud/lib/src/api/news.openapi.dart index d2b60241ff5..f9f5cdad44f 100644 --- a/packages/nextcloud/lib/src/api/news.openapi.dart +++ b/packages/nextcloud/lib/src/api/news.openapi.dart @@ -1,9 +1,8 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library news_openapi; import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; @@ -1720,7 +1719,6 @@ final Serializers serializers = (Serializers().toBuilder() ..add(EmptyOCS_Ocs.serializer) ..addBuilderFactory(const FullType(BuiltList, [FullType(JsonObject)]), ListBuilder.new)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/notes.openapi.dart b/packages/nextcloud/lib/src/api/notes.openapi.dart index 982a37a15f7..8f59b28093b 100644 --- a/packages/nextcloud/lib/src/api/notes.openapi.dart +++ b/packages/nextcloud/lib/src/api/notes.openapi.dart @@ -1,9 +1,9 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library notes_openapi; + import 'dart:convert'; import 'dart:typed_data'; @@ -963,7 +963,6 @@ final Serializers serializers = (Serializers().toBuilder() ..add(EmptyOCS_Ocs.serializer) ..addBuilderFactory(const FullType(BuiltList, [FullType(JsonObject)]), ListBuilder.new)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/notifications.openapi.dart b/packages/nextcloud/lib/src/api/notifications.openapi.dart index 2cd491a3c57..b9ae591ec92 100644 --- a/packages/nextcloud/lib/src/api/notifications.openapi.dart +++ b/packages/nextcloud/lib/src/api/notifications.openapi.dart @@ -1,9 +1,8 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library notifications_openapi; import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; @@ -2688,7 +2687,6 @@ final Serializers serializers = (Serializers().toBuilder() ..add(Capabilities_Notifications.serializer) ..addBuilderFactory(const FullType(BuiltList, [FullType(String)]), ListBuilder.new)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart b/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart index 2a6fcf0b04d..0bd00ca35bf 100644 --- a/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart +++ b/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart @@ -1,9 +1,8 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library provisioning_api_openapi; import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; @@ -8058,26 +8057,20 @@ abstract class Capabilities implements $CapabilitiesInterface, Built? builtListNever, Capabilities0? capabilities0}); - typedef $BuiltListCapabilities0 = ({BuiltList? builtListNever, Capabilities0? capabilities0}); extension $BuiltListCapabilities0Extension on $BuiltListCapabilities0 { @@ -287,7 +285,6 @@ final Serializers serializers = (Serializers().toBuilder() ..addBuilderFactory(const FullType(BuiltList, [FullType(Never)]), ListBuilder.new) ..add($BuiltListCapabilities0Extension.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/spreed.openapi.dart b/packages/nextcloud/lib/src/api/spreed.openapi.dart index c3600c4149d..b886dc9c2c0 100644 --- a/packages/nextcloud/lib/src/api/spreed.openapi.dart +++ b/packages/nextcloud/lib/src/api/spreed.openapi.dart @@ -1,9 +1,9 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library spreed_openapi; + import 'dart:typed_data'; import 'package:built_collection/built_collection.dart'; @@ -33629,21 +33629,16 @@ abstract class PublicCapabilities0 } typedef Room_LastMessage = ({BuiltList? builtListNever, ChatMessage? chatMessage}); - typedef RoomAddParticipantToRoomResponseApplicationJson_Ocs_Data = ({ BuiltList? builtListNever, RoomAddParticipantToRoomResponseApplicationJson_Ocs_Data0? roomAddParticipantToRoomResponseApplicationJsonOcsData0 }); - typedef SettingsSetUserSettingValue = ({int? $int, String? string}); - typedef SignalingPullMessagesResponseApplicationJson_Ocs_Data_Data = ({ BuiltList? builtListSignalingSession, String? string }); - typedef PublicCapabilities = ({BuiltList? builtListNever, PublicCapabilities0? publicCapabilities0}); - typedef $BuiltListChatMessage = ({BuiltList? builtListNever, ChatMessage? chatMessage}); extension $BuiltListChatMessageExtension on $BuiltListChatMessage { @@ -35434,7 +35429,6 @@ final Serializers serializers = (Serializers().toBuilder() ..add(PublicCapabilities0_Spreed_Config_Signaling.serializer) ..add($BuiltListPublicCapabilities0Extension.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/theming.openapi.dart b/packages/nextcloud/lib/src/api/theming.openapi.dart index 2c3cb64bce7..d765d18a670 100644 --- a/packages/nextcloud/lib/src/api/theming.openapi.dart +++ b/packages/nextcloud/lib/src/api/theming.openapi.dart @@ -1,9 +1,9 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library theming_openapi; + import 'dart:typed_data'; import 'package:built_collection/built_collection.dart'; @@ -1423,7 +1423,6 @@ final Serializers serializers = (Serializers().toBuilder() ..addBuilderFactory(const FullType(PublicCapabilities_Theming), PublicCapabilities_ThemingBuilder.new) ..add(PublicCapabilities_Theming.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/updatenotification.openapi.dart b/packages/nextcloud/lib/src/api/updatenotification.openapi.dart index e452643788b..51578336ec1 100644 --- a/packages/nextcloud/lib/src/api/updatenotification.openapi.dart +++ b/packages/nextcloud/lib/src/api/updatenotification.openapi.dart @@ -1,9 +1,8 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library updatenotification_openapi; import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; @@ -372,7 +371,6 @@ final Serializers serializers = (Serializers().toBuilder() ..add(App.serializer) ..addBuilderFactory(const FullType(BuiltList, [FullType(App)]), ListBuilder.new)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/uppush.openapi.dart b/packages/nextcloud/lib/src/api/uppush.openapi.dart index cc1ede5f7b9..adff598d0d1 100644 --- a/packages/nextcloud/lib/src/api/uppush.openapi.dart +++ b/packages/nextcloud/lib/src/api/uppush.openapi.dart @@ -1,9 +1,8 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library uppush_openapi; import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; @@ -1292,7 +1291,6 @@ final Serializers serializers = (Serializers().toBuilder() ..add(GatewayMatrixResponseApplicationJson.serializer) ..addBuilderFactory(const FullType(BuiltList, [FullType(String)]), ListBuilder.new)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/user_status.openapi.dart b/packages/nextcloud/lib/src/api/user_status.openapi.dart index aad8eb98844..0dbed353e70 100644 --- a/packages/nextcloud/lib/src/api/user_status.openapi.dart +++ b/packages/nextcloud/lib/src/api/user_status.openapi.dart @@ -1,9 +1,8 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library user_status_openapi; import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; @@ -1919,9 +1918,7 @@ abstract class Capabilities implements $CapabilitiesInterface, Built? builtListNever, Private? private}); - typedef $ClearAtTimeTypeInt = ({ClearAtTimeType? clearAtTimeType, int? $int}); extension $ClearAtTimeTypeIntExtension on $ClearAtTimeTypeInt { @@ -2163,7 +2160,6 @@ final Serializers serializers = (Serializers().toBuilder() ..addBuilderFactory(const FullType(Capabilities_UserStatus), Capabilities_UserStatusBuilder.new) ..add(Capabilities_UserStatus.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer()) diff --git a/packages/nextcloud/lib/src/api/weather_status.openapi.dart b/packages/nextcloud/lib/src/api/weather_status.openapi.dart index dfa6e11a1a9..82cf5cfae54 100644 --- a/packages/nextcloud/lib/src/api/weather_status.openapi.dart +++ b/packages/nextcloud/lib/src/api/weather_status.openapi.dart @@ -1,9 +1,8 @@ -// ignore_for_file: camel_case_types -// ignore_for_file: discarded_futures -// ignore_for_file: public_member_api_docs -// ignore_for_file: unreachable_switch_case -// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_extensions, camel_case_types, discarded_futures // ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: public_member_api_docs, unreachable_switch_case + +library weather_status_openapi; import 'package:built_collection/built_collection.dart'; import 'package:built_value/built_value.dart'; @@ -1882,7 +1881,6 @@ final Serializers serializers = (Serializers().toBuilder() ..addBuilderFactory(const FullType(Capabilities_WeatherStatus), Capabilities_WeatherStatusBuilder.new) ..add(Capabilities_WeatherStatus.serializer)) .build(); - @visibleForTesting final Serializers jsonSerializers = (serializers.toBuilder() ..add(DynamiteDoubleSerializer())