@appwrite.io/console 1.8.0 → 1.10.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 (105) hide show
  1. package/.github/workflows/publish.yml +1 -1
  2. package/CHANGELOG.md +45 -6
  3. package/README.md +82 -2
  4. package/dist/cjs/sdk.js +532 -200
  5. package/dist/cjs/sdk.js.map +1 -1
  6. package/dist/esm/sdk.js +533 -201
  7. package/dist/esm/sdk.js.map +1 -1
  8. package/dist/iife/sdk.js +532 -200
  9. package/docs/examples/databases/create-document.md +1 -3
  10. package/docs/examples/databases/create-documents.md +1 -1
  11. package/docs/examples/databases/decrement-document-attribute.md +18 -0
  12. package/docs/examples/databases/increment-document-attribute.md +18 -0
  13. package/docs/examples/databases/upsert-documents.md +1 -1
  14. package/docs/examples/domains/create-record-a-a-a-a.md +1 -1
  15. package/docs/examples/domains/create-record-a.md +1 -1
  16. package/docs/examples/domains/create-record-alias.md +1 -1
  17. package/docs/examples/domains/create-record-c-a-a.md +1 -1
  18. package/docs/examples/domains/create-record-c-n-a-m-e.md +1 -1
  19. package/docs/examples/domains/create-record-h-t-t-p-s.md +1 -1
  20. package/docs/examples/domains/create-record-m-x.md +1 -1
  21. package/docs/examples/domains/create-record-n-s.md +1 -1
  22. package/docs/examples/domains/create-record-s-r-v.md +1 -1
  23. package/docs/examples/domains/create-record-t-x-t.md +1 -1
  24. package/docs/examples/domains/update-record-a-a-a-a.md +1 -1
  25. package/docs/examples/domains/update-record-a.md +1 -1
  26. package/docs/examples/domains/update-record-alias.md +1 -1
  27. package/docs/examples/domains/update-record-c-a-a.md +1 -1
  28. package/docs/examples/domains/update-record-c-n-a-m-e.md +1 -1
  29. package/docs/examples/domains/update-record-h-t-t-p-s.md +1 -1
  30. package/docs/examples/domains/update-record-m-x.md +1 -1
  31. package/docs/examples/domains/update-record-n-s.md +1 -1
  32. package/docs/examples/domains/update-record-s-r-v.md +1 -1
  33. package/docs/examples/domains/update-record-t-x-t.md +1 -1
  34. package/docs/examples/functions/create-execution.md +1 -1
  35. package/docs/examples/health/{get-queue-stats-usage-dump.md → get-queue-billing-project-aggregation.md} +2 -2
  36. package/docs/examples/health/{get-queue-billing-aggregation.md → get-queue-billing-team-aggregation.md} +1 -1
  37. package/docs/examples/organizations/cancel-downgrade.md +13 -0
  38. package/docs/examples/organizations/estimation-create-organization.md +16 -0
  39. package/docs/examples/organizations/estimation-delete-organization.md +13 -0
  40. package/docs/examples/organizations/estimation-update-plan.md +16 -0
  41. package/docs/examples/organizations/get-available-credits.md +13 -0
  42. package/docs/examples/organizations/get-usage.md +1 -1
  43. package/docs/examples/organizations/update-projects.md +14 -0
  44. package/docs/examples/organizations/validate-payment.md +14 -0
  45. package/docs/examples/proxy/create-redirect-rule.md +4 -2
  46. package/docs/examples/vcs/get-repository-contents.md +2 -1
  47. package/package.json +1 -1
  48. package/src/client.ts +5 -4
  49. package/src/enums/build-runtime.ts +2 -0
  50. package/src/enums/image-format.ts +1 -0
  51. package/src/enums/proxy-resource-type.ts +4 -0
  52. package/src/enums/runtime.ts +2 -0
  53. package/src/index.ts +1 -0
  54. package/src/models.ts +513 -11
  55. package/src/services/account.ts +97 -36
  56. package/src/services/avatars.ts +26 -20
  57. package/src/services/backups.ts +11 -0
  58. package/src/services/console.ts +8 -1
  59. package/src/services/databases.ts +190 -31
  60. package/src/services/domains.ts +111 -69
  61. package/src/services/functions.ts +37 -8
  62. package/src/services/graphql.ts +1 -0
  63. package/src/services/health.ts +54 -4
  64. package/src/services/locale.ts +9 -2
  65. package/src/services/messaging.ts +53 -8
  66. package/src/services/migrations.ts +12 -0
  67. package/src/services/organizations.ts +301 -14
  68. package/src/services/project.ts +5 -0
  69. package/src/services/projects.ts +50 -0
  70. package/src/services/proxy.ts +23 -1
  71. package/src/services/sites.ts +32 -4
  72. package/src/services/storage.ts +23 -9
  73. package/src/services/teams.ts +30 -17
  74. package/src/services/tokens.ts +4 -0
  75. package/src/services/users.ts +69 -27
  76. package/src/services/vcs.ts +16 -4
  77. package/types/enums/build-runtime.d.ts +3 -1
  78. package/types/enums/image-format.d.ts +2 -1
  79. package/types/enums/proxy-resource-type.d.ts +4 -0
  80. package/types/enums/runtime.d.ts +3 -1
  81. package/types/index.d.ts +1 -0
  82. package/types/models.d.ts +494 -188
  83. package/types/services/account.d.ts +36 -36
  84. package/types/services/avatars.d.ts +20 -20
  85. package/types/services/console.d.ts +1 -1
  86. package/types/services/databases.d.ts +67 -31
  87. package/types/services/domains.d.ts +69 -69
  88. package/types/services/functions.d.ts +8 -8
  89. package/types/services/health.d.ts +11 -3
  90. package/types/services/locale.d.ts +2 -2
  91. package/types/services/messaging.d.ts +8 -8
  92. package/types/services/organizations.d.ts +88 -14
  93. package/types/services/proxy.d.ts +4 -1
  94. package/types/services/sites.d.ts +4 -4
  95. package/types/services/storage.d.ts +9 -9
  96. package/types/services/teams.d.ts +17 -17
  97. package/types/services/users.d.ts +27 -27
  98. package/types/services/vcs.d.ts +4 -4
  99. package/docs/examples/functions/create-build.md +0 -15
  100. package/docs/examples/functions/get-function-usage.md +0 -14
  101. package/docs/examples/functions/update-deployment-build.md +0 -14
  102. package/docs/examples/functions/update-deployment.md +0 -14
  103. package/docs/examples/proxy/create-rule.md +0 -15
  104. package/src/enums/resource-type.ts +0 -4
  105. package/types/enums/resource-type.d.ts +0 -4
package/dist/esm/sdk.js CHANGED
@@ -278,7 +278,7 @@ class Client {
278
278
  'x-sdk-name': 'Console',
279
279
  'x-sdk-platform': 'console',
280
280
  'x-sdk-language': 'web',
281
- 'x-sdk-version': '1.8.0',
281
+ 'x-sdk-version': '1.10.0',
282
282
  'X-Appwrite-Response-Format': '1.7.0',
283
283
  };
284
284
  this.realtime = {
@@ -613,9 +613,10 @@ class Client {
613
613
  return { uri: url.toString(), options };
614
614
  }
615
615
  chunkedUpload(method, url, headers = {}, originalPayload = {}, onProgress) {
616
+ var _a;
616
617
  return __awaiter(this, void 0, void 0, function* () {
617
- const file = Object.values(originalPayload).find((value) => value instanceof File);
618
- if (!file) {
618
+ const [fileParam, file] = (_a = Object.entries(originalPayload).find(([_, value]) => value instanceof File)) !== null && _a !== void 0 ? _a : [];
619
+ if (!file || !fileParam) {
619
620
  throw new Error('File not found in payload');
620
621
  }
621
622
  if (file.size <= Client.CHUNK_SIZE) {
@@ -630,7 +631,8 @@ class Client {
630
631
  }
631
632
  headers['content-range'] = `bytes ${start}-${end - 1}/${file.size}`;
632
633
  const chunk = file.slice(start, end);
633
- let payload = Object.assign(Object.assign({}, originalPayload), { file: new File([chunk], file.name) });
634
+ let payload = Object.assign({}, originalPayload);
635
+ payload[fileParam] = new File([chunk], file.name);
634
636
  response = yield this.call(method, url, headers, payload);
635
637
  if (onProgress && typeof onProgress === 'function') {
636
638
  onProgress({
@@ -986,8 +988,8 @@ class Account {
986
988
  }
987
989
  /**
988
990
  * Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.
989
- This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
990
-
991
+ * This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
992
+ *
991
993
  *
992
994
  * @param {string} email
993
995
  * @param {string} password
@@ -1589,8 +1591,8 @@ This endpoint can also be used to convert an anonymous account to a normal one,
1589
1591
  }
1590
1592
  /**
1591
1593
  * Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appwrite.io/docs/references/cloud/client-web/account#createRecovery) endpoint.
1592
-
1593
- Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
1594
+ *
1595
+ * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
1594
1596
  *
1595
1597
  * @param {string} userId
1596
1598
  * @param {string} secret
@@ -1670,8 +1672,8 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
1670
1672
  }
1671
1673
  /**
1672
1674
  * 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.
1673
-
1674
- 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).
1675
+ *
1676
+ * 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).
1675
1677
  *
1676
1678
  * @param {string} email
1677
1679
  * @param {string} password
@@ -1730,11 +1732,11 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
1730
1732
  }
1731
1733
  /**
1732
1734
  * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL&#039;s back to your app when login is completed.
1733
-
1734
- If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.
1735
-
1736
- 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).
1737
-
1735
+ *
1736
+ * If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.
1737
+ *
1738
+ * 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).
1739
+ *
1738
1740
  *
1739
1741
  * @param {OAuthProvider} provider
1740
1742
  * @param {string} success
@@ -1979,8 +1981,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
1979
1981
  }
1980
1982
  /**
1981
1983
  * Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user&#039;s email is valid for 15 minutes.
1982
-
1983
- 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).
1984
+ *
1985
+ * 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).
1984
1986
  *
1985
1987
  * @param {string} userId
1986
1988
  * @param {string} email
@@ -2014,9 +2016,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
2014
2016
  }
2015
2017
  /**
2016
2018
  * Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user&#039;s email address is valid for 1 hour.
2017
-
2018
- 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).
2019
-
2019
+ *
2020
+ * 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).
2021
+ *
2020
2022
  *
2021
2023
  * @param {string} userId
2022
2024
  * @param {string} email
@@ -2054,10 +2056,10 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
2054
2056
  }
2055
2057
  /**
2056
2058
  * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL&#039;s back to your app when login is completed.
2057
-
2058
- 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.
2059
-
2060
- 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).
2059
+ *
2060
+ * 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.
2061
+ *
2062
+ * 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).
2061
2063
  *
2062
2064
  * @param {OAuthProvider} provider
2063
2065
  * @param {string} success
@@ -2096,8 +2098,8 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
2096
2098
  }
2097
2099
  /**
2098
2100
  * Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user&#039;s phone is valid for 15 minutes.
2099
-
2100
- 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).
2101
+ *
2102
+ * 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).
2101
2103
  *
2102
2104
  * @param {string} userId
2103
2105
  * @param {string} phone
@@ -2127,9 +2129,9 @@ A user is limited to 10 active sessions at a time by default. [Learn more about
2127
2129
  }
2128
2130
  /**
2129
2131
  * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user&#039;s email address is valid for 7 days.
2130
-
2131
- Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
2132
-
2132
+ *
2133
+ * Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.
2134
+ *
2133
2135
  *
2134
2136
  * @param {string} url
2135
2137
  * @throws {AppwriteException}
@@ -2231,8 +2233,8 @@ class Avatars {
2231
2233
  }
2232
2234
  /**
2233
2235
  * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
2234
-
2235
- When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
2236
+ *
2237
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
2236
2238
  *
2237
2239
  * @param {Browser} code
2238
2240
  * @param {number} width
@@ -2265,9 +2267,9 @@ When one dimension is specified and the other is 0, the image is scaled with pre
2265
2267
  }
2266
2268
  /**
2267
2269
  * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
2268
-
2269
- When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
2270
-
2270
+ *
2271
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
2272
+ *
2271
2273
  *
2272
2274
  * @param {CreditCard} code
2273
2275
  * @param {number} width
@@ -2300,8 +2302,8 @@ When one dimension is specified and the other is 0, the image is scaled with pre
2300
2302
  }
2301
2303
  /**
2302
2304
  * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
2303
-
2304
- This endpoint does not follow HTTP redirects.
2305
+ *
2306
+ * This endpoint does not follow HTTP redirects.
2305
2307
  *
2306
2308
  * @param {string} url
2307
2309
  * @throws {AppwriteException}
@@ -2325,9 +2327,9 @@ This endpoint does not follow HTTP redirects.
2325
2327
  }
2326
2328
  /**
2327
2329
  * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
2328
-
2329
- When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
2330
-
2330
+ *
2331
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
2332
+ *
2331
2333
  *
2332
2334
  * @param {Flag} code
2333
2335
  * @param {number} width
@@ -2360,10 +2362,10 @@ When one dimension is specified and the other is 0, the image is scaled with pre
2360
2362
  }
2361
2363
  /**
2362
2364
  * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
2363
-
2364
- When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.
2365
-
2366
- This endpoint does not follow HTTP redirects.
2365
+ *
2366
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.
2367
+ *
2368
+ * This endpoint does not follow HTTP redirects.
2367
2369
  *
2368
2370
  * @param {string} url
2369
2371
  * @param {number} width
@@ -2395,11 +2397,11 @@ This endpoint does not follow HTTP redirects.
2395
2397
  }
2396
2398
  /**
2397
2399
  * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the &#039;name&#039; parameter. If no name is given and no user is logged, an empty avatar will be returned.
2398
-
2399
- You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user&#039;s initials when reloading the same theme will always return for the same initials.
2400
-
2401
- When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
2402
-
2400
+ *
2401
+ * You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user&#039;s initials when reloading the same theme will always return for the same initials.
2402
+ *
2403
+ * When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
2404
+ *
2403
2405
  *
2404
2406
  * @param {string} name
2405
2407
  * @param {number} width
@@ -2432,7 +2434,7 @@ When one dimension is specified and the other is 0, the image is scaled with pre
2432
2434
  }
2433
2435
  /**
2434
2436
  * 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.
2435
-
2437
+ *
2436
2438
  *
2437
2439
  * @param {string} text
2438
2440
  * @param {number} size
@@ -2982,7 +2984,7 @@ class Databases {
2982
2984
  }
2983
2985
  /**
2984
2986
  * Create a new Database.
2985
-
2987
+ *
2986
2988
  *
2987
2989
  * @param {string} databaseId
2988
2990
  * @param {string} name
@@ -3280,7 +3282,7 @@ class Databases {
3280
3282
  }
3281
3283
  /**
3282
3284
  * Create a boolean attribute.
3283
-
3285
+ *
3284
3286
  *
3285
3287
  * @param {string} databaseId
3286
3288
  * @param {string} collectionId
@@ -3461,7 +3463,7 @@ class Databases {
3461
3463
  }
3462
3464
  /**
3463
3465
  * Create an email attribute.
3464
-
3466
+ *
3465
3467
  *
3466
3468
  * @param {string} databaseId
3467
3469
  * @param {string} collectionId
@@ -3507,7 +3509,7 @@ class Databases {
3507
3509
  }
3508
3510
  /**
3509
3511
  * Update an email attribute. Changing the `default` value will not update already existing documents.
3510
-
3512
+ *
3511
3513
  *
3512
3514
  * @param {string} databaseId
3513
3515
  * @param {string} collectionId
@@ -3553,7 +3555,7 @@ class Databases {
3553
3555
  }
3554
3556
  /**
3555
3557
  * Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute.
3556
-
3558
+ *
3557
3559
  *
3558
3560
  * @param {string} databaseId
3559
3561
  * @param {string} collectionId
@@ -3606,7 +3608,7 @@ class Databases {
3606
3608
  }
3607
3609
  /**
3608
3610
  * Update an enum attribute. Changing the `default` value will not update already existing documents.
3609
-
3611
+ *
3610
3612
  *
3611
3613
  * @param {string} databaseId
3612
3614
  * @param {string} collectionId
@@ -3659,7 +3661,7 @@ class Databases {
3659
3661
  }
3660
3662
  /**
3661
3663
  * Create a float attribute. Optionally, minimum and maximum values can be provided.
3662
-
3664
+ *
3663
3665
  *
3664
3666
  * @param {string} databaseId
3665
3667
  * @param {string} collectionId
@@ -3713,7 +3715,7 @@ class Databases {
3713
3715
  }
3714
3716
  /**
3715
3717
  * Update a float attribute. Changing the `default` value will not update already existing documents.
3716
-
3718
+ *
3717
3719
  *
3718
3720
  * @param {string} databaseId
3719
3721
  * @param {string} collectionId
@@ -3767,7 +3769,7 @@ class Databases {
3767
3769
  }
3768
3770
  /**
3769
3771
  * Create an integer attribute. Optionally, minimum and maximum values can be provided.
3770
-
3772
+ *
3771
3773
  *
3772
3774
  * @param {string} databaseId
3773
3775
  * @param {string} collectionId
@@ -3821,7 +3823,7 @@ class Databases {
3821
3823
  }
3822
3824
  /**
3823
3825
  * Update an integer attribute. Changing the `default` value will not update already existing documents.
3824
-
3826
+ *
3825
3827
  *
3826
3828
  * @param {string} databaseId
3827
3829
  * @param {string} collectionId
@@ -3875,7 +3877,7 @@ class Databases {
3875
3877
  }
3876
3878
  /**
3877
3879
  * Create IP address attribute.
3878
-
3880
+ *
3879
3881
  *
3880
3882
  * @param {string} databaseId
3881
3883
  * @param {string} collectionId
@@ -3921,7 +3923,7 @@ class Databases {
3921
3923
  }
3922
3924
  /**
3923
3925
  * Update an ip attribute. Changing the `default` value will not update already existing documents.
3924
-
3926
+ *
3925
3927
  *
3926
3928
  * @param {string} databaseId
3927
3929
  * @param {string} collectionId
@@ -3967,7 +3969,7 @@ class Databases {
3967
3969
  }
3968
3970
  /**
3969
3971
  * Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
3970
-
3972
+ *
3971
3973
  *
3972
3974
  * @param {string} databaseId
3973
3975
  * @param {string} collectionId
@@ -4021,7 +4023,7 @@ class Databases {
4021
4023
  }
4022
4024
  /**
4023
4025
  * Create a string attribute.
4024
-
4026
+ *
4025
4027
  *
4026
4028
  * @param {string} databaseId
4027
4029
  * @param {string} collectionId
@@ -4078,7 +4080,7 @@ class Databases {
4078
4080
  }
4079
4081
  /**
4080
4082
  * Update a string attribute. Changing the `default` value will not update already existing documents.
4081
-
4083
+ *
4082
4084
  *
4083
4085
  * @param {string} databaseId
4084
4086
  * @param {string} collectionId
@@ -4128,7 +4130,7 @@ class Databases {
4128
4130
  }
4129
4131
  /**
4130
4132
  * Create a URL attribute.
4131
-
4133
+ *
4132
4134
  *
4133
4135
  * @param {string} databaseId
4134
4136
  * @param {string} collectionId
@@ -4174,7 +4176,7 @@ class Databases {
4174
4176
  }
4175
4177
  /**
4176
4178
  * Update an url attribute. Changing the `default` value will not update already existing documents.
4177
-
4179
+ *
4178
4180
  *
4179
4181
  * @param {string} databaseId
4180
4182
  * @param {string} collectionId
@@ -4272,7 +4274,7 @@ class Databases {
4272
4274
  }
4273
4275
  /**
4274
4276
  * Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
4275
-
4277
+ *
4276
4278
  *
4277
4279
  * @param {string} databaseId
4278
4280
  * @param {string} collectionId
@@ -4337,7 +4339,7 @@ class Databases {
4337
4339
  * @param {string} databaseId
4338
4340
  * @param {string} collectionId
4339
4341
  * @param {string} documentId
4340
- * @param {Omit<Document, keyof Models.Document>} data
4342
+ * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} data
4341
4343
  * @param {string[]} permissions
4342
4344
  * @throws {AppwriteException}
4343
4345
  * @returns {Promise<Document>}
@@ -4373,6 +4375,8 @@ class Databases {
4373
4375
  return this.client.call('post', uri, apiHeaders, payload);
4374
4376
  }
4375
4377
  /**
4378
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
4379
+ *
4376
4380
  * 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#databasesCreateCollection) API or directly from your database console.
4377
4381
  *
4378
4382
  * @param {string} databaseId
@@ -4403,8 +4407,10 @@ class Databases {
4403
4407
  return this.client.call('post', uri, apiHeaders, payload);
4404
4408
  }
4405
4409
  /**
4410
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
4411
+ *
4406
4412
  * 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#databasesCreateCollection) API or directly from your database console.
4407
-
4413
+ *
4408
4414
  *
4409
4415
  * @param {string} databaseId
4410
4416
  * @param {string} collectionId
@@ -4419,6 +4425,9 @@ class Databases {
4419
4425
  if (typeof collectionId === 'undefined') {
4420
4426
  throw new AppwriteException('Missing required parameter: "collectionId"');
4421
4427
  }
4428
+ if (typeof documents === 'undefined') {
4429
+ throw new AppwriteException('Missing required parameter: "documents"');
4430
+ }
4422
4431
  const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);
4423
4432
  const payload = {};
4424
4433
  if (typeof documents !== 'undefined') {
@@ -4431,6 +4440,8 @@ class Databases {
4431
4440
  return this.client.call('put', uri, apiHeaders, payload);
4432
4441
  }
4433
4442
  /**
4443
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
4444
+ *
4434
4445
  * Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.
4435
4446
  *
4436
4447
  * @param {string} databaseId
@@ -4462,6 +4473,8 @@ class Databases {
4462
4473
  return this.client.call('patch', uri, apiHeaders, payload);
4463
4474
  }
4464
4475
  /**
4476
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
4477
+ *
4465
4478
  * Bulk delete documents using queries, if no queries are passed then all documents are deleted.
4466
4479
  *
4467
4480
  * @param {string} databaseId
@@ -4518,6 +4531,8 @@ class Databases {
4518
4531
  return this.client.call('get', uri, apiHeaders, payload);
4519
4532
  }
4520
4533
  /**
4534
+ * **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
4535
+ *
4521
4536
  * Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
4522
4537
  *
4523
4538
  * @param {string} databaseId
@@ -4561,7 +4576,7 @@ class Databases {
4561
4576
  * @param {string} databaseId
4562
4577
  * @param {string} collectionId
4563
4578
  * @param {string} documentId
4564
- * @param {Partial<Omit<Document, keyof Models.Document>>} data
4579
+ * @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} data
4565
4580
  * @param {string[]} permissions
4566
4581
  * @throws {AppwriteException}
4567
4582
  * @returns {Promise<Document>}
@@ -4646,6 +4661,84 @@ class Databases {
4646
4661
  const apiHeaders = {};
4647
4662
  return this.client.call('get', uri, apiHeaders, payload);
4648
4663
  }
4664
+ /**
4665
+ * Decrement a specific attribute of a document by a given value.
4666
+ *
4667
+ * @param {string} databaseId
4668
+ * @param {string} collectionId
4669
+ * @param {string} documentId
4670
+ * @param {string} attribute
4671
+ * @param {number} value
4672
+ * @param {number} min
4673
+ * @throws {AppwriteException}
4674
+ * @returns {Promise<Document>}
4675
+ */
4676
+ decrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, min) {
4677
+ if (typeof databaseId === 'undefined') {
4678
+ throw new AppwriteException('Missing required parameter: "databaseId"');
4679
+ }
4680
+ if (typeof collectionId === 'undefined') {
4681
+ throw new AppwriteException('Missing required parameter: "collectionId"');
4682
+ }
4683
+ if (typeof documentId === 'undefined') {
4684
+ throw new AppwriteException('Missing required parameter: "documentId"');
4685
+ }
4686
+ if (typeof attribute === 'undefined') {
4687
+ throw new AppwriteException('Missing required parameter: "attribute"');
4688
+ }
4689
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
4690
+ const payload = {};
4691
+ if (typeof value !== 'undefined') {
4692
+ payload['value'] = value;
4693
+ }
4694
+ if (typeof min !== 'undefined') {
4695
+ payload['min'] = min;
4696
+ }
4697
+ const uri = new URL(this.client.config.endpoint + apiPath);
4698
+ const apiHeaders = {
4699
+ 'content-type': 'application/json',
4700
+ };
4701
+ return this.client.call('patch', uri, apiHeaders, payload);
4702
+ }
4703
+ /**
4704
+ * Increment a specific attribute of a document by a given value.
4705
+ *
4706
+ * @param {string} databaseId
4707
+ * @param {string} collectionId
4708
+ * @param {string} documentId
4709
+ * @param {string} attribute
4710
+ * @param {number} value
4711
+ * @param {number} max
4712
+ * @throws {AppwriteException}
4713
+ * @returns {Promise<Document>}
4714
+ */
4715
+ incrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, max) {
4716
+ if (typeof databaseId === 'undefined') {
4717
+ throw new AppwriteException('Missing required parameter: "databaseId"');
4718
+ }
4719
+ if (typeof collectionId === 'undefined') {
4720
+ throw new AppwriteException('Missing required parameter: "collectionId"');
4721
+ }
4722
+ if (typeof documentId === 'undefined') {
4723
+ throw new AppwriteException('Missing required parameter: "documentId"');
4724
+ }
4725
+ if (typeof attribute === 'undefined') {
4726
+ throw new AppwriteException('Missing required parameter: "attribute"');
4727
+ }
4728
+ const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
4729
+ const payload = {};
4730
+ if (typeof value !== 'undefined') {
4731
+ payload['value'] = value;
4732
+ }
4733
+ if (typeof max !== 'undefined') {
4734
+ payload['max'] = max;
4735
+ }
4736
+ const uri = new URL(this.client.config.endpoint + apiPath);
4737
+ const apiHeaders = {
4738
+ 'content-type': 'application/json',
4739
+ };
4740
+ return this.client.call('patch', uri, apiHeaders, payload);
4741
+ }
4649
4742
  /**
4650
4743
  * List indexes in the collection.
4651
4744
  *
@@ -4673,7 +4766,7 @@ class Databases {
4673
4766
  }
4674
4767
  /**
4675
4768
  * Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
4676
- Attributes can be `key`, `fulltext`, and `unique`.
4769
+ * Attributes can be `key`, `fulltext`, and `unique`.
4677
4770
  *
4678
4771
  * @param {string} databaseId
4679
4772
  * @param {string} collectionId
@@ -4943,7 +5036,7 @@ class Domains {
4943
5036
  }
4944
5037
  /**
4945
5038
  * Delete a domain by its unique ID. This endpoint can be used to delete a domain from your project.
4946
- Once deleted, the domain will no longer be available for use and all associated resources will be removed.
5039
+ * Once deleted, the domain will no longer be available for use and all associated resources will be removed.
4947
5040
  *
4948
5041
  * @param {string} domainId
4949
5042
  * @throws {AppwriteException}
@@ -4963,8 +5056,8 @@ Once deleted, the domain will no longer be available for use and all associated
4963
5056
  }
4964
5057
  /**
4965
5058
  * Verify which NS records are used and update the domain accordingly. This will check the domain&#039;s
4966
- nameservers and update the domain&#039;s status based on whether the nameservers match the expected
4967
- Appwrite nameservers.
5059
+ * nameservers and update the domain&#039;s status based on whether the nameservers match the expected
5060
+ * Appwrite nameservers.
4968
5061
  *
4969
5062
  * @param {string} domainId
4970
5063
  * @throws {AppwriteException}
@@ -5001,7 +5094,7 @@ Once deleted, the domain will no longer be available for use and all associated
5001
5094
  }
5002
5095
  /**
5003
5096
  * Add Google Workspace DNS records to the domain. This will create the required MX records
5004
- for Google Workspace email hosting.
5097
+ * for Google Workspace email hosting.
5005
5098
  *
5006
5099
  * @param {string} domainId
5007
5100
  * @throws {AppwriteException}
@@ -5038,7 +5131,7 @@ Once deleted, the domain will no longer be available for use and all associated
5038
5131
  }
5039
5132
  /**
5040
5133
  * Add iCloud DNS records to the domain. This will create the required MX and SPF records
5041
- for using iCloud email services with your domain.
5134
+ * for using iCloud email services with your domain.
5042
5135
  *
5043
5136
  * @param {string} domainId
5044
5137
  * @throws {AppwriteException}
@@ -5075,7 +5168,7 @@ Once deleted, the domain will no longer be available for use and all associated
5075
5168
  }
5076
5169
  /**
5077
5170
  * Add Mailgun DNS records to the domain. This endpoint will create the required DNS records
5078
- for Mailgun in the specified domain.
5171
+ * for Mailgun in the specified domain.
5079
5172
  *
5080
5173
  * @param {string} domainId
5081
5174
  * @throws {AppwriteException}
@@ -5112,7 +5205,7 @@ Once deleted, the domain will no longer be available for use and all associated
5112
5205
  }
5113
5206
  /**
5114
5207
  * Add Outlook DNS records to the domain. This will create the required MX records
5115
- for setting up Outlook email hosting for your domain.
5208
+ * for setting up Outlook email hosting for your domain.
5116
5209
  *
5117
5210
  * @param {string} domainId
5118
5211
  * @throws {AppwriteException}
@@ -5149,7 +5242,7 @@ Once deleted, the domain will no longer be available for use and all associated
5149
5242
  }
5150
5243
  /**
5151
5244
  * Add ProtonMail DNS records to the domain. This will create the required MX records
5152
- for using ProtonMail with your custom domain.
5245
+ * for using ProtonMail with your custom domain.
5153
5246
  *
5154
5247
  * @param {string} domainId
5155
5248
  * @throws {AppwriteException}
@@ -5186,7 +5279,7 @@ Once deleted, the domain will no longer be available for use and all associated
5186
5279
  }
5187
5280
  /**
5188
5281
  * Add Zoho Mail DNS records to the domain. This will create the required MX records
5189
- for setting up Zoho Mail on your domain.
5282
+ * for setting up Zoho Mail on your domain.
5190
5283
  *
5191
5284
  * @param {string} domainId
5192
5285
  * @throws {AppwriteException}
@@ -5206,7 +5299,7 @@ Once deleted, the domain will no longer be available for use and all associated
5206
5299
  }
5207
5300
  /**
5208
5301
  * List DNS records for a given domain. You can use this endpoint to list all the DNS records
5209
- associated with your domain.
5302
+ * associated with your domain.
5210
5303
  *
5211
5304
  * @param {string} domainId
5212
5305
  * @param {string[]} queries
@@ -5228,7 +5321,7 @@ Once deleted, the domain will no longer be available for use and all associated
5228
5321
  }
5229
5322
  /**
5230
5323
  * Create a new A record for the given domain. A records are used to point a domain name
5231
- to an IPv4 address. The record value should be a valid IPv4 address.
5324
+ * to an IPv4 address. The record value should be a valid IPv4 address.
5232
5325
  *
5233
5326
  * @param {string} domainId
5234
5327
  * @param {string} name
@@ -5273,8 +5366,8 @@ to an IPv4 address. The record value should be a valid IPv4 address.
5273
5366
  }
5274
5367
  /**
5275
5368
  * Update an existing A record for the given domain. This endpoint allows you to modify
5276
- the properties of an A record including its name (subdomain), IPv4 address, TTL,
5277
- and optional comment.
5369
+ * the properties of an A record including its name (subdomain), IPv4 address, TTL,
5370
+ * and optional comment.
5278
5371
  *
5279
5372
  * @param {string} domainId
5280
5373
  * @param {string} recordId
@@ -5323,7 +5416,7 @@ to an IPv4 address. The record value should be a valid IPv4 address.
5323
5416
  }
5324
5417
  /**
5325
5418
  * Create a new AAAA record for the given domain. This endpoint allows you to add a new IPv6 DNS record
5326
- to your domain. The record will be used to point a hostname to an IPv6 address.
5419
+ * to your domain. The record will be used to point a hostname to an IPv6 address.
5327
5420
  *
5328
5421
  * @param {string} domainId
5329
5422
  * @param {string} name
@@ -5368,8 +5461,8 @@ to an IPv4 address. The record value should be a valid IPv4 address.
5368
5461
  }
5369
5462
  /**
5370
5463
  * Update an existing AAAA record for the given domain. This endpoint allows you to modify
5371
- the properties of an existing AAAA record, including its name (subdomain), IPv6 address,
5372
- TTL, and optional comment.
5464
+ * the properties of an existing AAAA record, including its name (subdomain), IPv6 address,
5465
+ * TTL, and optional comment.
5373
5466
  *
5374
5467
  * @param {string} domainId
5375
5468
  * @param {string} recordId
@@ -5418,8 +5511,8 @@ to an IPv4 address. The record value should be a valid IPv4 address.
5418
5511
  }
5419
5512
  /**
5420
5513
  * Create a new ALIAS record for the given domain. This record type can be used to point your domain
5421
- to another domain name that will serve as an alias. This is particularly useful when you want to
5422
- map your domain to a target domain that may change its IP address.
5514
+ * to another domain name that will serve as an alias. This is particularly useful when you want to
5515
+ * map your domain to a target domain that may change its IP address.
5423
5516
  *
5424
5517
  * @param {string} domainId
5425
5518
  * @param {string} name
@@ -5464,10 +5557,10 @@ to an IPv4 address. The record value should be a valid IPv4 address.
5464
5557
  }
5465
5558
  /**
5466
5559
  * Update an existing ALIAS record for the specified domain. This endpoint allows you to modify
5467
- the properties of an existing ALIAS record including its name, target domain, TTL, and comment.
5468
-
5469
- The ALIAS record type is similar to a CNAME record but can be used at the zone apex (root domain).
5470
- It provides a way to map one domain name to another.
5560
+ * the properties of an existing ALIAS record including its name, target domain, TTL, and comment.
5561
+ *
5562
+ * The ALIAS record type is similar to a CNAME record but can be used at the zone apex (root domain).
5563
+ * It provides a way to map one domain name to another.
5471
5564
  *
5472
5565
  * @param {string} domainId
5473
5566
  * @param {string} recordId
@@ -5516,7 +5609,7 @@ to an IPv4 address. The record value should be a valid IPv4 address.
5516
5609
  }
5517
5610
  /**
5518
5611
  * Create a new CAA record for the given domain. CAA records are used to specify which
5519
- Certificate Authorities (CAs) are allowed to issue SSL/TLS certificates for your domain.
5612
+ * Certificate Authorities (CAs) are allowed to issue SSL/TLS certificates for your domain.
5520
5613
  *
5521
5614
  * @param {string} domainId
5522
5615
  * @param {string} name
@@ -5561,8 +5654,8 @@ Certificate Authorities (CAs) are allowed to issue SSL/TLS certificates for your
5561
5654
  }
5562
5655
  /**
5563
5656
  * Update an existing CAA record for the given domain. A CAA (Certification Authority Authorization)
5564
- record is used to specify which certificate authorities (CAs) are authorized to issue certificates
5565
- for a domain.
5657
+ * record is used to specify which certificate authorities (CAs) are authorized to issue certificates
5658
+ * for a domain.
5566
5659
  *
5567
5660
  * @param {string} domainId
5568
5661
  * @param {string} recordId
@@ -5611,10 +5704,10 @@ Certificate Authorities (CAs) are allowed to issue SSL/TLS certificates for your
5611
5704
  }
5612
5705
  /**
5613
5706
  * Create a new CNAME record for the given domain.
5614
-
5615
- A CNAME record maps a subdomain to another domain name, allowing you to create aliases
5616
- for your domain. For example, you can create a CNAME record to point &#039;blog.example.com&#039;
5617
- to &#039;example.wordpress.com&#039;.
5707
+ *
5708
+ * A CNAME record maps a subdomain to another domain name, allowing you to create aliases
5709
+ * for your domain. For example, you can create a CNAME record to point &#039;blog.example.com&#039;
5710
+ * to &#039;example.wordpress.com&#039;.
5618
5711
  *
5619
5712
  * @param {string} domainId
5620
5713
  * @param {string} name
@@ -5707,7 +5800,7 @@ Certificate Authorities (CAs) are allowed to issue SSL/TLS certificates for your
5707
5800
  }
5708
5801
  /**
5709
5802
  * Create a new HTTPS record for the given domain. This record is used to configure HTTPS
5710
- settings for your domain, enabling secure communication over SSL/TLS.
5803
+ * settings for your domain, enabling secure communication over SSL/TLS.
5711
5804
  *
5712
5805
  * @param {string} domainId
5713
5806
  * @param {string} name
@@ -5752,8 +5845,8 @@ Certificate Authorities (CAs) are allowed to issue SSL/TLS certificates for your
5752
5845
  }
5753
5846
  /**
5754
5847
  * Update an existing HTTPS record for the given domain. This endpoint allows you to modify
5755
- the properties of an HTTPS record associated with your domain, including the name (subdomain),
5756
- target value, TTL, and optional comment.
5848
+ * the properties of an HTTPS record associated with your domain, including the name (subdomain),
5849
+ * target value, TTL, and optional comment.
5757
5850
  *
5758
5851
  * @param {string} domainId
5759
5852
  * @param {string} recordId
@@ -5802,9 +5895,9 @@ target value, TTL, and optional comment.
5802
5895
  }
5803
5896
  /**
5804
5897
  * Create a new MX record for the given domain. MX records are used to define the mail servers responsible
5805
- for accepting email messages for the domain. Multiple MX records can be created with different priorities.
5806
- The priority parameter determines the order in which mail servers are used, with lower values indicating
5807
- higher priority.
5898
+ * for accepting email messages for the domain. Multiple MX records can be created with different priorities.
5899
+ * The priority parameter determines the order in which mail servers are used, with lower values indicating
5900
+ * higher priority.
5808
5901
  *
5809
5902
  * @param {string} domainId
5810
5903
  * @param {string} name
@@ -5911,7 +6004,7 @@ target value, TTL, and optional comment.
5911
6004
  }
5912
6005
  /**
5913
6006
  * Create a new NS record for the given domain. NS records specify the nameservers that are used
5914
- to resolve the domain name to IP addresses. Each domain can have multiple NS records.
6007
+ * to resolve the domain name to IP addresses. Each domain can have multiple NS records.
5915
6008
  *
5916
6009
  * @param {string} domainId
5917
6010
  * @param {string} name
@@ -5956,9 +6049,9 @@ target value, TTL, and optional comment.
5956
6049
  }
5957
6050
  /**
5958
6051
  * Update an existing NS record for the given domain. This endpoint allows you to modify
5959
- the properties of an NS (nameserver) record associated with your domain. You can update
5960
- the record name (subdomain), target nameserver value, TTL, and add or modify comments
5961
- for better record management.
6052
+ * the properties of an NS (nameserver) record associated with your domain. You can update
6053
+ * the record name (subdomain), target nameserver value, TTL, and add or modify comments
6054
+ * for better record management.
5962
6055
  *
5963
6056
  * @param {string} domainId
5964
6057
  * @param {string} recordId
@@ -6007,8 +6100,8 @@ target value, TTL, and optional comment.
6007
6100
  }
6008
6101
  /**
6009
6102
  * Create a new SRV record for the given domain. SRV records are used to define the location
6010
- of servers for specific services. For example, they can be used to specify which server
6011
- handles a specific service like SIP or XMPP for the domain.
6103
+ * of servers for specific services. For example, they can be used to specify which server
6104
+ * handles a specific service like SIP or XMPP for the domain.
6012
6105
  *
6013
6106
  * @param {string} domainId
6014
6107
  * @param {string} name
@@ -6074,19 +6167,19 @@ target value, TTL, and optional comment.
6074
6167
  }
6075
6168
  /**
6076
6169
  * Update an existing SRV record for the given domain.
6077
-
6078
- Required parameters:
6079
- - domainId: Domain unique ID
6080
- - recordId: DNS record unique ID
6081
- - name: Record name (service name)
6082
- - value: Target hostname for this SRV record
6083
- - ttl: Time to live, in seconds
6084
- - priority: Record priority
6085
- - weight: Record weight
6086
- - port: Port number for the service
6087
-
6088
- Optional parameters:
6089
- - comment: A comment for this record
6170
+ *
6171
+ * Required parameters:
6172
+ * - domainId: Domain unique ID
6173
+ * - recordId: DNS record unique ID
6174
+ * - name: Record name (service name)
6175
+ * - value: Target hostname for this SRV record
6176
+ * - ttl: Time to live, in seconds
6177
+ * - priority: Record priority
6178
+ * - weight: Record weight
6179
+ * - port: Port number for the service
6180
+ *
6181
+ * Optional parameters:
6182
+ * - comment: A comment for this record
6090
6183
  *
6091
6184
  * @param {string} domainId
6092
6185
  * @param {string} recordId
@@ -6156,8 +6249,8 @@ target value, TTL, and optional comment.
6156
6249
  }
6157
6250
  /**
6158
6251
  * Create a new TXT record for the given domain. TXT records can be used
6159
- to provide additional information about your domain, such as domain
6160
- verification records, SPF records, or DKIM records.
6252
+ * to provide additional information about your domain, such as domain
6253
+ * verification records, SPF records, or DKIM records.
6161
6254
  *
6162
6255
  * @param {string} domainId
6163
6256
  * @param {string} name
@@ -6199,9 +6292,9 @@ target value, TTL, and optional comment.
6199
6292
  }
6200
6293
  /**
6201
6294
  * Update an existing TXT record for the given domain.
6202
-
6203
- Update the TXT record details for a specific domain by providing the domain ID,
6204
- record ID, and the new record configuration including name, value, TTL, and an optional comment.
6295
+ *
6296
+ * Update the TXT record details for a specific domain by providing the domain ID,
6297
+ * record ID, and the new record configuration including name, value, TTL, and an optional comment.
6205
6298
  *
6206
6299
  * @param {string} domainId
6207
6300
  * @param {string} recordId
@@ -6250,10 +6343,10 @@ target value, TTL, and optional comment.
6250
6343
  }
6251
6344
  /**
6252
6345
  * Get a single DNS record for a given domain by record ID.
6253
-
6254
- This endpoint allows you to retrieve a specific DNS record associated with a domain
6255
- using its unique identifier. The record contains information about the DNS configuration
6256
- such as type, value, and TTL settings.
6346
+ *
6347
+ * This endpoint allows you to retrieve a specific DNS record associated with a domain
6348
+ * using its unique identifier. The record contains information about the DNS configuration
6349
+ * such as type, value, and TTL settings.
6257
6350
  *
6258
6351
  * @param {string} domainId
6259
6352
  * @param {string} recordId
@@ -6275,7 +6368,7 @@ target value, TTL, and optional comment.
6275
6368
  }
6276
6369
  /**
6277
6370
  * Delete a DNS record for the given domain. This endpoint allows you to delete an existing DNS record
6278
- from a specific domain.
6371
+ * from a specific domain.
6279
6372
  *
6280
6373
  * @param {string} domainId
6281
6374
  * @param {string} recordId
@@ -6299,9 +6392,9 @@ target value, TTL, and optional comment.
6299
6392
  }
6300
6393
  /**
6301
6394
  * Update the team ID for a specific domain. This endpoint requires admin access.
6302
-
6303
- Updating the team ID will transfer ownership and access control of the domain
6304
- and all its DNS records to the new team.
6395
+ *
6396
+ * Updating the team ID will transfer ownership and access control of the domain
6397
+ * and all its DNS records to the new team.
6305
6398
  *
6306
6399
  * @param {string} domainId
6307
6400
  * @param {string} teamId
@@ -6328,7 +6421,7 @@ target value, TTL, and optional comment.
6328
6421
  }
6329
6422
  /**
6330
6423
  * Retrieve the DNS zone file for the given domain. This endpoint will return the DNS
6331
- zone file in a standardized format that can be used to configure DNS servers.
6424
+ * zone file in a standardized format that can be used to configure DNS servers.
6332
6425
  *
6333
6426
  * @param {string} domainId
6334
6427
  * @throws {AppwriteException}
@@ -6346,7 +6439,7 @@ target value, TTL, and optional comment.
6346
6439
  }
6347
6440
  /**
6348
6441
  * Update the DNS zone for the given domain using the provided zone file content.
6349
- All parsed records are imported and then the main domain document is returned.
6442
+ * All parsed records are imported and then the main domain document is returned.
6350
6443
  *
6351
6444
  * @param {string} domainId
6352
6445
  * @param {string} content
@@ -6762,10 +6855,10 @@ class Functions {
6762
6855
  }
6763
6856
  /**
6764
6857
  * Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you&#039;ll need to update the function&#039;s deployment to use your new deployment UID.
6765
-
6766
- This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions).
6767
-
6768
- Use the &quot;command&quot; param to set the entrypoint used to execute your code.
6858
+ *
6859
+ * This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions).
6860
+ *
6861
+ * Use the &quot;command&quot; param to set the entrypoint used to execute your code.
6769
6862
  *
6770
6863
  * @param {string} functionId
6771
6864
  * @param {File} code
@@ -6837,8 +6930,8 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
6837
6930
  }
6838
6931
  /**
6839
6932
  * Create a deployment based on a template.
6840
-
6841
- Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details.
6933
+ *
6934
+ * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details.
6842
6935
  *
6843
6936
  * @param {string} functionId
6844
6937
  * @param {string} repository
@@ -6890,8 +6983,8 @@ Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/s
6890
6983
  }
6891
6984
  /**
6892
6985
  * Create a deployment when a function is connected to VCS.
6893
-
6894
- This endpoint lets you create deployment from a branch, commit, or a tag.
6986
+ *
6987
+ * This endpoint lets you create deployment from a branch, commit, or a tag.
6895
6988
  *
6896
6989
  * @param {string} functionId
6897
6990
  * @param {VCSDeploymentType} type
@@ -7428,14 +7521,31 @@ class Health {
7428
7521
  return this.client.call('get', uri, apiHeaders, payload);
7429
7522
  }
7430
7523
  /**
7431
- * Get billing aggregation queue
7524
+ * Get billing project aggregation queue
7525
+ *
7526
+ * @param {number} threshold
7527
+ * @throws {AppwriteException}
7528
+ * @returns {Promise<Models.HealthQueue>}
7529
+ */
7530
+ getQueueBillingProjectAggregation(threshold) {
7531
+ const apiPath = '/health/queue/billing-project-aggregation';
7532
+ const payload = {};
7533
+ if (typeof threshold !== 'undefined') {
7534
+ payload['threshold'] = threshold;
7535
+ }
7536
+ const uri = new URL(this.client.config.endpoint + apiPath);
7537
+ const apiHeaders = {};
7538
+ return this.client.call('get', uri, apiHeaders, payload);
7539
+ }
7540
+ /**
7541
+ * Get billing team aggregation queue
7432
7542
  *
7433
7543
  * @param {number} threshold
7434
7544
  * @throws {AppwriteException}
7435
7545
  * @returns {Promise<Models.HealthQueue>}
7436
7546
  */
7437
- getQueueBillingAggregation(threshold) {
7438
- const apiPath = '/health/queue/billing-aggregation';
7547
+ getQueueBillingTeamAggregation(threshold) {
7548
+ const apiPath = '/health/queue/billing-team-aggregation';
7439
7549
  const payload = {};
7440
7550
  if (typeof threshold !== 'undefined') {
7441
7551
  payload['threshold'] = threshold;
@@ -7535,7 +7645,7 @@ class Health {
7535
7645
  }
7536
7646
  /**
7537
7647
  * Returns the amount of failed jobs in a given queue.
7538
-
7648
+ *
7539
7649
  *
7540
7650
  * @param {Name} name
7541
7651
  * @param {number} threshold
@@ -7755,8 +7865,8 @@ class Locale {
7755
7865
  }
7756
7866
  /**
7757
7867
  * Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
7758
-
7759
- ([IP Geolocation by DB-IP](https://db-ip.com))
7868
+ *
7869
+ * ([IP Geolocation by DB-IP](https://db-ip.com))
7760
7870
  *
7761
7871
  * @throws {AppwriteException}
7762
7872
  * @returns {Promise<Models.Locale>}
@@ -7960,7 +8070,7 @@ class Messaging {
7960
8070
  }
7961
8071
  /**
7962
8072
  * Update an email message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
7963
-
8073
+ *
7964
8074
  *
7965
8075
  * @param {string} messageId
7966
8076
  * @param {string[]} topics
@@ -8118,7 +8228,7 @@ class Messaging {
8118
8228
  }
8119
8229
  /**
8120
8230
  * Update a push notification by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
8121
-
8231
+ *
8122
8232
  *
8123
8233
  * @param {string} messageId
8124
8234
  * @param {string[]} topics
@@ -8259,7 +8369,7 @@ class Messaging {
8259
8369
  }
8260
8370
  /**
8261
8371
  * Update an SMS message by its unique ID. This endpoint only works on messages that are in draft status. Messages that are already processing, sent, or failed cannot be updated.
8262
-
8372
+ *
8263
8373
  *
8264
8374
  * @param {string} messageId
8265
8375
  * @param {string[]} topics
@@ -8303,7 +8413,7 @@ class Messaging {
8303
8413
  }
8304
8414
  /**
8305
8415
  * Get a message by its unique ID.
8306
-
8416
+ *
8307
8417
  *
8308
8418
  * @param {string} messageId
8309
8419
  * @throws {AppwriteException}
@@ -9358,7 +9468,7 @@ class Messaging {
9358
9468
  }
9359
9469
  /**
9360
9470
  * Get a provider by its unique ID.
9361
-
9471
+ *
9362
9472
  *
9363
9473
  * @param {string} providerId
9364
9474
  * @throws {AppwriteException}
@@ -9491,7 +9601,7 @@ class Messaging {
9491
9601
  }
9492
9602
  /**
9493
9603
  * Get a topic by its unique ID.
9494
-
9604
+ *
9495
9605
  *
9496
9606
  * @param {string} topicId
9497
9607
  * @throws {AppwriteException}
@@ -9509,7 +9619,7 @@ class Messaging {
9509
9619
  }
9510
9620
  /**
9511
9621
  * Update a topic by its unique ID.
9512
-
9622
+ *
9513
9623
  *
9514
9624
  * @param {string} topicId
9515
9625
  * @param {string} name
@@ -9635,7 +9745,7 @@ class Messaging {
9635
9745
  }
9636
9746
  /**
9637
9747
  * Get a subscriber by its unique ID.
9638
-
9748
+ *
9639
9749
  *
9640
9750
  * @param {string} topicId
9641
9751
  * @param {string} subscriberId
@@ -10219,7 +10329,7 @@ class Organizations {
10219
10329
  }
10220
10330
  /**
10221
10331
  * Create a new organization.
10222
-
10332
+ *
10223
10333
  *
10224
10334
  * @param {string} organizationId
10225
10335
  * @param {string} name
@@ -10278,6 +10388,40 @@ class Organizations {
10278
10388
  };
10279
10389
  return this.client.call('post', uri, apiHeaders, payload);
10280
10390
  }
10391
+ /**
10392
+ * Get estimation for creating an organization.
10393
+ *
10394
+ * @param {BillingPlan} billingPlan
10395
+ * @param {string} paymentMethodId
10396
+ * @param {string[]} invites
10397
+ * @param {string} couponId
10398
+ * @throws {AppwriteException}
10399
+ * @returns {Promise<Models.Estimation>}
10400
+ */
10401
+ estimationCreateOrganization(billingPlan, paymentMethodId, invites, couponId) {
10402
+ if (typeof billingPlan === 'undefined') {
10403
+ throw new AppwriteException('Missing required parameter: "billingPlan"');
10404
+ }
10405
+ const apiPath = '/organizations/estimations/create-organization';
10406
+ const payload = {};
10407
+ if (typeof billingPlan !== 'undefined') {
10408
+ payload['billingPlan'] = billingPlan;
10409
+ }
10410
+ if (typeof paymentMethodId !== 'undefined') {
10411
+ payload['paymentMethodId'] = paymentMethodId;
10412
+ }
10413
+ if (typeof invites !== 'undefined') {
10414
+ payload['invites'] = invites;
10415
+ }
10416
+ if (typeof couponId !== 'undefined') {
10417
+ payload['couponId'] = couponId;
10418
+ }
10419
+ const uri = new URL(this.client.config.endpoint + apiPath);
10420
+ const apiHeaders = {
10421
+ 'content-type': 'application/json',
10422
+ };
10423
+ return this.client.call('patch', uri, apiHeaders, payload);
10424
+ }
10281
10425
  /**
10282
10426
  * Delete an organization.
10283
10427
  *
@@ -10463,7 +10607,7 @@ class Organizations {
10463
10607
  }
10464
10608
  /**
10465
10609
  * List all credits for an organization.
10466
-
10610
+ *
10467
10611
  *
10468
10612
  * @param {string} organizationId
10469
10613
  * @param {string[]} queries
@@ -10509,6 +10653,23 @@ class Organizations {
10509
10653
  };
10510
10654
  return this.client.call('post', uri, apiHeaders, payload);
10511
10655
  }
10656
+ /**
10657
+ * Get total available valid credits for an organization.
10658
+ *
10659
+ * @param {string} organizationId
10660
+ * @throws {AppwriteException}
10661
+ * @returns {Promise<Models.CreditAvailable>}
10662
+ */
10663
+ getAvailableCredits(organizationId) {
10664
+ if (typeof organizationId === 'undefined') {
10665
+ throw new AppwriteException('Missing required parameter: "organizationId"');
10666
+ }
10667
+ const apiPath = '/organizations/{organizationId}/credits/available'.replace('{organizationId}', organizationId);
10668
+ const payload = {};
10669
+ const uri = new URL(this.client.config.endpoint + apiPath);
10670
+ const apiHeaders = {};
10671
+ return this.client.call('get', uri, apiHeaders, payload);
10672
+ }
10512
10673
  /**
10513
10674
  * Get credit details.
10514
10675
  *
@@ -10530,6 +10691,59 @@ class Organizations {
10530
10691
  const apiHeaders = {};
10531
10692
  return this.client.call('get', uri, apiHeaders, payload);
10532
10693
  }
10694
+ /**
10695
+ * Get estimation for deleting an organization.
10696
+ *
10697
+ * @param {string} organizationId
10698
+ * @throws {AppwriteException}
10699
+ * @returns {Promise<Models.EstimationDeleteOrganization>}
10700
+ */
10701
+ estimationDeleteOrganization(organizationId) {
10702
+ if (typeof organizationId === 'undefined') {
10703
+ throw new AppwriteException('Missing required parameter: "organizationId"');
10704
+ }
10705
+ const apiPath = '/organizations/{organizationId}/estimations/delete-organization'.replace('{organizationId}', organizationId);
10706
+ const payload = {};
10707
+ const uri = new URL(this.client.config.endpoint + apiPath);
10708
+ const apiHeaders = {
10709
+ 'content-type': 'application/json',
10710
+ };
10711
+ return this.client.call('patch', uri, apiHeaders, payload);
10712
+ }
10713
+ /**
10714
+ * Get estimation for updating the organization plan.
10715
+ *
10716
+ * @param {string} organizationId
10717
+ * @param {BillingPlan} billingPlan
10718
+ * @param {string[]} invites
10719
+ * @param {string} couponId
10720
+ * @throws {AppwriteException}
10721
+ * @returns {Promise<Models.EstimationUpdatePlan>}
10722
+ */
10723
+ estimationUpdatePlan(organizationId, billingPlan, invites, couponId) {
10724
+ if (typeof organizationId === 'undefined') {
10725
+ throw new AppwriteException('Missing required parameter: "organizationId"');
10726
+ }
10727
+ if (typeof billingPlan === 'undefined') {
10728
+ throw new AppwriteException('Missing required parameter: "billingPlan"');
10729
+ }
10730
+ const apiPath = '/organizations/{organizationId}/estimations/update-plan'.replace('{organizationId}', organizationId);
10731
+ const payload = {};
10732
+ if (typeof billingPlan !== 'undefined') {
10733
+ payload['billingPlan'] = billingPlan;
10734
+ }
10735
+ if (typeof invites !== 'undefined') {
10736
+ payload['invites'] = invites;
10737
+ }
10738
+ if (typeof couponId !== 'undefined') {
10739
+ payload['couponId'] = couponId;
10740
+ }
10741
+ const uri = new URL(this.client.config.endpoint + apiPath);
10742
+ const apiHeaders = {
10743
+ 'content-type': 'application/json',
10744
+ };
10745
+ return this.client.call('patch', uri, apiHeaders, payload);
10746
+ }
10533
10747
  /**
10534
10748
  * List all invoices for an organization.
10535
10749
  *
@@ -10714,7 +10928,7 @@ class Organizations {
10714
10928
  }
10715
10929
  /**
10716
10930
  * Set an organization&#039;s backup payment method.
10717
-
10931
+ *
10718
10932
  *
10719
10933
  * @param {string} organizationId
10720
10934
  * @param {string} paymentMethodId
@@ -10846,6 +11060,48 @@ class Organizations {
10846
11060
  };
10847
11061
  return this.client.call('patch', uri, apiHeaders, payload);
10848
11062
  }
11063
+ /**
11064
+ * Cancel the downgrade initiated for an organization.
11065
+ *
11066
+ * @param {string} organizationId
11067
+ * @throws {AppwriteException}
11068
+ * @returns {Promise<Models.Organization<Preferences>>}
11069
+ */
11070
+ cancelDowngrade(organizationId) {
11071
+ if (typeof organizationId === 'undefined') {
11072
+ throw new AppwriteException('Missing required parameter: "organizationId"');
11073
+ }
11074
+ const apiPath = '/organizations/{organizationId}/plan/cancel'.replace('{organizationId}', organizationId);
11075
+ const payload = {};
11076
+ const uri = new URL(this.client.config.endpoint + apiPath);
11077
+ const apiHeaders = {
11078
+ 'content-type': 'application/json',
11079
+ };
11080
+ return this.client.call('patch', uri, apiHeaders, payload);
11081
+ }
11082
+ /**
11083
+ * Update selected projects to keep in the organization.
11084
+ *
11085
+ * @param {string} organizationId
11086
+ * @param {string[]} projects
11087
+ * @throws {AppwriteException}
11088
+ * @returns {Promise<Models.Organization<Preferences>>}
11089
+ */
11090
+ updateProjects(organizationId, projects) {
11091
+ if (typeof organizationId === 'undefined') {
11092
+ throw new AppwriteException('Missing required parameter: "organizationId"');
11093
+ }
11094
+ const apiPath = '/organizations/{organizationId}/projects'.replace('{organizationId}', organizationId);
11095
+ const payload = {};
11096
+ if (typeof projects !== 'undefined') {
11097
+ payload['projects'] = projects;
11098
+ }
11099
+ const uri = new URL(this.client.config.endpoint + apiPath);
11100
+ const apiHeaders = {
11101
+ 'content-type': 'application/json',
11102
+ };
11103
+ return this.client.call('patch', uri, apiHeaders, payload);
11104
+ }
10849
11105
  /**
10850
11106
  * Get Scopes
10851
11107
  *
@@ -10889,6 +11145,54 @@ class Organizations {
10889
11145
  };
10890
11146
  return this.client.call('patch', uri, apiHeaders, payload);
10891
11147
  }
11148
+ /**
11149
+ * Get the usage data for an organization.
11150
+ *
11151
+ * @param {string} organizationId
11152
+ * @param {string} startDate
11153
+ * @param {string} endDate
11154
+ * @throws {AppwriteException}
11155
+ * @returns {Promise<Models.UsageOrganization>}
11156
+ */
11157
+ getUsage(organizationId, startDate, endDate) {
11158
+ if (typeof organizationId === 'undefined') {
11159
+ throw new AppwriteException('Missing required parameter: "organizationId"');
11160
+ }
11161
+ const apiPath = '/organizations/{organizationId}/usage'.replace('{organizationId}', organizationId);
11162
+ const payload = {};
11163
+ if (typeof startDate !== 'undefined') {
11164
+ payload['startDate'] = startDate;
11165
+ }
11166
+ if (typeof endDate !== 'undefined') {
11167
+ payload['endDate'] = endDate;
11168
+ }
11169
+ const uri = new URL(this.client.config.endpoint + apiPath);
11170
+ const apiHeaders = {};
11171
+ return this.client.call('get', uri, apiHeaders, payload);
11172
+ }
11173
+ /**
11174
+ * Validate payment for team after creation or upgrade.
11175
+ *
11176
+ * @param {string} organizationId
11177
+ * @param {string[]} invites
11178
+ * @throws {AppwriteException}
11179
+ * @returns {Promise<Models.Organization<Preferences>>}
11180
+ */
11181
+ validatePayment(organizationId, invites) {
11182
+ if (typeof organizationId === 'undefined') {
11183
+ throw new AppwriteException('Missing required parameter: "organizationId"');
11184
+ }
11185
+ const apiPath = '/organizations/{organizationId}/validate'.replace('{organizationId}', organizationId);
11186
+ const payload = {};
11187
+ if (typeof invites !== 'undefined') {
11188
+ payload['invites'] = invites;
11189
+ }
11190
+ const uri = new URL(this.client.config.endpoint + apiPath);
11191
+ const apiHeaders = {
11192
+ 'content-type': 'application/json',
11193
+ };
11194
+ return this.client.call('patch', uri, apiHeaders, payload);
11195
+ }
10892
11196
  }
10893
11197
 
10894
11198
  class Project {
@@ -12765,10 +13069,12 @@ class Proxy {
12765
13069
  * @param {string} domain
12766
13070
  * @param {string} url
12767
13071
  * @param {StatusCode} statusCode
13072
+ * @param {string} resourceId
13073
+ * @param {ProxyResourceType} resourceType
12768
13074
  * @throws {AppwriteException}
12769
13075
  * @returns {Promise<Models.ProxyRule>}
12770
13076
  */
12771
- createRedirectRule(domain, url, statusCode) {
13077
+ createRedirectRule(domain, url, statusCode, resourceId, resourceType) {
12772
13078
  if (typeof domain === 'undefined') {
12773
13079
  throw new AppwriteException('Missing required parameter: "domain"');
12774
13080
  }
@@ -12778,6 +13084,12 @@ class Proxy {
12778
13084
  if (typeof statusCode === 'undefined') {
12779
13085
  throw new AppwriteException('Missing required parameter: "statusCode"');
12780
13086
  }
13087
+ if (typeof resourceId === 'undefined') {
13088
+ throw new AppwriteException('Missing required parameter: "resourceId"');
13089
+ }
13090
+ if (typeof resourceType === 'undefined') {
13091
+ throw new AppwriteException('Missing required parameter: "resourceType"');
13092
+ }
12781
13093
  const apiPath = '/proxy/rules/redirect';
12782
13094
  const payload = {};
12783
13095
  if (typeof domain !== 'undefined') {
@@ -12789,6 +13101,12 @@ class Proxy {
12789
13101
  if (typeof statusCode !== 'undefined') {
12790
13102
  payload['statusCode'] = statusCode;
12791
13103
  }
13104
+ if (typeof resourceId !== 'undefined') {
13105
+ payload['resourceId'] = resourceId;
13106
+ }
13107
+ if (typeof resourceType !== 'undefined') {
13108
+ payload['resourceType'] = resourceType;
13109
+ }
12792
13110
  const uri = new URL(this.client.config.endpoint + apiPath);
12793
13111
  const apiHeaders = {
12794
13112
  'content-type': 'application/json',
@@ -13351,8 +13669,8 @@ class Sites {
13351
13669
  }
13352
13670
  /**
13353
13671
  * Create a deployment based on a template.
13354
-
13355
- Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details.
13672
+ *
13673
+ * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/sites#listTemplates) to find the template details.
13356
13674
  *
13357
13675
  * @param {string} siteId
13358
13676
  * @param {string} repository
@@ -13404,8 +13722,8 @@ Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/s
13404
13722
  }
13405
13723
  /**
13406
13724
  * Create a deployment when a site is connected to VCS.
13407
-
13408
- This endpoint lets you create deployment from a branch, commit, or a tag.
13725
+ *
13726
+ * This endpoint lets you create deployment from a branch, commit, or a tag.
13409
13727
  *
13410
13728
  * @param {string} siteId
13411
13729
  * @param {VCSDeploymentType} type
@@ -13967,13 +14285,13 @@ class Storage {
13967
14285
  }
13968
14286
  /**
13969
14287
  * Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appwrite.io/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.
13970
-
13971
- Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
13972
-
13973
- When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file&#039;s **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
13974
-
13975
- If you&#039;re creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
13976
-
14288
+ *
14289
+ * Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.
14290
+ *
14291
+ * When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file&#039;s **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.
14292
+ *
14293
+ * If you&#039;re creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
14294
+ *
13977
14295
  *
13978
14296
  * @param {string} bucketId
13979
14297
  * @param {string} fileId
@@ -14214,7 +14532,7 @@ If you&#039;re creating a new file using one of the Appwrite SDKs, all the chunk
14214
14532
  }
14215
14533
  /**
14216
14534
  * Get usage metrics and statistics for all buckets in the project. You can view the total number of buckets, files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
14217
-
14535
+ *
14218
14536
  *
14219
14537
  * @param {StorageUsageRange} range
14220
14538
  * @throws {AppwriteException}
@@ -14232,7 +14550,7 @@ If you&#039;re creating a new file using one of the Appwrite SDKs, all the chunk
14232
14550
  }
14233
14551
  /**
14234
14552
  * Get usage metrics and statistics a specific bucket in the project. You can view the total number of files, storage usage. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
14235
-
14553
+ *
14236
14554
  *
14237
14555
  * @param {string} bucketId
14238
14556
  * @param {StorageUsageRange} range
@@ -14422,13 +14740,13 @@ class Teams {
14422
14740
  }
14423
14741
  /**
14424
14742
  * Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn&#039;t exist. If initiated from a Server SDK, the new member will be added automatically to the team.
14425
-
14426
- You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID &gt; email &gt; phone number if you provide more than one of these parameters.
14427
-
14428
- Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
14429
-
14430
- Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
14431
-
14743
+ *
14744
+ * You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID &gt; email &gt; phone number if you provide more than one of these parameters.
14745
+ *
14746
+ * Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
14747
+ *
14748
+ * Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
14749
+ *
14432
14750
  *
14433
14751
  * @param {string} teamId
14434
14752
  * @param {string[]} roles
@@ -14496,7 +14814,7 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee
14496
14814
  }
14497
14815
  /**
14498
14816
  * Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appwrite.io/docs/permissions).
14499
-
14817
+ *
14500
14818
  *
14501
14819
  * @param {string} teamId
14502
14820
  * @param {string} membershipId
@@ -14550,9 +14868,9 @@ Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatShee
14550
14868
  }
14551
14869
  /**
14552
14870
  * Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
14553
-
14554
- If the request is successful, a session for the user is automatically created.
14555
-
14871
+ *
14872
+ * If the request is successful, a session for the user is automatically created.
14873
+ *
14556
14874
  *
14557
14875
  * @param {string} teamId
14558
14876
  * @param {string} membershipId
@@ -15195,7 +15513,7 @@ class Users {
15195
15513
  }
15196
15514
  /**
15197
15515
  * Get usage metrics and statistics for all users in the project. You can view the total number of users and sessions. The response includes both current totals and historical data over time. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, range defaults to 30 days.
15198
-
15516
+ *
15199
15517
  *
15200
15518
  * @param {UserUsageRange} range
15201
15519
  * @throws {AppwriteException}
@@ -15302,8 +15620,8 @@ class Users {
15302
15620
  }
15303
15621
  /**
15304
15622
  * Update the user labels by its unique ID.
15305
-
15306
- Labels can be used to grant access to resources. While teams are a way for user&#039;s to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.
15623
+ *
15624
+ * Labels can be used to grant access to resources. While teams are a way for user&#039;s to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.
15307
15625
  *
15308
15626
  * @param {string} userId
15309
15627
  * @param {string[]} labels
@@ -15635,8 +15953,8 @@ Labels can be used to grant access to resources. While teams are a way for user&
15635
15953
  }
15636
15954
  /**
15637
15955
  * Creates a session for a user. Returns an immediately usable session object.
15638
-
15639
- If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint.
15956
+ *
15957
+ * If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint.
15640
15958
  *
15641
15959
  * @param {string} userId
15642
15960
  * @throws {AppwriteException}
@@ -15872,7 +16190,7 @@ If you want to generate a token for a custom authentication flow, use the [POST
15872
16190
  }
15873
16191
  /**
15874
16192
  * Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process.
15875
-
16193
+ *
15876
16194
  *
15877
16195
  * @param {string} userId
15878
16196
  * @param {number} length
@@ -16077,7 +16395,7 @@ class Vcs {
16077
16395
  }
16078
16396
  /**
16079
16397
  * Get a list of all branches from a GitHub repository in your installation. This endpoint returns the names of all branches in the repository and their total count. The GitHub installation must be properly configured and have access to the requested repository for this endpoint to work.
16080
-
16398
+ *
16081
16399
  *
16082
16400
  * @param {string} installationId
16083
16401
  * @param {string} providerRepositoryId
@@ -16099,15 +16417,15 @@ class Vcs {
16099
16417
  }
16100
16418
  /**
16101
16419
  * Get a list of files and directories from a GitHub repository connected to your project. This endpoint returns the contents of a specified repository path, including file names, sizes, and whether each item is a file or directory. The GitHub installation must be properly configured and the repository must be accessible through your installation for this endpoint to work.
16102
-
16103
16420
  *
16104
16421
  * @param {string} installationId
16105
16422
  * @param {string} providerRepositoryId
16106
16423
  * @param {string} providerRootDirectory
16424
+ * @param {string} providerReference
16107
16425
  * @throws {AppwriteException}
16108
16426
  * @returns {Promise<Models.VcsContentList>}
16109
16427
  */
16110
- getRepositoryContents(installationId, providerRepositoryId, providerRootDirectory) {
16428
+ getRepositoryContents(installationId, providerRepositoryId, providerRootDirectory, providerReference) {
16111
16429
  if (typeof installationId === 'undefined') {
16112
16430
  throw new AppwriteException('Missing required parameter: "installationId"');
16113
16431
  }
@@ -16119,6 +16437,9 @@ class Vcs {
16119
16437
  if (typeof providerRootDirectory !== 'undefined') {
16120
16438
  payload['providerRootDirectory'] = providerRootDirectory;
16121
16439
  }
16440
+ if (typeof providerReference !== 'undefined') {
16441
+ payload['providerReference'] = providerReference;
16442
+ }
16122
16443
  const uri = new URL(this.client.config.endpoint + apiPath);
16123
16444
  const apiHeaders = {};
16124
16445
  return this.client.call('get', uri, apiHeaders, payload);
@@ -16155,7 +16476,7 @@ class Vcs {
16155
16476
  }
16156
16477
  /**
16157
16478
  * List all VCS installations configured for the current project. This endpoint returns a list of installations including their provider, organization, and other configuration details.
16158
-
16479
+ *
16159
16480
  *
16160
16481
  * @param {string[]} queries
16161
16482
  * @param {string} search
@@ -16766,6 +17087,7 @@ var Runtime;
16766
17087
  Runtime["Dart31"] = "dart-3.1";
16767
17088
  Runtime["Dart33"] = "dart-3.3";
16768
17089
  Runtime["Dart35"] = "dart-3.5";
17090
+ Runtime["Dart38"] = "dart-3.8";
16769
17091
  Runtime["Dotnet60"] = "dotnet-6.0";
16770
17092
  Runtime["Dotnet70"] = "dotnet-7.0";
16771
17093
  Runtime["Dotnet80"] = "dotnet-8.0";
@@ -16792,6 +17114,7 @@ var Runtime;
16792
17114
  Runtime["Flutter324"] = "flutter-3.24";
16793
17115
  Runtime["Flutter327"] = "flutter-3.27";
16794
17116
  Runtime["Flutter329"] = "flutter-3.29";
17117
+ Runtime["Flutter332"] = "flutter-3.32";
16795
17118
  })(Runtime || (Runtime = {}));
16796
17119
 
16797
17120
  var FunctionUsageRange;
@@ -17229,6 +17552,12 @@ var StatusCode;
17229
17552
  StatusCode["PermanentRedirect308"] = "308";
17230
17553
  })(StatusCode || (StatusCode = {}));
17231
17554
 
17555
+ var ProxyResourceType;
17556
+ (function (ProxyResourceType) {
17557
+ ProxyResourceType["Site"] = "site";
17558
+ ProxyResourceType["Function"] = "function";
17559
+ })(ProxyResourceType || (ProxyResourceType = {}));
17560
+
17232
17561
  var Framework;
17233
17562
  (function (Framework) {
17234
17563
  Framework["Analog"] = "analog";
@@ -17283,6 +17612,7 @@ var BuildRuntime;
17283
17612
  BuildRuntime["Dart31"] = "dart-3.1";
17284
17613
  BuildRuntime["Dart33"] = "dart-3.3";
17285
17614
  BuildRuntime["Dart35"] = "dart-3.5";
17615
+ BuildRuntime["Dart38"] = "dart-3.8";
17286
17616
  BuildRuntime["Dotnet60"] = "dotnet-6.0";
17287
17617
  BuildRuntime["Dotnet70"] = "dotnet-7.0";
17288
17618
  BuildRuntime["Dotnet80"] = "dotnet-8.0";
@@ -17309,6 +17639,7 @@ var BuildRuntime;
17309
17639
  BuildRuntime["Flutter324"] = "flutter-3.24";
17310
17640
  BuildRuntime["Flutter327"] = "flutter-3.27";
17311
17641
  BuildRuntime["Flutter329"] = "flutter-3.29";
17642
+ BuildRuntime["Flutter332"] = "flutter-3.32";
17312
17643
  })(BuildRuntime || (BuildRuntime = {}));
17313
17644
 
17314
17645
  var Adapter;
@@ -17352,6 +17683,7 @@ var ImageFormat;
17352
17683
  ImageFormat["Webp"] = "webp";
17353
17684
  ImageFormat["Heic"] = "heic";
17354
17685
  ImageFormat["Avif"] = "avif";
17686
+ ImageFormat["Gif"] = "gif";
17355
17687
  })(ImageFormat || (ImageFormat = {}));
17356
17688
 
17357
17689
  var StorageUsageRange;
@@ -17396,5 +17728,5 @@ var VCSDetectionType;
17396
17728
  VCSDetectionType["Framework"] = "framework";
17397
17729
  })(VCSDetectionType || (VCSDetectionType = {}));
17398
17730
 
17399
- export { Account, Adapter, Api, ApiService, AppwriteException, Assistant, AuthMethod, AuthenticationFactor, AuthenticatorType, Avatars, Backups, BillingPlan, Browser, BuildRuntime, Client, Compression, Console, ConsoleResourceType, CreditCard, DatabaseUsageRange, Databases, DeploymentDownloadType, Domains, EmailTemplateLocale, EmailTemplateType, ExecutionMethod, Flag, Framework, FunctionUsageRange, Functions, Graphql, Health, ID, ImageFormat, ImageGravity, IndexType, Locale, MessagePriority, Messaging, MessagingProviderType, Migrations, Name, OAuthProvider, Organizations, PasswordHash, Permission, PlatformType, Project, ProjectUsageRange, Projects, Proxy, Query, Region, RelationMutate, RelationshipType, Role, Runtime, SMTPSecure, SiteUsageRange, Sites, SmsTemplateLocale, SmsTemplateType, SmtpEncryption, StatusCode, Storage, StorageUsageRange, Teams, Tokens, UserUsageRange, Users, VCSDeploymentType, VCSDetectionType, Vcs };
17731
+ export { Account, Adapter, Api, ApiService, AppwriteException, Assistant, AuthMethod, AuthenticationFactor, AuthenticatorType, Avatars, Backups, BillingPlan, Browser, BuildRuntime, Client, Compression, Console, ConsoleResourceType, CreditCard, DatabaseUsageRange, Databases, DeploymentDownloadType, Domains, EmailTemplateLocale, EmailTemplateType, ExecutionMethod, Flag, Framework, FunctionUsageRange, Functions, Graphql, Health, ID, ImageFormat, ImageGravity, IndexType, Locale, MessagePriority, Messaging, MessagingProviderType, Migrations, Name, OAuthProvider, Organizations, PasswordHash, Permission, PlatformType, Project, ProjectUsageRange, Projects, Proxy, ProxyResourceType, Query, Region, RelationMutate, RelationshipType, Role, Runtime, SMTPSecure, SiteUsageRange, Sites, SmsTemplateLocale, SmsTemplateType, SmtpEncryption, StatusCode, Storage, StorageUsageRange, Teams, Tokens, UserUsageRange, Users, VCSDeploymentType, VCSDetectionType, Vcs };
17400
17732
  //# sourceMappingURL=sdk.js.map