Browse Source

specs,tool,nextcloud,neon: Generate merged specs with automatic prefixes

pull/168/head
jld3103 2 years ago
parent
commit
aa8e24b507
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 5
      packages/neon/lib/src/blocs/user_status.dart
  2. 4
      packages/neon/lib/src/widgets/account_avatar.dart
  3. 196
      packages/nextcloud/lib/src/nextcloud.openapi.dart
  4. 35
      packages/nextcloud/lib/src/nextcloud.openapi.g.dart
  5. 22
      packages/nextcloud/lib/src/nextcloud.openapi.json
  6. 98
      packages/nextcloud/test/user_status.dart
  7. 24
      specs/core.json
  8. 38
      specs/news.json
  9. 18
      specs/notes.json
  10. 32
      specs/notifications.json
  11. 10
      specs/provisioning_api.json
  12. 56
      specs/user_status.json
  13. 19
      tool/generate-nextcloud.sh

5
packages/neon/lib/src/blocs/user_status.dart

@ -3,7 +3,7 @@ part of '../neon.dart';
abstract class UserStatusBlocEvents {}
abstract class UserStatusBlocStates {
BehaviorSubject<Result<NextcloudUserStatus?>> get userStatus;
BehaviorSubject<Result<NextcloudUserStatusStatus?>> get userStatus;
}
class UserStatusBloc extends InteractiveBloc implements UserStatusBlocEvents, UserStatusBlocStates {
@ -30,7 +30,8 @@ class UserStatusBloc extends InteractiveBloc implements UserStatusBlocEvents, Us
}
@override
BehaviorSubject<Result<NextcloudUserStatus?>> userStatus = BehaviorSubject<Result<NextcloudUserStatus?>>();
BehaviorSubject<Result<NextcloudUserStatusStatus?>> userStatus =
BehaviorSubject<Result<NextcloudUserStatusStatus?>>();
@override
Future refresh() async {

4
packages/neon/lib/src/widgets/account_avatar.dart

@ -39,7 +39,7 @@ class AccountAvatar extends StatelessWidget {
),
),
),
ResultBuilder<UserStatusBloc, NextcloudUserStatus?>(
ResultBuilder<UserStatusBloc, NextcloudUserStatusStatus?>(
stream: Provider.of<AccountsBloc>(context, listen: false).getUserStatusBloc(account).userStatus,
builder: (final context, final userStatus) => SizedBox(
height: kAvatarSize,
@ -77,7 +77,7 @@ class AccountAvatar extends StatelessWidget {
);
}
Color _userStatusToColor(final NextcloudUserStatus userStatus) {
Color _userStatusToColor(final NextcloudUserStatusStatus userStatus) {
switch (userStatus.status) {
case NextcloudUserStatusType.online:
return const Color(0xFF49B382);

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

@ -1218,7 +1218,7 @@ class NextcloudUserStatusClient {
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
Future<NextcloudUserStatusGetUserStatus> getStatus() async {
Future<NextcloudUserStatusGetStatus> getStatus() async {
var path = '/ocs/v2.php/apps/user_status/api/v1/user_status';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
@ -1230,13 +1230,13 @@ class NextcloudUserStatusClient {
body,
);
if (response.statusCode == 200) {
return NextcloudUserStatusGetUserStatus.fromJson(
return NextcloudUserStatusGetStatus.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
Future<NextcloudUserStatusGetUserStatus> setStatus({required NextcloudUserStatusType statusType}) async {
Future<NextcloudUserStatusGetStatus> setStatus({required NextcloudUserStatusType statusType}) async {
var path = '/ocs/v2.php/apps/user_status/api/v1/user_status/status';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
@ -1249,13 +1249,13 @@ class NextcloudUserStatusClient {
body,
);
if (response.statusCode == 200) {
return NextcloudUserStatusGetUserStatus.fromJson(
return NextcloudUserStatusGetStatus.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
Future<NextcloudUserStatusGetUserStatus> setPredefinedMessage({
Future<NextcloudUserStatusGetStatus> setPredefinedMessage({
required String messageId,
int? clearAt,
}) async {
@ -1274,13 +1274,13 @@ class NextcloudUserStatusClient {
body,
);
if (response.statusCode == 200) {
return NextcloudUserStatusGetUserStatus.fromJson(
return NextcloudUserStatusGetStatus.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
Future<NextcloudUserStatusGetUserStatus> setCustomMessage({
Future<NextcloudUserStatusGetStatus> setCustomMessage({
String? statusIcon,
String? message,
int? clearAt,
@ -1305,7 +1305,7 @@ class NextcloudUserStatusClient {
body,
);
if (response.statusCode == 200) {
return NextcloudUserStatusGetUserStatus.fromJson(
return NextcloudUserStatusGetStatus.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
@ -1346,7 +1346,7 @@ class NextcloudUserStatusClient {
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
Future<NextcloudUserStatus> heartbeat({required NextcloudUserStatusType status}) async {
Future<NextcloudUserStatusStatus> heartbeat({required NextcloudUserStatusType status}) async {
var path = '/ocs/v2.php/apps/user_status/api/v1/heartbeat';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
@ -1359,7 +1359,8 @@ class NextcloudUserStatusClient {
body,
);
if (response.statusCode == 200) {
return NextcloudUserStatus.fromJson(json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
return NextcloudUserStatusStatus.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
@ -4632,14 +4633,14 @@ class NextcloudUserStatusClearAt {
static String? toJsonString(NextcloudUserStatusClearAt? data) => data == null ? null : json.encode(data.toJson());
}
class NextcloudUserStatusPublicUserStatus_ClearAt {
NextcloudUserStatusPublicUserStatus_ClearAt(
class NextcloudUserStatusPublicStatus_ClearAt {
NextcloudUserStatusPublicStatus_ClearAt(
this._data, {
this.userStatusClearAt,
this.$int,
});
factory NextcloudUserStatusPublicUserStatus_ClearAt.fromJson(dynamic data) {
factory NextcloudUserStatusPublicStatus_ClearAt.fromJson(dynamic data) {
NextcloudUserStatusClearAt? userStatusClearAt;
int? $int;
try {
@ -4648,7 +4649,7 @@ class NextcloudUserStatusPublicUserStatus_ClearAt {
try {
$int = (data as int);
} catch (_) {}
return NextcloudUserStatusPublicUserStatus_ClearAt(
return NextcloudUserStatusPublicStatus_ClearAt(
data,
userStatusClearAt: userStatusClearAt,
$int: $int,
@ -4656,8 +4657,8 @@ class NextcloudUserStatusPublicUserStatus_ClearAt {
}
// coverage:ignore-start
factory NextcloudUserStatusPublicUserStatus_ClearAt.fromJsonString(String data) =>
NextcloudUserStatusPublicUserStatus_ClearAt.fromJson(json.decode(data));
factory NextcloudUserStatusPublicStatus_ClearAt.fromJsonString(String data) =>
NextcloudUserStatusPublicStatus_ClearAt.fromJson(json.decode(data));
// coverage:ignore-end
final dynamic _data;
@ -4705,8 +4706,8 @@ enum NextcloudUserStatusType {
}
@JsonSerializable()
class NextcloudUserStatusPublicUserStatus {
NextcloudUserStatusPublicUserStatus({
class NextcloudUserStatusPublicStatus {
NextcloudUserStatusPublicStatus({
required this.userId,
this.message,
this.icon,
@ -4715,13 +4716,13 @@ class NextcloudUserStatusPublicUserStatus {
});
// coverage:ignore-start
factory NextcloudUserStatusPublicUserStatus.fromJson(Map<String, dynamic> json) =>
_$NextcloudUserStatusPublicUserStatusFromJson(json);
factory NextcloudUserStatusPublicStatus.fromJson(Map<String, dynamic> json) =>
_$NextcloudUserStatusPublicStatusFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUserStatusPublicUserStatus.fromJsonString(String data) =>
NextcloudUserStatusPublicUserStatus.fromJson(json.decode(data) as Map<String, dynamic>);
factory NextcloudUserStatusPublicStatus.fromJsonString(String data) =>
NextcloudUserStatusPublicStatus.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final String userId;
@ -4730,14 +4731,14 @@ class NextcloudUserStatusPublicUserStatus {
final String? icon;
final NextcloudUserStatusPublicUserStatus_ClearAt clearAt;
final NextcloudUserStatusPublicStatus_ClearAt clearAt;
final NextcloudUserStatusType status;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusPublicUserStatusToJson(this);
Map<String, dynamic> toJson() => _$NextcloudUserStatusPublicStatusToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUserStatusPublicUserStatus? data) =>
static String? toJsonString(NextcloudUserStatusPublicStatus? data) =>
data == null ? null : json.encode(data.toJson());
}
@ -4760,7 +4761,7 @@ class NextcloudUserStatusGetPublicStatuses_Ocs {
final NextcloudOCSMeta meta;
final List<NextcloudUserStatusPublicUserStatus> data;
final List<NextcloudUserStatusPublicStatus> data;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusGetPublicStatuses_OcsToJson(this);
@ -4795,17 +4796,17 @@ class NextcloudUserStatusGetPublicStatuses {
class NextcloudUserStatusGetPublicStatus_Ocs_Data {
NextcloudUserStatusGetPublicStatus_Ocs_Data(
this._data, {
this.userStatusPublicUserStatus,
this.userStatusPublicStatus,
});
factory NextcloudUserStatusGetPublicStatus_Ocs_Data.fromJson(dynamic data) {
NextcloudUserStatusPublicUserStatus? userStatusPublicUserStatus;
NextcloudUserStatusPublicStatus? userStatusPublicStatus;
try {
userStatusPublicUserStatus = NextcloudUserStatusPublicUserStatus.fromJson(data as Map<String, dynamic>);
userStatusPublicStatus = NextcloudUserStatusPublicStatus.fromJson(data as Map<String, dynamic>);
} catch (_) {}
return NextcloudUserStatusGetPublicStatus_Ocs_Data(
data,
userStatusPublicUserStatus: userStatusPublicUserStatus,
userStatusPublicStatus: userStatusPublicStatus,
);
}
@ -4816,7 +4817,7 @@ class NextcloudUserStatusGetPublicStatus_Ocs_Data {
final dynamic _data;
final NextcloudUserStatusPublicUserStatus? userStatusPublicUserStatus;
final NextcloudUserStatusPublicStatus? userStatusPublicStatus;
// coverage:ignore-start
dynamic toJson() => _data;
@ -4877,14 +4878,14 @@ class NextcloudUserStatusGetPublicStatus {
data == null ? null : json.encode(data.toJson());
}
class NextcloudUserStatus_ClearAt {
NextcloudUserStatus_ClearAt(
class NextcloudUserStatusStatus_ClearAt {
NextcloudUserStatusStatus_ClearAt(
this._data, {
this.userStatusClearAt,
this.$int,
});
factory NextcloudUserStatus_ClearAt.fromJson(dynamic data) {
factory NextcloudUserStatusStatus_ClearAt.fromJson(dynamic data) {
NextcloudUserStatusClearAt? userStatusClearAt;
int? $int;
try {
@ -4893,7 +4894,7 @@ class NextcloudUserStatus_ClearAt {
try {
$int = (data as int);
} catch (_) {}
return NextcloudUserStatus_ClearAt(
return NextcloudUserStatusStatus_ClearAt(
data,
userStatusClearAt: userStatusClearAt,
$int: $int,
@ -4901,8 +4902,8 @@ class NextcloudUserStatus_ClearAt {
}
// coverage:ignore-start
factory NextcloudUserStatus_ClearAt.fromJsonString(String data) =>
NextcloudUserStatus_ClearAt.fromJson(json.decode(data));
factory NextcloudUserStatusStatus_ClearAt.fromJsonString(String data) =>
NextcloudUserStatusStatus_ClearAt.fromJson(json.decode(data));
// coverage:ignore-end
final dynamic _data;
@ -4921,8 +4922,8 @@ class NextcloudUserStatus_ClearAt {
}
@JsonSerializable()
class NextcloudUserStatus {
NextcloudUserStatus({
class NextcloudUserStatusStatus {
NextcloudUserStatusStatus({
required this.userId,
this.message,
this.messageId,
@ -4934,12 +4935,12 @@ class NextcloudUserStatus {
});
// coverage:ignore-start
factory NextcloudUserStatus.fromJson(Map<String, dynamic> json) => _$NextcloudUserStatusFromJson(json);
factory NextcloudUserStatusStatus.fromJson(Map<String, dynamic> json) => _$NextcloudUserStatusStatusFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUserStatus.fromJsonString(String data) =>
NextcloudUserStatus.fromJson(json.decode(data) as Map<String, dynamic>);
factory NextcloudUserStatusStatus.fromJsonString(String data) =>
NextcloudUserStatusStatus.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final String userId;
@ -4952,43 +4953,43 @@ class NextcloudUserStatus {
final String? icon;
final NextcloudUserStatus_ClearAt clearAt;
final NextcloudUserStatusStatus_ClearAt clearAt;
final NextcloudUserStatusType status;
final bool statusIsUserDefined;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusToJson(this);
Map<String, dynamic> toJson() => _$NextcloudUserStatusStatusToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUserStatus? data) => data == null ? null : json.encode(data.toJson());
static String? toJsonString(NextcloudUserStatusStatus? data) => data == null ? null : json.encode(data.toJson());
}
class NextcloudUserStatusGetUserStatus_Ocs_Data {
NextcloudUserStatusGetUserStatus_Ocs_Data(
class NextcloudUserStatusGetStatus_Ocs_Data {
NextcloudUserStatusGetStatus_Ocs_Data(
this._data, {
this.userStatus,
this.userStatusStatus,
});
factory NextcloudUserStatusGetUserStatus_Ocs_Data.fromJson(dynamic data) {
NextcloudUserStatus? userStatus;
factory NextcloudUserStatusGetStatus_Ocs_Data.fromJson(dynamic data) {
NextcloudUserStatusStatus? userStatusStatus;
try {
userStatus = NextcloudUserStatus.fromJson(data as Map<String, dynamic>);
userStatusStatus = NextcloudUserStatusStatus.fromJson(data as Map<String, dynamic>);
} catch (_) {}
return NextcloudUserStatusGetUserStatus_Ocs_Data(
return NextcloudUserStatusGetStatus_Ocs_Data(
data,
userStatus: userStatus,
userStatusStatus: userStatusStatus,
);
}
// coverage:ignore-start
factory NextcloudUserStatusGetUserStatus_Ocs_Data.fromJsonString(String data) =>
NextcloudUserStatusGetUserStatus_Ocs_Data.fromJson(json.decode(data));
factory NextcloudUserStatusGetStatus_Ocs_Data.fromJsonString(String data) =>
NextcloudUserStatusGetStatus_Ocs_Data.fromJson(json.decode(data));
// coverage:ignore-end
final dynamic _data;
final NextcloudUserStatus? userStatus;
final NextcloudUserStatusStatus? userStatusStatus;
// coverage:ignore-start
dynamic toJson() => _data;
@ -4999,54 +5000,53 @@ class NextcloudUserStatusGetUserStatus_Ocs_Data {
}
@JsonSerializable()
class NextcloudUserStatusGetUserStatus_Ocs {
NextcloudUserStatusGetUserStatus_Ocs({
class NextcloudUserStatusGetStatus_Ocs {
NextcloudUserStatusGetStatus_Ocs({
required this.meta,
required this.data,
});
// coverage:ignore-start
factory NextcloudUserStatusGetUserStatus_Ocs.fromJson(Map<String, dynamic> json) =>
_$NextcloudUserStatusGetUserStatus_OcsFromJson(json);
factory NextcloudUserStatusGetStatus_Ocs.fromJson(Map<String, dynamic> json) =>
_$NextcloudUserStatusGetStatus_OcsFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUserStatusGetUserStatus_Ocs.fromJsonString(String data) =>
NextcloudUserStatusGetUserStatus_Ocs.fromJson(json.decode(data) as Map<String, dynamic>);
factory NextcloudUserStatusGetStatus_Ocs.fromJsonString(String data) =>
NextcloudUserStatusGetStatus_Ocs.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final NextcloudOCSMeta meta;
final NextcloudUserStatusGetUserStatus_Ocs_Data data;
final NextcloudUserStatusGetStatus_Ocs_Data data;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusGetUserStatus_OcsToJson(this);
Map<String, dynamic> toJson() => _$NextcloudUserStatusGetStatus_OcsToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUserStatusGetUserStatus_Ocs? data) =>
static String? toJsonString(NextcloudUserStatusGetStatus_Ocs? data) =>
data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUserStatusGetUserStatus {
NextcloudUserStatusGetUserStatus({required this.ocs});
class NextcloudUserStatusGetStatus {
NextcloudUserStatusGetStatus({required this.ocs});
// coverage:ignore-start
factory NextcloudUserStatusGetUserStatus.fromJson(Map<String, dynamic> json) =>
_$NextcloudUserStatusGetUserStatusFromJson(json);
factory NextcloudUserStatusGetStatus.fromJson(Map<String, dynamic> json) =>
_$NextcloudUserStatusGetStatusFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUserStatusGetUserStatus.fromJsonString(String data) =>
NextcloudUserStatusGetUserStatus.fromJson(json.decode(data) as Map<String, dynamic>);
factory NextcloudUserStatusGetStatus.fromJsonString(String data) =>
NextcloudUserStatusGetStatus.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final NextcloudUserStatusGetUserStatus_Ocs ocs;
final NextcloudUserStatusGetStatus_Ocs ocs;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusGetUserStatusToJson(this);
Map<String, dynamic> toJson() => _$NextcloudUserStatusGetStatusToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUserStatusGetUserStatus? data) =>
data == null ? null : json.encode(data.toJson());
static String? toJsonString(NextcloudUserStatusGetStatus? data) => data == null ? null : json.encode(data.toJson());
}
class NextcloudUserStatusPredefinedStatus_ClearAt {
@ -5733,10 +5733,10 @@ final _deserializers = <Type, dynamic Function(dynamic)>{
List<NextcloudUserStatusGetPublicStatuses_Ocs>: (final data) => (data as List)
.map((final e) => NextcloudUserStatusGetPublicStatuses_Ocs.fromJson(e as Map<String, dynamic>))
.toList(),
NextcloudUserStatusPublicUserStatus: (final data) =>
NextcloudUserStatusPublicUserStatus.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusPublicUserStatus>: (final data) =>
(data as List).map((final e) => NextcloudUserStatusPublicUserStatus.fromJson(e as Map<String, dynamic>)).toList(),
NextcloudUserStatusPublicStatus: (final data) =>
NextcloudUserStatusPublicStatus.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusPublicStatus>: (final data) =>
(data as List).map((final e) => NextcloudUserStatusPublicStatus.fromJson(e as Map<String, dynamic>)).toList(),
NextcloudUserStatusClearAt: (final data) => NextcloudUserStatusClearAt.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusClearAt>: (final data) =>
(data as List).map((final e) => NextcloudUserStatusClearAt.fromJson(e as Map<String, dynamic>)).toList(),
@ -5749,18 +5749,16 @@ final _deserializers = <Type, dynamic Function(dynamic)>{
List<NextcloudUserStatusGetPublicStatus_Ocs>: (final data) => (data as List)
.map((final e) => NextcloudUserStatusGetPublicStatus_Ocs.fromJson(e as Map<String, dynamic>))
.toList(),
NextcloudUserStatusGetUserStatus: (final data) =>
NextcloudUserStatusGetUserStatus.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusGetUserStatus>: (final data) =>
(data as List).map((final e) => NextcloudUserStatusGetUserStatus.fromJson(e as Map<String, dynamic>)).toList(),
NextcloudUserStatusGetUserStatus_Ocs: (final data) =>
NextcloudUserStatusGetUserStatus_Ocs.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusGetUserStatus_Ocs>: (final data) => (data as List)
.map((final e) => NextcloudUserStatusGetUserStatus_Ocs.fromJson(e as Map<String, dynamic>))
.toList(),
NextcloudUserStatus: (final data) => NextcloudUserStatus.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatus>: (final data) =>
(data as List).map((final e) => NextcloudUserStatus.fromJson(e as Map<String, dynamic>)).toList(),
NextcloudUserStatusGetStatus: (final data) => NextcloudUserStatusGetStatus.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusGetStatus>: (final data) =>
(data as List).map((final e) => NextcloudUserStatusGetStatus.fromJson(e as Map<String, dynamic>)).toList(),
NextcloudUserStatusGetStatus_Ocs: (final data) =>
NextcloudUserStatusGetStatus_Ocs.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusGetStatus_Ocs>: (final data) =>
(data as List).map((final e) => NextcloudUserStatusGetStatus_Ocs.fromJson(e as Map<String, dynamic>)).toList(),
NextcloudUserStatusStatus: (final data) => NextcloudUserStatusStatus.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusStatus>: (final data) =>
(data as List).map((final e) => NextcloudUserStatusStatus.fromJson(e as Map<String, dynamic>)).toList(),
NextcloudUserStatusPredefinedStatuses: (final data) =>
NextcloudUserStatusPredefinedStatuses.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusPredefinedStatuses>: (final data) => (data as List)
@ -6018,20 +6016,20 @@ final _serializers = <Type, dynamic Function(dynamic)>{
List<NextcloudUserStatusGetPublicStatuses>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusGetPublicStatuses_Ocs: (final data) => data.toJson(),
List<NextcloudUserStatusGetPublicStatuses_Ocs>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusPublicUserStatus: (final data) => data.toJson(),
List<NextcloudUserStatusPublicUserStatus>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusPublicStatus: (final data) => data.toJson(),
List<NextcloudUserStatusPublicStatus>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusClearAt: (final data) => data.toJson(),
List<NextcloudUserStatusClearAt>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusGetPublicStatus: (final data) => data.toJson(),
List<NextcloudUserStatusGetPublicStatus>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusGetPublicStatus_Ocs: (final data) => data.toJson(),
List<NextcloudUserStatusGetPublicStatus_Ocs>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusGetUserStatus: (final data) => data.toJson(),
List<NextcloudUserStatusGetUserStatus>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusGetUserStatus_Ocs: (final data) => data.toJson(),
List<NextcloudUserStatusGetUserStatus_Ocs>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatus: (final data) => data.toJson(),
List<NextcloudUserStatus>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusGetStatus: (final data) => data.toJson(),
List<NextcloudUserStatusGetStatus>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusGetStatus_Ocs: (final data) => data.toJson(),
List<NextcloudUserStatusGetStatus_Ocs>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusStatus: (final data) => data.toJson(),
List<NextcloudUserStatusStatus>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusPredefinedStatuses: (final data) => data.toJson(),
List<NextcloudUserStatusPredefinedStatuses>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusPredefinedStatuses_Ocs: (final data) => data.toJson(),

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

@ -1970,21 +1970,21 @@ const _$NextcloudUserStatusClearAt_TypeEnumMap = {
NextcloudUserStatusClearAt_Type.endOf: 'end-of',
};
NextcloudUserStatusPublicUserStatus _$NextcloudUserStatusPublicUserStatusFromJson(Map<String, dynamic> json) {
NextcloudUserStatusPublicStatus _$NextcloudUserStatusPublicStatusFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['userId', 'message', 'icon', 'clearAt', 'status'],
);
return NextcloudUserStatusPublicUserStatus(
return NextcloudUserStatusPublicStatus(
userId: json['userId'] as String,
message: json['message'] as String?,
icon: json['icon'] as String?,
clearAt: NextcloudUserStatusPublicUserStatus_ClearAt.fromJson(json['clearAt']),
clearAt: NextcloudUserStatusPublicStatus_ClearAt.fromJson(json['clearAt']),
status: $enumDecode(_$NextcloudUserStatusTypeEnumMap, json['status']),
);
}
Map<String, dynamic> _$NextcloudUserStatusPublicUserStatusToJson(NextcloudUserStatusPublicUserStatus instance) =>
Map<String, dynamic> _$NextcloudUserStatusPublicStatusToJson(NextcloudUserStatusPublicStatus instance) =>
<String, dynamic>{
'userId': instance.userId,
'message': instance.message,
@ -2009,7 +2009,7 @@ NextcloudUserStatusGetPublicStatuses_Ocs _$NextcloudUserStatusGetPublicStatuses_
return NextcloudUserStatusGetPublicStatuses_Ocs(
meta: NextcloudOCSMeta.fromJson(json['meta'] as Map<String, dynamic>),
data: (json['data'] as List<dynamic>)
.map((e) => NextcloudUserStatusPublicUserStatus.fromJson(e as Map<String, dynamic>))
.map((e) => NextcloudUserStatusPublicStatus.fromJson(e as Map<String, dynamic>))
.toList(),
);
}
@ -2068,7 +2068,7 @@ Map<String, dynamic> _$NextcloudUserStatusGetPublicStatusToJson(NextcloudUserSta
'ocs': instance.ocs.toJson(),
};
NextcloudUserStatus _$NextcloudUserStatusFromJson(Map<String, dynamic> json) {
NextcloudUserStatusStatus _$NextcloudUserStatusStatusFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const [
@ -2082,19 +2082,19 @@ NextcloudUserStatus _$NextcloudUserStatusFromJson(Map<String, dynamic> json) {
'statusIsUserDefined'
],
);
return NextcloudUserStatus(
return NextcloudUserStatusStatus(
userId: json['userId'] as String,
message: json['message'] as String?,
messageId: json['messageId'] as String?,
messageIsPredefined: json['messageIsPredefined'] as bool,
icon: json['icon'] as String?,
clearAt: NextcloudUserStatus_ClearAt.fromJson(json['clearAt']),
clearAt: NextcloudUserStatusStatus_ClearAt.fromJson(json['clearAt']),
status: $enumDecode(_$NextcloudUserStatusTypeEnumMap, json['status']),
statusIsUserDefined: json['statusIsUserDefined'] as bool,
);
}
Map<String, dynamic> _$NextcloudUserStatusToJson(NextcloudUserStatus instance) => <String, dynamic>{
Map<String, dynamic> _$NextcloudUserStatusStatusToJson(NextcloudUserStatusStatus instance) => <String, dynamic>{
'userId': instance.userId,
'message': instance.message,
'messageId': instance.messageId,
@ -2105,35 +2105,34 @@ Map<String, dynamic> _$NextcloudUserStatusToJson(NextcloudUserStatus instance) =
'statusIsUserDefined': instance.statusIsUserDefined,
};
NextcloudUserStatusGetUserStatus_Ocs _$NextcloudUserStatusGetUserStatus_OcsFromJson(Map<String, dynamic> json) {
NextcloudUserStatusGetStatus_Ocs _$NextcloudUserStatusGetStatus_OcsFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['meta', 'data'],
);
return NextcloudUserStatusGetUserStatus_Ocs(
return NextcloudUserStatusGetStatus_Ocs(
meta: NextcloudOCSMeta.fromJson(json['meta'] as Map<String, dynamic>),
data: NextcloudUserStatusGetUserStatus_Ocs_Data.fromJson(json['data']),
data: NextcloudUserStatusGetStatus_Ocs_Data.fromJson(json['data']),
);
}
Map<String, dynamic> _$NextcloudUserStatusGetUserStatus_OcsToJson(NextcloudUserStatusGetUserStatus_Ocs instance) =>
Map<String, dynamic> _$NextcloudUserStatusGetStatus_OcsToJson(NextcloudUserStatusGetStatus_Ocs instance) =>
<String, dynamic>{
'meta': instance.meta.toJson(),
'data': instance.data.toJson(),
};
NextcloudUserStatusGetUserStatus _$NextcloudUserStatusGetUserStatusFromJson(Map<String, dynamic> json) {
NextcloudUserStatusGetStatus _$NextcloudUserStatusGetStatusFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['ocs'],
);
return NextcloudUserStatusGetUserStatus(
ocs: NextcloudUserStatusGetUserStatus_Ocs.fromJson(json['ocs'] as Map<String, dynamic>),
return NextcloudUserStatusGetStatus(
ocs: NextcloudUserStatusGetStatus_Ocs.fromJson(json['ocs'] as Map<String, dynamic>),
);
}
Map<String, dynamic> _$NextcloudUserStatusGetUserStatusToJson(NextcloudUserStatusGetUserStatus instance) =>
<String, dynamic>{
Map<String, dynamic> _$NextcloudUserStatusGetStatusToJson(NextcloudUserStatusGetStatus instance) => <String, dynamic>{
'ocs': instance.ocs.toJson(),
};

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

@ -1842,7 +1842,7 @@
"invisible"
]
},
"UserStatusGetUserStatus": {
"UserStatusGetStatus": {
"type": "object",
"required": [
"ocs"
@ -1861,7 +1861,7 @@
"data": {
"anyOf": [
{
"$ref": "#/components/schemas/UserStatus"
"$ref": "#/components/schemas/UserStatusStatus"
}
]
}
@ -1888,7 +1888,7 @@
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserStatusPublicUserStatus"
"$ref": "#/components/schemas/UserStatusPublicStatus"
}
}
}
@ -1914,7 +1914,7 @@
"data": {
"anyOf": [
{
"$ref": "#/components/schemas/UserStatusPublicUserStatus"
"$ref": "#/components/schemas/UserStatusPublicStatus"
}
]
}
@ -1922,7 +1922,7 @@
}
}
},
"UserStatus": {
"UserStatusStatus": {
"type": "object",
"required": [
"userId",
@ -1966,7 +1966,7 @@
}
}
},
"UserStatusPublicUserStatus": {
"UserStatusPublicStatus": {
"type": "object",
"required": [
"userId",
@ -3524,7 +3524,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus"
"$ref": "#/components/schemas/UserStatusGetStatus"
}
}
}
@ -3554,7 +3554,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus"
"$ref": "#/components/schemas/UserStatusGetStatus"
}
}
}
@ -3592,7 +3592,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus"
"$ref": "#/components/schemas/UserStatusGetStatus"
}
}
}
@ -3638,7 +3638,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus"
"$ref": "#/components/schemas/UserStatusGetStatus"
}
}
}
@ -3701,7 +3701,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatus"
"$ref": "#/components/schemas/UserStatusStatus"
}
}
}

98
packages/nextcloud/test/user_status.dart

@ -52,15 +52,15 @@ Future run(final DockerImage image) async {
test('Set status', () async {
final response = await client.userStatus.setStatus(statusType: NextcloudUserStatusType.online);
expect(response.ocs.data.userStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, null);
expect(response.ocs.data.userStatus!.messageId, null);
expect(response.ocs.data.userStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatus!.icon, null);
expect(response.ocs.data.userStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatus!.clearAt.$int, null);
expect(response.ocs.data.userStatus!.status, NextcloudUserStatusType.online);
expect(response.ocs.data.userStatus!.statusIsUserDefined, true);
expect(response.ocs.data.userStatusStatus!.userId, 'user1');
expect(response.ocs.data.userStatusStatus!.message, null);
expect(response.ocs.data.userStatusStatus!.messageId, null);
expect(response.ocs.data.userStatusStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatusStatus!.icon, null);
expect(response.ocs.data.userStatusStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatusStatus!.clearAt.$int, null);
expect(response.ocs.data.userStatusStatus!.status, NextcloudUserStatusType.online);
expect(response.ocs.data.userStatusStatus!.statusIsUserDefined, true);
});
test('Get status', () async {
@ -69,15 +69,15 @@ Future run(final DockerImage image) async {
await client.userStatus.setStatus(statusType: NextcloudUserStatusType.online);
final response = await client.userStatus.getStatus();
expect(response.ocs.data.userStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, null);
expect(response.ocs.data.userStatus!.messageId, null);
expect(response.ocs.data.userStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatus!.icon, null);
expect(response.ocs.data.userStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatus!.clearAt.$int, null);
expect(response.ocs.data.userStatus!.status, NextcloudUserStatusType.online);
expect(response.ocs.data.userStatus!.statusIsUserDefined, true);
expect(response.ocs.data.userStatusStatus!.userId, 'user1');
expect(response.ocs.data.userStatusStatus!.message, null);
expect(response.ocs.data.userStatusStatus!.messageId, null);
expect(response.ocs.data.userStatusStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatusStatus!.icon, null);
expect(response.ocs.data.userStatusStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatusStatus!.clearAt.$int, null);
expect(response.ocs.data.userStatusStatus!.status, NextcloudUserStatusType.online);
expect(response.ocs.data.userStatusStatus!.statusIsUserDefined, true);
});
test('Find all statuses', () async {
@ -101,12 +101,12 @@ Future run(final DockerImage image) async {
await client.userStatus.setStatus(statusType: NextcloudUserStatusType.online);
final response = await client.userStatus.getPublicStatus(userId: 'user1');
expect(response.ocs.data.userStatusPublicUserStatus!.userId, 'user1');
expect(response.ocs.data.userStatusPublicUserStatus!.message, null);
expect(response.ocs.data.userStatusPublicUserStatus!.icon, null);
expect(response.ocs.data.userStatusPublicUserStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatusPublicUserStatus!.clearAt.$int, null);
expect(response.ocs.data.userStatusPublicUserStatus!.status, NextcloudUserStatusType.online);
expect(response.ocs.data.userStatusPublicStatus!.userId, 'user1');
expect(response.ocs.data.userStatusPublicStatus!.message, null);
expect(response.ocs.data.userStatusPublicStatus!.icon, null);
expect(response.ocs.data.userStatusPublicStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatusPublicStatus!.clearAt.$int, null);
expect(response.ocs.data.userStatusPublicStatus!.status, NextcloudUserStatusType.online);
});
test('Set predefined message', () async {
@ -115,14 +115,14 @@ Future run(final DockerImage image) async {
messageId: 'meeting',
clearAt: clearAt,
);
expect(response.ocs.data.userStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, null);
expect(response.ocs.data.userStatus!.messageId, 'meeting');
expect(response.ocs.data.userStatus!.messageIsPredefined, true);
expect(response.ocs.data.userStatus!.icon, null);
expect(response.ocs.data.userStatus!.clearAt.$int, clearAt);
expect(response.ocs.data.userStatus!.status, NextcloudUserStatusType.offline);
expect(response.ocs.data.userStatus!.statusIsUserDefined, false);
expect(response.ocs.data.userStatusStatus!.userId, 'user1');
expect(response.ocs.data.userStatusStatus!.message, null);
expect(response.ocs.data.userStatusStatus!.messageId, 'meeting');
expect(response.ocs.data.userStatusStatus!.messageIsPredefined, true);
expect(response.ocs.data.userStatusStatus!.icon, null);
expect(response.ocs.data.userStatusStatus!.clearAt.$int, clearAt);
expect(response.ocs.data.userStatusStatus!.status, NextcloudUserStatusType.offline);
expect(response.ocs.data.userStatusStatus!.statusIsUserDefined, false);
});
test('Set custom message', () async {
@ -132,14 +132,14 @@ Future run(final DockerImage image) async {
message: 'bla',
clearAt: clearAt,
);
expect(response.ocs.data.userStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, 'bla');
expect(response.ocs.data.userStatus!.messageId, null);
expect(response.ocs.data.userStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatus!.icon, '😀');
expect(response.ocs.data.userStatus!.clearAt.$int, clearAt);
expect(response.ocs.data.userStatus!.status, NextcloudUserStatusType.offline);
expect(response.ocs.data.userStatus!.statusIsUserDefined, false);
expect(response.ocs.data.userStatusStatus!.userId, 'user1');
expect(response.ocs.data.userStatusStatus!.message, 'bla');
expect(response.ocs.data.userStatusStatus!.messageId, null);
expect(response.ocs.data.userStatusStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatusStatus!.icon, '😀');
expect(response.ocs.data.userStatusStatus!.clearAt.$int, clearAt);
expect(response.ocs.data.userStatusStatus!.status, NextcloudUserStatusType.offline);
expect(response.ocs.data.userStatusStatus!.statusIsUserDefined, false);
});
test('Clear message', () async {
@ -152,15 +152,15 @@ Future run(final DockerImage image) async {
await client.userStatus.clearMessage();
final response = await client.userStatus.getStatus();
expect(response.ocs.data.userStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, null);
expect(response.ocs.data.userStatus!.messageId, null);
expect(response.ocs.data.userStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatus!.icon, null);
expect(response.ocs.data.userStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatus!.clearAt.$int, null);
expect(response.ocs.data.userStatus!.status, NextcloudUserStatusType.offline);
expect(response.ocs.data.userStatus!.statusIsUserDefined, false);
expect(response.ocs.data.userStatusStatus!.userId, 'user1');
expect(response.ocs.data.userStatusStatus!.message, null);
expect(response.ocs.data.userStatusStatus!.messageId, null);
expect(response.ocs.data.userStatusStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatusStatus!.icon, null);
expect(response.ocs.data.userStatusStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatusStatus!.clearAt.$int, null);
expect(response.ocs.data.userStatusStatus!.status, NextcloudUserStatusType.offline);
expect(response.ocs.data.userStatusStatus!.statusIsUserDefined, false);
});
test('Heartbeat', () async {

24
specs/core.json

@ -81,7 +81,7 @@
}
}
},
"CoreServerStatus": {
"ServerStatus": {
"type": "object",
"required": [
"installed",
@ -120,7 +120,7 @@
}
}
},
"CoreServerCapabilities": {
"ServerCapabilities": {
"type": "object",
"required": [
"ocs"
@ -783,7 +783,7 @@
}
}
},
"CoreNavigationApps": {
"NavigationApps": {
"type": "object",
"required": [
"ocs"
@ -857,7 +857,7 @@
}
}
},
"CoreLoginFlowInit": {
"LoginFlowInit": {
"type": "object",
"required": [
"poll",
@ -884,7 +884,7 @@
}
}
},
"CoreLoginFlowResult": {
"LoginFlowResult": {
"type": "object",
"required": [
"server",
@ -903,7 +903,7 @@
}
}
},
"CoreAutocompleteResult": {
"AutocompleteResult": {
"type": "object",
"required": [
"ocs"
@ -986,7 +986,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CoreServerStatus"
"$ref": "#/components/schemas/ServerStatus"
}
}
}
@ -1006,7 +1006,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CoreServerCapabilities"
"$ref": "#/components/schemas/ServerCapabilities"
}
}
}
@ -1026,7 +1026,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CoreNavigationApps"
"$ref": "#/components/schemas/NavigationApps"
}
}
}
@ -1046,7 +1046,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CoreLoginFlowInit"
"$ref": "#/components/schemas/LoginFlowInit"
}
}
}
@ -1076,7 +1076,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CoreLoginFlowResult"
"$ref": "#/components/schemas/LoginFlowResult"
}
}
}
@ -1306,7 +1306,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/CoreAutocompleteResult"
"$ref": "#/components/schemas/AutocompleteResult"
}
}
}

38
specs/news.json

@ -81,7 +81,7 @@
}
}
},
"NewsListFeeds": {
"ListFeeds": {
"type": "object",
"required": [
"feeds"
@ -96,12 +96,12 @@
"feeds": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NewsFeed"
"$ref": "#/components/schemas/Feed"
}
}
}
},
"NewsFeed": {
"Feed": {
"type": "object",
"required": [
"id",
@ -154,12 +154,12 @@
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NewsArticle"
"$ref": "#/components/schemas/Article"
}
}
}
},
"NewsArticle": {
"Article": {
"type": "object",
"required": [
"id",
@ -239,7 +239,7 @@
}
}
},
"NewsListArticles": {
"ListArticles": {
"type": "object",
"required": [
"items"
@ -248,12 +248,12 @@
"items": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NewsArticle"
"$ref": "#/components/schemas/Article"
}
}
}
},
"NewsListFolders": {
"ListFolders": {
"type": "object",
"required": [
"folders"
@ -262,12 +262,12 @@
"folders": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NewsFolder"
"$ref": "#/components/schemas/Folder"
}
}
}
},
"NewsFolder": {
"Folder": {
"type": "object",
"required": [
"id",
@ -290,12 +290,12 @@
"deprecated": true,
"type": "array",
"items": {
"$ref": "#/components/schemas/NewsFeed"
"$ref": "#/components/schemas/Feed"
}
}
}
},
"NewsSupportedAPIVersions": {
"SupportedAPIVersions": {
"type": "object",
"properties": {
"apiLevels": {
@ -327,7 +327,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NewsSupportedAPIVersions"
"$ref": "#/components/schemas/SupportedAPIVersions"
}
}
}
@ -347,7 +347,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NewsListFolders"
"$ref": "#/components/schemas/ListFolders"
}
}
}
@ -375,7 +375,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NewsListFolders"
"$ref": "#/components/schemas/ListFolders"
}
}
}
@ -474,7 +474,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NewsListFeeds"
"$ref": "#/components/schemas/ListFeeds"
}
}
}
@ -510,7 +510,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NewsListFeeds"
"$ref": "#/components/schemas/ListFeeds"
}
}
}
@ -708,7 +708,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NewsListArticles"
"$ref": "#/components/schemas/ListArticles"
}
}
}
@ -757,7 +757,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NewsListArticles"
"$ref": "#/components/schemas/ListArticles"
}
}
}

18
specs/notes.json

@ -81,7 +81,7 @@
}
}
},
"NotesNote": {
"Note": {
"type": "object",
"required": [
"id",
@ -128,7 +128,7 @@
}
}
},
"NotesSettings": {
"Settings": {
"type": "object",
"required": [
"notesPath",
@ -226,7 +226,7 @@
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NotesNote"
"$ref": "#/components/schemas/Note"
}
}
}
@ -292,7 +292,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotesNote"
"$ref": "#/components/schemas/Note"
}
}
}
@ -340,7 +340,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotesNote"
"$ref": "#/components/schemas/Note"
}
}
}
@ -408,7 +408,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotesNote"
"$ref": "#/components/schemas/Note"
}
}
}
@ -446,7 +446,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotesSettings"
"$ref": "#/components/schemas/Settings"
}
}
}
@ -463,7 +463,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotesSettings"
"$ref": "#/components/schemas/Settings"
}
}
}
@ -474,7 +474,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotesSettings"
"$ref": "#/components/schemas/Settings"
}
}
}

32
specs/notifications.json

@ -81,7 +81,7 @@
}
}
},
"NotificationsNotification": {
"Notification": {
"type": "object",
"required": [
"notification_id",
@ -156,12 +156,12 @@
"actions": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NotificationsNotificationAction"
"$ref": "#/components/schemas/NotificationAction"
}
}
}
},
"NotificationsNotificationAction": {
"NotificationAction": {
"type": "object",
"required": [
"label",
@ -183,7 +183,7 @@
}
}
},
"NotificationsListNotifications": {
"ListNotifications": {
"type": "object",
"required": [
"ocs"
@ -202,14 +202,14 @@
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/NotificationsNotification"
"$ref": "#/components/schemas/Notification"
}
}
}
}
}
},
"NotificationsGetNotification": {
"GetNotification": {
"type": "object",
"required": [
"ocs"
@ -226,13 +226,13 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"$ref": "#/components/schemas/NotificationsNotification"
"$ref": "#/components/schemas/Notification"
}
}
}
}
},
"NotificationsPushServerSubscription": {
"PushServerSubscription": {
"type": "object",
"required": [
"publicKey",
@ -254,7 +254,7 @@
}
}
},
"NotificationsPushServerRegistration": {
"PushServerRegistration": {
"type": "object",
"required": [
"ocs"
@ -271,13 +271,13 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"$ref": "#/components/schemas/NotificationsPushServerSubscription"
"$ref": "#/components/schemas/PushServerSubscription"
}
}
}
}
},
"NotificationsPushNotification": {
"PushNotification": {
"type": "object",
"required": [
"accountID",
@ -296,11 +296,11 @@
"type": "string"
},
"subject": {
"$ref": "#/components/schemas/NotificationsPushNotificationDecryptedSubject"
"$ref": "#/components/schemas/PushNotificationDecryptedSubject"
}
}
},
"NotificationsPushNotificationDecryptedSubject": {
"PushNotificationDecryptedSubject": {
"type": "object",
"properties": {
"nid": {
@ -347,7 +347,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationsListNotifications"
"$ref": "#/components/schemas/ListNotifications"
}
}
}
@ -395,7 +395,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationsGetNotification"
"$ref": "#/components/schemas/GetNotification"
}
}
}
@ -460,7 +460,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationsPushServerRegistration"
"$ref": "#/components/schemas/PushServerRegistration"
}
}
}

10
specs/provisioning_api.json

@ -81,7 +81,7 @@
}
}
},
"ProvisioningApiUser": {
"User": {
"type": "object",
"required": [
"ocs"
@ -98,13 +98,13 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"$ref": "#/components/schemas/ProvisioningApiUserDetails"
"$ref": "#/components/schemas/UserDetails"
}
}
}
}
},
"ProvisioningApiUserDetails": {
"UserDetails": {
"type": "object",
"required": [
"storageLocation",
@ -327,7 +327,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProvisioningApiUser"
"$ref": "#/components/schemas/User"
}
}
}
@ -357,7 +357,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProvisioningApiUser"
"$ref": "#/components/schemas/User"
}
}
}

56
specs/user_status.json

@ -81,7 +81,7 @@
}
}
},
"UserStatusPredefinedStatuses": {
"PredefinedStatuses": {
"type": "object",
"required": [
"ocs"
@ -100,14 +100,14 @@
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserStatusPredefinedStatus"
"$ref": "#/components/schemas/PredefinedStatus"
}
}
}
}
}
},
"UserStatusPredefinedStatus": {
"PredefinedStatus": {
"type": "object",
"required": [
"id",
@ -128,7 +128,7 @@
"clearAt": {
"anyOf": [
{
"$ref": "#/components/schemas/UserStatusClearAt"
"$ref": "#/components/schemas/ClearAt"
},
{
"type": "integer",
@ -138,7 +138,7 @@
}
}
},
"UserStatusClearAt": {
"ClearAt": {
"type": "object",
"required": [
"type",
@ -169,7 +169,7 @@
}
}
},
"UserStatusType": {
"Type": {
"type": "string",
"enum": [
"online",
@ -179,7 +179,7 @@
"invisible"
]
},
"UserStatusGetUserStatus": {
"GetStatus": {
"type": "object",
"required": [
"ocs"
@ -198,7 +198,7 @@
"data": {
"anyOf": [
{
"$ref": "#/components/schemas/UserStatus"
"$ref": "#/components/schemas/Status"
}
]
}
@ -206,7 +206,7 @@
}
}
},
"UserStatusGetPublicStatuses": {
"GetPublicStatuses": {
"type": "object",
"required": [
"ocs"
@ -225,14 +225,14 @@
"data": {
"type": "array",
"items": {
"$ref": "#/components/schemas/UserStatusPublicUserStatus"
"$ref": "#/components/schemas/PublicStatus"
}
}
}
}
}
},
"UserStatusGetPublicStatus": {
"GetPublicStatus": {
"type": "object",
"required": [
"ocs"
@ -251,7 +251,7 @@
"data": {
"anyOf": [
{
"$ref": "#/components/schemas/UserStatusPublicUserStatus"
"$ref": "#/components/schemas/PublicStatus"
}
]
}
@ -259,7 +259,7 @@
}
}
},
"UserStatus": {
"Status": {
"type": "object",
"required": [
"userId",
@ -287,7 +287,7 @@
"clearAt": {
"anyOf": [
{
"$ref": "#/components/schemas/UserStatusClearAt"
"$ref": "#/components/schemas/ClearAt"
},
{
"type": "integer",
@ -296,14 +296,14 @@
]
},
"status": {
"$ref": "#/components/schemas/UserStatusType"
"$ref": "#/components/schemas/Type"
},
"statusIsUserDefined": {
"type": "boolean"
}
}
},
"UserStatusPublicUserStatus": {
"PublicStatus": {
"type": "object",
"required": [
"userId",
@ -323,7 +323,7 @@
"clearAt": {
"anyOf": [
{
"$ref": "#/components/schemas/UserStatusClearAt"
"$ref": "#/components/schemas/ClearAt"
},
{
"type": "integer",
@ -332,7 +332,7 @@
]
},
"status": {
"$ref": "#/components/schemas/UserStatusType"
"$ref": "#/components/schemas/Type"
}
}
}
@ -357,7 +357,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatusGetPublicStatuses"
"$ref": "#/components/schemas/GetPublicStatuses"
}
}
}
@ -387,7 +387,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatusGetPublicStatus"
"$ref": "#/components/schemas/GetPublicStatus"
}
}
}
@ -407,7 +407,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus"
"$ref": "#/components/schemas/GetStatus"
}
}
}
@ -427,7 +427,7 @@
"in": "query",
"required": true,
"schema": {
"$ref": "#/components/schemas/UserStatusType"
"$ref": "#/components/schemas/Type"
}
}
],
@ -437,7 +437,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus"
"$ref": "#/components/schemas/GetStatus"
}
}
}
@ -475,7 +475,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus"
"$ref": "#/components/schemas/GetStatus"
}
}
}
@ -521,7 +521,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus"
"$ref": "#/components/schemas/GetStatus"
}
}
}
@ -554,7 +554,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatusPredefinedStatuses"
"$ref": "#/components/schemas/PredefinedStatuses"
}
}
}
@ -574,7 +574,7 @@
"in": "query",
"required": true,
"schema": {
"$ref": "#/components/schemas/UserStatusType"
"$ref": "#/components/schemas/Type"
}
}
],
@ -584,7 +584,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatus"
"$ref": "#/components/schemas/Status"
}
}
}

19
tool/generate-nextcloud.sh

@ -6,12 +6,25 @@ rm -rf /tmp/nextcloud-neon
mkdir -p /tmp/nextcloud-neon
codenames=(core news notes notifications provisioning_api user_status)
prefixes=(Core News Notes Notifications ProvisioningApi UserStatus)
base_spec=/tmp/nextcloud-neon/base.json
merged_spec=/tmp/nextcloud-neon/merged.json
for codename in ${codenames[*]}; do
for i in $(seq 0 $((${#codenames[@]} - 1))); do
codename=${codenames[i]}
prefix=${prefixes[i]}
cp specs/"$codename".json /tmp/nextcloud-neon/"$codename".json
jq \
--arg prefix "$prefix" \
-s \
'.[]
| .components.schemas = (.components.schemas | with_entries(.key = if .key == "OCSMeta" or .key == "EmptyOCS" then .key else $prefix + .key end))
| walk(if type == "object" and has("$ref") and ."$ref" != "#/components/schemas/OCSMeta" and ."$ref" != "#/components/schemas/EmptyOCS" then ."$ref" |= sub("#/components/schemas/";"#/components/schemas/" + $prefix) else . end)' \
/tmp/nextcloud-neon/"$codename".json \
> /tmp/nextcloud-neon/"$codename"-prefixed.json
if [ ! -f $base_spec ]; then
cp specs/"$codename".json $base_spec
cp /tmp/nextcloud-neon/"$codename"-prefixed.json $base_spec
else
jq \
-s \
@ -23,7 +36,7 @@ for codename in ${codenames[*]}; do
paths: (.[0].paths * .[1].paths),
}' \
$base_spec \
specs/"$codename".json \
/tmp/nextcloud-neon/"$codename"-prefixed.json \
> $merged_spec
cp $merged_spec $base_spec
fi

Loading…
Cancel
Save