react-native-appwrite 0.7.0 → 0.7.2

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.
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.7.0",
5
+ "version": "0.7.2",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
@@ -30,11 +30,11 @@
30
30
  "rollup": "2.75.4",
31
31
  "serve-handler": "6.1.0",
32
32
  "tslib": "2.4.0",
33
- "typescript": "4.7.2"
33
+ "typescript": "^5.3.3"
34
34
  },
35
35
  "dependencies": {
36
- "expo-file-system": "16.0.8",
37
- "react-native": "^0.73.6"
36
+ "expo-file-system": "~18.0.11",
37
+ "react-native": "0.76.7"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "expo": "*",
package/src/client.ts CHANGED
@@ -114,7 +114,7 @@ class Client {
114
114
  'x-sdk-name': 'React Native',
115
115
  'x-sdk-platform': 'client',
116
116
  'x-sdk-language': 'reactnative',
117
- 'x-sdk-version': '0.7.0',
117
+ 'x-sdk-version': '0.7.2',
118
118
  'X-Appwrite-Response-Format': '1.6.0',
119
119
  };
120
120
 
@@ -452,6 +452,7 @@ class Client {
452
452
 
453
453
  try {
454
454
  let data = null;
455
+
455
456
  const response = await fetch(url.toString(), options);
456
457
 
457
458
  const warnings = response.headers.get('x-appwrite-warning');
@@ -468,7 +469,13 @@ class Client {
468
469
  }
469
470
 
470
471
  if (400 <= response.status) {
471
- throw new AppwriteException(data?.message, response.status, data?.type, data);
472
+ let responseText = '';
473
+ if (response.headers.get('content-type')?.includes('application/json')) {
474
+ responseText = JSON.stringify(data);
475
+ } else {
476
+ responseText = data?.message;
477
+ }
478
+ throw new AppwriteException(data?.message, response.status, data?.type, responseText);
472
479
  }
473
480
 
474
481
  const cookieFallback = response.headers.get('X-Fallback-Cookies');
@@ -15,4 +15,5 @@ export enum CreditCard {
15
15
  Visa = 'visa',
16
16
  MIR = 'mir',
17
17
  Maestro = 'maestro',
18
+ Rupay = 'rupay',
18
19
  }