From 9845aa05afa95595ac2ff4837e1678ab46fafe71 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Thu, 19 Oct 2023 22:09:59 +0200 Subject: [PATCH] fix(dynamite,dynamite_runtime,nextcloud): don't deserialize integers into double Signed-off-by: Nikolas Rimikis --- .../dynamite/lib/src/builder/imports.dart | 3 +- .../dynamite/lib/src/builder/serializer.dart | 2 +- .../dynamite_runtime/lib/built_value.dart | 2 + .../dynamite_runtime/lib/content_string.dart | 1 - .../dynamite_runtime/lib/http_client.dart | 1 - .../dynamite/dynamite_runtime/lib/models.dart | 1 + .../content_string_serializer.dart} | 17 +--- .../src/built_value/double_serializer.dart | 48 ++++++++++ .../lib/src/models/content_string.dart | 17 ++++ .../src/{ => models}/content_string.g.dart | 0 .../dynamite/dynamite_runtime/lib/utils.dart | 1 + .../dynamite/dynamite_runtime/pubspec.yaml | 2 +- .../test/content_string_test.dart | 3 +- .../test/double_serializer_test.dart | 95 +++++++++++++++++++ packages/nextcloud/lib/nextcloud.dart | 2 +- .../lib/src/api/comments.openapi.dart | 3 +- .../nextcloud/lib/src/api/core.openapi.dart | 4 +- .../lib/src/api/dashboard.openapi.dart | 4 +- .../nextcloud/lib/src/api/dav.openapi.dart | 3 +- .../nextcloud/lib/src/api/files.openapi.dart | 3 +- .../lib/src/api/files_external.openapi.dart | 3 +- .../lib/src/api/files_reminders.openapi.dart | 3 +- .../lib/src/api/files_sharing.openapi.dart | 4 +- .../lib/src/api/files_trashbin.openapi.dart | 3 +- .../lib/src/api/files_versions.openapi.dart | 3 +- .../nextcloud/lib/src/api/news.openapi.dart | 3 +- .../nextcloud/lib/src/api/notes.openapi.dart | 3 +- .../lib/src/api/notifications.openapi.dart | 3 +- .../lib/src/api/provisioning_api.openapi.dart | 4 +- .../lib/src/api/settings.openapi.dart | 3 +- .../lib/src/api/sharebymail.openapi.dart | 3 +- .../lib/src/api/theming.openapi.dart | 3 +- .../src/api/updatenotification.openapi.dart | 3 +- .../nextcloud/lib/src/api/uppush.openapi.dart | 3 +- .../lib/src/api/user_status.openapi.dart | 3 +- .../lib/src/api/weather_status.openapi.dart | 3 +- packages/nextcloud/lib/src/webdav/client.dart | 1 + 37 files changed, 219 insertions(+), 44 deletions(-) create mode 100644 packages/dynamite/dynamite_runtime/lib/built_value.dart delete mode 100644 packages/dynamite/dynamite_runtime/lib/content_string.dart create mode 100644 packages/dynamite/dynamite_runtime/lib/models.dart rename packages/dynamite/dynamite_runtime/lib/src/{content_string.dart => built_value/content_string_serializer.dart} (69%) create mode 100644 packages/dynamite/dynamite_runtime/lib/src/built_value/double_serializer.dart create mode 100644 packages/dynamite/dynamite_runtime/lib/src/models/content_string.dart rename packages/dynamite/dynamite_runtime/lib/src/{ => models}/content_string.g.dart (100%) create mode 100644 packages/dynamite/dynamite_runtime/test/double_serializer_test.dart diff --git a/packages/dynamite/dynamite/lib/src/builder/imports.dart b/packages/dynamite/dynamite/lib/src/builder/imports.dart index 3ce1dff0935..c3a37d54049 100644 --- a/packages/dynamite/dynamite/lib/src/builder/imports.dart +++ b/packages/dynamite/dynamite/lib/src/builder/imports.dart @@ -16,8 +16,9 @@ List generateImports(final AssetId outputId) => [ 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/content_string.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'), Directive.import('package:meta/meta.dart'), Directive.import('package:universal_io/io.dart'), diff --git a/packages/dynamite/dynamite/lib/src/builder/serializer.dart b/packages/dynamite/dynamite/lib/src/builder/serializer.dart index 97e8b49ea86..04674180e82 100644 --- a/packages/dynamite/dynamite/lib/src/builder/serializer.dart +++ b/packages/dynamite/dynamite/lib/src/builder/serializer.dart @@ -14,7 +14,7 @@ List buildSerializer(final State state) { const Code(').build();'), const Code(''), const Code( - 'final Serializers _jsonSerializers = (_serializers.toBuilder()..addPlugin(StandardJsonPlugin())..addPlugin(const ContentStringPlugin())).build();', + 'final Serializers _jsonSerializers = (_serializers.toBuilder()..add(DynamiteDoubleSerializer())..addPlugin(StandardJsonPlugin())..addPlugin(const ContentStringPlugin())).build();', ), const Code('// coverage:ignore-end'), ]; diff --git a/packages/dynamite/dynamite_runtime/lib/built_value.dart b/packages/dynamite/dynamite_runtime/lib/built_value.dart new file mode 100644 index 00000000000..2099eba8670 --- /dev/null +++ b/packages/dynamite/dynamite_runtime/lib/built_value.dart @@ -0,0 +1,2 @@ +export 'src/built_value/content_string_serializer.dart'; +export 'src/built_value/double_serializer.dart'; diff --git a/packages/dynamite/dynamite_runtime/lib/content_string.dart b/packages/dynamite/dynamite_runtime/lib/content_string.dart deleted file mode 100644 index 2a35d3d8125..00000000000 --- a/packages/dynamite/dynamite_runtime/lib/content_string.dart +++ /dev/null @@ -1 +0,0 @@ -export 'src/content_string.dart'; diff --git a/packages/dynamite/dynamite_runtime/lib/http_client.dart b/packages/dynamite/dynamite_runtime/lib/http_client.dart index 13962b5de81..5d373aaa1b5 100644 --- a/packages/dynamite/dynamite_runtime/lib/http_client.dart +++ b/packages/dynamite/dynamite_runtime/lib/http_client.dart @@ -1,3 +1,2 @@ export 'package:cookie_jar/cookie_jar.dart'; export 'src/dynamite_client.dart'; -export 'src/http_extensions.dart'; diff --git a/packages/dynamite/dynamite_runtime/lib/models.dart b/packages/dynamite/dynamite_runtime/lib/models.dart new file mode 100644 index 00000000000..7513560dec5 --- /dev/null +++ b/packages/dynamite/dynamite_runtime/lib/models.dart @@ -0,0 +1 @@ +export 'src/models/content_string.dart'; diff --git a/packages/dynamite/dynamite_runtime/lib/src/content_string.dart b/packages/dynamite/dynamite_runtime/lib/src/built_value/content_string_serializer.dart similarity index 69% rename from packages/dynamite/dynamite_runtime/lib/src/content_string.dart rename to packages/dynamite/dynamite_runtime/lib/src/built_value/content_string_serializer.dart index 9f75d638731..801d19b94c4 100644 --- a/packages/dynamite/dynamite_runtime/lib/src/content_string.dart +++ b/packages/dynamite/dynamite_runtime/lib/src/built_value/content_string_serializer.dart @@ -1,22 +1,7 @@ import 'dart:convert'; -import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; - -part 'content_string.g.dart'; - -/// Json data encoded in a `String` as defined by [json-schema](https://json-schema.org/understanding-json-schema/reference/non_json_data.html#contentschema). -abstract class ContentString implements Built, ContentStringBuilder> { - /// Creates a new content `String`. - factory ContentString([final void Function(ContentStringBuilder)? b]) = _$ContentString; - const ContentString._(); - - /// The decoded value of the content `String`. - T get content; - - /// The serializer for a content `String`. - static Serializer> get serializer => _$contentStringSerializer; -} +import 'package:dynamite_runtime/src/models/content_string.dart'; /// Serialization plugin for decoding [ContentString]s. /// diff --git a/packages/dynamite/dynamite_runtime/lib/src/built_value/double_serializer.dart b/packages/dynamite/dynamite_runtime/lib/src/built_value/double_serializer.dart new file mode 100644 index 00000000000..19e55ecd385 --- /dev/null +++ b/packages/dynamite/dynamite_runtime/lib/src/built_value/double_serializer.dart @@ -0,0 +1,48 @@ +import 'package:built_collection/built_collection.dart'; +import 'package:built_value/serializer.dart'; + +/// A built_value serializer for `double` values that does not accept integers. +class DynamiteDoubleSerializer implements PrimitiveSerializer { + // Constant names match those in [double]. + static const String _nan = 'NaN'; + static const String _infinity = 'INF'; + static const String _negativeInfinity = '-INF'; + + @override + final Iterable types = BuiltList([double]); + + @override + final String wireName = 'double'; + + @override + Object serialize( + final Serializers serializers, + final double aDouble, { + final FullType specifiedType = FullType.unspecified, + }) { + if (aDouble.isNaN) { + return _nan; + } else if (aDouble.isInfinite) { + return aDouble.isNegative ? _negativeInfinity : _infinity; + } else { + return aDouble; + } + } + + @override + double deserialize( + final Serializers serializers, + final Object serialized, { + final FullType specifiedType = FullType.unspecified, + }) { + if (serialized == _nan) { + return double.nan; + } else if (serialized == _negativeInfinity) { + return double.negativeInfinity; + } else if (serialized == _infinity) { + return double.infinity; + } else { + return serialized as double; + } + } +} diff --git a/packages/dynamite/dynamite_runtime/lib/src/models/content_string.dart b/packages/dynamite/dynamite_runtime/lib/src/models/content_string.dart new file mode 100644 index 00000000000..1d1e8db2635 --- /dev/null +++ b/packages/dynamite/dynamite_runtime/lib/src/models/content_string.dart @@ -0,0 +1,17 @@ +import 'package:built_value/built_value.dart'; +import 'package:built_value/serializer.dart'; + +part 'content_string.g.dart'; + +/// Json data encoded in a `String` as defined by [json-schema](https://json-schema.org/understanding-json-schema/reference/non_json_data.html#contentschema). +abstract class ContentString implements Built, ContentStringBuilder> { + /// Creates a new content `String`. + factory ContentString([final void Function(ContentStringBuilder)? b]) = _$ContentString; + const ContentString._(); + + /// The decoded value of the content `String`. + T get content; + + /// The serializer for a content `String`. + static Serializer> get serializer => _$contentStringSerializer; +} diff --git a/packages/dynamite/dynamite_runtime/lib/src/content_string.g.dart b/packages/dynamite/dynamite_runtime/lib/src/models/content_string.g.dart similarity index 100% rename from packages/dynamite/dynamite_runtime/lib/src/content_string.g.dart rename to packages/dynamite/dynamite_runtime/lib/src/models/content_string.g.dart diff --git a/packages/dynamite/dynamite_runtime/lib/utils.dart b/packages/dynamite/dynamite_runtime/lib/utils.dart index c8d7b71126d..818530c766f 100644 --- a/packages/dynamite/dynamite_runtime/lib/utils.dart +++ b/packages/dynamite/dynamite_runtime/lib/utils.dart @@ -1,2 +1,3 @@ +export 'src/http_extensions.dart'; export 'src/string_checker.dart'; export 'src/uri.dart'; diff --git a/packages/dynamite/dynamite_runtime/pubspec.yaml b/packages/dynamite/dynamite_runtime/pubspec.yaml index 4c0f20813cc..cd45cb9fa54 100644 --- a/packages/dynamite/dynamite_runtime/pubspec.yaml +++ b/packages/dynamite/dynamite_runtime/pubspec.yaml @@ -6,6 +6,7 @@ environment: sdk: '>=3.1.0 <4.0.0' dependencies: + built_collection: ^5.0.0 built_value: ^8.0.1 cookie_jar: ^4.0.0 meta: ^1.0.0 @@ -13,7 +14,6 @@ dependencies: dev_dependencies: build_runner: ^2.4.6 - built_collection: ^5.1.1 built_value_generator: ^8.6.3 neon_lints: git: diff --git a/packages/dynamite/dynamite_runtime/test/content_string_test.dart b/packages/dynamite/dynamite_runtime/test/content_string_test.dart index 2e87c378344..81cd4378e02 100644 --- a/packages/dynamite/dynamite_runtime/test/content_string_test.dart +++ b/packages/dynamite/dynamite_runtime/test/content_string_test.dart @@ -5,7 +5,8 @@ import 'dart:convert'; import 'package:built_collection/built_collection.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; +import 'package:dynamite_runtime/models.dart'; import 'package:test/test.dart'; part 'content_string_test.g.dart'; diff --git a/packages/dynamite/dynamite_runtime/test/double_serializer_test.dart b/packages/dynamite/dynamite_runtime/test/double_serializer_test.dart new file mode 100644 index 00000000000..9ea51855ddd --- /dev/null +++ b/packages/dynamite/dynamite_runtime/test/double_serializer_test.dart @@ -0,0 +1,95 @@ +// ignore_for_file: avoid_redundant_argument_values + +import 'dart:convert'; + +import 'package:built_value/serializer.dart'; +import 'package:dynamite_runtime/built_value.dart'; +import 'package:test/test.dart'; + +void main() { + final serializers = (Serializers().toBuilder()..add(DynamiteDoubleSerializer())).build(); + + group('double with known specifiedType', () { + const data = 3.141592653589793; + const serialized = data; + const specifiedType = FullType(double); + + test('can be serialized', () { + expect(serializers.serialize(data, specifiedType: specifiedType), serialized); + }); + + test('can be deserialized', () { + expect(serializers.deserialize(serialized, specifiedType: specifiedType), data); + }); + }); + + group('double with unknown specifiedType', () { + const data = 3.141592653589793; + final serialized = json.decode(json.encode(['double', data])) as Object; + const specifiedType = FullType.unspecified; + + test('can be serialized', () { + expect(serializers.serialize(data, specifiedType: specifiedType), serialized); + }); + + test('can be deserialized', () { + expect(serializers.deserialize(serialized, specifiedType: specifiedType), data); + }); + }); + + group('integer with known specifiedType', () { + const data = 3; + const serialized = data; + const specifiedType = FullType(double); + + test('can not be deserialized', () { + expect( + () => serializers.deserialize(serialized, specifiedType: specifiedType), + throwsA(isA()), + ); + }); + }); + + group('double with NaN value', () { + const data = double.nan; + const serialized = 'NaN'; + const specifiedType = FullType(double); + + test('can be serialized', () { + expect(serializers.serialize(data, specifiedType: specifiedType), serialized); + }); + + test('can be deserialized', () { + // Compare using toString as NaN != NaN. + expect(serializers.deserialize(serialized, specifiedType: specifiedType).toString(), data.toString()); + }); + }); + + group('double with -INF value', () { + const data = double.negativeInfinity; + const serialized = '-INF'; + const specifiedType = FullType(double); + + test('can be serialized', () { + expect(serializers.serialize(data, specifiedType: specifiedType), serialized); + }); + + test('can be deserialized', () { + expect(serializers.deserialize(serialized, specifiedType: specifiedType), data); + }); + }); + + group('double with INF value', () { + const data = double.infinity; + const serialized = 'INF'; + const specifiedType = FullType(double); + + test('can be serialized', () { + expect(serializers.serialize(data, specifiedType: specifiedType), serialized); + }); + + test('can be deserialized', () { + expect(serializers.deserialize(serialized, specifiedType: specifiedType), data); + }); + }); +} diff --git a/packages/nextcloud/lib/nextcloud.dart b/packages/nextcloud/lib/nextcloud.dart index aa37e686cca..6fbd7508138 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; +export 'package:dynamite_runtime/models.dart'; export 'ids.dart'; export 'src/client.dart'; diff --git a/packages/nextcloud/lib/src/api/comments.openapi.dart b/packages/nextcloud/lib/src/api/comments.openapi.dart index e1eafe4a45a..14a351032aa 100644 --- a/packages/nextcloud/lib/src/api/comments.openapi.dart +++ b/packages/nextcloud/lib/src/api/comments.openapi.dart @@ -6,7 +6,7 @@ import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; part 'comments.openapi.g.dart'; @@ -88,6 +88,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/core.openapi.dart b/packages/nextcloud/lib/src/api/core.openapi.dart index 284d7427d8b..53b4362c776 100644 --- a/packages/nextcloud/lib/src/api/core.openapi.dart +++ b/packages/nextcloud/lib/src/api/core.openapi.dart @@ -11,8 +11,9 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; +import 'package:dynamite_runtime/models.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -10401,6 +10402,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/dashboard.openapi.dart b/packages/nextcloud/lib/src/api/dashboard.openapi.dart index e25a323d98a..3524ec89f9b 100644 --- a/packages/nextcloud/lib/src/api/dashboard.openapi.dart +++ b/packages/nextcloud/lib/src/api/dashboard.openapi.dart @@ -9,8 +9,9 @@ import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; +import 'package:dynamite_runtime/models.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -758,6 +759,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/dav.openapi.dart b/packages/nextcloud/lib/src/api/dav.openapi.dart index e08c8803dc2..4d20de6614a 100644 --- a/packages/nextcloud/lib/src/api/dav.openapi.dart +++ b/packages/nextcloud/lib/src/api/dav.openapi.dart @@ -8,7 +8,7 @@ import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -334,6 +334,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/files.openapi.dart b/packages/nextcloud/lib/src/api/files.openapi.dart index 0ecf0a470de..5e107288859 100644 --- a/packages/nextcloud/lib/src/api/files.openapi.dart +++ b/packages/nextcloud/lib/src/api/files.openapi.dart @@ -10,7 +10,7 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/utils.dart'; import 'package:meta/meta.dart'; @@ -2823,6 +2823,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/files_external.openapi.dart b/packages/nextcloud/lib/src/api/files_external.openapi.dart index 2303e6fa9ec..2e7163a2b99 100644 --- a/packages/nextcloud/lib/src/api/files_external.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_external.openapi.dart @@ -10,7 +10,7 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -360,6 +360,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/files_reminders.openapi.dart b/packages/nextcloud/lib/src/api/files_reminders.openapi.dart index 712e387fb61..e0249b656ec 100644 --- a/packages/nextcloud/lib/src/api/files_reminders.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_reminders.openapi.dart @@ -9,7 +9,7 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/utils.dart'; import 'package:meta/meta.dart'; @@ -609,6 +609,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/files_sharing.openapi.dart b/packages/nextcloud/lib/src/api/files_sharing.openapi.dart index 7211e33c706..eb35d34f81c 100644 --- a/packages/nextcloud/lib/src/api/files_sharing.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_sharing.openapi.dart @@ -10,8 +10,9 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; +import 'package:dynamite_runtime/models.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -5372,6 +5373,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart b/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart index 2280ec153bf..9144d129ac4 100644 --- a/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_trashbin.openapi.dart @@ -8,7 +8,7 @@ import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -213,6 +213,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/files_versions.openapi.dart b/packages/nextcloud/lib/src/api/files_versions.openapi.dart index b9a3b66524b..14cf4733945 100644 --- a/packages/nextcloud/lib/src/api/files_versions.openapi.dart +++ b/packages/nextcloud/lib/src/api/files_versions.openapi.dart @@ -8,7 +8,7 @@ import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -217,6 +217,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/news.openapi.dart b/packages/nextcloud/lib/src/api/news.openapi.dart index 8f7b263932b..b111fdd798f 100644 --- a/packages/nextcloud/lib/src/api/news.openapi.dart +++ b/packages/nextcloud/lib/src/api/news.openapi.dart @@ -10,7 +10,7 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -1729,6 +1729,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/notes.openapi.dart b/packages/nextcloud/lib/src/api/notes.openapi.dart index 030e6c63f39..66c89622c73 100644 --- a/packages/nextcloud/lib/src/api/notes.openapi.dart +++ b/packages/nextcloud/lib/src/api/notes.openapi.dart @@ -11,7 +11,7 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -918,6 +918,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/notifications.openapi.dart b/packages/nextcloud/lib/src/api/notifications.openapi.dart index e4a57bc99c8..f8414b61d8a 100644 --- a/packages/nextcloud/lib/src/api/notifications.openapi.dart +++ b/packages/nextcloud/lib/src/api/notifications.openapi.dart @@ -10,7 +10,7 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -2268,6 +2268,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart b/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart index a3e2b39787e..546d4f37eb6 100644 --- a/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart +++ b/packages/nextcloud/lib/src/api/provisioning_api.openapi.dart @@ -10,8 +10,9 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; +import 'package:dynamite_runtime/models.dart'; import 'package:dynamite_runtime/utils.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -8626,6 +8627,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/settings.openapi.dart b/packages/nextcloud/lib/src/api/settings.openapi.dart index ef10f8f5291..43e3d2081c5 100644 --- a/packages/nextcloud/lib/src/api/settings.openapi.dart +++ b/packages/nextcloud/lib/src/api/settings.openapi.dart @@ -8,7 +8,7 @@ import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -199,6 +199,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/sharebymail.openapi.dart b/packages/nextcloud/lib/src/api/sharebymail.openapi.dart index 3ef5f04280f..d97238b03f7 100644 --- a/packages/nextcloud/lib/src/api/sharebymail.openapi.dart +++ b/packages/nextcloud/lib/src/api/sharebymail.openapi.dart @@ -6,7 +6,7 @@ import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; part 'sharebymail.openapi.g.dart'; @@ -241,6 +241,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/theming.openapi.dart b/packages/nextcloud/lib/src/api/theming.openapi.dart index 0eff02cac92..9425c3e478d 100644 --- a/packages/nextcloud/lib/src/api/theming.openapi.dart +++ b/packages/nextcloud/lib/src/api/theming.openapi.dart @@ -10,7 +10,7 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:dynamite_runtime/utils.dart'; import 'package:meta/meta.dart'; @@ -1411,6 +1411,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/updatenotification.openapi.dart b/packages/nextcloud/lib/src/api/updatenotification.openapi.dart index 6859ccf40fd..69c6a7c5ee6 100644 --- a/packages/nextcloud/lib/src/api/updatenotification.openapi.dart +++ b/packages/nextcloud/lib/src/api/updatenotification.openapi.dart @@ -9,7 +9,7 @@ import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -327,6 +327,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/uppush.openapi.dart b/packages/nextcloud/lib/src/api/uppush.openapi.dart index 8538168b368..d7f71e7c4a0 100644 --- a/packages/nextcloud/lib/src/api/uppush.openapi.dart +++ b/packages/nextcloud/lib/src/api/uppush.openapi.dart @@ -9,7 +9,7 @@ import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -1303,6 +1303,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/user_status.openapi.dart b/packages/nextcloud/lib/src/api/user_status.openapi.dart index 813de473d59..2129e65c634 100644 --- a/packages/nextcloud/lib/src/api/user_status.openapi.dart +++ b/packages/nextcloud/lib/src/api/user_status.openapi.dart @@ -10,7 +10,7 @@ import 'package:built_value/json_object.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -2092,6 +2092,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/api/weather_status.openapi.dart b/packages/nextcloud/lib/src/api/weather_status.openapi.dart index 8b8af53b43f..3afa37c0282 100644 --- a/packages/nextcloud/lib/src/api/weather_status.openapi.dart +++ b/packages/nextcloud/lib/src/api/weather_status.openapi.dart @@ -9,7 +9,7 @@ import 'package:built_value/built_value.dart'; import 'package:built_value/serializer.dart'; import 'package:built_value/standard_json_plugin.dart'; import 'package:collection/collection.dart'; -import 'package:dynamite_runtime/content_string.dart'; +import 'package:dynamite_runtime/built_value.dart'; import 'package:dynamite_runtime/http_client.dart'; import 'package:meta/meta.dart'; import 'package:universal_io/io.dart'; @@ -1881,6 +1881,7 @@ final Serializers _serializers = (Serializers().toBuilder() .build(); final Serializers _jsonSerializers = (_serializers.toBuilder() + ..add(DynamiteDoubleSerializer()) ..addPlugin(StandardJsonPlugin()) ..addPlugin(const ContentStringPlugin())) .build(); diff --git a/packages/nextcloud/lib/src/webdav/client.dart b/packages/nextcloud/lib/src/webdav/client.dart index a7dd64d3678..5790c9af9f1 100644 --- a/packages/nextcloud/lib/src/webdav/client.dart +++ b/packages/nextcloud/lib/src/webdav/client.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'dart:typed_data'; import 'package:dynamite_runtime/http_client.dart'; +import 'package:dynamite_runtime/utils.dart'; import 'package:meta/meta.dart'; import 'package:nextcloud/src/webdav/props.dart'; import 'package:nextcloud/src/webdav/webdav.dart';