@appwrite.io/console 2.2.0 → 2.3.1

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 (716) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/sdk.js +412 -202
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +412 -203
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +412 -202
  8. package/docs/examples/account/create-anonymous-session.md +2 -0
  9. package/docs/examples/account/create-billing-address.md +2 -0
  10. package/docs/examples/account/create-email-password-session.md +2 -0
  11. package/docs/examples/account/create-email-token.md +2 -0
  12. package/docs/examples/account/create-email-verification.md +2 -0
  13. package/docs/examples/account/create-jwt.md +2 -0
  14. package/docs/examples/account/create-key.md +2 -0
  15. package/docs/examples/account/create-magic-url-token.md +2 -0
  16. package/docs/examples/account/create-mfa-authenticator.md +2 -0
  17. package/docs/examples/account/create-mfa-challenge.md +2 -0
  18. package/docs/examples/account/create-mfa-recovery-codes.md +2 -0
  19. package/docs/examples/account/create-o-auth-2-session.md +2 -0
  20. package/docs/examples/account/create-o-auth-2-token.md +2 -0
  21. package/docs/examples/account/create-payment-method.md +2 -0
  22. package/docs/examples/account/create-phone-token.md +2 -0
  23. package/docs/examples/account/create-phone-verification.md +2 -0
  24. package/docs/examples/account/create-push-target.md +2 -0
  25. package/docs/examples/account/create-recovery.md +2 -0
  26. package/docs/examples/account/create-session.md +2 -0
  27. package/docs/examples/account/create-verification.md +2 -0
  28. package/docs/examples/account/create.md +2 -0
  29. package/docs/examples/account/delete-billing-address.md +2 -0
  30. package/docs/examples/account/delete-identity.md +2 -0
  31. package/docs/examples/account/delete-key.md +2 -0
  32. package/docs/examples/account/delete-mfa-authenticator.md +2 -0
  33. package/docs/examples/account/delete-payment-method.md +2 -0
  34. package/docs/examples/account/delete-push-target.md +2 -0
  35. package/docs/examples/account/delete-session.md +2 -0
  36. package/docs/examples/account/delete-sessions.md +2 -0
  37. package/docs/examples/account/delete.md +2 -0
  38. package/docs/examples/account/get-billing-address.md +2 -0
  39. package/docs/examples/account/get-coupon.md +2 -0
  40. package/docs/examples/account/get-key.md +2 -0
  41. package/docs/examples/account/get-mfa-recovery-codes.md +2 -0
  42. package/docs/examples/account/get-payment-method.md +2 -0
  43. package/docs/examples/account/get-prefs.md +2 -0
  44. package/docs/examples/account/get-session.md +2 -0
  45. package/docs/examples/account/get.md +2 -0
  46. package/docs/examples/account/list-billing-addresses.md +2 -0
  47. package/docs/examples/account/list-identities.md +2 -0
  48. package/docs/examples/account/list-invoices.md +2 -0
  49. package/docs/examples/account/list-keys.md +2 -0
  50. package/docs/examples/account/list-logs.md +2 -0
  51. package/docs/examples/account/list-mfa-factors.md +2 -0
  52. package/docs/examples/account/list-payment-methods.md +2 -0
  53. package/docs/examples/account/list-sessions.md +2 -0
  54. package/docs/examples/account/update-billing-address.md +2 -0
  55. package/docs/examples/account/update-email-verification.md +2 -0
  56. package/docs/examples/account/update-email.md +2 -0
  57. package/docs/examples/account/update-key.md +2 -0
  58. package/docs/examples/account/update-magic-url-session.md +2 -0
  59. package/docs/examples/account/update-mfa-authenticator.md +2 -0
  60. package/docs/examples/account/update-mfa-challenge.md +2 -0
  61. package/docs/examples/account/update-mfa-recovery-codes.md +2 -0
  62. package/docs/examples/account/update-mfa.md +2 -0
  63. package/docs/examples/account/update-name.md +2 -0
  64. package/docs/examples/account/update-password.md +2 -0
  65. package/docs/examples/account/update-payment-method-mandate-options.md +2 -0
  66. package/docs/examples/account/update-payment-method-provider.md +2 -0
  67. package/docs/examples/account/update-payment-method.md +2 -0
  68. package/docs/examples/account/update-phone-session.md +2 -0
  69. package/docs/examples/account/update-phone-verification.md +2 -0
  70. package/docs/examples/account/update-phone.md +2 -0
  71. package/docs/examples/account/update-prefs.md +2 -0
  72. package/docs/examples/account/update-push-target.md +2 -0
  73. package/docs/examples/account/update-recovery.md +2 -0
  74. package/docs/examples/account/update-session.md +2 -0
  75. package/docs/examples/account/update-status.md +2 -0
  76. package/docs/examples/account/update-verification.md +2 -0
  77. package/docs/examples/activities/get-event.md +15 -0
  78. package/docs/examples/activities/list-events.md +15 -0
  79. package/docs/examples/assistant/chat.md +2 -0
  80. package/docs/examples/avatars/get-browser.md +2 -0
  81. package/docs/examples/avatars/get-credit-card.md +2 -0
  82. package/docs/examples/avatars/get-favicon.md +2 -0
  83. package/docs/examples/avatars/get-flag.md +2 -0
  84. package/docs/examples/avatars/get-image.md +2 -0
  85. package/docs/examples/avatars/get-initials.md +2 -0
  86. package/docs/examples/avatars/get-qr.md +2 -0
  87. package/docs/examples/avatars/get-screenshot.md +2 -0
  88. package/docs/examples/backups/create-archive.md +4 -2
  89. package/docs/examples/backups/create-policy.md +4 -2
  90. package/docs/examples/backups/create-restoration.md +4 -2
  91. package/docs/examples/backups/delete-archive.md +2 -0
  92. package/docs/examples/backups/delete-policy.md +2 -0
  93. package/docs/examples/backups/get-archive.md +2 -0
  94. package/docs/examples/backups/get-policy.md +2 -0
  95. package/docs/examples/backups/get-restoration.md +2 -0
  96. package/docs/examples/backups/list-archives.md +2 -0
  97. package/docs/examples/backups/list-policies.md +2 -0
  98. package/docs/examples/backups/list-restorations.md +2 -0
  99. package/docs/examples/backups/update-policy.md +2 -0
  100. package/docs/examples/console/create-program-membership.md +2 -0
  101. package/docs/examples/console/create-source.md +2 -0
  102. package/docs/examples/console/get-campaign.md +2 -0
  103. package/docs/examples/console/get-coupon.md +2 -0
  104. package/docs/examples/console/get-plan.md +2 -0
  105. package/docs/examples/console/get-plans.md +2 -0
  106. package/docs/examples/console/get-program.md +2 -0
  107. package/docs/examples/console/get-resource.md +2 -0
  108. package/docs/examples/console/list-regions.md +2 -0
  109. package/docs/examples/console/suggest-columns.md +2 -0
  110. package/docs/examples/console/suggest-indexes.md +2 -0
  111. package/docs/examples/console/variables.md +2 -0
  112. package/docs/examples/databases/create-boolean-attribute.md +2 -0
  113. package/docs/examples/databases/create-collection.md +2 -0
  114. package/docs/examples/databases/create-datetime-attribute.md +2 -0
  115. package/docs/examples/databases/create-document.md +2 -0
  116. package/docs/examples/databases/create-documents.md +2 -0
  117. package/docs/examples/databases/create-email-attribute.md +2 -0
  118. package/docs/examples/databases/create-enum-attribute.md +2 -0
  119. package/docs/examples/databases/create-float-attribute.md +2 -0
  120. package/docs/examples/databases/create-index.md +2 -0
  121. package/docs/examples/databases/create-integer-attribute.md +2 -0
  122. package/docs/examples/databases/create-ip-attribute.md +2 -0
  123. package/docs/examples/databases/create-line-attribute.md +2 -0
  124. package/docs/examples/databases/create-longtext-attribute.md +4 -1
  125. package/docs/examples/databases/create-mediumtext-attribute.md +4 -1
  126. package/docs/examples/databases/create-operations.md +2 -0
  127. package/docs/examples/databases/create-point-attribute.md +2 -0
  128. package/docs/examples/databases/create-polygon-attribute.md +2 -0
  129. package/docs/examples/databases/create-relationship-attribute.md +2 -0
  130. package/docs/examples/databases/create-string-attribute.md +2 -0
  131. package/docs/examples/databases/create-text-attribute.md +4 -1
  132. package/docs/examples/databases/create-transaction.md +2 -0
  133. package/docs/examples/databases/create-url-attribute.md +2 -0
  134. package/docs/examples/databases/create-varchar-attribute.md +4 -1
  135. package/docs/examples/databases/create.md +2 -0
  136. package/docs/examples/databases/decrement-document-attribute.md +2 -0
  137. package/docs/examples/databases/delete-attribute.md +2 -0
  138. package/docs/examples/databases/delete-collection.md +2 -0
  139. package/docs/examples/databases/delete-document.md +2 -0
  140. package/docs/examples/databases/delete-documents.md +2 -0
  141. package/docs/examples/databases/delete-index.md +2 -0
  142. package/docs/examples/databases/delete-transaction.md +2 -0
  143. package/docs/examples/databases/delete.md +2 -0
  144. package/docs/examples/databases/get-attribute.md +2 -0
  145. package/docs/examples/databases/get-collection-usage.md +2 -0
  146. package/docs/examples/databases/get-collection.md +2 -0
  147. package/docs/examples/databases/get-document.md +2 -0
  148. package/docs/examples/databases/get-index.md +2 -0
  149. package/docs/examples/databases/get-transaction.md +2 -0
  150. package/docs/examples/databases/get-usage.md +2 -0
  151. package/docs/examples/databases/get.md +2 -0
  152. package/docs/examples/databases/increment-document-attribute.md +2 -0
  153. package/docs/examples/databases/list-attributes.md +2 -0
  154. package/docs/examples/databases/list-collection-logs.md +2 -0
  155. package/docs/examples/databases/list-collections.md +2 -0
  156. package/docs/examples/databases/list-document-logs.md +2 -0
  157. package/docs/examples/databases/list-documents.md +2 -0
  158. package/docs/examples/databases/list-indexes.md +2 -0
  159. package/docs/examples/databases/list-logs.md +2 -0
  160. package/docs/examples/databases/list-transactions.md +2 -0
  161. package/docs/examples/databases/list-usage.md +2 -0
  162. package/docs/examples/databases/list.md +2 -0
  163. package/docs/examples/databases/update-boolean-attribute.md +2 -0
  164. package/docs/examples/databases/update-collection.md +2 -0
  165. package/docs/examples/databases/update-datetime-attribute.md +2 -0
  166. package/docs/examples/databases/update-document.md +2 -0
  167. package/docs/examples/databases/update-documents.md +2 -0
  168. package/docs/examples/databases/update-email-attribute.md +2 -0
  169. package/docs/examples/databases/update-enum-attribute.md +2 -0
  170. package/docs/examples/databases/update-float-attribute.md +2 -0
  171. package/docs/examples/databases/update-integer-attribute.md +2 -0
  172. package/docs/examples/databases/update-ip-attribute.md +2 -0
  173. package/docs/examples/databases/update-line-attribute.md +2 -0
  174. package/docs/examples/databases/update-longtext-attribute.md +2 -0
  175. package/docs/examples/databases/update-mediumtext-attribute.md +2 -0
  176. package/docs/examples/databases/update-point-attribute.md +2 -0
  177. package/docs/examples/databases/update-polygon-attribute.md +2 -0
  178. package/docs/examples/databases/update-relationship-attribute.md +2 -0
  179. package/docs/examples/databases/update-string-attribute.md +2 -0
  180. package/docs/examples/databases/update-text-attribute.md +2 -0
  181. package/docs/examples/databases/update-transaction.md +2 -0
  182. package/docs/examples/databases/update-url-attribute.md +2 -0
  183. package/docs/examples/databases/update-varchar-attribute.md +2 -0
  184. package/docs/examples/databases/update.md +2 -0
  185. package/docs/examples/databases/upsert-document.md +2 -0
  186. package/docs/examples/databases/upsert-documents.md +2 -0
  187. package/docs/examples/domains/create-preset-google-workspace.md +2 -0
  188. package/docs/examples/domains/create-preset-i-cloud.md +2 -0
  189. package/docs/examples/domains/create-preset-mailgun.md +2 -0
  190. package/docs/examples/domains/create-preset-outlook.md +2 -0
  191. package/docs/examples/domains/create-preset-proton-mail.md +2 -0
  192. package/docs/examples/domains/create-preset-zoho.md +2 -0
  193. package/docs/examples/domains/create-record-a.md +2 -0
  194. package/docs/examples/domains/create-record-aaaa.md +2 -0
  195. package/docs/examples/domains/create-record-alias.md +2 -0
  196. package/docs/examples/domains/create-record-caa.md +2 -0
  197. package/docs/examples/domains/create-record-cname.md +2 -0
  198. package/docs/examples/domains/create-record-https.md +2 -0
  199. package/docs/examples/domains/create-record-mx.md +2 -0
  200. package/docs/examples/domains/create-record-ns.md +2 -0
  201. package/docs/examples/domains/create-record-srv.md +2 -0
  202. package/docs/examples/domains/create-record-txt.md +2 -0
  203. package/docs/examples/domains/create.md +2 -0
  204. package/docs/examples/domains/delete-record.md +2 -0
  205. package/docs/examples/domains/delete.md +2 -0
  206. package/docs/examples/domains/get-preset-google-workspace.md +2 -0
  207. package/docs/examples/domains/get-preset-i-cloud.md +2 -0
  208. package/docs/examples/domains/get-preset-mailgun.md +2 -0
  209. package/docs/examples/domains/get-preset-outlook.md +2 -0
  210. package/docs/examples/domains/get-preset-proton-mail.md +2 -0
  211. package/docs/examples/domains/get-preset-zoho.md +2 -0
  212. package/docs/examples/domains/get-price.md +17 -0
  213. package/docs/examples/domains/get-record.md +2 -0
  214. package/docs/examples/domains/get-zone.md +2 -0
  215. package/docs/examples/domains/get.md +2 -0
  216. package/docs/examples/domains/list-records.md +2 -0
  217. package/docs/examples/domains/list-suggestions.md +2 -0
  218. package/docs/examples/domains/list.md +2 -0
  219. package/docs/examples/domains/update-nameservers.md +2 -0
  220. package/docs/examples/domains/update-record-a.md +2 -0
  221. package/docs/examples/domains/update-record-aaaa.md +2 -0
  222. package/docs/examples/domains/update-record-alias.md +2 -0
  223. package/docs/examples/domains/update-record-caa.md +2 -0
  224. package/docs/examples/domains/update-record-cname.md +2 -0
  225. package/docs/examples/domains/update-record-https.md +2 -0
  226. package/docs/examples/domains/update-record-mx.md +2 -0
  227. package/docs/examples/domains/update-record-ns.md +2 -0
  228. package/docs/examples/domains/update-record-srv.md +2 -0
  229. package/docs/examples/domains/update-record-txt.md +2 -0
  230. package/docs/examples/domains/update-team.md +2 -0
  231. package/docs/examples/domains/update-zone.md +2 -0
  232. package/docs/examples/functions/create-deployment.md +2 -0
  233. package/docs/examples/functions/create-duplicate-deployment.md +2 -0
  234. package/docs/examples/functions/create-execution.md +2 -0
  235. package/docs/examples/functions/create-template-deployment.md +2 -0
  236. package/docs/examples/functions/create-variable.md +2 -0
  237. package/docs/examples/functions/create-vcs-deployment.md +2 -0
  238. package/docs/examples/functions/create.md +2 -0
  239. package/docs/examples/functions/delete-deployment.md +2 -0
  240. package/docs/examples/functions/delete-execution.md +2 -0
  241. package/docs/examples/functions/delete-variable.md +2 -0
  242. package/docs/examples/functions/delete.md +2 -0
  243. package/docs/examples/functions/get-deployment-download.md +2 -0
  244. package/docs/examples/functions/get-deployment.md +2 -0
  245. package/docs/examples/functions/get-execution.md +2 -0
  246. package/docs/examples/functions/get-template.md +2 -0
  247. package/docs/examples/functions/get-usage.md +2 -0
  248. package/docs/examples/functions/get-variable.md +2 -0
  249. package/docs/examples/functions/get.md +2 -0
  250. package/docs/examples/functions/list-deployments.md +2 -0
  251. package/docs/examples/functions/list-executions.md +2 -0
  252. package/docs/examples/functions/list-runtimes.md +2 -0
  253. package/docs/examples/functions/list-specifications.md +2 -0
  254. package/docs/examples/functions/list-templates.md +2 -0
  255. package/docs/examples/functions/list-usage.md +2 -0
  256. package/docs/examples/functions/list-variables.md +2 -0
  257. package/docs/examples/functions/list.md +2 -0
  258. package/docs/examples/functions/update-deployment-status.md +2 -0
  259. package/docs/examples/functions/update-function-deployment.md +2 -0
  260. package/docs/examples/functions/update-variable.md +2 -0
  261. package/docs/examples/functions/update.md +2 -0
  262. package/docs/examples/graphql/mutation.md +2 -0
  263. package/docs/examples/graphql/query.md +2 -0
  264. package/docs/examples/health/get-antivirus.md +2 -0
  265. package/docs/examples/health/get-cache.md +2 -0
  266. package/docs/examples/health/get-certificate.md +2 -0
  267. package/docs/examples/health/get-db.md +2 -0
  268. package/docs/examples/health/get-failed-jobs.md +2 -0
  269. package/docs/examples/health/get-pub-sub.md +2 -0
  270. package/docs/examples/health/get-queue-audits.md +2 -0
  271. package/docs/examples/health/get-queue-billing-project-aggregation.md +2 -0
  272. package/docs/examples/health/get-queue-billing-team-aggregation.md +2 -0
  273. package/docs/examples/health/get-queue-builds.md +2 -0
  274. package/docs/examples/health/get-queue-certificates.md +2 -0
  275. package/docs/examples/health/get-queue-databases.md +2 -0
  276. package/docs/examples/health/get-queue-deletes.md +2 -0
  277. package/docs/examples/health/get-queue-functions.md +2 -0
  278. package/docs/examples/health/get-queue-logs.md +2 -0
  279. package/docs/examples/health/get-queue-mails.md +2 -0
  280. package/docs/examples/health/get-queue-messaging.md +2 -0
  281. package/docs/examples/health/get-queue-migrations.md +2 -0
  282. package/docs/examples/health/get-queue-priority-builds.md +2 -0
  283. package/docs/examples/health/get-queue-region-manager.md +2 -0
  284. package/docs/examples/health/get-queue-stats-resources.md +2 -0
  285. package/docs/examples/health/get-queue-threats.md +2 -0
  286. package/docs/examples/health/get-queue-usage.md +2 -0
  287. package/docs/examples/health/get-queue-webhooks.md +2 -0
  288. package/docs/examples/health/get-storage-local.md +2 -0
  289. package/docs/examples/health/get-storage.md +2 -0
  290. package/docs/examples/health/get-time.md +2 -0
  291. package/docs/examples/health/get.md +2 -0
  292. package/docs/examples/locale/get.md +2 -0
  293. package/docs/examples/locale/list-codes.md +2 -0
  294. package/docs/examples/locale/list-continents.md +2 -0
  295. package/docs/examples/locale/list-countries-eu.md +2 -0
  296. package/docs/examples/locale/list-countries-phones.md +2 -0
  297. package/docs/examples/locale/list-countries.md +2 -0
  298. package/docs/examples/locale/list-currencies.md +2 -0
  299. package/docs/examples/locale/list-languages.md +2 -0
  300. package/docs/examples/messaging/create-apns-provider.md +2 -0
  301. package/docs/examples/messaging/create-email.md +2 -0
  302. package/docs/examples/messaging/create-fcm-provider.md +2 -0
  303. package/docs/examples/messaging/create-mailgun-provider.md +2 -0
  304. package/docs/examples/messaging/create-msg-91-provider.md +2 -0
  305. package/docs/examples/messaging/create-push.md +2 -0
  306. package/docs/examples/messaging/create-resend-provider.md +2 -0
  307. package/docs/examples/messaging/create-sendgrid-provider.md +2 -0
  308. package/docs/examples/messaging/create-sms.md +2 -0
  309. package/docs/examples/messaging/create-smtp-provider.md +2 -0
  310. package/docs/examples/messaging/create-subscriber.md +2 -0
  311. package/docs/examples/messaging/create-telesign-provider.md +2 -0
  312. package/docs/examples/messaging/create-textmagic-provider.md +2 -0
  313. package/docs/examples/messaging/create-topic.md +2 -0
  314. package/docs/examples/messaging/create-twilio-provider.md +2 -0
  315. package/docs/examples/messaging/create-vonage-provider.md +2 -0
  316. package/docs/examples/messaging/delete-provider.md +2 -0
  317. package/docs/examples/messaging/delete-subscriber.md +2 -0
  318. package/docs/examples/messaging/delete-topic.md +2 -0
  319. package/docs/examples/messaging/delete.md +2 -0
  320. package/docs/examples/messaging/get-message.md +2 -0
  321. package/docs/examples/messaging/get-provider.md +2 -0
  322. package/docs/examples/messaging/get-subscriber.md +2 -0
  323. package/docs/examples/messaging/get-topic.md +2 -0
  324. package/docs/examples/messaging/list-message-logs.md +2 -0
  325. package/docs/examples/messaging/list-messages.md +2 -0
  326. package/docs/examples/messaging/list-provider-logs.md +2 -0
  327. package/docs/examples/messaging/list-providers.md +2 -0
  328. package/docs/examples/messaging/list-subscriber-logs.md +2 -0
  329. package/docs/examples/messaging/list-subscribers.md +2 -0
  330. package/docs/examples/messaging/list-targets.md +2 -0
  331. package/docs/examples/messaging/list-topic-logs.md +2 -0
  332. package/docs/examples/messaging/list-topics.md +2 -0
  333. package/docs/examples/messaging/update-apns-provider.md +2 -0
  334. package/docs/examples/messaging/update-email.md +2 -0
  335. package/docs/examples/messaging/update-fcm-provider.md +2 -0
  336. package/docs/examples/messaging/update-mailgun-provider.md +2 -0
  337. package/docs/examples/messaging/update-msg-91-provider.md +2 -0
  338. package/docs/examples/messaging/update-push.md +2 -0
  339. package/docs/examples/messaging/update-resend-provider.md +2 -0
  340. package/docs/examples/messaging/update-sendgrid-provider.md +2 -0
  341. package/docs/examples/messaging/update-sms.md +2 -0
  342. package/docs/examples/messaging/update-smtp-provider.md +2 -0
  343. package/docs/examples/messaging/update-telesign-provider.md +2 -0
  344. package/docs/examples/messaging/update-textmagic-provider.md +2 -0
  345. package/docs/examples/messaging/update-topic.md +2 -0
  346. package/docs/examples/messaging/update-twilio-provider.md +2 -0
  347. package/docs/examples/messaging/update-vonage-provider.md +2 -0
  348. package/docs/examples/migrations/create-appwrite-migration.md +2 -0
  349. package/docs/examples/migrations/create-csv-export.md +2 -0
  350. package/docs/examples/migrations/create-csv-import.md +2 -0
  351. package/docs/examples/migrations/create-firebase-migration.md +2 -0
  352. package/docs/examples/migrations/create-n-host-migration.md +2 -0
  353. package/docs/examples/migrations/create-supabase-migration.md +2 -0
  354. package/docs/examples/migrations/delete.md +2 -0
  355. package/docs/examples/migrations/get-appwrite-report.md +2 -0
  356. package/docs/examples/migrations/get-firebase-report.md +2 -0
  357. package/docs/examples/migrations/get-n-host-report.md +2 -0
  358. package/docs/examples/migrations/get-supabase-report.md +2 -0
  359. package/docs/examples/migrations/get.md +2 -0
  360. package/docs/examples/migrations/list.md +2 -0
  361. package/docs/examples/migrations/retry.md +2 -0
  362. package/docs/examples/organizations/add-credit.md +2 -0
  363. package/docs/examples/organizations/cancel-downgrade.md +2 -0
  364. package/docs/examples/organizations/create-downgrade-feedback.md +2 -0
  365. package/docs/examples/organizations/create-invoice-payment.md +2 -0
  366. package/docs/examples/organizations/create-key.md +2 -0
  367. package/docs/examples/organizations/create.md +2 -0
  368. package/docs/examples/organizations/delete-backup-payment-method.md +2 -0
  369. package/docs/examples/organizations/delete-billing-address.md +2 -0
  370. package/docs/examples/organizations/delete-default-payment-method.md +2 -0
  371. package/docs/examples/organizations/delete-key.md +2 -0
  372. package/docs/examples/organizations/delete.md +2 -0
  373. package/docs/examples/organizations/estimation-create-organization.md +2 -0
  374. package/docs/examples/organizations/estimation-delete-organization.md +2 -0
  375. package/docs/examples/organizations/estimation-update-plan.md +2 -0
  376. package/docs/examples/organizations/get-aggregation.md +2 -0
  377. package/docs/examples/organizations/get-available-credits.md +2 -0
  378. package/docs/examples/organizations/get-billing-address.md +2 -0
  379. package/docs/examples/organizations/get-credit.md +2 -0
  380. package/docs/examples/organizations/get-invoice-download.md +2 -0
  381. package/docs/examples/organizations/get-invoice-view.md +2 -0
  382. package/docs/examples/organizations/get-invoice.md +2 -0
  383. package/docs/examples/organizations/get-key.md +2 -0
  384. package/docs/examples/organizations/get-payment-method.md +2 -0
  385. package/docs/examples/organizations/get-plan.md +2 -0
  386. package/docs/examples/organizations/get-scopes.md +2 -0
  387. package/docs/examples/organizations/get-usage.md +2 -0
  388. package/docs/examples/organizations/list-aggregations.md +2 -0
  389. package/docs/examples/organizations/list-credits.md +2 -0
  390. package/docs/examples/organizations/list-invoices.md +2 -0
  391. package/docs/examples/organizations/list-keys.md +2 -0
  392. package/docs/examples/organizations/list-regions.md +2 -0
  393. package/docs/examples/organizations/list.md +2 -0
  394. package/docs/examples/organizations/set-backup-payment-method.md +2 -0
  395. package/docs/examples/organizations/set-billing-address.md +2 -0
  396. package/docs/examples/organizations/set-billing-email.md +2 -0
  397. package/docs/examples/organizations/set-billing-tax-id.md +2 -0
  398. package/docs/examples/organizations/set-default-payment-method.md +2 -0
  399. package/docs/examples/organizations/update-budget.md +2 -0
  400. package/docs/examples/organizations/update-key.md +2 -0
  401. package/docs/examples/organizations/update-plan.md +2 -0
  402. package/docs/examples/organizations/validate-invoice.md +2 -0
  403. package/docs/examples/organizations/validate-payment.md +2 -0
  404. package/docs/examples/project/create-variable.md +2 -0
  405. package/docs/examples/project/delete-variable.md +2 -0
  406. package/docs/examples/project/get-usage.md +2 -0
  407. package/docs/examples/project/get-variable.md +2 -0
  408. package/docs/examples/project/list-variables.md +2 -0
  409. package/docs/examples/project/update-variable.md +2 -0
  410. package/docs/examples/projects/create-dev-key.md +2 -0
  411. package/docs/examples/projects/create-jwt.md +2 -0
  412. package/docs/examples/projects/create-key.md +3 -0
  413. package/docs/examples/projects/create-platform.md +2 -0
  414. package/docs/examples/projects/create-smtp-test.md +2 -0
  415. package/docs/examples/projects/create-webhook.md +2 -0
  416. package/docs/examples/projects/create.md +2 -0
  417. package/docs/examples/projects/delete-dev-key.md +2 -0
  418. package/docs/examples/projects/delete-email-template.md +2 -0
  419. package/docs/examples/projects/delete-key.md +2 -0
  420. package/docs/examples/projects/delete-platform.md +2 -0
  421. package/docs/examples/projects/delete-sms-template.md +2 -0
  422. package/docs/examples/projects/delete-webhook.md +2 -0
  423. package/docs/examples/projects/delete.md +2 -0
  424. package/docs/examples/projects/get-dev-key.md +2 -0
  425. package/docs/examples/projects/get-email-template.md +2 -0
  426. package/docs/examples/projects/get-key.md +2 -0
  427. package/docs/examples/projects/get-platform.md +2 -0
  428. package/docs/examples/projects/get-sms-template.md +2 -0
  429. package/docs/examples/projects/get-webhook.md +2 -0
  430. package/docs/examples/projects/get.md +2 -0
  431. package/docs/examples/projects/list-dev-keys.md +2 -0
  432. package/docs/examples/projects/list-keys.md +3 -0
  433. package/docs/examples/projects/list-platforms.md +2 -0
  434. package/docs/examples/projects/list-webhooks.md +2 -0
  435. package/docs/examples/projects/list.md +2 -0
  436. package/docs/examples/projects/update-api-status-all.md +2 -0
  437. package/docs/examples/projects/update-api-status.md +2 -0
  438. package/docs/examples/projects/update-auth-duration.md +2 -0
  439. package/docs/examples/projects/update-auth-limit.md +2 -0
  440. package/docs/examples/projects/update-auth-password-dictionary.md +2 -0
  441. package/docs/examples/projects/update-auth-password-history.md +2 -0
  442. package/docs/examples/projects/update-auth-sessions-limit.md +2 -0
  443. package/docs/examples/projects/update-auth-status.md +2 -0
  444. package/docs/examples/projects/update-dev-key.md +2 -0
  445. package/docs/examples/projects/update-email-template.md +2 -0
  446. package/docs/examples/projects/update-key.md +2 -0
  447. package/docs/examples/projects/update-labels.md +2 -0
  448. package/docs/examples/projects/update-memberships-privacy.md +2 -0
  449. package/docs/examples/projects/update-mock-numbers.md +2 -0
  450. package/docs/examples/projects/update-o-auth-2.md +2 -0
  451. package/docs/examples/projects/update-personal-data-check.md +2 -0
  452. package/docs/examples/projects/update-platform.md +2 -0
  453. package/docs/examples/projects/update-service-status-all.md +2 -0
  454. package/docs/examples/projects/update-service-status.md +2 -0
  455. package/docs/examples/projects/update-session-alerts.md +2 -0
  456. package/docs/examples/projects/update-session-invalidation.md +2 -0
  457. package/docs/examples/projects/update-sms-template.md +2 -0
  458. package/docs/examples/projects/update-smtp.md +2 -0
  459. package/docs/examples/projects/update-team.md +2 -0
  460. package/docs/examples/projects/update-webhook-signature.md +2 -0
  461. package/docs/examples/projects/update-webhook.md +2 -0
  462. package/docs/examples/projects/update.md +2 -0
  463. package/docs/examples/proxy/create-api-rule.md +2 -0
  464. package/docs/examples/proxy/create-function-rule.md +2 -0
  465. package/docs/examples/proxy/create-redirect-rule.md +2 -0
  466. package/docs/examples/proxy/create-site-rule.md +2 -0
  467. package/docs/examples/proxy/delete-rule.md +2 -0
  468. package/docs/examples/proxy/get-rule.md +2 -0
  469. package/docs/examples/proxy/list-rules.md +2 -0
  470. package/docs/examples/proxy/update-rule-verification.md +2 -0
  471. package/docs/examples/sites/create-deployment.md +2 -0
  472. package/docs/examples/sites/create-duplicate-deployment.md +2 -0
  473. package/docs/examples/sites/create-template-deployment.md +2 -0
  474. package/docs/examples/sites/create-variable.md +2 -0
  475. package/docs/examples/sites/create-vcs-deployment.md +2 -0
  476. package/docs/examples/sites/create.md +2 -0
  477. package/docs/examples/sites/delete-deployment.md +2 -0
  478. package/docs/examples/sites/delete-log.md +2 -0
  479. package/docs/examples/sites/delete-variable.md +2 -0
  480. package/docs/examples/sites/delete.md +2 -0
  481. package/docs/examples/sites/get-deployment-download.md +2 -0
  482. package/docs/examples/sites/get-deployment.md +2 -0
  483. package/docs/examples/sites/get-log.md +2 -0
  484. package/docs/examples/sites/get-template.md +2 -0
  485. package/docs/examples/sites/get-usage.md +2 -0
  486. package/docs/examples/sites/get-variable.md +2 -0
  487. package/docs/examples/sites/get.md +2 -0
  488. package/docs/examples/sites/list-deployments.md +2 -0
  489. package/docs/examples/sites/list-frameworks.md +2 -0
  490. package/docs/examples/sites/list-logs.md +2 -0
  491. package/docs/examples/sites/list-specifications.md +2 -0
  492. package/docs/examples/sites/list-templates.md +2 -0
  493. package/docs/examples/sites/list-usage.md +2 -0
  494. package/docs/examples/sites/list-variables.md +2 -0
  495. package/docs/examples/sites/list.md +2 -0
  496. package/docs/examples/sites/update-deployment-status.md +2 -0
  497. package/docs/examples/sites/update-site-deployment.md +2 -0
  498. package/docs/examples/sites/update-variable.md +2 -0
  499. package/docs/examples/sites/update.md +2 -0
  500. package/docs/examples/storage/create-bucket.md +2 -0
  501. package/docs/examples/storage/create-file.md +2 -0
  502. package/docs/examples/storage/delete-bucket.md +2 -0
  503. package/docs/examples/storage/delete-file.md +2 -0
  504. package/docs/examples/storage/get-bucket-usage.md +2 -0
  505. package/docs/examples/storage/get-bucket.md +2 -0
  506. package/docs/examples/storage/get-file-download.md +2 -0
  507. package/docs/examples/storage/get-file-preview.md +2 -0
  508. package/docs/examples/storage/get-file-view.md +2 -0
  509. package/docs/examples/storage/get-file.md +2 -0
  510. package/docs/examples/storage/get-usage.md +2 -0
  511. package/docs/examples/storage/list-buckets.md +2 -0
  512. package/docs/examples/storage/list-files.md +2 -0
  513. package/docs/examples/storage/update-bucket.md +2 -0
  514. package/docs/examples/storage/update-file.md +2 -0
  515. package/docs/examples/tablesdb/create-boolean-column.md +2 -0
  516. package/docs/examples/tablesdb/create-datetime-column.md +2 -0
  517. package/docs/examples/tablesdb/create-email-column.md +2 -0
  518. package/docs/examples/tablesdb/create-enum-column.md +2 -0
  519. package/docs/examples/tablesdb/create-float-column.md +2 -0
  520. package/docs/examples/tablesdb/create-index.md +2 -0
  521. package/docs/examples/tablesdb/create-integer-column.md +2 -0
  522. package/docs/examples/tablesdb/create-ip-column.md +2 -0
  523. package/docs/examples/tablesdb/create-line-column.md +2 -0
  524. package/docs/examples/tablesdb/create-longtext-column.md +4 -1
  525. package/docs/examples/tablesdb/create-mediumtext-column.md +4 -1
  526. package/docs/examples/tablesdb/create-operations.md +2 -0
  527. package/docs/examples/tablesdb/create-point-column.md +2 -0
  528. package/docs/examples/tablesdb/create-polygon-column.md +2 -0
  529. package/docs/examples/tablesdb/create-relationship-column.md +2 -0
  530. package/docs/examples/tablesdb/create-row.md +2 -0
  531. package/docs/examples/tablesdb/create-rows.md +2 -0
  532. package/docs/examples/tablesdb/create-string-column.md +2 -0
  533. package/docs/examples/tablesdb/create-table.md +2 -0
  534. package/docs/examples/tablesdb/create-text-column.md +4 -1
  535. package/docs/examples/tablesdb/create-transaction.md +2 -0
  536. package/docs/examples/tablesdb/create-url-column.md +2 -0
  537. package/docs/examples/tablesdb/create-varchar-column.md +4 -1
  538. package/docs/examples/tablesdb/create.md +2 -0
  539. package/docs/examples/tablesdb/decrement-row-column.md +2 -0
  540. package/docs/examples/tablesdb/delete-column.md +2 -0
  541. package/docs/examples/tablesdb/delete-index.md +2 -0
  542. package/docs/examples/tablesdb/delete-row.md +2 -0
  543. package/docs/examples/tablesdb/delete-rows.md +2 -0
  544. package/docs/examples/tablesdb/delete-table.md +2 -0
  545. package/docs/examples/tablesdb/delete-transaction.md +2 -0
  546. package/docs/examples/tablesdb/delete.md +2 -0
  547. package/docs/examples/tablesdb/get-column.md +2 -0
  548. package/docs/examples/tablesdb/get-index.md +2 -0
  549. package/docs/examples/tablesdb/get-row.md +2 -0
  550. package/docs/examples/tablesdb/get-table-usage.md +2 -0
  551. package/docs/examples/tablesdb/get-table.md +2 -0
  552. package/docs/examples/tablesdb/get-transaction.md +2 -0
  553. package/docs/examples/tablesdb/get-usage.md +2 -0
  554. package/docs/examples/tablesdb/get.md +2 -0
  555. package/docs/examples/tablesdb/increment-row-column.md +2 -0
  556. package/docs/examples/tablesdb/list-columns.md +2 -0
  557. package/docs/examples/tablesdb/list-indexes.md +2 -0
  558. package/docs/examples/tablesdb/list-row-logs.md +2 -0
  559. package/docs/examples/tablesdb/list-rows.md +2 -0
  560. package/docs/examples/tablesdb/list-table-logs.md +2 -0
  561. package/docs/examples/tablesdb/list-tables.md +2 -0
  562. package/docs/examples/tablesdb/list-transactions.md +2 -0
  563. package/docs/examples/tablesdb/list-usage.md +2 -0
  564. package/docs/examples/tablesdb/list.md +2 -0
  565. package/docs/examples/tablesdb/update-boolean-column.md +2 -0
  566. package/docs/examples/tablesdb/update-datetime-column.md +2 -0
  567. package/docs/examples/tablesdb/update-email-column.md +2 -0
  568. package/docs/examples/tablesdb/update-enum-column.md +2 -0
  569. package/docs/examples/tablesdb/update-float-column.md +2 -0
  570. package/docs/examples/tablesdb/update-integer-column.md +2 -0
  571. package/docs/examples/tablesdb/update-ip-column.md +2 -0
  572. package/docs/examples/tablesdb/update-line-column.md +2 -0
  573. package/docs/examples/tablesdb/update-longtext-column.md +2 -0
  574. package/docs/examples/tablesdb/update-mediumtext-column.md +2 -0
  575. package/docs/examples/tablesdb/update-point-column.md +2 -0
  576. package/docs/examples/tablesdb/update-polygon-column.md +2 -0
  577. package/docs/examples/tablesdb/update-relationship-column.md +2 -0
  578. package/docs/examples/tablesdb/update-row.md +2 -0
  579. package/docs/examples/tablesdb/update-rows.md +2 -0
  580. package/docs/examples/tablesdb/update-string-column.md +2 -0
  581. package/docs/examples/tablesdb/update-table.md +2 -0
  582. package/docs/examples/tablesdb/update-text-column.md +2 -0
  583. package/docs/examples/tablesdb/update-transaction.md +2 -0
  584. package/docs/examples/tablesdb/update-url-column.md +2 -0
  585. package/docs/examples/tablesdb/update-varchar-column.md +2 -0
  586. package/docs/examples/tablesdb/update.md +2 -0
  587. package/docs/examples/tablesdb/upsert-row.md +2 -0
  588. package/docs/examples/tablesdb/upsert-rows.md +2 -0
  589. package/docs/examples/teams/create-membership.md +4 -2
  590. package/docs/examples/teams/create.md +2 -0
  591. package/docs/examples/teams/delete-membership.md +2 -0
  592. package/docs/examples/teams/delete.md +2 -0
  593. package/docs/examples/teams/get-membership.md +2 -0
  594. package/docs/examples/teams/get-prefs.md +2 -0
  595. package/docs/examples/teams/get.md +2 -0
  596. package/docs/examples/teams/list-logs.md +2 -0
  597. package/docs/examples/teams/list-memberships.md +2 -0
  598. package/docs/examples/teams/list.md +2 -0
  599. package/docs/examples/teams/update-membership-status.md +2 -0
  600. package/docs/examples/teams/update-membership.md +4 -2
  601. package/docs/examples/teams/update-name.md +2 -0
  602. package/docs/examples/teams/update-prefs.md +2 -0
  603. package/docs/examples/tokens/create-file-token.md +2 -0
  604. package/docs/examples/tokens/delete.md +2 -0
  605. package/docs/examples/tokens/get.md +2 -0
  606. package/docs/examples/tokens/list.md +2 -0
  607. package/docs/examples/tokens/update.md +2 -0
  608. package/docs/examples/users/create-argon-2-user.md +2 -0
  609. package/docs/examples/users/create-bcrypt-user.md +2 -0
  610. package/docs/examples/users/create-jwt.md +2 -0
  611. package/docs/examples/users/create-md-5-user.md +2 -0
  612. package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
  613. package/docs/examples/users/create-ph-pass-user.md +2 -0
  614. package/docs/examples/users/create-scrypt-modified-user.md +2 -0
  615. package/docs/examples/users/create-scrypt-user.md +2 -0
  616. package/docs/examples/users/create-session.md +2 -0
  617. package/docs/examples/users/create-sha-user.md +2 -0
  618. package/docs/examples/users/create-target.md +2 -0
  619. package/docs/examples/users/create-token.md +2 -0
  620. package/docs/examples/users/create.md +2 -0
  621. package/docs/examples/users/delete-identity.md +2 -0
  622. package/docs/examples/users/delete-mfa-authenticator.md +2 -0
  623. package/docs/examples/users/delete-session.md +2 -0
  624. package/docs/examples/users/delete-sessions.md +2 -0
  625. package/docs/examples/users/delete-target.md +2 -0
  626. package/docs/examples/users/delete.md +2 -0
  627. package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
  628. package/docs/examples/users/get-prefs.md +2 -0
  629. package/docs/examples/users/get-target.md +2 -0
  630. package/docs/examples/users/get-usage.md +2 -0
  631. package/docs/examples/users/get.md +2 -0
  632. package/docs/examples/users/list-identities.md +2 -0
  633. package/docs/examples/users/list-logs.md +2 -0
  634. package/docs/examples/users/list-memberships.md +2 -0
  635. package/docs/examples/users/list-mfa-factors.md +2 -0
  636. package/docs/examples/users/list-sessions.md +2 -0
  637. package/docs/examples/users/list-targets.md +2 -0
  638. package/docs/examples/users/list.md +2 -0
  639. package/docs/examples/users/update-email-verification.md +2 -0
  640. package/docs/examples/users/update-email.md +2 -0
  641. package/docs/examples/users/update-labels.md +2 -0
  642. package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
  643. package/docs/examples/users/update-mfa.md +2 -0
  644. package/docs/examples/users/update-name.md +2 -0
  645. package/docs/examples/users/update-password.md +2 -0
  646. package/docs/examples/users/update-phone-verification.md +2 -0
  647. package/docs/examples/users/update-phone.md +2 -0
  648. package/docs/examples/users/update-prefs.md +2 -0
  649. package/docs/examples/users/update-status.md +2 -0
  650. package/docs/examples/users/update-target.md +2 -0
  651. package/docs/examples/vcs/create-repository-detection.md +2 -0
  652. package/docs/examples/vcs/create-repository.md +2 -0
  653. package/docs/examples/vcs/delete-installation.md +2 -0
  654. package/docs/examples/vcs/get-installation.md +2 -0
  655. package/docs/examples/vcs/get-repository-contents.md +2 -0
  656. package/docs/examples/vcs/get-repository.md +2 -0
  657. package/docs/examples/vcs/list-installations.md +2 -0
  658. package/docs/examples/vcs/list-repositories.md +2 -0
  659. package/docs/examples/vcs/list-repository-branches.md +2 -0
  660. package/docs/examples/vcs/update-external-deployments.md +2 -0
  661. package/package.json +1 -1
  662. package/src/channel.ts +30 -18
  663. package/src/client.ts +108 -22
  664. package/src/enums/{services.ts → backup-services.ts} +1 -1
  665. package/src/enums/build-runtime.ts +2 -0
  666. package/src/enums/registration-type.ts +6 -0
  667. package/src/enums/runtime.ts +2 -0
  668. package/src/enums/runtimes.ts +2 -0
  669. package/src/enums/scopes.ts +1 -0
  670. package/src/index.ts +3 -3
  671. package/src/models.ts +227 -5
  672. package/src/services/account.ts +11 -11
  673. package/src/services/activities.ts +116 -0
  674. package/src/services/avatars.ts +3 -3
  675. package/src/services/backups.ts +28 -28
  676. package/src/services/console.ts +1 -1
  677. package/src/services/databases.ts +57 -29
  678. package/src/services/domains.ts +70 -0
  679. package/src/services/functions.ts +2 -2
  680. package/src/services/graphql.ts +2 -2
  681. package/src/services/health.ts +1 -1
  682. package/src/services/migrations.ts +10 -10
  683. package/src/services/organizations.ts +0 -60
  684. package/src/services/projects.ts +28 -78
  685. package/src/services/realtime.ts +135 -58
  686. package/src/services/sites.ts +2 -2
  687. package/src/services/storage.ts +1 -1
  688. package/src/services/tables-db.ts +57 -29
  689. package/src/services/teams.ts +18 -19
  690. package/src/services/users.ts +1 -1
  691. package/types/channel.d.ts +4 -3
  692. package/types/client.d.ts +7 -2
  693. package/types/enums/{services.d.ts → backup-services.d.ts} +1 -1
  694. package/types/enums/build-runtime.d.ts +3 -1
  695. package/types/enums/registration-type.d.ts +6 -0
  696. package/types/enums/runtime.d.ts +3 -1
  697. package/types/enums/runtimes.d.ts +3 -1
  698. package/types/enums/scopes.d.ts +2 -1
  699. package/types/index.d.ts +3 -3
  700. package/types/models.d.ts +224 -5
  701. package/types/services/activities.d.ts +46 -0
  702. package/types/services/backups.d.ts +13 -13
  703. package/types/services/databases.d.ts +16 -4
  704. package/types/services/domains.d.ts +26 -0
  705. package/types/services/migrations.d.ts +2 -2
  706. package/types/services/organizations.d.ts +0 -22
  707. package/types/services/projects.d.ts +8 -25
  708. package/types/services/realtime.d.ts +13 -6
  709. package/types/services/tables-db.d.ts +16 -4
  710. package/types/services/teams.d.ts +8 -9
  711. package/docs/examples/organizations/update-projects.md +0 -14
  712. package/docs/examples/projects/update-status.md +0 -14
  713. package/src/enums/roles.ts +0 -7
  714. package/src/enums/status.ts +0 -4
  715. package/types/enums/roles.d.ts +0 -7
  716. package/types/enums/status.d.ts +0 -4
package/dist/cjs/sdk.js CHANGED
@@ -541,7 +541,7 @@ class Client {
541
541
  'x-sdk-name': 'Console',
542
542
  'x-sdk-platform': 'console',
543
543
  'x-sdk-language': 'web',
544
- 'x-sdk-version': '2.2.0',
544
+ 'x-sdk-version': '2.3.1',
545
545
  'X-Appwrite-Response-Format': '1.8.0',
546
546
  };
547
547
  this.realtime = {
@@ -550,7 +550,10 @@ class Client {
550
550
  heartbeat: undefined,
551
551
  url: '',
552
552
  channels: new Set(),
553
+ queries: new Set(),
553
554
  subscriptions: new Map(),
555
+ slotToSubscriptionId: new Map(),
556
+ subscriptionIdToSlot: new Map(),
554
557
  subscriptionsCounter: 0,
555
558
  reconnect: true,
556
559
  reconnectAttempts: 0,
@@ -585,26 +588,34 @@ class Client {
585
588
  }, 20000);
586
589
  },
587
590
  createSocket: () => {
588
- var _a, _b, _c;
589
- if (this.realtime.channels.size < 1) {
591
+ var _a, _b, _c, _d;
592
+ if (this.realtime.subscriptions.size < 1) {
590
593
  this.realtime.reconnect = false;
591
594
  (_a = this.realtime.socket) === null || _a === void 0 ? void 0 : _a.close();
592
595
  return;
593
596
  }
594
- const channels = new URLSearchParams();
595
- if (this.config.project) {
596
- channels.set('project', this.config.project);
597
- }
597
+ const encodedProject = encodeURIComponent((_b = this.config.project) !== null && _b !== void 0 ? _b : '');
598
+ let queryParams = 'project=' + encodedProject;
598
599
  this.realtime.channels.forEach(channel => {
599
- channels.append('channels[]', channel);
600
+ queryParams += '&channels[]=' + encodeURIComponent(channel);
601
+ });
602
+ // Per-subscription queries: channel[slot][]=query so server can route events by subscription
603
+ const selectAllQuery = Query.select(['*']).toString();
604
+ this.realtime.subscriptions.forEach((sub, slot) => {
605
+ const queries = sub.queries.length > 0 ? sub.queries : [selectAllQuery];
606
+ sub.channels.forEach(channel => {
607
+ queries.forEach(query => {
608
+ queryParams += '&' + encodeURIComponent(channel) + '[' + slot + '][]=' + encodeURIComponent(query);
609
+ });
610
+ });
600
611
  });
601
- const url = this.config.endpointRealtime + '/realtime?' + channels.toString();
612
+ const url = this.config.endpointRealtime + '/realtime?' + queryParams;
602
613
  if (url !== this.realtime.url || // Check if URL is present
603
614
  !this.realtime.socket || // Check if WebSocket has not been created
604
- ((_b = this.realtime.socket) === null || _b === void 0 ? void 0 : _b.readyState) > WebSocket.OPEN // Check if WebSocket is CLOSING (3) or CLOSED (4)
615
+ ((_c = this.realtime.socket) === null || _c === void 0 ? void 0 : _c.readyState) > WebSocket.OPEN // Check if WebSocket is CLOSING (3) or CLOSED (4)
605
616
  ) {
606
617
  if (this.realtime.socket &&
607
- ((_c = this.realtime.socket) === null || _c === void 0 ? void 0 : _c.readyState) < WebSocket.CLOSING // Close WebSocket if it is CONNECTING (0) or OPEN (1)
618
+ ((_d = this.realtime.socket) === null || _d === void 0 ? void 0 : _d.readyState) < WebSocket.CLOSING // Close WebSocket if it is CONNECTING (0) or OPEN (1)
608
619
  ) {
609
620
  this.realtime.reconnect = false;
610
621
  this.realtime.socket.close();
@@ -640,14 +651,25 @@ class Client {
640
651
  const message = JSONbig.parse(event.data);
641
652
  this.realtime.lastMessage = message;
642
653
  switch (message.type) {
643
- case 'connected':
654
+ case 'connected': {
655
+ const messageData = message.data;
656
+ if (messageData === null || messageData === void 0 ? void 0 : messageData.subscriptions) {
657
+ this.realtime.slotToSubscriptionId.clear();
658
+ this.realtime.subscriptionIdToSlot.clear();
659
+ for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
660
+ const slot = Number(slotStr);
661
+ if (!isNaN(slot) && typeof subscriptionId === 'string') {
662
+ this.realtime.slotToSubscriptionId.set(slot, subscriptionId);
663
+ this.realtime.subscriptionIdToSlot.set(subscriptionId, slot);
664
+ }
665
+ }
666
+ }
644
667
  let session = this.config.session;
645
668
  if (!session) {
646
669
  const cookie = JSONbig.parse((_a = window.localStorage.getItem('cookieFallback')) !== null && _a !== void 0 ? _a : '{}');
647
670
  session = cookie === null || cookie === void 0 ? void 0 : cookie[`a_session_${this.config.project}`];
648
671
  }
649
- const messageData = message.data;
650
- if (session && !messageData.user) {
672
+ if (session && !(messageData === null || messageData === void 0 ? void 0 : messageData.user)) {
651
673
  (_b = this.realtime.socket) === null || _b === void 0 ? void 0 : _b.send(JSONbig.stringify({
652
674
  type: 'authentication',
653
675
  data: {
@@ -656,12 +678,27 @@ class Client {
656
678
  }));
657
679
  }
658
680
  break;
659
- case 'event':
660
- let data = message.data;
661
- if (data === null || data === void 0 ? void 0 : data.channels) {
681
+ }
682
+ case 'event': {
683
+ const data = message.data;
684
+ if (!(data === null || data === void 0 ? void 0 : data.channels))
685
+ break;
686
+ const eventSubIds = data.subscriptions;
687
+ if (eventSubIds && eventSubIds.length > 0) {
688
+ for (const subscriptionId of eventSubIds) {
689
+ const slot = this.realtime.subscriptionIdToSlot.get(subscriptionId);
690
+ if (slot !== undefined) {
691
+ const subscription = this.realtime.subscriptions.get(slot);
692
+ if (subscription) {
693
+ setTimeout(() => subscription.callback(data));
694
+ }
695
+ }
696
+ }
697
+ }
698
+ else {
662
699
  const isSubscribed = data.channels.some(channel => this.realtime.channels.has(channel));
663
700
  if (!isSubscribed)
664
- return;
701
+ break;
665
702
  this.realtime.subscriptions.forEach(subscription => {
666
703
  if (data.channels.some(channel => subscription.channels.includes(channel))) {
667
704
  setTimeout(() => subscription.callback(data));
@@ -669,6 +706,7 @@ class Client {
669
706
  });
670
707
  }
671
708
  break;
709
+ }
672
710
  case 'pong':
673
711
  break; // Handle pong response if needed
674
712
  case 'error':
@@ -681,7 +719,7 @@ class Client {
681
719
  console.error(e);
682
720
  }
683
721
  },
684
- cleanUp: channels => {
722
+ cleanUp: (channels, queries) => {
685
723
  this.realtime.channels.forEach(channel => {
686
724
  if (channels.includes(channel)) {
687
725
  let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
@@ -692,6 +730,17 @@ class Client {
692
730
  }
693
731
  }
694
732
  });
733
+ this.realtime.queries.forEach(query => {
734
+ if (queries.includes(query)) {
735
+ let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
736
+ var _a;
737
+ return (_a = subscription.queries) === null || _a === void 0 ? void 0 : _a.includes(query);
738
+ });
739
+ if (!found) {
740
+ this.realtime.queries.delete(query);
741
+ }
742
+ }
743
+ });
695
744
  }
696
745
  };
697
746
  }
@@ -872,7 +921,7 @@ class Client {
872
921
  * @param {(payload: RealtimeMessage) => void} callback Is called on every realtime update.
873
922
  * @returns {() => void} Unsubscribes from events.
874
923
  */
875
- subscribe(channels, callback) {
924
+ subscribe(channels, callback, queries = []) {
876
925
  const channelArray = Array.isArray(channels) ? channels : [channels];
877
926
  // Convert Channel instances to strings
878
927
  const channelStrings = channelArray.map(ch => {
@@ -887,15 +936,18 @@ class Client {
887
936
  return String(ch);
888
937
  });
889
938
  channelStrings.forEach(channel => this.realtime.channels.add(channel));
939
+ const queryStrings = (queries !== null && queries !== void 0 ? queries : []).map(q => typeof q === 'string' ? q : q.toString());
940
+ queryStrings.forEach(query => this.realtime.queries.add(query));
890
941
  const counter = this.realtime.subscriptionsCounter++;
891
942
  this.realtime.subscriptions.set(counter, {
892
943
  channels: channelStrings,
944
+ queries: queryStrings,
893
945
  callback
894
946
  });
895
947
  this.realtime.connect();
896
948
  return () => {
897
949
  this.realtime.subscriptions.delete(counter);
898
- this.realtime.cleanUp(channelStrings);
950
+ this.realtime.cleanUp(channelStrings, queryStrings);
899
951
  this.realtime.connect();
900
952
  };
901
953
  }
@@ -1667,7 +1719,7 @@ class Account {
1667
1719
  }
1668
1720
  createMfaAuthenticator(paramsOrFirst) {
1669
1721
  let params;
1670
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
1722
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
1671
1723
  params = (paramsOrFirst || {});
1672
1724
  }
1673
1725
  else {
@@ -1689,7 +1741,7 @@ class Account {
1689
1741
  }
1690
1742
  createMFAAuthenticator(paramsOrFirst) {
1691
1743
  let params;
1692
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
1744
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
1693
1745
  params = (paramsOrFirst || {});
1694
1746
  }
1695
1747
  else {
@@ -1711,7 +1763,7 @@ class Account {
1711
1763
  }
1712
1764
  updateMfaAuthenticator(paramsOrFirst, ...rest) {
1713
1765
  let params;
1714
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
1766
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst || 'otp' in paramsOrFirst))) {
1715
1767
  params = (paramsOrFirst || {});
1716
1768
  }
1717
1769
  else {
@@ -1741,7 +1793,7 @@ class Account {
1741
1793
  }
1742
1794
  updateMFAAuthenticator(paramsOrFirst, ...rest) {
1743
1795
  let params;
1744
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
1796
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst || 'otp' in paramsOrFirst))) {
1745
1797
  params = (paramsOrFirst || {});
1746
1798
  }
1747
1799
  else {
@@ -1771,7 +1823,7 @@ class Account {
1771
1823
  }
1772
1824
  deleteMfaAuthenticator(paramsOrFirst) {
1773
1825
  let params;
1774
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
1826
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
1775
1827
  params = (paramsOrFirst || {});
1776
1828
  }
1777
1829
  else {
@@ -1793,7 +1845,7 @@ class Account {
1793
1845
  }
1794
1846
  deleteMFAAuthenticator(paramsOrFirst) {
1795
1847
  let params;
1796
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'type' in paramsOrFirst)) {
1848
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('type' in paramsOrFirst))) {
1797
1849
  params = (paramsOrFirst || {});
1798
1850
  }
1799
1851
  else {
@@ -1815,7 +1867,7 @@ class Account {
1815
1867
  }
1816
1868
  createMfaChallenge(paramsOrFirst) {
1817
1869
  let params;
1818
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) {
1870
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('factor' in paramsOrFirst))) {
1819
1871
  params = (paramsOrFirst || {});
1820
1872
  }
1821
1873
  else {
@@ -1840,7 +1892,7 @@ class Account {
1840
1892
  }
1841
1893
  createMFAChallenge(paramsOrFirst) {
1842
1894
  let params;
1843
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'factor' in paramsOrFirst)) {
1895
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('factor' in paramsOrFirst))) {
1844
1896
  params = (paramsOrFirst || {});
1845
1897
  }
1846
1898
  else {
@@ -2333,7 +2385,7 @@ class Account {
2333
2385
  }
2334
2386
  updatePrefs(paramsOrFirst) {
2335
2387
  let params;
2336
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'prefs' in paramsOrFirst)) {
2388
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('prefs' in paramsOrFirst))) {
2337
2389
  params = (paramsOrFirst || {});
2338
2390
  }
2339
2391
  else {
@@ -2541,7 +2593,7 @@ class Account {
2541
2593
  }
2542
2594
  createOAuth2Session(paramsOrFirst, ...rest) {
2543
2595
  let params;
2544
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'provider' in paramsOrFirst)) {
2596
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('provider' in paramsOrFirst || 'success' in paramsOrFirst || 'failure' in paramsOrFirst || 'scopes' in paramsOrFirst))) {
2545
2597
  params = (paramsOrFirst || {});
2546
2598
  }
2547
2599
  else {
@@ -2901,7 +2953,7 @@ class Account {
2901
2953
  }
2902
2954
  createOAuth2Token(paramsOrFirst, ...rest) {
2903
2955
  let params;
2904
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'provider' in paramsOrFirst)) {
2956
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('provider' in paramsOrFirst || 'success' in paramsOrFirst || 'failure' in paramsOrFirst || 'scopes' in paramsOrFirst))) {
2905
2957
  params = (paramsOrFirst || {});
2906
2958
  }
2907
2959
  else {
@@ -3142,13 +3194,59 @@ class Account {
3142
3194
  }
3143
3195
  }
3144
3196
 
3197
+ class Activities {
3198
+ constructor(client) {
3199
+ this.client = client;
3200
+ }
3201
+ listEvents(paramsOrFirst) {
3202
+ let params;
3203
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3204
+ params = (paramsOrFirst || {});
3205
+ }
3206
+ else {
3207
+ params = {
3208
+ queries: paramsOrFirst
3209
+ };
3210
+ }
3211
+ const queries = params.queries;
3212
+ const apiPath = '/activities/events';
3213
+ const payload = {};
3214
+ if (typeof queries !== 'undefined') {
3215
+ payload['queries'] = queries;
3216
+ }
3217
+ const uri = new URL(this.client.config.endpoint + apiPath);
3218
+ const apiHeaders = {};
3219
+ return this.client.call('get', uri, apiHeaders, payload);
3220
+ }
3221
+ getEvent(paramsOrFirst) {
3222
+ let params;
3223
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
3224
+ params = (paramsOrFirst || {});
3225
+ }
3226
+ else {
3227
+ params = {
3228
+ eventId: paramsOrFirst
3229
+ };
3230
+ }
3231
+ const eventId = params.eventId;
3232
+ if (typeof eventId === 'undefined') {
3233
+ throw new AppwriteException('Missing required parameter: "eventId"');
3234
+ }
3235
+ const apiPath = '/activities/events/{eventId}'.replace('{eventId}', eventId);
3236
+ const payload = {};
3237
+ const uri = new URL(this.client.config.endpoint + apiPath);
3238
+ const apiHeaders = {};
3239
+ return this.client.call('get', uri, apiHeaders, payload);
3240
+ }
3241
+ }
3242
+
3145
3243
  class Avatars {
3146
3244
  constructor(client) {
3147
3245
  this.client = client;
3148
3246
  }
3149
3247
  getBrowser(paramsOrFirst, ...rest) {
3150
3248
  let params;
3151
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
3249
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
3152
3250
  params = (paramsOrFirst || {});
3153
3251
  }
3154
3252
  else {
@@ -3186,7 +3284,7 @@ class Avatars {
3186
3284
  }
3187
3285
  getCreditCard(paramsOrFirst, ...rest) {
3188
3286
  let params;
3189
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
3287
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
3190
3288
  params = (paramsOrFirst || {});
3191
3289
  }
3192
3290
  else {
@@ -3250,7 +3348,7 @@ class Avatars {
3250
3348
  }
3251
3349
  getFlag(paramsOrFirst, ...rest) {
3252
3350
  let params;
3253
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
3351
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
3254
3352
  params = (paramsOrFirst || {});
3255
3353
  }
3256
3354
  else {
@@ -3550,7 +3648,7 @@ class Backups {
3550
3648
  }
3551
3649
  createArchive(paramsOrFirst, ...rest) {
3552
3650
  let params;
3553
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'services' in paramsOrFirst)) {
3651
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('services' in paramsOrFirst || 'resourceId' in paramsOrFirst))) {
3554
3652
  params = (paramsOrFirst || {});
3555
3653
  }
3556
3654
  else {
@@ -3950,7 +4048,7 @@ class Console {
3950
4048
  }
3951
4049
  getPlans(paramsOrFirst) {
3952
4050
  let params;
3953
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'platform' in paramsOrFirst)) {
4051
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('platform' in paramsOrFirst))) {
3954
4052
  params = (paramsOrFirst || {});
3955
4053
  }
3956
4054
  else {
@@ -4435,7 +4533,7 @@ class Databases {
4435
4533
  }
4436
4534
  listUsage(paramsOrFirst) {
4437
4535
  let params;
4438
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
4536
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
4439
4537
  params = (paramsOrFirst || {});
4440
4538
  }
4441
4539
  else {
@@ -5667,7 +5765,8 @@ class Databases {
5667
5765
  key: rest[1],
5668
5766
  required: rest[2],
5669
5767
  xdefault: rest[3],
5670
- array: rest[4]
5768
+ array: rest[4],
5769
+ encrypt: rest[5]
5671
5770
  };
5672
5771
  }
5673
5772
  const databaseId = params.databaseId;
@@ -5676,6 +5775,7 @@ class Databases {
5676
5775
  const required = params.required;
5677
5776
  const xdefault = params.xdefault;
5678
5777
  const array = params.array;
5778
+ const encrypt = params.encrypt;
5679
5779
  if (typeof databaseId === 'undefined') {
5680
5780
  throw new AppwriteException('Missing required parameter: "databaseId"');
5681
5781
  }
@@ -5702,6 +5802,9 @@ class Databases {
5702
5802
  if (typeof array !== 'undefined') {
5703
5803
  payload['array'] = array;
5704
5804
  }
5805
+ if (typeof encrypt !== 'undefined') {
5806
+ payload['encrypt'] = encrypt;
5807
+ }
5705
5808
  const uri = new URL(this.client.config.endpoint + apiPath);
5706
5809
  const apiHeaders = {
5707
5810
  'content-type': 'application/json',
@@ -5773,7 +5876,8 @@ class Databases {
5773
5876
  key: rest[1],
5774
5877
  required: rest[2],
5775
5878
  xdefault: rest[3],
5776
- array: rest[4]
5879
+ array: rest[4],
5880
+ encrypt: rest[5]
5777
5881
  };
5778
5882
  }
5779
5883
  const databaseId = params.databaseId;
@@ -5782,6 +5886,7 @@ class Databases {
5782
5886
  const required = params.required;
5783
5887
  const xdefault = params.xdefault;
5784
5888
  const array = params.array;
5889
+ const encrypt = params.encrypt;
5785
5890
  if (typeof databaseId === 'undefined') {
5786
5891
  throw new AppwriteException('Missing required parameter: "databaseId"');
5787
5892
  }
@@ -5808,6 +5913,9 @@ class Databases {
5808
5913
  if (typeof array !== 'undefined') {
5809
5914
  payload['array'] = array;
5810
5915
  }
5916
+ if (typeof encrypt !== 'undefined') {
5917
+ payload['encrypt'] = encrypt;
5918
+ }
5811
5919
  const uri = new URL(this.client.config.endpoint + apiPath);
5812
5920
  const apiHeaders = {
5813
5921
  'content-type': 'application/json',
@@ -6262,7 +6370,8 @@ class Databases {
6262
6370
  key: rest[1],
6263
6371
  required: rest[2],
6264
6372
  xdefault: rest[3],
6265
- array: rest[4]
6373
+ array: rest[4],
6374
+ encrypt: rest[5]
6266
6375
  };
6267
6376
  }
6268
6377
  const databaseId = params.databaseId;
@@ -6271,6 +6380,7 @@ class Databases {
6271
6380
  const required = params.required;
6272
6381
  const xdefault = params.xdefault;
6273
6382
  const array = params.array;
6383
+ const encrypt = params.encrypt;
6274
6384
  if (typeof databaseId === 'undefined') {
6275
6385
  throw new AppwriteException('Missing required parameter: "databaseId"');
6276
6386
  }
@@ -6297,6 +6407,9 @@ class Databases {
6297
6407
  if (typeof array !== 'undefined') {
6298
6408
  payload['array'] = array;
6299
6409
  }
6410
+ if (typeof encrypt !== 'undefined') {
6411
+ payload['encrypt'] = encrypt;
6412
+ }
6300
6413
  const uri = new URL(this.client.config.endpoint + apiPath);
6301
6414
  const apiHeaders = {
6302
6415
  'content-type': 'application/json',
@@ -6475,7 +6588,8 @@ class Databases {
6475
6588
  size: rest[2],
6476
6589
  required: rest[3],
6477
6590
  xdefault: rest[4],
6478
- array: rest[5]
6591
+ array: rest[5],
6592
+ encrypt: rest[6]
6479
6593
  };
6480
6594
  }
6481
6595
  const databaseId = params.databaseId;
@@ -6485,6 +6599,7 @@ class Databases {
6485
6599
  const required = params.required;
6486
6600
  const xdefault = params.xdefault;
6487
6601
  const array = params.array;
6602
+ const encrypt = params.encrypt;
6488
6603
  if (typeof databaseId === 'undefined') {
6489
6604
  throw new AppwriteException('Missing required parameter: "databaseId"');
6490
6605
  }
@@ -6517,6 +6632,9 @@ class Databases {
6517
6632
  if (typeof array !== 'undefined') {
6518
6633
  payload['array'] = array;
6519
6634
  }
6635
+ if (typeof encrypt !== 'undefined') {
6636
+ payload['encrypt'] = encrypt;
6637
+ }
6520
6638
  const uri = new URL(this.client.config.endpoint + apiPath);
6521
6639
  const apiHeaders = {
6522
6640
  'content-type': 'application/json',
@@ -7579,6 +7697,39 @@ class Domains {
7579
7697
  };
7580
7698
  return this.client.call('post', uri, apiHeaders, payload);
7581
7699
  }
7700
+ getPrice(paramsOrFirst, ...rest) {
7701
+ let params;
7702
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7703
+ params = (paramsOrFirst || {});
7704
+ }
7705
+ else {
7706
+ params = {
7707
+ domain: paramsOrFirst,
7708
+ periodYears: rest[0],
7709
+ registrationType: rest[1]
7710
+ };
7711
+ }
7712
+ const domain = params.domain;
7713
+ const periodYears = params.periodYears;
7714
+ const registrationType = params.registrationType;
7715
+ if (typeof domain === 'undefined') {
7716
+ throw new AppwriteException('Missing required parameter: "domain"');
7717
+ }
7718
+ const apiPath = '/domains/price';
7719
+ const payload = {};
7720
+ if (typeof domain !== 'undefined') {
7721
+ payload['domain'] = domain;
7722
+ }
7723
+ if (typeof periodYears !== 'undefined') {
7724
+ payload['periodYears'] = periodYears;
7725
+ }
7726
+ if (typeof registrationType !== 'undefined') {
7727
+ payload['registrationType'] = registrationType;
7728
+ }
7729
+ const uri = new URL(this.client.config.endpoint + apiPath);
7730
+ const apiHeaders = {};
7731
+ return this.client.call('get', uri, apiHeaders, payload);
7732
+ }
7582
7733
  listSuggestions(paramsOrFirst, ...rest) {
7583
7734
  let params;
7584
7735
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -9411,7 +9562,7 @@ class Functions {
9411
9562
  }
9412
9563
  listTemplates(paramsOrFirst, ...rest) {
9413
9564
  let params;
9414
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'runtimes' in paramsOrFirst)) {
9565
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('runtimes' in paramsOrFirst || 'useCases' in paramsOrFirst || 'limit' in paramsOrFirst || 'offset' in paramsOrFirst || 'total' in paramsOrFirst))) {
9415
9566
  params = (paramsOrFirst || {});
9416
9567
  }
9417
9568
  else {
@@ -9471,7 +9622,7 @@ class Functions {
9471
9622
  }
9472
9623
  listUsage(paramsOrFirst) {
9473
9624
  let params;
9474
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
9625
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
9475
9626
  params = (paramsOrFirst || {});
9476
9627
  }
9477
9628
  else {
@@ -10341,7 +10492,7 @@ class Graphql {
10341
10492
  }
10342
10493
  query(paramsOrFirst) {
10343
10494
  let params;
10344
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
10495
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) {
10345
10496
  params = (paramsOrFirst || {});
10346
10497
  }
10347
10498
  else {
@@ -10367,7 +10518,7 @@ class Graphql {
10367
10518
  }
10368
10519
  mutation(paramsOrFirst) {
10369
10520
  let params;
10370
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
10521
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) {
10371
10522
  params = (paramsOrFirst || {});
10372
10523
  }
10373
10524
  else {
@@ -10649,7 +10800,7 @@ class Health {
10649
10800
  }
10650
10801
  getFailedJobs(paramsOrFirst, ...rest) {
10651
10802
  let params;
10652
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'name' in paramsOrFirst)) {
10803
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('name' in paramsOrFirst || 'threshold' in paramsOrFirst))) {
10653
10804
  params = (paramsOrFirst || {});
10654
10805
  }
10655
10806
  else {
@@ -13884,7 +14035,7 @@ class Migrations {
13884
14035
  }
13885
14036
  createAppwriteMigration(paramsOrFirst, ...rest) {
13886
14037
  let params;
13887
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14038
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'projectId' in paramsOrFirst || 'apiKey' in paramsOrFirst))) {
13888
14039
  params = (paramsOrFirst || {});
13889
14040
  }
13890
14041
  else {
@@ -13933,7 +14084,7 @@ class Migrations {
13933
14084
  }
13934
14085
  getAppwriteReport(paramsOrFirst, ...rest) {
13935
14086
  let params;
13936
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14087
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'projectID' in paramsOrFirst || 'key' in paramsOrFirst))) {
13937
14088
  params = (paramsOrFirst || {});
13938
14089
  }
13939
14090
  else {
@@ -14094,7 +14245,7 @@ class Migrations {
14094
14245
  }
14095
14246
  createFirebaseMigration(paramsOrFirst, ...rest) {
14096
14247
  let params;
14097
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14248
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'serviceAccount' in paramsOrFirst))) {
14098
14249
  params = (paramsOrFirst || {});
14099
14250
  }
14100
14251
  else {
@@ -14127,7 +14278,7 @@ class Migrations {
14127
14278
  }
14128
14279
  getFirebaseReport(paramsOrFirst, ...rest) {
14129
14280
  let params;
14130
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14281
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'serviceAccount' in paramsOrFirst))) {
14131
14282
  params = (paramsOrFirst || {});
14132
14283
  }
14133
14284
  else {
@@ -14158,7 +14309,7 @@ class Migrations {
14158
14309
  }
14159
14310
  createNHostMigration(paramsOrFirst, ...rest) {
14160
14311
  let params;
14161
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14312
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'subdomain' in paramsOrFirst || 'region' in paramsOrFirst || 'adminSecret' in paramsOrFirst || 'database' in paramsOrFirst || 'username' in paramsOrFirst || 'password' in paramsOrFirst || 'port' in paramsOrFirst))) {
14162
14313
  params = (paramsOrFirst || {});
14163
14314
  }
14164
14315
  else {
@@ -14236,7 +14387,7 @@ class Migrations {
14236
14387
  }
14237
14388
  getNHostReport(paramsOrFirst, ...rest) {
14238
14389
  let params;
14239
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14390
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'subdomain' in paramsOrFirst || 'region' in paramsOrFirst || 'adminSecret' in paramsOrFirst || 'database' in paramsOrFirst || 'username' in paramsOrFirst || 'password' in paramsOrFirst || 'port' in paramsOrFirst))) {
14240
14391
  params = (paramsOrFirst || {});
14241
14392
  }
14242
14393
  else {
@@ -14312,7 +14463,7 @@ class Migrations {
14312
14463
  }
14313
14464
  createSupabaseMigration(paramsOrFirst, ...rest) {
14314
14465
  let params;
14315
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14466
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'apiKey' in paramsOrFirst || 'databaseHost' in paramsOrFirst || 'username' in paramsOrFirst || 'password' in paramsOrFirst || 'port' in paramsOrFirst))) {
14316
14467
  params = (paramsOrFirst || {});
14317
14468
  }
14318
14469
  else {
@@ -14382,7 +14533,7 @@ class Migrations {
14382
14533
  }
14383
14534
  getSupabaseReport(paramsOrFirst, ...rest) {
14384
14535
  let params;
14385
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14536
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'apiKey' in paramsOrFirst || 'databaseHost' in paramsOrFirst || 'username' in paramsOrFirst || 'password' in paramsOrFirst || 'port' in paramsOrFirst))) {
14386
14537
  params = (paramsOrFirst || {});
14387
14538
  }
14388
14539
  else {
@@ -15665,33 +15816,6 @@ class Organizations {
15665
15816
  };
15666
15817
  return this.client.call('patch', uri, apiHeaders, payload);
15667
15818
  }
15668
- updateProjects(paramsOrFirst, ...rest) {
15669
- let params;
15670
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
15671
- params = (paramsOrFirst || {});
15672
- }
15673
- else {
15674
- params = {
15675
- organizationId: paramsOrFirst,
15676
- projects: rest[0]
15677
- };
15678
- }
15679
- const organizationId = params.organizationId;
15680
- const projects = params.projects;
15681
- if (typeof organizationId === 'undefined') {
15682
- throw new AppwriteException('Missing required parameter: "organizationId"');
15683
- }
15684
- const apiPath = '/organizations/{organizationId}/projects'.replace('{organizationId}', organizationId);
15685
- const payload = {};
15686
- if (typeof projects !== 'undefined') {
15687
- payload['projects'] = projects;
15688
- }
15689
- const uri = new URL(this.client.config.endpoint + apiPath);
15690
- const apiHeaders = {
15691
- 'content-type': 'application/json',
15692
- };
15693
- return this.client.call('patch', uri, apiHeaders, payload);
15694
- }
15695
15819
  listRegions(paramsOrFirst) {
15696
15820
  let params;
15697
15821
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -16926,16 +17050,21 @@ class Projects {
16926
17050
  else {
16927
17051
  params = {
16928
17052
  projectId: paramsOrFirst,
16929
- total: rest[0]
17053
+ queries: rest[0],
17054
+ total: rest[1]
16930
17055
  };
16931
17056
  }
16932
17057
  const projectId = params.projectId;
17058
+ const queries = params.queries;
16933
17059
  const total = params.total;
16934
17060
  if (typeof projectId === 'undefined') {
16935
17061
  throw new AppwriteException('Missing required parameter: "projectId"');
16936
17062
  }
16937
17063
  const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
16938
17064
  const payload = {};
17065
+ if (typeof queries !== 'undefined') {
17066
+ payload['queries'] = queries;
17067
+ }
16939
17068
  if (typeof total !== 'undefined') {
16940
17069
  payload['total'] = total;
16941
17070
  }
@@ -16953,12 +17082,14 @@ class Projects {
16953
17082
  projectId: paramsOrFirst,
16954
17083
  name: rest[0],
16955
17084
  scopes: rest[1],
16956
- expire: rest[2]
17085
+ keyId: rest[2],
17086
+ expire: rest[3]
16957
17087
  };
16958
17088
  }
16959
17089
  const projectId = params.projectId;
16960
17090
  const name = params.name;
16961
17091
  const scopes = params.scopes;
17092
+ const keyId = params.keyId;
16962
17093
  const expire = params.expire;
16963
17094
  if (typeof projectId === 'undefined') {
16964
17095
  throw new AppwriteException('Missing required parameter: "projectId"');
@@ -16971,6 +17102,9 @@ class Projects {
16971
17102
  }
16972
17103
  const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
16973
17104
  const payload = {};
17105
+ if (typeof keyId !== 'undefined') {
17106
+ payload['keyId'] = keyId;
17107
+ }
16974
17108
  if (typeof name !== 'undefined') {
16975
17109
  payload['name'] = name;
16976
17110
  }
@@ -17707,36 +17841,6 @@ class Projects {
17707
17841
  };
17708
17842
  return this.client.call('post', uri, apiHeaders, payload);
17709
17843
  }
17710
- updateStatus(paramsOrFirst, ...rest) {
17711
- let params;
17712
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
17713
- params = (paramsOrFirst || {});
17714
- }
17715
- else {
17716
- params = {
17717
- projectId: paramsOrFirst,
17718
- status: rest[0]
17719
- };
17720
- }
17721
- const projectId = params.projectId;
17722
- const status = params.status;
17723
- if (typeof projectId === 'undefined') {
17724
- throw new AppwriteException('Missing required parameter: "projectId"');
17725
- }
17726
- if (typeof status === 'undefined') {
17727
- throw new AppwriteException('Missing required parameter: "status"');
17728
- }
17729
- const apiPath = '/projects/{projectId}/status'.replace('{projectId}', projectId);
17730
- const payload = {};
17731
- if (typeof status !== 'undefined') {
17732
- payload['status'] = status;
17733
- }
17734
- const uri = new URL(this.client.config.endpoint + apiPath);
17735
- const apiHeaders = {
17736
- 'content-type': 'application/json',
17737
- };
17738
- return this.client.call('patch', uri, apiHeaders, payload);
17739
- }
17740
17844
  updateTeam(paramsOrFirst, ...rest) {
17741
17845
  let params;
17742
17846
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -18784,7 +18888,7 @@ class Sites {
18784
18888
  }
18785
18889
  listTemplates(paramsOrFirst, ...rest) {
18786
18890
  let params;
18787
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'frameworks' in paramsOrFirst)) {
18891
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('frameworks' in paramsOrFirst || 'useCases' in paramsOrFirst || 'limit' in paramsOrFirst || 'offset' in paramsOrFirst))) {
18788
18892
  params = (paramsOrFirst || {});
18789
18893
  }
18790
18894
  else {
@@ -18839,7 +18943,7 @@ class Sites {
18839
18943
  }
18840
18944
  listUsage(paramsOrFirst) {
18841
18945
  let params;
18842
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
18946
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
18843
18947
  params = (paramsOrFirst || {});
18844
18948
  }
18845
18949
  else {
@@ -20209,7 +20313,7 @@ class Storage {
20209
20313
  }
20210
20314
  getUsage(paramsOrFirst) {
20211
20315
  let params;
20212
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
20316
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
20213
20317
  params = (paramsOrFirst || {});
20214
20318
  }
20215
20319
  else {
@@ -20471,7 +20575,7 @@ class TablesDB {
20471
20575
  }
20472
20576
  listUsage(paramsOrFirst) {
20473
20577
  let params;
20474
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
20578
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
20475
20579
  params = (paramsOrFirst || {});
20476
20580
  }
20477
20581
  else {
@@ -21703,7 +21807,8 @@ class TablesDB {
21703
21807
  key: rest[1],
21704
21808
  required: rest[2],
21705
21809
  xdefault: rest[3],
21706
- array: rest[4]
21810
+ array: rest[4],
21811
+ encrypt: rest[5]
21707
21812
  };
21708
21813
  }
21709
21814
  const databaseId = params.databaseId;
@@ -21712,6 +21817,7 @@ class TablesDB {
21712
21817
  const required = params.required;
21713
21818
  const xdefault = params.xdefault;
21714
21819
  const array = params.array;
21820
+ const encrypt = params.encrypt;
21715
21821
  if (typeof databaseId === 'undefined') {
21716
21822
  throw new AppwriteException('Missing required parameter: "databaseId"');
21717
21823
  }
@@ -21738,6 +21844,9 @@ class TablesDB {
21738
21844
  if (typeof array !== 'undefined') {
21739
21845
  payload['array'] = array;
21740
21846
  }
21847
+ if (typeof encrypt !== 'undefined') {
21848
+ payload['encrypt'] = encrypt;
21849
+ }
21741
21850
  const uri = new URL(this.client.config.endpoint + apiPath);
21742
21851
  const apiHeaders = {
21743
21852
  'content-type': 'application/json',
@@ -21809,7 +21918,8 @@ class TablesDB {
21809
21918
  key: rest[1],
21810
21919
  required: rest[2],
21811
21920
  xdefault: rest[3],
21812
- array: rest[4]
21921
+ array: rest[4],
21922
+ encrypt: rest[5]
21813
21923
  };
21814
21924
  }
21815
21925
  const databaseId = params.databaseId;
@@ -21818,6 +21928,7 @@ class TablesDB {
21818
21928
  const required = params.required;
21819
21929
  const xdefault = params.xdefault;
21820
21930
  const array = params.array;
21931
+ const encrypt = params.encrypt;
21821
21932
  if (typeof databaseId === 'undefined') {
21822
21933
  throw new AppwriteException('Missing required parameter: "databaseId"');
21823
21934
  }
@@ -21844,6 +21955,9 @@ class TablesDB {
21844
21955
  if (typeof array !== 'undefined') {
21845
21956
  payload['array'] = array;
21846
21957
  }
21958
+ if (typeof encrypt !== 'undefined') {
21959
+ payload['encrypt'] = encrypt;
21960
+ }
21847
21961
  const uri = new URL(this.client.config.endpoint + apiPath);
21848
21962
  const apiHeaders = {
21849
21963
  'content-type': 'application/json',
@@ -22298,7 +22412,8 @@ class TablesDB {
22298
22412
  key: rest[1],
22299
22413
  required: rest[2],
22300
22414
  xdefault: rest[3],
22301
- array: rest[4]
22415
+ array: rest[4],
22416
+ encrypt: rest[5]
22302
22417
  };
22303
22418
  }
22304
22419
  const databaseId = params.databaseId;
@@ -22307,6 +22422,7 @@ class TablesDB {
22307
22422
  const required = params.required;
22308
22423
  const xdefault = params.xdefault;
22309
22424
  const array = params.array;
22425
+ const encrypt = params.encrypt;
22310
22426
  if (typeof databaseId === 'undefined') {
22311
22427
  throw new AppwriteException('Missing required parameter: "databaseId"');
22312
22428
  }
@@ -22333,6 +22449,9 @@ class TablesDB {
22333
22449
  if (typeof array !== 'undefined') {
22334
22450
  payload['array'] = array;
22335
22451
  }
22452
+ if (typeof encrypt !== 'undefined') {
22453
+ payload['encrypt'] = encrypt;
22454
+ }
22336
22455
  const uri = new URL(this.client.config.endpoint + apiPath);
22337
22456
  const apiHeaders = {
22338
22457
  'content-type': 'application/json',
@@ -22511,7 +22630,8 @@ class TablesDB {
22511
22630
  size: rest[2],
22512
22631
  required: rest[3],
22513
22632
  xdefault: rest[4],
22514
- array: rest[5]
22633
+ array: rest[5],
22634
+ encrypt: rest[6]
22515
22635
  };
22516
22636
  }
22517
22637
  const databaseId = params.databaseId;
@@ -22521,6 +22641,7 @@ class TablesDB {
22521
22641
  const required = params.required;
22522
22642
  const xdefault = params.xdefault;
22523
22643
  const array = params.array;
22644
+ const encrypt = params.encrypt;
22524
22645
  if (typeof databaseId === 'undefined') {
22525
22646
  throw new AppwriteException('Missing required parameter: "databaseId"');
22526
22647
  }
@@ -22553,6 +22674,9 @@ class TablesDB {
22553
22674
  if (typeof array !== 'undefined') {
22554
22675
  payload['array'] = array;
22555
22676
  }
22677
+ if (typeof encrypt !== 'undefined') {
22678
+ payload['encrypt'] = encrypt;
22679
+ }
22556
22680
  const uri = new URL(this.client.config.endpoint + apiPath);
22557
22681
  const apiHeaders = {
22558
22682
  'content-type': 'application/json',
@@ -24640,7 +24764,7 @@ class Users {
24640
24764
  }
24641
24765
  getUsage(paramsOrFirst) {
24642
24766
  let params;
24643
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
24767
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
24644
24768
  params = (paramsOrFirst || {});
24645
24769
  }
24646
24770
  else {
@@ -26010,11 +26134,16 @@ class Realtime {
26010
26134
  this.TYPE_CONNECTED = 'connected';
26011
26135
  this.DEBOUNCE_MS = 1;
26012
26136
  this.HEARTBEAT_INTERVAL = 20000; // 20 seconds in milliseconds
26013
- this.activeChannels = new Set();
26137
+ // Slot-centric state: Map<slot, { channels: Set<string>, queries: string[], callback: Function }>
26014
26138
  this.activeSubscriptions = new Map();
26139
+ // Map slot index -> subscriptionId (from backend)
26140
+ this.slotToSubscriptionId = new Map();
26141
+ // Inverse map: subscriptionId -> slot index (for O(1) lookup)
26142
+ this.subscriptionIdToSlot = new Map();
26015
26143
  this.subCallDepth = 0;
26016
26144
  this.reconnectAttempts = 0;
26017
26145
  this.subscriptionsCounter = 0;
26146
+ this.connectionId = 0;
26018
26147
  this.reconnect = true;
26019
26148
  this.onErrorCallbacks = [];
26020
26149
  this.onCloseCallbacks = [];
@@ -26064,7 +26193,7 @@ class Realtime {
26064
26193
  }
26065
26194
  createSocket() {
26066
26195
  return __awaiter(this, void 0, void 0, function* () {
26067
- if (this.activeChannels.size === 0) {
26196
+ if (this.activeSubscriptions.size === 0) {
26068
26197
  this.reconnect = false;
26069
26198
  yield this.closeSocket();
26070
26199
  return;
@@ -26073,10 +26202,36 @@ class Realtime {
26073
26202
  if (!projectId) {
26074
26203
  throw new AppwriteException('Missing project ID');
26075
26204
  }
26205
+ // Collect all unique channels from all slots
26206
+ const allChannels = new Set();
26207
+ for (const subscription of this.activeSubscriptions.values()) {
26208
+ for (const channel of subscription.channels) {
26209
+ allChannels.add(channel);
26210
+ }
26211
+ }
26076
26212
  let queryParams = `project=${projectId}`;
26077
- for (const channel of this.activeChannels) {
26213
+ for (const channel of allChannels) {
26078
26214
  queryParams += `&channels[]=${encodeURIComponent(channel)}`;
26079
26215
  }
26216
+ // Build query string from slots → channels → queries
26217
+ // Format: channel[slot][]=query
26218
+ // For each slot, repeat its queries under each channel it subscribes to
26219
+ // Example: slot 1 → channels [tests, prod], queries [q1, q2]
26220
+ // Produces: tests[1][]=q1&tests[1][]=q2&prod[1][]=q1&prod[1][]=q2
26221
+ const selectAllQuery = Query.select(['*']).toString();
26222
+ for (const [slot, subscription] of this.activeSubscriptions) {
26223
+ // queries is string[] - iterate over each query string
26224
+ const queries = subscription.queries.length === 0
26225
+ ? [selectAllQuery]
26226
+ : subscription.queries;
26227
+ // Repeat this slot's queries under each channel it subscribes to
26228
+ // Each query is sent as a separate parameter: channel[slot][]=q1&channel[slot][]=q2
26229
+ for (const channel of subscription.channels) {
26230
+ for (const query of queries) {
26231
+ queryParams += `&${encodeURIComponent(channel)}[${slot}][]=${encodeURIComponent(query)}`;
26232
+ }
26233
+ }
26234
+ }
26080
26235
  const endpoint = this.client.config.endpointRealtime !== ''
26081
26236
  ? this.client.config.endpointRealtime
26082
26237
  : this.client.config.endpoint || '';
@@ -26086,18 +26241,29 @@ class Realtime {
26086
26241
  const url = `${realtimeEndpoint}/realtime?${queryParams}`;
26087
26242
  if (this.socket) {
26088
26243
  this.reconnect = false;
26089
- yield this.closeSocket();
26244
+ if (this.socket.readyState < WebSocket.CLOSING) {
26245
+ yield this.closeSocket();
26246
+ }
26247
+ // Ensure reconnect isn't stuck false if close event was missed.
26248
+ this.reconnect = true;
26090
26249
  }
26091
26250
  return new Promise((resolve, reject) => {
26092
26251
  try {
26093
- this.socket = new WebSocket(url);
26094
- this.socket.addEventListener('open', () => {
26252
+ const connectionId = ++this.connectionId;
26253
+ const socket = (this.socket = new WebSocket(url));
26254
+ socket.addEventListener('open', () => {
26255
+ if (connectionId !== this.connectionId) {
26256
+ return;
26257
+ }
26095
26258
  this.reconnectAttempts = 0;
26096
26259
  this.onOpenCallbacks.forEach(callback => callback());
26097
26260
  this.startHeartbeat();
26098
26261
  resolve();
26099
26262
  });
26100
- this.socket.addEventListener('message', (event) => {
26263
+ socket.addEventListener('message', (event) => {
26264
+ if (connectionId !== this.connectionId) {
26265
+ return;
26266
+ }
26101
26267
  try {
26102
26268
  const message = JSON.parse(event.data);
26103
26269
  this.handleMessage(message);
@@ -26106,7 +26272,10 @@ class Realtime {
26106
26272
  console.error('Failed to parse message:', error);
26107
26273
  }
26108
26274
  });
26109
- this.socket.addEventListener('close', (event) => __awaiter(this, void 0, void 0, function* () {
26275
+ socket.addEventListener('close', (event) => __awaiter(this, void 0, void 0, function* () {
26276
+ if (connectionId !== this.connectionId || socket !== this.socket) {
26277
+ return;
26278
+ }
26110
26279
  this.stopHeartbeat();
26111
26280
  this.onCloseCallbacks.forEach(callback => callback());
26112
26281
  if (!this.reconnect || event.code === RealtimeCode.POLICY_VIOLATION) {
@@ -26124,7 +26293,10 @@ class Realtime {
26124
26293
  console.error('Failed to reconnect:', error);
26125
26294
  }
26126
26295
  }));
26127
- this.socket.addEventListener('error', (event) => {
26296
+ socket.addEventListener('error', (event) => {
26297
+ if (connectionId !== this.connectionId || socket !== this.socket) {
26298
+ return;
26299
+ }
26128
26300
  this.stopHeartbeat();
26129
26301
  const error = new Error('WebSocket error');
26130
26302
  console.error('WebSocket error:', error.message);
@@ -26195,7 +26367,7 @@ class Realtime {
26195
26367
  }
26196
26368
  return String(channel);
26197
26369
  }
26198
- subscribe(channelsOrChannel, callback) {
26370
+ subscribe(channelsOrChannel, callback, queries = []) {
26199
26371
  return __awaiter(this, void 0, void 0, function* () {
26200
26372
  const channelArray = Array.isArray(channelsOrChannel)
26201
26373
  ? channelsOrChannel
@@ -26203,13 +26375,29 @@ class Realtime {
26203
26375
  // Convert all channels to strings
26204
26376
  const channelStrings = channelArray.map(ch => this.channelToString(ch));
26205
26377
  const channels = new Set(channelStrings);
26206
- this.subscriptionsCounter++;
26207
- const count = this.subscriptionsCounter;
26208
- for (const channel of channels) {
26209
- this.activeChannels.add(channel);
26378
+ // Convert queries to array of strings
26379
+ // Ensure each query is a separate string in the array
26380
+ const queryStrings = [];
26381
+ for (const q of (queries !== null && queries !== void 0 ? queries : [])) {
26382
+ if (Array.isArray(q)) {
26383
+ // Handle nested arrays: [[q1, q2]] -> [q1, q2]
26384
+ for (const inner of q) {
26385
+ queryStrings.push(typeof inner === 'string' ? inner : inner.toString());
26386
+ }
26387
+ }
26388
+ else {
26389
+ queryStrings.push(typeof q === 'string' ? q : q.toString());
26390
+ }
26210
26391
  }
26211
- this.activeSubscriptions.set(count, {
26392
+ // Allocate a new slot index
26393
+ this.subscriptionsCounter++;
26394
+ const slot = this.subscriptionsCounter;
26395
+ // Store slot-centric data: channels, queries, and callback belong to the slot
26396
+ // queries is stored as string[] (array of query strings)
26397
+ // No channel mutation occurs here - channels are derived from slots in createSocket()
26398
+ this.activeSubscriptions.set(slot, {
26212
26399
  channels,
26400
+ queries: queryStrings,
26213
26401
  callback
26214
26402
  });
26215
26403
  this.subCallDepth++;
@@ -26220,23 +26408,19 @@ class Realtime {
26220
26408
  this.subCallDepth--;
26221
26409
  return {
26222
26410
  close: () => __awaiter(this, void 0, void 0, function* () {
26223
- this.activeSubscriptions.delete(count);
26224
- this.cleanUp(channels);
26411
+ const subscriptionId = this.slotToSubscriptionId.get(slot);
26412
+ this.activeSubscriptions.delete(slot);
26413
+ this.slotToSubscriptionId.delete(slot);
26414
+ if (subscriptionId) {
26415
+ this.subscriptionIdToSlot.delete(subscriptionId);
26416
+ }
26225
26417
  yield this.createSocket();
26226
26418
  })
26227
26419
  };
26228
26420
  });
26229
26421
  }
26230
- cleanUp(channels) {
26231
- this.activeChannels = new Set(Array.from(this.activeChannels).filter(channel => {
26232
- if (!channels.has(channel)) {
26233
- return true;
26234
- }
26235
- const subsWithChannel = Array.from(this.activeSubscriptions.values())
26236
- .filter(sub => sub.channels.has(channel));
26237
- return subsWithChannel.length > 0;
26238
- }));
26239
- }
26422
+ // cleanUp is no longer needed - slots are removed directly in subscribe().close()
26423
+ // Channels are automatically rebuilt from remaining slots in createSocket()
26240
26424
  handleMessage(message) {
26241
26425
  if (!message.type) {
26242
26426
  return;
@@ -26262,6 +26446,19 @@ class Realtime {
26262
26446
  return;
26263
26447
  }
26264
26448
  const messageData = message.data;
26449
+ // Store subscription ID mappings from backend
26450
+ // Format: { "0": "sub_a1f9", "1": "sub_b83c", ... }
26451
+ if (messageData.subscriptions) {
26452
+ this.slotToSubscriptionId.clear();
26453
+ this.subscriptionIdToSlot.clear();
26454
+ for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
26455
+ const slot = Number(slotStr);
26456
+ if (!isNaN(slot)) {
26457
+ this.slotToSubscriptionId.set(slot, subscriptionId);
26458
+ this.subscriptionIdToSlot.set(subscriptionId, slot);
26459
+ }
26460
+ }
26461
+ }
26265
26462
  let session = this.client.config.session;
26266
26463
  if (!session) {
26267
26464
  try {
@@ -26296,23 +26493,26 @@ class Realtime {
26296
26493
  const events = data.events;
26297
26494
  const payload = data.payload;
26298
26495
  const timestamp = data.timestamp;
26299
- if (!channels || !events || !payload) {
26496
+ const subscriptions = data.subscriptions;
26497
+ if (!channels || !events || !payload || !subscriptions || subscriptions.length === 0) {
26300
26498
  return;
26301
26499
  }
26302
- const hasActiveChannel = channels.some(channel => this.activeChannels.has(channel));
26303
- if (!hasActiveChannel) {
26304
- return;
26305
- }
26306
- for (const [_, subscription] of this.activeSubscriptions) {
26307
- const hasSubscribedChannel = channels.some(channel => subscription.channels.has(channel));
26308
- if (hasSubscribedChannel) {
26309
- const response = {
26310
- events,
26311
- channels,
26312
- timestamp,
26313
- payload
26314
- };
26315
- subscription.callback(response);
26500
+ // Iterate over all matching subscriptionIds and call callback for each
26501
+ for (const subscriptionId of subscriptions) {
26502
+ // O(1) lookup using subscriptionId
26503
+ const slot = this.subscriptionIdToSlot.get(subscriptionId);
26504
+ if (slot !== undefined) {
26505
+ const subscription = this.activeSubscriptions.get(slot);
26506
+ if (subscription) {
26507
+ const response = {
26508
+ events,
26509
+ channels,
26510
+ timestamp,
26511
+ payload,
26512
+ subscriptions
26513
+ };
26514
+ subscription.callback(response);
26515
+ }
26316
26516
  }
26317
26517
  }
26318
26518
  }
@@ -26514,8 +26714,11 @@ class Channel {
26514
26714
  constructor(segments) {
26515
26715
  this.segments = segments;
26516
26716
  }
26517
- next(segment, id = "*") {
26518
- return new Channel([...this.segments, segment, normalize(id)]);
26717
+ next(segment, id) {
26718
+ const segments = id === undefined
26719
+ ? [...this.segments, segment]
26720
+ : [...this.segments, segment, normalize(id)];
26721
+ return new Channel(segments);
26519
26722
  }
26520
26723
  resolve(action) {
26521
26724
  return new Channel([...this.segments, action]);
@@ -26525,28 +26728,29 @@ class Channel {
26525
26728
  }
26526
26729
  // --- DATABASE ROUTE ---
26527
26730
  // Only available on Channel<Database>
26528
- collection(id = "*") {
26529
- return this.next("collections", id);
26731
+ collection(id) {
26732
+ // Default: wildcard collection ID
26733
+ return this.next("collections", id !== null && id !== void 0 ? id : "*");
26530
26734
  }
26531
26735
  // Only available on Channel<Collection>
26532
- document(id = "*") {
26736
+ document(id) {
26737
+ // Default: no document ID segment
26533
26738
  return this.next("documents", id);
26534
26739
  }
26535
26740
  // --- TABLESDB ROUTE ---
26536
- table(id = "*") {
26537
- return this.next("tables", id);
26741
+ table(id) {
26742
+ // Default: wildcard table ID
26743
+ return this.next("tables", id !== null && id !== void 0 ? id : "*");
26538
26744
  }
26539
- row(id = "*") {
26745
+ row(id) {
26746
+ // Default: no row ID segment
26540
26747
  return this.next("rows", id);
26541
26748
  }
26542
26749
  // --- BUCKET ROUTE ---
26543
- file(id = "*") {
26750
+ file(id) {
26751
+ // Default: no file ID segment
26544
26752
  return this.next("files", id);
26545
26753
  }
26546
- // --- FUNCTION ROUTE ---
26547
- execution(id = "*") {
26548
- return this.next("executions", id);
26549
- }
26550
26754
  // --- TERMINAL ACTIONS ---
26551
26755
  // Restricted to the Actionable union
26552
26756
  create() {
@@ -26562,6 +26766,9 @@ class Channel {
26562
26766
  static database(id = "*") {
26563
26767
  return new Channel(["databases", normalize(id)]);
26564
26768
  }
26769
+ static execution(id = "*") {
26770
+ return new Channel(["executions", normalize(id)]);
26771
+ }
26565
26772
  static tablesdb(id = "*") {
26566
26773
  return new Channel(["tablesdb", normalize(id)]);
26567
26774
  }
@@ -26577,9 +26784,8 @@ class Channel {
26577
26784
  static membership(id = "*") {
26578
26785
  return new Channel(["memberships", normalize(id)]);
26579
26786
  }
26580
- static account(userId = "") {
26581
- const id = normalize(userId);
26582
- return id === "*" ? "account" : `account.${id}`;
26787
+ static account() {
26788
+ return "account";
26583
26789
  }
26584
26790
  // Global events
26585
26791
  static documents() {
@@ -26597,6 +26803,9 @@ class Channel {
26597
26803
  static teams() {
26598
26804
  return "teams";
26599
26805
  }
26806
+ static memberships() {
26807
+ return "memberships";
26808
+ }
26600
26809
  }
26601
26810
 
26602
26811
  exports.Condition = void 0;
@@ -26929,6 +27138,7 @@ exports.Scopes = void 0;
26929
27138
  Scopes["RestorationsWrite"] = "restorations.write";
26930
27139
  Scopes["DomainsRead"] = "domains.read";
26931
27140
  Scopes["DomainsWrite"] = "domains.write";
27141
+ Scopes["EventsRead"] = "events.read";
26932
27142
  })(exports.Scopes || (exports.Scopes = {}));
26933
27143
 
26934
27144
  exports.AuthenticatorType = void 0;
@@ -27691,12 +27901,12 @@ exports.ImageFormat = void 0;
27691
27901
  ImageFormat["Gif"] = "gif";
27692
27902
  })(exports.ImageFormat || (exports.ImageFormat = {}));
27693
27903
 
27694
- exports.Services = void 0;
27695
- (function (Services) {
27696
- Services["Databases"] = "databases";
27697
- Services["Functions"] = "functions";
27698
- Services["Storage"] = "storage";
27699
- })(exports.Services || (exports.Services = {}));
27904
+ exports.BackupServices = void 0;
27905
+ (function (BackupServices) {
27906
+ BackupServices["Databases"] = "databases";
27907
+ BackupServices["Functions"] = "functions";
27908
+ BackupServices["Storage"] = "storage";
27909
+ })(exports.BackupServices || (exports.BackupServices = {}));
27700
27910
 
27701
27911
  exports.Platform = void 0;
27702
27912
  (function (Platform) {
@@ -27745,6 +27955,14 @@ exports.OrderBy = void 0;
27745
27955
  OrderBy["Desc"] = "desc";
27746
27956
  })(exports.OrderBy || (exports.OrderBy = {}));
27747
27957
 
27958
+ exports.RegistrationType = void 0;
27959
+ (function (RegistrationType) {
27960
+ RegistrationType["New"] = "new";
27961
+ RegistrationType["Transfer"] = "transfer";
27962
+ RegistrationType["Renewal"] = "renewal";
27963
+ RegistrationType["Trade"] = "trade";
27964
+ })(exports.RegistrationType || (exports.RegistrationType = {}));
27965
+
27748
27966
  exports.FilterType = void 0;
27749
27967
  (function (FilterType) {
27750
27968
  FilterType["Premium"] = "premium";
@@ -27789,6 +28007,7 @@ exports.Runtime = void 0;
27789
28007
  Runtime["Dart35"] = "dart-3.5";
27790
28008
  Runtime["Dart38"] = "dart-3.8";
27791
28009
  Runtime["Dart39"] = "dart-3.9";
28010
+ Runtime["Dart310"] = "dart-3.10";
27792
28011
  Runtime["Dotnet60"] = "dotnet-6.0";
27793
28012
  Runtime["Dotnet70"] = "dotnet-7.0";
27794
28013
  Runtime["Dotnet80"] = "dotnet-8.0";
@@ -27817,6 +28036,7 @@ exports.Runtime = void 0;
27817
28036
  Runtime["Flutter329"] = "flutter-3.29";
27818
28037
  Runtime["Flutter332"] = "flutter-3.32";
27819
28038
  Runtime["Flutter335"] = "flutter-3.35";
28039
+ Runtime["Flutter338"] = "flutter-3.38";
27820
28040
  })(exports.Runtime || (exports.Runtime = {}));
27821
28041
 
27822
28042
  exports.Runtimes = void 0;
@@ -27857,6 +28077,7 @@ exports.Runtimes = void 0;
27857
28077
  Runtimes["Dart35"] = "dart-3.5";
27858
28078
  Runtimes["Dart38"] = "dart-3.8";
27859
28079
  Runtimes["Dart39"] = "dart-3.9";
28080
+ Runtimes["Dart310"] = "dart-3.10";
27860
28081
  Runtimes["Dotnet60"] = "dotnet-6.0";
27861
28082
  Runtimes["Dotnet70"] = "dotnet-7.0";
27862
28083
  Runtimes["Dotnet80"] = "dotnet-8.0";
@@ -27885,6 +28106,7 @@ exports.Runtimes = void 0;
27885
28106
  Runtimes["Flutter329"] = "flutter-3.29";
27886
28107
  Runtimes["Flutter332"] = "flutter-3.32";
27887
28108
  Runtimes["Flutter335"] = "flutter-3.35";
28109
+ Runtimes["Flutter338"] = "flutter-3.38";
27888
28110
  })(exports.Runtimes || (exports.Runtimes = {}));
27889
28111
 
27890
28112
  exports.UseCases = void 0;
@@ -28052,12 +28274,6 @@ exports.SMTPSecure = void 0;
28052
28274
  SMTPSecure["Ssl"] = "ssl";
28053
28275
  })(exports.SMTPSecure || (exports.SMTPSecure = {}));
28054
28276
 
28055
- exports.Status = void 0;
28056
- (function (Status) {
28057
- Status["Active"] = "active";
28058
- Status["Archived"] = "archived";
28059
- })(exports.Status || (exports.Status = {}));
28060
-
28061
28277
  exports.EmailTemplateType = void 0;
28062
28278
  (function (EmailTemplateType) {
28063
28279
  EmailTemplateType["Verification"] = "verification";
@@ -28418,6 +28634,7 @@ exports.BuildRuntime = void 0;
28418
28634
  BuildRuntime["Dart35"] = "dart-3.5";
28419
28635
  BuildRuntime["Dart38"] = "dart-3.8";
28420
28636
  BuildRuntime["Dart39"] = "dart-3.9";
28637
+ BuildRuntime["Dart310"] = "dart-3.10";
28421
28638
  BuildRuntime["Dotnet60"] = "dotnet-6.0";
28422
28639
  BuildRuntime["Dotnet70"] = "dotnet-7.0";
28423
28640
  BuildRuntime["Dotnet80"] = "dotnet-8.0";
@@ -28446,6 +28663,7 @@ exports.BuildRuntime = void 0;
28446
28663
  BuildRuntime["Flutter329"] = "flutter-3.29";
28447
28664
  BuildRuntime["Flutter332"] = "flutter-3.32";
28448
28665
  BuildRuntime["Flutter335"] = "flutter-3.35";
28666
+ BuildRuntime["Flutter338"] = "flutter-3.38";
28449
28667
  })(exports.BuildRuntime || (exports.BuildRuntime = {}));
28450
28668
 
28451
28669
  exports.Adapter = void 0;
@@ -28493,15 +28711,6 @@ exports.ImageGravity = void 0;
28493
28711
  ImageGravity["Bottomright"] = "bottom-right";
28494
28712
  })(exports.ImageGravity || (exports.ImageGravity = {}));
28495
28713
 
28496
- exports.Roles = void 0;
28497
- (function (Roles) {
28498
- Roles["Developer"] = "developer";
28499
- Roles["Editor"] = "editor";
28500
- Roles["Analyst"] = "analyst";
28501
- Roles["Billing"] = "billing";
28502
- Roles["Owner"] = "owner";
28503
- })(exports.Roles || (exports.Roles = {}));
28504
-
28505
28714
  exports.PasswordHash = void 0;
28506
28715
  (function (PasswordHash) {
28507
28716
  PasswordHash["Sha1"] = "sha1";
@@ -28633,6 +28842,7 @@ exports.BillingPlanGroup = void 0;
28633
28842
  })(exports.BillingPlanGroup || (exports.BillingPlanGroup = {}));
28634
28843
 
28635
28844
  exports.Account = Account;
28845
+ exports.Activities = Activities;
28636
28846
  exports.AppwriteException = AppwriteException;
28637
28847
  exports.Assistant = Assistant;
28638
28848
  exports.Avatars = Avatars;