react-native-appwrite 0.7.3 → 0.9.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.
Files changed (113) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/README.md +2 -2
  3. package/dist/cjs/sdk.js +18 -12
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +18 -12
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/docs/examples/account/create-anonymous-session.md +1 -1
  8. package/docs/examples/account/create-email-password-session.md +1 -1
  9. package/docs/examples/account/create-email-token.md +1 -1
  10. package/docs/examples/account/create-j-w-t.md +1 -1
  11. package/docs/examples/account/create-magic-u-r-l-token.md +1 -1
  12. package/docs/examples/account/create-mfa-authenticator.md +1 -1
  13. package/docs/examples/account/create-mfa-challenge.md +1 -1
  14. package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
  15. package/docs/examples/account/create-o-auth2session.md +1 -1
  16. package/docs/examples/account/create-o-auth2token.md +1 -1
  17. package/docs/examples/account/create-phone-token.md +1 -1
  18. package/docs/examples/account/create-phone-verification.md +1 -1
  19. package/docs/examples/account/create-push-target.md +1 -1
  20. package/docs/examples/account/create-recovery.md +1 -1
  21. package/docs/examples/account/create-session.md +1 -1
  22. package/docs/examples/account/create-verification.md +1 -1
  23. package/docs/examples/account/create.md +1 -1
  24. package/docs/examples/account/delete-identity.md +1 -1
  25. package/docs/examples/account/delete-mfa-authenticator.md +1 -1
  26. package/docs/examples/account/delete-push-target.md +1 -1
  27. package/docs/examples/account/delete-session.md +1 -1
  28. package/docs/examples/account/delete-sessions.md +1 -1
  29. package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
  30. package/docs/examples/account/get-prefs.md +1 -1
  31. package/docs/examples/account/get-session.md +1 -1
  32. package/docs/examples/account/get.md +1 -1
  33. package/docs/examples/account/list-identities.md +1 -1
  34. package/docs/examples/account/list-logs.md +1 -1
  35. package/docs/examples/account/list-mfa-factors.md +1 -1
  36. package/docs/examples/account/list-sessions.md +1 -1
  37. package/docs/examples/account/update-email.md +1 -1
  38. package/docs/examples/account/update-m-f-a.md +1 -1
  39. package/docs/examples/account/update-magic-u-r-l-session.md +1 -1
  40. package/docs/examples/account/update-mfa-authenticator.md +1 -1
  41. package/docs/examples/account/update-mfa-challenge.md +1 -1
  42. package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
  43. package/docs/examples/account/update-name.md +1 -1
  44. package/docs/examples/account/update-password.md +1 -1
  45. package/docs/examples/account/update-phone-session.md +1 -1
  46. package/docs/examples/account/update-phone-verification.md +1 -1
  47. package/docs/examples/account/update-phone.md +1 -1
  48. package/docs/examples/account/update-prefs.md +1 -1
  49. package/docs/examples/account/update-push-target.md +1 -1
  50. package/docs/examples/account/update-recovery.md +1 -1
  51. package/docs/examples/account/update-session.md +1 -1
  52. package/docs/examples/account/update-status.md +1 -1
  53. package/docs/examples/account/update-verification.md +1 -1
  54. package/docs/examples/avatars/get-browser.md +2 -2
  55. package/docs/examples/avatars/get-credit-card.md +2 -2
  56. package/docs/examples/avatars/get-favicon.md +1 -1
  57. package/docs/examples/avatars/get-flag.md +2 -2
  58. package/docs/examples/avatars/get-image.md +1 -1
  59. package/docs/examples/avatars/get-initials.md +1 -1
  60. package/docs/examples/avatars/get-q-r.md +1 -1
  61. package/docs/examples/databases/create-document.md +4 -2
  62. package/docs/examples/databases/delete-document.md +1 -1
  63. package/docs/examples/databases/get-document.md +1 -1
  64. package/docs/examples/databases/list-documents.md +1 -1
  65. package/docs/examples/databases/update-document.md +1 -1
  66. package/docs/examples/functions/create-execution.md +1 -1
  67. package/docs/examples/functions/get-execution.md +1 -1
  68. package/docs/examples/functions/list-executions.md +2 -3
  69. package/docs/examples/graphql/mutation.md +1 -1
  70. package/docs/examples/graphql/query.md +1 -1
  71. package/docs/examples/locale/get.md +1 -1
  72. package/docs/examples/locale/list-codes.md +1 -1
  73. package/docs/examples/locale/list-continents.md +1 -1
  74. package/docs/examples/locale/list-countries-e-u.md +1 -1
  75. package/docs/examples/locale/list-countries-phones.md +1 -1
  76. package/docs/examples/locale/list-countries.md +1 -1
  77. package/docs/examples/locale/list-currencies.md +1 -1
  78. package/docs/examples/locale/list-languages.md +1 -1
  79. package/docs/examples/messaging/create-subscriber.md +1 -1
  80. package/docs/examples/messaging/delete-subscriber.md +1 -1
  81. package/docs/examples/storage/create-file.md +1 -1
  82. package/docs/examples/storage/delete-file.md +1 -1
  83. package/docs/examples/storage/get-file-download.md +3 -2
  84. package/docs/examples/storage/get-file-preview.md +4 -3
  85. package/docs/examples/storage/get-file-view.md +3 -2
  86. package/docs/examples/storage/get-file.md +1 -1
  87. package/docs/examples/storage/list-files.md +1 -1
  88. package/docs/examples/storage/update-file.md +1 -1
  89. package/docs/examples/teams/create-membership.md +1 -1
  90. package/docs/examples/teams/create.md +1 -1
  91. package/docs/examples/teams/delete-membership.md +1 -1
  92. package/docs/examples/teams/delete.md +1 -1
  93. package/docs/examples/teams/get-membership.md +1 -1
  94. package/docs/examples/teams/get-prefs.md +1 -1
  95. package/docs/examples/teams/get.md +1 -1
  96. package/docs/examples/teams/list-memberships.md +1 -1
  97. package/docs/examples/teams/list.md +1 -1
  98. package/docs/examples/teams/update-membership-status.md +1 -1
  99. package/docs/examples/teams/update-membership.md +1 -1
  100. package/docs/examples/teams/update-name.md +1 -1
  101. package/docs/examples/teams/update-prefs.md +1 -1
  102. package/package.json +3 -3
  103. package/src/client.ts +2 -2
  104. package/src/enums/image-format.ts +0 -1
  105. package/src/models.ts +1 -1
  106. package/src/services/databases.ts +0 -1
  107. package/src/services/functions.ts +1 -6
  108. package/src/services/storage.ts +18 -3
  109. package/types/enums/image-format.d.ts +0 -1
  110. package/types/models.d.ts +1 -1
  111. package/types/services/databases.d.ts +0 -1
  112. package/types/services/functions.d.ts +1 -2
  113. package/types/services/storage.d.ts +6 -3
package/CHANGELOG.md CHANGED
@@ -1 +1,6 @@
1
- # Change log
1
+ # Change log
2
+
3
+ ## 0.7.4
4
+
5
+ * Upgrade dependencies to resolve PlatformConstants error with Expo 53
6
+ * Update doc examples to use new multi-region endpoint
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # Appwrite React Native SDK
2
2
 
3
3
  ![License](https://img.shields.io/github/license/appwrite/sdk-for-react-native.svg?style=flat-square)
4
- ![Version](https://img.shields.io/badge/api%20version-1.6.2-blue.svg?style=flat-square)
4
+ ![Version](https://img.shields.io/badge/api%20version-1.7.0-blue.svg?style=flat-square)
5
5
  [![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
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 1.6.x. 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.7.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 abstract and simplify 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
@@ -99,8 +99,8 @@ class Client {
99
99
  'x-sdk-name': 'React Native',
100
100
  'x-sdk-platform': 'client',
101
101
  'x-sdk-language': 'reactnative',
102
- 'x-sdk-version': '0.7.3',
103
- 'X-Appwrite-Response-Format': '1.6.0',
102
+ 'x-sdk-version': '0.9.0',
103
+ 'X-Appwrite-Response-Format': '1.7.0',
104
104
  };
105
105
  this.realtime = {
106
106
  socket: undefined,
@@ -2003,7 +2003,6 @@ class Databases extends Service {
2003
2003
  * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
2004
2004
  * API or directly from your database console.
2005
2005
  *
2006
- *
2007
2006
  * @param {string} databaseId
2008
2007
  * @param {string} collectionId
2009
2008
  * @param {string} documentId
@@ -2143,11 +2142,10 @@ class Functions extends Service {
2143
2142
  *
2144
2143
  * @param {string} functionId
2145
2144
  * @param {string[]} queries
2146
- * @param {string} search
2147
2145
  * @throws {AppwriteException}
2148
2146
  * @returns {Promise}
2149
2147
  */
2150
- listExecutions(functionId, queries, search) {
2148
+ listExecutions(functionId, queries) {
2151
2149
  if (typeof functionId === 'undefined') {
2152
2150
  throw new AppwriteException('Missing required parameter: "functionId"');
2153
2151
  }
@@ -2156,9 +2154,6 @@ class Functions extends Service {
2156
2154
  if (typeof queries !== 'undefined') {
2157
2155
  payload['queries'] = queries;
2158
2156
  }
2159
- if (typeof search !== 'undefined') {
2160
- payload['search'] = search;
2161
- }
2162
2157
  const uri = new URL(this.client.config.endpoint + apiPath);
2163
2158
  return this.client.call('get', uri, {}, payload);
2164
2159
  }
@@ -2665,10 +2660,11 @@ class Storage extends Service {
2665
2660
  *
2666
2661
  * @param {string} bucketId
2667
2662
  * @param {string} fileId
2663
+ * @param {string} token
2668
2664
  * @throws {AppwriteException}
2669
2665
  * @returns {URL}
2670
2666
  */
2671
- getFileDownload(bucketId, fileId) {
2667
+ getFileDownload(bucketId, fileId, token) {
2672
2668
  if (typeof bucketId === 'undefined') {
2673
2669
  throw new AppwriteException('Missing required parameter: "bucketId"');
2674
2670
  }
@@ -2677,6 +2673,9 @@ class Storage extends Service {
2677
2673
  }
2678
2674
  const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
2679
2675
  const payload = {};
2676
+ if (typeof token !== 'undefined') {
2677
+ payload['token'] = token;
2678
+ }
2680
2679
  const uri = new URL(this.client.config.endpoint + apiPath);
2681
2680
  payload['project'] = this.client.config.project;
2682
2681
  for (const [key, value] of Object.entries(Service.flatten(payload))) {
@@ -2704,10 +2703,11 @@ class Storage extends Service {
2704
2703
  * @param {number} rotation
2705
2704
  * @param {string} background
2706
2705
  * @param {ImageFormat} output
2706
+ * @param {string} token
2707
2707
  * @throws {AppwriteException}
2708
2708
  * @returns {URL}
2709
2709
  */
2710
- getFilePreview(bucketId, fileId, width, height, gravity, quality, borderWidth, borderColor, borderRadius, opacity, rotation, background, output) {
2710
+ getFilePreview(bucketId, fileId, width, height, gravity, quality, borderWidth, borderColor, borderRadius, opacity, rotation, background, output, token) {
2711
2711
  if (typeof bucketId === 'undefined') {
2712
2712
  throw new AppwriteException('Missing required parameter: "bucketId"');
2713
2713
  }
@@ -2749,6 +2749,9 @@ class Storage extends Service {
2749
2749
  if (typeof output !== 'undefined') {
2750
2750
  payload['output'] = output;
2751
2751
  }
2752
+ if (typeof token !== 'undefined') {
2753
+ payload['token'] = token;
2754
+ }
2752
2755
  const uri = new URL(this.client.config.endpoint + apiPath);
2753
2756
  payload['project'] = this.client.config.project;
2754
2757
  for (const [key, value] of Object.entries(Service.flatten(payload))) {
@@ -2763,10 +2766,11 @@ class Storage extends Service {
2763
2766
  *
2764
2767
  * @param {string} bucketId
2765
2768
  * @param {string} fileId
2769
+ * @param {string} token
2766
2770
  * @throws {AppwriteException}
2767
2771
  * @returns {URL}
2768
2772
  */
2769
- getFileView(bucketId, fileId) {
2773
+ getFileView(bucketId, fileId, token) {
2770
2774
  if (typeof bucketId === 'undefined') {
2771
2775
  throw new AppwriteException('Missing required parameter: "bucketId"');
2772
2776
  }
@@ -2775,6 +2779,9 @@ class Storage extends Service {
2775
2779
  }
2776
2780
  const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
2777
2781
  const payload = {};
2782
+ if (typeof token !== 'undefined') {
2783
+ payload['token'] = token;
2784
+ }
2778
2785
  const uri = new URL(this.client.config.endpoint + apiPath);
2779
2786
  payload['project'] = this.client.config.project;
2780
2787
  for (const [key, value] of Object.entries(Service.flatten(payload))) {
@@ -3664,7 +3671,6 @@ exports.ImageFormat = void 0;
3664
3671
  (function (ImageFormat) {
3665
3672
  ImageFormat["Jpg"] = "jpg";
3666
3673
  ImageFormat["Jpeg"] = "jpeg";
3667
- ImageFormat["Gif"] = "gif";
3668
3674
  ImageFormat["Png"] = "png";
3669
3675
  ImageFormat["Webp"] = "webp";
3670
3676
  ImageFormat["Heic"] = "heic";