react-native-appwrite 0.17.1 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/cjs/sdk.js +1009 -21
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +1009 -22
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/docs/examples/account/list-identities.md +2 -1
  7. package/docs/examples/account/list-logs.md +2 -1
  8. package/docs/examples/avatars/get-screenshot.md +35 -0
  9. package/docs/examples/databases/create-document.md +1 -1
  10. package/docs/examples/databases/list-documents.md +2 -1
  11. package/docs/examples/databases/update-document.md +1 -1
  12. package/docs/examples/databases/upsert-document.md +1 -1
  13. package/docs/examples/functions/list-executions.md +2 -1
  14. package/docs/examples/storage/create-file.md +1 -1
  15. package/docs/examples/storage/list-files.md +2 -1
  16. package/docs/examples/storage/update-file.md +1 -1
  17. package/docs/examples/tablesdb/create-row.md +1 -1
  18. package/docs/examples/tablesdb/list-rows.md +2 -1
  19. package/docs/examples/tablesdb/update-row.md +1 -1
  20. package/docs/examples/tablesdb/upsert-row.md +1 -1
  21. package/docs/examples/teams/list-memberships.md +2 -1
  22. package/docs/examples/teams/list.md +2 -1
  23. package/package.json +3 -4
  24. package/src/client.ts +1 -1
  25. package/src/enums/execution-status.ts +1 -0
  26. package/src/enums/output.ts +9 -0
  27. package/src/enums/theme.ts +4 -0
  28. package/src/enums/timezone.ts +421 -0
  29. package/src/index.ts +6 -0
  30. package/src/models.ts +1 -1
  31. package/src/operator.ts +308 -0
  32. package/src/query.ts +6 -6
  33. package/src/services/account.ts +34 -16
  34. package/src/services/avatars.ts +347 -0
  35. package/src/services/databases.ts +15 -7
  36. package/src/services/functions.ts +15 -7
  37. package/src/services/storage.ts +15 -7
  38. package/src/services/tables-db.ts +15 -7
  39. package/src/services/teams.ts +30 -14
  40. package/types/enums/execution-status.d.ts +2 -1
  41. package/types/enums/output.d.ts +9 -0
  42. package/types/enums/theme.d.ts +4 -0
  43. package/types/enums/timezone.d.ts +421 -0
  44. package/types/index.d.ts +6 -0
  45. package/types/models.d.ts +1 -1
  46. package/types/operator.d.ts +180 -0
  47. package/types/services/account.d.ts +8 -2
  48. package/types/services/avatars.d.ts +123 -0
  49. package/types/services/databases.d.ts +4 -1
  50. package/types/services/functions.d.ts +4 -1
  51. package/types/services/storage.d.ts +4 -1
  52. package/types/services/tables-db.d.ts +4 -1
  53. package/types/services/teams.d.ts +8 -2
  54. package/.gitpod.yml +0 -10
@@ -7,7 +7,8 @@ const client = new Client()
7
7
  const account = new Account(client);
8
8
 
9
9
  const result = await account.listIdentities({
10
- queries: [] // optional
10
+ queries: [], // optional
11
+ total: false // optional
11
12
  });
12
13
 
13
14
  console.log(result);
@@ -7,7 +7,8 @@ const client = new Client()
7
7
  const account = new Account(client);
8
8
 
9
9
  const result = await account.listLogs({
10
- queries: [] // optional
10
+ queries: [], // optional
11
+ total: false // optional
11
12
  });
12
13
 
13
14
  console.log(result);
@@ -0,0 +1,35 @@
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: {
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);
@@ -1,4 +1,4 @@
1
- import { Client, Databases } from "react-native-appwrite";
1
+ import { Client, Databases, Permission, Role } from "react-native-appwrite";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -10,7 +10,8 @@ const result = await databases.listDocuments({
10
10
  databaseId: '<DATABASE_ID>',
11
11
  collectionId: '<COLLECTION_ID>',
12
12
  queries: [], // optional
13
- transactionId: '<TRANSACTION_ID>' // optional
13
+ transactionId: '<TRANSACTION_ID>', // optional
14
+ total: false // optional
14
15
  });
15
16
 
16
17
  console.log(result);
@@ -1,4 +1,4 @@
1
- import { Client, Databases } from "react-native-appwrite";
1
+ import { Client, Databases, Permission, Role } from "react-native-appwrite";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -1,4 +1,4 @@
1
- import { Client, Databases } from "react-native-appwrite";
1
+ import { Client, Databases, Permission, Role } from "react-native-appwrite";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -8,7 +8,8 @@ const functions = new Functions(client);
8
8
 
9
9
  const result = await functions.listExecutions({
10
10
  functionId: '<FUNCTION_ID>',
11
- queries: [] // optional
11
+ queries: [], // optional
12
+ total: false // optional
12
13
  });
13
14
 
14
15
  console.log(result);
@@ -1,4 +1,4 @@
1
- import { Client, Storage } from "react-native-appwrite";
1
+ import { Client, Storage, Permission, Role } from "react-native-appwrite";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -9,7 +9,8 @@ const storage = new Storage(client);
9
9
  const result = await storage.listFiles({
10
10
  bucketId: '<BUCKET_ID>',
11
11
  queries: [], // optional
12
- search: '<SEARCH>' // optional
12
+ search: '<SEARCH>', // optional
13
+ total: false // optional
13
14
  });
14
15
 
15
16
  console.log(result);
@@ -1,4 +1,4 @@
1
- import { Client, Storage } from "react-native-appwrite";
1
+ import { Client, Storage, Permission, Role } from "react-native-appwrite";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -1,4 +1,4 @@
1
- import { Client, TablesDB } from "react-native-appwrite";
1
+ import { Client, TablesDB, Permission, Role } from "react-native-appwrite";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -10,7 +10,8 @@ const result = await tablesDB.listRows({
10
10
  databaseId: '<DATABASE_ID>',
11
11
  tableId: '<TABLE_ID>',
12
12
  queries: [], // optional
13
- transactionId: '<TRANSACTION_ID>' // optional
13
+ transactionId: '<TRANSACTION_ID>', // optional
14
+ total: false // optional
14
15
  });
15
16
 
16
17
  console.log(result);
@@ -1,4 +1,4 @@
1
- import { Client, TablesDB } from "react-native-appwrite";
1
+ import { Client, TablesDB, Permission, Role } from "react-native-appwrite";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -1,4 +1,4 @@
1
- import { Client, TablesDB } from "react-native-appwrite";
1
+ import { Client, TablesDB, Permission, Role } from "react-native-appwrite";
2
2
 
3
3
  const client = new Client()
4
4
  .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
@@ -9,7 +9,8 @@ const teams = new Teams(client);
9
9
  const result = await teams.listMemberships({
10
10
  teamId: '<TEAM_ID>',
11
11
  queries: [], // optional
12
- search: '<SEARCH>' // optional
12
+ search: '<SEARCH>', // optional
13
+ total: false // optional
13
14
  });
14
15
 
15
16
  console.log(result);
@@ -8,7 +8,8 @@ const teams = new Teams(client);
8
8
 
9
9
  const result = await teams.list({
10
10
  queries: [], // optional
11
- search: '<SEARCH>' // optional
11
+ search: '<SEARCH>', // optional
12
+ total: false // optional
12
13
  });
13
14
 
14
15
  console.log(result);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "react-native-appwrite",
3
3
  "homepage": "https://appwrite.io/support",
4
4
  "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.17.1",
5
+ "version": "0.19.0",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "devDependencies": {
28
28
  "@rollup/plugin-typescript": "8.3.2",
29
- "playwright": "1.15.0",
29
+ "playwright": "1.56.1",
30
30
  "rollup": "2.75.4",
31
31
  "serve-handler": "6.1.0",
32
32
  "tslib": "2.4.0",
@@ -37,7 +37,6 @@
37
37
  "react-native": ">=0.76.7 <1.0.0"
38
38
  },
39
39
  "peerDependencies": {
40
- "expo": "*",
41
- "react-native": "*"
40
+ "expo": "*"
42
41
  }
43
42
  }
package/src/client.ts CHANGED
@@ -115,7 +115,7 @@ class Client {
115
115
  'x-sdk-name': 'React Native',
116
116
  'x-sdk-platform': 'client',
117
117
  'x-sdk-language': 'reactnative',
118
- 'x-sdk-version': '0.17.1',
118
+ 'x-sdk-version': '0.19.0',
119
119
  'X-Appwrite-Response-Format': '1.8.0',
120
120
  };
121
121
 
@@ -3,4 +3,5 @@ export enum ExecutionStatus {
3
3
  Processing = 'processing',
4
4
  Completed = 'completed',
5
5
  Failed = 'failed',
6
+ Scheduled = 'scheduled',
6
7
  }
@@ -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
+ }
@@ -0,0 +1,4 @@
1
+ export enum Theme {
2
+ Light = 'light',
3
+ Dark = 'dark',
4
+ }