Browse Source

Update nextcloud server and notifications to 27.0.0

pull/396/head
jld3103 2 years ago
parent
commit
af3a5085bc
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 2
      external/nextcloud-notifications
  2. 2
      external/nextcloud-server
  3. 2
      packages/neon/neon/lib/src/widgets/account_tile.dart
  4. 6
      packages/nextcloud/lib/src/helpers.dart
  5. 5
      packages/nextcloud/lib/src/nextcloud.openapi.dart
  6. 62
      packages/nextcloud/lib/src/nextcloud.openapi.g.dart
  7. 7
      packages/nextcloud/lib/src/nextcloud.openapi.json
  8. 2
      packages/nextcloud/lib/src/version_supported.dart
  9. 5
      packages/nextcloud/test/provisioning_api.dart
  10. 6
      packages/nextcloud/test/webdav.dart
  11. 5
      specs/core.json
  12. 2
      specs/notifications.json
  13. 4
      specs/provisioning_api.json
  14. 2
      specs/templates/appinfo_core.xml
  15. 2
      specs/templates/core.json
  16. 2
      specs/templates/notifications.json
  17. 10
      specs/templates/provisioning_api.json
  18. 32
      specs/templates/user_status.json
  19. 2
      specs/user_status.json
  20. 2
      tool/Dockerfile.dev

2
external/nextcloud-notifications vendored

@ -1 +1 @@
Subproject commit 69069071ff7a5775ddb06418f55f39593afdbbb1
Subproject commit 09d3a1c9abcdd1c0ec4d8531907b56ac9f368666

2
external/nextcloud-server vendored

@ -1 +1 @@
Subproject commit 8cfcb8e2a2f9ba1bbe993161f00d7dcebf07708f
Subproject commit add4e4365a4040d2e4e6aa79c0d03c3edd78583c

2
packages/neon/neon/lib/src/widgets/account_tile.dart

@ -43,7 +43,7 @@ class NeonAccountTile extends StatelessWidget {
if (userDetails.data != null) ...[
Flexible(
child: Text(
userDetails.data!.getDisplayName()!,
userDetails.data!.displayname,
style: Theme.of(context).textTheme.bodyLarge!.copyWith(
color: textColor,
),

6
packages/nextcloud/lib/src/helpers.dart

@ -14,12 +14,6 @@ NextcloudNotificationsNotificationDecryptedSubject decryptPushNotificationSubjec
json.decode(privateKey.decrypt(subject)) as Map<String, dynamic>,
);
extension UserDetailsDisplayName on openapi.NextcloudProvisioningApiUserDetails {
/// This is used to work around an API change that wasn't made for every endpoint
/// See https://github.com/nextcloud/server/commit/5086335643b6181284ee50f57b95525002842992
String? getDisplayName() => displayname ?? displayName;
}
/// See https://github.com/nextcloud/news/blob/4a107b3d53c4fe651ac704251b99e04a53cd587f/lib/Db/ListType.php
enum NewsListType {
feed(0),

5
packages/nextcloud/lib/src/nextcloud.openapi.dart

@ -3196,6 +3196,7 @@ abstract class NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus
jsonSerializers.deserializeWith(serializer, json)!;
Map<String, dynamic> toJson() => jsonSerializers.serializeWith(serializer, this)! as Map<String, dynamic>;
bool? get restore;
bool? get enabled;
@BuiltValueField(wireName: 'supports_emoji')
bool? get supportsEmoji;
@ -4015,7 +4016,7 @@ abstract class NextcloudProvisioningApiUserDetails
BuiltList<String> get additionalMail;
@BuiltValueField(wireName: 'additional_mailScope')
BuiltList<String> get additionalMailScope;
String? get displayname;
String get displayname;
String get displaynameScope;
String get phone;
String get phoneScope;
@ -4046,7 +4047,7 @@ abstract class NextcloudProvisioningApiUserDetails
String? get notifyEmail;
NextcloudProvisioningApiUserDetails_BackendCapabilities get backendCapabilities;
@BuiltValueField(wireName: 'display-name')
String? get displayName;
String get displayName;
static Serializer<NextcloudProvisioningApiUserDetails> get serializer =>
_$nextcloudProvisioningApiUserDetailsSerializer;
}

62
packages/nextcloud/lib/src/nextcloud.openapi.g.dart

@ -3757,6 +3757,12 @@ class _$NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatusSerializ
{FullType specifiedType = FullType.unspecified}) {
final result = <Object?>[];
Object? value;
value = object.restore;
if (value != null) {
result
..add('restore')
..add(serializers.serialize(value, specifiedType: const FullType(bool)));
}
value = object.enabled;
if (value != null) {
result
@ -3784,6 +3790,9 @@ class _$NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatusSerializ
iterator.moveNext();
final Object? value = iterator.current;
switch (key) {
case 'restore':
result.restore = serializers.deserialize(value, specifiedType: const FullType(bool)) as bool?;
break;
case 'enabled':
result.enabled = serializers.deserialize(value, specifiedType: const FullType(bool)) as bool?;
break;
@ -6109,6 +6118,8 @@ class _$NextcloudProvisioningApiUserDetailsSerializer
serializers.serialize(object.additionalMail, specifiedType: const FullType(BuiltList, [FullType(String)])),
'additional_mailScope',
serializers.serialize(object.additionalMailScope, specifiedType: const FullType(BuiltList, [FullType(String)])),
'displayname',
serializers.serialize(object.displayname, specifiedType: const FullType(String)),
'displaynameScope',
serializers.serialize(object.displaynameScope, specifiedType: const FullType(String)),
'phone',
@ -6160,6 +6171,8 @@ class _$NextcloudProvisioningApiUserDetailsSerializer
'backendCapabilities',
serializers.serialize(object.backendCapabilities,
specifiedType: const FullType(NextcloudProvisioningApiUserDetails_BackendCapabilities)),
'display-name',
serializers.serialize(object.displayName, specifiedType: const FullType(String)),
];
Object? value;
value = object.enabled;
@ -6180,24 +6193,12 @@ class _$NextcloudProvisioningApiUserDetailsSerializer
..add('email')
..add(serializers.serialize(value, specifiedType: const FullType(String)));
}
value = object.displayname;
if (value != null) {
result
..add('displayname')
..add(serializers.serialize(value, specifiedType: const FullType(String)));
}
value = object.notifyEmail;
if (value != null) {
result
..add('notify_email')
..add(serializers.serialize(value, specifiedType: const FullType(String)));
}
value = object.displayName;
if (value != null) {
result
..add('display-name')
..add(serializers.serialize(value, specifiedType: const FullType(String)));
}
return result;
}
@ -6254,7 +6255,7 @@ class _$NextcloudProvisioningApiUserDetailsSerializer
specifiedType: const FullType(BuiltList, [FullType(String)]))! as BuiltList<Object?>);
break;
case 'displayname':
result.displayname = serializers.deserialize(value, specifiedType: const FullType(String)) as String?;
result.displayname = serializers.deserialize(value, specifiedType: const FullType(String))! as String;
break;
case 'displaynameScope':
result.displaynameScope = serializers.deserialize(value, specifiedType: const FullType(String))! as String;
@ -6338,7 +6339,7 @@ class _$NextcloudProvisioningApiUserDetailsSerializer
as NextcloudProvisioningApiUserDetails_BackendCapabilities);
break;
case 'display-name':
result.displayName = serializers.deserialize(value, specifiedType: const FullType(String)) as String?;
result.displayName = serializers.deserialize(value, specifiedType: const FullType(String))! as String;
break;
}
}
@ -13537,6 +13538,8 @@ class NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_ThemingBuilder
class _$NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus
extends NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus {
@override
final bool? restore;
@override
final bool? enabled;
@override
final bool? supportsEmoji;
@ -13545,7 +13548,8 @@ class _$NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus
[void Function(NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatusBuilder)? updates]) =>
(NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatusBuilder()..update(updates))._build();
_$NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus._({this.enabled, this.supportsEmoji}) : super._();
_$NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus._({this.restore, this.enabled, this.supportsEmoji})
: super._();
@override
NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus rebuild(
@ -13560,6 +13564,7 @@ class _$NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus
bool operator ==(Object other) {
if (identical(other, this)) return true;
return other is NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus &&
restore == other.restore &&
enabled == other.enabled &&
supportsEmoji == other.supportsEmoji;
}
@ -13567,6 +13572,7 @@ class _$NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus
@override
int get hashCode {
var _$hash = 0;
_$hash = $jc(_$hash, restore.hashCode);
_$hash = $jc(_$hash, enabled.hashCode);
_$hash = $jc(_$hash, supportsEmoji.hashCode);
_$hash = $jf(_$hash);
@ -13576,6 +13582,7 @@ class _$NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus
@override
String toString() {
return (newBuiltValueToStringHelper(r'NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus')
..add('restore', restore)
..add('enabled', enabled)
..add('supportsEmoji', supportsEmoji))
.toString();
@ -13588,6 +13595,10 @@ class NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatusBuilder
NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatusBuilder> {
_$NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus? _$v;
bool? _restore;
bool? get restore => _$this._restore;
set restore(bool? restore) => _$this._restore = restore;
bool? _enabled;
bool? get enabled => _$this._enabled;
set enabled(bool? enabled) => _$this._enabled = enabled;
@ -13601,6 +13612,7 @@ class NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatusBuilder
NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatusBuilder get _$this {
final $v = _$v;
if ($v != null) {
_restore = $v.restore;
_enabled = $v.enabled;
_supportsEmoji = $v.supportsEmoji;
_$v = null;
@ -13625,7 +13637,7 @@ class NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatusBuilder
_$NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus _build() {
final _$result = _$v ??
_$NextcloudCoreServerCapabilities_Ocs_Data_Capabilities_UserStatus._(
enabled: enabled, supportsEmoji: supportsEmoji);
restore: restore, enabled: enabled, supportsEmoji: supportsEmoji);
replace(_$result);
return _$result;
}
@ -18682,7 +18694,7 @@ class _$NextcloudProvisioningApiUserDetails extends NextcloudProvisioningApiUser
@override
final BuiltList<String> additionalMailScope;
@override
final String? displayname;
final String displayname;
@override
final String displaynameScope;
@override
@ -18736,7 +18748,7 @@ class _$NextcloudProvisioningApiUserDetails extends NextcloudProvisioningApiUser
@override
final NextcloudProvisioningApiUserDetails_BackendCapabilities backendCapabilities;
@override
final String? displayName;
final String displayName;
factory _$NextcloudProvisioningApiUserDetails([void Function(NextcloudProvisioningApiUserDetailsBuilder)? updates]) =>
(NextcloudProvisioningApiUserDetailsBuilder()..update(updates))._build();
@ -18754,7 +18766,7 @@ class _$NextcloudProvisioningApiUserDetails extends NextcloudProvisioningApiUser
required this.emailScope,
required this.additionalMail,
required this.additionalMailScope,
this.displayname,
required this.displayname,
required this.displaynameScope,
required this.phone,
required this.phoneScope,
@ -18781,7 +18793,7 @@ class _$NextcloudProvisioningApiUserDetails extends NextcloudProvisioningApiUser
required this.locale,
this.notifyEmail,
required this.backendCapabilities,
this.displayName})
required this.displayName})
: super._() {
BuiltValueNullFieldError.checkNotNull(id, r'NextcloudProvisioningApiUserDetails', 'id');
BuiltValueNullFieldError.checkNotNull(lastLogin, r'NextcloudProvisioningApiUserDetails', 'lastLogin');
@ -18793,6 +18805,7 @@ class _$NextcloudProvisioningApiUserDetails extends NextcloudProvisioningApiUser
BuiltValueNullFieldError.checkNotNull(additionalMail, r'NextcloudProvisioningApiUserDetails', 'additionalMail');
BuiltValueNullFieldError.checkNotNull(
additionalMailScope, r'NextcloudProvisioningApiUserDetails', 'additionalMailScope');
BuiltValueNullFieldError.checkNotNull(displayname, r'NextcloudProvisioningApiUserDetails', 'displayname');
BuiltValueNullFieldError.checkNotNull(displaynameScope, r'NextcloudProvisioningApiUserDetails', 'displaynameScope');
BuiltValueNullFieldError.checkNotNull(phone, r'NextcloudProvisioningApiUserDetails', 'phone');
BuiltValueNullFieldError.checkNotNull(phoneScope, r'NextcloudProvisioningApiUserDetails', 'phoneScope');
@ -18821,6 +18834,7 @@ class _$NextcloudProvisioningApiUserDetails extends NextcloudProvisioningApiUser
BuiltValueNullFieldError.checkNotNull(locale, r'NextcloudProvisioningApiUserDetails', 'locale');
BuiltValueNullFieldError.checkNotNull(
backendCapabilities, r'NextcloudProvisioningApiUserDetails', 'backendCapabilities');
BuiltValueNullFieldError.checkNotNull(displayName, r'NextcloudProvisioningApiUserDetails', 'displayName');
}
@override
@ -19223,7 +19237,8 @@ class NextcloudProvisioningApiUserDetailsBuilder
emailScope, r'NextcloudProvisioningApiUserDetails', 'emailScope'),
additionalMail: additionalMail.build(),
additionalMailScope: additionalMailScope.build(),
displayname: displayname,
displayname: BuiltValueNullFieldError.checkNotNull(
displayname, r'NextcloudProvisioningApiUserDetails', 'displayname'),
displaynameScope: BuiltValueNullFieldError.checkNotNull(
displaynameScope, r'NextcloudProvisioningApiUserDetails', 'displaynameScope'),
phone: BuiltValueNullFieldError.checkNotNull(phone, r'NextcloudProvisioningApiUserDetails', 'phone'),
@ -19243,8 +19258,7 @@ class NextcloudProvisioningApiUserDetailsBuilder
twitterScope, r'NextcloudProvisioningApiUserDetails', 'twitterScope'),
organisation: BuiltValueNullFieldError.checkNotNull(
organisation, r'NextcloudProvisioningApiUserDetails', 'organisation'),
organisationScope: BuiltValueNullFieldError.checkNotNull(
organisationScope, r'NextcloudProvisioningApiUserDetails', 'organisationScope'),
organisationScope: BuiltValueNullFieldError.checkNotNull(organisationScope, r'NextcloudProvisioningApiUserDetails', 'organisationScope'),
role: BuiltValueNullFieldError.checkNotNull(role, r'NextcloudProvisioningApiUserDetails', 'role'),
roleScope: BuiltValueNullFieldError.checkNotNull(roleScope, r'NextcloudProvisioningApiUserDetails', 'roleScope'),
headline: BuiltValueNullFieldError.checkNotNull(headline, r'NextcloudProvisioningApiUserDetails', 'headline'),
@ -19260,7 +19274,7 @@ class NextcloudProvisioningApiUserDetailsBuilder
locale: BuiltValueNullFieldError.checkNotNull(locale, r'NextcloudProvisioningApiUserDetails', 'locale'),
notifyEmail: notifyEmail,
backendCapabilities: backendCapabilities.build(),
displayName: displayName);
displayName: BuiltValueNullFieldError.checkNotNull(displayName, r'NextcloudProvisioningApiUserDetails', 'displayName'));
} catch (_) {
late String _$failedField;
try {

7
packages/nextcloud/lib/src/nextcloud.openapi.json

@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "Nextcloud",
"version": "26.0.1",
"version": "27.0.0",
"description": "All supported Nextcloud APIs in one",
"license": {
"name": "agpl",
@ -755,6 +755,9 @@
"type": "object",
"additionalProperties": true,
"properties": {
"restore": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},
@ -1507,6 +1510,8 @@
"emailScope",
"additional_mail",
"additional_mailScope",
"display-name",
"displayname",
"displaynameScope",
"phone",
"phoneScope",

2
packages/nextcloud/lib/src/version_supported.dart

@ -1,7 +1,7 @@
part of '../nextcloud.dart';
/// Version of core/Server supported
const coreSupportedVersion = 26;
const coreSupportedVersion = 27;
/// API version of the news app supported
const newsSupportedVersion = 'v1-3';

5
packages/nextcloud/test/provisioning_api.dart

@ -1,4 +1,3 @@
import 'package:nextcloud/nextcloud.dart';
import 'package:test/test.dart';
import 'helper.dart';
@ -20,7 +19,7 @@ Future run(final DockerImage image) async {
test('Get current user', () async {
final user = await client.provisioningApi.getCurrentUser();
expect(user.ocs.data.id, 'user1');
expect(user.ocs.data.getDisplayName(), 'User One');
expect(user.ocs.data.displayname, 'User One');
expect(user.ocs.data.displaynameScope, 'v2-federated');
expect(user.ocs.data.language, 'en');
});
@ -28,7 +27,7 @@ Future run(final DockerImage image) async {
test('Get user by username', () async {
final user = await client.provisioningApi.getUser(userId: 'user1');
expect(user.ocs.data.id, 'user1');
expect(user.ocs.data.getDisplayName(), 'User One');
expect(user.ocs.data.displayname, 'User One');
expect(user.ocs.data.displaynameScope, 'v2-federated');
expect(user.ocs.data.language, 'en');
});

6
packages/nextcloud/test/webdav.dart

@ -47,7 +47,7 @@ Future run(final DockerImage image) async {
),
))
.responses;
expect(responses, hasLength(9));
expect(responses, hasLength(10));
final props =
responses.singleWhere((final response) => response.href!.endsWith('/Nextcloud.png')).propstats.first.prop;
expect(props.nchaspreview, isTrue);
@ -62,7 +62,7 @@ Future run(final DockerImage image) async {
depth: 'infinity',
))
.responses;
expect(responses, hasLength(37));
expect(responses, hasLength(48));
});
test('Create directory', () async {
@ -96,7 +96,7 @@ Future run(final DockerImage image) async {
),
))
.responses;
expect(responses, hasLength(11));
expect(responses, hasLength(12));
expect(
responses.singleWhere((final response) => response.href!.endsWith('/test.png')).propstats.first.prop.ocsize,
pngBytes.lengthInBytes,

5
specs/core.json

@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "Core",
"version": "26.0.1",
"version": "27.0.0",
"description": "Core functionality of Nextcloud",
"license": {
"name": "agpl",
@ -755,6 +755,9 @@
"type": "object",
"additionalProperties": true,
"properties": {
"restore": {
"type": "boolean"
},
"enabled": {
"type": "boolean"
},

2
specs/notifications.json

@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "Notifications",
"version": "2.14.0",
"version": "2.15.0",
"description": "This app provides a backend and frontend for the notification API available in Nextcloud.",
"license": {
"name": "agpl",

4
specs/provisioning_api.json

@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "Provisioning API",
"version": "1.16.0",
"version": "1.17.0",
"description": "This application enables a set of APIs that external systems can use to manage users, groups and apps.",
"license": {
"name": "agpl",
@ -112,6 +112,8 @@
"emailScope",
"additional_mail",
"additional_mailScope",
"display-name",
"displayname",
"displaynameScope",
"phone",
"phoneScope",

2
specs/templates/appinfo_core.xml

@ -4,6 +4,6 @@
<name>Core</name>
<summary>Core functionality of Nextcloud</summary>
<description><![CDATA[Core functionality of Nextcloud]]></description>
<version>26.0.1</version>
<version>27.0.0</version>
<licence>agpl</licence>
</info>

2
specs/templates/core.json

@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "Core",
"version": "26.0.1",
"version": "27.0.0",
"description": "Core functionality of Nextcloud",
"license": {
"name": "agpl",

2
specs/templates/notifications.json

@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "Notifications",
"version": "2.14.0",
"version": "2.15.0",
"description": "This app provides a backend and frontend for the notification API available in Nextcloud.",
"license": {
"name": "agpl",

10
specs/templates/provisioning_api.json

@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "Provisioning API",
"version": "1.16.0",
"version": "1.17.0",
"description": "This application enables a set of APIs that external systems can use to manage users, groups and apps.",
"license": {
"name": "agpl",
@ -562,6 +562,14 @@
"type": "string",
"default": ""
}
},
{
"name": "manager",
"in": "query",
"required": false,
"schema": {
"type": "string"
}
}
],
"responses": {

32
specs/templates/user_status.json

@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "User status",
"version": "1.6.0",
"version": "1.7.0",
"description": "User status",
"license": {
"name": "agpl",
@ -232,6 +232,36 @@
}
}
},
"/ocs/v2.php/apps/user_status/api/v1/user_status/revert/{messageId}": {
"parameters": [
{
"name": "messageId",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}
],
"delete": {
"operationId": "userstatus-revertstatus-TODO",
"tags": [
"user_status"
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"type": "string"
}
}
}
}
}
}
},
"/ocs/v2.php/apps/user_status/api/v1/predefined_statuses": {
"get": {
"operationId": "predefinedstatus-findall-TODO",

2
specs/user_status.json

@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "User status",
"version": "1.6.0",
"version": "1.7.0",
"description": "User status",
"license": {
"name": "agpl",

2
tool/Dockerfile.dev

@ -1,4 +1,4 @@
FROM nextcloud:26.0.1
FROM nextcloud:27.0.0
WORKDIR /usr/src/nextcloud
RUN chown -R www-data:www-data .
USER www-data

Loading…
Cancel
Save