appwrite-cli 4.2.1 → 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 (320) 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 +9 -4
  293. package/lib/commands/account.js +966 -381
  294. package/lib/commands/assistant.js +3 -8
  295. package/lib/commands/avatars.js +32 -48
  296. package/lib/commands/console.js +3 -8
  297. package/lib/commands/databases.js +119 -265
  298. package/lib/commands/deploy.js +45 -6
  299. package/lib/commands/functions.js +59 -124
  300. package/lib/commands/generic.js +0 -1
  301. package/lib/commands/graphql.js +5 -13
  302. package/lib/commands/health.js +225 -89
  303. package/lib/commands/locale.js +17 -43
  304. package/lib/commands/messaging.js +2815 -0
  305. package/lib/commands/migrations.js +35 -85
  306. package/lib/commands/project.js +28 -38
  307. package/lib/commands/projects.js +286 -270
  308. package/lib/commands/proxy.js +12 -29
  309. package/lib/commands/storage.js +42 -87
  310. package/lib/commands/teams.js +31 -75
  311. package/lib/commands/users.js +677 -235
  312. package/lib/commands/vcs.js +19 -48
  313. package/lib/paginate.js +2 -2
  314. package/lib/parser.js +1 -0
  315. package/package.json +1 -1
  316. package/scoop/appwrite.json +3 -3
  317. package/docs/examples/account/create-magic-u-r-l-session.md +0 -4
  318. package/docs/examples/account/create-phone-session.md +0 -3
  319. package/docs/examples/projects/get-usage.md +0 -3
  320. package/docs/examples/projects/update-smtp-configuration.md +0 -11
@@ -37,11 +37,11 @@ function convertReadStreamToReadableStream(readStream) {
37
37
 
38
38
  const teams = new Command("teams").description(commandDescriptions['teams']).configureHelp({
39
39
  helpWidth: process.stdout.columns || 80
40
- })
40
+ })
41
41
 
42
42
  /**
43
43
  * @typedef {Object} TeamsListRequestParams
44
- * @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. You may filter on the following attributes: name, total
44
+ * @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. You may filter on the following attributes: name, total, billingPlan
45
45
  * @property {string} search Search term to filter your list results. Max length: 256 chars.
46
46
  * @property {boolean} parseOutput
47
47
  * @property {libClient | undefined} sdk
@@ -52,7 +52,6 @@ const teams = new Command("teams").description(commandDescriptions['teams']).con
52
52
  */
53
53
  const teamsList = async ({ queries, search, parseOutput = true, sdk = undefined}) => {
54
54
  let client = !sdk ? await sdkForProject() : sdk;
55
-
56
55
  let apiPath = '/teams';
57
56
  let payload = {};
58
57
  if (typeof queries !== 'undefined') {
@@ -62,14 +61,12 @@ const teamsList = async ({ queries, search, parseOutput = true, sdk = undefined}
62
61
  payload['search'] = search;
63
62
  }
64
63
 
65
-
66
64
  let response = undefined;
67
-
65
+
68
66
  response = await client.call('get', apiPath, {
69
67
  'content-type': 'application/json',
70
68
  }, payload);
71
69
 
72
-
73
70
  if (parseOutput) {
74
71
  parse(response)
75
72
  success()
@@ -92,7 +89,6 @@ const teamsList = async ({ queries, search, parseOutput = true, sdk = undefined}
92
89
  */
93
90
  const teamsCreate = async ({ teamId, name, roles, parseOutput = true, sdk = undefined}) => {
94
91
  let client = !sdk ? await sdkForProject() : sdk;
95
-
96
92
  let apiPath = '/teams';
97
93
  let payload = {};
98
94
  if (typeof teamId !== 'undefined') {
@@ -106,14 +102,12 @@ const teamsCreate = async ({ teamId, name, roles, parseOutput = true, sdk = unde
106
102
  payload['roles'] = roles;
107
103
  }
108
104
 
109
-
110
105
  let response = undefined;
111
-
106
+
112
107
  response = await client.call('post', apiPath, {
113
108
  'content-type': 'application/json',
114
109
  }, payload);
115
110
 
116
-
117
111
  if (parseOutput) {
118
112
  parse(response)
119
113
  success()
@@ -134,18 +128,15 @@ const teamsCreate = async ({ teamId, name, roles, parseOutput = true, sdk = unde
134
128
  */
135
129
  const teamsGet = async ({ teamId, parseOutput = true, sdk = undefined}) => {
136
130
  let client = !sdk ? await sdkForProject() : sdk;
137
-
138
131
  let apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
139
132
  let payload = {};
140
133
 
141
-
142
134
  let response = undefined;
143
-
135
+
144
136
  response = await client.call('get', apiPath, {
145
137
  'content-type': 'application/json',
146
138
  }, payload);
147
139
 
148
-
149
140
  if (parseOutput) {
150
141
  parse(response)
151
142
  success()
@@ -167,21 +158,18 @@ const teamsGet = async ({ teamId, parseOutput = true, sdk = undefined}) => {
167
158
  */
168
159
  const teamsUpdateName = async ({ teamId, name, parseOutput = true, sdk = undefined}) => {
169
160
  let client = !sdk ? await sdkForProject() : sdk;
170
-
171
161
  let apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
172
162
  let payload = {};
173
163
  if (typeof name !== 'undefined') {
174
164
  payload['name'] = name;
175
165
  }
176
166
 
177
-
178
167
  let response = undefined;
179
-
168
+
180
169
  response = await client.call('put', apiPath, {
181
170
  'content-type': 'application/json',
182
171
  }, payload);
183
172
 
184
-
185
173
  if (parseOutput) {
186
174
  parse(response)
187
175
  success()
@@ -202,18 +190,15 @@ const teamsUpdateName = async ({ teamId, name, parseOutput = true, sdk = undefin
202
190
  */
203
191
  const teamsDelete = async ({ teamId, parseOutput = true, sdk = undefined}) => {
204
192
  let client = !sdk ? await sdkForProject() : sdk;
205
-
206
193
  let apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);
207
194
  let payload = {};
208
195
 
209
-
210
196
  let response = undefined;
211
-
197
+
212
198
  response = await client.call('delete', apiPath, {
213
199
  'content-type': 'application/json',
214
200
  }, payload);
215
201
 
216
-
217
202
  if (parseOutput) {
218
203
  parse(response)
219
204
  success()
@@ -235,21 +220,18 @@ const teamsDelete = async ({ teamId, parseOutput = true, sdk = undefined}) => {
235
220
  */
236
221
  const teamsListLogs = async ({ teamId, queries, parseOutput = true, sdk = undefined}) => {
237
222
  let client = !sdk ? await sdkForProject() : sdk;
238
-
239
223
  let apiPath = '/teams/{teamId}/logs'.replace('{teamId}', teamId);
240
224
  let payload = {};
241
225
  if (typeof queries !== 'undefined') {
242
226
  payload['queries'] = queries;
243
227
  }
244
228
 
245
-
246
229
  let response = undefined;
247
-
230
+
248
231
  response = await client.call('get', apiPath, {
249
232
  'content-type': 'application/json',
250
233
  }, payload);
251
234
 
252
-
253
235
  if (parseOutput) {
254
236
  parse(response)
255
237
  success()
@@ -272,7 +254,6 @@ const teamsListLogs = async ({ teamId, queries, parseOutput = true, sdk = undefi
272
254
  */
273
255
  const teamsListMemberships = async ({ teamId, queries, search, parseOutput = true, sdk = undefined}) => {
274
256
  let client = !sdk ? await sdkForProject() : sdk;
275
-
276
257
  let apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
277
258
  let payload = {};
278
259
  if (typeof queries !== 'undefined') {
@@ -282,14 +263,12 @@ const teamsListMemberships = async ({ teamId, queries, search, parseOutput = tru
282
263
  payload['search'] = search;
283
264
  }
284
265
 
285
-
286
266
  let response = undefined;
287
-
267
+
288
268
  response = await client.call('get', apiPath, {
289
269
  'content-type': 'application/json',
290
270
  }, payload);
291
271
 
292
-
293
272
  if (parseOutput) {
294
273
  parse(response)
295
274
  success()
@@ -316,7 +295,6 @@ const teamsListMemberships = async ({ teamId, queries, search, parseOutput = tru
316
295
  */
317
296
  const teamsCreateMembership = async ({ teamId, roles, email, userId, phone, url, name, parseOutput = true, sdk = undefined}) => {
318
297
  let client = !sdk ? await sdkForProject() : sdk;
319
-
320
298
  let apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);
321
299
  let payload = {};
322
300
  if (typeof email !== 'undefined') {
@@ -339,14 +317,12 @@ const teamsCreateMembership = async ({ teamId, roles, email, userId, phone, url,
339
317
  payload['name'] = name;
340
318
  }
341
319
 
342
-
343
320
  let response = undefined;
344
-
321
+
345
322
  response = await client.call('post', apiPath, {
346
323
  'content-type': 'application/json',
347
324
  }, payload);
348
325
 
349
-
350
326
  if (parseOutput) {
351
327
  parse(response)
352
328
  success()
@@ -368,18 +344,15 @@ const teamsCreateMembership = async ({ teamId, roles, email, userId, phone, url,
368
344
  */
369
345
  const teamsGetMembership = async ({ teamId, membershipId, parseOutput = true, sdk = undefined}) => {
370
346
  let client = !sdk ? await sdkForProject() : sdk;
371
-
372
347
  let apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
373
348
  let payload = {};
374
349
 
375
-
376
350
  let response = undefined;
377
-
351
+
378
352
  response = await client.call('get', apiPath, {
379
353
  'content-type': 'application/json',
380
354
  }, payload);
381
355
 
382
-
383
356
  if (parseOutput) {
384
357
  parse(response)
385
358
  success()
@@ -402,7 +375,6 @@ const teamsGetMembership = async ({ teamId, membershipId, parseOutput = true, sd
402
375
  */
403
376
  const teamsUpdateMembership = async ({ teamId, membershipId, roles, parseOutput = true, sdk = undefined}) => {
404
377
  let client = !sdk ? await sdkForProject() : sdk;
405
-
406
378
  let apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
407
379
  let payload = {};
408
380
  roles = roles === true ? [] : roles;
@@ -410,14 +382,12 @@ const teamsUpdateMembership = async ({ teamId, membershipId, roles, parseOutput
410
382
  payload['roles'] = roles;
411
383
  }
412
384
 
413
-
414
385
  let response = undefined;
415
-
386
+
416
387
  response = await client.call('patch', apiPath, {
417
388
  'content-type': 'application/json',
418
389
  }, payload);
419
390
 
420
-
421
391
  if (parseOutput) {
422
392
  parse(response)
423
393
  success()
@@ -439,18 +409,15 @@ const teamsUpdateMembership = async ({ teamId, membershipId, roles, parseOutput
439
409
  */
440
410
  const teamsDeleteMembership = async ({ teamId, membershipId, parseOutput = true, sdk = undefined}) => {
441
411
  let client = !sdk ? await sdkForProject() : sdk;
442
-
443
412
  let apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
444
413
  let payload = {};
445
414
 
446
-
447
415
  let response = undefined;
448
-
416
+
449
417
  response = await client.call('delete', apiPath, {
450
418
  'content-type': 'application/json',
451
419
  }, payload);
452
420
 
453
-
454
421
  if (parseOutput) {
455
422
  parse(response)
456
423
  success()
@@ -474,7 +441,6 @@ const teamsDeleteMembership = async ({ teamId, membershipId, parseOutput = true,
474
441
  */
475
442
  const teamsUpdateMembershipStatus = async ({ teamId, membershipId, userId, secret, parseOutput = true, sdk = undefined}) => {
476
443
  let client = !sdk ? await sdkForProject() : sdk;
477
-
478
444
  let apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);
479
445
  let payload = {};
480
446
  if (typeof userId !== 'undefined') {
@@ -484,14 +450,12 @@ const teamsUpdateMembershipStatus = async ({ teamId, membershipId, userId, secre
484
450
  payload['secret'] = secret;
485
451
  }
486
452
 
487
-
488
453
  let response = undefined;
489
-
454
+
490
455
  response = await client.call('patch', apiPath, {
491
456
  'content-type': 'application/json',
492
457
  }, payload);
493
458
 
494
-
495
459
  if (parseOutput) {
496
460
  parse(response)
497
461
  success()
@@ -512,18 +476,15 @@ const teamsUpdateMembershipStatus = async ({ teamId, membershipId, userId, secre
512
476
  */
513
477
  const teamsGetPrefs = async ({ teamId, parseOutput = true, sdk = undefined}) => {
514
478
  let client = !sdk ? await sdkForProject() : sdk;
515
-
516
479
  let apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
517
480
  let payload = {};
518
481
 
519
-
520
482
  let response = undefined;
521
-
483
+
522
484
  response = await client.call('get', apiPath, {
523
485
  'content-type': 'application/json',
524
486
  }, payload);
525
487
 
526
-
527
488
  if (parseOutput) {
528
489
  parse(response)
529
490
  success()
@@ -545,21 +506,18 @@ const teamsGetPrefs = async ({ teamId, parseOutput = true, sdk = undefined}) =>
545
506
  */
546
507
  const teamsUpdatePrefs = async ({ teamId, prefs, parseOutput = true, sdk = undefined}) => {
547
508
  let client = !sdk ? await sdkForProject() : sdk;
548
-
549
509
  let apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);
550
510
  let payload = {};
551
511
  if (typeof prefs !== 'undefined') {
552
512
  payload['prefs'] = JSON.parse(prefs);
553
513
  }
554
514
 
555
-
556
515
  let response = undefined;
557
-
516
+
558
517
  response = await client.call('put', apiPath, {
559
518
  'content-type': 'application/json',
560
519
  }, payload);
561
520
 
562
-
563
521
  if (parseOutput) {
564
522
  parse(response)
565
523
  success()
@@ -568,11 +526,10 @@ const teamsUpdatePrefs = async ({ teamId, prefs, parseOutput = true, sdk = undef
568
526
  return response;
569
527
  }
570
528
 
571
-
572
529
  teams
573
530
  .command(`list`)
574
531
  .description(`Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.`)
575
- .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: name, total`)
532
+ .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: name, total, billingPlan`)
576
533
  .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
577
534
  .action(actionRunner(teamsList))
578
535
 
@@ -674,21 +631,20 @@ teams
674
631
  .requiredOption(`--prefs <prefs>`, `Prefs key-value JSON object.`)
675
632
  .action(actionRunner(teamsUpdatePrefs))
676
633
 
677
-
678
634
  module.exports = {
679
635
  teams,
680
- teamsList,
681
- teamsCreate,
682
- teamsGet,
683
- teamsUpdateName,
684
- teamsDelete,
685
- teamsListLogs,
686
- teamsListMemberships,
687
- teamsCreateMembership,
688
- teamsGetMembership,
689
- teamsUpdateMembership,
690
- teamsDeleteMembership,
691
- teamsUpdateMembershipStatus,
692
- teamsGetPrefs,
693
- teamsUpdatePrefs
636
+ teamsList,
637
+ teamsCreate,
638
+ teamsGet,
639
+ teamsUpdateName,
640
+ teamsDelete,
641
+ teamsListLogs,
642
+ teamsListMemberships,
643
+ teamsCreateMembership,
644
+ teamsGetMembership,
645
+ teamsUpdateMembership,
646
+ teamsDeleteMembership,
647
+ teamsUpdateMembershipStatus,
648
+ teamsGetPrefs,
649
+ teamsUpdatePrefs
694
650
  };