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.
- package/CHANGELOG.md +6 -1
- package/README.md +2 -2
- package/dist/cjs/sdk.js +18 -12
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +18 -12
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/account/create-anonymous-session.md +1 -1
- package/docs/examples/account/create-email-password-session.md +1 -1
- package/docs/examples/account/create-email-token.md +1 -1
- package/docs/examples/account/create-j-w-t.md +1 -1
- package/docs/examples/account/create-magic-u-r-l-token.md +1 -1
- package/docs/examples/account/create-mfa-authenticator.md +1 -1
- package/docs/examples/account/create-mfa-challenge.md +1 -1
- package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/create-o-auth2session.md +1 -1
- package/docs/examples/account/create-o-auth2token.md +1 -1
- package/docs/examples/account/create-phone-token.md +1 -1
- package/docs/examples/account/create-phone-verification.md +1 -1
- package/docs/examples/account/create-push-target.md +1 -1
- package/docs/examples/account/create-recovery.md +1 -1
- package/docs/examples/account/create-session.md +1 -1
- package/docs/examples/account/create-verification.md +1 -1
- package/docs/examples/account/create.md +1 -1
- package/docs/examples/account/delete-identity.md +1 -1
- package/docs/examples/account/delete-mfa-authenticator.md +1 -1
- package/docs/examples/account/delete-push-target.md +1 -1
- package/docs/examples/account/delete-session.md +1 -1
- package/docs/examples/account/delete-sessions.md +1 -1
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/get-prefs.md +1 -1
- package/docs/examples/account/get-session.md +1 -1
- package/docs/examples/account/get.md +1 -1
- package/docs/examples/account/list-identities.md +1 -1
- package/docs/examples/account/list-logs.md +1 -1
- package/docs/examples/account/list-mfa-factors.md +1 -1
- package/docs/examples/account/list-sessions.md +1 -1
- package/docs/examples/account/update-email.md +1 -1
- package/docs/examples/account/update-m-f-a.md +1 -1
- package/docs/examples/account/update-magic-u-r-l-session.md +1 -1
- package/docs/examples/account/update-mfa-authenticator.md +1 -1
- package/docs/examples/account/update-mfa-challenge.md +1 -1
- package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/update-name.md +1 -1
- package/docs/examples/account/update-password.md +1 -1
- package/docs/examples/account/update-phone-session.md +1 -1
- package/docs/examples/account/update-phone-verification.md +1 -1
- package/docs/examples/account/update-phone.md +1 -1
- package/docs/examples/account/update-prefs.md +1 -1
- package/docs/examples/account/update-push-target.md +1 -1
- package/docs/examples/account/update-recovery.md +1 -1
- package/docs/examples/account/update-session.md +1 -1
- package/docs/examples/account/update-status.md +1 -1
- package/docs/examples/account/update-verification.md +1 -1
- package/docs/examples/avatars/get-browser.md +2 -2
- package/docs/examples/avatars/get-credit-card.md +2 -2
- package/docs/examples/avatars/get-favicon.md +1 -1
- package/docs/examples/avatars/get-flag.md +2 -2
- package/docs/examples/avatars/get-image.md +1 -1
- package/docs/examples/avatars/get-initials.md +1 -1
- package/docs/examples/avatars/get-q-r.md +1 -1
- package/docs/examples/databases/create-document.md +4 -2
- package/docs/examples/databases/delete-document.md +1 -1
- package/docs/examples/databases/get-document.md +1 -1
- package/docs/examples/databases/list-documents.md +1 -1
- package/docs/examples/databases/update-document.md +1 -1
- package/docs/examples/functions/create-execution.md +1 -1
- package/docs/examples/functions/get-execution.md +1 -1
- package/docs/examples/functions/list-executions.md +2 -3
- package/docs/examples/graphql/mutation.md +1 -1
- package/docs/examples/graphql/query.md +1 -1
- package/docs/examples/locale/get.md +1 -1
- package/docs/examples/locale/list-codes.md +1 -1
- package/docs/examples/locale/list-continents.md +1 -1
- package/docs/examples/locale/list-countries-e-u.md +1 -1
- package/docs/examples/locale/list-countries-phones.md +1 -1
- package/docs/examples/locale/list-countries.md +1 -1
- package/docs/examples/locale/list-currencies.md +1 -1
- package/docs/examples/locale/list-languages.md +1 -1
- package/docs/examples/messaging/create-subscriber.md +1 -1
- package/docs/examples/messaging/delete-subscriber.md +1 -1
- package/docs/examples/storage/create-file.md +1 -1
- package/docs/examples/storage/delete-file.md +1 -1
- package/docs/examples/storage/get-file-download.md +3 -2
- package/docs/examples/storage/get-file-preview.md +4 -3
- package/docs/examples/storage/get-file-view.md +3 -2
- package/docs/examples/storage/get-file.md +1 -1
- package/docs/examples/storage/list-files.md +1 -1
- package/docs/examples/storage/update-file.md +1 -1
- package/docs/examples/teams/create-membership.md +1 -1
- package/docs/examples/teams/create.md +1 -1
- package/docs/examples/teams/delete-membership.md +1 -1
- package/docs/examples/teams/delete.md +1 -1
- package/docs/examples/teams/get-membership.md +1 -1
- package/docs/examples/teams/get-prefs.md +1 -1
- package/docs/examples/teams/get.md +1 -1
- package/docs/examples/teams/list-memberships.md +1 -1
- package/docs/examples/teams/list.md +1 -1
- package/docs/examples/teams/update-membership-status.md +1 -1
- package/docs/examples/teams/update-membership.md +1 -1
- package/docs/examples/teams/update-name.md +1 -1
- package/docs/examples/teams/update-prefs.md +1 -1
- package/package.json +3 -3
- package/src/client.ts +2 -2
- package/src/enums/image-format.ts +0 -1
- package/src/models.ts +1 -1
- package/src/services/databases.ts +0 -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/databases.d.ts +0 -1
- package/types/services/functions.d.ts +1 -2
- package/types/services/storage.d.ts +6 -3
package/CHANGELOG.md
CHANGED
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,
|
|
@@ -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
|
|
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";
|