react-native-appwrite 0.7.1 → 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/dist/cjs/sdk.js +18 -10
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +18 -10
- package/dist/esm/sdk.js.map +1 -1
- package/package.json +4 -4
- package/src/client.ts +10 -4
- package/src/enums/credit-card.ts +1 -0
- package/src/services/databases.ts +1 -0
- package/types/client.d.ts +4 -4
- package/types/enums/credit-card.d.ts +2 -1
- package/types/query.d.ts +4 -4
- package/types/services/databases.d.ts +1 -0
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.
|
|
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": "
|
|
33
|
+
"typescript": "^5.3.3"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"expo-file-system": "
|
|
37
|
-
"react-native": "
|
|
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.
|
|
117
|
+
'x-sdk-version': '0.7.2',
|
|
118
118
|
'X-Appwrite-Response-Format': '1.6.0',
|
|
119
119
|
};
|
|
120
120
|
|
|
@@ -452,8 +452,8 @@ class Client {
|
|
|
452
452
|
|
|
453
453
|
try {
|
|
454
454
|
let data = null;
|
|
455
|
+
|
|
455
456
|
const response = await fetch(url.toString(), options);
|
|
456
|
-
const text = await response.text()
|
|
457
457
|
|
|
458
458
|
const warnings = response.headers.get('x-appwrite-warning');
|
|
459
459
|
if (warnings) {
|
|
@@ -464,12 +464,18 @@ class Client {
|
|
|
464
464
|
data = await response.json();
|
|
465
465
|
} else {
|
|
466
466
|
data = {
|
|
467
|
-
message: text
|
|
467
|
+
message: await response.text()
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
470
|
|
|
471
471
|
if (400 <= response.status) {
|
|
472
|
-
|
|
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);
|
|
473
479
|
}
|
|
474
480
|
|
|
475
481
|
const cookieFallback = response.headers.get('X-Fallback-Cookies');
|
package/src/enums/credit-card.ts
CHANGED
|
@@ -50,6 +50,7 @@ export class Databases extends Service {
|
|
|
50
50
|
* collection resource using either a [server
|
|
51
51
|
* integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
|
52
52
|
* API or directly from your database console.
|
|
53
|
+
*
|
|
53
54
|
*
|
|
54
55
|
* @param {string} databaseId
|
|
55
56
|
* @param {string} collectionId
|
package/types/client.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Models } from './models';
|
|
2
|
-
|
|
2
|
+
type Payload = {
|
|
3
3
|
[key: string]: any;
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
type Headers = {
|
|
6
6
|
[key: string]: string;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type RealtimeResponseEvent<T extends unknown> = {
|
|
9
9
|
events: string[];
|
|
10
10
|
channels: string[];
|
|
11
11
|
timestamp: number;
|
|
12
12
|
payload: T;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type UploadProgress = {
|
|
15
15
|
$id: string;
|
|
16
16
|
progress: number;
|
|
17
17
|
sizeUploaded: number;
|
package/types/query.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
|
|
1
|
+
type QueryTypesSingle = string | number | boolean;
|
|
2
|
+
export type QueryTypesList = string[] | number[] | boolean[] | Query[];
|
|
3
|
+
export type QueryTypes = QueryTypesSingle | QueryTypesList;
|
|
4
|
+
type AttributesTypes = string | string[];
|
|
5
5
|
export declare class Query {
|
|
6
6
|
method: string;
|
|
7
7
|
attribute: AttributesTypes | undefined;
|
|
@@ -20,6 +20,7 @@ export declare class Databases extends Service {
|
|
|
20
20
|
* integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
|
21
21
|
* API or directly from your database console.
|
|
22
22
|
*
|
|
23
|
+
*
|
|
23
24
|
* @param {string} databaseId
|
|
24
25
|
* @param {string} collectionId
|
|
25
26
|
* @param {string} documentId
|