appwrite-cli 13.0.0-rc.1 → 13.0.0-rc.3

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 (430) hide show
  1. package/.github/workflows/publish.yml +68 -0
  2. package/CHANGELOG.md +10 -1
  3. package/LICENSE.md +1 -1
  4. package/README.md +3 -3
  5. package/cli.ts +152 -0
  6. package/dist/bundle.cjs +95813 -0
  7. package/dist/cli.d.ts +3 -0
  8. package/dist/cli.d.ts.map +1 -0
  9. package/dist/cli.js +145 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/index.d.ts +10 -2
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +7 -142
  14. package/dist/index.js.map +1 -1
  15. package/dist/lib/client.d.ts +2 -3
  16. package/dist/lib/client.d.ts.map +1 -1
  17. package/dist/lib/client.js +57 -45
  18. package/dist/lib/client.js.map +1 -1
  19. package/dist/lib/commands/config.d.ts +562 -0
  20. package/dist/lib/commands/config.d.ts.map +1 -0
  21. package/dist/lib/commands/config.js +416 -0
  22. package/dist/lib/commands/config.js.map +1 -0
  23. package/dist/lib/commands/db.d.ts +34 -0
  24. package/dist/lib/commands/db.d.ts.map +1 -0
  25. package/dist/lib/commands/db.js +247 -0
  26. package/dist/lib/commands/db.js.map +1 -0
  27. package/dist/lib/commands/errors.d.ts +68 -0
  28. package/dist/lib/commands/errors.d.ts.map +1 -0
  29. package/dist/lib/commands/errors.js +72 -0
  30. package/dist/lib/commands/errors.js.map +1 -0
  31. package/dist/lib/commands/generic.d.ts +2 -2
  32. package/dist/lib/commands/generic.d.ts.map +1 -1
  33. package/dist/lib/commands/generic.js +170 -157
  34. package/dist/lib/commands/generic.js.map +1 -1
  35. package/dist/lib/commands/init.d.ts +1 -1
  36. package/dist/lib/commands/init.d.ts.map +1 -1
  37. package/dist/lib/commands/init.js +201 -192
  38. package/dist/lib/commands/init.js.map +1 -1
  39. package/dist/lib/commands/pull.d.ts +105 -3
  40. package/dist/lib/commands/pull.d.ts.map +1 -1
  41. package/dist/lib/commands/pull.js +530 -370
  42. package/dist/lib/commands/pull.js.map +1 -1
  43. package/dist/lib/commands/push.d.ts +106 -0
  44. package/dist/lib/commands/push.d.ts.map +1 -1
  45. package/dist/lib/commands/push.js +1432 -1830
  46. package/dist/lib/commands/push.js.map +1 -1
  47. package/dist/lib/commands/run.d.ts +1 -1
  48. package/dist/lib/commands/run.d.ts.map +1 -1
  49. package/dist/lib/commands/run.js +129 -127
  50. package/dist/lib/commands/run.js.map +1 -1
  51. package/dist/lib/commands/schema.d.ts +59 -0
  52. package/dist/lib/commands/schema.d.ts.map +1 -0
  53. package/dist/lib/commands/schema.js +86 -0
  54. package/dist/lib/commands/schema.js.map +1 -0
  55. package/dist/lib/commands/services/account.d.ts +3 -0
  56. package/dist/lib/commands/services/account.d.ts.map +1 -0
  57. package/dist/lib/commands/services/account.js +328 -0
  58. package/dist/lib/commands/services/account.js.map +1 -0
  59. package/dist/lib/commands/services/console.d.ts +3 -0
  60. package/dist/lib/commands/services/console.d.ts.map +1 -0
  61. package/dist/lib/commands/services/console.js +28 -0
  62. package/dist/lib/commands/services/console.js.map +1 -0
  63. package/dist/lib/commands/services/databases.d.ts +3 -0
  64. package/dist/lib/commands/services/databases.d.ts.map +1 -0
  65. package/dist/lib/commands/services/databases.js +620 -0
  66. package/dist/lib/commands/services/databases.js.map +1 -0
  67. package/dist/lib/commands/services/functions.d.ts +3 -0
  68. package/dist/lib/commands/services/functions.d.ts.map +1 -0
  69. package/dist/lib/commands/services/functions.js +266 -0
  70. package/dist/lib/commands/services/functions.js.map +1 -0
  71. package/dist/lib/commands/services/graphql.d.ts +3 -0
  72. package/dist/lib/commands/services/graphql.d.ts.map +1 -0
  73. package/dist/lib/commands/services/graphql.js +28 -0
  74. package/dist/lib/commands/services/graphql.js.map +1 -0
  75. package/dist/lib/commands/services/health.d.ts +3 -0
  76. package/dist/lib/commands/services/health.d.ts.map +1 -0
  77. package/dist/lib/commands/services/health.js +123 -0
  78. package/dist/lib/commands/services/health.js.map +1 -0
  79. package/dist/lib/commands/services/locale.d.ts +3 -0
  80. package/dist/lib/commands/services/locale.d.ts.map +1 -0
  81. package/dist/lib/commands/services/locale.js +52 -0
  82. package/dist/lib/commands/services/locale.js.map +1 -0
  83. package/dist/lib/commands/services/messaging.d.ts +3 -0
  84. package/dist/lib/commands/services/messaging.d.ts.map +1 -0
  85. package/dist/lib/commands/services/messaging.js +505 -0
  86. package/dist/lib/commands/services/messaging.js.map +1 -0
  87. package/dist/lib/commands/services/migrations.d.ts +3 -0
  88. package/dist/lib/commands/services/migrations.d.ts.map +1 -0
  89. package/dist/lib/commands/services/migrations.js +135 -0
  90. package/dist/lib/commands/services/migrations.js.map +1 -0
  91. package/dist/lib/commands/services/project.d.ts +3 -0
  92. package/dist/lib/commands/services/project.d.ts.map +1 -0
  93. package/dist/lib/commands/services/project.js +54 -0
  94. package/dist/lib/commands/services/project.js.map +1 -0
  95. package/dist/lib/commands/services/projects.d.ts +3 -0
  96. package/dist/lib/commands/services/projects.d.ts.map +1 -0
  97. package/dist/lib/commands/services/projects.js +415 -0
  98. package/dist/lib/commands/services/projects.js.map +1 -0
  99. package/dist/lib/commands/services/proxy.d.ts +3 -0
  100. package/dist/lib/commands/services/proxy.d.ts.map +1 -0
  101. package/dist/lib/commands/services/proxy.js +68 -0
  102. package/dist/lib/commands/services/proxy.js.map +1 -0
  103. package/dist/lib/commands/services/sites.d.ts +3 -0
  104. package/dist/lib/commands/services/sites.d.ts.map +1 -0
  105. package/dist/lib/commands/services/sites.js +250 -0
  106. package/dist/lib/commands/services/sites.js.map +1 -0
  107. package/dist/lib/commands/services/storage.d.ts +3 -0
  108. package/dist/lib/commands/services/storage.d.ts.map +1 -0
  109. package/dist/lib/commands/services/storage.js +175 -0
  110. package/dist/lib/commands/services/storage.js.map +1 -0
  111. package/dist/lib/commands/services/tables-db.d.ts +3 -0
  112. package/dist/lib/commands/services/tables-db.d.ts.map +1 -0
  113. package/dist/lib/commands/services/tables-db.js +613 -0
  114. package/dist/lib/commands/services/tables-db.js.map +1 -0
  115. package/dist/lib/commands/services/teams.d.ts +3 -0
  116. package/dist/lib/commands/services/teams.d.ts.map +1 -0
  117. package/dist/lib/commands/services/teams.js +123 -0
  118. package/dist/lib/commands/services/teams.js.map +1 -0
  119. package/dist/lib/commands/services/tokens.d.ts +3 -0
  120. package/dist/lib/commands/services/tokens.d.ts.map +1 -0
  121. package/dist/lib/commands/services/tokens.js +49 -0
  122. package/dist/lib/commands/services/tokens.js.map +1 -0
  123. package/dist/lib/commands/services/users.d.ts +3 -0
  124. package/dist/lib/commands/services/users.d.ts.map +1 -0
  125. package/dist/lib/commands/services/users.js +312 -0
  126. package/dist/lib/commands/services/users.js.map +1 -0
  127. package/dist/lib/commands/services/vcs.d.ts +3 -0
  128. package/dist/lib/commands/services/vcs.d.ts.map +1 -0
  129. package/dist/lib/commands/services/vcs.js +87 -0
  130. package/dist/lib/commands/services/vcs.js.map +1 -0
  131. package/dist/lib/commands/types.d.ts +1 -1
  132. package/dist/lib/commands/types.d.ts.map +1 -1
  133. package/dist/lib/commands/types.js +53 -57
  134. package/dist/lib/commands/types.js.map +1 -1
  135. package/dist/lib/commands/update.d.ts +1 -1
  136. package/dist/lib/commands/update.d.ts.map +1 -1
  137. package/dist/lib/commands/update.js +69 -69
  138. package/dist/lib/commands/update.js.map +1 -1
  139. package/dist/lib/commands/utils/attributes.d.ts +47 -0
  140. package/dist/lib/commands/utils/attributes.d.ts.map +1 -0
  141. package/dist/lib/commands/utils/attributes.js +514 -0
  142. package/dist/lib/commands/utils/attributes.js.map +1 -0
  143. package/dist/lib/commands/utils/change-approval.d.ts +25 -0
  144. package/dist/lib/commands/utils/change-approval.d.ts.map +1 -0
  145. package/dist/lib/commands/utils/change-approval.js +129 -0
  146. package/dist/lib/commands/utils/change-approval.js.map +1 -0
  147. package/dist/lib/commands/utils/database-sync.d.ts +10 -0
  148. package/dist/lib/commands/utils/database-sync.d.ts.map +1 -0
  149. package/dist/lib/commands/utils/database-sync.js +136 -0
  150. package/dist/lib/commands/utils/database-sync.js.map +1 -0
  151. package/dist/lib/commands/utils/deployment.d.ts +34 -0
  152. package/dist/lib/commands/utils/deployment.d.ts.map +1 -0
  153. package/dist/lib/commands/utils/deployment.js +109 -0
  154. package/dist/lib/commands/utils/deployment.js.map +1 -0
  155. package/dist/lib/commands/utils/error-formatter.d.ts +19 -0
  156. package/dist/lib/commands/utils/error-formatter.d.ts.map +1 -0
  157. package/dist/lib/commands/utils/error-formatter.js +333 -0
  158. package/dist/lib/commands/utils/error-formatter.js.map +1 -0
  159. package/dist/lib/commands/utils/pools.d.ts +16 -0
  160. package/dist/lib/commands/utils/pools.d.ts.map +1 -0
  161. package/dist/lib/commands/utils/pools.js +198 -0
  162. package/dist/lib/commands/utils/pools.js.map +1 -0
  163. package/dist/lib/config.d.ts +41 -40
  164. package/dist/lib/config.d.ts.map +1 -1
  165. package/dist/lib/config.js +264 -239
  166. package/dist/lib/config.js.map +1 -1
  167. package/dist/lib/constants.d.ts +14 -0
  168. package/dist/lib/constants.d.ts.map +1 -0
  169. package/dist/lib/constants.js +19 -0
  170. package/dist/lib/constants.js.map +1 -0
  171. package/dist/lib/emulation/docker.d.ts +4 -12
  172. package/dist/lib/emulation/docker.d.ts.map +1 -1
  173. package/dist/lib/emulation/docker.js +159 -142
  174. package/dist/lib/emulation/docker.js.map +1 -1
  175. package/dist/lib/emulation/utils.d.ts +1 -1
  176. package/dist/lib/emulation/utils.d.ts.map +1 -1
  177. package/dist/lib/emulation/utils.js +55 -58
  178. package/dist/lib/emulation/utils.js.map +1 -1
  179. package/dist/lib/id.d.ts +1 -1
  180. package/dist/lib/id.d.ts.map +1 -1
  181. package/dist/lib/id.js +13 -18
  182. package/dist/lib/id.js.map +1 -1
  183. package/dist/lib/paginate.d.ts +3 -4
  184. package/dist/lib/paginate.d.ts.map +1 -1
  185. package/dist/lib/paginate.js +7 -10
  186. package/dist/lib/paginate.js.map +1 -1
  187. package/dist/lib/parser.d.ts +1 -1
  188. package/dist/lib/parser.d.ts.map +1 -1
  189. package/dist/lib/parser.js +92 -103
  190. package/dist/lib/parser.js.map +1 -1
  191. package/dist/lib/questions.d.ts +1 -1
  192. package/dist/lib/questions.d.ts.map +1 -1
  193. package/dist/lib/questions.js +381 -385
  194. package/dist/lib/questions.js.map +1 -1
  195. package/dist/lib/sdks.d.ts +1 -1
  196. package/dist/lib/sdks.d.ts.map +1 -1
  197. package/dist/lib/sdks.js +39 -30
  198. package/dist/lib/sdks.js.map +1 -1
  199. package/dist/lib/services.d.ts +13 -0
  200. package/dist/lib/services.d.ts.map +1 -0
  201. package/dist/lib/services.js +47 -0
  202. package/dist/lib/services.js.map +1 -0
  203. package/dist/lib/spinner.d.ts +1 -1
  204. package/dist/lib/spinner.d.ts.map +1 -1
  205. package/dist/lib/spinner.js +25 -27
  206. package/dist/lib/spinner.js.map +1 -1
  207. package/dist/lib/type-generation/attribute.d.ts +1 -1
  208. package/dist/lib/type-generation/attribute.d.ts.map +1 -1
  209. package/dist/lib/type-generation/attribute.js +14 -17
  210. package/dist/lib/type-generation/attribute.js.map +1 -1
  211. package/dist/lib/type-generation/languages/csharp.d.ts +1 -1
  212. package/dist/lib/type-generation/languages/csharp.d.ts.map +1 -1
  213. package/dist/lib/type-generation/languages/csharp.js +34 -34
  214. package/dist/lib/type-generation/languages/csharp.js.map +1 -1
  215. package/dist/lib/type-generation/languages/dart.d.ts +1 -1
  216. package/dist/lib/type-generation/languages/dart.d.ts.map +1 -1
  217. package/dist/lib/type-generation/languages/dart.js +57 -57
  218. package/dist/lib/type-generation/languages/dart.js.map +1 -1
  219. package/dist/lib/type-generation/languages/java.d.ts +1 -1
  220. package/dist/lib/type-generation/languages/java.d.ts.map +1 -1
  221. package/dist/lib/type-generation/languages/java.js +35 -35
  222. package/dist/lib/type-generation/languages/java.js.map +1 -1
  223. package/dist/lib/type-generation/languages/javascript.d.ts +1 -1
  224. package/dist/lib/type-generation/languages/javascript.d.ts.map +1 -1
  225. package/dist/lib/type-generation/languages/javascript.js +45 -44
  226. package/dist/lib/type-generation/languages/javascript.js.map +1 -1
  227. package/dist/lib/type-generation/languages/kotlin.d.ts +1 -1
  228. package/dist/lib/type-generation/languages/kotlin.d.ts.map +1 -1
  229. package/dist/lib/type-generation/languages/kotlin.js +35 -35
  230. package/dist/lib/type-generation/languages/kotlin.js.map +1 -1
  231. package/dist/lib/type-generation/languages/language.d.ts.map +1 -1
  232. package/dist/lib/type-generation/languages/language.js +32 -37
  233. package/dist/lib/type-generation/languages/language.js.map +1 -1
  234. package/dist/lib/type-generation/languages/php.d.ts +1 -1
  235. package/dist/lib/type-generation/languages/php.d.ts.map +1 -1
  236. package/dist/lib/type-generation/languages/php.js +34 -34
  237. package/dist/lib/type-generation/languages/php.js.map +1 -1
  238. package/dist/lib/type-generation/languages/swift.d.ts +1 -1
  239. package/dist/lib/type-generation/languages/swift.d.ts.map +1 -1
  240. package/dist/lib/type-generation/languages/swift.js +35 -35
  241. package/dist/lib/type-generation/languages/swift.js.map +1 -1
  242. package/dist/lib/type-generation/languages/typescript.d.ts +1 -1
  243. package/dist/lib/type-generation/languages/typescript.d.ts.map +1 -1
  244. package/dist/lib/type-generation/languages/typescript.js +49 -46
  245. package/dist/lib/type-generation/languages/typescript.js.map +1 -1
  246. package/dist/lib/types.d.ts +38 -108
  247. package/dist/lib/types.d.ts.map +1 -1
  248. package/dist/lib/types.js +1 -2
  249. package/dist/lib/utils.d.ts +3 -0
  250. package/dist/lib/utils.d.ts.map +1 -1
  251. package/dist/lib/utils.js +142 -98
  252. package/dist/lib/utils.js.map +1 -1
  253. package/dist/lib/validations.d.ts.map +1 -1
  254. package/dist/lib/validations.js +2 -6
  255. package/dist/lib/validations.js.map +1 -1
  256. package/dist/package.json +68 -0
  257. package/index.ts +25 -149
  258. package/install.ps1 +2 -2
  259. package/install.sh +1 -1
  260. package/lib/client.ts +261 -220
  261. package/lib/commands/config.ts +494 -0
  262. package/lib/commands/db.ts +324 -0
  263. package/lib/commands/errors.ts +93 -0
  264. package/lib/commands/generic.ts +371 -269
  265. package/lib/commands/init.ts +631 -519
  266. package/lib/commands/pull.ts +827 -453
  267. package/lib/commands/push.ts +2191 -2349
  268. package/lib/commands/run.ts +382 -302
  269. package/lib/commands/schema.ts +122 -0
  270. package/lib/commands/services/account.ts +647 -0
  271. package/lib/commands/services/console.ts +52 -0
  272. package/lib/commands/services/databases.ts +1163 -0
  273. package/lib/commands/services/functions.ts +536 -0
  274. package/lib/commands/services/graphql.ts +50 -0
  275. package/lib/commands/services/health.ts +260 -0
  276. package/lib/commands/services/locale.ts +102 -0
  277. package/lib/commands/services/messaging.ts +1052 -0
  278. package/lib/commands/services/migrations.ts +249 -0
  279. package/lib/commands/services/project.ts +112 -0
  280. package/lib/commands/services/projects.ts +785 -0
  281. package/lib/commands/services/proxy.ts +135 -0
  282. package/lib/commands/services/sites.ts +505 -0
  283. package/lib/commands/services/storage.ts +338 -0
  284. package/lib/commands/services/tables-db.ts +1150 -0
  285. package/lib/commands/services/teams.ts +232 -0
  286. package/lib/commands/services/tokens.ts +94 -0
  287. package/lib/commands/services/users.ts +616 -0
  288. package/lib/commands/services/vcs.ts +165 -0
  289. package/lib/commands/types.ts +145 -118
  290. package/lib/commands/update.ts +189 -159
  291. package/lib/commands/utils/attributes.ts +719 -0
  292. package/lib/commands/utils/change-approval.ts +186 -0
  293. package/lib/commands/utils/database-sync.ts +180 -0
  294. package/lib/commands/utils/deployment.ts +184 -0
  295. package/lib/commands/utils/error-formatter.ts +417 -0
  296. package/lib/commands/utils/pools.ts +355 -0
  297. package/lib/config.ts +766 -687
  298. package/lib/constants.ts +22 -0
  299. package/lib/emulation/docker.ts +277 -216
  300. package/lib/emulation/utils.ts +188 -174
  301. package/lib/id.ts +23 -23
  302. package/lib/paginate.ts +69 -55
  303. package/lib/parser.ts +220 -189
  304. package/lib/questions.ts +1024 -948
  305. package/lib/sdks.ts +84 -51
  306. package/lib/services.ts +72 -0
  307. package/lib/spinner.ts +112 -99
  308. package/lib/type-generation/attribute.ts +15 -14
  309. package/lib/type-generation/languages/csharp.ts +71 -60
  310. package/lib/type-generation/languages/dart.ts +106 -93
  311. package/lib/type-generation/languages/java.ts +69 -58
  312. package/lib/type-generation/languages/javascript.ts +84 -73
  313. package/lib/type-generation/languages/kotlin.ts +71 -60
  314. package/lib/type-generation/languages/language.ts +103 -95
  315. package/lib/type-generation/languages/php.ts +67 -56
  316. package/lib/type-generation/languages/swift.ts +71 -60
  317. package/lib/type-generation/languages/typescript.ts +93 -76
  318. package/lib/types.ts +50 -125
  319. package/lib/utils.ts +304 -233
  320. package/lib/validations.ts +17 -14
  321. package/package.json +31 -22
  322. package/scoop/appwrite.config.json +3 -3
  323. package/tsconfig.json +7 -13
  324. package/.github/workflows/autoclose.yml +0 -11
  325. package/.github/workflows/npm-publish.yml +0 -49
  326. package/dist/lib/commands/account.d.ts +0 -379
  327. package/dist/lib/commands/account.d.ts.map +0 -1
  328. package/dist/lib/commands/account.js +0 -1228
  329. package/dist/lib/commands/account.js.map +0 -1
  330. package/dist/lib/commands/console.d.ts +0 -20
  331. package/dist/lib/commands/console.d.ts.map +0 -1
  332. package/dist/lib/commands/console.js +0 -78
  333. package/dist/lib/commands/console.js.map +0 -1
  334. package/dist/lib/commands/databases.d.ts +0 -732
  335. package/dist/lib/commands/databases.d.ts.map +0 -1
  336. package/dist/lib/commands/databases.js +0 -2196
  337. package/dist/lib/commands/databases.js.map +0 -1
  338. package/dist/lib/commands/functions.d.ts +0 -310
  339. package/dist/lib/commands/functions.d.ts.map +0 -1
  340. package/dist/lib/commands/functions.js +0 -1100
  341. package/dist/lib/commands/functions.js.map +0 -1
  342. package/dist/lib/commands/graphql.d.ts +0 -19
  343. package/dist/lib/commands/graphql.d.ts.map +0 -1
  344. package/dist/lib/commands/graphql.js +0 -77
  345. package/dist/lib/commands/graphql.js.map +0 -1
  346. package/dist/lib/commands/health.d.ts +0 -153
  347. package/dist/lib/commands/health.d.ts.map +0 -1
  348. package/dist/lib/commands/health.js +0 -464
  349. package/dist/lib/commands/health.js.map +0 -1
  350. package/dist/lib/commands/locale.d.ts +0 -53
  351. package/dist/lib/commands/locale.d.ts.map +0 -1
  352. package/dist/lib/commands/locale.js +0 -165
  353. package/dist/lib/commands/locale.js.map +0 -1
  354. package/dist/lib/commands/messaging.d.ts +0 -588
  355. package/dist/lib/commands/messaging.d.ts.map +0 -1
  356. package/dist/lib/commands/messaging.js +0 -2042
  357. package/dist/lib/commands/messaging.js.map +0 -1
  358. package/dist/lib/commands/migrations.d.ts +0 -150
  359. package/dist/lib/commands/migrations.d.ts.map +0 -1
  360. package/dist/lib/commands/migrations.js +0 -524
  361. package/dist/lib/commands/migrations.js.map +0 -1
  362. package/dist/lib/commands/organizations.d.ts +0 -11
  363. package/dist/lib/commands/organizations.d.ts.map +0 -1
  364. package/dist/lib/commands/organizations.js +0 -31
  365. package/dist/lib/commands/organizations.js.map +0 -1
  366. package/dist/lib/commands/project.d.ts +0 -53
  367. package/dist/lib/commands/project.d.ts.map +0 -1
  368. package/dist/lib/commands/project.js +0 -176
  369. package/dist/lib/commands/project.js.map +0 -1
  370. package/dist/lib/commands/projects.d.ts +0 -516
  371. package/dist/lib/commands/projects.d.ts.map +0 -1
  372. package/dist/lib/commands/projects.js +0 -1590
  373. package/dist/lib/commands/projects.js.map +0 -1
  374. package/dist/lib/commands/proxy.d.ts +0 -71
  375. package/dist/lib/commands/proxy.d.ts.map +0 -1
  376. package/dist/lib/commands/proxy.js +0 -240
  377. package/dist/lib/commands/proxy.js.map +0 -1
  378. package/dist/lib/commands/sites.d.ts +0 -296
  379. package/dist/lib/commands/sites.d.ts.map +0 -1
  380. package/dist/lib/commands/sites.js +0 -1046
  381. package/dist/lib/commands/sites.js.map +0 -1
  382. package/dist/lib/commands/storage.d.ts +0 -170
  383. package/dist/lib/commands/storage.d.ts.map +0 -1
  384. package/dist/lib/commands/storage.js +0 -651
  385. package/dist/lib/commands/storage.js.map +0 -1
  386. package/dist/lib/commands/tables-db.d.ts +0 -728
  387. package/dist/lib/commands/tables-db.d.ts.map +0 -1
  388. package/dist/lib/commands/tables-db.js +0 -2198
  389. package/dist/lib/commands/tables-db.js.map +0 -1
  390. package/dist/lib/commands/teams.d.ts +0 -129
  391. package/dist/lib/commands/teams.d.ts.map +0 -1
  392. package/dist/lib/commands/teams.js +0 -403
  393. package/dist/lib/commands/teams.js.map +0 -1
  394. package/dist/lib/commands/tokens.d.ts +0 -48
  395. package/dist/lib/commands/tokens.d.ts.map +0 -1
  396. package/dist/lib/commands/tokens.js +0 -156
  397. package/dist/lib/commands/tokens.js.map +0 -1
  398. package/dist/lib/commands/users.d.ts +0 -382
  399. package/dist/lib/commands/users.d.ts.map +0 -1
  400. package/dist/lib/commands/users.js +0 -1195
  401. package/dist/lib/commands/users.js.map +0 -1
  402. package/dist/lib/commands/vcs.d.ts +0 -92
  403. package/dist/lib/commands/vcs.d.ts.map +0 -1
  404. package/dist/lib/commands/vcs.js +0 -276
  405. package/dist/lib/commands/vcs.js.map +0 -1
  406. package/dist/lib/exception.d.ts +0 -8
  407. package/dist/lib/exception.d.ts.map +0 -1
  408. package/dist/lib/exception.js +0 -16
  409. package/dist/lib/exception.js.map +0 -1
  410. package/lib/commands/account.ts +0 -1867
  411. package/lib/commands/console.ts +0 -112
  412. package/lib/commands/databases.ts +0 -3272
  413. package/lib/commands/functions.ts +0 -1587
  414. package/lib/commands/graphql.ts +0 -110
  415. package/lib/commands/health.ts +0 -753
  416. package/lib/commands/locale.ts +0 -270
  417. package/lib/commands/messaging.ts +0 -2878
  418. package/lib/commands/migrations.ts +0 -754
  419. package/lib/commands/organizations.ts +0 -46
  420. package/lib/commands/project.ts +0 -266
  421. package/lib/commands/projects.ts +0 -2370
  422. package/lib/commands/proxy.ts +0 -357
  423. package/lib/commands/sites.ts +0 -1514
  424. package/lib/commands/storage.ts +0 -919
  425. package/lib/commands/tables-db.ts +0 -3260
  426. package/lib/commands/teams.ts +0 -609
  427. package/lib/commands/tokens.ts +0 -232
  428. package/lib/commands/users.ts +0 -1804
  429. package/lib/commands/vcs.ts +0 -428
  430. package/lib/exception.ts +0 -20
@@ -0,0 +1,785 @@
1
+ import { Command } from "commander";
2
+ import { sdkForProject } from "../../sdks.js";
3
+ import {
4
+ actionRunner,
5
+ commandDescriptions,
6
+ success,
7
+ parse,
8
+ parseBool,
9
+ parseInteger,
10
+ } from "../../parser.js";
11
+ import {
12
+ Projects,
13
+ Region,
14
+ Api,
15
+ AuthMethod,
16
+ OAuthProvider,
17
+ PlatformType,
18
+ ApiService,
19
+ SMTPSecure,
20
+ EmailTemplateType,
21
+ EmailTemplateLocale,
22
+ SmsTemplateType,
23
+ SmsTemplateLocale,
24
+ } from "@appwrite.io/console";
25
+
26
+ let projectsClient: Projects | null = null;
27
+
28
+ const getProjectsClient = async (): Promise<Projects> => {
29
+ if (!projectsClient) {
30
+ const sdkClient = await sdkForProject();
31
+ projectsClient = new Projects(sdkClient);
32
+ }
33
+ return projectsClient;
34
+ };
35
+
36
+ export const projects = new Command("projects")
37
+ .description(commandDescriptions["projects"] ?? "")
38
+ .configureHelp({
39
+ helpWidth: process.stdout.columns || 80,
40
+ });
41
+
42
+ projects
43
+ .command(`list`)
44
+ .description(`Get a list of all projects. You can use the query params to filter your results. `)
45
+ .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`)
46
+ .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
47
+ .option(
48
+ `--total [value]`,
49
+ `When set to false, the total count returned will be 0 and will not be calculated.`,
50
+ (value: string | undefined) =>
51
+ value === undefined ? true : parseBool(value),
52
+ )
53
+ .action(
54
+ actionRunner(
55
+ async ({ queries, search, total }) =>
56
+ parse(await (await getProjectsClient()).list(queries, search, total)),
57
+ ),
58
+ );
59
+
60
+ projects
61
+ .command(`create`)
62
+ .description(`Create a new project. You can create a maximum of 100 projects per account. `)
63
+ .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.`)
64
+ .requiredOption(`--name <name>`, `Project name. Max length: 128 chars.`)
65
+ .requiredOption(`--team-id <team-id>`, `Team unique ID.`)
66
+ .option(`--region <region>`, `Project Region.`)
67
+ .option(`--description <description>`, `Project description. Max length: 256 chars.`)
68
+ .option(`--logo <logo>`, `Project logo.`)
69
+ .option(`--url <url>`, `Project URL.`)
70
+ .option(`--legal-name <legal-name>`, `Project legal Name. Max length: 256 chars.`)
71
+ .option(`--legal-country <legal-country>`, `Project legal Country. Max length: 256 chars.`)
72
+ .option(`--legal-state <legal-state>`, `Project legal State. Max length: 256 chars.`)
73
+ .option(`--legal-city <legal-city>`, `Project legal City. Max length: 256 chars.`)
74
+ .option(`--legal-address <legal-address>`, `Project legal Address. Max length: 256 chars.`)
75
+ .option(`--legal-tax-id <legal-tax-id>`, `Project legal Tax ID. Max length: 256 chars.`)
76
+ .action(
77
+ actionRunner(
78
+ async ({ projectId, name, teamId, region, description, logo, url, legalName, legalCountry, legalState, legalCity, legalAddress, legalTaxId }) =>
79
+ parse(await (await getProjectsClient()).create(projectId, name, teamId, region as Region, description, logo, url, legalName, legalCountry, legalState, legalCity, legalAddress, legalTaxId)),
80
+ ),
81
+ );
82
+
83
+ projects
84
+ .command(`get`)
85
+ .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. `)
86
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
87
+ .action(
88
+ actionRunner(
89
+ async ({ projectId }) =>
90
+ parse(await (await getProjectsClient()).get(projectId)),
91
+ ),
92
+ );
93
+
94
+ projects
95
+ .command(`update`)
96
+ .description(`Update a project by its unique ID.`)
97
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
98
+ .requiredOption(`--name <name>`, `Project name. Max length: 128 chars.`)
99
+ .option(`--description <description>`, `Project description. Max length: 256 chars.`)
100
+ .option(`--logo <logo>`, `Project logo.`)
101
+ .option(`--url <url>`, `Project URL.`)
102
+ .option(`--legal-name <legal-name>`, `Project legal name. Max length: 256 chars.`)
103
+ .option(`--legal-country <legal-country>`, `Project legal country. Max length: 256 chars.`)
104
+ .option(`--legal-state <legal-state>`, `Project legal state. Max length: 256 chars.`)
105
+ .option(`--legal-city <legal-city>`, `Project legal city. Max length: 256 chars.`)
106
+ .option(`--legal-address <legal-address>`, `Project legal address. Max length: 256 chars.`)
107
+ .option(`--legal-tax-id <legal-tax-id>`, `Project legal tax ID. Max length: 256 chars.`)
108
+ .action(
109
+ actionRunner(
110
+ async ({ projectId, name, description, logo, url, legalName, legalCountry, legalState, legalCity, legalAddress, legalTaxId }) =>
111
+ parse(await (await getProjectsClient()).update(projectId, name, description, logo, url, legalName, legalCountry, legalState, legalCity, legalAddress, legalTaxId)),
112
+ ),
113
+ );
114
+
115
+ projects
116
+ .command(`delete`)
117
+ .description(`Delete a project by its unique ID.`)
118
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
119
+ .action(
120
+ actionRunner(
121
+ async ({ projectId }) =>
122
+ parse(await (await getProjectsClient()).delete(projectId)),
123
+ ),
124
+ );
125
+
126
+ projects
127
+ .command(`update-api-status`)
128
+ .description(`Update the status of a specific API type. Use this endpoint to enable or disable API types such as REST, GraphQL and Realtime.`)
129
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
130
+ .requiredOption(`--api <api>`, `API name.`)
131
+ .requiredOption(`--status <status>`, `API status.`, parseBool)
132
+ .action(
133
+ actionRunner(
134
+ async ({ projectId, api, status }) =>
135
+ parse(await (await getProjectsClient()).updateApiStatus(projectId, api as Api, status)),
136
+ ),
137
+ );
138
+
139
+ projects
140
+ .command(`update-api-status-all`)
141
+ .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.`)
142
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
143
+ .requiredOption(`--status <status>`, `API status.`, parseBool)
144
+ .action(
145
+ actionRunner(
146
+ async ({ projectId, status }) =>
147
+ parse(await (await getProjectsClient()).updateApiStatusAll(projectId, status)),
148
+ ),
149
+ );
150
+
151
+ projects
152
+ .command(`update-auth-duration`)
153
+ .description(`Update how long sessions created within a project should stay active for.`)
154
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
155
+ .requiredOption(`--duration <duration>`, `Project session length in seconds. Max length: 31536000 seconds.`, parseInteger)
156
+ .action(
157
+ actionRunner(
158
+ async ({ projectId, duration }) =>
159
+ parse(await (await getProjectsClient()).updateAuthDuration(projectId, duration)),
160
+ ),
161
+ );
162
+
163
+ projects
164
+ .command(`update-auth-limit`)
165
+ .description(`Update the maximum number of users allowed in this project. Set to 0 for unlimited users. `)
166
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
167
+ .requiredOption(`--limit <limit>`, `Set the max number of users allowed in this project. Use 0 for unlimited.`, parseInteger)
168
+ .action(
169
+ actionRunner(
170
+ async ({ projectId, limit }) =>
171
+ parse(await (await getProjectsClient()).updateAuthLimit(projectId, limit)),
172
+ ),
173
+ );
174
+
175
+ projects
176
+ .command(`update-auth-sessions-limit`)
177
+ .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.`)
178
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
179
+ .requiredOption(`--limit <limit>`, `Set the max number of users allowed in this project. Value allowed is between 1-100. Default is 10`, parseInteger)
180
+ .action(
181
+ actionRunner(
182
+ async ({ projectId, limit }) =>
183
+ parse(await (await getProjectsClient()).updateAuthSessionsLimit(projectId, limit)),
184
+ ),
185
+ );
186
+
187
+ projects
188
+ .command(`update-memberships-privacy`)
189
+ .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. `)
190
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
191
+ .requiredOption(`--user-name <user-name>`, `Set to true to show userName to members of a team.`, parseBool)
192
+ .requiredOption(`--user-email <user-email>`, `Set to true to show email to members of a team.`, parseBool)
193
+ .requiredOption(`--mfa <mfa>`, `Set to true to show mfa to members of a team.`, parseBool)
194
+ .action(
195
+ actionRunner(
196
+ async ({ projectId, userName, userEmail, mfa }) =>
197
+ parse(await (await getProjectsClient()).updateMembershipsPrivacy(projectId, userName, userEmail, mfa)),
198
+ ),
199
+ );
200
+
201
+ projects
202
+ .command(`update-mock-numbers`)
203
+ .description(`Update the list of mock phone numbers for testing. Use these numbers to bypass SMS verification in development. `)
204
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
205
+ .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.`)
206
+ .action(
207
+ actionRunner(
208
+ async ({ projectId, numbers }) =>
209
+ parse(await (await getProjectsClient()).updateMockNumbers(projectId, numbers)),
210
+ ),
211
+ );
212
+
213
+ projects
214
+ .command(`update-auth-password-dictionary`)
215
+ .description(`Enable or disable checking user passwords against common passwords dictionary. This helps ensure users don't use common and insecure passwords. `)
216
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
217
+ .requiredOption(`--enabled <enabled>`, `Set whether or not to enable checking user's password against most commonly used passwords. Default is false.`, parseBool)
218
+ .action(
219
+ actionRunner(
220
+ async ({ projectId, enabled }) =>
221
+ parse(await (await getProjectsClient()).updateAuthPasswordDictionary(projectId, enabled)),
222
+ ),
223
+ );
224
+
225
+ projects
226
+ .command(`update-auth-password-history`)
227
+ .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.`)
228
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
229
+ .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)
230
+ .action(
231
+ actionRunner(
232
+ async ({ projectId, limit }) =>
233
+ parse(await (await getProjectsClient()).updateAuthPasswordHistory(projectId, limit)),
234
+ ),
235
+ );
236
+
237
+ projects
238
+ .command(`update-personal-data-check`)
239
+ .description(`Enable or disable checking user passwords against their personal data. This helps prevent users from using personal information in their passwords. `)
240
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
241
+ .requiredOption(`--enabled <enabled>`, `Set whether or not to check a password for similarity with personal data. Default is false.`, parseBool)
242
+ .action(
243
+ actionRunner(
244
+ async ({ projectId, enabled }) =>
245
+ parse(await (await getProjectsClient()).updatePersonalDataCheck(projectId, enabled)),
246
+ ),
247
+ );
248
+
249
+ projects
250
+ .command(`update-session-alerts`)
251
+ .description(`Enable or disable session email alerts. When enabled, users will receive email notifications when new sessions are created.`)
252
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
253
+ .requiredOption(`--alerts <alerts>`, `Set to true to enable session emails.`, parseBool)
254
+ .action(
255
+ actionRunner(
256
+ async ({ projectId, alerts }) =>
257
+ parse(await (await getProjectsClient()).updateSessionAlerts(projectId, alerts)),
258
+ ),
259
+ );
260
+
261
+ projects
262
+ .command(`update-session-invalidation`)
263
+ .description(`Invalidate all existing sessions. An optional auth security setting for projects, and enabled by default for console project.`)
264
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
265
+ .requiredOption(`--enabled <enabled>`, `Update authentication session invalidation status. Use this endpoint to enable or disable session invalidation on password change`, parseBool)
266
+ .action(
267
+ actionRunner(
268
+ async ({ projectId, enabled }) =>
269
+ parse(await (await getProjectsClient()).updateSessionInvalidation(projectId, enabled)),
270
+ ),
271
+ );
272
+
273
+ projects
274
+ .command(`update-auth-status`)
275
+ .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. `)
276
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
277
+ .requiredOption(`--method <method>`, `Auth Method. Possible values: email-password,magic-url,email-otp,anonymous,invites,jwt,phone`)
278
+ .requiredOption(`--status <status>`, `Set the status of this auth method.`, parseBool)
279
+ .action(
280
+ actionRunner(
281
+ async ({ projectId, method, status }) =>
282
+ parse(await (await getProjectsClient()).updateAuthStatus(projectId, method as AuthMethod, status)),
283
+ ),
284
+ );
285
+
286
+ projects
287
+ .command(`list-dev-keys`)
288
+ .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.'`)
289
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
290
+ .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`)
291
+ .action(
292
+ actionRunner(
293
+ async ({ projectId, queries }) =>
294
+ parse(await (await getProjectsClient()).listDevKeys(projectId, queries)),
295
+ ),
296
+ );
297
+
298
+ projects
299
+ .command(`create-dev-key`)
300
+ .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.`)
301
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
302
+ .requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
303
+ .requiredOption(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.`)
304
+ .action(
305
+ actionRunner(
306
+ async ({ projectId, name, expire }) =>
307
+ parse(await (await getProjectsClient()).createDevKey(projectId, name, expire)),
308
+ ),
309
+ );
310
+
311
+ projects
312
+ .command(`get-dev-key`)
313
+ .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.`)
314
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
315
+ .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
316
+ .action(
317
+ actionRunner(
318
+ async ({ projectId, keyId }) =>
319
+ parse(await (await getProjectsClient()).getDevKey(projectId, keyId)),
320
+ ),
321
+ );
322
+
323
+ projects
324
+ .command(`update-dev-key`)
325
+ .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.'`)
326
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
327
+ .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
328
+ .requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
329
+ .requiredOption(`--expire <expire>`, `Expiration time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.`)
330
+ .action(
331
+ actionRunner(
332
+ async ({ projectId, keyId, name, expire }) =>
333
+ parse(await (await getProjectsClient()).updateDevKey(projectId, keyId, name, expire)),
334
+ ),
335
+ );
336
+
337
+ projects
338
+ .command(`delete-dev-key`)
339
+ .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.`)
340
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
341
+ .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
342
+ .action(
343
+ actionRunner(
344
+ async ({ projectId, keyId }) =>
345
+ parse(await (await getProjectsClient()).deleteDevKey(projectId, keyId)),
346
+ ),
347
+ );
348
+
349
+ projects
350
+ .command(`create-jwt`)
351
+ .description(`Create a new JWT token. This token can be used to authenticate users with custom scopes and expiration time. `)
352
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
353
+ .requiredOption(`--scopes [scopes...]`, `List of scopes allowed for JWT key. Maximum of 100 scopes are allowed.`)
354
+ .option(`--duration <duration>`, `Time in seconds before JWT expires. Default duration is 900 seconds, and maximum is 3600 seconds.`, parseInteger)
355
+ .action(
356
+ actionRunner(
357
+ async ({ projectId, scopes, duration }) =>
358
+ parse(await (await getProjectsClient()).createJWT(projectId, scopes, duration)),
359
+ ),
360
+ );
361
+
362
+ projects
363
+ .command(`list-keys`)
364
+ .description(`Get a list of all API keys from the current project. `)
365
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
366
+ .option(
367
+ `--total [value]`,
368
+ `When set to false, the total count returned will be 0 and will not be calculated.`,
369
+ (value: string | undefined) =>
370
+ value === undefined ? true : parseBool(value),
371
+ )
372
+ .action(
373
+ actionRunner(
374
+ async ({ projectId, total }) =>
375
+ parse(await (await getProjectsClient()).listKeys(projectId, total)),
376
+ ),
377
+ );
378
+
379
+ projects
380
+ .command(`create-key`)
381
+ .description(`Create a new API key. It's recommended to have multiple API keys with strict scopes for separate functions within your project.`)
382
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
383
+ .requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
384
+ .requiredOption(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 scopes are allowed.`)
385
+ .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.`)
386
+ .action(
387
+ actionRunner(
388
+ async ({ projectId, name, scopes, expire }) =>
389
+ parse(await (await getProjectsClient()).createKey(projectId, name, scopes, expire)),
390
+ ),
391
+ );
392
+
393
+ projects
394
+ .command(`get-key`)
395
+ .description(`Get a key by its unique ID. This endpoint returns details about a specific API key in your project including it's scopes.`)
396
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
397
+ .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
398
+ .action(
399
+ actionRunner(
400
+ async ({ projectId, keyId }) =>
401
+ parse(await (await getProjectsClient()).getKey(projectId, keyId)),
402
+ ),
403
+ );
404
+
405
+ projects
406
+ .command(`update-key`)
407
+ .description(`Update a key by its unique ID. Use this endpoint to update the name, scopes, or expiration time of an API key. `)
408
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
409
+ .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
410
+ .requiredOption(`--name <name>`, `Key name. Max length: 128 chars.`)
411
+ .requiredOption(`--scopes [scopes...]`, `Key scopes list. Maximum of 100 events are allowed.`)
412
+ .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.`)
413
+ .action(
414
+ actionRunner(
415
+ async ({ projectId, keyId, name, scopes, expire }) =>
416
+ parse(await (await getProjectsClient()).updateKey(projectId, keyId, name, scopes, expire)),
417
+ ),
418
+ );
419
+
420
+ projects
421
+ .command(`delete-key`)
422
+ .description(`Delete a key by its unique ID. Once deleted, the key can no longer be used to authenticate API calls. `)
423
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
424
+ .requiredOption(`--key-id <key-id>`, `Key unique ID.`)
425
+ .action(
426
+ actionRunner(
427
+ async ({ projectId, keyId }) =>
428
+ parse(await (await getProjectsClient()).deleteKey(projectId, keyId)),
429
+ ),
430
+ );
431
+
432
+ projects
433
+ .command(`update-o-auth-2`)
434
+ .description(`Update the OAuth2 provider configurations. Use this endpoint to set up or update the OAuth2 provider credentials or enable/disable providers. `)
435
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
436
+ .requiredOption(`--provider <provider>`, `Provider Name`)
437
+ .option(`--app-id <app-id>`, `Provider app ID. Max length: 256 chars.`)
438
+ .option(`--secret <secret>`, `Provider secret key. Max length: 512 chars.`)
439
+ .option(
440
+ `--enabled [value]`,
441
+ `Provider status. Set to 'false' to disable new session creation.`,
442
+ (value: string | undefined) =>
443
+ value === undefined ? true : parseBool(value),
444
+ )
445
+ .action(
446
+ actionRunner(
447
+ async ({ projectId, provider, appId, secret, enabled }) =>
448
+ parse(await (await getProjectsClient()).updateOAuth2(projectId, provider as OAuthProvider, appId, secret, enabled)),
449
+ ),
450
+ );
451
+
452
+ projects
453
+ .command(`list-platforms`)
454
+ .description(`Get a list of all platforms in the project. This endpoint returns an array of all platforms and their configurations. `)
455
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
456
+ .option(
457
+ `--total [value]`,
458
+ `When set to false, the total count returned will be 0 and will not be calculated.`,
459
+ (value: string | undefined) =>
460
+ value === undefined ? true : parseBool(value),
461
+ )
462
+ .action(
463
+ actionRunner(
464
+ async ({ projectId, total }) =>
465
+ parse(await (await getProjectsClient()).listPlatforms(projectId, total)),
466
+ ),
467
+ );
468
+
469
+ projects
470
+ .command(`create-platform`)
471
+ .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.`)
472
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
473
+ .requiredOption(`--type <type>`, `Platform type. Possible values are: web, flutter-web, flutter-ios, flutter-android, flutter-linux, flutter-macos, flutter-windows, apple-ios, apple-macos, apple-watchos, apple-tvos, android, unity, react-native-ios, react-native-android.`)
474
+ .requiredOption(`--name <name>`, `Platform name. Max length: 128 chars.`)
475
+ .option(`--key <key>`, `Package name for Android or bundle ID for iOS or macOS. Max length: 256 chars.`)
476
+ .option(`--store <store>`, `App store or Google Play store ID. Max length: 256 chars.`)
477
+ .option(`--hostname <hostname>`, `Platform client hostname. Max length: 256 chars.`)
478
+ .action(
479
+ actionRunner(
480
+ async ({ projectId, type, name, key, store, hostname }) =>
481
+ parse(await (await getProjectsClient()).createPlatform(projectId, type as PlatformType, name, key, store, hostname)),
482
+ ),
483
+ );
484
+
485
+ projects
486
+ .command(`get-platform`)
487
+ .description(`Get a platform by its unique ID. This endpoint returns the platform's details, including its name, type, and key configurations. `)
488
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
489
+ .requiredOption(`--platform-id <platform-id>`, `Platform unique ID.`)
490
+ .action(
491
+ actionRunner(
492
+ async ({ projectId, platformId }) =>
493
+ parse(await (await getProjectsClient()).getPlatform(projectId, platformId)),
494
+ ),
495
+ );
496
+
497
+ projects
498
+ .command(`update-platform`)
499
+ .description(`Update a platform by its unique ID. Use this endpoint to update the platform's name, key, platform store ID, or hostname. `)
500
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
501
+ .requiredOption(`--platform-id <platform-id>`, `Platform unique ID.`)
502
+ .requiredOption(`--name <name>`, `Platform name. Max length: 128 chars.`)
503
+ .option(`--key <key>`, `Package name for android or bundle ID for iOS. Max length: 256 chars.`)
504
+ .option(`--store <store>`, `App store or Google Play store ID. Max length: 256 chars.`)
505
+ .option(`--hostname <hostname>`, `Platform client URL. Max length: 256 chars.`)
506
+ .action(
507
+ actionRunner(
508
+ async ({ projectId, platformId, name, key, store, hostname }) =>
509
+ parse(await (await getProjectsClient()).updatePlatform(projectId, platformId, name, key, store, hostname)),
510
+ ),
511
+ );
512
+
513
+ projects
514
+ .command(`delete-platform`)
515
+ .description(`Delete a platform by its unique ID. This endpoint removes the platform and all its configurations from the project. `)
516
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
517
+ .requiredOption(`--platform-id <platform-id>`, `Platform unique ID.`)
518
+ .action(
519
+ actionRunner(
520
+ async ({ projectId, platformId }) =>
521
+ parse(await (await getProjectsClient()).deletePlatform(projectId, platformId)),
522
+ ),
523
+ );
524
+
525
+ projects
526
+ .command(`update-service-status`)
527
+ .description(`Update the status of a specific service. Use this endpoint to enable or disable a service in your project. `)
528
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
529
+ .requiredOption(`--service <service>`, `Service name.`)
530
+ .requiredOption(`--status <status>`, `Service status.`, parseBool)
531
+ .action(
532
+ actionRunner(
533
+ async ({ projectId, service, status }) =>
534
+ parse(await (await getProjectsClient()).updateServiceStatus(projectId, service as ApiService, status)),
535
+ ),
536
+ );
537
+
538
+ projects
539
+ .command(`update-service-status-all`)
540
+ .description(`Update the status of all services. Use this endpoint to enable or disable all optional services at once. `)
541
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
542
+ .requiredOption(`--status <status>`, `Service status.`, parseBool)
543
+ .action(
544
+ actionRunner(
545
+ async ({ projectId, status }) =>
546
+ parse(await (await getProjectsClient()).updateServiceStatusAll(projectId, status)),
547
+ ),
548
+ );
549
+
550
+ projects
551
+ .command(`update-smtp`)
552
+ .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. `)
553
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
554
+ .requiredOption(`--enabled <enabled>`, `Enable custom SMTP service`, parseBool)
555
+ .option(`--sender-name <sender-name>`, `Name of the email sender`)
556
+ .option(`--sender-email <sender-email>`, `Email of the sender`)
557
+ .option(`--reply-to <reply-to>`, `Reply to email`)
558
+ .option(`--host <host>`, `SMTP server host name`)
559
+ .option(`--port <port>`, `SMTP server port`, parseInteger)
560
+ .option(`--username <username>`, `SMTP server username`)
561
+ .option(`--password <password>`, `SMTP server password`)
562
+ .option(`--secure <secure>`, `Does SMTP server use secure connection`)
563
+ .action(
564
+ actionRunner(
565
+ async ({ projectId, enabled, senderName, senderEmail, replyTo, host, port, username, password, secure }) =>
566
+ parse(await (await getProjectsClient()).updateSmtp(projectId, enabled, senderName, senderEmail, replyTo, host, port, username, password, secure as SMTPSecure)),
567
+ ),
568
+ );
569
+
570
+ projects
571
+ .command(`create-smtp-test`)
572
+ .description(`Send a test email to verify SMTP configuration. `)
573
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
574
+ .requiredOption(`--emails [emails...]`, `Array of emails to send test email to. Maximum of 10 emails are allowed.`)
575
+ .requiredOption(`--sender-name <sender-name>`, `Name of the email sender`)
576
+ .requiredOption(`--sender-email <sender-email>`, `Email of the sender`)
577
+ .requiredOption(`--host <host>`, `SMTP server host name`)
578
+ .option(`--reply-to <reply-to>`, `Reply to email`)
579
+ .option(`--port <port>`, `SMTP server port`, parseInteger)
580
+ .option(`--username <username>`, `SMTP server username`)
581
+ .option(`--password <password>`, `SMTP server password`)
582
+ .option(`--secure <secure>`, `Does SMTP server use secure connection`)
583
+ .action(
584
+ actionRunner(
585
+ async ({ projectId, emails, senderName, senderEmail, host, replyTo, port, username, password, secure }) =>
586
+ parse(await (await getProjectsClient()).createSmtpTest(projectId, emails, senderName, senderEmail, host, replyTo, port, username, password, secure as SMTPSecure)),
587
+ ),
588
+ );
589
+
590
+ projects
591
+ .command(`update-team`)
592
+ .description(`Update the team ID of a project allowing for it to be transferred to another team.`)
593
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
594
+ .requiredOption(`--team-id <team-id>`, `Team ID of the team to transfer project to.`)
595
+ .action(
596
+ actionRunner(
597
+ async ({ projectId, teamId }) =>
598
+ parse(await (await getProjectsClient()).updateTeam(projectId, teamId)),
599
+ ),
600
+ );
601
+
602
+ projects
603
+ .command(`get-email-template`)
604
+ .description(`Get a custom email template for the specified locale and type. This endpoint returns the template content, subject, and other configuration details. `)
605
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
606
+ .requiredOption(`--type <type>`, `Template type`)
607
+ .requiredOption(`--locale <locale>`, `Template locale`)
608
+ .action(
609
+ actionRunner(
610
+ async ({ projectId, type, locale }) =>
611
+ parse(await (await getProjectsClient()).getEmailTemplate(projectId, type as EmailTemplateType, locale as EmailTemplateLocale)),
612
+ ),
613
+ );
614
+
615
+ projects
616
+ .command(`update-email-template`)
617
+ .description(`Update a custom email template for the specified locale and type. Use this endpoint to modify the content of your email templates.`)
618
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
619
+ .requiredOption(`--type <type>`, `Template type`)
620
+ .requiredOption(`--locale <locale>`, `Template locale`)
621
+ .requiredOption(`--subject <subject>`, `Email Subject`)
622
+ .requiredOption(`--message <message>`, `Template message`)
623
+ .option(`--sender-name <sender-name>`, `Name of the email sender`)
624
+ .option(`--sender-email <sender-email>`, `Email of the sender`)
625
+ .option(`--reply-to <reply-to>`, `Reply to email`)
626
+ .action(
627
+ actionRunner(
628
+ async ({ projectId, type, locale, subject, message, senderName, senderEmail, replyTo }) =>
629
+ parse(await (await getProjectsClient()).updateEmailTemplate(projectId, type as EmailTemplateType, locale as EmailTemplateLocale, subject, message, senderName, senderEmail, replyTo)),
630
+ ),
631
+ );
632
+
633
+ projects
634
+ .command(`delete-email-template`)
635
+ .description(`Reset a custom email template to its default value. This endpoint removes any custom content and restores the template to its original state. `)
636
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
637
+ .requiredOption(`--type <type>`, `Template type`)
638
+ .requiredOption(`--locale <locale>`, `Template locale`)
639
+ .action(
640
+ actionRunner(
641
+ async ({ projectId, type, locale }) =>
642
+ parse(await (await getProjectsClient()).deleteEmailTemplate(projectId, type as EmailTemplateType, locale as EmailTemplateLocale)),
643
+ ),
644
+ );
645
+
646
+ projects
647
+ .command(`get-sms-template`)
648
+ .description(`Get a custom SMS template for the specified locale and type returning it's contents.`)
649
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
650
+ .requiredOption(`--type <type>`, `Template type`)
651
+ .requiredOption(`--locale <locale>`, `Template locale`)
652
+ .action(
653
+ actionRunner(
654
+ async ({ projectId, type, locale }) =>
655
+ parse(await (await getProjectsClient()).getSmsTemplate(projectId, type as SmsTemplateType, locale as SmsTemplateLocale)),
656
+ ),
657
+ );
658
+
659
+ projects
660
+ .command(`update-sms-template`)
661
+ .description(`Update a custom SMS template for the specified locale and type. Use this endpoint to modify the content of your SMS templates. `)
662
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
663
+ .requiredOption(`--type <type>`, `Template type`)
664
+ .requiredOption(`--locale <locale>`, `Template locale`)
665
+ .requiredOption(`--message <message>`, `Template message`)
666
+ .action(
667
+ actionRunner(
668
+ async ({ projectId, type, locale, message }) =>
669
+ parse(await (await getProjectsClient()).updateSmsTemplate(projectId, type as SmsTemplateType, locale as SmsTemplateLocale, message)),
670
+ ),
671
+ );
672
+
673
+ projects
674
+ .command(`delete-sms-template`)
675
+ .description(`Reset a custom SMS template to its default value. This endpoint removes any custom message and restores the template to its original state. `)
676
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
677
+ .requiredOption(`--type <type>`, `Template type`)
678
+ .requiredOption(`--locale <locale>`, `Template locale`)
679
+ .action(
680
+ actionRunner(
681
+ async ({ projectId, type, locale }) =>
682
+ parse(await (await getProjectsClient()).deleteSmsTemplate(projectId, type as SmsTemplateType, locale as SmsTemplateLocale)),
683
+ ),
684
+ );
685
+
686
+ projects
687
+ .command(`list-webhooks`)
688
+ .description(`Get a list of all webhooks belonging to the project. You can use the query params to filter your results. `)
689
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
690
+ .option(
691
+ `--total [value]`,
692
+ `When set to false, the total count returned will be 0 and will not be calculated.`,
693
+ (value: string | undefined) =>
694
+ value === undefined ? true : parseBool(value),
695
+ )
696
+ .action(
697
+ actionRunner(
698
+ async ({ projectId, total }) =>
699
+ parse(await (await getProjectsClient()).listWebhooks(projectId, total)),
700
+ ),
701
+ );
702
+
703
+ projects
704
+ .command(`create-webhook`)
705
+ .description(`Create a new webhook. Use this endpoint to configure a URL that will receive events from Appwrite when specific events occur. `)
706
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
707
+ .requiredOption(`--name <name>`, `Webhook name. Max length: 128 chars.`)
708
+ .requiredOption(`--events [events...]`, `Events list. Maximum of 100 events are allowed.`)
709
+ .requiredOption(`--url <url>`, `Webhook URL.`)
710
+ .requiredOption(`--security <security>`, `Certificate verification, false for disabled or true for enabled.`, parseBool)
711
+ .option(
712
+ `--enabled [value]`,
713
+ `Enable or disable a webhook.`,
714
+ (value: string | undefined) =>
715
+ value === undefined ? true : parseBool(value),
716
+ )
717
+ .option(`--http-user <http-user>`, `Webhook HTTP user. Max length: 256 chars.`)
718
+ .option(`--http-pass <http-pass>`, `Webhook HTTP password. Max length: 256 chars.`)
719
+ .action(
720
+ actionRunner(
721
+ async ({ projectId, name, events, url, security, enabled, httpUser, httpPass }) =>
722
+ parse(await (await getProjectsClient()).createWebhook(projectId, name, events, url, security, enabled, httpUser, httpPass)),
723
+ ),
724
+ );
725
+
726
+ projects
727
+ .command(`get-webhook`)
728
+ .description(`Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project. `)
729
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
730
+ .requiredOption(`--webhook-id <webhook-id>`, `Webhook unique ID.`)
731
+ .action(
732
+ actionRunner(
733
+ async ({ projectId, webhookId }) =>
734
+ parse(await (await getProjectsClient()).getWebhook(projectId, webhookId)),
735
+ ),
736
+ );
737
+
738
+ projects
739
+ .command(`update-webhook`)
740
+ .description(`Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook. `)
741
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
742
+ .requiredOption(`--webhook-id <webhook-id>`, `Webhook unique ID.`)
743
+ .requiredOption(`--name <name>`, `Webhook name. Max length: 128 chars.`)
744
+ .requiredOption(`--events [events...]`, `Events list. Maximum of 100 events are allowed.`)
745
+ .requiredOption(`--url <url>`, `Webhook URL.`)
746
+ .requiredOption(`--security <security>`, `Certificate verification, false for disabled or true for enabled.`, parseBool)
747
+ .option(
748
+ `--enabled [value]`,
749
+ `Enable or disable a webhook.`,
750
+ (value: string | undefined) =>
751
+ value === undefined ? true : parseBool(value),
752
+ )
753
+ .option(`--http-user <http-user>`, `Webhook HTTP user. Max length: 256 chars.`)
754
+ .option(`--http-pass <http-pass>`, `Webhook HTTP password. Max length: 256 chars.`)
755
+ .action(
756
+ actionRunner(
757
+ async ({ projectId, webhookId, name, events, url, security, enabled, httpUser, httpPass }) =>
758
+ parse(await (await getProjectsClient()).updateWebhook(projectId, webhookId, name, events, url, security, enabled, httpUser, httpPass)),
759
+ ),
760
+ );
761
+
762
+ projects
763
+ .command(`delete-webhook`)
764
+ .description(`Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events. `)
765
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
766
+ .requiredOption(`--webhook-id <webhook-id>`, `Webhook unique ID.`)
767
+ .action(
768
+ actionRunner(
769
+ async ({ projectId, webhookId }) =>
770
+ parse(await (await getProjectsClient()).deleteWebhook(projectId, webhookId)),
771
+ ),
772
+ );
773
+
774
+ projects
775
+ .command(`update-webhook-signature`)
776
+ .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. `)
777
+ .requiredOption(`--project-id <project-id>`, `Project unique ID.`)
778
+ .requiredOption(`--webhook-id <webhook-id>`, `Webhook unique ID.`)
779
+ .action(
780
+ actionRunner(
781
+ async ({ projectId, webhookId }) =>
782
+ parse(await (await getProjectsClient()).updateWebhookSignature(projectId, webhookId)),
783
+ ),
784
+ );
785
+