node-appwrite 17.1.0 → 17.2.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 (77) hide show
  1. package/dist/client.js +2 -2
  2. package/dist/client.js.map +1 -1
  3. package/dist/client.mjs +2 -2
  4. package/dist/client.mjs.map +1 -1
  5. package/dist/models.d.mts +122 -97
  6. package/dist/models.d.ts +122 -97
  7. package/dist/services/account.d.mts +31 -31
  8. package/dist/services/account.d.ts +31 -31
  9. package/dist/services/account.js +81 -81
  10. package/dist/services/account.js.map +1 -1
  11. package/dist/services/account.mjs +81 -81
  12. package/dist/services/account.mjs.map +1 -1
  13. package/dist/services/avatars.d.mts +20 -20
  14. package/dist/services/avatars.d.ts +20 -20
  15. package/dist/services/avatars.js +79 -79
  16. package/dist/services/avatars.js.map +1 -1
  17. package/dist/services/avatars.mjs +79 -79
  18. package/dist/services/avatars.mjs.map +1 -1
  19. package/dist/services/databases.d.mts +67 -40
  20. package/dist/services/databases.d.ts +67 -40
  21. package/dist/services/databases.js +384 -295
  22. package/dist/services/databases.js.map +1 -1
  23. package/dist/services/databases.mjs +384 -295
  24. package/dist/services/databases.mjs.map +1 -1
  25. package/dist/services/functions.d.mts +8 -8
  26. package/dist/services/functions.d.ts +8 -8
  27. package/dist/services/functions.js +38 -38
  28. package/dist/services/functions.js.map +1 -1
  29. package/dist/services/functions.mjs +38 -38
  30. package/dist/services/functions.mjs.map +1 -1
  31. package/dist/services/graphql.js.map +1 -1
  32. package/dist/services/graphql.mjs.map +1 -1
  33. package/dist/services/health.d.mts +1 -1
  34. package/dist/services/health.d.ts +1 -1
  35. package/dist/services/health.js +8 -8
  36. package/dist/services/health.js.map +1 -1
  37. package/dist/services/health.mjs +8 -8
  38. package/dist/services/health.mjs.map +1 -1
  39. package/dist/services/locale.d.mts +2 -2
  40. package/dist/services/locale.d.ts +2 -2
  41. package/dist/services/locale.js +7 -7
  42. package/dist/services/locale.js.map +1 -1
  43. package/dist/services/locale.mjs +7 -7
  44. package/dist/services/locale.mjs.map +1 -1
  45. package/dist/services/messaging.d.mts +8 -8
  46. package/dist/services/messaging.d.ts +8 -8
  47. package/dist/services/messaging.js +94 -94
  48. package/dist/services/messaging.js.map +1 -1
  49. package/dist/services/messaging.mjs +94 -94
  50. package/dist/services/messaging.mjs.map +1 -1
  51. package/dist/services/sites.d.mts +4 -4
  52. package/dist/services/sites.d.ts +4 -4
  53. package/dist/services/sites.js +24 -24
  54. package/dist/services/sites.js.map +1 -1
  55. package/dist/services/sites.mjs +24 -24
  56. package/dist/services/sites.mjs.map +1 -1
  57. package/dist/services/storage.d.mts +7 -7
  58. package/dist/services/storage.d.ts +7 -7
  59. package/dist/services/storage.js +16 -16
  60. package/dist/services/storage.js.map +1 -1
  61. package/dist/services/storage.mjs +16 -16
  62. package/dist/services/storage.mjs.map +1 -1
  63. package/dist/services/teams.d.mts +17 -17
  64. package/dist/services/teams.d.ts +17 -17
  65. package/dist/services/teams.js +40 -40
  66. package/dist/services/teams.js.map +1 -1
  67. package/dist/services/teams.mjs +40 -40
  68. package/dist/services/teams.mjs.map +1 -1
  69. package/dist/services/tokens.js.map +1 -1
  70. package/dist/services/tokens.mjs.map +1 -1
  71. package/dist/services/users.d.mts +26 -26
  72. package/dist/services/users.d.ts +26 -26
  73. package/dist/services/users.js +26 -26
  74. package/dist/services/users.js.map +1 -1
  75. package/dist/services/users.mjs +26 -26
  76. package/dist/services/users.mjs.map +1 -1
  77. package/package.json +1 -1
@@ -14,7 +14,7 @@ declare class Account {
14
14
  * @throws {AppwriteException}
15
15
  * @returns {Promise<Models.User<Preferences>>}
16
16
  */
17
- get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
17
+ get<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Models.User<Preferences>>;
18
18
  /**
19
19
  * 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).
20
20
  *
@@ -25,18 +25,18 @@ declare class Account {
25
25
  * @throws {AppwriteException}
26
26
  * @returns {Promise<Models.User<Preferences>>}
27
27
  */
28
- create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
28
+ create<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
29
29
  /**
30
30
  * 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.
31
- This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
32
-
31
+ * This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
32
+ *
33
33
  *
34
34
  * @param {string} email
35
35
  * @param {string} password
36
36
  * @throws {AppwriteException}
37
37
  * @returns {Promise<Models.User<Preferences>>}
38
38
  */
39
- updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>>;
39
+ updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(email: string, password: string): Promise<Models.User<Preferences>>;
40
40
  /**
41
41
  * Get the list of identities for the currently logged in user.
42
42
  *
@@ -75,7 +75,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
75
75
  * @throws {AppwriteException}
76
76
  * @returns {Promise<Models.User<Preferences>>}
77
77
  */
78
- updateMFA<Preferences extends Models.Preferences>(mfa: boolean): Promise<Models.User<Preferences>>;
78
+ updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(mfa: boolean): Promise<Models.User<Preferences>>;
79
79
  /**
80
80
  * 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.
81
81
  *
@@ -92,7 +92,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
92
92
  * @throws {AppwriteException}
93
93
  * @returns {Promise<Models.User<Preferences>>}
94
94
  */
95
- updateMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
95
+ updateMfaAuthenticator<Preferences extends Models.Preferences = Models.DefaultPreferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
96
96
  /**
97
97
  * Delete an authenticator for a user by ID.
98
98
  *
@@ -153,7 +153,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
153
153
  * @throws {AppwriteException}
154
154
  * @returns {Promise<Models.User<Preferences>>}
155
155
  */
156
- updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>>;
156
+ updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(name: string): Promise<Models.User<Preferences>>;
157
157
  /**
158
158
  * 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.
159
159
  *
@@ -162,7 +162,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
162
162
  * @throws {AppwriteException}
163
163
  * @returns {Promise<Models.User<Preferences>>}
164
164
  */
165
- updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
165
+ updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
166
166
  /**
167
167
  * 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.
168
168
  *
@@ -171,14 +171,14 @@ This endpoint can also be used to convert an anonymous account to a normal one,
171
171
  * @throws {AppwriteException}
172
172
  * @returns {Promise<Models.User<Preferences>>}
173
173
  */
174
- updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.User<Preferences>>;
174
+ updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(phone: string, password: string): Promise<Models.User<Preferences>>;
175
175
  /**
176
176
  * Get the preferences as a key-value object for the currently logged in user.
177
177
  *
178
178
  * @throws {AppwriteException}
179
179
  * @returns {Promise<Preferences>}
180
180
  */
181
- getPrefs<Preferences extends Models.Preferences>(): Promise<Preferences>;
181
+ getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Preferences>;
182
182
  /**
183
183
  * 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.
184
184
  *
@@ -186,7 +186,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
186
186
  * @throws {AppwriteException}
187
187
  * @returns {Promise<Models.User<Preferences>>}
188
188
  */
189
- updatePrefs<Preferences extends Models.Preferences>(prefs: Partial<Preferences>): Promise<Models.User<Preferences>>;
189
+ updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(prefs: Partial<Preferences>): Promise<Models.User<Preferences>>;
190
190
  /**
191
191
  * 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.
192
192
  *
@@ -198,8 +198,8 @@ This endpoint can also be used to convert an anonymous account to a normal one,
198
198
  createRecovery(email: string, url: string): Promise<Models.Token>;
199
199
  /**
200
200
  * 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.
201
-
202
- 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.
201
+ *
202
+ * 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.
203
203
  *
204
204
  * @param {string} userId
205
205
  * @param {string} secret
@@ -231,8 +231,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
231
231
  createAnonymousSession(): Promise<Models.Session>;
232
232
  /**
233
233
  * 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.
234
-
235
- 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).
234
+ *
235
+ * 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).
236
236
  *
237
237
  * @param {string} email
238
238
  * @param {string} password
@@ -297,11 +297,11 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
297
297
  * @throws {AppwriteException}
298
298
  * @returns {Promise<Models.User<Preferences>>}
299
299
  */
300
- updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
300
+ updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Models.User<Preferences>>;
301
301
  /**
302
302
  * 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.
303
-
304
- 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).
303
+ *
304
+ * 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).
305
305
  *
306
306
  * @param {string} userId
307
307
  * @param {string} email
@@ -312,9 +312,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
312
312
  createEmailToken(userId: string, email: string, phrase?: boolean): Promise<Models.Token>;
313
313
  /**
314
314
  * 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.
315
-
316
- 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).
317
-
315
+ *
316
+ * 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).
317
+ *
318
318
  *
319
319
  * @param {string} userId
320
320
  * @param {string} email
@@ -326,10 +326,10 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
326
326
  createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise<Models.Token>;
327
327
  /**
328
328
  * 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.
329
-
330
- 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.
331
-
332
- 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).
329
+ *
330
+ * 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.
331
+ *
332
+ * 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).
333
333
  *
334
334
  * @param {OAuthProvider} provider
335
335
  * @param {string} success
@@ -341,8 +341,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
341
341
  createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): Promise<string>;
342
342
  /**
343
343
  * 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.
344
-
345
- 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).
344
+ *
345
+ * 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).
346
346
  *
347
347
  * @param {string} userId
348
348
  * @param {string} phone
@@ -352,9 +352,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
352
352
  createPhoneToken(userId: string, phone: string): Promise<Models.Token>;
353
353
  /**
354
354
  * 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.
355
-
356
- 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.
357
-
355
+ *
356
+ * 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.
357
+ *
358
358
  *
359
359
  * @param {string} url
360
360
  * @throws {AppwriteException}
@@ -14,7 +14,7 @@ declare class Account {
14
14
  * @throws {AppwriteException}
15
15
  * @returns {Promise<Models.User<Preferences>>}
16
16
  */
17
- get<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
17
+ get<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Models.User<Preferences>>;
18
18
  /**
19
19
  * 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).
20
20
  *
@@ -25,18 +25,18 @@ declare class Account {
25
25
  * @throws {AppwriteException}
26
26
  * @returns {Promise<Models.User<Preferences>>}
27
27
  */
28
- create<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
28
+ create<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
29
29
  /**
30
30
  * 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.
31
- This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
32
-
31
+ * This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
32
+ *
33
33
  *
34
34
  * @param {string} email
35
35
  * @param {string} password
36
36
  * @throws {AppwriteException}
37
37
  * @returns {Promise<Models.User<Preferences>>}
38
38
  */
39
- updateEmail<Preferences extends Models.Preferences>(email: string, password: string): Promise<Models.User<Preferences>>;
39
+ updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(email: string, password: string): Promise<Models.User<Preferences>>;
40
40
  /**
41
41
  * Get the list of identities for the currently logged in user.
42
42
  *
@@ -75,7 +75,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
75
75
  * @throws {AppwriteException}
76
76
  * @returns {Promise<Models.User<Preferences>>}
77
77
  */
78
- updateMFA<Preferences extends Models.Preferences>(mfa: boolean): Promise<Models.User<Preferences>>;
78
+ updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(mfa: boolean): Promise<Models.User<Preferences>>;
79
79
  /**
80
80
  * 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.
81
81
  *
@@ -92,7 +92,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
92
92
  * @throws {AppwriteException}
93
93
  * @returns {Promise<Models.User<Preferences>>}
94
94
  */
95
- updateMfaAuthenticator<Preferences extends Models.Preferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
95
+ updateMfaAuthenticator<Preferences extends Models.Preferences = Models.DefaultPreferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
96
96
  /**
97
97
  * Delete an authenticator for a user by ID.
98
98
  *
@@ -153,7 +153,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
153
153
  * @throws {AppwriteException}
154
154
  * @returns {Promise<Models.User<Preferences>>}
155
155
  */
156
- updateName<Preferences extends Models.Preferences>(name: string): Promise<Models.User<Preferences>>;
156
+ updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(name: string): Promise<Models.User<Preferences>>;
157
157
  /**
158
158
  * 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.
159
159
  *
@@ -162,7 +162,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
162
162
  * @throws {AppwriteException}
163
163
  * @returns {Promise<Models.User<Preferences>>}
164
164
  */
165
- updatePassword<Preferences extends Models.Preferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
165
+ updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
166
166
  /**
167
167
  * 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.
168
168
  *
@@ -171,14 +171,14 @@ This endpoint can also be used to convert an anonymous account to a normal one,
171
171
  * @throws {AppwriteException}
172
172
  * @returns {Promise<Models.User<Preferences>>}
173
173
  */
174
- updatePhone<Preferences extends Models.Preferences>(phone: string, password: string): Promise<Models.User<Preferences>>;
174
+ updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(phone: string, password: string): Promise<Models.User<Preferences>>;
175
175
  /**
176
176
  * Get the preferences as a key-value object for the currently logged in user.
177
177
  *
178
178
  * @throws {AppwriteException}
179
179
  * @returns {Promise<Preferences>}
180
180
  */
181
- getPrefs<Preferences extends Models.Preferences>(): Promise<Preferences>;
181
+ getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Preferences>;
182
182
  /**
183
183
  * 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.
184
184
  *
@@ -186,7 +186,7 @@ This endpoint can also be used to convert an anonymous account to a normal one,
186
186
  * @throws {AppwriteException}
187
187
  * @returns {Promise<Models.User<Preferences>>}
188
188
  */
189
- updatePrefs<Preferences extends Models.Preferences>(prefs: Partial<Preferences>): Promise<Models.User<Preferences>>;
189
+ updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(prefs: Partial<Preferences>): Promise<Models.User<Preferences>>;
190
190
  /**
191
191
  * 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.
192
192
  *
@@ -198,8 +198,8 @@ This endpoint can also be used to convert an anonymous account to a normal one,
198
198
  createRecovery(email: string, url: string): Promise<Models.Token>;
199
199
  /**
200
200
  * 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.
201
-
202
- 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.
201
+ *
202
+ * 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.
203
203
  *
204
204
  * @param {string} userId
205
205
  * @param {string} secret
@@ -231,8 +231,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
231
231
  createAnonymousSession(): Promise<Models.Session>;
232
232
  /**
233
233
  * 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.
234
-
235
- 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).
234
+ *
235
+ * 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).
236
236
  *
237
237
  * @param {string} email
238
238
  * @param {string} password
@@ -297,11 +297,11 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
297
297
  * @throws {AppwriteException}
298
298
  * @returns {Promise<Models.User<Preferences>>}
299
299
  */
300
- updateStatus<Preferences extends Models.Preferences>(): Promise<Models.User<Preferences>>;
300
+ updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Models.User<Preferences>>;
301
301
  /**
302
302
  * 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.
303
-
304
- 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).
303
+ *
304
+ * 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).
305
305
  *
306
306
  * @param {string} userId
307
307
  * @param {string} email
@@ -312,9 +312,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
312
312
  createEmailToken(userId: string, email: string, phrase?: boolean): Promise<Models.Token>;
313
313
  /**
314
314
  * 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.
315
-
316
- 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).
317
-
315
+ *
316
+ * 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).
317
+ *
318
318
  *
319
319
  * @param {string} userId
320
320
  * @param {string} email
@@ -326,10 +326,10 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
326
326
  createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise<Models.Token>;
327
327
  /**
328
328
  * 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.
329
-
330
- 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.
331
-
332
- 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).
329
+ *
330
+ * 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.
331
+ *
332
+ * 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).
333
333
  *
334
334
  * @param {OAuthProvider} provider
335
335
  * @param {string} success
@@ -341,8 +341,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
341
341
  createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): Promise<string>;
342
342
  /**
343
343
  * 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.
344
-
345
- 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).
344
+ *
345
+ * 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).
346
346
  *
347
347
  * @param {string} userId
348
348
  * @param {string} phone
@@ -352,9 +352,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
352
352
  createPhoneToken(userId: string, phone: string): Promise<Models.Token>;
353
353
  /**
354
354
  * 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.
355
-
356
- 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.
357
-
355
+ *
356
+ * 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.
357
+ *
358
358
  *
359
359
  * @param {string} url
360
360
  * @throws {AppwriteException}
@@ -70,15 +70,15 @@ class Account {
70
70
  );
71
71
  }
72
72
  /**
73
- * 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.
74
- This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
75
-
76
- *
77
- * @param {string} email
78
- * @param {string} password
79
- * @throws {AppwriteException}
80
- * @returns {Promise<Models.User<Preferences>>}
81
- */
73
+ * 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.
74
+ * This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
75
+ *
76
+ *
77
+ * @param {string} email
78
+ * @param {string} password
79
+ * @throws {AppwriteException}
80
+ * @returns {Promise<Models.User<Preferences>>}
81
+ */
82
82
  updateEmail(email, password) {
83
83
  if (typeof email === "undefined") {
84
84
  throw new client.AppwriteException('Missing required parameter: "email"');
@@ -608,16 +608,16 @@ class Account {
608
608
  );
609
609
  }
610
610
  /**
611
- * 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.
612
-
613
- 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.
614
- *
615
- * @param {string} userId
616
- * @param {string} secret
617
- * @param {string} password
618
- * @throws {AppwriteException}
619
- * @returns {Promise<Models.Token>}
620
- */
611
+ * 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.
612
+ *
613
+ * 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.
614
+ *
615
+ * @param {string} userId
616
+ * @param {string} secret
617
+ * @param {string} password
618
+ * @throws {AppwriteException}
619
+ * @returns {Promise<Models.Token>}
620
+ */
621
621
  updateRecovery(userId, secret, password) {
622
622
  if (typeof userId === "undefined") {
623
623
  throw new client.AppwriteException('Missing required parameter: "userId"');
@@ -709,15 +709,15 @@ class Account {
709
709
  );
710
710
  }
711
711
  /**
712
- * 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.
713
-
714
- 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).
715
- *
716
- * @param {string} email
717
- * @param {string} password
718
- * @throws {AppwriteException}
719
- * @returns {Promise<Models.Session>}
720
- */
712
+ * 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.
713
+ *
714
+ * 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).
715
+ *
716
+ * @param {string} email
717
+ * @param {string} password
718
+ * @throws {AppwriteException}
719
+ * @returns {Promise<Models.Session>}
720
+ */
721
721
  createEmailPasswordSession(email, password) {
722
722
  if (typeof email === "undefined") {
723
723
  throw new client.AppwriteException('Missing required parameter: "email"');
@@ -937,16 +937,16 @@ class Account {
937
937
  );
938
938
  }
939
939
  /**
940
- * 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.
941
-
942
- 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).
943
- *
944
- * @param {string} userId
945
- * @param {string} email
946
- * @param {boolean} phrase
947
- * @throws {AppwriteException}
948
- * @returns {Promise<Models.Token>}
949
- */
940
+ * 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.
941
+ *
942
+ * 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).
943
+ *
944
+ * @param {string} userId
945
+ * @param {string} email
946
+ * @param {boolean} phrase
947
+ * @throws {AppwriteException}
948
+ * @returns {Promise<Models.Token>}
949
+ */
950
950
  createEmailToken(userId, email, phrase) {
951
951
  if (typeof userId === "undefined") {
952
952
  throw new client.AppwriteException('Missing required parameter: "userId"');
@@ -977,18 +977,18 @@ class Account {
977
977
  );
978
978
  }
979
979
  /**
980
- * 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.
981
-
982
- 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).
983
-
984
- *
985
- * @param {string} userId
986
- * @param {string} email
987
- * @param {string} url
988
- * @param {boolean} phrase
989
- * @throws {AppwriteException}
990
- * @returns {Promise<Models.Token>}
991
- */
980
+ * 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.
981
+ *
982
+ * 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).
983
+ *
984
+ *
985
+ * @param {string} userId
986
+ * @param {string} email
987
+ * @param {string} url
988
+ * @param {boolean} phrase
989
+ * @throws {AppwriteException}
990
+ * @returns {Promise<Models.Token>}
991
+ */
992
992
  createMagicURLToken(userId, email, url, phrase) {
993
993
  if (typeof userId === "undefined") {
994
994
  throw new client.AppwriteException('Missing required parameter: "userId"');
@@ -1022,19 +1022,19 @@ class Account {
1022
1022
  );
1023
1023
  }
1024
1024
  /**
1025
- * 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.
1026
-
1027
- 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.
1028
-
1029
- 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).
1030
- *
1031
- * @param {OAuthProvider} provider
1032
- * @param {string} success
1033
- * @param {string} failure
1034
- * @param {string[]} scopes
1035
- * @throws {AppwriteException}
1036
- * @returns {Promise<string>}
1037
- */
1025
+ * 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.
1026
+ *
1027
+ * 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.
1028
+ *
1029
+ * 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).
1030
+ *
1031
+ * @param {OAuthProvider} provider
1032
+ * @param {string} success
1033
+ * @param {string} failure
1034
+ * @param {string[]} scopes
1035
+ * @throws {AppwriteException}
1036
+ * @returns {Promise<string>}
1037
+ */
1038
1038
  createOAuth2Token(provider, success, failure, scopes) {
1039
1039
  if (typeof provider === "undefined") {
1040
1040
  throw new client.AppwriteException('Missing required parameter: "provider"');
@@ -1060,15 +1060,15 @@ class Account {
1060
1060
  );
1061
1061
  }
1062
1062
  /**
1063
- * 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.
1064
-
1065
- 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).
1066
- *
1067
- * @param {string} userId
1068
- * @param {string} phone
1069
- * @throws {AppwriteException}
1070
- * @returns {Promise<Models.Token>}
1071
- */
1063
+ * 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.
1064
+ *
1065
+ * 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).
1066
+ *
1067
+ * @param {string} userId
1068
+ * @param {string} phone
1069
+ * @throws {AppwriteException}
1070
+ * @returns {Promise<Models.Token>}
1071
+ */
1072
1072
  createPhoneToken(userId, phone) {
1073
1073
  if (typeof userId === "undefined") {
1074
1074
  throw new client.AppwriteException('Missing required parameter: "userId"');
@@ -1096,15 +1096,15 @@ class Account {
1096
1096
  );
1097
1097
  }
1098
1098
  /**
1099
- * 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.
1100
-
1101
- 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.
1102
-
1103
- *
1104
- * @param {string} url
1105
- * @throws {AppwriteException}
1106
- * @returns {Promise<Models.Token>}
1107
- */
1099
+ * 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.
1100
+ *
1101
+ * 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.
1102
+ *
1103
+ *
1104
+ * @param {string} url
1105
+ * @throws {AppwriteException}
1106
+ * @returns {Promise<Models.Token>}
1107
+ */
1108
1108
  createVerification(url) {
1109
1109
  if (typeof url === "undefined") {
1110
1110
  throw new client.AppwriteException('Missing required parameter: "url"');