Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion example.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ function configureSDK($sdk, $overrides = []) {
// $platform = 'server';
}

$branch = '1.8.x';
$version = '1.8.x';
$spec = getSSLPage("https://raw.githubusercontent.com/appwrite/appwrite/{$version}/app/config/specs/swagger2-{$version}-{$platform}.json");
$spec = getSSLPage("https://raw.githubusercontent.com/appwrite/appwrite/{$branch}/app/config/specs/swagger2-{$version}-{$platform}.json");

if(empty($spec)) {
throw new Exception('Failed to fetch spec from Appwrite server');
Expand Down
3 changes: 3 additions & 0 deletions templates/cli/lib/type-generation/attribute.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const AttributeType = {
URL: "url",
ENUM: "enum",
RELATIONSHIP: "relationship",
POINT: "point",
LINESTRING: "linestring",
POLYGON: "polygon",
};

module.exports = {
Expand Down
9 changes: 9 additions & 0 deletions templates/cli/lib/type-generation/languages/csharp.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ class CSharp extends LanguageMeta {
type = `List<${type}>`;
}
break;
case AttributeType.POINT:
type = "List<double>";
break;
case AttributeType.LINESTRING:
type = "List<List<double>>";
break;
case AttributeType.POLYGON:
type = "List<List<List<double>>>";
break;
default:
throw new Error(`Unknown attribute type: ${attribute.type}`);
}
Expand Down
9 changes: 9 additions & 0 deletions templates/cli/lib/type-generation/languages/dart.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ class Dart extends LanguageMeta {
type = `List<${type}>`;
}
break;
case AttributeType.POINT:
type = "List<double>";
break;
case AttributeType.LINESTRING:
type = "List<List<double>>";
break;
case AttributeType.POLYGON:
type = "List<List<List<double>>>";
break;
default:
throw new Error(`Unknown attribute type: ${attribute.type}`);
}
Expand Down
9 changes: 9 additions & 0 deletions templates/cli/lib/type-generation/languages/java.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ class Java extends LanguageMeta {
type = "List<" + type + ">";
}
break;
case AttributeType.POINT:
type = "List<Double>";
break;
case AttributeType.LINESTRING:
type = "List<List<Double>>";
break;
case AttributeType.POLYGON:
type = "List<List<List<Double>>>";
break;
default:
throw new Error(`Unknown attribute type: ${attribute.type}`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ class JavaScript extends LanguageMeta {
type = `${type}[]`;
}
break;
case AttributeType.POINT:
type = "number[]";
break;
case AttributeType.LINESTRING:
type = "number[][]";
break;
case AttributeType.POLYGON:
type = "number[][][]";
break;
default:
throw new Error(`Unknown attribute type: ${attribute.type}`);
}
Expand Down
9 changes: 9 additions & 0 deletions templates/cli/lib/type-generation/languages/kotlin.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ class Kotlin extends LanguageMeta {
type = `List<${type}>`;
}
break;
case AttributeType.POINT:
type = "List<Double>";
break;
case AttributeType.LINESTRING:
type = "List<List<Double>>";
break;
case AttributeType.POLYGON:
type = "List<List<List<Double>>>";
break;
default:
throw new Error(`Unknown attribute type: ${attribute.type}`);
}
Expand Down
5 changes: 5 additions & 0 deletions templates/cli/lib/type-generation/languages/php.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ class PHP extends LanguageMeta {
type = "array";
}
break;
case AttributeType.POINT:
case AttributeType.LINESTRING:
case AttributeType.POLYGON:
type = "array";
break;
default:
throw new Error(`Unknown attribute type: ${attribute.type}`);
}
Expand Down
9 changes: 9 additions & 0 deletions templates/cli/lib/type-generation/languages/swift.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ class Swift extends LanguageMeta {
type = `[${type}]`;
}
break;
case AttributeType.POINT:
type = "[Double]";
break;
case AttributeType.LINESTRING:
type = "[[Double]]";
break;
case AttributeType.POLYGON:
type = "[[[Double]]]";
break;
default:
throw new Error(`Unknown attribute type: ${attribute.type}`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ class TypeScript extends LanguageMeta {
type = `${type}[]`;
}
break;
case AttributeType.POINT:
type = "Array<number>";
break;
case AttributeType.LINESTRING:
type = "Array<Array<number>>";
break;
case AttributeType.POLYGON:
type = "Array<Array<Array<number>>>";
break;
default:
throw new Error(`Unknown attribute type: ${attribute.type}`);
}
Expand Down
2 changes: 1 addition & 1 deletion templates/react-native/package.json.twig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"devDependencies": {
"@rollup/plugin-typescript": "8.3.2",
"playwright": "1.15.0",
"playwright": "1.56.1",
"rollup": "2.75.4",
"serve-handler": "6.1.0",
"tslib": "2.4.0",
Expand Down
2 changes: 1 addition & 1 deletion templates/web/package.json.twig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"devDependencies": {
"@rollup/plugin-typescript": "8.3.2",
"playwright": "1.15.0",
"playwright": "1.56.1",
"rollup": "2.79.2",
"serve-handler": "6.1.0",
"tslib": "2.4.0",
Expand Down
4 changes: 2 additions & 2 deletions tests/WebChromiumTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ class WebChromiumTest extends Base
'cp tests/languages/web/tests.js tests/sdks/web/tests.js',
'cp tests/languages/web/node.js tests/sdks/web/node.js',
'cp tests/languages/web/index.html tests/sdks/web/index.html',
'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal sh -c "npm install && npm run build"',
'docker run --rm -v $(pwd):/app -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.56.1-jammy sh -c "npm install && npm run build"',
];
protected string $command =
'docker run --network="mockapi" --rm -v $(pwd):/app -e BROWSER=chromium -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.15.0-focal node tests.js';
'docker run --network="mockapi" --rm -v $(pwd):/app -e BROWSER=chromium -w /app/tests/sdks/web mcr.microsoft.com/playwright:v1.56.1-jammy node tests.js';

protected array $expectedOutput = [
...Base::PING_RESPONSE,
Expand Down
Loading