appwrite-cli 4.2.2 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/.github/workflows/npm-publish.yml +1 -1
  2. package/README.md +6 -9
  3. package/docs/examples/account/{create-email-session.md → create-email-password-session.md} +1 -1
  4. package/docs/examples/account/create-email-token.md +4 -0
  5. package/docs/examples/account/create-magic-u-r-l-token.md +5 -0
  6. package/docs/examples/account/create-mfa-authenticator.md +2 -0
  7. package/docs/examples/account/create-mfa-challenge.md +2 -0
  8. package/docs/examples/account/create-mfa-recovery-codes.md +1 -0
  9. package/docs/examples/account/create-o-auth2token.md +5 -0
  10. package/docs/examples/account/create-phone-token.md +3 -0
  11. package/docs/examples/account/create-push-target.md +4 -0
  12. package/docs/examples/account/create-session.md +3 -0
  13. package/docs/examples/account/create.md +1 -1
  14. package/docs/examples/account/delete-identity.md +1 -1
  15. package/docs/examples/account/delete-mfa-authenticator.md +3 -0
  16. package/docs/examples/account/delete-push-target.md +2 -0
  17. package/docs/examples/account/delete-session.md +1 -1
  18. package/docs/examples/account/delete.md +1 -0
  19. package/docs/examples/account/get-mfa-recovery-codes.md +1 -0
  20. package/docs/examples/account/get-session.md +1 -1
  21. package/docs/examples/account/list-mfa-factors.md +1 -0
  22. package/docs/examples/account/update-m-f-a.md +2 -0
  23. package/docs/examples/account/update-magic-u-r-l-session.md +2 -2
  24. package/docs/examples/account/update-mfa-authenticator.md +3 -0
  25. package/docs/examples/account/update-mfa-challenge.md +3 -0
  26. package/docs/examples/account/update-mfa-recovery-codes.md +1 -0
  27. package/docs/examples/account/update-name.md +1 -1
  28. package/docs/examples/account/update-phone-session.md +2 -2
  29. package/docs/examples/account/update-phone-verification.md +2 -2
  30. package/docs/examples/account/update-push-target.md +3 -0
  31. package/docs/examples/account/update-recovery.md +3 -4
  32. package/docs/examples/account/update-session.md +1 -1
  33. package/docs/examples/account/update-verification.md +2 -2
  34. package/docs/examples/assistant/chat.md +1 -1
  35. package/docs/examples/avatars/get-q-r.md +1 -1
  36. package/docs/examples/databases/create-boolean-attribute.md +2 -2
  37. package/docs/examples/databases/create-collection.md +3 -3
  38. package/docs/examples/databases/create-datetime-attribute.md +2 -2
  39. package/docs/examples/databases/create-document.md +3 -3
  40. package/docs/examples/databases/create-email-attribute.md +2 -2
  41. package/docs/examples/databases/create-enum-attribute.md +2 -2
  42. package/docs/examples/databases/create-float-attribute.md +2 -2
  43. package/docs/examples/databases/create-index.md +2 -2
  44. package/docs/examples/databases/create-integer-attribute.md +2 -2
  45. package/docs/examples/databases/create-ip-attribute.md +2 -2
  46. package/docs/examples/databases/create-relationship-attribute.md +3 -3
  47. package/docs/examples/databases/create-string-attribute.md +2 -2
  48. package/docs/examples/databases/create-url-attribute.md +2 -2
  49. package/docs/examples/databases/create.md +2 -2
  50. package/docs/examples/databases/delete-attribute.md +2 -2
  51. package/docs/examples/databases/delete-collection.md +2 -2
  52. package/docs/examples/databases/delete-document.md +3 -3
  53. package/docs/examples/databases/delete-index.md +2 -2
  54. package/docs/examples/databases/delete.md +1 -1
  55. package/docs/examples/databases/get-attribute.md +2 -2
  56. package/docs/examples/databases/get-collection-usage.md +2 -2
  57. package/docs/examples/databases/get-collection.md +2 -2
  58. package/docs/examples/databases/get-database-usage.md +1 -1
  59. package/docs/examples/databases/get-document.md +3 -3
  60. package/docs/examples/databases/get-index.md +2 -2
  61. package/docs/examples/databases/get.md +1 -1
  62. package/docs/examples/databases/list-attributes.md +2 -2
  63. package/docs/examples/databases/list-collection-logs.md +2 -2
  64. package/docs/examples/databases/list-collections.md +1 -1
  65. package/docs/examples/databases/list-document-logs.md +3 -3
  66. package/docs/examples/databases/list-documents.md +2 -2
  67. package/docs/examples/databases/list-indexes.md +2 -2
  68. package/docs/examples/databases/list-logs.md +1 -1
  69. package/docs/examples/databases/update-boolean-attribute.md +2 -2
  70. package/docs/examples/databases/update-collection.md +3 -3
  71. package/docs/examples/databases/update-datetime-attribute.md +2 -2
  72. package/docs/examples/databases/update-document.md +3 -3
  73. package/docs/examples/databases/update-email-attribute.md +2 -2
  74. package/docs/examples/databases/update-enum-attribute.md +3 -3
  75. package/docs/examples/databases/update-float-attribute.md +2 -2
  76. package/docs/examples/databases/update-integer-attribute.md +2 -2
  77. package/docs/examples/databases/update-ip-attribute.md +2 -2
  78. package/docs/examples/databases/update-relationship-attribute.md +2 -2
  79. package/docs/examples/databases/update-string-attribute.md +3 -3
  80. package/docs/examples/databases/update-url-attribute.md +2 -2
  81. package/docs/examples/databases/update.md +2 -2
  82. package/docs/examples/functions/create-build.md +3 -3
  83. package/docs/examples/functions/create-deployment.md +1 -1
  84. package/docs/examples/functions/create-execution.md +1 -1
  85. package/docs/examples/functions/create-variable.md +3 -3
  86. package/docs/examples/functions/create.md +3 -3
  87. package/docs/examples/functions/delete-deployment.md +2 -2
  88. package/docs/examples/functions/delete-variable.md +2 -2
  89. package/docs/examples/functions/delete.md +1 -1
  90. package/docs/examples/functions/download-deployment.md +2 -2
  91. package/docs/examples/functions/get-deployment.md +2 -2
  92. package/docs/examples/functions/get-execution.md +2 -2
  93. package/docs/examples/functions/get-function-usage.md +1 -1
  94. package/docs/examples/functions/get-variable.md +2 -2
  95. package/docs/examples/functions/get.md +1 -1
  96. package/docs/examples/functions/list-deployments.md +1 -1
  97. package/docs/examples/functions/list-executions.md +1 -1
  98. package/docs/examples/functions/list-variables.md +1 -1
  99. package/docs/examples/functions/update-deployment.md +2 -2
  100. package/docs/examples/functions/update-variable.md +3 -3
  101. package/docs/examples/functions/update.md +2 -2
  102. package/docs/examples/health/get-certificate.md +2 -0
  103. package/docs/examples/health/get-failed-jobs.md +3 -0
  104. package/docs/examples/health/get-queue-usage-dump.md +2 -0
  105. package/docs/examples/health/get-queue-usage.md +2 -0
  106. package/docs/examples/health/get-storage.md +1 -0
  107. package/docs/examples/messaging/create-apns-provider.md +9 -0
  108. package/docs/examples/messaging/create-email.md +13 -0
  109. package/docs/examples/messaging/create-fcm-provider.md +5 -0
  110. package/docs/examples/messaging/create-mailgun-provider.md +11 -0
  111. package/docs/examples/messaging/create-msg91provider.md +7 -0
  112. package/docs/examples/messaging/create-push.md +17 -0
  113. package/docs/examples/messaging/create-sendgrid-provider.md +9 -0
  114. package/docs/examples/messaging/create-sms.md +8 -0
  115. package/docs/examples/messaging/create-smtp-provider.md +15 -0
  116. package/docs/examples/messaging/create-subscriber.md +4 -0
  117. package/docs/examples/messaging/create-telesign-provider.md +7 -0
  118. package/docs/examples/messaging/create-textmagic-provider.md +7 -0
  119. package/docs/examples/messaging/create-topic.md +4 -0
  120. package/docs/examples/messaging/create-twilio-provider.md +7 -0
  121. package/docs/examples/messaging/create-vonage-provider.md +7 -0
  122. package/docs/examples/messaging/delete-provider.md +2 -0
  123. package/docs/examples/messaging/delete-subscriber.md +3 -0
  124. package/docs/examples/messaging/delete-topic.md +2 -0
  125. package/docs/examples/messaging/delete.md +2 -0
  126. package/docs/examples/messaging/get-message.md +2 -0
  127. package/docs/examples/messaging/get-provider.md +2 -0
  128. package/docs/examples/messaging/get-subscriber.md +3 -0
  129. package/docs/examples/messaging/get-topic.md +2 -0
  130. package/docs/examples/messaging/list-message-logs.md +3 -0
  131. package/docs/examples/messaging/list-messages.md +3 -0
  132. package/docs/examples/messaging/list-provider-logs.md +3 -0
  133. package/docs/examples/messaging/list-providers.md +3 -0
  134. package/docs/examples/messaging/list-subscriber-logs.md +3 -0
  135. package/docs/examples/messaging/list-subscribers.md +4 -0
  136. package/docs/examples/messaging/list-targets.md +3 -0
  137. package/docs/examples/messaging/list-topic-logs.md +3 -0
  138. package/docs/examples/messaging/list-topics.md +3 -0
  139. package/docs/examples/messaging/update-apns-provider.md +9 -0
  140. package/docs/examples/messaging/update-email.md +12 -0
  141. package/docs/examples/messaging/update-fcm-provider.md +5 -0
  142. package/docs/examples/messaging/update-mailgun-provider.md +11 -0
  143. package/docs/examples/messaging/update-msg91provider.md +7 -0
  144. package/docs/examples/messaging/update-push.md +17 -0
  145. package/docs/examples/messaging/update-sendgrid-provider.md +9 -0
  146. package/docs/examples/messaging/update-sms.md +8 -0
  147. package/docs/examples/messaging/update-smtp-provider.md +15 -0
  148. package/docs/examples/messaging/update-telesign-provider.md +7 -0
  149. package/docs/examples/messaging/update-textmagic-provider.md +7 -0
  150. package/docs/examples/messaging/update-topic.md +4 -0
  151. package/docs/examples/messaging/update-twilio-provider.md +7 -0
  152. package/docs/examples/messaging/update-vonage-provider.md +7 -0
  153. package/docs/examples/migrations/create-appwrite-migration.md +2 -2
  154. package/docs/examples/migrations/create-firebase-migration.md +1 -1
  155. package/docs/examples/migrations/create-firebase-o-auth-migration.md +1 -1
  156. package/docs/examples/migrations/create-n-host-migration.md +6 -6
  157. package/docs/examples/migrations/create-supabase-migration.md +4 -4
  158. package/docs/examples/migrations/delete.md +1 -1
  159. package/docs/examples/migrations/get-appwrite-report.md +2 -2
  160. package/docs/examples/migrations/get-firebase-report-o-auth.md +1 -1
  161. package/docs/examples/migrations/get-firebase-report.md +1 -1
  162. package/docs/examples/migrations/get-n-host-report.md +6 -6
  163. package/docs/examples/migrations/get-supabase-report.md +4 -4
  164. package/docs/examples/migrations/get.md +1 -1
  165. package/docs/examples/migrations/retry.md +1 -1
  166. package/docs/examples/project/create-variable.md +2 -2
  167. package/docs/examples/project/delete-variable.md +1 -1
  168. package/docs/examples/project/get-usage.md +2 -0
  169. package/docs/examples/project/get-variable.md +1 -1
  170. package/docs/examples/project/update-variable.md +2 -2
  171. package/docs/examples/projects/create-key.md +2 -2
  172. package/docs/examples/projects/create-platform.md +2 -2
  173. package/docs/examples/projects/create-smtp-test.md +11 -0
  174. package/docs/examples/projects/create-webhook.md +4 -3
  175. package/docs/examples/projects/create.md +2 -2
  176. package/docs/examples/projects/delete-email-template.md +1 -1
  177. package/docs/examples/projects/delete-key.md +2 -2
  178. package/docs/examples/projects/delete-platform.md +2 -2
  179. package/docs/examples/projects/delete-sms-template.md +1 -1
  180. package/docs/examples/projects/delete-webhook.md +2 -2
  181. package/docs/examples/projects/delete.md +1 -1
  182. package/docs/examples/projects/get-email-template.md +1 -1
  183. package/docs/examples/projects/get-key.md +2 -2
  184. package/docs/examples/projects/get-platform.md +2 -2
  185. package/docs/examples/projects/get-sms-template.md +1 -1
  186. package/docs/examples/projects/get-webhook.md +2 -2
  187. package/docs/examples/projects/get.md +1 -1
  188. package/docs/examples/projects/list-keys.md +1 -1
  189. package/docs/examples/projects/list-platforms.md +1 -1
  190. package/docs/examples/projects/list-webhooks.md +1 -1
  191. package/docs/examples/projects/update-api-status-all.md +3 -0
  192. package/docs/examples/projects/update-api-status.md +4 -0
  193. package/docs/examples/projects/update-auth-duration.md +1 -1
  194. package/docs/examples/projects/update-auth-limit.md +1 -1
  195. package/docs/examples/projects/update-auth-password-dictionary.md +1 -1
  196. package/docs/examples/projects/update-auth-password-history.md +1 -1
  197. package/docs/examples/projects/update-auth-sessions-limit.md +1 -1
  198. package/docs/examples/projects/update-auth-status.md +1 -1
  199. package/docs/examples/projects/update-email-template.md +3 -3
  200. package/docs/examples/projects/update-key.md +3 -3
  201. package/docs/examples/projects/update-o-auth2.md +1 -1
  202. package/docs/examples/projects/update-personal-data-check.md +1 -1
  203. package/docs/examples/projects/update-platform.md +3 -3
  204. package/docs/examples/projects/update-service-status-all.md +1 -1
  205. package/docs/examples/projects/update-service-status.md +1 -1
  206. package/docs/examples/projects/update-sms-template.md +2 -2
  207. package/docs/examples/projects/update-smtp.md +11 -0
  208. package/docs/examples/projects/update-team.md +2 -2
  209. package/docs/examples/projects/update-webhook-signature.md +2 -2
  210. package/docs/examples/projects/update-webhook.md +5 -4
  211. package/docs/examples/projects/update.md +2 -2
  212. package/docs/examples/proxy/delete-rule.md +1 -1
  213. package/docs/examples/proxy/get-rule.md +1 -1
  214. package/docs/examples/proxy/update-rule-verification.md +1 -1
  215. package/docs/examples/storage/create-bucket.md +2 -2
  216. package/docs/examples/storage/create-file.md +2 -2
  217. package/docs/examples/storage/delete-bucket.md +1 -1
  218. package/docs/examples/storage/delete-file.md +2 -2
  219. package/docs/examples/storage/get-bucket-usage.md +1 -1
  220. package/docs/examples/storage/get-bucket.md +1 -1
  221. package/docs/examples/storage/get-file-download.md +2 -2
  222. package/docs/examples/storage/get-file-preview.md +2 -2
  223. package/docs/examples/storage/get-file-view.md +2 -2
  224. package/docs/examples/storage/get-file.md +2 -2
  225. package/docs/examples/storage/list-files.md +1 -1
  226. package/docs/examples/storage/update-bucket.md +2 -2
  227. package/docs/examples/storage/update-file.md +2 -2
  228. package/docs/examples/teams/create-membership.md +1 -1
  229. package/docs/examples/teams/create.md +2 -2
  230. package/docs/examples/teams/delete-membership.md +2 -2
  231. package/docs/examples/teams/delete.md +1 -1
  232. package/docs/examples/teams/get-membership.md +2 -2
  233. package/docs/examples/teams/get-prefs.md +1 -1
  234. package/docs/examples/teams/get.md +1 -1
  235. package/docs/examples/teams/list-logs.md +1 -1
  236. package/docs/examples/teams/list-memberships.md +1 -1
  237. package/docs/examples/teams/update-membership-status.md +4 -4
  238. package/docs/examples/teams/update-membership.md +2 -2
  239. package/docs/examples/teams/update-name.md +2 -2
  240. package/docs/examples/teams/update-prefs.md +1 -1
  241. package/docs/examples/users/create-argon2user.md +1 -1
  242. package/docs/examples/users/create-bcrypt-user.md +1 -1
  243. package/docs/examples/users/create-m-d5user.md +1 -1
  244. package/docs/examples/users/create-mfa-recovery-codes.md +2 -0
  245. package/docs/examples/users/create-p-h-pass-user.md +1 -1
  246. package/docs/examples/users/create-s-h-a-user.md +1 -1
  247. package/docs/examples/users/create-scrypt-modified-user.md +4 -4
  248. package/docs/examples/users/create-scrypt-user.md +2 -2
  249. package/docs/examples/users/create-session.md +2 -0
  250. package/docs/examples/users/create-target.md +7 -0
  251. package/docs/examples/users/create-token.md +4 -0
  252. package/docs/examples/users/create.md +1 -1
  253. package/docs/examples/users/delete-identity.md +1 -1
  254. package/docs/examples/users/delete-mfa-authenticator.md +3 -0
  255. package/docs/examples/users/delete-session.md +2 -2
  256. package/docs/examples/users/delete-sessions.md +1 -1
  257. package/docs/examples/users/delete-target.md +3 -0
  258. package/docs/examples/users/delete.md +1 -1
  259. package/docs/examples/users/get-mfa-recovery-codes.md +2 -0
  260. package/docs/examples/users/get-prefs.md +1 -1
  261. package/docs/examples/users/get-target.md +3 -0
  262. package/docs/examples/users/get-usage.md +0 -1
  263. package/docs/examples/users/get.md +1 -1
  264. package/docs/examples/users/list-logs.md +1 -1
  265. package/docs/examples/users/list-memberships.md +1 -1
  266. package/docs/examples/users/list-mfa-factors.md +2 -0
  267. package/docs/examples/users/list-sessions.md +1 -1
  268. package/docs/examples/users/list-targets.md +3 -0
  269. package/docs/examples/users/update-email-verification.md +1 -1
  270. package/docs/examples/users/update-email.md +1 -1
  271. package/docs/examples/users/update-labels.md +1 -1
  272. package/docs/examples/users/update-mfa-recovery-codes.md +2 -0
  273. package/docs/examples/users/update-mfa.md +3 -0
  274. package/docs/examples/users/update-name.md +2 -2
  275. package/docs/examples/users/update-password.md +1 -1
  276. package/docs/examples/users/update-phone-verification.md +1 -1
  277. package/docs/examples/users/update-phone.md +1 -1
  278. package/docs/examples/users/update-prefs.md +1 -1
  279. package/docs/examples/users/update-status.md +1 -1
  280. package/docs/examples/users/update-target.md +6 -0
  281. package/docs/examples/vcs/create-repository-detection.md +2 -2
  282. package/docs/examples/vcs/create-repository.md +2 -2
  283. package/docs/examples/vcs/delete-installation.md +1 -1
  284. package/docs/examples/vcs/get-installation.md +1 -1
  285. package/docs/examples/vcs/get-repository.md +2 -2
  286. package/docs/examples/vcs/list-repositories.md +1 -1
  287. package/docs/examples/vcs/list-repository-branches.md +2 -2
  288. package/docs/examples/vcs/update-external-deployments.md +3 -3
  289. package/index.js +2 -0
  290. package/install.ps1 +2 -2
  291. package/install.sh +1 -1
  292. package/lib/client.js +4 -4
  293. package/lib/commands/account.js +906 -226
  294. package/lib/commands/avatars.js +3 -3
  295. package/lib/commands/databases.js +22 -22
  296. package/lib/commands/deploy.js +45 -6
  297. package/lib/commands/functions.js +5 -5
  298. package/lib/commands/health.js +193 -1
  299. package/lib/commands/messaging.js +2815 -0
  300. package/lib/commands/migrations.js +2 -2
  301. package/lib/commands/project.js +15 -5
  302. package/lib/commands/projects.js +210 -72
  303. package/lib/commands/proxy.js +1 -1
  304. package/lib/commands/storage.js +6 -6
  305. package/lib/commands/teams.js +2 -2
  306. package/lib/commands/users.js +545 -14
  307. package/lib/paginate.js +2 -2
  308. package/lib/parser.js +1 -0
  309. package/package.json +1 -1
  310. package/scoop/appwrite.json +3 -3
  311. package/docs/examples/account/create-magic-u-r-l-session.md +0 -4
  312. package/docs/examples/account/create-phone-session.md +0 -3
  313. package/docs/examples/projects/get-usage.md +0 -3
  314. package/docs/examples/projects/update-smtp-configuration.md +0 -11
@@ -41,7 +41,7 @@ const avatars = new Command("avatars").description(commandDescriptions['avatars'
41
41
 
42
42
  /**
43
43
  * @typedef {Object} AvatarsGetBrowserRequestParams
44
- * @property {string} code Browser Code.
44
+ * @property {Browser} code Browser Code.
45
45
  * @property {number} width Image width. Pass an integer between 0 to 2000. Defaults to 100.
46
46
  * @property {number} height Image height. Pass an integer between 0 to 2000. Defaults to 100.
47
47
  * @property {number} quality Image quality. Pass an integer between 0 to 100. Defaults to 100.
@@ -89,7 +89,7 @@ const avatarsGetBrowser = async ({ code, width, height, quality, parseOutput = t
89
89
 
90
90
  /**
91
91
  * @typedef {Object} AvatarsGetCreditCardRequestParams
92
- * @property {string} code Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.
92
+ * @property {CreditCard} code Credit Card Code. Possible values: amex, argencard, cabal, censosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, union-china-pay, visa, mir, maestro.
93
93
  * @property {number} width Image width. Pass an integer between 0 to 2000. Defaults to 100.
94
94
  * @property {number} height Image height. Pass an integer between 0 to 2000. Defaults to 100.
95
95
  * @property {number} quality Image quality. Pass an integer between 0 to 100. Defaults to 100.
@@ -176,7 +176,7 @@ const avatarsGetFavicon = async ({ url, parseOutput = true, sdk = undefined, des
176
176
 
177
177
  /**
178
178
  * @typedef {Object} AvatarsGetFlagRequestParams
179
- * @property {string} code Country Code. ISO Alpha-2 country code format.
179
+ * @property {Flag} code Country Code. ISO Alpha-2 country code format.
180
180
  * @property {number} width Image width. Pass an integer between 0 to 2000. Defaults to 100.
181
181
  * @property {number} height Image height. Pass an integer between 0 to 2000. Defaults to 100.
182
182
  * @property {number} quality Image quality. Pass an integer between 0 to 100. Defaults to 100.
@@ -117,7 +117,7 @@ const databasesCreate = async ({ databaseId, name, enabled, parseOutput = true,
117
117
 
118
118
  /**
119
119
  * @typedef {Object} DatabasesGetUsageRequestParams
120
- * @property {string} range 'Date range.
120
+ * @property {DatabaseUsageRange} range 'Date range.
121
121
  * @property {boolean} parseOutput
122
122
  * @property {libClient | undefined} sdk
123
123
  */
@@ -561,7 +561,7 @@ const databasesUpdateBooleanAttribute = async ({ databaseId, collectionId, key,
561
561
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
562
562
  * @property {string} key Attribute Key.
563
563
  * @property {boolean} required Is attribute required?
564
- * @property {string} xdefault Default value for the attribute in ISO 8601 format. Cannot be set when attribute is required.
564
+ * @property {string} xdefault Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.
565
565
  * @property {boolean} array Is attribute an array?
566
566
  * @property {boolean} parseOutput
567
567
  * @property {libClient | undefined} sdk
@@ -1112,11 +1112,11 @@ const databasesUpdateIpAttribute = async ({ databaseId, collectionId, key, requi
1112
1112
  * @property {string} databaseId Database ID.
1113
1113
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1114
1114
  * @property {string} relatedCollectionId Related Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1115
- * @property {string} type Relation type
1115
+ * @property {RelationshipType} type Relation type
1116
1116
  * @property {boolean} twoWay Is Two Way?
1117
1117
  * @property {string} key Attribute Key.
1118
1118
  * @property {string} twoWayKey Two Way Attribute Key.
1119
- * @property {string} onDelete Constraints option
1119
+ * @property {RelationMutate} onDelete Constraints option
1120
1120
  * @property {boolean} parseOutput
1121
1121
  * @property {libClient | undefined} sdk
1122
1122
  */
@@ -1406,7 +1406,7 @@ const databasesDeleteAttribute = async ({ databaseId, collectionId, key, parseOu
1406
1406
  * @property {string} databaseId Database ID.
1407
1407
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1408
1408
  * @property {string} key Attribute Key.
1409
- * @property {string} onDelete Constraints option
1409
+ * @property {RelationMutate} onDelete Constraints option
1410
1410
  * @property {boolean} parseOutput
1411
1411
  * @property {libClient | undefined} sdk
1412
1412
  */
@@ -1518,7 +1518,7 @@ const databasesCreateDocument = async ({ databaseId, collectionId, documentId, d
1518
1518
  * @property {string} databaseId Database ID.
1519
1519
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1520
1520
  * @property {string} documentId Document ID.
1521
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only method allowed is select.
1521
+ * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.
1522
1522
  * @property {boolean} parseOutput
1523
1523
  * @property {libClient | undefined} sdk
1524
1524
  */
@@ -1693,7 +1693,7 @@ const databasesListIndexes = async ({ databaseId, collectionId, queries, parseOu
1693
1693
  * @property {string} databaseId Database ID.
1694
1694
  * @property {string} collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
1695
1695
  * @property {string} key Index Key.
1696
- * @property {string} type Index type.
1696
+ * @property {IndexType} type Index type.
1697
1697
  * @property {string[]} attributes Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
1698
1698
  * @property {string[]} orders Array of index orders. Maximum of 100 orders are allowed.
1699
1699
  * @property {boolean} parseOutput
@@ -1836,7 +1836,7 @@ const databasesListCollectionLogs = async ({ databaseId, collectionId, queries,
1836
1836
  * @typedef {Object} DatabasesGetCollectionUsageRequestParams
1837
1837
  * @property {string} databaseId Database ID.
1838
1838
  * @property {string} collectionId Collection ID.
1839
- * @property {string} range Date range.
1839
+ * @property {DatabaseUsageRange} range Date range.
1840
1840
  * @property {boolean} parseOutput
1841
1841
  * @property {libClient | undefined} sdk
1842
1842
  */
@@ -1902,7 +1902,7 @@ const databasesListLogs = async ({ databaseId, queries, parseOutput = true, sdk
1902
1902
  /**
1903
1903
  * @typedef {Object} DatabasesGetDatabaseUsageRequestParams
1904
1904
  * @property {string} databaseId Database ID.
1905
- * @property {string} range 'Date range.
1905
+ * @property {DatabaseUsageRange} range 'Date range.
1906
1906
  * @property {boolean} parseOutput
1907
1907
  * @property {libClient | undefined} sdk
1908
1908
  */
@@ -2019,7 +2019,7 @@ databases
2019
2019
 
2020
2020
  databases
2021
2021
  .command(`listAttributes`)
2022
- .description(``)
2022
+ .description(`List attributes in the collection.`)
2023
2023
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2024
2024
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2025
2025
  .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error`)
@@ -2038,7 +2038,7 @@ databases
2038
2038
 
2039
2039
  databases
2040
2040
  .command(`updateBooleanAttribute`)
2041
- .description(``)
2041
+ .description(`Update a boolean attribute. Changing the 'default' value will not update already existing documents.`)
2042
2042
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2043
2043
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2044
2044
  .requiredOption(`--key <key>`, `Attribute Key.`)
@@ -2048,18 +2048,18 @@ databases
2048
2048
 
2049
2049
  databases
2050
2050
  .command(`createDatetimeAttribute`)
2051
- .description(``)
2051
+ .description(`Create a date time attribute according to the ISO 8601 standard.`)
2052
2052
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2053
2053
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2054
2054
  .requiredOption(`--key <key>`, `Attribute Key.`)
2055
2055
  .requiredOption(`--required <required>`, `Is attribute required?`, parseBool)
2056
- .option(`--xdefault <xdefault>`, `Default value for the attribute in ISO 8601 format. Cannot be set when attribute is required.`)
2056
+ .option(`--xdefault <xdefault>`, `Default value for the attribute in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Cannot be set when attribute is required.`)
2057
2057
  .option(`--array <array>`, `Is attribute an array?`, parseBool)
2058
2058
  .action(actionRunner(databasesCreateDatetimeAttribute))
2059
2059
 
2060
2060
  databases
2061
2061
  .command(`updateDatetimeAttribute`)
2062
- .description(``)
2062
+ .description(`Update a date time attribute. Changing the 'default' value will not update already existing documents.`)
2063
2063
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2064
2064
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2065
2065
  .requiredOption(`--key <key>`, `Attribute Key.`)
@@ -2090,7 +2090,7 @@ databases
2090
2090
 
2091
2091
  databases
2092
2092
  .command(`createEnumAttribute`)
2093
- .description(``)
2093
+ .description(`Create an enumeration attribute. The 'elements' param acts as a white-list of accepted values for this attribute. `)
2094
2094
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2095
2095
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2096
2096
  .requiredOption(`--key <key>`, `Attribute Key.`)
@@ -2241,7 +2241,7 @@ databases
2241
2241
 
2242
2242
  databases
2243
2243
  .command(`getAttribute`)
2244
- .description(``)
2244
+ .description(`Get attribute by ID.`)
2245
2245
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2246
2246
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2247
2247
  .requiredOption(`--key <key>`, `Attribute Key.`)
@@ -2249,7 +2249,7 @@ databases
2249
2249
 
2250
2250
  databases
2251
2251
  .command(`deleteAttribute`)
2252
- .description(``)
2252
+ .description(`Deletes an attribute.`)
2253
2253
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2254
2254
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2255
2255
  .requiredOption(`--key <key>`, `Attribute Key.`)
@@ -2288,7 +2288,7 @@ databases
2288
2288
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2289
2289
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2290
2290
  .requiredOption(`--documentId <documentId>`, `Document ID.`)
2291
- .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Only method allowed is select.`)
2291
+ .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long.`)
2292
2292
  .action(actionRunner(databasesGetDocument))
2293
2293
 
2294
2294
  databases
@@ -2320,7 +2320,7 @@ databases
2320
2320
 
2321
2321
  databases
2322
2322
  .command(`listIndexes`)
2323
- .description(``)
2323
+ .description(`List indexes in the collection.`)
2324
2324
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2325
2325
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2326
2326
  .option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error`)
@@ -2328,7 +2328,7 @@ databases
2328
2328
 
2329
2329
  databases
2330
2330
  .command(`createIndex`)
2331
- .description(``)
2331
+ .description(`Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request. Attributes can be 'key', 'fulltext', and 'unique'.`)
2332
2332
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2333
2333
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2334
2334
  .requiredOption(`--key <key>`, `Index Key.`)
@@ -2339,7 +2339,7 @@ databases
2339
2339
 
2340
2340
  databases
2341
2341
  .command(`getIndex`)
2342
- .description(``)
2342
+ .description(`Get index by ID.`)
2343
2343
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2344
2344
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2345
2345
  .requiredOption(`--key <key>`, `Index Key.`)
@@ -2347,7 +2347,7 @@ databases
2347
2347
 
2348
2348
  databases
2349
2349
  .command(`deleteIndex`)
2350
- .description(``)
2350
+ .description(`Delete an index.`)
2351
2351
  .requiredOption(`--databaseId <databaseId>`, `Database ID.`)
2352
2352
  .requiredOption(`--collectionId <collectionId>`, `Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).`)
2353
2353
  .requiredOption(`--key <key>`, `Index Key.`)
@@ -52,7 +52,7 @@ const awaitPools = {
52
52
  const { total } = await databasesListAttributes({
53
53
  databaseId,
54
54
  collectionId,
55
- queries: ['limit(1)'],
55
+ queries: [JSON.stringify({ method: 'limit', values: [1] })],
56
56
  parseOutput: false
57
57
  });
58
58
 
@@ -83,7 +83,7 @@ const awaitPools = {
83
83
  const { total } = await databasesListIndexes({
84
84
  databaseId,
85
85
  collectionId,
86
- queries: ['limit(100)'],
86
+ queries: [JSON.stringify({ method: 'limit', values: [1] })],
87
87
  parseOutput: false
88
88
  });
89
89
 
@@ -106,6 +106,35 @@ const awaitPools = {
106
106
  iteration + 1
107
107
  );
108
108
  },
109
+ wipeVariables: async (functionId, iteration = 1) => {
110
+ if (iteration > poolMaxDebounces) {
111
+ return false;
112
+ }
113
+
114
+ const { total } = await functionsListVariables({
115
+ functionId,
116
+ queries: ['limit(1)'],
117
+ parseOutput: false
118
+ });
119
+
120
+ if (total === 0) {
121
+ return true;
122
+ }
123
+
124
+ let steps = Math.max(1, Math.ceil(total / STEP_SIZE));
125
+ if (steps > 1 && iteration === 1) {
126
+ poolMaxDebounces *= steps;
127
+
128
+ log('Found a large number of variables, increasing timeout to ' + (poolMaxDebounces * POOL_DEBOUNCE / 1000 / 60) + ' minutes')
129
+ }
130
+
131
+ await new Promise(resolve => setTimeout(resolve, POOL_DEBOUNCE));
132
+
133
+ return await awaitPools.wipeVariables(
134
+ functionId,
135
+ iteration + 1
136
+ );
137
+ },
109
138
  expectAttributes: async (databaseId, collectionId, attributeKeys, iteration = 1) => {
110
139
  if (iteration > poolMaxDebounces) {
111
140
  return false;
@@ -302,7 +331,7 @@ const deployFunction = async ({ functionId, all, yes } = {}) => {
302
331
 
303
332
  const { total } = await functionsListVariables({
304
333
  functionId: func['$id'],
305
- queries: ['limit(1)'],
334
+ queries: [JSON.stringify({ method: 'limit', values: [1] })],
306
335
  parseOutput: false
307
336
  });
308
337
 
@@ -310,7 +339,7 @@ const deployFunction = async ({ functionId, all, yes } = {}) => {
310
339
 
311
340
  if (total === 0) {
312
341
  deployVariables = true;
313
- } else if (remoteVariables.length > 0 && !yes) {
342
+ } else if (total > 0 && !yes) {
314
343
  const variableAnswers = await inquirer.prompt(questionsDeployFunctions[1])
315
344
  deployVariables = variableAnswers.override.toLowerCase() === "yes";
316
345
  }
@@ -320,13 +349,23 @@ const deployFunction = async ({ functionId, all, yes } = {}) => {
320
349
  } else {
321
350
  log(`Deploying variables for ${func.name} ( ${func['$id']} )`);
322
351
 
323
- await Promise.all(remoteVariables.map(async remoteVariable => {
352
+ const { variables } = await paginate(functionsListVariables, {
353
+ functionId: func['$id'],
354
+ parseOutput: false
355
+ }, 100, 'variables');
356
+
357
+ await Promise.all(variables.map(async variable => {
324
358
  await functionsDeleteVariable({
325
359
  functionId: func['$id'],
326
- variableId: remoteVariable['$id'],
360
+ variableId: variable['$id'],
327
361
  parseOutput: false
328
362
  });
329
363
  }));
364
+
365
+ let result = await awaitPools.wipeVariables(func['$id']);
366
+ if (!result) {
367
+ throw new Error("Variable deletion timed out.");
368
+ }
330
369
 
331
370
  // Deploy local variables
332
371
  await Promise.all(Object.keys(func.variables).map(async localVariableKey => {
@@ -79,7 +79,7 @@ const functionsList = async ({ queries, search, parseOutput = true, sdk = undefi
79
79
  * @typedef {Object} FunctionsCreateRequestParams
80
80
  * @property {string} functionId Function ID. Choose a custom ID or generate a random ID with &#039;ID.unique()&#039;. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can&#039;t start with a special char. Max length is 36 chars.
81
81
  * @property {string} name Function name. Max length: 128 chars.
82
- * @property {string} runtime Execution runtime.
82
+ * @property {Runtime} runtime Execution runtime.
83
83
  * @property {string[]} execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
84
84
  * @property {string[]} events Events list. Maximum of 100 events are allowed.
85
85
  * @property {string} schedule Schedule CRON syntax.
@@ -215,7 +215,7 @@ const functionsListRuntimes = async ({ parseOutput = true, sdk = undefined}) =>
215
215
 
216
216
  /**
217
217
  * @typedef {Object} FunctionsGetUsageRequestParams
218
- * @property {string} range Date range.
218
+ * @property {FunctionUsageRange} range Date range.
219
219
  * @property {boolean} parseOutput
220
220
  * @property {libClient | undefined} sdk
221
221
  */
@@ -278,7 +278,7 @@ const functionsGet = async ({ functionId, parseOutput = true, sdk = undefined})
278
278
  * @typedef {Object} FunctionsUpdateRequestParams
279
279
  * @property {string} functionId Function ID.
280
280
  * @property {string} name Function name. Max length: 128 chars.
281
- * @property {string} runtime Execution runtime.
281
+ * @property {Runtime} runtime Execution runtime.
282
282
  * @property {string[]} execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
283
283
  * @property {string[]} events Events list. Maximum of 100 events are allowed.
284
284
  * @property {string} schedule Schedule CRON syntax.
@@ -793,7 +793,7 @@ const functionsListExecutions = async ({ functionId, queries, search, parseOutpu
793
793
  * @property {string} body HTTP body of execution. Default value is empty string.
794
794
  * @property {boolean} async Execute code in the background. Default value is false.
795
795
  * @property {string} xpath HTTP path of execution. Path can include query params. Default value is /
796
- * @property {string} method HTTP method of execution. Default value is GET.
796
+ * @property {ExecutionMethod} method HTTP method of execution. Default value is GET.
797
797
  * @property {object} headers HTTP headers of execution. Defaults to empty.
798
798
  * @property {boolean} parseOutput
799
799
  * @property {libClient | undefined} sdk
@@ -869,7 +869,7 @@ const functionsGetExecution = async ({ functionId, executionId, parseOutput = tr
869
869
  /**
870
870
  * @typedef {Object} FunctionsGetFunctionUsageRequestParams
871
871
  * @property {string} functionId Function ID.
872
- * @property {string} range Date range.
872
+ * @property {FunctionUsageRange} range Date range.
873
873
  * @property {boolean} parseOutput
874
874
  * @property {libClient | undefined} sdk
875
875
  */
@@ -123,6 +123,38 @@ const healthGetCache = async ({ parseOutput = true, sdk = undefined}) => {
123
123
  return response;
124
124
  }
125
125
 
126
+ /**
127
+ * @typedef {Object} HealthGetCertificateRequestParams
128
+ * @property {string} domain string
129
+ * @property {boolean} parseOutput
130
+ * @property {libClient | undefined} sdk
131
+ */
132
+
133
+ /**
134
+ * @param {HealthGetCertificateRequestParams} params
135
+ */
136
+ const healthGetCertificate = async ({ domain, parseOutput = true, sdk = undefined}) => {
137
+ let client = !sdk ? await sdkForProject() : sdk;
138
+ let apiPath = '/health/certificate';
139
+ let payload = {};
140
+ if (typeof domain !== 'undefined') {
141
+ payload['domain'] = domain;
142
+ }
143
+
144
+ let response = undefined;
145
+
146
+ response = await client.call('get', apiPath, {
147
+ 'content-type': 'application/json',
148
+ }, payload);
149
+
150
+ if (parseOutput) {
151
+ parse(response)
152
+ success()
153
+ }
154
+
155
+ return response;
156
+ }
157
+
126
158
  /**
127
159
  * @typedef {Object} HealthGetDBRequestParams
128
160
  * @property {boolean} parseOutput
@@ -339,6 +371,39 @@ const healthGetQueueDeletes = async ({ threshold, parseOutput = true, sdk = unde
339
371
  return response;
340
372
  }
341
373
 
374
+ /**
375
+ * @typedef {Object} HealthGetFailedJobsRequestParams
376
+ * @property {Name} name The name of the queue
377
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
378
+ * @property {boolean} parseOutput
379
+ * @property {libClient | undefined} sdk
380
+ */
381
+
382
+ /**
383
+ * @param {HealthGetFailedJobsRequestParams} params
384
+ */
385
+ const healthGetFailedJobs = async ({ name, threshold, parseOutput = true, sdk = undefined}) => {
386
+ let client = !sdk ? await sdkForProject() : sdk;
387
+ let apiPath = '/health/queue/failed/{name}'.replace('{name}', name);
388
+ let payload = {};
389
+ if (typeof threshold !== 'undefined') {
390
+ payload['threshold'] = threshold;
391
+ }
392
+
393
+ let response = undefined;
394
+
395
+ response = await client.call('get', apiPath, {
396
+ 'content-type': 'application/json',
397
+ }, payload);
398
+
399
+ if (parseOutput) {
400
+ parse(response)
401
+ success()
402
+ }
403
+
404
+ return response;
405
+ }
406
+
342
407
  /**
343
408
  * @typedef {Object} HealthGetQueueFunctionsRequestParams
344
409
  * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
@@ -499,6 +564,70 @@ const healthGetQueueMigrations = async ({ threshold, parseOutput = true, sdk = u
499
564
  return response;
500
565
  }
501
566
 
567
+ /**
568
+ * @typedef {Object} HealthGetQueueUsageRequestParams
569
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
570
+ * @property {boolean} parseOutput
571
+ * @property {libClient | undefined} sdk
572
+ */
573
+
574
+ /**
575
+ * @param {HealthGetQueueUsageRequestParams} params
576
+ */
577
+ const healthGetQueueUsage = async ({ threshold, parseOutput = true, sdk = undefined}) => {
578
+ let client = !sdk ? await sdkForProject() : sdk;
579
+ let apiPath = '/health/queue/usage';
580
+ let payload = {};
581
+ if (typeof threshold !== 'undefined') {
582
+ payload['threshold'] = threshold;
583
+ }
584
+
585
+ let response = undefined;
586
+
587
+ response = await client.call('get', apiPath, {
588
+ 'content-type': 'application/json',
589
+ }, payload);
590
+
591
+ if (parseOutput) {
592
+ parse(response)
593
+ success()
594
+ }
595
+
596
+ return response;
597
+ }
598
+
599
+ /**
600
+ * @typedef {Object} HealthGetQueueUsageDumpRequestParams
601
+ * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
602
+ * @property {boolean} parseOutput
603
+ * @property {libClient | undefined} sdk
604
+ */
605
+
606
+ /**
607
+ * @param {HealthGetQueueUsageDumpRequestParams} params
608
+ */
609
+ const healthGetQueueUsageDump = async ({ threshold, parseOutput = true, sdk = undefined}) => {
610
+ let client = !sdk ? await sdkForProject() : sdk;
611
+ let apiPath = '/health/queue/usage-dump';
612
+ let payload = {};
613
+ if (typeof threshold !== 'undefined') {
614
+ payload['threshold'] = threshold;
615
+ }
616
+
617
+ let response = undefined;
618
+
619
+ response = await client.call('get', apiPath, {
620
+ 'content-type': 'application/json',
621
+ }, payload);
622
+
623
+ if (parseOutput) {
624
+ parse(response)
625
+ success()
626
+ }
627
+
628
+ return response;
629
+ }
630
+
502
631
  /**
503
632
  * @typedef {Object} HealthGetQueueWebhooksRequestParams
504
633
  * @property {number} threshold Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.
@@ -531,6 +660,34 @@ const healthGetQueueWebhooks = async ({ threshold, parseOutput = true, sdk = und
531
660
  return response;
532
661
  }
533
662
 
663
+ /**
664
+ * @typedef {Object} HealthGetStorageRequestParams
665
+ * @property {boolean} parseOutput
666
+ * @property {libClient | undefined} sdk
667
+ */
668
+
669
+ /**
670
+ * @param {HealthGetStorageRequestParams} params
671
+ */
672
+ const healthGetStorage = async ({ parseOutput = true, sdk = undefined}) => {
673
+ let client = !sdk ? await sdkForProject() : sdk;
674
+ let apiPath = '/health/storage';
675
+ let payload = {};
676
+
677
+ let response = undefined;
678
+
679
+ response = await client.call('get', apiPath, {
680
+ 'content-type': 'application/json',
681
+ }, payload);
682
+
683
+ if (parseOutput) {
684
+ parse(response)
685
+ success()
686
+ }
687
+
688
+ return response;
689
+ }
690
+
534
691
  /**
535
692
  * @typedef {Object} HealthGetStorageLocalRequestParams
536
693
  * @property {boolean} parseOutput
@@ -602,6 +759,12 @@ health
602
759
  .description(`Check the Appwrite in-memory cache servers are up and connection is successful.`)
603
760
  .action(actionRunner(healthGetCache))
604
761
 
762
+ health
763
+ .command(`getCertificate`)
764
+ .description(`Get the SSL certificate for a domain`)
765
+ .option(`--domain <domain>`, `string`)
766
+ .action(actionRunner(healthGetCertificate))
767
+
605
768
  health
606
769
  .command(`getDB`)
607
770
  .description(`Check the Appwrite database servers are up and connection is successful.`)
@@ -642,9 +805,16 @@ health
642
805
  .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
643
806
  .action(actionRunner(healthGetQueueDeletes))
644
807
 
808
+ health
809
+ .command(`getFailedJobs`)
810
+ .description(`Returns the amount of failed jobs in a given queue. `)
811
+ .requiredOption(`--name <name>`, `The name of the queue`)
812
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
813
+ .action(actionRunner(healthGetFailedJobs))
814
+
645
815
  health
646
816
  .command(`getQueueFunctions`)
647
- .description(``)
817
+ .description(`Get the number of function executions that are waiting to be processed in the Appwrite internal queue server.`)
648
818
  .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
649
819
  .action(actionRunner(healthGetQueueFunctions))
650
820
 
@@ -672,12 +842,29 @@ health
672
842
  .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
673
843
  .action(actionRunner(healthGetQueueMigrations))
674
844
 
845
+ health
846
+ .command(`getQueueUsage`)
847
+ .description(`Get the number of metrics that are waiting to be processed in the Appwrite internal queue server.`)
848
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
849
+ .action(actionRunner(healthGetQueueUsage))
850
+
851
+ health
852
+ .command(`getQueueUsageDump`)
853
+ .description(`Get the number of projects containing metrics that are waiting to be processed in the Appwrite internal queue server.`)
854
+ .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
855
+ .action(actionRunner(healthGetQueueUsageDump))
856
+
675
857
  health
676
858
  .command(`getQueueWebhooks`)
677
859
  .description(`Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server.`)
678
860
  .option(`--threshold <threshold>`, `Queue size threshold. When hit (equal or higher), endpoint returns server error. Default value is 5000.`, parseInteger)
679
861
  .action(actionRunner(healthGetQueueWebhooks))
680
862
 
863
+ health
864
+ .command(`getStorage`)
865
+ .description(`Check the Appwrite storage device is up and connection is successful.`)
866
+ .action(actionRunner(healthGetStorage))
867
+
681
868
  health
682
869
  .command(`getStorageLocal`)
683
870
  .description(`Check the Appwrite local storage device is up and connection is successful.`)
@@ -693,6 +880,7 @@ module.exports = {
693
880
  healthGet,
694
881
  healthGetAntivirus,
695
882
  healthGetCache,
883
+ healthGetCertificate,
696
884
  healthGetDB,
697
885
  healthGetPubSub,
698
886
  healthGetQueue,
@@ -700,12 +888,16 @@ module.exports = {
700
888
  healthGetQueueCertificates,
701
889
  healthGetQueueDatabases,
702
890
  healthGetQueueDeletes,
891
+ healthGetFailedJobs,
703
892
  healthGetQueueFunctions,
704
893
  healthGetQueueLogs,
705
894
  healthGetQueueMails,
706
895
  healthGetQueueMessaging,
707
896
  healthGetQueueMigrations,
897
+ healthGetQueueUsage,
898
+ healthGetQueueUsageDump,
708
899
  healthGetQueueWebhooks,
900
+ healthGetStorage,
709
901
  healthGetStorageLocal,
710
902
  healthGetTime
711
903
  };