node-appwrite 11.0.0 → 11.1.1

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.
@@ -32,7 +32,7 @@ class Health extends Service {
32
32
  }
33
33
 
34
34
  /**
35
- * Get Antivirus
35
+ * Get antivirus
36
36
  *
37
37
  * Check the Appwrite Antivirus server is up and connection is successful.
38
38
  *
@@ -49,7 +49,7 @@ class Health extends Service {
49
49
  }
50
50
 
51
51
  /**
52
- * Get Cache
52
+ * Get cache
53
53
  *
54
54
  * Check the Appwrite in-memory cache servers are up and connection is
55
55
  * successful.
@@ -84,7 +84,7 @@ class Health extends Service {
84
84
  }
85
85
 
86
86
  /**
87
- * Get PubSub
87
+ * Get pubsub
88
88
  *
89
89
  * Check the Appwrite pub-sub servers are up and connection is successful.
90
90
  *
@@ -101,7 +101,7 @@ class Health extends Service {
101
101
  }
102
102
 
103
103
  /**
104
- * Get Queue
104
+ * Get queue
105
105
  *
106
106
  * Check the Appwrite queue messaging servers are up and connection is
107
107
  * successful.
@@ -119,77 +119,240 @@ class Health extends Service {
119
119
  }
120
120
 
121
121
  /**
122
- * Get Certificates Queue
122
+ * Get builds queue
123
+ *
124
+ * Get the number of builds that are waiting to be processed in the Appwrite
125
+ * internal queue server.
126
+ *
127
+ * @param {number} threshold
128
+ * @throws {AppwriteException}
129
+ * @returns {Promise}
130
+ */
131
+ async getQueueBuilds(threshold) {
132
+ const apiPath = '/health/queue/builds';
133
+ let payload = {};
134
+
135
+ if (typeof threshold !== 'undefined') {
136
+ payload['threshold'] = threshold;
137
+ }
138
+
139
+ return await this.client.call('get', apiPath, {
140
+ 'content-type': 'application/json',
141
+ }, payload);
142
+ }
143
+
144
+ /**
145
+ * Get certificates queue
123
146
  *
124
147
  * Get the number of certificates that are waiting to be issued against
125
148
  * [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue
126
149
  * server.
127
150
  *
151
+ * @param {number} threshold
128
152
  * @throws {AppwriteException}
129
153
  * @returns {Promise}
130
154
  */
131
- async getQueueCertificates() {
155
+ async getQueueCertificates(threshold) {
132
156
  const apiPath = '/health/queue/certificates';
133
157
  let payload = {};
134
158
 
159
+ if (typeof threshold !== 'undefined') {
160
+ payload['threshold'] = threshold;
161
+ }
162
+
163
+ return await this.client.call('get', apiPath, {
164
+ 'content-type': 'application/json',
165
+ }, payload);
166
+ }
167
+
168
+ /**
169
+ * Get databases queue
170
+ *
171
+ * Get the number of database changes that are waiting to be processed in the
172
+ * Appwrite internal queue server.
173
+ *
174
+ * @param {string} name
175
+ * @param {number} threshold
176
+ * @throws {AppwriteException}
177
+ * @returns {Promise}
178
+ */
179
+ async getQueueDatabases(name, threshold) {
180
+ const apiPath = '/health/queue/databases';
181
+ let payload = {};
182
+
183
+ if (typeof name !== 'undefined') {
184
+ payload['name'] = name;
185
+ }
186
+
187
+ if (typeof threshold !== 'undefined') {
188
+ payload['threshold'] = threshold;
189
+ }
190
+
135
191
  return await this.client.call('get', apiPath, {
136
192
  'content-type': 'application/json',
137
193
  }, payload);
138
194
  }
139
195
 
140
196
  /**
141
- * Get Functions Queue
197
+ * Get deletes queue
198
+ *
199
+ * Get the number of background destructive changes that are waiting to be
200
+ * processed in the Appwrite internal queue server.
142
201
  *
202
+ * @param {number} threshold
143
203
  * @throws {AppwriteException}
144
204
  * @returns {Promise}
145
205
  */
146
- async getQueueFunctions() {
206
+ async getQueueDeletes(threshold) {
207
+ const apiPath = '/health/queue/deletes';
208
+ let payload = {};
209
+
210
+ if (typeof threshold !== 'undefined') {
211
+ payload['threshold'] = threshold;
212
+ }
213
+
214
+ return await this.client.call('get', apiPath, {
215
+ 'content-type': 'application/json',
216
+ }, payload);
217
+ }
218
+
219
+ /**
220
+ * Get functions queue
221
+ *
222
+ * @param {number} threshold
223
+ * @throws {AppwriteException}
224
+ * @returns {Promise}
225
+ */
226
+ async getQueueFunctions(threshold) {
147
227
  const apiPath = '/health/queue/functions';
148
228
  let payload = {};
149
229
 
230
+ if (typeof threshold !== 'undefined') {
231
+ payload['threshold'] = threshold;
232
+ }
233
+
150
234
  return await this.client.call('get', apiPath, {
151
235
  'content-type': 'application/json',
152
236
  }, payload);
153
237
  }
154
238
 
155
239
  /**
156
- * Get Logs Queue
240
+ * Get logs queue
157
241
  *
158
242
  * Get the number of logs that are waiting to be processed in the Appwrite
159
243
  * internal queue server.
160
244
  *
245
+ * @param {number} threshold
161
246
  * @throws {AppwriteException}
162
247
  * @returns {Promise}
163
248
  */
164
- async getQueueLogs() {
249
+ async getQueueLogs(threshold) {
165
250
  const apiPath = '/health/queue/logs';
166
251
  let payload = {};
167
252
 
253
+ if (typeof threshold !== 'undefined') {
254
+ payload['threshold'] = threshold;
255
+ }
256
+
257
+ return await this.client.call('get', apiPath, {
258
+ 'content-type': 'application/json',
259
+ }, payload);
260
+ }
261
+
262
+ /**
263
+ * Get mails queue
264
+ *
265
+ * Get the number of mails that are waiting to be processed in the Appwrite
266
+ * internal queue server.
267
+ *
268
+ * @param {number} threshold
269
+ * @throws {AppwriteException}
270
+ * @returns {Promise}
271
+ */
272
+ async getQueueMails(threshold) {
273
+ const apiPath = '/health/queue/mails';
274
+ let payload = {};
275
+
276
+ if (typeof threshold !== 'undefined') {
277
+ payload['threshold'] = threshold;
278
+ }
279
+
280
+ return await this.client.call('get', apiPath, {
281
+ 'content-type': 'application/json',
282
+ }, payload);
283
+ }
284
+
285
+ /**
286
+ * Get messaging queue
287
+ *
288
+ * Get the number of messages that are waiting to be processed in the Appwrite
289
+ * internal queue server.
290
+ *
291
+ * @param {number} threshold
292
+ * @throws {AppwriteException}
293
+ * @returns {Promise}
294
+ */
295
+ async getQueueMessaging(threshold) {
296
+ const apiPath = '/health/queue/messaging';
297
+ let payload = {};
298
+
299
+ if (typeof threshold !== 'undefined') {
300
+ payload['threshold'] = threshold;
301
+ }
302
+
168
303
  return await this.client.call('get', apiPath, {
169
304
  'content-type': 'application/json',
170
305
  }, payload);
171
306
  }
172
307
 
173
308
  /**
174
- * Get Webhooks Queue
309
+ * Get migrations queue
310
+ *
311
+ * Get the number of migrations that are waiting to be processed in the
312
+ * Appwrite internal queue server.
313
+ *
314
+ * @param {number} threshold
315
+ * @throws {AppwriteException}
316
+ * @returns {Promise}
317
+ */
318
+ async getQueueMigrations(threshold) {
319
+ const apiPath = '/health/queue/migrations';
320
+ let payload = {};
321
+
322
+ if (typeof threshold !== 'undefined') {
323
+ payload['threshold'] = threshold;
324
+ }
325
+
326
+ return await this.client.call('get', apiPath, {
327
+ 'content-type': 'application/json',
328
+ }, payload);
329
+ }
330
+
331
+ /**
332
+ * Get webhooks queue
175
333
  *
176
334
  * Get the number of webhooks that are waiting to be processed in the Appwrite
177
335
  * internal queue server.
178
336
  *
337
+ * @param {number} threshold
179
338
  * @throws {AppwriteException}
180
339
  * @returns {Promise}
181
340
  */
182
- async getQueueWebhooks() {
341
+ async getQueueWebhooks(threshold) {
183
342
  const apiPath = '/health/queue/webhooks';
184
343
  let payload = {};
185
344
 
345
+ if (typeof threshold !== 'undefined') {
346
+ payload['threshold'] = threshold;
347
+ }
348
+
186
349
  return await this.client.call('get', apiPath, {
187
350
  'content-type': 'application/json',
188
351
  }, payload);
189
352
  }
190
353
 
191
354
  /**
192
- * Get Local Storage
355
+ * Get local storage
193
356
  *
194
357
  * Check the Appwrite local storage device is up and connection is successful.
195
358
  *
@@ -206,7 +369,7 @@ class Health extends Service {
206
369
  }
207
370
 
208
371
  /**
209
- * Get Time
372
+ * Get time
210
373
  *
211
374
  * Check the Appwrite server time is synced with Google remote NTP server. We
212
375
  * use this technology to smoothly handle leap seconds with no disruptive
@@ -15,7 +15,7 @@ class Locale extends Service {
15
15
 
16
16
 
17
17
  /**
18
- * Get User Locale
18
+ * Get user locale
19
19
  *
20
20
  * Get the current user location based on IP. Returns an object with user
21
21
  * country code, country name, continent name, continent code, ip address and
@@ -55,7 +55,7 @@ class Locale extends Service {
55
55
  }
56
56
 
57
57
  /**
58
- * List Continents
58
+ * List continents
59
59
  *
60
60
  * List of all continents. You can use the locale header to get the data in a
61
61
  * supported language.
@@ -73,7 +73,7 @@ class Locale extends Service {
73
73
  }
74
74
 
75
75
  /**
76
- * List Countries
76
+ * List countries
77
77
  *
78
78
  * List of all countries. You can use the locale header to get the data in a
79
79
  * supported language.
@@ -91,7 +91,7 @@ class Locale extends Service {
91
91
  }
92
92
 
93
93
  /**
94
- * List EU Countries
94
+ * List EU countries
95
95
  *
96
96
  * List of all countries that are currently members of the EU. You can use the
97
97
  * locale header to get the data in a supported language.
@@ -109,7 +109,7 @@ class Locale extends Service {
109
109
  }
110
110
 
111
111
  /**
112
- * List Countries Phone Codes
112
+ * List countries phone codes
113
113
  *
114
114
  * List of all countries phone codes. You can use the locale header to get the
115
115
  * data in a supported language.
@@ -127,7 +127,7 @@ class Locale extends Service {
127
127
  }
128
128
 
129
129
  /**
130
- * List Currencies
130
+ * List currencies
131
131
  *
132
132
  * List of all currencies, including currency symbol, name, plural, and
133
133
  * decimal digits for all major and minor currencies. You can use the locale
@@ -146,7 +146,7 @@ class Locale extends Service {
146
146
  }
147
147
 
148
148
  /**
149
- * List Languages
149
+ * List languages
150
150
  *
151
151
  * List of all languages classified by ISO 639-1 including 2-letter code, name
152
152
  * in English, and name in the respective language.
@@ -118,7 +118,7 @@ class Storage extends Service {
118
118
  }
119
119
 
120
120
  /**
121
- * Get Bucket
121
+ * Get bucket
122
122
  *
123
123
  * Get a storage bucket by its unique ID. This endpoint response returns a
124
124
  * JSON object with the storage bucket metadata.
@@ -141,7 +141,7 @@ class Storage extends Service {
141
141
  }
142
142
 
143
143
  /**
144
- * Update Bucket
144
+ * Update bucket
145
145
  *
146
146
  * Update a storage bucket by its unique ID.
147
147
  *
@@ -212,7 +212,7 @@ class Storage extends Service {
212
212
  }
213
213
 
214
214
  /**
215
- * Delete Bucket
215
+ * Delete bucket
216
216
  *
217
217
  * Delete a storage bucket by its unique ID.
218
218
  *
@@ -234,7 +234,7 @@ class Storage extends Service {
234
234
  }
235
235
 
236
236
  /**
237
- * List Files
237
+ * List files
238
238
  *
239
239
  * Get a list of all the user files. You can use the query params to filter
240
240
  * your results.
@@ -267,12 +267,12 @@ class Storage extends Service {
267
267
  }
268
268
 
269
269
  /**
270
- * Create File
270
+ * Create file
271
271
  *
272
272
  * Create a new file. Before using this route, you should create a new bucket
273
273
  * resource using either a [server
274
- * integration](/docs/server/storage#storageCreateBucket) API or directly from
275
- * your Appwrite console.
274
+ * integration](https://appwrite.io/docs/server/storage#storageCreateBucket)
275
+ * API or directly from your Appwrite console.
276
276
  *
277
277
  * Larger files should be uploaded using multiple requests with the
278
278
  * [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range)
@@ -458,7 +458,7 @@ class Storage extends Service {
458
458
  }
459
459
 
460
460
  /**
461
- * Get File
461
+ * Get file
462
462
  *
463
463
  * Get a file by its unique ID. This endpoint response returns a JSON object
464
464
  * with the file metadata.
@@ -486,7 +486,7 @@ class Storage extends Service {
486
486
  }
487
487
 
488
488
  /**
489
- * Update File
489
+ * Update file
490
490
  *
491
491
  * Update a file by its unique ID. Only users with write permissions have
492
492
  * access to update this resource.
@@ -552,7 +552,7 @@ class Storage extends Service {
552
552
  }
553
553
 
554
554
  /**
555
- * Get File for Download
555
+ * Get file for download
556
556
  *
557
557
  * Get a file content by its unique ID. The endpoint response return with a
558
558
  * 'Content-Disposition: attachment' header that tells the browser to start
@@ -581,7 +581,7 @@ class Storage extends Service {
581
581
  }
582
582
 
583
583
  /**
584
- * Get File Preview
584
+ * Get file preview
585
585
  *
586
586
  * Get a file preview image. Currently, this method supports preview for image
587
587
  * files (jpg, png, and gif), other supported formats, like pdf, docs, slides,
@@ -667,7 +667,7 @@ class Storage extends Service {
667
667
  }
668
668
 
669
669
  /**
670
- * Get File for View
670
+ * Get file for view
671
671
  *
672
672
  * Get a file content by its unique ID. This endpoint is similar to the
673
673
  * download method but returns with no 'Content-Disposition: attachment'
@@ -15,7 +15,7 @@ class Teams extends Service {
15
15
 
16
16
 
17
17
  /**
18
- * List Teams
18
+ * List teams
19
19
  *
20
20
  * Get a list of all the teams in which the current user is a member. You can
21
21
  * use the parameters to filter your results.
@@ -43,7 +43,7 @@ class Teams extends Service {
43
43
  }
44
44
 
45
45
  /**
46
- * Create Team
46
+ * Create team
47
47
  *
48
48
  * Create a new team. The user who creates the team will automatically be
49
49
  * assigned as the owner of the team. Only the users with the owner role can
@@ -85,7 +85,7 @@ class Teams extends Service {
85
85
  }
86
86
 
87
87
  /**
88
- * Get Team
88
+ * Get team
89
89
  *
90
90
  * Get a team by its ID. All team members have read access for this resource.
91
91
  *
@@ -107,7 +107,7 @@ class Teams extends Service {
107
107
  }
108
108
 
109
109
  /**
110
- * Update Name
110
+ * Update name
111
111
  *
112
112
  * Update the team's name by its unique ID.
113
113
  *
@@ -138,7 +138,7 @@ class Teams extends Service {
138
138
  }
139
139
 
140
140
  /**
141
- * Delete Team
141
+ * Delete team
142
142
  *
143
143
  * Delete a team using its ID. Only team members with the owner role can
144
144
  * delete the team.
@@ -161,7 +161,7 @@ class Teams extends Service {
161
161
  }
162
162
 
163
163
  /**
164
- * List Team Memberships
164
+ * List team memberships
165
165
  *
166
166
  * Use this endpoint to list a team's members using the team's ID. All team
167
167
  * members have read access to this endpoint.
@@ -194,7 +194,7 @@ class Teams extends Service {
194
194
  }
195
195
 
196
196
  /**
197
- * Create Team Membership
197
+ * Create team membership
198
198
  *
199
199
  * Invite a new member to join your team. Provide an ID for existing users, or
200
200
  * invite unregistered users using an email or phone number. If initiated from
@@ -209,8 +209,8 @@ class Teams extends Service {
209
209
  *
210
210
  * Use the `url` parameter to redirect the user from the invitation email to
211
211
  * your app. After the user is redirected, use the [Update Team Membership
212
- * Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow
213
- * the user to accept the invitation to the team.
212
+ * Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus)
213
+ * endpoint to allow the user to accept the invitation to the team.
214
214
  *
215
215
  * Please note that to avoid a [Redirect
216
216
  * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
@@ -270,7 +270,7 @@ class Teams extends Service {
270
270
  }
271
271
 
272
272
  /**
273
- * Get Team Membership
273
+ * Get team membership
274
274
  *
275
275
  * Get a team member by the membership unique id. All team members have read
276
276
  * access for this resource.
@@ -298,11 +298,11 @@ class Teams extends Service {
298
298
  }
299
299
 
300
300
  /**
301
- * Update Membership
301
+ * Update membership
302
302
  *
303
303
  * Modify the roles of a team member. Only team members with the owner role
304
304
  * have access to this endpoint. Learn more about [roles and
305
- * permissions](/docs/permissions).
305
+ * permissions](https://appwrite.io/docs/permissions).
306
306
  *
307
307
  *
308
308
  * @param {string} teamId
@@ -337,7 +337,7 @@ class Teams extends Service {
337
337
  }
338
338
 
339
339
  /**
340
- * Delete Team Membership
340
+ * Delete team membership
341
341
  *
342
342
  * This endpoint allows a user to leave a team or for a team owner to delete
343
343
  * the membership of any other team member. You can also use this endpoint to
@@ -366,7 +366,7 @@ class Teams extends Service {
366
366
  }
367
367
 
368
368
  /**
369
- * Update Team Membership Status
369
+ * Update team membership status
370
370
  *
371
371
  * Use this endpoint to allow a user to accept an invitation to join a team
372
372
  * after being redirected back to your app from the invitation email received
@@ -417,11 +417,11 @@ class Teams extends Service {
417
417
  }
418
418
 
419
419
  /**
420
- * Get Team Preferences
420
+ * Get team preferences
421
421
  *
422
422
  * Get the team's shared preferences by its unique ID. If a preference doesn't
423
423
  * need to be shared by all team members, prefer storing them in [user
424
- * preferences](/docs/client/account#accountGetPrefs).
424
+ * preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
425
425
  *
426
426
  * @param {string} teamId
427
427
  * @throws {AppwriteException}
@@ -441,7 +441,7 @@ class Teams extends Service {
441
441
  }
442
442
 
443
443
  /**
444
- * Update Preferences
444
+ * Update preferences
445
445
  *
446
446
  * Update the team's preferences by its unique ID. The object you pass is
447
447
  * stored as is and replaces any previous value. The maximum allowed prefs