Skip to content

Commit 964aa9d

Browse files
committed
feat: add method to service
1 parent dbfef5f commit 964aa9d

File tree

10 files changed

+823
-13
lines changed

10 files changed

+823
-13
lines changed

.gitpod.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

CHANGELOG.md

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

3+
## 0.19.0
4+
5+
* Add `getScreenshot` method to `Avatars` service
6+
37
## 0.18.0
48

59
* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Client, Avatars, Theme, Timezone, Output } from "react-native-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: {}, // optional
12+
viewportWidth: 1, // optional
13+
viewportHeight: 1, // optional
14+
scale: 0.1, // optional
15+
theme: Theme.Light, // optional
16+
userAgent: '<USER_AGENT>', // optional
17+
fullpage: false, // optional
18+
locale: '<LOCALE>', // optional
19+
timezone: Timezone.AfricaAbidjan, // optional
20+
latitude: -90, // optional
21+
longitude: -180, // optional
22+
accuracy: 0, // optional
23+
touch: false, // optional
24+
permissions: [], // optional
25+
sleep: 0, // optional
26+
width: 0, // optional
27+
height: 0, // optional
28+
quality: -1, // optional
29+
output: Output.Jpg // optional
30+
});
31+
32+
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": "react-native-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": "0.18.0",
5+
"version": "0.19.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.75.4",
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
@@ -115,7 +115,7 @@ class Client {
115115
'x-sdk-name': 'React Native',
116116
'x-sdk-platform': 'client',
117117
'x-sdk-language': 'reactnative',
118-
'x-sdk-version': '0.18.0',
118+
'x-sdk-version': '0.19.0',
119119
'X-Appwrite-Response-Format': '1.8.0',
120120
};
121121

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)