@appwrite.io/console 0.6.4 → 0.7.0-rc.2

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 (408) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/sdk.js +2513 -2350
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +2513 -2350
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +2513 -2350
  7. package/docs/examples/account/create-anonymous-session.md +1 -1
  8. package/docs/examples/account/create-email-password-session.md +1 -1
  9. package/docs/examples/account/create-email-token.md +1 -1
  10. package/docs/examples/account/create-j-w-t.md +1 -1
  11. package/docs/examples/account/create-magic-u-r-l-token.md +1 -1
  12. package/docs/examples/account/create-mfa-authenticator.md +1 -1
  13. package/docs/examples/account/create-mfa-challenge.md +1 -1
  14. package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
  15. package/docs/examples/account/create-phone-token.md +1 -1
  16. package/docs/examples/account/create-phone-verification.md +1 -1
  17. package/docs/examples/account/create-push-target.md +1 -1
  18. package/docs/examples/account/create-recovery.md +1 -1
  19. package/docs/examples/account/create-session.md +1 -1
  20. package/docs/examples/account/create-verification.md +1 -1
  21. package/docs/examples/account/create.md +1 -1
  22. package/docs/examples/account/delete-identity.md +1 -1
  23. package/docs/examples/account/delete-mfa-authenticator.md +2 -3
  24. package/docs/examples/account/delete-push-target.md +1 -1
  25. package/docs/examples/account/delete-session.md +1 -1
  26. package/docs/examples/account/delete-sessions.md +1 -1
  27. package/docs/examples/account/delete.md +1 -1
  28. package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
  29. package/docs/examples/account/get-prefs.md +1 -1
  30. package/docs/examples/account/get-session.md +1 -1
  31. package/docs/examples/account/get.md +1 -1
  32. package/docs/examples/account/list-identities.md +1 -1
  33. package/docs/examples/account/list-logs.md +1 -1
  34. package/docs/examples/account/list-mfa-factors.md +1 -1
  35. package/docs/examples/account/list-sessions.md +1 -1
  36. package/docs/examples/account/update-email.md +1 -1
  37. package/docs/examples/account/update-m-f-a.md +1 -1
  38. package/docs/examples/account/update-magic-u-r-l-session.md +1 -1
  39. package/docs/examples/account/update-mfa-authenticator.md +1 -1
  40. package/docs/examples/account/update-mfa-challenge.md +1 -1
  41. package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
  42. package/docs/examples/account/update-name.md +1 -1
  43. package/docs/examples/account/update-password.md +1 -1
  44. package/docs/examples/account/update-phone-session.md +1 -1
  45. package/docs/examples/account/update-phone-verification.md +1 -1
  46. package/docs/examples/account/update-phone.md +1 -1
  47. package/docs/examples/account/update-prefs.md +1 -1
  48. package/docs/examples/account/update-push-target.md +1 -1
  49. package/docs/examples/account/update-recovery.md +1 -1
  50. package/docs/examples/account/update-session.md +1 -1
  51. package/docs/examples/account/update-status.md +1 -1
  52. package/docs/examples/account/update-verification.md +1 -1
  53. package/docs/examples/assistant/chat.md +1 -1
  54. package/docs/examples/console/variables.md +1 -1
  55. package/docs/examples/databases/create-boolean-attribute.md +1 -1
  56. package/docs/examples/databases/create-collection.md +1 -1
  57. package/docs/examples/databases/create-datetime-attribute.md +1 -1
  58. package/docs/examples/databases/create-document.md +1 -1
  59. package/docs/examples/databases/create-email-attribute.md +1 -1
  60. package/docs/examples/databases/create-enum-attribute.md +1 -1
  61. package/docs/examples/databases/create-float-attribute.md +1 -1
  62. package/docs/examples/databases/create-index.md +1 -1
  63. package/docs/examples/databases/create-integer-attribute.md +1 -1
  64. package/docs/examples/databases/create-ip-attribute.md +1 -1
  65. package/docs/examples/databases/create-relationship-attribute.md +1 -1
  66. package/docs/examples/databases/create-string-attribute.md +1 -1
  67. package/docs/examples/databases/create-url-attribute.md +1 -1
  68. package/docs/examples/databases/create.md +1 -1
  69. package/docs/examples/databases/delete-attribute.md +1 -1
  70. package/docs/examples/databases/delete-collection.md +1 -1
  71. package/docs/examples/databases/delete-document.md +1 -1
  72. package/docs/examples/databases/delete-index.md +1 -1
  73. package/docs/examples/databases/delete.md +1 -1
  74. package/docs/examples/databases/get-attribute.md +1 -1
  75. package/docs/examples/databases/get-collection-usage.md +1 -1
  76. package/docs/examples/databases/get-collection.md +1 -1
  77. package/docs/examples/databases/get-database-usage.md +1 -1
  78. package/docs/examples/databases/get-document.md +1 -1
  79. package/docs/examples/databases/get-index.md +1 -1
  80. package/docs/examples/databases/get-usage.md +1 -1
  81. package/docs/examples/databases/get.md +1 -1
  82. package/docs/examples/databases/list-attributes.md +1 -1
  83. package/docs/examples/databases/list-collection-logs.md +1 -1
  84. package/docs/examples/databases/list-collections.md +1 -1
  85. package/docs/examples/databases/list-document-logs.md +1 -1
  86. package/docs/examples/databases/list-documents.md +1 -1
  87. package/docs/examples/databases/list-indexes.md +1 -1
  88. package/docs/examples/databases/list-logs.md +1 -1
  89. package/docs/examples/databases/list.md +1 -1
  90. package/docs/examples/databases/update-boolean-attribute.md +1 -1
  91. package/docs/examples/databases/update-collection.md +1 -1
  92. package/docs/examples/databases/update-datetime-attribute.md +1 -1
  93. package/docs/examples/databases/update-document.md +1 -1
  94. package/docs/examples/databases/update-email-attribute.md +1 -1
  95. package/docs/examples/databases/update-enum-attribute.md +1 -1
  96. package/docs/examples/databases/update-float-attribute.md +1 -1
  97. package/docs/examples/databases/update-integer-attribute.md +1 -1
  98. package/docs/examples/databases/update-ip-attribute.md +1 -1
  99. package/docs/examples/databases/update-relationship-attribute.md +1 -1
  100. package/docs/examples/databases/update-string-attribute.md +1 -1
  101. package/docs/examples/databases/update-url-attribute.md +1 -1
  102. package/docs/examples/databases/update.md +1 -1
  103. package/docs/examples/functions/create-build.md +2 -2
  104. package/docs/examples/functions/create-deployment.md +1 -1
  105. package/docs/examples/functions/create-execution.md +3 -2
  106. package/docs/examples/functions/create-variable.md +1 -1
  107. package/docs/examples/functions/create.md +3 -3
  108. package/docs/examples/functions/delete-deployment.md +1 -1
  109. package/docs/examples/functions/delete-execution.md +14 -0
  110. package/docs/examples/functions/delete-variable.md +1 -1
  111. package/docs/examples/functions/delete.md +1 -1
  112. package/docs/examples/functions/{download-deployment.md → get-deployment-download.md} +1 -1
  113. package/docs/examples/functions/get-deployment.md +1 -1
  114. package/docs/examples/functions/get-execution.md +1 -1
  115. package/docs/examples/functions/get-function-usage.md +1 -1
  116. package/docs/examples/functions/{get-specifications.md → get-template.md} +4 -2
  117. package/docs/examples/functions/get-usage.md +1 -1
  118. package/docs/examples/functions/get-variable.md +1 -1
  119. package/docs/examples/functions/get.md +1 -1
  120. package/docs/examples/functions/list-deployments.md +1 -1
  121. package/docs/examples/functions/list-executions.md +1 -1
  122. package/docs/examples/functions/list-runtimes.md +1 -1
  123. package/docs/examples/functions/list-templates.md +16 -0
  124. package/docs/examples/functions/list-variables.md +1 -1
  125. package/docs/examples/functions/list.md +1 -1
  126. package/docs/examples/functions/update-deployment-build.md +14 -0
  127. package/docs/examples/functions/update-deployment.md +1 -1
  128. package/docs/examples/functions/update-variable.md +1 -1
  129. package/docs/examples/functions/update.md +3 -3
  130. package/docs/examples/graphql/mutation.md +1 -1
  131. package/docs/examples/graphql/query.md +1 -1
  132. package/docs/examples/health/get-antivirus.md +1 -1
  133. package/docs/examples/health/get-cache.md +1 -1
  134. package/docs/examples/health/get-certificate.md +1 -1
  135. package/docs/examples/health/get-d-b.md +1 -1
  136. package/docs/examples/health/get-failed-jobs.md +1 -1
  137. package/docs/examples/health/get-pub-sub.md +1 -1
  138. package/docs/examples/health/get-queue-builds.md +1 -1
  139. package/docs/examples/health/get-queue-certificates.md +1 -1
  140. package/docs/examples/health/get-queue-databases.md +1 -1
  141. package/docs/examples/health/get-queue-deletes.md +1 -1
  142. package/docs/examples/health/get-queue-functions.md +1 -1
  143. package/docs/examples/health/get-queue-logs.md +1 -1
  144. package/docs/examples/health/get-queue-mails.md +1 -1
  145. package/docs/examples/health/get-queue-messaging.md +1 -1
  146. package/docs/examples/health/get-queue-migrations.md +1 -1
  147. package/docs/examples/health/get-queue-usage-dump.md +1 -1
  148. package/docs/examples/health/get-queue-usage.md +1 -1
  149. package/docs/examples/health/get-queue-webhooks.md +1 -1
  150. package/docs/examples/health/get-queue.md +1 -1
  151. package/docs/examples/health/get-storage-local.md +1 -1
  152. package/docs/examples/health/get-storage.md +1 -1
  153. package/docs/examples/health/get-time.md +1 -1
  154. package/docs/examples/health/get.md +1 -1
  155. package/docs/examples/locale/get.md +1 -1
  156. package/docs/examples/locale/list-codes.md +1 -1
  157. package/docs/examples/locale/list-continents.md +1 -1
  158. package/docs/examples/locale/list-countries-e-u.md +1 -1
  159. package/docs/examples/locale/list-countries-phones.md +1 -1
  160. package/docs/examples/locale/list-countries.md +1 -1
  161. package/docs/examples/locale/list-currencies.md +1 -1
  162. package/docs/examples/locale/list-languages.md +1 -1
  163. package/docs/examples/messaging/create-apns-provider.md +1 -1
  164. package/docs/examples/messaging/create-email.md +1 -1
  165. package/docs/examples/messaging/create-fcm-provider.md +1 -1
  166. package/docs/examples/messaging/create-mailgun-provider.md +1 -1
  167. package/docs/examples/messaging/create-msg91provider.md +1 -1
  168. package/docs/examples/messaging/create-push.md +1 -1
  169. package/docs/examples/messaging/create-sendgrid-provider.md +1 -1
  170. package/docs/examples/messaging/create-sms.md +1 -1
  171. package/docs/examples/messaging/create-smtp-provider.md +1 -1
  172. package/docs/examples/messaging/create-subscriber.md +1 -1
  173. package/docs/examples/messaging/create-telesign-provider.md +1 -1
  174. package/docs/examples/messaging/create-textmagic-provider.md +1 -1
  175. package/docs/examples/messaging/create-topic.md +1 -1
  176. package/docs/examples/messaging/create-twilio-provider.md +1 -1
  177. package/docs/examples/messaging/create-vonage-provider.md +1 -1
  178. package/docs/examples/messaging/delete-provider.md +1 -1
  179. package/docs/examples/messaging/delete-subscriber.md +1 -1
  180. package/docs/examples/messaging/delete-topic.md +1 -1
  181. package/docs/examples/messaging/delete.md +1 -1
  182. package/docs/examples/messaging/get-message.md +1 -1
  183. package/docs/examples/messaging/get-provider.md +1 -1
  184. package/docs/examples/messaging/get-subscriber.md +1 -1
  185. package/docs/examples/messaging/get-topic.md +1 -1
  186. package/docs/examples/messaging/list-message-logs.md +1 -1
  187. package/docs/examples/messaging/list-messages.md +1 -1
  188. package/docs/examples/messaging/list-provider-logs.md +1 -1
  189. package/docs/examples/messaging/list-providers.md +1 -1
  190. package/docs/examples/messaging/list-subscriber-logs.md +1 -1
  191. package/docs/examples/messaging/list-subscribers.md +1 -1
  192. package/docs/examples/messaging/list-targets.md +1 -1
  193. package/docs/examples/messaging/list-topic-logs.md +1 -1
  194. package/docs/examples/messaging/list-topics.md +1 -1
  195. package/docs/examples/messaging/update-apns-provider.md +1 -1
  196. package/docs/examples/messaging/update-email.md +1 -1
  197. package/docs/examples/messaging/update-fcm-provider.md +1 -1
  198. package/docs/examples/messaging/update-mailgun-provider.md +1 -1
  199. package/docs/examples/messaging/update-msg91provider.md +1 -1
  200. package/docs/examples/messaging/update-push.md +1 -1
  201. package/docs/examples/messaging/update-sendgrid-provider.md +1 -1
  202. package/docs/examples/messaging/update-sms.md +1 -1
  203. package/docs/examples/messaging/update-smtp-provider.md +1 -1
  204. package/docs/examples/messaging/update-telesign-provider.md +1 -1
  205. package/docs/examples/messaging/update-textmagic-provider.md +1 -1
  206. package/docs/examples/messaging/update-topic.md +1 -1
  207. package/docs/examples/messaging/update-twilio-provider.md +1 -1
  208. package/docs/examples/messaging/update-vonage-provider.md +1 -1
  209. package/docs/examples/migrations/create-appwrite-migration.md +1 -1
  210. package/docs/examples/migrations/create-firebase-migration.md +1 -1
  211. package/docs/examples/migrations/create-firebase-o-auth-migration.md +1 -1
  212. package/docs/examples/migrations/create-n-host-migration.md +1 -1
  213. package/docs/examples/migrations/create-supabase-migration.md +1 -1
  214. package/docs/examples/migrations/delete-firebase-auth.md +1 -1
  215. package/docs/examples/migrations/delete.md +1 -1
  216. package/docs/examples/migrations/get-appwrite-report.md +1 -1
  217. package/docs/examples/migrations/get-firebase-report-o-auth.md +1 -1
  218. package/docs/examples/migrations/get-firebase-report.md +1 -1
  219. package/docs/examples/migrations/get-n-host-report.md +1 -1
  220. package/docs/examples/migrations/get-supabase-report.md +1 -1
  221. package/docs/examples/migrations/get.md +1 -1
  222. package/docs/examples/migrations/list-firebase-projects.md +1 -1
  223. package/docs/examples/migrations/list.md +1 -1
  224. package/docs/examples/migrations/retry.md +1 -1
  225. package/docs/examples/project/create-variable.md +1 -1
  226. package/docs/examples/project/delete-variable.md +1 -1
  227. package/docs/examples/project/get-usage.md +1 -1
  228. package/docs/examples/project/get-variable.md +1 -1
  229. package/docs/examples/project/list-variables.md +1 -1
  230. package/docs/examples/project/update-variable.md +1 -1
  231. package/docs/examples/projects/create-j-w-t.md +15 -0
  232. package/docs/examples/projects/create-key.md +1 -1
  233. package/docs/examples/projects/create-platform.md +1 -1
  234. package/docs/examples/projects/create-smtp-test.md +1 -1
  235. package/docs/examples/projects/create-webhook.md +1 -1
  236. package/docs/examples/projects/create.md +1 -1
  237. package/docs/examples/projects/delete-email-template.md +1 -1
  238. package/docs/examples/projects/delete-key.md +1 -1
  239. package/docs/examples/projects/delete-platform.md +1 -1
  240. package/docs/examples/projects/delete-sms-template.md +1 -1
  241. package/docs/examples/projects/delete-webhook.md +1 -1
  242. package/docs/examples/projects/delete.md +1 -1
  243. package/docs/examples/projects/get-email-template.md +1 -1
  244. package/docs/examples/projects/get-key.md +1 -1
  245. package/docs/examples/projects/get-platform.md +1 -1
  246. package/docs/examples/projects/get-sms-template.md +1 -1
  247. package/docs/examples/projects/get-webhook.md +1 -1
  248. package/docs/examples/projects/get.md +1 -1
  249. package/docs/examples/projects/list-keys.md +1 -1
  250. package/docs/examples/projects/list-platforms.md +1 -1
  251. package/docs/examples/projects/list-webhooks.md +1 -1
  252. package/docs/examples/projects/list.md +1 -1
  253. package/docs/examples/projects/update-api-status-all.md +1 -1
  254. package/docs/examples/projects/update-api-status.md +1 -1
  255. package/docs/examples/projects/update-auth-duration.md +1 -1
  256. package/docs/examples/projects/update-auth-limit.md +1 -1
  257. package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
  258. package/docs/examples/projects/update-auth-password-history.md +1 -1
  259. package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
  260. package/docs/examples/projects/update-auth-status.md +1 -1
  261. package/docs/examples/projects/update-email-template.md +1 -1
  262. package/docs/examples/projects/update-key.md +1 -1
  263. package/docs/examples/projects/update-mock-numbers.md +14 -0
  264. package/docs/examples/projects/update-o-auth2.md +1 -1
  265. package/docs/examples/projects/update-personal-data-check.md +1 -1
  266. package/docs/examples/projects/update-platform.md +1 -1
  267. package/docs/examples/projects/update-service-status-all.md +1 -1
  268. package/docs/examples/projects/update-service-status.md +1 -1
  269. package/docs/examples/projects/update-session-alerts.md +14 -0
  270. package/docs/examples/projects/update-sms-template.md +1 -1
  271. package/docs/examples/projects/update-smtp.md +1 -1
  272. package/docs/examples/projects/update-team.md +1 -1
  273. package/docs/examples/projects/update-webhook-signature.md +1 -1
  274. package/docs/examples/projects/update-webhook.md +1 -1
  275. package/docs/examples/projects/update.md +1 -1
  276. package/docs/examples/proxy/create-rule.md +1 -1
  277. package/docs/examples/proxy/delete-rule.md +1 -1
  278. package/docs/examples/proxy/get-rule.md +1 -1
  279. package/docs/examples/proxy/list-rules.md +1 -1
  280. package/docs/examples/proxy/update-rule-verification.md +1 -1
  281. package/docs/examples/storage/create-bucket.md +1 -1
  282. package/docs/examples/storage/create-file.md +1 -1
  283. package/docs/examples/storage/delete-bucket.md +1 -1
  284. package/docs/examples/storage/delete-file.md +1 -1
  285. package/docs/examples/storage/get-bucket-usage.md +1 -1
  286. package/docs/examples/storage/get-bucket.md +1 -1
  287. package/docs/examples/storage/get-file.md +1 -1
  288. package/docs/examples/storage/get-usage.md +1 -1
  289. package/docs/examples/storage/list-buckets.md +1 -1
  290. package/docs/examples/storage/list-files.md +1 -1
  291. package/docs/examples/storage/update-bucket.md +1 -1
  292. package/docs/examples/storage/update-file.md +1 -1
  293. package/docs/examples/teams/create-membership.md +1 -1
  294. package/docs/examples/teams/create.md +1 -1
  295. package/docs/examples/teams/delete-membership.md +1 -1
  296. package/docs/examples/teams/delete.md +1 -1
  297. package/docs/examples/teams/get-membership.md +1 -1
  298. package/docs/examples/teams/get-prefs.md +1 -1
  299. package/docs/examples/teams/get.md +1 -1
  300. package/docs/examples/teams/list-logs.md +1 -1
  301. package/docs/examples/teams/list-memberships.md +1 -1
  302. package/docs/examples/teams/list.md +1 -1
  303. package/docs/examples/teams/update-membership-status.md +1 -1
  304. package/docs/examples/teams/update-membership.md +1 -1
  305. package/docs/examples/teams/update-name.md +1 -1
  306. package/docs/examples/teams/update-prefs.md +1 -1
  307. package/docs/examples/users/create-argon2user.md +1 -1
  308. package/docs/examples/users/create-bcrypt-user.md +1 -1
  309. package/docs/examples/users/create-j-w-t.md +15 -0
  310. package/docs/examples/users/create-m-d5user.md +1 -1
  311. package/docs/examples/users/create-mfa-recovery-codes.md +1 -1
  312. package/docs/examples/users/create-p-h-pass-user.md +1 -1
  313. package/docs/examples/users/create-s-h-a-user.md +1 -1
  314. package/docs/examples/users/create-scrypt-modified-user.md +1 -1
  315. package/docs/examples/users/create-scrypt-user.md +1 -1
  316. package/docs/examples/users/create-session.md +1 -1
  317. package/docs/examples/users/create-target.md +1 -1
  318. package/docs/examples/users/create-token.md +1 -1
  319. package/docs/examples/users/create.md +1 -1
  320. package/docs/examples/users/delete-identity.md +1 -1
  321. package/docs/examples/users/delete-mfa-authenticator.md +1 -1
  322. package/docs/examples/users/delete-session.md +1 -1
  323. package/docs/examples/users/delete-sessions.md +1 -1
  324. package/docs/examples/users/delete-target.md +1 -1
  325. package/docs/examples/users/delete.md +1 -1
  326. package/docs/examples/users/get-mfa-recovery-codes.md +1 -1
  327. package/docs/examples/users/get-prefs.md +1 -1
  328. package/docs/examples/users/get-target.md +1 -1
  329. package/docs/examples/users/get-usage.md +1 -1
  330. package/docs/examples/users/get.md +1 -1
  331. package/docs/examples/users/list-identities.md +1 -1
  332. package/docs/examples/users/list-logs.md +1 -1
  333. package/docs/examples/users/list-memberships.md +1 -1
  334. package/docs/examples/users/list-mfa-factors.md +1 -1
  335. package/docs/examples/users/list-sessions.md +1 -1
  336. package/docs/examples/users/list-targets.md +1 -1
  337. package/docs/examples/users/list.md +1 -1
  338. package/docs/examples/users/update-email-verification.md +1 -1
  339. package/docs/examples/users/update-email.md +1 -1
  340. package/docs/examples/users/update-labels.md +1 -1
  341. package/docs/examples/users/update-mfa-recovery-codes.md +1 -1
  342. package/docs/examples/users/update-mfa.md +1 -1
  343. package/docs/examples/users/update-name.md +1 -1
  344. package/docs/examples/users/update-password.md +1 -1
  345. package/docs/examples/users/update-phone-verification.md +1 -1
  346. package/docs/examples/users/update-phone.md +1 -1
  347. package/docs/examples/users/update-prefs.md +1 -1
  348. package/docs/examples/users/update-status.md +1 -1
  349. package/docs/examples/users/update-target.md +1 -1
  350. package/docs/examples/vcs/create-repository-detection.md +1 -1
  351. package/docs/examples/vcs/create-repository.md +1 -1
  352. package/docs/examples/vcs/delete-installation.md +1 -1
  353. package/docs/examples/vcs/get-installation.md +1 -1
  354. package/docs/examples/vcs/get-repository-contents.md +15 -0
  355. package/docs/examples/vcs/get-repository.md +1 -1
  356. package/docs/examples/vcs/list-installations.md +1 -1
  357. package/docs/examples/vcs/list-repositories.md +1 -1
  358. package/docs/examples/vcs/list-repository-branches.md +1 -1
  359. package/docs/examples/vcs/update-external-deployments.md +1 -1
  360. package/package.json +1 -1
  361. package/src/client.ts +124 -66
  362. package/src/enums/email-template-type.ts +2 -0
  363. package/src/enums/platform-type.ts +2 -0
  364. package/src/enums/runtime.ts +1 -0
  365. package/src/index.ts +1 -1
  366. package/src/models.ts +230 -28
  367. package/src/services/account.ts +651 -644
  368. package/src/services/assistant.ts +19 -16
  369. package/src/services/avatars.ts +111 -152
  370. package/src/services/console.ts +19 -14
  371. package/src/services/databases.ts +628 -638
  372. package/src/services/functions.ts +435 -339
  373. package/src/services/graphql.ts +31 -24
  374. package/src/services/health.ts +299 -199
  375. package/src/services/locale.ts +113 -77
  376. package/src/services/messaging.ts +568 -583
  377. package/src/services/migrations.ts +199 -197
  378. package/src/services/project.ts +82 -65
  379. package/src/services/projects.ts +615 -459
  380. package/src/services/proxy.ts +68 -50
  381. package/src/services/storage.ts +198 -253
  382. package/src/services/teams.ts +198 -188
  383. package/src/services/users.ts +568 -478
  384. package/src/services/vcs.ts +149 -83
  385. package/types/client.d.ts +13 -17
  386. package/types/enums/email-template-type.d.ts +3 -1
  387. package/types/enums/platform-type.d.ts +3 -1
  388. package/types/enums/runtime.d.ts +2 -1
  389. package/types/index.d.ts +1 -1
  390. package/types/models.d.ts +230 -28
  391. package/types/services/account.d.ts +162 -317
  392. package/types/services/assistant.d.ts +4 -4
  393. package/types/services/avatars.d.ts +50 -84
  394. package/types/services/console.d.ts +4 -4
  395. package/types/services/databases.d.ts +143 -173
  396. package/types/services/functions.d.ts +112 -97
  397. package/types/services/graphql.d.ts +6 -6
  398. package/types/services/health.d.ts +64 -85
  399. package/types/services/locale.d.ts +28 -39
  400. package/types/services/messaging.d.ts +103 -104
  401. package/types/services/migrations.d.ts +34 -34
  402. package/types/services/project.d.ts +17 -20
  403. package/types/services/projects.d.ts +118 -87
  404. package/types/services/proxy.d.ts +13 -14
  405. package/types/services/storage.d.ts +53 -78
  406. package/types/services/teams.d.ts +53 -83
  407. package/types/services/users.d.ts +120 -157
  408. package/types/services/vcs.d.ts +31 -20
@@ -1,14 +1,12 @@
1
- import { Service } from '../service';
2
- import { AppwriteException, Client } from '../client';
1
+ import { AppwriteException, Client, type Payload, UploadProgress } from '../client';
3
2
  import type { Models } from '../models';
4
- import type { UploadProgress, Payload } from '../client';
5
3
 
6
- export class Migrations extends Service {
4
+ export class Migrations {
5
+ client: Client;
7
6
 
8
- constructor(client: Client)
9
- {
10
- super(client);
11
- }
7
+ constructor(client: Client) {
8
+ this.client = client;
9
+ }
12
10
 
13
11
  /**
14
12
  * List Migrations
@@ -17,26 +15,30 @@ export class Migrations extends Service {
17
15
  * @param {string[]} queries
18
16
  * @param {string} search
19
17
  * @throws {AppwriteException}
20
- * @returns {Promise}
21
- */
18
+ * @returns {Promise<Models.MigrationList>}
19
+ */
22
20
  async list(queries?: string[], search?: string): Promise<Models.MigrationList> {
23
21
  const apiPath = '/migrations';
24
22
  const payload: Payload = {};
25
-
26
23
  if (typeof queries !== 'undefined') {
27
24
  payload['queries'] = queries;
28
25
  }
29
-
30
26
  if (typeof search !== 'undefined') {
31
27
  payload['search'] = search;
32
28
  }
33
-
34
29
  const uri = new URL(this.client.config.endpoint + apiPath);
35
- return await this.client.call('get', uri, {
30
+
31
+ const apiHeaders: { [header: string]: string } = {
36
32
  'content-type': 'application/json',
37
- }, payload);
38
- }
33
+ }
39
34
 
35
+ return await this.client.call(
36
+ 'get',
37
+ uri,
38
+ apiHeaders,
39
+ payload
40
+ );
41
+ }
40
42
  /**
41
43
  * Migrate Appwrite Data
42
44
  *
@@ -46,50 +48,48 @@ export class Migrations extends Service {
46
48
  * @param {string} projectId
47
49
  * @param {string} apiKey
48
50
  * @throws {AppwriteException}
49
- * @returns {Promise}
50
- */
51
+ * @returns {Promise<Models.Migration>}
52
+ */
51
53
  async createAppwriteMigration(resources: string[], endpoint: string, projectId: string, apiKey: string): Promise<Models.Migration> {
52
54
  if (typeof resources === 'undefined') {
53
55
  throw new AppwriteException('Missing required parameter: "resources"');
54
56
  }
55
-
56
57
  if (typeof endpoint === 'undefined') {
57
58
  throw new AppwriteException('Missing required parameter: "endpoint"');
58
59
  }
59
-
60
60
  if (typeof projectId === 'undefined') {
61
61
  throw new AppwriteException('Missing required parameter: "projectId"');
62
62
  }
63
-
64
63
  if (typeof apiKey === 'undefined') {
65
64
  throw new AppwriteException('Missing required parameter: "apiKey"');
66
65
  }
67
-
68
66
  const apiPath = '/migrations/appwrite';
69
67
  const payload: Payload = {};
70
-
71
68
  if (typeof resources !== 'undefined') {
72
69
  payload['resources'] = resources;
73
70
  }
74
-
75
71
  if (typeof endpoint !== 'undefined') {
76
72
  payload['endpoint'] = endpoint;
77
73
  }
78
-
79
74
  if (typeof projectId !== 'undefined') {
80
75
  payload['projectId'] = projectId;
81
76
  }
82
-
83
77
  if (typeof apiKey !== 'undefined') {
84
78
  payload['apiKey'] = apiKey;
85
79
  }
86
-
87
80
  const uri = new URL(this.client.config.endpoint + apiPath);
88
- return await this.client.call('post', uri, {
81
+
82
+ const apiHeaders: { [header: string]: string } = {
89
83
  'content-type': 'application/json',
90
- }, payload);
91
- }
84
+ }
92
85
 
86
+ return await this.client.call(
87
+ 'post',
88
+ uri,
89
+ apiHeaders,
90
+ payload
91
+ );
92
+ }
93
93
  /**
94
94
  * Generate a report on Appwrite Data
95
95
  *
@@ -99,50 +99,48 @@ export class Migrations extends Service {
99
99
  * @param {string} projectID
100
100
  * @param {string} key
101
101
  * @throws {AppwriteException}
102
- * @returns {Promise}
103
- */
102
+ * @returns {Promise<Models.MigrationReport>}
103
+ */
104
104
  async getAppwriteReport(resources: string[], endpoint: string, projectID: string, key: string): Promise<Models.MigrationReport> {
105
105
  if (typeof resources === 'undefined') {
106
106
  throw new AppwriteException('Missing required parameter: "resources"');
107
107
  }
108
-
109
108
  if (typeof endpoint === 'undefined') {
110
109
  throw new AppwriteException('Missing required parameter: "endpoint"');
111
110
  }
112
-
113
111
  if (typeof projectID === 'undefined') {
114
112
  throw new AppwriteException('Missing required parameter: "projectID"');
115
113
  }
116
-
117
114
  if (typeof key === 'undefined') {
118
115
  throw new AppwriteException('Missing required parameter: "key"');
119
116
  }
120
-
121
117
  const apiPath = '/migrations/appwrite/report';
122
118
  const payload: Payload = {};
123
-
124
119
  if (typeof resources !== 'undefined') {
125
120
  payload['resources'] = resources;
126
121
  }
127
-
128
122
  if (typeof endpoint !== 'undefined') {
129
123
  payload['endpoint'] = endpoint;
130
124
  }
131
-
132
125
  if (typeof projectID !== 'undefined') {
133
126
  payload['projectID'] = projectID;
134
127
  }
135
-
136
128
  if (typeof key !== 'undefined') {
137
129
  payload['key'] = key;
138
130
  }
139
-
140
131
  const uri = new URL(this.client.config.endpoint + apiPath);
141
- return await this.client.call('get', uri, {
132
+
133
+ const apiHeaders: { [header: string]: string } = {
142
134
  'content-type': 'application/json',
143
- }, payload);
144
- }
135
+ }
145
136
 
137
+ return await this.client.call(
138
+ 'get',
139
+ uri,
140
+ apiHeaders,
141
+ payload
142
+ );
143
+ }
146
144
  /**
147
145
  * Migrate Firebase Data (Service Account)
148
146
  *
@@ -150,51 +148,59 @@ export class Migrations extends Service {
150
148
  * @param {string[]} resources
151
149
  * @param {string} serviceAccount
152
150
  * @throws {AppwriteException}
153
- * @returns {Promise}
154
- */
151
+ * @returns {Promise<Models.Migration>}
152
+ */
155
153
  async createFirebaseMigration(resources: string[], serviceAccount: string): Promise<Models.Migration> {
156
154
  if (typeof resources === 'undefined') {
157
155
  throw new AppwriteException('Missing required parameter: "resources"');
158
156
  }
159
-
160
157
  if (typeof serviceAccount === 'undefined') {
161
158
  throw new AppwriteException('Missing required parameter: "serviceAccount"');
162
159
  }
163
-
164
160
  const apiPath = '/migrations/firebase';
165
161
  const payload: Payload = {};
166
-
167
162
  if (typeof resources !== 'undefined') {
168
163
  payload['resources'] = resources;
169
164
  }
170
-
171
165
  if (typeof serviceAccount !== 'undefined') {
172
166
  payload['serviceAccount'] = serviceAccount;
173
167
  }
174
-
175
168
  const uri = new URL(this.client.config.endpoint + apiPath);
176
- return await this.client.call('post', uri, {
169
+
170
+ const apiHeaders: { [header: string]: string } = {
177
171
  'content-type': 'application/json',
178
- }, payload);
179
- }
172
+ }
180
173
 
174
+ return await this.client.call(
175
+ 'post',
176
+ uri,
177
+ apiHeaders,
178
+ payload
179
+ );
180
+ }
181
181
  /**
182
182
  * Revoke Appwrite&#039;s authorization to access Firebase Projects
183
183
  *
184
184
  *
185
185
  * @throws {AppwriteException}
186
- * @returns {Promise}
187
- */
186
+ * @returns {Promise<{}>}
187
+ */
188
188
  async deleteFirebaseAuth(): Promise<{}> {
189
189
  const apiPath = '/migrations/firebase/deauthorize';
190
190
  const payload: Payload = {};
191
-
192
191
  const uri = new URL(this.client.config.endpoint + apiPath);
193
- return await this.client.call('get', uri, {
192
+
193
+ const apiHeaders: { [header: string]: string } = {
194
194
  'content-type': 'application/json',
195
- }, payload);
196
- }
195
+ }
197
196
 
197
+ return await this.client.call(
198
+ 'get',
199
+ uri,
200
+ apiHeaders,
201
+ payload
202
+ );
203
+ }
198
204
  /**
199
205
  * Migrate Firebase Data (OAuth)
200
206
  *
@@ -202,51 +208,59 @@ export class Migrations extends Service {
202
208
  * @param {string[]} resources
203
209
  * @param {string} projectId
204
210
  * @throws {AppwriteException}
205
- * @returns {Promise}
206
- */
211
+ * @returns {Promise<Models.Migration>}
212
+ */
207
213
  async createFirebaseOAuthMigration(resources: string[], projectId: string): Promise<Models.Migration> {
208
214
  if (typeof resources === 'undefined') {
209
215
  throw new AppwriteException('Missing required parameter: "resources"');
210
216
  }
211
-
212
217
  if (typeof projectId === 'undefined') {
213
218
  throw new AppwriteException('Missing required parameter: "projectId"');
214
219
  }
215
-
216
220
  const apiPath = '/migrations/firebase/oauth';
217
221
  const payload: Payload = {};
218
-
219
222
  if (typeof resources !== 'undefined') {
220
223
  payload['resources'] = resources;
221
224
  }
222
-
223
225
  if (typeof projectId !== 'undefined') {
224
226
  payload['projectId'] = projectId;
225
227
  }
226
-
227
228
  const uri = new URL(this.client.config.endpoint + apiPath);
228
- return await this.client.call('post', uri, {
229
+
230
+ const apiHeaders: { [header: string]: string } = {
229
231
  'content-type': 'application/json',
230
- }, payload);
231
- }
232
+ }
232
233
 
234
+ return await this.client.call(
235
+ 'post',
236
+ uri,
237
+ apiHeaders,
238
+ payload
239
+ );
240
+ }
233
241
  /**
234
242
  * List Firebase Projects
235
243
  *
236
244
  *
237
245
  * @throws {AppwriteException}
238
- * @returns {Promise}
239
- */
246
+ * @returns {Promise<Models.FirebaseProjectList>}
247
+ */
240
248
  async listFirebaseProjects(): Promise<Models.FirebaseProjectList> {
241
249
  const apiPath = '/migrations/firebase/projects';
242
250
  const payload: Payload = {};
243
-
244
251
  const uri = new URL(this.client.config.endpoint + apiPath);
245
- return await this.client.call('get', uri, {
252
+
253
+ const apiHeaders: { [header: string]: string } = {
246
254
  'content-type': 'application/json',
247
- }, payload);
248
- }
255
+ }
249
256
 
257
+ return await this.client.call(
258
+ 'get',
259
+ uri,
260
+ apiHeaders,
261
+ payload
262
+ );
263
+ }
250
264
  /**
251
265
  * Generate a report on Firebase Data
252
266
  *
@@ -254,34 +268,36 @@ export class Migrations extends Service {
254
268
  * @param {string[]} resources
255
269
  * @param {string} serviceAccount
256
270
  * @throws {AppwriteException}
257
- * @returns {Promise}
258
- */
271
+ * @returns {Promise<Models.MigrationReport>}
272
+ */
259
273
  async getFirebaseReport(resources: string[], serviceAccount: string): Promise<Models.MigrationReport> {
260
274
  if (typeof resources === 'undefined') {
261
275
  throw new AppwriteException('Missing required parameter: "resources"');
262
276
  }
263
-
264
277
  if (typeof serviceAccount === 'undefined') {
265
278
  throw new AppwriteException('Missing required parameter: "serviceAccount"');
266
279
  }
267
-
268
280
  const apiPath = '/migrations/firebase/report';
269
281
  const payload: Payload = {};
270
-
271
282
  if (typeof resources !== 'undefined') {
272
283
  payload['resources'] = resources;
273
284
  }
274
-
275
285
  if (typeof serviceAccount !== 'undefined') {
276
286
  payload['serviceAccount'] = serviceAccount;
277
287
  }
278
-
279
288
  const uri = new URL(this.client.config.endpoint + apiPath);
280
- return await this.client.call('get', uri, {
289
+
290
+ const apiHeaders: { [header: string]: string } = {
281
291
  'content-type': 'application/json',
282
- }, payload);
283
- }
292
+ }
284
293
 
294
+ return await this.client.call(
295
+ 'get',
296
+ uri,
297
+ apiHeaders,
298
+ payload
299
+ );
300
+ }
285
301
  /**
286
302
  * Generate a report on Firebase Data using OAuth
287
303
  *
@@ -289,34 +305,36 @@ export class Migrations extends Service {
289
305
  * @param {string[]} resources
290
306
  * @param {string} projectId
291
307
  * @throws {AppwriteException}
292
- * @returns {Promise}
293
- */
308
+ * @returns {Promise<Models.MigrationReport>}
309
+ */
294
310
  async getFirebaseReportOAuth(resources: string[], projectId: string): Promise<Models.MigrationReport> {
295
311
  if (typeof resources === 'undefined') {
296
312
  throw new AppwriteException('Missing required parameter: "resources"');
297
313
  }
298
-
299
314
  if (typeof projectId === 'undefined') {
300
315
  throw new AppwriteException('Missing required parameter: "projectId"');
301
316
  }
302
-
303
317
  const apiPath = '/migrations/firebase/report/oauth';
304
318
  const payload: Payload = {};
305
-
306
319
  if (typeof resources !== 'undefined') {
307
320
  payload['resources'] = resources;
308
321
  }
309
-
310
322
  if (typeof projectId !== 'undefined') {
311
323
  payload['projectId'] = projectId;
312
324
  }
313
-
314
325
  const uri = new URL(this.client.config.endpoint + apiPath);
315
- return await this.client.call('get', uri, {
326
+
327
+ const apiHeaders: { [header: string]: string } = {
316
328
  'content-type': 'application/json',
317
- }, payload);
318
- }
329
+ }
319
330
 
331
+ return await this.client.call(
332
+ 'get',
333
+ uri,
334
+ apiHeaders,
335
+ payload
336
+ );
337
+ }
320
338
  /**
321
339
  * Migrate NHost Data
322
340
  *
@@ -330,78 +348,69 @@ export class Migrations extends Service {
330
348
  * @param {string} password
331
349
  * @param {number} port
332
350
  * @throws {AppwriteException}
333
- * @returns {Promise}
334
- */
351
+ * @returns {Promise<Models.Migration>}
352
+ */
335
353
  async createNHostMigration(resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.Migration> {
336
354
  if (typeof resources === 'undefined') {
337
355
  throw new AppwriteException('Missing required parameter: "resources"');
338
356
  }
339
-
340
357
  if (typeof subdomain === 'undefined') {
341
358
  throw new AppwriteException('Missing required parameter: "subdomain"');
342
359
  }
343
-
344
360
  if (typeof region === 'undefined') {
345
361
  throw new AppwriteException('Missing required parameter: "region"');
346
362
  }
347
-
348
363
  if (typeof adminSecret === 'undefined') {
349
364
  throw new AppwriteException('Missing required parameter: "adminSecret"');
350
365
  }
351
-
352
366
  if (typeof database === 'undefined') {
353
367
  throw new AppwriteException('Missing required parameter: "database"');
354
368
  }
355
-
356
369
  if (typeof username === 'undefined') {
357
370
  throw new AppwriteException('Missing required parameter: "username"');
358
371
  }
359
-
360
372
  if (typeof password === 'undefined') {
361
373
  throw new AppwriteException('Missing required parameter: "password"');
362
374
  }
363
-
364
375
  const apiPath = '/migrations/nhost';
365
376
  const payload: Payload = {};
366
-
367
377
  if (typeof resources !== 'undefined') {
368
378
  payload['resources'] = resources;
369
379
  }
370
-
371
380
  if (typeof subdomain !== 'undefined') {
372
381
  payload['subdomain'] = subdomain;
373
382
  }
374
-
375
383
  if (typeof region !== 'undefined') {
376
384
  payload['region'] = region;
377
385
  }
378
-
379
386
  if (typeof adminSecret !== 'undefined') {
380
387
  payload['adminSecret'] = adminSecret;
381
388
  }
382
-
383
389
  if (typeof database !== 'undefined') {
384
390
  payload['database'] = database;
385
391
  }
386
-
387
392
  if (typeof username !== 'undefined') {
388
393
  payload['username'] = username;
389
394
  }
390
-
391
395
  if (typeof password !== 'undefined') {
392
396
  payload['password'] = password;
393
397
  }
394
-
395
398
  if (typeof port !== 'undefined') {
396
399
  payload['port'] = port;
397
400
  }
398
-
399
401
  const uri = new URL(this.client.config.endpoint + apiPath);
400
- return await this.client.call('post', uri, {
402
+
403
+ const apiHeaders: { [header: string]: string } = {
401
404
  'content-type': 'application/json',
402
- }, payload);
403
- }
405
+ }
404
406
 
407
+ return await this.client.call(
408
+ 'post',
409
+ uri,
410
+ apiHeaders,
411
+ payload
412
+ );
413
+ }
405
414
  /**
406
415
  * Generate a report on NHost Data
407
416
  *
@@ -415,78 +424,69 @@ export class Migrations extends Service {
415
424
  * @param {string} password
416
425
  * @param {number} port
417
426
  * @throws {AppwriteException}
418
- * @returns {Promise}
419
- */
427
+ * @returns {Promise<Models.MigrationReport>}
428
+ */
420
429
  async getNHostReport(resources: string[], subdomain: string, region: string, adminSecret: string, database: string, username: string, password: string, port?: number): Promise<Models.MigrationReport> {
421
430
  if (typeof resources === 'undefined') {
422
431
  throw new AppwriteException('Missing required parameter: "resources"');
423
432
  }
424
-
425
433
  if (typeof subdomain === 'undefined') {
426
434
  throw new AppwriteException('Missing required parameter: "subdomain"');
427
435
  }
428
-
429
436
  if (typeof region === 'undefined') {
430
437
  throw new AppwriteException('Missing required parameter: "region"');
431
438
  }
432
-
433
439
  if (typeof adminSecret === 'undefined') {
434
440
  throw new AppwriteException('Missing required parameter: "adminSecret"');
435
441
  }
436
-
437
442
  if (typeof database === 'undefined') {
438
443
  throw new AppwriteException('Missing required parameter: "database"');
439
444
  }
440
-
441
445
  if (typeof username === 'undefined') {
442
446
  throw new AppwriteException('Missing required parameter: "username"');
443
447
  }
444
-
445
448
  if (typeof password === 'undefined') {
446
449
  throw new AppwriteException('Missing required parameter: "password"');
447
450
  }
448
-
449
451
  const apiPath = '/migrations/nhost/report';
450
452
  const payload: Payload = {};
451
-
452
453
  if (typeof resources !== 'undefined') {
453
454
  payload['resources'] = resources;
454
455
  }
455
-
456
456
  if (typeof subdomain !== 'undefined') {
457
457
  payload['subdomain'] = subdomain;
458
458
  }
459
-
460
459
  if (typeof region !== 'undefined') {
461
460
  payload['region'] = region;
462
461
  }
463
-
464
462
  if (typeof adminSecret !== 'undefined') {
465
463
  payload['adminSecret'] = adminSecret;
466
464
  }
467
-
468
465
  if (typeof database !== 'undefined') {
469
466
  payload['database'] = database;
470
467
  }
471
-
472
468
  if (typeof username !== 'undefined') {
473
469
  payload['username'] = username;
474
470
  }
475
-
476
471
  if (typeof password !== 'undefined') {
477
472
  payload['password'] = password;
478
473
  }
479
-
480
474
  if (typeof port !== 'undefined') {
481
475
  payload['port'] = port;
482
476
  }
483
-
484
477
  const uri = new URL(this.client.config.endpoint + apiPath);
485
- return await this.client.call('get', uri, {
478
+
479
+ const apiHeaders: { [header: string]: string } = {
486
480
  'content-type': 'application/json',
487
- }, payload);
488
- }
481
+ }
489
482
 
483
+ return await this.client.call(
484
+ 'get',
485
+ uri,
486
+ apiHeaders,
487
+ payload
488
+ );
489
+ }
490
490
  /**
491
491
  * Migrate Supabase Data
492
492
  *
@@ -499,70 +499,63 @@ export class Migrations extends Service {
499
499
  * @param {string} password
500
500
  * @param {number} port
501
501
  * @throws {AppwriteException}
502
- * @returns {Promise}
503
- */
502
+ * @returns {Promise<Models.Migration>}
503
+ */
504
504
  async createSupabaseMigration(resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.Migration> {
505
505
  if (typeof resources === 'undefined') {
506
506
  throw new AppwriteException('Missing required parameter: "resources"');
507
507
  }
508
-
509
508
  if (typeof endpoint === 'undefined') {
510
509
  throw new AppwriteException('Missing required parameter: "endpoint"');
511
510
  }
512
-
513
511
  if (typeof apiKey === 'undefined') {
514
512
  throw new AppwriteException('Missing required parameter: "apiKey"');
515
513
  }
516
-
517
514
  if (typeof databaseHost === 'undefined') {
518
515
  throw new AppwriteException('Missing required parameter: "databaseHost"');
519
516
  }
520
-
521
517
  if (typeof username === 'undefined') {
522
518
  throw new AppwriteException('Missing required parameter: "username"');
523
519
  }
524
-
525
520
  if (typeof password === 'undefined') {
526
521
  throw new AppwriteException('Missing required parameter: "password"');
527
522
  }
528
-
529
523
  const apiPath = '/migrations/supabase';
530
524
  const payload: Payload = {};
531
-
532
525
  if (typeof resources !== 'undefined') {
533
526
  payload['resources'] = resources;
534
527
  }
535
-
536
528
  if (typeof endpoint !== 'undefined') {
537
529
  payload['endpoint'] = endpoint;
538
530
  }
539
-
540
531
  if (typeof apiKey !== 'undefined') {
541
532
  payload['apiKey'] = apiKey;
542
533
  }
543
-
544
534
  if (typeof databaseHost !== 'undefined') {
545
535
  payload['databaseHost'] = databaseHost;
546
536
  }
547
-
548
537
  if (typeof username !== 'undefined') {
549
538
  payload['username'] = username;
550
539
  }
551
-
552
540
  if (typeof password !== 'undefined') {
553
541
  payload['password'] = password;
554
542
  }
555
-
556
543
  if (typeof port !== 'undefined') {
557
544
  payload['port'] = port;
558
545
  }
559
-
560
546
  const uri = new URL(this.client.config.endpoint + apiPath);
561
- return await this.client.call('post', uri, {
547
+
548
+ const apiHeaders: { [header: string]: string } = {
562
549
  'content-type': 'application/json',
563
- }, payload);
564
- }
550
+ }
565
551
 
552
+ return await this.client.call(
553
+ 'post',
554
+ uri,
555
+ apiHeaders,
556
+ payload
557
+ );
558
+ }
566
559
  /**
567
560
  * Generate a report on Supabase Data
568
561
  *
@@ -575,133 +568,142 @@ export class Migrations extends Service {
575
568
  * @param {string} password
576
569
  * @param {number} port
577
570
  * @throws {AppwriteException}
578
- * @returns {Promise}
579
- */
571
+ * @returns {Promise<Models.MigrationReport>}
572
+ */
580
573
  async getSupabaseReport(resources: string[], endpoint: string, apiKey: string, databaseHost: string, username: string, password: string, port?: number): Promise<Models.MigrationReport> {
581
574
  if (typeof resources === 'undefined') {
582
575
  throw new AppwriteException('Missing required parameter: "resources"');
583
576
  }
584
-
585
577
  if (typeof endpoint === 'undefined') {
586
578
  throw new AppwriteException('Missing required parameter: "endpoint"');
587
579
  }
588
-
589
580
  if (typeof apiKey === 'undefined') {
590
581
  throw new AppwriteException('Missing required parameter: "apiKey"');
591
582
  }
592
-
593
583
  if (typeof databaseHost === 'undefined') {
594
584
  throw new AppwriteException('Missing required parameter: "databaseHost"');
595
585
  }
596
-
597
586
  if (typeof username === 'undefined') {
598
587
  throw new AppwriteException('Missing required parameter: "username"');
599
588
  }
600
-
601
589
  if (typeof password === 'undefined') {
602
590
  throw new AppwriteException('Missing required parameter: "password"');
603
591
  }
604
-
605
592
  const apiPath = '/migrations/supabase/report';
606
593
  const payload: Payload = {};
607
-
608
594
  if (typeof resources !== 'undefined') {
609
595
  payload['resources'] = resources;
610
596
  }
611
-
612
597
  if (typeof endpoint !== 'undefined') {
613
598
  payload['endpoint'] = endpoint;
614
599
  }
615
-
616
600
  if (typeof apiKey !== 'undefined') {
617
601
  payload['apiKey'] = apiKey;
618
602
  }
619
-
620
603
  if (typeof databaseHost !== 'undefined') {
621
604
  payload['databaseHost'] = databaseHost;
622
605
  }
623
-
624
606
  if (typeof username !== 'undefined') {
625
607
  payload['username'] = username;
626
608
  }
627
-
628
609
  if (typeof password !== 'undefined') {
629
610
  payload['password'] = password;
630
611
  }
631
-
632
612
  if (typeof port !== 'undefined') {
633
613
  payload['port'] = port;
634
614
  }
635
-
636
615
  const uri = new URL(this.client.config.endpoint + apiPath);
637
- return await this.client.call('get', uri, {
616
+
617
+ const apiHeaders: { [header: string]: string } = {
638
618
  'content-type': 'application/json',
639
- }, payload);
640
- }
619
+ }
641
620
 
621
+ return await this.client.call(
622
+ 'get',
623
+ uri,
624
+ apiHeaders,
625
+ payload
626
+ );
627
+ }
642
628
  /**
643
629
  * Get Migration
644
630
  *
645
631
  *
646
632
  * @param {string} migrationId
647
633
  * @throws {AppwriteException}
648
- * @returns {Promise}
649
- */
634
+ * @returns {Promise<Models.Migration>}
635
+ */
650
636
  async get(migrationId: string): Promise<Models.Migration> {
651
637
  if (typeof migrationId === 'undefined') {
652
638
  throw new AppwriteException('Missing required parameter: "migrationId"');
653
639
  }
654
-
655
640
  const apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
656
641
  const payload: Payload = {};
657
-
658
642
  const uri = new URL(this.client.config.endpoint + apiPath);
659
- return await this.client.call('get', uri, {
643
+
644
+ const apiHeaders: { [header: string]: string } = {
660
645
  'content-type': 'application/json',
661
- }, payload);
662
- }
646
+ }
663
647
 
648
+ return await this.client.call(
649
+ 'get',
650
+ uri,
651
+ apiHeaders,
652
+ payload
653
+ );
654
+ }
664
655
  /**
665
656
  * Retry Migration
666
657
  *
667
658
  *
668
659
  * @param {string} migrationId
669
660
  * @throws {AppwriteException}
670
- * @returns {Promise}
671
- */
661
+ * @returns {Promise<Models.Migration>}
662
+ */
672
663
  async retry(migrationId: string): Promise<Models.Migration> {
673
664
  if (typeof migrationId === 'undefined') {
674
665
  throw new AppwriteException('Missing required parameter: "migrationId"');
675
666
  }
676
-
677
667
  const apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
678
668
  const payload: Payload = {};
679
-
680
669
  const uri = new URL(this.client.config.endpoint + apiPath);
681
- return await this.client.call('patch', uri, {
670
+
671
+ const apiHeaders: { [header: string]: string } = {
682
672
  'content-type': 'application/json',
683
- }, payload);
684
- }
673
+ }
685
674
 
675
+ return await this.client.call(
676
+ 'patch',
677
+ uri,
678
+ apiHeaders,
679
+ payload
680
+ );
681
+ }
686
682
  /**
687
683
  * Delete Migration
688
684
  *
689
685
  *
690
686
  * @param {string} migrationId
691
687
  * @throws {AppwriteException}
692
- * @returns {Promise}
693
- */
688
+ * @returns {Promise<{}>}
689
+ */
694
690
  async delete(migrationId: string): Promise<{}> {
695
691
  if (typeof migrationId === 'undefined') {
696
692
  throw new AppwriteException('Missing required parameter: "migrationId"');
697
693
  }
698
-
699
694
  const apiPath = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);
700
695
  const payload: Payload = {};
701
-
702
696
  const uri = new URL(this.client.config.endpoint + apiPath);
703
- return await this.client.call('delete', uri, {
697
+
698
+ const apiHeaders: { [header: string]: string } = {
704
699
  'content-type': 'application/json',
705
- }, payload);
700
+ }
701
+
702
+ return await this.client.call(
703
+ 'delete',
704
+ uri,
705
+ apiHeaders,
706
+ payload
707
+ );
706
708
  }
707
- };
709
+ }