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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # Change log
2
2
 
3
+ ## 0.24.0
4
+
5
+ * Added Query.contains, Query.containsAny, and Query.containsAll for enhanced filtering capabilities.
6
+
7
+ ## 0.23.1
8
+
9
+ * Add `upsert` method to Realtime `Channels` helper class
10
+ * Fix `bignumber.js` bundler conflict by removing direct dependency in favor of transitive dependency from `json-bigint`
11
+
3
12
  ## 0.21.0
4
13
 
5
14
  * Add `queries` parameter to `client.subscribe()` for filtering Realtime events
package/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
  [![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
7
7
  [![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
8
8
 
9
- **This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-react-native/releases).**
9
+ **This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-react-native/releases).**
10
10
 
11
11
  Appwrite is an open-source backend as a service server that abstracts and simplifies complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the React Native SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
12
12
 
package/dist/cjs/sdk.js CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  var reactNative = require('react-native');
4
4
  var JSONbigModule = require('json-bigint');
5
- var BigNumber = require('bignumber.js');
6
5
  var FileSystem = require('expo-file-system');
7
6
 
8
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -26,7 +25,6 @@ function _interopNamespace(e) {
26
25
  }
27
26
 
28
27
  var JSONbigModule__default = /*#__PURE__*/_interopDefaultLegacy(JSONbigModule);
29
- var BigNumber__default = /*#__PURE__*/_interopDefaultLegacy(BigNumber);
30
28
  var FileSystem__namespace = /*#__PURE__*/_interopNamespace(FileSystem);
31
29
 
32
30
  /******************************************************************************
@@ -84,8 +82,16 @@ const JSONbigParser = JSONbigModule__default["default"]({ storeAsString: false }
84
82
  const JSONbigSerializer = JSONbigModule__default["default"]({ useNativeBigInt: true });
85
83
  const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
86
84
  const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
85
+ function isBigNumber(value) {
86
+ return value !== null
87
+ && typeof value === 'object'
88
+ && value._isBigNumber === true
89
+ && typeof value.isInteger === 'function'
90
+ && typeof value.toFixed === 'function'
91
+ && typeof value.toNumber === 'function';
92
+ }
87
93
  function reviver(_key, value) {
88
- if (BigNumber__default["default"].isBigNumber(value)) {
94
+ if (isBigNumber(value)) {
89
95
  if (value.isInteger()) {
90
96
  const str = value.toFixed();
91
97
  const bi = BigInt(str);
@@ -128,7 +134,7 @@ class Client {
128
134
  'x-sdk-name': 'React Native',
129
135
  'x-sdk-platform': 'client',
130
136
  'x-sdk-language': 'reactnative',
131
- 'x-sdk-version': '0.23.0',
137
+ 'x-sdk-version': '0.24.0',
132
138
  'X-Appwrite-Response-Format': '1.8.0',
133
139
  };
134
140
  this.realtime = {
@@ -5013,12 +5019,34 @@ Query.limit = (limit) => new Query("limit", undefined, limit).toString();
5013
5019
  Query.offset = (offset) => new Query("offset", undefined, offset).toString();
5014
5020
  /**
5015
5021
  * Filter resources where attribute contains the specified value.
5022
+ * For string attributes, checks if the string contains the substring.
5016
5023
  *
5024
+ * Note: For array attributes, use {@link containsAny} or {@link containsAll} instead.
5017
5025
  * @param {string} attribute
5018
5026
  * @param {string | string[]} value
5019
5027
  * @returns {string}
5020
5028
  */
5021
5029
  Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
5030
+ /**
5031
+ * Filter resources where attribute contains ANY of the specified values.
5032
+ * For array and relationship attributes, matches documents where the attribute
5033
+ * contains at least one of the given values.
5034
+ *
5035
+ * @param {string} attribute
5036
+ * @param {any[]} value
5037
+ * @returns {string}
5038
+ */
5039
+ Query.containsAny = (attribute, value) => new Query("containsAny", attribute, value).toString();
5040
+ /**
5041
+ * Filter resources where attribute contains ALL of the specified values.
5042
+ * For array and relationship attributes, matches documents where the attribute
5043
+ * contains every one of the given values.
5044
+ *
5045
+ * @param {string} attribute
5046
+ * @param {any[]} value
5047
+ * @returns {string}
5048
+ */
5049
+ Query.containsAll = (attribute, value) => new Query("containsAll", attribute, value).toString();
5022
5050
  /**
5023
5051
  * Filter resources where attribute does not contain the specified value.
5024
5052
  *
@@ -5399,6 +5427,9 @@ class Channel {
5399
5427
  create() {
5400
5428
  return this.resolve("create");
5401
5429
  }
5430
+ upsert() {
5431
+ return this.resolve("upsert");
5432
+ }
5402
5433
  update() {
5403
5434
  return this.resolve("update");
5404
5435
  }
@@ -5770,8 +5801,6 @@ exports.OAuthProvider = void 0;
5770
5801
  OAuthProvider["Yandex"] = "yandex";
5771
5802
  OAuthProvider["Zoho"] = "zoho";
5772
5803
  OAuthProvider["Zoom"] = "zoom";
5773
- OAuthProvider["GithubImagine"] = "githubImagine";
5774
- OAuthProvider["GoogleImagine"] = "googleImagine";
5775
5804
  })(exports.OAuthProvider || (exports.OAuthProvider = {}));
5776
5805
 
5777
5806
  exports.Browser = void 0;