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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # Change log
2
2
 
3
+ ## 0.24.1
4
+
5
+ * Fix very large double values (for example 1.7976931348623157e+308) from being expanded into giant integer literals.
6
+
7
+ ## 0.24.0
8
+
9
+ * Added Query.contains, Query.containsAny, and Query.containsAll for enhanced filtering capabilities.
10
+
3
11
  ## 0.23.1
4
12
 
5
13
  * Add `upsert` method to Realtime `Channels` helper class
package/dist/cjs/sdk.js CHANGED
@@ -82,6 +82,8 @@ const JSONbigParser = JSONbigModule__default["default"]({ storeAsString: false }
82
82
  const JSONbigSerializer = JSONbigModule__default["default"]({ useNativeBigInt: true });
83
83
  const MAX_SAFE = BigInt(Number.MAX_SAFE_INTEGER);
84
84
  const MIN_SAFE = BigInt(Number.MIN_SAFE_INTEGER);
85
+ const MAX_INT64 = BigInt('9223372036854775807');
86
+ const MIN_INT64 = BigInt('-9223372036854775808');
85
87
  function isBigNumber(value) {
86
88
  return value !== null
87
89
  && typeof value === 'object'
@@ -98,7 +100,10 @@ function reviver(_key, value) {
98
100
  if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
99
101
  return Number(str);
100
102
  }
101
- return bi;
103
+ if (bi >= MIN_INT64 && bi <= MAX_INT64) {
104
+ return bi;
105
+ }
106
+ return value.toNumber();
102
107
  }
103
108
  return value.toNumber();
104
109
  }
@@ -134,7 +139,7 @@ class Client {
134
139
  'x-sdk-name': 'React Native',
135
140
  'x-sdk-platform': 'client',
136
141
  'x-sdk-language': 'reactnative',
137
- 'x-sdk-version': '0.23.1',
142
+ 'x-sdk-version': '0.24.1',
138
143
  'X-Appwrite-Response-Format': '1.8.0',
139
144
  };
140
145
  this.realtime = {
@@ -5019,12 +5024,34 @@ Query.limit = (limit) => new Query("limit", undefined, limit).toString();
5019
5024
  Query.offset = (offset) => new Query("offset", undefined, offset).toString();
5020
5025
  /**
5021
5026
  * Filter resources where attribute contains the specified value.
5027
+ * For string attributes, checks if the string contains the substring.
5022
5028
  *
5029
+ * Note: For array attributes, use {@link containsAny} or {@link containsAll} instead.
5023
5030
  * @param {string} attribute
5024
5031
  * @param {string | string[]} value
5025
5032
  * @returns {string}
5026
5033
  */
5027
5034
  Query.contains = (attribute, value) => new Query("contains", attribute, value).toString();
5035
+ /**
5036
+ * Filter resources where attribute contains ANY of the specified values.
5037
+ * For array and relationship attributes, matches documents where the attribute
5038
+ * contains at least one of the given values.
5039
+ *
5040
+ * @param {string} attribute
5041
+ * @param {any[]} value
5042
+ * @returns {string}
5043
+ */
5044
+ Query.containsAny = (attribute, value) => new Query("containsAny", attribute, value).toString();
5045
+ /**
5046
+ * Filter resources where attribute contains ALL of the specified values.
5047
+ * For array and relationship attributes, matches documents where the attribute
5048
+ * contains every one of the given values.
5049
+ *
5050
+ * @param {string} attribute
5051
+ * @param {any[]} value
5052
+ * @returns {string}
5053
+ */
5054
+ Query.containsAll = (attribute, value) => new Query("containsAll", attribute, value).toString();
5028
5055
  /**
5029
5056
  * Filter resources where attribute does not contain the specified value.
5030
5057
  *