react-native-appwrite 0.9.2 → 0.10.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 +13 -0
- package/README.md +1 -1
- package/dist/cjs/sdk.js +241 -20
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +241 -20
- package/dist/esm/sdk.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +4 -2
- package/src/services/avatars.ts +296 -20
- package/src/services/storage.ts +140 -8
- package/types/client.d.ts +1 -1
- package/types/services/avatars.d.ts +136 -7
- package/types/services/storage.d.ts +52 -3
|
@@ -5,6 +5,135 @@ import { CreditCard } from '../enums/credit-card';
|
|
|
5
5
|
import { Flag } from '../enums/flag';
|
|
6
6
|
export declare class Avatars extends Service {
|
|
7
7
|
constructor(client: Client);
|
|
8
|
+
/**
|
|
9
|
+
* You can use this endpoint to show different browser icons to your users.
|
|
10
|
+
* The code argument receives the browser code as it appears in your user [GET
|
|
11
|
+
* /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions)
|
|
12
|
+
* endpoint. Use width, height and quality arguments to change the output
|
|
13
|
+
* settings.
|
|
14
|
+
*
|
|
15
|
+
* When one dimension is specified and the other is 0, the image is scaled
|
|
16
|
+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
17
|
+
* image at source quality. If dimensions are not specified, the default size
|
|
18
|
+
* of image returned is 100x100px.
|
|
19
|
+
*
|
|
20
|
+
* @param {Browser} code
|
|
21
|
+
* @param {number} width
|
|
22
|
+
* @param {number} height
|
|
23
|
+
* @param {number} quality
|
|
24
|
+
* @throws {AppwriteException}
|
|
25
|
+
* @returns {ArrayBuffer}
|
|
26
|
+
*/
|
|
27
|
+
getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
|
28
|
+
/**
|
|
29
|
+
* The credit card endpoint will return you the icon of the credit card
|
|
30
|
+
* provider you need. Use width, height and quality arguments to change the
|
|
31
|
+
* output settings.
|
|
32
|
+
*
|
|
33
|
+
* When one dimension is specified and the other is 0, the image is scaled
|
|
34
|
+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
35
|
+
* image at source quality. If dimensions are not specified, the default size
|
|
36
|
+
* of image returned is 100x100px.
|
|
37
|
+
*
|
|
38
|
+
*
|
|
39
|
+
* @param {CreditCard} code
|
|
40
|
+
* @param {number} width
|
|
41
|
+
* @param {number} height
|
|
42
|
+
* @param {number} quality
|
|
43
|
+
* @throws {AppwriteException}
|
|
44
|
+
* @returns {ArrayBuffer}
|
|
45
|
+
*/
|
|
46
|
+
getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
|
47
|
+
/**
|
|
48
|
+
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
|
|
49
|
+
* website URL.
|
|
50
|
+
*
|
|
51
|
+
* This endpoint does not follow HTTP redirects.
|
|
52
|
+
*
|
|
53
|
+
* @param {string} url
|
|
54
|
+
* @throws {AppwriteException}
|
|
55
|
+
* @returns {ArrayBuffer}
|
|
56
|
+
*/
|
|
57
|
+
getFavicon(url: string): Promise<ArrayBuffer>;
|
|
58
|
+
/**
|
|
59
|
+
* You can use this endpoint to show different country flags icons to your
|
|
60
|
+
* users. The code argument receives the 2 letter country code. Use width,
|
|
61
|
+
* height and quality arguments to change the output settings. Country codes
|
|
62
|
+
* follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
|
63
|
+
*
|
|
64
|
+
* When one dimension is specified and the other is 0, the image is scaled
|
|
65
|
+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
66
|
+
* image at source quality. If dimensions are not specified, the default size
|
|
67
|
+
* of image returned is 100x100px.
|
|
68
|
+
*
|
|
69
|
+
*
|
|
70
|
+
* @param {Flag} code
|
|
71
|
+
* @param {number} width
|
|
72
|
+
* @param {number} height
|
|
73
|
+
* @param {number} quality
|
|
74
|
+
* @throws {AppwriteException}
|
|
75
|
+
* @returns {ArrayBuffer}
|
|
76
|
+
*/
|
|
77
|
+
getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
|
78
|
+
/**
|
|
79
|
+
* Use this endpoint to fetch a remote image URL and crop it to any image size
|
|
80
|
+
* you want. This endpoint is very useful if you need to crop and display
|
|
81
|
+
* remote images in your app or in case you want to make sure a 3rd party
|
|
82
|
+
* image is properly served using a TLS protocol.
|
|
83
|
+
*
|
|
84
|
+
* When one dimension is specified and the other is 0, the image is scaled
|
|
85
|
+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
86
|
+
* image at source quality. If dimensions are not specified, the default size
|
|
87
|
+
* of image returned is 400x400px.
|
|
88
|
+
*
|
|
89
|
+
* This endpoint does not follow HTTP redirects.
|
|
90
|
+
*
|
|
91
|
+
* @param {string} url
|
|
92
|
+
* @param {number} width
|
|
93
|
+
* @param {number} height
|
|
94
|
+
* @throws {AppwriteException}
|
|
95
|
+
* @returns {ArrayBuffer}
|
|
96
|
+
*/
|
|
97
|
+
getImage(url: string, width?: number, height?: number): Promise<ArrayBuffer>;
|
|
98
|
+
/**
|
|
99
|
+
* Use this endpoint to show your user initials avatar icon on your website or
|
|
100
|
+
* app. By default, this route will try to print your logged-in user name or
|
|
101
|
+
* email initials. You can also overwrite the user name if you pass the 'name'
|
|
102
|
+
* parameter. If no name is given and no user is logged, an empty avatar will
|
|
103
|
+
* be returned.
|
|
104
|
+
*
|
|
105
|
+
* You can use the color and background params to change the avatar colors. By
|
|
106
|
+
* default, a random theme will be selected. The random theme will persist for
|
|
107
|
+
* the user's initials when reloading the same theme will always return for
|
|
108
|
+
* the same initials.
|
|
109
|
+
*
|
|
110
|
+
* When one dimension is specified and the other is 0, the image is scaled
|
|
111
|
+
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
112
|
+
* image at source quality. If dimensions are not specified, the default size
|
|
113
|
+
* of image returned is 100x100px.
|
|
114
|
+
*
|
|
115
|
+
*
|
|
116
|
+
* @param {string} name
|
|
117
|
+
* @param {number} width
|
|
118
|
+
* @param {number} height
|
|
119
|
+
* @param {string} background
|
|
120
|
+
* @throws {AppwriteException}
|
|
121
|
+
* @returns {ArrayBuffer}
|
|
122
|
+
*/
|
|
123
|
+
getInitials(name?: string, width?: number, height?: number, background?: string): Promise<ArrayBuffer>;
|
|
124
|
+
/**
|
|
125
|
+
* Converts a given plain text to a QR code image. You can use the query
|
|
126
|
+
* parameters to change the size and style of the resulting image.
|
|
127
|
+
*
|
|
128
|
+
*
|
|
129
|
+
* @param {string} text
|
|
130
|
+
* @param {number} size
|
|
131
|
+
* @param {number} margin
|
|
132
|
+
* @param {boolean} download
|
|
133
|
+
* @throws {AppwriteException}
|
|
134
|
+
* @returns {ArrayBuffer}
|
|
135
|
+
*/
|
|
136
|
+
getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<ArrayBuffer>;
|
|
8
137
|
/**
|
|
9
138
|
* You can use this endpoint to show different browser icons to your users.
|
|
10
139
|
* The code argument receives the browser code as it appears in your user [GET
|
|
@@ -24,7 +153,7 @@ export declare class Avatars extends Service {
|
|
|
24
153
|
* @throws {AppwriteException}
|
|
25
154
|
* @returns {URL}
|
|
26
155
|
*/
|
|
27
|
-
|
|
156
|
+
getBrowserURL(code: Browser, width?: number, height?: number, quality?: number): URL;
|
|
28
157
|
/**
|
|
29
158
|
* The credit card endpoint will return you the icon of the credit card
|
|
30
159
|
* provider you need. Use width, height and quality arguments to change the
|
|
@@ -43,7 +172,7 @@ export declare class Avatars extends Service {
|
|
|
43
172
|
* @throws {AppwriteException}
|
|
44
173
|
* @returns {URL}
|
|
45
174
|
*/
|
|
46
|
-
|
|
175
|
+
getCreditCardURL(code: CreditCard, width?: number, height?: number, quality?: number): URL;
|
|
47
176
|
/**
|
|
48
177
|
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
|
|
49
178
|
* website URL.
|
|
@@ -54,7 +183,7 @@ export declare class Avatars extends Service {
|
|
|
54
183
|
* @throws {AppwriteException}
|
|
55
184
|
* @returns {URL}
|
|
56
185
|
*/
|
|
57
|
-
|
|
186
|
+
getFaviconURL(url: string): URL;
|
|
58
187
|
/**
|
|
59
188
|
* You can use this endpoint to show different country flags icons to your
|
|
60
189
|
* users. The code argument receives the 2 letter country code. Use width,
|
|
@@ -74,7 +203,7 @@ export declare class Avatars extends Service {
|
|
|
74
203
|
* @throws {AppwriteException}
|
|
75
204
|
* @returns {URL}
|
|
76
205
|
*/
|
|
77
|
-
|
|
206
|
+
getFlagURL(code: Flag, width?: number, height?: number, quality?: number): URL;
|
|
78
207
|
/**
|
|
79
208
|
* Use this endpoint to fetch a remote image URL and crop it to any image size
|
|
80
209
|
* you want. This endpoint is very useful if you need to crop and display
|
|
@@ -94,7 +223,7 @@ export declare class Avatars extends Service {
|
|
|
94
223
|
* @throws {AppwriteException}
|
|
95
224
|
* @returns {URL}
|
|
96
225
|
*/
|
|
97
|
-
|
|
226
|
+
getImageURL(url: string, width?: number, height?: number): URL;
|
|
98
227
|
/**
|
|
99
228
|
* Use this endpoint to show your user initials avatar icon on your website or
|
|
100
229
|
* app. By default, this route will try to print your logged-in user name or
|
|
@@ -120,7 +249,7 @@ export declare class Avatars extends Service {
|
|
|
120
249
|
* @throws {AppwriteException}
|
|
121
250
|
* @returns {URL}
|
|
122
251
|
*/
|
|
123
|
-
|
|
252
|
+
getInitialsURL(name?: string, width?: number, height?: number, background?: string): URL;
|
|
124
253
|
/**
|
|
125
254
|
* Converts a given plain text to a QR code image. You can use the query
|
|
126
255
|
* parameters to change the size and style of the resulting image.
|
|
@@ -133,5 +262,5 @@ export declare class Avatars extends Service {
|
|
|
133
262
|
* @throws {AppwriteException}
|
|
134
263
|
* @returns {URL}
|
|
135
264
|
*/
|
|
136
|
-
|
|
265
|
+
getQRURL(text: string, size?: number, margin?: number, download?: boolean): URL;
|
|
137
266
|
}
|
|
@@ -82,6 +82,55 @@ export declare class Storage extends Service {
|
|
|
82
82
|
* @returns {Promise}
|
|
83
83
|
*/
|
|
84
84
|
deleteFile(bucketId: string, fileId: string): Promise<{}>;
|
|
85
|
+
/**
|
|
86
|
+
* Get a file content by its unique ID. The endpoint response return with a
|
|
87
|
+
* 'Content-Disposition: attachment' header that tells the browser to start
|
|
88
|
+
* downloading the file to user downloads directory.
|
|
89
|
+
*
|
|
90
|
+
* @param {string} bucketId
|
|
91
|
+
* @param {string} fileId
|
|
92
|
+
* @param {string} token
|
|
93
|
+
* @throws {AppwriteException}
|
|
94
|
+
* @returns {ArrayBuffer}
|
|
95
|
+
*/
|
|
96
|
+
getFileDownload(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;
|
|
97
|
+
/**
|
|
98
|
+
* Get a file preview image. Currently, this method supports preview for image
|
|
99
|
+
* files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
|
|
100
|
+
* and spreadsheets, will return the file icon image. You can also pass query
|
|
101
|
+
* string arguments for cutting and resizing your preview image. Preview is
|
|
102
|
+
* supported only for image files smaller than 10MB.
|
|
103
|
+
*
|
|
104
|
+
* @param {string} bucketId
|
|
105
|
+
* @param {string} fileId
|
|
106
|
+
* @param {number} width
|
|
107
|
+
* @param {number} height
|
|
108
|
+
* @param {ImageGravity} gravity
|
|
109
|
+
* @param {number} quality
|
|
110
|
+
* @param {number} borderWidth
|
|
111
|
+
* @param {string} borderColor
|
|
112
|
+
* @param {number} borderRadius
|
|
113
|
+
* @param {number} opacity
|
|
114
|
+
* @param {number} rotation
|
|
115
|
+
* @param {string} background
|
|
116
|
+
* @param {ImageFormat} output
|
|
117
|
+
* @param {string} token
|
|
118
|
+
* @throws {AppwriteException}
|
|
119
|
+
* @returns {ArrayBuffer}
|
|
120
|
+
*/
|
|
121
|
+
getFilePreview(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string): Promise<ArrayBuffer>;
|
|
122
|
+
/**
|
|
123
|
+
* Get a file content by its unique ID. This endpoint is similar to the
|
|
124
|
+
* download method but returns with no 'Content-Disposition: attachment'
|
|
125
|
+
* header.
|
|
126
|
+
*
|
|
127
|
+
* @param {string} bucketId
|
|
128
|
+
* @param {string} fileId
|
|
129
|
+
* @param {string} token
|
|
130
|
+
* @throws {AppwriteException}
|
|
131
|
+
* @returns {ArrayBuffer}
|
|
132
|
+
*/
|
|
133
|
+
getFileView(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;
|
|
85
134
|
/**
|
|
86
135
|
* Get a file content by its unique ID. The endpoint response return with a
|
|
87
136
|
* 'Content-Disposition: attachment' header that tells the browser to start
|
|
@@ -93,7 +142,7 @@ export declare class Storage extends Service {
|
|
|
93
142
|
* @throws {AppwriteException}
|
|
94
143
|
* @returns {URL}
|
|
95
144
|
*/
|
|
96
|
-
|
|
145
|
+
getFileDownloadURL(bucketId: string, fileId: string, token?: string): URL;
|
|
97
146
|
/**
|
|
98
147
|
* Get a file preview image. Currently, this method supports preview for image
|
|
99
148
|
* files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
|
|
@@ -118,7 +167,7 @@ export declare class Storage extends Service {
|
|
|
118
167
|
* @throws {AppwriteException}
|
|
119
168
|
* @returns {URL}
|
|
120
169
|
*/
|
|
121
|
-
|
|
170
|
+
getFilePreviewURL(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string): URL;
|
|
122
171
|
/**
|
|
123
172
|
* Get a file content by its unique ID. This endpoint is similar to the
|
|
124
173
|
* download method but returns with no 'Content-Disposition: attachment'
|
|
@@ -130,5 +179,5 @@ export declare class Storage extends Service {
|
|
|
130
179
|
* @throws {AppwriteException}
|
|
131
180
|
* @returns {URL}
|
|
132
181
|
*/
|
|
133
|
-
|
|
182
|
+
getFileViewURL(bucketId: string, fileId: string, token?: string): URL;
|
|
134
183
|
}
|