react-native-appwrite 0.23.0 → 0.24.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.
- package/CHANGELOG.md +9 -0
- package/README.md +1 -1
- package/dist/cjs/sdk.js +35 -6
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +35 -5
- package/dist/esm/sdk.js.map +1 -1
- package/package.json +2 -3
- package/src/channel.ts +4 -0
- package/src/client.ts +11 -3
- package/src/enums/o-auth-provider.ts +0 -2
- package/src/query.ts +26 -0
- package/src/services/account.ts +4 -4
- package/types/channel.d.ts +1 -0
- package/types/enums/o-auth-provider.d.ts +1 -3
- package/types/query.d.ts +22 -0
- package/types/services/account.d.ts +4 -4
package/dist/esm/sdk.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Platform } from 'react-native';
|
|
2
2
|
import JSONbigModule from 'json-bigint';
|
|
3
|
-
import BigNumber from 'bignumber.js';
|
|
4
3
|
import * as FileSystem from 'expo-file-system';
|
|
5
4
|
|
|
6
5
|
/******************************************************************************
|
|
@@ -58,8 +57,16 @@ const JSONbigParser = JSONbigModule({ storeAsString: false });
|
|
|
58
57
|
const JSONbigSerializer = JSONbigModule({ useNativeBigInt: true });
|
|
59
58
|
const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
|
|
60
59
|
const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
|
|
60
|
+
function isBigNumber(value) {
|
|
61
|
+
return value !== null
|
|
62
|
+
&& typeof value === 'object'
|
|
63
|
+
&& value._isBigNumber === true
|
|
64
|
+
&& typeof value.isInteger === 'function'
|
|
65
|
+
&& typeof value.toFixed === 'function'
|
|
66
|
+
&& typeof value.toNumber === 'function';
|
|
67
|
+
}
|
|
61
68
|
function reviver(_key, value) {
|
|
62
|
-
if (
|
|
69
|
+
if (isBigNumber(value)) {
|
|
63
70
|
if (value.isInteger()) {
|
|
64
71
|
const str = value.toFixed();
|
|
65
72
|
const bi = BigInt(str);
|
|
@@ -102,7 +109,7 @@ class Client {
|
|
|
102
109
|
'x-sdk-name': 'React Native',
|
|
103
110
|
'x-sdk-platform': 'client',
|
|
104
111
|
'x-sdk-language': 'reactnative',
|
|
105
|
-
'x-sdk-version': '0.
|
|
112
|
+
'x-sdk-version': '0.24.0',
|
|
106
113
|
'X-Appwrite-Response-Format': '1.8.0',
|
|
107
114
|
};
|
|
108
115
|
this.realtime = {
|
|
@@ -4987,12 +4994,34 @@ Query.limit = (limit) => new Query("limit", undefined, limit).toString();
|
|
|
4987
4994
|
Query.offset = (offset) => new Query("offset", undefined, offset).toString();
|
|
4988
4995
|
/**
|
|
4989
4996
|
* Filter resources where attribute contains the specified value.
|
|
4997
|
+
* For string attributes, checks if the string contains the substring.
|
|
4990
4998
|
*
|
|
4999
|
+
* Note: For array attributes, use {@link containsAny} or {@link containsAll} instead.
|
|
4991
5000
|
* @param {string} attribute
|
|
4992
5001
|
* @param {string | string[]} value
|
|
4993
5002
|
* @returns {string}
|
|
4994
5003
|
*/
|
|
4995
5004
|
Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
|
|
5005
|
+
/**
|
|
5006
|
+
* Filter resources where attribute contains ANY of the specified values.
|
|
5007
|
+
* For array and relationship attributes, matches documents where the attribute
|
|
5008
|
+
* contains at least one of the given values.
|
|
5009
|
+
*
|
|
5010
|
+
* @param {string} attribute
|
|
5011
|
+
* @param {any[]} value
|
|
5012
|
+
* @returns {string}
|
|
5013
|
+
*/
|
|
5014
|
+
Query.containsAny = (attribute, value) => new Query("containsAny", attribute, value).toString();
|
|
5015
|
+
/**
|
|
5016
|
+
* Filter resources where attribute contains ALL of the specified values.
|
|
5017
|
+
* For array and relationship attributes, matches documents where the attribute
|
|
5018
|
+
* contains every one of the given values.
|
|
5019
|
+
*
|
|
5020
|
+
* @param {string} attribute
|
|
5021
|
+
* @param {any[]} value
|
|
5022
|
+
* @returns {string}
|
|
5023
|
+
*/
|
|
5024
|
+
Query.containsAll = (attribute, value) => new Query("containsAll", attribute, value).toString();
|
|
4996
5025
|
/**
|
|
4997
5026
|
* Filter resources where attribute does not contain the specified value.
|
|
4998
5027
|
*
|
|
@@ -5373,6 +5402,9 @@ class Channel {
|
|
|
5373
5402
|
create() {
|
|
5374
5403
|
return this.resolve("create");
|
|
5375
5404
|
}
|
|
5405
|
+
upsert() {
|
|
5406
|
+
return this.resolve("upsert");
|
|
5407
|
+
}
|
|
5376
5408
|
update() {
|
|
5377
5409
|
return this.resolve("update");
|
|
5378
5410
|
}
|
|
@@ -5744,8 +5776,6 @@ var OAuthProvider;
|
|
|
5744
5776
|
OAuthProvider["Yandex"] = "yandex";
|
|
5745
5777
|
OAuthProvider["Zoho"] = "zoho";
|
|
5746
5778
|
OAuthProvider["Zoom"] = "zoom";
|
|
5747
|
-
OAuthProvider["GithubImagine"] = "githubImagine";
|
|
5748
|
-
OAuthProvider["GoogleImagine"] = "googleImagine";
|
|
5749
5779
|
})(OAuthProvider || (OAuthProvider = {}));
|
|
5750
5780
|
|
|
5751
5781
|
var Browser;
|