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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 19.0.0

* Rename `VCSDeploymentType` enum to `VCSReferenceType`
* Change `createTemplateDeployment` method signature: replace `version` parameter with `type` (TemplateReferenceType) and `reference` parameters
* Add `Theme`, `Timezone` and `Output` enums

## 18.0.1

* Fix `TablesDB` service to use correct file name
Expand Down
8 changes: 4 additions & 4 deletions docs/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ DELETE https://cloud.appwrite.io/v1/account/mfa/authenticators/{type}


```http request
POST https://cloud.appwrite.io/v1/account/mfa/challenge
POST https://cloud.appwrite.io/v1/account/mfa/challenges
```

** Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. **
Expand All @@ -195,7 +195,7 @@ POST https://cloud.appwrite.io/v1/account/mfa/challenge


```http request
POST https://cloud.appwrite.io/v1/account/mfa/challenge
POST https://cloud.appwrite.io/v1/account/mfa/challenges
```

** Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method. **
Expand All @@ -208,7 +208,7 @@ POST https://cloud.appwrite.io/v1/account/mfa/challenge


```http request
PUT https://cloud.appwrite.io/v1/account/mfa/challenge
PUT https://cloud.appwrite.io/v1/account/mfa/challenges
```

** Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. **
Expand All @@ -222,7 +222,7 @@ PUT https://cloud.appwrite.io/v1/account/mfa/challenge


```http request
PUT https://cloud.appwrite.io/v1/account/mfa/challenge
PUT https://cloud.appwrite.io/v1/account/mfa/challenges
```

** Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method. **
Expand Down
35 changes: 19 additions & 16 deletions docs/examples/avatars/get-screenshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,26 @@ $avatars = new Avatars($client);

$result = $avatars->getScreenshot(
url: 'https://example.com',
headers: [], // optional
viewportWidth: 1, // optional
viewportHeight: 1, // optional
scale: 0.1, // optional
headers: [
'Authorization' => 'Bearer token123',
'X-Custom-Header' => 'value'
], // optional
viewportWidth: 1920, // optional
viewportHeight: 1080, // optional
scale: 2, // optional
theme: Theme::LIGHT(), // optional
userAgent: '<USER_AGENT>', // optional
fullpage: false, // optional
locale: '<LOCALE>', // optional
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional
fullpage: true, // optional
locale: 'en-US', // optional
timezone: Timezone::AFRICAABIDJAN(), // optional
latitude: -90, // optional
longitude: -180, // optional
accuracy: 0, // optional
touch: false, // optional
permissions: [], // optional
sleep: 0, // optional
width: 0, // optional
height: 0, // optional
quality: -1, // optional
latitude: 37.7749, // optional
longitude: -122.4194, // optional
accuracy: 100, // optional
touch: true, // optional
permissions: ["geolocation","notifications"], // optional
sleep: 3, // optional
width: 800, // optional
height: 600, // optional
quality: 85, // optional
output: Output::JPG() // optional
);
4 changes: 3 additions & 1 deletion docs/examples/functions/create-template-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Appwrite\Client;
use Appwrite\Services\Functions;
use Appwrite\Enums\TemplateReferenceType;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -15,6 +16,7 @@ $result = $functions->createTemplateDeployment(
repository: '<REPOSITORY>',
owner: '<OWNER>',
rootDirectory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: TemplateReferenceType::COMMIT(),
reference: '<REFERENCE>',
activate: false // optional
);
4 changes: 2 additions & 2 deletions docs/examples/functions/create-vcs-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use Appwrite\Client;
use Appwrite\Services\Functions;
use Appwrite\Enums\VCSDeploymentType;
use Appwrite\Enums\VCSReferenceType;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -13,7 +13,7 @@ $functions = new Functions($client);

$result = $functions->createVcsDeployment(
functionId: '<FUNCTION_ID>',
type: VCSDeploymentType::BRANCH(),
type: VCSReferenceType::BRANCH(),
reference: '<REFERENCE>',
activate: false // optional
);
4 changes: 3 additions & 1 deletion docs/examples/sites/create-template-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Appwrite\Client;
use Appwrite\Services\Sites;
use Appwrite\Enums\TemplateReferenceType;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -15,6 +16,7 @@ $result = $sites->createTemplateDeployment(
repository: '<REPOSITORY>',
owner: '<OWNER>',
rootDirectory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: TemplateReferenceType::BRANCH(),
reference: '<REFERENCE>',
activate: false // optional
);
4 changes: 2 additions & 2 deletions docs/examples/sites/create-vcs-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Appwrite\Client;
use Appwrite\Services\Sites;
use Appwrite\Enums\VCSDeploymentType;
use Appwrite\Enums\VCSReferenceType;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -13,7 +13,7 @@ $sites = new Sites($client);

$result = $sites->createVcsDeployment(
siteId: '<SITE_ID>',
type: VCSDeploymentType::BRANCH(),
type: VCSReferenceType::BRANCH(),
reference: '<REFERENCE>',
activate: false // optional
);
3 changes: 2 additions & 1 deletion docs/examples/storage/create-bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ $result = $storage->createBucket(
allowedFileExtensions: [], // optional
compression: Compression::NONE(), // optional
encryption: false, // optional
antivirus: false // optional
antivirus: false, // optional
transformations: false // optional
);
3 changes: 2 additions & 1 deletion docs/examples/storage/update-bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ $result = $storage->updateBucket(
allowedFileExtensions: [], // optional
compression: Compression::NONE(), // optional
encryption: false, // optional
antivirus: false // optional
antivirus: false, // optional
transformations: false // optional
);
3 changes: 2 additions & 1 deletion docs/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/p
| repository | string | Repository name of the template. | |
| owner | string | The name of the owner of the template. | |
| rootDirectory | string | Path to function code in the template repo. | |
| version | string | Version (tag) for the repo linked to the function template. | |
| type | string | Type for the reference provided. Can be commit, branch, or tag | |
| reference | string | Reference value, can be a commit hash, branch name, or release tag | |
| activate | boolean | Automatically activate the deployment when it is finished building. | |


Expand Down
3 changes: 2 additions & 1 deletion docs/sites.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@ Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/p
| repository | string | Repository name of the template. | |
| owner | string | The name of the owner of the template. | |
| rootDirectory | string | Path to site code in the template repo. | |
| version | string | Version (tag) for the repo linked to the site template. | |
| type | string | Type for the reference provided. Can be commit, branch, or tag | |
| reference | string | Reference value, can be a commit hash, branch name, or release tag | |
| activate | boolean | Automatically activate the deployment when it is finished building. | |


Expand Down
4 changes: 3 additions & 1 deletion docs/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GET https://cloud.appwrite.io/v1/storage/buckets

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus | [] |
| queries | array | Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus, transformations | [] |
| search | string | Search term to filter your list results. Max length: 256 chars. | |
| total | boolean | When set to false, the total count returned will be 0 and will not be calculated. | 1 |

Expand All @@ -36,6 +36,7 @@ POST https://cloud.appwrite.io/v1/storage/buckets
| compression | string | Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled | none |
| encryption | boolean | Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled | 1 |
| antivirus | boolean | Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled | 1 |
| transformations | boolean | Are image transformations enabled? | 1 |


```http request
Expand Down Expand Up @@ -71,6 +72,7 @@ PUT https://cloud.appwrite.io/v1/storage/buckets/{bucketId}
| compression | string | Compression algorithm choosen for compression. Can be one of none, [gzip](https://en.wikipedia.org/wiki/Gzip), or [zstd](https://en.wikipedia.org/wiki/Zstd), For file size above 20MB compression is skipped even if it's enabled | none |
| encryption | boolean | Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled | 1 |
| antivirus | boolean | Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled | 1 |
| transformations | boolean | Are image transformations enabled? | 1 |


```http request
Expand Down
2 changes: 1 addition & 1 deletion docs/tablesdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ PUT https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}
| tableId | string | **Required** Table ID. | |
| name | string | Table name. Max length: 128 chars. | |
| permissions | array | An array of permission strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions). | |
| rowSecurity | boolean | Enables configuring permissions for individual rows. A user needs one of row or table level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions). | |
| rowSecurity | boolean | Enables configuring permissions for individual rows. A user needs one of row or table-level permissions to access a row. [Learn more about permissions](https://appwrite.io/docs/permissions). | |
| enabled | boolean | Is table enabled? When set to 'disabled', users cannot access the table but Server SDKs with and API key can still read and write to the table. No data is lost when this is toggled. | 1 |


Expand Down
4 changes: 2 additions & 2 deletions src/Appwrite/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class Client
*/
protected array $headers = [
'content-type' => '',
'user-agent' => 'AppwritePHPSDK/18.0.1 ()',
'user-agent' => 'AppwritePHPSDK/19.0.0 ()',
'x-sdk-name'=> 'PHP',
'x-sdk-platform'=> 'server',
'x-sdk-language'=> 'php',
'x-sdk-version'=> '18.0.1',
'x-sdk-version'=> '19.0.0',
];

/**
Expand Down
16 changes: 16 additions & 0 deletions src/Appwrite/Enums/BuildRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class BuildRuntime implements JsonSerializable
private static BuildRuntime $DART33;
private static BuildRuntime $DART35;
private static BuildRuntime $DART38;
private static BuildRuntime $DART39;
private static BuildRuntime $DOTNET60;
private static BuildRuntime $DOTNET70;
private static BuildRuntime $DOTNET80;
Expand Down Expand Up @@ -71,6 +72,7 @@ class BuildRuntime implements JsonSerializable
private static BuildRuntime $FLUTTER327;
private static BuildRuntime $FLUTTER329;
private static BuildRuntime $FLUTTER332;
private static BuildRuntime $FLUTTER335;

private string $value;

Expand Down Expand Up @@ -355,6 +357,13 @@ public static function DART38(): BuildRuntime
}
return self::$DART38;
}
public static function DART39(): BuildRuntime
{
if (!isset(self::$DART39)) {
self::$DART39 = new BuildRuntime('dart-3.9');
}
return self::$DART39;
}
public static function DOTNET60(): BuildRuntime
{
if (!isset(self::$DOTNET60)) {
Expand Down Expand Up @@ -544,4 +553,11 @@ public static function FLUTTER332(): BuildRuntime
}
return self::$FLUTTER332;
}
public static function FLUTTER335(): BuildRuntime
{
if (!isset(self::$FLUTTER335)) {
self::$FLUTTER335 = new BuildRuntime('flutter-3.35');
}
return self::$FLUTTER335;
}
}
16 changes: 16 additions & 0 deletions src/Appwrite/Enums/Runtime.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class Runtime implements JsonSerializable
private static Runtime $DART33;
private static Runtime $DART35;
private static Runtime $DART38;
private static Runtime $DART39;
private static Runtime $DOTNET60;
private static Runtime $DOTNET70;
private static Runtime $DOTNET80;
Expand Down Expand Up @@ -71,6 +72,7 @@ class Runtime implements JsonSerializable
private static Runtime $FLUTTER327;
private static Runtime $FLUTTER329;
private static Runtime $FLUTTER332;
private static Runtime $FLUTTER335;

private string $value;

Expand Down Expand Up @@ -355,6 +357,13 @@ public static function DART38(): Runtime
}
return self::$DART38;
}
public static function DART39(): Runtime
{
if (!isset(self::$DART39)) {
self::$DART39 = new Runtime('dart-3.9');
}
return self::$DART39;
}
public static function DOTNET60(): Runtime
{
if (!isset(self::$DOTNET60)) {
Expand Down Expand Up @@ -544,4 +553,11 @@ public static function FLUTTER332(): Runtime
}
return self::$FLUTTER332;
}
public static function FLUTTER335(): Runtime
{
if (!isset(self::$FLUTTER335)) {
self::$FLUTTER335 = new Runtime('flutter-3.35');
}
return self::$FLUTTER335;
}
}
51 changes: 51 additions & 0 deletions src/Appwrite/Enums/TemplateReferenceType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace Appwrite\Enums;

use JsonSerializable;

class TemplateReferenceType implements JsonSerializable
{
private static TemplateReferenceType $BRANCH;
private static TemplateReferenceType $COMMIT;
private static TemplateReferenceType $TAG;

private string $value;

private function __construct(string $value)
{
$this->value = $value;
}

public function __toString(): string
{
return $this->value;
}

public function jsonSerialize(): string
{
return $this->value;
}

public static function BRANCH(): TemplateReferenceType
{
if (!isset(self::$BRANCH)) {
self::$BRANCH = new TemplateReferenceType('branch');
}
return self::$BRANCH;
}
public static function COMMIT(): TemplateReferenceType
{
if (!isset(self::$COMMIT)) {
self::$COMMIT = new TemplateReferenceType('commit');
}
return self::$COMMIT;
}
public static function TAG(): TemplateReferenceType
{
if (!isset(self::$TAG)) {
self::$TAG = new TemplateReferenceType('tag');
}
return self::$TAG;
}
}
Loading