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

## 18.0.0

* Fix duplicate methods issue (e.g., `updateMFA` and `updateMfa`) causing build and runtime errors
* Add support for `getScreenshot` method to `Avatars` service
* Add `Output`, `Theme` and `Timezone` enums

## 17.5.0

* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"url": "https://appwrite.io/support",
"email": "team@appwrite.io"
},
"scripts": {
"test": "vendor/bin/phpunit"
},
"autoload": {
"psr-4": {
"Appwrite\\": "src/Appwrite"
Expand All @@ -19,7 +22,7 @@
},
"require-dev": {
"phpunit/phpunit": "^10",
"mockery/mockery": "^1.6.6"
"mockery/mockery": "^1.6.12"
},
"minimum-stability": "dev"
}
36 changes: 36 additions & 0 deletions docs/avatars.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,39 @@ GET https://cloud.appwrite.io/v1/avatars/qr
| margin | integer | Margin from edge. Pass an integer between 0 to 10. Defaults to 1. | 1 |
| download | boolean | Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0. | |


```http request
GET https://cloud.appwrite.io/v1/avatars/screenshots
```

** Use this endpoint to capture a screenshot of any website URL. This endpoint uses a headless browser to render the webpage and capture it as an image.

You can configure the browser viewport size, theme, user agent, geolocation, permissions, and more. Capture either just the viewport or the full page scroll.

When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px. **

### Parameters

| Field Name | Type | Description | Default |
| --- | --- | --- | --- |
| url | string | **Required** Website URL which you want to capture. | |
| headers | object | HTTP headers to send with the browser request. Defaults to empty. | {} |
| viewportWidth | integer | Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280. | 1280 |
| viewportHeight | integer | Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720. | 720 |
| scale | number | Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1. | 1 |
| theme | string | Browser theme. Pass "light" or "dark". Defaults to "light". | light |
| userAgent | string | Custom user agent string. Defaults to browser default. | |
| fullpage | boolean | Capture full page scroll. Pass 0 for viewport only, or 1 for full page. Defaults to 0. | |
| locale | string | Browser locale (e.g., "en-US", "fr-FR"). Defaults to browser default. | |
| timezone | string | IANA timezone identifier (e.g., "America/New_York", "Europe/London"). Defaults to browser default. | |
| latitude | number | Geolocation latitude. Pass a number between -90 to 90. Defaults to 0. | 0 |
| longitude | number | Geolocation longitude. Pass a number between -180 to 180. Defaults to 0. | 0 |
| accuracy | number | Geolocation accuracy in meters. Pass a number between 0 to 100000. Defaults to 0. | 0 |
| touch | boolean | Enable touch support. Pass 0 for no touch, or 1 for touch enabled. Defaults to 0. | |
| permissions | array | Browser permissions to grant. Pass an array of permission names like ["geolocation", "camera", "microphone"]. Defaults to empty. | [] |
| sleep | integer | Wait time in seconds before taking the screenshot. Pass an integer between 0 to 10. Defaults to 0. | 0 |
| width | integer | Output image width. Pass 0 to use original width, or an integer between 1 to 2000. Defaults to 0 (original width). | 0 |
| height | integer | Output image height. Pass 0 to use original height, or an integer between 1 to 2000. Defaults to 0 (original height). | 0 |
| quality | integer | Screenshot quality. Pass an integer between 0 to 100. Defaults to keep existing image quality. | -1 |
| output | string | Output format type (jpeg, jpg, png, gif and webp). | |

37 changes: 37 additions & 0 deletions docs/examples/avatars/get-screenshot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

use Appwrite\Client;
use Appwrite\Services\Avatars;
use Appwrite\Enums\Theme;
use Appwrite\Enums\Timezone;
use Appwrite\Enums\Output;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
->setProject('<YOUR_PROJECT_ID>') // Your project ID
->setSession(''); // The user session to authenticate with

$avatars = new Avatars($client);

$result = $avatars->getScreenshot(
url: 'https://example.com',
headers: [], // optional
viewportWidth: 1, // optional
viewportHeight: 1, // optional
scale: 0.1, // optional
theme: Theme::LIGHT(), // optional
userAgent: '<USER_AGENT>', // optional
fullpage: false, // optional
locale: '<LOCALE>', // 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
output: Output::JPG() // optional
);
1 change: 1 addition & 0 deletions docs/examples/databases/create-relationship-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use Appwrite\Client;
use Appwrite\Services\Databases;
use Appwrite\Enums\RelationshipType;
use Appwrite\Enums\RelationMutate;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
1 change: 1 addition & 0 deletions docs/examples/databases/update-relationship-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Appwrite\Client;
use Appwrite\Services\Databases;
use Appwrite\Enums\RelationMutate;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
1 change: 1 addition & 0 deletions docs/examples/functions/create-execution.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\ExecutionMethod;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/functions/create.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\;
use Appwrite\Enums\Runtime;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -14,7 +14,7 @@ $functions = new Functions($client);
$result = $functions->create(
functionId: '<FUNCTION_ID>',
name: '<NAME>',
runtime: ::NODE145(),
runtime: Runtime::NODE145(),
execute: ["any"], // optional
events: [], // optional
schedule: '', // optional
Expand Down
1 change: 1 addition & 0 deletions docs/examples/functions/get-deployment-download.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\DeploymentDownloadType;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/functions/update.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\Runtime;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -13,7 +14,7 @@ $functions = new Functions($client);
$result = $functions->update(
functionId: '<FUNCTION_ID>',
name: '<NAME>',
runtime: ::NODE145(), // optional
runtime: Runtime::NODE145(), // optional
execute: ["any"], // optional
events: [], // optional
schedule: '', // optional
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/health/get-failed-jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use Appwrite\Client;
use Appwrite\Services\Health;
use Appwrite\Enums\;
use Appwrite\Enums\Name;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -12,6 +12,6 @@ $client = (new Client())
$health = new Health($client);

$result = $health->getFailedJobs(
name: ::V1DATABASE(),
name: Name::V1DATABASE(),
threshold: null // optional
);
1 change: 1 addition & 0 deletions docs/examples/messaging/create-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Appwrite\Client;
use Appwrite\Services\Messaging;
use Appwrite\Enums\MessagePriority;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
1 change: 1 addition & 0 deletions docs/examples/messaging/create-smtp-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Appwrite\Client;
use Appwrite\Services\Messaging;
use Appwrite\Enums\SmtpEncryption;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
1 change: 1 addition & 0 deletions docs/examples/messaging/update-push.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Appwrite\Client;
use Appwrite\Services\Messaging;
use Appwrite\Enums\MessagePriority;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
1 change: 1 addition & 0 deletions docs/examples/messaging/update-smtp-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Appwrite\Client;
use Appwrite\Services\Messaging;
use Appwrite\Enums\SmtpEncryption;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
11 changes: 6 additions & 5 deletions docs/examples/sites/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

use Appwrite\Client;
use Appwrite\Services\Sites;
use Appwrite\Enums\;
use Appwrite\Enums\;
use Appwrite\Enums\Framework;
use Appwrite\Enums\BuildRuntime;
use Appwrite\Enums\Adapter;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -15,15 +16,15 @@ $sites = new Sites($client);
$result = $sites->create(
siteId: '<SITE_ID>',
name: '<NAME>',
framework: ::ANALOG(),
buildRuntime: ::NODE145(),
framework: Framework::ANALOG(),
buildRuntime: BuildRuntime::NODE145(),
enabled: false, // optional
logging: false, // optional
timeout: 1, // optional
installCommand: '<INSTALL_COMMAND>', // optional
buildCommand: '<BUILD_COMMAND>', // optional
outputDirectory: '<OUTPUT_DIRECTORY>', // optional
adapter: ::STATIC(), // optional
adapter: Adapter::STATIC(), // optional
installationId: '<INSTALLATION_ID>', // optional
fallbackFile: '<FALLBACK_FILE>', // optional
providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional
Expand Down
1 change: 1 addition & 0 deletions docs/examples/sites/get-deployment-download.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\DeploymentDownloadType;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
10 changes: 6 additions & 4 deletions docs/examples/sites/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

use Appwrite\Client;
use Appwrite\Services\Sites;
use Appwrite\Enums\;
use Appwrite\Enums\Framework;
use Appwrite\Enums\BuildRuntime;
use Appwrite\Enums\Adapter;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -14,15 +16,15 @@ $sites = new Sites($client);
$result = $sites->update(
siteId: '<SITE_ID>',
name: '<NAME>',
framework: ::ANALOG(),
framework: Framework::ANALOG(),
enabled: false, // optional
logging: false, // optional
timeout: 1, // optional
installCommand: '<INSTALL_COMMAND>', // optional
buildCommand: '<BUILD_COMMAND>', // optional
outputDirectory: '<OUTPUT_DIRECTORY>', // optional
buildRuntime: ::NODE145(), // optional
adapter: ::STATIC(), // optional
buildRuntime: BuildRuntime::NODE145(), // optional
adapter: Adapter::STATIC(), // optional
fallbackFile: '<FALLBACK_FILE>', // optional
installationId: '<INSTALLATION_ID>', // optional
providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/storage/create-bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Appwrite\Client;
use Appwrite\Services\Storage;
use Appwrite\Enums\Compression;
use Appwrite\Permission;
use Appwrite\Role;

Expand All @@ -20,7 +21,7 @@ $result = $storage->createBucket(
enabled: false, // optional
maximumFileSize: 1, // optional
allowedFileExtensions: [], // optional
compression: ::NONE(), // optional
compression: Compression::NONE(), // optional
encryption: false, // optional
antivirus: false // optional
);
2 changes: 2 additions & 0 deletions docs/examples/storage/get-file-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

use Appwrite\Client;
use Appwrite\Services\Storage;
use Appwrite\Enums\ImageGravity;
use Appwrite\Enums\ImageFormat;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/storage/update-bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Appwrite\Client;
use Appwrite\Services\Storage;
use Appwrite\Enums\Compression;
use Appwrite\Permission;
use Appwrite\Role;

Expand All @@ -20,7 +21,7 @@ $result = $storage->updateBucket(
enabled: false, // optional
maximumFileSize: 1, // optional
allowedFileExtensions: [], // optional
compression: ::NONE(), // optional
compression: Compression::NONE(), // optional
encryption: false, // optional
antivirus: false // optional
);
1 change: 1 addition & 0 deletions docs/examples/tablesdb/create-relationship-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use Appwrite\Client;
use Appwrite\Services\TablesDB;
use Appwrite\Enums\RelationshipType;
use Appwrite\Enums\RelationMutate;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
1 change: 1 addition & 0 deletions docs/examples/tablesdb/update-relationship-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Appwrite\Client;
use Appwrite\Services\TablesDB;
use Appwrite\Enums\RelationMutate;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
1 change: 1 addition & 0 deletions docs/examples/users/create-sha-user.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Appwrite\Client;
use Appwrite\Services\Users;
use Appwrite\Enums\PasswordHash;

$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand Down
2 changes: 1 addition & 1 deletion docs/sites.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ GET https://cloud.appwrite.io/v1/sites/{siteId}/deployments
POST https://cloud.appwrite.io/v1/sites/{siteId}/deployments
```

** Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you&#039;ll need to update the function&#039;s deployment to use your new deployment ID. **
** Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you&#039;ll need to update the site&#039;s deployment to use your new deployment ID. **

### Parameters

Expand Down
Loading