Browse Source

Merge pull request #859 from nextcloud/fix/nextcloud/autocomplete

fix(nextcloud): Fix autocomplete
pull/923/head
Kate 1 year ago committed by GitHub
parent
commit
f7bc06139e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      external/nextcloud-server
  2. 106
      packages/nextcloud/lib/src/api/core.openapi.dart
  3. 355
      packages/nextcloud/lib/src/api/core.openapi.g.dart
  4. 31
      packages/nextcloud/lib/src/api/core.openapi.json
  5. 42
      packages/nextcloud/test/core_test.dart

2
external/nextcloud-server vendored

@ -1 +1 @@
Subproject commit 69a050991bd580c0fef0c10a27fcadae701a9338 Subproject commit c88b02abff69ff25262b1760bc0beacca23c61ac

106
packages/nextcloud/lib/src/api/core.openapi.dart

@ -4732,13 +4732,113 @@ abstract class CoreAppPasswordDeleteAppPasswordResponseApplicationJson
_$coreAppPasswordDeleteAppPasswordResponseApplicationJsonSerializer; _$coreAppPasswordDeleteAppPasswordResponseApplicationJsonSerializer;
} }
@BuiltValue(instantiable: false)
abstract interface class CoreAutocompleteResult_Status0Interface {
String get status;
String? get message;
String? get icon;
int? get clearAt;
CoreAutocompleteResult_Status0Interface rebuild(
final void Function(CoreAutocompleteResult_Status0InterfaceBuilder) updates,
);
CoreAutocompleteResult_Status0InterfaceBuilder toBuilder();
}
abstract class CoreAutocompleteResult_Status0
implements
CoreAutocompleteResult_Status0Interface,
Built<CoreAutocompleteResult_Status0, CoreAutocompleteResult_Status0Builder> {
factory CoreAutocompleteResult_Status0([final void Function(CoreAutocompleteResult_Status0Builder)? b]) =
_$CoreAutocompleteResult_Status0;
// coverage:ignore-start
const CoreAutocompleteResult_Status0._();
// coverage:ignore-end
// coverage:ignore-start
factory CoreAutocompleteResult_Status0.fromJson(final Map<String, dynamic> json) =>
_jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
static Serializer<CoreAutocompleteResult_Status0> get serializer => _$coreAutocompleteResultStatus0Serializer;
}
abstract class CoreAutocompleteResult_Status
implements Built<CoreAutocompleteResult_Status, CoreAutocompleteResult_StatusBuilder> {
factory CoreAutocompleteResult_Status([final void Function(CoreAutocompleteResult_StatusBuilder)? b]) =
_$CoreAutocompleteResult_Status;
// coverage:ignore-start
const CoreAutocompleteResult_Status._();
// coverage:ignore-end
// coverage:ignore-start
factory CoreAutocompleteResult_Status.fromJson(final Map<String, dynamic> json) =>
_jsonSerializers.deserializeWith(serializer, json)!;
// coverage:ignore-end
// coverage:ignore-start
Map<String, dynamic> toJson() => _jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
// coverage:ignore-end
JsonObject get data;
CoreAutocompleteResult_Status0? get autocompleteResultStatus0;
String? get string;
@BuiltValueSerializer(custom: true)
static Serializer<CoreAutocompleteResult_Status> get serializer => _$CoreAutocompleteResult_StatusSerializer();
}
class _$CoreAutocompleteResult_StatusSerializer implements PrimitiveSerializer<CoreAutocompleteResult_Status> {
@override
final Iterable<Type> types = const [CoreAutocompleteResult_Status, _$CoreAutocompleteResult_Status];
@override
final String wireName = 'CoreAutocompleteResult_Status';
@override
Object serialize(
final Serializers serializers,
final CoreAutocompleteResult_Status object, {
final FullType specifiedType = FullType.unspecified,
}) =>
object.data.value;
@override
CoreAutocompleteResult_Status deserialize(
final Serializers serializers,
final Object data, {
final FullType specifiedType = FullType.unspecified,
}) {
final result = CoreAutocompleteResult_StatusBuilder()..data = JsonObject(data);
try {
result._autocompleteResultStatus0 = (_jsonSerializers.deserialize(
data,
specifiedType: const FullType(CoreAutocompleteResult_Status0),
)! as CoreAutocompleteResult_Status0)
.toBuilder();
} catch (_) {}
try {
result._string = _jsonSerializers.deserialize(data, specifiedType: const FullType(String))! as String;
} catch (_) {}
assert(
[result._autocompleteResultStatus0, result._string].where((final x) => x != null).isNotEmpty,
'Need oneOf for ${result._data}',
);
return result.build();
}
}
@BuiltValue(instantiable: false) @BuiltValue(instantiable: false)
abstract interface class CoreAutocompleteResultInterface { abstract interface class CoreAutocompleteResultInterface {
String get id; String get id;
String get label; String get label;
String get icon; String get icon;
String get source; String get source;
String get status; CoreAutocompleteResult_Status get status;
String get subline; String get subline;
String get shareWithDisplayNameUnique; String get shareWithDisplayNameUnique;
CoreAutocompleteResultInterface rebuild(final void Function(CoreAutocompleteResultInterfaceBuilder) updates); CoreAutocompleteResultInterface rebuild(final void Function(CoreAutocompleteResultInterfaceBuilder) updates);
@ -10259,6 +10359,10 @@ final Serializers _serializers = (Serializers().toBuilder()
..add(CoreAutoCompleteGetResponseApplicationJson_Ocs.serializer) ..add(CoreAutoCompleteGetResponseApplicationJson_Ocs.serializer)
..addBuilderFactory(const FullType(CoreAutocompleteResult), CoreAutocompleteResult.new) ..addBuilderFactory(const FullType(CoreAutocompleteResult), CoreAutocompleteResult.new)
..add(CoreAutocompleteResult.serializer) ..add(CoreAutocompleteResult.serializer)
..addBuilderFactory(const FullType(CoreAutocompleteResult_Status), CoreAutocompleteResult_Status.new)
..add(CoreAutocompleteResult_Status.serializer)
..addBuilderFactory(const FullType(CoreAutocompleteResult_Status0), CoreAutocompleteResult_Status0.new)
..add(CoreAutocompleteResult_Status0.serializer)
..addBuilderFactory( ..addBuilderFactory(
const FullType(BuiltList, [FullType(CoreAutocompleteResult)]), const FullType(BuiltList, [FullType(CoreAutocompleteResult)]),
ListBuilder<CoreAutocompleteResult>.new, ListBuilder<CoreAutocompleteResult>.new,

355
packages/nextcloud/lib/src/api/core.openapi.g.dart

@ -32,6 +32,8 @@ Serializer<CoreAppPasswordDeleteAppPasswordResponseApplicationJson_Ocs>
Serializer<CoreAppPasswordDeleteAppPasswordResponseApplicationJson> Serializer<CoreAppPasswordDeleteAppPasswordResponseApplicationJson>
_$coreAppPasswordDeleteAppPasswordResponseApplicationJsonSerializer = _$coreAppPasswordDeleteAppPasswordResponseApplicationJsonSerializer =
_$CoreAppPasswordDeleteAppPasswordResponseApplicationJsonSerializer(); _$CoreAppPasswordDeleteAppPasswordResponseApplicationJsonSerializer();
Serializer<CoreAutocompleteResult_Status0> _$coreAutocompleteResultStatus0Serializer =
_$CoreAutocompleteResult_Status0Serializer();
Serializer<CoreAutocompleteResult> _$coreAutocompleteResultSerializer = _$CoreAutocompleteResultSerializer(); Serializer<CoreAutocompleteResult> _$coreAutocompleteResultSerializer = _$CoreAutocompleteResultSerializer();
Serializer<CoreAutoCompleteGetResponseApplicationJson_Ocs> _$coreAutoCompleteGetResponseApplicationJsonOcsSerializer = Serializer<CoreAutoCompleteGetResponseApplicationJson_Ocs> _$coreAutoCompleteGetResponseApplicationJsonOcsSerializer =
_$CoreAutoCompleteGetResponseApplicationJson_OcsSerializer(); _$CoreAutoCompleteGetResponseApplicationJson_OcsSerializer();
@ -897,6 +899,71 @@ class _$CoreAppPasswordDeleteAppPasswordResponseApplicationJsonSerializer
} }
} }
class _$CoreAutocompleteResult_Status0Serializer implements StructuredSerializer<CoreAutocompleteResult_Status0> {
@override
final Iterable<Type> types = const [CoreAutocompleteResult_Status0, _$CoreAutocompleteResult_Status0];
@override
final String wireName = 'CoreAutocompleteResult_Status0';
@override
Iterable<Object?> serialize(Serializers serializers, CoreAutocompleteResult_Status0 object,
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[
'status',
serializers.serialize(object.status, specifiedType: const FullType(String)),
];
Object? value;
value = object.message;
if (value != null) {
result
..add('message')
..add(serializers.serialize(value, specifiedType: const FullType(String)));
}
value = object.icon;
if (value != null) {
result
..add('icon')
..add(serializers.serialize(value, specifiedType: const FullType(String)));
}
value = object.clearAt;
if (value != null) {
result
..add('clearAt')
..add(serializers.serialize(value, specifiedType: const FullType(int)));
}
return result;
}
@override
CoreAutocompleteResult_Status0 deserialize(Serializers serializers, Iterable<Object?> serialized,
{FullType specifiedType = FullType.unspecified}) {
final result = CoreAutocompleteResult_Status0Builder();
final iterator = serialized.iterator;
while (iterator.moveNext()) {
final key = iterator.current! as String;
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case 'status':
result.status = serializers.deserialize(value, specifiedType: const FullType(String))! as String;
break;
case 'message':
result.message = serializers.deserialize(value, specifiedType: const FullType(String)) as String?;
break;
case 'icon':
result.icon = serializers.deserialize(value, specifiedType: const FullType(String)) as String?;
break;
case 'clearAt':
result.clearAt = serializers.deserialize(value, specifiedType: const FullType(int)) as int?;
break;
}
}
return result.build();
}
}
class _$CoreAutocompleteResultSerializer implements StructuredSerializer<CoreAutocompleteResult> { class _$CoreAutocompleteResultSerializer implements StructuredSerializer<CoreAutocompleteResult> {
@override @override
final Iterable<Type> types = const [CoreAutocompleteResult, _$CoreAutocompleteResult]; final Iterable<Type> types = const [CoreAutocompleteResult, _$CoreAutocompleteResult];
@ -916,7 +983,7 @@ class _$CoreAutocompleteResultSerializer implements StructuredSerializer<CoreAut
'source', 'source',
serializers.serialize(object.source, specifiedType: const FullType(String)), serializers.serialize(object.source, specifiedType: const FullType(String)),
'status', 'status',
serializers.serialize(object.status, specifiedType: const FullType(String)), serializers.serialize(object.status, specifiedType: const FullType(CoreAutocompleteResult_Status)),
'subline', 'subline',
serializers.serialize(object.subline, specifiedType: const FullType(String)), serializers.serialize(object.subline, specifiedType: const FullType(String)),
'shareWithDisplayNameUnique', 'shareWithDisplayNameUnique',
@ -950,7 +1017,8 @@ class _$CoreAutocompleteResultSerializer implements StructuredSerializer<CoreAut
result.source = serializers.deserialize(value, specifiedType: const FullType(String))! as String; result.source = serializers.deserialize(value, specifiedType: const FullType(String))! as String;
break; break;
case 'status': case 'status':
result.status = serializers.deserialize(value, specifiedType: const FullType(String))! as String; result.status.replace(serializers.deserialize(value,
specifiedType: const FullType(CoreAutocompleteResult_Status))! as CoreAutocompleteResult_Status);
break; break;
case 'subline': case 'subline':
result.subline = serializers.deserialize(value, specifiedType: const FullType(String))! as String; result.subline = serializers.deserialize(value, specifiedType: const FullType(String))! as String;
@ -9245,6 +9313,259 @@ class CoreAppPasswordDeleteAppPasswordResponseApplicationJsonBuilder
} }
} }
abstract mixin class CoreAutocompleteResult_Status0InterfaceBuilder {
void replace(CoreAutocompleteResult_Status0Interface other);
void update(void Function(CoreAutocompleteResult_Status0InterfaceBuilder) updates);
String? get status;
set status(String? status);
String? get message;
set message(String? message);
String? get icon;
set icon(String? icon);
int? get clearAt;
set clearAt(int? clearAt);
}
class _$CoreAutocompleteResult_Status0 extends CoreAutocompleteResult_Status0 {
@override
final String status;
@override
final String? message;
@override
final String? icon;
@override
final int? clearAt;
factory _$CoreAutocompleteResult_Status0([void Function(CoreAutocompleteResult_Status0Builder)? updates]) =>
(CoreAutocompleteResult_Status0Builder()..update(updates))._build();
_$CoreAutocompleteResult_Status0._({required this.status, this.message, this.icon, this.clearAt}) : super._() {
BuiltValueNullFieldError.checkNotNull(status, r'CoreAutocompleteResult_Status0', 'status');
}
@override
CoreAutocompleteResult_Status0 rebuild(void Function(CoreAutocompleteResult_Status0Builder) updates) =>
(toBuilder()..update(updates)).build();
@override
CoreAutocompleteResult_Status0Builder toBuilder() => CoreAutocompleteResult_Status0Builder()..replace(this);
@override
bool operator ==(Object other) {
if (identical(other, this)) return true;
return other is CoreAutocompleteResult_Status0 &&
status == other.status &&
message == other.message &&
icon == other.icon &&
clearAt == other.clearAt;
}
@override
int get hashCode {
var _$hash = 0;
_$hash = $jc(_$hash, status.hashCode);
_$hash = $jc(_$hash, message.hashCode);
_$hash = $jc(_$hash, icon.hashCode);
_$hash = $jc(_$hash, clearAt.hashCode);
_$hash = $jf(_$hash);
return _$hash;
}
@override
String toString() {
return (newBuiltValueToStringHelper(r'CoreAutocompleteResult_Status0')
..add('status', status)
..add('message', message)
..add('icon', icon)
..add('clearAt', clearAt))
.toString();
}
}
class CoreAutocompleteResult_Status0Builder
implements
Builder<CoreAutocompleteResult_Status0, CoreAutocompleteResult_Status0Builder>,
CoreAutocompleteResult_Status0InterfaceBuilder {
_$CoreAutocompleteResult_Status0? _$v;
String? _status;
String? get status => _$this._status;
set status(covariant String? status) => _$this._status = status;
String? _message;
String? get message => _$this._message;
set message(covariant String? message) => _$this._message = message;
String? _icon;
String? get icon => _$this._icon;
set icon(covariant String? icon) => _$this._icon = icon;
int? _clearAt;
int? get clearAt => _$this._clearAt;
set clearAt(covariant int? clearAt) => _$this._clearAt = clearAt;
CoreAutocompleteResult_Status0Builder();
CoreAutocompleteResult_Status0Builder get _$this {
final $v = _$v;
if ($v != null) {
_status = $v.status;
_message = $v.message;
_icon = $v.icon;
_clearAt = $v.clearAt;
_$v = null;
}
return this;
}
@override
void replace(covariant CoreAutocompleteResult_Status0 other) {
ArgumentError.checkNotNull(other, 'other');
_$v = other as _$CoreAutocompleteResult_Status0;
}
@override
void update(void Function(CoreAutocompleteResult_Status0Builder)? updates) {
if (updates != null) updates(this);
}
@override
CoreAutocompleteResult_Status0 build() => _build();
_$CoreAutocompleteResult_Status0 _build() {
final _$result = _$v ??
_$CoreAutocompleteResult_Status0._(
status: BuiltValueNullFieldError.checkNotNull(status, r'CoreAutocompleteResult_Status0', 'status'),
message: message,
icon: icon,
clearAt: clearAt);
replace(_$result);
return _$result;
}
}
class _$CoreAutocompleteResult_Status extends CoreAutocompleteResult_Status {
@override
final JsonObject data;
@override
final CoreAutocompleteResult_Status0? autocompleteResultStatus0;
@override
final String? string;
factory _$CoreAutocompleteResult_Status([void Function(CoreAutocompleteResult_StatusBuilder)? updates]) =>
(CoreAutocompleteResult_StatusBuilder()..update(updates))._build();
_$CoreAutocompleteResult_Status._({required this.data, this.autocompleteResultStatus0, this.string}) : super._() {
BuiltValueNullFieldError.checkNotNull(data, r'CoreAutocompleteResult_Status', 'data');
}
@override
CoreAutocompleteResult_Status rebuild(void Function(CoreAutocompleteResult_StatusBuilder) updates) =>
(toBuilder()..update(updates)).build();
@override
CoreAutocompleteResult_StatusBuilder toBuilder() => CoreAutocompleteResult_StatusBuilder()..replace(this);
@override
bool operator ==(Object other) {
if (identical(other, this)) return true;
return other is CoreAutocompleteResult_Status &&
data == other.data &&
autocompleteResultStatus0 == other.autocompleteResultStatus0 &&
string == other.string;
}
@override
int get hashCode {
var _$hash = 0;
_$hash = $jc(_$hash, data.hashCode);
_$hash = $jc(_$hash, autocompleteResultStatus0.hashCode);
_$hash = $jc(_$hash, string.hashCode);
_$hash = $jf(_$hash);
return _$hash;
}
@override
String toString() {
return (newBuiltValueToStringHelper(r'CoreAutocompleteResult_Status')
..add('data', data)
..add('autocompleteResultStatus0', autocompleteResultStatus0)
..add('string', string))
.toString();
}
}
class CoreAutocompleteResult_StatusBuilder
implements Builder<CoreAutocompleteResult_Status, CoreAutocompleteResult_StatusBuilder> {
_$CoreAutocompleteResult_Status? _$v;
JsonObject? _data;
JsonObject? get data => _$this._data;
set data(JsonObject? data) => _$this._data = data;
CoreAutocompleteResult_Status0Builder? _autocompleteResultStatus0;
CoreAutocompleteResult_Status0Builder get autocompleteResultStatus0 =>
_$this._autocompleteResultStatus0 ??= CoreAutocompleteResult_Status0Builder();
set autocompleteResultStatus0(CoreAutocompleteResult_Status0Builder? autocompleteResultStatus0) =>
_$this._autocompleteResultStatus0 = autocompleteResultStatus0;
String? _string;
String? get string => _$this._string;
set string(String? string) => _$this._string = string;
CoreAutocompleteResult_StatusBuilder();
CoreAutocompleteResult_StatusBuilder get _$this {
final $v = _$v;
if ($v != null) {
_data = $v.data;
_autocompleteResultStatus0 = $v.autocompleteResultStatus0?.toBuilder();
_string = $v.string;
_$v = null;
}
return this;
}
@override
void replace(CoreAutocompleteResult_Status other) {
ArgumentError.checkNotNull(other, 'other');
_$v = other as _$CoreAutocompleteResult_Status;
}
@override
void update(void Function(CoreAutocompleteResult_StatusBuilder)? updates) {
if (updates != null) updates(this);
}
@override
CoreAutocompleteResult_Status build() => _build();
_$CoreAutocompleteResult_Status _build() {
_$CoreAutocompleteResult_Status _$result;
try {
_$result = _$v ??
_$CoreAutocompleteResult_Status._(
data: BuiltValueNullFieldError.checkNotNull(data, r'CoreAutocompleteResult_Status', 'data'),
autocompleteResultStatus0: _autocompleteResultStatus0?.build(),
string: string);
} catch (_) {
late String _$failedField;
try {
_$failedField = 'autocompleteResultStatus0';
_autocompleteResultStatus0?.build();
} catch (e) {
throw BuiltValueNestedFieldError(r'CoreAutocompleteResult_Status', _$failedField, e.toString());
}
rethrow;
}
replace(_$result);
return _$result;
}
}
abstract mixin class CoreAutocompleteResultInterfaceBuilder { abstract mixin class CoreAutocompleteResultInterfaceBuilder {
void replace(CoreAutocompleteResultInterface other); void replace(CoreAutocompleteResultInterface other);
void update(void Function(CoreAutocompleteResultInterfaceBuilder) updates); void update(void Function(CoreAutocompleteResultInterfaceBuilder) updates);
@ -9260,8 +9581,8 @@ abstract mixin class CoreAutocompleteResultInterfaceBuilder {
String? get source; String? get source;
set source(String? source); set source(String? source);
String? get status; CoreAutocompleteResult_StatusBuilder get status;
set status(String? status); set status(CoreAutocompleteResult_StatusBuilder? status);
String? get subline; String? get subline;
set subline(String? subline); set subline(String? subline);
@ -9280,7 +9601,7 @@ class _$CoreAutocompleteResult extends CoreAutocompleteResult {
@override @override
final String source; final String source;
@override @override
final String status; final CoreAutocompleteResult_Status status;
@override @override
final String subline; final String subline;
@override @override
@ -9376,9 +9697,9 @@ class CoreAutocompleteResultBuilder
String? get source => _$this._source; String? get source => _$this._source;
set source(covariant String? source) => _$this._source = source; set source(covariant String? source) => _$this._source = source;
String? _status; CoreAutocompleteResult_StatusBuilder? _status;
String? get status => _$this._status; CoreAutocompleteResult_StatusBuilder get status => _$this._status ??= CoreAutocompleteResult_StatusBuilder();
set status(covariant String? status) => _$this._status = status; set status(covariant CoreAutocompleteResult_StatusBuilder? status) => _$this._status = status;
String? _subline; String? _subline;
String? get subline => _$this._subline; String? get subline => _$this._subline;
@ -9398,7 +9719,7 @@ class CoreAutocompleteResultBuilder
_label = $v.label; _label = $v.label;
_icon = $v.icon; _icon = $v.icon;
_source = $v.source; _source = $v.source;
_status = $v.status; _status = $v.status.toBuilder();
_subline = $v.subline; _subline = $v.subline;
_shareWithDisplayNameUnique = $v.shareWithDisplayNameUnique; _shareWithDisplayNameUnique = $v.shareWithDisplayNameUnique;
_$v = null; _$v = null;
@ -9421,16 +9742,28 @@ class CoreAutocompleteResultBuilder
CoreAutocompleteResult build() => _build(); CoreAutocompleteResult build() => _build();
_$CoreAutocompleteResult _build() { _$CoreAutocompleteResult _build() {
final _$result = _$v ?? _$CoreAutocompleteResult _$result;
try {
_$result = _$v ??
_$CoreAutocompleteResult._( _$CoreAutocompleteResult._(
id: BuiltValueNullFieldError.checkNotNull(id, r'CoreAutocompleteResult', 'id'), id: BuiltValueNullFieldError.checkNotNull(id, r'CoreAutocompleteResult', 'id'),
label: BuiltValueNullFieldError.checkNotNull(label, r'CoreAutocompleteResult', 'label'), label: BuiltValueNullFieldError.checkNotNull(label, r'CoreAutocompleteResult', 'label'),
icon: BuiltValueNullFieldError.checkNotNull(icon, r'CoreAutocompleteResult', 'icon'), icon: BuiltValueNullFieldError.checkNotNull(icon, r'CoreAutocompleteResult', 'icon'),
source: BuiltValueNullFieldError.checkNotNull(source, r'CoreAutocompleteResult', 'source'), source: BuiltValueNullFieldError.checkNotNull(source, r'CoreAutocompleteResult', 'source'),
status: BuiltValueNullFieldError.checkNotNull(status, r'CoreAutocompleteResult', 'status'), status: status.build(),
subline: BuiltValueNullFieldError.checkNotNull(subline, r'CoreAutocompleteResult', 'subline'), subline: BuiltValueNullFieldError.checkNotNull(subline, r'CoreAutocompleteResult', 'subline'),
shareWithDisplayNameUnique: BuiltValueNullFieldError.checkNotNull( shareWithDisplayNameUnique: BuiltValueNullFieldError.checkNotNull(
shareWithDisplayNameUnique, r'CoreAutocompleteResult', 'shareWithDisplayNameUnique')); shareWithDisplayNameUnique, r'CoreAutocompleteResult', 'shareWithDisplayNameUnique'));
} catch (_) {
late String _$failedField;
try {
_$failedField = 'status';
status.build();
} catch (e) {
throw BuiltValueNestedFieldError(r'CoreAutocompleteResult', _$failedField, e.toString());
}
rethrow;
}
replace(_$result); replace(_$result);
return _$result; return _$result;
} }

31
packages/nextcloud/lib/src/api/core.openapi.json

@ -46,7 +46,38 @@
"type": "string" "type": "string"
}, },
"status": { "status": {
"oneOf": [
{
"type": "object",
"required": [
"status",
"message",
"icon",
"clearAt"
],
"properties": {
"status": {
"type": "string"
},
"message": {
"type": "string",
"nullable": true
},
"icon": {
"type": "string",
"nullable": true
},
"clearAt": {
"type": "integer",
"format": "int64",
"nullable": true
}
}
},
{
"type": "string" "type": "string"
}
]
}, },
"subline": { "subline": {
"type": "string" "type": "string"

42
packages/nextcloud/test/core_test.dart

@ -87,48 +87,24 @@ void main() {
expect(response.body.ocs.data[5].id, 'news'); expect(response.body.ocs.data[5].id, 'news');
}); });
test( test('Autocomplete', () async {
'Autocomplete',
() async {
final response = await client.core.autoComplete.$get( final response = await client.core.autoComplete.$get(
search: '', search: '',
itemType: 'call', itemType: 'call',
itemId: 'new', itemId: 'new',
shareTypes: [ shareTypes: [ShareType.group.index],
ShareType.user.index,
ShareType.group.index,
],
); );
expect(response.statusCode, 200); expect(response.body.ocs.data, hasLength(1));
expect(() => response.headers, isA<void>());
expect(response.body.ocs.data, hasLength(3));
expect(response.body.ocs.data[0].id, 'admin'); expect(response.body.ocs.data[0].id, 'admin');
expect(response.body.ocs.data[0].label, 'admin'); expect(response.body.ocs.data[0].label, 'admin');
expect(response.body.ocs.data[0].icon, 'icon-user'); expect(response.body.ocs.data[0].icon, '');
expect(response.body.ocs.data[0].source, 'users'); expect(response.body.ocs.data[0].source, 'groups');
expect(response.body.ocs.data[0].status, isEmpty); expect(response.body.ocs.data[0].status.autocompleteResultStatus0, isNull);
expect(response.body.ocs.data[0].status.string, isEmpty);
expect(response.body.ocs.data[0].subline, ''); expect(response.body.ocs.data[0].subline, '');
expect(response.body.ocs.data[0].shareWithDisplayNameUnique, 'admin@example.com'); expect(response.body.ocs.data[0].shareWithDisplayNameUnique, '');
});
expect(response.body.ocs.data[1].id, 'user2');
expect(response.body.ocs.data[1].label, 'User Two');
expect(response.body.ocs.data[1].icon, 'icon-user');
expect(response.body.ocs.data[1].source, 'users');
expect(response.body.ocs.data[1].status, isEmpty);
expect(response.body.ocs.data[1].subline, '');
expect(response.body.ocs.data[1].shareWithDisplayNameUnique, 'user2');
expect(response.body.ocs.data[2].id, 'admin');
expect(response.body.ocs.data[2].label, 'admin');
expect(response.body.ocs.data[2].icon, '');
expect(response.body.ocs.data[2].source, 'groups');
expect(response.body.ocs.data[2].status, isEmpty);
expect(response.body.ocs.data[2].subline, '');
expect(response.body.ocs.data[2].shareWithDisplayNameUnique, '');
},
skip: true, // TODO: This test only works on 28+ due to a bug fix with the status
);
test('Get preview', () async { test('Get preview', () async {
final response = await client.core.preview.getPreview(file: 'Nextcloud.png'); final response = await client.core.preview.getPreview(file: 'Nextcloud.png');

Loading…
Cancel
Save