@appwrite.io/console 1.9.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (746) hide show
  1. package/.github/workflows/publish.yml +9 -8
  2. package/CHANGELOG.md +51 -6
  3. package/LICENSE +1 -1
  4. package/README.md +84 -4
  5. package/dist/cjs/sdk.js +15258 -6036
  6. package/dist/cjs/sdk.js.map +1 -1
  7. package/dist/esm/sdk.js +15256 -6037
  8. package/dist/esm/sdk.js.map +1 -1
  9. package/dist/iife/sdk.js +15258 -6036
  10. package/docs/examples/account/create-billing-address.md +8 -8
  11. package/docs/examples/account/create-email-password-session.md +4 -4
  12. package/docs/examples/account/create-email-token.md +5 -5
  13. package/docs/examples/account/{update-magic-u-r-l-session.md → create-email-verification.md} +3 -4
  14. package/docs/examples/account/{update-m-f-a.md → create-jwt.md} +3 -3
  15. package/docs/examples/account/{create-magic-u-r-l-token.md → create-magic-url-token.md} +6 -6
  16. package/docs/examples/account/create-mfa-authenticator.md +3 -3
  17. package/docs/examples/account/create-mfa-challenge.md +3 -3
  18. package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
  19. package/docs/examples/account/{create-o-auth2token.md → create-o-auth-2-session.md} +6 -6
  20. package/docs/examples/account/{create-o-auth2session.md → create-o-auth-2-token.md} +6 -6
  21. package/docs/examples/account/create-phone-token.md +4 -4
  22. package/docs/examples/account/create-push-target.md +5 -5
  23. package/docs/examples/account/create-recovery.md +4 -4
  24. package/docs/examples/account/create-session.md +4 -4
  25. package/docs/examples/account/create-verification.md +3 -3
  26. package/docs/examples/account/create.md +6 -6
  27. package/docs/examples/account/delete-billing-address.md +3 -3
  28. package/docs/examples/account/delete-identity.md +3 -3
  29. package/docs/examples/account/delete-mfa-authenticator.md +3 -3
  30. package/docs/examples/account/delete-payment-method.md +3 -3
  31. package/docs/examples/account/delete-push-target.md +3 -3
  32. package/docs/examples/account/delete-session.md +3 -3
  33. package/docs/examples/account/get-billing-address.md +3 -3
  34. package/docs/examples/account/get-coupon.md +3 -3
  35. package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
  36. package/docs/examples/account/get-payment-method.md +3 -3
  37. package/docs/examples/account/get-session.md +3 -3
  38. package/docs/examples/account/list-billing-addresses.md +3 -3
  39. package/docs/examples/account/list-identities.md +4 -3
  40. package/docs/examples/account/list-invoices.md +3 -3
  41. package/docs/examples/account/list-logs.md +4 -3
  42. package/docs/examples/account/list-mfa-factors.md +1 -1
  43. package/docs/examples/account/list-payment-methods.md +3 -3
  44. package/docs/examples/account/update-billing-address.md +9 -9
  45. package/docs/examples/account/update-email-verification.md +14 -0
  46. package/docs/examples/account/update-email.md +4 -4
  47. package/docs/examples/account/update-magic-url-session.md +14 -0
  48. package/docs/examples/account/update-mfa-authenticator.md +4 -4
  49. package/docs/examples/account/update-mfa-challenge.md +4 -4
  50. package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
  51. package/docs/examples/account/{create-j-w-t.md → update-mfa.md} +3 -1
  52. package/docs/examples/account/update-name.md +3 -3
  53. package/docs/examples/account/update-password.md +4 -4
  54. package/docs/examples/account/update-payment-method-mandate-options.md +3 -3
  55. package/docs/examples/account/update-payment-method-provider.md +6 -5
  56. package/docs/examples/account/update-payment-method.md +6 -5
  57. package/docs/examples/account/update-phone-session.md +4 -4
  58. package/docs/examples/account/update-phone-verification.md +4 -4
  59. package/docs/examples/account/update-phone.md +4 -4
  60. package/docs/examples/account/update-prefs.md +7 -3
  61. package/docs/examples/account/update-push-target.md +4 -4
  62. package/docs/examples/account/update-recovery.md +5 -5
  63. package/docs/examples/account/update-session.md +3 -3
  64. package/docs/examples/account/update-verification.md +4 -4
  65. package/docs/examples/assistant/chat.md +3 -3
  66. package/docs/examples/avatars/get-browser.md +6 -6
  67. package/docs/examples/avatars/get-credit-card.md +6 -6
  68. package/docs/examples/avatars/get-favicon.md +3 -3
  69. package/docs/examples/avatars/get-flag.md +6 -6
  70. package/docs/examples/avatars/get-image.md +5 -5
  71. package/docs/examples/avatars/get-initials.md +6 -6
  72. package/docs/examples/avatars/{get-q-r.md → get-qr.md} +6 -6
  73. package/docs/examples/avatars/get-screenshot.md +35 -0
  74. package/docs/examples/backups/create-archive.md +4 -4
  75. package/docs/examples/backups/create-policy.md +9 -9
  76. package/docs/examples/backups/create-restoration.md +6 -6
  77. package/docs/examples/backups/delete-archive.md +3 -3
  78. package/docs/examples/backups/delete-policy.md +3 -3
  79. package/docs/examples/backups/get-archive.md +3 -3
  80. package/docs/examples/backups/get-policy.md +3 -3
  81. package/docs/examples/backups/get-restoration.md +3 -3
  82. package/docs/examples/backups/list-archives.md +3 -3
  83. package/docs/examples/backups/list-policies.md +3 -3
  84. package/docs/examples/backups/list-restorations.md +3 -3
  85. package/docs/examples/backups/update-policy.md +7 -7
  86. package/docs/examples/console/create-program-membership.md +3 -3
  87. package/docs/examples/console/create-source.md +7 -7
  88. package/docs/examples/console/get-campaign.md +3 -3
  89. package/docs/examples/console/get-coupon.md +3 -3
  90. package/docs/examples/console/{plans.md → get-plan.md} +3 -1
  91. package/docs/examples/console/get-plans.md +13 -0
  92. package/docs/examples/console/{regions.md → get-program.md} +3 -1
  93. package/docs/examples/console/get-regions.md +13 -0
  94. package/docs/examples/console/get-resource.md +4 -4
  95. package/docs/examples/console/suggest-columns.md +17 -0
  96. package/docs/examples/console/suggest-indexes.md +16 -0
  97. package/docs/examples/databases/create-boolean-attribute.md +8 -8
  98. package/docs/examples/databases/create-collection.md +11 -9
  99. package/docs/examples/databases/create-datetime-attribute.md +8 -8
  100. package/docs/examples/databases/create-document.md +16 -11
  101. package/docs/examples/databases/create-documents.md +7 -6
  102. package/docs/examples/databases/create-email-attribute.md +8 -8
  103. package/docs/examples/databases/create-enum-attribute.md +9 -9
  104. package/docs/examples/databases/create-float-attribute.md +10 -10
  105. package/docs/examples/databases/create-index.md +9 -9
  106. package/docs/examples/databases/create-integer-attribute.md +10 -10
  107. package/docs/examples/databases/create-ip-attribute.md +8 -8
  108. package/docs/examples/databases/create-line-attribute.md +17 -0
  109. package/docs/examples/databases/create-operations.md +24 -0
  110. package/docs/examples/databases/create-point-attribute.md +17 -0
  111. package/docs/examples/databases/create-polygon-attribute.md +17 -0
  112. package/docs/examples/databases/create-relationship-attribute.md +10 -10
  113. package/docs/examples/databases/create-string-attribute.md +10 -10
  114. package/docs/examples/databases/create-transaction.md +13 -0
  115. package/docs/examples/databases/create-url-attribute.md +8 -8
  116. package/docs/examples/databases/create.md +5 -5
  117. package/docs/examples/databases/decrement-document-attribute.md +9 -8
  118. package/docs/examples/databases/delete-attribute.md +5 -5
  119. package/docs/examples/databases/delete-collection.md +4 -4
  120. package/docs/examples/databases/delete-document.md +6 -5
  121. package/docs/examples/databases/delete-documents.md +6 -5
  122. package/docs/examples/databases/delete-index.md +5 -5
  123. package/docs/examples/databases/{get-database-usage.md → delete-transaction.md} +4 -5
  124. package/docs/examples/databases/delete.md +3 -3
  125. package/docs/examples/databases/get-attribute.md +5 -5
  126. package/docs/examples/databases/get-collection-usage.md +6 -6
  127. package/docs/examples/databases/get-collection.md +4 -4
  128. package/docs/examples/databases/get-document.md +7 -6
  129. package/docs/examples/databases/get-index.md +5 -5
  130. package/docs/examples/databases/get-transaction.md +13 -0
  131. package/docs/examples/databases/get-usage.md +5 -4
  132. package/docs/examples/databases/get.md +3 -3
  133. package/docs/examples/databases/increment-document-attribute.md +9 -8
  134. package/docs/examples/databases/list-attributes.md +6 -5
  135. package/docs/examples/databases/list-collection-logs.md +5 -5
  136. package/docs/examples/databases/list-collections.md +6 -5
  137. package/docs/examples/databases/list-document-logs.md +6 -6
  138. package/docs/examples/databases/list-documents.md +7 -5
  139. package/docs/examples/databases/list-indexes.md +6 -5
  140. package/docs/examples/databases/list-logs.md +4 -4
  141. package/docs/examples/databases/list-transactions.md +13 -0
  142. package/docs/examples/databases/list-usage.md +13 -0
  143. package/docs/examples/databases/list.md +5 -4
  144. package/docs/examples/databases/update-boolean-attribute.md +8 -8
  145. package/docs/examples/databases/update-collection.md +9 -9
  146. package/docs/examples/databases/update-datetime-attribute.md +8 -8
  147. package/docs/examples/databases/update-document.md +15 -8
  148. package/docs/examples/databases/update-documents.md +13 -6
  149. package/docs/examples/databases/update-email-attribute.md +8 -8
  150. package/docs/examples/databases/update-enum-attribute.md +9 -9
  151. package/docs/examples/databases/update-float-attribute.md +10 -10
  152. package/docs/examples/databases/update-integer-attribute.md +10 -10
  153. package/docs/examples/databases/update-ip-attribute.md +8 -8
  154. package/docs/examples/databases/update-line-attribute.md +18 -0
  155. package/docs/examples/databases/update-point-attribute.md +18 -0
  156. package/docs/examples/databases/update-polygon-attribute.md +18 -0
  157. package/docs/examples/databases/update-relationship-attribute.md +7 -7
  158. package/docs/examples/databases/update-string-attribute.md +9 -9
  159. package/docs/examples/databases/update-transaction.md +15 -0
  160. package/docs/examples/databases/update-url-attribute.md +8 -8
  161. package/docs/examples/databases/update.md +5 -5
  162. package/docs/examples/databases/upsert-document.md +15 -8
  163. package/docs/examples/databases/upsert-documents.md +6 -5
  164. package/docs/examples/domains/create-preset-google-workspace.md +3 -3
  165. package/docs/examples/domains/create-preset-i-cloud.md +3 -3
  166. package/docs/examples/domains/create-preset-mailgun.md +3 -3
  167. package/docs/examples/domains/create-preset-outlook.md +3 -3
  168. package/docs/examples/domains/create-preset-proton-mail.md +3 -3
  169. package/docs/examples/domains/create-preset-zoho.md +3 -3
  170. package/docs/examples/domains/create-record-a.md +7 -7
  171. package/docs/examples/domains/{create-record-a-a-a-a.md → create-record-aaaa.md} +7 -7
  172. package/docs/examples/domains/create-record-alias.md +7 -7
  173. package/docs/examples/domains/{create-record-n-s.md → create-record-caa.md} +7 -7
  174. package/docs/examples/domains/{create-record-c-a-a.md → create-record-cname.md} +7 -7
  175. package/docs/examples/domains/{create-record-h-t-t-p-s.md → create-record-https.md} +7 -7
  176. package/docs/examples/domains/create-record-mx.md +18 -0
  177. package/docs/examples/domains/create-record-ns.md +17 -0
  178. package/docs/examples/domains/create-record-srv.md +20 -0
  179. package/docs/examples/domains/{create-record-c-n-a-m-e.md → create-record-txt.md} +7 -7
  180. package/docs/examples/domains/create.md +4 -4
  181. package/docs/examples/domains/delete-record.md +4 -4
  182. package/docs/examples/domains/delete.md +3 -3
  183. package/docs/examples/domains/get-preset-google-workspace.md +3 -3
  184. package/docs/examples/domains/get-preset-i-cloud.md +3 -3
  185. package/docs/examples/domains/get-preset-mailgun.md +3 -3
  186. package/docs/examples/domains/get-preset-outlook.md +3 -3
  187. package/docs/examples/domains/get-preset-proton-mail.md +3 -3
  188. package/docs/examples/domains/get-preset-zoho.md +3 -3
  189. package/docs/examples/domains/get-record.md +4 -4
  190. package/docs/examples/domains/get-zone.md +3 -3
  191. package/docs/examples/domains/get.md +3 -3
  192. package/docs/examples/domains/list-records.md +4 -4
  193. package/docs/examples/domains/list.md +4 -4
  194. package/docs/examples/domains/update-nameservers.md +3 -3
  195. package/docs/examples/domains/update-record-a.md +8 -8
  196. package/docs/examples/domains/update-record-aaaa.md +18 -0
  197. package/docs/examples/domains/update-record-alias.md +8 -8
  198. package/docs/examples/domains/update-record-caa.md +18 -0
  199. package/docs/examples/domains/update-record-cname.md +18 -0
  200. package/docs/examples/domains/update-record-https.md +18 -0
  201. package/docs/examples/domains/update-record-mx.md +19 -0
  202. package/docs/examples/domains/update-record-ns.md +18 -0
  203. package/docs/examples/domains/update-record-srv.md +21 -0
  204. package/docs/examples/domains/update-record-txt.md +18 -0
  205. package/docs/examples/domains/update-team.md +4 -4
  206. package/docs/examples/domains/update-zone.md +4 -4
  207. package/docs/examples/functions/create-deployment.md +7 -7
  208. package/docs/examples/functions/create-duplicate-deployment.md +5 -5
  209. package/docs/examples/functions/create-execution.md +9 -9
  210. package/docs/examples/functions/create-template-deployment.md +10 -9
  211. package/docs/examples/functions/create-variable.md +6 -6
  212. package/docs/examples/functions/create-vcs-deployment.md +7 -7
  213. package/docs/examples/functions/create.md +21 -21
  214. package/docs/examples/functions/delete-deployment.md +4 -4
  215. package/docs/examples/functions/delete-execution.md +4 -4
  216. package/docs/examples/functions/delete-variable.md +4 -4
  217. package/docs/examples/functions/delete.md +3 -3
  218. package/docs/examples/functions/get-deployment-download.md +5 -5
  219. package/docs/examples/functions/get-deployment.md +4 -4
  220. package/docs/examples/functions/get-execution.md +4 -4
  221. package/docs/examples/functions/get-template.md +3 -3
  222. package/docs/examples/functions/get-usage.md +5 -5
  223. package/docs/examples/functions/get-variable.md +4 -4
  224. package/docs/examples/functions/get.md +3 -3
  225. package/docs/examples/functions/list-deployments.md +6 -5
  226. package/docs/examples/functions/list-executions.md +5 -4
  227. package/docs/examples/functions/list-templates.md +7 -6
  228. package/docs/examples/functions/list-usage.md +4 -4
  229. package/docs/examples/functions/list-variables.md +3 -3
  230. package/docs/examples/functions/list.md +5 -4
  231. package/docs/examples/functions/update-deployment-status.md +4 -4
  232. package/docs/examples/functions/update-function-deployment.md +4 -4
  233. package/docs/examples/functions/update-variable.md +7 -7
  234. package/docs/examples/functions/update.md +21 -21
  235. package/docs/examples/graphql/mutation.md +3 -3
  236. package/docs/examples/graphql/query.md +3 -3
  237. package/docs/examples/health/get-certificate.md +3 -3
  238. package/docs/examples/health/get-failed-jobs.md +5 -5
  239. package/docs/examples/health/get-queue-billing-project-aggregation.md +3 -3
  240. package/docs/examples/health/get-queue-billing-team-aggregation.md +3 -3
  241. package/docs/examples/health/get-queue-builds.md +3 -3
  242. package/docs/examples/health/get-queue-certificates.md +3 -3
  243. package/docs/examples/health/get-queue-databases.md +4 -4
  244. package/docs/examples/health/get-queue-deletes.md +3 -3
  245. package/docs/examples/health/get-queue-functions.md +3 -3
  246. package/docs/examples/health/get-queue-logs.md +3 -3
  247. package/docs/examples/health/get-queue-mails.md +3 -3
  248. package/docs/examples/health/get-queue-messaging.md +3 -3
  249. package/docs/examples/health/get-queue-migrations.md +3 -3
  250. package/docs/examples/health/get-queue-priority-builds.md +3 -3
  251. package/docs/examples/health/get-queue-region-manager.md +3 -3
  252. package/docs/examples/health/get-queue-stats-resources.md +3 -3
  253. package/docs/examples/health/get-queue-threats.md +13 -0
  254. package/docs/examples/health/get-queue-usage.md +3 -3
  255. package/docs/examples/health/get-queue-webhooks.md +3 -3
  256. package/docs/examples/messaging/create-apns-provider.md +10 -10
  257. package/docs/examples/messaging/create-email.md +14 -14
  258. package/docs/examples/messaging/create-fcm-provider.md +6 -6
  259. package/docs/examples/messaging/create-mailgun-provider.md +12 -12
  260. package/docs/examples/messaging/{create-msg91provider.md → create-msg-91-provider.md} +8 -8
  261. package/docs/examples/messaging/create-push.md +21 -21
  262. package/docs/examples/messaging/create-resend-provider.md +20 -0
  263. package/docs/examples/messaging/create-sendgrid-provider.md +10 -10
  264. package/docs/examples/messaging/create-sms.md +9 -9
  265. package/docs/examples/messaging/create-smtp-provider.md +16 -16
  266. package/docs/examples/messaging/create-subscriber.md +5 -5
  267. package/docs/examples/messaging/create-telesign-provider.md +8 -8
  268. package/docs/examples/messaging/create-textmagic-provider.md +8 -8
  269. package/docs/examples/messaging/create-topic.md +5 -5
  270. package/docs/examples/messaging/create-twilio-provider.md +8 -8
  271. package/docs/examples/messaging/create-vonage-provider.md +8 -8
  272. package/docs/examples/messaging/delete-provider.md +3 -3
  273. package/docs/examples/messaging/delete-subscriber.md +4 -4
  274. package/docs/examples/messaging/delete-topic.md +3 -3
  275. package/docs/examples/messaging/delete.md +3 -3
  276. package/docs/examples/messaging/get-message.md +3 -3
  277. package/docs/examples/messaging/get-provider.md +3 -3
  278. package/docs/examples/messaging/get-subscriber.md +4 -4
  279. package/docs/examples/messaging/get-topic.md +3 -3
  280. package/docs/examples/messaging/list-message-logs.md +5 -4
  281. package/docs/examples/messaging/list-messages.md +5 -4
  282. package/docs/examples/messaging/list-provider-logs.md +5 -4
  283. package/docs/examples/messaging/list-providers.md +5 -4
  284. package/docs/examples/messaging/list-subscriber-logs.md +5 -4
  285. package/docs/examples/messaging/list-subscribers.md +6 -5
  286. package/docs/examples/messaging/list-targets.md +5 -4
  287. package/docs/examples/messaging/list-topic-logs.md +5 -4
  288. package/docs/examples/messaging/list-topics.md +5 -4
  289. package/docs/examples/messaging/update-apns-provider.md +10 -10
  290. package/docs/examples/messaging/update-email.md +14 -14
  291. package/docs/examples/messaging/update-fcm-provider.md +6 -6
  292. package/docs/examples/messaging/update-mailgun-provider.md +12 -12
  293. package/docs/examples/messaging/{update-msg91provider.md → update-msg-91-provider.md} +8 -8
  294. package/docs/examples/messaging/update-push.md +21 -21
  295. package/docs/examples/messaging/update-resend-provider.md +20 -0
  296. package/docs/examples/messaging/update-sendgrid-provider.md +10 -10
  297. package/docs/examples/messaging/update-sms.md +9 -9
  298. package/docs/examples/messaging/update-smtp-provider.md +16 -16
  299. package/docs/examples/messaging/update-telesign-provider.md +8 -8
  300. package/docs/examples/messaging/update-textmagic-provider.md +8 -8
  301. package/docs/examples/messaging/update-topic.md +5 -5
  302. package/docs/examples/messaging/update-twilio-provider.md +8 -8
  303. package/docs/examples/messaging/update-vonage-provider.md +8 -8
  304. package/docs/examples/migrations/create-appwrite-migration.md +6 -6
  305. package/docs/examples/migrations/create-csv-export.md +21 -0
  306. package/docs/examples/migrations/{create-csv-migration.md → create-csv-import.md} +6 -5
  307. package/docs/examples/migrations/create-firebase-migration.md +4 -4
  308. package/docs/examples/migrations/create-n-host-migration.md +10 -10
  309. package/docs/examples/migrations/create-supabase-migration.md +9 -9
  310. package/docs/examples/migrations/delete.md +3 -3
  311. package/docs/examples/migrations/get-appwrite-report.md +6 -6
  312. package/docs/examples/migrations/get-firebase-report.md +4 -4
  313. package/docs/examples/migrations/get-n-host-report.md +10 -10
  314. package/docs/examples/migrations/get-supabase-report.md +9 -9
  315. package/docs/examples/migrations/get.md +3 -3
  316. package/docs/examples/migrations/list.md +5 -4
  317. package/docs/examples/migrations/retry.md +3 -3
  318. package/docs/examples/organizations/add-credit.md +4 -4
  319. package/docs/examples/organizations/cancel-downgrade.md +3 -3
  320. package/docs/examples/organizations/create-downgrade-feedback.md +17 -0
  321. package/docs/examples/organizations/create-invoice-payment.md +5 -5
  322. package/docs/examples/organizations/create.md +13 -12
  323. package/docs/examples/organizations/delete-backup-payment-method.md +3 -3
  324. package/docs/examples/organizations/delete-billing-address.md +3 -3
  325. package/docs/examples/organizations/delete-default-payment-method.md +3 -3
  326. package/docs/examples/organizations/delete.md +3 -3
  327. package/docs/examples/organizations/estimation-create-organization.md +8 -7
  328. package/docs/examples/organizations/estimation-delete-organization.md +3 -3
  329. package/docs/examples/organizations/estimation-update-plan.md +7 -7
  330. package/docs/examples/organizations/get-aggregation.md +6 -4
  331. package/docs/examples/organizations/get-available-credits.md +13 -0
  332. package/docs/examples/organizations/get-billing-address.md +4 -4
  333. package/docs/examples/organizations/get-credit.md +4 -4
  334. package/docs/examples/organizations/get-invoice-download.md +4 -4
  335. package/docs/examples/organizations/get-invoice-view.md +4 -4
  336. package/docs/examples/organizations/get-invoice.md +4 -4
  337. package/docs/examples/organizations/get-payment-method.md +4 -4
  338. package/docs/examples/organizations/get-plan.md +3 -3
  339. package/docs/examples/organizations/get-scopes.md +3 -3
  340. package/docs/examples/organizations/get-usage.md +5 -5
  341. package/docs/examples/organizations/list-aggregations.md +4 -4
  342. package/docs/examples/organizations/list-credits.md +4 -4
  343. package/docs/examples/organizations/list-invoices.md +4 -4
  344. package/docs/examples/organizations/list.md +4 -4
  345. package/docs/examples/organizations/set-backup-payment-method.md +4 -4
  346. package/docs/examples/organizations/set-billing-address.md +4 -4
  347. package/docs/examples/organizations/set-billing-email.md +4 -4
  348. package/docs/examples/organizations/set-billing-tax-id.md +4 -4
  349. package/docs/examples/organizations/set-default-payment-method.md +4 -4
  350. package/docs/examples/organizations/update-budget.md +5 -5
  351. package/docs/examples/organizations/update-plan.md +11 -11
  352. package/docs/examples/organizations/update-projects.md +14 -0
  353. package/docs/examples/organizations/validate-invoice.md +4 -4
  354. package/docs/examples/organizations/validate-payment.md +4 -4
  355. package/docs/examples/project/create-variable.md +5 -5
  356. package/docs/examples/project/delete-variable.md +3 -3
  357. package/docs/examples/project/get-usage.md +5 -5
  358. package/docs/examples/project/get-variable.md +3 -3
  359. package/docs/examples/project/update-variable.md +6 -6
  360. package/docs/examples/projects/create-dev-key.md +5 -5
  361. package/docs/examples/projects/{create-j-w-t.md → create-jwt.md} +5 -5
  362. package/docs/examples/projects/create-key.md +6 -6
  363. package/docs/examples/projects/create-platform.md +8 -8
  364. package/docs/examples/projects/create-smtp-test.md +12 -12
  365. package/docs/examples/projects/create-webhook.md +10 -10
  366. package/docs/examples/projects/create.md +16 -16
  367. package/docs/examples/projects/delete-dev-key.md +4 -4
  368. package/docs/examples/projects/delete-email-template.md +5 -5
  369. package/docs/examples/projects/delete-key.md +4 -4
  370. package/docs/examples/projects/delete-platform.md +4 -4
  371. package/docs/examples/projects/delete-sms-template.md +5 -5
  372. package/docs/examples/projects/delete-webhook.md +4 -4
  373. package/docs/examples/projects/delete.md +3 -3
  374. package/docs/examples/projects/get-dev-key.md +4 -4
  375. package/docs/examples/projects/get-email-template.md +5 -5
  376. package/docs/examples/projects/get-key.md +4 -4
  377. package/docs/examples/projects/get-platform.md +4 -4
  378. package/docs/examples/projects/get-sms-template.md +5 -5
  379. package/docs/examples/projects/get-webhook.md +4 -4
  380. package/docs/examples/projects/get.md +3 -3
  381. package/docs/examples/projects/list-dev-keys.md +4 -4
  382. package/docs/examples/projects/list-keys.md +4 -3
  383. package/docs/examples/projects/list-platforms.md +4 -3
  384. package/docs/examples/projects/list-webhooks.md +4 -3
  385. package/docs/examples/projects/list.md +5 -4
  386. package/docs/examples/projects/update-api-status-all.md +4 -4
  387. package/docs/examples/projects/update-api-status.md +6 -6
  388. package/docs/examples/projects/update-auth-duration.md +4 -4
  389. package/docs/examples/projects/update-auth-limit.md +4 -4
  390. package/docs/examples/projects/update-auth-password-dictionary.md +4 -4
  391. package/docs/examples/projects/update-auth-password-history.md +4 -4
  392. package/docs/examples/projects/update-auth-sessions-limit.md +4 -4
  393. package/docs/examples/projects/update-auth-status.md +5 -5
  394. package/docs/examples/projects/update-dev-key.md +6 -6
  395. package/docs/examples/projects/update-email-template.md +10 -10
  396. package/docs/examples/projects/update-key.md +7 -7
  397. package/docs/examples/projects/update-memberships-privacy.md +6 -6
  398. package/docs/examples/projects/update-mock-numbers.md +4 -4
  399. package/docs/examples/projects/{update-o-auth2.md → update-o-auth-2.md} +7 -7
  400. package/docs/examples/projects/update-personal-data-check.md +4 -4
  401. package/docs/examples/projects/update-platform.md +8 -8
  402. package/docs/examples/projects/update-service-status-all.md +4 -4
  403. package/docs/examples/projects/update-service-status.md +5 -5
  404. package/docs/examples/projects/update-session-alerts.md +4 -4
  405. package/docs/examples/projects/update-session-invalidation.md +14 -0
  406. package/docs/examples/projects/update-sms-template.md +6 -6
  407. package/docs/examples/projects/update-smtp.md +12 -12
  408. package/docs/examples/projects/update-status.md +14 -0
  409. package/docs/examples/projects/update-team.md +4 -4
  410. package/docs/examples/projects/update-webhook-signature.md +4 -4
  411. package/docs/examples/projects/update-webhook.md +11 -11
  412. package/docs/examples/projects/update.md +13 -13
  413. package/docs/examples/proxy/{create-a-p-i-rule.md → create-api-rule.md} +3 -3
  414. package/docs/examples/proxy/create-function-rule.md +5 -5
  415. package/docs/examples/proxy/create-redirect-rule.md +8 -8
  416. package/docs/examples/proxy/create-site-rule.md +5 -5
  417. package/docs/examples/proxy/delete-rule.md +3 -3
  418. package/docs/examples/proxy/get-rule.md +3 -3
  419. package/docs/examples/proxy/list-rules.md +5 -4
  420. package/docs/examples/proxy/update-rule-verification.md +3 -3
  421. package/docs/examples/sites/create-deployment.md +8 -8
  422. package/docs/examples/sites/create-duplicate-deployment.md +4 -4
  423. package/docs/examples/sites/create-template-deployment.md +10 -9
  424. package/docs/examples/sites/create-variable.md +6 -6
  425. package/docs/examples/sites/create-vcs-deployment.md +7 -7
  426. package/docs/examples/sites/create.md +21 -21
  427. package/docs/examples/sites/delete-deployment.md +4 -4
  428. package/docs/examples/sites/delete-log.md +4 -4
  429. package/docs/examples/sites/delete-variable.md +4 -4
  430. package/docs/examples/sites/delete.md +3 -3
  431. package/docs/examples/sites/get-deployment-download.md +5 -5
  432. package/docs/examples/sites/get-deployment.md +4 -4
  433. package/docs/examples/sites/get-log.md +4 -4
  434. package/docs/examples/sites/get-template.md +3 -3
  435. package/docs/examples/sites/get-usage.md +5 -5
  436. package/docs/examples/sites/get-variable.md +4 -4
  437. package/docs/examples/sites/get.md +3 -3
  438. package/docs/examples/sites/list-deployments.md +6 -5
  439. package/docs/examples/sites/list-logs.md +5 -4
  440. package/docs/examples/sites/list-templates.md +6 -6
  441. package/docs/examples/sites/list-usage.md +4 -4
  442. package/docs/examples/sites/list-variables.md +3 -3
  443. package/docs/examples/sites/list.md +5 -4
  444. package/docs/examples/sites/update-deployment-status.md +4 -4
  445. package/docs/examples/sites/update-site-deployment.md +4 -4
  446. package/docs/examples/sites/update-variable.md +7 -7
  447. package/docs/examples/sites/update.md +21 -21
  448. package/docs/examples/storage/create-bucket.md +14 -13
  449. package/docs/examples/storage/create-file.md +7 -7
  450. package/docs/examples/storage/delete-bucket.md +3 -3
  451. package/docs/examples/storage/delete-file.md +4 -4
  452. package/docs/examples/storage/get-bucket-usage.md +5 -5
  453. package/docs/examples/storage/get-bucket.md +3 -3
  454. package/docs/examples/storage/get-file-download.md +5 -5
  455. package/docs/examples/storage/get-file-preview.md +16 -16
  456. package/docs/examples/storage/get-file-view.md +5 -5
  457. package/docs/examples/storage/get-file.md +4 -4
  458. package/docs/examples/storage/get-usage.md +4 -4
  459. package/docs/examples/storage/list-buckets.md +5 -4
  460. package/docs/examples/storage/list-files.md +6 -5
  461. package/docs/examples/storage/update-bucket.md +14 -13
  462. package/docs/examples/storage/update-file.md +7 -7
  463. package/docs/examples/tablesdb/create-boolean-column.md +18 -0
  464. package/docs/examples/tablesdb/create-datetime-column.md +18 -0
  465. package/docs/examples/tablesdb/create-email-column.md +18 -0
  466. package/docs/examples/tablesdb/create-enum-column.md +19 -0
  467. package/docs/examples/tablesdb/create-float-column.md +20 -0
  468. package/docs/examples/tablesdb/create-index.md +19 -0
  469. package/docs/examples/tablesdb/create-integer-column.md +20 -0
  470. package/docs/examples/tablesdb/create-ip-column.md +18 -0
  471. package/docs/examples/tablesdb/create-line-column.md +17 -0
  472. package/docs/examples/tablesdb/create-operations.md +24 -0
  473. package/docs/examples/tablesdb/create-point-column.md +17 -0
  474. package/docs/examples/tablesdb/create-polygon-column.md +17 -0
  475. package/docs/examples/tablesdb/create-relationship-column.md +20 -0
  476. package/docs/examples/tablesdb/create-row.md +24 -0
  477. package/docs/examples/tablesdb/create-rows.md +16 -0
  478. package/docs/examples/tablesdb/create-string-column.md +20 -0
  479. package/docs/examples/tablesdb/create-table.md +20 -0
  480. package/docs/examples/tablesdb/create-transaction.md +13 -0
  481. package/docs/examples/tablesdb/create-url-column.md +18 -0
  482. package/docs/examples/tablesdb/create.md +15 -0
  483. package/docs/examples/tablesdb/decrement-row-column.md +19 -0
  484. package/docs/examples/tablesdb/delete-column.md +15 -0
  485. package/docs/examples/tablesdb/delete-index.md +15 -0
  486. package/docs/examples/tablesdb/delete-row.md +16 -0
  487. package/docs/examples/tablesdb/delete-rows.md +16 -0
  488. package/docs/examples/tablesdb/delete-table.md +14 -0
  489. package/docs/examples/tablesdb/delete-transaction.md +13 -0
  490. package/docs/examples/tablesdb/delete.md +13 -0
  491. package/docs/examples/tablesdb/get-column.md +15 -0
  492. package/docs/examples/tablesdb/get-index.md +15 -0
  493. package/docs/examples/tablesdb/get-row.md +17 -0
  494. package/docs/examples/tablesdb/get-table-usage.md +15 -0
  495. package/docs/examples/tablesdb/get-table.md +14 -0
  496. package/docs/examples/tablesdb/get-transaction.md +13 -0
  497. package/docs/examples/tablesdb/get-usage.md +14 -0
  498. package/docs/examples/tablesdb/get.md +13 -0
  499. package/docs/examples/tablesdb/increment-row-column.md +19 -0
  500. package/docs/examples/tablesdb/list-columns.md +16 -0
  501. package/docs/examples/tablesdb/list-indexes.md +16 -0
  502. package/docs/examples/tablesdb/list-row-logs.md +16 -0
  503. package/docs/examples/tablesdb/list-rows.md +17 -0
  504. package/docs/examples/tablesdb/list-table-logs.md +15 -0
  505. package/docs/examples/tablesdb/list-tables.md +16 -0
  506. package/docs/examples/tablesdb/list-transactions.md +13 -0
  507. package/docs/examples/tablesdb/list-usage.md +13 -0
  508. package/docs/examples/tablesdb/list.md +15 -0
  509. package/docs/examples/tablesdb/update-boolean-column.md +18 -0
  510. package/docs/examples/tablesdb/update-datetime-column.md +18 -0
  511. package/docs/examples/tablesdb/update-email-column.md +18 -0
  512. package/docs/examples/tablesdb/update-enum-column.md +19 -0
  513. package/docs/examples/tablesdb/update-float-column.md +20 -0
  514. package/docs/examples/tablesdb/update-integer-column.md +20 -0
  515. package/docs/examples/tablesdb/update-ip-column.md +18 -0
  516. package/docs/examples/tablesdb/update-line-column.md +18 -0
  517. package/docs/examples/tablesdb/update-point-column.md +18 -0
  518. package/docs/examples/tablesdb/update-polygon-column.md +18 -0
  519. package/docs/examples/tablesdb/update-relationship-column.md +17 -0
  520. package/docs/examples/tablesdb/update-row.md +24 -0
  521. package/docs/examples/tablesdb/update-rows.md +23 -0
  522. package/docs/examples/tablesdb/update-string-column.md +19 -0
  523. package/docs/examples/tablesdb/update-table.md +18 -0
  524. package/docs/examples/tablesdb/update-transaction.md +15 -0
  525. package/docs/examples/tablesdb/update-url-column.md +18 -0
  526. package/docs/examples/tablesdb/update.md +15 -0
  527. package/docs/examples/tablesdb/upsert-row.md +24 -0
  528. package/docs/examples/tablesdb/upsert-rows.md +16 -0
  529. package/docs/examples/teams/create-membership.md +9 -9
  530. package/docs/examples/teams/create.md +5 -5
  531. package/docs/examples/teams/delete-membership.md +4 -4
  532. package/docs/examples/teams/delete.md +3 -3
  533. package/docs/examples/teams/get-membership.md +4 -4
  534. package/docs/examples/teams/get-prefs.md +3 -3
  535. package/docs/examples/teams/get.md +3 -3
  536. package/docs/examples/teams/list-logs.md +5 -4
  537. package/docs/examples/teams/list-memberships.md +6 -5
  538. package/docs/examples/teams/list.md +5 -4
  539. package/docs/examples/teams/update-membership-status.md +6 -6
  540. package/docs/examples/teams/update-membership.md +5 -5
  541. package/docs/examples/teams/update-name.md +4 -4
  542. package/docs/examples/teams/update-prefs.md +4 -4
  543. package/docs/examples/tokens/create-file-token.md +5 -5
  544. package/docs/examples/tokens/delete.md +3 -3
  545. package/docs/examples/tokens/get.md +3 -3
  546. package/docs/examples/tokens/list.md +6 -5
  547. package/docs/examples/tokens/update.md +4 -4
  548. package/docs/examples/users/{create-m-d5user.md → create-argon-2-user.md} +6 -6
  549. package/docs/examples/users/create-bcrypt-user.md +6 -6
  550. package/docs/examples/users/{create-j-w-t.md → create-jwt.md} +5 -5
  551. package/docs/examples/users/{create-argon2user.md → create-md-5-user.md} +6 -6
  552. package/docs/examples/users/create-mfa-recovery-codes.md +3 -3
  553. package/docs/examples/users/{create-p-h-pass-user.md → create-ph-pass-user.md} +6 -6
  554. package/docs/examples/users/create-scrypt-modified-user.md +9 -9
  555. package/docs/examples/users/create-scrypt-user.md +11 -11
  556. package/docs/examples/users/create-session.md +3 -3
  557. package/docs/examples/users/{create-s-h-a-user.md → create-sha-user.md} +7 -7
  558. package/docs/examples/users/create-target.md +8 -8
  559. package/docs/examples/users/create-token.md +5 -5
  560. package/docs/examples/users/create.md +7 -7
  561. package/docs/examples/users/delete-identity.md +3 -3
  562. package/docs/examples/users/delete-mfa-authenticator.md +4 -4
  563. package/docs/examples/users/delete-session.md +4 -4
  564. package/docs/examples/users/delete-sessions.md +3 -3
  565. package/docs/examples/users/delete-target.md +4 -4
  566. package/docs/examples/users/delete.md +3 -3
  567. package/docs/examples/users/get-mfa-recovery-codes.md +3 -3
  568. package/docs/examples/users/get-prefs.md +3 -3
  569. package/docs/examples/users/get-target.md +4 -4
  570. package/docs/examples/users/get-usage.md +4 -4
  571. package/docs/examples/users/get.md +3 -3
  572. package/docs/examples/users/list-identities.md +5 -4
  573. package/docs/examples/users/list-logs.md +5 -4
  574. package/docs/examples/users/list-memberships.md +6 -5
  575. package/docs/examples/users/list-mfa-factors.md +3 -3
  576. package/docs/examples/users/list-sessions.md +4 -3
  577. package/docs/examples/users/list-targets.md +5 -4
  578. package/docs/examples/users/list.md +5 -4
  579. package/docs/examples/users/update-email-verification.md +4 -4
  580. package/docs/examples/users/update-email.md +4 -4
  581. package/docs/examples/users/update-labels.md +4 -4
  582. package/docs/examples/users/update-mfa-recovery-codes.md +3 -3
  583. package/docs/examples/users/update-mfa.md +4 -4
  584. package/docs/examples/users/update-name.md +4 -4
  585. package/docs/examples/users/update-password.md +4 -4
  586. package/docs/examples/users/update-phone-verification.md +4 -4
  587. package/docs/examples/users/update-phone.md +4 -4
  588. package/docs/examples/users/update-prefs.md +4 -4
  589. package/docs/examples/users/update-status.md +4 -4
  590. package/docs/examples/users/update-target.md +7 -7
  591. package/docs/examples/vcs/create-repository-detection.md +6 -6
  592. package/docs/examples/vcs/create-repository.md +5 -5
  593. package/docs/examples/vcs/delete-installation.md +3 -3
  594. package/docs/examples/vcs/get-installation.md +3 -3
  595. package/docs/examples/vcs/get-repository-contents.md +6 -5
  596. package/docs/examples/vcs/get-repository.md +4 -4
  597. package/docs/examples/vcs/list-installations.md +5 -4
  598. package/docs/examples/vcs/list-repositories.md +6 -5
  599. package/docs/examples/vcs/list-repository-branches.md +4 -4
  600. package/docs/examples/vcs/update-external-deployments.md +5 -5
  601. package/package.json +4 -4
  602. package/src/client.ts +42 -7
  603. package/src/enums/api-service.ts +1 -0
  604. package/src/enums/attribute-status.ts +7 -0
  605. package/src/enums/billing-plan-group.ts +5 -0
  606. package/src/enums/build-runtime.ts +2 -0
  607. package/src/enums/column-status.ts +7 -0
  608. package/src/enums/credit-card.ts +1 -1
  609. package/src/enums/database-type.ts +4 -0
  610. package/src/enums/deployment-status.ts +7 -0
  611. package/src/enums/execution-method.ts +1 -0
  612. package/src/enums/execution-status.ts +7 -0
  613. package/src/enums/execution-trigger.ts +5 -0
  614. package/src/enums/framework.ts +1 -0
  615. package/src/enums/health-antivirus-status.ts +5 -0
  616. package/src/enums/health-check-status.ts +4 -0
  617. package/src/enums/index-status.ts +7 -0
  618. package/src/enums/index-type.ts +1 -0
  619. package/src/enums/message-status.ts +7 -0
  620. package/src/enums/o-auth-provider.ts +3 -0
  621. package/src/enums/platform.ts +4 -0
  622. package/src/enums/proxy-rule-deployment-resource-type.ts +4 -0
  623. package/src/enums/proxy-rule-status.ts +6 -0
  624. package/src/enums/region.ts +3 -0
  625. package/src/enums/runtime.ts +2 -0
  626. package/src/enums/status.ts +4 -0
  627. package/src/enums/template-reference-type.ts +5 -0
  628. package/src/enums/theme.ts +4 -0
  629. package/src/enums/timezone.ts +421 -0
  630. package/src/enums/{user-usage-range.ts → usage-range.ts} +1 -1
  631. package/src/enums/{v-c-s-deployment-type.ts → vcs-reference-type.ts} +1 -1
  632. package/src/index.ts +27 -11
  633. package/src/models.ts +1925 -239
  634. package/src/operator.ts +308 -0
  635. package/src/query.ts +246 -2
  636. package/src/services/account.ts +2278 -235
  637. package/src/services/assistant.ts +29 -3
  638. package/src/services/avatars.ts +511 -52
  639. package/src/services/backups.ts +400 -42
  640. package/src/services/console.ts +499 -19
  641. package/src/services/databases.ts +3584 -430
  642. package/src/services/domains.ts +1795 -266
  643. package/src/services/functions.ts +1197 -155
  644. package/src/services/graphql.ts +56 -4
  645. package/src/services/health.ts +586 -42
  646. package/src/services/locale.ts +18 -2
  647. package/src/services/messaging.ts +3418 -386
  648. package/src/services/migrations.ts +653 -65
  649. package/src/services/organizations.ts +1411 -126
  650. package/src/services/project.ts +173 -17
  651. package/src/services/projects.ts +2808 -282
  652. package/src/services/proxy.ts +272 -26
  653. package/src/services/realtime.ts +437 -0
  654. package/src/services/sites.ts +1129 -143
  655. package/src/services/storage.ts +672 -89
  656. package/src/services/tables-db.ts +5439 -0
  657. package/src/services/teams.ts +535 -65
  658. package/src/services/tokens.ts +171 -16
  659. package/src/services/users.ts +1916 -182
  660. package/src/services/vcs.ts +373 -41
  661. package/types/client.d.ts +14 -5
  662. package/types/enums/api-service.d.ts +1 -0
  663. package/types/enums/attribute-status.d.ts +7 -0
  664. package/types/enums/billing-plan-group.d.ts +5 -0
  665. package/types/enums/build-runtime.d.ts +3 -1
  666. package/types/enums/column-status.d.ts +7 -0
  667. package/types/enums/credit-card.d.ts +1 -1
  668. package/types/enums/database-type.d.ts +4 -0
  669. package/types/enums/deployment-status.d.ts +7 -0
  670. package/types/enums/execution-method.d.ts +2 -1
  671. package/types/enums/execution-status.d.ts +7 -0
  672. package/types/enums/execution-trigger.d.ts +5 -0
  673. package/types/enums/framework.d.ts +1 -0
  674. package/types/enums/health-antivirus-status.d.ts +5 -0
  675. package/types/enums/health-check-status.d.ts +4 -0
  676. package/types/enums/index-status.d.ts +7 -0
  677. package/types/enums/index-type.d.ts +2 -1
  678. package/types/enums/message-status.d.ts +7 -0
  679. package/types/enums/o-auth-provider.d.ts +4 -1
  680. package/types/enums/platform.d.ts +4 -0
  681. package/types/enums/proxy-rule-deployment-resource-type.d.ts +4 -0
  682. package/types/enums/proxy-rule-status.d.ts +6 -0
  683. package/types/enums/region.d.ts +4 -1
  684. package/types/enums/runtime.d.ts +3 -1
  685. package/types/enums/status.d.ts +4 -0
  686. package/types/enums/template-reference-type.d.ts +5 -0
  687. package/types/enums/theme.d.ts +4 -0
  688. package/types/enums/timezone.d.ts +421 -0
  689. package/types/enums/{site-usage-range.d.ts → usage-range.d.ts} +1 -1
  690. package/types/enums/{v-c-s-deployment-type.d.ts → vcs-reference-type.d.ts} +1 -1
  691. package/types/index.d.ts +27 -11
  692. package/types/models.d.ts +1877 -422
  693. package/types/operator.d.ts +180 -0
  694. package/types/query.d.ts +198 -2
  695. package/types/services/account.d.ts +1020 -158
  696. package/types/services/assistant.d.ts +13 -2
  697. package/types/services/avatars.d.ts +263 -45
  698. package/types/services/backups.d.ts +190 -30
  699. package/types/services/console.d.ts +202 -15
  700. package/types/services/databases.d.ts +1756 -299
  701. package/types/services/domains.d.ts +971 -219
  702. package/types/services/functions.d.ts +622 -131
  703. package/types/services/graphql.d.ts +24 -2
  704. package/types/services/health.d.ts +246 -24
  705. package/types/services/locale.d.ts +2 -2
  706. package/types/services/messaging.d.ts +1670 -281
  707. package/types/services/migrations.d.ts +319 -53
  708. package/types/services/organizations.d.ts +664 -109
  709. package/types/services/project.d.ts +81 -12
  710. package/types/services/projects.d.ts +1308 -202
  711. package/types/services/proxy.d.ts +128 -19
  712. package/types/services/realtime.d.ts +118 -0
  713. package/types/services/sites.d.ts +580 -119
  714. package/types/services/storage.d.ts +362 -81
  715. package/types/services/tables-db.d.ts +2040 -0
  716. package/types/services/teams.d.ts +277 -61
  717. package/types/services/tokens.d.ts +80 -12
  718. package/types/services/users.d.ts +906 -149
  719. package/types/services/vcs.d.ts +182 -34
  720. package/docs/examples/domains/create-record-m-x.md +0 -18
  721. package/docs/examples/domains/create-record-s-r-v.md +0 -20
  722. package/docs/examples/domains/create-record-t-x-t.md +0 -17
  723. package/docs/examples/domains/update-record-a-a-a-a.md +0 -18
  724. package/docs/examples/domains/update-record-c-a-a.md +0 -18
  725. package/docs/examples/domains/update-record-c-n-a-m-e.md +0 -18
  726. package/docs/examples/domains/update-record-h-t-t-p-s.md +0 -18
  727. package/docs/examples/domains/update-record-m-x.md +0 -19
  728. package/docs/examples/domains/update-record-n-s.md +0 -18
  729. package/docs/examples/domains/update-record-s-r-v.md +0 -21
  730. package/docs/examples/domains/update-record-t-x-t.md +0 -18
  731. package/src/enums/billing-plan.ts +0 -5
  732. package/src/enums/database-usage-range.ts +0 -5
  733. package/src/enums/function-usage-range.ts +0 -5
  734. package/src/enums/site-usage-range.ts +0 -5
  735. package/src/enums/storage-usage-range.ts +0 -5
  736. package/types/enums/billing-plan.d.ts +0 -5
  737. package/types/enums/database-usage-range.d.ts +0 -5
  738. package/types/enums/function-usage-range.d.ts +0 -5
  739. package/types/enums/storage-usage-range.d.ts +0 -5
  740. package/types/enums/user-usage-range.d.ts +0 -5
  741. /package/docs/examples/health/{get-d-b.md → get-db.md} +0 -0
  742. /package/docs/examples/locale/{list-countries-e-u.md → list-countries-eu.md} +0 -0
  743. /package/src/enums/{s-m-t-p-secure.ts → smtp-secure.ts} +0 -0
  744. /package/src/enums/{v-c-s-detection-type.ts → vcs-detection-type.ts} +0 -0
  745. /package/types/enums/{s-m-t-p-secure.d.ts → smtp-secure.d.ts} +0 -0
  746. /package/types/enums/{v-c-s-detection-type.d.ts → vcs-detection-type.d.ts} +0 -0
@@ -1,9 +1,11 @@
1
1
  import { Service } from '../service';
2
2
  import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
3
3
  import type { Models } from '../models';
4
+
4
5
  import { Runtime } from '../enums/runtime';
5
- import { FunctionUsageRange } from '../enums/function-usage-range';
6
- import { VCSDeploymentType } from '../enums/v-c-s-deployment-type';
6
+ import { UsageRange } from '../enums/usage-range';
7
+ import { TemplateReferenceType } from '../enums/template-reference-type';
8
+ import { VCSReferenceType } from '../enums/vcs-reference-type';
7
9
  import { DeploymentDownloadType } from '../enums/deployment-download-type';
8
10
  import { ExecutionMethod } from '../enums/execution-method';
9
11
 
@@ -15,14 +17,47 @@ export class Functions {
15
17
  }
16
18
 
17
19
  /**
18
- * Get a list of all the project's functions. You can use the query params to filter your results.
20
+ * Get a list of all the project's functions. You can use the query params to filter your results.
21
+ *
22
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
23
+ * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
24
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
25
+ * @throws {AppwriteException}
26
+ * @returns {Promise<Models.FunctionList>}
27
+ */
28
+ list(params?: { queries?: string[], search?: string, total?: boolean }): Promise<Models.FunctionList>;
29
+ /**
30
+ * Get a list of all the project's functions. You can use the query params to filter your results.
19
31
  *
20
- * @param {string[]} queries
21
- * @param {string} search
32
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId
33
+ * @param {string} search - Search term to filter your list results. Max length: 256 chars.
34
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
22
35
  * @throws {AppwriteException}
23
36
  * @returns {Promise<Models.FunctionList>}
37
+ * @deprecated Use the object parameter style method for a better developer experience.
24
38
  */
25
- list(queries?: string[], search?: string): Promise<Models.FunctionList> {
39
+ list(queries?: string[], search?: string, total?: boolean): Promise<Models.FunctionList>;
40
+ list(
41
+ paramsOrFirst?: { queries?: string[], search?: string, total?: boolean } | string[],
42
+ ...rest: [(string)?, (boolean)?]
43
+ ): Promise<Models.FunctionList> {
44
+ let params: { queries?: string[], search?: string, total?: boolean };
45
+
46
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
47
+ params = (paramsOrFirst || {}) as { queries?: string[], search?: string, total?: boolean };
48
+ } else {
49
+ params = {
50
+ queries: paramsOrFirst as string[],
51
+ search: rest[0] as string,
52
+ total: rest[1] as boolean
53
+ };
54
+ }
55
+
56
+ const queries = params.queries;
57
+ const search = params.search;
58
+ const total = params.total;
59
+
60
+
26
61
  const apiPath = '/functions';
27
62
  const payload: Payload = {};
28
63
  if (typeof queries !== 'undefined') {
@@ -31,6 +66,9 @@ export class Functions {
31
66
  if (typeof search !== 'undefined') {
32
67
  payload['search'] = search;
33
68
  }
69
+ if (typeof total !== 'undefined') {
70
+ payload['total'] = total;
71
+ }
34
72
  const uri = new URL(this.client.config.endpoint + apiPath);
35
73
 
36
74
  const apiHeaders: { [header: string]: string } = {
@@ -43,31 +81,108 @@ export class Functions {
43
81
  payload
44
82
  );
45
83
  }
84
+
46
85
  /**
47
86
  * Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
48
87
  *
49
- * @param {string} functionId
50
- * @param {string} name
51
- * @param {Runtime} runtime
52
- * @param {string[]} execute
53
- * @param {string[]} events
54
- * @param {string} schedule
55
- * @param {number} timeout
56
- * @param {boolean} enabled
57
- * @param {boolean} logging
58
- * @param {string} entrypoint
59
- * @param {string} commands
60
- * @param {string[]} scopes
61
- * @param {string} installationId
62
- * @param {string} providerRepositoryId
63
- * @param {string} providerBranch
64
- * @param {boolean} providerSilentMode
65
- * @param {string} providerRootDirectory
66
- * @param {string} specification
88
+ * @param {string} params.functionId - Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
89
+ * @param {string} params.name - Function name. Max length: 128 chars.
90
+ * @param {Runtime} params.runtime - Execution runtime.
91
+ * @param {string[]} params.execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
92
+ * @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
93
+ * @param {string} params.schedule - Schedule CRON syntax.
94
+ * @param {number} params.timeout - Function maximum execution time in seconds.
95
+ * @param {boolean} params.enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
96
+ * @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
97
+ * @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
98
+ * @param {string} params.commands - Build Commands.
99
+ * @param {string[]} params.scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
100
+ * @param {string} params.installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
101
+ * @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function.
102
+ * @param {string} params.providerBranch - Production branch for the repo linked to the function.
103
+ * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
104
+ * @param {string} params.providerRootDirectory - Path to function code in the linked repo.
105
+ * @param {string} params.specification - Runtime specification for the function and builds.
67
106
  * @throws {AppwriteException}
68
107
  * @returns {Promise<Models.Function>}
69
108
  */
70
- create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function> {
109
+ create(params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise<Models.Function>;
110
+ /**
111
+ * Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.
112
+ *
113
+ * @param {string} functionId - Function ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
114
+ * @param {string} name - Function name. Max length: 128 chars.
115
+ * @param {Runtime} runtime - Execution runtime.
116
+ * @param {string[]} execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
117
+ * @param {string[]} events - Events list. Maximum of 100 events are allowed.
118
+ * @param {string} schedule - Schedule CRON syntax.
119
+ * @param {number} timeout - Function maximum execution time in seconds.
120
+ * @param {boolean} enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
121
+ * @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
122
+ * @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
123
+ * @param {string} commands - Build Commands.
124
+ * @param {string[]} scopes - List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
125
+ * @param {string} installationId - Appwrite Installation ID for VCS (Version Control System) deployment.
126
+ * @param {string} providerRepositoryId - Repository ID of the repo linked to the function.
127
+ * @param {string} providerBranch - Production branch for the repo linked to the function.
128
+ * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
129
+ * @param {string} providerRootDirectory - Path to function code in the linked repo.
130
+ * @param {string} specification - Runtime specification for the function and builds.
131
+ * @throws {AppwriteException}
132
+ * @returns {Promise<Models.Function>}
133
+ * @deprecated Use the object parameter style method for a better developer experience.
134
+ */
135
+ create(functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
136
+ create(
137
+ paramsOrFirst: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string,
138
+ ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number)?, (boolean)?, (boolean)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?]
139
+ ): Promise<Models.Function> {
140
+ let params: { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string };
141
+
142
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
143
+ params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string };
144
+ } else {
145
+ params = {
146
+ functionId: paramsOrFirst as string,
147
+ name: rest[0] as string,
148
+ runtime: rest[1] as Runtime,
149
+ execute: rest[2] as string[],
150
+ events: rest[3] as string[],
151
+ schedule: rest[4] as string,
152
+ timeout: rest[5] as number,
153
+ enabled: rest[6] as boolean,
154
+ logging: rest[7] as boolean,
155
+ entrypoint: rest[8] as string,
156
+ commands: rest[9] as string,
157
+ scopes: rest[10] as string[],
158
+ installationId: rest[11] as string,
159
+ providerRepositoryId: rest[12] as string,
160
+ providerBranch: rest[13] as string,
161
+ providerSilentMode: rest[14] as boolean,
162
+ providerRootDirectory: rest[15] as string,
163
+ specification: rest[16] as string
164
+ };
165
+ }
166
+
167
+ const functionId = params.functionId;
168
+ const name = params.name;
169
+ const runtime = params.runtime;
170
+ const execute = params.execute;
171
+ const events = params.events;
172
+ const schedule = params.schedule;
173
+ const timeout = params.timeout;
174
+ const enabled = params.enabled;
175
+ const logging = params.logging;
176
+ const entrypoint = params.entrypoint;
177
+ const commands = params.commands;
178
+ const scopes = params.scopes;
179
+ const installationId = params.installationId;
180
+ const providerRepositoryId = params.providerRepositoryId;
181
+ const providerBranch = params.providerBranch;
182
+ const providerSilentMode = params.providerSilentMode;
183
+ const providerRootDirectory = params.providerRootDirectory;
184
+ const specification = params.specification;
185
+
71
186
  if (typeof functionId === 'undefined') {
72
187
  throw new AppwriteException('Missing required parameter: "functionId"');
73
188
  }
@@ -77,6 +192,7 @@ export class Functions {
77
192
  if (typeof runtime === 'undefined') {
78
193
  throw new AppwriteException('Missing required parameter: "runtime"');
79
194
  }
195
+
80
196
  const apiPath = '/functions';
81
197
  const payload: Payload = {};
82
198
  if (typeof functionId !== 'undefined') {
@@ -146,6 +262,7 @@ export class Functions {
146
262
  payload
147
263
  );
148
264
  }
265
+
149
266
  /**
150
267
  * Get a list of all runtimes that are currently active on your instance.
151
268
  *
@@ -153,6 +270,7 @@ export class Functions {
153
270
  * @returns {Promise<Models.RuntimeList>}
154
271
  */
155
272
  listRuntimes(): Promise<Models.RuntimeList> {
273
+
156
274
  const apiPath = '/functions/runtimes';
157
275
  const payload: Payload = {};
158
276
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -167,6 +285,7 @@ export class Functions {
167
285
  payload
168
286
  );
169
287
  }
288
+
170
289
  /**
171
290
  * List allowed function specifications for this instance.
172
291
  *
@@ -174,6 +293,7 @@ export class Functions {
174
293
  * @returns {Promise<Models.SpecificationList>}
175
294
  */
176
295
  listSpecifications(): Promise<Models.SpecificationList> {
296
+
177
297
  const apiPath = '/functions/specifications';
178
298
  const payload: Payload = {};
179
299
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -188,17 +308,57 @@ export class Functions {
188
308
  payload
189
309
  );
190
310
  }
311
+
312
+ /**
313
+ * List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
314
+ *
315
+ * @param {string[]} params.runtimes - List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.
316
+ * @param {string[]} params.useCases - List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.
317
+ * @param {number} params.limit - Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.
318
+ * @param {number} params.offset - Offset the list of returned templates. Maximum offset is 5000.
319
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
320
+ * @throws {AppwriteException}
321
+ * @returns {Promise<Models.TemplateFunctionList>}
322
+ */
323
+ listTemplates(params?: { runtimes?: string[], useCases?: string[], limit?: number, offset?: number, total?: boolean }): Promise<Models.TemplateFunctionList>;
191
324
  /**
192
325
  * List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
193
326
  *
194
- * @param {string[]} runtimes
195
- * @param {string[]} useCases
196
- * @param {number} limit
197
- * @param {number} offset
327
+ * @param {string[]} runtimes - List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.
328
+ * @param {string[]} useCases - List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.
329
+ * @param {number} limit - Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.
330
+ * @param {number} offset - Offset the list of returned templates. Maximum offset is 5000.
331
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
198
332
  * @throws {AppwriteException}
199
333
  * @returns {Promise<Models.TemplateFunctionList>}
334
+ * @deprecated Use the object parameter style method for a better developer experience.
200
335
  */
201
- listTemplates(runtimes?: string[], useCases?: string[], limit?: number, offset?: number): Promise<Models.TemplateFunctionList> {
336
+ listTemplates(runtimes?: string[], useCases?: string[], limit?: number, offset?: number, total?: boolean): Promise<Models.TemplateFunctionList>;
337
+ listTemplates(
338
+ paramsOrFirst?: { runtimes?: string[], useCases?: string[], limit?: number, offset?: number, total?: boolean } | string[],
339
+ ...rest: [(string[])?, (number)?, (number)?, (boolean)?]
340
+ ): Promise<Models.TemplateFunctionList> {
341
+ let params: { runtimes?: string[], useCases?: string[], limit?: number, offset?: number, total?: boolean };
342
+
343
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
344
+ params = (paramsOrFirst || {}) as { runtimes?: string[], useCases?: string[], limit?: number, offset?: number, total?: boolean };
345
+ } else {
346
+ params = {
347
+ runtimes: paramsOrFirst as string[],
348
+ useCases: rest[0] as string[],
349
+ limit: rest[1] as number,
350
+ offset: rest[2] as number,
351
+ total: rest[3] as boolean
352
+ };
353
+ }
354
+
355
+ const runtimes = params.runtimes;
356
+ const useCases = params.useCases;
357
+ const limit = params.limit;
358
+ const offset = params.offset;
359
+ const total = params.total;
360
+
361
+
202
362
  const apiPath = '/functions/templates';
203
363
  const payload: Payload = {};
204
364
  if (typeof runtimes !== 'undefined') {
@@ -213,6 +373,9 @@ export class Functions {
213
373
  if (typeof offset !== 'undefined') {
214
374
  payload['offset'] = offset;
215
375
  }
376
+ if (typeof total !== 'undefined') {
377
+ payload['total'] = total;
378
+ }
216
379
  const uri = new URL(this.client.config.endpoint + apiPath);
217
380
 
218
381
  const apiHeaders: { [header: string]: string } = {
@@ -225,17 +388,43 @@ export class Functions {
225
388
  payload
226
389
  );
227
390
  }
391
+
392
+ /**
393
+ * Get a function template using ID. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
394
+ *
395
+ * @param {string} params.templateId - Template ID.
396
+ * @throws {AppwriteException}
397
+ * @returns {Promise<Models.TemplateFunction>}
398
+ */
399
+ getTemplate(params: { templateId: string }): Promise<Models.TemplateFunction>;
228
400
  /**
229
401
  * Get a function template using ID. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.
230
402
  *
231
- * @param {string} templateId
403
+ * @param {string} templateId - Template ID.
232
404
  * @throws {AppwriteException}
233
405
  * @returns {Promise<Models.TemplateFunction>}
406
+ * @deprecated Use the object parameter style method for a better developer experience.
234
407
  */
235
- getTemplate(templateId: string): Promise<Models.TemplateFunction> {
408
+ getTemplate(templateId: string): Promise<Models.TemplateFunction>;
409
+ getTemplate(
410
+ paramsOrFirst: { templateId: string } | string
411
+ ): Promise<Models.TemplateFunction> {
412
+ let params: { templateId: string };
413
+
414
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
415
+ params = (paramsOrFirst || {}) as { templateId: string };
416
+ } else {
417
+ params = {
418
+ templateId: paramsOrFirst as string
419
+ };
420
+ }
421
+
422
+ const templateId = params.templateId;
423
+
236
424
  if (typeof templateId === 'undefined') {
237
425
  throw new AppwriteException('Missing required parameter: "templateId"');
238
426
  }
427
+
239
428
  const apiPath = '/functions/templates/{templateId}'.replace('{templateId}', templateId);
240
429
  const payload: Payload = {};
241
430
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -250,14 +439,40 @@ export class Functions {
250
439
  payload
251
440
  );
252
441
  }
442
+
443
+ /**
444
+ * Get usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. 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, defaults to 30 days.
445
+ *
446
+ * @param {UsageRange} params.range - Date range.
447
+ * @throws {AppwriteException}
448
+ * @returns {Promise<Models.UsageFunctions>}
449
+ */
450
+ listUsage(params?: { range?: UsageRange }): Promise<Models.UsageFunctions>;
253
451
  /**
254
452
  * Get usage metrics and statistics for all functions in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. 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, defaults to 30 days.
255
453
  *
256
- * @param {FunctionUsageRange} range
454
+ * @param {UsageRange} range - Date range.
257
455
  * @throws {AppwriteException}
258
456
  * @returns {Promise<Models.UsageFunctions>}
457
+ * @deprecated Use the object parameter style method for a better developer experience.
259
458
  */
260
- listUsage(range?: FunctionUsageRange): Promise<Models.UsageFunctions> {
459
+ listUsage(range?: UsageRange): Promise<Models.UsageFunctions>;
460
+ listUsage(
461
+ paramsOrFirst?: { range?: UsageRange } | UsageRange
462
+ ): Promise<Models.UsageFunctions> {
463
+ let params: { range?: UsageRange };
464
+
465
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
466
+ params = (paramsOrFirst || {}) as { range?: UsageRange };
467
+ } else {
468
+ params = {
469
+ range: paramsOrFirst as UsageRange
470
+ };
471
+ }
472
+
473
+ const range = params.range;
474
+
475
+
261
476
  const apiPath = '/functions/usage';
262
477
  const payload: Payload = {};
263
478
  if (typeof range !== 'undefined') {
@@ -275,17 +490,43 @@ export class Functions {
275
490
  payload
276
491
  );
277
492
  }
493
+
278
494
  /**
279
495
  * Get a function by its unique ID.
280
496
  *
281
- * @param {string} functionId
497
+ * @param {string} params.functionId - Function ID.
282
498
  * @throws {AppwriteException}
283
499
  * @returns {Promise<Models.Function>}
284
500
  */
285
- get(functionId: string): Promise<Models.Function> {
501
+ get(params: { functionId: string }): Promise<Models.Function>;
502
+ /**
503
+ * Get a function by its unique ID.
504
+ *
505
+ * @param {string} functionId - Function ID.
506
+ * @throws {AppwriteException}
507
+ * @returns {Promise<Models.Function>}
508
+ * @deprecated Use the object parameter style method for a better developer experience.
509
+ */
510
+ get(functionId: string): Promise<Models.Function>;
511
+ get(
512
+ paramsOrFirst: { functionId: string } | string
513
+ ): Promise<Models.Function> {
514
+ let params: { functionId: string };
515
+
516
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
517
+ params = (paramsOrFirst || {}) as { functionId: string };
518
+ } else {
519
+ params = {
520
+ functionId: paramsOrFirst as string
521
+ };
522
+ }
523
+
524
+ const functionId = params.functionId;
525
+
286
526
  if (typeof functionId === 'undefined') {
287
527
  throw new AppwriteException('Missing required parameter: "functionId"');
288
528
  }
529
+
289
530
  const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
290
531
  const payload: Payload = {};
291
532
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -300,37 +541,115 @@ export class Functions {
300
541
  payload
301
542
  );
302
543
  }
544
+
303
545
  /**
304
546
  * Update function by its unique ID.
305
547
  *
306
- * @param {string} functionId
307
- * @param {string} name
308
- * @param {Runtime} runtime
309
- * @param {string[]} execute
310
- * @param {string[]} events
311
- * @param {string} schedule
312
- * @param {number} timeout
313
- * @param {boolean} enabled
314
- * @param {boolean} logging
315
- * @param {string} entrypoint
316
- * @param {string} commands
317
- * @param {string[]} scopes
318
- * @param {string} installationId
319
- * @param {string} providerRepositoryId
320
- * @param {string} providerBranch
321
- * @param {boolean} providerSilentMode
322
- * @param {string} providerRootDirectory
323
- * @param {string} specification
548
+ * @param {string} params.functionId - Function ID.
549
+ * @param {string} params.name - Function name. Max length: 128 chars.
550
+ * @param {Runtime} params.runtime - Execution runtime.
551
+ * @param {string[]} params.execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
552
+ * @param {string[]} params.events - Events list. Maximum of 100 events are allowed.
553
+ * @param {string} params.schedule - Schedule CRON syntax.
554
+ * @param {number} params.timeout - Maximum execution time in seconds.
555
+ * @param {boolean} params.enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
556
+ * @param {boolean} params.logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
557
+ * @param {string} params.entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
558
+ * @param {string} params.commands - Build Commands.
559
+ * @param {string[]} params.scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
560
+ * @param {string} params.installationId - Appwrite Installation ID for VCS (Version Controle System) deployment.
561
+ * @param {string} params.providerRepositoryId - Repository ID of the repo linked to the function
562
+ * @param {string} params.providerBranch - Production branch for the repo linked to the function
563
+ * @param {boolean} params.providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
564
+ * @param {string} params.providerRootDirectory - Path to function code in the linked repo.
565
+ * @param {string} params.specification - Runtime specification for the function and builds.
324
566
  * @throws {AppwriteException}
325
567
  * @returns {Promise<Models.Function>}
326
568
  */
327
- update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function> {
569
+ update(params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string }): Promise<Models.Function>;
570
+ /**
571
+ * Update function by its unique ID.
572
+ *
573
+ * @param {string} functionId - Function ID.
574
+ * @param {string} name - Function name. Max length: 128 chars.
575
+ * @param {Runtime} runtime - Execution runtime.
576
+ * @param {string[]} execute - An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
577
+ * @param {string[]} events - Events list. Maximum of 100 events are allowed.
578
+ * @param {string} schedule - Schedule CRON syntax.
579
+ * @param {number} timeout - Maximum execution time in seconds.
580
+ * @param {boolean} enabled - Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
581
+ * @param {boolean} logging - When disabled, executions will exclude logs and errors, and will be slightly faster.
582
+ * @param {string} entrypoint - Entrypoint File. This path is relative to the "providerRootDirectory".
583
+ * @param {string} commands - Build Commands.
584
+ * @param {string[]} scopes - List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
585
+ * @param {string} installationId - Appwrite Installation ID for VCS (Version Controle System) deployment.
586
+ * @param {string} providerRepositoryId - Repository ID of the repo linked to the function
587
+ * @param {string} providerBranch - Production branch for the repo linked to the function
588
+ * @param {boolean} providerSilentMode - Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
589
+ * @param {string} providerRootDirectory - Path to function code in the linked repo.
590
+ * @param {string} specification - Runtime specification for the function and builds.
591
+ * @throws {AppwriteException}
592
+ * @returns {Promise<Models.Function>}
593
+ * @deprecated Use the object parameter style method for a better developer experience.
594
+ */
595
+ update(functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string): Promise<Models.Function>;
596
+ update(
597
+ paramsOrFirst: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string } | string,
598
+ ...rest: [(string)?, (Runtime)?, (string[])?, (string[])?, (string)?, (number)?, (boolean)?, (boolean)?, (string)?, (string)?, (string[])?, (string)?, (string)?, (string)?, (boolean)?, (string)?, (string)?]
599
+ ): Promise<Models.Function> {
600
+ let params: { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string };
601
+
602
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
603
+ params = (paramsOrFirst || {}) as { functionId: string, name: string, runtime?: Runtime, execute?: string[], events?: string[], schedule?: string, timeout?: number, enabled?: boolean, logging?: boolean, entrypoint?: string, commands?: string, scopes?: string[], installationId?: string, providerRepositoryId?: string, providerBranch?: string, providerSilentMode?: boolean, providerRootDirectory?: string, specification?: string };
604
+ } else {
605
+ params = {
606
+ functionId: paramsOrFirst as string,
607
+ name: rest[0] as string,
608
+ runtime: rest[1] as Runtime,
609
+ execute: rest[2] as string[],
610
+ events: rest[3] as string[],
611
+ schedule: rest[4] as string,
612
+ timeout: rest[5] as number,
613
+ enabled: rest[6] as boolean,
614
+ logging: rest[7] as boolean,
615
+ entrypoint: rest[8] as string,
616
+ commands: rest[9] as string,
617
+ scopes: rest[10] as string[],
618
+ installationId: rest[11] as string,
619
+ providerRepositoryId: rest[12] as string,
620
+ providerBranch: rest[13] as string,
621
+ providerSilentMode: rest[14] as boolean,
622
+ providerRootDirectory: rest[15] as string,
623
+ specification: rest[16] as string
624
+ };
625
+ }
626
+
627
+ const functionId = params.functionId;
628
+ const name = params.name;
629
+ const runtime = params.runtime;
630
+ const execute = params.execute;
631
+ const events = params.events;
632
+ const schedule = params.schedule;
633
+ const timeout = params.timeout;
634
+ const enabled = params.enabled;
635
+ const logging = params.logging;
636
+ const entrypoint = params.entrypoint;
637
+ const commands = params.commands;
638
+ const scopes = params.scopes;
639
+ const installationId = params.installationId;
640
+ const providerRepositoryId = params.providerRepositoryId;
641
+ const providerBranch = params.providerBranch;
642
+ const providerSilentMode = params.providerSilentMode;
643
+ const providerRootDirectory = params.providerRootDirectory;
644
+ const specification = params.specification;
645
+
328
646
  if (typeof functionId === 'undefined') {
329
647
  throw new AppwriteException('Missing required parameter: "functionId"');
330
648
  }
331
649
  if (typeof name === 'undefined') {
332
650
  throw new AppwriteException('Missing required parameter: "name"');
333
651
  }
652
+
334
653
  const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
335
654
  const payload: Payload = {};
336
655
  if (typeof name !== 'undefined') {
@@ -397,17 +716,43 @@ export class Functions {
397
716
  payload
398
717
  );
399
718
  }
719
+
400
720
  /**
401
721
  * Delete a function by its unique ID.
402
722
  *
403
- * @param {string} functionId
723
+ * @param {string} params.functionId - Function ID.
404
724
  * @throws {AppwriteException}
405
725
  * @returns {Promise<{}>}
406
726
  */
407
- delete(functionId: string): Promise<{}> {
727
+ delete(params: { functionId: string }): Promise<{}>;
728
+ /**
729
+ * Delete a function by its unique ID.
730
+ *
731
+ * @param {string} functionId - Function ID.
732
+ * @throws {AppwriteException}
733
+ * @returns {Promise<{}>}
734
+ * @deprecated Use the object parameter style method for a better developer experience.
735
+ */
736
+ delete(functionId: string): Promise<{}>;
737
+ delete(
738
+ paramsOrFirst: { functionId: string } | string
739
+ ): Promise<{}> {
740
+ let params: { functionId: string };
741
+
742
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
743
+ params = (paramsOrFirst || {}) as { functionId: string };
744
+ } else {
745
+ params = {
746
+ functionId: paramsOrFirst as string
747
+ };
748
+ }
749
+
750
+ const functionId = params.functionId;
751
+
408
752
  if (typeof functionId === 'undefined') {
409
753
  throw new AppwriteException('Missing required parameter: "functionId"');
410
754
  }
755
+
411
756
  const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
412
757
  const payload: Payload = {};
413
758
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -423,21 +768,51 @@ export class Functions {
423
768
  payload
424
769
  );
425
770
  }
771
+
426
772
  /**
427
773
  * Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.
428
774
  *
429
- * @param {string} functionId
430
- * @param {string} deploymentId
775
+ * @param {string} params.functionId - Function ID.
776
+ * @param {string} params.deploymentId - Deployment ID.
431
777
  * @throws {AppwriteException}
432
778
  * @returns {Promise<Models.Function>}
433
779
  */
434
- updateFunctionDeployment(functionId: string, deploymentId: string): Promise<Models.Function> {
780
+ updateFunctionDeployment(params: { functionId: string, deploymentId: string }): Promise<Models.Function>;
781
+ /**
782
+ * Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.
783
+ *
784
+ * @param {string} functionId - Function ID.
785
+ * @param {string} deploymentId - Deployment ID.
786
+ * @throws {AppwriteException}
787
+ * @returns {Promise<Models.Function>}
788
+ * @deprecated Use the object parameter style method for a better developer experience.
789
+ */
790
+ updateFunctionDeployment(functionId: string, deploymentId: string): Promise<Models.Function>;
791
+ updateFunctionDeployment(
792
+ paramsOrFirst: { functionId: string, deploymentId: string } | string,
793
+ ...rest: [(string)?]
794
+ ): Promise<Models.Function> {
795
+ let params: { functionId: string, deploymentId: string };
796
+
797
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
798
+ params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string };
799
+ } else {
800
+ params = {
801
+ functionId: paramsOrFirst as string,
802
+ deploymentId: rest[0] as string
803
+ };
804
+ }
805
+
806
+ const functionId = params.functionId;
807
+ const deploymentId = params.deploymentId;
808
+
435
809
  if (typeof functionId === 'undefined') {
436
810
  throw new AppwriteException('Missing required parameter: "functionId"');
437
811
  }
438
812
  if (typeof deploymentId === 'undefined') {
439
813
  throw new AppwriteException('Missing required parameter: "deploymentId"');
440
814
  }
815
+
441
816
  const apiPath = '/functions/{functionId}/deployment'.replace('{functionId}', functionId);
442
817
  const payload: Payload = {};
443
818
  if (typeof deploymentId !== 'undefined') {
@@ -456,19 +831,56 @@ export class Functions {
456
831
  payload
457
832
  );
458
833
  }
834
+
459
835
  /**
460
- * Get a list of all the function&#039;s code deployments. You can use the query params to filter your results.
836
+ * Get a list of all the function's code deployments. You can use the query params to filter your results.
461
837
  *
462
- * @param {string} functionId
463
- * @param {string[]} queries
464
- * @param {string} search
838
+ * @param {string} params.functionId - Function ID.
839
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
840
+ * @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
841
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
465
842
  * @throws {AppwriteException}
466
843
  * @returns {Promise<Models.DeploymentList>}
467
844
  */
468
- listDeployments(functionId: string, queries?: string[], search?: string): Promise<Models.DeploymentList> {
845
+ listDeployments(params: { functionId: string, queries?: string[], search?: string, total?: boolean }): Promise<Models.DeploymentList>;
846
+ /**
847
+ * Get a list of all the function's code deployments. You can use the query params to filter your results.
848
+ *
849
+ * @param {string} functionId - Function ID.
850
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
851
+ * @param {string} search - Search term to filter your list results. Max length: 256 chars.
852
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
853
+ * @throws {AppwriteException}
854
+ * @returns {Promise<Models.DeploymentList>}
855
+ * @deprecated Use the object parameter style method for a better developer experience.
856
+ */
857
+ listDeployments(functionId: string, queries?: string[], search?: string, total?: boolean): Promise<Models.DeploymentList>;
858
+ listDeployments(
859
+ paramsOrFirst: { functionId: string, queries?: string[], search?: string, total?: boolean } | string,
860
+ ...rest: [(string[])?, (string)?, (boolean)?]
861
+ ): Promise<Models.DeploymentList> {
862
+ let params: { functionId: string, queries?: string[], search?: string, total?: boolean };
863
+
864
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
865
+ params = (paramsOrFirst || {}) as { functionId: string, queries?: string[], search?: string, total?: boolean };
866
+ } else {
867
+ params = {
868
+ functionId: paramsOrFirst as string,
869
+ queries: rest[0] as string[],
870
+ search: rest[1] as string,
871
+ total: rest[2] as boolean
872
+ };
873
+ }
874
+
875
+ const functionId = params.functionId;
876
+ const queries = params.queries;
877
+ const search = params.search;
878
+ const total = params.total;
879
+
469
880
  if (typeof functionId === 'undefined') {
470
881
  throw new AppwriteException('Missing required parameter: "functionId"');
471
882
  }
883
+
472
884
  const apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);
473
885
  const payload: Payload = {};
474
886
  if (typeof queries !== 'undefined') {
@@ -477,6 +889,9 @@ export class Functions {
477
889
  if (typeof search !== 'undefined') {
478
890
  payload['search'] = search;
479
891
  }
892
+ if (typeof total !== 'undefined') {
893
+ payload['total'] = total;
894
+ }
480
895
  const uri = new URL(this.client.config.endpoint + apiPath);
481
896
 
482
897
  const apiHeaders: { [header: string]: string } = {
@@ -489,22 +904,67 @@ export class Functions {
489
904
  payload
490
905
  );
491
906
  }
492
- /**
493
- * 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.
494
-
495
- 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).
496
907
 
497
- Use the &quot;command&quot; param to set the entrypoint used to execute your code.
908
+ /**
909
+ * 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'll need to update the function's deployment to use your new deployment UID.
910
+ *
911
+ * 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).
912
+ *
913
+ * Use the "command" param to set the entrypoint used to execute your code.
914
+ *
915
+ * @param {string} params.functionId - Function ID.
916
+ * @param {File} params.code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
917
+ * @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
918
+ * @param {string} params.entrypoint - Entrypoint File.
919
+ * @param {string} params.commands - Build Commands.
920
+ * @throws {AppwriteException}
921
+ * @returns {Promise<Models.Deployment>}
922
+ */
923
+ createDeployment(params: { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string , onProgress?: (progress: UploadProgress) => void }): Promise<Models.Deployment>;
924
+ /**
925
+ * 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'll need to update the function's deployment to use your new deployment UID.
926
+ *
927
+ * 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).
928
+ *
929
+ * Use the "command" param to set the entrypoint used to execute your code.
498
930
  *
499
- * @param {string} functionId
500
- * @param {File} code
501
- * @param {boolean} activate
502
- * @param {string} entrypoint
503
- * @param {string} commands
931
+ * @param {string} functionId - Function ID.
932
+ * @param {File} code - Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
933
+ * @param {boolean} activate - Automatically activate the deployment when it is finished building.
934
+ * @param {string} entrypoint - Entrypoint File.
935
+ * @param {string} commands - Build Commands.
504
936
  * @throws {AppwriteException}
505
937
  * @returns {Promise<Models.Deployment>}
938
+ * @deprecated Use the object parameter style method for a better developer experience.
506
939
  */
507
- createDeployment(functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string, onProgress = (progress: UploadProgress) => {}): Promise<Models.Deployment> {
940
+ createDeployment(functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => void): Promise<Models.Deployment>;
941
+ createDeployment(
942
+ paramsOrFirst: { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string, onProgress?: (progress: UploadProgress) => void } | string,
943
+ ...rest: [(File)?, (boolean)?, (string)?, (string)?,((progress: UploadProgress) => void)?]
944
+ ): Promise<Models.Deployment> {
945
+ let params: { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string };
946
+ let onProgress: ((progress: UploadProgress) => void);
947
+
948
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
949
+ params = (paramsOrFirst || {}) as { functionId: string, code: File, activate: boolean, entrypoint?: string, commands?: string };
950
+ onProgress = paramsOrFirst?.onProgress as ((progress: UploadProgress) => void);
951
+ } else {
952
+ params = {
953
+ functionId: paramsOrFirst as string,
954
+ code: rest[0] as File,
955
+ activate: rest[1] as boolean,
956
+ entrypoint: rest[2] as string,
957
+ commands: rest[3] as string
958
+ };
959
+ onProgress = rest[4] as ((progress: UploadProgress) => void);
960
+ }
961
+
962
+ const functionId = params.functionId;
963
+ const code = params.code;
964
+ const activate = params.activate;
965
+ const entrypoint = params.entrypoint;
966
+ const commands = params.commands;
967
+
508
968
  if (typeof functionId === 'undefined') {
509
969
  throw new AppwriteException('Missing required parameter: "functionId"');
510
970
  }
@@ -514,6 +974,7 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
514
974
  if (typeof activate === 'undefined') {
515
975
  throw new AppwriteException('Missing required parameter: "activate"');
516
976
  }
977
+
517
978
  const apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);
518
979
  const payload: Payload = {};
519
980
  if (typeof entrypoint !== 'undefined') {
@@ -542,22 +1003,55 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
542
1003
  onProgress
543
1004
  );
544
1005
  }
1006
+
1007
+ /**
1008
+ * Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
1009
+ *
1010
+ * @param {string} params.functionId - Function ID.
1011
+ * @param {string} params.deploymentId - Deployment ID.
1012
+ * @param {string} params.buildId - Build unique ID.
1013
+ * @throws {AppwriteException}
1014
+ * @returns {Promise<Models.Deployment>}
1015
+ */
1016
+ createDuplicateDeployment(params: { functionId: string, deploymentId: string, buildId?: string }): Promise<Models.Deployment>;
545
1017
  /**
546
- * Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment&#039;s code will be preserved and used for the new build.
1018
+ * Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.
547
1019
  *
548
- * @param {string} functionId
549
- * @param {string} deploymentId
550
- * @param {string} buildId
1020
+ * @param {string} functionId - Function ID.
1021
+ * @param {string} deploymentId - Deployment ID.
1022
+ * @param {string} buildId - Build unique ID.
551
1023
  * @throws {AppwriteException}
552
1024
  * @returns {Promise<Models.Deployment>}
1025
+ * @deprecated Use the object parameter style method for a better developer experience.
553
1026
  */
554
- createDuplicateDeployment(functionId: string, deploymentId: string, buildId?: string): Promise<Models.Deployment> {
1027
+ createDuplicateDeployment(functionId: string, deploymentId: string, buildId?: string): Promise<Models.Deployment>;
1028
+ createDuplicateDeployment(
1029
+ paramsOrFirst: { functionId: string, deploymentId: string, buildId?: string } | string,
1030
+ ...rest: [(string)?, (string)?]
1031
+ ): Promise<Models.Deployment> {
1032
+ let params: { functionId: string, deploymentId: string, buildId?: string };
1033
+
1034
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1035
+ params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string, buildId?: string };
1036
+ } else {
1037
+ params = {
1038
+ functionId: paramsOrFirst as string,
1039
+ deploymentId: rest[0] as string,
1040
+ buildId: rest[1] as string
1041
+ };
1042
+ }
1043
+
1044
+ const functionId = params.functionId;
1045
+ const deploymentId = params.deploymentId;
1046
+ const buildId = params.buildId;
1047
+
555
1048
  if (typeof functionId === 'undefined') {
556
1049
  throw new AppwriteException('Missing required parameter: "functionId"');
557
1050
  }
558
1051
  if (typeof deploymentId === 'undefined') {
559
1052
  throw new AppwriteException('Missing required parameter: "deploymentId"');
560
1053
  }
1054
+
561
1055
  const apiPath = '/functions/{functionId}/deployments/duplicate'.replace('{functionId}', functionId);
562
1056
  const payload: Payload = {};
563
1057
  if (typeof deploymentId !== 'undefined') {
@@ -579,21 +1073,68 @@ Use the &quot;command&quot; param to set the entrypoint used to execute your cod
579
1073
  payload
580
1074
  );
581
1075
  }
1076
+
582
1077
  /**
583
1078
  * Create a deployment based on a template.
584
-
585
- Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/server/functions#listTemplates) to find the template details.
1079
+ *
1080
+ * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/functions/templates) to find the template details.
1081
+ *
1082
+ * @param {string} params.functionId - Function ID.
1083
+ * @param {string} params.repository - Repository name of the template.
1084
+ * @param {string} params.owner - The name of the owner of the template.
1085
+ * @param {string} params.rootDirectory - Path to function code in the template repo.
1086
+ * @param {TemplateReferenceType} params.type - Type for the reference provided. Can be commit, branch, or tag
1087
+ * @param {string} params.reference - Reference value, can be a commit hash, branch name, or release tag
1088
+ * @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
1089
+ * @throws {AppwriteException}
1090
+ * @returns {Promise<Models.Deployment>}
1091
+ */
1092
+ createTemplateDeployment(params: { functionId: string, repository: string, owner: string, rootDirectory: string, type: TemplateReferenceType, reference: string, activate?: boolean }): Promise<Models.Deployment>;
1093
+ /**
1094
+ * Create a deployment based on a template.
1095
+ *
1096
+ * Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/functions/templates) to find the template details.
586
1097
  *
587
- * @param {string} functionId
588
- * @param {string} repository
589
- * @param {string} owner
590
- * @param {string} rootDirectory
591
- * @param {string} version
592
- * @param {boolean} activate
1098
+ * @param {string} functionId - Function ID.
1099
+ * @param {string} repository - Repository name of the template.
1100
+ * @param {string} owner - The name of the owner of the template.
1101
+ * @param {string} rootDirectory - Path to function code in the template repo.
1102
+ * @param {TemplateReferenceType} type - Type for the reference provided. Can be commit, branch, or tag
1103
+ * @param {string} reference - Reference value, can be a commit hash, branch name, or release tag
1104
+ * @param {boolean} activate - Automatically activate the deployment when it is finished building.
593
1105
  * @throws {AppwriteException}
594
1106
  * @returns {Promise<Models.Deployment>}
1107
+ * @deprecated Use the object parameter style method for a better developer experience.
595
1108
  */
596
- createTemplateDeployment(functionId: string, repository: string, owner: string, rootDirectory: string, version: string, activate?: boolean): Promise<Models.Deployment> {
1109
+ createTemplateDeployment(functionId: string, repository: string, owner: string, rootDirectory: string, type: TemplateReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
1110
+ createTemplateDeployment(
1111
+ paramsOrFirst: { functionId: string, repository: string, owner: string, rootDirectory: string, type: TemplateReferenceType, reference: string, activate?: boolean } | string,
1112
+ ...rest: [(string)?, (string)?, (string)?, (TemplateReferenceType)?, (string)?, (boolean)?]
1113
+ ): Promise<Models.Deployment> {
1114
+ let params: { functionId: string, repository: string, owner: string, rootDirectory: string, type: TemplateReferenceType, reference: string, activate?: boolean };
1115
+
1116
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1117
+ params = (paramsOrFirst || {}) as { functionId: string, repository: string, owner: string, rootDirectory: string, type: TemplateReferenceType, reference: string, activate?: boolean };
1118
+ } else {
1119
+ params = {
1120
+ functionId: paramsOrFirst as string,
1121
+ repository: rest[0] as string,
1122
+ owner: rest[1] as string,
1123
+ rootDirectory: rest[2] as string,
1124
+ type: rest[3] as TemplateReferenceType,
1125
+ reference: rest[4] as string,
1126
+ activate: rest[5] as boolean
1127
+ };
1128
+ }
1129
+
1130
+ const functionId = params.functionId;
1131
+ const repository = params.repository;
1132
+ const owner = params.owner;
1133
+ const rootDirectory = params.rootDirectory;
1134
+ const type = params.type;
1135
+ const reference = params.reference;
1136
+ const activate = params.activate;
1137
+
597
1138
  if (typeof functionId === 'undefined') {
598
1139
  throw new AppwriteException('Missing required parameter: "functionId"');
599
1140
  }
@@ -606,9 +1147,13 @@ Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/s
606
1147
  if (typeof rootDirectory === 'undefined') {
607
1148
  throw new AppwriteException('Missing required parameter: "rootDirectory"');
608
1149
  }
609
- if (typeof version === 'undefined') {
610
- throw new AppwriteException('Missing required parameter: "version"');
1150
+ if (typeof type === 'undefined') {
1151
+ throw new AppwriteException('Missing required parameter: "type"');
1152
+ }
1153
+ if (typeof reference === 'undefined') {
1154
+ throw new AppwriteException('Missing required parameter: "reference"');
611
1155
  }
1156
+
612
1157
  const apiPath = '/functions/{functionId}/deployments/template'.replace('{functionId}', functionId);
613
1158
  const payload: Payload = {};
614
1159
  if (typeof repository !== 'undefined') {
@@ -620,8 +1165,11 @@ Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/s
620
1165
  if (typeof rootDirectory !== 'undefined') {
621
1166
  payload['rootDirectory'] = rootDirectory;
622
1167
  }
623
- if (typeof version !== 'undefined') {
624
- payload['version'] = version;
1168
+ if (typeof type !== 'undefined') {
1169
+ payload['type'] = type;
1170
+ }
1171
+ if (typeof reference !== 'undefined') {
1172
+ payload['reference'] = reference;
625
1173
  }
626
1174
  if (typeof activate !== 'undefined') {
627
1175
  payload['activate'] = activate;
@@ -639,19 +1187,56 @@ Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/s
639
1187
  payload
640
1188
  );
641
1189
  }
1190
+
642
1191
  /**
643
1192
  * Create a deployment when a function is connected to VCS.
644
-
645
- This endpoint lets you create deployment from a branch, commit, or a tag.
1193
+ *
1194
+ * This endpoint lets you create deployment from a branch, commit, or a tag.
1195
+ *
1196
+ * @param {string} params.functionId - Function ID.
1197
+ * @param {VCSReferenceType} params.type - Type of reference passed. Allowed values are: branch, commit
1198
+ * @param {string} params.reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
1199
+ * @param {boolean} params.activate - Automatically activate the deployment when it is finished building.
1200
+ * @throws {AppwriteException}
1201
+ * @returns {Promise<Models.Deployment>}
1202
+ */
1203
+ createVcsDeployment(params: { functionId: string, type: VCSReferenceType, reference: string, activate?: boolean }): Promise<Models.Deployment>;
1204
+ /**
1205
+ * Create a deployment when a function is connected to VCS.
1206
+ *
1207
+ * This endpoint lets you create deployment from a branch, commit, or a tag.
646
1208
  *
647
- * @param {string} functionId
648
- * @param {VCSDeploymentType} type
649
- * @param {string} reference
650
- * @param {boolean} activate
1209
+ * @param {string} functionId - Function ID.
1210
+ * @param {VCSReferenceType} type - Type of reference passed. Allowed values are: branch, commit
1211
+ * @param {string} reference - VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
1212
+ * @param {boolean} activate - Automatically activate the deployment when it is finished building.
651
1213
  * @throws {AppwriteException}
652
1214
  * @returns {Promise<Models.Deployment>}
1215
+ * @deprecated Use the object parameter style method for a better developer experience.
653
1216
  */
654
- createVcsDeployment(functionId: string, type: VCSDeploymentType, reference: string, activate?: boolean): Promise<Models.Deployment> {
1217
+ createVcsDeployment(functionId: string, type: VCSReferenceType, reference: string, activate?: boolean): Promise<Models.Deployment>;
1218
+ createVcsDeployment(
1219
+ paramsOrFirst: { functionId: string, type: VCSReferenceType, reference: string, activate?: boolean } | string,
1220
+ ...rest: [(VCSReferenceType)?, (string)?, (boolean)?]
1221
+ ): Promise<Models.Deployment> {
1222
+ let params: { functionId: string, type: VCSReferenceType, reference: string, activate?: boolean };
1223
+
1224
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1225
+ params = (paramsOrFirst || {}) as { functionId: string, type: VCSReferenceType, reference: string, activate?: boolean };
1226
+ } else {
1227
+ params = {
1228
+ functionId: paramsOrFirst as string,
1229
+ type: rest[0] as VCSReferenceType,
1230
+ reference: rest[1] as string,
1231
+ activate: rest[2] as boolean
1232
+ };
1233
+ }
1234
+
1235
+ const functionId = params.functionId;
1236
+ const type = params.type;
1237
+ const reference = params.reference;
1238
+ const activate = params.activate;
1239
+
655
1240
  if (typeof functionId === 'undefined') {
656
1241
  throw new AppwriteException('Missing required parameter: "functionId"');
657
1242
  }
@@ -661,6 +1246,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
661
1246
  if (typeof reference === 'undefined') {
662
1247
  throw new AppwriteException('Missing required parameter: "reference"');
663
1248
  }
1249
+
664
1250
  const apiPath = '/functions/{functionId}/deployments/vcs'.replace('{functionId}', functionId);
665
1251
  const payload: Payload = {};
666
1252
  if (typeof type !== 'undefined') {
@@ -685,21 +1271,51 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
685
1271
  payload
686
1272
  );
687
1273
  }
1274
+
1275
+ /**
1276
+ * Get a function deployment by its unique ID.
1277
+ *
1278
+ * @param {string} params.functionId - Function ID.
1279
+ * @param {string} params.deploymentId - Deployment ID.
1280
+ * @throws {AppwriteException}
1281
+ * @returns {Promise<Models.Deployment>}
1282
+ */
1283
+ getDeployment(params: { functionId: string, deploymentId: string }): Promise<Models.Deployment>;
688
1284
  /**
689
1285
  * Get a function deployment by its unique ID.
690
1286
  *
691
- * @param {string} functionId
692
- * @param {string} deploymentId
1287
+ * @param {string} functionId - Function ID.
1288
+ * @param {string} deploymentId - Deployment ID.
693
1289
  * @throws {AppwriteException}
694
1290
  * @returns {Promise<Models.Deployment>}
1291
+ * @deprecated Use the object parameter style method for a better developer experience.
695
1292
  */
696
- getDeployment(functionId: string, deploymentId: string): Promise<Models.Deployment> {
1293
+ getDeployment(functionId: string, deploymentId: string): Promise<Models.Deployment>;
1294
+ getDeployment(
1295
+ paramsOrFirst: { functionId: string, deploymentId: string } | string,
1296
+ ...rest: [(string)?]
1297
+ ): Promise<Models.Deployment> {
1298
+ let params: { functionId: string, deploymentId: string };
1299
+
1300
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1301
+ params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string };
1302
+ } else {
1303
+ params = {
1304
+ functionId: paramsOrFirst as string,
1305
+ deploymentId: rest[0] as string
1306
+ };
1307
+ }
1308
+
1309
+ const functionId = params.functionId;
1310
+ const deploymentId = params.deploymentId;
1311
+
697
1312
  if (typeof functionId === 'undefined') {
698
1313
  throw new AppwriteException('Missing required parameter: "functionId"');
699
1314
  }
700
1315
  if (typeof deploymentId === 'undefined') {
701
1316
  throw new AppwriteException('Missing required parameter: "deploymentId"');
702
1317
  }
1318
+
703
1319
  const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
704
1320
  const payload: Payload = {};
705
1321
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -714,21 +1330,51 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
714
1330
  payload
715
1331
  );
716
1332
  }
1333
+
717
1334
  /**
718
1335
  * Delete a code deployment by its unique ID.
719
1336
  *
720
- * @param {string} functionId
721
- * @param {string} deploymentId
1337
+ * @param {string} params.functionId - Function ID.
1338
+ * @param {string} params.deploymentId - Deployment ID.
722
1339
  * @throws {AppwriteException}
723
1340
  * @returns {Promise<{}>}
724
1341
  */
725
- deleteDeployment(functionId: string, deploymentId: string): Promise<{}> {
1342
+ deleteDeployment(params: { functionId: string, deploymentId: string }): Promise<{}>;
1343
+ /**
1344
+ * Delete a code deployment by its unique ID.
1345
+ *
1346
+ * @param {string} functionId - Function ID.
1347
+ * @param {string} deploymentId - Deployment ID.
1348
+ * @throws {AppwriteException}
1349
+ * @returns {Promise<{}>}
1350
+ * @deprecated Use the object parameter style method for a better developer experience.
1351
+ */
1352
+ deleteDeployment(functionId: string, deploymentId: string): Promise<{}>;
1353
+ deleteDeployment(
1354
+ paramsOrFirst: { functionId: string, deploymentId: string } | string,
1355
+ ...rest: [(string)?]
1356
+ ): Promise<{}> {
1357
+ let params: { functionId: string, deploymentId: string };
1358
+
1359
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1360
+ params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string };
1361
+ } else {
1362
+ params = {
1363
+ functionId: paramsOrFirst as string,
1364
+ deploymentId: rest[0] as string
1365
+ };
1366
+ }
1367
+
1368
+ const functionId = params.functionId;
1369
+ const deploymentId = params.deploymentId;
1370
+
726
1371
  if (typeof functionId === 'undefined') {
727
1372
  throw new AppwriteException('Missing required parameter: "functionId"');
728
1373
  }
729
1374
  if (typeof deploymentId === 'undefined') {
730
1375
  throw new AppwriteException('Missing required parameter: "deploymentId"');
731
1376
  }
1377
+
732
1378
  const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
733
1379
  const payload: Payload = {};
734
1380
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -744,22 +1390,55 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
744
1390
  payload
745
1391
  );
746
1392
  }
1393
+
1394
+ /**
1395
+ * Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
1396
+ *
1397
+ * @param {string} params.functionId - Function ID.
1398
+ * @param {string} params.deploymentId - Deployment ID.
1399
+ * @param {DeploymentDownloadType} params.type - Deployment file to download. Can be: "source", "output".
1400
+ * @throws {AppwriteException}
1401
+ * @returns {string}
1402
+ */
1403
+ getDeploymentDownload(params: { functionId: string, deploymentId: string, type?: DeploymentDownloadType }): string;
747
1404
  /**
748
- * Get a function deployment content by its unique ID. The endpoint response return with a &#039;Content-Disposition: attachment&#039; header that tells the browser to start downloading the file to user downloads directory.
1405
+ * Get a function deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.
749
1406
  *
750
- * @param {string} functionId
751
- * @param {string} deploymentId
752
- * @param {DeploymentDownloadType} type
1407
+ * @param {string} functionId - Function ID.
1408
+ * @param {string} deploymentId - Deployment ID.
1409
+ * @param {DeploymentDownloadType} type - Deployment file to download. Can be: "source", "output".
753
1410
  * @throws {AppwriteException}
754
1411
  * @returns {string}
1412
+ * @deprecated Use the object parameter style method for a better developer experience.
755
1413
  */
756
- getDeploymentDownload(functionId: string, deploymentId: string, type?: DeploymentDownloadType): string {
1414
+ getDeploymentDownload(functionId: string, deploymentId: string, type?: DeploymentDownloadType): string;
1415
+ getDeploymentDownload(
1416
+ paramsOrFirst: { functionId: string, deploymentId: string, type?: DeploymentDownloadType } | string,
1417
+ ...rest: [(string)?, (DeploymentDownloadType)?]
1418
+ ): string {
1419
+ let params: { functionId: string, deploymentId: string, type?: DeploymentDownloadType };
1420
+
1421
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1422
+ params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string, type?: DeploymentDownloadType };
1423
+ } else {
1424
+ params = {
1425
+ functionId: paramsOrFirst as string,
1426
+ deploymentId: rest[0] as string,
1427
+ type: rest[1] as DeploymentDownloadType
1428
+ };
1429
+ }
1430
+
1431
+ const functionId = params.functionId;
1432
+ const deploymentId = params.deploymentId;
1433
+ const type = params.type;
1434
+
757
1435
  if (typeof functionId === 'undefined') {
758
1436
  throw new AppwriteException('Missing required parameter: "functionId"');
759
1437
  }
760
1438
  if (typeof deploymentId === 'undefined') {
761
1439
  throw new AppwriteException('Missing required parameter: "deploymentId"');
762
1440
  }
1441
+
763
1442
  const apiPath = '/functions/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
764
1443
  const payload: Payload = {};
765
1444
  if (typeof type !== 'undefined') {
@@ -778,21 +1457,51 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
778
1457
 
779
1458
  return uri.toString();
780
1459
  }
1460
+
1461
+ /**
1462
+ * Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
1463
+ *
1464
+ * @param {string} params.functionId - Function ID.
1465
+ * @param {string} params.deploymentId - Deployment ID.
1466
+ * @throws {AppwriteException}
1467
+ * @returns {Promise<Models.Deployment>}
1468
+ */
1469
+ updateDeploymentStatus(params: { functionId: string, deploymentId: string }): Promise<Models.Deployment>;
781
1470
  /**
782
- * Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn&#039;t started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status &#039;ready&#039;) or failed. The response includes the final build status and details.
1471
+ * Cancel an ongoing function deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.
783
1472
  *
784
- * @param {string} functionId
785
- * @param {string} deploymentId
1473
+ * @param {string} functionId - Function ID.
1474
+ * @param {string} deploymentId - Deployment ID.
786
1475
  * @throws {AppwriteException}
787
1476
  * @returns {Promise<Models.Deployment>}
1477
+ * @deprecated Use the object parameter style method for a better developer experience.
788
1478
  */
789
- updateDeploymentStatus(functionId: string, deploymentId: string): Promise<Models.Deployment> {
1479
+ updateDeploymentStatus(functionId: string, deploymentId: string): Promise<Models.Deployment>;
1480
+ updateDeploymentStatus(
1481
+ paramsOrFirst: { functionId: string, deploymentId: string } | string,
1482
+ ...rest: [(string)?]
1483
+ ): Promise<Models.Deployment> {
1484
+ let params: { functionId: string, deploymentId: string };
1485
+
1486
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1487
+ params = (paramsOrFirst || {}) as { functionId: string, deploymentId: string };
1488
+ } else {
1489
+ params = {
1490
+ functionId: paramsOrFirst as string,
1491
+ deploymentId: rest[0] as string
1492
+ };
1493
+ }
1494
+
1495
+ const functionId = params.functionId;
1496
+ const deploymentId = params.deploymentId;
1497
+
790
1498
  if (typeof functionId === 'undefined') {
791
1499
  throw new AppwriteException('Missing required parameter: "functionId"');
792
1500
  }
793
1501
  if (typeof deploymentId === 'undefined') {
794
1502
  throw new AppwriteException('Missing required parameter: "deploymentId"');
795
1503
  }
1504
+
796
1505
  const apiPath = '/functions/{functionId}/deployments/{deploymentId}/status'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
797
1506
  const payload: Payload = {};
798
1507
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -808,23 +1517,60 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
808
1517
  payload
809
1518
  );
810
1519
  }
1520
+
811
1521
  /**
812
1522
  * Get a list of all the current user function execution logs. You can use the query params to filter your results.
813
1523
  *
814
- * @param {string} functionId
815
- * @param {string[]} queries
1524
+ * @param {string} params.functionId - Function ID.
1525
+ * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
1526
+ * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.
816
1527
  * @throws {AppwriteException}
817
1528
  * @returns {Promise<Models.ExecutionList>}
818
1529
  */
819
- listExecutions(functionId: string, queries?: string[]): Promise<Models.ExecutionList> {
1530
+ listExecutions(params: { functionId: string, queries?: string[], total?: boolean }): Promise<Models.ExecutionList>;
1531
+ /**
1532
+ * Get a list of all the current user function execution logs. You can use the query params to filter your results.
1533
+ *
1534
+ * @param {string} functionId - Function ID.
1535
+ * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
1536
+ * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.
1537
+ * @throws {AppwriteException}
1538
+ * @returns {Promise<Models.ExecutionList>}
1539
+ * @deprecated Use the object parameter style method for a better developer experience.
1540
+ */
1541
+ listExecutions(functionId: string, queries?: string[], total?: boolean): Promise<Models.ExecutionList>;
1542
+ listExecutions(
1543
+ paramsOrFirst: { functionId: string, queries?: string[], total?: boolean } | string,
1544
+ ...rest: [(string[])?, (boolean)?]
1545
+ ): Promise<Models.ExecutionList> {
1546
+ let params: { functionId: string, queries?: string[], total?: boolean };
1547
+
1548
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1549
+ params = (paramsOrFirst || {}) as { functionId: string, queries?: string[], total?: boolean };
1550
+ } else {
1551
+ params = {
1552
+ functionId: paramsOrFirst as string,
1553
+ queries: rest[0] as string[],
1554
+ total: rest[1] as boolean
1555
+ };
1556
+ }
1557
+
1558
+ const functionId = params.functionId;
1559
+ const queries = params.queries;
1560
+ const total = params.total;
1561
+
820
1562
  if (typeof functionId === 'undefined') {
821
1563
  throw new AppwriteException('Missing required parameter: "functionId"');
822
1564
  }
1565
+
823
1566
  const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
824
1567
  const payload: Payload = {};
825
1568
  if (typeof queries !== 'undefined') {
826
1569
  payload['queries'] = queries;
827
1570
  }
1571
+ if (typeof total !== 'undefined') {
1572
+ payload['total'] = total;
1573
+ }
828
1574
  const uri = new URL(this.client.config.endpoint + apiPath);
829
1575
 
830
1576
  const apiHeaders: { [header: string]: string } = {
@@ -837,23 +1583,68 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
837
1583
  payload
838
1584
  );
839
1585
  }
1586
+
840
1587
  /**
841
1588
  * Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
842
1589
  *
843
- * @param {string} functionId
844
- * @param {string} body
845
- * @param {boolean} async
846
- * @param {string} xpath
847
- * @param {ExecutionMethod} method
848
- * @param {object} headers
849
- * @param {string} scheduledAt
1590
+ * @param {string} params.functionId - Function ID.
1591
+ * @param {string} params.body - HTTP body of execution. Default value is empty string.
1592
+ * @param {boolean} params.async - Execute code in the background. Default value is false.
1593
+ * @param {string} params.xpath - HTTP path of execution. Path can include query params. Default value is /
1594
+ * @param {ExecutionMethod} params.method - HTTP method of execution. Default value is POST.
1595
+ * @param {object} params.headers - HTTP headers of execution. Defaults to empty.
1596
+ * @param {string} params.scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
850
1597
  * @throws {AppwriteException}
851
1598
  * @returns {Promise<Models.Execution>}
852
1599
  */
853
- createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution> {
1600
+ createExecution(params: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string }): Promise<Models.Execution>;
1601
+ /**
1602
+ * Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.
1603
+ *
1604
+ * @param {string} functionId - Function ID.
1605
+ * @param {string} body - HTTP body of execution. Default value is empty string.
1606
+ * @param {boolean} async - Execute code in the background. Default value is false.
1607
+ * @param {string} xpath - HTTP path of execution. Path can include query params. Default value is /
1608
+ * @param {ExecutionMethod} method - HTTP method of execution. Default value is POST.
1609
+ * @param {object} headers - HTTP headers of execution. Defaults to empty.
1610
+ * @param {string} scheduledAt - Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
1611
+ * @throws {AppwriteException}
1612
+ * @returns {Promise<Models.Execution>}
1613
+ * @deprecated Use the object parameter style method for a better developer experience.
1614
+ */
1615
+ createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution>;
1616
+ createExecution(
1617
+ paramsOrFirst: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string } | string,
1618
+ ...rest: [(string)?, (boolean)?, (string)?, (ExecutionMethod)?, (object)?, (string)?]
1619
+ ): Promise<Models.Execution> {
1620
+ let params: { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string };
1621
+
1622
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1623
+ params = (paramsOrFirst || {}) as { functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string };
1624
+ } else {
1625
+ params = {
1626
+ functionId: paramsOrFirst as string,
1627
+ body: rest[0] as string,
1628
+ async: rest[1] as boolean,
1629
+ xpath: rest[2] as string,
1630
+ method: rest[3] as ExecutionMethod,
1631
+ headers: rest[4] as object,
1632
+ scheduledAt: rest[5] as string
1633
+ };
1634
+ }
1635
+
1636
+ const functionId = params.functionId;
1637
+ const body = params.body;
1638
+ const async = params.async;
1639
+ const xpath = params.xpath;
1640
+ const method = params.method;
1641
+ const headers = params.headers;
1642
+ const scheduledAt = params.scheduledAt;
1643
+
854
1644
  if (typeof functionId === 'undefined') {
855
1645
  throw new AppwriteException('Missing required parameter: "functionId"');
856
1646
  }
1647
+
857
1648
  const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
858
1649
  const payload: Payload = {};
859
1650
  if (typeof body !== 'undefined') {
@@ -887,21 +1678,51 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
887
1678
  payload
888
1679
  );
889
1680
  }
1681
+
890
1682
  /**
891
1683
  * Get a function execution log by its unique ID.
892
1684
  *
893
- * @param {string} functionId
894
- * @param {string} executionId
1685
+ * @param {string} params.functionId - Function ID.
1686
+ * @param {string} params.executionId - Execution ID.
895
1687
  * @throws {AppwriteException}
896
1688
  * @returns {Promise<Models.Execution>}
897
1689
  */
898
- getExecution(functionId: string, executionId: string): Promise<Models.Execution> {
1690
+ getExecution(params: { functionId: string, executionId: string }): Promise<Models.Execution>;
1691
+ /**
1692
+ * Get a function execution log by its unique ID.
1693
+ *
1694
+ * @param {string} functionId - Function ID.
1695
+ * @param {string} executionId - Execution ID.
1696
+ * @throws {AppwriteException}
1697
+ * @returns {Promise<Models.Execution>}
1698
+ * @deprecated Use the object parameter style method for a better developer experience.
1699
+ */
1700
+ getExecution(functionId: string, executionId: string): Promise<Models.Execution>;
1701
+ getExecution(
1702
+ paramsOrFirst: { functionId: string, executionId: string } | string,
1703
+ ...rest: [(string)?]
1704
+ ): Promise<Models.Execution> {
1705
+ let params: { functionId: string, executionId: string };
1706
+
1707
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1708
+ params = (paramsOrFirst || {}) as { functionId: string, executionId: string };
1709
+ } else {
1710
+ params = {
1711
+ functionId: paramsOrFirst as string,
1712
+ executionId: rest[0] as string
1713
+ };
1714
+ }
1715
+
1716
+ const functionId = params.functionId;
1717
+ const executionId = params.executionId;
1718
+
899
1719
  if (typeof functionId === 'undefined') {
900
1720
  throw new AppwriteException('Missing required parameter: "functionId"');
901
1721
  }
902
1722
  if (typeof executionId === 'undefined') {
903
1723
  throw new AppwriteException('Missing required parameter: "executionId"');
904
1724
  }
1725
+
905
1726
  const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
906
1727
  const payload: Payload = {};
907
1728
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -916,21 +1737,51 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
916
1737
  payload
917
1738
  );
918
1739
  }
1740
+
1741
+ /**
1742
+ * Delete a function execution by its unique ID.
1743
+ *
1744
+ * @param {string} params.functionId - Function ID.
1745
+ * @param {string} params.executionId - Execution ID.
1746
+ * @throws {AppwriteException}
1747
+ * @returns {Promise<{}>}
1748
+ */
1749
+ deleteExecution(params: { functionId: string, executionId: string }): Promise<{}>;
919
1750
  /**
920
1751
  * Delete a function execution by its unique ID.
921
1752
  *
922
- * @param {string} functionId
923
- * @param {string} executionId
1753
+ * @param {string} functionId - Function ID.
1754
+ * @param {string} executionId - Execution ID.
924
1755
  * @throws {AppwriteException}
925
1756
  * @returns {Promise<{}>}
1757
+ * @deprecated Use the object parameter style method for a better developer experience.
926
1758
  */
927
- deleteExecution(functionId: string, executionId: string): Promise<{}> {
1759
+ deleteExecution(functionId: string, executionId: string): Promise<{}>;
1760
+ deleteExecution(
1761
+ paramsOrFirst: { functionId: string, executionId: string } | string,
1762
+ ...rest: [(string)?]
1763
+ ): Promise<{}> {
1764
+ let params: { functionId: string, executionId: string };
1765
+
1766
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1767
+ params = (paramsOrFirst || {}) as { functionId: string, executionId: string };
1768
+ } else {
1769
+ params = {
1770
+ functionId: paramsOrFirst as string,
1771
+ executionId: rest[0] as string
1772
+ };
1773
+ }
1774
+
1775
+ const functionId = params.functionId;
1776
+ const executionId = params.executionId;
1777
+
928
1778
  if (typeof functionId === 'undefined') {
929
1779
  throw new AppwriteException('Missing required parameter: "functionId"');
930
1780
  }
931
1781
  if (typeof executionId === 'undefined') {
932
1782
  throw new AppwriteException('Missing required parameter: "executionId"');
933
1783
  }
1784
+
934
1785
  const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
935
1786
  const payload: Payload = {};
936
1787
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -946,18 +1797,48 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
946
1797
  payload
947
1798
  );
948
1799
  }
1800
+
1801
+ /**
1802
+ * Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. 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, defaults to 30 days.
1803
+ *
1804
+ * @param {string} params.functionId - Function ID.
1805
+ * @param {UsageRange} params.range - Date range.
1806
+ * @throws {AppwriteException}
1807
+ * @returns {Promise<Models.UsageFunction>}
1808
+ */
1809
+ getUsage(params: { functionId: string, range?: UsageRange }): Promise<Models.UsageFunction>;
949
1810
  /**
950
1811
  * Get usage metrics and statistics for a for a specific function. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. 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, defaults to 30 days.
951
1812
  *
952
- * @param {string} functionId
953
- * @param {FunctionUsageRange} range
1813
+ * @param {string} functionId - Function ID.
1814
+ * @param {UsageRange} range - Date range.
954
1815
  * @throws {AppwriteException}
955
1816
  * @returns {Promise<Models.UsageFunction>}
1817
+ * @deprecated Use the object parameter style method for a better developer experience.
956
1818
  */
957
- getUsage(functionId: string, range?: FunctionUsageRange): Promise<Models.UsageFunction> {
1819
+ getUsage(functionId: string, range?: UsageRange): Promise<Models.UsageFunction>;
1820
+ getUsage(
1821
+ paramsOrFirst: { functionId: string, range?: UsageRange } | string,
1822
+ ...rest: [(UsageRange)?]
1823
+ ): Promise<Models.UsageFunction> {
1824
+ let params: { functionId: string, range?: UsageRange };
1825
+
1826
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1827
+ params = (paramsOrFirst || {}) as { functionId: string, range?: UsageRange };
1828
+ } else {
1829
+ params = {
1830
+ functionId: paramsOrFirst as string,
1831
+ range: rest[0] as UsageRange
1832
+ };
1833
+ }
1834
+
1835
+ const functionId = params.functionId;
1836
+ const range = params.range;
1837
+
958
1838
  if (typeof functionId === 'undefined') {
959
1839
  throw new AppwriteException('Missing required parameter: "functionId"');
960
1840
  }
1841
+
961
1842
  const apiPath = '/functions/{functionId}/usage'.replace('{functionId}', functionId);
962
1843
  const payload: Payload = {};
963
1844
  if (typeof range !== 'undefined') {
@@ -975,17 +1856,43 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
975
1856
  payload
976
1857
  );
977
1858
  }
1859
+
1860
+ /**
1861
+ * Get a list of all variables of a specific function.
1862
+ *
1863
+ * @param {string} params.functionId - Function unique ID.
1864
+ * @throws {AppwriteException}
1865
+ * @returns {Promise<Models.VariableList>}
1866
+ */
1867
+ listVariables(params: { functionId: string }): Promise<Models.VariableList>;
978
1868
  /**
979
1869
  * Get a list of all variables of a specific function.
980
1870
  *
981
- * @param {string} functionId
1871
+ * @param {string} functionId - Function unique ID.
982
1872
  * @throws {AppwriteException}
983
1873
  * @returns {Promise<Models.VariableList>}
1874
+ * @deprecated Use the object parameter style method for a better developer experience.
984
1875
  */
985
- listVariables(functionId: string): Promise<Models.VariableList> {
1876
+ listVariables(functionId: string): Promise<Models.VariableList>;
1877
+ listVariables(
1878
+ paramsOrFirst: { functionId: string } | string
1879
+ ): Promise<Models.VariableList> {
1880
+ let params: { functionId: string };
1881
+
1882
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1883
+ params = (paramsOrFirst || {}) as { functionId: string };
1884
+ } else {
1885
+ params = {
1886
+ functionId: paramsOrFirst as string
1887
+ };
1888
+ }
1889
+
1890
+ const functionId = params.functionId;
1891
+
986
1892
  if (typeof functionId === 'undefined') {
987
1893
  throw new AppwriteException('Missing required parameter: "functionId"');
988
1894
  }
1895
+
989
1896
  const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId);
990
1897
  const payload: Payload = {};
991
1898
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -1000,17 +1907,52 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
1000
1907
  payload
1001
1908
  );
1002
1909
  }
1910
+
1911
+ /**
1912
+ * Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.
1913
+ *
1914
+ * @param {string} params.functionId - Function unique ID.
1915
+ * @param {string} params.key - Variable key. Max length: 255 chars.
1916
+ * @param {string} params.value - Variable value. Max length: 8192 chars.
1917
+ * @param {boolean} params.secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
1918
+ * @throws {AppwriteException}
1919
+ * @returns {Promise<Models.Variable>}
1920
+ */
1921
+ createVariable(params: { functionId: string, key: string, value: string, secret?: boolean }): Promise<Models.Variable>;
1003
1922
  /**
1004
1923
  * Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.
1005
1924
  *
1006
- * @param {string} functionId
1007
- * @param {string} key
1008
- * @param {string} value
1009
- * @param {boolean} secret
1925
+ * @param {string} functionId - Function unique ID.
1926
+ * @param {string} key - Variable key. Max length: 255 chars.
1927
+ * @param {string} value - Variable value. Max length: 8192 chars.
1928
+ * @param {boolean} secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
1010
1929
  * @throws {AppwriteException}
1011
1930
  * @returns {Promise<Models.Variable>}
1931
+ * @deprecated Use the object parameter style method for a better developer experience.
1012
1932
  */
1013
- createVariable(functionId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable> {
1933
+ createVariable(functionId: string, key: string, value: string, secret?: boolean): Promise<Models.Variable>;
1934
+ createVariable(
1935
+ paramsOrFirst: { functionId: string, key: string, value: string, secret?: boolean } | string,
1936
+ ...rest: [(string)?, (string)?, (boolean)?]
1937
+ ): Promise<Models.Variable> {
1938
+ let params: { functionId: string, key: string, value: string, secret?: boolean };
1939
+
1940
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
1941
+ params = (paramsOrFirst || {}) as { functionId: string, key: string, value: string, secret?: boolean };
1942
+ } else {
1943
+ params = {
1944
+ functionId: paramsOrFirst as string,
1945
+ key: rest[0] as string,
1946
+ value: rest[1] as string,
1947
+ secret: rest[2] as boolean
1948
+ };
1949
+ }
1950
+
1951
+ const functionId = params.functionId;
1952
+ const key = params.key;
1953
+ const value = params.value;
1954
+ const secret = params.secret;
1955
+
1014
1956
  if (typeof functionId === 'undefined') {
1015
1957
  throw new AppwriteException('Missing required parameter: "functionId"');
1016
1958
  }
@@ -1020,6 +1962,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
1020
1962
  if (typeof value === 'undefined') {
1021
1963
  throw new AppwriteException('Missing required parameter: "value"');
1022
1964
  }
1965
+
1023
1966
  const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId);
1024
1967
  const payload: Payload = {};
1025
1968
  if (typeof key !== 'undefined') {
@@ -1044,21 +1987,51 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
1044
1987
  payload
1045
1988
  );
1046
1989
  }
1990
+
1991
+ /**
1992
+ * Get a variable by its unique ID.
1993
+ *
1994
+ * @param {string} params.functionId - Function unique ID.
1995
+ * @param {string} params.variableId - Variable unique ID.
1996
+ * @throws {AppwriteException}
1997
+ * @returns {Promise<Models.Variable>}
1998
+ */
1999
+ getVariable(params: { functionId: string, variableId: string }): Promise<Models.Variable>;
1047
2000
  /**
1048
2001
  * Get a variable by its unique ID.
1049
2002
  *
1050
- * @param {string} functionId
1051
- * @param {string} variableId
2003
+ * @param {string} functionId - Function unique ID.
2004
+ * @param {string} variableId - Variable unique ID.
1052
2005
  * @throws {AppwriteException}
1053
2006
  * @returns {Promise<Models.Variable>}
2007
+ * @deprecated Use the object parameter style method for a better developer experience.
1054
2008
  */
1055
- getVariable(functionId: string, variableId: string): Promise<Models.Variable> {
2009
+ getVariable(functionId: string, variableId: string): Promise<Models.Variable>;
2010
+ getVariable(
2011
+ paramsOrFirst: { functionId: string, variableId: string } | string,
2012
+ ...rest: [(string)?]
2013
+ ): Promise<Models.Variable> {
2014
+ let params: { functionId: string, variableId: string };
2015
+
2016
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2017
+ params = (paramsOrFirst || {}) as { functionId: string, variableId: string };
2018
+ } else {
2019
+ params = {
2020
+ functionId: paramsOrFirst as string,
2021
+ variableId: rest[0] as string
2022
+ };
2023
+ }
2024
+
2025
+ const functionId = params.functionId;
2026
+ const variableId = params.variableId;
2027
+
1056
2028
  if (typeof functionId === 'undefined') {
1057
2029
  throw new AppwriteException('Missing required parameter: "functionId"');
1058
2030
  }
1059
2031
  if (typeof variableId === 'undefined') {
1060
2032
  throw new AppwriteException('Missing required parameter: "variableId"');
1061
2033
  }
2034
+
1062
2035
  const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
1063
2036
  const payload: Payload = {};
1064
2037
  const uri = new URL(this.client.config.endpoint + apiPath);
@@ -1073,18 +2046,56 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
1073
2046
  payload
1074
2047
  );
1075
2048
  }
2049
+
2050
+ /**
2051
+ * Update variable by its unique ID.
2052
+ *
2053
+ * @param {string} params.functionId - Function unique ID.
2054
+ * @param {string} params.variableId - Variable unique ID.
2055
+ * @param {string} params.key - Variable key. Max length: 255 chars.
2056
+ * @param {string} params.value - Variable value. Max length: 8192 chars.
2057
+ * @param {boolean} params.secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
2058
+ * @throws {AppwriteException}
2059
+ * @returns {Promise<Models.Variable>}
2060
+ */
2061
+ updateVariable(params: { functionId: string, variableId: string, key: string, value?: string, secret?: boolean }): Promise<Models.Variable>;
1076
2062
  /**
1077
2063
  * Update variable by its unique ID.
1078
2064
  *
1079
- * @param {string} functionId
1080
- * @param {string} variableId
1081
- * @param {string} key
1082
- * @param {string} value
1083
- * @param {boolean} secret
2065
+ * @param {string} functionId - Function unique ID.
2066
+ * @param {string} variableId - Variable unique ID.
2067
+ * @param {string} key - Variable key. Max length: 255 chars.
2068
+ * @param {string} value - Variable value. Max length: 8192 chars.
2069
+ * @param {boolean} secret - Secret variables can be updated or deleted, but only functions can read them during build and runtime.
1084
2070
  * @throws {AppwriteException}
1085
2071
  * @returns {Promise<Models.Variable>}
2072
+ * @deprecated Use the object parameter style method for a better developer experience.
1086
2073
  */
1087
- updateVariable(functionId: string, variableId: string, key: string, value?: string, secret?: boolean): Promise<Models.Variable> {
2074
+ updateVariable(functionId: string, variableId: string, key: string, value?: string, secret?: boolean): Promise<Models.Variable>;
2075
+ updateVariable(
2076
+ paramsOrFirst: { functionId: string, variableId: string, key: string, value?: string, secret?: boolean } | string,
2077
+ ...rest: [(string)?, (string)?, (string)?, (boolean)?]
2078
+ ): Promise<Models.Variable> {
2079
+ let params: { functionId: string, variableId: string, key: string, value?: string, secret?: boolean };
2080
+
2081
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2082
+ params = (paramsOrFirst || {}) as { functionId: string, variableId: string, key: string, value?: string, secret?: boolean };
2083
+ } else {
2084
+ params = {
2085
+ functionId: paramsOrFirst as string,
2086
+ variableId: rest[0] as string,
2087
+ key: rest[1] as string,
2088
+ value: rest[2] as string,
2089
+ secret: rest[3] as boolean
2090
+ };
2091
+ }
2092
+
2093
+ const functionId = params.functionId;
2094
+ const variableId = params.variableId;
2095
+ const key = params.key;
2096
+ const value = params.value;
2097
+ const secret = params.secret;
2098
+
1088
2099
  if (typeof functionId === 'undefined') {
1089
2100
  throw new AppwriteException('Missing required parameter: "functionId"');
1090
2101
  }
@@ -1094,6 +2105,7 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
1094
2105
  if (typeof key === 'undefined') {
1095
2106
  throw new AppwriteException('Missing required parameter: "key"');
1096
2107
  }
2108
+
1097
2109
  const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
1098
2110
  const payload: Payload = {};
1099
2111
  if (typeof key !== 'undefined') {
@@ -1118,21 +2130,51 @@ This endpoint lets you create deployment from a branch, commit, or a tag.
1118
2130
  payload
1119
2131
  );
1120
2132
  }
2133
+
1121
2134
  /**
1122
2135
  * Delete a variable by its unique ID.
1123
2136
  *
1124
- * @param {string} functionId
1125
- * @param {string} variableId
2137
+ * @param {string} params.functionId - Function unique ID.
2138
+ * @param {string} params.variableId - Variable unique ID.
1126
2139
  * @throws {AppwriteException}
1127
2140
  * @returns {Promise<{}>}
1128
2141
  */
1129
- deleteVariable(functionId: string, variableId: string): Promise<{}> {
2142
+ deleteVariable(params: { functionId: string, variableId: string }): Promise<{}>;
2143
+ /**
2144
+ * Delete a variable by its unique ID.
2145
+ *
2146
+ * @param {string} functionId - Function unique ID.
2147
+ * @param {string} variableId - Variable unique ID.
2148
+ * @throws {AppwriteException}
2149
+ * @returns {Promise<{}>}
2150
+ * @deprecated Use the object parameter style method for a better developer experience.
2151
+ */
2152
+ deleteVariable(functionId: string, variableId: string): Promise<{}>;
2153
+ deleteVariable(
2154
+ paramsOrFirst: { functionId: string, variableId: string } | string,
2155
+ ...rest: [(string)?]
2156
+ ): Promise<{}> {
2157
+ let params: { functionId: string, variableId: string };
2158
+
2159
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
2160
+ params = (paramsOrFirst || {}) as { functionId: string, variableId: string };
2161
+ } else {
2162
+ params = {
2163
+ functionId: paramsOrFirst as string,
2164
+ variableId: rest[0] as string
2165
+ };
2166
+ }
2167
+
2168
+ const functionId = params.functionId;
2169
+ const variableId = params.variableId;
2170
+
1130
2171
  if (typeof functionId === 'undefined') {
1131
2172
  throw new AppwriteException('Missing required parameter: "functionId"');
1132
2173
  }
1133
2174
  if (typeof variableId === 'undefined') {
1134
2175
  throw new AppwriteException('Missing required parameter: "variableId"');
1135
2176
  }
2177
+
1136
2178
  const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
1137
2179
  const payload: Payload = {};
1138
2180
  const uri = new URL(this.client.config.endpoint + apiPath);