Skip to content

Commit cb131ec

Browse files
authored
Merge branch 'master' into feat-cli-console-project
2 parents 295cd81 + 9f8541c commit cb131ec

File tree

10 files changed

+83
-93
lines changed

10 files changed

+83
-93
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/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:

templates/dart/pubspec.yaml.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ dependencies:
1313
dev_dependencies:
1414
lints: ^2.0.1
1515
test: ^1.22.0
16-
mockito: ^5.4.2
16+
mockito: ^5.4.0

templates/dotnet/icon.png

47.6 KB
Loading

templates/dotnet/src/Appwrite/Appwrite.csproj.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
{{sdk.shortDescription}}
1010
</Description>
1111
<PackageIcon>icon.png</PackageIcon>
12+
<PackageReadmeFile>README.md</PackageReadmeFile>
1213
<PackageLicenseExpression>{{spec.licenseName}}</PackageLicenseExpression>
1314
<PackageProjectUrl>{{sdk.gitURL}}</PackageProjectUrl>
1415
<RepositoryType>git</RepositoryType>
@@ -22,6 +23,7 @@
2223
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
2324
<PackageReference Include="System.Net.Http" Version="4.3.4" />
2425
<None Include="..\..\icon.png" Pack="true" PackagePath="$(PackageIcon)"/>
26+
<None Include="..\..\README.md" Pack="true" PackagePath="$(PackageReadmeFile)"/>
2527
</ItemGroup>
2628

2729
</Project>

templates/dotnet/src/Appwrite/Models/Model.cs.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace {{ spec.title | caseUcfirst }}.Models
4040

4141
public static {{ definition.name | caseUcfirst | overrideIdentifier}} From(Dictionary<string, object> map) => new {{ definition.name | caseUcfirst | overrideIdentifier}}(
4242
{%~ for property in definition.properties %}
43-
{{ property.name | caseCamel | escapeKeyword | removeDollarSign }}: {% if property.sub_schema %}{% if property.type == 'array' %}((JArray)map["{{ property.name }}"]).ToObject<List<Dictionary<string, object>>>().Select(it => {{property.sub_schema | caseUcfirst | overrideIdentifier}}.From(map: it)).ToList(){% else %}{{property.sub_schema | caseUcfirst | overrideIdentifier}}.From(map: ((JObject)map["{{ property.name }}"]).ToObject<Dictionary<string, object>>()!){% endif %}{% else %}{% if property.type == 'array' %}((JArray)map["{{ property.name }}"]).ToObject<{{ property | typeName }}>(){% else %}{% if property.type == "integer" or property.type == "number" %}{% if not property.required %}map["{{ property.name }}"] == null ? null : {% endif %}Convert.To{% if property.type == "integer" %}Int64{% else %}Double{% endif %}(map["{{ property.name }}"]){% else %}{% if property.type == "bool" %}({{ property | typeName }}{% if not property.required %}?{% endif %})map["{{ property.name }}"]{% endif %}map["{{ property.name }}"]{% if not property.required %}?{% endif %}.ToString(){% endif %}{% endif %}{% endif %}{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %}
43+
{{ property.name | caseCamel | escapeKeyword | removeDollarSign }}: {% if property.sub_schema %}{% if property.type == 'array' %}((JArray)map["{{ property.name }}"]).ToObject<List<Dictionary<string, object>>>().Select(it => {{property.sub_schema | caseUcfirst | overrideIdentifier}}.From(map: it)).ToList(){% else %}{{property.sub_schema | caseUcfirst | overrideIdentifier}}.From(map: ((JObject)map["{{ property.name }}"]).ToObject<Dictionary<string, object>>()!){% endif %}{% else %}{% if property.type == 'array' %}((JArray)map["{{ property.name }}"]).ToObject<{{ property | typeName }}>(){% else %}{% if property.type == "integer" or property.type == "number" %}{% if not property.required %}map["{{ property.name }}"] == null ? null : {% endif %}Convert.To{% if property.type == "integer" %}Int64{% else %}Double{% endif %}(map["{{ property.name }}"]){% else %}{% if property.type == "boolean" %}({{ property | typeName }}{% if not property.required %}?{% endif %})map["{{ property.name }}"]{% else %}map["{{ property.name }}"]{% if not property.required %}?{% endif %}.ToString(){% endif %}{% endif %}{% endif %}{% endif %}{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %}
4444

4545
{%~ endfor %}
4646
{%~ if definition.additionalProperties %}

templates/flutter/pubspec.yaml.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ dev_dependencies:
3232
flutter_lints: ^2.0.1
3333
flutter_test:
3434
sdk: flutter
35-
mockito: ^5.4.2
35+
mockito: ^5.4.0

templates/python/base/params.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
params = {}
22
{% if method.parameters.all | length %}
33
{% for parameter in method.parameters.all %}
4-
{% if parameter.required %}
4+
{% if parameter.required and not parameter.nullable %}
55
if {{ parameter.name | escapeKeyword | caseSnake }} is None:
66
raise {{spec.title | caseUcfirst}}Exception('Missing required parameter: "{{ parameter.name | escapeKeyword | caseSnake }}"')
77

templates/python/package/client.py.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ class Client:
5050
if params is None:
5151
params = {}
5252

53+
params = {k: v for k, v in params.items() if v is not None} # Remove None values from params dictionary
54+
5355
data = {}
5456
json = {}
5557
files = {}

tests/languages/cli/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const { exec, execSync } = require('child_process');
22

3-
execSync("node index client --endpoint 'https://demo.appwrite.io/v1' --projectId console --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' });
3+
execSync("node index client --endpoint 'https://stage.cloud.appwrite.io/v1' --projectId console --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' });
44

55
var output;
66
console.log('\nTest Started');

0 commit comments

Comments
 (0)