Skip to content

Commit d915592

Browse files
authored
Merge pull request #148 from appwrite/dev
2 parents de72141 + 70b4d95 commit d915592

File tree

11 files changed

+685
-8
lines changed

11 files changed

+685
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## 21.5.0
4+
5+
* Add `getScreenshot` method to `Avatars` service
6+
* Add `Theme`, `Timezone` and `Output` enums
7+
38
## 21.4.0
49

510
* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { Client, Account } from "appwrite";
3333
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:
3434

3535
```html
36-
<script src="https://cdn.jsdelivr.net/npm/appwrite@21.4.0"></script>
36+
<script src="https://cdn.jsdelivr.net/npm/appwrite@21.5.0"></script>
3737
```
3838

3939

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { Client, Avatars, Theme, Timezone, Output } from "appwrite";
2+
3+
const client = new Client()
4+
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
5+
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
6+
7+
const avatars = new Avatars(client);
8+
9+
const result = avatars.getScreenshot({
10+
url: 'https://example.com',
11+
headers: {
12+
"Authorization": "Bearer token123",
13+
"X-Custom-Header": "value"
14+
}, // optional
15+
viewportWidth: 1920, // optional
16+
viewportHeight: 1080, // optional
17+
scale: 2, // optional
18+
theme: Theme.Light, // optional
19+
userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // optional
20+
fullpage: true, // optional
21+
locale: 'en-US', // optional
22+
timezone: Timezone.AfricaAbidjan, // optional
23+
latitude: 37.7749, // optional
24+
longitude: -122.4194, // optional
25+
accuracy: 100, // optional
26+
touch: true, // optional
27+
permissions: ["geolocation","notifications"], // optional
28+
sleep: 3, // optional
29+
width: 800, // optional
30+
height: 600, // optional
31+
quality: 85, // optional
32+
output: Output.Jpg // optional
33+
});
34+
35+
console.log(result);

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "appwrite",
33
"homepage": "https://appwrite.io/support",
44
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
5-
"version": "21.4.0",
5+
"version": "21.5.0",
66
"license": "BSD-3-Clause",
77
"main": "dist/cjs/sdk.js",
88
"exports": {
@@ -26,7 +26,7 @@
2626
},
2727
"devDependencies": {
2828
"@rollup/plugin-typescript": "8.3.2",
29-
"playwright": "1.15.0",
29+
"playwright": "1.56.1",
3030
"rollup": "2.79.2",
3131
"serve-handler": "6.1.0",
3232
"tslib": "2.4.0",

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ class Client {
320320
'x-sdk-name': 'Web',
321321
'x-sdk-platform': 'client',
322322
'x-sdk-language': 'web',
323-
'x-sdk-version': '21.4.0',
323+
'x-sdk-version': '21.5.0',
324324
'X-Appwrite-Response-Format': '1.8.0',
325325
};
326326

src/enums/output.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export enum Output {
2+
Jpg = 'jpg',
3+
Jpeg = 'jpeg',
4+
Png = 'png',
5+
Webp = 'webp',
6+
Heic = 'heic',
7+
Avif = 'avif',
8+
Gif = 'gif',
9+
}

src/enums/theme.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export enum Theme {
2+
Light = 'light',
3+
Dark = 'dark',
4+
}

0 commit comments

Comments
 (0)