Skip to content

Commit 5fcd4fb

Browse files
Merge branch 'master' of https://github.com/appwrite/sdk-generator into feat-web-response-models
2 parents 92a5b46 + 5a57afe commit 5fcd4fb

File tree

100 files changed

+6605
-362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+6605
-362
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,8 @@ examples/*
1111

1212
# exception to the rule
1313
!examples/.gitkeep
14-
.DS_Store
14+
**/.DS_Store
15+
templates/swift/example/.build
16+
templates/swift/example/Example.xcodeproj/project.xcworkspace/xcuserdata
17+
templates/swift/example/Example.xcodeproj/xcuserdata
18+
**/xcuserdata

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ docker run --rm -v $(pwd):$(pwd):rw -w $(pwd) -v /var/run/docker.sock:/var/run/d
229229
* **path** -> Path to API without a basePath
230230
* **fullPath** -> Path to API with basePath
231231
* **name** -> Name of API Method
232-
* **packaging** -> A flag to indicate if the files at a path need to be packaged as a tarfile
232+
* **packaging** -> A flag to indicate if the files at a path need to be packaged as a tar file
233233
* **title** -> Title of API Method
234234
* **description** -> Description of API Method
235235
* **security** -> Array of security methods for this API Call. Primarily used for code examples.
@@ -259,7 +259,7 @@ docker run --rm -v $(pwd):$(pwd):rw -w $(pwd) -v /var/run/docker.sock:/var/run/d
259259

260260
* **language** -- Information on the current language SDK
261261
* **name** -> Name of language
262-
* **params** -> Custom langauge specific parameters
262+
* **params** -> Custom language specific parameters
263263

264264
* **sdk** -- Various Metadata used for packaging and categorising
265265
* **namespace** -> SDK Namespace
@@ -283,7 +283,7 @@ docker run --rm -v $(pwd):$(pwd):rw -w $(pwd) -v /var/run/docker.sock:/var/run/d
283283
* **gettingStarted** -> Raw Markdown for Getting Started
284284
* **readme** -> Stores the raw markdown used to generate the readme.md file. [here](https://github.com/appwrite/sdk-for-flutter/blob/master/README.md)
285285
* **changelog** -> Stores the raw markdown used to generate the changelog.md file. [here](https://github.com/appwrite/sdk-for-flutter/blob/master/CHANGELOG.md)
286-
* **examples** -> Stores the raw markdown used to generate examples for your SDK. A example can be found [here](https://github.com/appwrite/sdk-for-flutter/tree/master/example)
286+
* **examples** -> Stores the raw markdown used to generate examples for your SDK. An example can be found [here](https://github.com/appwrite/sdk-for-flutter/tree/master/example)
287287
* **twitterHandle** -> Twitter handle of creator
288288
* **discordChannel** -> Discord Channel ID for SDK
289289
* **discordUrl** -> Discord Server Invite for SDK

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
[Appwrite](https://appwrite.io) SDK generator is a PHP library for auto generating SDK libraries for multiple languages and platforms.
1212

13-
The SDK Generator uses a predefined language settings as [Twig templates](https://twig.symfony.com/) to generate codebases based on different API specs.
13+
The SDK Generator uses predefined language settings as [Twig templates](https://twig.symfony.com/) to generate codebases based on different API specs.
1414

15-
Currently the only spec supported is Swagger 2.0, but we intend to add support for more specification in the near future. This generator is still lacking support for any definition/models specs.
15+
Currently, the only spec supported is Swagger 2.0, but we intend to add support for more specification in the near future. This generator is still lacking support for any definition/models specs.
1616

1717
## Getting Started
1818

composer.lock

Lines changed: 49 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example.php

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Appwrite\SDK\Language\Deno;
1616
use Appwrite\SDK\Language\HTTP;
1717
use Appwrite\SDK\Language\Swift;
18+
use Appwrite\SDK\Language\SwiftClient;
1819
use Appwrite\SDK\Language\DotNet;
1920
use Appwrite\SDK\Language\Flutter;
2021
use Appwrite\SDK\Language\Android;
@@ -269,7 +270,7 @@ function getSSLPage($url) {
269270
$sdk->generate(__DIR__ . '/examples/go');
270271

271272

272-
// Swift
273+
// Swift (Server)
273274
$sdk = new SDK(new Swift(), new Swagger2($spec));
274275

275276
$sdk
@@ -291,7 +292,31 @@ function getSSLPage($url) {
291292
])
292293
;
293294

294-
$sdk->generate(__DIR__ . '/examples/swift');
295+
$sdk->generate(__DIR__ . '/examples/swift-server');
296+
297+
// Swift (Client)
298+
$sdk = new SDK(new SwiftClient(), new Swagger2($spec));
299+
300+
$sdk
301+
->setName('NAME')
302+
->setDescription('Repo description goes here')
303+
->setShortDescription('Repo short description goes here')
304+
->setURL('https://example.com')
305+
->setLogo('https://appwrite.io/v1/images/console.png')
306+
->setLicenseContent('test test test')
307+
->setWarning('**WORK IN PROGRESS - NOT READY FOR USAGE**')
308+
->setChangelog('**CHANGELOG**')
309+
->setVersion('0.0.1')
310+
->setGitUserName('repoowner')
311+
->setGitRepoName('reponame')
312+
->setTwitter('appwrite_io')
313+
->setDiscord('564160730845151244', 'https://appwrite.io/discord')
314+
->setDefaultHeaders([
315+
'X-Appwrite-Response-Format' => '0.7.0',
316+
])
317+
;
318+
319+
$sdk->generate(__DIR__ . '/examples/swift-client');
295320

296321
// DotNet
297322
$sdk = new SDK(new DotNet(), new Swagger2($spec));

0 commit comments

Comments
 (0)