Browse Source

fix(tool,nextcloud): Fix capabilities

Signed-off-by: jld3103 <jld3103yt@gmail.com>
pull/597/head
jld3103 1 year ago
parent
commit
faab2e712f
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 2
      external/nextcloud-openapi-extractor
  2. 2
      external/nextcloud-server
  3. 1179
      packages/nextcloud/lib/src/api/core.openapi.dart
  4. 14929
      packages/nextcloud/lib/src/api/core.openapi.g.dart
  5. 1413
      packages/nextcloud/lib/src/api/core.openapi.json
  6. 2
      packages/nextcloud/lib/src/version_supported.dart
  7. 17
      packages/nextcloud/test/core_test.dart
  8. 2
      tool/generate-specs.sh

2
external/nextcloud-openapi-extractor vendored

@ -1 +1 @@
Subproject commit 5940a175e352d3cf7780e1c50dd572dfe04523b3
Subproject commit 85b552a0c82ac71e1f5660109113b6235156e92e

2
external/nextcloud-server vendored

@ -1 +1 @@
Subproject commit 8606f162c5b5b5d6a355e7e2f27e05585b3d0360
Subproject commit 020401b6c82930783188fd428b961ddd4a296656

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

File diff suppressed because it is too large Load Diff

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

File diff suppressed because it is too large Load Diff

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

File diff suppressed because it is too large Load Diff

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

@ -49,7 +49,7 @@ extension NotesVersionSupported on NotesClient {
///
/// Also returns the supported API version number
(bool, int) isSupported(final CoreOcsGetCapabilitiesResponse200ApplicationJson_Ocs_Data capabilities) => (
capabilities.capabilities.notes?.apiVersion
capabilities.capabilities.notesCapabilities?.notes.apiVersion
?.map(Version.parse)
.where((final version) => version.major == notesSupportedVersion)
.isNotEmpty ??

17
packages/nextcloud/test/core_test.dart

@ -45,17 +45,12 @@ void main() {
final capabilities = await client.core.ocs.getCapabilities();
expect(capabilities.ocs.data.version.major, coreSupportedVersion);
expect(capabilities.ocs.data.version.string, startsWith('$coreSupportedVersion.'));
expect(capabilities.ocs.data.capabilities.theming!.name, 'Nextcloud');
expect(capabilities.ocs.data.capabilities.theming!.url, 'https://nextcloud.com');
expect(capabilities.ocs.data.capabilities.theming!.slogan, 'a safe home for all your data');
expect(capabilities.ocs.data.capabilities.theming!.color, '#0082c9');
expect(capabilities.ocs.data.capabilities.theming!.colorText, '#ffffff');
expect(capabilities.ocs.data.capabilities.theming!.logo, isNotEmpty);
expect(capabilities.ocs.data.capabilities.theming!.background, isNotEmpty);
expect(capabilities.ocs.data.capabilities.theming!.backgroundPlain, false);
expect(capabilities.ocs.data.capabilities.theming!.backgroundDefault, true);
expect(capabilities.ocs.data.capabilities.theming!.logoheader, isNotEmpty);
expect(capabilities.ocs.data.capabilities.theming!.favicon, isNotEmpty);
expect(capabilities.ocs.data.capabilities.filesSharingCapabilities, isNotNull);
expect(capabilities.ocs.data.capabilities.notesCapabilities, isNotNull);
expect(capabilities.ocs.data.capabilities.notificationsCapabilities, isNotNull);
expect(capabilities.ocs.data.capabilities.provisioningApiCapabilities, isNotNull);
expect(capabilities.ocs.data.capabilities.themingPublicCapabilities, isNotNull);
expect(capabilities.ocs.data.capabilities.userStatusCapabilities, isNotNull);
});
test('Get navigation apps', () async {

2
tool/generate-specs.sh

@ -23,7 +23,7 @@ done
jq \
-s \
'.[0] * {paths: {"/ocs/v2.php/cloud/capabilities": {get: {responses: .[1].paths."/ocs/v2.php/cloud/capabilities".get.responses}}}}' \
'.[0] * {components: {schemas: .[1].components.schemas | with_entries(select(.key | endswith("Capabilities")))}, paths: {"/ocs/v2.php/cloud/capabilities": {get: {responses: .[1].paths."/ocs/v2.php/cloud/capabilities".get.responses}}}}' \
packages/nextcloud/lib/src/api/core.openapi.json \
/tmp/nextcloud-neon/merged.json \
> /tmp/nextcloud-neon/core.json

Loading…
Cancel
Save