Skip to content

Commit cdffea8

Browse files
committed
Merge remote-tracking branch 'origin/master' into fix-prefs-permissions
2 parents fcb1ed8 + 0965751 commit cdffea8

File tree

117 files changed

+3380
-619
lines changed

Some content is hidden

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

117 files changed

+3380
-619
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ env:
2929
- SDK=DartStable
3030
- SDK=Deno1193
3131
- SDK=Deno1303
32+
- SDK=DotNet60
33+
- SDK=DotNet70
3234
- SDK=FlutterStable
3335
- SDK=FlutterBeta
3436
- SDK=Go112

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/CLI.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ public function getFiles(): array
7171
'destination' => 'package.json',
7272
'template' => 'cli/package.json.twig',
7373
],
74+
[
75+
'scope' => 'default',
76+
'destination' => 'scoop/appwrite.json',
77+
'template' => 'cli/scoop/appwrite.json.twig',
78+
'minify' => false,
79+
],
7480
[
7581
'scope' => 'default',
7682
'destination' => 'LICENSE.md',

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: 68 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ public function getKeywords(): array
129129
'when',
130130
'where',
131131
'while',
132-
'yield'
132+
'yield',
133+
'path'
133134
];
134135
}
135136

@@ -139,23 +140,26 @@ public function getKeywords(): array
139140
public function getIdentifierOverrides(): array
140141
{
141142
return [
142-
'Jwt' => 'JWT'
143+
'Jwt' => 'JWT',
144+
'Domain' => 'XDomain',
143145
];
144146
}
145147

146148
/**
147-
* @param $type
149+
* @param array $parameter
148150
* @return string
149151
*/
150152
public function getTypeName(array $parameter): string
151153
{
152154
switch ($parameter['type']) {
153155
case self::TYPE_INTEGER:
154-
return 'int';
156+
return 'long';
157+
case self::TYPE_NUMBER:
158+
return 'double';
155159
case self::TYPE_STRING:
156160
return 'string';
157161
case self::TYPE_FILE:
158-
return 'FileInfo';
162+
return 'InputFile';
159163
case self::TYPE_BOOLEAN:
160164
return 'bool';
161165
case self::TYPE_ARRAY:
@@ -233,7 +237,7 @@ public function getParamExample(array $param): string
233237
if (empty($example) && $example !== 0 && $example !== false) {
234238
switch ($type) {
235239
case self::TYPE_FILE:
236-
$output .= 'new File("./path-to-files/image.jpg")';
240+
$output .= 'InputFile.FromPath("./path-to-files/image.jpg")';
237241
break;
238242
case self::TYPE_NUMBER:
239243
case self::TYPE_INTEGER:
@@ -249,7 +253,13 @@ public function getParamExample(array $param): string
249253
$output .= '[object]';
250254
break;
251255
case self::TYPE_ARRAY:
252-
$output .= '[List<object>]';
256+
if (\str_starts_with($example, '[')) {
257+
$example = \substr($example, 1);
258+
}
259+
if (\str_ends_with($example, ']')) {
260+
$example = \substr($example, 0, -1);
261+
}
262+
$output .= 'new List<' . $this->getTypeName($param['array']) . '> {' . $example . '}';
253263
break;
254264
}
255265
} else {
@@ -283,23 +293,28 @@ public function getFiles(): array
283293
return [
284294
[
285295
'scope' => 'default',
286-
'destination' => 'README.md',
287-
'template' => 'dotnet/README.md.twig',
296+
'destination' => '.travis.yml',
297+
'template' => 'dotnet/.travis.yml.twig',
288298
],
289299
[
290300
'scope' => 'default',
291301
'destination' => 'CHANGELOG.md',
292302
'template' => 'dotnet/CHANGELOG.md.twig',
293303
],
304+
[
305+
'scope' => 'copy',
306+
'destination' => '/icon.png',
307+
'template' => 'dotnet/icon.png',
308+
],
294309
[
295310
'scope' => 'default',
296311
'destination' => 'LICENSE',
297312
'template' => 'dotnet/LICENSE.twig',
298313
],
299314
[
300315
'scope' => 'default',
301-
'destination' => '.travis.yml',
302-
'template' => 'dotnet/.travis.yml.twig',
316+
'destination' => 'README.md',
317+
'template' => 'dotnet/README.md.twig',
303318
],
304319
[
305320
'scope' => 'method',
@@ -308,53 +323,78 @@ public function getFiles(): array
308323
],
309324
[
310325
'scope' => 'default',
311-
'destination' => '/src/Appwrite.sln',
326+
'destination' => '/src/{{ spec.title | caseUcfirst }}.sln',
312327
'template' => 'dotnet/src/Appwrite.sln',
313328
],
314-
[
315-
'scope' => 'copy',
316-
'destination' => '/icon.png',
317-
'template' => 'dotnet/icon.png',
318-
],
319329
[
320330
'scope' => 'default',
321-
'destination' => '/src/Appwrite/Appwrite.csproj',
331+
'destination' => '/src/{{ spec.title | caseUcfirst }}/{{ spec.title | caseUcfirst }}.csproj',
322332
'template' => 'dotnet/src/Appwrite/Appwrite.csproj.twig',
323333
],
324334
[
325335
'scope' => 'default',
326-
'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Client.cs',
336+
'destination' => '/src/{{ spec.title | caseUcfirst }}/Client.cs',
327337
'template' => 'dotnet/src/Appwrite/Client.cs.twig',
328338
],
329339
[
330340
'scope' => 'default',
331-
'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Helpers/ExtensionMethods.cs',
332-
'template' => 'dotnet/src/Appwrite/Helpers/ExtensionMethods.cs',
341+
'destination' => '/src/{{ spec.title | caseUcfirst }}/{{ spec.title | caseUcfirst }}Exception.cs',
342+
'template' => 'dotnet/src/Appwrite/Exception.cs.twig',
333343
],
334344
[
335345
'scope' => 'default',
336-
'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Models/OrderType.cs',
346+
'destination' => '/src/{{ spec.title | caseUcfirst }}/ID.cs',
347+
'template' => 'dotnet/src/Appwrite/ID.cs.twig',
348+
],
349+
[
350+
'scope' => 'default',
351+
'destination' => '/src/{{ spec.title | caseUcfirst }}/Permission.cs',
352+
'template' => 'dotnet/src/Appwrite/Permission.cs.twig',
353+
],
354+
[
355+
'scope' => 'default',
356+
'destination' => '/src/{{ spec.title | caseUcfirst }}/Query.cs',
357+
'template' => 'dotnet/src/Appwrite/Query.cs.twig',
358+
],
359+
[
360+
'scope' => 'default',
361+
'destination' => '/src/{{ spec.title | caseUcfirst }}/Role.cs',
362+
'template' => 'dotnet/src/Appwrite/Role.cs.twig',
363+
],
364+
[
365+
'scope' => 'default',
366+
'destination' => '/src/{{ spec.title | caseUcfirst }}/Extensions/Extensions.cs',
367+
'template' => 'dotnet/src/Appwrite/Extensions/Extensions.cs.twig',
368+
],
369+
[
370+
'scope' => 'default',
371+
'destination' => '/src/{{ spec.title | caseUcfirst }}/Models/OrderType.cs',
337372
'template' => 'dotnet/src/Appwrite/Models/OrderType.cs.twig',
338373
],
339374
[
340375
'scope' => 'default',
341-
'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Models/Rule.cs',
342-
'template' => 'dotnet/src/Appwrite/Models/Rule.cs.twig',
376+
'destination' => '/src/{{ spec.title | caseUcfirst }}/Models/UploadProgress.cs',
377+
'template' => 'dotnet/src/Appwrite/Models/UploadProgress.cs.twig',
343378
],
344379
[
345380
'scope' => 'default',
346-
'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Models/Exception.cs',
347-
'template' => 'dotnet/src/Appwrite/Models/Exception.cs.twig',
381+
'destination' => '/src/{{ spec.title | caseUcfirst }}/Models/InputFile.cs',
382+
'template' => 'dotnet/src/Appwrite/Models/InputFile.cs.twig',
348383
],
349384
[
350385
'scope' => 'default',
351-
'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Services/Service.cs',
386+
'destination' => '/src/{{ spec.title | caseUcfirst }}/Services/Service.cs',
352387
'template' => 'dotnet/src/Appwrite/Services/Service.cs.twig',
353388
],
354389
[
355390
'scope' => 'service',
356-
'destination' => '/{{ sdk.namespace | caseSlash }}/src/Appwrite/Services/{{service.name | caseUcfirst}}.cs',
391+
'destination' => '/src/{{ spec.title | caseUcfirst }}/Services/{{service.name | caseUcfirst}}.cs',
357392
'template' => 'dotnet/src/Appwrite/Services/ServiceTemplate.cs.twig',
393+
],
394+
[
395+
'scope' => 'definition',
396+
'destination' => '/src/{{ spec.title | caseUcfirst }}/Models/{{ definition.name | caseUcfirst | overrideIdentifier }}.cs',
397+
'template' => 'dotnet/src/Appwrite/Models/Model.cs.twig',
358398
]
359399
];
360400
}

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/SDK/Language/JS.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public function getKeywords(): array
105105
'while',
106106
'with',
107107
'yield',
108+
'path'
108109
];
109110
}
110111

src/SDK/Language/Kotlin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ public function getKeywords(): array
8686
"vararg",
8787
"when",
8888
"where",
89-
"while"
89+
"while",
90+
"path"
9091
];
9192
}
9293

0 commit comments

Comments
 (0)