Skip to content

Commit 07214de

Browse files
committed
update sdks
1 parent baa7a17 commit 07214de

9 files changed

Lines changed: 88 additions & 46 deletions

File tree

app/config/platforms.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226
[
227227
'key' => 'cli',
228228
'name' => 'Command Line',
229-
'version' => '10.2.4',
229+
'version' => '10.3.0',
230230
'url' => 'https://github.com/appwrite/sdk-for-cli',
231231
'package' => 'https://www.npmjs.com/package/appwrite-cli',
232232
'enabled' => true,
@@ -300,7 +300,7 @@
300300
[
301301
'key' => 'python',
302302
'name' => 'Python',
303-
'version' => '13.4.2',
303+
'version' => '13.5.0',
304304
'url' => 'https://github.com/appwrite/sdk-for-python',
305305
'package' => 'https://pypi.org/project/appwrite/',
306306
'enabled' => true,

composer.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
appwrite migrations create-csv-export \
2+
--resource-id <ID1:ID2> \
3+
--bucket-id <BUCKET_ID> \
4+
--filename <FILENAME>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
appwrite migrations create-csv-import \
2+
--bucket-id <BUCKET_ID> \
3+
--file-id <FILE_ID> \
4+
--resource-id <ID1:ID2>

docs/sdks/apple/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 13.3.1
44

55
* Fix `onOpen` callback not being called when the websocket connection is established
6+
* Fix add missing `scheduled` value to `ExecutionStatus` enum
67

78
## 13.3.0
89

docs/sdks/cli/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Change Log
22

3-
## 10.2.4
3+
## 10.3.0
44

5+
* Add `create-csv-export` and `create-csv-import` commands to create a CSV export and import of a collection/table
6+
* Add `create-resend-provider` and `update-resend-provider` commands to create and update a Resend Email provider
57
* Fix syncing of tables deleted locally during `push tables` command
68
* Fix added push command support for cli spatial types
79
* Fix attribute changing during push

docs/sdks/flutter/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
## 20.2.2
44

55
* Widen `device_info_plus` and `package_info_plus` dependencies to allow for newer versions for Android 15+ support
6+
* Fix `CHUNK_SIZE` constant to `chunkSize`
7+
* Fix missing `@override` annotation to `toMap` method in all model classes
68

79
## 20.2.1
810

docs/sdks/python/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Change Log
22

3-
## 13.4.2
3+
## 13.5.0
44

5+
* Add `create_resend_provider` and `update_resend_provider` methods to `Messaging` service
6+
* Improve deprecation warnings
57
* Fix adding `Optional[]` to optional parameters
68
* Fix passing of `None` to nullable parameters
79

src/Appwrite/Platform/Tasks/SDKs.php

Lines changed: 57 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,18 @@ public function __construct()
4848
->param('message', null, new Nullable(new Text(256)), 'Commit Message', optional: true)
4949
->param('release', null, new Nullable(new WhiteList(['yes', 'no'])), 'Should we create releases?', optional: true)
5050
->param('commit', null, new Nullable(new WhiteList(['yes', 'no'])), 'Actually create releases (yes) or dry-run (no)?', optional: true)
51+
->param('sdks', null, new Nullable(new Text(256)), 'Selected SDKs', optional: true)
5152
->callback($this->action(...));
5253
}
5354

54-
public function action(?string $selectedPlatform, ?string $selectedSDK, ?string $version, ?string $git, ?string $production, ?string $message, ?string $release, ?string $commit): void
55+
public function action(?string $selectedPlatform, ?string $selectedSDK, ?string $version, ?string $git, ?string $production, ?string $message, ?string $release, ?string $commit, ?string $sdks): void
5556
{
56-
$selectedPlatform ??= Console::confirm('Choose Platform ("' . APP_PLATFORM_CLIENT . '", "' . APP_PLATFORM_SERVER . '", "' . APP_PLATFORM_CONSOLE . '" or "*" for all):');
57-
$selectedSDK ??= \strtolower(Console::confirm('Choose SDK ("*" for all):'));
57+
if (!$sdks){
58+
$selectedPlatform ??= Console::confirm('Choose Platform ("' . APP_PLATFORM_CLIENT . '", "' . APP_PLATFORM_SERVER . '", "' . APP_PLATFORM_CONSOLE . '" or "*" for all):');
59+
$selectedSDK ??= \strtolower(Console::confirm('Choose SDK ("*" for all):'));
60+
} else {
61+
$sdks = explode(',', $sdks);
62+
}
5863
$version ??= Console::confirm('Choose an Appwrite version');
5964

6065
$createRelease = ($release === 'yes');
@@ -104,12 +109,12 @@ public function action(?string $selectedPlatform, ?string $selectedSDK, ?string
104109

105110
$platforms = Config::getParam('platforms');
106111
foreach ($platforms as $key => $platform) {
107-
if ($selectedPlatform !== $key && $selectedPlatform !== '*') {
112+
if ($selectedPlatform !== $key && $selectedPlatform !== '*' && ($sdks === null)) {
108113
continue;
109114
}
110115

111116
foreach ($platform['sdks'] as $language) {
112-
if ($selectedSDK !== $language['key'] && $selectedSDK !== '*') {
117+
if ($selectedSDK !== $language['key'] && $selectedSDK !== '*' && ($sdks === null || !\in_array($language['key'], $sdks))) {
113118
continue;
114119
}
115120

@@ -472,38 +477,60 @@ public function action(?string $selectedPlatform, ?string $selectedSDK, ?string
472477
$errorMessage = implode("\n", $prOutput);
473478
if (strpos($errorMessage, 'already exists') !== false) {
474479
Console::warning("Pull request already exists for {$language['name']} SDK, updating title and body...");
475-
476-
$updateCommand = 'cd ' . $target . ' && \
477-
gh pr edit "' . $gitBranch . '" \
480+
$prNumberCommand = 'cd ' . $target . ' && \
481+
gh pr list \
478482
--repo "' . $repoName . '" \
479-
--title "' . $prTitle . '" \
480-
--body "' . $prBody . '" \
483+
--head "' . $gitBranch . '" \
484+
--json number \
485+
--jq ".[0].number" \
481486
2>&1';
482487

483-
$updateOutput = [];
484-
$updateReturnCode = 0;
485-
\exec($updateCommand, $updateOutput, $updateReturnCode);
486-
487-
if ($updateReturnCode === 0) {
488-
Console::success("Successfully updated pull request for {$language['name']} SDK");
489-
490-
$prUrlCommand = 'cd ' . $target . ' && \
491-
gh pr view "' . $gitBranch . '" \
492-
--repo "' . $repoName . '" \
493-
--json url \
494-
--jq .url \
488+
$prNumberOutput = [];
489+
$prNumberReturnCode = 0;
490+
\exec($prNumberCommand, $prNumberOutput, $prNumberReturnCode);
491+
492+
if ($prNumberReturnCode === 0 && !empty($prNumberOutput[0])) {
493+
$prNumber = trim($prNumberOutput[0]);
494+
495+
// Use API directly to update PR to avoid deprecated projectCards field
496+
$updateCommand = 'cd ' . $target . ' && \
497+
gh api \
498+
--method PATCH \
499+
-H "Accept: application/vnd.github+json" \
500+
-H "X-GitHub-Api-Version: 2022-11-28" \
501+
/repos/' . $repoName . '/pulls/' . $prNumber . ' \
502+
-f title="' . $prTitle . '" \
503+
-f body="' . $prBody . '" \
495504
2>&1';
496505

497-
$prUrlOutput = [];
498-
$prUrlReturnCode = 0;
499-
\exec($prUrlCommand, $prUrlOutput, $prUrlReturnCode);
500-
501-
if ($prUrlReturnCode === 0 && !empty($prUrlOutput)) {
502-
$prUrls[$language['name']] = $prUrlOutput[0];
506+
$updateOutput = [];
507+
$updateReturnCode = 0;
508+
\exec($updateCommand, $updateOutput, $updateReturnCode);
509+
510+
if ($updateReturnCode === 0) {
511+
Console::success("Successfully updated pull request for {$language['name']} SDK");
512+
513+
$prUrlCommand = 'cd ' . $target . ' && \
514+
gh pr list \
515+
--repo "' . $repoName . '" \
516+
--head "' . $gitBranch . '" \
517+
--json url \
518+
--jq ".[0].url" \
519+
2>&1';
520+
521+
$prUrlOutput = [];
522+
$prUrlReturnCode = 0;
523+
\exec($prUrlCommand, $prUrlOutput, $prUrlReturnCode);
524+
525+
if ($prUrlReturnCode === 0 && !empty($prUrlOutput)) {
526+
$prUrls[$language['name']] = trim($prUrlOutput[0]);
527+
}
528+
} else {
529+
$updateErrorMessage = implode("\n", $updateOutput);
530+
Console::error("Failed to update pull request for {$language['name']} SDK: " . $updateErrorMessage);
503531
}
504532
} else {
505-
$updateErrorMessage = implode("\n", $updateOutput);
506-
Console::error("Failed to update pull request for {$language['name']} SDK: " . $updateErrorMessage);
533+
Console::error("Failed to get PR number for {$language['name']} SDK");
507534
}
508535
} else {
509536
Console::error("Failed to create pull request for {$language['name']} SDK: " . $errorMessage);

0 commit comments

Comments
 (0)