@appwrite.io/console 16.0.0 → 17.0.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 (59) hide show
  1. package/README.md +5 -6
  2. package/dist/cjs/package.json +1 -1
  3. package/dist/cjs/sdk.js +8558 -4805
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/package.json +1 -1
  6. package/dist/esm/sdk.js +8559 -4806
  7. package/dist/esm/sdk.js.map +1 -1
  8. package/dist/iife/sdk.js +8558 -4805
  9. package/package.json +59 -50
  10. package/types/client.d.ts +2 -13
  11. package/types/enums/{addon.d.ts → addon-key.d.ts} +1 -1
  12. package/types/enums/authentication-factor.d.ts +2 -1
  13. package/types/enums/billing-plan-group.d.ts +2 -1
  14. package/types/enums/build-runtime.d.ts +4 -1
  15. package/types/enums/cache-database.d.ts +1 -2
  16. package/types/enums/embedding-model.d.ts +1 -3
  17. package/types/enums/execution-resource-type.d.ts +4 -0
  18. package/types/enums/framework.d.ts +1 -0
  19. package/types/enums/id-token-provider.d.ts +4 -0
  20. package/types/enums/image-gravity.d.ts +1 -0
  21. package/types/enums/o-auth-provider.d.ts +5 -0
  22. package/types/enums/organization-key-scopes.d.ts +2 -4
  23. package/types/enums/project-email-template-id.d.ts +2 -1
  24. package/types/enums/project-key-scopes.d.ts +20 -3
  25. package/types/enums/project-o-auth-provider-id.d.ts +5 -0
  26. package/types/enums/project-policy-id.d.ts +2 -0
  27. package/types/enums/query-suggestion-resource.d.ts +2 -3
  28. package/types/enums/runtime.d.ts +4 -1
  29. package/types/enums/usage-event-dimension.d.ts +7 -1
  30. package/types/enums/usage-event-metric.d.ts +55 -0
  31. package/types/enums/usage-gauge-metric.d.ts +50 -0
  32. package/types/index.d.ts +11 -6
  33. package/types/models.d.ts +696 -776
  34. package/types/services/account.d.ts +124 -36
  35. package/types/services/apps.d.ts +6 -6
  36. package/types/services/avatars.d.ts +44 -0
  37. package/types/services/console.d.ts +2 -2
  38. package/types/services/databases.d.ts +8 -8
  39. package/types/services/documents-db.d.ts +13 -7
  40. package/types/services/domains.d.ts +82 -54
  41. package/types/services/functions.d.ts +6 -6
  42. package/types/services/manager.d.ts +14 -14
  43. package/types/services/messaging.d.ts +80 -6
  44. package/types/services/mongo.d.ts +17 -23
  45. package/types/services/mysql.d.ts +17 -23
  46. package/types/services/organization.d.ts +165 -0
  47. package/types/services/organizations.d.ts +24 -24
  48. package/types/services/postgresql.d.ts +17 -23
  49. package/types/services/project.d.ts +218 -51
  50. package/types/services/projects.d.ts +0 -94
  51. package/types/services/sites.d.ts +15 -8
  52. package/types/services/storage.d.ts +2 -2
  53. package/types/services/tables-db.d.ts +37 -12
  54. package/types/services/teams.d.ts +0 -25
  55. package/types/services/usage.d.ts +23 -14
  56. package/types/services/users.d.ts +26 -29
  57. package/types/services/vectors-db.d.ts +15 -9
  58. package/types/services/waf.d.ts +11 -2
  59. package/types/enums/project-usage-range.d.ts +0 -4
@@ -3,6 +3,7 @@ import type { Models } from '../models';
3
3
  import { AccountKeyScopes } from '../enums/account-key-scopes';
4
4
  import { AuthenticatorType } from '../enums/authenticator-type';
5
5
  import { AuthenticationFactor } from '../enums/authentication-factor';
6
+ import { IdTokenProvider } from '../enums/id-token-provider';
6
7
  import { OAuthProvider } from '../enums/o-auth-provider';
7
8
  export declare class Account {
8
9
  client: Client;
@@ -540,28 +541,6 @@ export declare class Account {
540
541
  * @deprecated Use the object parameter style method for a better developer experience.
541
542
  */
542
543
  deleteKey(keyId: string): Promise<{}>;
543
- /**
544
- * 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.
545
- *
546
- * @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
547
- * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
548
- * @throws {AppwriteException}
549
- * @returns {Promise<Models.LogList>}
550
- */
551
- listLogs(params?: {
552
- queries?: string[];
553
- total?: boolean;
554
- }): Promise<Models.LogList>;
555
- /**
556
- * 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.
557
- *
558
- * @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
559
- * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
560
- * @throws {AppwriteException}
561
- * @returns {Promise<Models.LogList>}
562
- * @deprecated Use the object parameter style method for a better developer experience.
563
- */
564
- listLogs(queries?: string[], total?: boolean): Promise<Models.LogList>;
565
544
  /**
566
545
  * Enable or disable MFA on an account.
567
546
  *
@@ -707,7 +686,7 @@ export declare class Account {
707
686
  /**
708
687
  * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
709
688
  *
710
- * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.
689
+ * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`.
711
690
  * @throws {AppwriteException}
712
691
  * @returns {Promise<Models.MfaChallenge>}
713
692
  * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createMFAChallenge` instead.
@@ -718,7 +697,7 @@ export declare class Account {
718
697
  /**
719
698
  * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
720
699
  *
721
- * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.
700
+ * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`.
722
701
  * @throws {AppwriteException}
723
702
  * @returns {Promise<Models.MfaChallenge>}
724
703
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -727,7 +706,7 @@ export declare class Account {
727
706
  /**
728
707
  * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
729
708
  *
730
- * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.
709
+ * @param {AuthenticationFactor} params.factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`.
731
710
  * @throws {AppwriteException}
732
711
  * @returns {Promise<Models.MfaChallenge>}
733
712
  */
@@ -737,7 +716,7 @@ export declare class Account {
737
716
  /**
738
717
  * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.
739
718
  *
740
- * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`.
719
+ * @param {AuthenticationFactor} factor - Factor used for verification. Must be one of following: `email`, `phone`, `totp`, `recoveryCode`, `custom`.
741
720
  * @throws {AppwriteException}
742
721
  * @returns {Promise<Models.MfaChallenge>}
743
722
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -1174,6 +1153,62 @@ export declare class Account {
1174
1153
  * @deprecated Use the object parameter style method for a better developer experience.
1175
1154
  */
1176
1155
  createEmailPasswordSession(email: string, password: string): Promise<Models.Session>;
1156
+ /**
1157
+ * Allow the user to login to their account using an OpenID Connect ID token obtained natively from the OAuth2 provider, for example via Google Credential Manager on Android or Sign in with Apple on iOS. No browser or redirect is involved: the ID token is verified against the provider's published signing keys and a session is created in a single request.
1158
+ *
1159
+ * Native sign-in is switched on per provider with its nativeEnabled setting. It is independent of the browser-based flow's enabled setting, which has no effect on this endpoint. The token's audience must match the provider's configured client ID or one of its native client IDs; tokens issued for any other client ID are rejected. For Sign in with Apple, register your app's bundle ID as a native client ID. For Google, the web client ID used by Credential Manager is usually the configured client ID; add your Android and iOS client IDs as native client IDs if your app requests tokens for them.
1160
+ *
1161
+ * Pass the raw nonce used when requesting the ID token so it can be validated against the token's nonce claim. When signing in with Apple, the nonce is required: hash it with SHA-256 before passing it to the Apple SDK, and send the raw value here - Apple tokens requested without a nonce are rejected. For Google the nonce is optional: it is validated whenever the token carries one, and ignored when the provider issued the token without one. Apple only returns the user's name on the first authorization, and never inside the ID token - capture it on the client and pass it via the name parameter.
1162
+ *
1163
+ * 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 verified email received from the provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.
1164
+ *
1165
+ * This flow does not return provider refresh tokens. You may pass an access token the provider handed your client, along with its lifetime, to store it on the session - but Appwrite cannot renew it once it expires. If your app needs long-lived access to provider APIs, use the browser-based OAuth2 flow instead.
1166
+ *
1167
+ * 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).
1168
+ *
1169
+ *
1170
+ * @param {IdTokenProvider} params.provider - OAuth2 provider that issued the ID token. Currently, supported providers are: apple, google.
1171
+ * @param {string} params.idToken - OpenID Connect ID token (JWT) obtained natively from the provider, for example via Google Credential Manager or Sign in with Apple.
1172
+ * @param {string} params.nonce - Raw nonce used when requesting the ID token. Required for Apple, and whenever the token carries a nonce claim, which must match it. Ignored when the provider issued the token without a nonce.
1173
+ * @param {string} params.accessToken - Provider access token to store alongside the session for calling provider APIs. Never used for authentication.
1174
+ * @param {number} params.accessTokenExpiry - Seconds until the provider access token expires, as reported by the provider. Stored so clients can tell when the stored token goes stale.
1175
+ * @param {string} params.name - User name. Only used when creating a new user and the ID token has no name claim, such as on the first Sign in with Apple authorization.
1176
+ * @throws {AppwriteException}
1177
+ * @returns {Promise<Models.Session>}
1178
+ */
1179
+ createIdTokenSession(params: {
1180
+ provider: IdTokenProvider;
1181
+ idToken: string;
1182
+ nonce?: string;
1183
+ accessToken?: string;
1184
+ accessTokenExpiry?: number;
1185
+ name?: string;
1186
+ }): Promise<Models.Session>;
1187
+ /**
1188
+ * Allow the user to login to their account using an OpenID Connect ID token obtained natively from the OAuth2 provider, for example via Google Credential Manager on Android or Sign in with Apple on iOS. No browser or redirect is involved: the ID token is verified against the provider's published signing keys and a session is created in a single request.
1189
+ *
1190
+ * Native sign-in is switched on per provider with its nativeEnabled setting. It is independent of the browser-based flow's enabled setting, which has no effect on this endpoint. The token's audience must match the provider's configured client ID or one of its native client IDs; tokens issued for any other client ID are rejected. For Sign in with Apple, register your app's bundle ID as a native client ID. For Google, the web client ID used by Credential Manager is usually the configured client ID; add your Android and iOS client IDs as native client IDs if your app requests tokens for them.
1191
+ *
1192
+ * Pass the raw nonce used when requesting the ID token so it can be validated against the token's nonce claim. When signing in with Apple, the nonce is required: hash it with SHA-256 before passing it to the Apple SDK, and send the raw value here - Apple tokens requested without a nonce are rejected. For Google the nonce is optional: it is validated whenever the token carries one, and ignored when the provider issued the token without one. Apple only returns the user's name on the first authorization, and never inside the ID token - capture it on the client and pass it via the name parameter.
1193
+ *
1194
+ * 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 verified email received from the provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.
1195
+ *
1196
+ * This flow does not return provider refresh tokens. You may pass an access token the provider handed your client, along with its lifetime, to store it on the session - but Appwrite cannot renew it once it expires. If your app needs long-lived access to provider APIs, use the browser-based OAuth2 flow instead.
1197
+ *
1198
+ * 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).
1199
+ *
1200
+ *
1201
+ * @param {IdTokenProvider} provider - OAuth2 provider that issued the ID token. Currently, supported providers are: apple, google.
1202
+ * @param {string} idToken - OpenID Connect ID token (JWT) obtained natively from the provider, for example via Google Credential Manager or Sign in with Apple.
1203
+ * @param {string} nonce - Raw nonce used when requesting the ID token. Required for Apple, and whenever the token carries a nonce claim, which must match it. Ignored when the provider issued the token without a nonce.
1204
+ * @param {string} accessToken - Provider access token to store alongside the session for calling provider APIs. Never used for authentication.
1205
+ * @param {number} accessTokenExpiry - Seconds until the provider access token expires, as reported by the provider. Stored so clients can tell when the stored token goes stale.
1206
+ * @param {string} name - User name. Only used when creating a new user and the ID token has no name claim, such as on the first Sign in with Apple authorization.
1207
+ * @throws {AppwriteException}
1208
+ * @returns {Promise<Models.Session>}
1209
+ * @deprecated Use the object parameter style method for a better developer experience.
1210
+ */
1211
+ createIdTokenSession(provider: IdTokenProvider, idToken: string, nonce?: string, accessToken?: string, accessTokenExpiry?: number, name?: string): Promise<Models.Session>;
1177
1212
  /**
1178
1213
  * 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.
1179
1214
  *
@@ -1205,7 +1240,7 @@ export declare class Account {
1205
1240
  * 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).
1206
1241
  *
1207
1242
  *
1208
- * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1243
+ * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1209
1244
  * @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.
1210
1245
  * @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.
1211
1246
  * @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.
@@ -1226,7 +1261,7 @@ export declare class Account {
1226
1261
  * 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).
1227
1262
  *
1228
1263
  *
1229
- * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1264
+ * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1230
1265
  * @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.
1231
1266
  * @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.
1232
1267
  * @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.
@@ -1283,7 +1318,7 @@ export declare class Account {
1283
1318
  /**
1284
1319
  * Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.
1285
1320
  *
1286
- * @param {string} params.sessionId - Session ID. Use the string 'current' to get the current device session. Defaults to 'current'.
1321
+ * @param {string} params.sessionId - Session ID. Use the string 'current' to get the current device session.
1287
1322
  * @throws {AppwriteException}
1288
1323
  * @returns {Promise<Models.Session>}
1289
1324
  */
@@ -1293,7 +1328,7 @@ export declare class Account {
1293
1328
  /**
1294
1329
  * Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.
1295
1330
  *
1296
- * @param {string} sessionId - Session ID. Use the string 'current' to get the current device session. Defaults to 'current'.
1331
+ * @param {string} sessionId - Session ID. Use the string 'current' to get the current device session.
1297
1332
  * @throws {AppwriteException}
1298
1333
  * @returns {Promise<Models.Session>}
1299
1334
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -1302,7 +1337,7 @@ export declare class Account {
1302
1337
  /**
1303
1338
  * 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.
1304
1339
  *
1305
- * @param {string} params.sessionId - Session ID. Use the string 'current' to update the current device session. Defaults to 'current'.
1340
+ * @param {string} params.sessionId - Session ID. Use the string 'current' to update the current device session.
1306
1341
  * @throws {AppwriteException}
1307
1342
  * @returns {Promise<Models.Session>}
1308
1343
  */
@@ -1312,7 +1347,7 @@ export declare class Account {
1312
1347
  /**
1313
1348
  * 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.
1314
1349
  *
1315
- * @param {string} sessionId - Session ID. Use the string 'current' to update the current device session. Defaults to 'current'.
1350
+ * @param {string} sessionId - Session ID. Use the string 'current' to update the current device session.
1316
1351
  * @throws {AppwriteException}
1317
1352
  * @returns {Promise<Models.Session>}
1318
1353
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -1321,7 +1356,7 @@ export declare class Account {
1321
1356
  /**
1322
1357
  * 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.
1323
1358
  *
1324
- * @param {string} params.sessionId - Session ID. Use the string 'current' to delete the current device session. Defaults to 'current'.
1359
+ * @param {string} params.sessionId - Session ID. Use the string 'current' to delete the current device session.
1325
1360
  * @throws {AppwriteException}
1326
1361
  * @returns {Promise<{}>}
1327
1362
  */
@@ -1331,7 +1366,7 @@ export declare class Account {
1331
1366
  /**
1332
1367
  * 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.
1333
1368
  *
1334
- * @param {string} sessionId - Session ID. Use the string 'current' to delete the current device session. Defaults to 'current'.
1369
+ * @param {string} sessionId - Session ID. Use the string 'current' to delete the current device session.
1335
1370
  * @throws {AppwriteException}
1336
1371
  * @returns {Promise<{}>}
1337
1372
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -1480,9 +1515,11 @@ export declare class Account {
1480
1515
  *
1481
1516
  * 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.
1482
1517
  *
1518
+ * If there is already an active session, the OAuth2 identity is attached to the logged-in account and that session stays active until the token is exchanged for a new one.
1519
+ *
1483
1520
  * 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).
1484
1521
  *
1485
- * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1522
+ * @param {OAuthProvider} params.provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1486
1523
  * @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.
1487
1524
  * @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.
1488
1525
  * @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.
@@ -1500,9 +1537,11 @@ export declare class Account {
1500
1537
  *
1501
1538
  * 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.
1502
1539
  *
1540
+ * If there is already an active session, the OAuth2 identity is attached to the logged-in account and that session stays active until the token is exchanged for a new one.
1541
+ *
1503
1542
  * 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).
1504
1543
  *
1505
- * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1544
+ * @param {OAuthProvider} provider - OAuth2 Provider. Currently, supported providers are: amazon, apple, appwrite, auth0, authentik, autodesk, bitbucket, bitly, box, cloudflare, dailymotion, discord, disqus, dropbox, etsy, facebook, figma, fusionauth, github, gitlab, google, huggingface, kakao, keycloak, kick, linkedin, microsoft, notion, oidc, okta, paypal, paypalSandbox, podio, resend, salesforce, slack, spotify, stripe, tiktok, tradeshift, tradeshiftBox, twitch, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1506
1545
  * @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.
1507
1546
  * @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.
1508
1547
  * @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.
@@ -1633,6 +1672,55 @@ export declare class Account {
1633
1672
  * @deprecated Use the object parameter style method for a better developer experience.
1634
1673
  */
1635
1674
  updateVerification(userId: string, secret: string): Promise<Models.Token>;
1675
+ /**
1676
+ * Use this endpoint to send a 6-digit verification code to the currently logged in user's email address. Unlike [createEmailVerification](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerification), this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a verification page. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateEmailVerificationOTP). The code sent to the user's email address is valid for 15 minutes.
1677
+ *
1678
+ * Enable the **phrase** parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing.
1679
+ *
1680
+ *
1681
+ * @param {boolean} params.phrase - Toggle for security phrase. If enabled, email will be sent 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.
1682
+ * @throws {AppwriteException}
1683
+ * @returns {Promise<Models.Token>}
1684
+ */
1685
+ createEmailVerificationOTP(params?: {
1686
+ phrase?: boolean;
1687
+ }): Promise<Models.Token>;
1688
+ /**
1689
+ * Use this endpoint to send a 6-digit verification code to the currently logged in user's email address. Unlike [createEmailVerification](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerification), this method requires no redirect URL, which makes it suitable for mobile and desktop apps that cannot host a verification page. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateEmailVerificationOTP). The code sent to the user's email address is valid for 15 minutes.
1690
+ *
1691
+ * Enable the **phrase** parameter to include a randomly generated security phrase in both the email and the response. Showing that phrase in your app lets the user confirm the email genuinely came from your request, which helps protect against phishing.
1692
+ *
1693
+ *
1694
+ * @param {boolean} phrase - Toggle for security phrase. If enabled, email will be sent 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.
1695
+ * @throws {AppwriteException}
1696
+ * @returns {Promise<Models.Token>}
1697
+ * @deprecated Use the object parameter style method for a better developer experience.
1698
+ */
1699
+ createEmailVerificationOTP(phrase?: boolean): Promise<Models.Token>;
1700
+ /**
1701
+ * Use this endpoint to complete the user email verification process using the 6-digit code that was emailed by [createEmailVerificationOTP](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerificationOTP). Pass the **userId** of the user being verified along with the **secret** code from the email. If confirmed, this route will return a 200 status code and the code is consumed.
1702
+ *
1703
+ *
1704
+ * @param {string} params.userId - User ID.
1705
+ * @param {string} params.secret - Valid verification OTP code.
1706
+ * @throws {AppwriteException}
1707
+ * @returns {Promise<Models.Token>}
1708
+ */
1709
+ updateEmailVerificationOTP(params: {
1710
+ userId: string;
1711
+ secret: string;
1712
+ }): Promise<Models.Token>;
1713
+ /**
1714
+ * Use this endpoint to complete the user email verification process using the 6-digit code that was emailed by [createEmailVerificationOTP](https://appwrite.io/docs/references/cloud/client-web/account#createEmailVerificationOTP). Pass the **userId** of the user being verified along with the **secret** code from the email. If confirmed, this route will return a 200 status code and the code is consumed.
1715
+ *
1716
+ *
1717
+ * @param {string} userId - User ID.
1718
+ * @param {string} secret - Valid verification OTP code.
1719
+ * @throws {AppwriteException}
1720
+ * @returns {Promise<Models.Token>}
1721
+ * @deprecated Use the object parameter style method for a better developer experience.
1722
+ */
1723
+ updateEmailVerificationOTP(userId: string, secret: string): Promise<Models.Token>;
1636
1724
  /**
1637
1725
  * 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.
1638
1726
  *
@@ -115,7 +115,7 @@ export declare class Apps {
115
115
  /**
116
116
  * Get an application by its unique ID.
117
117
  *
118
- * @param {string} params.appId - Application unique ID or HTTPS client ID metadata document URL.
118
+ * @param {string} params.appId - Application unique ID.
119
119
  * @throws {AppwriteException}
120
120
  * @returns {Promise<Models.App>}
121
121
  */
@@ -125,7 +125,7 @@ export declare class Apps {
125
125
  /**
126
126
  * Get an application by its unique ID.
127
127
  *
128
- * @param {string} appId - Application unique ID or HTTPS client ID metadata document URL.
128
+ * @param {string} appId - Application unique ID.
129
129
  * @throws {AppwriteException}
130
130
  * @returns {Promise<Models.App>}
131
131
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -152,7 +152,7 @@ export declare class Apps {
152
152
  * @param {string[]} params.postLogoutRedirectUris - Post-logout redirect URIs for OpenID Connect RP-Initiated Logout. Each must be an https URL, an http loopback URL, or a private-use scheme URI, and must not contain a fragment. After ending the user session, the logout endpoint only redirects to URIs in this list.
153
153
  * @param {string} params.type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`.
154
154
  * @param {boolean} params.deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false.
155
- * @param {string[]} params.installationScopes - Scopes the application requests when installed on a team. Organization-level and project-level scopes only; use the list scopes endpoint with `type=installation` to discover available values. Maximum of 100 scopes are allowed.
155
+ * @param {string[]} params.installationScopes - Scopes the application requests when installed on a team. Only scopes allowed by the project's OAuth2 server installation scopes configuration are accepted; use the list installation scopes endpoint to discover available values. Maximum of 100 scopes are allowed.
156
156
  * @param {string} params.installationRedirectUrl - URL users are redirected to after creating or updating an installation of this application. Must be an https URL, an http loopback URL (localhost, 127.0.0.1, [::1]), or a private-use scheme URI, and must not contain a fragment. Leave empty for no redirect.
157
157
  * @throws {AppwriteException}
158
158
  * @returns {Promise<Models.App>}
@@ -200,7 +200,7 @@ export declare class Apps {
200
200
  * @param {string[]} postLogoutRedirectUris - Post-logout redirect URIs for OpenID Connect RP-Initiated Logout. Each must be an https URL, an http loopback URL, or a private-use scheme URI, and must not contain a fragment. After ending the user session, the logout endpoint only redirects to URIs in this list.
201
201
  * @param {string} type - OAuth2 client type. Use `public` for SPAs, mobile, and native apps that cannot keep a `client_secret` — PKCE is then required at the token endpoint. Use `confidential` for server-side clients that present a `client_secret`. Defaults to `confidential`.
202
202
  * @param {boolean} deviceFlow - Allow this client to use the OAuth2 Device Authorization Grant (RFC 8628) for input-constrained devices such as TVs and CLIs. Defaults to false.
203
- * @param {string[]} installationScopes - Scopes the application requests when installed on a team. Organization-level and project-level scopes only; use the list scopes endpoint with `type=installation` to discover available values. Maximum of 100 scopes are allowed.
203
+ * @param {string[]} installationScopes - Scopes the application requests when installed on a team. Only scopes allowed by the project's OAuth2 server installation scopes configuration are accepted; use the list installation scopes endpoint to discover available values. Maximum of 100 scopes are allowed.
204
204
  * @param {string} installationRedirectUrl - URL users are redirected to after creating or updating an installation of this application. Must be an https URL, an http loopback URL (localhost, 127.0.0.1, [::1]), or a private-use scheme URI, and must not contain a fragment. Leave empty for no redirect.
205
205
  * @throws {AppwriteException}
206
206
  * @returns {Promise<Models.App>}
@@ -409,7 +409,7 @@ export declare class Apps {
409
409
  * Update the labels of an application. Labels are read-only for clients; only a server SDK using a project API key can set them. Replaces the previous labels.
410
410
  *
411
411
  * @param {string} params.appId - Application unique ID.
412
- * @param {string[]} params.labels - Array of application labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.
412
+ * @param {string[]} params.labels - Array of application labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. Reserved labels are rejected.
413
413
  * @throws {AppwriteException}
414
414
  * @returns {Promise<Models.App>}
415
415
  */
@@ -421,7 +421,7 @@ export declare class Apps {
421
421
  * Update the labels of an application. Labels are read-only for clients; only a server SDK using a project API key can set them. Replaces the previous labels.
422
422
  *
423
423
  * @param {string} appId - Application unique ID.
424
- * @param {string[]} labels - Array of application labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long.
424
+ * @param {string[]} labels - Array of application labels. Replaces the previous labels. Maximum of 1000 labels are allowed, each up to 36 alphanumeric characters long. Reserved labels are rejected.
425
425
  * @throws {AppwriteException}
426
426
  * @returns {Promise<Models.App>}
427
427
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -203,6 +203,50 @@ export declare class Avatars {
203
203
  * @deprecated Use the object parameter style method for a better developer experience.
204
204
  */
205
205
  getInitials(name?: string, width?: number, height?: number, background?: string): string;
206
+ /**
207
+ * Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback.
208
+ *
209
+ * Passing `userId` — `current()` for the authenticated user — resolves the photo from everything known about that user: identity photos, email, and name. An explicit `emailHash` or `name` then overrides just that value, and the user's remaining sources stay in the chain. Without `userId`, passing `emailHash` and/or `name` resolves the avatar from those values alone: the hash is looked up on Gravatar and Libravatar, the name is rendered as initials, and the session user stays out of the chain so their own photo never shadows the avatar being asked for. When nothing is passed, the photo resolves for the currently authenticated user. Emails are only ever accepted pre-hashed, so no address ends up in a URL.
210
+ *
211
+ * @param {number} params.width - Output image width in pixels. Pass an integer between 0 and 2000. Defaults to 256.
212
+ * @param {number} params.height - Output image height in pixels. Pass an integer between 0 and 2000. Defaults to 256.
213
+ * @param {number} params.quality - Output image quality between 0 and 100. Defaults to 100.
214
+ * @param {string} params.output - Output image format. Defaults to 'png'.
215
+ * @param {string} params.rating - Maximum image rating to fetch from Gravatar/Libravatar. Defaults to 'g'.
216
+ * @param {string} params.userId - User ID to resolve the photo for. Pass 'current()' for the currently authenticated user. When omitted, the session user is used only if no emailHash and no name is passed.
217
+ * @param {string} params.emailHash - SHA256 hash of the lowercase, trimmed email address to look up on Gravatar and Libravatar instead of the user's own email. Pass the hash, never the address itself.
218
+ * @param {string} params.name - Name to render initials from instead of the user's own name. Max length: 128 chars.
219
+ * @throws {AppwriteException}
220
+ * @returns {string}
221
+ */
222
+ getPhoto(params?: {
223
+ width?: number;
224
+ height?: number;
225
+ quality?: number;
226
+ output?: string;
227
+ rating?: string;
228
+ userId?: string;
229
+ emailHash?: string;
230
+ name?: string;
231
+ }): string;
232
+ /**
233
+ * Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback.
234
+ *
235
+ * Passing `userId` — `current()` for the authenticated user — resolves the photo from everything known about that user: identity photos, email, and name. An explicit `emailHash` or `name` then overrides just that value, and the user's remaining sources stay in the chain. Without `userId`, passing `emailHash` and/or `name` resolves the avatar from those values alone: the hash is looked up on Gravatar and Libravatar, the name is rendered as initials, and the session user stays out of the chain so their own photo never shadows the avatar being asked for. When nothing is passed, the photo resolves for the currently authenticated user. Emails are only ever accepted pre-hashed, so no address ends up in a URL.
236
+ *
237
+ * @param {number} width - Output image width in pixels. Pass an integer between 0 and 2000. Defaults to 256.
238
+ * @param {number} height - Output image height in pixels. Pass an integer between 0 and 2000. Defaults to 256.
239
+ * @param {number} quality - Output image quality between 0 and 100. Defaults to 100.
240
+ * @param {string} output - Output image format. Defaults to 'png'.
241
+ * @param {string} rating - Maximum image rating to fetch from Gravatar/Libravatar. Defaults to 'g'.
242
+ * @param {string} userId - User ID to resolve the photo for. Pass 'current()' for the currently authenticated user. When omitted, the session user is used only if no emailHash and no name is passed.
243
+ * @param {string} emailHash - SHA256 hash of the lowercase, trimmed email address to look up on Gravatar and Libravatar instead of the user's own email. Pass the hash, never the address itself.
244
+ * @param {string} name - Name to render initials from instead of the user's own name. Max length: 128 chars.
245
+ * @throws {AppwriteException}
246
+ * @returns {string}
247
+ * @deprecated Use the object parameter style method for a better developer experience.
248
+ */
249
+ getPhoto(width?: number, height?: number, quality?: number, output?: string, rating?: string, userId?: string, emailHash?: string, name?: string): string;
206
250
  /**
207
251
  * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
208
252
  *
@@ -330,7 +330,7 @@ export declare class Console {
330
330
  /**
331
331
  * Get the Appwrite built-in default email template for the specified type and locale. Always returns the unmodified default, ignoring any custom project overrides.
332
332
  *
333
- * @param {ProjectEmailTemplateId} params.templateId - Email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession
333
+ * @param {ProjectEmailTemplateId} params.templateId - Email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession, otpVerification
334
334
  * @param {ProjectEmailTemplateLocale} params.locale - Template locale. If left empty, the fallback locale (en) will be used.
335
335
  * @throws {AppwriteException}
336
336
  * @returns {Promise<Models.EmailTemplate>}
@@ -342,7 +342,7 @@ export declare class Console {
342
342
  /**
343
343
  * Get the Appwrite built-in default email template for the specified type and locale. Always returns the unmodified default, ignoring any custom project overrides.
344
344
  *
345
- * @param {ProjectEmailTemplateId} templateId - Email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession
345
+ * @param {ProjectEmailTemplateId} templateId - Email template type. Can be one of: verification, magicSession, recovery, invitation, mfaChallenge, sessionAlert, otpSession, otpVerification
346
346
  * @param {ProjectEmailTemplateLocale} locale - Template locale. If left empty, the fallback locale (en) will be used.
347
347
  * @throws {AppwriteException}
348
348
  * @returns {Promise<Models.EmailTemplate>}
@@ -294,7 +294,7 @@ export declare class Databases {
294
294
  * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
295
295
  * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
296
296
  * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
297
- * @param {object[]} params.attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
297
+ * @param {object[]} params.attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
298
298
  * @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
299
299
  * @throws {AppwriteException}
300
300
  * @returns {Promise<Models.Collection>}
@@ -319,7 +319,7 @@ export declare class Databases {
319
319
  * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
320
320
  * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
321
321
  * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
322
- * @param {object[]} attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
322
+ * @param {object[]} attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
323
323
  * @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
324
324
  * @throws {AppwriteException}
325
325
  * @returns {Promise<Models.Collection>}
@@ -1429,11 +1429,11 @@ export declare class Databases {
1429
1429
  * @param {string} params.databaseId - Database ID.
1430
1430
  * @param {string} params.collectionId - Collection ID.
1431
1431
  * @param {string} params.relatedCollectionId - Related Collection ID.
1432
- * @param {RelationshipType} params.type - Relation type
1432
+ * @param {RelationshipType} params.type - Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany.
1433
1433
  * @param {boolean} params.twoWay - Is Two Way?
1434
1434
  * @param {string} params.key - Attribute Key.
1435
1435
  * @param {string} params.twoWayKey - Two Way Attribute Key.
1436
- * @param {RelationMutate} params.onDelete - Constraints option
1436
+ * @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull.
1437
1437
  * @throws {AppwriteException}
1438
1438
  * @returns {Promise<Models.AttributeRelationship>}
1439
1439
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRelationshipColumn` instead.
@@ -1455,11 +1455,11 @@ export declare class Databases {
1455
1455
  * @param {string} databaseId - Database ID.
1456
1456
  * @param {string} collectionId - Collection ID.
1457
1457
  * @param {string} relatedCollectionId - Related Collection ID.
1458
- * @param {RelationshipType} type - Relation type
1458
+ * @param {RelationshipType} type - Relationship type. Possible values are: oneToOne, oneToMany, manyToOne, manyToMany.
1459
1459
  * @param {boolean} twoWay - Is Two Way?
1460
1460
  * @param {string} key - Attribute Key.
1461
1461
  * @param {string} twoWayKey - Two Way Attribute Key.
1462
- * @param {RelationMutate} onDelete - Constraints option
1462
+ * @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull.
1463
1463
  * @throws {AppwriteException}
1464
1464
  * @returns {Promise<Models.AttributeRelationship>}
1465
1465
  * @deprecated Use the object parameter style method for a better developer experience.
@@ -1472,7 +1472,7 @@ export declare class Databases {
1472
1472
  * @param {string} params.databaseId - Database ID.
1473
1473
  * @param {string} params.collectionId - Collection ID.
1474
1474
  * @param {string} params.key - Attribute Key.
1475
- * @param {RelationMutate} params.onDelete - Constraints option
1475
+ * @param {RelationMutate} params.onDelete - Delete constraint. Possible values are: cascade, restrict, setNull.
1476
1476
  * @param {string} params.newKey - New Attribute Key.
1477
1477
  * @throws {AppwriteException}
1478
1478
  * @returns {Promise<Models.AttributeRelationship>}
@@ -1492,7 +1492,7 @@ export declare class Databases {
1492
1492
  * @param {string} databaseId - Database ID.
1493
1493
  * @param {string} collectionId - Collection ID.
1494
1494
  * @param {string} key - Attribute Key.
1495
- * @param {RelationMutate} onDelete - Constraints option
1495
+ * @param {RelationMutate} onDelete - Delete constraint. Possible values are: cascade, restrict, setNull.
1496
1496
  * @param {string} newKey - New Attribute Key.
1497
1497
  * @throws {AppwriteException}
1498
1498
  * @returns {Promise<Models.AttributeRelationship>}
@@ -64,7 +64,7 @@ export declare class DocumentsDB {
64
64
  */
65
65
  create(databaseId: string, name: string, enabled?: boolean, specification?: string, replicas?: number, syncMode?: string): Promise<Models.Database>;
66
66
  /**
67
- * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization.
67
+ * List the dedicated database specifications available on the current plan. Each specification reports its resource limits, its own prices and overage rates, and whether it is enabled for the organization.
68
68
  *
69
69
  * @throws {AppwriteException}
70
70
  * @returns {Promise<Models.DedicatedDatabaseSpecificationList>}
@@ -280,7 +280,7 @@ export declare class DocumentsDB {
280
280
  * @param {string[]} params.permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
281
281
  * @param {boolean} params.documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
282
282
  * @param {boolean} params.enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
283
- * @param {object[]} params.attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
283
+ * @param {object[]} params.attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
284
284
  * @param {object[]} params.indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
285
285
  * @throws {AppwriteException}
286
286
  * @returns {Promise<Models.Collection>}
@@ -304,7 +304,7 @@ export declare class DocumentsDB {
304
304
  * @param {string[]} permissions - An array of permissions strings. By default, no user is granted with any permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
305
305
  * @param {boolean} documentSecurity - Enables configuring permissions for individual documents. A user needs one of document or collection level permissions to access a document. [Learn more about permissions](https://appwrite.io/docs/permissions).
306
306
  * @param {boolean} enabled - Is collection enabled? When set to 'disabled', users cannot access the collection but Server SDKs with and API key can still read and write to the collection. No data is lost when this is toggled.
307
- * @param {object[]} attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, integer, float, boolean, datetime, relationship), size (integer, required for string type), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
307
+ * @param {object[]} attributes - Array of attribute definitions to create. Each attribute should contain: key (string), type (string: string, varchar, text, mediumtext, longtext, integer, bigint, double, boolean, datetime, point, linestring, polygon, email, url, ip, enum), size (integer, required for string and varchar types), required (boolean, optional), default (mixed, optional), array (boolean, optional), and type-specific options.
308
308
  * @param {object[]} indexes - Array of index definitions to create. Each index should contain: key (string), type (string: key, fulltext, unique, spatial), attributes (array of attribute keys), orders (array of ASC/DESC, optional), and lengths (array of integers, optional).
309
309
  * @throws {AppwriteException}
310
310
  * @returns {Promise<Models.Collection>}
@@ -434,6 +434,7 @@ export declare class DocumentsDB {
434
434
  * @param {string} params.documentId - Document 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.
435
435
  * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} params.data - Document data as JSON object.
436
436
  * @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
437
+ * @param {string} params.transactionId - Transaction ID for staging the operation.
437
438
  * @throws {AppwriteException}
438
439
  * @returns {Promise<Document>}
439
440
  */
@@ -443,6 +444,7 @@ export declare class DocumentsDB {
443
444
  documentId: string;
444
445
  data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>;
445
446
  permissions?: string[];
447
+ transactionId?: string;
446
448
  }): Promise<Document>;
447
449
  /**
448
450
  * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
@@ -452,17 +454,19 @@ export declare class DocumentsDB {
452
454
  * @param {string} documentId - Document 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.
453
455
  * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} data - Document data as JSON object.
454
456
  * @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
457
+ * @param {string} transactionId - Transaction ID for staging the operation.
455
458
  * @throws {AppwriteException}
456
459
  * @returns {Promise<Document>}
457
460
  * @deprecated Use the object parameter style method for a better developer experience.
458
461
  */
459
- createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document>;
462
+ createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, permissions?: string[], transactionId?: string): Promise<Document>;
460
463
  /**
461
464
  * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
462
465
  *
463
466
  * @param {string} params.databaseId - Database ID.
464
467
  * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
465
468
  * @param {object[]} params.documents - Array of documents data as JSON objects.
469
+ * @param {string} params.transactionId - Transaction ID for staging the operation.
466
470
  * @throws {AppwriteException}
467
471
  * @returns {Promise<Models.DocumentList<Document>>}
468
472
  */
@@ -470,6 +474,7 @@ export declare class DocumentsDB {
470
474
  databaseId: string;
471
475
  collectionId: string;
472
476
  documents: object[];
477
+ transactionId?: string;
473
478
  }): Promise<Models.DocumentList<Document>>;
474
479
  /**
475
480
  * Create new Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
@@ -477,11 +482,12 @@ export declare class DocumentsDB {
477
482
  * @param {string} databaseId - Database ID.
478
483
  * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
479
484
  * @param {object[]} documents - Array of documents data as JSON objects.
485
+ * @param {string} transactionId - Transaction ID for staging the operation.
480
486
  * @throws {AppwriteException}
481
487
  * @returns {Promise<Models.DocumentList<Document>>}
482
488
  * @deprecated Use the object parameter style method for a better developer experience.
483
489
  */
484
- createDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[]): Promise<Models.DocumentList<Document>>;
490
+ createDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documents: object[], transactionId?: string): Promise<Models.DocumentList<Document>>;
485
491
  /**
486
492
  * Create or update Documents. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#documentsDBCreateCollection) API or directly from your database console.
487
493
  *
@@ -890,7 +896,7 @@ export declare class DocumentsDB {
890
896
  */
891
897
  deleteIndex(databaseId: string, collectionId: string, key: string): Promise<{}>;
892
898
  /**
893
- * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote.
899
+ * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted.
894
900
  *
895
901
  * @param {string} params.databaseId - Database ID.
896
902
  * @param {string} params.targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.
@@ -902,7 +908,7 @@ export declare class DocumentsDB {
902
908
  targetReplicaId?: string;
903
909
  }): Promise<Models.DedicatedDatabase>;
904
910
  /**
905
- * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote.
911
+ * Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation also accepts this call as a repair once nothing is driving the operation it is stuck in. Repairing a failover that did not finish, a `failed` database, a stranded upgrade or migrate, or a stranded compute resize additionally requires `targetReplicaId` to name the member to promote, because the default target may be the member that operation already promoted.
906
912
  *
907
913
  * @param {string} databaseId - Database ID.
908
914
  * @param {string} targetReplicaId - Target replica ID to promote. If not specified, the healthiest replica is selected.