From e50e7cf7d6a23b756e8ff24336acf34cc1da56c6 Mon Sep 17 00:00:00 2001 From: premtsd-code Date: Wed, 20 May 2026 06:36:21 +0000 Subject: [PATCH 1/5] chore: update PHP SDK to 24.0.0 --- docs/examples/advisor/get-insight.md | 2 +- docs/examples/advisor/get-report.md | 2 +- docs/examples/advisor/list-insights.md | 2 +- docs/examples/advisor/list-reports.md | 2 +- .../update-deny-canonical-email-policy.md | 16 -- docs/project.md | 4 +- src/Appwrite/Enums/Prompt.php | 61 ------ src/Appwrite/Models/BillingLimits.php | 72 +++---- src/Appwrite/Models/File.php | 7 + src/Appwrite/Models/Project.php | 13 +- tests/Appwrite/Services/ProjectTest.php | 184 +----------------- tests/Appwrite/Services/StorageTest.php | 4 + 12 files changed, 48 insertions(+), 321 deletions(-) delete mode 100644 docs/examples/project/update-deny-canonical-email-policy.md delete mode 100644 src/Appwrite/Enums/Prompt.php diff --git a/docs/examples/advisor/get-insight.md b/docs/examples/advisor/get-insight.md index 79412e7a..421a8476 100644 --- a/docs/examples/advisor/get-insight.md +++ b/docs/examples/advisor/get-insight.md @@ -7,7 +7,7 @@ use Appwrite\Services\Advisor; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID - ->setSession(''); // The user session to authenticate with + ->setKey(''); // Your secret API key $advisor = new Advisor($client); diff --git a/docs/examples/advisor/get-report.md b/docs/examples/advisor/get-report.md index 93e4d71f..8baacab7 100644 --- a/docs/examples/advisor/get-report.md +++ b/docs/examples/advisor/get-report.md @@ -7,7 +7,7 @@ use Appwrite\Services\Advisor; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID - ->setSession(''); // The user session to authenticate with + ->setKey(''); // Your secret API key $advisor = new Advisor($client); diff --git a/docs/examples/advisor/list-insights.md b/docs/examples/advisor/list-insights.md index 241075bb..10cf4fd9 100644 --- a/docs/examples/advisor/list-insights.md +++ b/docs/examples/advisor/list-insights.md @@ -7,7 +7,7 @@ use Appwrite\Services\Advisor; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID - ->setSession(''); // The user session to authenticate with + ->setKey(''); // Your secret API key $advisor = new Advisor($client); diff --git a/docs/examples/advisor/list-reports.md b/docs/examples/advisor/list-reports.md index 91f3c2db..29c42206 100644 --- a/docs/examples/advisor/list-reports.md +++ b/docs/examples/advisor/list-reports.md @@ -7,7 +7,7 @@ use Appwrite\Services\Advisor; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('') // Your project ID - ->setSession(''); // The user session to authenticate with + ->setKey(''); // Your secret API key $advisor = new Advisor($client); diff --git a/docs/examples/project/update-deny-canonical-email-policy.md b/docs/examples/project/update-deny-canonical-email-policy.md deleted file mode 100644 index 1580f5e8..00000000 --- a/docs/examples/project/update-deny-canonical-email-policy.md +++ /dev/null @@ -1,16 +0,0 @@ -```php -setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint - ->setProject('') // Your project ID - ->setKey(''); // Your secret API key - -$project = new Project($client); - -$result = $project->updateDenyCanonicalEmailPolicy( - enabled: false -);``` diff --git a/docs/project.md b/docs/project.md index 7ef92d74..81f603ce 100644 --- a/docs/project.md +++ b/docs/project.md @@ -501,7 +501,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/google | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com | | -| clientSecret | string | 'Client Secret' of Google OAuth2 app. For example: example-google-client-secret | | +| clientSecret | string | 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj | | | prompt | array | Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. | | | enabled | boolean | OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. | | @@ -549,7 +549,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/linkedin | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv | | -| primaryClientSecret | string | 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: example-linkedin-client-secret | | +| primaryClientSecret | string | 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw== | | | enabled | boolean | OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. | | diff --git a/src/Appwrite/Enums/Prompt.php b/src/Appwrite/Enums/Prompt.php deleted file mode 100644 index 92980f99..00000000 --- a/src/Appwrite/Enums/Prompt.php +++ /dev/null @@ -1,61 +0,0 @@ -value = $value; - } - - public function __toString(): string - { - return $this->value; - } - - public function jsonSerialize(): string - { - return $this->value; - } - - public static function NONE(): Prompt - { - if (!isset(self::$NONE)) { - self::$NONE = new Prompt('none'); - } - return self::$NONE; - } - public static function CONSENT(): Prompt - { - if (!isset(self::$CONSENT)) { - self::$CONSENT = new Prompt('consent'); - } - return self::$CONSENT; - } - public static function SELECTACCOUNT(): Prompt - { - if (!isset(self::$SELECTACCOUNT)) { - self::$SELECTACCOUNT = new Prompt('select_account'); - } - return self::$SELECTACCOUNT; - } - - public static function from(string $value): self - { - return match ($value) { - 'none' => self::NONE(), - 'consent' => self::CONSENT(), - 'select_account' => self::SELECTACCOUNT(), - default => throw new \InvalidArgumentException('Unknown Prompt value: ' . $value), - }; - } -} diff --git a/src/Appwrite/Models/BillingLimits.php b/src/Appwrite/Models/BillingLimits.php index 8f95f73e..f80a7441 100644 --- a/src/Appwrite/Models/BillingLimits.php +++ b/src/Appwrite/Models/BillingLimits.php @@ -12,24 +12,24 @@ /** * BillingLimits constructor. * - * @param int $bandwidth bandwidth limit - * @param int $storage storage limit - * @param int $users users limit - * @param int $executions executions limit - * @param int $gBHours gbhours limit - * @param int $imageTransformations image transformations limit - * @param int $authPhone auth phone limit - * @param int $budgetLimit budget limit percentage + * @param int|null $bandwidth bandwidth limit + * @param int|null $storage storage limit + * @param int|null $users users limit + * @param int|null $executions executions limit + * @param int|null $gBHours gbhours limit + * @param int|null $imageTransformations image transformations limit + * @param int|null $authPhone auth phone limit + * @param int|null $budgetLimit budget limit percentage */ public function __construct( - public int $bandwidth, - public int $storage, - public int $users, - public int $executions, - public int $gBHours, - public int $imageTransformations, - public int $authPhone, - public int $budgetLimit + public ?int $bandwidth = null, + public ?int $storage = null, + public ?int $users = null, + public ?int $executions = null, + public ?int $gBHours = null, + public ?int $imageTransformations = null, + public ?int $authPhone = null, + public ?int $budgetLimit = null ) { } @@ -38,40 +38,16 @@ public function __construct( */ public static function from(array $data): static { - if (!array_key_exists('bandwidth', $data)) { - throw new \InvalidArgumentException('Missing required field "bandwidth" for ' . static::class . '.'); - } - if (!array_key_exists('storage', $data)) { - throw new \InvalidArgumentException('Missing required field "storage" for ' . static::class . '.'); - } - if (!array_key_exists('users', $data)) { - throw new \InvalidArgumentException('Missing required field "users" for ' . static::class . '.'); - } - if (!array_key_exists('executions', $data)) { - throw new \InvalidArgumentException('Missing required field "executions" for ' . static::class . '.'); - } - if (!array_key_exists('GBHours', $data)) { - throw new \InvalidArgumentException('Missing required field "GBHours" for ' . static::class . '.'); - } - if (!array_key_exists('imageTransformations', $data)) { - throw new \InvalidArgumentException('Missing required field "imageTransformations" for ' . static::class . '.'); - } - if (!array_key_exists('authPhone', $data)) { - throw new \InvalidArgumentException('Missing required field "authPhone" for ' . static::class . '.'); - } - if (!array_key_exists('budgetLimit', $data)) { - throw new \InvalidArgumentException('Missing required field "budgetLimit" for ' . static::class . '.'); - } return new static( - bandwidth: $data['bandwidth'], - storage: $data['storage'], - users: $data['users'], - executions: $data['executions'], - gBHours: $data['GBHours'], - imageTransformations: $data['imageTransformations'], - authPhone: $data['authPhone'], - budgetLimit: $data['budgetLimit'] + bandwidth: array_key_exists('bandwidth', $data) ? $data['bandwidth'] : null, + storage: array_key_exists('storage', $data) ? $data['storage'] : null, + users: array_key_exists('users', $data) ? $data['users'] : null, + executions: array_key_exists('executions', $data) ? $data['executions'] : null, + gBHours: array_key_exists('GBHours', $data) ? $data['GBHours'] : null, + imageTransformations: array_key_exists('imageTransformations', $data) ? $data['imageTransformations'] : null, + authPhone: array_key_exists('authPhone', $data) ? $data['authPhone'] : null, + budgetLimit: array_key_exists('budgetLimit', $data) ? $data['budgetLimit'] : null ); } diff --git a/src/Appwrite/Models/File.php b/src/Appwrite/Models/File.php index b2bbc9a8..0853e506 100644 --- a/src/Appwrite/Models/File.php +++ b/src/Appwrite/Models/File.php @@ -21,6 +21,7 @@ * @param string $signature file md5 signature. * @param string $mimeType file mime type. * @param int $sizeOriginal file original size in bytes. + * @param int $sizeActual file actual stored size in bytes after compression and/or encryption. * @param int $chunksTotal total number of chunks available * @param int $chunksUploaded total number of chunks uploaded * @param bool $encryption whether file contents are encrypted at rest. @@ -36,6 +37,7 @@ public function __construct( public string $signature, public string $mimeType, public int $sizeOriginal, + public int $sizeActual, public int $chunksTotal, public int $chunksUploaded, public bool $encryption, @@ -75,6 +77,9 @@ public static function from(array $data): static if (!array_key_exists('sizeOriginal', $data)) { throw new \InvalidArgumentException('Missing required field "sizeOriginal" for ' . static::class . '.'); } + if (!array_key_exists('sizeActual', $data)) { + throw new \InvalidArgumentException('Missing required field "sizeActual" for ' . static::class . '.'); + } if (!array_key_exists('chunksTotal', $data)) { throw new \InvalidArgumentException('Missing required field "chunksTotal" for ' . static::class . '.'); } @@ -98,6 +103,7 @@ public static function from(array $data): static signature: $data['signature'], mimeType: $data['mimeType'], sizeOriginal: $data['sizeOriginal'], + sizeActual: $data['sizeActual'], chunksTotal: $data['chunksTotal'], chunksUploaded: $data['chunksUploaded'], encryption: $data['encryption'], @@ -120,6 +126,7 @@ public function toArray(): array 'signature' => static::serializeValue($this->signature), 'mimeType' => static::serializeValue($this->mimeType), 'sizeOriginal' => static::serializeValue($this->sizeOriginal), + 'sizeActual' => static::serializeValue($this->sizeActual), 'chunksTotal' => static::serializeValue($this->chunksTotal), 'chunksUploaded' => static::serializeValue($this->chunksUploaded), 'encryption' => static::serializeValue($this->encryption), diff --git a/src/Appwrite/Models/Project.php b/src/Appwrite/Models/Project.php index cdcb986b..0b31c9be 100644 --- a/src/Appwrite/Models/Project.php +++ b/src/Appwrite/Models/Project.php @@ -36,9 +36,9 @@ * @param list $services list of services. * @param list $protocols list of protocols. * @param string $region project region - * @param BillingLimits $billingLimits billing limits reached * @param list $blocks project blocks information * @param string $consoleAccessedAt last time the project was accessed via console. used with plan's projectinactivitydays to determine if project is paused. + * @param BillingLimits|null $billingLimits billing limits reached */ public function __construct( public string $id, @@ -65,9 +65,9 @@ public function __construct( public array $services, public array $protocols, public string $region, - public BillingLimits $billingLimits, public array $blocks, - public string $consoleAccessedAt + public string $consoleAccessedAt, + public ?BillingLimits $billingLimits = null ) { } @@ -148,9 +148,6 @@ public static function from(array $data): static if (!array_key_exists('region', $data)) { throw new \InvalidArgumentException('Missing required field "region" for ' . static::class . '.'); } - if (!array_key_exists('billingLimits', $data)) { - throw new \InvalidArgumentException('Missing required field "billingLimits" for ' . static::class . '.'); - } if (!array_key_exists('blocks', $data)) { throw new \InvalidArgumentException('Missing required field "blocks" for ' . static::class . '.'); } @@ -203,14 +200,14 @@ public static function from(array $data): static ) : $data['protocols'], region: $data['region'], - billingLimits: static::hydrateTypedValue(BillingLimits::class, $data['billingLimits']), blocks: is_array($data['blocks']) ? array_map( static fn (mixed $item): mixed => static::hydrateTypedValue(Block::class, $item), $data['blocks'] ) : $data['blocks'], - consoleAccessedAt: $data['consoleAccessedAt'] + consoleAccessedAt: $data['consoleAccessedAt'], + billingLimits: array_key_exists('billingLimits', $data) ? static::hydrateTypedValue(BillingLimits::class, $data['billingLimits'], true) : null ); } diff --git a/tests/Appwrite/Services/ProjectTest.php b/tests/Appwrite/Services/ProjectTest.php index 81180fb3..315e4c88 100644 --- a/tests/Appwrite/Services/ProjectTest.php +++ b/tests/Appwrite/Services/ProjectTest.php @@ -81,16 +81,6 @@ public function testMethodGet(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -181,16 +171,6 @@ public function testMethodUpdateAuthMethod(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -419,16 +399,6 @@ public function testMethodUpdateLabels(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -907,7 +877,7 @@ public function testMethodUpdateOAuth2Google(): void "\$id" => "github", "enabled" => true, "clientId" => "120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com", - "clientSecret" => "example-google-client-secret", + "clientSecret" => "GOCSPX-2k8gsR0000000000000000VNahJj", "prompt" => array() ); @@ -964,7 +934,7 @@ public function testMethodUpdateOAuth2Linkedin(): void "\$id" => "github", "enabled" => true, "clientId" => "770000000000dv", - "primaryClientSecret" => "example-linkedin-client-secret" + "primaryClientSecret" => "WPL_AP1.2Bf0000000000000./HtlYw==" ); $this->client @@ -1736,16 +1706,6 @@ public function testMethodUpdateDenyAliasedEmailPolicy(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -1825,16 +1785,6 @@ public function testMethodUpdateDenyDisposableEmailPolicy(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -1914,16 +1864,6 @@ public function testMethodUpdateDenyFreeEmailPolicy(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -2003,16 +1943,6 @@ public function testMethodUpdateMembershipPrivacyPolicy(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -2090,16 +2020,6 @@ public function testMethodUpdatePasswordDictionaryPolicy(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -2179,16 +2099,6 @@ public function testMethodUpdatePasswordHistoryPolicy(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -2268,16 +2178,6 @@ public function testMethodUpdatePasswordPersonalDataPolicy(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -2357,16 +2257,6 @@ public function testMethodUpdateSessionAlertPolicy(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -2446,16 +2336,6 @@ public function testMethodUpdateSessionDurationPolicy(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -2535,16 +2415,6 @@ public function testMethodUpdateSessionInvalidationPolicy(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -2624,16 +2494,6 @@ public function testMethodUpdateSessionLimitPolicy(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -2713,16 +2573,6 @@ public function testMethodUpdateUserLimitPolicy(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -2829,16 +2679,6 @@ public function testMethodUpdateProtocol(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -2919,16 +2759,6 @@ public function testMethodUpdateService(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", @@ -3009,16 +2839,6 @@ public function testMethodUpdateSMTP(): void ) ), "region" => "fra", - "billingLimits" => array( - "bandwidth" => 5, - "storage" => 150, - "users" => 200000, - "executions" => 750000, - "GBHours" => 100, - "imageTransformations" => 100, - "authPhone" => 10, - "budgetLimit" => 100 - ), "blocks" => array( array( "\$createdAt" => "2020-10-15T06:38:00.000+00:00", diff --git a/tests/Appwrite/Services/StorageTest.php b/tests/Appwrite/Services/StorageTest.php index ac7c71f5..4b62eead 100644 --- a/tests/Appwrite/Services/StorageTest.php +++ b/tests/Appwrite/Services/StorageTest.php @@ -176,6 +176,7 @@ public function testMethodListFiles(): void "signature" => "5d529fd02b544198ae075bd57c1762bb", "mimeType" => "image/png", "sizeOriginal" => 17890, + "sizeActual" => 12345, "chunksTotal" => 17890, "chunksUploaded" => 17890, "encryption" => true, @@ -207,6 +208,7 @@ public function testMethodCreateFile(): void "signature" => "5d529fd02b544198ae075bd57c1762bb", "mimeType" => "image/png", "sizeOriginal" => 17890, + "sizeActual" => 12345, "chunksTotal" => 17890, "chunksUploaded" => 17890, "encryption" => true, @@ -238,6 +240,7 @@ public function testMethodGetFile(): void "signature" => "5d529fd02b544198ae075bd57c1762bb", "mimeType" => "image/png", "sizeOriginal" => 17890, + "sizeActual" => 12345, "chunksTotal" => 17890, "chunksUploaded" => 17890, "encryption" => true, @@ -268,6 +271,7 @@ public function testMethodUpdateFile(): void "signature" => "5d529fd02b544198ae075bd57c1762bb", "mimeType" => "image/png", "sizeOriginal" => 17890, + "sizeActual" => 12345, "chunksTotal" => 17890, "chunksUploaded" => 17890, "encryption" => true, From 6dfb54d94916b8d1c23245254f0255e7bddaccb8 Mon Sep 17 00:00:00 2001 From: Prem Palanisamy Date: Wed, 20 May 2026 07:41:24 +0100 Subject: [PATCH 2/5] chore: bump version to 24.0.1 and add changelog --- CHANGELOG.md | 9 +++++++++ src/Appwrite/Client.php | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04807029..9953d684 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 24.0.1 + +* Fixed: `Project.billingLimits` now hydrates as `?BillingLimits` (nullable) — server emits `billingLimits: {}` for projects with no usage limits crossed, which previously threw `InvalidArgumentException: Missing required field "bandwidth"` on every `Project` response parse +* Fixed: All 8 `BillingLimits` inner fields (`bandwidth`, `storage`, `users`, `executions`, `GBHours`, `imageTransformations`, `authPhone`, `budgetLimit`) now hydrate as `?int` — match the runtime "sparse map of limits crossed" semantics +* Fixed: `Project.consoleAccessedAt` no longer null at runtime — server now emits empty string for never-accessed projects, matching the OSS `pingedAt` convention +* Added: `File.sizeActual` field — actual bytes used on disk after compression / encryption +* Removed: `Prompt` enum — stale leftover, no remaining references +* Updated: Advisor doc examples (`get-insight`, `get-report`, `list-insights`, `list-reports`) corrected to use API key auth instead of session + ## 24.0.0 * Breaking: Renamed `AuthMethod` enum to `ProjectAuthMethodId` diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index 09df9b9b..4c3158bf 100644 --- a/src/Appwrite/Client.php +++ b/src/Appwrite/Client.php @@ -37,11 +37,11 @@ class Client */ protected array $headers = [ 'content-type' => '', - 'user-agent' => 'AppwritePHPSDK/24.0.0 ()', + 'user-agent' => 'AppwritePHPSDK/24.0.1 ()', 'x-sdk-name'=> 'PHP', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '24.0.0', + 'x-sdk-version'=> '24.0.1', ]; /** From 7c0cdca0150673ded14e447a98c3212905b680e8 Mon Sep 17 00:00:00 2001 From: premtsd-code Date: Wed, 20 May 2026 08:04:30 +0000 Subject: [PATCH 3/5] chore: update PHP SDK to 24.0.1 --- CHANGELOG.md | 9 --------- docs/project.md | 4 ++-- tests/Appwrite/Services/ProjectTest.php | 4 ++-- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9953d684..04807029 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,5 @@ # Change Log -## 24.0.1 - -* Fixed: `Project.billingLimits` now hydrates as `?BillingLimits` (nullable) — server emits `billingLimits: {}` for projects with no usage limits crossed, which previously threw `InvalidArgumentException: Missing required field "bandwidth"` on every `Project` response parse -* Fixed: All 8 `BillingLimits` inner fields (`bandwidth`, `storage`, `users`, `executions`, `GBHours`, `imageTransformations`, `authPhone`, `budgetLimit`) now hydrate as `?int` — match the runtime "sparse map of limits crossed" semantics -* Fixed: `Project.consoleAccessedAt` no longer null at runtime — server now emits empty string for never-accessed projects, matching the OSS `pingedAt` convention -* Added: `File.sizeActual` field — actual bytes used on disk after compression / encryption -* Removed: `Prompt` enum — stale leftover, no remaining references -* Updated: Advisor doc examples (`get-insight`, `get-report`, `list-insights`, `list-reports`) corrected to use API key auth instead of session - ## 24.0.0 * Breaking: Renamed `AuthMethod` enum to `ProjectAuthMethodId` diff --git a/docs/project.md b/docs/project.md index 81f603ce..7ef92d74 100644 --- a/docs/project.md +++ b/docs/project.md @@ -501,7 +501,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/google | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Google OAuth2 app. For example: 120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com | | -| clientSecret | string | 'Client Secret' of Google OAuth2 app. For example: GOCSPX-2k8gsR0000000000000000VNahJj | | +| clientSecret | string | 'Client Secret' of Google OAuth2 app. For example: example-google-client-secret | | | prompt | array | Array of Google OAuth2 prompt values. If "none" is included, it must be the only element. "none" means: don't display any authentication or consent screens. Must not be specified with other values. "consent" means: prompt the user for consent. "select_account" means: prompt the user to select an account. | | | enabled | boolean | OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. | | @@ -549,7 +549,7 @@ PATCH https://cloud.appwrite.io/v1/project/oauth2/linkedin | Field Name | Type | Description | Default | | --- | --- | --- | --- | | clientId | string | 'Client ID' of Linkedin OAuth2 app. For example: 770000000000dv | | -| primaryClientSecret | string | 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: WPL_AP1.2Bf0000000000000./HtlYw== | | +| primaryClientSecret | string | 'Primary Client Secret or Secondary Client Secret' of Linkedin OAuth2 app. For example: example-linkedin-client-secret | | | enabled | boolean | OAuth2 sign-in method status. Set to true to enable new session creation. Setting to true will trigger end-to-end credentials validation, and will throw if the credentials are invalid. | | diff --git a/tests/Appwrite/Services/ProjectTest.php b/tests/Appwrite/Services/ProjectTest.php index 315e4c88..4b859821 100644 --- a/tests/Appwrite/Services/ProjectTest.php +++ b/tests/Appwrite/Services/ProjectTest.php @@ -877,7 +877,7 @@ public function testMethodUpdateOAuth2Google(): void "\$id" => "github", "enabled" => true, "clientId" => "120000000095-92ifjb00000000000000000000g7ijfb.apps.googleusercontent.com", - "clientSecret" => "GOCSPX-2k8gsR0000000000000000VNahJj", + "clientSecret" => "example-google-client-secret", "prompt" => array() ); @@ -934,7 +934,7 @@ public function testMethodUpdateOAuth2Linkedin(): void "\$id" => "github", "enabled" => true, "clientId" => "770000000000dv", - "primaryClientSecret" => "WPL_AP1.2Bf0000000000000./HtlYw==" + "primaryClientSecret" => "example-linkedin-client-secret" ); $this->client From 910562be45d270a351d7b37db8e7b1aee339ea9e Mon Sep 17 00:00:00 2001 From: premtsd-code Date: Wed, 20 May 2026 08:36:16 +0000 Subject: [PATCH 4/5] feat: update PHP SDK to 25.0.0 * Breaking: Removed `Prompt` enum class * Breaking: Changed `BillingLimits` properties from required to nullable * Breaking: Moved `billingLimits` property to optional in `Project` model * Added `sizeActual` property to `File` model for compressed storage size * Updated authentication examples from session to API key based * Breaking: Removed `updateDenyCanonicalEmailPolicy` method documentation --- CHANGELOG.md | 9 +++++++++ src/Appwrite/Client.php | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04807029..306db102 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Change Log +## 25.0.0 + +* Breaking: Removed `Prompt` enum class +* Breaking: Changed `BillingLimits` properties from required to nullable +* Breaking: Moved `billingLimits` property to optional in `Project` model +* Added `sizeActual` property to `File` model for compressed storage size +* Updated authentication examples from session to API key based +* Breaking: Removed `updateDenyCanonicalEmailPolicy` method documentation + ## 24.0.0 * Breaking: Renamed `AuthMethod` enum to `ProjectAuthMethodId` diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index 4c3158bf..9d46a417 100644 --- a/src/Appwrite/Client.php +++ b/src/Appwrite/Client.php @@ -37,11 +37,11 @@ class Client */ protected array $headers = [ 'content-type' => '', - 'user-agent' => 'AppwritePHPSDK/24.0.1 ()', + 'user-agent' => 'AppwritePHPSDK/25.0.0 ()', 'x-sdk-name'=> 'PHP', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '24.0.1', + 'x-sdk-version'=> '25.0.0', ]; /** From 5b7f9f521d1ff7a0b96891eb21fff2308117eb0e Mon Sep 17 00:00:00 2001 From: premtsd-code Date: Wed, 20 May 2026 09:00:46 +0000 Subject: [PATCH 5/5] chore: update PHP SDK to 24.1.0 --- CHANGELOG.md | 15 +++++++-------- src/Appwrite/Client.php | 4 ++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 306db102..07f15349 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,12 @@ # Change Log -## 25.0.0 - -* Breaking: Removed `Prompt` enum class -* Breaking: Changed `BillingLimits` properties from required to nullable -* Breaking: Moved `billingLimits` property to optional in `Project` model -* Added `sizeActual` property to `File` model for compressed storage size -* Updated authentication examples from session to API key based -* Breaking: Removed `updateDenyCanonicalEmailPolicy` method documentation +## 24.1.0 + +* Added `sizeActual` property to `File` model for actual stored size after compression/encryption +* Updated `BillingLimits` properties to be nullable to match the server's sparse "limits crossed" response +* Updated `Project.billingLimits` to be nullable +* Updated advisor example docs to use API key authentication +* Removed orphaned `Prompt` enum (already unused; superseded by `ProjectOAuth2GooglePrompt` in 24.0.0) ## 24.0.0 diff --git a/src/Appwrite/Client.php b/src/Appwrite/Client.php index 9d46a417..f9ff4541 100644 --- a/src/Appwrite/Client.php +++ b/src/Appwrite/Client.php @@ -37,11 +37,11 @@ class Client */ protected array $headers = [ 'content-type' => '', - 'user-agent' => 'AppwritePHPSDK/25.0.0 ()', + 'user-agent' => 'AppwritePHPSDK/24.1.0 ()', 'x-sdk-name'=> 'PHP', 'x-sdk-platform'=> 'server', 'x-sdk-language'=> 'php', - 'x-sdk-version'=> '25.0.0', + 'x-sdk-version'=> '24.1.0', ]; /**