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
@@ -1,557 +1,931 @@
1
- import fs = require('fs');
2
- import chalk from 'chalk';
3
- import tar = require('tar');
4
- import { Command } from 'commander';
5
- import inquirer from 'inquirer';
6
- import { messagingListTopics } from './messaging';
7
- import { teamsList } from './teams';
8
- import { projectsGet } from './projects';
9
- import { functionsList, functionsGetDeploymentDownload, functionsListDeployments } from './functions';
10
- import { sitesList, sitesGetDeploymentDownload, sitesListDeployments } from './sites';
11
- import { databasesGet, databasesListCollections, databasesList } from './databases';
12
- import { tablesDBList, tablesDBGet, tablesDBListTables } from './tables-db';
13
- import { storageListBuckets } from './storage';
14
- import { localConfig } from '../config';
15
- import { paginate } from '../paginate';
16
- import { questionsPullCollection, questionsPullFunctions, questionsPullFunctionsCode, questionsPullSites, questionsPullSitesCode, questionsPullResources } from '../questions';
17
- import { cliConfig, success, log, warn, actionRunner, commandDescriptions } from '../parser';
18
-
19
- interface PullResourcesOptions {
20
- skipDeprecated?: boolean;
1
+ import fs from "fs";
2
+ import path from "path";
3
+ import chalk from "chalk";
4
+ import { Command } from "commander";
5
+ import inquirer from "inquirer";
6
+ import {
7
+ Databases,
8
+ Functions,
9
+ Messaging,
10
+ Projects,
11
+ Sites,
12
+ Storage,
13
+ TablesDB,
14
+ Teams,
15
+ Client,
16
+ Query,
17
+ Models,
18
+ } from "@appwrite.io/console";
19
+ import { getFunctionsService, getSitesService } from "../services.js";
20
+ import { sdkForProject, sdkForConsole } from "../sdks.js";
21
+ import { localConfig } from "../config.js";
22
+ import { paginate } from "../paginate.js";
23
+ import {
24
+ questionsPullFunctions,
25
+ questionsPullFunctionsCode,
26
+ questionsPullSites,
27
+ questionsPullSitesCode,
28
+ questionsPullResources,
29
+ } from "../questions.js";
30
+ import {
31
+ cliConfig,
32
+ success,
33
+ log,
34
+ warn,
35
+ error,
36
+ actionRunner,
37
+ commandDescriptions,
38
+ } from "../parser.js";
39
+ import type { ConfigType } from "./config.js";
40
+ import { createSettingsObject } from "../utils.js";
41
+ import { ProjectNotInitializedError } from "./errors.js";
42
+ import type { SettingsType, FunctionType, SiteType } from "./config.js";
43
+ import { downloadDeploymentCode } from "./utils/deployment.js";
44
+
45
+ export interface PullOptions {
46
+ all?: boolean;
47
+ settings?: boolean;
48
+ functions?: boolean;
49
+ sites?: boolean;
50
+ collections?: boolean;
51
+ tables?: boolean;
52
+ buckets?: boolean;
53
+ teams?: boolean;
54
+ topics?: boolean;
55
+ skipDeprecated?: boolean;
56
+ withVariables?: boolean;
57
+ noCode?: boolean;
21
58
  }
22
59
 
23
60
  interface PullFunctionsOptions {
24
- code?: boolean;
25
- withVariables?: boolean;
61
+ code?: boolean;
62
+ withVariables?: boolean;
63
+ functionIds?: string[];
26
64
  }
27
65
 
28
66
  interface PullSitesOptions {
29
- code?: boolean;
30
- withVariables?: boolean;
67
+ code?: boolean;
68
+ withVariables?: boolean;
69
+ siteIds?: string[];
31
70
  }
32
71
 
33
- export const pullResources = async ({
34
- skipDeprecated = false
35
- }: PullResourcesOptions = {}): Promise<void> => {
36
- const actions: Record<string, (options?: any) => Promise<void>> = {
37
- settings: pullSettings,
38
- functions: pullFunctions,
39
- sites: pullSites,
40
- collections: pullCollection,
41
- tables: pullTable,
42
- buckets: pullBucket,
43
- teams: pullTeam,
44
- messages: pullMessagingTopic
45
- }
72
+ export interface PullSettingsResult {
73
+ projectName: string;
74
+ settings: SettingsType;
75
+ project: Models.Project;
76
+ }
77
+
78
+ async function createPullInstance(): Promise<Pull> {
79
+ const projectClient = await sdkForProject();
80
+ const consoleClient = await sdkForConsole();
81
+ const pullInstance = new Pull(projectClient, consoleClient);
46
82
 
47
- if (skipDeprecated) {
48
- delete actions.collections;
83
+ pullInstance.setConfigDirectoryPath(localConfig.configDirectoryPath);
84
+ return pullInstance;
85
+ }
86
+
87
+ export class Pull {
88
+ private projectClient: Client;
89
+ private consoleClient: Client;
90
+ private configDirectoryPath: string;
91
+ private silent: boolean;
92
+
93
+ constructor(projectClient: Client, consoleClient: Client, silent = false) {
94
+ this.projectClient = projectClient;
95
+ this.consoleClient = consoleClient;
96
+ this.configDirectoryPath = process.cwd();
97
+ this.silent = silent;
98
+ }
99
+
100
+ /**
101
+ * Set the base directory path for config files and resources
102
+ */
103
+ public setConfigDirectoryPath(path: string): void {
104
+ this.configDirectoryPath = path;
105
+ }
106
+
107
+ /**
108
+ * Log a message (respects silent mode)
109
+ */
110
+ private log(message: string): void {
111
+ if (!this.silent) {
112
+ log(message);
113
+ }
114
+ }
115
+
116
+ /**
117
+ * Log a success message (respects silent mode)
118
+ */
119
+ private success(message: string): void {
120
+ if (!this.silent) {
121
+ success(message);
122
+ }
123
+ }
124
+
125
+ /**
126
+ * Log a warning message (respects silent mode)
127
+ */
128
+ private warn(message: string): void {
129
+ if (!this.silent) {
130
+ warn(message);
131
+ }
132
+ }
133
+
134
+ /**
135
+ * Pull resources from Appwrite project and return updated config
136
+ *
137
+ * @param config - Current configuration object
138
+ * @param options - Pull options specifying which resources to pull
139
+ * @returns Updated configuration object with pulled resources
140
+ */
141
+ public async pullResources(
142
+ config: ConfigType,
143
+ options: PullOptions = { all: true, skipDeprecated: true },
144
+ ): Promise<ConfigType> {
145
+ const { skipDeprecated = true } = options;
146
+ if (!config.projectId) {
147
+ throw new ProjectNotInitializedError();
49
148
  }
50
149
 
51
- if (cliConfig.all) {
52
- for (let action of Object.values(actions)) {
53
- cliConfig.all = true;
54
- await action({ returnOnZero: true });
55
- }
56
- } else {
57
- const answers = await inquirer.prompt(questionsPullResources[0]);
150
+ const updatedConfig: ConfigType = { ...config };
151
+ const shouldPullAll = options.all === true;
58
152
 
59
- const action = actions[answers.resource];
60
- if (action !== undefined) {
61
- await action({ returnOnZero: true });
62
- }
153
+ if (shouldPullAll || options.settings) {
154
+ const settings = await this.pullSettings(config.projectId);
155
+ updatedConfig.settings = settings.settings;
156
+ updatedConfig.projectName = settings.projectName;
63
157
  }
64
- };
65
158
 
66
- const pullSettings = async (): Promise<void> => {
67
- log("Pulling project settings ...");
159
+ if (shouldPullAll || options.functions) {
160
+ const functions = await this.pullFunctions({
161
+ code: options.noCode === true ? false : true,
162
+ withVariables: options.withVariables,
163
+ });
164
+ updatedConfig.functions = functions;
165
+ }
68
166
 
69
- try {
70
- let response = await projectsGet({
71
- parseOutput: false,
72
- projectId: localConfig.getProject().projectId
73
- });
167
+ if (shouldPullAll || options.sites) {
168
+ const sites = await this.pullSites({
169
+ code: options.noCode === true ? false : true,
170
+ withVariables: options.withVariables,
171
+ });
172
+ updatedConfig.sites = sites;
173
+ }
74
174
 
75
- localConfig.setProject(response.$id, response.name, response);
175
+ if (shouldPullAll || options.tables) {
176
+ const { databases, tables } = await this.pullTables();
177
+ updatedConfig.databases = databases;
178
+ updatedConfig.tables = tables;
179
+ }
76
180
 
77
- success(`Successfully pulled ${chalk.bold('all')} project settings.`);
78
- } catch (e) {
79
- throw e;
181
+ if (options.collections || (shouldPullAll && !skipDeprecated)) {
182
+ const { databases, collections } = await this.pullCollections();
183
+ updatedConfig.databases = databases;
184
+ updatedConfig.collections = collections;
80
185
  }
81
- }
82
186
 
83
- const pullFunctions = async ({ code, withVariables }: PullFunctionsOptions = {}): Promise<void> => {
84
- process.chdir(localConfig.configDirectoryPath)
187
+ if (shouldPullAll || options.buckets) {
188
+ const buckets = await this.pullBuckets();
189
+ updatedConfig.buckets = buckets;
190
+ }
85
191
 
86
- log("Fetching functions ...");
87
- let total = 0;
192
+ if (shouldPullAll || options.teams) {
193
+ const teams = await this.pullTeams();
194
+ updatedConfig.teams = teams;
195
+ }
88
196
 
89
- const fetchResponse = await functionsList({
90
- queries: [JSON.stringify({ method: 'limit', values: [1] })],
91
- parseOutput: false
92
- });
93
- if (fetchResponse["functions"].length <= 0) {
94
- log("No functions found.");
95
- success(`Successfully pulled ${chalk.bold(total)} functions.`);
96
- return;
197
+ if (shouldPullAll || options.topics) {
198
+ const topics = await this.pullMessagingTopics();
199
+ updatedConfig.topics = topics;
97
200
  }
98
201
 
99
- const functions = cliConfig.all
100
- ? (await paginate(functionsList, { parseOutput: false }, 100, 'functions')).functions
101
- : (await inquirer.prompt(questionsPullFunctions)).functions;
102
-
103
- let allowCodePull: boolean | null = cliConfig.force === true ? true : null;
104
-
105
- for (let func of functions) {
106
- total++;
107
- log(`Pulling function ${chalk.bold(func['name'])} ...`);
108
-
109
- const localFunction = localConfig.getFunction(func.$id);
110
-
111
- func['path'] = localFunction['path'];
112
- if (!localFunction['path']) {
113
- func['path'] = `functions/${func.name}`;
114
- }
115
- const holdingVars = func['vars'];
116
- // We don't save var in to the config
117
- delete func['vars'];
118
- localConfig.addFunction(func);
119
-
120
- if (!fs.existsSync(func['path'])) {
121
- fs.mkdirSync(func['path'], { recursive: true });
122
- }
123
-
124
- if (code === false) {
125
- warn("Source code download skipped.");
126
- continue;
127
- }
128
-
129
- if (allowCodePull === null) {
130
- const codeAnswer = await inquirer.prompt(questionsPullFunctionsCode);
131
- allowCodePull = codeAnswer.override;
132
- }
133
-
134
- if (!allowCodePull) {
135
- continue;
136
- }
137
-
138
- let deploymentId: string | null = null;
139
-
140
- try {
141
- const fetchResponse = await functionsListDeployments({
142
- functionId: func['$id'],
143
- queries: [
144
- JSON.stringify({ method: 'limit', values: [1] }),
145
- JSON.stringify({ method: 'orderDesc', values: ['$id'] })
146
- ],
147
- parseOutput: false
148
- });
149
-
150
- if (fetchResponse['total'] > 0) {
151
- deploymentId = fetchResponse['deployments'][0]['$id'];
152
- }
153
-
154
- } catch {
155
- }
156
-
157
- if (deploymentId === null) {
158
- log("Source code download skipped because function doesn't have any available deployment");
159
- continue;
160
- }
161
-
162
- log("Pulling latest deployment code ...");
163
-
164
- const compressedFileName = `${func['$id']}-${+new Date()}.tar.gz`
165
- await functionsGetDeploymentDownload({
166
- functionId: func['$id'],
167
- deploymentId,
168
- destination: compressedFileName,
169
- overrideForCli: true,
170
- parseOutput: false
171
- });
202
+ return updatedConfig;
203
+ }
204
+
205
+ /**
206
+ * Pull project settings
207
+ */
208
+ public async pullSettings(projectId: string): Promise<PullSettingsResult> {
209
+ this.log("Pulling project settings ...");
210
+
211
+ const projectsService = new Projects(this.consoleClient);
212
+ const project = await projectsService.get({ projectId: projectId });
213
+
214
+ this.success(`Successfully pulled ${chalk.bold("all")} project settings.`);
215
+
216
+ return {
217
+ projectName: project.name,
218
+ settings: createSettingsObject(project),
219
+ project,
220
+ };
221
+ }
222
+
223
+ /**
224
+ * Pull functions from the project
225
+ */
226
+ public async pullFunctions(
227
+ options: PullFunctionsOptions = {},
228
+ ): Promise<FunctionType[]> {
229
+ this.log("Fetching functions ...");
230
+
231
+ const functionsService = new Functions(this.projectClient);
232
+ let functions: Models.Function[];
233
+
234
+ if (options.functionIds && options.functionIds.length > 0) {
235
+ functions = await Promise.all(
236
+ options.functionIds.map((id) =>
237
+ functionsService.get({
238
+ functionId: id,
239
+ }),
240
+ ),
241
+ );
242
+ } else {
243
+ const fetchResponse = await functionsService.list({
244
+ queries: [Query.limit(1)],
245
+ });
246
+
247
+ if (fetchResponse["functions"].length <= 0) {
248
+ this.log("No functions found.");
249
+ this.success(`Successfully pulled ${chalk.bold(0)} functions.`);
250
+ return [];
251
+ }
252
+
253
+ const { functions: allFunctions } = await paginate(
254
+ async () => new Functions(this.projectClient).list(),
255
+ {},
256
+ 100,
257
+ "functions",
258
+ );
259
+ functions = allFunctions;
260
+ }
172
261
 
173
- tar.extract({
174
- sync: true,
175
- cwd: func['path'],
176
- file: compressedFileName,
177
- strict: false,
262
+ const result: FunctionType[] = [];
263
+
264
+ for (const func of functions) {
265
+ this.log(`Pulling function ${chalk.bold(func.name)} ...`);
266
+
267
+ const funcPath = `functions/${func.name}`;
268
+ const absoluteFuncPath = path.resolve(this.configDirectoryPath, funcPath);
269
+ const holdingVars = func.vars || [];
270
+
271
+ const functionConfig: FunctionType = {
272
+ $id: func.$id,
273
+ name: func.name,
274
+ runtime: func.runtime,
275
+ path: funcPath,
276
+ entrypoint: func.entrypoint,
277
+ execute: func.execute,
278
+ enabled: func.enabled,
279
+ logging: func.logging,
280
+ events: func.events,
281
+ schedule: func.schedule,
282
+ timeout: func.timeout,
283
+ commands: func.commands,
284
+ scopes: func.scopes,
285
+ specification: func.specification,
286
+ };
287
+
288
+ result.push(functionConfig);
289
+
290
+ if (!fs.existsSync(absoluteFuncPath)) {
291
+ fs.mkdirSync(absoluteFuncPath, { recursive: true });
292
+ }
293
+
294
+ if (options.code !== false) {
295
+ await downloadDeploymentCode({
296
+ resourceId: func["$id"],
297
+ resourcePath: absoluteFuncPath,
298
+ holdingVars,
299
+ withVariables: options.withVariables,
300
+ listDeployments: () =>
301
+ functionsService.listDeployments({
302
+ functionId: func["$id"],
303
+ queries: [Query.limit(1), Query.orderDesc("$id")],
304
+ }),
305
+ getDownloadUrl: (deploymentId) =>
306
+ functionsService.getDeploymentDownload({
307
+ functionId: func["$id"],
308
+ deploymentId,
309
+ }),
310
+ projectClient: this.projectClient,
178
311
  });
312
+ }
313
+ }
179
314
 
180
- fs.rmSync(compressedFileName);
315
+ if (options.code === false) {
316
+ this.warn("Source code download skipped.");
317
+ }
318
+
319
+ this.success(`Successfully pulled ${chalk.bold(result.length)} functions.`);
320
+ return result;
321
+ }
322
+
323
+ /**
324
+ * Pull sites from the project
325
+ */
326
+ public async pullSites(options: PullSitesOptions = {}): Promise<SiteType[]> {
327
+ this.log("Fetching sites ...");
328
+
329
+ const sitesService = new Sites(this.projectClient);
330
+ let sites: Models.Site[];
331
+
332
+ if (options.siteIds && options.siteIds.length > 0) {
333
+ sites = await Promise.all(
334
+ options.siteIds.map((id) =>
335
+ sitesService.get({
336
+ siteId: id,
337
+ }),
338
+ ),
339
+ );
340
+ } else {
341
+ const fetchResponse = await sitesService.list({
342
+ queries: [Query.limit(1)],
343
+ });
344
+
345
+ if (fetchResponse["sites"].length <= 0) {
346
+ this.log("No sites found.");
347
+ this.success(`Successfully pulled ${chalk.bold(0)} sites.`);
348
+ return [];
349
+ }
350
+
351
+ const { sites: fetchedSites } = await paginate(
352
+ async () => new Sites(this.projectClient).list(),
353
+ {},
354
+ 100,
355
+ "sites",
356
+ );
357
+ sites = fetchedSites;
358
+ }
181
359
 
182
- if (withVariables) {
183
- const envFileLocation = `${func['path']}/.env`
184
- try {
185
- fs.rmSync(envFileLocation);
186
- } catch {
187
- }
360
+ const result: SiteType[] = [];
361
+
362
+ for (const site of sites) {
363
+ this.log(`Pulling site ${chalk.bold(site.name)} ...`);
364
+
365
+ const sitePath = `sites/${site.name}`;
366
+ const absoluteSitePath = path.resolve(this.configDirectoryPath, sitePath);
367
+ const holdingVars = site.vars || [];
368
+
369
+ const siteConfig: SiteType = {
370
+ $id: site.$id,
371
+ name: site.name,
372
+ path: sitePath,
373
+ framework: site.framework,
374
+ enabled: site.enabled,
375
+ logging: site.logging,
376
+ timeout: site.timeout,
377
+ buildRuntime: site.buildRuntime,
378
+ adapter: site.adapter,
379
+ installCommand: site.installCommand,
380
+ buildCommand: site.buildCommand,
381
+ outputDirectory: site.outputDirectory,
382
+ fallbackFile: site.fallbackFile,
383
+ specification: site.specification,
384
+ };
385
+
386
+ result.push(siteConfig);
387
+
388
+ if (!fs.existsSync(absoluteSitePath)) {
389
+ fs.mkdirSync(absoluteSitePath, { recursive: true });
390
+ }
391
+
392
+ if (options.code !== false) {
393
+ await downloadDeploymentCode({
394
+ resourceId: site["$id"],
395
+ resourcePath: absoluteSitePath,
396
+ holdingVars,
397
+ withVariables: options.withVariables,
398
+ listDeployments: () =>
399
+ sitesService.listDeployments({
400
+ siteId: site["$id"],
401
+ queries: [Query.limit(1), Query.orderDesc("$id")],
402
+ }),
403
+ getDownloadUrl: (deploymentId) =>
404
+ sitesService.getDeploymentDownload({
405
+ siteId: site["$id"],
406
+ deploymentId,
407
+ }),
408
+ projectClient: this.projectClient,
409
+ });
410
+ }
411
+ }
188
412
 
189
- fs.writeFileSync(envFileLocation, holdingVars.map((r: any) => `${r.key}=${r.value}\n`).join(''))
190
- }
413
+ if (options.code === false) {
414
+ this.warn("Source code download skipped.");
191
415
  }
192
416
 
193
- success(`Successfully pulled ${chalk.bold(total)} functions.`);
194
- }
417
+ this.success(`Successfully pulled ${chalk.bold(result.length)} sites.`);
418
+ return result;
419
+ }
195
420
 
196
- const pullSites = async ({ code, withVariables }: PullSitesOptions = {}): Promise<void> => {
197
- process.chdir(localConfig.configDirectoryPath)
421
+ /**
422
+ * Pull collections from the project (deprecated)
423
+ */
424
+ public async pullCollections(): Promise<{
425
+ databases: any[];
426
+ collections: any[];
427
+ }> {
428
+ this.warn(
429
+ "appwrite pull collection has been deprecated. Please consider using 'appwrite pull tables' instead",
430
+ );
431
+ this.log("Fetching collections ...");
198
432
 
199
- log("Fetching sites ...");
200
- let total = 0;
433
+ const databasesService = new Databases(this.projectClient);
201
434
 
202
- const fetchResponse = await sitesList({
203
- queries: [JSON.stringify({ method: 'limit', values: [1] })],
204
- parseOutput: false
205
- });
206
- if (fetchResponse["sites"].length <= 0) {
207
- log("No sites found.");
208
- success(`Successfully pulled ${chalk.bold(total)} sites.`);
209
- return;
435
+ const fetchResponse = await databasesService.list([Query.limit(1)]);
436
+
437
+ if (fetchResponse["databases"].length <= 0) {
438
+ this.log("No collections found.");
439
+ this.success(
440
+ `Successfully pulled ${chalk.bold(0)} collections from ${chalk.bold(0)} databases.`,
441
+ );
442
+ return { databases: [], collections: [] };
210
443
  }
211
444
 
212
- const sites = cliConfig.all
213
- ? (await paginate(sitesList, { parseOutput: false }, 100, 'sites')).sites
214
- : (await inquirer.prompt(questionsPullSites)).sites;
215
-
216
- let allowCodePull: boolean | null = cliConfig.force === true ? true : null;
217
-
218
- for (let site of sites) {
219
- total++;
220
- log(`Pulling site ${chalk.bold(site['name'])} ...`);
221
-
222
- const localSite = localConfig.getSite(site.$id);
223
-
224
- site['path'] = localSite['path'];
225
- if (!localSite['path']) {
226
- site['path'] = `sites/${site.name}`;
227
- }
228
- const holdingVars = site['vars'];
229
- // We don't save var in to the config
230
- delete site['vars'];
231
- localConfig.addSite(site);
232
-
233
- if (!fs.existsSync(site['path'])) {
234
- fs.mkdirSync(site['path'], { recursive: true });
235
- }
236
-
237
- if (code === false) {
238
- warn("Source code download skipped.");
239
- continue;
240
- }
241
-
242
- if (allowCodePull === null) {
243
- const codeAnswer = await inquirer.prompt(questionsPullSitesCode);
244
- allowCodePull = codeAnswer.override;
245
- }
246
-
247
- if (!allowCodePull) {
248
- continue;
249
- }
250
-
251
- let deploymentId: string | null = null;
252
-
253
- try {
254
- const fetchResponse = await sitesListDeployments({
255
- siteId: site['$id'],
256
- queries: [
257
- JSON.stringify({ method: 'limit', values: [1] }),
258
- JSON.stringify({ method: 'orderDesc', values: ['$id'] })
259
- ],
260
- parseOutput: false
261
- });
262
-
263
- if (fetchResponse['total'] > 0) {
264
- deploymentId = fetchResponse['deployments'][0]['$id'];
265
- }
266
-
267
- } catch {
268
- }
269
-
270
- if (deploymentId === null) {
271
- log("Source code download skipped because site doesn't have any available deployment");
272
- continue;
273
- }
274
-
275
- log("Pulling latest deployment code ...");
276
-
277
- const compressedFileName = `${site['$id']}-${+new Date()}.tar.gz`
278
- await sitesGetDeploymentDownload({
279
- siteId: site['$id'],
280
- deploymentId,
281
- destination: compressedFileName,
282
- overrideForCli: true,
283
- parseOutput: false
445
+ const { databases } = await paginate(
446
+ async () => new Databases(this.projectClient).list(),
447
+ {},
448
+ 100,
449
+ "databases",
450
+ );
451
+
452
+ const allDatabases: any[] = [];
453
+ const allCollections: any[] = [];
454
+
455
+ for (const database of databases) {
456
+ this.log(
457
+ `Pulling all collections from ${chalk.bold(database.name)} database ...`,
458
+ );
459
+ allDatabases.push(database);
460
+
461
+ const { collections } = await paginate(
462
+ async () =>
463
+ new Databases(this.projectClient).listCollections(database.$id),
464
+ {},
465
+ 100,
466
+ "collections",
467
+ );
468
+
469
+ for (const collection of collections) {
470
+ allCollections.push({
471
+ ...collection,
472
+ $createdAt: undefined,
473
+ $updatedAt: undefined,
284
474
  });
475
+ }
476
+ }
477
+
478
+ this.success(
479
+ `Successfully pulled ${chalk.bold(allCollections.length)} collections from ${chalk.bold(allDatabases.length)} databases.`,
480
+ );
481
+
482
+ return {
483
+ databases: allDatabases,
484
+ collections: allCollections,
485
+ };
486
+ }
487
+
488
+ /**
489
+ * Pull tables from the project
490
+ */
491
+ public async pullTables(): Promise<{
492
+ databases: any[];
493
+ tables: any[];
494
+ }> {
495
+ this.log("Fetching tables ...");
496
+
497
+ const tablesDBService = new TablesDB(this.projectClient);
498
+
499
+ const fetchResponse = await tablesDBService.list({
500
+ queries: [Query.limit(1)],
501
+ });
285
502
 
286
- tar.extract({
287
- sync: true,
288
- cwd: site['path'],
289
- file: compressedFileName,
290
- strict: false,
503
+ if (fetchResponse["databases"].length <= 0) {
504
+ this.log("No tables found.");
505
+ this.success(
506
+ `Successfully pulled ${chalk.bold(0)} tables from ${chalk.bold(0)} tableDBs.`,
507
+ );
508
+ return { databases: [], tables: [] };
509
+ }
510
+
511
+ const { databases } = await paginate(
512
+ async () => new TablesDB(this.projectClient).list(),
513
+ {},
514
+ 100,
515
+ "databases",
516
+ );
517
+
518
+ const allDatabases: any[] = [];
519
+ const allTables: any[] = [];
520
+
521
+ for (const database of databases) {
522
+ this.log(
523
+ `Pulling all tables from ${chalk.bold(database.name)} database ...`,
524
+ );
525
+ allDatabases.push(database);
526
+
527
+ const { tables } = await paginate(
528
+ async () => new TablesDB(this.projectClient).listTables(database.$id),
529
+ {},
530
+ 100,
531
+ "tables",
532
+ );
533
+
534
+ for (const table of tables) {
535
+ allTables.push({
536
+ ...table,
537
+ $createdAt: undefined,
538
+ $updatedAt: undefined,
291
539
  });
540
+ }
541
+ }
292
542
 
293
- fs.rmSync(compressedFileName);
543
+ this.success(
544
+ `Successfully pulled ${chalk.bold(allTables.length)} tables from ${chalk.bold(allDatabases.length)} tableDBs.`,
545
+ );
294
546
 
295
- if (withVariables) {
296
- const envFileLocation = `${site['path']}/.env`
297
- try {
298
- fs.rmSync(envFileLocation);
299
- } catch {
300
- }
547
+ return {
548
+ databases: allDatabases,
549
+ tables: allTables,
550
+ };
551
+ }
301
552
 
302
- fs.writeFileSync(envFileLocation, holdingVars.map((r: any) => `${r.key}=${r.value}\n`).join(''))
303
- }
304
- }
553
+ /**
554
+ * Pull storage buckets from the project
555
+ */
556
+ public async pullBuckets(): Promise<any[]> {
557
+ this.log("Fetching buckets ...");
305
558
 
306
- success(`Successfully pulled ${chalk.bold(total)} sites.`);
307
- }
559
+ const storageService = new Storage(this.projectClient);
308
560
 
309
- const pullCollection = async (): Promise<void> => {
310
- warn("appwrite pull collection has been deprecated. Please consider using 'appwrite pull tables' instead");
311
- log("Fetching collections ...");
312
- let totalDatabases = 0;
313
- let totalCollections = 0;
314
-
315
- const fetchResponse = await databasesList({
316
- queries: [JSON.stringify({ method: 'limit', values: [1] })],
317
- parseOutput: false
561
+ const fetchResponse = await storageService.listBuckets({
562
+ queries: [Query.limit(1)],
318
563
  });
319
- if (fetchResponse["databases"].length <= 0) {
320
- log("No collections found.");
321
- success(`Successfully pulled ${chalk.bold(totalCollections)} collections from ${chalk.bold(totalDatabases)} databases.`);
322
- return;
564
+
565
+ if (fetchResponse["buckets"].length <= 0) {
566
+ this.log("No buckets found.");
567
+ this.success(`Successfully pulled ${chalk.bold(0)} buckets.`);
568
+ return [];
323
569
  }
324
570
 
325
- let databases: string[] = cliConfig.ids;
571
+ const { buckets } = await paginate(
572
+ async () => new Storage(this.projectClient).listBuckets(),
573
+ {},
574
+ 100,
575
+ "buckets",
576
+ );
326
577
 
327
- if (databases.length === 0) {
328
- if (cliConfig.all) {
329
- databases = (await paginate(databasesList, { parseOutput: false }, 100, 'databases')).databases.map((database: any) => database.$id);
330
- } else {
331
- databases = (await inquirer.prompt(questionsPullCollection)).databases;
332
- }
578
+ for (const bucket of buckets) {
579
+ this.log(`Pulling bucket ${chalk.bold(bucket.name)} ...`);
333
580
  }
334
581
 
335
- for (const databaseId of databases) {
336
- const database = await databasesGet({
337
- databaseId,
338
- parseOutput: false
339
- });
582
+ this.success(`Successfully pulled ${chalk.bold(buckets.length)} buckets.`);
583
+
584
+ return buckets;
585
+ }
340
586
 
341
- totalDatabases++;
342
- log(`Pulling all collections from ${chalk.bold(database['name'])} database ...`);
587
+ /**
588
+ * Pull teams from the project
589
+ */
590
+ public async pullTeams(): Promise<any[]> {
591
+ this.log("Fetching teams ...");
343
592
 
344
- localConfig.addDatabase(database);
593
+ const teamsService = new Teams(this.projectClient);
345
594
 
346
- const { collections } = await paginate(databasesListCollections, {
347
- databaseId,
348
- parseOutput: false
349
- }, 100, 'collections');
595
+ const fetchResponse = await teamsService.list({
596
+ queries: [Query.limit(1)],
597
+ });
350
598
 
351
- for (const collection of collections) {
352
- totalCollections++;
353
- localConfig.addCollection({
354
- ...collection,
355
- '$createdAt': undefined,
356
- '$updatedAt': undefined
357
- });
358
- }
599
+ if (fetchResponse["teams"].length <= 0) {
600
+ this.log("No teams found.");
601
+ this.success(`Successfully pulled ${chalk.bold(0)} teams.`);
602
+ return [];
359
603
  }
360
604
 
361
- success(`Successfully pulled ${chalk.bold(totalCollections)} collections from ${chalk.bold(totalDatabases)} databases.`);
362
- }
605
+ const { teams } = await paginate(
606
+ async () => new Teams(this.projectClient).list(),
607
+ {},
608
+ 100,
609
+ "teams",
610
+ );
363
611
 
364
- const pullTable = async (): Promise<void> => {
365
- log("Fetching tables ...");
366
- let totalTablesDBs = 0;
367
- let totalTables = 0;
612
+ for (const team of teams) {
613
+ this.log(`Pulling team ${chalk.bold(team.name)} ...`);
614
+ }
615
+
616
+ this.success(`Successfully pulled ${chalk.bold(teams.length)} teams.`);
617
+
618
+ return teams;
619
+ }
368
620
 
369
- const fetchResponse = await tablesDBList({
370
- queries: [JSON.stringify({ method: 'limit', values: [1] })],
371
- parseOutput: false
621
+ /**
622
+ * Pull messaging topics from the project
623
+ */
624
+ public async pullMessagingTopics(): Promise<any[]> {
625
+ this.log("Fetching topics ...");
626
+
627
+ const messagingService = new Messaging(this.projectClient);
628
+
629
+ const fetchResponse = await messagingService.listTopics({
630
+ queries: [Query.limit(1)],
372
631
  });
373
- if (fetchResponse["databases"].length <= 0) {
374
- log("No tables found.");
375
- success(`Successfully pulled ${chalk.bold(totalTables)} tables from ${chalk.bold(totalTablesDBs)} tableDBs.`);
376
- return;
632
+
633
+ if (fetchResponse["topics"].length <= 0) {
634
+ this.log("No topics found.");
635
+ this.success(`Successfully pulled ${chalk.bold(0)} topics.`);
636
+ return [];
377
637
  }
378
638
 
379
- let databases: string[] = cliConfig.ids;
639
+ const { topics } = await paginate(
640
+ async () => new Messaging(this.projectClient).listTopics(),
641
+ {},
642
+ 100,
643
+ "topics",
644
+ );
380
645
 
381
- if (databases.length === 0) {
382
- if (cliConfig.all) {
383
- databases = (await paginate(tablesDBList, { parseOutput: false }, 100, 'databases')).databases.map((database: any) => database.$id);
384
- } else {
385
- databases = (await inquirer.prompt(questionsPullCollection)).databases;
386
- }
646
+ for (const topic of topics) {
647
+ this.log(`Pulling topic ${chalk.bold(topic.name)} ...`);
387
648
  }
388
649
 
389
- for (const databaseId of databases) {
390
- const database = await tablesDBGet({
391
- databaseId,
392
- parseOutput: false
393
- });
650
+ this.success(`Successfully pulled ${chalk.bold(topics.length)} topics.`);
394
651
 
395
- totalTablesDBs++;
396
- log(`Pulling all tables from ${chalk.bold(database['name'])} database ...`);
652
+ return topics;
653
+ }
654
+ }
397
655
 
398
- localConfig.addTablesDB(database);
656
+ /** Helper methods for CLI commands */
399
657
 
400
- const { tables } = await paginate(tablesDBListTables, {
401
- databaseId,
402
- parseOutput: false
403
- }, 100, 'tables');
658
+ export const pullResources = async ({
659
+ skipDeprecated = true,
660
+ }: {
661
+ skipDeprecated?: boolean;
662
+ } = {}): Promise<void> => {
663
+ const project = localConfig.getProject();
664
+ if (!project.projectId) {
665
+ error(
666
+ "Project configuration not found. Please run 'appwrite init project' to initialize your project first.",
667
+ );
668
+ process.exit(1);
669
+ }
670
+
671
+ const actions: Record<string, (options?: any) => Promise<void>> = {
672
+ settings: pullSettings,
673
+ functions: pullFunctions,
674
+ sites: pullSites,
675
+ collections: pullCollection,
676
+ tables: pullTable,
677
+ buckets: pullBucket,
678
+ teams: pullTeam,
679
+ messages: pullMessagingTopic,
680
+ };
681
+
682
+ if (skipDeprecated) {
683
+ delete actions.collections;
684
+ }
685
+
686
+ if (cliConfig.all) {
687
+ for (let action of Object.values(actions)) {
688
+ cliConfig.all = true;
689
+ await action({ returnOnZero: true });
690
+ }
691
+ } else {
692
+ const answers = await inquirer.prompt([questionsPullResources[0]]);
404
693
 
405
- for (const table of tables) {
406
- totalTables++;
407
- localConfig.addTable({
408
- ...table,
409
- '$createdAt': undefined,
410
- '$updatedAt': undefined
411
- });
412
- }
694
+ const action = actions[answers.resource];
695
+ if (action !== undefined) {
696
+ await action({ returnOnZero: true });
413
697
  }
698
+ }
699
+ };
414
700
 
415
- success(`Successfully pulled ${chalk.bold(totalTables)} tables from ${chalk.bold(totalTablesDBs)} tableDBs.`);
416
- }
701
+ const pullSettings = async (): Promise<void> => {
702
+ const pullInstance = await createPullInstance();
703
+ const projectId = localConfig.getProject().projectId;
704
+ const settings = await pullInstance.pullSettings(projectId);
417
705
 
418
- const pullBucket = async (): Promise<void> => {
419
- log("Fetching buckets ...");
420
- let total = 0;
706
+ localConfig.setProject(projectId, settings.projectName, settings.project);
707
+ };
421
708
 
422
- const fetchResponse = await storageListBuckets({
423
- queries: [JSON.stringify({ method: 'limit', values: [1] })],
424
- parseOutput: false
425
- });
426
- if (fetchResponse["buckets"].length <= 0) {
427
- log("No buckets found.");
428
- success(`Successfully pulled ${chalk.bold(total)} buckets.`);
429
- return;
430
- }
709
+ const pullFunctions = async ({
710
+ code,
711
+ withVariables,
712
+ }: PullFunctionsOptions = {}): Promise<void> => {
713
+ const functionsService = await getFunctionsService();
714
+ const fetchResponse = await functionsService.list([Query.limit(1)]);
715
+ if (fetchResponse["functions"].length <= 0) {
716
+ log("No functions found.");
717
+ success(`Successfully pulled ${chalk.bold(0)} functions.`);
718
+ return;
719
+ }
720
+
721
+ const functionsToCheck = cliConfig.all
722
+ ? (
723
+ await paginate(
724
+ async () => (await getFunctionsService()).list(),
725
+ {},
726
+ 100,
727
+ "functions",
728
+ )
729
+ ).functions
730
+ : (await inquirer.prompt(questionsPullFunctions)).functions;
731
+
732
+ let allowCodePull: boolean | null = cliConfig.force === true ? true : null;
733
+ if (code !== false && allowCodePull === null) {
734
+ const codeAnswer = await inquirer.prompt(questionsPullFunctionsCode);
735
+ allowCodePull = codeAnswer.override;
736
+ }
737
+
738
+ const shouldPullCode = code !== false && allowCodePull === true;
739
+ const selectedFunctionIds = functionsToCheck.map((f: any) => f.$id);
740
+
741
+ const pullInstance = await createPullInstance();
742
+ const functions = await pullInstance.pullFunctions({
743
+ code: shouldPullCode,
744
+ withVariables,
745
+ functionIds: selectedFunctionIds,
746
+ });
747
+
748
+ for (const func of functions) {
749
+ const localFunction = localConfig.getFunction(func.$id);
750
+ func["path"] = localFunction["path"] || func["path"];
751
+ localConfig.addFunction(func);
752
+ }
753
+ };
431
754
 
432
- const { buckets } = await paginate(storageListBuckets, { parseOutput: false }, 100, 'buckets');
755
+ const pullSites = async ({
756
+ code,
757
+ withVariables,
758
+ }: PullSitesOptions = {}): Promise<void> => {
759
+ const sitesService = await getSitesService();
760
+ const fetchResponse = await sitesService.list({
761
+ queries: [Query.limit(1)],
762
+ });
763
+ if (fetchResponse["sites"].length <= 0) {
764
+ log("No sites found.");
765
+ success(`Successfully pulled ${chalk.bold(0)} sites.`);
766
+ return;
767
+ }
768
+
769
+ const sitesToCheck = cliConfig.all
770
+ ? (
771
+ await paginate(
772
+ async () => (await getSitesService()).list(),
773
+ {},
774
+ 100,
775
+ "sites",
776
+ )
777
+ ).sites
778
+ : (await inquirer.prompt(questionsPullSites)).sites;
779
+
780
+ let allowCodePull: boolean | null = cliConfig.force === true ? true : null;
781
+ if (code !== false && allowCodePull === null) {
782
+ const codeAnswer = await inquirer.prompt(questionsPullSitesCode);
783
+ allowCodePull = codeAnswer.override;
784
+ }
785
+
786
+ const shouldPullCode = code !== false && allowCodePull === true;
787
+ const selectedSiteIds = sitesToCheck.map((s: any) => s.$id);
788
+
789
+ const pullInstance = await createPullInstance();
790
+ const sites = await pullInstance.pullSites({
791
+ code: shouldPullCode,
792
+ withVariables,
793
+ siteIds: selectedSiteIds,
794
+ });
795
+
796
+ for (const site of sites) {
797
+ const localSite = localConfig.getSite(site.$id);
798
+ site["path"] = localSite["path"] || site["path"];
799
+ localConfig.addSite(site);
800
+ }
801
+ };
433
802
 
434
- for (const bucket of buckets) {
435
- total++;
436
- log(`Pulling bucket ${chalk.bold(bucket['name'])} ...`);
437
- localConfig.addBucket(bucket);
438
- }
803
+ const pullCollection = async (): Promise<void> => {
804
+ const pullInstance = await createPullInstance();
805
+ const { databases, collections } = await pullInstance.pullCollections();
439
806
 
440
- success(`Successfully pulled ${chalk.bold(total)} buckets.`);
441
- }
807
+ for (const database of databases) {
808
+ localConfig.addDatabase(database);
809
+ }
442
810
 
443
- const pullTeam = async (): Promise<void> => {
444
- log("Fetching teams ...");
445
- let total = 0;
811
+ for (const collection of collections) {
812
+ localConfig.addCollection(collection);
813
+ }
814
+ };
446
815
 
447
- const fetchResponse = await teamsList({
448
- queries: [JSON.stringify({ method: 'limit', values: [1] })],
449
- parseOutput: false
450
- });
451
- if (fetchResponse["teams"].length <= 0) {
452
- log("No teams found.");
453
- success(`Successfully pulled ${chalk.bold(total)} teams.`);
454
- return;
455
- }
816
+ const pullTable = async (): Promise<void> => {
817
+ const pullInstance = await createPullInstance();
818
+ const { databases, tables } = await pullInstance.pullTables();
456
819
 
457
- const { teams } = await paginate(teamsList, { parseOutput: false }, 100, 'teams');
820
+ for (const database of databases) {
821
+ localConfig.addTablesDB(database);
822
+ }
458
823
 
459
- for (const team of teams) {
460
- total++;
461
- log(`Pulling team ${chalk.bold(team['name'])} ...`);
462
- localConfig.addTeam(team);
463
- }
824
+ for (const table of tables) {
825
+ localConfig.addTable(table);
826
+ }
827
+ };
464
828
 
465
- success(`Successfully pulled ${chalk.bold(total)} teams.`);
466
- }
829
+ const pullBucket = async (): Promise<void> => {
830
+ const pullInstance = await createPullInstance();
831
+ const buckets = await pullInstance.pullBuckets();
467
832
 
468
- const pullMessagingTopic = async (): Promise<void> => {
469
- log("Fetching topics ...");
470
- let total = 0;
833
+ for (const bucket of buckets) {
834
+ localConfig.addBucket(bucket);
835
+ }
836
+ };
471
837
 
472
- const fetchResponse = await messagingListTopics({
473
- queries: [JSON.stringify({ method: 'limit', values: [1] })],
474
- parseOutput: false
475
- });
476
- if (fetchResponse["topics"].length <= 0) {
477
- log("No topics found.");
478
- success(`Successfully pulled ${chalk.bold(total)} topics.`);
479
- return;
480
- }
838
+ const pullTeam = async (): Promise<void> => {
839
+ const pullInstance = await createPullInstance();
840
+ const teams = await pullInstance.pullTeams();
481
841
 
482
- const { topics } = await paginate(messagingListTopics, { parseOutput: false }, 100, 'topics');
842
+ for (const team of teams) {
843
+ localConfig.addTeam(team);
844
+ }
845
+ };
483
846
 
484
- for (const topic of topics) {
485
- total++;
486
- log(`Pulling topic ${chalk.bold(topic['name'])} ...`);
487
- localConfig.addMessagingTopic(topic);
488
- }
847
+ const pullMessagingTopic = async (): Promise<void> => {
848
+ const pullInstance = await createPullInstance();
849
+ const topics = await pullInstance.pullMessagingTopics();
489
850
 
490
- success(`Successfully pulled ${chalk.bold(total)} topics.`);
491
- }
851
+ for (const topic of topics) {
852
+ localConfig.addMessagingTopic(topic);
853
+ }
854
+ };
855
+
856
+ /** Commander.js exports */
492
857
 
493
858
  export const pull = new Command("pull")
494
- .description(commandDescriptions['pull'])
495
- .action(actionRunner(() => pullResources({ skipDeprecated: true })));
859
+ .description(commandDescriptions["pull"])
860
+ .action(actionRunner(() => pullResources({ skipDeprecated: true })));
496
861
 
497
862
  pull
498
- .command("all")
499
- .description("Pull all resource.")
500
- .action(actionRunner(() => {
501
- cliConfig.all = true;
502
- return pullResources({
503
- skipDeprecated: true
504
- });
505
- }));
863
+ .command("all")
864
+ .description("Pull all resources")
865
+ .action(
866
+ actionRunner(() => {
867
+ cliConfig.all = true;
868
+ return pullResources({
869
+ skipDeprecated: true,
870
+ });
871
+ }),
872
+ );
506
873
 
507
874
  pull
508
- .command("settings")
509
- .description("Pull your Appwrite project name, services and auth settings")
510
- .action(actionRunner(pullSettings));
875
+ .command("settings")
876
+ .description("Pull your Appwrite project name, services and auth settings")
877
+ .action(actionRunner(pullSettings));
511
878
 
512
879
  pull
513
- .command("function")
514
- .alias("functions")
515
- .description("Pull your Appwrite cloud function")
516
- .option("--no-code", "Don't pull the function's code")
517
- .option("--with-variables", `Pull function variables. ${chalk.red('recommend for testing purposes only')}`)
518
- .action(actionRunner(pullFunctions))
880
+ .command("function")
881
+ .alias("functions")
882
+ .description("Pull your Appwrite cloud function")
883
+ .option("--no-code", "Don't pull the function's code")
884
+ .option(
885
+ "--with-variables",
886
+ `Pull function variables. ${chalk.red("recommend for testing purposes only")}`,
887
+ )
888
+ .action(actionRunner(pullFunctions));
519
889
 
520
890
  pull
521
- .command("site")
522
- .alias("sites")
523
- .description("Pull your Appwrite site")
524
- .option("--no-code", "Don't pull the site's code")
525
- .option("--with-variables", `Pull site variables. ${chalk.red('recommend for testing purposes only')}`)
526
- .action(actionRunner(pullSites))
891
+ .command("site")
892
+ .alias("sites")
893
+ .description("Pull your Appwrite site")
894
+ .option("--no-code", "Don't pull the site's code")
895
+ .option(
896
+ "--with-variables",
897
+ `Pull site variables. ${chalk.red("recommend for testing purposes only")}`,
898
+ )
899
+ .action(actionRunner(pullSites));
527
900
 
528
901
  pull
529
- .command("collection")
530
- .alias("collections")
531
- .description("Pull your Appwrite collections (deprecated, please use 'pull tables' instead)")
532
- .action(actionRunner(pullCollection))
902
+ .command("collection")
903
+ .alias("collections")
904
+ .description(
905
+ "Pull your Appwrite collections (deprecated, please use 'pull tables' instead)",
906
+ )
907
+ .action(actionRunner(pullCollection));
533
908
 
534
909
  pull
535
- .command("table")
536
- .alias("tables")
537
- .description("Pull your Appwrite tables")
538
- .action(actionRunner(pullTable))
910
+ .command("table")
911
+ .alias("tables")
912
+ .description("Pull your Appwrite tables")
913
+ .action(actionRunner(pullTable));
539
914
 
540
915
  pull
541
- .command("bucket")
542
- .alias("buckets")
543
- .description("Pull your Appwrite buckets")
544
- .action(actionRunner(pullBucket))
916
+ .command("bucket")
917
+ .alias("buckets")
918
+ .description("Pull your Appwrite buckets")
919
+ .action(actionRunner(pullBucket));
545
920
 
546
921
  pull
547
- .command("team")
548
- .alias("teams")
549
- .description("Pull your Appwrite teams")
550
- .action(actionRunner(pullTeam))
922
+ .command("team")
923
+ .alias("teams")
924
+ .description("Pull your Appwrite teams")
925
+ .action(actionRunner(pullTeam));
551
926
 
552
927
  pull
553
- .command("topic")
554
- .alias("topics")
555
- .description("Pull your Appwrite messaging topics")
556
- .action(actionRunner(pullMessagingTopic))
557
-
928
+ .command("topic")
929
+ .alias("topics")
930
+ .description("Pull your Appwrite messaging topics")
931
+ .action(actionRunner(pullMessagingTopic));