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/dist/esm/sdk.js CHANGED
@@ -77,8 +77,8 @@ class Client {
77
77
  'x-sdk-name': 'React Native',
78
78
  'x-sdk-platform': 'client',
79
79
  'x-sdk-language': 'reactnative',
80
- 'x-sdk-version': '0.7.3',
81
- 'X-Appwrite-Response-Format': '1.6.0',
80
+ 'x-sdk-version': '0.9.0',
81
+ 'X-Appwrite-Response-Format': '1.7.0',
82
82
  };
83
83
  this.realtime = {
84
84
  socket: undefined,
@@ -1981,7 +1981,6 @@ class Databases extends Service {
1981
1981
  * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
1982
1982
  * API or directly from your database console.
1983
1983
  *
1984
- *
1985
1984
  * @param {string} databaseId
1986
1985
  * @param {string} collectionId
1987
1986
  * @param {string} documentId
@@ -2121,11 +2120,10 @@ class Functions extends Service {
2121
2120
  *
2122
2121
  * @param {string} functionId
2123
2122
  * @param {string[]} queries
2124
- * @param {string} search
2125
2123
  * @throws {AppwriteException}
2126
2124
  * @returns {Promise}
2127
2125
  */
2128
- listExecutions(functionId, queries, search) {
2126
+ listExecutions(functionId, queries) {
2129
2127
  if (typeof functionId === 'undefined') {
2130
2128
  throw new AppwriteException('Missing required parameter: "functionId"');
2131
2129
  }
@@ -2134,9 +2132,6 @@ class Functions extends Service {
2134
2132
  if (typeof queries !== 'undefined') {
2135
2133
  payload['queries'] = queries;
2136
2134
  }
2137
- if (typeof search !== 'undefined') {
2138
- payload['search'] = search;
2139
- }
2140
2135
  const uri = new URL(this.client.config.endpoint + apiPath);
2141
2136
  return this.client.call('get', uri, {}, payload);
2142
2137
  }
@@ -2643,10 +2638,11 @@ class Storage extends Service {
2643
2638
  *
2644
2639
  * @param {string} bucketId
2645
2640
  * @param {string} fileId
2641
+ * @param {string} token
2646
2642
  * @throws {AppwriteException}
2647
2643
  * @returns {URL}
2648
2644
  */
2649
- getFileDownload(bucketId, fileId) {
2645
+ getFileDownload(bucketId, fileId, token) {
2650
2646
  if (typeof bucketId === 'undefined') {
2651
2647
  throw new AppwriteException('Missing required parameter: "bucketId"');
2652
2648
  }
@@ -2655,6 +2651,9 @@ class Storage extends Service {
2655
2651
  }
2656
2652
  const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
2657
2653
  const payload = {};
2654
+ if (typeof token !== 'undefined') {
2655
+ payload['token'] = token;
2656
+ }
2658
2657
  const uri = new URL(this.client.config.endpoint + apiPath);
2659
2658
  payload['project'] = this.client.config.project;
2660
2659
  for (const [key, value] of Object.entries(Service.flatten(payload))) {
@@ -2682,10 +2681,11 @@ class Storage extends Service {
2682
2681
  * @param {number} rotation
2683
2682
  * @param {string} background
2684
2683
  * @param {ImageFormat} output
2684
+ * @param {string} token
2685
2685
  * @throws {AppwriteException}
2686
2686
  * @returns {URL}
2687
2687
  */
2688
- getFilePreview(bucketId, fileId, width, height, gravity, quality, borderWidth, borderColor, borderRadius, opacity, rotation, background, output) {
2688
+ getFilePreview(bucketId, fileId, width, height, gravity, quality, borderWidth, borderColor, borderRadius, opacity, rotation, background, output, token) {
2689
2689
  if (typeof bucketId === 'undefined') {
2690
2690
  throw new AppwriteException('Missing required parameter: "bucketId"');
2691
2691
  }
@@ -2727,6 +2727,9 @@ class Storage extends Service {
2727
2727
  if (typeof output !== 'undefined') {
2728
2728
  payload['output'] = output;
2729
2729
  }
2730
+ if (typeof token !== 'undefined') {
2731
+ payload['token'] = token;
2732
+ }
2730
2733
  const uri = new URL(this.client.config.endpoint + apiPath);
2731
2734
  payload['project'] = this.client.config.project;
2732
2735
  for (const [key, value] of Object.entries(Service.flatten(payload))) {
@@ -2741,10 +2744,11 @@ class Storage extends Service {
2741
2744
  *
2742
2745
  * @param {string} bucketId
2743
2746
  * @param {string} fileId
2747
+ * @param {string} token
2744
2748
  * @throws {AppwriteException}
2745
2749
  * @returns {URL}
2746
2750
  */
2747
- getFileView(bucketId, fileId) {
2751
+ getFileView(bucketId, fileId, token) {
2748
2752
  if (typeof bucketId === 'undefined') {
2749
2753
  throw new AppwriteException('Missing required parameter: "bucketId"');
2750
2754
  }
@@ -2753,6 +2757,9 @@ class Storage extends Service {
2753
2757
  }
2754
2758
  const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
2755
2759
  const payload = {};
2760
+ if (typeof token !== 'undefined') {
2761
+ payload['token'] = token;
2762
+ }
2756
2763
  const uri = new URL(this.client.config.endpoint + apiPath);
2757
2764
  payload['project'] = this.client.config.project;
2758
2765
  for (const [key, value] of Object.entries(Service.flatten(payload))) {
@@ -3642,7 +3649,6 @@ var ImageFormat;
3642
3649
  (function (ImageFormat) {
3643
3650
  ImageFormat["Jpg"] = "jpg";
3644
3651
  ImageFormat["Jpeg"] = "jpeg";
3645
- ImageFormat["Gif"] = "gif";
3646
3652
  ImageFormat["Png"] = "png";
3647
3653
  ImageFormat["Webp"] = "webp";
3648
3654
  ImageFormat["Heic"] = "heic";