react-native-appwrite 0.21.0 → 0.23.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,10 @@
1
1
  # Change log
2
2
 
3
+ ## 0.23.1
4
+
5
+ * Add `upsert` method to Realtime `Channels` helper class
6
+ * Fix `bignumber.js` bundler conflict by removing direct dependency in favor of transitive dependency from `json-bigint`
7
+
3
8
  ## 0.21.0
4
9
 
5
10
  * 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.21.0',
137
+ 'x-sdk-version': '0.23.1',
132
138
  'X-Appwrite-Response-Format': '1.8.0',
133
139
  };
134
140
  this.realtime = {
@@ -5399,6 +5405,9 @@ class Channel {
5399
5405
  create() {
5400
5406
  return this.resolve("create");
5401
5407
  }
5408
+ upsert() {
5409
+ return this.resolve("upsert");
5410
+ }
5402
5411
  update() {
5403
5412
  return this.resolve("update");
5404
5413
  }
@@ -5431,18 +5440,24 @@ class Channel {
5431
5440
  return "account";
5432
5441
  }
5433
5442
  // Global events
5434
- static get documents() {
5443
+ static documents() {
5435
5444
  return "documents";
5436
5445
  }
5437
- static get rows() {
5446
+ static rows() {
5438
5447
  return "rows";
5439
5448
  }
5440
- static get files() {
5449
+ static files() {
5441
5450
  return "files";
5442
5451
  }
5443
- static get executions() {
5452
+ static executions() {
5444
5453
  return "executions";
5445
5454
  }
5455
+ static teams() {
5456
+ return "teams";
5457
+ }
5458
+ static memberships() {
5459
+ return "memberships";
5460
+ }
5446
5461
  }
5447
5462
 
5448
5463
  exports.Condition = void 0;
@@ -5764,8 +5779,6 @@ exports.OAuthProvider = void 0;
5764
5779
  OAuthProvider["Yandex"] = "yandex";
5765
5780
  OAuthProvider["Zoho"] = "zoho";
5766
5781
  OAuthProvider["Zoom"] = "zoom";
5767
- OAuthProvider["GithubImagine"] = "githubImagine";
5768
- OAuthProvider["GoogleImagine"] = "googleImagine";
5769
5782
  })(exports.OAuthProvider || (exports.OAuthProvider = {}));
5770
5783
 
5771
5784
  exports.Browser = void 0;