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,2615 @@
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 projects = new Command("projects").description(commandDescriptions['projects'] ?? '').configureHelp({
39
+ helpWidth: process.stdout.columns || 80
40
+ })
41
+
42
+ /**
43
+ * @typedef {Object} ProjectsListRequestParams
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, teamId
45
+ * @property {string} search Search term to filter your list results. Max length: 256 chars.
46
+ * @property {boolean} overrideForCli
47
+ * @property {boolean} parseOutput
48
+ * @property {libClient | undefined} sdk
49
+ */
50
+
51
+ /**
52
+ * @param {ProjectsListRequestParams} params
53
+ */
54
+ const projectsList = async ({queries,search,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
55
+ let client = !sdk ? await sdkForConsole() :
56
+ sdk;
57
+ let apiPath = '/projects';
58
+ let payload = {};
59
+ if (typeof queries !== 'undefined') {
60
+ payload['queries'] = queries;
61
+ }
62
+ if (typeof search !== 'undefined') {
63
+ payload['search'] = search;
64
+ }
65
+
66
+ let response = undefined;
67
+
68
+ response = await client.call('get', apiPath, {
69
+ }, payload);
70
+
71
+ if (parseOutput) {
72
+ if(console) {
73
+ showConsoleLink('projects', 'list');
74
+ } else {
75
+ parse(response)
76
+ }
77
+ }
78
+
79
+ return response;
80
+
81
+ }
82
+
83
+ /**
84
+ * @typedef {Object} ProjectsCreateRequestParams
85
+ * @property {string} projectId Unique Id. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars.
86
+ * @property {string} name Project name. Max length: 128 chars.
87
+ * @property {string} teamId Team unique ID.
88
+ * @property {Region} region Project Region.
89
+ * @property {string} description Project description. Max length: 256 chars.
90
+ * @property {string} logo Project logo.
91
+ * @property {string} url Project URL.
92
+ * @property {string} legalName Project legal Name. Max length: 256 chars.
93
+ * @property {string} legalCountry Project legal Country. Max length: 256 chars.
94
+ * @property {string} legalState Project legal State. Max length: 256 chars.
95
+ * @property {string} legalCity Project legal City. Max length: 256 chars.
96
+ * @property {string} legalAddress Project legal Address. Max length: 256 chars.
97
+ * @property {string} legalTaxId Project legal Tax ID. Max length: 256 chars.
98
+ * @property {boolean} overrideForCli
99
+ * @property {boolean} parseOutput
100
+ * @property {libClient | undefined} sdk
101
+ */
102
+
103
+ /**
104
+ * @param {ProjectsCreateRequestParams} params
105
+ */
106
+ const projectsCreate = async ({projectId,name,teamId,region,description,logo,url,legalName,legalCountry,legalState,legalCity,legalAddress,legalTaxId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
107
+ let client = !sdk ? await sdkForConsole() :
108
+ sdk;
109
+ let apiPath = '/projects';
110
+ let payload = {};
111
+ if (typeof projectId !== 'undefined') {
112
+ payload['projectId'] = projectId;
113
+ }
114
+ if (typeof name !== 'undefined') {
115
+ payload['name'] = name;
116
+ }
117
+ if (typeof teamId !== 'undefined') {
118
+ payload['teamId'] = teamId;
119
+ }
120
+ if (typeof region !== 'undefined') {
121
+ payload['region'] = region;
122
+ }
123
+ if (typeof description !== 'undefined') {
124
+ payload['description'] = description;
125
+ }
126
+ if (typeof logo !== 'undefined') {
127
+ payload['logo'] = logo;
128
+ }
129
+ if (typeof url !== 'undefined') {
130
+ payload['url'] = url;
131
+ }
132
+ if (typeof legalName !== 'undefined') {
133
+ payload['legalName'] = legalName;
134
+ }
135
+ if (typeof legalCountry !== 'undefined') {
136
+ payload['legalCountry'] = legalCountry;
137
+ }
138
+ if (typeof legalState !== 'undefined') {
139
+ payload['legalState'] = legalState;
140
+ }
141
+ if (typeof legalCity !== 'undefined') {
142
+ payload['legalCity'] = legalCity;
143
+ }
144
+ if (typeof legalAddress !== 'undefined') {
145
+ payload['legalAddress'] = legalAddress;
146
+ }
147
+ if (typeof legalTaxId !== 'undefined') {
148
+ payload['legalTaxId'] = legalTaxId;
149
+ }
150
+
151
+ let response = undefined;
152
+
153
+ response = await client.call('post', apiPath, {
154
+ 'content-type': 'application/json',
155
+ }, payload);
156
+
157
+ if (parseOutput) {
158
+ parse(response)
159
+ }
160
+
161
+ return response;
162
+
163
+ }
164
+
165
+ /**
166
+ * @typedef {Object} ProjectsGetRequestParams
167
+ * @property {string} projectId Project unique ID.
168
+ * @property {boolean} overrideForCli
169
+ * @property {boolean} parseOutput
170
+ * @property {libClient | undefined} sdk
171
+ */
172
+
173
+ /**
174
+ * @param {ProjectsGetRequestParams} params
175
+ */
176
+ const projectsGet = async ({projectId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
177
+ let client = !sdk ? await sdkForConsole() :
178
+ sdk;
179
+ let apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
180
+ let payload = {};
181
+
182
+ let response = undefined;
183
+
184
+ response = await client.call('get', apiPath, {
185
+ }, payload);
186
+
187
+ if (parseOutput) {
188
+ if(console) {
189
+ showConsoleLink('projects', 'get', projectId);
190
+ } else {
191
+ parse(response)
192
+ }
193
+ }
194
+
195
+ return response;
196
+
197
+ }
198
+
199
+ /**
200
+ * @typedef {Object} ProjectsUpdateRequestParams
201
+ * @property {string} projectId Project unique ID.
202
+ * @property {string} name Project name. Max length: 128 chars.
203
+ * @property {string} description Project description. Max length: 256 chars.
204
+ * @property {string} logo Project logo.
205
+ * @property {string} url Project URL.
206
+ * @property {string} legalName Project legal name. Max length: 256 chars.
207
+ * @property {string} legalCountry Project legal country. Max length: 256 chars.
208
+ * @property {string} legalState Project legal state. Max length: 256 chars.
209
+ * @property {string} legalCity Project legal city. Max length: 256 chars.
210
+ * @property {string} legalAddress Project legal address. Max length: 256 chars.
211
+ * @property {string} legalTaxId Project legal tax ID. Max length: 256 chars.
212
+ * @property {boolean} overrideForCli
213
+ * @property {boolean} parseOutput
214
+ * @property {libClient | undefined} sdk
215
+ */
216
+
217
+ /**
218
+ * @param {ProjectsUpdateRequestParams} params
219
+ */
220
+ const projectsUpdate = async ({projectId,name,description,logo,url,legalName,legalCountry,legalState,legalCity,legalAddress,legalTaxId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
221
+ let client = !sdk ? await sdkForConsole() :
222
+ sdk;
223
+ let apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
224
+ let payload = {};
225
+ if (typeof name !== 'undefined') {
226
+ payload['name'] = name;
227
+ }
228
+ if (typeof description !== 'undefined') {
229
+ payload['description'] = description;
230
+ }
231
+ if (typeof logo !== 'undefined') {
232
+ payload['logo'] = logo;
233
+ }
234
+ if (typeof url !== 'undefined') {
235
+ payload['url'] = url;
236
+ }
237
+ if (typeof legalName !== 'undefined') {
238
+ payload['legalName'] = legalName;
239
+ }
240
+ if (typeof legalCountry !== 'undefined') {
241
+ payload['legalCountry'] = legalCountry;
242
+ }
243
+ if (typeof legalState !== 'undefined') {
244
+ payload['legalState'] = legalState;
245
+ }
246
+ if (typeof legalCity !== 'undefined') {
247
+ payload['legalCity'] = legalCity;
248
+ }
249
+ if (typeof legalAddress !== 'undefined') {
250
+ payload['legalAddress'] = legalAddress;
251
+ }
252
+ if (typeof legalTaxId !== 'undefined') {
253
+ payload['legalTaxId'] = legalTaxId;
254
+ }
255
+
256
+ let response = undefined;
257
+
258
+ response = await client.call('patch', apiPath, {
259
+ 'content-type': 'application/json',
260
+ }, payload);
261
+
262
+ if (parseOutput) {
263
+ parse(response)
264
+ }
265
+
266
+ return response;
267
+
268
+ }
269
+
270
+ /**
271
+ * @typedef {Object} ProjectsDeleteRequestParams
272
+ * @property {string} projectId Project unique ID.
273
+ * @property {boolean} overrideForCli
274
+ * @property {boolean} parseOutput
275
+ * @property {libClient | undefined} sdk
276
+ */
277
+
278
+ /**
279
+ * @param {ProjectsDeleteRequestParams} params
280
+ */
281
+ const projectsDelete = async ({projectId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
282
+ let client = !sdk ? await sdkForConsole() :
283
+ sdk;
284
+ let apiPath = '/projects/{projectId}'.replace('{projectId}', projectId);
285
+ let payload = {};
286
+
287
+ let response = undefined;
288
+
289
+ response = await client.call('delete', apiPath, {
290
+ 'content-type': 'application/json',
291
+ }, payload);
292
+
293
+ if (parseOutput) {
294
+ parse(response)
295
+ }
296
+
297
+ return response;
298
+
299
+ }
300
+
301
+ /**
302
+ * @typedef {Object} ProjectsUpdateApiStatusRequestParams
303
+ * @property {string} projectId Project unique ID.
304
+ * @property {Api} api API name.
305
+ * @property {boolean} status API status.
306
+ * @property {boolean} overrideForCli
307
+ * @property {boolean} parseOutput
308
+ * @property {libClient | undefined} sdk
309
+ */
310
+
311
+ /**
312
+ * @param {ProjectsUpdateApiStatusRequestParams} params
313
+ */
314
+ const projectsUpdateApiStatus = async ({projectId,api,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
315
+ let client = !sdk ? await sdkForConsole() :
316
+ sdk;
317
+ let apiPath = '/projects/{projectId}/api'.replace('{projectId}', projectId);
318
+ let payload = {};
319
+ if (typeof api !== 'undefined') {
320
+ payload['api'] = api;
321
+ }
322
+ if (typeof status !== 'undefined') {
323
+ payload['status'] = status;
324
+ }
325
+
326
+ let response = undefined;
327
+
328
+ response = await client.call('patch', apiPath, {
329
+ 'content-type': 'application/json',
330
+ }, payload);
331
+
332
+ if (parseOutput) {
333
+ parse(response)
334
+ }
335
+
336
+ return response;
337
+
338
+ }
339
+
340
+ /**
341
+ * @typedef {Object} ProjectsUpdateApiStatusAllRequestParams
342
+ * @property {string} projectId Project unique ID.
343
+ * @property {boolean} status API status.
344
+ * @property {boolean} overrideForCli
345
+ * @property {boolean} parseOutput
346
+ * @property {libClient | undefined} sdk
347
+ */
348
+
349
+ /**
350
+ * @param {ProjectsUpdateApiStatusAllRequestParams} params
351
+ */
352
+ const projectsUpdateApiStatusAll = async ({projectId,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
353
+ let client = !sdk ? await sdkForConsole() :
354
+ sdk;
355
+ let apiPath = '/projects/{projectId}/api/all'.replace('{projectId}', projectId);
356
+ let payload = {};
357
+ if (typeof status !== 'undefined') {
358
+ payload['status'] = status;
359
+ }
360
+
361
+ let response = undefined;
362
+
363
+ response = await client.call('patch', apiPath, {
364
+ 'content-type': 'application/json',
365
+ }, payload);
366
+
367
+ if (parseOutput) {
368
+ parse(response)
369
+ }
370
+
371
+ return response;
372
+
373
+ }
374
+
375
+ /**
376
+ * @typedef {Object} ProjectsUpdateAuthDurationRequestParams
377
+ * @property {string} projectId Project unique ID.
378
+ * @property {number} duration Project session length in seconds. Max length: 31536000 seconds.
379
+ * @property {boolean} overrideForCli
380
+ * @property {boolean} parseOutput
381
+ * @property {libClient | undefined} sdk
382
+ */
383
+
384
+ /**
385
+ * @param {ProjectsUpdateAuthDurationRequestParams} params
386
+ */
387
+ const projectsUpdateAuthDuration = async ({projectId,duration,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
388
+ let client = !sdk ? await sdkForConsole() :
389
+ sdk;
390
+ let apiPath = '/projects/{projectId}/auth/duration'.replace('{projectId}', projectId);
391
+ let payload = {};
392
+ if (typeof duration !== 'undefined') {
393
+ payload['duration'] = duration;
394
+ }
395
+
396
+ let response = undefined;
397
+
398
+ response = await client.call('patch', apiPath, {
399
+ 'content-type': 'application/json',
400
+ }, payload);
401
+
402
+ if (parseOutput) {
403
+ parse(response)
404
+ }
405
+
406
+ return response;
407
+
408
+ }
409
+
410
+ /**
411
+ * @typedef {Object} ProjectsUpdateAuthLimitRequestParams
412
+ * @property {string} projectId Project unique ID.
413
+ * @property {number} limit Set the max number of users allowed in this project. Use 0 for unlimited.
414
+ * @property {boolean} overrideForCli
415
+ * @property {boolean} parseOutput
416
+ * @property {libClient | undefined} sdk
417
+ */
418
+
419
+ /**
420
+ * @param {ProjectsUpdateAuthLimitRequestParams} params
421
+ */
422
+ const projectsUpdateAuthLimit = async ({projectId,limit,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
423
+ let client = !sdk ? await sdkForConsole() :
424
+ sdk;
425
+ let apiPath = '/projects/{projectId}/auth/limit'.replace('{projectId}', projectId);
426
+ let payload = {};
427
+ if (typeof limit !== 'undefined') {
428
+ payload['limit'] = limit;
429
+ }
430
+
431
+ let response = undefined;
432
+
433
+ response = await client.call('patch', apiPath, {
434
+ 'content-type': 'application/json',
435
+ }, payload);
436
+
437
+ if (parseOutput) {
438
+ parse(response)
439
+ }
440
+
441
+ return response;
442
+
443
+ }
444
+
445
+ /**
446
+ * @typedef {Object} ProjectsUpdateAuthSessionsLimitRequestParams
447
+ * @property {string} projectId Project unique ID.
448
+ * @property {number} limit Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10
449
+ * @property {boolean} overrideForCli
450
+ * @property {boolean} parseOutput
451
+ * @property {libClient | undefined} sdk
452
+ */
453
+
454
+ /**
455
+ * @param {ProjectsUpdateAuthSessionsLimitRequestParams} params
456
+ */
457
+ const projectsUpdateAuthSessionsLimit = async ({projectId,limit,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
458
+ let client = !sdk ? await sdkForConsole() :
459
+ sdk;
460
+ let apiPath = '/projects/{projectId}/auth/max-sessions'.replace('{projectId}', projectId);
461
+ let payload = {};
462
+ if (typeof limit !== 'undefined') {
463
+ payload['limit'] = limit;
464
+ }
465
+
466
+ let response = undefined;
467
+
468
+ response = await client.call('patch', apiPath, {
469
+ 'content-type': 'application/json',
470
+ }, payload);
471
+
472
+ if (parseOutput) {
473
+ parse(response)
474
+ }
475
+
476
+ return response;
477
+
478
+ }
479
+
480
+ /**
481
+ * @typedef {Object} ProjectsUpdateMembershipsPrivacyRequestParams
482
+ * @property {string} projectId Project unique ID.
483
+ * @property {boolean} userName Set to true to show userName to members of a team.
484
+ * @property {boolean} userEmail Set to true to show email to members of a team.
485
+ * @property {boolean} mfa Set to true to show mfa to members of a team.
486
+ * @property {boolean} overrideForCli
487
+ * @property {boolean} parseOutput
488
+ * @property {libClient | undefined} sdk
489
+ */
490
+
491
+ /**
492
+ * @param {ProjectsUpdateMembershipsPrivacyRequestParams} params
493
+ */
494
+ const projectsUpdateMembershipsPrivacy = async ({projectId,userName,userEmail,mfa,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
495
+ let client = !sdk ? await sdkForConsole() :
496
+ sdk;
497
+ let apiPath = '/projects/{projectId}/auth/memberships-privacy'.replace('{projectId}', projectId);
498
+ let payload = {};
499
+ if (typeof userName !== 'undefined') {
500
+ payload['userName'] = userName;
501
+ }
502
+ if (typeof userEmail !== 'undefined') {
503
+ payload['userEmail'] = userEmail;
504
+ }
505
+ if (typeof mfa !== 'undefined') {
506
+ payload['mfa'] = mfa;
507
+ }
508
+
509
+ let response = undefined;
510
+
511
+ response = await client.call('patch', apiPath, {
512
+ 'content-type': 'application/json',
513
+ }, payload);
514
+
515
+ if (parseOutput) {
516
+ parse(response)
517
+ }
518
+
519
+ return response;
520
+
521
+ }
522
+
523
+ /**
524
+ * @typedef {Object} ProjectsUpdateMockNumbersRequestParams
525
+ * @property {string} projectId Project unique ID.
526
+ * @property {object[]} numbers An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.
527
+ * @property {boolean} overrideForCli
528
+ * @property {boolean} parseOutput
529
+ * @property {libClient | undefined} sdk
530
+ */
531
+
532
+ /**
533
+ * @param {ProjectsUpdateMockNumbersRequestParams} params
534
+ */
535
+ const projectsUpdateMockNumbers = async ({projectId,numbers,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
536
+ let client = !sdk ? await sdkForConsole() :
537
+ sdk;
538
+ let apiPath = '/projects/{projectId}/auth/mock-numbers'.replace('{projectId}', projectId);
539
+ let payload = {};
540
+ numbers = numbers === true ? [] : numbers;
541
+ if (typeof numbers !== 'undefined') {
542
+ payload['numbers'] = numbers;
543
+ }
544
+
545
+ let response = undefined;
546
+
547
+ response = await client.call('patch', apiPath, {
548
+ 'content-type': 'application/json',
549
+ }, payload);
550
+
551
+ if (parseOutput) {
552
+ parse(response)
553
+ }
554
+
555
+ return response;
556
+
557
+ }
558
+
559
+ /**
560
+ * @typedef {Object} ProjectsUpdateAuthPasswordDictionaryRequestParams
561
+ * @property {string} projectId Project unique ID.
562
+ * @property {boolean} enabled Set whether or not to enable checking user's password against most commonly used passwords. Default is false.
563
+ * @property {boolean} overrideForCli
564
+ * @property {boolean} parseOutput
565
+ * @property {libClient | undefined} sdk
566
+ */
567
+
568
+ /**
569
+ * @param {ProjectsUpdateAuthPasswordDictionaryRequestParams} params
570
+ */
571
+ const projectsUpdateAuthPasswordDictionary = async ({projectId,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
572
+ let client = !sdk ? await sdkForConsole() :
573
+ sdk;
574
+ let apiPath = '/projects/{projectId}/auth/password-dictionary'.replace('{projectId}', projectId);
575
+ let payload = {};
576
+ if (typeof enabled !== 'undefined') {
577
+ payload['enabled'] = enabled;
578
+ }
579
+
580
+ let response = undefined;
581
+
582
+ response = await client.call('patch', apiPath, {
583
+ 'content-type': 'application/json',
584
+ }, payload);
585
+
586
+ if (parseOutput) {
587
+ parse(response)
588
+ }
589
+
590
+ return response;
591
+
592
+ }
593
+
594
+ /**
595
+ * @typedef {Object} ProjectsUpdateAuthPasswordHistoryRequestParams
596
+ * @property {string} projectId Project unique ID.
597
+ * @property {number} limit Set the max number of passwords to store in user history. User can't choose a new password that is already stored in the password history list. Max number of passwords allowed in history is20. Default value is 0
598
+ * @property {boolean} overrideForCli
599
+ * @property {boolean} parseOutput
600
+ * @property {libClient | undefined} sdk
601
+ */
602
+
603
+ /**
604
+ * @param {ProjectsUpdateAuthPasswordHistoryRequestParams} params
605
+ */
606
+ const projectsUpdateAuthPasswordHistory = async ({projectId,limit,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
607
+ let client = !sdk ? await sdkForConsole() :
608
+ sdk;
609
+ let apiPath = '/projects/{projectId}/auth/password-history'.replace('{projectId}', projectId);
610
+ let payload = {};
611
+ if (typeof limit !== 'undefined') {
612
+ payload['limit'] = limit;
613
+ }
614
+
615
+ let response = undefined;
616
+
617
+ response = await client.call('patch', apiPath, {
618
+ 'content-type': 'application/json',
619
+ }, payload);
620
+
621
+ if (parseOutput) {
622
+ parse(response)
623
+ }
624
+
625
+ return response;
626
+
627
+ }
628
+
629
+ /**
630
+ * @typedef {Object} ProjectsUpdatePersonalDataCheckRequestParams
631
+ * @property {string} projectId Project unique ID.
632
+ * @property {boolean} enabled Set whether or not to check a password for similarity with personal data. Default is false.
633
+ * @property {boolean} overrideForCli
634
+ * @property {boolean} parseOutput
635
+ * @property {libClient | undefined} sdk
636
+ */
637
+
638
+ /**
639
+ * @param {ProjectsUpdatePersonalDataCheckRequestParams} params
640
+ */
641
+ const projectsUpdatePersonalDataCheck = async ({projectId,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
642
+ let client = !sdk ? await sdkForConsole() :
643
+ sdk;
644
+ let apiPath = '/projects/{projectId}/auth/personal-data'.replace('{projectId}', projectId);
645
+ let payload = {};
646
+ if (typeof enabled !== 'undefined') {
647
+ payload['enabled'] = enabled;
648
+ }
649
+
650
+ let response = undefined;
651
+
652
+ response = await client.call('patch', apiPath, {
653
+ 'content-type': 'application/json',
654
+ }, payload);
655
+
656
+ if (parseOutput) {
657
+ parse(response)
658
+ }
659
+
660
+ return response;
661
+
662
+ }
663
+
664
+ /**
665
+ * @typedef {Object} ProjectsUpdateSessionAlertsRequestParams
666
+ * @property {string} projectId Project unique ID.
667
+ * @property {boolean} alerts Set to true to enable session emails.
668
+ * @property {boolean} overrideForCli
669
+ * @property {boolean} parseOutput
670
+ * @property {libClient | undefined} sdk
671
+ */
672
+
673
+ /**
674
+ * @param {ProjectsUpdateSessionAlertsRequestParams} params
675
+ */
676
+ const projectsUpdateSessionAlerts = async ({projectId,alerts,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
677
+ let client = !sdk ? await sdkForConsole() :
678
+ sdk;
679
+ let apiPath = '/projects/{projectId}/auth/session-alerts'.replace('{projectId}', projectId);
680
+ let payload = {};
681
+ if (typeof alerts !== 'undefined') {
682
+ payload['alerts'] = alerts;
683
+ }
684
+
685
+ let response = undefined;
686
+
687
+ response = await client.call('patch', apiPath, {
688
+ 'content-type': 'application/json',
689
+ }, payload);
690
+
691
+ if (parseOutput) {
692
+ parse(response)
693
+ }
694
+
695
+ return response;
696
+
697
+ }
698
+
699
+ /**
700
+ * @typedef {Object} ProjectsUpdateAuthStatusRequestParams
701
+ * @property {string} projectId Project unique ID.
702
+ * @property {AuthMethod} method Auth Method. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone
703
+ * @property {boolean} status Set the status of this auth method.
704
+ * @property {boolean} overrideForCli
705
+ * @property {boolean} parseOutput
706
+ * @property {libClient | undefined} sdk
707
+ */
708
+
709
+ /**
710
+ * @param {ProjectsUpdateAuthStatusRequestParams} params
711
+ */
712
+ const projectsUpdateAuthStatus = async ({projectId,method,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
713
+ let client = !sdk ? await sdkForConsole() :
714
+ sdk;
715
+ let apiPath = '/projects/{projectId}/auth/{method}'.replace('{projectId}', projectId).replace('{method}', method);
716
+ let payload = {};
717
+ if (typeof status !== 'undefined') {
718
+ payload['status'] = status;
719
+ }
720
+
721
+ let response = undefined;
722
+
723
+ response = await client.call('patch', apiPath, {
724
+ 'content-type': 'application/json',
725
+ }, payload);
726
+
727
+ if (parseOutput) {
728
+ parse(response)
729
+ }
730
+
731
+ return response;
732
+
733
+ }
734
+
735
+ /**
736
+ * @typedef {Object} ProjectsListDevKeysRequestParams
737
+ * @property {string} projectId Project unique ID.
738
+ * @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: accessedAt, expire
739
+ * @property {boolean} overrideForCli
740
+ * @property {boolean} parseOutput
741
+ * @property {libClient | undefined} sdk
742
+ */
743
+
744
+ /**
745
+ * @param {ProjectsListDevKeysRequestParams} params
746
+ */
747
+ const projectsListDevKeys = async ({projectId,queries,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
748
+ let client = !sdk ? await sdkForConsole() :
749
+ sdk;
750
+ let apiPath = '/projects/{projectId}/dev-keys'.replace('{projectId}', projectId);
751
+ let payload = {};
752
+ if (typeof queries !== 'undefined') {
753
+ payload['queries'] = queries;
754
+ }
755
+
756
+ let response = undefined;
757
+
758
+ response = await client.call('get', apiPath, {
759
+ }, payload);
760
+
761
+ if (parseOutput) {
762
+ if(console) {
763
+ showConsoleLink('projects', 'listDevKeys', projectId);
764
+ } else {
765
+ parse(response)
766
+ }
767
+ }
768
+
769
+ return response;
770
+
771
+ }
772
+
773
+ /**
774
+ * @typedef {Object} ProjectsCreateDevKeyRequestParams
775
+ * @property {string} projectId Project unique ID.
776
+ * @property {string} name Key name. Max length: 128 chars.
777
+ * @property {string} expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
778
+ * @property {boolean} overrideForCli
779
+ * @property {boolean} parseOutput
780
+ * @property {libClient | undefined} sdk
781
+ */
782
+
783
+ /**
784
+ * @param {ProjectsCreateDevKeyRequestParams} params
785
+ */
786
+ const projectsCreateDevKey = async ({projectId,name,expire,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
787
+ let client = !sdk ? await sdkForConsole() :
788
+ sdk;
789
+ let apiPath = '/projects/{projectId}/dev-keys'.replace('{projectId}', projectId);
790
+ let payload = {};
791
+ if (typeof name !== 'undefined') {
792
+ payload['name'] = name;
793
+ }
794
+ if (typeof expire !== 'undefined') {
795
+ payload['expire'] = expire;
796
+ }
797
+
798
+ let response = undefined;
799
+
800
+ response = await client.call('post', apiPath, {
801
+ 'content-type': 'application/json',
802
+ }, payload);
803
+
804
+ if (parseOutput) {
805
+ parse(response)
806
+ }
807
+
808
+ return response;
809
+
810
+ }
811
+
812
+ /**
813
+ * @typedef {Object} ProjectsGetDevKeyRequestParams
814
+ * @property {string} projectId Project unique ID.
815
+ * @property {string} keyId Key unique ID.
816
+ * @property {boolean} overrideForCli
817
+ * @property {boolean} parseOutput
818
+ * @property {libClient | undefined} sdk
819
+ */
820
+
821
+ /**
822
+ * @param {ProjectsGetDevKeyRequestParams} params
823
+ */
824
+ const projectsGetDevKey = async ({projectId,keyId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
825
+ let client = !sdk ? await sdkForConsole() :
826
+ sdk;
827
+ let apiPath = '/projects/{projectId}/dev-keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
828
+ let payload = {};
829
+
830
+ let response = undefined;
831
+
832
+ response = await client.call('get', apiPath, {
833
+ }, payload);
834
+
835
+ if (parseOutput) {
836
+ if(console) {
837
+ showConsoleLink('projects', 'getDevKey', projectId, keyId);
838
+ } else {
839
+ parse(response)
840
+ }
841
+ }
842
+
843
+ return response;
844
+
845
+ }
846
+
847
+ /**
848
+ * @typedef {Object} ProjectsUpdateDevKeyRequestParams
849
+ * @property {string} projectId Project unique ID.
850
+ * @property {string} keyId Key unique ID.
851
+ * @property {string} name Key name. Max length: 128 chars.
852
+ * @property {string} expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
853
+ * @property {boolean} overrideForCli
854
+ * @property {boolean} parseOutput
855
+ * @property {libClient | undefined} sdk
856
+ */
857
+
858
+ /**
859
+ * @param {ProjectsUpdateDevKeyRequestParams} params
860
+ */
861
+ const projectsUpdateDevKey = async ({projectId,keyId,name,expire,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
862
+ let client = !sdk ? await sdkForConsole() :
863
+ sdk;
864
+ let apiPath = '/projects/{projectId}/dev-keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
865
+ let payload = {};
866
+ if (typeof name !== 'undefined') {
867
+ payload['name'] = name;
868
+ }
869
+ if (typeof expire !== 'undefined') {
870
+ payload['expire'] = expire;
871
+ }
872
+
873
+ let response = undefined;
874
+
875
+ response = await client.call('put', apiPath, {
876
+ 'content-type': 'application/json',
877
+ }, payload);
878
+
879
+ if (parseOutput) {
880
+ parse(response)
881
+ }
882
+
883
+ return response;
884
+
885
+ }
886
+
887
+ /**
888
+ * @typedef {Object} ProjectsDeleteDevKeyRequestParams
889
+ * @property {string} projectId Project unique ID.
890
+ * @property {string} keyId Key unique ID.
891
+ * @property {boolean} overrideForCli
892
+ * @property {boolean} parseOutput
893
+ * @property {libClient | undefined} sdk
894
+ */
895
+
896
+ /**
897
+ * @param {ProjectsDeleteDevKeyRequestParams} params
898
+ */
899
+ const projectsDeleteDevKey = async ({projectId,keyId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
900
+ let client = !sdk ? await sdkForConsole() :
901
+ sdk;
902
+ let apiPath = '/projects/{projectId}/dev-keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
903
+ let payload = {};
904
+
905
+ let response = undefined;
906
+
907
+ response = await client.call('delete', apiPath, {
908
+ 'content-type': 'application/json',
909
+ }, payload);
910
+
911
+ if (parseOutput) {
912
+ parse(response)
913
+ }
914
+
915
+ return response;
916
+
917
+ }
918
+
919
+ /**
920
+ * @typedef {Object} ProjectsCreateJWTRequestParams
921
+ * @property {string} projectId Project unique ID.
922
+ * @property {string[]} scopes List of scopes allowed for JWT key. Maximum of 100 scopes are allowed.
923
+ * @property {number} duration Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.
924
+ * @property {boolean} overrideForCli
925
+ * @property {boolean} parseOutput
926
+ * @property {libClient | undefined} sdk
927
+ */
928
+
929
+ /**
930
+ * @param {ProjectsCreateJWTRequestParams} params
931
+ */
932
+ const projectsCreateJWT = async ({projectId,scopes,duration,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
933
+ let client = !sdk ? await sdkForConsole() :
934
+ sdk;
935
+ let apiPath = '/projects/{projectId}/jwts'.replace('{projectId}', projectId);
936
+ let payload = {};
937
+ scopes = scopes === true ? [] : scopes;
938
+ if (typeof scopes !== 'undefined') {
939
+ payload['scopes'] = scopes;
940
+ }
941
+ if (typeof duration !== 'undefined') {
942
+ payload['duration'] = duration;
943
+ }
944
+
945
+ let response = undefined;
946
+
947
+ response = await client.call('post', apiPath, {
948
+ 'content-type': 'application/json',
949
+ }, payload);
950
+
951
+ if (parseOutput) {
952
+ parse(response)
953
+ }
954
+
955
+ return response;
956
+
957
+ }
958
+
959
+ /**
960
+ * @typedef {Object} ProjectsListKeysRequestParams
961
+ * @property {string} projectId Project unique ID.
962
+ * @property {boolean} overrideForCli
963
+ * @property {boolean} parseOutput
964
+ * @property {libClient | undefined} sdk
965
+ */
966
+
967
+ /**
968
+ * @param {ProjectsListKeysRequestParams} params
969
+ */
970
+ const projectsListKeys = async ({projectId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
971
+ let client = !sdk ? await sdkForConsole() :
972
+ sdk;
973
+ let apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
974
+ let payload = {};
975
+
976
+ let response = undefined;
977
+
978
+ response = await client.call('get', apiPath, {
979
+ }, payload);
980
+
981
+ if (parseOutput) {
982
+ if(console) {
983
+ showConsoleLink('projects', 'listKeys', projectId);
984
+ } else {
985
+ parse(response)
986
+ }
987
+ }
988
+
989
+ return response;
990
+
991
+ }
992
+
993
+ /**
994
+ * @typedef {Object} ProjectsCreateKeyRequestParams
995
+ * @property {string} projectId Project unique ID.
996
+ * @property {string} name Key name. Max length: 128 chars.
997
+ * @property {string[]} scopes Key scopes list. Maximum of 100 scopes are allowed.
998
+ * @property {string} expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
999
+ * @property {boolean} overrideForCli
1000
+ * @property {boolean} parseOutput
1001
+ * @property {libClient | undefined} sdk
1002
+ */
1003
+
1004
+ /**
1005
+ * @param {ProjectsCreateKeyRequestParams} params
1006
+ */
1007
+ const projectsCreateKey = async ({projectId,name,scopes,expire,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1008
+ let client = !sdk ? await sdkForConsole() :
1009
+ sdk;
1010
+ let apiPath = '/projects/{projectId}/keys'.replace('{projectId}', projectId);
1011
+ let payload = {};
1012
+ if (typeof name !== 'undefined') {
1013
+ payload['name'] = name;
1014
+ }
1015
+ scopes = scopes === true ? [] : scopes;
1016
+ if (typeof scopes !== 'undefined') {
1017
+ payload['scopes'] = scopes;
1018
+ }
1019
+ if (typeof expire !== 'undefined') {
1020
+ payload['expire'] = expire;
1021
+ }
1022
+
1023
+ let response = undefined;
1024
+
1025
+ response = await client.call('post', apiPath, {
1026
+ 'content-type': 'application/json',
1027
+ }, payload);
1028
+
1029
+ if (parseOutput) {
1030
+ parse(response)
1031
+ }
1032
+
1033
+ return response;
1034
+
1035
+ }
1036
+
1037
+ /**
1038
+ * @typedef {Object} ProjectsGetKeyRequestParams
1039
+ * @property {string} projectId Project unique ID.
1040
+ * @property {string} keyId Key unique ID.
1041
+ * @property {boolean} overrideForCli
1042
+ * @property {boolean} parseOutput
1043
+ * @property {libClient | undefined} sdk
1044
+ */
1045
+
1046
+ /**
1047
+ * @param {ProjectsGetKeyRequestParams} params
1048
+ */
1049
+ const projectsGetKey = async ({projectId,keyId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1050
+ let client = !sdk ? await sdkForConsole() :
1051
+ sdk;
1052
+ let apiPath = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
1053
+ let payload = {};
1054
+
1055
+ let response = undefined;
1056
+
1057
+ response = await client.call('get', apiPath, {
1058
+ }, payload);
1059
+
1060
+ if (parseOutput) {
1061
+ if(console) {
1062
+ showConsoleLink('projects', 'getKey', projectId, keyId);
1063
+ } else {
1064
+ parse(response)
1065
+ }
1066
+ }
1067
+
1068
+ return response;
1069
+
1070
+ }
1071
+
1072
+ /**
1073
+ * @typedef {Object} ProjectsUpdateKeyRequestParams
1074
+ * @property {string} projectId Project unique ID.
1075
+ * @property {string} keyId Key unique ID.
1076
+ * @property {string} name Key name. Max length: 128 chars.
1077
+ * @property {string[]} scopes Key scopes list. Maximum of 100 events are allowed.
1078
+ * @property {string} expire Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.
1079
+ * @property {boolean} overrideForCli
1080
+ * @property {boolean} parseOutput
1081
+ * @property {libClient | undefined} sdk
1082
+ */
1083
+
1084
+ /**
1085
+ * @param {ProjectsUpdateKeyRequestParams} params
1086
+ */
1087
+ const projectsUpdateKey = async ({projectId,keyId,name,scopes,expire,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1088
+ let client = !sdk ? await sdkForConsole() :
1089
+ sdk;
1090
+ let apiPath = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
1091
+ let payload = {};
1092
+ if (typeof name !== 'undefined') {
1093
+ payload['name'] = name;
1094
+ }
1095
+ scopes = scopes === true ? [] : scopes;
1096
+ if (typeof scopes !== 'undefined') {
1097
+ payload['scopes'] = scopes;
1098
+ }
1099
+ if (typeof expire !== 'undefined') {
1100
+ payload['expire'] = expire;
1101
+ }
1102
+
1103
+ let response = undefined;
1104
+
1105
+ response = await client.call('put', apiPath, {
1106
+ 'content-type': 'application/json',
1107
+ }, payload);
1108
+
1109
+ if (parseOutput) {
1110
+ parse(response)
1111
+ }
1112
+
1113
+ return response;
1114
+
1115
+ }
1116
+
1117
+ /**
1118
+ * @typedef {Object} ProjectsDeleteKeyRequestParams
1119
+ * @property {string} projectId Project unique ID.
1120
+ * @property {string} keyId Key unique ID.
1121
+ * @property {boolean} overrideForCli
1122
+ * @property {boolean} parseOutput
1123
+ * @property {libClient | undefined} sdk
1124
+ */
1125
+
1126
+ /**
1127
+ * @param {ProjectsDeleteKeyRequestParams} params
1128
+ */
1129
+ const projectsDeleteKey = async ({projectId,keyId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1130
+ let client = !sdk ? await sdkForConsole() :
1131
+ sdk;
1132
+ let apiPath = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);
1133
+ let payload = {};
1134
+
1135
+ let response = undefined;
1136
+
1137
+ response = await client.call('delete', apiPath, {
1138
+ 'content-type': 'application/json',
1139
+ }, payload);
1140
+
1141
+ if (parseOutput) {
1142
+ parse(response)
1143
+ }
1144
+
1145
+ return response;
1146
+
1147
+ }
1148
+
1149
+ /**
1150
+ * @typedef {Object} ProjectsUpdateOAuth2RequestParams
1151
+ * @property {string} projectId Project unique ID.
1152
+ * @property {OAuthProvider} provider Provider Name
1153
+ * @property {string} appId Provider app ID. Max length: 256 chars.
1154
+ * @property {string} secret Provider secret key. Max length: 512 chars.
1155
+ * @property {boolean} enabled Provider status. Set to 'false' to disable new session creation.
1156
+ * @property {boolean} overrideForCli
1157
+ * @property {boolean} parseOutput
1158
+ * @property {libClient | undefined} sdk
1159
+ */
1160
+
1161
+ /**
1162
+ * @param {ProjectsUpdateOAuth2RequestParams} params
1163
+ */
1164
+ const projectsUpdateOAuth2 = async ({projectId,provider,appId,secret,enabled,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1165
+ let client = !sdk ? await sdkForConsole() :
1166
+ sdk;
1167
+ let apiPath = '/projects/{projectId}/oauth2'.replace('{projectId}', projectId);
1168
+ let payload = {};
1169
+ if (typeof provider !== 'undefined') {
1170
+ payload['provider'] = provider;
1171
+ }
1172
+ if (typeof appId !== 'undefined') {
1173
+ payload['appId'] = appId;
1174
+ }
1175
+ if (typeof secret !== 'undefined') {
1176
+ payload['secret'] = secret;
1177
+ }
1178
+ if (typeof enabled !== 'undefined') {
1179
+ payload['enabled'] = enabled;
1180
+ }
1181
+
1182
+ let response = undefined;
1183
+
1184
+ response = await client.call('patch', apiPath, {
1185
+ 'content-type': 'application/json',
1186
+ }, payload);
1187
+
1188
+ if (parseOutput) {
1189
+ parse(response)
1190
+ }
1191
+
1192
+ return response;
1193
+
1194
+ }
1195
+
1196
+ /**
1197
+ * @typedef {Object} ProjectsListPlatformsRequestParams
1198
+ * @property {string} projectId Project unique ID.
1199
+ * @property {boolean} overrideForCli
1200
+ * @property {boolean} parseOutput
1201
+ * @property {libClient | undefined} sdk
1202
+ */
1203
+
1204
+ /**
1205
+ * @param {ProjectsListPlatformsRequestParams} params
1206
+ */
1207
+ const projectsListPlatforms = async ({projectId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1208
+ let client = !sdk ? await sdkForConsole() :
1209
+ sdk;
1210
+ let apiPath = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);
1211
+ let payload = {};
1212
+
1213
+ let response = undefined;
1214
+
1215
+ response = await client.call('get', apiPath, {
1216
+ }, payload);
1217
+
1218
+ if (parseOutput) {
1219
+ if(console) {
1220
+ showConsoleLink('projects', 'listPlatforms', projectId);
1221
+ } else {
1222
+ parse(response)
1223
+ }
1224
+ }
1225
+
1226
+ return response;
1227
+
1228
+ }
1229
+
1230
+ /**
1231
+ * @typedef {Object} ProjectsCreatePlatformRequestParams
1232
+ * @property {string} projectId Project unique ID.
1233
+ * @property {PlatformType} type Platform type.
1234
+ * @property {string} name Platform name. Max length: 128 chars.
1235
+ * @property {string} key Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.
1236
+ * @property {string} store App store or Google Play store ID. Max length: 256 chars.
1237
+ * @property {string} hostname Platform client hostname. Max length: 256 chars.
1238
+ * @property {boolean} overrideForCli
1239
+ * @property {boolean} parseOutput
1240
+ * @property {libClient | undefined} sdk
1241
+ */
1242
+
1243
+ /**
1244
+ * @param {ProjectsCreatePlatformRequestParams} params
1245
+ */
1246
+ const projectsCreatePlatform = async ({projectId,type,name,key,store,hostname,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1247
+ let client = !sdk ? await sdkForConsole() :
1248
+ sdk;
1249
+ let apiPath = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);
1250
+ let payload = {};
1251
+ if (typeof type !== 'undefined') {
1252
+ payload['type'] = type;
1253
+ }
1254
+ if (typeof name !== 'undefined') {
1255
+ payload['name'] = name;
1256
+ }
1257
+ if (typeof key !== 'undefined') {
1258
+ payload['key'] = key;
1259
+ }
1260
+ if (typeof store !== 'undefined') {
1261
+ payload['store'] = store;
1262
+ }
1263
+ if (typeof hostname !== 'undefined') {
1264
+ payload['hostname'] = hostname;
1265
+ }
1266
+
1267
+ let response = undefined;
1268
+
1269
+ response = await client.call('post', apiPath, {
1270
+ 'content-type': 'application/json',
1271
+ }, payload);
1272
+
1273
+ if (parseOutput) {
1274
+ parse(response)
1275
+ }
1276
+
1277
+ return response;
1278
+
1279
+ }
1280
+
1281
+ /**
1282
+ * @typedef {Object} ProjectsGetPlatformRequestParams
1283
+ * @property {string} projectId Project unique ID.
1284
+ * @property {string} platformId Platform unique ID.
1285
+ * @property {boolean} overrideForCli
1286
+ * @property {boolean} parseOutput
1287
+ * @property {libClient | undefined} sdk
1288
+ */
1289
+
1290
+ /**
1291
+ * @param {ProjectsGetPlatformRequestParams} params
1292
+ */
1293
+ const projectsGetPlatform = async ({projectId,platformId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1294
+ let client = !sdk ? await sdkForConsole() :
1295
+ sdk;
1296
+ let apiPath = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
1297
+ let payload = {};
1298
+
1299
+ let response = undefined;
1300
+
1301
+ response = await client.call('get', apiPath, {
1302
+ }, payload);
1303
+
1304
+ if (parseOutput) {
1305
+ if(console) {
1306
+ showConsoleLink('projects', 'getPlatform', projectId, platformId);
1307
+ } else {
1308
+ parse(response)
1309
+ }
1310
+ }
1311
+
1312
+ return response;
1313
+
1314
+ }
1315
+
1316
+ /**
1317
+ * @typedef {Object} ProjectsUpdatePlatformRequestParams
1318
+ * @property {string} projectId Project unique ID.
1319
+ * @property {string} platformId Platform unique ID.
1320
+ * @property {string} name Platform name. Max length: 128 chars.
1321
+ * @property {string} key Package name for android or bundle ID for iOS. Max length: 256 chars.
1322
+ * @property {string} store App store or Google Play store ID. Max length: 256 chars.
1323
+ * @property {string} hostname Platform client URL. Max length: 256 chars.
1324
+ * @property {boolean} overrideForCli
1325
+ * @property {boolean} parseOutput
1326
+ * @property {libClient | undefined} sdk
1327
+ */
1328
+
1329
+ /**
1330
+ * @param {ProjectsUpdatePlatformRequestParams} params
1331
+ */
1332
+ const projectsUpdatePlatform = async ({projectId,platformId,name,key,store,hostname,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1333
+ let client = !sdk ? await sdkForConsole() :
1334
+ sdk;
1335
+ let apiPath = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
1336
+ let payload = {};
1337
+ if (typeof name !== 'undefined') {
1338
+ payload['name'] = name;
1339
+ }
1340
+ if (typeof key !== 'undefined') {
1341
+ payload['key'] = key;
1342
+ }
1343
+ if (typeof store !== 'undefined') {
1344
+ payload['store'] = store;
1345
+ }
1346
+ if (typeof hostname !== 'undefined') {
1347
+ payload['hostname'] = hostname;
1348
+ }
1349
+
1350
+ let response = undefined;
1351
+
1352
+ response = await client.call('put', apiPath, {
1353
+ 'content-type': 'application/json',
1354
+ }, payload);
1355
+
1356
+ if (parseOutput) {
1357
+ parse(response)
1358
+ }
1359
+
1360
+ return response;
1361
+
1362
+ }
1363
+
1364
+ /**
1365
+ * @typedef {Object} ProjectsDeletePlatformRequestParams
1366
+ * @property {string} projectId Project unique ID.
1367
+ * @property {string} platformId Platform unique ID.
1368
+ * @property {boolean} overrideForCli
1369
+ * @property {boolean} parseOutput
1370
+ * @property {libClient | undefined} sdk
1371
+ */
1372
+
1373
+ /**
1374
+ * @param {ProjectsDeletePlatformRequestParams} params
1375
+ */
1376
+ const projectsDeletePlatform = async ({projectId,platformId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1377
+ let client = !sdk ? await sdkForConsole() :
1378
+ sdk;
1379
+ let apiPath = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);
1380
+ let payload = {};
1381
+
1382
+ let response = undefined;
1383
+
1384
+ response = await client.call('delete', apiPath, {
1385
+ 'content-type': 'application/json',
1386
+ }, payload);
1387
+
1388
+ if (parseOutput) {
1389
+ parse(response)
1390
+ }
1391
+
1392
+ return response;
1393
+
1394
+ }
1395
+
1396
+ /**
1397
+ * @typedef {Object} ProjectsUpdateServiceStatusRequestParams
1398
+ * @property {string} projectId Project unique ID.
1399
+ * @property {ApiService} service Service name.
1400
+ * @property {boolean} status Service status.
1401
+ * @property {boolean} overrideForCli
1402
+ * @property {boolean} parseOutput
1403
+ * @property {libClient | undefined} sdk
1404
+ */
1405
+
1406
+ /**
1407
+ * @param {ProjectsUpdateServiceStatusRequestParams} params
1408
+ */
1409
+ const projectsUpdateServiceStatus = async ({projectId,service,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1410
+ let client = !sdk ? await sdkForConsole() :
1411
+ sdk;
1412
+ let apiPath = '/projects/{projectId}/service'.replace('{projectId}', projectId);
1413
+ let payload = {};
1414
+ if (typeof service !== 'undefined') {
1415
+ payload['service'] = service;
1416
+ }
1417
+ if (typeof status !== 'undefined') {
1418
+ payload['status'] = status;
1419
+ }
1420
+
1421
+ let response = undefined;
1422
+
1423
+ response = await client.call('patch', apiPath, {
1424
+ 'content-type': 'application/json',
1425
+ }, payload);
1426
+
1427
+ if (parseOutput) {
1428
+ parse(response)
1429
+ }
1430
+
1431
+ return response;
1432
+
1433
+ }
1434
+
1435
+ /**
1436
+ * @typedef {Object} ProjectsUpdateServiceStatusAllRequestParams
1437
+ * @property {string} projectId Project unique ID.
1438
+ * @property {boolean} status Service status.
1439
+ * @property {boolean} overrideForCli
1440
+ * @property {boolean} parseOutput
1441
+ * @property {libClient | undefined} sdk
1442
+ */
1443
+
1444
+ /**
1445
+ * @param {ProjectsUpdateServiceStatusAllRequestParams} params
1446
+ */
1447
+ const projectsUpdateServiceStatusAll = async ({projectId,status,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1448
+ let client = !sdk ? await sdkForConsole() :
1449
+ sdk;
1450
+ let apiPath = '/projects/{projectId}/service/all'.replace('{projectId}', projectId);
1451
+ let payload = {};
1452
+ if (typeof status !== 'undefined') {
1453
+ payload['status'] = status;
1454
+ }
1455
+
1456
+ let response = undefined;
1457
+
1458
+ response = await client.call('patch', apiPath, {
1459
+ 'content-type': 'application/json',
1460
+ }, payload);
1461
+
1462
+ if (parseOutput) {
1463
+ parse(response)
1464
+ }
1465
+
1466
+ return response;
1467
+
1468
+ }
1469
+
1470
+ /**
1471
+ * @typedef {Object} ProjectsUpdateSmtpRequestParams
1472
+ * @property {string} projectId Project unique ID.
1473
+ * @property {boolean} enabled Enable custom SMTP service
1474
+ * @property {string} senderName Name of the email sender
1475
+ * @property {string} senderEmail Email of the sender
1476
+ * @property {string} replyTo Reply to email
1477
+ * @property {string} host SMTP server host name
1478
+ * @property {number} port SMTP server port
1479
+ * @property {string} username SMTP server username
1480
+ * @property {string} password SMTP server password
1481
+ * @property {SMTPSecure} secure Does SMTP server use secure connection
1482
+ * @property {boolean} overrideForCli
1483
+ * @property {boolean} parseOutput
1484
+ * @property {libClient | undefined} sdk
1485
+ */
1486
+
1487
+ /**
1488
+ * @param {ProjectsUpdateSmtpRequestParams} params
1489
+ */
1490
+ const projectsUpdateSmtp = async ({projectId,enabled,senderName,senderEmail,replyTo,host,port,username,password,secure,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1491
+ let client = !sdk ? await sdkForConsole() :
1492
+ sdk;
1493
+ let apiPath = '/projects/{projectId}/smtp'.replace('{projectId}', projectId);
1494
+ let payload = {};
1495
+ if (typeof enabled !== 'undefined') {
1496
+ payload['enabled'] = enabled;
1497
+ }
1498
+ if (typeof senderName !== 'undefined') {
1499
+ payload['senderName'] = senderName;
1500
+ }
1501
+ if (typeof senderEmail !== 'undefined') {
1502
+ payload['senderEmail'] = senderEmail;
1503
+ }
1504
+ if (typeof replyTo !== 'undefined') {
1505
+ payload['replyTo'] = replyTo;
1506
+ }
1507
+ if (typeof host !== 'undefined') {
1508
+ payload['host'] = host;
1509
+ }
1510
+ if (typeof port !== 'undefined') {
1511
+ payload['port'] = port;
1512
+ }
1513
+ if (typeof username !== 'undefined') {
1514
+ payload['username'] = username;
1515
+ }
1516
+ if (typeof password !== 'undefined') {
1517
+ payload['password'] = password;
1518
+ }
1519
+ if (typeof secure !== 'undefined') {
1520
+ payload['secure'] = secure;
1521
+ }
1522
+
1523
+ let response = undefined;
1524
+
1525
+ response = await client.call('patch', apiPath, {
1526
+ 'content-type': 'application/json',
1527
+ }, payload);
1528
+
1529
+ if (parseOutput) {
1530
+ parse(response)
1531
+ }
1532
+
1533
+ return response;
1534
+
1535
+ }
1536
+
1537
+ /**
1538
+ * @typedef {Object} ProjectsCreateSmtpTestRequestParams
1539
+ * @property {string} projectId Project unique ID.
1540
+ * @property {string[]} emails Array of emails to send test email to. Maximum of 10 emails are allowed.
1541
+ * @property {string} senderName Name of the email sender
1542
+ * @property {string} senderEmail Email of the sender
1543
+ * @property {string} host SMTP server host name
1544
+ * @property {string} replyTo Reply to email
1545
+ * @property {number} port SMTP server port
1546
+ * @property {string} username SMTP server username
1547
+ * @property {string} password SMTP server password
1548
+ * @property {SMTPSecure} secure Does SMTP server use secure connection
1549
+ * @property {boolean} overrideForCli
1550
+ * @property {boolean} parseOutput
1551
+ * @property {libClient | undefined} sdk
1552
+ */
1553
+
1554
+ /**
1555
+ * @param {ProjectsCreateSmtpTestRequestParams} params
1556
+ */
1557
+ const projectsCreateSmtpTest = async ({projectId,emails,senderName,senderEmail,host,replyTo,port,username,password,secure,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1558
+ let client = !sdk ? await sdkForConsole() :
1559
+ sdk;
1560
+ let apiPath = '/projects/{projectId}/smtp/tests'.replace('{projectId}', projectId);
1561
+ let payload = {};
1562
+ emails = emails === true ? [] : emails;
1563
+ if (typeof emails !== 'undefined') {
1564
+ payload['emails'] = emails;
1565
+ }
1566
+ if (typeof senderName !== 'undefined') {
1567
+ payload['senderName'] = senderName;
1568
+ }
1569
+ if (typeof senderEmail !== 'undefined') {
1570
+ payload['senderEmail'] = senderEmail;
1571
+ }
1572
+ if (typeof replyTo !== 'undefined') {
1573
+ payload['replyTo'] = replyTo;
1574
+ }
1575
+ if (typeof host !== 'undefined') {
1576
+ payload['host'] = host;
1577
+ }
1578
+ if (typeof port !== 'undefined') {
1579
+ payload['port'] = port;
1580
+ }
1581
+ if (typeof username !== 'undefined') {
1582
+ payload['username'] = username;
1583
+ }
1584
+ if (typeof password !== 'undefined') {
1585
+ payload['password'] = password;
1586
+ }
1587
+ if (typeof secure !== 'undefined') {
1588
+ payload['secure'] = secure;
1589
+ }
1590
+
1591
+ let response = undefined;
1592
+
1593
+ response = await client.call('post', apiPath, {
1594
+ 'content-type': 'application/json',
1595
+ }, payload);
1596
+
1597
+ if (parseOutput) {
1598
+ parse(response)
1599
+ }
1600
+
1601
+ return response;
1602
+
1603
+ }
1604
+
1605
+ /**
1606
+ * @typedef {Object} ProjectsUpdateTeamRequestParams
1607
+ * @property {string} projectId Project unique ID.
1608
+ * @property {string} teamId Team ID of the team to transfer project to.
1609
+ * @property {boolean} overrideForCli
1610
+ * @property {boolean} parseOutput
1611
+ * @property {libClient | undefined} sdk
1612
+ */
1613
+
1614
+ /**
1615
+ * @param {ProjectsUpdateTeamRequestParams} params
1616
+ */
1617
+ const projectsUpdateTeam = async ({projectId,teamId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1618
+ let client = !sdk ? await sdkForConsole() :
1619
+ sdk;
1620
+ let apiPath = '/projects/{projectId}/team'.replace('{projectId}', projectId);
1621
+ let payload = {};
1622
+ if (typeof teamId !== 'undefined') {
1623
+ payload['teamId'] = teamId;
1624
+ }
1625
+
1626
+ let response = undefined;
1627
+
1628
+ response = await client.call('patch', apiPath, {
1629
+ 'content-type': 'application/json',
1630
+ }, payload);
1631
+
1632
+ if (parseOutput) {
1633
+ parse(response)
1634
+ }
1635
+
1636
+ return response;
1637
+
1638
+ }
1639
+
1640
+ /**
1641
+ * @typedef {Object} ProjectsGetEmailTemplateRequestParams
1642
+ * @property {string} projectId Project unique ID.
1643
+ * @property {EmailTemplateType} type Template type
1644
+ * @property {EmailTemplateLocale} locale Template locale
1645
+ * @property {boolean} overrideForCli
1646
+ * @property {boolean} parseOutput
1647
+ * @property {libClient | undefined} sdk
1648
+ */
1649
+
1650
+ /**
1651
+ * @param {ProjectsGetEmailTemplateRequestParams} params
1652
+ */
1653
+ const projectsGetEmailTemplate = async ({projectId,type,locale,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1654
+ let client = !sdk ? await sdkForConsole() :
1655
+ sdk;
1656
+ let apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1657
+ let payload = {};
1658
+
1659
+ let response = undefined;
1660
+
1661
+ response = await client.call('get', apiPath, {
1662
+ }, payload);
1663
+
1664
+ if (parseOutput) {
1665
+ parse(response)
1666
+ }
1667
+
1668
+ return response;
1669
+
1670
+ }
1671
+
1672
+ /**
1673
+ * @typedef {Object} ProjectsUpdateEmailTemplateRequestParams
1674
+ * @property {string} projectId Project unique ID.
1675
+ * @property {EmailTemplateType} type Template type
1676
+ * @property {EmailTemplateLocale} locale Template locale
1677
+ * @property {string} subject Email Subject
1678
+ * @property {string} message Template message
1679
+ * @property {string} senderName Name of the email sender
1680
+ * @property {string} senderEmail Email of the sender
1681
+ * @property {string} replyTo Reply to email
1682
+ * @property {boolean} overrideForCli
1683
+ * @property {boolean} parseOutput
1684
+ * @property {libClient | undefined} sdk
1685
+ */
1686
+
1687
+ /**
1688
+ * @param {ProjectsUpdateEmailTemplateRequestParams} params
1689
+ */
1690
+ const projectsUpdateEmailTemplate = async ({projectId,type,locale,subject,message,senderName,senderEmail,replyTo,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1691
+ let client = !sdk ? await sdkForConsole() :
1692
+ sdk;
1693
+ let apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1694
+ let payload = {};
1695
+ if (typeof subject !== 'undefined') {
1696
+ payload['subject'] = subject;
1697
+ }
1698
+ if (typeof message !== 'undefined') {
1699
+ payload['message'] = message;
1700
+ }
1701
+ if (typeof senderName !== 'undefined') {
1702
+ payload['senderName'] = senderName;
1703
+ }
1704
+ if (typeof senderEmail !== 'undefined') {
1705
+ payload['senderEmail'] = senderEmail;
1706
+ }
1707
+ if (typeof replyTo !== 'undefined') {
1708
+ payload['replyTo'] = replyTo;
1709
+ }
1710
+
1711
+ let response = undefined;
1712
+
1713
+ response = await client.call('patch', apiPath, {
1714
+ 'content-type': 'application/json',
1715
+ }, payload);
1716
+
1717
+ if (parseOutput) {
1718
+ parse(response)
1719
+ }
1720
+
1721
+ return response;
1722
+
1723
+ }
1724
+
1725
+ /**
1726
+ * @typedef {Object} ProjectsDeleteEmailTemplateRequestParams
1727
+ * @property {string} projectId Project unique ID.
1728
+ * @property {EmailTemplateType} type Template type
1729
+ * @property {EmailTemplateLocale} locale Template locale
1730
+ * @property {boolean} overrideForCli
1731
+ * @property {boolean} parseOutput
1732
+ * @property {libClient | undefined} sdk
1733
+ */
1734
+
1735
+ /**
1736
+ * @param {ProjectsDeleteEmailTemplateRequestParams} params
1737
+ */
1738
+ const projectsDeleteEmailTemplate = async ({projectId,type,locale,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1739
+ let client = !sdk ? await sdkForConsole() :
1740
+ sdk;
1741
+ let apiPath = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1742
+ let payload = {};
1743
+
1744
+ let response = undefined;
1745
+
1746
+ response = await client.call('delete', apiPath, {
1747
+ 'content-type': 'application/json',
1748
+ }, payload);
1749
+
1750
+ if (parseOutput) {
1751
+ parse(response)
1752
+ }
1753
+
1754
+ return response;
1755
+
1756
+ }
1757
+
1758
+ /**
1759
+ * @typedef {Object} ProjectsGetSmsTemplateRequestParams
1760
+ * @property {string} projectId Project unique ID.
1761
+ * @property {SmsTemplateType} type Template type
1762
+ * @property {SmsTemplateLocale} locale Template locale
1763
+ * @property {boolean} overrideForCli
1764
+ * @property {boolean} parseOutput
1765
+ * @property {libClient | undefined} sdk
1766
+ */
1767
+
1768
+ /**
1769
+ * @param {ProjectsGetSmsTemplateRequestParams} params
1770
+ */
1771
+ const projectsGetSmsTemplate = async ({projectId,type,locale,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1772
+ let client = !sdk ? await sdkForConsole() :
1773
+ sdk;
1774
+ let apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1775
+ let payload = {};
1776
+
1777
+ let response = undefined;
1778
+
1779
+ response = await client.call('get', apiPath, {
1780
+ }, payload);
1781
+
1782
+ if (parseOutput) {
1783
+ parse(response)
1784
+ }
1785
+
1786
+ return response;
1787
+
1788
+ }
1789
+
1790
+ /**
1791
+ * @typedef {Object} ProjectsUpdateSmsTemplateRequestParams
1792
+ * @property {string} projectId Project unique ID.
1793
+ * @property {SmsTemplateType} type Template type
1794
+ * @property {SmsTemplateLocale} locale Template locale
1795
+ * @property {string} message Template message
1796
+ * @property {boolean} overrideForCli
1797
+ * @property {boolean} parseOutput
1798
+ * @property {libClient | undefined} sdk
1799
+ */
1800
+
1801
+ /**
1802
+ * @param {ProjectsUpdateSmsTemplateRequestParams} params
1803
+ */
1804
+ const projectsUpdateSmsTemplate = async ({projectId,type,locale,message,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1805
+ let client = !sdk ? await sdkForConsole() :
1806
+ sdk;
1807
+ let apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1808
+ let payload = {};
1809
+ if (typeof message !== 'undefined') {
1810
+ payload['message'] = message;
1811
+ }
1812
+
1813
+ let response = undefined;
1814
+
1815
+ response = await client.call('patch', apiPath, {
1816
+ 'content-type': 'application/json',
1817
+ }, payload);
1818
+
1819
+ if (parseOutput) {
1820
+ parse(response)
1821
+ }
1822
+
1823
+ return response;
1824
+
1825
+ }
1826
+
1827
+ /**
1828
+ * @typedef {Object} ProjectsDeleteSmsTemplateRequestParams
1829
+ * @property {string} projectId Project unique ID.
1830
+ * @property {SmsTemplateType} type Template type
1831
+ * @property {SmsTemplateLocale} locale Template locale
1832
+ * @property {boolean} overrideForCli
1833
+ * @property {boolean} parseOutput
1834
+ * @property {libClient | undefined} sdk
1835
+ */
1836
+
1837
+ /**
1838
+ * @param {ProjectsDeleteSmsTemplateRequestParams} params
1839
+ */
1840
+ const projectsDeleteSmsTemplate = async ({projectId,type,locale,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1841
+ let client = !sdk ? await sdkForConsole() :
1842
+ sdk;
1843
+ let apiPath = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);
1844
+ let payload = {};
1845
+
1846
+ let response = undefined;
1847
+
1848
+ response = await client.call('delete', apiPath, {
1849
+ 'content-type': 'application/json',
1850
+ }, payload);
1851
+
1852
+ if (parseOutput) {
1853
+ parse(response)
1854
+ }
1855
+
1856
+ return response;
1857
+
1858
+ }
1859
+
1860
+ /**
1861
+ * @typedef {Object} ProjectsListWebhooksRequestParams
1862
+ * @property {string} projectId Project unique ID.
1863
+ * @property {boolean} overrideForCli
1864
+ * @property {boolean} parseOutput
1865
+ * @property {libClient | undefined} sdk
1866
+ */
1867
+
1868
+ /**
1869
+ * @param {ProjectsListWebhooksRequestParams} params
1870
+ */
1871
+ const projectsListWebhooks = async ({projectId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1872
+ let client = !sdk ? await sdkForConsole() :
1873
+ sdk;
1874
+ let apiPath = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
1875
+ let payload = {};
1876
+
1877
+ let response = undefined;
1878
+
1879
+ response = await client.call('get', apiPath, {
1880
+ }, payload);
1881
+
1882
+ if (parseOutput) {
1883
+ if(console) {
1884
+ showConsoleLink('projects', 'listWebhooks', projectId);
1885
+ } else {
1886
+ parse(response)
1887
+ }
1888
+ }
1889
+
1890
+ return response;
1891
+
1892
+ }
1893
+
1894
+ /**
1895
+ * @typedef {Object} ProjectsCreateWebhookRequestParams
1896
+ * @property {string} projectId Project unique ID.
1897
+ * @property {string} name Webhook name. Max length: 128 chars.
1898
+ * @property {string[]} events Events list. Maximum of 100 events are allowed.
1899
+ * @property {string} url Webhook URL.
1900
+ * @property {boolean} security Certificate verification, false for disabled or true for enabled.
1901
+ * @property {boolean} enabled Enable or disable a webhook.
1902
+ * @property {string} httpUser Webhook HTTP user. Max length: 256 chars.
1903
+ * @property {string} httpPass Webhook HTTP password. Max length: 256 chars.
1904
+ * @property {boolean} overrideForCli
1905
+ * @property {boolean} parseOutput
1906
+ * @property {libClient | undefined} sdk
1907
+ */
1908
+
1909
+ /**
1910
+ * @param {ProjectsCreateWebhookRequestParams} params
1911
+ */
1912
+ const projectsCreateWebhook = async ({projectId,name,events,url,security,enabled,httpUser,httpPass,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1913
+ let client = !sdk ? await sdkForConsole() :
1914
+ sdk;
1915
+ let apiPath = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);
1916
+ let payload = {};
1917
+ if (typeof name !== 'undefined') {
1918
+ payload['name'] = name;
1919
+ }
1920
+ if (typeof enabled !== 'undefined') {
1921
+ payload['enabled'] = enabled;
1922
+ }
1923
+ events = events === true ? [] : events;
1924
+ if (typeof events !== 'undefined') {
1925
+ payload['events'] = events;
1926
+ }
1927
+ if (typeof url !== 'undefined') {
1928
+ payload['url'] = url;
1929
+ }
1930
+ if (typeof security !== 'undefined') {
1931
+ payload['security'] = security;
1932
+ }
1933
+ if (typeof httpUser !== 'undefined') {
1934
+ payload['httpUser'] = httpUser;
1935
+ }
1936
+ if (typeof httpPass !== 'undefined') {
1937
+ payload['httpPass'] = httpPass;
1938
+ }
1939
+
1940
+ let response = undefined;
1941
+
1942
+ response = await client.call('post', apiPath, {
1943
+ 'content-type': 'application/json',
1944
+ }, payload);
1945
+
1946
+ if (parseOutput) {
1947
+ parse(response)
1948
+ }
1949
+
1950
+ return response;
1951
+
1952
+ }
1953
+
1954
+ /**
1955
+ * @typedef {Object} ProjectsGetWebhookRequestParams
1956
+ * @property {string} projectId Project unique ID.
1957
+ * @property {string} webhookId Webhook unique ID.
1958
+ * @property {boolean} overrideForCli
1959
+ * @property {boolean} parseOutput
1960
+ * @property {libClient | undefined} sdk
1961
+ */
1962
+
1963
+ /**
1964
+ * @param {ProjectsGetWebhookRequestParams} params
1965
+ */
1966
+ const projectsGetWebhook = async ({projectId,webhookId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1967
+ let client = !sdk ? await sdkForConsole() :
1968
+ sdk;
1969
+ let apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
1970
+ let payload = {};
1971
+
1972
+ let response = undefined;
1973
+
1974
+ response = await client.call('get', apiPath, {
1975
+ }, payload);
1976
+
1977
+ if (parseOutput) {
1978
+ if(console) {
1979
+ showConsoleLink('projects', 'getWebhook', projectId, webhookId);
1980
+ } else {
1981
+ parse(response)
1982
+ }
1983
+ }
1984
+
1985
+ return response;
1986
+
1987
+ }
1988
+
1989
+ /**
1990
+ * @typedef {Object} ProjectsUpdateWebhookRequestParams
1991
+ * @property {string} projectId Project unique ID.
1992
+ * @property {string} webhookId Webhook unique ID.
1993
+ * @property {string} name Webhook name. Max length: 128 chars.
1994
+ * @property {string[]} events Events list. Maximum of 100 events are allowed.
1995
+ * @property {string} url Webhook URL.
1996
+ * @property {boolean} security Certificate verification, false for disabled or true for enabled.
1997
+ * @property {boolean} enabled Enable or disable a webhook.
1998
+ * @property {string} httpUser Webhook HTTP user. Max length: 256 chars.
1999
+ * @property {string} httpPass Webhook HTTP password. Max length: 256 chars.
2000
+ * @property {boolean} overrideForCli
2001
+ * @property {boolean} parseOutput
2002
+ * @property {libClient | undefined} sdk
2003
+ */
2004
+
2005
+ /**
2006
+ * @param {ProjectsUpdateWebhookRequestParams} params
2007
+ */
2008
+ const projectsUpdateWebhook = async ({projectId,webhookId,name,events,url,security,enabled,httpUser,httpPass,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2009
+ let client = !sdk ? await sdkForConsole() :
2010
+ sdk;
2011
+ let apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
2012
+ let payload = {};
2013
+ if (typeof name !== 'undefined') {
2014
+ payload['name'] = name;
2015
+ }
2016
+ if (typeof enabled !== 'undefined') {
2017
+ payload['enabled'] = enabled;
2018
+ }
2019
+ events = events === true ? [] : events;
2020
+ if (typeof events !== 'undefined') {
2021
+ payload['events'] = events;
2022
+ }
2023
+ if (typeof url !== 'undefined') {
2024
+ payload['url'] = url;
2025
+ }
2026
+ if (typeof security !== 'undefined') {
2027
+ payload['security'] = security;
2028
+ }
2029
+ if (typeof httpUser !== 'undefined') {
2030
+ payload['httpUser'] = httpUser;
2031
+ }
2032
+ if (typeof httpPass !== 'undefined') {
2033
+ payload['httpPass'] = httpPass;
2034
+ }
2035
+
2036
+ let response = undefined;
2037
+
2038
+ response = await client.call('put', apiPath, {
2039
+ 'content-type': 'application/json',
2040
+ }, payload);
2041
+
2042
+ if (parseOutput) {
2043
+ parse(response)
2044
+ }
2045
+
2046
+ return response;
2047
+
2048
+ }
2049
+
2050
+ /**
2051
+ * @typedef {Object} ProjectsDeleteWebhookRequestParams
2052
+ * @property {string} projectId Project unique ID.
2053
+ * @property {string} webhookId Webhook unique ID.
2054
+ * @property {boolean} overrideForCli
2055
+ * @property {boolean} parseOutput
2056
+ * @property {libClient | undefined} sdk
2057
+ */
2058
+
2059
+ /**
2060
+ * @param {ProjectsDeleteWebhookRequestParams} params
2061
+ */
2062
+ const projectsDeleteWebhook = async ({projectId,webhookId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2063
+ let client = !sdk ? await sdkForConsole() :
2064
+ sdk;
2065
+ let apiPath = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
2066
+ let payload = {};
2067
+
2068
+ let response = undefined;
2069
+
2070
+ response = await client.call('delete', apiPath, {
2071
+ 'content-type': 'application/json',
2072
+ }, payload);
2073
+
2074
+ if (parseOutput) {
2075
+ parse(response)
2076
+ }
2077
+
2078
+ return response;
2079
+
2080
+ }
2081
+
2082
+ /**
2083
+ * @typedef {Object} ProjectsUpdateWebhookSignatureRequestParams
2084
+ * @property {string} projectId Project unique ID.
2085
+ * @property {string} webhookId Webhook unique ID.
2086
+ * @property {boolean} overrideForCli
2087
+ * @property {boolean} parseOutput
2088
+ * @property {libClient | undefined} sdk
2089
+ */
2090
+
2091
+ /**
2092
+ * @param {ProjectsUpdateWebhookSignatureRequestParams} params
2093
+ */
2094
+ const projectsUpdateWebhookSignature = async ({projectId,webhookId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
2095
+ let client = !sdk ? await sdkForConsole() :
2096
+ sdk;
2097
+ let apiPath = '/projects/{projectId}/webhooks/{webhookId}/signature'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);
2098
+ let payload = {};
2099
+
2100
+ let response = undefined;
2101
+
2102
+ response = await client.call('patch', apiPath, {
2103
+ 'content-type': 'application/json',
2104
+ }, payload);
2105
+
2106
+ if (parseOutput) {
2107
+ parse(response)
2108
+ }
2109
+
2110
+ return response;
2111
+
2112
+ }
2113
+
2114
+ projects
2115
+ .command(`list`)
2116
+ .description(`Get a list of all projects. You can use the query params to filter your results. `)
2117
+ .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, teamId`)
2118
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
2119
+ .option(`--console`, `Get the resource console url`)
2120
+ .action(actionRunner(projectsList))
2121
+
2122
+ projects
2123
+ .command(`create`)
2124
+ .description(`Create a new project. You can create a maximum of 100 projects per account. `)
2125
+ .requiredOption(`--project-id <project-id>`, `Unique Id. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, and hyphen. Can't start with a special char. Max length is 36 chars.`)
2126
+ .requiredOption(`--name <name>`, `Project name. Max length: 128 chars.`)
2127
+ .requiredOption(`--team-id <team-id>`, `Team unique ID.`)
2128
+ .option(`--region <region>`, `Project Region.`)
2129
+ .option(`--description <description>`, `Project description. Max length: 256 chars.`)
2130
+ .option(`--logo <logo>`, `Project logo.`)
2131
+ .option(`--url <url>`, `Project URL.`)
2132
+ .option(`--legal-name <legal-name>`, `Project legal Name. Max length: 256 chars.`)
2133
+ .option(`--legal-country <legal-country>`, `Project legal Country. Max length: 256 chars.`)
2134
+ .option(`--legal-state <legal-state>`, `Project legal State. Max length: 256 chars.`)
2135
+ .option(`--legal-city <legal-city>`, `Project legal City. Max length: 256 chars.`)
2136
+ .option(`--legal-address <legal-address>`, `Project legal Address. Max length: 256 chars.`)
2137
+ .option(`--legal-tax-id <legal-tax-id>`, `Project legal Tax ID. Max length: 256 chars.`)
2138
+ .action(actionRunner(projectsCreate))
2139
+
2140
+ projects
2141
+ .command(`get`)
2142
+ .description(`Get a project by its unique ID. This endpoint allows you to retrieve the project's details, including its name, description, team, region, and other metadata. `)
2143
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2144
+ .option(`--console`, `Get the resource console url`)
2145
+ .action(actionRunner(projectsGet))
2146
+
2147
+ projects
2148
+ .command(`update`)
2149
+ .description(`Update a project by its unique ID.`)
2150
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2151
+ .requiredOption(`--name <name>`, `Project name. Max length: 128 chars.`)
2152
+ .option(`--description <description>`, `Project description. Max length: 256 chars.`)
2153
+ .option(`--logo <logo>`, `Project logo.`)
2154
+ .option(`--url <url>`, `Project URL.`)
2155
+ .option(`--legal-name <legal-name>`, `Project legal name. Max length: 256 chars.`)
2156
+ .option(`--legal-country <legal-country>`, `Project legal country. Max length: 256 chars.`)
2157
+ .option(`--legal-state <legal-state>`, `Project legal state. Max length: 256 chars.`)
2158
+ .option(`--legal-city <legal-city>`, `Project legal city. Max length: 256 chars.`)
2159
+ .option(`--legal-address <legal-address>`, `Project legal address. Max length: 256 chars.`)
2160
+ .option(`--legal-tax-id <legal-tax-id>`, `Project legal tax ID. Max length: 256 chars.`)
2161
+ .action(actionRunner(projectsUpdate))
2162
+
2163
+ projects
2164
+ .command(`delete`)
2165
+ .description(`Delete a project by its unique ID.`)
2166
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2167
+ .action(actionRunner(projectsDelete))
2168
+
2169
+ projects
2170
+ .command(`update-api-status`)
2171
+ .description(`Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.`)
2172
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2173
+ .requiredOption(`--api <api>`, `API name.`)
2174
+ .requiredOption(`--status [value]`, `API status.`, (value) => value === undefined ? true : parseBool(value))
2175
+ .action(actionRunner(projectsUpdateApiStatus))
2176
+
2177
+ projects
2178
+ .command(`update-api-status-all`)
2179
+ .description(`Update the status of all API types. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime all at once.`)
2180
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2181
+ .requiredOption(`--status [value]`, `API status.`, (value) => value === undefined ? true : parseBool(value))
2182
+ .action(actionRunner(projectsUpdateApiStatusAll))
2183
+
2184
+ projects
2185
+ .command(`update-auth-duration`)
2186
+ .description(`Update how long sessions created within a project should stay active for.`)
2187
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2188
+ .requiredOption(`--duration <duration>`, `Project session length in seconds. Max length: 31536000 seconds.`, parseInteger)
2189
+ .action(actionRunner(projectsUpdateAuthDuration))
2190
+
2191
+ projects
2192
+ .command(`update-auth-limit`)
2193
+ .description(`Update the maximum number of users allowed in this project. Set to 0 for unlimited users. `)
2194
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2195
+ .requiredOption(`--limit <limit>`, `Set the max number of users allowed in this project. Use 0 for unlimited.`, parseInteger)
2196
+ .action(actionRunner(projectsUpdateAuthLimit))
2197
+
2198
+ projects
2199
+ .command(`update-auth-sessions-limit`)
2200
+ .description(`Update the maximum number of sessions allowed per user within the project, if the limit is hit the oldest session will be deleted to make room for new sessions.`)
2201
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2202
+ .requiredOption(`--limit <limit>`, `Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10`, parseInteger)
2203
+ .action(actionRunner(projectsUpdateAuthSessionsLimit))
2204
+
2205
+ projects
2206
+ .command(`update-memberships-privacy`)
2207
+ .description(`Update project membership privacy settings. Use this endpoint to control what user information is visible to other team members, such as user name, email, and MFA status. `)
2208
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2209
+ .requiredOption(`--user-name [value]`, `Set to true to show userName to members of a team.`, (value) => value === undefined ? true : parseBool(value))
2210
+ .requiredOption(`--user-email [value]`, `Set to true to show email to members of a team.`, (value) => value === undefined ? true : parseBool(value))
2211
+ .requiredOption(`--mfa [value]`, `Set to true to show mfa to members of a team.`, (value) => value === undefined ? true : parseBool(value))
2212
+ .action(actionRunner(projectsUpdateMembershipsPrivacy))
2213
+
2214
+ projects
2215
+ .command(`update-mock-numbers`)
2216
+ .description(`Update the list of mock phone numbers for testing. Use these numbers to bypass SMS verification in development. `)
2217
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2218
+ .requiredOption(`--numbers [numbers...]`, `An array of mock numbers and their corresponding verification codes (OTPs). Each number should be a valid E.164 formatted phone number. Maximum of 10 numbers are allowed.`)
2219
+ .action(actionRunner(projectsUpdateMockNumbers))
2220
+
2221
+ projects
2222
+ .command(`update-auth-password-dictionary`)
2223
+ .description(`Enable or disable checking user passwords against common passwords dictionary. This helps ensure users don't use common and insecure passwords. `)
2224
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2225
+ .requiredOption(`--enabled [value]`, `Set whether or not to enable checking user's password against most commonly used passwords. Default is false.`, (value) => value === undefined ? true : parseBool(value))
2226
+ .action(actionRunner(projectsUpdateAuthPasswordDictionary))
2227
+
2228
+ projects
2229
+ .command(`update-auth-password-history`)
2230
+ .description(`Update the authentication password history requirement. Use this endpoint to require new passwords to be different than the last X amount of previously used ones.`)
2231
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2232
+ .requiredOption(`--limit <limit>`, `Set the max number of passwords to store in user history. User can't choose a new password that is already stored in the password history list. Max number of passwords allowed in history is20. Default value is 0`, parseInteger)
2233
+ .action(actionRunner(projectsUpdateAuthPasswordHistory))
2234
+
2235
+ projects
2236
+ .command(`update-personal-data-check`)
2237
+ .description(`Enable or disable checking user passwords against their personal data. This helps prevent users from using personal information in their passwords. `)
2238
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2239
+ .requiredOption(`--enabled [value]`, `Set whether or not to check a password for similarity with personal data. Default is false.`, (value) => value === undefined ? true : parseBool(value))
2240
+ .action(actionRunner(projectsUpdatePersonalDataCheck))
2241
+
2242
+ projects
2243
+ .command(`update-session-alerts`)
2244
+ .description(`Enable or disable session email alerts. When enabled, users will receive email notifications when new sessions are created.`)
2245
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2246
+ .requiredOption(`--alerts [value]`, `Set to true to enable session emails.`, (value) => value === undefined ? true : parseBool(value))
2247
+ .action(actionRunner(projectsUpdateSessionAlerts))
2248
+
2249
+ projects
2250
+ .command(`update-auth-status`)
2251
+ .description(`Update the status of a specific authentication method. Use this endpoint to enable or disable different authentication methods such as email, magic urls or sms in your project. `)
2252
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2253
+ .requiredOption(`--method <method>`, `Auth Method. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone`)
2254
+ .requiredOption(`--status [value]`, `Set the status of this auth method.`, (value) => value === undefined ? true : parseBool(value))
2255
+ .action(actionRunner(projectsUpdateAuthStatus))
2256
+
2257
+ projects
2258
+ .command(`list-dev-keys`)
2259
+ .description(`List all the project\'s dev keys. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.'`)
2260
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2261
+ .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: accessedAt, expire`)
2262
+ .option(`--console`, `Get the resource console url`)
2263
+ .action(actionRunner(projectsListDevKeys))
2264
+
2265
+ projects
2266
+ .command(`create-dev-key`)
2267
+ .description(`Create a new project dev key. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development. Strictly meant for development purposes only.`)
2268
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2269
+ .requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
2270
+ .requiredOption(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.`)
2271
+ .action(actionRunner(projectsCreateDevKey))
2272
+
2273
+ projects
2274
+ .command(`get-dev-key`)
2275
+ .description(`Get a project\'s dev key by its unique ID. Dev keys are project specific and allow you to bypass rate limits and get better error logging during development.`)
2276
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2277
+ .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
2278
+ .option(`--console`, `Get the resource console url`)
2279
+ .action(actionRunner(projectsGetDevKey))
2280
+
2281
+ projects
2282
+ .command(`update-dev-key`)
2283
+ .description(`Update a project\'s dev key by its unique ID. Use this endpoint to update a project\'s dev key name or expiration time.'`)
2284
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2285
+ .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
2286
+ .requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
2287
+ .requiredOption(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.`)
2288
+ .action(actionRunner(projectsUpdateDevKey))
2289
+
2290
+ projects
2291
+ .command(`delete-dev-key`)
2292
+ .description(`Delete a project\'s dev key by its unique ID. Once deleted, the key will no longer allow bypassing of rate limits and better logging of errors.`)
2293
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2294
+ .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
2295
+ .action(actionRunner(projectsDeleteDevKey))
2296
+
2297
+ projects
2298
+ .command(`create-jwt`)
2299
+ .description(`Create a new JWT token. This token can be used to authenticate users with custom scopes and expiration time. `)
2300
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2301
+ .requiredOption(`--scopes [scopes...]`, `List of scopes allowed for JWT key. Maximum of 100 scopes are allowed.`)
2302
+ .option(`--duration <duration>`, `Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.`, parseInteger)
2303
+ .action(actionRunner(projectsCreateJWT))
2304
+
2305
+ projects
2306
+ .command(`list-keys`)
2307
+ .description(`Get a list of all API keys from the current project. `)
2308
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2309
+ .option(`--console`, `Get the resource console url`)
2310
+ .action(actionRunner(projectsListKeys))
2311
+
2312
+ projects
2313
+ .command(`create-key`)
2314
+ .description(`Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.`)
2315
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2316
+ .requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
2317
+ .requiredOption(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 scopes are allowed.`)
2318
+ .option(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.`)
2319
+ .action(actionRunner(projectsCreateKey))
2320
+
2321
+ projects
2322
+ .command(`get-key`)
2323
+ .description(`Get a key by its unique ID. This endpoint returns details about a specific API key in your project including it's scopes.`)
2324
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2325
+ .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
2326
+ .option(`--console`, `Get the resource console url`)
2327
+ .action(actionRunner(projectsGetKey))
2328
+
2329
+ projects
2330
+ .command(`update-key`)
2331
+ .description(`Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. `)
2332
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2333
+ .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
2334
+ .requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
2335
+ .requiredOption(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 events are allowed.`)
2336
+ .option(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Use null for unlimited expiration.`)
2337
+ .action(actionRunner(projectsUpdateKey))
2338
+
2339
+ projects
2340
+ .command(`delete-key`)
2341
+ .description(`Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. `)
2342
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2343
+ .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
2344
+ .action(actionRunner(projectsDeleteKey))
2345
+
2346
+ projects
2347
+ .command(`update-o-auth-2`)
2348
+ .description(`Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable/disable providers. `)
2349
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2350
+ .requiredOption(`--provider <provider>`, `Provider Name`)
2351
+ .option(`--app-id <app-id>`, `Provider app ID. Max length: 256 chars.`)
2352
+ .option(`--secret <secret>`, `Provider secret key. Max length: 512 chars.`)
2353
+ .option(`--enabled [value]`, `Provider status. Set to 'false' to disable new session creation.`, (value) => value === undefined ? true : parseBool(value))
2354
+ .action(actionRunner(projectsUpdateOAuth2))
2355
+
2356
+ projects
2357
+ .command(`list-platforms`)
2358
+ .description(`Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. `)
2359
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2360
+ .option(`--console`, `Get the resource console url`)
2361
+ .action(actionRunner(projectsListPlatforms))
2362
+
2363
+ projects
2364
+ .command(`create-platform`)
2365
+ .description(`Create a new platform for your project. Use this endpoint to register a new platform where your users will run your application which will interact with the Appwrite API.`)
2366
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2367
+ .requiredOption(`--type <type>`, `Platform type.`)
2368
+ .requiredOption(`--name <name>`, `Platform name. Max length: 128 chars.`)
2369
+ .option(`--key <key>`, `Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.`)
2370
+ .option(`--store <store>`, `App store or Google Play store ID. Max length: 256 chars.`)
2371
+ .option(`--hostname <hostname>`, `Platform client hostname. Max length: 256 chars.`)
2372
+ .action(actionRunner(projectsCreatePlatform))
2373
+
2374
+ projects
2375
+ .command(`get-platform`)
2376
+ .description(`Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. `)
2377
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2378
+ .requiredOption(`--platform-id <platform-id>`, `Platform unique ID.`)
2379
+ .option(`--console`, `Get the resource console url`)
2380
+ .action(actionRunner(projectsGetPlatform))
2381
+
2382
+ projects
2383
+ .command(`update-platform`)
2384
+ .description(`Update a platform by its unique ID. Use this endpoint to update the platform's name, key, platform store ID, or hostname. `)
2385
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2386
+ .requiredOption(`--platform-id <platform-id>`, `Platform unique ID.`)
2387
+ .requiredOption(`--name <name>`, `Platform name. Max length: 128 chars.`)
2388
+ .option(`--key <key>`, `Package name for android or bundle ID for iOS. Max length: 256 chars.`)
2389
+ .option(`--store <store>`, `App store or Google Play store ID. Max length: 256 chars.`)
2390
+ .option(`--hostname <hostname>`, `Platform client URL. Max length: 256 chars.`)
2391
+ .action(actionRunner(projectsUpdatePlatform))
2392
+
2393
+ projects
2394
+ .command(`delete-platform`)
2395
+ .description(`Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. `)
2396
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2397
+ .requiredOption(`--platform-id <platform-id>`, `Platform unique ID.`)
2398
+ .action(actionRunner(projectsDeletePlatform))
2399
+
2400
+ projects
2401
+ .command(`update-service-status`)
2402
+ .description(`Update the status of a specific service. Use this endpoint to enable or disable a service in your project. `)
2403
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2404
+ .requiredOption(`--service <service>`, `Service name.`)
2405
+ .requiredOption(`--status [value]`, `Service status.`, (value) => value === undefined ? true : parseBool(value))
2406
+ .action(actionRunner(projectsUpdateServiceStatus))
2407
+
2408
+ projects
2409
+ .command(`update-service-status-all`)
2410
+ .description(`Update the status of all services. Use this endpoint to enable or disable all optional services at once. `)
2411
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2412
+ .requiredOption(`--status [value]`, `Service status.`, (value) => value === undefined ? true : parseBool(value))
2413
+ .action(actionRunner(projectsUpdateServiceStatusAll))
2414
+
2415
+ projects
2416
+ .command(`update-smtp`)
2417
+ .description(`Update the SMTP configuration for your project. Use this endpoint to configure your project's SMTP provider with your custom settings for sending transactional emails. `)
2418
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2419
+ .requiredOption(`--enabled [value]`, `Enable custom SMTP service`, (value) => value === undefined ? true : parseBool(value))
2420
+ .option(`--sender-name <sender-name>`, `Name of the email sender`)
2421
+ .option(`--sender-email <sender-email>`, `Email of the sender`)
2422
+ .option(`--reply-to <reply-to>`, `Reply to email`)
2423
+ .option(`--host <host>`, `SMTP server host name`)
2424
+ .option(`--port <port>`, `SMTP server port`, parseInteger)
2425
+ .option(`--username <username>`, `SMTP server username`)
2426
+ .option(`--password <password>`, `SMTP server password`)
2427
+ .option(`--secure <secure>`, `Does SMTP server use secure connection`)
2428
+ .action(actionRunner(projectsUpdateSmtp))
2429
+
2430
+ projects
2431
+ .command(`create-smtp-test`)
2432
+ .description(`Send a test email to verify SMTP configuration. `)
2433
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2434
+ .requiredOption(`--emails [emails...]`, `Array of emails to send test email to. Maximum of 10 emails are allowed.`)
2435
+ .requiredOption(`--sender-name <sender-name>`, `Name of the email sender`)
2436
+ .requiredOption(`--sender-email <sender-email>`, `Email of the sender`)
2437
+ .requiredOption(`--host <host>`, `SMTP server host name`)
2438
+ .option(`--reply-to <reply-to>`, `Reply to email`)
2439
+ .option(`--port <port>`, `SMTP server port`, parseInteger)
2440
+ .option(`--username <username>`, `SMTP server username`)
2441
+ .option(`--password <password>`, `SMTP server password`)
2442
+ .option(`--secure <secure>`, `Does SMTP server use secure connection`)
2443
+ .action(actionRunner(projectsCreateSmtpTest))
2444
+
2445
+ projects
2446
+ .command(`update-team`)
2447
+ .description(`Update the team ID of a project allowing for it to be transferred to another team.`)
2448
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2449
+ .requiredOption(`--team-id <team-id>`, `Team ID of the team to transfer project to.`)
2450
+ .action(actionRunner(projectsUpdateTeam))
2451
+
2452
+ projects
2453
+ .command(`get-email-template`)
2454
+ .description(`Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. `)
2455
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2456
+ .requiredOption(`--type <type>`, `Template type`)
2457
+ .requiredOption(`--locale <locale>`, `Template locale`)
2458
+ .action(actionRunner(projectsGetEmailTemplate))
2459
+
2460
+ projects
2461
+ .command(`update-email-template`)
2462
+ .description(`Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.`)
2463
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2464
+ .requiredOption(`--type <type>`, `Template type`)
2465
+ .requiredOption(`--locale <locale>`, `Template locale`)
2466
+ .requiredOption(`--subject <subject>`, `Email Subject`)
2467
+ .requiredOption(`--message <message>`, `Template message`)
2468
+ .option(`--sender-name <sender-name>`, `Name of the email sender`)
2469
+ .option(`--sender-email <sender-email>`, `Email of the sender`)
2470
+ .option(`--reply-to <reply-to>`, `Reply to email`)
2471
+ .action(actionRunner(projectsUpdateEmailTemplate))
2472
+
2473
+ projects
2474
+ .command(`delete-email-template`)
2475
+ .description(`Reset a custom email template to its default value. This endpoint removes any custom content and restores the template to its original state. `)
2476
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2477
+ .requiredOption(`--type <type>`, `Template type`)
2478
+ .requiredOption(`--locale <locale>`, `Template locale`)
2479
+ .action(actionRunner(projectsDeleteEmailTemplate))
2480
+
2481
+ projects
2482
+ .command(`get-sms-template`)
2483
+ .description(`Get a custom SMS template for the specified locale and type returning it's contents.`)
2484
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2485
+ .requiredOption(`--type <type>`, `Template type`)
2486
+ .requiredOption(`--locale <locale>`, `Template locale`)
2487
+ .action(actionRunner(projectsGetSmsTemplate))
2488
+
2489
+ projects
2490
+ .command(`update-sms-template`)
2491
+ .description(`Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. `)
2492
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2493
+ .requiredOption(`--type <type>`, `Template type`)
2494
+ .requiredOption(`--locale <locale>`, `Template locale`)
2495
+ .requiredOption(`--message <message>`, `Template message`)
2496
+ .action(actionRunner(projectsUpdateSmsTemplate))
2497
+
2498
+ projects
2499
+ .command(`delete-sms-template`)
2500
+ .description(`Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. `)
2501
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2502
+ .requiredOption(`--type <type>`, `Template type`)
2503
+ .requiredOption(`--locale <locale>`, `Template locale`)
2504
+ .action(actionRunner(projectsDeleteSmsTemplate))
2505
+
2506
+ projects
2507
+ .command(`list-webhooks`)
2508
+ .description(`Get a list of all webhooks belonging to the project. You can use the query params to filter your results. `)
2509
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2510
+ .option(`--console`, `Get the resource console url`)
2511
+ .action(actionRunner(projectsListWebhooks))
2512
+
2513
+ projects
2514
+ .command(`create-webhook`)
2515
+ .description(`Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. `)
2516
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2517
+ .requiredOption(`--name <name>`, `Webhook name. Max length: 128 chars.`)
2518
+ .requiredOption(`--events [events...]`, `Events list. Maximum of 100 events are allowed.`)
2519
+ .requiredOption(`--url <url>`, `Webhook URL.`)
2520
+ .requiredOption(`--security [value]`, `Certificate verification, false for disabled or true for enabled.`, (value) => value === undefined ? true : parseBool(value))
2521
+ .option(`--enabled [value]`, `Enable or disable a webhook.`, (value) => value === undefined ? true : parseBool(value))
2522
+ .option(`--http-user <http-user>`, `Webhook HTTP user. Max length: 256 chars.`)
2523
+ .option(`--http-pass <http-pass>`, `Webhook HTTP password. Max length: 256 chars.`)
2524
+ .action(actionRunner(projectsCreateWebhook))
2525
+
2526
+ projects
2527
+ .command(`get-webhook`)
2528
+ .description(`Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. `)
2529
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2530
+ .requiredOption(`--webhook-id <webhook-id>`, `Webhook unique ID.`)
2531
+ .option(`--console`, `Get the resource console url`)
2532
+ .action(actionRunner(projectsGetWebhook))
2533
+
2534
+ projects
2535
+ .command(`update-webhook`)
2536
+ .description(`Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. `)
2537
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2538
+ .requiredOption(`--webhook-id <webhook-id>`, `Webhook unique ID.`)
2539
+ .requiredOption(`--name <name>`, `Webhook name. Max length: 128 chars.`)
2540
+ .requiredOption(`--events [events...]`, `Events list. Maximum of 100 events are allowed.`)
2541
+ .requiredOption(`--url <url>`, `Webhook URL.`)
2542
+ .requiredOption(`--security [value]`, `Certificate verification, false for disabled or true for enabled.`, (value) => value === undefined ? true : parseBool(value))
2543
+ .option(`--enabled [value]`, `Enable or disable a webhook.`, (value) => value === undefined ? true : parseBool(value))
2544
+ .option(`--http-user <http-user>`, `Webhook HTTP user. Max length: 256 chars.`)
2545
+ .option(`--http-pass <http-pass>`, `Webhook HTTP password. Max length: 256 chars.`)
2546
+ .action(actionRunner(projectsUpdateWebhook))
2547
+
2548
+ projects
2549
+ .command(`delete-webhook`)
2550
+ .description(`Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. `)
2551
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2552
+ .requiredOption(`--webhook-id <webhook-id>`, `Webhook unique ID.`)
2553
+ .action(actionRunner(projectsDeleteWebhook))
2554
+
2555
+ projects
2556
+ .command(`update-webhook-signature`)
2557
+ .description(`Update the webhook signature key. This endpoint can be used to regenerate the signature key used to sign and validate payload deliveries for a specific webhook. `)
2558
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
2559
+ .requiredOption(`--webhook-id <webhook-id>`, `Webhook unique ID.`)
2560
+ .action(actionRunner(projectsUpdateWebhookSignature))
2561
+
2562
+ module.exports = {
2563
+ projects,
2564
+ projectsList,
2565
+ projectsCreate,
2566
+ projectsGet,
2567
+ projectsUpdate,
2568
+ projectsDelete,
2569
+ projectsUpdateApiStatus,
2570
+ projectsUpdateApiStatusAll,
2571
+ projectsUpdateAuthDuration,
2572
+ projectsUpdateAuthLimit,
2573
+ projectsUpdateAuthSessionsLimit,
2574
+ projectsUpdateMembershipsPrivacy,
2575
+ projectsUpdateMockNumbers,
2576
+ projectsUpdateAuthPasswordDictionary,
2577
+ projectsUpdateAuthPasswordHistory,
2578
+ projectsUpdatePersonalDataCheck,
2579
+ projectsUpdateSessionAlerts,
2580
+ projectsUpdateAuthStatus,
2581
+ projectsListDevKeys,
2582
+ projectsCreateDevKey,
2583
+ projectsGetDevKey,
2584
+ projectsUpdateDevKey,
2585
+ projectsDeleteDevKey,
2586
+ projectsCreateJWT,
2587
+ projectsListKeys,
2588
+ projectsCreateKey,
2589
+ projectsGetKey,
2590
+ projectsUpdateKey,
2591
+ projectsDeleteKey,
2592
+ projectsUpdateOAuth2,
2593
+ projectsListPlatforms,
2594
+ projectsCreatePlatform,
2595
+ projectsGetPlatform,
2596
+ projectsUpdatePlatform,
2597
+ projectsDeletePlatform,
2598
+ projectsUpdateServiceStatus,
2599
+ projectsUpdateServiceStatusAll,
2600
+ projectsUpdateSmtp,
2601
+ projectsCreateSmtpTest,
2602
+ projectsUpdateTeam,
2603
+ projectsGetEmailTemplate,
2604
+ projectsUpdateEmailTemplate,
2605
+ projectsDeleteEmailTemplate,
2606
+ projectsGetSmsTemplate,
2607
+ projectsUpdateSmsTemplate,
2608
+ projectsDeleteSmsTemplate,
2609
+ projectsListWebhooks,
2610
+ projectsCreateWebhook,
2611
+ projectsGetWebhook,
2612
+ projectsUpdateWebhook,
2613
+ projectsDeleteWebhook,
2614
+ projectsUpdateWebhookSignature
2615
+ };