chirag-appwrite-cli 0.1.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 (491) hide show
  1. package/.github/workflows/npm-publish.yml +49 -0
  2. package/CHANGELOG.md +1 -0
  3. package/Formula/appwrite.rb +19 -0
  4. package/LICENSE.md +1 -0
  5. package/README.md +104 -0
  6. package/appwrite.json +164 -0
  7. package/docs/examples/account/create-anonymous-session.md +1 -0
  8. package/docs/examples/account/create-email-password-session.md +3 -0
  9. package/docs/examples/account/create-email-token.md +4 -0
  10. package/docs/examples/account/create-j-w-t.md +1 -0
  11. package/docs/examples/account/create-magic-u-r-l-token.md +5 -0
  12. package/docs/examples/account/create-mfa-authenticator.md +2 -0
  13. package/docs/examples/account/create-mfa-challenge.md +2 -0
  14. package/docs/examples/account/create-mfa-recovery-codes.md +1 -0
  15. package/docs/examples/account/create-o-auth2session.md +5 -0
  16. package/docs/examples/account/create-o-auth2token.md +5 -0
  17. package/docs/examples/account/create-phone-token.md +3 -0
  18. package/docs/examples/account/create-phone-verification.md +1 -0
  19. package/docs/examples/account/create-push-target.md +4 -0
  20. package/docs/examples/account/create-recovery.md +3 -0
  21. package/docs/examples/account/create-session.md +3 -0
  22. package/docs/examples/account/create-verification.md +2 -0
  23. package/docs/examples/account/create.md +5 -0
  24. package/docs/examples/account/delete-identity.md +2 -0
  25. package/docs/examples/account/delete-mfa-authenticator.md +2 -0
  26. package/docs/examples/account/delete-push-target.md +2 -0
  27. package/docs/examples/account/delete-session.md +2 -0
  28. package/docs/examples/account/delete-sessions.md +1 -0
  29. package/docs/examples/account/delete.md +1 -0
  30. package/docs/examples/account/get-mfa-recovery-codes.md +1 -0
  31. package/docs/examples/account/get-prefs.md +1 -0
  32. package/docs/examples/account/get-session.md +2 -0
  33. package/docs/examples/account/get.md +1 -0
  34. package/docs/examples/account/list-identities.md +2 -0
  35. package/docs/examples/account/list-logs.md +2 -0
  36. package/docs/examples/account/list-mfa-factors.md +1 -0
  37. package/docs/examples/account/list-sessions.md +1 -0
  38. package/docs/examples/account/update-email.md +3 -0
  39. package/docs/examples/account/update-m-f-a.md +2 -0
  40. package/docs/examples/account/update-magic-u-r-l-session.md +3 -0
  41. package/docs/examples/account/update-mfa-authenticator.md +3 -0
  42. package/docs/examples/account/update-mfa-challenge.md +3 -0
  43. package/docs/examples/account/update-mfa-recovery-codes.md +1 -0
  44. package/docs/examples/account/update-name.md +2 -0
  45. package/docs/examples/account/update-password.md +3 -0
  46. package/docs/examples/account/update-phone-session.md +3 -0
  47. package/docs/examples/account/update-phone-verification.md +3 -0
  48. package/docs/examples/account/update-phone.md +3 -0
  49. package/docs/examples/account/update-prefs.md +2 -0
  50. package/docs/examples/account/update-push-target.md +3 -0
  51. package/docs/examples/account/update-recovery.md +4 -0
  52. package/docs/examples/account/update-session.md +2 -0
  53. package/docs/examples/account/update-status.md +1 -0
  54. package/docs/examples/account/update-verification.md +3 -0
  55. package/docs/examples/avatars/get-browser.md +5 -0
  56. package/docs/examples/avatars/get-credit-card.md +5 -0
  57. package/docs/examples/avatars/get-favicon.md +2 -0
  58. package/docs/examples/avatars/get-flag.md +5 -0
  59. package/docs/examples/avatars/get-image.md +4 -0
  60. package/docs/examples/avatars/get-initials.md +5 -0
  61. package/docs/examples/avatars/get-q-r.md +5 -0
  62. package/docs/examples/console/get-resource.md +3 -0
  63. package/docs/examples/console/variables.md +1 -0
  64. package/docs/examples/databases/create-boolean-attribute.md +7 -0
  65. package/docs/examples/databases/create-collection.md +7 -0
  66. package/docs/examples/databases/create-datetime-attribute.md +7 -0
  67. package/docs/examples/databases/create-document.md +6 -0
  68. package/docs/examples/databases/create-documents.md +4 -0
  69. package/docs/examples/databases/create-email-attribute.md +7 -0
  70. package/docs/examples/databases/create-enum-attribute.md +8 -0
  71. package/docs/examples/databases/create-float-attribute.md +9 -0
  72. package/docs/examples/databases/create-index.md +8 -0
  73. package/docs/examples/databases/create-integer-attribute.md +9 -0
  74. package/docs/examples/databases/create-ip-attribute.md +7 -0
  75. package/docs/examples/databases/create-relationship-attribute.md +9 -0
  76. package/docs/examples/databases/create-string-attribute.md +9 -0
  77. package/docs/examples/databases/create-url-attribute.md +7 -0
  78. package/docs/examples/databases/create.md +4 -0
  79. package/docs/examples/databases/decrement-document-attribute.md +7 -0
  80. package/docs/examples/databases/delete-attribute.md +4 -0
  81. package/docs/examples/databases/delete-collection.md +3 -0
  82. package/docs/examples/databases/delete-document.md +4 -0
  83. package/docs/examples/databases/delete-documents.md +4 -0
  84. package/docs/examples/databases/delete-index.md +4 -0
  85. package/docs/examples/databases/delete.md +2 -0
  86. package/docs/examples/databases/get-attribute.md +4 -0
  87. package/docs/examples/databases/get-collection-usage.md +4 -0
  88. package/docs/examples/databases/get-collection.md +3 -0
  89. package/docs/examples/databases/get-database-usage.md +3 -0
  90. package/docs/examples/databases/get-document.md +5 -0
  91. package/docs/examples/databases/get-index.md +4 -0
  92. package/docs/examples/databases/get-usage.md +2 -0
  93. package/docs/examples/databases/get.md +2 -0
  94. package/docs/examples/databases/increment-document-attribute.md +7 -0
  95. package/docs/examples/databases/list-attributes.md +4 -0
  96. package/docs/examples/databases/list-collection-logs.md +4 -0
  97. package/docs/examples/databases/list-collections.md +4 -0
  98. package/docs/examples/databases/list-document-logs.md +5 -0
  99. package/docs/examples/databases/list-documents.md +4 -0
  100. package/docs/examples/databases/list-indexes.md +4 -0
  101. package/docs/examples/databases/list-logs.md +3 -0
  102. package/docs/examples/databases/list.md +3 -0
  103. package/docs/examples/databases/update-boolean-attribute.md +7 -0
  104. package/docs/examples/databases/update-collection.md +7 -0
  105. package/docs/examples/databases/update-datetime-attribute.md +7 -0
  106. package/docs/examples/databases/update-document.md +6 -0
  107. package/docs/examples/databases/update-documents.md +5 -0
  108. package/docs/examples/databases/update-email-attribute.md +7 -0
  109. package/docs/examples/databases/update-enum-attribute.md +8 -0
  110. package/docs/examples/databases/update-float-attribute.md +9 -0
  111. package/docs/examples/databases/update-integer-attribute.md +9 -0
  112. package/docs/examples/databases/update-ip-attribute.md +7 -0
  113. package/docs/examples/databases/update-relationship-attribute.md +6 -0
  114. package/docs/examples/databases/update-string-attribute.md +8 -0
  115. package/docs/examples/databases/update-url-attribute.md +7 -0
  116. package/docs/examples/databases/update.md +4 -0
  117. package/docs/examples/databases/upsert-document.md +6 -0
  118. package/docs/examples/databases/upsert-documents.md +4 -0
  119. package/docs/examples/functions/create-deployment.md +6 -0
  120. package/docs/examples/functions/create-duplicate-deployment.md +4 -0
  121. package/docs/examples/functions/create-execution.md +8 -0
  122. package/docs/examples/functions/create-template-deployment.md +7 -0
  123. package/docs/examples/functions/create-variable.md +5 -0
  124. package/docs/examples/functions/create-vcs-deployment.md +5 -0
  125. package/docs/examples/functions/create.md +19 -0
  126. package/docs/examples/functions/delete-deployment.md +3 -0
  127. package/docs/examples/functions/delete-execution.md +3 -0
  128. package/docs/examples/functions/delete-variable.md +3 -0
  129. package/docs/examples/functions/delete.md +2 -0
  130. package/docs/examples/functions/get-deployment-download.md +4 -0
  131. package/docs/examples/functions/get-deployment.md +3 -0
  132. package/docs/examples/functions/get-execution.md +3 -0
  133. package/docs/examples/functions/get-template.md +2 -0
  134. package/docs/examples/functions/get-usage.md +3 -0
  135. package/docs/examples/functions/get-variable.md +3 -0
  136. package/docs/examples/functions/get.md +2 -0
  137. package/docs/examples/functions/list-deployments.md +4 -0
  138. package/docs/examples/functions/list-executions.md +3 -0
  139. package/docs/examples/functions/list-runtimes.md +1 -0
  140. package/docs/examples/functions/list-specifications.md +1 -0
  141. package/docs/examples/functions/list-templates.md +5 -0
  142. package/docs/examples/functions/list-usage.md +2 -0
  143. package/docs/examples/functions/list-variables.md +2 -0
  144. package/docs/examples/functions/list.md +3 -0
  145. package/docs/examples/functions/update-deployment-status.md +3 -0
  146. package/docs/examples/functions/update-function-deployment.md +3 -0
  147. package/docs/examples/functions/update-variable.md +6 -0
  148. package/docs/examples/functions/update.md +19 -0
  149. package/docs/examples/graphql/mutation.md +2 -0
  150. package/docs/examples/graphql/query.md +2 -0
  151. package/docs/examples/health/get-antivirus.md +1 -0
  152. package/docs/examples/health/get-cache.md +1 -0
  153. package/docs/examples/health/get-certificate.md +2 -0
  154. package/docs/examples/health/get-d-b.md +1 -0
  155. package/docs/examples/health/get-failed-jobs.md +3 -0
  156. package/docs/examples/health/get-pub-sub.md +1 -0
  157. package/docs/examples/health/get-queue-builds.md +2 -0
  158. package/docs/examples/health/get-queue-certificates.md +2 -0
  159. package/docs/examples/health/get-queue-databases.md +3 -0
  160. package/docs/examples/health/get-queue-deletes.md +2 -0
  161. package/docs/examples/health/get-queue-functions.md +2 -0
  162. package/docs/examples/health/get-queue-logs.md +2 -0
  163. package/docs/examples/health/get-queue-mails.md +2 -0
  164. package/docs/examples/health/get-queue-messaging.md +2 -0
  165. package/docs/examples/health/get-queue-migrations.md +2 -0
  166. package/docs/examples/health/get-queue-stats-resources.md +2 -0
  167. package/docs/examples/health/get-queue-usage.md +2 -0
  168. package/docs/examples/health/get-queue-webhooks.md +2 -0
  169. package/docs/examples/health/get-storage-local.md +1 -0
  170. package/docs/examples/health/get-storage.md +1 -0
  171. package/docs/examples/health/get-time.md +1 -0
  172. package/docs/examples/health/get.md +1 -0
  173. package/docs/examples/locale/get.md +1 -0
  174. package/docs/examples/locale/list-codes.md +1 -0
  175. package/docs/examples/locale/list-continents.md +1 -0
  176. package/docs/examples/locale/list-countries-e-u.md +1 -0
  177. package/docs/examples/locale/list-countries-phones.md +1 -0
  178. package/docs/examples/locale/list-countries.md +1 -0
  179. package/docs/examples/locale/list-currencies.md +1 -0
  180. package/docs/examples/locale/list-languages.md +1 -0
  181. package/docs/examples/messaging/create-apns-provider.md +9 -0
  182. package/docs/examples/messaging/create-email.md +13 -0
  183. package/docs/examples/messaging/create-fcm-provider.md +5 -0
  184. package/docs/examples/messaging/create-mailgun-provider.md +11 -0
  185. package/docs/examples/messaging/create-msg91provider.md +7 -0
  186. package/docs/examples/messaging/create-push.md +20 -0
  187. package/docs/examples/messaging/create-sendgrid-provider.md +9 -0
  188. package/docs/examples/messaging/create-sms.md +8 -0
  189. package/docs/examples/messaging/create-smtp-provider.md +15 -0
  190. package/docs/examples/messaging/create-subscriber.md +4 -0
  191. package/docs/examples/messaging/create-telesign-provider.md +7 -0
  192. package/docs/examples/messaging/create-textmagic-provider.md +7 -0
  193. package/docs/examples/messaging/create-topic.md +4 -0
  194. package/docs/examples/messaging/create-twilio-provider.md +7 -0
  195. package/docs/examples/messaging/create-vonage-provider.md +7 -0
  196. package/docs/examples/messaging/delete-provider.md +2 -0
  197. package/docs/examples/messaging/delete-subscriber.md +3 -0
  198. package/docs/examples/messaging/delete-topic.md +2 -0
  199. package/docs/examples/messaging/delete.md +2 -0
  200. package/docs/examples/messaging/get-message.md +2 -0
  201. package/docs/examples/messaging/get-provider.md +2 -0
  202. package/docs/examples/messaging/get-subscriber.md +3 -0
  203. package/docs/examples/messaging/get-topic.md +2 -0
  204. package/docs/examples/messaging/list-message-logs.md +3 -0
  205. package/docs/examples/messaging/list-messages.md +3 -0
  206. package/docs/examples/messaging/list-provider-logs.md +3 -0
  207. package/docs/examples/messaging/list-providers.md +3 -0
  208. package/docs/examples/messaging/list-subscriber-logs.md +3 -0
  209. package/docs/examples/messaging/list-subscribers.md +4 -0
  210. package/docs/examples/messaging/list-targets.md +3 -0
  211. package/docs/examples/messaging/list-topic-logs.md +3 -0
  212. package/docs/examples/messaging/list-topics.md +3 -0
  213. package/docs/examples/messaging/update-apns-provider.md +9 -0
  214. package/docs/examples/messaging/update-email.md +13 -0
  215. package/docs/examples/messaging/update-fcm-provider.md +5 -0
  216. package/docs/examples/messaging/update-mailgun-provider.md +11 -0
  217. package/docs/examples/messaging/update-msg91provider.md +7 -0
  218. package/docs/examples/messaging/update-push.md +20 -0
  219. package/docs/examples/messaging/update-sendgrid-provider.md +9 -0
  220. package/docs/examples/messaging/update-sms.md +8 -0
  221. package/docs/examples/messaging/update-smtp-provider.md +15 -0
  222. package/docs/examples/messaging/update-telesign-provider.md +7 -0
  223. package/docs/examples/messaging/update-textmagic-provider.md +7 -0
  224. package/docs/examples/messaging/update-topic.md +4 -0
  225. package/docs/examples/messaging/update-twilio-provider.md +7 -0
  226. package/docs/examples/messaging/update-vonage-provider.md +7 -0
  227. package/docs/examples/migrations/create-appwrite-migration.md +5 -0
  228. package/docs/examples/migrations/create-csv-migration.md +4 -0
  229. package/docs/examples/migrations/create-firebase-migration.md +3 -0
  230. package/docs/examples/migrations/create-n-host-migration.md +9 -0
  231. package/docs/examples/migrations/create-supabase-migration.md +8 -0
  232. package/docs/examples/migrations/delete.md +2 -0
  233. package/docs/examples/migrations/get-appwrite-report.md +5 -0
  234. package/docs/examples/migrations/get-firebase-report.md +3 -0
  235. package/docs/examples/migrations/get-n-host-report.md +9 -0
  236. package/docs/examples/migrations/get-supabase-report.md +8 -0
  237. package/docs/examples/migrations/get.md +2 -0
  238. package/docs/examples/migrations/list.md +3 -0
  239. package/docs/examples/migrations/retry.md +2 -0
  240. package/docs/examples/project/create-variable.md +4 -0
  241. package/docs/examples/project/delete-variable.md +2 -0
  242. package/docs/examples/project/get-usage.md +4 -0
  243. package/docs/examples/project/get-variable.md +2 -0
  244. package/docs/examples/project/list-variables.md +1 -0
  245. package/docs/examples/project/update-variable.md +5 -0
  246. package/docs/examples/projects/create-dev-key.md +4 -0
  247. package/docs/examples/projects/create-j-w-t.md +4 -0
  248. package/docs/examples/projects/create-key.md +5 -0
  249. package/docs/examples/projects/create-platform.md +7 -0
  250. package/docs/examples/projects/create-smtp-test.md +11 -0
  251. package/docs/examples/projects/create-webhook.md +9 -0
  252. package/docs/examples/projects/create.md +14 -0
  253. package/docs/examples/projects/delete-dev-key.md +3 -0
  254. package/docs/examples/projects/delete-email-template.md +4 -0
  255. package/docs/examples/projects/delete-key.md +3 -0
  256. package/docs/examples/projects/delete-platform.md +3 -0
  257. package/docs/examples/projects/delete-sms-template.md +4 -0
  258. package/docs/examples/projects/delete-webhook.md +3 -0
  259. package/docs/examples/projects/delete.md +2 -0
  260. package/docs/examples/projects/get-dev-key.md +3 -0
  261. package/docs/examples/projects/get-email-template.md +4 -0
  262. package/docs/examples/projects/get-key.md +3 -0
  263. package/docs/examples/projects/get-platform.md +3 -0
  264. package/docs/examples/projects/get-sms-template.md +4 -0
  265. package/docs/examples/projects/get-webhook.md +3 -0
  266. package/docs/examples/projects/get.md +2 -0
  267. package/docs/examples/projects/list-dev-keys.md +3 -0
  268. package/docs/examples/projects/list-keys.md +2 -0
  269. package/docs/examples/projects/list-platforms.md +2 -0
  270. package/docs/examples/projects/list-webhooks.md +2 -0
  271. package/docs/examples/projects/list.md +3 -0
  272. package/docs/examples/projects/update-api-status-all.md +3 -0
  273. package/docs/examples/projects/update-api-status.md +4 -0
  274. package/docs/examples/projects/update-auth-duration.md +3 -0
  275. package/docs/examples/projects/update-auth-limit.md +3 -0
  276. package/docs/examples/projects/update-auth-password-dictionary.md +3 -0
  277. package/docs/examples/projects/update-auth-password-history.md +3 -0
  278. package/docs/examples/projects/update-auth-sessions-limit.md +3 -0
  279. package/docs/examples/projects/update-auth-status.md +4 -0
  280. package/docs/examples/projects/update-dev-key.md +5 -0
  281. package/docs/examples/projects/update-email-template.md +9 -0
  282. package/docs/examples/projects/update-key.md +6 -0
  283. package/docs/examples/projects/update-memberships-privacy.md +5 -0
  284. package/docs/examples/projects/update-mock-numbers.md +3 -0
  285. package/docs/examples/projects/update-o-auth2.md +6 -0
  286. package/docs/examples/projects/update-personal-data-check.md +3 -0
  287. package/docs/examples/projects/update-platform.md +7 -0
  288. package/docs/examples/projects/update-service-status-all.md +3 -0
  289. package/docs/examples/projects/update-service-status.md +4 -0
  290. package/docs/examples/projects/update-session-alerts.md +3 -0
  291. package/docs/examples/projects/update-sms-template.md +5 -0
  292. package/docs/examples/projects/update-smtp.md +11 -0
  293. package/docs/examples/projects/update-team.md +3 -0
  294. package/docs/examples/projects/update-webhook-signature.md +3 -0
  295. package/docs/examples/projects/update-webhook.md +10 -0
  296. package/docs/examples/projects/update.md +12 -0
  297. package/docs/examples/proxy/create-a-p-i-rule.md +2 -0
  298. package/docs/examples/proxy/create-function-rule.md +4 -0
  299. package/docs/examples/proxy/create-redirect-rule.md +6 -0
  300. package/docs/examples/proxy/create-site-rule.md +4 -0
  301. package/docs/examples/proxy/delete-rule.md +2 -0
  302. package/docs/examples/proxy/get-rule.md +2 -0
  303. package/docs/examples/proxy/list-rules.md +3 -0
  304. package/docs/examples/proxy/update-rule-verification.md +2 -0
  305. package/docs/examples/sites/create-deployment.md +7 -0
  306. package/docs/examples/sites/create-duplicate-deployment.md +3 -0
  307. package/docs/examples/sites/create-template-deployment.md +7 -0
  308. package/docs/examples/sites/create-variable.md +5 -0
  309. package/docs/examples/sites/create-vcs-deployment.md +5 -0
  310. package/docs/examples/sites/create.md +19 -0
  311. package/docs/examples/sites/delete-deployment.md +3 -0
  312. package/docs/examples/sites/delete-log.md +3 -0
  313. package/docs/examples/sites/delete-variable.md +3 -0
  314. package/docs/examples/sites/delete.md +2 -0
  315. package/docs/examples/sites/get-deployment-download.md +4 -0
  316. package/docs/examples/sites/get-deployment.md +3 -0
  317. package/docs/examples/sites/get-log.md +3 -0
  318. package/docs/examples/sites/get-template.md +2 -0
  319. package/docs/examples/sites/get-usage.md +3 -0
  320. package/docs/examples/sites/get-variable.md +3 -0
  321. package/docs/examples/sites/get.md +2 -0
  322. package/docs/examples/sites/list-deployments.md +4 -0
  323. package/docs/examples/sites/list-frameworks.md +1 -0
  324. package/docs/examples/sites/list-logs.md +3 -0
  325. package/docs/examples/sites/list-specifications.md +1 -0
  326. package/docs/examples/sites/list-templates.md +5 -0
  327. package/docs/examples/sites/list-usage.md +2 -0
  328. package/docs/examples/sites/list-variables.md +2 -0
  329. package/docs/examples/sites/list.md +3 -0
  330. package/docs/examples/sites/update-deployment-status.md +3 -0
  331. package/docs/examples/sites/update-site-deployment.md +3 -0
  332. package/docs/examples/sites/update-variable.md +6 -0
  333. package/docs/examples/sites/update.md +19 -0
  334. package/docs/examples/storage/create-bucket.md +11 -0
  335. package/docs/examples/storage/create-file.md +5 -0
  336. package/docs/examples/storage/delete-bucket.md +2 -0
  337. package/docs/examples/storage/delete-file.md +3 -0
  338. package/docs/examples/storage/get-bucket-usage.md +3 -0
  339. package/docs/examples/storage/get-bucket.md +2 -0
  340. package/docs/examples/storage/get-file-download.md +4 -0
  341. package/docs/examples/storage/get-file-preview.md +15 -0
  342. package/docs/examples/storage/get-file-view.md +4 -0
  343. package/docs/examples/storage/get-file.md +3 -0
  344. package/docs/examples/storage/get-usage.md +2 -0
  345. package/docs/examples/storage/list-buckets.md +3 -0
  346. package/docs/examples/storage/list-files.md +4 -0
  347. package/docs/examples/storage/update-bucket.md +11 -0
  348. package/docs/examples/storage/update-file.md +5 -0
  349. package/docs/examples/teams/create-membership.md +8 -0
  350. package/docs/examples/teams/create.md +4 -0
  351. package/docs/examples/teams/delete-membership.md +3 -0
  352. package/docs/examples/teams/delete.md +2 -0
  353. package/docs/examples/teams/get-membership.md +3 -0
  354. package/docs/examples/teams/get-prefs.md +2 -0
  355. package/docs/examples/teams/get.md +2 -0
  356. package/docs/examples/teams/list-logs.md +3 -0
  357. package/docs/examples/teams/list-memberships.md +4 -0
  358. package/docs/examples/teams/list.md +3 -0
  359. package/docs/examples/teams/update-membership-status.md +5 -0
  360. package/docs/examples/teams/update-membership.md +4 -0
  361. package/docs/examples/teams/update-name.md +3 -0
  362. package/docs/examples/teams/update-prefs.md +3 -0
  363. package/docs/examples/tokens/create-file-token.md +4 -0
  364. package/docs/examples/tokens/delete.md +2 -0
  365. package/docs/examples/tokens/get.md +2 -0
  366. package/docs/examples/tokens/list.md +4 -0
  367. package/docs/examples/tokens/update.md +3 -0
  368. package/docs/examples/users/create-argon2user.md +5 -0
  369. package/docs/examples/users/create-bcrypt-user.md +5 -0
  370. package/docs/examples/users/create-j-w-t.md +4 -0
  371. package/docs/examples/users/create-m-d5user.md +5 -0
  372. package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
  373. package/docs/examples/users/create-p-h-pass-user.md +5 -0
  374. package/docs/examples/users/create-s-h-a-user.md +6 -0
  375. package/docs/examples/users/create-scrypt-modified-user.md +8 -0
  376. package/docs/examples/users/create-scrypt-user.md +10 -0
  377. package/docs/examples/users/create-session.md +2 -0
  378. package/docs/examples/users/create-target.md +7 -0
  379. package/docs/examples/users/create-token.md +4 -0
  380. package/docs/examples/users/create.md +6 -0
  381. package/docs/examples/users/delete-identity.md +2 -0
  382. package/docs/examples/users/delete-mfa-authenticator.md +3 -0
  383. package/docs/examples/users/delete-session.md +3 -0
  384. package/docs/examples/users/delete-sessions.md +2 -0
  385. package/docs/examples/users/delete-target.md +3 -0
  386. package/docs/examples/users/delete.md +2 -0
  387. package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
  388. package/docs/examples/users/get-prefs.md +2 -0
  389. package/docs/examples/users/get-target.md +3 -0
  390. package/docs/examples/users/get-usage.md +2 -0
  391. package/docs/examples/users/get.md +2 -0
  392. package/docs/examples/users/list-identities.md +3 -0
  393. package/docs/examples/users/list-logs.md +3 -0
  394. package/docs/examples/users/list-memberships.md +4 -0
  395. package/docs/examples/users/list-mfa-factors.md +2 -0
  396. package/docs/examples/users/list-sessions.md +2 -0
  397. package/docs/examples/users/list-targets.md +3 -0
  398. package/docs/examples/users/list.md +3 -0
  399. package/docs/examples/users/update-email-verification.md +3 -0
  400. package/docs/examples/users/update-email.md +3 -0
  401. package/docs/examples/users/update-labels.md +3 -0
  402. package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
  403. package/docs/examples/users/update-mfa.md +3 -0
  404. package/docs/examples/users/update-name.md +3 -0
  405. package/docs/examples/users/update-password.md +3 -0
  406. package/docs/examples/users/update-phone-verification.md +3 -0
  407. package/docs/examples/users/update-phone.md +3 -0
  408. package/docs/examples/users/update-prefs.md +3 -0
  409. package/docs/examples/users/update-status.md +3 -0
  410. package/docs/examples/users/update-target.md +6 -0
  411. package/docs/examples/vcs/create-repository-detection.md +5 -0
  412. package/docs/examples/vcs/create-repository.md +4 -0
  413. package/docs/examples/vcs/delete-installation.md +2 -0
  414. package/docs/examples/vcs/get-installation.md +2 -0
  415. package/docs/examples/vcs/get-repository-contents.md +5 -0
  416. package/docs/examples/vcs/get-repository.md +3 -0
  417. package/docs/examples/vcs/list-installations.md +3 -0
  418. package/docs/examples/vcs/list-repositories.md +4 -0
  419. package/docs/examples/vcs/list-repository-branches.md +3 -0
  420. package/docs/examples/vcs/update-external-deployments.md +4 -0
  421. package/functions/Starter function/.prettierrc.json +6 -0
  422. package/functions/Starter function/README.md +48 -0
  423. package/functions/Starter function/package-lock.json +60 -0
  424. package/functions/Starter function/package.json +16 -0
  425. package/functions/Starter function/src/main.js +35 -0
  426. package/generate/appwrite.d.ts +18 -0
  427. package/index.js +109 -0
  428. package/install.ps1 +98 -0
  429. package/install.sh +157 -0
  430. package/lib/client.js +259 -0
  431. package/lib/commands/account.js +2074 -0
  432. package/lib/commands/avatars.js +491 -0
  433. package/lib/commands/console.js +129 -0
  434. package/lib/commands/databases.js +2972 -0
  435. package/lib/commands/functions.js +1737 -0
  436. package/lib/commands/generic.js +328 -0
  437. package/lib/commands/graphql.js +128 -0
  438. package/lib/commands/health.js +891 -0
  439. package/lib/commands/init.js +566 -0
  440. package/lib/commands/locale.js +324 -0
  441. package/lib/commands/messaging.js +2970 -0
  442. package/lib/commands/migrations.js +751 -0
  443. package/lib/commands/organizations.js +48 -0
  444. package/lib/commands/project.js +308 -0
  445. package/lib/commands/projects.js +2615 -0
  446. package/lib/commands/proxy.js +406 -0
  447. package/lib/commands/pull.js +474 -0
  448. package/lib/commands/push.js +2117 -0
  449. package/lib/commands/run.js +330 -0
  450. package/lib/commands/sites.js +1663 -0
  451. package/lib/commands/storage.js +990 -0
  452. package/lib/commands/teams.js +682 -0
  453. package/lib/commands/tokens.js +261 -0
  454. package/lib/commands/types.js +156 -0
  455. package/lib/commands/users.js +2035 -0
  456. package/lib/commands/vcs.js +484 -0
  457. package/lib/config.js +705 -0
  458. package/lib/emulation/docker.js +264 -0
  459. package/lib/emulation/utils.js +186 -0
  460. package/lib/exception.js +9 -0
  461. package/lib/id.js +30 -0
  462. package/lib/paginate.js +52 -0
  463. package/lib/parser.js +246 -0
  464. package/lib/questions.js +1006 -0
  465. package/lib/sdks.js +60 -0
  466. package/lib/spinner.js +104 -0
  467. package/lib/type-generation/attribute.js +16 -0
  468. package/lib/type-generation/languages/dart.js +196 -0
  469. package/lib/type-generation/languages/java.js +130 -0
  470. package/lib/type-generation/languages/javascript.js +102 -0
  471. package/lib/type-generation/languages/kotlin.js +84 -0
  472. package/lib/type-generation/languages/language.js +125 -0
  473. package/lib/type-generation/languages/php.js +109 -0
  474. package/lib/type-generation/languages/swift.js +169 -0
  475. package/lib/type-generation/languages/typescript.js +102 -0
  476. package/lib/utils.js +289 -0
  477. package/lib/validations.js +17 -0
  478. package/package.json +50 -0
  479. package/scoop/appwrite.json +30 -0
  480. package/sites/JavaScript starter/.env.example +3 -0
  481. package/sites/JavaScript starter/LICENSE +21 -0
  482. package/sites/JavaScript starter/images/appwrite.svg +8 -0
  483. package/sites/JavaScript starter/images/javascript.svg +5 -0
  484. package/sites/JavaScript starter/index.html +250 -0
  485. package/sites/JavaScript starter/lib/appwrite.js +10 -0
  486. package/sites/JavaScript starter/package-lock.json +1431 -0
  487. package/sites/JavaScript starter/package.json +21 -0
  488. package/sites/JavaScript starter/readme.md +26 -0
  489. package/sites/JavaScript starter/src/javascript.svg +1 -0
  490. package/sites/JavaScript starter/style/app.css +20 -0
  491. package/sites/JavaScript starter/vite.config.js +7 -0
@@ -0,0 +1,891 @@
1
+ const fs = require('fs');
2
+ const pathLib = require('path');
3
+ const tar = require("tar");
4
+ const ignore = require("ignore");
5
+ const { promisify } = require('util');
6
+ const libClient = require('../client.js');
7
+ const { getAllFiles, showConsoleLink } = require('../utils.js');
8
+ const { Command } = require('commander');
9
+ const { sdkForProject, sdkForConsole } = require('../sdks')
10
+ const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser')
11
+ const { localConfig, globalConfig } = require("../config");
12
+ const { File } = require('undici');
13
+ const { ReadableStream } = require('stream/web');
14
+
15
+ /**
16
+ * @param {fs.ReadStream} readStream
17
+ * @returns {ReadableStream}
18
+ */
19
+ function convertReadStreamToReadableStream(readStream) {
20
+ return new ReadableStream({
21
+ start(controller) {
22
+ readStream.on("data", (chunk) => {
23
+ controller.enqueue(chunk);
24
+ });
25
+ readStream.on("end", () => {
26
+ controller.close();
27
+ });
28
+ readStream.on("error", (err) => {
29
+ controller.error(err);
30
+ });
31
+ },
32
+ cancel() {
33
+ readStream.destroy();
34
+ },
35
+ });
36
+ }
37
+
38
+ const health = new Command("health").description(commandDescriptions['health'] ?? '').configureHelp({
39
+ helpWidth: process.stdout.columns || 80
40
+ })
41
+
42
+ /**
43
+ * @typedef {Object} HealthGetRequestParams
44
+ * @property {boolean} overrideForCli
45
+ * @property {boolean} parseOutput
46
+ * @property {libClient | undefined} sdk
47
+ */
48
+
49
+ /**
50
+ * @param {HealthGetRequestParams} params
51
+ */
52
+ const healthGet = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
53
+ let client = !sdk ? await sdkForProject() :
54
+ sdk;
55
+ let apiPath = '/health';
56
+ let payload = {};
57
+
58
+ let response = undefined;
59
+
60
+ response = await client.call('get', apiPath, {
61
+ }, payload);
62
+
63
+ if (parseOutput) {
64
+ parse(response)
65
+ }
66
+
67
+ return response;
68
+
69
+ }
70
+
71
+ /**
72
+ * @typedef {Object} HealthGetAntivirusRequestParams
73
+ * @property {boolean} overrideForCli
74
+ * @property {boolean} parseOutput
75
+ * @property {libClient | undefined} sdk
76
+ */
77
+
78
+ /**
79
+ * @param {HealthGetAntivirusRequestParams} params
80
+ */
81
+ const healthGetAntivirus = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
82
+ let client = !sdk ? await sdkForProject() :
83
+ sdk;
84
+ let apiPath = '/health/anti-virus';
85
+ let payload = {};
86
+
87
+ let response = undefined;
88
+
89
+ response = await client.call('get', apiPath, {
90
+ }, payload);
91
+
92
+ if (parseOutput) {
93
+ parse(response)
94
+ }
95
+
96
+ return response;
97
+
98
+ }
99
+
100
+ /**
101
+ * @typedef {Object} HealthGetCacheRequestParams
102
+ * @property {boolean} overrideForCli
103
+ * @property {boolean} parseOutput
104
+ * @property {libClient | undefined} sdk
105
+ */
106
+
107
+ /**
108
+ * @param {HealthGetCacheRequestParams} params
109
+ */
110
+ const healthGetCache = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
111
+ let client = !sdk ? await sdkForProject() :
112
+ sdk;
113
+ let apiPath = '/health/cache';
114
+ let payload = {};
115
+
116
+ let response = undefined;
117
+
118
+ response = await client.call('get', apiPath, {
119
+ }, payload);
120
+
121
+ if (parseOutput) {
122
+ parse(response)
123
+ }
124
+
125
+ return response;
126
+
127
+ }
128
+
129
+ /**
130
+ * @typedef {Object} HealthGetCertificateRequestParams
131
+ * @property {string} domain string
132
+ * @property {boolean} overrideForCli
133
+ * @property {boolean} parseOutput
134
+ * @property {libClient | undefined} sdk
135
+ */
136
+
137
+ /**
138
+ * @param {HealthGetCertificateRequestParams} params
139
+ */
140
+ const healthGetCertificate = async ({domain,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
141
+ let client = !sdk ? await sdkForProject() :
142
+ sdk;
143
+ let apiPath = '/health/certificate';
144
+ let payload = {};
145
+ if (typeof domain !== 'undefined') {
146
+ payload['domain'] = domain;
147
+ }
148
+
149
+ let response = undefined;
150
+
151
+ response = await client.call('get', apiPath, {
152
+ }, payload);
153
+
154
+ if (parseOutput) {
155
+ parse(response)
156
+ }
157
+
158
+ return response;
159
+
160
+ }
161
+
162
+ /**
163
+ * @typedef {Object} HealthGetDBRequestParams
164
+ * @property {boolean} overrideForCli
165
+ * @property {boolean} parseOutput
166
+ * @property {libClient | undefined} sdk
167
+ */
168
+
169
+ /**
170
+ * @param {HealthGetDBRequestParams} params
171
+ */
172
+ const healthGetDB = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
173
+ let client = !sdk ? await sdkForProject() :
174
+ sdk;
175
+ let apiPath = '/health/db';
176
+ let payload = {};
177
+
178
+ let response = undefined;
179
+
180
+ response = await client.call('get', apiPath, {
181
+ }, payload);
182
+
183
+ if (parseOutput) {
184
+ parse(response)
185
+ }
186
+
187
+ return response;
188
+
189
+ }
190
+
191
+ /**
192
+ * @typedef {Object} HealthGetPubSubRequestParams
193
+ * @property {boolean} overrideForCli
194
+ * @property {boolean} parseOutput
195
+ * @property {libClient | undefined} sdk
196
+ */
197
+
198
+ /**
199
+ * @param {HealthGetPubSubRequestParams} params
200
+ */
201
+ const healthGetPubSub = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
202
+ let client = !sdk ? await sdkForProject() :
203
+ sdk;
204
+ let apiPath = '/health/pubsub';
205
+ let payload = {};
206
+
207
+ let response = undefined;
208
+
209
+ response = await client.call('get', apiPath, {
210
+ }, payload);
211
+
212
+ if (parseOutput) {
213
+ parse(response)
214
+ }
215
+
216
+ return response;
217
+
218
+ }
219
+
220
+ /**
221
+ * @typedef {Object} HealthGetQueueBuildsRequestParams
222
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
223
+ * @property {boolean} overrideForCli
224
+ * @property {boolean} parseOutput
225
+ * @property {libClient | undefined} sdk
226
+ */
227
+
228
+ /**
229
+ * @param {HealthGetQueueBuildsRequestParams} params
230
+ */
231
+ const healthGetQueueBuilds = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
232
+ let client = !sdk ? await sdkForProject() :
233
+ sdk;
234
+ let apiPath = '/health/queue/builds';
235
+ let payload = {};
236
+ if (typeof threshold !== 'undefined') {
237
+ payload['threshold'] = threshold;
238
+ }
239
+
240
+ let response = undefined;
241
+
242
+ response = await client.call('get', apiPath, {
243
+ }, payload);
244
+
245
+ if (parseOutput) {
246
+ parse(response)
247
+ }
248
+
249
+ return response;
250
+
251
+ }
252
+
253
+ /**
254
+ * @typedef {Object} HealthGetQueueCertificatesRequestParams
255
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
256
+ * @property {boolean} overrideForCli
257
+ * @property {boolean} parseOutput
258
+ * @property {libClient | undefined} sdk
259
+ */
260
+
261
+ /**
262
+ * @param {HealthGetQueueCertificatesRequestParams} params
263
+ */
264
+ const healthGetQueueCertificates = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
265
+ let client = !sdk ? await sdkForProject() :
266
+ sdk;
267
+ let apiPath = '/health/queue/certificates';
268
+ let payload = {};
269
+ if (typeof threshold !== 'undefined') {
270
+ payload['threshold'] = threshold;
271
+ }
272
+
273
+ let response = undefined;
274
+
275
+ response = await client.call('get', apiPath, {
276
+ }, payload);
277
+
278
+ if (parseOutput) {
279
+ parse(response)
280
+ }
281
+
282
+ return response;
283
+
284
+ }
285
+
286
+ /**
287
+ * @typedef {Object} HealthGetQueueDatabasesRequestParams
288
+ * @property {string} name Queue name for which to check the queue size
289
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
290
+ * @property {boolean} overrideForCli
291
+ * @property {boolean} parseOutput
292
+ * @property {libClient | undefined} sdk
293
+ */
294
+
295
+ /**
296
+ * @param {HealthGetQueueDatabasesRequestParams} params
297
+ */
298
+ const healthGetQueueDatabases = async ({name,threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
299
+ let client = !sdk ? await sdkForProject() :
300
+ sdk;
301
+ let apiPath = '/health/queue/databases';
302
+ let payload = {};
303
+ if (typeof name !== 'undefined') {
304
+ payload['name'] = name;
305
+ }
306
+ if (typeof threshold !== 'undefined') {
307
+ payload['threshold'] = threshold;
308
+ }
309
+
310
+ let response = undefined;
311
+
312
+ response = await client.call('get', apiPath, {
313
+ }, payload);
314
+
315
+ if (parseOutput) {
316
+ parse(response)
317
+ }
318
+
319
+ return response;
320
+
321
+ }
322
+
323
+ /**
324
+ * @typedef {Object} HealthGetQueueDeletesRequestParams
325
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
326
+ * @property {boolean} overrideForCli
327
+ * @property {boolean} parseOutput
328
+ * @property {libClient | undefined} sdk
329
+ */
330
+
331
+ /**
332
+ * @param {HealthGetQueueDeletesRequestParams} params
333
+ */
334
+ const healthGetQueueDeletes = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
335
+ let client = !sdk ? await sdkForProject() :
336
+ sdk;
337
+ let apiPath = '/health/queue/deletes';
338
+ let payload = {};
339
+ if (typeof threshold !== 'undefined') {
340
+ payload['threshold'] = threshold;
341
+ }
342
+
343
+ let response = undefined;
344
+
345
+ response = await client.call('get', apiPath, {
346
+ }, payload);
347
+
348
+ if (parseOutput) {
349
+ parse(response)
350
+ }
351
+
352
+ return response;
353
+
354
+ }
355
+
356
+ /**
357
+ * @typedef {Object} HealthGetFailedJobsRequestParams
358
+ * @property {Name} name The name of the queue
359
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
360
+ * @property {boolean} overrideForCli
361
+ * @property {boolean} parseOutput
362
+ * @property {libClient | undefined} sdk
363
+ */
364
+
365
+ /**
366
+ * @param {HealthGetFailedJobsRequestParams} params
367
+ */
368
+ const healthGetFailedJobs = async ({name,threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
369
+ let client = !sdk ? await sdkForProject() :
370
+ sdk;
371
+ let apiPath = '/health/queue/failed/{name}'.replace('{name}', name);
372
+ let payload = {};
373
+ if (typeof threshold !== 'undefined') {
374
+ payload['threshold'] = threshold;
375
+ }
376
+
377
+ let response = undefined;
378
+
379
+ response = await client.call('get', apiPath, {
380
+ }, payload);
381
+
382
+ if (parseOutput) {
383
+ parse(response)
384
+ }
385
+
386
+ return response;
387
+
388
+ }
389
+
390
+ /**
391
+ * @typedef {Object} HealthGetQueueFunctionsRequestParams
392
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
393
+ * @property {boolean} overrideForCli
394
+ * @property {boolean} parseOutput
395
+ * @property {libClient | undefined} sdk
396
+ */
397
+
398
+ /**
399
+ * @param {HealthGetQueueFunctionsRequestParams} params
400
+ */
401
+ const healthGetQueueFunctions = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
402
+ let client = !sdk ? await sdkForProject() :
403
+ sdk;
404
+ let apiPath = '/health/queue/functions';
405
+ let payload = {};
406
+ if (typeof threshold !== 'undefined') {
407
+ payload['threshold'] = threshold;
408
+ }
409
+
410
+ let response = undefined;
411
+
412
+ response = await client.call('get', apiPath, {
413
+ }, payload);
414
+
415
+ if (parseOutput) {
416
+ parse(response)
417
+ }
418
+
419
+ return response;
420
+
421
+ }
422
+
423
+ /**
424
+ * @typedef {Object} HealthGetQueueLogsRequestParams
425
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
426
+ * @property {boolean} overrideForCli
427
+ * @property {boolean} parseOutput
428
+ * @property {libClient | undefined} sdk
429
+ */
430
+
431
+ /**
432
+ * @param {HealthGetQueueLogsRequestParams} params
433
+ */
434
+ const healthGetQueueLogs = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
435
+ let client = !sdk ? await sdkForProject() :
436
+ sdk;
437
+ let apiPath = '/health/queue/logs';
438
+ let payload = {};
439
+ if (typeof threshold !== 'undefined') {
440
+ payload['threshold'] = threshold;
441
+ }
442
+
443
+ let response = undefined;
444
+
445
+ response = await client.call('get', apiPath, {
446
+ }, payload);
447
+
448
+ if (parseOutput) {
449
+ parse(response)
450
+ }
451
+
452
+ return response;
453
+
454
+ }
455
+
456
+ /**
457
+ * @typedef {Object} HealthGetQueueMailsRequestParams
458
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
459
+ * @property {boolean} overrideForCli
460
+ * @property {boolean} parseOutput
461
+ * @property {libClient | undefined} sdk
462
+ */
463
+
464
+ /**
465
+ * @param {HealthGetQueueMailsRequestParams} params
466
+ */
467
+ const healthGetQueueMails = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
468
+ let client = !sdk ? await sdkForProject() :
469
+ sdk;
470
+ let apiPath = '/health/queue/mails';
471
+ let payload = {};
472
+ if (typeof threshold !== 'undefined') {
473
+ payload['threshold'] = threshold;
474
+ }
475
+
476
+ let response = undefined;
477
+
478
+ response = await client.call('get', apiPath, {
479
+ }, payload);
480
+
481
+ if (parseOutput) {
482
+ parse(response)
483
+ }
484
+
485
+ return response;
486
+
487
+ }
488
+
489
+ /**
490
+ * @typedef {Object} HealthGetQueueMessagingRequestParams
491
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
492
+ * @property {boolean} overrideForCli
493
+ * @property {boolean} parseOutput
494
+ * @property {libClient | undefined} sdk
495
+ */
496
+
497
+ /**
498
+ * @param {HealthGetQueueMessagingRequestParams} params
499
+ */
500
+ const healthGetQueueMessaging = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
501
+ let client = !sdk ? await sdkForProject() :
502
+ sdk;
503
+ let apiPath = '/health/queue/messaging';
504
+ let payload = {};
505
+ if (typeof threshold !== 'undefined') {
506
+ payload['threshold'] = threshold;
507
+ }
508
+
509
+ let response = undefined;
510
+
511
+ response = await client.call('get', apiPath, {
512
+ }, payload);
513
+
514
+ if (parseOutput) {
515
+ parse(response)
516
+ }
517
+
518
+ return response;
519
+
520
+ }
521
+
522
+ /**
523
+ * @typedef {Object} HealthGetQueueMigrationsRequestParams
524
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
525
+ * @property {boolean} overrideForCli
526
+ * @property {boolean} parseOutput
527
+ * @property {libClient | undefined} sdk
528
+ */
529
+
530
+ /**
531
+ * @param {HealthGetQueueMigrationsRequestParams} params
532
+ */
533
+ const healthGetQueueMigrations = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
534
+ let client = !sdk ? await sdkForProject() :
535
+ sdk;
536
+ let apiPath = '/health/queue/migrations';
537
+ let payload = {};
538
+ if (typeof threshold !== 'undefined') {
539
+ payload['threshold'] = threshold;
540
+ }
541
+
542
+ let response = undefined;
543
+
544
+ response = await client.call('get', apiPath, {
545
+ }, payload);
546
+
547
+ if (parseOutput) {
548
+ parse(response)
549
+ }
550
+
551
+ return response;
552
+
553
+ }
554
+
555
+ /**
556
+ * @typedef {Object} HealthGetQueueStatsResourcesRequestParams
557
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
558
+ * @property {boolean} overrideForCli
559
+ * @property {boolean} parseOutput
560
+ * @property {libClient | undefined} sdk
561
+ */
562
+
563
+ /**
564
+ * @param {HealthGetQueueStatsResourcesRequestParams} params
565
+ */
566
+ const healthGetQueueStatsResources = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
567
+ let client = !sdk ? await sdkForProject() :
568
+ sdk;
569
+ let apiPath = '/health/queue/stats-resources';
570
+ let payload = {};
571
+ if (typeof threshold !== 'undefined') {
572
+ payload['threshold'] = threshold;
573
+ }
574
+
575
+ let response = undefined;
576
+
577
+ response = await client.call('get', apiPath, {
578
+ }, payload);
579
+
580
+ if (parseOutput) {
581
+ parse(response)
582
+ }
583
+
584
+ return response;
585
+
586
+ }
587
+
588
+ /**
589
+ * @typedef {Object} HealthGetQueueUsageRequestParams
590
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
591
+ * @property {boolean} overrideForCli
592
+ * @property {boolean} parseOutput
593
+ * @property {libClient | undefined} sdk
594
+ */
595
+
596
+ /**
597
+ * @param {HealthGetQueueUsageRequestParams} params
598
+ */
599
+ const healthGetQueueUsage = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
600
+ let client = !sdk ? await sdkForProject() :
601
+ sdk;
602
+ let apiPath = '/health/queue/stats-usage';
603
+ let payload = {};
604
+ if (typeof threshold !== 'undefined') {
605
+ payload['threshold'] = threshold;
606
+ }
607
+
608
+ let response = undefined;
609
+
610
+ response = await client.call('get', apiPath, {
611
+ }, payload);
612
+
613
+ if (parseOutput) {
614
+ parse(response)
615
+ }
616
+
617
+ return response;
618
+
619
+ }
620
+
621
+ /**
622
+ * @typedef {Object} HealthGetQueueWebhooksRequestParams
623
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
624
+ * @property {boolean} overrideForCli
625
+ * @property {boolean} parseOutput
626
+ * @property {libClient | undefined} sdk
627
+ */
628
+
629
+ /**
630
+ * @param {HealthGetQueueWebhooksRequestParams} params
631
+ */
632
+ const healthGetQueueWebhooks = async ({threshold,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
633
+ let client = !sdk ? await sdkForProject() :
634
+ sdk;
635
+ let apiPath = '/health/queue/webhooks';
636
+ let payload = {};
637
+ if (typeof threshold !== 'undefined') {
638
+ payload['threshold'] = threshold;
639
+ }
640
+
641
+ let response = undefined;
642
+
643
+ response = await client.call('get', apiPath, {
644
+ }, payload);
645
+
646
+ if (parseOutput) {
647
+ parse(response)
648
+ }
649
+
650
+ return response;
651
+
652
+ }
653
+
654
+ /**
655
+ * @typedef {Object} HealthGetStorageRequestParams
656
+ * @property {boolean} overrideForCli
657
+ * @property {boolean} parseOutput
658
+ * @property {libClient | undefined} sdk
659
+ */
660
+
661
+ /**
662
+ * @param {HealthGetStorageRequestParams} params
663
+ */
664
+ const healthGetStorage = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
665
+ let client = !sdk ? await sdkForProject() :
666
+ sdk;
667
+ let apiPath = '/health/storage';
668
+ let payload = {};
669
+
670
+ let response = undefined;
671
+
672
+ response = await client.call('get', apiPath, {
673
+ }, payload);
674
+
675
+ if (parseOutput) {
676
+ parse(response)
677
+ }
678
+
679
+ return response;
680
+
681
+ }
682
+
683
+ /**
684
+ * @typedef {Object} HealthGetStorageLocalRequestParams
685
+ * @property {boolean} overrideForCli
686
+ * @property {boolean} parseOutput
687
+ * @property {libClient | undefined} sdk
688
+ */
689
+
690
+ /**
691
+ * @param {HealthGetStorageLocalRequestParams} params
692
+ */
693
+ const healthGetStorageLocal = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
694
+ let client = !sdk ? await sdkForProject() :
695
+ sdk;
696
+ let apiPath = '/health/storage/local';
697
+ let payload = {};
698
+
699
+ let response = undefined;
700
+
701
+ response = await client.call('get', apiPath, {
702
+ }, payload);
703
+
704
+ if (parseOutput) {
705
+ parse(response)
706
+ }
707
+
708
+ return response;
709
+
710
+ }
711
+
712
+ /**
713
+ * @typedef {Object} HealthGetTimeRequestParams
714
+ * @property {boolean} overrideForCli
715
+ * @property {boolean} parseOutput
716
+ * @property {libClient | undefined} sdk
717
+ */
718
+
719
+ /**
720
+ * @param {HealthGetTimeRequestParams} params
721
+ */
722
+ const healthGetTime = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
723
+ let client = !sdk ? await sdkForProject() :
724
+ sdk;
725
+ let apiPath = '/health/time';
726
+ let payload = {};
727
+
728
+ let response = undefined;
729
+
730
+ response = await client.call('get', apiPath, {
731
+ }, payload);
732
+
733
+ if (parseOutput) {
734
+ parse(response)
735
+ }
736
+
737
+ return response;
738
+
739
+ }
740
+
741
+ health
742
+ .command(`get`)
743
+ .description(`Check the Appwrite HTTP server is up and responsive.`)
744
+ .action(actionRunner(healthGet))
745
+
746
+ health
747
+ .command(`get-antivirus`)
748
+ .description(`Check the Appwrite Antivirus server is up and connection is successful.`)
749
+ .action(actionRunner(healthGetAntivirus))
750
+
751
+ health
752
+ .command(`get-cache`)
753
+ .description(`Check the Appwrite in-memory cache servers are up and connection is successful.`)
754
+ .action(actionRunner(healthGetCache))
755
+
756
+ health
757
+ .command(`get-certificate`)
758
+ .description(`Get the SSL certificate for a domain`)
759
+ .option(`--domain <domain>`, `string`)
760
+ .action(actionRunner(healthGetCertificate))
761
+
762
+ health
763
+ .command(`get-db`)
764
+ .description(`Check the Appwrite database servers are up and connection is successful.`)
765
+ .action(actionRunner(healthGetDB))
766
+
767
+ health
768
+ .command(`get-pub-sub`)
769
+ .description(`Check the Appwrite pub-sub servers are up and connection is successful.`)
770
+ .action(actionRunner(healthGetPubSub))
771
+
772
+ health
773
+ .command(`get-queue-builds`)
774
+ .description(`Get the number of builds that are waiting to be processed in the Appwrite internal queue server.`)
775
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
776
+ .action(actionRunner(healthGetQueueBuilds))
777
+
778
+ health
779
+ .command(`get-queue-certificates`)
780
+ .description(`Get the number of certificates that are waiting to be issued against [Letsencrypt](https://letsencrypt.org/) in the Appwrite internal queue server.`)
781
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
782
+ .action(actionRunner(healthGetQueueCertificates))
783
+
784
+ health
785
+ .command(`get-queue-databases`)
786
+ .description(`Get the number of database changes that are waiting to be processed in the Appwrite internal queue server.`)
787
+ .option(`--name <name>`, `Queue name for which to check the queue size`)
788
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
789
+ .action(actionRunner(healthGetQueueDatabases))
790
+
791
+ health
792
+ .command(`get-queue-deletes`)
793
+ .description(`Get the number of background destructive changes that are waiting to be processed in the Appwrite internal queue server.`)
794
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
795
+ .action(actionRunner(healthGetQueueDeletes))
796
+
797
+ health
798
+ .command(`get-failed-jobs`)
799
+ .description(`Returns the amount of failed jobs in a given queue. `)
800
+ .requiredOption(`--name <name>`, `The name of the queue`)
801
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
802
+ .action(actionRunner(healthGetFailedJobs))
803
+
804
+ health
805
+ .command(`get-queue-functions`)
806
+ .description(`Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.`)
807
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
808
+ .action(actionRunner(healthGetQueueFunctions))
809
+
810
+ health
811
+ .command(`get-queue-logs`)
812
+ .description(`Get the number of logs that are waiting to be processed in the Appwrite internal queue server.`)
813
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
814
+ .action(actionRunner(healthGetQueueLogs))
815
+
816
+ health
817
+ .command(`get-queue-mails`)
818
+ .description(`Get the number of mails that are waiting to be processed in the Appwrite internal queue server.`)
819
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
820
+ .action(actionRunner(healthGetQueueMails))
821
+
822
+ health
823
+ .command(`get-queue-messaging`)
824
+ .description(`Get the number of messages that are waiting to be processed in the Appwrite internal queue server.`)
825
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
826
+ .action(actionRunner(healthGetQueueMessaging))
827
+
828
+ health
829
+ .command(`get-queue-migrations`)
830
+ .description(`Get the number of migrations that are waiting to be processed in the Appwrite internal queue server.`)
831
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
832
+ .action(actionRunner(healthGetQueueMigrations))
833
+
834
+ health
835
+ .command(`get-queue-stats-resources`)
836
+ .description(`Get the number of metrics that are waiting to be processed in the Appwrite stats resources queue.`)
837
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
838
+ .action(actionRunner(healthGetQueueStatsResources))
839
+
840
+ health
841
+ .command(`get-queue-usage`)
842
+ .description(`Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.`)
843
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
844
+ .action(actionRunner(healthGetQueueUsage))
845
+
846
+ health
847
+ .command(`get-queue-webhooks`)
848
+ .description(`Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.`)
849
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
850
+ .action(actionRunner(healthGetQueueWebhooks))
851
+
852
+ health
853
+ .command(`get-storage`)
854
+ .description(`Check the Appwrite storage device is up and connection is successful.`)
855
+ .action(actionRunner(healthGetStorage))
856
+
857
+ health
858
+ .command(`get-storage-local`)
859
+ .description(`Check the Appwrite local storage device is up and connection is successful.`)
860
+ .action(actionRunner(healthGetStorageLocal))
861
+
862
+ health
863
+ .command(`get-time`)
864
+ .description(`Check the Appwrite server time is synced with Google remote NTP server. We use this technology to smoothly handle leap seconds with no disruptive events. The [Network Time Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is used by hundreds of millions of computers and devices to synchronize their clocks over the Internet. If your computer sets its own clock, it likely uses NTP.`)
865
+ .action(actionRunner(healthGetTime))
866
+
867
+ module.exports = {
868
+ health,
869
+ healthGet,
870
+ healthGetAntivirus,
871
+ healthGetCache,
872
+ healthGetCertificate,
873
+ healthGetDB,
874
+ healthGetPubSub,
875
+ healthGetQueueBuilds,
876
+ healthGetQueueCertificates,
877
+ healthGetQueueDatabases,
878
+ healthGetQueueDeletes,
879
+ healthGetFailedJobs,
880
+ healthGetQueueFunctions,
881
+ healthGetQueueLogs,
882
+ healthGetQueueMails,
883
+ healthGetQueueMessaging,
884
+ healthGetQueueMigrations,
885
+ healthGetQueueStatsResources,
886
+ healthGetQueueUsage,
887
+ healthGetQueueWebhooks,
888
+ healthGetStorage,
889
+ healthGetStorageLocal,
890
+ healthGetTime
891
+ };