Skip to content

Feat kmp sdk #1040

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

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
21d70cc
Initial twig translation of KMP SDK
camka14 Jan 14, 2025
8ade1e3
Add Test Generation,
camka14 Jan 17, 2025
eb33d83
Fix Test and Release compiling
camka14 Jan 29, 2025
9c5993f
Pass all tests
camka14 Feb 18, 2025
fd9cb4b
Merge branch 'master' of https://github.com/appwrite/sdk-generator in…
camka14 Feb 18, 2025
ec73e97
Remove Document twig file, remove Document type form RealtimModels
camka14 Feb 18, 2025
876e363
Update x-appwrite-response-format to 1.6.0
camka14 Feb 19, 2025
e9e3b6f
Fix OAuth2 login handling
elesey Feb 22, 2025
af0861d
Merge branch 'master' of https://github.com/appwrite/sdk-generator in…
camka14 Feb 23, 2025
a98cca2
Switch WebAuthComponent to activity instead of context
elesey Feb 23, 2025
94f4042
Add OAuth2 handling
elesey Feb 27, 2025
193d171
Merge branch 'master' of https://github.com/appwrite/sdk-generator in…
camka14 Feb 27, 2025
eebc424
Fix iOS and JVM OAuth2Extensions class names
camka14 Feb 28, 2025
c75c8c1
Fix update and create document methods
camka14 Mar 13, 2025
6b9a5b3
Fix old cookies being used when domain is preceded by "."
camka14 Mar 18, 2025
085f227
Fix socket creation in Realtime.kt
camka14 Apr 5, 2025
3c5dc82
Fix encoding prefs error
camka14 May 13, 2025
cf1aeb8
Merge branch 'master' of https://github.com/appwrite/sdk-generator in…
camka14 May 22, 2025
9e4a3ca
PR Changes per comments
camka14 May 22, 2025
763ec35
Revert uninteded changes
camka14 May 22, 2025
072ad1a
Revert Uninteded File Change
camka14 May 22, 2025
40bc4d0
Replace io.appwrite with proper value
camka14 May 22, 2025
4b215e0
Update KMP tests, replace spec.namespace with sdk.namespace where nee…
camka14 May 27, 2025
930fac1
Refactor iOS OAuth2 authentication
elesey May 30, 2025
19aa2d5
Remove println in iosCookieStorage
elesey May 30, 2025
90ba7b7
Incorrect new line
camka14 Jun 1, 2025
d7ae324
Added variables for ios client headers
camka14 Jun 1, 2025
9d5868b
AppwriteException incorrect Case
camka14 Jun 1, 2025
107321d
Fix error thrown outside of scope in iOS OAuth Cancellation
camka14 Jun 6, 2025
c606846
Fix iOS cookie storage not recreating cookies properly
camka14 Jun 6, 2025
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
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 @@ -465,6 +466,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