Skip to content

Commit f29e456

Browse files
committed
Merge remote-tracking branch 'origin/master' into refactor-kt-android-test-names
2 parents 8bcd3fa + 51a8e42 commit f29e456

File tree

163 files changed

+3401
-1473
lines changed

Some content is hidden

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

163 files changed

+3401
-1473
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ os: linux
1212
language: php
1313

1414
php:
15-
- 8.0
15+
- 8.1
1616

1717
env:
1818
- SDK=Android11Java8

composer.lock

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

specs/swagger-appwrite-0.12.0.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

specs/swagger-appwrite.0.12.0.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

specs/swagger2-latest-console.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

src/SDK/Language.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,13 @@ public function getParams()
7474
{
7575
return $this->params;
7676
}
77+
78+
/**
79+
* Language specific filters.
80+
* @return array
81+
*/
82+
public function getFilters(): array
83+
{
84+
return [];
85+
}
7786
}

src/SDK/Language/Android.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ public function getFiles()
131131
'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/json/PreciseNumberAdapter.kt',
132132
'template' => '/android/library/src/main/java/io/appwrite/json/PreciseNumberAdapter.kt.twig',
133133
],
134+
[
135+
'scope' => 'default',
136+
'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/models/InputFile.kt',
137+
'template' => '/android/library/src/main/java/io/appwrite/models/InputFile.kt.twig',
138+
],
134139
[
135140
'scope' => 'default',
136141
'destination' => '/library/src/main/java/{{ sdk.namespace | caseSlash }}/models/RealtimeModels.kt',

src/SDK/Language/CLI.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@ public function getFiles()
158158
'template' => 'cli/lib/client.js.twig',
159159
'minify' => false,
160160
],
161+
[
162+
'scope' => 'default',
163+
'destination' => 'lib/utils.js',
164+
'template' => 'cli/lib/utils.js.twig',
165+
'minify' => false,
166+
],
161167
[
162168
'scope' => 'default',
163169
'destination' => 'lib/commands/init.js',

src/SDK/Language/Dart.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Appwrite\SDK\Language;
44

55
use Appwrite\SDK\Language;
6+
use Twig\TwigFilter;
67

78
class Dart extends Language {
89

@@ -111,7 +112,7 @@ public function getKeywords()
111112
*/
112113
public function getIdentifierOverrides()
113114
{
114-
return ['Function' => 'Func'];
115+
return ['Function' => 'Func', 'default' => 'xdefault', 'required' => 'xrequired', 'async' => 'xasync'];
115116
}
116117

117118
/**
@@ -420,18 +421,19 @@ public function getFiles()
420421
'template' => 'dart/lib/src/input_file.dart.twig',
421422
'minify' => false,
422423
],
423-
[
424-
'scope' => 'default',
425-
'destination' => 'lib/src/chunked_upload_io.dart',
426-
'template' => 'dart/lib/src/chunked_upload_io.dart.twig',
427-
'minify' => false,
428-
],
429-
[
430-
'scope' => 'default',
431-
'destination' => 'lib/src/chunked_upload_stub.dart',
432-
'template' => 'dart/lib/src/chunked_upload_stub.dart.twig',
433-
'minify' => false,
434-
],
424+
];
425+
}
426+
427+
public function getFilters(): array
428+
{
429+
return [
430+
new TwigFilter('dartComment', function ($value) {
431+
$value = explode("\n", $value);
432+
foreach ($value as $key => $line) {
433+
$value[$key] = " /// " . wordwrap($value[$key], 75, "\n /// ");
434+
}
435+
return implode("\n", $value);
436+
}, ['is_safe' => ['html']]),
435437
];
436438
}
437439
}

src/SDK/Language/Deno.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ public function getFiles()
3636
'template' => 'deno/src/query.ts.twig',
3737
'minify' => false,
3838
],
39+
[
40+
'scope' => 'default',
41+
'destination' => 'src/inputFile.ts',
42+
'template' => 'deno/src/inputFile.ts.twig',
43+
'minify' => false,
44+
],
3945
[
4046
'scope' => 'default',
4147
'destination' => '/src/service.ts',
@@ -101,7 +107,7 @@ public function getTypeName($type)
101107
return 'string';
102108
break;
103109
case self::TYPE_FILE:
104-
return 'string';
110+
return 'InputFile';
105111
break;
106112
case self::TYPE_BOOLEAN:
107113
return 'boolean';
@@ -145,7 +151,7 @@ public function getParamExample(array $param)
145151
$output .= '{}';
146152
break;
147153
case self::TYPE_FILE:
148-
$output .= "new File([fileBlob], 'file.png')";
154+
$output .= "'file.png'";
149155
break;
150156
}
151157
}
@@ -164,7 +170,7 @@ public function getParamExample(array $param)
164170
$output .= "'{$example}'";
165171
break;
166172
case self::TYPE_FILE:
167-
$output .= "new File([fileBlob], 'file.png')";
173+
$output .= "'file.png'";
168174
break;
169175
}
170176
}

0 commit comments

Comments
 (0)