Skip to content

Commit 578aa35

Browse files
Merge branch 'master' into maintenance-upgrade-dependencies
2 parents 2d2a0c2 + 72bc680 commit 578aa35

Some content is hidden

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

60 files changed

+1414
-147
lines changed

composer.lock

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

src/SDK/Language/Dart.php

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,61 @@ public function getFiles(): array
401401
'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md',
402402
'template' => 'dart/docs/example.md.twig',
403403
],
404+
[
405+
'scope' => 'service',
406+
'destination' => '/test/services/{{service.name | caseDash}}_test.dart',
407+
'template' => 'dart/test/services/service_test.dart.twig',
408+
],
409+
[
410+
'scope' => 'definition',
411+
'destination' => '/test/src/models/{{definition.name | caseSnake }}_test.dart',
412+
'template' => 'dart/test/src/models/model_test.dart.twig',
413+
],
414+
[
415+
'scope' => 'default',
416+
'destination' => '/test/id_test.dart',
417+
'template' => 'dart/test/id_test.dart.twig',
418+
],
419+
[
420+
'scope' => 'default',
421+
'destination' => '/test/permission_test.dart',
422+
'template' => 'dart/test/permission_test.dart.twig',
423+
],
424+
[
425+
'scope' => 'default',
426+
'destination' => '/test/query_test.dart',
427+
'template' => 'dart/test/query_test.dart.twig',
428+
],
429+
[
430+
'scope' => 'default',
431+
'destination' => '/test/role_test.dart',
432+
'template' => 'dart/test/role_test.dart.twig',
433+
],
434+
[
435+
'scope' => 'default',
436+
'destination' => '/test/src/enums_test.dart',
437+
'template' => 'dart/test/src/enums_test.dart.twig',
438+
],
439+
[
440+
'scope' => 'default',
441+
'destination' => '/test/src/upload_progress_test.dart',
442+
'template' => 'dart/test/src/upload_progress_test.dart.twig',
443+
],
444+
[
445+
'scope' => 'default',
446+
'destination' => '/test/src/exception_test.dart',
447+
'template' => 'dart/test/src/exception_test.dart.twig',
448+
],
449+
[
450+
'scope' => 'default',
451+
'destination' => '/test/src/input_file_test.dart',
452+
'template' => 'dart/test/src/input_file_test.dart.twig',
453+
],
454+
[
455+
'scope' => 'default',
456+
'destination' => '/test/src/response_test.dart',
457+
'template' => 'dart/test/src/response_test.dart.twig',
458+
],
404459
[
405460
'scope' => 'default',
406461
'destination' => '.travis.yml',

src/SDK/Language/DotNet.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public function getParamExample(array $param): string
236236
if (empty($example) && $example !== 0 && $example !== false) {
237237
switch ($type) {
238238
case self::TYPE_FILE:
239-
$output .= 'new File("./path-to-files/image.jpg")';
239+
$output .= 'InputFile.FromPath("./path-to-files/image.jpg")';
240240
break;
241241
case self::TYPE_NUMBER:
242242
case self::TYPE_INTEGER:

src/SDK/Language/Flutter.php

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,86 @@ public function getFiles(): array
240240
'destination' => '/lib/services/{{service.name | caseDash}}.dart',
241241
'template' => 'flutter/lib/services/service.dart.twig',
242242
],
243+
[
244+
'scope' => 'service',
245+
'destination' => '/test/services/{{service.name | caseDash}}_test.dart',
246+
'template' => 'dart/test/services/service_test.dart.twig',
247+
],
248+
[
249+
'scope' => 'definition',
250+
'destination' => '/test/src/models/{{definition.name | caseSnake }}_test.dart',
251+
'template' => 'dart/test/src/models/model_test.dart.twig',
252+
],
253+
[
254+
'scope' => 'default',
255+
'destination' => '/test/id_test.dart',
256+
'template' => 'dart/test/id_test.dart.twig',
257+
],
258+
[
259+
'scope' => 'default',
260+
'destination' => '/test/permission_test.dart',
261+
'template' => 'dart/test/permission_test.dart.twig',
262+
],
263+
[
264+
'scope' => 'default',
265+
'destination' => '/test/query_test.dart',
266+
'template' => 'dart/test/query_test.dart.twig',
267+
],
268+
[
269+
'scope' => 'default',
270+
'destination' => '/test/role_test.dart',
271+
'template' => 'dart/test/role_test.dart.twig',
272+
],
273+
[
274+
'scope' => 'default',
275+
'destination' => '/test/src/cookie_manager_test.dart',
276+
'template' => 'flutter/test/src/cookie_manager_test.dart.twig',
277+
],
278+
[
279+
'scope' => 'default',
280+
'destination' => '/test/src/interceptor_test.dart',
281+
'template' => 'flutter/test/src/interceptor_test.dart.twig',
282+
],
283+
[
284+
'scope' => 'default',
285+
'destination' => '/test/src/realtime_response_test.dart',
286+
'template' => 'flutter/test/src/realtime_response_test.dart.twig',
287+
],
288+
[
289+
'scope' => 'default',
290+
'destination' => '/test/src/realtime_response_connected_test.dart',
291+
'template' => 'flutter/test/src/realtime_response_connected_test.dart.twig',
292+
],
293+
[
294+
'scope' => 'default',
295+
'destination' => '/test/src/realtime_subscription_test.dart',
296+
'template' => 'flutter/test/src/realtime_subscription_test.dart.twig',
297+
],
298+
[
299+
'scope' => 'default',
300+
'destination' => '/test/src/enums_test.dart',
301+
'template' => 'dart/test/src/enums_test.dart.twig',
302+
],
303+
[
304+
'scope' => 'default',
305+
'destination' => '/test/src/upload_progress_test.dart',
306+
'template' => 'dart/test/src/upload_progress_test.dart.twig',
307+
],
308+
[
309+
'scope' => 'default',
310+
'destination' => '/test/src/input_file_test.dart',
311+
'template' => 'dart/test/src/input_file_test.dart.twig',
312+
],
313+
[
314+
'scope' => 'default',
315+
'destination' => '/test/src/exception_test.dart',
316+
'template' => 'dart/test/src/exception_test.dart.twig',
317+
],
318+
[
319+
'scope' => 'default',
320+
'destination' => '/test/src/response_test.dart',
321+
'template' => 'dart/test/src/response_test.dart.twig',
322+
],
243323
[
244324
'scope' => 'method',
245325
'destination' => 'docs/examples/{{service.name | caseLower}}/{{method.name | caseDash}}.md',

src/Spec/Swagger2.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ public function getDefinitions()
319319
foreach ($sch['properties'] as $name => $def) {
320320
$sch['properties'][$name]['name'] = $name;
321321
$sch['properties'][$name]['description'] = $def['description'];
322+
$sch['properties'][$name]['example'] = $def['x-example'];
322323
$sch['properties'][$name]['required'] = in_array($name, $sch['required']);
323324
if (isset($def['items']['$ref'])) {
324325
//nested model

templates/cli/lib/commands/generic.js.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ const client = new Command("client")
8282
}
8383

8484
let client = new Client().setEndpoint(endpoint);
85+
client.setProject('console');
8586
if (selfSigned || globalConfig.getSelfSigned()) {
8687
client.setSelfSigned(true);
8788
}

templates/dart/README.md.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![pub package](https://img.shields.io/pub/v/{{ language.params.packageName }}.svg?style=flat-square)](https://pub.dartlang.org/packages/{{ language.params.packageName }})
44
![License](https://img.shields.io/github/license/{{ sdk.gitUserName|url_encode }}/{{ sdk.gitRepoName|url_encode }}.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-{{ spec.version|url_encode }}-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-{{spec.version | split('.') | slice(0,2) | join('.') ~ '.x' | url_encode}}-blue.svg?style=flat-square)
66
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
77
{% if sdk.twitterHandle %}
88
[![Twitter Account](https://img.shields.io/twitter/follow/{{ sdk.twitterHandle }}?color=00acee&label=twitter&style=flat-square)](https://twitter.com/{{ sdk.twitterHandle }})

templates/dart/lib/id.dart.twig

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
part of {{ language.params.packageName }};
22

3+
/// Helper class to generate ID strings for resources.
34
class ID {
4-
ID._();
5-
6-
static String unique() {
7-
return 'unique()';
8-
}
5+
ID._();
96

10-
static String custom(String id) {
11-
return id;
12-
}
7+
/// Have Appwrite generate a unique ID for you.
8+
static String unique() {
9+
return 'unique()';
10+
}
11+
12+
/// Uses [id] as the ID for the resource.
13+
static String custom(String id) {
14+
return id;
15+
}
1316
}

templates/dart/lib/models.dart.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/// {{spec.title | caseUcfirst}} Models
12
library {{ language.params.packageName }}.models;
23

34
part 'src/models/model.dart';

templates/dart/lib/package.dart.twig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/// {{spec.title | caseUcfirst}} {{sdk.name}} SDK
2+
///
3+
/// This SDK is compatible with Appwrite server version {{spec.version | split('.') | slice(0,2) | join('.') ~ '.x' }}.
4+
/// For older versions, please check
5+
/// [previous releases](https://github.com/{{sdk.gitUserName}}/{{sdk.gitRepoName}}/releases).
16
library {{ language.params.packageName }};
27

38
import 'dart:async';

0 commit comments

Comments
 (0)