@appwrite.io/console 18.0.0 → 18.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@appwrite.io/console",
3
3
  "homepage": "https://appwrite.io/support",
4
4
  "description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
5
- "version": "18.0.0",
5
+ "version": "18.2.0",
6
6
  "license": "BSD-3-Clause",
7
7
  "main": "dist/cjs/sdk.js",
8
8
  "exports": {
@@ -58,7 +58,7 @@
58
58
  "typescript-eslint": "8.70.0"
59
59
  },
60
60
  "overrides": {
61
- "brace-expansion": "5.0.9"
61
+ "brace-expansion": "5.0.12"
62
62
  },
63
63
  "jsdelivr": "dist/iife/sdk.js",
64
64
  "unpkg": "dist/iife/sdk.js"
package/types/client.d.ts CHANGED
@@ -172,7 +172,10 @@ declare class Client {
172
172
  *
173
173
  * A stable client id for the AppwritePush service. The broker keys its
174
174
  * offline-replay cursor on this id, so pass a stable value to resume replay across
175
- * reloads/restarts. Defaults to a per-connection id when unset.
175
+ * reloads/restarts. Defaults, when unset, to one per user and tab: stable across reloads of
176
+ * the tab, different in every other tab, and distinct for each connection open at the same
177
+ * time, so no two connections take over each other's session. An explicit id shared by
178
+ * several tabs or connections makes them do that.
176
179
  *
177
180
  * @param {string} pushClientId
178
181
  *
@@ -365,7 +368,7 @@ declare class Client {
365
368
  uri: string;
366
369
  options: RequestInit;
367
370
  };
368
- chunkedUpload(method: string, url: URL, headers: Headers | undefined, originalPayload: Payload | undefined, onProgress: (progress: UploadProgress) => void): Promise<any>;
371
+ chunkedUpload(method: string, url: URL, headers: Headers | undefined, originalPayload: Payload | undefined, onProgress: (progress: UploadProgress) => void, responseType?: string): Promise<any>;
369
372
  ping(): Promise<unknown>;
370
373
  call(method: string, url: URL, headers?: Headers, params?: Payload, responseType?: string): Promise<any>;
371
374
  static flatten(data: Payload, prefix?: string): Payload;
@@ -41,6 +41,7 @@ export declare enum OAuthProvider {
41
41
  Tradeshift = "tradeshift",
42
42
  TradeshiftBox = "tradeshiftBox",
43
43
  Twitch = "twitch",
44
+ Webflow = "webflow",
44
45
  Wordpress = "wordpress",
45
46
  X = "x",
46
47
  Yahoo = "yahoo",
@@ -89,6 +89,7 @@ export declare enum ProjectKeyScopes {
89
89
  WebhooksWrite = "webhooks.write",
90
90
  LocaleRead = "locale.read",
91
91
  AvatarsRead = "avatars.read",
92
+ AvatarsWrite = "avatars.write",
92
93
  HealthRead = "health.read",
93
94
  AssistantRead = "assistant.read",
94
95
  MigrationsRead = "migrations.read",
@@ -41,6 +41,7 @@ export declare enum ProjectOAuthProviderId {
41
41
  Tradeshift = "tradeshift",
42
42
  TradeshiftBox = "tradeshiftBox",
43
43
  Twitch = "twitch",
44
+ Webflow = "webflow",
44
45
  Wordpress = "wordpress",
45
46
  X = "x",
46
47
  Yahoo = "yahoo",
@@ -18,6 +18,15 @@ export declare enum UsageEventDimension {
18
18
  SdkVersion = "sdkVersion",
19
19
  TeamId = "teamId",
20
20
  ResourceId = "resourceId",
21
+ Protocol = "protocol",
22
+ QueryKeys = "queryKeys",
23
+ Accept = "accept",
24
+ AcceptLanguage = "acceptLanguage",
25
+ PostalCode = "postalCode",
26
+ Latitude = "latitude",
27
+ Longitude = "longitude",
28
+ TimeZone = "timeZone",
29
+ WeatherCode = "weatherCode",
21
30
  Isp = "isp",
22
31
  AutonomousSystemNumber = "autonomousSystemNumber",
23
32
  AutonomousSystemOrganization = "autonomousSystemOrganization",
@@ -6,6 +6,7 @@ export declare enum UsageEventMetric {
6
6
  WebhooksEventsFailed = "webhooks.events.failed",
7
7
  AuthMethodPhone = "auth.method.phone",
8
8
  MessagesSent = "messages.sent",
9
+ MessagesFailed = "messages.failed",
9
10
  MessagesSmsSent = "messages.sms.sent",
10
11
  Executions = "executions",
11
12
  ExecutionsCompute = "executions.compute",
package/types/models.d.ts CHANGED
@@ -3272,6 +3272,107 @@ export declare namespace Models {
3272
3272
  */
3273
3273
  threads: number;
3274
3274
  };
3275
+ /**
3276
+ * Account
3277
+ */
3278
+ export type Account<Preferences extends Models.Preferences = Models.DefaultPreferences> = {
3279
+ /**
3280
+ * User ID.
3281
+ */
3282
+ $id: string;
3283
+ /**
3284
+ * User creation date in ISO 8601 format.
3285
+ */
3286
+ $createdAt: string;
3287
+ /**
3288
+ * User update date in ISO 8601 format.
3289
+ */
3290
+ $updatedAt: string;
3291
+ /**
3292
+ * User name.
3293
+ */
3294
+ name: string;
3295
+ /**
3296
+ * User registration date in ISO 8601 format.
3297
+ */
3298
+ registration: string;
3299
+ /**
3300
+ * User status. Pass `true` for enabled and `false` for disabled.
3301
+ */
3302
+ status: boolean;
3303
+ /**
3304
+ * Labels for the user.
3305
+ */
3306
+ labels: string[];
3307
+ /**
3308
+ * Password update time in ISO 8601 format.
3309
+ */
3310
+ passwordUpdate: string;
3311
+ /**
3312
+ * User email address.
3313
+ */
3314
+ email: string;
3315
+ /**
3316
+ * User phone number in E.164 format.
3317
+ */
3318
+ phone: string;
3319
+ /**
3320
+ * Email verification status.
3321
+ */
3322
+ emailVerification: boolean;
3323
+ /**
3324
+ * Canonical form of the user email address.
3325
+ */
3326
+ emailCanonical?: string;
3327
+ /**
3328
+ * Whether the user email is from a free email provider.
3329
+ */
3330
+ emailIsFree?: boolean;
3331
+ /**
3332
+ * Whether the user email is from a disposable email provider.
3333
+ */
3334
+ emailIsDisposable?: boolean;
3335
+ /**
3336
+ * Whether the user email is from a corporate domain.
3337
+ */
3338
+ emailIsCorporate?: boolean;
3339
+ /**
3340
+ * Whether the user email is in its canonical form.
3341
+ */
3342
+ emailIsCanonical?: boolean;
3343
+ /**
3344
+ * Whether the password was found in a known data breach the last time it was checked. Null when the password has never been checked.
3345
+ */
3346
+ passwordPwned?: boolean;
3347
+ /**
3348
+ * Phone verification status.
3349
+ */
3350
+ phoneVerification: boolean;
3351
+ /**
3352
+ * Multi factor authentication status.
3353
+ */
3354
+ mfa: boolean;
3355
+ /**
3356
+ * User preferences as a key-value object
3357
+ */
3358
+ prefs: Preferences;
3359
+ /**
3360
+ * A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.
3361
+ */
3362
+ targets: Target[];
3363
+ /**
3364
+ * Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.
3365
+ */
3366
+ accessedAt: string;
3367
+ /**
3368
+ * Whether the user can impersonate other users.
3369
+ */
3370
+ impersonator?: boolean;
3371
+ /**
3372
+ * ID of the original actor performing the impersonation. Present only when the current request is impersonating another user. Internal audit logs attribute the action to this user, while the impersonated target is recorded only in internal audit payload data.
3373
+ */
3374
+ impersonatorUserId?: string;
3375
+ };
3275
3376
  /**
3276
3377
  * Preferences
3277
3378
  */
@@ -5226,7 +5327,7 @@ export declare namespace Models {
5226
5327
  */
5227
5328
  authUsername: string;
5228
5329
  /**
5229
- * HTTP basic authentication password.
5330
+ * HTTP basic authentication password. Write-only: always returned empty.
5230
5331
  */
5231
5332
  authPassword: string;
5232
5333
  /**
@@ -5688,6 +5789,27 @@ export declare namespace Models {
5688
5789
  */
5689
5790
  clientSecret: string;
5690
5791
  };
5792
+ /**
5793
+ * OAuth2Webflow
5794
+ */
5795
+ export type OAuth2Webflow = {
5796
+ /**
5797
+ * OAuth2 provider ID.
5798
+ */
5799
+ $id: string;
5800
+ /**
5801
+ * OAuth2 provider is active and can be used to create sessions.
5802
+ */
5803
+ enabled: boolean;
5804
+ /**
5805
+ * Webflow OAuth2 client ID.
5806
+ */
5807
+ clientId: string;
5808
+ /**
5809
+ * Webflow OAuth2 client secret.
5810
+ */
5811
+ clientSecret: string;
5812
+ };
5691
5813
  /**
5692
5814
  * OAuth2Twitch
5693
5815
  */
@@ -6446,7 +6568,7 @@ export declare namespace Models {
6446
6568
  /**
6447
6569
  * List of OAuth2 providers.
6448
6570
  */
6449
- providers: (Models.OAuth2Github | Models.OAuth2Discord | Models.OAuth2Figma | Models.OAuth2Dropbox | Models.OAuth2Dailymotion | Models.OAuth2Bitbucket | Models.OAuth2Bitly | Models.OAuth2Box | Models.OAuth2Autodesk | Models.OAuth2Google | Models.OAuth2Zoom | Models.OAuth2Zoho | Models.OAuth2Yandex | Models.OAuth2X | Models.OAuth2WordPress | Models.OAuth2Twitch | Models.OAuth2Stripe | Models.OAuth2Spotify | Models.OAuth2Slack | Models.OAuth2Podio | Models.OAuth2Notion | Models.OAuth2Salesforce | Models.OAuth2Yahoo | Models.OAuth2Linkedin | Models.OAuth2Disqus | Models.OAuth2Amazon | Models.OAuth2Etsy | Models.OAuth2Facebook | Models.OAuth2Tradeshift | Models.OAuth2Paypal | Models.OAuth2Gitlab | Models.OAuth2Appwrite | Models.OAuth2Authentik | Models.OAuth2Auth0 | Models.OAuth2FusionAuth | Models.OAuth2Keycloak | Models.OAuth2Oidc | Models.OAuth2Apple | Models.OAuth2Okta | Models.OAuth2Kick | Models.OAuth2Microsoft | Models.OAuth2HuggingFace | Models.OAuth2Resend | Models.OAuth2Cloudflare | Models.OAuth2TikTok | Models.OAuth2Kakao)[];
6571
+ providers: (Models.OAuth2Github | Models.OAuth2Discord | Models.OAuth2Figma | Models.OAuth2Dropbox | Models.OAuth2Dailymotion | Models.OAuth2Bitbucket | Models.OAuth2Bitly | Models.OAuth2Box | Models.OAuth2Autodesk | Models.OAuth2Google | Models.OAuth2Zoom | Models.OAuth2Zoho | Models.OAuth2Yandex | Models.OAuth2X | Models.OAuth2WordPress | Models.OAuth2Webflow | Models.OAuth2Twitch | Models.OAuth2Stripe | Models.OAuth2Spotify | Models.OAuth2Slack | Models.OAuth2Podio | Models.OAuth2Notion | Models.OAuth2Salesforce | Models.OAuth2Yahoo | Models.OAuth2Linkedin | Models.OAuth2Disqus | Models.OAuth2Amazon | Models.OAuth2Etsy | Models.OAuth2Facebook | Models.OAuth2Tradeshift | Models.OAuth2Paypal | Models.OAuth2Gitlab | Models.OAuth2Appwrite | Models.OAuth2Authentik | Models.OAuth2Auth0 | Models.OAuth2FusionAuth | Models.OAuth2Keycloak | Models.OAuth2Oidc | Models.OAuth2Apple | Models.OAuth2Okta | Models.OAuth2Kick | Models.OAuth2Microsoft | Models.OAuth2HuggingFace | Models.OAuth2Resend | Models.OAuth2Cloudflare | Models.OAuth2TikTok | Models.OAuth2Kakao)[];
6450
6572
  };
6451
6573
  /**
6452
6574
  * Policy Password Dictionary
@@ -7163,6 +7285,26 @@ export declare namespace Models {
7163
7285
  * Region/state chain when broken down by `subdivisions`.
7164
7286
  */
7165
7287
  subdivisions?: string;
7288
+ /**
7289
+ * Postal code when broken down by `postalCode`.
7290
+ */
7291
+ postalCode?: string;
7292
+ /**
7293
+ * Latitude when broken down by `latitude`.
7294
+ */
7295
+ latitude?: string;
7296
+ /**
7297
+ * Longitude when broken down by `longitude`.
7298
+ */
7299
+ longitude?: string;
7300
+ /**
7301
+ * Time zone when broken down by `timeZone`.
7302
+ */
7303
+ timeZone?: string;
7304
+ /**
7305
+ * Weather station code when broken down by `weatherCode`.
7306
+ */
7307
+ weatherCode?: string;
7166
7308
  /**
7167
7309
  * Internet service provider when broken down by `isp`.
7168
7310
  */
@@ -1164,17 +1164,41 @@ export declare class Account {
1164
1164
  /**
1165
1165
  * Get the list of active sessions across different devices for the currently logged in user.
1166
1166
  *
1167
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
1168
+ * @throws {AppwriteException}
1169
+ * @returns {Promise<Models.SessionList>}
1170
+ */
1171
+ listSessions(params?: {
1172
+ total?: boolean;
1173
+ }): Promise<Models.SessionList>;
1174
+ /**
1175
+ * Get the list of active sessions across different devices for the currently logged in user.
1176
+ *
1177
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
1167
1178
  * @throws {AppwriteException}
1168
1179
  * @returns {Promise<Models.SessionList>}
1180
+ * @deprecated Use the object parameter style method for a better developer experience.
1169
1181
  */
1170
- listSessions(): Promise<Models.SessionList>;
1182
+ listSessions(total?: boolean): Promise<Models.SessionList>;
1171
1183
  /**
1172
- * Delete all sessions from the user account and remove any sessions cookies from the end client.
1184
+ * Delete all sessions from the user account and remove any sessions cookies from the end client. Pass `current` as false to keep the session making the request and sign out of every other session.
1173
1185
  *
1186
+ * @param {boolean} params.current - Delete the current session too. Use false to sign out of every other session while staying signed in on this one.
1174
1187
  * @throws {AppwriteException}
1175
1188
  * @returns {Promise<{}>}
1176
1189
  */
1177
- deleteSessions(): Promise<{}>;
1190
+ deleteSessions(params?: {
1191
+ current?: boolean;
1192
+ }): Promise<{}>;
1193
+ /**
1194
+ * Delete all sessions from the user account and remove any sessions cookies from the end client. Pass `current` as false to keep the session making the request and sign out of every other session.
1195
+ *
1196
+ * @param {boolean} current - Delete the current session too. Use false to sign out of every other session while staying signed in on this one.
1197
+ * @throws {AppwriteException}
1198
+ * @returns {Promise<{}>}
1199
+ * @deprecated Use the object parameter style method for a better developer experience.
1200
+ */
1201
+ deleteSessions(current?: boolean): Promise<{}>;
1178
1202
  /**
1179
1203
  * 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).
1180
1204
  *
@@ -1183,31 +1207,34 @@ export declare class Account {
1183
1207
  */
1184
1208
  createAnonymousSession(): Promise<Models.Session>;
1185
1209
  /**
1186
- * 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.
1210
+ * 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. Use the optional `duration` parameter to create a shorter session, for example when the user doesn't choose "remember me". It must be at least 60 seconds and cannot exceed the project maximum session length.
1187
1211
  *
1188
1212
  * 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).
1189
1213
  *
1190
1214
  * @param {string} params.email - User email.
1191
1215
  * @param {string} params.password - User password. Must be at least 8 chars.
1216
+ * @param {number} params.duration - Session length in seconds. Minimum is 60 seconds, and it cannot exceed the project maximum session length. Defaults to the project maximum session length.
1192
1217
  * @throws {AppwriteException}
1193
1218
  * @returns {Promise<Models.Session>}
1194
1219
  */
1195
1220
  createEmailPasswordSession(params: {
1196
1221
  email: string;
1197
1222
  password: string;
1223
+ duration?: number;
1198
1224
  }): Promise<Models.Session>;
1199
1225
  /**
1200
- * 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.
1226
+ * 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. Use the optional `duration` parameter to create a shorter session, for example when the user doesn't choose "remember me". It must be at least 60 seconds and cannot exceed the project maximum session length.
1201
1227
  *
1202
1228
  * 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).
1203
1229
  *
1204
1230
  * @param {string} email - User email.
1205
1231
  * @param {string} password - User password. Must be at least 8 chars.
1232
+ * @param {number} duration - Session length in seconds. Minimum is 60 seconds, and it cannot exceed the project maximum session length. Defaults to the project maximum session length.
1206
1233
  * @throws {AppwriteException}
1207
1234
  * @returns {Promise<Models.Session>}
1208
1235
  * @deprecated Use the object parameter style method for a better developer experience.
1209
1236
  */
1210
- createEmailPasswordSession(email: string, password: string): Promise<Models.Session>;
1237
+ createEmailPasswordSession(email: string, password: string, duration?: number): Promise<Models.Session>;
1211
1238
  /**
1212
1239
  * 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.
1213
1240
  *
@@ -1295,7 +1322,7 @@ export declare class Account {
1295
1322
  * 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).
1296
1323
  *
1297
1324
  *
1298
- * @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.
1325
+ * @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, webflow, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1299
1326
  * @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.
1300
1327
  * @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.
1301
1328
  * @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.
@@ -1316,7 +1343,7 @@ export declare class Account {
1316
1343
  * 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).
1317
1344
  *
1318
1345
  *
1319
- * @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.
1346
+ * @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, webflow, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1320
1347
  * @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.
1321
1348
  * @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.
1322
1349
  * @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.
@@ -1574,7 +1601,7 @@ export declare class Account {
1574
1601
  *
1575
1602
  * 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).
1576
1603
  *
1577
- * @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.
1604
+ * @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, webflow, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1578
1605
  * @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.
1579
1606
  * @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.
1580
1607
  * @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.
@@ -1596,7 +1623,7 @@ export declare class Account {
1596
1623
  *
1597
1624
  * 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).
1598
1625
  *
1599
- * @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.
1626
+ * @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, webflow, wordpress, x, yahoo, yammer, yandex, zoho, zoom.
1600
1627
  * @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.
1601
1628
  * @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.
1602
1629
  * @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.
@@ -7,18 +7,18 @@ export declare class Assistant {
7
7
  *
8
8
  * @param {string} params.prompt - Prompt. A string containing questions asked to the AI assistant.
9
9
  * @throws {AppwriteException}
10
- * @returns {Promise<{}>}
10
+ * @returns {Promise<string>}
11
11
  */
12
12
  chat(params: {
13
13
  prompt: string;
14
- }): Promise<{}>;
14
+ }): Promise<string>;
15
15
  /**
16
16
  * Send a prompt to the AI assistant and receive a response. This endpoint allows you to interact with Appwrite's AI assistant by sending questions or prompts and receiving helpful responses in real-time through a server-sent events stream.
17
17
  *
18
18
  * @param {string} prompt - Prompt. A string containing questions asked to the AI assistant.
19
19
  * @throws {AppwriteException}
20
- * @returns {Promise<{}>}
20
+ * @returns {Promise<string>}
21
21
  * @deprecated Use the object parameter style method for a better developer experience.
22
22
  */
23
- chat(prompt: string): Promise<{}>;
23
+ chat(prompt: string): Promise<string>;
24
24
  }
@@ -1,4 +1,5 @@
1
- import { Client } from '../client';
1
+ import { Client, UploadProgress } from '../client';
2
+ import type { Models } from '../models';
2
3
  import { Browser } from '../enums/browser';
3
4
  import { CreditCard } from '../enums/credit-card';
4
5
  import { Flag } from '../enums/flag';
@@ -204,7 +205,7 @@ export declare class Avatars {
204
205
  */
205
206
  getInitials(name?: string, width?: number, height?: number, background?: string): string;
206
207
  /**
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
+ * Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: a custom uploaded photo (see avatars.updatePhoto), OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback.
208
209
  *
209
210
  * 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
  *
@@ -230,7 +231,7 @@ export declare class Avatars {
230
231
  name?: string;
231
232
  }): string;
232
233
  /**
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
+ * Returns the best available profile photo for a user. The endpoint tries each source in priority order and returns the first successful result: a custom uploaded photo (see avatars.updatePhoto), OAuth2 identity photo, Gravatar, Libravatar, Appwrite Initials, built-in static fallback.
234
235
  *
235
236
  * 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
  *
@@ -247,6 +248,33 @@ export declare class Avatars {
247
248
  * @deprecated Use the object parameter style method for a better developer experience.
248
249
  */
249
250
  getPhoto(width?: number, height?: number, quality?: number, output?: string, rating?: string, userId?: string, emailHash?: string, name?: string): string;
251
+ /**
252
+ * Update the profile photo of the currently authenticated user. The uploaded image takes priority over every other photo source, including OAuth2 identity photos, Gravatar, and Libravatar. Updating an already customized photo replaces it. The image must be at most 5MB and is sent in a single request.
253
+ *
254
+ * @param {File} params.file - Binary image file of at most 5MB. Allowed file types are png, jpg, jpeg, and webp.
255
+ * @throws {AppwriteException}
256
+ * @returns {Promise<Models.Account<Preferences>>}
257
+ */
258
+ updatePhoto<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
259
+ file: File;
260
+ onProgress?: (progress: UploadProgress) => void;
261
+ }): Promise<Models.Account<Preferences>>;
262
+ /**
263
+ * Update the profile photo of the currently authenticated user. The uploaded image takes priority over every other photo source, including OAuth2 identity photos, Gravatar, and Libravatar. Updating an already customized photo replaces it. The image must be at most 5MB and is sent in a single request.
264
+ *
265
+ * @param {File} file - Binary image file of at most 5MB. Allowed file types are png, jpg, jpeg, and webp.
266
+ * @throws {AppwriteException}
267
+ * @returns {Promise<Models.Account<Preferences>>}
268
+ * @deprecated Use the object parameter style method for a better developer experience.
269
+ */
270
+ updatePhoto<Preferences extends Models.Preferences = Models.DefaultPreferences>(file: File, onProgress?: (progress: UploadProgress) => void): Promise<Models.Account<Preferences>>;
271
+ /**
272
+ * Delete the profile photo of the currently authenticated user and store the built-in static placeholder in its place. The placeholder is the user's photo from then on, so it takes priority over every other photo source — OAuth2 identity photos, Gravatar, Libravatar, and initials — until a new photo is uploaded with avatars.updatePhoto.
273
+ *
274
+ * @throws {AppwriteException}
275
+ * @returns {Promise<{}>}
276
+ */
277
+ deletePhoto(): Promise<{}>;
250
278
  /**
251
279
  * 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.
252
280
  *
@@ -285,7 +313,7 @@ export declare class Avatars {
285
313
  * When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px.
286
314
  *
287
315
  * @param {string} params.url - Website URL which you want to capture.
288
- * @param {object} params.headers - HTTP headers to send with the browser request. Defaults to empty.
316
+ * @param {object} params.headers - HTTP headers to send with the browser request. Only Accept and Accept-Language are allowed. Defaults to empty.
289
317
  * @param {number} params.viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.
290
318
  * @param {number} params.viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.
291
319
  * @param {number} params.scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.
@@ -337,7 +365,7 @@ export declare class Avatars {
337
365
  * When width and height are specified, the image is resized accordingly. If both dimensions are 0, the API provides an image at original size. If dimensions are not specified, the default viewport size is 1280x720px.
338
366
  *
339
367
  * @param {string} url - Website URL which you want to capture.
340
- * @param {object} headers - HTTP headers to send with the browser request. Defaults to empty.
368
+ * @param {object} headers - HTTP headers to send with the browser request. Only Accept and Accept-Language are allowed. Defaults to empty.
341
369
  * @param {number} viewportWidth - Browser viewport width. Pass an integer between 1 to 1920. Defaults to 1280.
342
370
  * @param {number} viewportHeight - Browser viewport height. Pass an integer between 1 to 1080. Defaults to 720.
343
371
  * @param {number} scale - Browser scale factor. Pass a number between 0.1 to 3. Defaults to 1.
@@ -76,10 +76,22 @@ export declare class Console {
76
76
  /**
77
77
  * List all OAuth2 providers supported by the Appwrite server, along with the parameters required to configure each provider. The response excludes mock providers but includes sandbox providers.
78
78
  *
79
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
79
80
  * @throws {AppwriteException}
80
81
  * @returns {Promise<Models.ConsoleOAuth2ProviderList>}
81
82
  */
82
- listOAuth2Providers(): Promise<Models.ConsoleOAuth2ProviderList>;
83
+ listOAuth2Providers(params?: {
84
+ total?: boolean;
85
+ }): Promise<Models.ConsoleOAuth2ProviderList>;
86
+ /**
87
+ * List all OAuth2 providers supported by the Appwrite server, along with the parameters required to configure each provider. The response excludes mock providers but includes sandbox providers.
88
+ *
89
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
90
+ * @throws {AppwriteException}
91
+ * @returns {Promise<Models.ConsoleOAuth2ProviderList>}
92
+ * @deprecated Use the object parameter style method for a better developer experience.
93
+ */
94
+ listOAuth2Providers(total?: boolean): Promise<Models.ConsoleOAuth2ProviderList>;
83
95
  /**
84
96
  * Return a list of all available plans.
85
97
  *
@@ -196,17 +208,41 @@ export declare class Console {
196
208
  /**
197
209
  * List all scopes available for organization API keys, along with a description for each scope.
198
210
  *
211
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
212
+ * @throws {AppwriteException}
213
+ * @returns {Promise<Models.ConsoleKeyScopeList>}
214
+ */
215
+ listOrganizationScopes(params?: {
216
+ total?: boolean;
217
+ }): Promise<Models.ConsoleKeyScopeList>;
218
+ /**
219
+ * List all scopes available for organization API keys, along with a description for each scope.
220
+ *
221
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
199
222
  * @throws {AppwriteException}
200
223
  * @returns {Promise<Models.ConsoleKeyScopeList>}
224
+ * @deprecated Use the object parameter style method for a better developer experience.
201
225
  */
202
- listOrganizationScopes(): Promise<Models.ConsoleKeyScopeList>;
226
+ listOrganizationScopes(total?: boolean): Promise<Models.ConsoleKeyScopeList>;
203
227
  /**
204
228
  * List all scopes available for project API keys, along with a description for each scope.
205
229
  *
230
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
206
231
  * @throws {AppwriteException}
207
232
  * @returns {Promise<Models.ConsoleKeyScopeList>}
208
233
  */
209
- listProjectScopes(): Promise<Models.ConsoleKeyScopeList>;
234
+ listProjectScopes(params?: {
235
+ total?: boolean;
236
+ }): Promise<Models.ConsoleKeyScopeList>;
237
+ /**
238
+ * List all scopes available for project API keys, along with a description for each scope.
239
+ *
240
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
241
+ * @throws {AppwriteException}
242
+ * @returns {Promise<Models.ConsoleKeyScopeList>}
243
+ * @deprecated Use the object parameter style method for a better developer experience.
244
+ */
245
+ listProjectScopes(total?: boolean): Promise<Models.ConsoleKeyScopeList>;
210
246
  /**
211
247
  * Create a new source.
212
248
  *
@@ -65,22 +65,25 @@ export declare class Databases {
65
65
  * List transactions across all databases.
66
66
  *
67
67
  * @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).
68
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
68
69
  * @throws {AppwriteException}
69
70
  * @returns {Promise<Models.TransactionList>}
70
71
  * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listTransactions` instead.
71
72
  */
72
73
  listTransactions(params?: {
73
74
  queries?: string[];
75
+ total?: boolean;
74
76
  }): Promise<Models.TransactionList>;
75
77
  /**
76
78
  * List transactions across all databases.
77
79
  *
78
80
  * @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).
81
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
79
82
  * @throws {AppwriteException}
80
83
  * @returns {Promise<Models.TransactionList>}
81
84
  * @deprecated Use the object parameter style method for a better developer experience.
82
85
  */
83
- listTransactions(queries?: string[]): Promise<Models.TransactionList>;
86
+ listTransactions(queries?: string[], total?: boolean): Promise<Models.TransactionList>;
84
87
  /**
85
88
  * Create a new transaction.
86
89
  *
@@ -74,21 +74,24 @@ export declare class DocumentsDB {
74
74
  * List transactions across all databases.
75
75
  *
76
76
  * @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).
77
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
77
78
  * @throws {AppwriteException}
78
79
  * @returns {Promise<Models.TransactionList>}
79
80
  */
80
81
  listTransactions(params?: {
81
82
  queries?: string[];
83
+ total?: boolean;
82
84
  }): Promise<Models.TransactionList>;
83
85
  /**
84
86
  * List transactions across all databases.
85
87
  *
86
88
  * @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).
89
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
87
90
  * @throws {AppwriteException}
88
91
  * @returns {Promise<Models.TransactionList>}
89
92
  * @deprecated Use the object parameter style method for a better developer experience.
90
93
  */
91
- listTransactions(queries?: string[]): Promise<Models.TransactionList>;
94
+ listTransactions(queries?: string[], total?: boolean): Promise<Models.TransactionList>;
92
95
  /**
93
96
  * Create a new transaction.
94
97
  *