Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat kmp sdk #1040

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 88 additions & 81 deletions composer.lock

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions example.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
include_once 'vendor/autoload.php';

use Appwrite\SDK\Language\GraphQL;
use Appwrite\SDK\Language\KMP;
use Appwrite\Spec\Swagger2;
use Appwrite\SDK\SDK;
use Appwrite\SDK\Language\Web;
Expand Down Expand Up @@ -464,6 +465,31 @@ function getSSLPage($url) {
;
$sdk->generate(__DIR__ . '/examples/android');

// KMP

$sdk = new SDK(new KMP(), new Swagger2($spec));

$sdk
->setName('KMP')
->setNamespace('io appwrite')
->setDescription('Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Flutter SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to https://appwrite.io/docs')
->setShortDescription('Appwrite KMP SDK')
->setURL('https://example.com')
->setGitUserName('appwrite')
->setGitRepoName('sdk-for-kmp')
->setLogo('https://appwrite.io/v1/images/console.png')
->setLicenseContent('test test test')
->setWarning('**This SDK is compatible with Appwrite server version 0.7.x. For older versions, please check previous releases.**')
->setChangelog('**CHANGELOG**')
->setVersion('0.0.0-SNAPSHOT')
->setTwitter('appwrite_io')
->setDiscord('564160730845151244', 'https://appwrite.io/discord')
->setDefaultHeaders([
'x-appwrite-response-format' => '1.6.0',
])
;
$sdk->generate(__DIR__ . '/examples/kmp');

// Kotlin
$sdk = new SDK(new Kotlin(), new Swagger2($spec));

Expand Down
4 changes: 2 additions & 2 deletions src/SDK/Language/Android.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,11 @@ public function getFiles(): array
];
}

protected function getReturnType(array $method, array $spec, string $namespace, string $generic = 'T'): string
protected function getReturnType(array $method, array $spec, string $namespace, string $generic = 'T', bool $withGeneric = true): string
{
if ($method['type'] === 'webAuth') {
return 'Bool';
}
return parent::getReturnType($method, $spec, $namespace, $generic);
return parent::getReturnType($method, $spec, $namespace, $generic, $withGeneric);
}
}
Loading