react-native-appwrite 0.7.4 → 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.
- package/README.md +2 -2
- package/dist/cjs/sdk.js +18 -11
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +18 -11
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/avatars/get-browser.md +1 -1
- package/docs/examples/avatars/get-credit-card.md +1 -1
- package/docs/examples/avatars/get-flag.md +1 -1
- package/docs/examples/databases/create-document.md +3 -1
- package/docs/examples/functions/list-executions.md +1 -2
- package/docs/examples/storage/get-file-download.md +2 -1
- package/docs/examples/storage/get-file-preview.md +3 -2
- package/docs/examples/storage/get-file-view.md +2 -1
- package/package.json +1 -1
- package/src/client.ts +2 -2
- package/src/enums/image-format.ts +0 -1
- package/src/models.ts +1 -1
- package/src/services/functions.ts +1 -6
- package/src/services/storage.ts +18 -3
- package/types/enums/image-format.d.ts +0 -1
- package/types/models.d.ts +1 -1
- package/types/services/functions.d.ts +1 -2
- package/types/services/storage.d.ts +6 -3
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Appwrite React Native SDK
|
|
2
2
|
|
|
3
3
|

|
|
4
|
-

|
|
5
5
|
[](https://travis-ci.com/appwrite/sdk-generator)
|
|
6
6
|
[](https://twitter.com/appwrite)
|
|
7
7
|
[](https://appwrite.io/discord)
|
|
8
8
|
|
|
9
|
-
**This SDK is compatible with Appwrite server version 1.
|
|
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.
|
|
103
|
-
'X-Appwrite-Response-Format': '1.
|
|
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,
|
|
@@ -2142,11 +2142,10 @@ class Functions extends Service {
|
|
|
2142
2142
|
*
|
|
2143
2143
|
* @param {string} functionId
|
|
2144
2144
|
* @param {string[]} queries
|
|
2145
|
-
* @param {string} search
|
|
2146
2145
|
* @throws {AppwriteException}
|
|
2147
2146
|
* @returns {Promise}
|
|
2148
2147
|
*/
|
|
2149
|
-
listExecutions(functionId, queries
|
|
2148
|
+
listExecutions(functionId, queries) {
|
|
2150
2149
|
if (typeof functionId === 'undefined') {
|
|
2151
2150
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
2152
2151
|
}
|
|
@@ -2155,9 +2154,6 @@ class Functions extends Service {
|
|
|
2155
2154
|
if (typeof queries !== 'undefined') {
|
|
2156
2155
|
payload['queries'] = queries;
|
|
2157
2156
|
}
|
|
2158
|
-
if (typeof search !== 'undefined') {
|
|
2159
|
-
payload['search'] = search;
|
|
2160
|
-
}
|
|
2161
2157
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2162
2158
|
return this.client.call('get', uri, {}, payload);
|
|
2163
2159
|
}
|
|
@@ -2664,10 +2660,11 @@ class Storage extends Service {
|
|
|
2664
2660
|
*
|
|
2665
2661
|
* @param {string} bucketId
|
|
2666
2662
|
* @param {string} fileId
|
|
2663
|
+
* @param {string} token
|
|
2667
2664
|
* @throws {AppwriteException}
|
|
2668
2665
|
* @returns {URL}
|
|
2669
2666
|
*/
|
|
2670
|
-
getFileDownload(bucketId, fileId) {
|
|
2667
|
+
getFileDownload(bucketId, fileId, token) {
|
|
2671
2668
|
if (typeof bucketId === 'undefined') {
|
|
2672
2669
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
2673
2670
|
}
|
|
@@ -2676,6 +2673,9 @@ class Storage extends Service {
|
|
|
2676
2673
|
}
|
|
2677
2674
|
const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
2678
2675
|
const payload = {};
|
|
2676
|
+
if (typeof token !== 'undefined') {
|
|
2677
|
+
payload['token'] = token;
|
|
2678
|
+
}
|
|
2679
2679
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2680
2680
|
payload['project'] = this.client.config.project;
|
|
2681
2681
|
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
@@ -2703,10 +2703,11 @@ class Storage extends Service {
|
|
|
2703
2703
|
* @param {number} rotation
|
|
2704
2704
|
* @param {string} background
|
|
2705
2705
|
* @param {ImageFormat} output
|
|
2706
|
+
* @param {string} token
|
|
2706
2707
|
* @throws {AppwriteException}
|
|
2707
2708
|
* @returns {URL}
|
|
2708
2709
|
*/
|
|
2709
|
-
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) {
|
|
2710
2711
|
if (typeof bucketId === 'undefined') {
|
|
2711
2712
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
2712
2713
|
}
|
|
@@ -2748,6 +2749,9 @@ class Storage extends Service {
|
|
|
2748
2749
|
if (typeof output !== 'undefined') {
|
|
2749
2750
|
payload['output'] = output;
|
|
2750
2751
|
}
|
|
2752
|
+
if (typeof token !== 'undefined') {
|
|
2753
|
+
payload['token'] = token;
|
|
2754
|
+
}
|
|
2751
2755
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2752
2756
|
payload['project'] = this.client.config.project;
|
|
2753
2757
|
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
@@ -2762,10 +2766,11 @@ class Storage extends Service {
|
|
|
2762
2766
|
*
|
|
2763
2767
|
* @param {string} bucketId
|
|
2764
2768
|
* @param {string} fileId
|
|
2769
|
+
* @param {string} token
|
|
2765
2770
|
* @throws {AppwriteException}
|
|
2766
2771
|
* @returns {URL}
|
|
2767
2772
|
*/
|
|
2768
|
-
getFileView(bucketId, fileId) {
|
|
2773
|
+
getFileView(bucketId, fileId, token) {
|
|
2769
2774
|
if (typeof bucketId === 'undefined') {
|
|
2770
2775
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
2771
2776
|
}
|
|
@@ -2774,6 +2779,9 @@ class Storage extends Service {
|
|
|
2774
2779
|
}
|
|
2775
2780
|
const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
2776
2781
|
const payload = {};
|
|
2782
|
+
if (typeof token !== 'undefined') {
|
|
2783
|
+
payload['token'] = token;
|
|
2784
|
+
}
|
|
2777
2785
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2778
2786
|
payload['project'] = this.client.config.project;
|
|
2779
2787
|
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
@@ -3663,7 +3671,6 @@ exports.ImageFormat = void 0;
|
|
|
3663
3671
|
(function (ImageFormat) {
|
|
3664
3672
|
ImageFormat["Jpg"] = "jpg";
|
|
3665
3673
|
ImageFormat["Jpeg"] = "jpeg";
|
|
3666
|
-
ImageFormat["Gif"] = "gif";
|
|
3667
3674
|
ImageFormat["Png"] = "png";
|
|
3668
3675
|
ImageFormat["Webp"] = "webp";
|
|
3669
3676
|
ImageFormat["Heic"] = "heic";
|