@appwrite.io/console 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (709) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/sdk.js +326 -194
  4. package/dist/cjs/sdk.js.map +1 -1
  5. package/dist/esm/sdk.js +327 -195
  6. package/dist/esm/sdk.js.map +1 -1
  7. package/dist/iife/sdk.js +326 -194
  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/assistant/chat.md +2 -0
  78. package/docs/examples/avatars/get-browser.md +2 -0
  79. package/docs/examples/avatars/get-credit-card.md +2 -0
  80. package/docs/examples/avatars/get-favicon.md +2 -0
  81. package/docs/examples/avatars/get-flag.md +2 -0
  82. package/docs/examples/avatars/get-image.md +2 -0
  83. package/docs/examples/avatars/get-initials.md +2 -0
  84. package/docs/examples/avatars/get-qr.md +2 -0
  85. package/docs/examples/avatars/get-screenshot.md +2 -0
  86. package/docs/examples/backups/create-archive.md +4 -2
  87. package/docs/examples/backups/create-policy.md +4 -2
  88. package/docs/examples/backups/create-restoration.md +4 -2
  89. package/docs/examples/backups/delete-archive.md +2 -0
  90. package/docs/examples/backups/delete-policy.md +2 -0
  91. package/docs/examples/backups/get-archive.md +2 -0
  92. package/docs/examples/backups/get-policy.md +2 -0
  93. package/docs/examples/backups/get-restoration.md +2 -0
  94. package/docs/examples/backups/list-archives.md +2 -0
  95. package/docs/examples/backups/list-policies.md +2 -0
  96. package/docs/examples/backups/list-restorations.md +2 -0
  97. package/docs/examples/backups/update-policy.md +2 -0
  98. package/docs/examples/console/create-program-membership.md +2 -0
  99. package/docs/examples/console/create-source.md +2 -0
  100. package/docs/examples/console/get-campaign.md +2 -0
  101. package/docs/examples/console/get-coupon.md +2 -0
  102. package/docs/examples/console/get-plan.md +2 -0
  103. package/docs/examples/console/get-plans.md +2 -0
  104. package/docs/examples/console/get-program.md +2 -0
  105. package/docs/examples/console/get-resource.md +2 -0
  106. package/docs/examples/console/list-regions.md +2 -0
  107. package/docs/examples/console/suggest-columns.md +2 -0
  108. package/docs/examples/console/suggest-indexes.md +2 -0
  109. package/docs/examples/console/variables.md +2 -0
  110. package/docs/examples/databases/create-boolean-attribute.md +2 -0
  111. package/docs/examples/databases/create-collection.md +2 -0
  112. package/docs/examples/databases/create-datetime-attribute.md +2 -0
  113. package/docs/examples/databases/create-document.md +2 -0
  114. package/docs/examples/databases/create-documents.md +2 -0
  115. package/docs/examples/databases/create-email-attribute.md +2 -0
  116. package/docs/examples/databases/create-enum-attribute.md +2 -0
  117. package/docs/examples/databases/create-float-attribute.md +2 -0
  118. package/docs/examples/databases/create-index.md +2 -0
  119. package/docs/examples/databases/create-integer-attribute.md +2 -0
  120. package/docs/examples/databases/create-ip-attribute.md +2 -0
  121. package/docs/examples/databases/create-line-attribute.md +2 -0
  122. package/docs/examples/databases/create-longtext-attribute.md +2 -0
  123. package/docs/examples/databases/create-mediumtext-attribute.md +2 -0
  124. package/docs/examples/databases/create-operations.md +2 -0
  125. package/docs/examples/databases/create-point-attribute.md +2 -0
  126. package/docs/examples/databases/create-polygon-attribute.md +2 -0
  127. package/docs/examples/databases/create-relationship-attribute.md +2 -0
  128. package/docs/examples/databases/create-string-attribute.md +2 -0
  129. package/docs/examples/databases/create-text-attribute.md +2 -0
  130. package/docs/examples/databases/create-transaction.md +2 -0
  131. package/docs/examples/databases/create-url-attribute.md +2 -0
  132. package/docs/examples/databases/create-varchar-attribute.md +2 -0
  133. package/docs/examples/databases/create.md +2 -0
  134. package/docs/examples/databases/decrement-document-attribute.md +2 -0
  135. package/docs/examples/databases/delete-attribute.md +2 -0
  136. package/docs/examples/databases/delete-collection.md +2 -0
  137. package/docs/examples/databases/delete-document.md +2 -0
  138. package/docs/examples/databases/delete-documents.md +2 -0
  139. package/docs/examples/databases/delete-index.md +2 -0
  140. package/docs/examples/databases/delete-transaction.md +2 -0
  141. package/docs/examples/databases/delete.md +2 -0
  142. package/docs/examples/databases/get-attribute.md +2 -0
  143. package/docs/examples/databases/get-collection-usage.md +2 -0
  144. package/docs/examples/databases/get-collection.md +2 -0
  145. package/docs/examples/databases/get-document.md +2 -0
  146. package/docs/examples/databases/get-index.md +2 -0
  147. package/docs/examples/databases/get-transaction.md +2 -0
  148. package/docs/examples/databases/get-usage.md +2 -0
  149. package/docs/examples/databases/get.md +2 -0
  150. package/docs/examples/databases/increment-document-attribute.md +2 -0
  151. package/docs/examples/databases/list-attributes.md +2 -0
  152. package/docs/examples/databases/list-collection-logs.md +2 -0
  153. package/docs/examples/databases/list-collections.md +2 -0
  154. package/docs/examples/databases/list-document-logs.md +2 -0
  155. package/docs/examples/databases/list-documents.md +2 -0
  156. package/docs/examples/databases/list-indexes.md +2 -0
  157. package/docs/examples/databases/list-logs.md +2 -0
  158. package/docs/examples/databases/list-transactions.md +2 -0
  159. package/docs/examples/databases/list-usage.md +2 -0
  160. package/docs/examples/databases/list.md +2 -0
  161. package/docs/examples/databases/update-boolean-attribute.md +2 -0
  162. package/docs/examples/databases/update-collection.md +2 -0
  163. package/docs/examples/databases/update-datetime-attribute.md +2 -0
  164. package/docs/examples/databases/update-document.md +2 -0
  165. package/docs/examples/databases/update-documents.md +2 -0
  166. package/docs/examples/databases/update-email-attribute.md +2 -0
  167. package/docs/examples/databases/update-enum-attribute.md +2 -0
  168. package/docs/examples/databases/update-float-attribute.md +2 -0
  169. package/docs/examples/databases/update-integer-attribute.md +2 -0
  170. package/docs/examples/databases/update-ip-attribute.md +2 -0
  171. package/docs/examples/databases/update-line-attribute.md +2 -0
  172. package/docs/examples/databases/update-longtext-attribute.md +2 -0
  173. package/docs/examples/databases/update-mediumtext-attribute.md +2 -0
  174. package/docs/examples/databases/update-point-attribute.md +2 -0
  175. package/docs/examples/databases/update-polygon-attribute.md +2 -0
  176. package/docs/examples/databases/update-relationship-attribute.md +2 -0
  177. package/docs/examples/databases/update-string-attribute.md +2 -0
  178. package/docs/examples/databases/update-text-attribute.md +2 -0
  179. package/docs/examples/databases/update-transaction.md +2 -0
  180. package/docs/examples/databases/update-url-attribute.md +2 -0
  181. package/docs/examples/databases/update-varchar-attribute.md +2 -0
  182. package/docs/examples/databases/update.md +2 -0
  183. package/docs/examples/databases/upsert-document.md +2 -0
  184. package/docs/examples/databases/upsert-documents.md +2 -0
  185. package/docs/examples/domains/create-preset-google-workspace.md +2 -0
  186. package/docs/examples/domains/create-preset-i-cloud.md +2 -0
  187. package/docs/examples/domains/create-preset-mailgun.md +2 -0
  188. package/docs/examples/domains/create-preset-outlook.md +2 -0
  189. package/docs/examples/domains/create-preset-proton-mail.md +2 -0
  190. package/docs/examples/domains/create-preset-zoho.md +2 -0
  191. package/docs/examples/domains/create-record-a.md +2 -0
  192. package/docs/examples/domains/create-record-aaaa.md +2 -0
  193. package/docs/examples/domains/create-record-alias.md +2 -0
  194. package/docs/examples/domains/create-record-caa.md +2 -0
  195. package/docs/examples/domains/create-record-cname.md +2 -0
  196. package/docs/examples/domains/create-record-https.md +2 -0
  197. package/docs/examples/domains/create-record-mx.md +2 -0
  198. package/docs/examples/domains/create-record-ns.md +2 -0
  199. package/docs/examples/domains/create-record-srv.md +2 -0
  200. package/docs/examples/domains/create-record-txt.md +2 -0
  201. package/docs/examples/domains/create.md +2 -0
  202. package/docs/examples/domains/delete-record.md +2 -0
  203. package/docs/examples/domains/delete.md +2 -0
  204. package/docs/examples/domains/get-preset-google-workspace.md +2 -0
  205. package/docs/examples/domains/get-preset-i-cloud.md +2 -0
  206. package/docs/examples/domains/get-preset-mailgun.md +2 -0
  207. package/docs/examples/domains/get-preset-outlook.md +2 -0
  208. package/docs/examples/domains/get-preset-proton-mail.md +2 -0
  209. package/docs/examples/domains/get-preset-zoho.md +2 -0
  210. package/docs/examples/domains/get-price.md +17 -0
  211. package/docs/examples/domains/get-record.md +2 -0
  212. package/docs/examples/domains/get-zone.md +2 -0
  213. package/docs/examples/domains/get.md +2 -0
  214. package/docs/examples/domains/list-records.md +2 -0
  215. package/docs/examples/domains/list-suggestions.md +2 -0
  216. package/docs/examples/domains/list.md +2 -0
  217. package/docs/examples/domains/update-nameservers.md +2 -0
  218. package/docs/examples/domains/update-record-a.md +2 -0
  219. package/docs/examples/domains/update-record-aaaa.md +2 -0
  220. package/docs/examples/domains/update-record-alias.md +2 -0
  221. package/docs/examples/domains/update-record-caa.md +2 -0
  222. package/docs/examples/domains/update-record-cname.md +2 -0
  223. package/docs/examples/domains/update-record-https.md +2 -0
  224. package/docs/examples/domains/update-record-mx.md +2 -0
  225. package/docs/examples/domains/update-record-ns.md +2 -0
  226. package/docs/examples/domains/update-record-srv.md +2 -0
  227. package/docs/examples/domains/update-record-txt.md +2 -0
  228. package/docs/examples/domains/update-team.md +2 -0
  229. package/docs/examples/domains/update-zone.md +2 -0
  230. package/docs/examples/functions/create-deployment.md +2 -0
  231. package/docs/examples/functions/create-duplicate-deployment.md +2 -0
  232. package/docs/examples/functions/create-execution.md +2 -0
  233. package/docs/examples/functions/create-template-deployment.md +2 -0
  234. package/docs/examples/functions/create-variable.md +2 -0
  235. package/docs/examples/functions/create-vcs-deployment.md +2 -0
  236. package/docs/examples/functions/create.md +2 -0
  237. package/docs/examples/functions/delete-deployment.md +2 -0
  238. package/docs/examples/functions/delete-execution.md +2 -0
  239. package/docs/examples/functions/delete-variable.md +2 -0
  240. package/docs/examples/functions/delete.md +2 -0
  241. package/docs/examples/functions/get-deployment-download.md +2 -0
  242. package/docs/examples/functions/get-deployment.md +2 -0
  243. package/docs/examples/functions/get-execution.md +2 -0
  244. package/docs/examples/functions/get-template.md +2 -0
  245. package/docs/examples/functions/get-usage.md +2 -0
  246. package/docs/examples/functions/get-variable.md +2 -0
  247. package/docs/examples/functions/get.md +2 -0
  248. package/docs/examples/functions/list-deployments.md +2 -0
  249. package/docs/examples/functions/list-executions.md +2 -0
  250. package/docs/examples/functions/list-runtimes.md +2 -0
  251. package/docs/examples/functions/list-specifications.md +2 -0
  252. package/docs/examples/functions/list-templates.md +2 -0
  253. package/docs/examples/functions/list-usage.md +2 -0
  254. package/docs/examples/functions/list-variables.md +2 -0
  255. package/docs/examples/functions/list.md +2 -0
  256. package/docs/examples/functions/update-deployment-status.md +2 -0
  257. package/docs/examples/functions/update-function-deployment.md +2 -0
  258. package/docs/examples/functions/update-variable.md +2 -0
  259. package/docs/examples/functions/update.md +2 -0
  260. package/docs/examples/graphql/mutation.md +2 -0
  261. package/docs/examples/graphql/query.md +2 -0
  262. package/docs/examples/health/get-antivirus.md +2 -0
  263. package/docs/examples/health/get-cache.md +2 -0
  264. package/docs/examples/health/get-certificate.md +2 -0
  265. package/docs/examples/health/get-db.md +2 -0
  266. package/docs/examples/health/get-failed-jobs.md +2 -0
  267. package/docs/examples/health/get-pub-sub.md +2 -0
  268. package/docs/examples/health/get-queue-audits.md +2 -0
  269. package/docs/examples/health/get-queue-billing-project-aggregation.md +2 -0
  270. package/docs/examples/health/get-queue-billing-team-aggregation.md +2 -0
  271. package/docs/examples/health/get-queue-builds.md +2 -0
  272. package/docs/examples/health/get-queue-certificates.md +2 -0
  273. package/docs/examples/health/get-queue-databases.md +2 -0
  274. package/docs/examples/health/get-queue-deletes.md +2 -0
  275. package/docs/examples/health/get-queue-functions.md +2 -0
  276. package/docs/examples/health/get-queue-logs.md +2 -0
  277. package/docs/examples/health/get-queue-mails.md +2 -0
  278. package/docs/examples/health/get-queue-messaging.md +2 -0
  279. package/docs/examples/health/get-queue-migrations.md +2 -0
  280. package/docs/examples/health/get-queue-priority-builds.md +2 -0
  281. package/docs/examples/health/get-queue-region-manager.md +2 -0
  282. package/docs/examples/health/get-queue-stats-resources.md +2 -0
  283. package/docs/examples/health/get-queue-threats.md +2 -0
  284. package/docs/examples/health/get-queue-usage.md +2 -0
  285. package/docs/examples/health/get-queue-webhooks.md +2 -0
  286. package/docs/examples/health/get-storage-local.md +2 -0
  287. package/docs/examples/health/get-storage.md +2 -0
  288. package/docs/examples/health/get-time.md +2 -0
  289. package/docs/examples/health/get.md +2 -0
  290. package/docs/examples/locale/get.md +2 -0
  291. package/docs/examples/locale/list-codes.md +2 -0
  292. package/docs/examples/locale/list-continents.md +2 -0
  293. package/docs/examples/locale/list-countries-eu.md +2 -0
  294. package/docs/examples/locale/list-countries-phones.md +2 -0
  295. package/docs/examples/locale/list-countries.md +2 -0
  296. package/docs/examples/locale/list-currencies.md +2 -0
  297. package/docs/examples/locale/list-languages.md +2 -0
  298. package/docs/examples/messaging/create-apns-provider.md +2 -0
  299. package/docs/examples/messaging/create-email.md +2 -0
  300. package/docs/examples/messaging/create-fcm-provider.md +2 -0
  301. package/docs/examples/messaging/create-mailgun-provider.md +2 -0
  302. package/docs/examples/messaging/create-msg-91-provider.md +2 -0
  303. package/docs/examples/messaging/create-push.md +2 -0
  304. package/docs/examples/messaging/create-resend-provider.md +2 -0
  305. package/docs/examples/messaging/create-sendgrid-provider.md +2 -0
  306. package/docs/examples/messaging/create-sms.md +2 -0
  307. package/docs/examples/messaging/create-smtp-provider.md +2 -0
  308. package/docs/examples/messaging/create-subscriber.md +2 -0
  309. package/docs/examples/messaging/create-telesign-provider.md +2 -0
  310. package/docs/examples/messaging/create-textmagic-provider.md +2 -0
  311. package/docs/examples/messaging/create-topic.md +2 -0
  312. package/docs/examples/messaging/create-twilio-provider.md +2 -0
  313. package/docs/examples/messaging/create-vonage-provider.md +2 -0
  314. package/docs/examples/messaging/delete-provider.md +2 -0
  315. package/docs/examples/messaging/delete-subscriber.md +2 -0
  316. package/docs/examples/messaging/delete-topic.md +2 -0
  317. package/docs/examples/messaging/delete.md +2 -0
  318. package/docs/examples/messaging/get-message.md +2 -0
  319. package/docs/examples/messaging/get-provider.md +2 -0
  320. package/docs/examples/messaging/get-subscriber.md +2 -0
  321. package/docs/examples/messaging/get-topic.md +2 -0
  322. package/docs/examples/messaging/list-message-logs.md +2 -0
  323. package/docs/examples/messaging/list-messages.md +2 -0
  324. package/docs/examples/messaging/list-provider-logs.md +2 -0
  325. package/docs/examples/messaging/list-providers.md +2 -0
  326. package/docs/examples/messaging/list-subscriber-logs.md +2 -0
  327. package/docs/examples/messaging/list-subscribers.md +2 -0
  328. package/docs/examples/messaging/list-targets.md +2 -0
  329. package/docs/examples/messaging/list-topic-logs.md +2 -0
  330. package/docs/examples/messaging/list-topics.md +2 -0
  331. package/docs/examples/messaging/update-apns-provider.md +2 -0
  332. package/docs/examples/messaging/update-email.md +2 -0
  333. package/docs/examples/messaging/update-fcm-provider.md +2 -0
  334. package/docs/examples/messaging/update-mailgun-provider.md +2 -0
  335. package/docs/examples/messaging/update-msg-91-provider.md +2 -0
  336. package/docs/examples/messaging/update-push.md +2 -0
  337. package/docs/examples/messaging/update-resend-provider.md +2 -0
  338. package/docs/examples/messaging/update-sendgrid-provider.md +2 -0
  339. package/docs/examples/messaging/update-sms.md +2 -0
  340. package/docs/examples/messaging/update-smtp-provider.md +2 -0
  341. package/docs/examples/messaging/update-telesign-provider.md +2 -0
  342. package/docs/examples/messaging/update-textmagic-provider.md +2 -0
  343. package/docs/examples/messaging/update-topic.md +2 -0
  344. package/docs/examples/messaging/update-twilio-provider.md +2 -0
  345. package/docs/examples/messaging/update-vonage-provider.md +2 -0
  346. package/docs/examples/migrations/create-appwrite-migration.md +2 -0
  347. package/docs/examples/migrations/create-csv-export.md +2 -0
  348. package/docs/examples/migrations/create-csv-import.md +2 -0
  349. package/docs/examples/migrations/create-firebase-migration.md +2 -0
  350. package/docs/examples/migrations/create-n-host-migration.md +2 -0
  351. package/docs/examples/migrations/create-supabase-migration.md +2 -0
  352. package/docs/examples/migrations/delete.md +2 -0
  353. package/docs/examples/migrations/get-appwrite-report.md +2 -0
  354. package/docs/examples/migrations/get-firebase-report.md +2 -0
  355. package/docs/examples/migrations/get-n-host-report.md +2 -0
  356. package/docs/examples/migrations/get-supabase-report.md +2 -0
  357. package/docs/examples/migrations/get.md +2 -0
  358. package/docs/examples/migrations/list.md +2 -0
  359. package/docs/examples/migrations/retry.md +2 -0
  360. package/docs/examples/organizations/add-credit.md +2 -0
  361. package/docs/examples/organizations/cancel-downgrade.md +2 -0
  362. package/docs/examples/organizations/create-downgrade-feedback.md +2 -0
  363. package/docs/examples/organizations/create-invoice-payment.md +2 -0
  364. package/docs/examples/organizations/create-key.md +2 -0
  365. package/docs/examples/organizations/create.md +2 -0
  366. package/docs/examples/organizations/delete-backup-payment-method.md +2 -0
  367. package/docs/examples/organizations/delete-billing-address.md +2 -0
  368. package/docs/examples/organizations/delete-default-payment-method.md +2 -0
  369. package/docs/examples/organizations/delete-key.md +2 -0
  370. package/docs/examples/organizations/delete.md +2 -0
  371. package/docs/examples/organizations/estimation-create-organization.md +2 -0
  372. package/docs/examples/organizations/estimation-delete-organization.md +2 -0
  373. package/docs/examples/organizations/estimation-update-plan.md +2 -0
  374. package/docs/examples/organizations/get-aggregation.md +2 -0
  375. package/docs/examples/organizations/get-available-credits.md +2 -0
  376. package/docs/examples/organizations/get-billing-address.md +2 -0
  377. package/docs/examples/organizations/get-credit.md +2 -0
  378. package/docs/examples/organizations/get-invoice-download.md +2 -0
  379. package/docs/examples/organizations/get-invoice-view.md +2 -0
  380. package/docs/examples/organizations/get-invoice.md +2 -0
  381. package/docs/examples/organizations/get-key.md +2 -0
  382. package/docs/examples/organizations/get-payment-method.md +2 -0
  383. package/docs/examples/organizations/get-plan.md +2 -0
  384. package/docs/examples/organizations/get-scopes.md +2 -0
  385. package/docs/examples/organizations/get-usage.md +2 -0
  386. package/docs/examples/organizations/list-aggregations.md +2 -0
  387. package/docs/examples/organizations/list-credits.md +2 -0
  388. package/docs/examples/organizations/list-invoices.md +2 -0
  389. package/docs/examples/organizations/list-keys.md +2 -0
  390. package/docs/examples/organizations/list-regions.md +2 -0
  391. package/docs/examples/organizations/list.md +2 -0
  392. package/docs/examples/organizations/set-backup-payment-method.md +2 -0
  393. package/docs/examples/organizations/set-billing-address.md +2 -0
  394. package/docs/examples/organizations/set-billing-email.md +2 -0
  395. package/docs/examples/organizations/set-billing-tax-id.md +2 -0
  396. package/docs/examples/organizations/set-default-payment-method.md +2 -0
  397. package/docs/examples/organizations/update-budget.md +2 -0
  398. package/docs/examples/organizations/update-key.md +2 -0
  399. package/docs/examples/organizations/update-plan.md +2 -0
  400. package/docs/examples/organizations/validate-invoice.md +2 -0
  401. package/docs/examples/organizations/validate-payment.md +2 -0
  402. package/docs/examples/project/create-variable.md +2 -0
  403. package/docs/examples/project/delete-variable.md +2 -0
  404. package/docs/examples/project/get-usage.md +2 -0
  405. package/docs/examples/project/get-variable.md +2 -0
  406. package/docs/examples/project/list-variables.md +2 -0
  407. package/docs/examples/project/update-variable.md +2 -0
  408. package/docs/examples/projects/create-dev-key.md +2 -0
  409. package/docs/examples/projects/create-jwt.md +2 -0
  410. package/docs/examples/projects/create-key.md +3 -0
  411. package/docs/examples/projects/create-platform.md +2 -0
  412. package/docs/examples/projects/create-smtp-test.md +2 -0
  413. package/docs/examples/projects/create-webhook.md +2 -0
  414. package/docs/examples/projects/create.md +2 -0
  415. package/docs/examples/projects/delete-dev-key.md +2 -0
  416. package/docs/examples/projects/delete-email-template.md +2 -0
  417. package/docs/examples/projects/delete-key.md +2 -0
  418. package/docs/examples/projects/delete-platform.md +2 -0
  419. package/docs/examples/projects/delete-sms-template.md +2 -0
  420. package/docs/examples/projects/delete-webhook.md +2 -0
  421. package/docs/examples/projects/delete.md +2 -0
  422. package/docs/examples/projects/get-dev-key.md +2 -0
  423. package/docs/examples/projects/get-email-template.md +2 -0
  424. package/docs/examples/projects/get-key.md +2 -0
  425. package/docs/examples/projects/get-platform.md +2 -0
  426. package/docs/examples/projects/get-sms-template.md +2 -0
  427. package/docs/examples/projects/get-webhook.md +2 -0
  428. package/docs/examples/projects/get.md +2 -0
  429. package/docs/examples/projects/list-dev-keys.md +2 -0
  430. package/docs/examples/projects/list-keys.md +3 -0
  431. package/docs/examples/projects/list-platforms.md +2 -0
  432. package/docs/examples/projects/list-webhooks.md +2 -0
  433. package/docs/examples/projects/list.md +2 -0
  434. package/docs/examples/projects/update-api-status-all.md +2 -0
  435. package/docs/examples/projects/update-api-status.md +2 -0
  436. package/docs/examples/projects/update-auth-duration.md +2 -0
  437. package/docs/examples/projects/update-auth-limit.md +2 -0
  438. package/docs/examples/projects/update-auth-password-dictionary.md +2 -0
  439. package/docs/examples/projects/update-auth-password-history.md +2 -0
  440. package/docs/examples/projects/update-auth-sessions-limit.md +2 -0
  441. package/docs/examples/projects/update-auth-status.md +2 -0
  442. package/docs/examples/projects/update-dev-key.md +2 -0
  443. package/docs/examples/projects/update-email-template.md +2 -0
  444. package/docs/examples/projects/update-key.md +2 -0
  445. package/docs/examples/projects/update-labels.md +2 -0
  446. package/docs/examples/projects/update-memberships-privacy.md +2 -0
  447. package/docs/examples/projects/update-mock-numbers.md +2 -0
  448. package/docs/examples/projects/update-o-auth-2.md +2 -0
  449. package/docs/examples/projects/update-personal-data-check.md +2 -0
  450. package/docs/examples/projects/update-platform.md +2 -0
  451. package/docs/examples/projects/update-service-status-all.md +2 -0
  452. package/docs/examples/projects/update-service-status.md +2 -0
  453. package/docs/examples/projects/update-session-alerts.md +2 -0
  454. package/docs/examples/projects/update-session-invalidation.md +2 -0
  455. package/docs/examples/projects/update-sms-template.md +2 -0
  456. package/docs/examples/projects/update-smtp.md +2 -0
  457. package/docs/examples/projects/update-team.md +2 -0
  458. package/docs/examples/projects/update-webhook-signature.md +2 -0
  459. package/docs/examples/projects/update-webhook.md +2 -0
  460. package/docs/examples/projects/update.md +2 -0
  461. package/docs/examples/proxy/create-api-rule.md +2 -0
  462. package/docs/examples/proxy/create-function-rule.md +2 -0
  463. package/docs/examples/proxy/create-redirect-rule.md +2 -0
  464. package/docs/examples/proxy/create-site-rule.md +2 -0
  465. package/docs/examples/proxy/delete-rule.md +2 -0
  466. package/docs/examples/proxy/get-rule.md +2 -0
  467. package/docs/examples/proxy/list-rules.md +2 -0
  468. package/docs/examples/proxy/update-rule-verification.md +2 -0
  469. package/docs/examples/sites/create-deployment.md +2 -0
  470. package/docs/examples/sites/create-duplicate-deployment.md +2 -0
  471. package/docs/examples/sites/create-template-deployment.md +2 -0
  472. package/docs/examples/sites/create-variable.md +2 -0
  473. package/docs/examples/sites/create-vcs-deployment.md +2 -0
  474. package/docs/examples/sites/create.md +2 -0
  475. package/docs/examples/sites/delete-deployment.md +2 -0
  476. package/docs/examples/sites/delete-log.md +2 -0
  477. package/docs/examples/sites/delete-variable.md +2 -0
  478. package/docs/examples/sites/delete.md +2 -0
  479. package/docs/examples/sites/get-deployment-download.md +2 -0
  480. package/docs/examples/sites/get-deployment.md +2 -0
  481. package/docs/examples/sites/get-log.md +2 -0
  482. package/docs/examples/sites/get-template.md +2 -0
  483. package/docs/examples/sites/get-usage.md +2 -0
  484. package/docs/examples/sites/get-variable.md +2 -0
  485. package/docs/examples/sites/get.md +2 -0
  486. package/docs/examples/sites/list-deployments.md +2 -0
  487. package/docs/examples/sites/list-frameworks.md +2 -0
  488. package/docs/examples/sites/list-logs.md +2 -0
  489. package/docs/examples/sites/list-specifications.md +2 -0
  490. package/docs/examples/sites/list-templates.md +2 -0
  491. package/docs/examples/sites/list-usage.md +2 -0
  492. package/docs/examples/sites/list-variables.md +2 -0
  493. package/docs/examples/sites/list.md +2 -0
  494. package/docs/examples/sites/update-deployment-status.md +2 -0
  495. package/docs/examples/sites/update-site-deployment.md +2 -0
  496. package/docs/examples/sites/update-variable.md +2 -0
  497. package/docs/examples/sites/update.md +2 -0
  498. package/docs/examples/storage/create-bucket.md +2 -0
  499. package/docs/examples/storage/create-file.md +2 -0
  500. package/docs/examples/storage/delete-bucket.md +2 -0
  501. package/docs/examples/storage/delete-file.md +2 -0
  502. package/docs/examples/storage/get-bucket-usage.md +2 -0
  503. package/docs/examples/storage/get-bucket.md +2 -0
  504. package/docs/examples/storage/get-file-download.md +2 -0
  505. package/docs/examples/storage/get-file-preview.md +2 -0
  506. package/docs/examples/storage/get-file-view.md +2 -0
  507. package/docs/examples/storage/get-file.md +2 -0
  508. package/docs/examples/storage/get-usage.md +2 -0
  509. package/docs/examples/storage/list-buckets.md +2 -0
  510. package/docs/examples/storage/list-files.md +2 -0
  511. package/docs/examples/storage/update-bucket.md +2 -0
  512. package/docs/examples/storage/update-file.md +2 -0
  513. package/docs/examples/tablesdb/create-boolean-column.md +2 -0
  514. package/docs/examples/tablesdb/create-datetime-column.md +2 -0
  515. package/docs/examples/tablesdb/create-email-column.md +2 -0
  516. package/docs/examples/tablesdb/create-enum-column.md +2 -0
  517. package/docs/examples/tablesdb/create-float-column.md +2 -0
  518. package/docs/examples/tablesdb/create-index.md +2 -0
  519. package/docs/examples/tablesdb/create-integer-column.md +2 -0
  520. package/docs/examples/tablesdb/create-ip-column.md +2 -0
  521. package/docs/examples/tablesdb/create-line-column.md +2 -0
  522. package/docs/examples/tablesdb/create-longtext-column.md +2 -0
  523. package/docs/examples/tablesdb/create-mediumtext-column.md +2 -0
  524. package/docs/examples/tablesdb/create-operations.md +2 -0
  525. package/docs/examples/tablesdb/create-point-column.md +2 -0
  526. package/docs/examples/tablesdb/create-polygon-column.md +2 -0
  527. package/docs/examples/tablesdb/create-relationship-column.md +2 -0
  528. package/docs/examples/tablesdb/create-row.md +2 -0
  529. package/docs/examples/tablesdb/create-rows.md +2 -0
  530. package/docs/examples/tablesdb/create-string-column.md +2 -0
  531. package/docs/examples/tablesdb/create-table.md +2 -0
  532. package/docs/examples/tablesdb/create-text-column.md +2 -0
  533. package/docs/examples/tablesdb/create-transaction.md +2 -0
  534. package/docs/examples/tablesdb/create-url-column.md +2 -0
  535. package/docs/examples/tablesdb/create-varchar-column.md +2 -0
  536. package/docs/examples/tablesdb/create.md +2 -0
  537. package/docs/examples/tablesdb/decrement-row-column.md +2 -0
  538. package/docs/examples/tablesdb/delete-column.md +2 -0
  539. package/docs/examples/tablesdb/delete-index.md +2 -0
  540. package/docs/examples/tablesdb/delete-row.md +2 -0
  541. package/docs/examples/tablesdb/delete-rows.md +2 -0
  542. package/docs/examples/tablesdb/delete-table.md +2 -0
  543. package/docs/examples/tablesdb/delete-transaction.md +2 -0
  544. package/docs/examples/tablesdb/delete.md +2 -0
  545. package/docs/examples/tablesdb/get-column.md +2 -0
  546. package/docs/examples/tablesdb/get-index.md +2 -0
  547. package/docs/examples/tablesdb/get-row.md +2 -0
  548. package/docs/examples/tablesdb/get-table-usage.md +2 -0
  549. package/docs/examples/tablesdb/get-table.md +2 -0
  550. package/docs/examples/tablesdb/get-transaction.md +2 -0
  551. package/docs/examples/tablesdb/get-usage.md +2 -0
  552. package/docs/examples/tablesdb/get.md +2 -0
  553. package/docs/examples/tablesdb/increment-row-column.md +2 -0
  554. package/docs/examples/tablesdb/list-columns.md +2 -0
  555. package/docs/examples/tablesdb/list-indexes.md +2 -0
  556. package/docs/examples/tablesdb/list-row-logs.md +2 -0
  557. package/docs/examples/tablesdb/list-rows.md +2 -0
  558. package/docs/examples/tablesdb/list-table-logs.md +2 -0
  559. package/docs/examples/tablesdb/list-tables.md +2 -0
  560. package/docs/examples/tablesdb/list-transactions.md +2 -0
  561. package/docs/examples/tablesdb/list-usage.md +2 -0
  562. package/docs/examples/tablesdb/list.md +2 -0
  563. package/docs/examples/tablesdb/update-boolean-column.md +2 -0
  564. package/docs/examples/tablesdb/update-datetime-column.md +2 -0
  565. package/docs/examples/tablesdb/update-email-column.md +2 -0
  566. package/docs/examples/tablesdb/update-enum-column.md +2 -0
  567. package/docs/examples/tablesdb/update-float-column.md +2 -0
  568. package/docs/examples/tablesdb/update-integer-column.md +2 -0
  569. package/docs/examples/tablesdb/update-ip-column.md +2 -0
  570. package/docs/examples/tablesdb/update-line-column.md +2 -0
  571. package/docs/examples/tablesdb/update-longtext-column.md +2 -0
  572. package/docs/examples/tablesdb/update-mediumtext-column.md +2 -0
  573. package/docs/examples/tablesdb/update-point-column.md +2 -0
  574. package/docs/examples/tablesdb/update-polygon-column.md +2 -0
  575. package/docs/examples/tablesdb/update-relationship-column.md +2 -0
  576. package/docs/examples/tablesdb/update-row.md +2 -0
  577. package/docs/examples/tablesdb/update-rows.md +2 -0
  578. package/docs/examples/tablesdb/update-string-column.md +2 -0
  579. package/docs/examples/tablesdb/update-table.md +2 -0
  580. package/docs/examples/tablesdb/update-text-column.md +2 -0
  581. package/docs/examples/tablesdb/update-transaction.md +2 -0
  582. package/docs/examples/tablesdb/update-url-column.md +2 -0
  583. package/docs/examples/tablesdb/update-varchar-column.md +2 -0
  584. package/docs/examples/tablesdb/update.md +2 -0
  585. package/docs/examples/tablesdb/upsert-row.md +2 -0
  586. package/docs/examples/tablesdb/upsert-rows.md +2 -0
  587. package/docs/examples/teams/create-membership.md +4 -2
  588. package/docs/examples/teams/create.md +2 -0
  589. package/docs/examples/teams/delete-membership.md +2 -0
  590. package/docs/examples/teams/delete.md +2 -0
  591. package/docs/examples/teams/get-membership.md +2 -0
  592. package/docs/examples/teams/get-prefs.md +2 -0
  593. package/docs/examples/teams/get.md +2 -0
  594. package/docs/examples/teams/list-logs.md +2 -0
  595. package/docs/examples/teams/list-memberships.md +2 -0
  596. package/docs/examples/teams/list.md +2 -0
  597. package/docs/examples/teams/update-membership-status.md +2 -0
  598. package/docs/examples/teams/update-membership.md +4 -2
  599. package/docs/examples/teams/update-name.md +2 -0
  600. package/docs/examples/teams/update-prefs.md +2 -0
  601. package/docs/examples/tokens/create-file-token.md +2 -0
  602. package/docs/examples/tokens/delete.md +2 -0
  603. package/docs/examples/tokens/get.md +2 -0
  604. package/docs/examples/tokens/list.md +2 -0
  605. package/docs/examples/tokens/update.md +2 -0
  606. package/docs/examples/users/create-argon-2-user.md +2 -0
  607. package/docs/examples/users/create-bcrypt-user.md +2 -0
  608. package/docs/examples/users/create-jwt.md +2 -0
  609. package/docs/examples/users/create-md-5-user.md +2 -0
  610. package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
  611. package/docs/examples/users/create-ph-pass-user.md +2 -0
  612. package/docs/examples/users/create-scrypt-modified-user.md +2 -0
  613. package/docs/examples/users/create-scrypt-user.md +2 -0
  614. package/docs/examples/users/create-session.md +2 -0
  615. package/docs/examples/users/create-sha-user.md +2 -0
  616. package/docs/examples/users/create-target.md +2 -0
  617. package/docs/examples/users/create-token.md +2 -0
  618. package/docs/examples/users/create.md +2 -0
  619. package/docs/examples/users/delete-identity.md +2 -0
  620. package/docs/examples/users/delete-mfa-authenticator.md +2 -0
  621. package/docs/examples/users/delete-session.md +2 -0
  622. package/docs/examples/users/delete-sessions.md +2 -0
  623. package/docs/examples/users/delete-target.md +2 -0
  624. package/docs/examples/users/delete.md +2 -0
  625. package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
  626. package/docs/examples/users/get-prefs.md +2 -0
  627. package/docs/examples/users/get-target.md +2 -0
  628. package/docs/examples/users/get-usage.md +2 -0
  629. package/docs/examples/users/get.md +2 -0
  630. package/docs/examples/users/list-identities.md +2 -0
  631. package/docs/examples/users/list-logs.md +2 -0
  632. package/docs/examples/users/list-memberships.md +2 -0
  633. package/docs/examples/users/list-mfa-factors.md +2 -0
  634. package/docs/examples/users/list-sessions.md +2 -0
  635. package/docs/examples/users/list-targets.md +2 -0
  636. package/docs/examples/users/list.md +2 -0
  637. package/docs/examples/users/update-email-verification.md +2 -0
  638. package/docs/examples/users/update-email.md +2 -0
  639. package/docs/examples/users/update-labels.md +2 -0
  640. package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
  641. package/docs/examples/users/update-mfa.md +2 -0
  642. package/docs/examples/users/update-name.md +2 -0
  643. package/docs/examples/users/update-password.md +2 -0
  644. package/docs/examples/users/update-phone-verification.md +2 -0
  645. package/docs/examples/users/update-phone.md +2 -0
  646. package/docs/examples/users/update-prefs.md +2 -0
  647. package/docs/examples/users/update-status.md +2 -0
  648. package/docs/examples/users/update-target.md +2 -0
  649. package/docs/examples/vcs/create-repository-detection.md +2 -0
  650. package/docs/examples/vcs/create-repository.md +2 -0
  651. package/docs/examples/vcs/delete-installation.md +2 -0
  652. package/docs/examples/vcs/get-installation.md +2 -0
  653. package/docs/examples/vcs/get-repository-contents.md +2 -0
  654. package/docs/examples/vcs/get-repository.md +2 -0
  655. package/docs/examples/vcs/list-installations.md +2 -0
  656. package/docs/examples/vcs/list-repositories.md +2 -0
  657. package/docs/examples/vcs/list-repository-branches.md +2 -0
  658. package/docs/examples/vcs/update-external-deployments.md +2 -0
  659. package/package.json +1 -1
  660. package/src/channel.ts +30 -18
  661. package/src/client.ts +108 -22
  662. package/src/enums/{services.ts → backup-services.ts} +1 -1
  663. package/src/enums/build-runtime.ts +5 -0
  664. package/src/enums/registration-type.ts +6 -0
  665. package/src/enums/runtime.ts +5 -0
  666. package/src/enums/runtimes.ts +5 -0
  667. package/src/enums/scopes.ts +1 -0
  668. package/src/index.ts +2 -3
  669. package/src/models.ts +45 -3
  670. package/src/services/account.ts +11 -11
  671. package/src/services/avatars.ts +3 -3
  672. package/src/services/backups.ts +28 -28
  673. package/src/services/console.ts +1 -1
  674. package/src/services/databases.ts +1 -1
  675. package/src/services/domains.ts +70 -0
  676. package/src/services/functions.ts +2 -2
  677. package/src/services/graphql.ts +2 -2
  678. package/src/services/health.ts +1 -1
  679. package/src/services/migrations.ts +8 -8
  680. package/src/services/organizations.ts +0 -60
  681. package/src/services/projects.ts +28 -78
  682. package/src/services/realtime.ts +135 -58
  683. package/src/services/sites.ts +2 -2
  684. package/src/services/storage.ts +1 -1
  685. package/src/services/tables-db.ts +1 -1
  686. package/src/services/teams.ts +18 -19
  687. package/src/services/users.ts +1 -1
  688. package/types/channel.d.ts +4 -3
  689. package/types/client.d.ts +7 -2
  690. package/types/enums/{services.d.ts → backup-services.d.ts} +1 -1
  691. package/types/enums/build-runtime.d.ts +6 -1
  692. package/types/enums/registration-type.d.ts +6 -0
  693. package/types/enums/runtime.d.ts +6 -1
  694. package/types/enums/runtimes.d.ts +6 -1
  695. package/types/enums/scopes.d.ts +2 -1
  696. package/types/index.d.ts +2 -3
  697. package/types/models.d.ts +44 -3
  698. package/types/services/backups.d.ts +13 -13
  699. package/types/services/domains.d.ts +26 -0
  700. package/types/services/organizations.d.ts +0 -22
  701. package/types/services/projects.d.ts +8 -25
  702. package/types/services/realtime.d.ts +13 -6
  703. package/types/services/teams.d.ts +8 -9
  704. package/docs/examples/organizations/update-projects.md +0 -14
  705. package/docs/examples/projects/update-status.md +0 -14
  706. package/src/enums/roles.ts +0 -7
  707. package/src/enums/status.ts +0 -4
  708. package/types/enums/roles.d.ts +0 -7
  709. 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.0',
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);
600
601
  });
601
- const url = this.config.endpointRealtime + '/realtime?' + channels.toString();
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
+ });
611
+ });
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 {
@@ -3148,7 +3200,7 @@ class Avatars {
3148
3200
  }
3149
3201
  getBrowser(paramsOrFirst, ...rest) {
3150
3202
  let params;
3151
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
3203
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
3152
3204
  params = (paramsOrFirst || {});
3153
3205
  }
3154
3206
  else {
@@ -3186,7 +3238,7 @@ class Avatars {
3186
3238
  }
3187
3239
  getCreditCard(paramsOrFirst, ...rest) {
3188
3240
  let params;
3189
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
3241
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
3190
3242
  params = (paramsOrFirst || {});
3191
3243
  }
3192
3244
  else {
@@ -3250,7 +3302,7 @@ class Avatars {
3250
3302
  }
3251
3303
  getFlag(paramsOrFirst, ...rest) {
3252
3304
  let params;
3253
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'code' in paramsOrFirst)) {
3305
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('code' in paramsOrFirst || 'width' in paramsOrFirst || 'height' in paramsOrFirst || 'quality' in paramsOrFirst))) {
3254
3306
  params = (paramsOrFirst || {});
3255
3307
  }
3256
3308
  else {
@@ -3550,7 +3602,7 @@ class Backups {
3550
3602
  }
3551
3603
  createArchive(paramsOrFirst, ...rest) {
3552
3604
  let params;
3553
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'services' in paramsOrFirst)) {
3605
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('services' in paramsOrFirst || 'resourceId' in paramsOrFirst))) {
3554
3606
  params = (paramsOrFirst || {});
3555
3607
  }
3556
3608
  else {
@@ -3950,7 +4002,7 @@ class Console {
3950
4002
  }
3951
4003
  getPlans(paramsOrFirst) {
3952
4004
  let params;
3953
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'platform' in paramsOrFirst)) {
4005
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('platform' in paramsOrFirst))) {
3954
4006
  params = (paramsOrFirst || {});
3955
4007
  }
3956
4008
  else {
@@ -4435,7 +4487,7 @@ class Databases {
4435
4487
  }
4436
4488
  listUsage(paramsOrFirst) {
4437
4489
  let params;
4438
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
4490
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
4439
4491
  params = (paramsOrFirst || {});
4440
4492
  }
4441
4493
  else {
@@ -7579,6 +7631,39 @@ class Domains {
7579
7631
  };
7580
7632
  return this.client.call('post', uri, apiHeaders, payload);
7581
7633
  }
7634
+ getPrice(paramsOrFirst, ...rest) {
7635
+ let params;
7636
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
7637
+ params = (paramsOrFirst || {});
7638
+ }
7639
+ else {
7640
+ params = {
7641
+ domain: paramsOrFirst,
7642
+ periodYears: rest[0],
7643
+ registrationType: rest[1]
7644
+ };
7645
+ }
7646
+ const domain = params.domain;
7647
+ const periodYears = params.periodYears;
7648
+ const registrationType = params.registrationType;
7649
+ if (typeof domain === 'undefined') {
7650
+ throw new AppwriteException('Missing required parameter: "domain"');
7651
+ }
7652
+ const apiPath = '/domains/price';
7653
+ const payload = {};
7654
+ if (typeof domain !== 'undefined') {
7655
+ payload['domain'] = domain;
7656
+ }
7657
+ if (typeof periodYears !== 'undefined') {
7658
+ payload['periodYears'] = periodYears;
7659
+ }
7660
+ if (typeof registrationType !== 'undefined') {
7661
+ payload['registrationType'] = registrationType;
7662
+ }
7663
+ const uri = new URL(this.client.config.endpoint + apiPath);
7664
+ const apiHeaders = {};
7665
+ return this.client.call('get', uri, apiHeaders, payload);
7666
+ }
7582
7667
  listSuggestions(paramsOrFirst, ...rest) {
7583
7668
  let params;
7584
7669
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -9411,7 +9496,7 @@ class Functions {
9411
9496
  }
9412
9497
  listTemplates(paramsOrFirst, ...rest) {
9413
9498
  let params;
9414
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'runtimes' in paramsOrFirst)) {
9499
+ 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
9500
  params = (paramsOrFirst || {});
9416
9501
  }
9417
9502
  else {
@@ -9471,7 +9556,7 @@ class Functions {
9471
9556
  }
9472
9557
  listUsage(paramsOrFirst) {
9473
9558
  let params;
9474
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
9559
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
9475
9560
  params = (paramsOrFirst || {});
9476
9561
  }
9477
9562
  else {
@@ -10341,7 +10426,7 @@ class Graphql {
10341
10426
  }
10342
10427
  query(paramsOrFirst) {
10343
10428
  let params;
10344
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
10429
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) {
10345
10430
  params = (paramsOrFirst || {});
10346
10431
  }
10347
10432
  else {
@@ -10367,7 +10452,7 @@ class Graphql {
10367
10452
  }
10368
10453
  mutation(paramsOrFirst) {
10369
10454
  let params;
10370
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'query' in paramsOrFirst)) {
10455
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('query' in paramsOrFirst))) {
10371
10456
  params = (paramsOrFirst || {});
10372
10457
  }
10373
10458
  else {
@@ -10649,7 +10734,7 @@ class Health {
10649
10734
  }
10650
10735
  getFailedJobs(paramsOrFirst, ...rest) {
10651
10736
  let params;
10652
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'name' in paramsOrFirst)) {
10737
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('name' in paramsOrFirst || 'threshold' in paramsOrFirst))) {
10653
10738
  params = (paramsOrFirst || {});
10654
10739
  }
10655
10740
  else {
@@ -13884,7 +13969,7 @@ class Migrations {
13884
13969
  }
13885
13970
  createAppwriteMigration(paramsOrFirst, ...rest) {
13886
13971
  let params;
13887
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
13972
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'projectId' in paramsOrFirst || 'apiKey' in paramsOrFirst))) {
13888
13973
  params = (paramsOrFirst || {});
13889
13974
  }
13890
13975
  else {
@@ -13933,7 +14018,7 @@ class Migrations {
13933
14018
  }
13934
14019
  getAppwriteReport(paramsOrFirst, ...rest) {
13935
14020
  let params;
13936
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14021
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'endpoint' in paramsOrFirst || 'projectID' in paramsOrFirst || 'key' in paramsOrFirst))) {
13937
14022
  params = (paramsOrFirst || {});
13938
14023
  }
13939
14024
  else {
@@ -14094,7 +14179,7 @@ class Migrations {
14094
14179
  }
14095
14180
  createFirebaseMigration(paramsOrFirst, ...rest) {
14096
14181
  let params;
14097
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14182
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'serviceAccount' in paramsOrFirst))) {
14098
14183
  params = (paramsOrFirst || {});
14099
14184
  }
14100
14185
  else {
@@ -14127,7 +14212,7 @@ class Migrations {
14127
14212
  }
14128
14213
  getFirebaseReport(paramsOrFirst, ...rest) {
14129
14214
  let params;
14130
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14215
+ if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('resources' in paramsOrFirst || 'serviceAccount' in paramsOrFirst))) {
14131
14216
  params = (paramsOrFirst || {});
14132
14217
  }
14133
14218
  else {
@@ -14158,7 +14243,7 @@ class Migrations {
14158
14243
  }
14159
14244
  createNHostMigration(paramsOrFirst, ...rest) {
14160
14245
  let params;
14161
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14246
+ 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
14247
  params = (paramsOrFirst || {});
14163
14248
  }
14164
14249
  else {
@@ -14236,7 +14321,7 @@ class Migrations {
14236
14321
  }
14237
14322
  getNHostReport(paramsOrFirst, ...rest) {
14238
14323
  let params;
14239
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14324
+ 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
14325
  params = (paramsOrFirst || {});
14241
14326
  }
14242
14327
  else {
@@ -14312,7 +14397,7 @@ class Migrations {
14312
14397
  }
14313
14398
  createSupabaseMigration(paramsOrFirst, ...rest) {
14314
14399
  let params;
14315
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14400
+ 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
14401
  params = (paramsOrFirst || {});
14317
14402
  }
14318
14403
  else {
@@ -14382,7 +14467,7 @@ class Migrations {
14382
14467
  }
14383
14468
  getSupabaseReport(paramsOrFirst, ...rest) {
14384
14469
  let params;
14385
- if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'resources' in paramsOrFirst)) {
14470
+ 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
14471
  params = (paramsOrFirst || {});
14387
14472
  }
14388
14473
  else {
@@ -15665,33 +15750,6 @@ class Organizations {
15665
15750
  };
15666
15751
  return this.client.call('patch', uri, apiHeaders, payload);
15667
15752
  }
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
15753
  listRegions(paramsOrFirst) {
15696
15754
  let params;
15697
15755
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -16926,16 +16984,21 @@ class Projects {
16926
16984
  else {
16927
16985
  params = {
16928
16986
  projectId: paramsOrFirst,
16929
- total: rest[0]
16987
+ queries: rest[0],
16988
+ total: rest[1]
16930
16989
  };
16931
16990
  }
16932
16991
  const projectId = params.projectId;
16992
+ const queries = params.queries;
16933
16993
  const total = params.total;
16934
16994
  if (typeof projectId === 'undefined') {
16935
16995
  throw new AppwriteException('Missing required parameter: "projectId"');
16936
16996
  }
16937
16997
  const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
16938
16998
  const payload = {};
16999
+ if (typeof queries !== 'undefined') {
17000
+ payload['queries'] = queries;
17001
+ }
16939
17002
  if (typeof total !== 'undefined') {
16940
17003
  payload['total'] = total;
16941
17004
  }
@@ -16953,12 +17016,14 @@ class Projects {
16953
17016
  projectId: paramsOrFirst,
16954
17017
  name: rest[0],
16955
17018
  scopes: rest[1],
16956
- expire: rest[2]
17019
+ keyId: rest[2],
17020
+ expire: rest[3]
16957
17021
  };
16958
17022
  }
16959
17023
  const projectId = params.projectId;
16960
17024
  const name = params.name;
16961
17025
  const scopes = params.scopes;
17026
+ const keyId = params.keyId;
16962
17027
  const expire = params.expire;
16963
17028
  if (typeof projectId === 'undefined') {
16964
17029
  throw new AppwriteException('Missing required parameter: "projectId"');
@@ -16971,6 +17036,9 @@ class Projects {
16971
17036
  }
16972
17037
  const apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
16973
17038
  const payload = {};
17039
+ if (typeof keyId !== 'undefined') {
17040
+ payload['keyId'] = keyId;
17041
+ }
16974
17042
  if (typeof name !== 'undefined') {
16975
17043
  payload['name'] = name;
16976
17044
  }
@@ -17707,36 +17775,6 @@ class Projects {
17707
17775
  };
17708
17776
  return this.client.call('post', uri, apiHeaders, payload);
17709
17777
  }
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
17778
  updateTeam(paramsOrFirst, ...rest) {
17741
17779
  let params;
17742
17780
  if ((paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst))) {
@@ -18784,7 +18822,7 @@ class Sites {
18784
18822
  }
18785
18823
  listTemplates(paramsOrFirst, ...rest) {
18786
18824
  let params;
18787
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'frameworks' in paramsOrFirst)) {
18825
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('frameworks' in paramsOrFirst || 'useCases' in paramsOrFirst || 'limit' in paramsOrFirst || 'offset' in paramsOrFirst))) {
18788
18826
  params = (paramsOrFirst || {});
18789
18827
  }
18790
18828
  else {
@@ -18839,7 +18877,7 @@ class Sites {
18839
18877
  }
18840
18878
  listUsage(paramsOrFirst) {
18841
18879
  let params;
18842
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
18880
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
18843
18881
  params = (paramsOrFirst || {});
18844
18882
  }
18845
18883
  else {
@@ -20209,7 +20247,7 @@ class Storage {
20209
20247
  }
20210
20248
  getUsage(paramsOrFirst) {
20211
20249
  let params;
20212
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
20250
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
20213
20251
  params = (paramsOrFirst || {});
20214
20252
  }
20215
20253
  else {
@@ -20471,7 +20509,7 @@ class TablesDB {
20471
20509
  }
20472
20510
  listUsage(paramsOrFirst) {
20473
20511
  let params;
20474
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
20512
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
20475
20513
  params = (paramsOrFirst || {});
20476
20514
  }
20477
20515
  else {
@@ -24640,7 +24678,7 @@ class Users {
24640
24678
  }
24641
24679
  getUsage(paramsOrFirst) {
24642
24680
  let params;
24643
- if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && 'range' in paramsOrFirst)) {
24681
+ if (!paramsOrFirst || (paramsOrFirst && typeof paramsOrFirst === 'object' && !Array.isArray(paramsOrFirst) && ('range' in paramsOrFirst))) {
24644
24682
  params = (paramsOrFirst || {});
24645
24683
  }
24646
24684
  else {
@@ -26010,11 +26048,16 @@ class Realtime {
26010
26048
  this.TYPE_CONNECTED = 'connected';
26011
26049
  this.DEBOUNCE_MS = 1;
26012
26050
  this.HEARTBEAT_INTERVAL = 20000; // 20 seconds in milliseconds
26013
- this.activeChannels = new Set();
26051
+ // Slot-centric state: Map<slot, { channels: Set<string>, queries: string[], callback: Function }>
26014
26052
  this.activeSubscriptions = new Map();
26053
+ // Map slot index -> subscriptionId (from backend)
26054
+ this.slotToSubscriptionId = new Map();
26055
+ // Inverse map: subscriptionId -> slot index (for O(1) lookup)
26056
+ this.subscriptionIdToSlot = new Map();
26015
26057
  this.subCallDepth = 0;
26016
26058
  this.reconnectAttempts = 0;
26017
26059
  this.subscriptionsCounter = 0;
26060
+ this.connectionId = 0;
26018
26061
  this.reconnect = true;
26019
26062
  this.onErrorCallbacks = [];
26020
26063
  this.onCloseCallbacks = [];
@@ -26064,7 +26107,7 @@ class Realtime {
26064
26107
  }
26065
26108
  createSocket() {
26066
26109
  return __awaiter(this, void 0, void 0, function* () {
26067
- if (this.activeChannels.size === 0) {
26110
+ if (this.activeSubscriptions.size === 0) {
26068
26111
  this.reconnect = false;
26069
26112
  yield this.closeSocket();
26070
26113
  return;
@@ -26073,10 +26116,36 @@ class Realtime {
26073
26116
  if (!projectId) {
26074
26117
  throw new AppwriteException('Missing project ID');
26075
26118
  }
26119
+ // Collect all unique channels from all slots
26120
+ const allChannels = new Set();
26121
+ for (const subscription of this.activeSubscriptions.values()) {
26122
+ for (const channel of subscription.channels) {
26123
+ allChannels.add(channel);
26124
+ }
26125
+ }
26076
26126
  let queryParams = `project=${projectId}`;
26077
- for (const channel of this.activeChannels) {
26127
+ for (const channel of allChannels) {
26078
26128
  queryParams += `&channels[]=${encodeURIComponent(channel)}`;
26079
26129
  }
26130
+ // Build query string from slots → channels → queries
26131
+ // Format: channel[slot][]=query
26132
+ // For each slot, repeat its queries under each channel it subscribes to
26133
+ // Example: slot 1 → channels [tests, prod], queries [q1, q2]
26134
+ // Produces: tests[1][]=q1&tests[1][]=q2&prod[1][]=q1&prod[1][]=q2
26135
+ const selectAllQuery = Query.select(['*']).toString();
26136
+ for (const [slot, subscription] of this.activeSubscriptions) {
26137
+ // queries is string[] - iterate over each query string
26138
+ const queries = subscription.queries.length === 0
26139
+ ? [selectAllQuery]
26140
+ : subscription.queries;
26141
+ // Repeat this slot's queries under each channel it subscribes to
26142
+ // Each query is sent as a separate parameter: channel[slot][]=q1&channel[slot][]=q2
26143
+ for (const channel of subscription.channels) {
26144
+ for (const query of queries) {
26145
+ queryParams += `&${encodeURIComponent(channel)}[${slot}][]=${encodeURIComponent(query)}`;
26146
+ }
26147
+ }
26148
+ }
26080
26149
  const endpoint = this.client.config.endpointRealtime !== ''
26081
26150
  ? this.client.config.endpointRealtime
26082
26151
  : this.client.config.endpoint || '';
@@ -26086,18 +26155,29 @@ class Realtime {
26086
26155
  const url = `${realtimeEndpoint}/realtime?${queryParams}`;
26087
26156
  if (this.socket) {
26088
26157
  this.reconnect = false;
26089
- yield this.closeSocket();
26158
+ if (this.socket.readyState < WebSocket.CLOSING) {
26159
+ yield this.closeSocket();
26160
+ }
26161
+ // Ensure reconnect isn't stuck false if close event was missed.
26162
+ this.reconnect = true;
26090
26163
  }
26091
26164
  return new Promise((resolve, reject) => {
26092
26165
  try {
26093
- this.socket = new WebSocket(url);
26094
- this.socket.addEventListener('open', () => {
26166
+ const connectionId = ++this.connectionId;
26167
+ const socket = (this.socket = new WebSocket(url));
26168
+ socket.addEventListener('open', () => {
26169
+ if (connectionId !== this.connectionId) {
26170
+ return;
26171
+ }
26095
26172
  this.reconnectAttempts = 0;
26096
26173
  this.onOpenCallbacks.forEach(callback => callback());
26097
26174
  this.startHeartbeat();
26098
26175
  resolve();
26099
26176
  });
26100
- this.socket.addEventListener('message', (event) => {
26177
+ socket.addEventListener('message', (event) => {
26178
+ if (connectionId !== this.connectionId) {
26179
+ return;
26180
+ }
26101
26181
  try {
26102
26182
  const message = JSON.parse(event.data);
26103
26183
  this.handleMessage(message);
@@ -26106,7 +26186,10 @@ class Realtime {
26106
26186
  console.error('Failed to parse message:', error);
26107
26187
  }
26108
26188
  });
26109
- this.socket.addEventListener('close', (event) => __awaiter(this, void 0, void 0, function* () {
26189
+ socket.addEventListener('close', (event) => __awaiter(this, void 0, void 0, function* () {
26190
+ if (connectionId !== this.connectionId || socket !== this.socket) {
26191
+ return;
26192
+ }
26110
26193
  this.stopHeartbeat();
26111
26194
  this.onCloseCallbacks.forEach(callback => callback());
26112
26195
  if (!this.reconnect || event.code === RealtimeCode.POLICY_VIOLATION) {
@@ -26124,7 +26207,10 @@ class Realtime {
26124
26207
  console.error('Failed to reconnect:', error);
26125
26208
  }
26126
26209
  }));
26127
- this.socket.addEventListener('error', (event) => {
26210
+ socket.addEventListener('error', (event) => {
26211
+ if (connectionId !== this.connectionId || socket !== this.socket) {
26212
+ return;
26213
+ }
26128
26214
  this.stopHeartbeat();
26129
26215
  const error = new Error('WebSocket error');
26130
26216
  console.error('WebSocket error:', error.message);
@@ -26195,7 +26281,7 @@ class Realtime {
26195
26281
  }
26196
26282
  return String(channel);
26197
26283
  }
26198
- subscribe(channelsOrChannel, callback) {
26284
+ subscribe(channelsOrChannel, callback, queries = []) {
26199
26285
  return __awaiter(this, void 0, void 0, function* () {
26200
26286
  const channelArray = Array.isArray(channelsOrChannel)
26201
26287
  ? channelsOrChannel
@@ -26203,13 +26289,29 @@ class Realtime {
26203
26289
  // Convert all channels to strings
26204
26290
  const channelStrings = channelArray.map(ch => this.channelToString(ch));
26205
26291
  const channels = new Set(channelStrings);
26206
- this.subscriptionsCounter++;
26207
- const count = this.subscriptionsCounter;
26208
- for (const channel of channels) {
26209
- this.activeChannels.add(channel);
26292
+ // Convert queries to array of strings
26293
+ // Ensure each query is a separate string in the array
26294
+ const queryStrings = [];
26295
+ for (const q of (queries !== null && queries !== void 0 ? queries : [])) {
26296
+ if (Array.isArray(q)) {
26297
+ // Handle nested arrays: [[q1, q2]] -> [q1, q2]
26298
+ for (const inner of q) {
26299
+ queryStrings.push(typeof inner === 'string' ? inner : inner.toString());
26300
+ }
26301
+ }
26302
+ else {
26303
+ queryStrings.push(typeof q === 'string' ? q : q.toString());
26304
+ }
26210
26305
  }
26211
- this.activeSubscriptions.set(count, {
26306
+ // Allocate a new slot index
26307
+ this.subscriptionsCounter++;
26308
+ const slot = this.subscriptionsCounter;
26309
+ // Store slot-centric data: channels, queries, and callback belong to the slot
26310
+ // queries is stored as string[] (array of query strings)
26311
+ // No channel mutation occurs here - channels are derived from slots in createSocket()
26312
+ this.activeSubscriptions.set(slot, {
26212
26313
  channels,
26314
+ queries: queryStrings,
26213
26315
  callback
26214
26316
  });
26215
26317
  this.subCallDepth++;
@@ -26220,23 +26322,19 @@ class Realtime {
26220
26322
  this.subCallDepth--;
26221
26323
  return {
26222
26324
  close: () => __awaiter(this, void 0, void 0, function* () {
26223
- this.activeSubscriptions.delete(count);
26224
- this.cleanUp(channels);
26325
+ const subscriptionId = this.slotToSubscriptionId.get(slot);
26326
+ this.activeSubscriptions.delete(slot);
26327
+ this.slotToSubscriptionId.delete(slot);
26328
+ if (subscriptionId) {
26329
+ this.subscriptionIdToSlot.delete(subscriptionId);
26330
+ }
26225
26331
  yield this.createSocket();
26226
26332
  })
26227
26333
  };
26228
26334
  });
26229
26335
  }
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
- }
26336
+ // cleanUp is no longer needed - slots are removed directly in subscribe().close()
26337
+ // Channels are automatically rebuilt from remaining slots in createSocket()
26240
26338
  handleMessage(message) {
26241
26339
  if (!message.type) {
26242
26340
  return;
@@ -26262,6 +26360,19 @@ class Realtime {
26262
26360
  return;
26263
26361
  }
26264
26362
  const messageData = message.data;
26363
+ // Store subscription ID mappings from backend
26364
+ // Format: { "0": "sub_a1f9", "1": "sub_b83c", ... }
26365
+ if (messageData.subscriptions) {
26366
+ this.slotToSubscriptionId.clear();
26367
+ this.subscriptionIdToSlot.clear();
26368
+ for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
26369
+ const slot = Number(slotStr);
26370
+ if (!isNaN(slot)) {
26371
+ this.slotToSubscriptionId.set(slot, subscriptionId);
26372
+ this.subscriptionIdToSlot.set(subscriptionId, slot);
26373
+ }
26374
+ }
26375
+ }
26265
26376
  let session = this.client.config.session;
26266
26377
  if (!session) {
26267
26378
  try {
@@ -26296,23 +26407,26 @@ class Realtime {
26296
26407
  const events = data.events;
26297
26408
  const payload = data.payload;
26298
26409
  const timestamp = data.timestamp;
26299
- if (!channels || !events || !payload) {
26300
- return;
26301
- }
26302
- const hasActiveChannel = channels.some(channel => this.activeChannels.has(channel));
26303
- if (!hasActiveChannel) {
26410
+ const subscriptions = data.subscriptions;
26411
+ if (!channels || !events || !payload || !subscriptions || subscriptions.length === 0) {
26304
26412
  return;
26305
26413
  }
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);
26414
+ // Iterate over all matching subscriptionIds and call callback for each
26415
+ for (const subscriptionId of subscriptions) {
26416
+ // O(1) lookup using subscriptionId
26417
+ const slot = this.subscriptionIdToSlot.get(subscriptionId);
26418
+ if (slot !== undefined) {
26419
+ const subscription = this.activeSubscriptions.get(slot);
26420
+ if (subscription) {
26421
+ const response = {
26422
+ events,
26423
+ channels,
26424
+ timestamp,
26425
+ payload,
26426
+ subscriptions
26427
+ };
26428
+ subscription.callback(response);
26429
+ }
26316
26430
  }
26317
26431
  }
26318
26432
  }
@@ -26514,8 +26628,11 @@ class Channel {
26514
26628
  constructor(segments) {
26515
26629
  this.segments = segments;
26516
26630
  }
26517
- next(segment, id = "*") {
26518
- return new Channel([...this.segments, segment, normalize(id)]);
26631
+ next(segment, id) {
26632
+ const segments = id === undefined
26633
+ ? [...this.segments, segment]
26634
+ : [...this.segments, segment, normalize(id)];
26635
+ return new Channel(segments);
26519
26636
  }
26520
26637
  resolve(action) {
26521
26638
  return new Channel([...this.segments, action]);
@@ -26525,28 +26642,29 @@ class Channel {
26525
26642
  }
26526
26643
  // --- DATABASE ROUTE ---
26527
26644
  // Only available on Channel<Database>
26528
- collection(id = "*") {
26529
- return this.next("collections", id);
26645
+ collection(id) {
26646
+ // Default: wildcard collection ID
26647
+ return this.next("collections", id !== null && id !== void 0 ? id : "*");
26530
26648
  }
26531
26649
  // Only available on Channel<Collection>
26532
- document(id = "*") {
26650
+ document(id) {
26651
+ // Default: no document ID segment
26533
26652
  return this.next("documents", id);
26534
26653
  }
26535
26654
  // --- TABLESDB ROUTE ---
26536
- table(id = "*") {
26537
- return this.next("tables", id);
26655
+ table(id) {
26656
+ // Default: wildcard table ID
26657
+ return this.next("tables", id !== null && id !== void 0 ? id : "*");
26538
26658
  }
26539
- row(id = "*") {
26659
+ row(id) {
26660
+ // Default: no row ID segment
26540
26661
  return this.next("rows", id);
26541
26662
  }
26542
26663
  // --- BUCKET ROUTE ---
26543
- file(id = "*") {
26664
+ file(id) {
26665
+ // Default: no file ID segment
26544
26666
  return this.next("files", id);
26545
26667
  }
26546
- // --- FUNCTION ROUTE ---
26547
- execution(id = "*") {
26548
- return this.next("executions", id);
26549
- }
26550
26668
  // --- TERMINAL ACTIONS ---
26551
26669
  // Restricted to the Actionable union
26552
26670
  create() {
@@ -26562,6 +26680,9 @@ class Channel {
26562
26680
  static database(id = "*") {
26563
26681
  return new Channel(["databases", normalize(id)]);
26564
26682
  }
26683
+ static execution(id = "*") {
26684
+ return new Channel(["executions", normalize(id)]);
26685
+ }
26565
26686
  static tablesdb(id = "*") {
26566
26687
  return new Channel(["tablesdb", normalize(id)]);
26567
26688
  }
@@ -26577,9 +26698,8 @@ class Channel {
26577
26698
  static membership(id = "*") {
26578
26699
  return new Channel(["memberships", normalize(id)]);
26579
26700
  }
26580
- static account(userId = "") {
26581
- const id = normalize(userId);
26582
- return id === "*" ? "account" : `account.${id}`;
26701
+ static account() {
26702
+ return "account";
26583
26703
  }
26584
26704
  // Global events
26585
26705
  static documents() {
@@ -26597,6 +26717,9 @@ class Channel {
26597
26717
  static teams() {
26598
26718
  return "teams";
26599
26719
  }
26720
+ static memberships() {
26721
+ return "memberships";
26722
+ }
26600
26723
  }
26601
26724
 
26602
26725
  exports.Condition = void 0;
@@ -26929,6 +27052,7 @@ exports.Scopes = void 0;
26929
27052
  Scopes["RestorationsWrite"] = "restorations.write";
26930
27053
  Scopes["DomainsRead"] = "domains.read";
26931
27054
  Scopes["DomainsWrite"] = "domains.write";
27055
+ Scopes["EventsRead"] = "events.read";
26932
27056
  })(exports.Scopes || (exports.Scopes = {}));
26933
27057
 
26934
27058
  exports.AuthenticatorType = void 0;
@@ -27691,12 +27815,12 @@ exports.ImageFormat = void 0;
27691
27815
  ImageFormat["Gif"] = "gif";
27692
27816
  })(exports.ImageFormat || (exports.ImageFormat = {}));
27693
27817
 
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 = {}));
27818
+ exports.BackupServices = void 0;
27819
+ (function (BackupServices) {
27820
+ BackupServices["Databases"] = "databases";
27821
+ BackupServices["Functions"] = "functions";
27822
+ BackupServices["Storage"] = "storage";
27823
+ })(exports.BackupServices || (exports.BackupServices = {}));
27700
27824
 
27701
27825
  exports.Platform = void 0;
27702
27826
  (function (Platform) {
@@ -27745,6 +27869,14 @@ exports.OrderBy = void 0;
27745
27869
  OrderBy["Desc"] = "desc";
27746
27870
  })(exports.OrderBy || (exports.OrderBy = {}));
27747
27871
 
27872
+ exports.RegistrationType = void 0;
27873
+ (function (RegistrationType) {
27874
+ RegistrationType["New"] = "new";
27875
+ RegistrationType["Transfer"] = "transfer";
27876
+ RegistrationType["Renewal"] = "renewal";
27877
+ RegistrationType["Trade"] = "trade";
27878
+ })(exports.RegistrationType || (exports.RegistrationType = {}));
27879
+
27748
27880
  exports.FilterType = void 0;
27749
27881
  (function (FilterType) {
27750
27882
  FilterType["Premium"] = "premium";
@@ -27775,6 +27907,9 @@ exports.Runtime = void 0;
27775
27907
  Runtime["Python312"] = "python-3.12";
27776
27908
  Runtime["Pythonml311"] = "python-ml-3.11";
27777
27909
  Runtime["Pythonml312"] = "python-ml-3.12";
27910
+ Runtime["Deno121"] = "deno-1.21";
27911
+ Runtime["Deno124"] = "deno-1.24";
27912
+ Runtime["Deno135"] = "deno-1.35";
27778
27913
  Runtime["Deno140"] = "deno-1.40";
27779
27914
  Runtime["Deno146"] = "deno-1.46";
27780
27915
  Runtime["Deno20"] = "deno-2.0";
@@ -27789,6 +27924,7 @@ exports.Runtime = void 0;
27789
27924
  Runtime["Dart35"] = "dart-3.5";
27790
27925
  Runtime["Dart38"] = "dart-3.8";
27791
27926
  Runtime["Dart39"] = "dart-3.9";
27927
+ Runtime["Dart310"] = "dart-3.10";
27792
27928
  Runtime["Dotnet60"] = "dotnet-6.0";
27793
27929
  Runtime["Dotnet70"] = "dotnet-7.0";
27794
27930
  Runtime["Dotnet80"] = "dotnet-8.0";
@@ -27817,6 +27953,7 @@ exports.Runtime = void 0;
27817
27953
  Runtime["Flutter329"] = "flutter-3.29";
27818
27954
  Runtime["Flutter332"] = "flutter-3.32";
27819
27955
  Runtime["Flutter335"] = "flutter-3.35";
27956
+ Runtime["Flutter338"] = "flutter-3.38";
27820
27957
  })(exports.Runtime || (exports.Runtime = {}));
27821
27958
 
27822
27959
  exports.Runtimes = void 0;
@@ -27843,6 +27980,9 @@ exports.Runtimes = void 0;
27843
27980
  Runtimes["Python312"] = "python-3.12";
27844
27981
  Runtimes["Pythonml311"] = "python-ml-3.11";
27845
27982
  Runtimes["Pythonml312"] = "python-ml-3.12";
27983
+ Runtimes["Deno121"] = "deno-1.21";
27984
+ Runtimes["Deno124"] = "deno-1.24";
27985
+ Runtimes["Deno135"] = "deno-1.35";
27846
27986
  Runtimes["Deno140"] = "deno-1.40";
27847
27987
  Runtimes["Deno146"] = "deno-1.46";
27848
27988
  Runtimes["Deno20"] = "deno-2.0";
@@ -27857,6 +27997,7 @@ exports.Runtimes = void 0;
27857
27997
  Runtimes["Dart35"] = "dart-3.5";
27858
27998
  Runtimes["Dart38"] = "dart-3.8";
27859
27999
  Runtimes["Dart39"] = "dart-3.9";
28000
+ Runtimes["Dart310"] = "dart-3.10";
27860
28001
  Runtimes["Dotnet60"] = "dotnet-6.0";
27861
28002
  Runtimes["Dotnet70"] = "dotnet-7.0";
27862
28003
  Runtimes["Dotnet80"] = "dotnet-8.0";
@@ -27885,6 +28026,7 @@ exports.Runtimes = void 0;
27885
28026
  Runtimes["Flutter329"] = "flutter-3.29";
27886
28027
  Runtimes["Flutter332"] = "flutter-3.32";
27887
28028
  Runtimes["Flutter335"] = "flutter-3.35";
28029
+ Runtimes["Flutter338"] = "flutter-3.38";
27888
28030
  })(exports.Runtimes || (exports.Runtimes = {}));
27889
28031
 
27890
28032
  exports.UseCases = void 0;
@@ -28052,12 +28194,6 @@ exports.SMTPSecure = void 0;
28052
28194
  SMTPSecure["Ssl"] = "ssl";
28053
28195
  })(exports.SMTPSecure || (exports.SMTPSecure = {}));
28054
28196
 
28055
- exports.Status = void 0;
28056
- (function (Status) {
28057
- Status["Active"] = "active";
28058
- Status["Archived"] = "archived";
28059
- })(exports.Status || (exports.Status = {}));
28060
-
28061
28197
  exports.EmailTemplateType = void 0;
28062
28198
  (function (EmailTemplateType) {
28063
28199
  EmailTemplateType["Verification"] = "verification";
@@ -28404,6 +28540,9 @@ exports.BuildRuntime = void 0;
28404
28540
  BuildRuntime["Python312"] = "python-3.12";
28405
28541
  BuildRuntime["Pythonml311"] = "python-ml-3.11";
28406
28542
  BuildRuntime["Pythonml312"] = "python-ml-3.12";
28543
+ BuildRuntime["Deno121"] = "deno-1.21";
28544
+ BuildRuntime["Deno124"] = "deno-1.24";
28545
+ BuildRuntime["Deno135"] = "deno-1.35";
28407
28546
  BuildRuntime["Deno140"] = "deno-1.40";
28408
28547
  BuildRuntime["Deno146"] = "deno-1.46";
28409
28548
  BuildRuntime["Deno20"] = "deno-2.0";
@@ -28418,6 +28557,7 @@ exports.BuildRuntime = void 0;
28418
28557
  BuildRuntime["Dart35"] = "dart-3.5";
28419
28558
  BuildRuntime["Dart38"] = "dart-3.8";
28420
28559
  BuildRuntime["Dart39"] = "dart-3.9";
28560
+ BuildRuntime["Dart310"] = "dart-3.10";
28421
28561
  BuildRuntime["Dotnet60"] = "dotnet-6.0";
28422
28562
  BuildRuntime["Dotnet70"] = "dotnet-7.0";
28423
28563
  BuildRuntime["Dotnet80"] = "dotnet-8.0";
@@ -28446,6 +28586,7 @@ exports.BuildRuntime = void 0;
28446
28586
  BuildRuntime["Flutter329"] = "flutter-3.29";
28447
28587
  BuildRuntime["Flutter332"] = "flutter-3.32";
28448
28588
  BuildRuntime["Flutter335"] = "flutter-3.35";
28589
+ BuildRuntime["Flutter338"] = "flutter-3.38";
28449
28590
  })(exports.BuildRuntime || (exports.BuildRuntime = {}));
28450
28591
 
28451
28592
  exports.Adapter = void 0;
@@ -28493,15 +28634,6 @@ exports.ImageGravity = void 0;
28493
28634
  ImageGravity["Bottomright"] = "bottom-right";
28494
28635
  })(exports.ImageGravity || (exports.ImageGravity = {}));
28495
28636
 
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
28637
  exports.PasswordHash = void 0;
28506
28638
  (function (PasswordHash) {
28507
28639
  PasswordHash["Sha1"] = "sha1";