react-native-appwrite 0.23.1 → 0.24.1
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/CHANGELOG.md +8 -0
- package/dist/cjs/sdk.js +29 -2
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +29 -2
- package/dist/esm/sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +7 -2
- package/src/query.ts +26 -0
- package/types/query.d.ts +22 -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 abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.24.1",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "dist/cjs/sdk.js",
|
|
8
8
|
"exports": {
|
package/src/client.ts
CHANGED
|
@@ -8,6 +8,8 @@ const JSONbigSerializer = JSONbigModule({ useNativeBigInt: true });
|
|
|
8
8
|
|
|
9
9
|
const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
|
|
10
10
|
const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
|
|
11
|
+
const MAX_INT64 = BigInt('9223372036854775807');
|
|
12
|
+
const MIN_INT64 = BigInt('-9223372036854775808');
|
|
11
13
|
|
|
12
14
|
function isBigNumber(value: any): boolean {
|
|
13
15
|
return value !== null
|
|
@@ -26,7 +28,10 @@ function reviver(_key: string, value: any): any {
|
|
|
26
28
|
if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
|
|
27
29
|
return Number(str);
|
|
28
30
|
}
|
|
29
|
-
|
|
31
|
+
if (bi >= MIN_INT64 && bi <= MAX_INT64) {
|
|
32
|
+
return bi;
|
|
33
|
+
}
|
|
34
|
+
return value.toNumber();
|
|
30
35
|
}
|
|
31
36
|
return value.toNumber();
|
|
32
37
|
}
|
|
@@ -153,7 +158,7 @@ class Client {
|
|
|
153
158
|
'x-sdk-name': 'React Native',
|
|
154
159
|
'x-sdk-platform': 'client',
|
|
155
160
|
'x-sdk-language': 'reactnative',
|
|
156
|
-
'x-sdk-version': '0.
|
|
161
|
+
'x-sdk-version': '0.24.1',
|
|
157
162
|
'X-Appwrite-Response-Format': '1.8.0',
|
|
158
163
|
};
|
|
159
164
|
|
package/src/query.ts
CHANGED
|
@@ -126,7 +126,9 @@ export class Query {
|
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
128
|
* Filter resources where attribute contains the specified value.
|
|
129
|
+
* For string attributes, checks if the string contains the substring.
|
|
129
130
|
*
|
|
131
|
+
* Note: For array attributes, use {@link containsAny} or {@link containsAll} instead.
|
|
130
132
|
* @param {string} attribute
|
|
131
133
|
* @param {string | string[]} value
|
|
132
134
|
* @returns {string}
|
|
@@ -134,6 +136,30 @@ export class Query {
|
|
|
134
136
|
static contains = (attribute: string, value: string | any[]): string =>
|
|
135
137
|
new Query("contains", attribute, value).toString();
|
|
136
138
|
|
|
139
|
+
/**
|
|
140
|
+
* Filter resources where attribute contains ANY of the specified values.
|
|
141
|
+
* For array and relationship attributes, matches documents where the attribute
|
|
142
|
+
* contains at least one of the given values.
|
|
143
|
+
*
|
|
144
|
+
* @param {string} attribute
|
|
145
|
+
* @param {any[]} value
|
|
146
|
+
* @returns {string}
|
|
147
|
+
*/
|
|
148
|
+
static containsAny = (attribute: string, value: any[]): string =>
|
|
149
|
+
new Query("containsAny", attribute, value).toString();
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Filter resources where attribute contains ALL of the specified values.
|
|
153
|
+
* For array and relationship attributes, matches documents where the attribute
|
|
154
|
+
* contains every one of the given values.
|
|
155
|
+
*
|
|
156
|
+
* @param {string} attribute
|
|
157
|
+
* @param {any[]} value
|
|
158
|
+
* @returns {string}
|
|
159
|
+
*/
|
|
160
|
+
static containsAll = (attribute: string, value: any[]): string =>
|
|
161
|
+
new Query("containsAll", attribute, value).toString();
|
|
162
|
+
|
|
137
163
|
/**
|
|
138
164
|
* Filter resources where attribute does not contain the specified value.
|
|
139
165
|
*
|
package/types/query.d.ts
CHANGED
|
@@ -52,12 +52,34 @@ export declare class Query {
|
|
|
52
52
|
static offset: (offset: number) => string;
|
|
53
53
|
/**
|
|
54
54
|
* Filter resources where attribute contains the specified value.
|
|
55
|
+
* For string attributes, checks if the string contains the substring.
|
|
55
56
|
*
|
|
57
|
+
* Note: For array attributes, use {@link containsAny} or {@link containsAll} instead.
|
|
56
58
|
* @param {string} attribute
|
|
57
59
|
* @param {string | string[]} value
|
|
58
60
|
* @returns {string}
|
|
59
61
|
*/
|
|
60
62
|
static contains: (attribute: string, value: string | any[]) => string;
|
|
63
|
+
/**
|
|
64
|
+
* Filter resources where attribute contains ANY of the specified values.
|
|
65
|
+
* For array and relationship attributes, matches documents where the attribute
|
|
66
|
+
* contains at least one of the given values.
|
|
67
|
+
*
|
|
68
|
+
* @param {string} attribute
|
|
69
|
+
* @param {any[]} value
|
|
70
|
+
* @returns {string}
|
|
71
|
+
*/
|
|
72
|
+
static containsAny: (attribute: string, value: any[]) => string;
|
|
73
|
+
/**
|
|
74
|
+
* Filter resources where attribute contains ALL of the specified values.
|
|
75
|
+
* For array and relationship attributes, matches documents where the attribute
|
|
76
|
+
* contains every one of the given values.
|
|
77
|
+
*
|
|
78
|
+
* @param {string} attribute
|
|
79
|
+
* @param {any[]} value
|
|
80
|
+
* @returns {string}
|
|
81
|
+
*/
|
|
82
|
+
static containsAll: (attribute: string, value: any[]) => string;
|
|
61
83
|
/**
|
|
62
84
|
* Filter resources where attribute does not contain the specified value.
|
|
63
85
|
*
|