@appwrite.io/console 7.0.0 → 8.1.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 (150) hide show
  1. package/.github/workflows/publish.yml +1 -1
  2. package/CHANGELOG.md +30 -6
  3. package/README.md +2 -2
  4. package/dist/cjs/sdk.js +222 -303
  5. package/docs/examples/databases/create-index.md +2 -2
  6. package/docs/examples/domains/create-purchase.md +2 -1
  7. package/docs/examples/domains/create-transfer-in.md +2 -1
  8. package/docs/examples/domains/update-auto-renewal.md +16 -0
  9. package/docs/examples/project/create-variable.md +1 -0
  10. package/docs/examples/project/list-variables.md +4 -1
  11. package/docs/examples/project/update-variable.md +1 -1
  12. package/docs/examples/tablesdb/create-index.md +2 -2
  13. package/docs/examples/users/update-impersonator.md +16 -0
  14. package/package.json +7 -7
  15. package/rollup.config.js +2 -1
  16. package/src/client.ts +61 -1
  17. package/src/enums/appwrite-migration-resource.ts +2 -0
  18. package/src/enums/backup-services.ts +3 -0
  19. package/src/enums/build-runtime.ts +0 -86
  20. package/src/enums/database-type.ts +2 -0
  21. package/src/enums/databases-index-type.ts +6 -0
  22. package/src/enums/runtime.ts +0 -86
  23. package/src/enums/runtimes.ts +0 -86
  24. package/src/enums/scopes.ts +13 -2
  25. package/src/enums/{index-type.ts → tables-db-index-type.ts} +1 -1
  26. package/src/enums/template-reference-type.ts +1 -1
  27. package/src/enums/use-cases.ts +7 -2
  28. package/src/index.ts +2 -1
  29. package/src/models.ts +172 -4
  30. package/src/services/databases.ts +10 -10
  31. package/src/services/domains.ts +103 -26
  32. package/src/services/project.ts +76 -33
  33. package/src/services/tables-db.ts +10 -10
  34. package/src/services/users.ts +67 -2
  35. package/src/services/vcs.ts +10 -10
  36. package/dist/cjs/sdk.js.map +0 -1
  37. package/dist/esm/sdk.js +0 -29782
  38. package/dist/esm/sdk.js.map +0 -1
  39. package/dist/iife/sdk.js +0 -33583
  40. package/types/channel.d.ts +0 -74
  41. package/types/client.d.ts +0 -260
  42. package/types/enums/adapter.d.ts +0 -4
  43. package/types/enums/api-service.d.ts +0 -15
  44. package/types/enums/api.d.ts +0 -5
  45. package/types/enums/appwrite-migration-resource.d.ts +0 -25
  46. package/types/enums/attribute-status.d.ts +0 -7
  47. package/types/enums/auth-method.d.ts +0 -9
  48. package/types/enums/authentication-factor.d.ts +0 -6
  49. package/types/enums/authenticator-type.d.ts +0 -3
  50. package/types/enums/backup-services.d.ts +0 -5
  51. package/types/enums/billing-plan-group.d.ts +0 -5
  52. package/types/enums/browser-permission.d.ts +0 -22
  53. package/types/enums/browser.d.ts +0 -16
  54. package/types/enums/build-runtime.d.ts +0 -174
  55. package/types/enums/column-status.d.ts +0 -7
  56. package/types/enums/compression.d.ts +0 -5
  57. package/types/enums/console-resource-type.d.ts +0 -3
  58. package/types/enums/credit-card.d.ts +0 -19
  59. package/types/enums/database-type.d.ts +0 -4
  60. package/types/enums/deployment-download-type.d.ts +0 -4
  61. package/types/enums/deployment-status.d.ts +0 -8
  62. package/types/enums/domain-purchase-status.d.ts +0 -6
  63. package/types/enums/domain-transfer-status-enum.d.ts +0 -10
  64. package/types/enums/email-template-locale.d.ts +0 -133
  65. package/types/enums/email-template-type.d.ts +0 -9
  66. package/types/enums/execution-method.d.ts +0 -9
  67. package/types/enums/execution-status.d.ts +0 -7
  68. package/types/enums/execution-trigger.d.ts +0 -5
  69. package/types/enums/filter-type.d.ts +0 -4
  70. package/types/enums/firebase-migration-resource.d.ts +0 -12
  71. package/types/enums/flag.d.ts +0 -197
  72. package/types/enums/framework.d.ts +0 -17
  73. package/types/enums/frameworks.d.ts +0 -17
  74. package/types/enums/health-antivirus-status.d.ts +0 -5
  75. package/types/enums/health-check-status.d.ts +0 -4
  76. package/types/enums/image-format.d.ts +0 -9
  77. package/types/enums/image-gravity.d.ts +0 -11
  78. package/types/enums/index-status.d.ts +0 -7
  79. package/types/enums/index-type.d.ts +0 -6
  80. package/types/enums/message-priority.d.ts +0 -4
  81. package/types/enums/message-status.d.ts +0 -7
  82. package/types/enums/messaging-provider-type.d.ts +0 -5
  83. package/types/enums/n-host-migration-resource.d.ts +0 -13
  84. package/types/enums/name.d.ts +0 -15
  85. package/types/enums/o-auth-provider.d.ts +0 -41
  86. package/types/enums/order-by.d.ts +0 -4
  87. package/types/enums/password-hash.d.ts +0 -13
  88. package/types/enums/platform-type.d.ts +0 -17
  89. package/types/enums/platform.d.ts +0 -4
  90. package/types/enums/project-usage-range.d.ts +0 -4
  91. package/types/enums/proxy-resource-type.d.ts +0 -4
  92. package/types/enums/proxy-rule-deployment-resource-type.d.ts +0 -4
  93. package/types/enums/proxy-rule-status.d.ts +0 -6
  94. package/types/enums/region.d.ts +0 -8
  95. package/types/enums/registration-type.d.ts +0 -6
  96. package/types/enums/relation-mutate.d.ts +0 -5
  97. package/types/enums/relationship-type.d.ts +0 -6
  98. package/types/enums/resource-type.d.ts +0 -6
  99. package/types/enums/runtime.d.ts +0 -174
  100. package/types/enums/runtimes.d.ts +0 -174
  101. package/types/enums/scopes.d.ts +0 -70
  102. package/types/enums/sms-template-locale.d.ts +0 -133
  103. package/types/enums/sms-template-type.d.ts +0 -6
  104. package/types/enums/smtp-encryption.d.ts +0 -5
  105. package/types/enums/smtp-secure.d.ts +0 -4
  106. package/types/enums/status-code.d.ts +0 -6
  107. package/types/enums/status.d.ts +0 -3
  108. package/types/enums/supabase-migration-resource.d.ts +0 -13
  109. package/types/enums/template-reference-type.d.ts +0 -5
  110. package/types/enums/theme.d.ts +0 -4
  111. package/types/enums/timezone.d.ts +0 -421
  112. package/types/enums/usage-range.d.ts +0 -5
  113. package/types/enums/use-cases.d.ts +0 -11
  114. package/types/enums/vcs-detection-type.d.ts +0 -4
  115. package/types/enums/vcs-reference-type.d.ts +0 -5
  116. package/types/id.d.ts +0 -20
  117. package/types/index.d.ts +0 -117
  118. package/types/models.d.ts +0 -9071
  119. package/types/operator.d.ts +0 -180
  120. package/types/permission.d.ts +0 -43
  121. package/types/query.d.ts +0 -442
  122. package/types/role.d.ts +0 -70
  123. package/types/service.d.ts +0 -11
  124. package/types/services/account.d.ts +0 -1536
  125. package/types/services/activities.d.ts +0 -46
  126. package/types/services/assistant.d.ts +0 -24
  127. package/types/services/avatars.d.ts +0 -320
  128. package/types/services/backups.d.ts +0 -277
  129. package/types/services/console.d.ts +0 -248
  130. package/types/services/databases.d.ts +0 -2435
  131. package/types/services/domains.d.ts +0 -1499
  132. package/types/services/functions.d.ts +0 -842
  133. package/types/services/graphql.d.ts +0 -43
  134. package/types/services/health.d.ts +0 -475
  135. package/types/services/locale.d.ts +0 -64
  136. package/types/services/messaging.d.ts +0 -1989
  137. package/types/services/migrations.d.ts +0 -417
  138. package/types/services/organizations.d.ts +0 -1009
  139. package/types/services/project.d.ts +0 -130
  140. package/types/services/projects.d.ts +0 -1626
  141. package/types/services/proxy.d.ts +0 -190
  142. package/types/services/realtime.d.ts +0 -134
  143. package/types/services/sites.d.ts +0 -800
  144. package/types/services/storage.d.ts +0 -467
  145. package/types/services/tables-db.d.ts +0 -2352
  146. package/types/services/teams.d.ts +0 -366
  147. package/types/services/tokens.d.ts +0 -119
  148. package/types/services/users.d.ts +0 -1184
  149. package/types/services/vcs.d.ts +0 -252
  150. package/types/services/webhooks.d.ts +0 -165
@@ -1,1536 +0,0 @@
1
- import { Client } from '../client';
2
- import type { Models } from '../models';
3
- import { Scopes } from '../enums/scopes';
4
- import { AuthenticatorType } from '../enums/authenticator-type';
5
- import { AuthenticationFactor } from '../enums/authentication-factor';
6
- import { OAuthProvider } from '../enums/o-auth-provider';
7
- export declare class Account {
8
- client: Client;
9
- constructor(client: Client);
10
- /**
11
- * Get the currently logged in user.
12
- *
13
- * @throws {AppwriteException}
14
- * @returns {Promise<Models.User<Preferences>>}
15
- */
16
- get<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Models.User<Preferences>>;
17
- /**
18
- * 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).
19
- *
20
- * @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
21
- * @param {string} params.email - User email.
22
- * @param {string} params.password - New user password. Must be between 8 and 256 chars.
23
- * @param {string} params.name - User name. Max length: 128 chars.
24
- * @throws {AppwriteException}
25
- * @returns {Promise<Models.User<Preferences>>}
26
- */
27
- create<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
28
- userId: string;
29
- email: string;
30
- password: string;
31
- name?: string;
32
- }): Promise<Models.User<Preferences>>;
33
- /**
34
- * 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).
35
- *
36
- * @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
37
- * @param {string} email - User email.
38
- * @param {string} password - New user password. Must be between 8 and 256 chars.
39
- * @param {string} name - User name. Max length: 128 chars.
40
- * @throws {AppwriteException}
41
- * @returns {Promise<Models.User<Preferences>>}
42
- * @deprecated Use the object parameter style method for a better developer experience.
43
- */
44
- create<Preferences extends Models.Preferences = Models.DefaultPreferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>>;
45
- /**
46
- * Delete the currently logged in user.
47
- *
48
- * @throws {AppwriteException}
49
- * @returns {Promise<{}>}
50
- */
51
- delete(): Promise<{}>;
52
- /**
53
- * List all billing addresses for a user.
54
- *
55
- * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed
56
- * @throws {AppwriteException}
57
- * @returns {Promise<Models.BillingAddressList>}
58
- */
59
- listBillingAddresses(params?: {
60
- queries?: string[];
61
- }): Promise<Models.BillingAddressList>;
62
- /**
63
- * List all billing addresses for a user.
64
- *
65
- * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed
66
- * @throws {AppwriteException}
67
- * @returns {Promise<Models.BillingAddressList>}
68
- * @deprecated Use the object parameter style method for a better developer experience.
69
- */
70
- listBillingAddresses(queries?: string[]): Promise<Models.BillingAddressList>;
71
- /**
72
- * Add a new billing address to a user's account.
73
- *
74
- * @param {string} params.country - Country
75
- * @param {string} params.city - City
76
- * @param {string} params.streetAddress - Street address
77
- * @param {string} params.addressLine2 - Address line 2
78
- * @param {string} params.state - State or province
79
- * @param {string} params.postalCode - Postal code
80
- * @throws {AppwriteException}
81
- * @returns {Promise<Models.BillingAddress>}
82
- */
83
- createBillingAddress(params: {
84
- country: string;
85
- city: string;
86
- streetAddress: string;
87
- addressLine2?: string;
88
- state?: string;
89
- postalCode?: string;
90
- }): Promise<Models.BillingAddress>;
91
- /**
92
- * Add a new billing address to a user's account.
93
- *
94
- * @param {string} country - Country
95
- * @param {string} city - City
96
- * @param {string} streetAddress - Street address
97
- * @param {string} addressLine2 - Address line 2
98
- * @param {string} state - State or province
99
- * @param {string} postalCode - Postal code
100
- * @throws {AppwriteException}
101
- * @returns {Promise<Models.BillingAddress>}
102
- * @deprecated Use the object parameter style method for a better developer experience.
103
- */
104
- createBillingAddress(country: string, city: string, streetAddress: string, addressLine2?: string, state?: string, postalCode?: string): Promise<Models.BillingAddress>;
105
- /**
106
- * Get a specific billing address for a user using it's ID.
107
- *
108
- * @param {string} params.billingAddressId - Unique ID of billing address
109
- * @throws {AppwriteException}
110
- * @returns {Promise<Models.BillingAddress>}
111
- */
112
- getBillingAddress(params: {
113
- billingAddressId: string;
114
- }): Promise<Models.BillingAddress>;
115
- /**
116
- * Get a specific billing address for a user using it's ID.
117
- *
118
- * @param {string} billingAddressId - Unique ID of billing address
119
- * @throws {AppwriteException}
120
- * @returns {Promise<Models.BillingAddress>}
121
- * @deprecated Use the object parameter style method for a better developer experience.
122
- */
123
- getBillingAddress(billingAddressId: string): Promise<Models.BillingAddress>;
124
- /**
125
- * Update a specific billing address using it's ID.
126
- *
127
- * @param {string} params.billingAddressId - Unique ID of billing address
128
- * @param {string} params.country - Country
129
- * @param {string} params.city - City
130
- * @param {string} params.streetAddress - Street address
131
- * @param {string} params.addressLine2 - Address line 2
132
- * @param {string} params.state - State or province
133
- * @param {string} params.postalCode - Postal code
134
- * @throws {AppwriteException}
135
- * @returns {Promise<Models.BillingAddress>}
136
- */
137
- updateBillingAddress(params: {
138
- billingAddressId: string;
139
- country: string;
140
- city: string;
141
- streetAddress: string;
142
- addressLine2?: string;
143
- state?: string;
144
- postalCode?: string;
145
- }): Promise<Models.BillingAddress>;
146
- /**
147
- * Update a specific billing address using it's ID.
148
- *
149
- * @param {string} billingAddressId - Unique ID of billing address
150
- * @param {string} country - Country
151
- * @param {string} city - City
152
- * @param {string} streetAddress - Street address
153
- * @param {string} addressLine2 - Address line 2
154
- * @param {string} state - State or province
155
- * @param {string} postalCode - Postal code
156
- * @throws {AppwriteException}
157
- * @returns {Promise<Models.BillingAddress>}
158
- * @deprecated Use the object parameter style method for a better developer experience.
159
- */
160
- updateBillingAddress(billingAddressId: string, country: string, city: string, streetAddress: string, addressLine2?: string, state?: string, postalCode?: string): Promise<Models.BillingAddress>;
161
- /**
162
- * Delete a specific billing address using it's ID.
163
- *
164
- * @param {string} params.billingAddressId - Billing address unique ID
165
- * @throws {AppwriteException}
166
- * @returns {Promise<{}>}
167
- */
168
- deleteBillingAddress(params: {
169
- billingAddressId: string;
170
- }): Promise<{}>;
171
- /**
172
- * Delete a specific billing address using it's ID.
173
- *
174
- * @param {string} billingAddressId - Billing address unique ID
175
- * @throws {AppwriteException}
176
- * @returns {Promise<{}>}
177
- * @deprecated Use the object parameter style method for a better developer experience.
178
- */
179
- deleteBillingAddress(billingAddressId: string): Promise<{}>;
180
- /**
181
- * Get coupon details for an account.
182
- *
183
- * @param {string} params.couponId - ID of the coupon
184
- * @throws {AppwriteException}
185
- * @returns {Promise<Models.Coupon>}
186
- */
187
- getCoupon(params: {
188
- couponId: string;
189
- }): Promise<Models.Coupon>;
190
- /**
191
- * Get coupon details for an account.
192
- *
193
- * @param {string} couponId - ID of the coupon
194
- * @throws {AppwriteException}
195
- * @returns {Promise<Models.Coupon>}
196
- * @deprecated Use the object parameter style method for a better developer experience.
197
- */
198
- getCoupon(couponId: string): Promise<Models.Coupon>;
199
- /**
200
- * 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.
201
- * This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
202
- *
203
- *
204
- * @param {string} params.email - User email.
205
- * @param {string} params.password - User password. Must be at least 8 chars.
206
- * @throws {AppwriteException}
207
- * @returns {Promise<Models.User<Preferences>>}
208
- */
209
- updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
210
- email: string;
211
- password: string;
212
- }): Promise<Models.User<Preferences>>;
213
- /**
214
- * 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.
215
- * This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
216
- *
217
- *
218
- * @param {string} email - User email.
219
- * @param {string} password - User password. Must be at least 8 chars.
220
- * @throws {AppwriteException}
221
- * @returns {Promise<Models.User<Preferences>>}
222
- * @deprecated Use the object parameter style method for a better developer experience.
223
- */
224
- updateEmail<Preferences extends Models.Preferences = Models.DefaultPreferences>(email: string, password: string): Promise<Models.User<Preferences>>;
225
- /**
226
- * Get the list of identities for the currently logged in user.
227
- *
228
- * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry
229
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
230
- * @throws {AppwriteException}
231
- * @returns {Promise<Models.IdentityList>}
232
- */
233
- listIdentities(params?: {
234
- queries?: string[];
235
- total?: boolean;
236
- }): Promise<Models.IdentityList>;
237
- /**
238
- * Get the list of identities for the currently logged in user.
239
- *
240
- * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry
241
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
242
- * @throws {AppwriteException}
243
- * @returns {Promise<Models.IdentityList>}
244
- * @deprecated Use the object parameter style method for a better developer experience.
245
- */
246
- listIdentities(queries?: string[], total?: boolean): Promise<Models.IdentityList>;
247
- /**
248
- * Delete an identity by its unique ID.
249
- *
250
- * @param {string} params.identityId - Identity ID.
251
- * @throws {AppwriteException}
252
- * @returns {Promise<{}>}
253
- */
254
- deleteIdentity(params: {
255
- identityId: string;
256
- }): Promise<{}>;
257
- /**
258
- * Delete an identity by its unique ID.
259
- *
260
- * @param {string} identityId - Identity ID.
261
- * @throws {AppwriteException}
262
- * @returns {Promise<{}>}
263
- * @deprecated Use the object parameter style method for a better developer experience.
264
- */
265
- deleteIdentity(identityId: string): Promise<{}>;
266
- /**
267
- * List all invoices tied to an account.
268
- *
269
- * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, type, amount, currency, from, to, dueAt, attempts, status, grossAmount
270
- * @throws {AppwriteException}
271
- * @returns {Promise<Models.InvoiceList>}
272
- */
273
- listInvoices(params?: {
274
- queries?: string[];
275
- }): Promise<Models.InvoiceList>;
276
- /**
277
- * List all invoices tied to an account.
278
- *
279
- * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: teamId, aggregationId, type, amount, currency, from, to, dueAt, attempts, status, grossAmount
280
- * @throws {AppwriteException}
281
- * @returns {Promise<Models.InvoiceList>}
282
- * @deprecated Use the object parameter style method for a better developer experience.
283
- */
284
- listInvoices(queries?: string[]): Promise<Models.InvoiceList>;
285
- /**
286
- * 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.
287
- *
288
- * @param {number} params.duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
289
- * @throws {AppwriteException}
290
- * @returns {Promise<Models.Jwt>}
291
- */
292
- createJWT(params?: {
293
- duration?: number;
294
- }): Promise<Models.Jwt>;
295
- /**
296
- * 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.
297
- *
298
- * @param {number} duration - Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
299
- * @throws {AppwriteException}
300
- * @returns {Promise<Models.Jwt>}
301
- * @deprecated Use the object parameter style method for a better developer experience.
302
- */
303
- createJWT(duration?: number): Promise<Models.Jwt>;
304
- /**
305
- * Get a list of all API keys from the current account.
306
- *
307
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
308
- * @throws {AppwriteException}
309
- * @returns {Promise<Models.KeyList>}
310
- */
311
- listKeys(params?: {
312
- total?: boolean;
313
- }): Promise<Models.KeyList>;
314
- /**
315
- * Get a list of all API keys from the current account.
316
- *
317
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
318
- * @throws {AppwriteException}
319
- * @returns {Promise<Models.KeyList>}
320
- * @deprecated Use the object parameter style method for a better developer experience.
321
- */
322
- listKeys(total?: boolean): Promise<Models.KeyList>;
323
- /**
324
- * Create a new account API key.
325
- *
326
- * @param {string} params.name - Key name. Max length: 128 chars.
327
- * @param {Scopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed.
328
- * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
329
- * @throws {AppwriteException}
330
- * @returns {Promise<Models.Key>}
331
- */
332
- createKey(params: {
333
- name: string;
334
- scopes: Scopes[];
335
- expire?: string;
336
- }): Promise<Models.Key>;
337
- /**
338
- * Create a new account API key.
339
- *
340
- * @param {string} name - Key name. Max length: 128 chars.
341
- * @param {Scopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed.
342
- * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
343
- * @throws {AppwriteException}
344
- * @returns {Promise<Models.Key>}
345
- * @deprecated Use the object parameter style method for a better developer experience.
346
- */
347
- createKey(name: string, scopes: Scopes[], expire?: string): Promise<Models.Key>;
348
- /**
349
- * Get a key by its unique ID. This endpoint returns details about a specific API key in your account including it's scopes.
350
- *
351
- * @param {string} params.keyId - Key unique ID.
352
- * @throws {AppwriteException}
353
- * @returns {Promise<Models.Key>}
354
- */
355
- getKey(params: {
356
- keyId: string;
357
- }): Promise<Models.Key>;
358
- /**
359
- * Get a key by its unique ID. This endpoint returns details about a specific API key in your account including it's scopes.
360
- *
361
- * @param {string} keyId - Key unique ID.
362
- * @throws {AppwriteException}
363
- * @returns {Promise<Models.Key>}
364
- * @deprecated Use the object parameter style method for a better developer experience.
365
- */
366
- getKey(keyId: string): Promise<Models.Key>;
367
- /**
368
- * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.
369
- *
370
- * @param {string} params.keyId - Key unique ID.
371
- * @param {string} params.name - Key name. Max length: 128 chars.
372
- * @param {Scopes[]} params.scopes - Key scopes list. Maximum of 100 scopes are allowed.
373
- * @param {string} params.expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
374
- * @throws {AppwriteException}
375
- * @returns {Promise<Models.Key>}
376
- */
377
- updateKey(params: {
378
- keyId: string;
379
- name: string;
380
- scopes: Scopes[];
381
- expire?: string;
382
- }): Promise<Models.Key>;
383
- /**
384
- * Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key.
385
- *
386
- * @param {string} keyId - Key unique ID.
387
- * @param {string} name - Key name. Max length: 128 chars.
388
- * @param {Scopes[]} scopes - Key scopes list. Maximum of 100 scopes are allowed.
389
- * @param {string} expire - Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
390
- * @throws {AppwriteException}
391
- * @returns {Promise<Models.Key>}
392
- * @deprecated Use the object parameter style method for a better developer experience.
393
- */
394
- updateKey(keyId: string, name: string, scopes: Scopes[], expire?: string): Promise<Models.Key>;
395
- /**
396
- * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.
397
- *
398
- * @param {string} params.keyId - Key unique ID.
399
- * @throws {AppwriteException}
400
- * @returns {Promise<{}>}
401
- */
402
- deleteKey(params: {
403
- keyId: string;
404
- }): Promise<{}>;
405
- /**
406
- * Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls.
407
- *
408
- * @param {string} keyId - Key unique ID.
409
- * @throws {AppwriteException}
410
- * @returns {Promise<{}>}
411
- * @deprecated Use the object parameter style method for a better developer experience.
412
- */
413
- deleteKey(keyId: string): Promise<{}>;
414
- /**
415
- * 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.
416
- *
417
- * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
418
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
419
- * @throws {AppwriteException}
420
- * @returns {Promise<Models.LogList>}
421
- */
422
- listLogs(params?: {
423
- queries?: string[];
424
- total?: boolean;
425
- }): Promise<Models.LogList>;
426
- /**
427
- * 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.
428
- *
429
- * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset
430
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
431
- * @throws {AppwriteException}
432
- * @returns {Promise<Models.LogList>}
433
- * @deprecated Use the object parameter style method for a better developer experience.
434
- */
435
- listLogs(queries?: string[], total?: boolean): Promise<Models.LogList>;
436
- /**
437
- * Enable or disable MFA on an account.
438
- *
439
- * @param {boolean} params.mfa - Enable or disable MFA.
440
- * @throws {AppwriteException}
441
- * @returns {Promise<Models.User<Preferences>>}
442
- */
443
- updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
444
- mfa: boolean;
445
- }): Promise<Models.User<Preferences>>;
446
- /**
447
- * Enable or disable MFA on an account.
448
- *
449
- * @param {boolean} mfa - Enable or disable MFA.
450
- * @throws {AppwriteException}
451
- * @returns {Promise<Models.User<Preferences>>}
452
- * @deprecated Use the object parameter style method for a better developer experience.
453
- */
454
- updateMFA<Preferences extends Models.Preferences = Models.DefaultPreferences>(mfa: boolean): Promise<Models.User<Preferences>>;
455
- /**
456
- * 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.
457
- *
458
- * @param {AuthenticatorType} params.type - Type of authenticator. Must be `totp`
459
- * @throws {AppwriteException}
460
- * @returns {Promise<Models.MfaType>}
461
- * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createMFAAuthenticator` instead.
462
- */
463
- createMfaAuthenticator(params: {
464
- type: AuthenticatorType;
465
- }): Promise<Models.MfaType>;
466
- /**
467
- * 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.
468
- *
469
- * @param {AuthenticatorType} type - Type of authenticator. Must be `totp`
470
- * @throws {AppwriteException}
471
- * @returns {Promise<Models.MfaType>}
472
- * @deprecated Use the object parameter style method for a better developer experience.
473
- */
474
- createMfaAuthenticator(type: AuthenticatorType): Promise<Models.MfaType>;
475
- /**
476
- * 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.
477
- *
478
- * @param {AuthenticatorType} params.type - Type of authenticator. Must be `totp`
479
- * @throws {AppwriteException}
480
- * @returns {Promise<Models.MfaType>}
481
- */
482
- createMFAAuthenticator(params: {
483
- type: AuthenticatorType;
484
- }): Promise<Models.MfaType>;
485
- /**
486
- * 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.
487
- *
488
- * @param {AuthenticatorType} type - Type of authenticator. Must be `totp`
489
- * @throws {AppwriteException}
490
- * @returns {Promise<Models.MfaType>}
491
- * @deprecated Use the object parameter style method for a better developer experience.
492
- */
493
- createMFAAuthenticator(type: AuthenticatorType): Promise<Models.MfaType>;
494
- /**
495
- * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.
496
- *
497
- * @param {AuthenticatorType} params.type - Type of authenticator.
498
- * @param {string} params.otp - Valid verification token.
499
- * @throws {AppwriteException}
500
- * @returns {Promise<Models.User<Preferences>>}
501
- * @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateMFAAuthenticator` instead.
502
- */
503
- updateMfaAuthenticator<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
504
- type: AuthenticatorType;
505
- otp: string;
506
- }): Promise<Models.User<Preferences>>;
507
- /**
508
- * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.
509
- *
510
- * @param {AuthenticatorType} type - Type of authenticator.
511
- * @param {string} otp - Valid verification token.
512
- * @throws {AppwriteException}
513
- * @returns {Promise<Models.User<Preferences>>}
514
- * @deprecated Use the object parameter style method for a better developer experience.
515
- */
516
- updateMfaAuthenticator<Preferences extends Models.Preferences = Models.DefaultPreferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
517
- /**
518
- * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.
519
- *
520
- * @param {AuthenticatorType} params.type - Type of authenticator.
521
- * @param {string} params.otp - Valid verification token.
522
- * @throws {AppwriteException}
523
- * @returns {Promise<Models.User<Preferences>>}
524
- */
525
- updateMFAAuthenticator<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
526
- type: AuthenticatorType;
527
- otp: string;
528
- }): Promise<Models.User<Preferences>>;
529
- /**
530
- * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.
531
- *
532
- * @param {AuthenticatorType} type - Type of authenticator.
533
- * @param {string} otp - Valid verification token.
534
- * @throws {AppwriteException}
535
- * @returns {Promise<Models.User<Preferences>>}
536
- * @deprecated Use the object parameter style method for a better developer experience.
537
- */
538
- updateMFAAuthenticator<Preferences extends Models.Preferences = Models.DefaultPreferences>(type: AuthenticatorType, otp: string): Promise<Models.User<Preferences>>;
539
- /**
540
- * Delete an authenticator for a user by ID.
541
- *
542
- * @param {AuthenticatorType} params.type - Type of authenticator.
543
- * @throws {AppwriteException}
544
- * @returns {Promise<{}>}
545
- * @deprecated This API has been deprecated since 1.8.0. Please use `Account.deleteMFAAuthenticator` instead.
546
- */
547
- deleteMfaAuthenticator(params: {
548
- type: AuthenticatorType;
549
- }): Promise<{}>;
550
- /**
551
- * Delete an authenticator for a user by ID.
552
- *
553
- * @param {AuthenticatorType} type - Type of authenticator.
554
- * @throws {AppwriteException}
555
- * @returns {Promise<{}>}
556
- * @deprecated Use the object parameter style method for a better developer experience.
557
- */
558
- deleteMfaAuthenticator(type: AuthenticatorType): Promise<{}>;
559
- /**
560
- * Delete an authenticator for a user by ID.
561
- *
562
- * @param {AuthenticatorType} params.type - Type of authenticator.
563
- * @throws {AppwriteException}
564
- * @returns {Promise<{}>}
565
- */
566
- deleteMFAAuthenticator(params: {
567
- type: AuthenticatorType;
568
- }): Promise<{}>;
569
- /**
570
- * Delete an authenticator for a user by ID.
571
- *
572
- * @param {AuthenticatorType} type - Type of authenticator.
573
- * @throws {AppwriteException}
574
- * @returns {Promise<{}>}
575
- * @deprecated Use the object parameter style method for a better developer experience.
576
- */
577
- deleteMFAAuthenticator(type: AuthenticatorType): Promise<{}>;
578
- /**
579
- * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
580
- *
581
- * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.
582
- * @throws {AppwriteException}
583
- * @returns {Promise<Models.MfaChallenge>}
584
- * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createMFAChallenge` instead.
585
- */
586
- createMfaChallenge(params: {
587
- factor: AuthenticationFactor;
588
- }): Promise<Models.MfaChallenge>;
589
- /**
590
- * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
591
- *
592
- * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.
593
- * @throws {AppwriteException}
594
- * @returns {Promise<Models.MfaChallenge>}
595
- * @deprecated Use the object parameter style method for a better developer experience.
596
- */
597
- createMfaChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge>;
598
- /**
599
- * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
600
- *
601
- * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.
602
- * @throws {AppwriteException}
603
- * @returns {Promise<Models.MfaChallenge>}
604
- */
605
- createMFAChallenge(params: {
606
- factor: AuthenticationFactor;
607
- }): Promise<Models.MfaChallenge>;
608
- /**
609
- * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
610
- *
611
- * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.
612
- * @throws {AppwriteException}
613
- * @returns {Promise<Models.MfaChallenge>}
614
- * @deprecated Use the object parameter style method for a better developer experience.
615
- */
616
- createMFAChallenge(factor: AuthenticationFactor): Promise<Models.MfaChallenge>;
617
- /**
618
- * 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.
619
- *
620
- * @param {string} params.challengeId - ID of the challenge.
621
- * @param {string} params.otp - Valid verification token.
622
- * @throws {AppwriteException}
623
- * @returns {Promise<Models.Session>}
624
- * @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateMFAChallenge` instead.
625
- */
626
- updateMfaChallenge(params: {
627
- challengeId: string;
628
- otp: string;
629
- }): Promise<Models.Session>;
630
- /**
631
- * 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.
632
- *
633
- * @param {string} challengeId - ID of the challenge.
634
- * @param {string} otp - Valid verification token.
635
- * @throws {AppwriteException}
636
- * @returns {Promise<Models.Session>}
637
- * @deprecated Use the object parameter style method for a better developer experience.
638
- */
639
- updateMfaChallenge(challengeId: string, otp: string): Promise<Models.Session>;
640
- /**
641
- * 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.
642
- *
643
- * @param {string} params.challengeId - ID of the challenge.
644
- * @param {string} params.otp - Valid verification token.
645
- * @throws {AppwriteException}
646
- * @returns {Promise<Models.Session>}
647
- */
648
- updateMFAChallenge(params: {
649
- challengeId: string;
650
- otp: string;
651
- }): Promise<Models.Session>;
652
- /**
653
- * 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.
654
- *
655
- * @param {string} challengeId - ID of the challenge.
656
- * @param {string} otp - Valid verification token.
657
- * @throws {AppwriteException}
658
- * @returns {Promise<Models.Session>}
659
- * @deprecated Use the object parameter style method for a better developer experience.
660
- */
661
- updateMFAChallenge(challengeId: string, otp: string): Promise<Models.Session>;
662
- /**
663
- * List the factors available on the account to be used as a MFA challange.
664
- *
665
- * @throws {AppwriteException}
666
- * @returns {Promise<Models.MfaFactors>}
667
- * @deprecated This API has been deprecated since 1.8.0. Please use `Account.listMFAFactors` instead.
668
- */
669
- listMfaFactors(): Promise<Models.MfaFactors>;
670
- /**
671
- * List the factors available on the account to be used as a MFA challange.
672
- *
673
- * @throws {AppwriteException}
674
- * @returns {Promise<Models.MfaFactors>}
675
- */
676
- listMFAFactors(): Promise<Models.MfaFactors>;
677
- /**
678
- * 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.
679
- *
680
- * @throws {AppwriteException}
681
- * @returns {Promise<Models.MfaRecoveryCodes>}
682
- * @deprecated This API has been deprecated since 1.8.0. Please use `Account.getMFARecoveryCodes` instead.
683
- */
684
- getMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
685
- /**
686
- * 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.
687
- *
688
- * @throws {AppwriteException}
689
- * @returns {Promise<Models.MfaRecoveryCodes>}
690
- */
691
- getMFARecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
692
- /**
693
- * Generate recovery codes as backup for MFA flow. It'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.
694
- *
695
- * @throws {AppwriteException}
696
- * @returns {Promise<Models.MfaRecoveryCodes>}
697
- * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createMFARecoveryCodes` instead.
698
- */
699
- createMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
700
- /**
701
- * Generate recovery codes as backup for MFA flow. It'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.
702
- *
703
- * @throws {AppwriteException}
704
- * @returns {Promise<Models.MfaRecoveryCodes>}
705
- */
706
- createMFARecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
707
- /**
708
- * 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.
709
- *
710
- * @throws {AppwriteException}
711
- * @returns {Promise<Models.MfaRecoveryCodes>}
712
- * @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateMFARecoveryCodes` instead.
713
- */
714
- updateMfaRecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
715
- /**
716
- * 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.
717
- *
718
- * @throws {AppwriteException}
719
- * @returns {Promise<Models.MfaRecoveryCodes>}
720
- */
721
- updateMFARecoveryCodes(): Promise<Models.MfaRecoveryCodes>;
722
- /**
723
- * Update currently logged in user account name.
724
- *
725
- * @param {string} params.name - User name. Max length: 128 chars.
726
- * @throws {AppwriteException}
727
- * @returns {Promise<Models.User<Preferences>>}
728
- */
729
- updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
730
- name: string;
731
- }): Promise<Models.User<Preferences>>;
732
- /**
733
- * Update currently logged in user account name.
734
- *
735
- * @param {string} name - User name. Max length: 128 chars.
736
- * @throws {AppwriteException}
737
- * @returns {Promise<Models.User<Preferences>>}
738
- * @deprecated Use the object parameter style method for a better developer experience.
739
- */
740
- updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(name: string): Promise<Models.User<Preferences>>;
741
- /**
742
- * 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.
743
- *
744
- * @param {string} params.password - New user password. Must be at least 8 chars.
745
- * @param {string} params.oldPassword - Current user password. Must be at least 8 chars.
746
- * @throws {AppwriteException}
747
- * @returns {Promise<Models.User<Preferences>>}
748
- */
749
- updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
750
- password: string;
751
- oldPassword?: string;
752
- }): Promise<Models.User<Preferences>>;
753
- /**
754
- * 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.
755
- *
756
- * @param {string} password - New user password. Must be at least 8 chars.
757
- * @param {string} oldPassword - Current user password. Must be at least 8 chars.
758
- * @throws {AppwriteException}
759
- * @returns {Promise<Models.User<Preferences>>}
760
- * @deprecated Use the object parameter style method for a better developer experience.
761
- */
762
- updatePassword<Preferences extends Models.Preferences = Models.DefaultPreferences>(password: string, oldPassword?: string): Promise<Models.User<Preferences>>;
763
- /**
764
- * List payment methods for this account.
765
- *
766
- * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed
767
- * @throws {AppwriteException}
768
- * @returns {Promise<Models.PaymentMethodList>}
769
- */
770
- listPaymentMethods(params?: {
771
- queries?: string[];
772
- }): Promise<Models.PaymentMethodList>;
773
- /**
774
- * List payment methods for this account.
775
- *
776
- * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, expired, failed
777
- * @throws {AppwriteException}
778
- * @returns {Promise<Models.PaymentMethodList>}
779
- * @deprecated Use the object parameter style method for a better developer experience.
780
- */
781
- listPaymentMethods(queries?: string[]): Promise<Models.PaymentMethodList>;
782
- /**
783
- * Create a new payment method for the current user account.
784
- *
785
- * @throws {AppwriteException}
786
- * @returns {Promise<Models.PaymentMethod>}
787
- */
788
- createPaymentMethod(): Promise<Models.PaymentMethod>;
789
- /**
790
- * Get a specific payment method for the user.
791
- *
792
- * @param {string} params.paymentMethodId - Unique ID of payment method
793
- * @throws {AppwriteException}
794
- * @returns {Promise<Models.PaymentMethod>}
795
- */
796
- getPaymentMethod(params: {
797
- paymentMethodId: string;
798
- }): Promise<Models.PaymentMethod>;
799
- /**
800
- * Get a specific payment method for the user.
801
- *
802
- * @param {string} paymentMethodId - Unique ID of payment method
803
- * @throws {AppwriteException}
804
- * @returns {Promise<Models.PaymentMethod>}
805
- * @deprecated Use the object parameter style method for a better developer experience.
806
- */
807
- getPaymentMethod(paymentMethodId: string): Promise<Models.PaymentMethod>;
808
- /**
809
- * Update a new payment method for the current user account.
810
- *
811
- * @param {string} params.paymentMethodId - Unique ID of payment method
812
- * @param {number} params.expiryMonth - Payment expiry month
813
- * @param {number} params.expiryYear - Expiry year
814
- * @param {string} params.state - State of the payment method country
815
- * @throws {AppwriteException}
816
- * @returns {Promise<Models.PaymentMethod>}
817
- */
818
- updatePaymentMethod(params: {
819
- paymentMethodId: string;
820
- expiryMonth: number;
821
- expiryYear: number;
822
- state?: string;
823
- }): Promise<Models.PaymentMethod>;
824
- /**
825
- * Update a new payment method for the current user account.
826
- *
827
- * @param {string} paymentMethodId - Unique ID of payment method
828
- * @param {number} expiryMonth - Payment expiry month
829
- * @param {number} expiryYear - Expiry year
830
- * @param {string} state - State of the payment method country
831
- * @throws {AppwriteException}
832
- * @returns {Promise<Models.PaymentMethod>}
833
- * @deprecated Use the object parameter style method for a better developer experience.
834
- */
835
- updatePaymentMethod(paymentMethodId: string, expiryMonth: number, expiryYear: number, state?: string): Promise<Models.PaymentMethod>;
836
- /**
837
- * Delete a specific payment method from a user's account.
838
- *
839
- * @param {string} params.paymentMethodId - Unique ID of payment method
840
- * @throws {AppwriteException}
841
- * @returns {Promise<{}>}
842
- */
843
- deletePaymentMethod(params: {
844
- paymentMethodId: string;
845
- }): Promise<{}>;
846
- /**
847
- * Delete a specific payment method from a user's account.
848
- *
849
- * @param {string} paymentMethodId - Unique ID of payment method
850
- * @throws {AppwriteException}
851
- * @returns {Promise<{}>}
852
- * @deprecated Use the object parameter style method for a better developer experience.
853
- */
854
- deletePaymentMethod(paymentMethodId: string): Promise<{}>;
855
- /**
856
- * Update payment method provider.
857
- *
858
- * @param {string} params.paymentMethodId - Unique ID of payment method
859
- * @param {string} params.providerMethodId - Payment method ID from the payment provider
860
- * @param {string} params.name - Name in the payment method
861
- * @param {string} params.state - State of the payment method country
862
- * @throws {AppwriteException}
863
- * @returns {Promise<Models.PaymentMethod>}
864
- */
865
- updatePaymentMethodProvider(params: {
866
- paymentMethodId: string;
867
- providerMethodId: string;
868
- name: string;
869
- state?: string;
870
- }): Promise<Models.PaymentMethod>;
871
- /**
872
- * Update payment method provider.
873
- *
874
- * @param {string} paymentMethodId - Unique ID of payment method
875
- * @param {string} providerMethodId - Payment method ID from the payment provider
876
- * @param {string} name - Name in the payment method
877
- * @param {string} state - State of the payment method country
878
- * @throws {AppwriteException}
879
- * @returns {Promise<Models.PaymentMethod>}
880
- * @deprecated Use the object parameter style method for a better developer experience.
881
- */
882
- updatePaymentMethodProvider(paymentMethodId: string, providerMethodId: string, name: string, state?: string): Promise<Models.PaymentMethod>;
883
- /**
884
- * Update payment method mandate options.
885
- *
886
- * @param {string} params.paymentMethodId - Unique ID of payment method
887
- * @throws {AppwriteException}
888
- * @returns {Promise<Models.PaymentMethod>}
889
- */
890
- updatePaymentMethodMandateOptions(params: {
891
- paymentMethodId: string;
892
- }): Promise<Models.PaymentMethod>;
893
- /**
894
- * Update payment method mandate options.
895
- *
896
- * @param {string} paymentMethodId - Unique ID of payment method
897
- * @throws {AppwriteException}
898
- * @returns {Promise<Models.PaymentMethod>}
899
- * @deprecated Use the object parameter style method for a better developer experience.
900
- */
901
- updatePaymentMethodMandateOptions(paymentMethodId: string): Promise<Models.PaymentMethod>;
902
- /**
903
- * Update the currently logged in user'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.
904
- *
905
- * @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
906
- * @param {string} params.password - User password. Must be at least 8 chars.
907
- * @throws {AppwriteException}
908
- * @returns {Promise<Models.User<Preferences>>}
909
- */
910
- updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
911
- phone: string;
912
- password: string;
913
- }): Promise<Models.User<Preferences>>;
914
- /**
915
- * Update the currently logged in user'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.
916
- *
917
- * @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
918
- * @param {string} password - User password. Must be at least 8 chars.
919
- * @throws {AppwriteException}
920
- * @returns {Promise<Models.User<Preferences>>}
921
- * @deprecated Use the object parameter style method for a better developer experience.
922
- */
923
- updatePhone<Preferences extends Models.Preferences = Models.DefaultPreferences>(phone: string, password: string): Promise<Models.User<Preferences>>;
924
- /**
925
- * Get the preferences as a key-value object for the currently logged in user.
926
- *
927
- * @throws {AppwriteException}
928
- * @returns {Promise<Preferences>}
929
- */
930
- getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Preferences>;
931
- /**
932
- * 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.
933
- *
934
- * @param {Partial<Preferences>} params.prefs - Prefs key-value JSON object.
935
- * @throws {AppwriteException}
936
- * @returns {Promise<Models.User<Preferences>>}
937
- */
938
- updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
939
- prefs: Partial<Preferences>;
940
- }): Promise<Models.User<Preferences>>;
941
- /**
942
- * 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.
943
- *
944
- * @param {Partial<Preferences>} prefs - Prefs key-value JSON object.
945
- * @throws {AppwriteException}
946
- * @returns {Promise<Models.User<Preferences>>}
947
- * @deprecated Use the object parameter style method for a better developer experience.
948
- */
949
- updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(prefs: Partial<Preferences>): Promise<Models.User<Preferences>>;
950
- /**
951
- * 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's email address is valid for 1 hour.
952
- *
953
- * @param {string} params.email - User email.
954
- * @param {string} params.url - URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
955
- * @throws {AppwriteException}
956
- * @returns {Promise<Models.Token>}
957
- */
958
- createRecovery(params: {
959
- email: string;
960
- url: string;
961
- }): Promise<Models.Token>;
962
- /**
963
- * 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's email address is valid for 1 hour.
964
- *
965
- * @param {string} email - User email.
966
- * @param {string} url - URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
967
- * @throws {AppwriteException}
968
- * @returns {Promise<Models.Token>}
969
- * @deprecated Use the object parameter style method for a better developer experience.
970
- */
971
- createRecovery(email: string, url: string): Promise<Models.Token>;
972
- /**
973
- * 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.
974
- *
975
- * 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.
976
- *
977
- * @param {string} params.userId - User ID.
978
- * @param {string} params.secret - Valid reset token.
979
- * @param {string} params.password - New user password. Must be between 8 and 256 chars.
980
- * @throws {AppwriteException}
981
- * @returns {Promise<Models.Token>}
982
- */
983
- updateRecovery(params: {
984
- userId: string;
985
- secret: string;
986
- password: string;
987
- }): Promise<Models.Token>;
988
- /**
989
- * 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.
990
- *
991
- * 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.
992
- *
993
- * @param {string} userId - User ID.
994
- * @param {string} secret - Valid reset token.
995
- * @param {string} password - New user password. Must be between 8 and 256 chars.
996
- * @throws {AppwriteException}
997
- * @returns {Promise<Models.Token>}
998
- * @deprecated Use the object parameter style method for a better developer experience.
999
- */
1000
- updateRecovery(userId: string, secret: string, password: string): Promise<Models.Token>;
1001
- /**
1002
- * Get the list of active sessions across different devices for the currently logged in user.
1003
- *
1004
- * @throws {AppwriteException}
1005
- * @returns {Promise<Models.SessionList>}
1006
- */
1007
- listSessions(): Promise<Models.SessionList>;
1008
- /**
1009
- * Delete all sessions from the user account and remove any sessions cookies from the end client.
1010
- *
1011
- * @throws {AppwriteException}
1012
- * @returns {Promise<{}>}
1013
- */
1014
- deleteSessions(): Promise<{}>;
1015
- /**
1016
- * 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).
1017
- *
1018
- * @throws {AppwriteException}
1019
- * @returns {Promise<Models.Session>}
1020
- */
1021
- createAnonymousSession(): Promise<Models.Session>;
1022
- /**
1023
- * 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.
1024
- *
1025
- * 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).
1026
- *
1027
- * @param {string} params.email - User email.
1028
- * @param {string} params.password - User password. Must be at least 8 chars.
1029
- * @throws {AppwriteException}
1030
- * @returns {Promise<Models.Session>}
1031
- */
1032
- createEmailPasswordSession(params: {
1033
- email: string;
1034
- password: string;
1035
- }): Promise<Models.Session>;
1036
- /**
1037
- * 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.
1038
- *
1039
- * 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).
1040
- *
1041
- * @param {string} email - User email.
1042
- * @param {string} password - User password. Must be at least 8 chars.
1043
- * @throws {AppwriteException}
1044
- * @returns {Promise<Models.Session>}
1045
- * @deprecated Use the object parameter style method for a better developer experience.
1046
- */
1047
- createEmailPasswordSession(email: string, password: string): Promise<Models.Session>;
1048
- /**
1049
- * 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.
1050
- *
1051
- * @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1052
- * @param {string} params.secret - Valid verification token.
1053
- * @throws {AppwriteException}
1054
- * @returns {Promise<Models.Session>}
1055
- * @deprecated This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.
1056
- */
1057
- updateMagicURLSession(params: {
1058
- userId: string;
1059
- secret: string;
1060
- }): Promise<Models.Session>;
1061
- /**
1062
- * 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.
1063
- *
1064
- * @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1065
- * @param {string} secret - Valid verification token.
1066
- * @throws {AppwriteException}
1067
- * @returns {Promise<Models.Session>}
1068
- * @deprecated Use the object parameter style method for a better developer experience.
1069
- */
1070
- updateMagicURLSession(userId: string, secret: string): Promise<Models.Session>;
1071
- /**
1072
- * 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's back to your app when login is completed.
1073
- *
1074
- * 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.
1075
- *
1076
- * 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).
1077
- *
1078
- *
1079
- * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
1080
- * @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1081
- * @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1082
- * @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
1083
- * @throws {AppwriteException}
1084
- * @returns {void | string}
1085
- */
1086
- createOAuth2Session(params: {
1087
- provider: OAuthProvider;
1088
- success?: string;
1089
- failure?: string;
1090
- scopes?: string[];
1091
- }): void | string;
1092
- /**
1093
- * 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's back to your app when login is completed.
1094
- *
1095
- * 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.
1096
- *
1097
- * 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).
1098
- *
1099
- *
1100
- * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
1101
- * @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1102
- * @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1103
- * @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
1104
- * @throws {AppwriteException}
1105
- * @returns {void | string}
1106
- * @deprecated Use the object parameter style method for a better developer experience.
1107
- */
1108
- createOAuth2Session(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | string;
1109
- /**
1110
- * 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.
1111
- *
1112
- * @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1113
- * @param {string} params.secret - Valid verification token.
1114
- * @throws {AppwriteException}
1115
- * @returns {Promise<Models.Session>}
1116
- * @deprecated This API has been deprecated since 1.6.0. Please use `Account.createSession` instead.
1117
- */
1118
- updatePhoneSession(params: {
1119
- userId: string;
1120
- secret: string;
1121
- }): Promise<Models.Session>;
1122
- /**
1123
- * 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.
1124
- *
1125
- * @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1126
- * @param {string} secret - Valid verification token.
1127
- * @throws {AppwriteException}
1128
- * @returns {Promise<Models.Session>}
1129
- * @deprecated Use the object parameter style method for a better developer experience.
1130
- */
1131
- updatePhoneSession(userId: string, secret: string): Promise<Models.Session>;
1132
- /**
1133
- * 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.
1134
- *
1135
- * @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1136
- * @param {string} params.secret - Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.
1137
- * @throws {AppwriteException}
1138
- * @returns {Promise<Models.Session>}
1139
- */
1140
- createSession(params: {
1141
- userId: string;
1142
- secret: string;
1143
- }): Promise<Models.Session>;
1144
- /**
1145
- * 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.
1146
- *
1147
- * @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1148
- * @param {string} secret - Secret of a token generated by login methods. For example, the `createMagicURLToken` or `createPhoneToken` methods.
1149
- * @throws {AppwriteException}
1150
- * @returns {Promise<Models.Session>}
1151
- * @deprecated Use the object parameter style method for a better developer experience.
1152
- */
1153
- createSession(userId: string, secret: string): Promise<Models.Session>;
1154
- /**
1155
- * Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.
1156
- *
1157
- * @param {string} params.sessionId - Session ID. Use the string 'current' to get the current device session.
1158
- * @throws {AppwriteException}
1159
- * @returns {Promise<Models.Session>}
1160
- */
1161
- getSession(params: {
1162
- sessionId: string;
1163
- }): Promise<Models.Session>;
1164
- /**
1165
- * Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.
1166
- *
1167
- * @param {string} sessionId - Session ID. Use the string 'current' to get the current device session.
1168
- * @throws {AppwriteException}
1169
- * @returns {Promise<Models.Session>}
1170
- * @deprecated Use the object parameter style method for a better developer experience.
1171
- */
1172
- getSession(sessionId: string): Promise<Models.Session>;
1173
- /**
1174
- * Use this endpoint to extend a session'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.
1175
- *
1176
- * @param {string} params.sessionId - Session ID. Use the string 'current' to update the current device session.
1177
- * @throws {AppwriteException}
1178
- * @returns {Promise<Models.Session>}
1179
- */
1180
- updateSession(params: {
1181
- sessionId: string;
1182
- }): Promise<Models.Session>;
1183
- /**
1184
- * Use this endpoint to extend a session'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.
1185
- *
1186
- * @param {string} sessionId - Session ID. Use the string 'current' to update the current device session.
1187
- * @throws {AppwriteException}
1188
- * @returns {Promise<Models.Session>}
1189
- * @deprecated Use the object parameter style method for a better developer experience.
1190
- */
1191
- updateSession(sessionId: string): Promise<Models.Session>;
1192
- /**
1193
- * Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead.
1194
- *
1195
- * @param {string} params.sessionId - Session ID. Use the string 'current' to delete the current device session.
1196
- * @throws {AppwriteException}
1197
- * @returns {Promise<{}>}
1198
- */
1199
- deleteSession(params: {
1200
- sessionId: string;
1201
- }): Promise<{}>;
1202
- /**
1203
- * Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appwrite.io/docs/references/cloud/client-web/account#deleteSessions) instead.
1204
- *
1205
- * @param {string} sessionId - Session ID. Use the string 'current' to delete the current device session.
1206
- * @throws {AppwriteException}
1207
- * @returns {Promise<{}>}
1208
- * @deprecated Use the object parameter style method for a better developer experience.
1209
- */
1210
- deleteSession(sessionId: string): Promise<{}>;
1211
- /**
1212
- * 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.
1213
- *
1214
- * @throws {AppwriteException}
1215
- * @returns {Promise<Models.User<Preferences>>}
1216
- */
1217
- updateStatus<Preferences extends Models.Preferences = Models.DefaultPreferences>(): Promise<Models.User<Preferences>>;
1218
- /**
1219
- * 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.
1220
- *
1221
- * @param {string} params.targetId - Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1222
- * @param {string} params.identifier - The target identifier (token, email, phone etc.)
1223
- * @param {string} params.providerId - Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.
1224
- * @throws {AppwriteException}
1225
- * @returns {Promise<Models.Target>}
1226
- */
1227
- createPushTarget(params: {
1228
- targetId: string;
1229
- identifier: string;
1230
- providerId?: string;
1231
- }): Promise<Models.Target>;
1232
- /**
1233
- * 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.
1234
- *
1235
- * @param {string} targetId - Target ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1236
- * @param {string} identifier - The target identifier (token, email, phone etc.)
1237
- * @param {string} providerId - Provider ID. Message will be sent to this target from the specified provider ID. If no provider ID is set the first setup provider will be used.
1238
- * @throws {AppwriteException}
1239
- * @returns {Promise<Models.Target>}
1240
- * @deprecated Use the object parameter style method for a better developer experience.
1241
- */
1242
- createPushTarget(targetId: string, identifier: string, providerId?: string): Promise<Models.Target>;
1243
- /**
1244
- * Update the currently logged in user's push notification target. You can modify the target'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.
1245
- *
1246
- * @param {string} params.targetId - Target ID.
1247
- * @param {string} params.identifier - The target identifier (token, email, phone etc.)
1248
- * @throws {AppwriteException}
1249
- * @returns {Promise<Models.Target>}
1250
- */
1251
- updatePushTarget(params: {
1252
- targetId: string;
1253
- identifier: string;
1254
- }): Promise<Models.Target>;
1255
- /**
1256
- * Update the currently logged in user's push notification target. You can modify the target'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.
1257
- *
1258
- * @param {string} targetId - Target ID.
1259
- * @param {string} identifier - The target identifier (token, email, phone etc.)
1260
- * @throws {AppwriteException}
1261
- * @returns {Promise<Models.Target>}
1262
- * @deprecated Use the object parameter style method for a better developer experience.
1263
- */
1264
- updatePushTarget(targetId: string, identifier: string): Promise<Models.Target>;
1265
- /**
1266
- * 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.
1267
- *
1268
- * @param {string} params.targetId - Target ID.
1269
- * @throws {AppwriteException}
1270
- * @returns {Promise<{}>}
1271
- */
1272
- deletePushTarget(params: {
1273
- targetId: string;
1274
- }): Promise<{}>;
1275
- /**
1276
- * 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.
1277
- *
1278
- * @param {string} targetId - Target ID.
1279
- * @throws {AppwriteException}
1280
- * @returns {Promise<{}>}
1281
- * @deprecated Use the object parameter style method for a better developer experience.
1282
- */
1283
- deletePushTarget(targetId: string): Promise<{}>;
1284
- /**
1285
- * Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. 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's email is valid for 15 minutes.
1286
- *
1287
- * 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).
1288
- *
1289
- *
1290
- * @param {string} params.userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
1291
- * @param {string} params.email - User email.
1292
- * @param {boolean} params.phrase - Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
1293
- * @throws {AppwriteException}
1294
- * @returns {Promise<Models.Token>}
1295
- */
1296
- createEmailToken(params: {
1297
- userId: string;
1298
- email: string;
1299
- phrase?: boolean;
1300
- }): Promise<Models.Token>;
1301
- /**
1302
- * Sends the user an email with a secret key for creating a session. If the email address has never been used, a **new account is created** using the provided `userId`. Otherwise, if the email address is already attached to an account, the **user ID is ignored**. Then, the user will receive an email with the one-time password. 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's email is valid for 15 minutes.
1303
- *
1304
- * 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).
1305
- *
1306
- *
1307
- * @param {string} userId - User ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
1308
- * @param {string} email - User email.
1309
- * @param {boolean} phrase - Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
1310
- * @throws {AppwriteException}
1311
- * @returns {Promise<Models.Token>}
1312
- * @deprecated Use the object parameter style method for a better developer experience.
1313
- */
1314
- createEmailToken(userId: string, email: string, phrase?: boolean): Promise<Models.Token>;
1315
- /**
1316
- * 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's email address is valid for 1 hour.
1317
- *
1318
- * 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).
1319
- *
1320
- *
1321
- * @param {string} params.userId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
1322
- * @param {string} params.email - User email.
1323
- * @param {string} params.url - URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1324
- * @param {boolean} params.phrase - Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
1325
- * @throws {AppwriteException}
1326
- * @returns {Promise<Models.Token>}
1327
- */
1328
- createMagicURLToken(params: {
1329
- userId: string;
1330
- email: string;
1331
- url?: string;
1332
- phrase?: boolean;
1333
- }): Promise<Models.Token>;
1334
- /**
1335
- * 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's email address is valid for 1 hour.
1336
- *
1337
- * 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).
1338
- *
1339
- *
1340
- * @param {string} userId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the email address has never been used, a new account is created using the provided userId. Otherwise, if the email address is already attached to an account, the user ID is ignored.
1341
- * @param {string} email - User email.
1342
- * @param {string} url - URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1343
- * @param {boolean} phrase - Toggle for security phrase. If enabled, email will be send with a randomly generated phrase and the phrase will also be included in the response. Confirming phrases match increases the security of your authentication flow.
1344
- * @throws {AppwriteException}
1345
- * @returns {Promise<Models.Token>}
1346
- * @deprecated Use the object parameter style method for a better developer experience.
1347
- */
1348
- createMagicURLToken(userId: string, email: string, url?: string, phrase?: boolean): Promise<Models.Token>;
1349
- /**
1350
- * 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's back to your app when login is completed.
1351
- *
1352
- * 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.
1353
- *
1354
- * 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).
1355
- *
1356
- * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
1357
- * @param {string} params.success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1358
- * @param {string} params.failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1359
- * @param {string[]} params.scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
1360
- * @throws {AppwriteException}
1361
- * @returns {void | string}
1362
- */
1363
- createOAuth2Token(params: {
1364
- provider: OAuthProvider;
1365
- success?: string;
1366
- failure?: string;
1367
- scopes?: string[];
1368
- }): void | string;
1369
- /**
1370
- * 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's back to your app when login is completed.
1371
- *
1372
- * 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.
1373
- *
1374
- * 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).
1375
- *
1376
- * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, github, gitlab, google, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoho, zoom.
1377
- * @param {string} success - URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1378
- * @param {string} failure - URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project's platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1379
- * @param {string[]} scopes - A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
1380
- * @throws {AppwriteException}
1381
- * @returns {void | string}
1382
- * @deprecated Use the object parameter style method for a better developer experience.
1383
- */
1384
- createOAuth2Token(provider: OAuthProvider, success?: string, failure?: string, scopes?: string[]): void | string;
1385
- /**
1386
- * 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's phone is valid for 15 minutes.
1387
- *
1388
- * 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).
1389
- *
1390
- * @param {string} params.userId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.
1391
- * @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
1392
- * @throws {AppwriteException}
1393
- * @returns {Promise<Models.Token>}
1394
- */
1395
- createPhoneToken(params: {
1396
- userId: string;
1397
- phone: string;
1398
- }): Promise<Models.Token>;
1399
- /**
1400
- * 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's phone is valid for 15 minutes.
1401
- *
1402
- * 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).
1403
- *
1404
- * @param {string} userId - Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars. If the phone number has never been used, a new account is created using the provided userId. Otherwise, if the phone number is already attached to an account, the user ID is ignored.
1405
- * @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
1406
- * @throws {AppwriteException}
1407
- * @returns {Promise<Models.Token>}
1408
- * @deprecated Use the object parameter style method for a better developer experience.
1409
- */
1410
- createPhoneToken(userId: string, phone: string): Promise<Models.Token>;
1411
- /**
1412
- * 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's email address is valid for 7 days.
1413
- *
1414
- * 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.
1415
- *
1416
- *
1417
- * @param {string} params.url - URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1418
- * @throws {AppwriteException}
1419
- * @returns {Promise<Models.Token>}
1420
- */
1421
- createEmailVerification(params: {
1422
- url: string;
1423
- }): Promise<Models.Token>;
1424
- /**
1425
- * 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's email address is valid for 7 days.
1426
- *
1427
- * 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.
1428
- *
1429
- *
1430
- * @param {string} url - URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1431
- * @throws {AppwriteException}
1432
- * @returns {Promise<Models.Token>}
1433
- * @deprecated Use the object parameter style method for a better developer experience.
1434
- */
1435
- createEmailVerification(url: string): Promise<Models.Token>;
1436
- /**
1437
- * 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's email address is valid for 7 days.
1438
- *
1439
- * 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.
1440
- *
1441
- *
1442
- * @param {string} params.url - URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1443
- * @throws {AppwriteException}
1444
- * @returns {Promise<Models.Token>}
1445
- * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createEmailVerification` instead.
1446
- */
1447
- createVerification(params: {
1448
- url: string;
1449
- }): Promise<Models.Token>;
1450
- /**
1451
- * 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's email address is valid for 7 days.
1452
- *
1453
- * 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.
1454
- *
1455
- *
1456
- * @param {string} url - URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
1457
- * @throws {AppwriteException}
1458
- * @returns {Promise<Models.Token>}
1459
- * @deprecated Use the object parameter style method for a better developer experience.
1460
- */
1461
- createVerification(url: string): Promise<Models.Token>;
1462
- /**
1463
- * 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.
1464
- *
1465
- * @param {string} params.userId - User ID.
1466
- * @param {string} params.secret - Valid verification token.
1467
- * @throws {AppwriteException}
1468
- * @returns {Promise<Models.Token>}
1469
- */
1470
- updateEmailVerification(params: {
1471
- userId: string;
1472
- secret: string;
1473
- }): Promise<Models.Token>;
1474
- /**
1475
- * 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.
1476
- *
1477
- * @param {string} userId - User ID.
1478
- * @param {string} secret - Valid verification token.
1479
- * @throws {AppwriteException}
1480
- * @returns {Promise<Models.Token>}
1481
- * @deprecated Use the object parameter style method for a better developer experience.
1482
- */
1483
- updateEmailVerification(userId: string, secret: string): Promise<Models.Token>;
1484
- /**
1485
- * 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.
1486
- *
1487
- * @param {string} params.userId - User ID.
1488
- * @param {string} params.secret - Valid verification token.
1489
- * @throws {AppwriteException}
1490
- * @returns {Promise<Models.Token>}
1491
- * @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateEmailVerification` instead.
1492
- */
1493
- updateVerification(params: {
1494
- userId: string;
1495
- secret: string;
1496
- }): Promise<Models.Token>;
1497
- /**
1498
- * 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.
1499
- *
1500
- * @param {string} userId - User ID.
1501
- * @param {string} secret - Valid verification token.
1502
- * @throws {AppwriteException}
1503
- * @returns {Promise<Models.Token>}
1504
- * @deprecated Use the object parameter style method for a better developer experience.
1505
- */
1506
- updateVerification(userId: string, secret: string): Promise<Models.Token>;
1507
- /**
1508
- * Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user'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's phone number is valid for 15 minutes.
1509
- *
1510
- * @throws {AppwriteException}
1511
- * @returns {Promise<Models.Token>}
1512
- */
1513
- createPhoneVerification(): Promise<Models.Token>;
1514
- /**
1515
- * Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.
1516
- *
1517
- * @param {string} params.userId - User ID.
1518
- * @param {string} params.secret - Valid verification token.
1519
- * @throws {AppwriteException}
1520
- * @returns {Promise<Models.Token>}
1521
- */
1522
- updatePhoneVerification(params: {
1523
- userId: string;
1524
- secret: string;
1525
- }): Promise<Models.Token>;
1526
- /**
1527
- * Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.
1528
- *
1529
- * @param {string} userId - User ID.
1530
- * @param {string} secret - Valid verification token.
1531
- * @throws {AppwriteException}
1532
- * @returns {Promise<Models.Token>}
1533
- * @deprecated Use the object parameter style method for a better developer experience.
1534
- */
1535
- updatePhoneVerification(userId: string, secret: string): Promise<Models.Token>;
1536
- }