@appwrite.io/console 1.5.1 → 1.6.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.
Files changed (66) hide show
  1. package/README.md +4 -4
  2. package/dist/cjs/sdk.js +7714 -9758
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +7714 -9758
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +7714 -9758
  7. package/docs/examples/databases/update-float-attribute.md +2 -2
  8. package/docs/examples/databases/update-integer-attribute.md +2 -2
  9. package/docs/examples/health/{get-queue-usage-count.md → get-queue-stats-resources.md} +1 -1
  10. package/docs/examples/health/{get-queue-usage-dump.md → get-queue-stats-usage-dump.md} +1 -1
  11. package/docs/examples/organizations/create.md +5 -1
  12. package/docs/examples/organizations/update-plan.md +5 -1
  13. package/docs/examples/organizations/validate-invoice.md +14 -0
  14. package/package.json +1 -1
  15. package/src/client.ts +21 -4
  16. package/src/enums/credit-card.ts +1 -0
  17. package/src/enums/name.ts +3 -2
  18. package/src/enums/o-auth-provider.ts +1 -0
  19. package/src/enums/runtime.ts +3 -0
  20. package/src/models.ts +202 -5
  21. package/src/services/account.ts +126 -430
  22. package/src/services/assistant.ts +2 -7
  23. package/src/services/avatars.ts +7 -21
  24. package/src/services/backups.ts +24 -84
  25. package/src/services/console.ts +14 -49
  26. package/src/services/databases.ts +99 -350
  27. package/src/services/functions.ts +55 -192
  28. package/src/services/graphql.ts +4 -14
  29. package/src/services/health.ts +55 -207
  30. package/src/services/locale.ts +16 -56
  31. package/src/services/messaging.ts +92 -322
  32. package/src/services/migrations.ts +24 -84
  33. package/src/services/organizations.ts +118 -196
  34. package/src/services/project.ts +12 -42
  35. package/src/services/projects.ts +92 -322
  36. package/src/services/proxy.ts +10 -35
  37. package/src/services/storage.ts +27 -93
  38. package/src/services/teams.ts +28 -98
  39. package/src/services/users.ts +86 -301
  40. package/src/services/vcs.ts +20 -70
  41. package/types/enums/credit-card.d.ts +2 -1
  42. package/types/enums/name.d.ts +3 -2
  43. package/types/enums/o-auth-provider.d.ts +1 -0
  44. package/types/enums/runtime.d.ts +3 -0
  45. package/types/models.d.ts +202 -5
  46. package/types/services/account.d.ts +4 -128
  47. package/types/services/assistant.d.ts +0 -2
  48. package/types/services/avatars.d.ts +0 -14
  49. package/types/services/backups.d.ts +0 -24
  50. package/types/services/console.d.ts +0 -14
  51. package/types/services/databases.d.ts +5 -100
  52. package/types/services/functions.d.ts +0 -56
  53. package/types/services/graphql.d.ts +0 -4
  54. package/types/services/health.d.ts +5 -64
  55. package/types/services/locale.d.ts +0 -16
  56. package/types/services/messaging.d.ts +0 -92
  57. package/types/services/migrations.d.ts +0 -24
  58. package/types/services/organizations.d.ts +21 -60
  59. package/types/services/project.d.ts +0 -12
  60. package/types/services/projects.d.ts +0 -92
  61. package/types/services/proxy.d.ts +0 -10
  62. package/types/services/storage.d.ts +0 -30
  63. package/types/services/teams.d.ts +0 -28
  64. package/types/services/users.d.ts +0 -86
  65. package/types/services/vcs.d.ts +0 -20
  66. package/docs/examples/health/get-queue.md +0 -11
@@ -7,8 +7,6 @@ export declare class Account {
7
7
  client: Client;
8
8
  constructor(client: Client);
9
9
  /**
10
- * Get account
11
- *
12
10
  * Get the currently logged in user.
13
11
  *
14
12
  * @throws {AppwriteException}
@@ -16,8 +14,6 @@ export declare class Account {
16
14
  */
17
15
  get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
18
16
  /**
19
- * Create account
20
- *
21
17
  * Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appwrite.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appwrite.io/docs/references/cloud/client-web/account#createEmailSession).
22
18
  *
23
19
  * @param {string} userId
@@ -29,8 +25,6 @@ export declare class Account {
29
25
  */
30
26
  create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
31
27
  /**
32
- * Delete account
33
- *
34
28
  * Delete the currently logged in user.
35
29
  *
36
30
  * @throws {AppwriteException}
@@ -38,8 +32,6 @@ export declare class Account {
38
32
  */
39
33
  delete(): Promise<{}>;
40
34
  /**
41
- * List billing addresses
42
- *
43
35
  * List all billing addresses for a user.
44
36
  *
45
37
  * @param {string[]} queries
@@ -48,8 +40,6 @@ export declare class Account {
48
40
  */
49
41
  listBillingAddresses(queries?: string[]): Promise<Models.BillingAddressList>;
50
42
  /**
51
- * Create new billing address
52
- *
53
43
  * Add a new billing address to a user&#039;s account.
54
44
  *
55
45
  * @param {string} country
@@ -63,8 +53,6 @@ export declare class Account {
63
53
  */
64
54
  createBillingAddress(country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<Models.BillingAddress>;
65
55
  /**
66
- * Get billing address
67
- *
68
56
  * Get a specific billing address for a user using it&#039;s ID.
69
57
  *
70
58
  * @param {string} billingAddressId
@@ -73,8 +61,6 @@ export declare class Account {
73
61
  */
74
62
  getBillingAddress(billingAddressId: string): Promise<Models.BillingAddress>;
75
63
  /**
76
- * Update billing address
77
- *
78
64
  * Update a specific billing address using it&#039;s ID.
79
65
  *
80
66
  * @param {string} billingAddressId
@@ -89,8 +75,6 @@ export declare class Account {
89
75
  */
90
76
  updateBillingAddress(billingAddressId: string, country: string, streetAddress: string, city: string, state: string, postalCode?: string, addressLine2?: string): Promise<Models.BillingAddress>;
91
77
  /**
92
- * Delete billing address
93
- *
94
78
  * Delete a specific billing address using it&#039;s ID.
95
79
  *
96
80
  * @param {string} billingAddressId
@@ -99,8 +83,6 @@ export declare class Account {
99
83
  */
100
84
  deleteBillingAddress(billingAddressId: string): Promise<{}>;
101
85
  /**
102
- * Get coupon details
103
- *
104
86
  * Get coupon details for an account.
105
87
  *
106
88
  * @param {string} couponId
@@ -109,8 +91,6 @@ export declare class Account {
109
91
  */
110
92
  getCoupon(couponId: string): Promise<Models.Coupon>;
111
93
  /**
112
- * Update email
113
- *
114
94
  * Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.
115
95
  This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
116
96
 
@@ -122,8 +102,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
122
102
  */
123
103
  updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>>;
124
104
  /**
125
- * List identities
126
- *
127
105
  * Get the list of identities for the currently logged in user.
128
106
  *
129
107
  * @param {string[]} queries
@@ -132,8 +110,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
132
110
  */
133
111
  listIdentities(queries?: string[]): Promise<Models.IdentityList>;
134
112
  /**
135
- * Delete identity
136
- *
137
113
  * Delete an identity by its unique ID.
138
114
  *
139
115
  * @param {string} identityId
@@ -142,8 +118,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
142
118
  */
143
119
  deleteIdentity(identityId: string): Promise<{}>;
144
120
  /**
145
- * List invoices
146
- *
147
121
  * List all invoices tied to an account.
148
122
  *
149
123
  * @param {string[]} queries
@@ -152,8 +126,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
152
126
  */
153
127
  listInvoices(queries?: string[]): Promise<Models.InvoiceList>;
154
128
  /**
155
- * Create JWT
156
- *
157
129
  * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
158
130
  *
159
131
  * @throws {AppwriteException}
@@ -161,8 +133,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
161
133
  */
162
134
  createJWT(): Promise<Models.Jwt>;
163
135
  /**
164
- * List logs
165
- *
166
136
  * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.
167
137
  *
168
138
  * @param {string[]} queries
@@ -171,8 +141,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
171
141
  */
172
142
  listLogs(queries?: string[]): Promise<Models.LogList>;
173
143
  /**
174
- * Update MFA
175
- *
176
144
  * Enable or disable MFA on an account.
177
145
  *
178
146
  * @param {boolean} mfa
@@ -181,8 +149,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
181
149
  */
182
150
  updateMFA<Preferences extends Models.Preferences>(mfa: boolean): Promise<Models.User<Preferences>>;
183
151
  /**
184
- * Create authenticator
185
- *
186
152
  * Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.
187
153
  *
188
154
  * @param {AuthenticatorType} type
@@ -191,8 +157,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
191
157
  */
192
158
  createMfaAuthenticator(type: AuthenticatorType): Promise<Models.MfaType>;
193
159
  /**
194
- * Verify authenticator
195
- *
196
160
  * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.
197
161
  *
198
162
  * @param {AuthenticatorType} type
@@ -202,8 +166,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
202
166
  */
203
167
  updateMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
204
168
  /**
205
- * Delete authenticator
206
- *
207
169
  * Delete an authenticator for a user by ID.
208
170
  *
209
171
  * @param {AuthenticatorType} type
@@ -212,8 +174,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
212
174
  */
213
175
  deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}>;
214
176
  /**
215
- * Create MFA challenge
216
- *
217
177
  * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
218
178
  *
219
179
  * @param {AuthenticationFactor} factor
@@ -222,8 +182,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
222
182
  */
223
183
  createMfaChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge>;
224
184
  /**
225
- * Create MFA challenge (confirmation)
226
- *
227
185
  * Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
228
186
  *
229
187
  * @param {string} challengeId
@@ -233,8 +191,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
233
191
  */
234
192
  updateMfaChallenge(challengeId: string, otp: string): Promise<Models.Session>;
235
193
  /**
236
- * List factors
237
- *
238
194
  * List the factors available on the account to be used as a MFA challange.
239
195
  *
240
196
  * @throws {AppwriteException}
@@ -242,8 +198,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
242
198
  */
243
199
  listMfaFactors(): Promise<Models.MfaFactors>;
244
200
  /**
245
- * Get MFA recovery codes
246
- *
247
201
  * Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.
248
202
  *
249
203
  * @throws {AppwriteException}
@@ -251,8 +205,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
251
205
  */
252
206
  getMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
253
207
  /**
254
- * Create MFA recovery codes
255
- *
256
208
  * Generate recovery codes as backup for MFA flow. It&#039;s recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
257
209
  *
258
210
  * @throws {AppwriteException}
@@ -260,8 +212,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
260
212
  */
261
213
  createMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
262
214
  /**
263
- * Regenerate MFA recovery codes
264
- *
265
215
  * Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.
266
216
  *
267
217
  * @throws {AppwriteException}
@@ -269,8 +219,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
269
219
  */
270
220
  updateMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
271
221
  /**
272
- * Update name
273
- *
274
222
  * Update currently logged in user account name.
275
223
  *
276
224
  * @param {string} name
@@ -279,8 +227,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
279
227
  */
280
228
  updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>>;
281
229
  /**
282
- * Update password
283
- *
284
230
  * Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.
285
231
  *
286
232
  * @param {string} password
@@ -290,8 +236,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
290
236
  */
291
237
  updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
292
238
  /**
293
- * List payment methods
294
- *
295
239
  * List payment methods for this account.
296
240
  *
297
241
  * @param {string[]} queries
@@ -300,8 +244,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
300
244
  */
301
245
  listPaymentMethods(queries?: string[]): Promise<Models.PaymentMethodList>;
302
246
  /**
303
- * Create new payment method
304
- *
305
247
  * Create a new payment method for the current user account.
306
248
  *
307
249
  * @throws {AppwriteException}
@@ -309,8 +251,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
309
251
  */
310
252
  createPaymentMethod(): Promise<Models.PaymentMethod>;
311
253
  /**
312
- * Get payment method
313
- *
314
254
  * Get a specific payment method for the user.
315
255
  *
316
256
  * @param {string} paymentMethodId
@@ -319,8 +259,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
319
259
  */
320
260
  getPaymentMethod(paymentMethodId: string): Promise<Models.PaymentMethod>;
321
261
  /**
322
- * Update payment method
323
- *
324
262
  * Update a new payment method for the current user account.
325
263
  *
326
264
  * @param {string} paymentMethodId
@@ -331,8 +269,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
331
269
  */
332
270
  updatePaymentMethod(paymentMethodId: string, expiryMonth: number, expiryYear: number): Promise<Models.PaymentMethod>;
333
271
  /**
334
- * Delete payment method
335
- *
336
272
  * Delete a specific payment method from a user&#039;s account.
337
273
  *
338
274
  * @param {string} paymentMethodId
@@ -341,8 +277,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
341
277
  */
342
278
  deletePaymentMethod(paymentMethodId: string): Promise<{}>;
343
279
  /**
344
- * Update payment method provider id
345
- *
346
280
  * Update payment method provider.
347
281
  *
348
282
  * @param {string} paymentMethodId
@@ -353,8 +287,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
353
287
  */
354
288
  updatePaymentMethodProvider(paymentMethodId: string, providerMethodId: string, name: string): Promise<Models.PaymentMethod>;
355
289
  /**
356
- * Update payment method with new setup with mandates for indian cards
357
- *
358
290
  * Update payment method mandate options.
359
291
  *
360
292
  * @param {string} paymentMethodId
@@ -363,8 +295,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
363
295
  */
364
296
  updatePaymentMethodMandateOptions(paymentMethodId: string): Promise<Models.PaymentMethod>;
365
297
  /**
366
- * Update phone
367
- *
368
298
  * Update the currently logged in user&#039;s phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appwrite.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.
369
299
  *
370
300
  * @param {string} phone
@@ -374,8 +304,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
374
304
  */
375
305
  updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.User<Preferences>>;
376
306
  /**
377
- * Get account preferences
378
- *
379
307
  * Get the preferences as a key-value object for the currently logged in user.
380
308
  *
381
309
  * @throws {AppwriteException}
@@ -383,8 +311,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
383
311
  */
384
312
  getPrefs<Preferences extends Models.Preferences>(): Promise<Preferences>;
385
313
  /**
386
- * Update preferences
387
- *
388
314
  * Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
389
315
  *
390
316
  * @param {Partial<Preferences>} prefs
@@ -393,8 +319,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
393
319
  */
394
320
  updatePrefs<Preferences extends Models.Preferences>(prefs: Partial<Preferences>): Promise<Models.User<Preferences>>;
395
321
  /**
396
- * Create password recovery
397
- *
398
322
  * Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user&#039;s email address is valid for 1 hour.
399
323
  *
400
324
  * @param {string} email
@@ -404,8 +328,6 @@ This endpoint can also be used to convert an anonymous account to a normal one,
404
328
  */
405
329
  createRecovery(email: string, url: string): Promise<Models.Token>;
406
330
  /**
407
- * Create password recovery (confirmation)
408
- *
409
331
  * Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint.
410
332
 
411
333
  Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
@@ -418,8 +340,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
418
340
  */
419
341
  updateRecovery(userId: string, secret: string, password: string): Promise<Models.Token>;
420
342
  /**
421
- * List sessions
422
- *
423
343
  * Get the list of active sessions across different devices for the currently logged in user.
424
344
  *
425
345
  * @throws {AppwriteException}
@@ -427,8 +347,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
427
347
  */
428
348
  listSessions(): Promise<Models.SessionList>;
429
349
  /**
430
- * Delete sessions
431
- *
432
350
  * Delete all sessions from the user account and remove any sessions cookies from the end client.
433
351
  *
434
352
  * @throws {AppwriteException}
@@ -436,8 +354,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
436
354
  */
437
355
  deleteSessions(): Promise<{}>;
438
356
  /**
439
- * Create anonymous session
440
- *
441
357
  * Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session).
442
358
  *
443
359
  * @throws {AppwriteException}
@@ -445,8 +361,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
445
361
  */
446
362
  createAnonymousSession(): Promise<Models.Session>;
447
363
  /**
448
- * Create email password session
449
- *
450
364
  * Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.
451
365
 
452
366
  A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
@@ -458,8 +372,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
458
372
  */
459
373
  createEmailPasswordSession(email: string, password: string): Promise<Models.Session>;
460
374
  /**
461
- * Update magic URL session
462
- *
463
375
  * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
464
376
  *
465
377
  * @param {string} userId
@@ -469,8 +381,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
469
381
  */
470
382
  updateMagicURLSession(userId: string, secret: string): Promise<Models.Session>;
471
383
  /**
472
- * Create OAuth2 session
473
- *
474
384
  * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL&#039;s back to your app when login is completed.
475
385
 
476
386
  If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.
@@ -483,12 +393,10 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
483
393
  * @param {string} failure
484
394
  * @param {string[]} scopes
485
395
  * @throws {AppwriteException}
486
- * @returns {Promise<void | string>}
396
+ * @returns {void | string}
487
397
  */
488
- createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): Promise<void | string>;
398
+ createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | string;
489
399
  /**
490
- * Update phone session
491
- *
492
400
  * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
493
401
  *
494
402
  * @param {string} userId
@@ -498,8 +406,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
498
406
  */
499
407
  updatePhoneSession(userId: string, secret: string): Promise<Models.Session>;
500
408
  /**
501
- * Create session
502
- *
503
409
  * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.
504
410
  *
505
411
  * @param {string} userId
@@ -509,8 +415,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
509
415
  */
510
416
  createSession(userId: string, secret: string): Promise<Models.Session>;
511
417
  /**
512
- * Get session
513
- *
514
418
  * Use this endpoint to get a logged in user&#039;s session using a Session ID. Inputting &#039;current&#039; will return the current session being used.
515
419
  *
516
420
  * @param {string} sessionId
@@ -519,8 +423,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
519
423
  */
520
424
  getSession(sessionId: string): Promise<Models.Session>;
521
425
  /**
522
- * Update session
523
- *
524
426
  * Use this endpoint to extend a session&#039;s length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.
525
427
  *
526
428
  * @param {string} sessionId
@@ -529,8 +431,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
529
431
  */
530
432
  updateSession(sessionId: string): Promise<Models.Session>;
531
433
  /**
532
- * Delete session
533
- *
534
434
  * Logout the user. Use &#039;current&#039; as the session ID to logout on this device, use a session ID to logout on another device. If you&#039;re looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead.
535
435
  *
536
436
  * @param {string} sessionId
@@ -539,8 +439,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
539
439
  */
540
440
  deleteSession(sessionId: string): Promise<{}>;
541
441
  /**
542
- * Update status
543
- *
544
442
  * Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.
545
443
  *
546
444
  * @throws {AppwriteException}
@@ -548,8 +446,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
548
446
  */
549
447
  updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
550
448
  /**
551
- * Create push target
552
- *
553
449
  * Use this endpoint to register a device for push notifications. Provide a target ID (custom or generated using ID.unique()), a device identifier (usually a device token), and optionally specify which provider should send notifications to this target. The target is automatically linked to the current session and includes device information like brand and model.
554
450
  *
555
451
  * @param {string} targetId
@@ -560,8 +456,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
560
456
  */
561
457
  createPushTarget(targetId: string, identifier: string, providerId?: string): Promise<Models.Target>;
562
458
  /**
563
- * Update push target
564
- *
565
459
  * Update the currently logged in user&#039;s push notification target. You can modify the target&#039;s identifier (device token) and provider ID (token, email, phone etc.). The target must exist and belong to the current user. If you change the provider ID, notifications will be sent through the new messaging provider instead.
566
460
  *
567
461
  * @param {string} targetId
@@ -571,8 +465,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
571
465
  */
572
466
  updatePushTarget(targetId: string, identifier: string): Promise<Models.Target>;
573
467
  /**
574
- * Delete push target
575
- *
576
468
  * Delete a push notification target for the currently logged in user. After deletion, the device will no longer receive push notifications. The target must exist and belong to the current user.
577
469
  *
578
470
  * @param {string} targetId
@@ -581,8 +473,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
581
473
  */
582
474
  deletePushTarget(targetId: string): Promise<{}>;
583
475
  /**
584
- * Create email token (OTP)
585
- *
586
476
  * Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user&#039;s email is valid for 15 minutes.
587
477
 
588
478
  A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
@@ -595,8 +485,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
595
485
  */
596
486
  createEmailToken(userId: string, email: string, phrase?: boolean): Promise<Models.Token>;
597
487
  /**
598
- * Create magic URL token
599
- *
600
488
  * Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user&#039;s email address is valid for 1 hour.
601
489
 
602
490
  A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
@@ -611,8 +499,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
611
499
  */
612
500
  createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise<Models.Token>;
613
501
  /**
614
- * Create OAuth2 token
615
- *
616
502
  * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL&#039;s back to your app when login is completed.
617
503
 
618
504
  If authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint.
@@ -624,12 +510,10 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
624
510
  * @param {string} failure
625
511
  * @param {string[]} scopes
626
512
  * @throws {AppwriteException}
627
- * @returns {Promise<void | string>}
513
+ * @returns {void | string}
628
514
  */
629
- createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): Promise<void | string>;
515
+ createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | string;
630
516
  /**
631
- * Create phone token
632
- *
633
517
  * Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user&#039;s phone is valid for 15 minutes.
634
518
 
635
519
  A user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appwrite.io/docs/authentication-security#limits).
@@ -641,8 +525,6 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
641
525
  */
642
526
  createPhoneToken(userId: string, phone: string): Promise<Models.Token>;
643
527
  /**
644
- * Create email verification
645
- *
646
528
  * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user&#039;s email address is valid for 7 days.
647
529
 
648
530
  Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
@@ -654,8 +536,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
654
536
  */
655
537
  createVerification(url: string): Promise<Models.Token>;
656
538
  /**
657
- * Create email verification (confirmation)
658
- *
659
539
  * Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.
660
540
  *
661
541
  * @param {string} userId
@@ -665,8 +545,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
665
545
  */
666
546
  updateVerification(userId: string, secret: string): Promise<Models.Token>;
667
547
  /**
668
- * Create phone verification
669
- *
670
548
  * Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user&#039;s phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user&#039;s phone number is valid for 15 minutes.
671
549
  *
672
550
  * @throws {AppwriteException}
@@ -674,8 +552,6 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
674
552
  */
675
553
  createPhoneVerification(): Promise<Models.Token>;
676
554
  /**
677
- * Update phone verification (confirmation)
678
- *
679
555
  * Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user&#039;s phone number to verify the user email ownership. If confirmed this route will return a 200 status code.
680
556
  *
681
557
  * @param {string} userId
@@ -3,8 +3,6 @@ export declare class Assistant {
3
3
  client: Client;
4
4
  constructor(client: Client);
5
5
  /**
6
- * Ask query
7
- *
8
6
  * Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite&#039;s AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream.
9
7
  *
10
8
  * @param {string} prompt
@@ -6,8 +6,6 @@ export declare class Avatars {
6
6
  client: Client;
7
7
  constructor(client: Client);
8
8
  /**
9
- * Get browser icon
10
- *
11
9
  * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
12
10
 
13
11
  When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
@@ -21,8 +19,6 @@ When one dimension is specified and the other is 0, the image is scaled with pre
21
19
  */
22
20
  getBrowser(code: Browser, width?: number, height?: number, quality?: number): string;
23
21
  /**
24
- * Get credit card icon
25
- *
26
22
  * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
27
23
 
28
24
  When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
@@ -37,8 +33,6 @@ When one dimension is specified and the other is 0, the image is scaled with pre
37
33
  */
38
34
  getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): string;
39
35
  /**
40
- * Get favicon
41
- *
42
36
  * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
43
37
 
44
38
  This endpoint does not follow HTTP redirects.
@@ -49,8 +43,6 @@ This endpoint does not follow HTTP redirects.
49
43
  */
50
44
  getFavicon(url: string): string;
51
45
  /**
52
- * Get country flag
53
- *
54
46
  * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
55
47
 
56
48
  When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
@@ -65,8 +57,6 @@ When one dimension is specified and the other is 0, the image is scaled with pre
65
57
  */
66
58
  getFlag(code: Flag, width?: number, height?: number, quality?: number): string;
67
59
  /**
68
- * Get image from URL
69
- *
70
60
  * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
71
61
 
72
62
  When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.
@@ -81,8 +71,6 @@ This endpoint does not follow HTTP redirects.
81
71
  */
82
72
  getImage(url: string, width?: number, height?: number): string;
83
73
  /**
84
- * Get user initials
85
- *
86
74
  * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the &#039;name&#039; parameter. If no name is given and no user is logged, an empty avatar will be returned.
87
75
 
88
76
  You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user&#039;s initials when reloading the same theme will always return for the same initials.
@@ -99,8 +87,6 @@ When one dimension is specified and the other is 0, the image is scaled with pre
99
87
  */
100
88
  getInitials(name?: string, width?: number, height?: number, background?: string): string;
101
89
  /**
102
- * Get QR code
103
- *
104
90
  * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
105
91
 
106
92
  *