react-native-appwrite 0.7.0 → 0.7.2

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.
@@ -17,8 +17,6 @@ export class Avatars extends Service {
17
17
  }
18
18
 
19
19
  /**
20
- * Get browser icon
21
- *
22
20
  * You can use this endpoint to show different browser icons to your users.
23
21
  * The code argument receives the browser code as it appears in your user [GET
24
22
  * /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions)
@@ -68,8 +66,6 @@ export class Avatars extends Service {
68
66
  }
69
67
 
70
68
  /**
71
- * Get credit card icon
72
- *
73
69
  * The credit card endpoint will return you the icon of the credit card
74
70
  * provider you need. Use width, height and quality arguments to change the
75
71
  * output settings.
@@ -118,8 +114,6 @@ export class Avatars extends Service {
118
114
  }
119
115
 
120
116
  /**
121
- * Get favicon
122
- *
123
117
  * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
124
118
  * website URL.
125
119
  *
@@ -152,8 +146,6 @@ export class Avatars extends Service {
152
146
  }
153
147
 
154
148
  /**
155
- * Get country flag
156
- *
157
149
  * You can use this endpoint to show different country flags icons to your
158
150
  * users. The code argument receives the 2 letter country code. Use width,
159
151
  * height and quality arguments to change the output settings. Country codes
@@ -203,8 +195,6 @@ export class Avatars extends Service {
203
195
  }
204
196
 
205
197
  /**
206
- * Get image from URL
207
- *
208
198
  * Use this endpoint to fetch a remote image URL and crop it to any image size
209
199
  * you want. This endpoint is very useful if you need to crop and display
210
200
  * remote images in your app or in case you want to make sure a 3rd party
@@ -254,8 +244,6 @@ export class Avatars extends Service {
254
244
  }
255
245
 
256
246
  /**
257
- * Get user initials
258
- *
259
247
  * Use this endpoint to show your user initials avatar icon on your website or
260
248
  * app. By default, this route will try to print your logged-in user name or
261
249
  * email initials. You can also overwrite the user name if you pass the 'name'
@@ -311,8 +299,6 @@ export class Avatars extends Service {
311
299
  }
312
300
 
313
301
  /**
314
- * Get QR code
315
- *
316
302
  * Converts a given plain text to a QR code image. You can use the query
317
303
  * parameters to change the size and style of the resulting image.
318
304
  *
@@ -14,8 +14,6 @@ export class Databases extends Service {
14
14
  }
15
15
 
16
16
  /**
17
- * List documents
18
- *
19
17
  * Get a list of all the user's documents in a given collection. You can use
20
18
  * the query params to filter your results.
21
19
  *
@@ -25,7 +23,7 @@ export class Databases extends Service {
25
23
  * @throws {AppwriteException}
26
24
  * @returns {Promise}
27
25
  */
28
- async listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
26
+ listDocuments<Document extends Models.Document>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>> {
29
27
  if (typeof databaseId === 'undefined') {
30
28
  throw new AppwriteException('Missing required parameter: "databaseId"');
31
29
  }
@@ -42,18 +40,17 @@ export class Databases extends Service {
42
40
  }
43
41
 
44
42
  const uri = new URL(this.client.config.endpoint + apiPath);
45
- return await this.client.call('get', uri, {
43
+ return this.client.call('get', uri, {
46
44
  'content-type': 'application/json',
47
45
  }, payload);
48
46
  }
49
47
 
50
48
  /**
51
- * Create document
52
- *
53
49
  * Create a new Document. Before using this route, you should create a new
54
50
  * collection resource using either a [server
55
51
  * integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
56
52
  * API or directly from your database console.
53
+ *
57
54
  *
58
55
  * @param {string} databaseId
59
56
  * @param {string} collectionId
@@ -63,7 +60,7 @@ export class Databases extends Service {
63
60
  * @throws {AppwriteException}
64
61
  * @returns {Promise}
65
62
  */
66
- async createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> {
63
+ createDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data: object, permissions?: string[]): Promise<Document> {
67
64
  if (typeof databaseId === 'undefined') {
68
65
  throw new AppwriteException('Missing required parameter: "databaseId"');
69
66
  }
@@ -96,14 +93,12 @@ export class Databases extends Service {
96
93
  }
97
94
 
98
95
  const uri = new URL(this.client.config.endpoint + apiPath);
99
- return await this.client.call('post', uri, {
96
+ return this.client.call('post', uri, {
100
97
  'content-type': 'application/json',
101
98
  }, payload);
102
99
  }
103
100
 
104
101
  /**
105
- * Get document
106
- *
107
102
  * Get a document by its unique ID. This endpoint response returns a JSON
108
103
  * object with the document data.
109
104
  *
@@ -114,7 +109,7 @@ export class Databases extends Service {
114
109
  * @throws {AppwriteException}
115
110
  * @returns {Promise}
116
111
  */
117
- async getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document> {
112
+ getDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document> {
118
113
  if (typeof databaseId === 'undefined') {
119
114
  throw new AppwriteException('Missing required parameter: "databaseId"');
120
115
  }
@@ -135,14 +130,12 @@ export class Databases extends Service {
135
130
  }
136
131
 
137
132
  const uri = new URL(this.client.config.endpoint + apiPath);
138
- return await this.client.call('get', uri, {
133
+ return this.client.call('get', uri, {
139
134
  'content-type': 'application/json',
140
135
  }, payload);
141
136
  }
142
137
 
143
138
  /**
144
- * Update document
145
- *
146
139
  * Update a document by its unique ID. Using the patch method you can pass
147
140
  * only specific fields that will get updated.
148
141
  *
@@ -154,7 +147,7 @@ export class Databases extends Service {
154
147
  * @throws {AppwriteException}
155
148
  * @returns {Promise}
156
149
  */
157
- async updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: object, permissions?: string[]): Promise<Document> {
150
+ updateDocument<Document extends Models.Document>(databaseId: string, collectionId: string, documentId: string, data?: object, permissions?: string[]): Promise<Document> {
158
151
  if (typeof databaseId === 'undefined') {
159
152
  throw new AppwriteException('Missing required parameter: "databaseId"');
160
153
  }
@@ -179,14 +172,12 @@ export class Databases extends Service {
179
172
  }
180
173
 
181
174
  const uri = new URL(this.client.config.endpoint + apiPath);
182
- return await this.client.call('patch', uri, {
175
+ return this.client.call('patch', uri, {
183
176
  'content-type': 'application/json',
184
177
  }, payload);
185
178
  }
186
179
 
187
180
  /**
188
- * Delete document
189
- *
190
181
  * Delete a document by its unique ID.
191
182
  *
192
183
  * @param {string} databaseId
@@ -195,7 +186,7 @@ export class Databases extends Service {
195
186
  * @throws {AppwriteException}
196
187
  * @returns {Promise}
197
188
  */
198
- async deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}> {
189
+ deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}> {
199
190
  if (typeof databaseId === 'undefined') {
200
191
  throw new AppwriteException('Missing required parameter: "databaseId"');
201
192
  }
@@ -212,7 +203,7 @@ export class Databases extends Service {
212
203
  const payload: Payload = {};
213
204
 
214
205
  const uri = new URL(this.client.config.endpoint + apiPath);
215
- return await this.client.call('delete', uri, {
206
+ return this.client.call('delete', uri, {
216
207
  'content-type': 'application/json',
217
208
  }, payload);
218
209
  }
@@ -15,8 +15,6 @@ export class Functions extends Service {
15
15
  }
16
16
 
17
17
  /**
18
- * List executions
19
- *
20
18
  * Get a list of all the current user function execution logs. You can use the
21
19
  * query params to filter your results.
22
20
  *
@@ -26,7 +24,7 @@ export class Functions extends Service {
26
24
  * @throws {AppwriteException}
27
25
  * @returns {Promise}
28
26
  */
29
- async listExecutions(functionId: string, queries?: string[], search?: string): Promise<Models.ExecutionList> {
27
+ listExecutions(functionId: string, queries?: string[], search?: string): Promise<Models.ExecutionList> {
30
28
  if (typeof functionId === 'undefined') {
31
29
  throw new AppwriteException('Missing required parameter: "functionId"');
32
30
  }
@@ -43,14 +41,12 @@ export class Functions extends Service {
43
41
  }
44
42
 
45
43
  const uri = new URL(this.client.config.endpoint + apiPath);
46
- return await this.client.call('get', uri, {
44
+ return this.client.call('get', uri, {
47
45
  'content-type': 'application/json',
48
46
  }, payload);
49
47
  }
50
48
 
51
49
  /**
52
- * Create execution
53
- *
54
50
  * Trigger a function execution. The returned object will return you the
55
51
  * current execution status. You can ping the `Get Execution` endpoint to get
56
52
  * updates on the current execution status. Once this endpoint is called, your
@@ -66,7 +62,7 @@ export class Functions extends Service {
66
62
  * @throws {AppwriteException}
67
63
  * @returns {Promise}
68
64
  */
69
- async createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution> {
65
+ createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution> {
70
66
  if (typeof functionId === 'undefined') {
71
67
  throw new AppwriteException('Missing required parameter: "functionId"');
72
68
  }
@@ -99,14 +95,12 @@ export class Functions extends Service {
99
95
  }
100
96
 
101
97
  const uri = new URL(this.client.config.endpoint + apiPath);
102
- return await this.client.call('post', uri, {
98
+ return this.client.call('post', uri, {
103
99
  'content-type': 'application/json',
104
100
  }, payload);
105
101
  }
106
102
 
107
103
  /**
108
- * Get execution
109
- *
110
104
  * Get a function execution log by its unique ID.
111
105
  *
112
106
  * @param {string} functionId
@@ -114,7 +108,7 @@ export class Functions extends Service {
114
108
  * @throws {AppwriteException}
115
109
  * @returns {Promise}
116
110
  */
117
- async getExecution(functionId: string, executionId: string): Promise<Models.Execution> {
111
+ getExecution(functionId: string, executionId: string): Promise<Models.Execution> {
118
112
  if (typeof functionId === 'undefined') {
119
113
  throw new AppwriteException('Missing required parameter: "functionId"');
120
114
  }
@@ -127,7 +121,7 @@ export class Functions extends Service {
127
121
  const payload: Payload = {};
128
122
 
129
123
  const uri = new URL(this.client.config.endpoint + apiPath);
130
- return await this.client.call('get', uri, {
124
+ return this.client.call('get', uri, {
131
125
  'content-type': 'application/json',
132
126
  }, payload);
133
127
  }
@@ -14,15 +14,13 @@ export class Graphql extends Service {
14
14
  }
15
15
 
16
16
  /**
17
- * GraphQL endpoint
18
- *
19
17
  * Execute a GraphQL mutation.
20
18
  *
21
19
  * @param {object} query
22
20
  * @throws {AppwriteException}
23
21
  * @returns {Promise}
24
22
  */
25
- async query(query: object): Promise<{}> {
23
+ query(query: object): Promise<{}> {
26
24
  if (typeof query === 'undefined') {
27
25
  throw new AppwriteException('Missing required parameter: "query"');
28
26
  }
@@ -35,22 +33,20 @@ export class Graphql extends Service {
35
33
  }
36
34
 
37
35
  const uri = new URL(this.client.config.endpoint + apiPath);
38
- return await this.client.call('post', uri, {
36
+ return this.client.call('post', uri, {
39
37
  'x-sdk-graphql': 'true',
40
38
  'content-type': 'application/json',
41
39
  }, payload);
42
40
  }
43
41
 
44
42
  /**
45
- * GraphQL endpoint
46
- *
47
43
  * Execute a GraphQL mutation.
48
44
  *
49
45
  * @param {object} query
50
46
  * @throws {AppwriteException}
51
47
  * @returns {Promise}
52
48
  */
53
- async mutation(query: object): Promise<{}> {
49
+ mutation(query: object): Promise<{}> {
54
50
  if (typeof query === 'undefined') {
55
51
  throw new AppwriteException('Missing required parameter: "query"');
56
52
  }
@@ -63,7 +59,7 @@ export class Graphql extends Service {
63
59
  }
64
60
 
65
61
  const uri = new URL(this.client.config.endpoint + apiPath);
66
- return await this.client.call('post', uri, {
62
+ return this.client.call('post', uri, {
67
63
  'x-sdk-graphql': 'true',
68
64
  'content-type': 'application/json',
69
65
  }, payload);
@@ -14,8 +14,6 @@ export class Locale extends Service {
14
14
  }
15
15
 
16
16
  /**
17
- * Get user locale
18
- *
19
17
  * Get the current user location based on IP. Returns an object with user
20
18
  * country code, country name, continent name, continent code, ip address and
21
19
  * suggested currency. You can use the locale header to get the data in a
@@ -26,114 +24,102 @@ export class Locale extends Service {
26
24
  * @throws {AppwriteException}
27
25
  * @returns {Promise}
28
26
  */
29
- async get(): Promise<Models.Locale> {
27
+ get(): Promise<Models.Locale> {
30
28
  const apiPath = '/locale';
31
29
  const payload: Payload = {};
32
30
 
33
31
  const uri = new URL(this.client.config.endpoint + apiPath);
34
- return await this.client.call('get', uri, {
32
+ return this.client.call('get', uri, {
35
33
  'content-type': 'application/json',
36
34
  }, payload);
37
35
  }
38
36
 
39
37
  /**
40
- * List locale codes
41
- *
42
38
  * List of all locale codes in [ISO
43
39
  * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
44
40
  *
45
41
  * @throws {AppwriteException}
46
42
  * @returns {Promise}
47
43
  */
48
- async listCodes(): Promise<Models.LocaleCodeList> {
44
+ listCodes(): Promise<Models.LocaleCodeList> {
49
45
  const apiPath = '/locale/codes';
50
46
  const payload: Payload = {};
51
47
 
52
48
  const uri = new URL(this.client.config.endpoint + apiPath);
53
- return await this.client.call('get', uri, {
49
+ return this.client.call('get', uri, {
54
50
  'content-type': 'application/json',
55
51
  }, payload);
56
52
  }
57
53
 
58
54
  /**
59
- * List continents
60
- *
61
55
  * List of all continents. You can use the locale header to get the data in a
62
56
  * supported language.
63
57
  *
64
58
  * @throws {AppwriteException}
65
59
  * @returns {Promise}
66
60
  */
67
- async listContinents(): Promise<Models.ContinentList> {
61
+ listContinents(): Promise<Models.ContinentList> {
68
62
  const apiPath = '/locale/continents';
69
63
  const payload: Payload = {};
70
64
 
71
65
  const uri = new URL(this.client.config.endpoint + apiPath);
72
- return await this.client.call('get', uri, {
66
+ return this.client.call('get', uri, {
73
67
  'content-type': 'application/json',
74
68
  }, payload);
75
69
  }
76
70
 
77
71
  /**
78
- * List countries
79
- *
80
72
  * List of all countries. You can use the locale header to get the data in a
81
73
  * supported language.
82
74
  *
83
75
  * @throws {AppwriteException}
84
76
  * @returns {Promise}
85
77
  */
86
- async listCountries(): Promise<Models.CountryList> {
78
+ listCountries(): Promise<Models.CountryList> {
87
79
  const apiPath = '/locale/countries';
88
80
  const payload: Payload = {};
89
81
 
90
82
  const uri = new URL(this.client.config.endpoint + apiPath);
91
- return await this.client.call('get', uri, {
83
+ return this.client.call('get', uri, {
92
84
  'content-type': 'application/json',
93
85
  }, payload);
94
86
  }
95
87
 
96
88
  /**
97
- * List EU countries
98
- *
99
89
  * List of all countries that are currently members of the EU. You can use the
100
90
  * locale header to get the data in a supported language.
101
91
  *
102
92
  * @throws {AppwriteException}
103
93
  * @returns {Promise}
104
94
  */
105
- async listCountriesEU(): Promise<Models.CountryList> {
95
+ listCountriesEU(): Promise<Models.CountryList> {
106
96
  const apiPath = '/locale/countries/eu';
107
97
  const payload: Payload = {};
108
98
 
109
99
  const uri = new URL(this.client.config.endpoint + apiPath);
110
- return await this.client.call('get', uri, {
100
+ return this.client.call('get', uri, {
111
101
  'content-type': 'application/json',
112
102
  }, payload);
113
103
  }
114
104
 
115
105
  /**
116
- * List countries phone codes
117
- *
118
106
  * List of all countries phone codes. You can use the locale header to get the
119
107
  * data in a supported language.
120
108
  *
121
109
  * @throws {AppwriteException}
122
110
  * @returns {Promise}
123
111
  */
124
- async listCountriesPhones(): Promise<Models.PhoneList> {
112
+ listCountriesPhones(): Promise<Models.PhoneList> {
125
113
  const apiPath = '/locale/countries/phones';
126
114
  const payload: Payload = {};
127
115
 
128
116
  const uri = new URL(this.client.config.endpoint + apiPath);
129
- return await this.client.call('get', uri, {
117
+ return this.client.call('get', uri, {
130
118
  'content-type': 'application/json',
131
119
  }, payload);
132
120
  }
133
121
 
134
122
  /**
135
- * List currencies
136
- *
137
123
  * List of all currencies, including currency symbol, name, plural, and
138
124
  * decimal digits for all major and minor currencies. You can use the locale
139
125
  * header to get the data in a supported language.
@@ -141,31 +127,29 @@ export class Locale extends Service {
141
127
  * @throws {AppwriteException}
142
128
  * @returns {Promise}
143
129
  */
144
- async listCurrencies(): Promise<Models.CurrencyList> {
130
+ listCurrencies(): Promise<Models.CurrencyList> {
145
131
  const apiPath = '/locale/currencies';
146
132
  const payload: Payload = {};
147
133
 
148
134
  const uri = new URL(this.client.config.endpoint + apiPath);
149
- return await this.client.call('get', uri, {
135
+ return this.client.call('get', uri, {
150
136
  'content-type': 'application/json',
151
137
  }, payload);
152
138
  }
153
139
 
154
140
  /**
155
- * List languages
156
- *
157
141
  * List of all languages classified by ISO 639-1 including 2-letter code, name
158
142
  * in English, and name in the respective language.
159
143
  *
160
144
  * @throws {AppwriteException}
161
145
  * @returns {Promise}
162
146
  */
163
- async listLanguages(): Promise<Models.LanguageList> {
147
+ listLanguages(): Promise<Models.LanguageList> {
164
148
  const apiPath = '/locale/languages';
165
149
  const payload: Payload = {};
166
150
 
167
151
  const uri = new URL(this.client.config.endpoint + apiPath);
168
- return await this.client.call('get', uri, {
152
+ return this.client.call('get', uri, {
169
153
  'content-type': 'application/json',
170
154
  }, payload);
171
155
  }
@@ -14,8 +14,6 @@ export class Messaging extends Service {
14
14
  }
15
15
 
16
16
  /**
17
- * Create subscriber
18
- *
19
17
  * Create a new subscriber.
20
18
  *
21
19
  * @param {string} topicId
@@ -24,7 +22,7 @@ export class Messaging extends Service {
24
22
  * @throws {AppwriteException}
25
23
  * @returns {Promise}
26
24
  */
27
- async createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise<Models.Subscriber> {
25
+ createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise<Models.Subscriber> {
28
26
  if (typeof topicId === 'undefined') {
29
27
  throw new AppwriteException('Missing required parameter: "topicId"');
30
28
  }
@@ -49,14 +47,12 @@ export class Messaging extends Service {
49
47
  }
50
48
 
51
49
  const uri = new URL(this.client.config.endpoint + apiPath);
52
- return await this.client.call('post', uri, {
50
+ return this.client.call('post', uri, {
53
51
  'content-type': 'application/json',
54
52
  }, payload);
55
53
  }
56
54
 
57
55
  /**
58
- * Delete subscriber
59
- *
60
56
  * Delete a subscriber by its unique ID.
61
57
  *
62
58
  * @param {string} topicId
@@ -64,7 +60,7 @@ export class Messaging extends Service {
64
60
  * @throws {AppwriteException}
65
61
  * @returns {Promise}
66
62
  */
67
- async deleteSubscriber(topicId: string, subscriberId: string): Promise<{}> {
63
+ deleteSubscriber(topicId: string, subscriberId: string): Promise<{}> {
68
64
  if (typeof topicId === 'undefined') {
69
65
  throw new AppwriteException('Missing required parameter: "topicId"');
70
66
  }
@@ -77,7 +73,7 @@ export class Messaging extends Service {
77
73
  const payload: Payload = {};
78
74
 
79
75
  const uri = new URL(this.client.config.endpoint + apiPath);
80
- return await this.client.call('delete', uri, {
76
+ return this.client.call('delete', uri, {
81
77
  'content-type': 'application/json',
82
78
  }, payload);
83
79
  }
@@ -16,8 +16,6 @@ export class Storage extends Service {
16
16
  }
17
17
 
18
18
  /**
19
- * List files
20
- *
21
19
  * Get a list of all the user files. You can use the query params to filter
22
20
  * your results.
23
21
  *
@@ -27,7 +25,7 @@ export class Storage extends Service {
27
25
  * @throws {AppwriteException}
28
26
  * @returns {Promise}
29
27
  */
30
- async listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList> {
28
+ listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList> {
31
29
  if (typeof bucketId === 'undefined') {
32
30
  throw new AppwriteException('Missing required parameter: "bucketId"');
33
31
  }
@@ -44,14 +42,12 @@ export class Storage extends Service {
44
42
  }
45
43
 
46
44
  const uri = new URL(this.client.config.endpoint + apiPath);
47
- return await this.client.call('get', uri, {
45
+ return this.client.call('get', uri, {
48
46
  'content-type': 'application/json',
49
47
  }, payload);
50
48
  }
51
49
 
52
50
  /**
53
- * Create file
54
- *
55
51
  * Create a new file. Before using this route, you should create a new bucket
56
52
  * resource using either a [server
57
53
  * integration](https://appwrite.io/docs/server/storage#storageCreateBucket)
@@ -111,7 +107,7 @@ export class Storage extends Service {
111
107
  const size = file.size;
112
108
 
113
109
  if (size <= Service.CHUNK_SIZE) {
114
- return await this.client.call('post', uri, {
110
+ return this.client.call('post', uri, {
115
111
  'content-type': 'multipart/form-data',
116
112
  }, payload);
117
113
  }
@@ -167,8 +163,6 @@ export class Storage extends Service {
167
163
  }
168
164
 
169
165
  /**
170
- * Get file
171
- *
172
166
  * Get a file by its unique ID. This endpoint response returns a JSON object
173
167
  * with the file metadata.
174
168
  *
@@ -177,7 +171,7 @@ export class Storage extends Service {
177
171
  * @throws {AppwriteException}
178
172
  * @returns {Promise}
179
173
  */
180
- async getFile(bucketId: string, fileId: string): Promise<Models.File> {
174
+ getFile(bucketId: string, fileId: string): Promise<Models.File> {
181
175
  if (typeof bucketId === 'undefined') {
182
176
  throw new AppwriteException('Missing required parameter: "bucketId"');
183
177
  }
@@ -190,14 +184,12 @@ export class Storage extends Service {
190
184
  const payload: Payload = {};
191
185
 
192
186
  const uri = new URL(this.client.config.endpoint + apiPath);
193
- return await this.client.call('get', uri, {
187
+ return this.client.call('get', uri, {
194
188
  'content-type': 'application/json',
195
189
  }, payload);
196
190
  }
197
191
 
198
192
  /**
199
- * Update file
200
- *
201
193
  * Update a file by its unique ID. Only users with write permissions have
202
194
  * access to update this resource.
203
195
  *
@@ -208,7 +200,7 @@ export class Storage extends Service {
208
200
  * @throws {AppwriteException}
209
201
  * @returns {Promise}
210
202
  */
211
- async updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File> {
203
+ updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File> {
212
204
  if (typeof bucketId === 'undefined') {
213
205
  throw new AppwriteException('Missing required parameter: "bucketId"');
214
206
  }
@@ -229,14 +221,12 @@ export class Storage extends Service {
229
221
  }
230
222
 
231
223
  const uri = new URL(this.client.config.endpoint + apiPath);
232
- return await this.client.call('put', uri, {
224
+ return this.client.call('put', uri, {
233
225
  'content-type': 'application/json',
234
226
  }, payload);
235
227
  }
236
228
 
237
229
  /**
238
- * Delete file
239
- *
240
230
  * Delete a file by its unique ID. Only users with write permissions have
241
231
  * access to delete this resource.
242
232
  *
@@ -245,7 +235,7 @@ export class Storage extends Service {
245
235
  * @throws {AppwriteException}
246
236
  * @returns {Promise}
247
237
  */
248
- async deleteFile(bucketId: string, fileId: string): Promise<{}> {
238
+ deleteFile(bucketId: string, fileId: string): Promise<{}> {
249
239
  if (typeof bucketId === 'undefined') {
250
240
  throw new AppwriteException('Missing required parameter: "bucketId"');
251
241
  }
@@ -258,14 +248,12 @@ export class Storage extends Service {
258
248
  const payload: Payload = {};
259
249
 
260
250
  const uri = new URL(this.client.config.endpoint + apiPath);
261
- return await this.client.call('delete', uri, {
251
+ return this.client.call('delete', uri, {
262
252
  'content-type': 'application/json',
263
253
  }, payload);
264
254
  }
265
255
 
266
256
  /**
267
- * Get file for download
268
- *
269
257
  * Get a file content by its unique ID. The endpoint response return with a
270
258
  * 'Content-Disposition: attachment' header that tells the browser to start
271
259
  * downloading the file to user downloads directory.
@@ -298,8 +286,6 @@ export class Storage extends Service {
298
286
  }
299
287
 
300
288
  /**
301
- * Get file preview
302
- *
303
289
  * Get a file preview image. Currently, this method supports preview for image
304
290
  * files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
305
291
  * and spreadsheets, will return the file icon image. You can also pass query
@@ -389,8 +375,6 @@ export class Storage extends Service {
389
375
  }
390
376
 
391
377
  /**
392
- * Get file for view
393
- *
394
378
  * Get a file content by its unique ID. This endpoint is similar to the
395
379
  * download method but returns with no 'Content-Disposition: attachment'
396
380
  * header.