appwrite-cli 12.0.1 → 13.0.0-rc.2

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 (801) hide show
  1. package/.github/workflows/build-verify.yml +71 -0
  2. package/.github/workflows/npm-publish.yml +41 -22
  3. package/CHANGELOG.md +108 -100
  4. package/LICENSE.md +1 -1
  5. package/README.md +58 -35
  6. package/bun.lock +625 -0
  7. package/dist/bundle.cjs +94853 -0
  8. package/dist/index.d.ts +3 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +145 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/lib/client.d.ts +88 -0
  13. package/dist/lib/client.d.ts.map +1 -0
  14. package/dist/lib/client.js +238 -0
  15. package/dist/lib/client.js.map +1 -0
  16. package/dist/lib/commands/generic.d.ts +17 -0
  17. package/dist/lib/commands/generic.d.ts.map +1 -0
  18. package/dist/lib/commands/generic.js +292 -0
  19. package/dist/lib/commands/generic.js.map +1 -0
  20. package/dist/lib/commands/init.d.ts +3 -0
  21. package/dist/lib/commands/init.d.ts.map +1 -0
  22. package/{lib → dist/lib}/commands/init.js +186 -270
  23. package/dist/lib/commands/init.js.map +1 -0
  24. package/dist/lib/commands/pull.d.ts +8 -0
  25. package/dist/lib/commands/pull.d.ts.map +1 -0
  26. package/{lib → dist/lib}/commands/pull.js +159 -280
  27. package/dist/lib/commands/pull.js.map +1 -0
  28. package/dist/lib/commands/push.d.ts +4 -0
  29. package/dist/lib/commands/push.d.ts.map +1 -0
  30. package/dist/lib/commands/push.js +2127 -0
  31. package/dist/lib/commands/push.js.map +1 -0
  32. package/dist/lib/commands/run.d.ts +3 -0
  33. package/dist/lib/commands/run.d.ts.map +1 -0
  34. package/{lib → dist/lib}/commands/run.js +146 -187
  35. package/dist/lib/commands/run.js.map +1 -0
  36. package/dist/lib/commands/services/account.d.ts +3 -0
  37. package/dist/lib/commands/services/account.d.ts.map +1 -0
  38. package/dist/lib/commands/services/account.js +306 -0
  39. package/dist/lib/commands/services/account.js.map +1 -0
  40. package/dist/lib/commands/services/avatars.d.ts +3 -0
  41. package/dist/lib/commands/services/avatars.d.ts.map +1 -0
  42. package/dist/lib/commands/services/avatars.js +118 -0
  43. package/dist/lib/commands/services/avatars.js.map +1 -0
  44. package/dist/lib/commands/services/console.d.ts +3 -0
  45. package/dist/lib/commands/services/console.d.ts.map +1 -0
  46. package/dist/lib/commands/services/console.js +41 -0
  47. package/dist/lib/commands/services/console.js.map +1 -0
  48. package/dist/lib/commands/services/databases.d.ts +3 -0
  49. package/dist/lib/commands/services/databases.d.ts.map +1 -0
  50. package/dist/lib/commands/services/databases.js +612 -0
  51. package/dist/lib/commands/services/databases.js.map +1 -0
  52. package/dist/lib/commands/services/functions.d.ts +3 -0
  53. package/dist/lib/commands/services/functions.d.ts.map +1 -0
  54. package/dist/lib/commands/services/functions.js +258 -0
  55. package/dist/lib/commands/services/functions.js.map +1 -0
  56. package/dist/lib/commands/services/graphql.d.ts +3 -0
  57. package/dist/lib/commands/services/graphql.d.ts.map +1 -0
  58. package/dist/lib/commands/services/graphql.js +28 -0
  59. package/dist/lib/commands/services/graphql.js.map +1 -0
  60. package/dist/lib/commands/services/health.d.ts +3 -0
  61. package/dist/lib/commands/services/health.d.ts.map +1 -0
  62. package/dist/lib/commands/services/health.js +123 -0
  63. package/dist/lib/commands/services/health.js.map +1 -0
  64. package/dist/lib/commands/services/locale.d.ts +3 -0
  65. package/dist/lib/commands/services/locale.d.ts.map +1 -0
  66. package/dist/lib/commands/services/locale.js +52 -0
  67. package/dist/lib/commands/services/locale.js.map +1 -0
  68. package/dist/lib/commands/services/messaging.d.ts +3 -0
  69. package/dist/lib/commands/services/messaging.d.ts.map +1 -0
  70. package/dist/lib/commands/services/messaging.js +505 -0
  71. package/dist/lib/commands/services/messaging.js.map +1 -0
  72. package/dist/lib/commands/services/migrations.d.ts +3 -0
  73. package/dist/lib/commands/services/migrations.d.ts.map +1 -0
  74. package/dist/lib/commands/services/migrations.js +135 -0
  75. package/dist/lib/commands/services/migrations.js.map +1 -0
  76. package/dist/lib/commands/services/project.d.ts +3 -0
  77. package/dist/lib/commands/services/project.d.ts.map +1 -0
  78. package/dist/lib/commands/services/project.js +54 -0
  79. package/dist/lib/commands/services/project.js.map +1 -0
  80. package/dist/lib/commands/services/projects.d.ts +3 -0
  81. package/dist/lib/commands/services/projects.d.ts.map +1 -0
  82. package/dist/lib/commands/services/projects.js +415 -0
  83. package/dist/lib/commands/services/projects.js.map +1 -0
  84. package/dist/lib/commands/services/proxy.d.ts +3 -0
  85. package/dist/lib/commands/services/proxy.d.ts.map +1 -0
  86. package/dist/lib/commands/services/proxy.js +68 -0
  87. package/dist/lib/commands/services/proxy.js.map +1 -0
  88. package/dist/lib/commands/services/sites.d.ts +3 -0
  89. package/dist/lib/commands/services/sites.d.ts.map +1 -0
  90. package/dist/lib/commands/services/sites.js +242 -0
  91. package/dist/lib/commands/services/sites.js.map +1 -0
  92. package/dist/lib/commands/services/storage.d.ts +3 -0
  93. package/dist/lib/commands/services/storage.d.ts.map +1 -0
  94. package/dist/lib/commands/services/storage.js +153 -0
  95. package/dist/lib/commands/services/storage.js.map +1 -0
  96. package/dist/lib/commands/services/tablesdb.d.ts +3 -0
  97. package/dist/lib/commands/services/tablesdb.d.ts.map +1 -0
  98. package/dist/lib/commands/services/tablesdb.js +605 -0
  99. package/dist/lib/commands/services/tablesdb.js.map +1 -0
  100. package/dist/lib/commands/services/teams.d.ts +3 -0
  101. package/dist/lib/commands/services/teams.d.ts.map +1 -0
  102. package/dist/lib/commands/services/teams.js +123 -0
  103. package/dist/lib/commands/services/teams.js.map +1 -0
  104. package/dist/lib/commands/services/tokens.d.ts +3 -0
  105. package/dist/lib/commands/services/tokens.d.ts.map +1 -0
  106. package/dist/lib/commands/services/tokens.js +49 -0
  107. package/dist/lib/commands/services/tokens.js.map +1 -0
  108. package/dist/lib/commands/services/users.d.ts +3 -0
  109. package/dist/lib/commands/services/users.d.ts.map +1 -0
  110. package/dist/lib/commands/services/users.js +312 -0
  111. package/dist/lib/commands/services/users.js.map +1 -0
  112. package/dist/lib/commands/services/vcs.d.ts +3 -0
  113. package/dist/lib/commands/services/vcs.d.ts.map +1 -0
  114. package/dist/lib/commands/services/vcs.js +87 -0
  115. package/dist/lib/commands/services/vcs.js.map +1 -0
  116. package/dist/lib/commands/types.d.ts +3 -0
  117. package/dist/lib/commands/types.d.ts.map +1 -0
  118. package/dist/lib/commands/types.js +151 -0
  119. package/dist/lib/commands/types.js.map +1 -0
  120. package/dist/lib/commands/update.d.ts +3 -0
  121. package/dist/lib/commands/update.d.ts.map +1 -0
  122. package/{lib → dist/lib}/commands/update.js +62 -79
  123. package/dist/lib/commands/update.js.map +1 -0
  124. package/dist/lib/config.d.ts +118 -0
  125. package/dist/lib/config.d.ts.map +1 -0
  126. package/{lib → dist/lib}/config.js +173 -232
  127. package/dist/lib/config.js.map +1 -0
  128. package/dist/lib/emulation/docker.d.ts +7 -0
  129. package/dist/lib/emulation/docker.d.ts.map +1 -0
  130. package/dist/lib/emulation/docker.js +224 -0
  131. package/dist/lib/emulation/docker.js.map +1 -0
  132. package/dist/lib/emulation/utils.d.ts +29 -0
  133. package/dist/lib/emulation/utils.d.ts.map +1 -0
  134. package/{lib → dist/lib}/emulation/utils.js +70 -91
  135. package/dist/lib/emulation/utils.js.map +1 -0
  136. package/dist/lib/id.d.ts +7 -0
  137. package/dist/lib/id.d.ts.map +1 -0
  138. package/{lib → dist/lib}/id.js +5 -8
  139. package/dist/lib/id.js.map +1 -0
  140. package/dist/lib/paginate.d.ts +9 -0
  141. package/dist/lib/paginate.d.ts.map +1 -0
  142. package/{lib → dist/lib}/paginate.js +10 -19
  143. package/dist/lib/paginate.js.map +1 -0
  144. package/dist/lib/parser.d.ts +18 -0
  145. package/dist/lib/parser.d.ts.map +1 -0
  146. package/dist/lib/parser.js +225 -0
  147. package/dist/lib/parser.js.map +1 -0
  148. package/dist/lib/questions.d.ts +59 -0
  149. package/dist/lib/questions.d.ts.map +1 -0
  150. package/{lib → dist/lib}/questions.js +393 -500
  151. package/dist/lib/questions.js.map +1 -0
  152. package/dist/lib/sdks.d.ts +4 -0
  153. package/dist/lib/sdks.d.ts.map +1 -0
  154. package/dist/lib/sdks.js +61 -0
  155. package/dist/lib/sdks.js.map +1 -0
  156. package/dist/lib/services.d.ts +13 -0
  157. package/dist/lib/services.d.ts.map +1 -0
  158. package/dist/lib/services.js +47 -0
  159. package/dist/lib/services.js.map +1 -0
  160. package/dist/lib/spinner.d.ts +28 -0
  161. package/dist/lib/spinner.d.ts.map +1 -0
  162. package/dist/lib/spinner.js +91 -0
  163. package/dist/lib/spinner.js.map +1 -0
  164. package/dist/lib/type-generation/attribute.d.ts +17 -0
  165. package/dist/lib/type-generation/attribute.d.ts.map +1 -0
  166. package/{lib → dist/lib}/type-generation/attribute.js +2 -5
  167. package/dist/lib/type-generation/attribute.js.map +1 -0
  168. package/dist/lib/type-generation/languages/csharp.d.ts +7 -0
  169. package/dist/lib/type-generation/languages/csharp.d.ts.map +1 -0
  170. package/dist/lib/type-generation/languages/csharp.js +180 -0
  171. package/dist/lib/type-generation/languages/csharp.js.map +1 -0
  172. package/dist/lib/type-generation/languages/dart.d.ts +8 -0
  173. package/dist/lib/type-generation/languages/dart.d.ts.map +1 -0
  174. package/dist/lib/type-generation/languages/dart.js +197 -0
  175. package/dist/lib/type-generation/languages/dart.js.map +1 -0
  176. package/dist/lib/type-generation/languages/java.d.ts +7 -0
  177. package/dist/lib/type-generation/languages/java.d.ts.map +1 -0
  178. package/dist/lib/type-generation/languages/java.js +140 -0
  179. package/dist/lib/type-generation/languages/java.js.map +1 -0
  180. package/dist/lib/type-generation/languages/javascript.d.ts +9 -0
  181. package/dist/lib/type-generation/languages/javascript.d.ts.map +1 -0
  182. package/dist/lib/type-generation/languages/javascript.js +109 -0
  183. package/dist/lib/type-generation/languages/javascript.js.map +1 -0
  184. package/dist/lib/type-generation/languages/kotlin.d.ts +7 -0
  185. package/dist/lib/type-generation/languages/kotlin.d.ts.map +1 -0
  186. package/dist/lib/type-generation/languages/kotlin.js +95 -0
  187. package/dist/lib/type-generation/languages/kotlin.js.map +1 -0
  188. package/dist/lib/type-generation/languages/language.d.ts +43 -0
  189. package/dist/lib/type-generation/languages/language.d.ts.map +1 -0
  190. package/dist/lib/type-generation/languages/language.js +77 -0
  191. package/dist/lib/type-generation/languages/language.js.map +1 -0
  192. package/dist/lib/type-generation/languages/php.d.ts +7 -0
  193. package/dist/lib/type-generation/languages/php.d.ts.map +1 -0
  194. package/dist/lib/type-generation/languages/php.js +116 -0
  195. package/dist/lib/type-generation/languages/php.js.map +1 -0
  196. package/dist/lib/type-generation/languages/swift.d.ts +7 -0
  197. package/dist/lib/type-generation/languages/swift.d.ts.map +1 -0
  198. package/dist/lib/type-generation/languages/swift.js +179 -0
  199. package/dist/lib/type-generation/languages/swift.js.map +1 -0
  200. package/dist/lib/type-generation/languages/typescript.d.ts +9 -0
  201. package/dist/lib/type-generation/languages/typescript.d.ts.map +1 -0
  202. package/dist/lib/type-generation/languages/typescript.js +115 -0
  203. package/dist/lib/type-generation/languages/typescript.js.map +1 -0
  204. package/dist/lib/types.d.ts +277 -0
  205. package/dist/lib/types.d.ts.map +1 -0
  206. package/dist/lib/types.js +2 -0
  207. package/dist/lib/types.js.map +1 -0
  208. package/dist/lib/utils.d.ts +15 -0
  209. package/dist/lib/utils.d.ts.map +1 -0
  210. package/{lib → dist/lib}/utils.js +125 -167
  211. package/dist/lib/utils.js.map +1 -0
  212. package/dist/lib/validations.d.ts +2 -0
  213. package/dist/lib/validations.d.ts.map +1 -0
  214. package/dist/lib/validations.js +16 -0
  215. package/dist/lib/validations.js.map +1 -0
  216. package/dist/package.json +67 -0
  217. package/dist/scripts/generate-commands.d.ts +2 -0
  218. package/dist/scripts/generate-commands.d.ts.map +1 -0
  219. package/dist/scripts/generate-commands.js +398 -0
  220. package/dist/scripts/generate-commands.js.map +1 -0
  221. package/index.ts +168 -0
  222. package/install.ps1 +2 -5
  223. package/install.sh +1 -2
  224. package/lib/client.ts +292 -0
  225. package/lib/commands/generic.ts +440 -0
  226. package/lib/commands/init.ts +713 -0
  227. package/lib/commands/pull.ts +668 -0
  228. package/lib/commands/push.ts +3183 -0
  229. package/lib/commands/run.ts +416 -0
  230. package/lib/commands/services/account.ts +832 -0
  231. package/lib/commands/services/avatars.ts +400 -0
  232. package/lib/commands/services/console.ts +73 -0
  233. package/lib/commands/services/databases.ts +2080 -0
  234. package/lib/commands/services/functions.ts +855 -0
  235. package/lib/commands/services/graphql.ts +47 -0
  236. package/lib/commands/services/health.ts +322 -0
  237. package/lib/commands/services/locale.ts +99 -0
  238. package/lib/commands/services/messaging.ts +1871 -0
  239. package/lib/commands/services/migrations.ts +421 -0
  240. package/lib/commands/services/project.ts +116 -0
  241. package/lib/commands/services/projects.ts +1317 -0
  242. package/lib/commands/services/proxy.ts +163 -0
  243. package/lib/commands/services/sites.ts +777 -0
  244. package/lib/commands/services/storage.ts +547 -0
  245. package/lib/commands/services/tablesdb.ts +1928 -0
  246. package/lib/commands/services/teams.ts +294 -0
  247. package/lib/commands/services/tokens.ts +106 -0
  248. package/lib/commands/services/users.ts +886 -0
  249. package/lib/commands/services/vcs.ts +268 -0
  250. package/lib/commands/types.ts +220 -0
  251. package/lib/commands/update.ts +255 -0
  252. package/lib/config.ts +969 -0
  253. package/lib/emulation/docker.ts +312 -0
  254. package/lib/emulation/utils.ts +207 -0
  255. package/lib/id.ts +30 -0
  256. package/lib/paginate.ts +77 -0
  257. package/lib/parser.ts +264 -0
  258. package/lib/questions.ts +1167 -0
  259. package/lib/sdks.ts +84 -0
  260. package/lib/services.ts +72 -0
  261. package/lib/spinner.ts +131 -0
  262. package/lib/type-generation/attribute.ts +18 -0
  263. package/lib/type-generation/languages/{csharp.js → csharp.ts} +27 -14
  264. package/lib/type-generation/languages/{dart.js → dart.ts} +61 -46
  265. package/lib/type-generation/languages/{java.js → java.ts} +31 -18
  266. package/lib/type-generation/languages/{javascript.js → javascript.ts} +35 -24
  267. package/lib/type-generation/languages/{kotlin.js → kotlin.ts} +27 -14
  268. package/lib/type-generation/languages/{language.js → language.ts} +45 -43
  269. package/lib/type-generation/languages/{php.js → php.ts} +28 -15
  270. package/lib/type-generation/languages/{swift.js → swift.ts} +27 -14
  271. package/lib/type-generation/languages/{typescript.js → typescript.ts} +43 -26
  272. package/lib/types.ts +304 -0
  273. package/lib/utils.ts +352 -0
  274. package/lib/validations.ts +20 -0
  275. package/package.json +36 -19
  276. package/scoop/appwrite.config.json +19 -29
  277. package/scripts/generate-commands.ts +539 -0
  278. package/tsconfig.json +24 -0
  279. package/.github/workflows/autoclose.yml +0 -11
  280. package/docs/examples/account/create-anonymous-session.md +0 -1
  281. package/docs/examples/account/create-email-password-session.md +0 -3
  282. package/docs/examples/account/create-email-token.md +0 -3
  283. package/docs/examples/account/create-email-verification.md +0 -2
  284. package/docs/examples/account/create-jwt.md +0 -1
  285. package/docs/examples/account/create-magic-url-token.md +0 -3
  286. package/docs/examples/account/create-mfa-authenticator.md +0 -2
  287. package/docs/examples/account/create-mfa-challenge.md +0 -2
  288. package/docs/examples/account/create-mfa-recovery-codes.md +0 -1
  289. package/docs/examples/account/create-o-auth-2-session.md +0 -2
  290. package/docs/examples/account/create-o-auth-2-token.md +0 -2
  291. package/docs/examples/account/create-phone-token.md +0 -3
  292. package/docs/examples/account/create-phone-verification.md +0 -1
  293. package/docs/examples/account/create-push-target.md +0 -3
  294. package/docs/examples/account/create-recovery.md +0 -3
  295. package/docs/examples/account/create-session.md +0 -3
  296. package/docs/examples/account/create-verification.md +0 -2
  297. package/docs/examples/account/create.md +0 -4
  298. package/docs/examples/account/delete-identity.md +0 -2
  299. package/docs/examples/account/delete-mfa-authenticator.md +0 -2
  300. package/docs/examples/account/delete-push-target.md +0 -2
  301. package/docs/examples/account/delete-session.md +0 -2
  302. package/docs/examples/account/delete-sessions.md +0 -1
  303. package/docs/examples/account/delete.md +0 -1
  304. package/docs/examples/account/get-mfa-recovery-codes.md +0 -1
  305. package/docs/examples/account/get-prefs.md +0 -1
  306. package/docs/examples/account/get-session.md +0 -2
  307. package/docs/examples/account/get.md +0 -1
  308. package/docs/examples/account/list-identities.md +0 -1
  309. package/docs/examples/account/list-logs.md +0 -1
  310. package/docs/examples/account/list-mfa-factors.md +0 -1
  311. package/docs/examples/account/list-sessions.md +0 -1
  312. package/docs/examples/account/update-email-verification.md +0 -3
  313. package/docs/examples/account/update-email.md +0 -3
  314. package/docs/examples/account/update-magic-url-session.md +0 -3
  315. package/docs/examples/account/update-mfa-authenticator.md +0 -3
  316. package/docs/examples/account/update-mfa-challenge.md +0 -3
  317. package/docs/examples/account/update-mfa-recovery-codes.md +0 -1
  318. package/docs/examples/account/update-mfa.md +0 -2
  319. package/docs/examples/account/update-name.md +0 -2
  320. package/docs/examples/account/update-password.md +0 -2
  321. package/docs/examples/account/update-phone-session.md +0 -3
  322. package/docs/examples/account/update-phone-verification.md +0 -3
  323. package/docs/examples/account/update-phone.md +0 -3
  324. package/docs/examples/account/update-prefs.md +0 -2
  325. package/docs/examples/account/update-push-target.md +0 -3
  326. package/docs/examples/account/update-recovery.md +0 -4
  327. package/docs/examples/account/update-session.md +0 -2
  328. package/docs/examples/account/update-status.md +0 -1
  329. package/docs/examples/account/update-verification.md +0 -3
  330. package/docs/examples/console/get-resource.md +0 -3
  331. package/docs/examples/console/variables.md +0 -1
  332. package/docs/examples/databases/create-boolean-attribute.md +0 -5
  333. package/docs/examples/databases/create-collection.md +0 -4
  334. package/docs/examples/databases/create-datetime-attribute.md +0 -5
  335. package/docs/examples/databases/create-document.md +0 -5
  336. package/docs/examples/databases/create-documents.md +0 -4
  337. package/docs/examples/databases/create-email-attribute.md +0 -5
  338. package/docs/examples/databases/create-enum-attribute.md +0 -6
  339. package/docs/examples/databases/create-float-attribute.md +0 -5
  340. package/docs/examples/databases/create-index.md +0 -6
  341. package/docs/examples/databases/create-integer-attribute.md +0 -5
  342. package/docs/examples/databases/create-ip-attribute.md +0 -5
  343. package/docs/examples/databases/create-line-attribute.md +0 -5
  344. package/docs/examples/databases/create-operations.md +0 -2
  345. package/docs/examples/databases/create-point-attribute.md +0 -5
  346. package/docs/examples/databases/create-polygon-attribute.md +0 -5
  347. package/docs/examples/databases/create-relationship-attribute.md +0 -5
  348. package/docs/examples/databases/create-string-attribute.md +0 -6
  349. package/docs/examples/databases/create-transaction.md +0 -1
  350. package/docs/examples/databases/create-url-attribute.md +0 -5
  351. package/docs/examples/databases/create.md +0 -3
  352. package/docs/examples/databases/decrement-document-attribute.md +0 -5
  353. package/docs/examples/databases/delete-attribute.md +0 -4
  354. package/docs/examples/databases/delete-collection.md +0 -3
  355. package/docs/examples/databases/delete-document.md +0 -4
  356. package/docs/examples/databases/delete-documents.md +0 -3
  357. package/docs/examples/databases/delete-index.md +0 -4
  358. package/docs/examples/databases/delete-transaction.md +0 -2
  359. package/docs/examples/databases/delete.md +0 -2
  360. package/docs/examples/databases/get-attribute.md +0 -4
  361. package/docs/examples/databases/get-collection-usage.md +0 -3
  362. package/docs/examples/databases/get-collection.md +0 -3
  363. package/docs/examples/databases/get-document.md +0 -4
  364. package/docs/examples/databases/get-index.md +0 -4
  365. package/docs/examples/databases/get-transaction.md +0 -2
  366. package/docs/examples/databases/get-usage.md +0 -2
  367. package/docs/examples/databases/get.md +0 -2
  368. package/docs/examples/databases/increment-document-attribute.md +0 -5
  369. package/docs/examples/databases/list-attributes.md +0 -3
  370. package/docs/examples/databases/list-collection-logs.md +0 -3
  371. package/docs/examples/databases/list-collections.md +0 -2
  372. package/docs/examples/databases/list-document-logs.md +0 -4
  373. package/docs/examples/databases/list-documents.md +0 -3
  374. package/docs/examples/databases/list-indexes.md +0 -3
  375. package/docs/examples/databases/list-logs.md +0 -2
  376. package/docs/examples/databases/list-transactions.md +0 -1
  377. package/docs/examples/databases/list-usage.md +0 -1
  378. package/docs/examples/databases/list.md +0 -1
  379. package/docs/examples/databases/update-boolean-attribute.md +0 -6
  380. package/docs/examples/databases/update-collection.md +0 -4
  381. package/docs/examples/databases/update-datetime-attribute.md +0 -6
  382. package/docs/examples/databases/update-document.md +0 -4
  383. package/docs/examples/databases/update-documents.md +0 -3
  384. package/docs/examples/databases/update-email-attribute.md +0 -6
  385. package/docs/examples/databases/update-enum-attribute.md +0 -7
  386. package/docs/examples/databases/update-float-attribute.md +0 -6
  387. package/docs/examples/databases/update-integer-attribute.md +0 -6
  388. package/docs/examples/databases/update-ip-attribute.md +0 -6
  389. package/docs/examples/databases/update-line-attribute.md +0 -5
  390. package/docs/examples/databases/update-point-attribute.md +0 -5
  391. package/docs/examples/databases/update-polygon-attribute.md +0 -5
  392. package/docs/examples/databases/update-relationship-attribute.md +0 -4
  393. package/docs/examples/databases/update-string-attribute.md +0 -6
  394. package/docs/examples/databases/update-transaction.md +0 -2
  395. package/docs/examples/databases/update-url-attribute.md +0 -6
  396. package/docs/examples/databases/update.md +0 -3
  397. package/docs/examples/databases/upsert-document.md +0 -5
  398. package/docs/examples/databases/upsert-documents.md +0 -4
  399. package/docs/examples/functions/create-deployment.md +0 -4
  400. package/docs/examples/functions/create-duplicate-deployment.md +0 -3
  401. package/docs/examples/functions/create-execution.md +0 -2
  402. package/docs/examples/functions/create-template-deployment.md +0 -7
  403. package/docs/examples/functions/create-variable.md +0 -4
  404. package/docs/examples/functions/create-vcs-deployment.md +0 -4
  405. package/docs/examples/functions/create.md +0 -4
  406. package/docs/examples/functions/delete-deployment.md +0 -3
  407. package/docs/examples/functions/delete-execution.md +0 -3
  408. package/docs/examples/functions/delete-variable.md +0 -3
  409. package/docs/examples/functions/delete.md +0 -2
  410. package/docs/examples/functions/get-deployment-download.md +0 -3
  411. package/docs/examples/functions/get-deployment.md +0 -3
  412. package/docs/examples/functions/get-execution.md +0 -3
  413. package/docs/examples/functions/get-template.md +0 -2
  414. package/docs/examples/functions/get-usage.md +0 -2
  415. package/docs/examples/functions/get-variable.md +0 -3
  416. package/docs/examples/functions/get.md +0 -2
  417. package/docs/examples/functions/list-deployments.md +0 -2
  418. package/docs/examples/functions/list-executions.md +0 -2
  419. package/docs/examples/functions/list-runtimes.md +0 -1
  420. package/docs/examples/functions/list-specifications.md +0 -1
  421. package/docs/examples/functions/list-templates.md +0 -1
  422. package/docs/examples/functions/list-usage.md +0 -1
  423. package/docs/examples/functions/list-variables.md +0 -2
  424. package/docs/examples/functions/list.md +0 -1
  425. package/docs/examples/functions/update-deployment-status.md +0 -3
  426. package/docs/examples/functions/update-function-deployment.md +0 -3
  427. package/docs/examples/functions/update-variable.md +0 -4
  428. package/docs/examples/functions/update.md +0 -3
  429. package/docs/examples/graphql/mutation.md +0 -2
  430. package/docs/examples/graphql/query.md +0 -2
  431. package/docs/examples/health/get-antivirus.md +0 -1
  432. package/docs/examples/health/get-cache.md +0 -1
  433. package/docs/examples/health/get-certificate.md +0 -1
  434. package/docs/examples/health/get-db.md +0 -1
  435. package/docs/examples/health/get-failed-jobs.md +0 -2
  436. package/docs/examples/health/get-pub-sub.md +0 -1
  437. package/docs/examples/health/get-queue-builds.md +0 -1
  438. package/docs/examples/health/get-queue-certificates.md +0 -1
  439. package/docs/examples/health/get-queue-databases.md +0 -1
  440. package/docs/examples/health/get-queue-deletes.md +0 -1
  441. package/docs/examples/health/get-queue-functions.md +0 -1
  442. package/docs/examples/health/get-queue-logs.md +0 -1
  443. package/docs/examples/health/get-queue-mails.md +0 -1
  444. package/docs/examples/health/get-queue-messaging.md +0 -1
  445. package/docs/examples/health/get-queue-migrations.md +0 -1
  446. package/docs/examples/health/get-queue-stats-resources.md +0 -1
  447. package/docs/examples/health/get-queue-usage.md +0 -1
  448. package/docs/examples/health/get-queue-webhooks.md +0 -1
  449. package/docs/examples/health/get-storage-local.md +0 -1
  450. package/docs/examples/health/get-storage.md +0 -1
  451. package/docs/examples/health/get-time.md +0 -1
  452. package/docs/examples/health/get.md +0 -1
  453. package/docs/examples/locale/get.md +0 -1
  454. package/docs/examples/locale/list-codes.md +0 -1
  455. package/docs/examples/locale/list-continents.md +0 -1
  456. package/docs/examples/locale/list-countries-eu.md +0 -1
  457. package/docs/examples/locale/list-countries-phones.md +0 -1
  458. package/docs/examples/locale/list-countries.md +0 -1
  459. package/docs/examples/locale/list-currencies.md +0 -1
  460. package/docs/examples/locale/list-languages.md +0 -1
  461. package/docs/examples/messaging/create-apns-provider.md +0 -3
  462. package/docs/examples/messaging/create-email.md +0 -4
  463. package/docs/examples/messaging/create-fcm-provider.md +0 -3
  464. package/docs/examples/messaging/create-mailgun-provider.md +0 -3
  465. package/docs/examples/messaging/create-msg-91-provider.md +0 -3
  466. package/docs/examples/messaging/create-push.md +0 -2
  467. package/docs/examples/messaging/create-resend-provider.md +0 -3
  468. package/docs/examples/messaging/create-sendgrid-provider.md +0 -3
  469. package/docs/examples/messaging/create-sms.md +0 -3
  470. package/docs/examples/messaging/create-smtp-provider.md +0 -4
  471. package/docs/examples/messaging/create-subscriber.md +0 -4
  472. package/docs/examples/messaging/create-telesign-provider.md +0 -3
  473. package/docs/examples/messaging/create-textmagic-provider.md +0 -3
  474. package/docs/examples/messaging/create-topic.md +0 -3
  475. package/docs/examples/messaging/create-twilio-provider.md +0 -3
  476. package/docs/examples/messaging/create-vonage-provider.md +0 -3
  477. package/docs/examples/messaging/delete-provider.md +0 -2
  478. package/docs/examples/messaging/delete-subscriber.md +0 -3
  479. package/docs/examples/messaging/delete-topic.md +0 -2
  480. package/docs/examples/messaging/delete.md +0 -2
  481. package/docs/examples/messaging/get-message.md +0 -2
  482. package/docs/examples/messaging/get-provider.md +0 -2
  483. package/docs/examples/messaging/get-subscriber.md +0 -3
  484. package/docs/examples/messaging/get-topic.md +0 -2
  485. package/docs/examples/messaging/list-message-logs.md +0 -2
  486. package/docs/examples/messaging/list-messages.md +0 -1
  487. package/docs/examples/messaging/list-provider-logs.md +0 -2
  488. package/docs/examples/messaging/list-providers.md +0 -1
  489. package/docs/examples/messaging/list-subscriber-logs.md +0 -2
  490. package/docs/examples/messaging/list-subscribers.md +0 -2
  491. package/docs/examples/messaging/list-targets.md +0 -2
  492. package/docs/examples/messaging/list-topic-logs.md +0 -2
  493. package/docs/examples/messaging/list-topics.md +0 -1
  494. package/docs/examples/messaging/update-apns-provider.md +0 -2
  495. package/docs/examples/messaging/update-email.md +0 -2
  496. package/docs/examples/messaging/update-fcm-provider.md +0 -2
  497. package/docs/examples/messaging/update-mailgun-provider.md +0 -2
  498. package/docs/examples/messaging/update-msg-91-provider.md +0 -2
  499. package/docs/examples/messaging/update-push.md +0 -2
  500. package/docs/examples/messaging/update-resend-provider.md +0 -2
  501. package/docs/examples/messaging/update-sendgrid-provider.md +0 -2
  502. package/docs/examples/messaging/update-sms.md +0 -2
  503. package/docs/examples/messaging/update-smtp-provider.md +0 -2
  504. package/docs/examples/messaging/update-telesign-provider.md +0 -2
  505. package/docs/examples/messaging/update-textmagic-provider.md +0 -2
  506. package/docs/examples/messaging/update-topic.md +0 -2
  507. package/docs/examples/messaging/update-twilio-provider.md +0 -2
  508. package/docs/examples/messaging/update-vonage-provider.md +0 -2
  509. package/docs/examples/migrations/create-appwrite-migration.md +0 -5
  510. package/docs/examples/migrations/create-csv-export.md +0 -3
  511. package/docs/examples/migrations/create-csv-import.md +0 -4
  512. package/docs/examples/migrations/create-firebase-migration.md +0 -3
  513. package/docs/examples/migrations/create-n-host-migration.md +0 -8
  514. package/docs/examples/migrations/create-supabase-migration.md +0 -7
  515. package/docs/examples/migrations/delete.md +0 -2
  516. package/docs/examples/migrations/get-appwrite-report.md +0 -5
  517. package/docs/examples/migrations/get-firebase-report.md +0 -3
  518. package/docs/examples/migrations/get-n-host-report.md +0 -8
  519. package/docs/examples/migrations/get-supabase-report.md +0 -7
  520. package/docs/examples/migrations/get.md +0 -2
  521. package/docs/examples/migrations/list.md +0 -1
  522. package/docs/examples/migrations/retry.md +0 -2
  523. package/docs/examples/project/create-variable.md +0 -3
  524. package/docs/examples/project/delete-variable.md +0 -2
  525. package/docs/examples/project/get-usage.md +0 -3
  526. package/docs/examples/project/get-variable.md +0 -2
  527. package/docs/examples/project/list-variables.md +0 -1
  528. package/docs/examples/project/update-variable.md +0 -3
  529. package/docs/examples/projects/create-dev-key.md +0 -4
  530. package/docs/examples/projects/create-jwt.md +0 -3
  531. package/docs/examples/projects/create-key.md +0 -4
  532. package/docs/examples/projects/create-platform.md +0 -4
  533. package/docs/examples/projects/create-smtp-test.md +0 -6
  534. package/docs/examples/projects/create-webhook.md +0 -6
  535. package/docs/examples/projects/create.md +0 -4
  536. package/docs/examples/projects/delete-dev-key.md +0 -3
  537. package/docs/examples/projects/delete-email-template.md +0 -4
  538. package/docs/examples/projects/delete-key.md +0 -3
  539. package/docs/examples/projects/delete-platform.md +0 -3
  540. package/docs/examples/projects/delete-sms-template.md +0 -4
  541. package/docs/examples/projects/delete-webhook.md +0 -3
  542. package/docs/examples/projects/delete.md +0 -2
  543. package/docs/examples/projects/get-dev-key.md +0 -3
  544. package/docs/examples/projects/get-email-template.md +0 -4
  545. package/docs/examples/projects/get-key.md +0 -3
  546. package/docs/examples/projects/get-platform.md +0 -3
  547. package/docs/examples/projects/get-sms-template.md +0 -4
  548. package/docs/examples/projects/get-webhook.md +0 -3
  549. package/docs/examples/projects/get.md +0 -2
  550. package/docs/examples/projects/list-dev-keys.md +0 -2
  551. package/docs/examples/projects/list-keys.md +0 -2
  552. package/docs/examples/projects/list-platforms.md +0 -2
  553. package/docs/examples/projects/list-webhooks.md +0 -2
  554. package/docs/examples/projects/list.md +0 -1
  555. package/docs/examples/projects/update-api-status-all.md +0 -3
  556. package/docs/examples/projects/update-api-status.md +0 -4
  557. package/docs/examples/projects/update-auth-duration.md +0 -3
  558. package/docs/examples/projects/update-auth-limit.md +0 -3
  559. package/docs/examples/projects/update-auth-password-dictionary.md +0 -3
  560. package/docs/examples/projects/update-auth-password-history.md +0 -3
  561. package/docs/examples/projects/update-auth-sessions-limit.md +0 -3
  562. package/docs/examples/projects/update-auth-status.md +0 -4
  563. package/docs/examples/projects/update-dev-key.md +0 -5
  564. package/docs/examples/projects/update-email-template.md +0 -6
  565. package/docs/examples/projects/update-key.md +0 -5
  566. package/docs/examples/projects/update-memberships-privacy.md +0 -5
  567. package/docs/examples/projects/update-mock-numbers.md +0 -3
  568. package/docs/examples/projects/update-o-auth-2.md +0 -3
  569. package/docs/examples/projects/update-personal-data-check.md +0 -3
  570. package/docs/examples/projects/update-platform.md +0 -4
  571. package/docs/examples/projects/update-service-status-all.md +0 -3
  572. package/docs/examples/projects/update-service-status.md +0 -4
  573. package/docs/examples/projects/update-session-alerts.md +0 -3
  574. package/docs/examples/projects/update-session-invalidation.md +0 -3
  575. package/docs/examples/projects/update-sms-template.md +0 -5
  576. package/docs/examples/projects/update-smtp.md +0 -3
  577. package/docs/examples/projects/update-team.md +0 -3
  578. package/docs/examples/projects/update-webhook-signature.md +0 -3
  579. package/docs/examples/projects/update-webhook.md +0 -7
  580. package/docs/examples/projects/update.md +0 -3
  581. package/docs/examples/proxy/create-api-rule.md +0 -2
  582. package/docs/examples/proxy/create-function-rule.md +0 -3
  583. package/docs/examples/proxy/create-redirect-rule.md +0 -6
  584. package/docs/examples/proxy/create-site-rule.md +0 -3
  585. package/docs/examples/proxy/delete-rule.md +0 -2
  586. package/docs/examples/proxy/get-rule.md +0 -2
  587. package/docs/examples/proxy/list-rules.md +0 -1
  588. package/docs/examples/proxy/update-rule-verification.md +0 -2
  589. package/docs/examples/sites/create-deployment.md +0 -4
  590. package/docs/examples/sites/create-duplicate-deployment.md +0 -3
  591. package/docs/examples/sites/create-template-deployment.md +0 -7
  592. package/docs/examples/sites/create-variable.md +0 -4
  593. package/docs/examples/sites/create-vcs-deployment.md +0 -4
  594. package/docs/examples/sites/create.md +0 -5
  595. package/docs/examples/sites/delete-deployment.md +0 -3
  596. package/docs/examples/sites/delete-log.md +0 -3
  597. package/docs/examples/sites/delete-variable.md +0 -3
  598. package/docs/examples/sites/delete.md +0 -2
  599. package/docs/examples/sites/get-deployment-download.md +0 -3
  600. package/docs/examples/sites/get-deployment.md +0 -3
  601. package/docs/examples/sites/get-log.md +0 -3
  602. package/docs/examples/sites/get-template.md +0 -2
  603. package/docs/examples/sites/get-usage.md +0 -2
  604. package/docs/examples/sites/get-variable.md +0 -3
  605. package/docs/examples/sites/get.md +0 -2
  606. package/docs/examples/sites/list-deployments.md +0 -2
  607. package/docs/examples/sites/list-frameworks.md +0 -1
  608. package/docs/examples/sites/list-logs.md +0 -2
  609. package/docs/examples/sites/list-specifications.md +0 -1
  610. package/docs/examples/sites/list-templates.md +0 -1
  611. package/docs/examples/sites/list-usage.md +0 -1
  612. package/docs/examples/sites/list-variables.md +0 -2
  613. package/docs/examples/sites/list.md +0 -1
  614. package/docs/examples/sites/update-deployment-status.md +0 -3
  615. package/docs/examples/sites/update-site-deployment.md +0 -3
  616. package/docs/examples/sites/update-variable.md +0 -4
  617. package/docs/examples/sites/update.md +0 -4
  618. package/docs/examples/storage/create-bucket.md +0 -3
  619. package/docs/examples/storage/create-file.md +0 -4
  620. package/docs/examples/storage/delete-bucket.md +0 -2
  621. package/docs/examples/storage/delete-file.md +0 -3
  622. package/docs/examples/storage/get-bucket-usage.md +0 -2
  623. package/docs/examples/storage/get-bucket.md +0 -2
  624. package/docs/examples/storage/get-file-download.md +0 -3
  625. package/docs/examples/storage/get-file-preview.md +0 -3
  626. package/docs/examples/storage/get-file-view.md +0 -3
  627. package/docs/examples/storage/get-file.md +0 -3
  628. package/docs/examples/storage/get-usage.md +0 -1
  629. package/docs/examples/storage/list-buckets.md +0 -1
  630. package/docs/examples/storage/list-files.md +0 -2
  631. package/docs/examples/storage/update-bucket.md +0 -3
  632. package/docs/examples/storage/update-file.md +0 -3
  633. package/docs/examples/tablesdb/create-boolean-column.md +0 -5
  634. package/docs/examples/tablesdb/create-datetime-column.md +0 -5
  635. package/docs/examples/tablesdb/create-email-column.md +0 -5
  636. package/docs/examples/tablesdb/create-enum-column.md +0 -6
  637. package/docs/examples/tablesdb/create-float-column.md +0 -5
  638. package/docs/examples/tablesdb/create-index.md +0 -6
  639. package/docs/examples/tablesdb/create-integer-column.md +0 -5
  640. package/docs/examples/tablesdb/create-ip-column.md +0 -5
  641. package/docs/examples/tablesdb/create-line-column.md +0 -5
  642. package/docs/examples/tablesdb/create-operations.md +0 -2
  643. package/docs/examples/tablesdb/create-point-column.md +0 -5
  644. package/docs/examples/tablesdb/create-polygon-column.md +0 -5
  645. package/docs/examples/tablesdb/create-relationship-column.md +0 -5
  646. package/docs/examples/tablesdb/create-row.md +0 -5
  647. package/docs/examples/tablesdb/create-rows.md +0 -4
  648. package/docs/examples/tablesdb/create-string-column.md +0 -6
  649. package/docs/examples/tablesdb/create-table.md +0 -4
  650. package/docs/examples/tablesdb/create-transaction.md +0 -1
  651. package/docs/examples/tablesdb/create-url-column.md +0 -5
  652. package/docs/examples/tablesdb/create.md +0 -3
  653. package/docs/examples/tablesdb/decrement-row-column.md +0 -5
  654. package/docs/examples/tablesdb/delete-column.md +0 -4
  655. package/docs/examples/tablesdb/delete-index.md +0 -4
  656. package/docs/examples/tablesdb/delete-row.md +0 -4
  657. package/docs/examples/tablesdb/delete-rows.md +0 -3
  658. package/docs/examples/tablesdb/delete-table.md +0 -3
  659. package/docs/examples/tablesdb/delete-transaction.md +0 -2
  660. package/docs/examples/tablesdb/delete.md +0 -2
  661. package/docs/examples/tablesdb/get-column.md +0 -4
  662. package/docs/examples/tablesdb/get-index.md +0 -4
  663. package/docs/examples/tablesdb/get-row.md +0 -4
  664. package/docs/examples/tablesdb/get-table-usage.md +0 -3
  665. package/docs/examples/tablesdb/get-table.md +0 -3
  666. package/docs/examples/tablesdb/get-transaction.md +0 -2
  667. package/docs/examples/tablesdb/get-usage.md +0 -2
  668. package/docs/examples/tablesdb/get.md +0 -2
  669. package/docs/examples/tablesdb/increment-row-column.md +0 -5
  670. package/docs/examples/tablesdb/list-columns.md +0 -3
  671. package/docs/examples/tablesdb/list-indexes.md +0 -3
  672. package/docs/examples/tablesdb/list-row-logs.md +0 -4
  673. package/docs/examples/tablesdb/list-rows.md +0 -3
  674. package/docs/examples/tablesdb/list-table-logs.md +0 -3
  675. package/docs/examples/tablesdb/list-tables.md +0 -2
  676. package/docs/examples/tablesdb/list-transactions.md +0 -1
  677. package/docs/examples/tablesdb/list-usage.md +0 -1
  678. package/docs/examples/tablesdb/list.md +0 -1
  679. package/docs/examples/tablesdb/update-boolean-column.md +0 -6
  680. package/docs/examples/tablesdb/update-datetime-column.md +0 -6
  681. package/docs/examples/tablesdb/update-email-column.md +0 -6
  682. package/docs/examples/tablesdb/update-enum-column.md +0 -7
  683. package/docs/examples/tablesdb/update-float-column.md +0 -6
  684. package/docs/examples/tablesdb/update-integer-column.md +0 -6
  685. package/docs/examples/tablesdb/update-ip-column.md +0 -6
  686. package/docs/examples/tablesdb/update-line-column.md +0 -5
  687. package/docs/examples/tablesdb/update-point-column.md +0 -5
  688. package/docs/examples/tablesdb/update-polygon-column.md +0 -5
  689. package/docs/examples/tablesdb/update-relationship-column.md +0 -4
  690. package/docs/examples/tablesdb/update-row.md +0 -4
  691. package/docs/examples/tablesdb/update-rows.md +0 -3
  692. package/docs/examples/tablesdb/update-string-column.md +0 -6
  693. package/docs/examples/tablesdb/update-table.md +0 -4
  694. package/docs/examples/tablesdb/update-transaction.md +0 -2
  695. package/docs/examples/tablesdb/update-url-column.md +0 -6
  696. package/docs/examples/tablesdb/update.md +0 -3
  697. package/docs/examples/tablesdb/upsert-row.md +0 -4
  698. package/docs/examples/tablesdb/upsert-rows.md +0 -4
  699. package/docs/examples/teams/create-membership.md +0 -3
  700. package/docs/examples/teams/create.md +0 -3
  701. package/docs/examples/teams/delete-membership.md +0 -3
  702. package/docs/examples/teams/delete.md +0 -2
  703. package/docs/examples/teams/get-membership.md +0 -3
  704. package/docs/examples/teams/get-prefs.md +0 -2
  705. package/docs/examples/teams/get.md +0 -2
  706. package/docs/examples/teams/list-logs.md +0 -2
  707. package/docs/examples/teams/list-memberships.md +0 -2
  708. package/docs/examples/teams/list.md +0 -1
  709. package/docs/examples/teams/update-membership-status.md +0 -5
  710. package/docs/examples/teams/update-membership.md +0 -4
  711. package/docs/examples/teams/update-name.md +0 -3
  712. package/docs/examples/teams/update-prefs.md +0 -3
  713. package/docs/examples/tokens/create-file-token.md +0 -3
  714. package/docs/examples/tokens/delete.md +0 -2
  715. package/docs/examples/tokens/get.md +0 -2
  716. package/docs/examples/tokens/list.md +0 -3
  717. package/docs/examples/tokens/update.md +0 -2
  718. package/docs/examples/users/create-argon-2-user.md +0 -4
  719. package/docs/examples/users/create-bcrypt-user.md +0 -4
  720. package/docs/examples/users/create-jwt.md +0 -2
  721. package/docs/examples/users/create-md-5-user.md +0 -4
  722. package/docs/examples/users/create-mfa-recovery-codes.md +0 -2
  723. package/docs/examples/users/create-ph-pass-user.md +0 -4
  724. package/docs/examples/users/create-scrypt-modified-user.md +0 -7
  725. package/docs/examples/users/create-scrypt-user.md +0 -9
  726. package/docs/examples/users/create-session.md +0 -2
  727. package/docs/examples/users/create-sha-user.md +0 -4
  728. package/docs/examples/users/create-target.md +0 -5
  729. package/docs/examples/users/create-token.md +0 -2
  730. package/docs/examples/users/create.md +0 -2
  731. package/docs/examples/users/delete-identity.md +0 -2
  732. package/docs/examples/users/delete-mfa-authenticator.md +0 -3
  733. package/docs/examples/users/delete-session.md +0 -3
  734. package/docs/examples/users/delete-sessions.md +0 -2
  735. package/docs/examples/users/delete-target.md +0 -3
  736. package/docs/examples/users/delete.md +0 -2
  737. package/docs/examples/users/get-mfa-recovery-codes.md +0 -2
  738. package/docs/examples/users/get-prefs.md +0 -2
  739. package/docs/examples/users/get-target.md +0 -3
  740. package/docs/examples/users/get-usage.md +0 -1
  741. package/docs/examples/users/get.md +0 -2
  742. package/docs/examples/users/list-identities.md +0 -1
  743. package/docs/examples/users/list-logs.md +0 -2
  744. package/docs/examples/users/list-memberships.md +0 -2
  745. package/docs/examples/users/list-mfa-factors.md +0 -2
  746. package/docs/examples/users/list-sessions.md +0 -2
  747. package/docs/examples/users/list-targets.md +0 -2
  748. package/docs/examples/users/list.md +0 -1
  749. package/docs/examples/users/update-email-verification.md +0 -3
  750. package/docs/examples/users/update-email.md +0 -3
  751. package/docs/examples/users/update-labels.md +0 -3
  752. package/docs/examples/users/update-mfa-recovery-codes.md +0 -2
  753. package/docs/examples/users/update-mfa.md +0 -3
  754. package/docs/examples/users/update-name.md +0 -3
  755. package/docs/examples/users/update-password.md +0 -3
  756. package/docs/examples/users/update-phone-verification.md +0 -3
  757. package/docs/examples/users/update-phone.md +0 -3
  758. package/docs/examples/users/update-prefs.md +0 -3
  759. package/docs/examples/users/update-status.md +0 -3
  760. package/docs/examples/users/update-target.md +0 -3
  761. package/docs/examples/vcs/create-repository-detection.md +0 -4
  762. package/docs/examples/vcs/create-repository.md +0 -4
  763. package/docs/examples/vcs/delete-installation.md +0 -2
  764. package/docs/examples/vcs/get-installation.md +0 -2
  765. package/docs/examples/vcs/get-repository-contents.md +0 -3
  766. package/docs/examples/vcs/get-repository.md +0 -3
  767. package/docs/examples/vcs/list-installations.md +0 -1
  768. package/docs/examples/vcs/list-repositories.md +0 -3
  769. package/docs/examples/vcs/list-repository-branches.md +0 -3
  770. package/docs/examples/vcs/update-external-deployments.md +0 -4
  771. package/index.js +0 -147
  772. package/lib/client.js +0 -254
  773. package/lib/commands/account.js +0 -2121
  774. package/lib/commands/console.js +0 -127
  775. package/lib/commands/databases.js +0 -3590
  776. package/lib/commands/functions.js +0 -1732
  777. package/lib/commands/generic.js +0 -330
  778. package/lib/commands/graphql.js +0 -126
  779. package/lib/commands/health.js +0 -869
  780. package/lib/commands/locale.js +0 -316
  781. package/lib/commands/messaging.js +0 -3116
  782. package/lib/commands/migrations.js +0 -830
  783. package/lib/commands/organizations.js +0 -48
  784. package/lib/commands/project.js +0 -302
  785. package/lib/commands/projects.js +0 -2626
  786. package/lib/commands/proxy.js +0 -403
  787. package/lib/commands/push.js +0 -2570
  788. package/lib/commands/sites.js +0 -1654
  789. package/lib/commands/storage.js +0 -995
  790. package/lib/commands/tables-db.js +0 -3569
  791. package/lib/commands/teams.js +0 -683
  792. package/lib/commands/tokens.js +0 -261
  793. package/lib/commands/types.js +0 -191
  794. package/lib/commands/users.js +0 -2022
  795. package/lib/commands/vcs.js +0 -484
  796. package/lib/emulation/docker.js +0 -264
  797. package/lib/exception.js +0 -9
  798. package/lib/parser.js +0 -250
  799. package/lib/sdks.js +0 -60
  800. package/lib/spinner.js +0 -104
  801. package/lib/validations.js +0 -17
@@ -1,1654 +0,0 @@
1
- const fs = require('fs');
2
- const pathLib = require('path');
3
- const tar = require("tar");
4
- const ignore = require("ignore");
5
- const { promisify } = require('util');
6
- const libClient = require('../client.js');
7
- const { getAllFiles, showConsoleLink } = require('../utils.js');
8
- const { Command } = require('commander');
9
- const { sdkForProject, sdkForConsole } = require('../sdks')
10
- const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log, warn } = require('../parser')
11
- const { localConfig, globalConfig } = require("../config");
12
- const { File } = require('undici');
13
- const { ReadableStream } = require('stream/web');
14
-
15
- /**
16
- * @param {fs.ReadStream} readStream
17
- * @returns {ReadableStream}
18
- */
19
- function convertReadStreamToReadableStream(readStream) {
20
- return new ReadableStream({
21
- start(controller) {
22
- readStream.on("data", (chunk) => {
23
- controller.enqueue(chunk);
24
- });
25
- readStream.on("end", () => {
26
- controller.close();
27
- });
28
- readStream.on("error", (err) => {
29
- controller.error(err);
30
- });
31
- },
32
- cancel() {
33
- readStream.destroy();
34
- },
35
- });
36
- }
37
-
38
- const sites = new Command("sites").description(commandDescriptions['sites'] ?? '').configureHelp({
39
- helpWidth: process.stdout.columns || 80
40
- })
41
-
42
- /**
43
- * @typedef {Object} SitesListRequestParams
44
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId
45
- * @property {string} search Search term to filter your list results. Max length: 256 chars.
46
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
47
- * @property {boolean} overrideForCli
48
- * @property {boolean} parseOutput
49
- * @property {libClient | undefined} sdk
50
- */
51
-
52
- /**
53
- * @param {SitesListRequestParams} params
54
- */
55
- const sitesList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
56
- let client = !sdk ? await sdkForProject() :
57
- sdk;
58
- let apiPath = '/sites';
59
- let payload = {};
60
- if (typeof queries !== 'undefined') {
61
- payload['queries'] = queries;
62
- }
63
- if (typeof search !== 'undefined') {
64
- payload['search'] = search;
65
- }
66
- if (typeof total !== 'undefined') {
67
- payload['total'] = total;
68
- }
69
-
70
- let response = undefined;
71
-
72
- response = await client.call('get', apiPath, {
73
- }, payload);
74
-
75
- if (parseOutput) {
76
- if(console) {
77
- showConsoleLink('sites', 'list');
78
- } else {
79
- parse(response)
80
- }
81
- }
82
-
83
- return response;
84
-
85
- }
86
- /**
87
- * @typedef {Object} SitesCreateRequestParams
88
- * @property {string} siteId Site ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
89
- * @property {string} name Site name. Max length: 128 chars.
90
- * @property {Framework} framework Sites framework.
91
- * @property {BuildRuntime} buildRuntime Runtime to use during build step.
92
- * @property {boolean} enabled Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
93
- * @property {boolean} logging When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
94
- * @property {number} timeout Maximum request time in seconds.
95
- * @property {string} installCommand Install Command.
96
- * @property {string} buildCommand Build Command.
97
- * @property {string} outputDirectory Output Directory for site.
98
- * @property {Adapter} adapter Framework adapter defining rendering strategy. Allowed values are: static, ssr
99
- * @property {string} installationId Appwrite Installation ID for VCS (Version Control System) deployment.
100
- * @property {string} fallbackFile Fallback file for single page application sites.
101
- * @property {string} providerRepositoryId Repository ID of the repo linked to the site.
102
- * @property {string} providerBranch Production branch for the repo linked to the site.
103
- * @property {boolean} providerSilentMode Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
104
- * @property {string} providerRootDirectory Path to site code in the linked repo.
105
- * @property {string} specification Framework specification for the site and builds.
106
- * @property {boolean} overrideForCli
107
- * @property {boolean} parseOutput
108
- * @property {libClient | undefined} sdk
109
- */
110
-
111
- /**
112
- * @param {SitesCreateRequestParams} params
113
- */
114
- const sitesCreate = async ({siteId,name,framework,buildRuntime,enabled,logging,timeout,installCommand,buildCommand,outputDirectory,adapter,installationId,fallbackFile,providerRepositoryId,providerBranch,providerSilentMode,providerRootDirectory,specification,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
115
- let client = !sdk ? await sdkForProject() :
116
- sdk;
117
- let apiPath = '/sites';
118
- let payload = {};
119
- if (typeof siteId !== 'undefined') {
120
- payload['siteId'] = siteId;
121
- }
122
- if (typeof name !== 'undefined') {
123
- payload['name'] = name;
124
- }
125
- if (typeof framework !== 'undefined') {
126
- payload['framework'] = framework;
127
- }
128
- if (typeof enabled !== 'undefined') {
129
- payload['enabled'] = enabled;
130
- }
131
- if (typeof logging !== 'undefined') {
132
- payload['logging'] = logging;
133
- }
134
- if (typeof timeout !== 'undefined') {
135
- payload['timeout'] = timeout;
136
- }
137
- if (typeof installCommand !== 'undefined') {
138
- payload['installCommand'] = installCommand;
139
- }
140
- if (typeof buildCommand !== 'undefined') {
141
- payload['buildCommand'] = buildCommand;
142
- }
143
- if (typeof outputDirectory !== 'undefined') {
144
- payload['outputDirectory'] = outputDirectory;
145
- }
146
- if (typeof buildRuntime !== 'undefined') {
147
- payload['buildRuntime'] = buildRuntime;
148
- }
149
- if (typeof adapter !== 'undefined') {
150
- payload['adapter'] = adapter;
151
- }
152
- if (typeof installationId !== 'undefined') {
153
- payload['installationId'] = installationId;
154
- }
155
- if (typeof fallbackFile !== 'undefined') {
156
- payload['fallbackFile'] = fallbackFile;
157
- }
158
- if (typeof providerRepositoryId !== 'undefined') {
159
- payload['providerRepositoryId'] = providerRepositoryId;
160
- }
161
- if (typeof providerBranch !== 'undefined') {
162
- payload['providerBranch'] = providerBranch;
163
- }
164
- if (typeof providerSilentMode !== 'undefined') {
165
- payload['providerSilentMode'] = providerSilentMode;
166
- }
167
- if (typeof providerRootDirectory !== 'undefined') {
168
- payload['providerRootDirectory'] = providerRootDirectory;
169
- }
170
- if (typeof specification !== 'undefined') {
171
- payload['specification'] = specification;
172
- }
173
-
174
- let response = undefined;
175
-
176
- response = await client.call('post', apiPath, {
177
- 'content-type': 'application/json',
178
- }, payload);
179
-
180
- if (parseOutput) {
181
- parse(response)
182
- }
183
-
184
- return response;
185
-
186
- }
187
- /**
188
- * @typedef {Object} SitesListFrameworksRequestParams
189
- * @property {boolean} overrideForCli
190
- * @property {boolean} parseOutput
191
- * @property {libClient | undefined} sdk
192
- */
193
-
194
- /**
195
- * @param {SitesListFrameworksRequestParams} params
196
- */
197
- const sitesListFrameworks = async ({parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
198
- let client = !sdk ? await sdkForProject() :
199
- sdk;
200
- let apiPath = '/sites/frameworks';
201
- let payload = {};
202
-
203
- let response = undefined;
204
-
205
- response = await client.call('get', apiPath, {
206
- }, payload);
207
-
208
- if (parseOutput) {
209
- if(console) {
210
- showConsoleLink('sites', 'listFrameworks');
211
- } else {
212
- parse(response)
213
- }
214
- }
215
-
216
- return response;
217
-
218
- }
219
- /**
220
- * @typedef {Object} SitesListSpecificationsRequestParams
221
- * @property {boolean} overrideForCli
222
- * @property {boolean} parseOutput
223
- * @property {libClient | undefined} sdk
224
- */
225
-
226
- /**
227
- * @param {SitesListSpecificationsRequestParams} params
228
- */
229
- const sitesListSpecifications = async ({parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
230
- let client = !sdk ? await sdkForProject() :
231
- sdk;
232
- let apiPath = '/sites/specifications';
233
- let payload = {};
234
-
235
- let response = undefined;
236
-
237
- response = await client.call('get', apiPath, {
238
- }, payload);
239
-
240
- if (parseOutput) {
241
- if(console) {
242
- showConsoleLink('sites', 'listSpecifications');
243
- } else {
244
- parse(response)
245
- }
246
- }
247
-
248
- return response;
249
-
250
- }
251
- /**
252
- * @typedef {Object} SitesListTemplatesRequestParams
253
- * @property {string[]} frameworks List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.
254
- * @property {string[]} useCases List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.
255
- * @property {number} limit Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.
256
- * @property {number} offset Offset the list of returned templates. Maximum offset is 5000.
257
- * @property {boolean} overrideForCli
258
- * @property {boolean} parseOutput
259
- * @property {libClient | undefined} sdk
260
- */
261
-
262
- /**
263
- * @param {SitesListTemplatesRequestParams} params
264
- */
265
- const sitesListTemplates = async ({frameworks,useCases,limit,offset,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
266
- let client = !sdk ? await sdkForProject() :
267
- sdk;
268
- let apiPath = '/sites/templates';
269
- let payload = {};
270
- if (typeof frameworks !== 'undefined') {
271
- payload['frameworks'] = frameworks;
272
- }
273
- if (typeof useCases !== 'undefined') {
274
- payload['useCases'] = useCases;
275
- }
276
- if (typeof limit !== 'undefined') {
277
- payload['limit'] = limit;
278
- }
279
- if (typeof offset !== 'undefined') {
280
- payload['offset'] = offset;
281
- }
282
-
283
- let response = undefined;
284
-
285
- response = await client.call('get', apiPath, {
286
- }, payload);
287
-
288
- if (parseOutput) {
289
- if(console) {
290
- showConsoleLink('sites', 'listTemplates');
291
- } else {
292
- parse(response)
293
- }
294
- }
295
-
296
- return response;
297
-
298
- }
299
- /**
300
- * @typedef {Object} SitesGetTemplateRequestParams
301
- * @property {string} templateId Template ID.
302
- * @property {boolean} overrideForCli
303
- * @property {boolean} parseOutput
304
- * @property {libClient | undefined} sdk
305
- */
306
-
307
- /**
308
- * @param {SitesGetTemplateRequestParams} params
309
- */
310
- const sitesGetTemplate = async ({templateId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
311
- let client = !sdk ? await sdkForProject() :
312
- sdk;
313
- let apiPath = '/sites/templates/{templateId}'.replace('{templateId}', templateId);
314
- let payload = {};
315
-
316
- let response = undefined;
317
-
318
- response = await client.call('get', apiPath, {
319
- }, payload);
320
-
321
- if (parseOutput) {
322
- if(console) {
323
- showConsoleLink('sites', 'getTemplate', templateId);
324
- } else {
325
- parse(response)
326
- }
327
- }
328
-
329
- return response;
330
-
331
- }
332
- /**
333
- * @typedef {Object} SitesListUsageRequestParams
334
- * @property {UsageRange} range Date range.
335
- * @property {boolean} overrideForCli
336
- * @property {boolean} parseOutput
337
- * @property {libClient | undefined} sdk
338
- */
339
-
340
- /**
341
- * @param {SitesListUsageRequestParams} params
342
- */
343
- const sitesListUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
344
- let client = !sdk ? await sdkForProject() :
345
- sdk;
346
- let apiPath = '/sites/usage';
347
- let payload = {};
348
- if (typeof range !== 'undefined') {
349
- payload['range'] = range;
350
- }
351
-
352
- let response = undefined;
353
-
354
- response = await client.call('get', apiPath, {
355
- }, payload);
356
-
357
- if (parseOutput) {
358
- if(console) {
359
- showConsoleLink('sites', 'listUsage');
360
- } else {
361
- parse(response)
362
- }
363
- }
364
-
365
- return response;
366
-
367
- }
368
- /**
369
- * @typedef {Object} SitesGetRequestParams
370
- * @property {string} siteId Site ID.
371
- * @property {boolean} overrideForCli
372
- * @property {boolean} parseOutput
373
- * @property {libClient | undefined} sdk
374
- */
375
-
376
- /**
377
- * @param {SitesGetRequestParams} params
378
- */
379
- const sitesGet = async ({siteId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
380
- let client = !sdk ? await sdkForProject() :
381
- sdk;
382
- let apiPath = '/sites/{siteId}'.replace('{siteId}', siteId);
383
- let payload = {};
384
-
385
- let response = undefined;
386
-
387
- response = await client.call('get', apiPath, {
388
- }, payload);
389
-
390
- if (parseOutput) {
391
- if(console) {
392
- showConsoleLink('sites', 'get', siteId);
393
- } else {
394
- parse(response)
395
- }
396
- }
397
-
398
- return response;
399
-
400
- }
401
- /**
402
- * @typedef {Object} SitesUpdateRequestParams
403
- * @property {string} siteId Site ID.
404
- * @property {string} name Site name. Max length: 128 chars.
405
- * @property {Framework} framework Sites framework.
406
- * @property {boolean} enabled Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
407
- * @property {boolean} logging When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
408
- * @property {number} timeout Maximum request time in seconds.
409
- * @property {string} installCommand Install Command.
410
- * @property {string} buildCommand Build Command.
411
- * @property {string} outputDirectory Output Directory for site.
412
- * @property {BuildRuntime} buildRuntime Runtime to use during build step.
413
- * @property {Adapter} adapter Framework adapter defining rendering strategy. Allowed values are: static, ssr
414
- * @property {string} fallbackFile Fallback file for single page application sites.
415
- * @property {string} installationId Appwrite Installation ID for VCS (Version Control System) deployment.
416
- * @property {string} providerRepositoryId Repository ID of the repo linked to the site.
417
- * @property {string} providerBranch Production branch for the repo linked to the site.
418
- * @property {boolean} providerSilentMode Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
419
- * @property {string} providerRootDirectory Path to site code in the linked repo.
420
- * @property {string} specification Framework specification for the site and builds.
421
- * @property {boolean} overrideForCli
422
- * @property {boolean} parseOutput
423
- * @property {libClient | undefined} sdk
424
- */
425
-
426
- /**
427
- * @param {SitesUpdateRequestParams} params
428
- */
429
- const sitesUpdate = async ({siteId,name,framework,enabled,logging,timeout,installCommand,buildCommand,outputDirectory,buildRuntime,adapter,fallbackFile,installationId,providerRepositoryId,providerBranch,providerSilentMode,providerRootDirectory,specification,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
430
- let client = !sdk ? await sdkForProject() :
431
- sdk;
432
- let apiPath = '/sites/{siteId}'.replace('{siteId}', siteId);
433
- let payload = {};
434
- if (typeof name !== 'undefined') {
435
- payload['name'] = name;
436
- }
437
- if (typeof framework !== 'undefined') {
438
- payload['framework'] = framework;
439
- }
440
- if (typeof enabled !== 'undefined') {
441
- payload['enabled'] = enabled;
442
- }
443
- if (typeof logging !== 'undefined') {
444
- payload['logging'] = logging;
445
- }
446
- if (typeof timeout !== 'undefined') {
447
- payload['timeout'] = timeout;
448
- }
449
- if (typeof installCommand !== 'undefined') {
450
- payload['installCommand'] = installCommand;
451
- }
452
- if (typeof buildCommand !== 'undefined') {
453
- payload['buildCommand'] = buildCommand;
454
- }
455
- if (typeof outputDirectory !== 'undefined') {
456
- payload['outputDirectory'] = outputDirectory;
457
- }
458
- if (typeof buildRuntime !== 'undefined') {
459
- payload['buildRuntime'] = buildRuntime;
460
- }
461
- if (typeof adapter !== 'undefined') {
462
- payload['adapter'] = adapter;
463
- }
464
- if (typeof fallbackFile !== 'undefined') {
465
- payload['fallbackFile'] = fallbackFile;
466
- }
467
- if (typeof installationId !== 'undefined') {
468
- payload['installationId'] = installationId;
469
- }
470
- if (typeof providerRepositoryId !== 'undefined') {
471
- payload['providerRepositoryId'] = providerRepositoryId;
472
- }
473
- if (typeof providerBranch !== 'undefined') {
474
- payload['providerBranch'] = providerBranch;
475
- }
476
- if (typeof providerSilentMode !== 'undefined') {
477
- payload['providerSilentMode'] = providerSilentMode;
478
- }
479
- if (typeof providerRootDirectory !== 'undefined') {
480
- payload['providerRootDirectory'] = providerRootDirectory;
481
- }
482
- if (typeof specification !== 'undefined') {
483
- payload['specification'] = specification;
484
- }
485
-
486
- let response = undefined;
487
-
488
- response = await client.call('put', apiPath, {
489
- 'content-type': 'application/json',
490
- }, payload);
491
-
492
- if (parseOutput) {
493
- parse(response)
494
- }
495
-
496
- return response;
497
-
498
- }
499
- /**
500
- * @typedef {Object} SitesDeleteRequestParams
501
- * @property {string} siteId Site ID.
502
- * @property {boolean} overrideForCli
503
- * @property {boolean} parseOutput
504
- * @property {libClient | undefined} sdk
505
- */
506
-
507
- /**
508
- * @param {SitesDeleteRequestParams} params
509
- */
510
- const sitesDelete = async ({siteId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
511
- let client = !sdk ? await sdkForProject() :
512
- sdk;
513
- let apiPath = '/sites/{siteId}'.replace('{siteId}', siteId);
514
- let payload = {};
515
-
516
- let response = undefined;
517
-
518
- response = await client.call('delete', apiPath, {
519
- 'content-type': 'application/json',
520
- }, payload);
521
-
522
- if (parseOutput) {
523
- parse(response)
524
- }
525
-
526
- return response;
527
-
528
- }
529
- /**
530
- * @typedef {Object} SitesUpdateSiteDeploymentRequestParams
531
- * @property {string} siteId Site ID.
532
- * @property {string} deploymentId Deployment ID.
533
- * @property {boolean} overrideForCli
534
- * @property {boolean} parseOutput
535
- * @property {libClient | undefined} sdk
536
- */
537
-
538
- /**
539
- * @param {SitesUpdateSiteDeploymentRequestParams} params
540
- */
541
- const sitesUpdateSiteDeployment = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
542
- let client = !sdk ? await sdkForProject() :
543
- sdk;
544
- let apiPath = '/sites/{siteId}/deployment'.replace('{siteId}', siteId);
545
- let payload = {};
546
- if (typeof deploymentId !== 'undefined') {
547
- payload['deploymentId'] = deploymentId;
548
- }
549
-
550
- let response = undefined;
551
-
552
- response = await client.call('patch', apiPath, {
553
- 'content-type': 'application/json',
554
- }, payload);
555
-
556
- if (parseOutput) {
557
- parse(response)
558
- }
559
-
560
- return response;
561
-
562
- }
563
- /**
564
- * @typedef {Object} SitesListDeploymentsRequestParams
565
- * @property {string} siteId Site ID.
566
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type
567
- * @property {string} search Search term to filter your list results. Max length: 256 chars.
568
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
569
- * @property {boolean} overrideForCli
570
- * @property {boolean} parseOutput
571
- * @property {libClient | undefined} sdk
572
- */
573
-
574
- /**
575
- * @param {SitesListDeploymentsRequestParams} params
576
- */
577
- const sitesListDeployments = async ({siteId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
578
- let client = !sdk ? await sdkForProject() :
579
- sdk;
580
- let apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId);
581
- let payload = {};
582
- if (typeof queries !== 'undefined') {
583
- payload['queries'] = queries;
584
- }
585
- if (typeof search !== 'undefined') {
586
- payload['search'] = search;
587
- }
588
- if (typeof total !== 'undefined') {
589
- payload['total'] = total;
590
- }
591
-
592
- let response = undefined;
593
-
594
- response = await client.call('get', apiPath, {
595
- }, payload);
596
-
597
- if (parseOutput) {
598
- if(console) {
599
- showConsoleLink('sites', 'listDeployments', siteId);
600
- } else {
601
- parse(response)
602
- }
603
- }
604
-
605
- return response;
606
-
607
- }
608
- /**
609
- * @typedef {Object} SitesCreateDeploymentRequestParams
610
- * @property {string} siteId Site ID.
611
- * @property {string} code Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.
612
- * @property {boolean} activate Automatically activate the deployment when it is finished building.
613
- * @property {string} installCommand Install Commands.
614
- * @property {string} buildCommand Build Commands.
615
- * @property {string} outputDirectory Output Directory.
616
- * @property {boolean} overrideForCli
617
- * @property {boolean} parseOutput
618
- * @property {libClient | undefined} sdk
619
- * @property {CallableFunction} onProgress
620
- */
621
-
622
- /**
623
- * @param {SitesCreateDeploymentRequestParams} params
624
- */
625
- const sitesCreateDeployment = async ({siteId,code,activate,installCommand,buildCommand,outputDirectory,parseOutput = true, overrideForCli = false, sdk = undefined,onProgress = () => {}}) => {
626
- let client = !sdk ? await sdkForProject() :
627
- sdk;
628
- let apiPath = '/sites/{siteId}/deployments'.replace('{siteId}', siteId);
629
- let payload = {};
630
- if (typeof installCommand !== 'undefined') {
631
- payload['installCommand'] = installCommand;
632
- }
633
- if (typeof buildCommand !== 'undefined') {
634
- payload['buildCommand'] = buildCommand;
635
- }
636
- if (typeof outputDirectory !== 'undefined') {
637
- payload['outputDirectory'] = outputDirectory;
638
- }
639
- const folderPath = fs.realpathSync(code);
640
- if (!fs.lstatSync(folderPath).isDirectory()) {
641
- throw new Error('The path is not a directory.');
642
- }
643
-
644
- const ignorer = ignore();
645
-
646
- const resourceId = siteId;
647
- const resourceConfig = localConfig.getSite(resourceId);
648
-
649
- ignorer.add('.appwrite');
650
-
651
- if (resourceConfig.ignore) {
652
- ignorer.add(resourceConfig.ignore);
653
- } else if (fs.existsSync(pathLib.join(code, '.gitignore'))) {
654
- ignorer.add(fs.readFileSync(pathLib.join(code, '.gitignore')).toString());
655
- }
656
-
657
- const files = getAllFiles(code).map((file) => pathLib.relative(code, file)).filter((file) => !ignorer.ignores(file));
658
-
659
- const archiveFileName = `sites-${resourceId}-code.tar.gz`;
660
-
661
- await tar
662
- .create({
663
- gzip: true,
664
- sync: true,
665
- cwd: folderPath,
666
- file: archiveFileName
667
- }, files);
668
-
669
- let archivePath = fs.realpathSync(archiveFileName)
670
- if (typeof archivePath !== 'undefined') {
671
- payload['code'] = archivePath;
672
- code = archivePath;
673
- }
674
-
675
- const filePath = fs.realpathSync(code);
676
- const nodeStream = fs.createReadStream(filePath);
677
- const stream = convertReadStreamToReadableStream(nodeStream);
678
-
679
- if (typeof filePath !== 'undefined') {
680
- code = { type: 'file', stream, filename: pathLib.basename(filePath), size: fs.statSync(filePath).size };
681
- payload['code'] = code
682
- }
683
- if (typeof activate !== 'undefined') {
684
- payload['activate'] = activate;
685
- }
686
-
687
- const size = code.size;
688
-
689
- const apiHeaders = {
690
- 'content-type': 'multipart/form-data',
691
- };
692
-
693
- let id = undefined;
694
- let response = undefined;
695
-
696
- let chunksUploaded = 0;
697
-
698
- let currentChunk = 1;
699
- let currentPosition = 0;
700
- let uploadableChunk = new Uint8Array(client.CHUNK_SIZE);
701
-
702
- const uploadChunk = async (lastUpload = false) => {
703
- if(currentChunk <= chunksUploaded) {
704
- return;
705
- }
706
-
707
- const start = ((currentChunk - 1) * client.CHUNK_SIZE);
708
- let end = start + currentPosition - 1;
709
-
710
- if(!lastUpload || currentChunk !== 1) {
711
- apiHeaders['content-range'] = 'bytes ' + start + '-' + end + '/' + size;
712
- }
713
-
714
- let uploadableChunkTrimmed;
715
-
716
- if(currentPosition + 1 >= client.CHUNK_SIZE) {
717
- uploadableChunkTrimmed = uploadableChunk;
718
- } else {
719
- uploadableChunkTrimmed = new Uint8Array(currentPosition);
720
- for(let i = 0; i <= currentPosition; i++) {
721
- uploadableChunkTrimmed[i] = uploadableChunk[i];
722
- }
723
- }
724
-
725
- if (id) {
726
- apiHeaders['x-appwrite-id'] = id;
727
- }
728
-
729
- payload['code'] = { type: 'file', file: new File([uploadableChunkTrimmed], code.filename), filename: code.filename };
730
-
731
- response = await client.call('post', apiPath, apiHeaders, payload);
732
-
733
- if (!id) {
734
- id = response['$id'];
735
- }
736
-
737
- if (onProgress !== null) {
738
- onProgress({
739
- $id: response['$id'],
740
- progress: Math.min((currentChunk) * client.CHUNK_SIZE, size) / size * 100,
741
- sizeUploaded: end+1,
742
- chunksTotal: response['chunksTotal'],
743
- chunksUploaded: response['chunksUploaded']
744
- });
745
- }
746
-
747
- uploadableChunk = new Uint8Array(client.CHUNK_SIZE);
748
- currentChunk++;
749
- currentPosition = 0;
750
- }
751
-
752
- for await (const chunk of code.stream) {
753
- for(const b of chunk) {
754
- uploadableChunk[currentPosition] = b;
755
-
756
- currentPosition++;
757
- if(currentPosition >= client.CHUNK_SIZE) {
758
- await uploadChunk();
759
- currentPosition = 0;
760
- }
761
- }
762
- }
763
-
764
- if (currentPosition > 0) { // Check if there's any remaining data for the last chunk
765
- await uploadChunk(true);
766
- }
767
-
768
- await fs.unlink(filePath,()=>{});
769
-
770
- if (parseOutput) {
771
- parse(response)
772
- }
773
-
774
- return response;
775
- }
776
- /**
777
- * @typedef {Object} SitesCreateDuplicateDeploymentRequestParams
778
- * @property {string} siteId Site ID.
779
- * @property {string} deploymentId Deployment ID.
780
- * @property {boolean} overrideForCli
781
- * @property {boolean} parseOutput
782
- * @property {libClient | undefined} sdk
783
- */
784
-
785
- /**
786
- * @param {SitesCreateDuplicateDeploymentRequestParams} params
787
- */
788
- const sitesCreateDuplicateDeployment = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
789
- let client = !sdk ? await sdkForProject() :
790
- sdk;
791
- let apiPath = '/sites/{siteId}/deployments/duplicate'.replace('{siteId}', siteId);
792
- let payload = {};
793
- if (typeof deploymentId !== 'undefined') {
794
- payload['deploymentId'] = deploymentId;
795
- }
796
-
797
- let response = undefined;
798
-
799
- response = await client.call('post', apiPath, {
800
- 'content-type': 'application/json',
801
- }, payload);
802
-
803
- if (parseOutput) {
804
- parse(response)
805
- }
806
-
807
- return response;
808
-
809
- }
810
- /**
811
- * @typedef {Object} SitesCreateTemplateDeploymentRequestParams
812
- * @property {string} siteId Site ID.
813
- * @property {string} repository Repository name of the template.
814
- * @property {string} owner The name of the owner of the template.
815
- * @property {string} rootDirectory Path to site code in the template repo.
816
- * @property {TemplateReferenceType} type Type for the reference provided. Can be commit, branch, or tag
817
- * @property {string} reference Reference value, can be a commit hash, branch name, or release tag
818
- * @property {boolean} activate Automatically activate the deployment when it is finished building.
819
- * @property {boolean} overrideForCli
820
- * @property {boolean} parseOutput
821
- * @property {libClient | undefined} sdk
822
- */
823
-
824
- /**
825
- * @param {SitesCreateTemplateDeploymentRequestParams} params
826
- */
827
- const sitesCreateTemplateDeployment = async ({siteId,repository,owner,rootDirectory,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
828
- let client = !sdk ? await sdkForProject() :
829
- sdk;
830
- let apiPath = '/sites/{siteId}/deployments/template'.replace('{siteId}', siteId);
831
- let payload = {};
832
- if (typeof repository !== 'undefined') {
833
- payload['repository'] = repository;
834
- }
835
- if (typeof owner !== 'undefined') {
836
- payload['owner'] = owner;
837
- }
838
- if (typeof rootDirectory !== 'undefined') {
839
- payload['rootDirectory'] = rootDirectory;
840
- }
841
- if (typeof type !== 'undefined') {
842
- payload['type'] = type;
843
- }
844
- if (typeof reference !== 'undefined') {
845
- payload['reference'] = reference;
846
- }
847
- if (typeof activate !== 'undefined') {
848
- payload['activate'] = activate;
849
- }
850
-
851
- let response = undefined;
852
-
853
- response = await client.call('post', apiPath, {
854
- 'content-type': 'application/json',
855
- }, payload);
856
-
857
- if (parseOutput) {
858
- parse(response)
859
- }
860
-
861
- return response;
862
-
863
- }
864
- /**
865
- * @typedef {Object} SitesCreateVcsDeploymentRequestParams
866
- * @property {string} siteId Site ID.
867
- * @property {VCSReferenceType} type Type of reference passed. Allowed values are: branch, commit
868
- * @property {string} reference VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
869
- * @property {boolean} activate Automatically activate the deployment when it is finished building.
870
- * @property {boolean} overrideForCli
871
- * @property {boolean} parseOutput
872
- * @property {libClient | undefined} sdk
873
- */
874
-
875
- /**
876
- * @param {SitesCreateVcsDeploymentRequestParams} params
877
- */
878
- const sitesCreateVcsDeployment = async ({siteId,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
879
- let client = !sdk ? await sdkForProject() :
880
- sdk;
881
- let apiPath = '/sites/{siteId}/deployments/vcs'.replace('{siteId}', siteId);
882
- let payload = {};
883
- if (typeof type !== 'undefined') {
884
- payload['type'] = type;
885
- }
886
- if (typeof reference !== 'undefined') {
887
- payload['reference'] = reference;
888
- }
889
- if (typeof activate !== 'undefined') {
890
- payload['activate'] = activate;
891
- }
892
-
893
- let response = undefined;
894
-
895
- response = await client.call('post', apiPath, {
896
- 'content-type': 'application/json',
897
- }, payload);
898
-
899
- if (parseOutput) {
900
- parse(response)
901
- }
902
-
903
- return response;
904
-
905
- }
906
- /**
907
- * @typedef {Object} SitesGetDeploymentRequestParams
908
- * @property {string} siteId Site ID.
909
- * @property {string} deploymentId Deployment ID.
910
- * @property {boolean} overrideForCli
911
- * @property {boolean} parseOutput
912
- * @property {libClient | undefined} sdk
913
- */
914
-
915
- /**
916
- * @param {SitesGetDeploymentRequestParams} params
917
- */
918
- const sitesGetDeployment = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
919
- let client = !sdk ? await sdkForProject() :
920
- sdk;
921
- let apiPath = '/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
922
- let payload = {};
923
-
924
- let response = undefined;
925
-
926
- response = await client.call('get', apiPath, {
927
- }, payload);
928
-
929
- if (parseOutput) {
930
- if(console) {
931
- showConsoleLink('sites', 'getDeployment', siteId, deploymentId);
932
- } else {
933
- parse(response)
934
- }
935
- }
936
-
937
- return response;
938
-
939
- }
940
- /**
941
- * @typedef {Object} SitesDeleteDeploymentRequestParams
942
- * @property {string} siteId Site ID.
943
- * @property {string} deploymentId Deployment ID.
944
- * @property {boolean} overrideForCli
945
- * @property {boolean} parseOutput
946
- * @property {libClient | undefined} sdk
947
- */
948
-
949
- /**
950
- * @param {SitesDeleteDeploymentRequestParams} params
951
- */
952
- const sitesDeleteDeployment = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
953
- let client = !sdk ? await sdkForProject() :
954
- sdk;
955
- let apiPath = '/sites/{siteId}/deployments/{deploymentId}'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
956
- let payload = {};
957
-
958
- let response = undefined;
959
-
960
- response = await client.call('delete', apiPath, {
961
- 'content-type': 'application/json',
962
- }, payload);
963
-
964
- if (parseOutput) {
965
- parse(response)
966
- }
967
-
968
- return response;
969
-
970
- }
971
- /**
972
- * @typedef {Object} SitesGetDeploymentDownloadRequestParams
973
- * @property {string} siteId Site ID.
974
- * @property {string} deploymentId Deployment ID.
975
- * @property {DeploymentDownloadType} type Deployment file to download. Can be: &quot;source&quot;, &quot;output&quot;.
976
- * @property {boolean} overrideForCli
977
- * @property {boolean} parseOutput
978
- * @property {libClient | undefined} sdk
979
- * @property {string} destination
980
- */
981
-
982
- /**
983
- * @param {SitesGetDeploymentDownloadRequestParams} params
984
- */
985
- const sitesGetDeploymentDownload = async ({siteId,deploymentId,type,parseOutput = true, overrideForCli = false, sdk = undefined, destination, console}) => {
986
- let client = !sdk ? await sdkForProject() :
987
- sdk;
988
- let apiPath = '/sites/{siteId}/deployments/{deploymentId}/download'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
989
- let payload = {};
990
- if (typeof type !== 'undefined') {
991
- payload['type'] = type;
992
- }
993
- if (!overrideForCli) {
994
- payload['project'] = localConfig.getProject().projectId
995
- payload['key'] = globalConfig.getKey();
996
- const queryParams = new URLSearchParams(payload);
997
- apiPath = `${globalConfig.getEndpoint()}${apiPath}?${queryParams.toString()}`;
998
- }
999
-
1000
- let response = undefined;
1001
-
1002
- response = await client.call('get', apiPath, {
1003
- }, payload, 'arraybuffer');
1004
-
1005
- if (overrideForCli) {
1006
- response = Buffer.from(response);
1007
- }
1008
-
1009
- fs.writeFileSync(destination, response);
1010
- if (parseOutput) {
1011
- if(console) {
1012
- showConsoleLink('sites', 'getDeploymentDownload', siteId, deploymentId);
1013
- } else {
1014
- parse(response)
1015
- }
1016
- }
1017
-
1018
- return response;
1019
-
1020
- }
1021
- /**
1022
- * @typedef {Object} SitesUpdateDeploymentStatusRequestParams
1023
- * @property {string} siteId Site ID.
1024
- * @property {string} deploymentId Deployment ID.
1025
- * @property {boolean} overrideForCli
1026
- * @property {boolean} parseOutput
1027
- * @property {libClient | undefined} sdk
1028
- */
1029
-
1030
- /**
1031
- * @param {SitesUpdateDeploymentStatusRequestParams} params
1032
- */
1033
- const sitesUpdateDeploymentStatus = async ({siteId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1034
- let client = !sdk ? await sdkForProject() :
1035
- sdk;
1036
- let apiPath = '/sites/{siteId}/deployments/{deploymentId}/status'.replace('{siteId}', siteId).replace('{deploymentId}', deploymentId);
1037
- let payload = {};
1038
-
1039
- let response = undefined;
1040
-
1041
- response = await client.call('patch', apiPath, {
1042
- 'content-type': 'application/json',
1043
- }, payload);
1044
-
1045
- if (parseOutput) {
1046
- parse(response)
1047
- }
1048
-
1049
- return response;
1050
-
1051
- }
1052
- /**
1053
- * @typedef {Object} SitesListLogsRequestParams
1054
- * @property {string} siteId Site ID.
1055
- * @property {string[]} queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId
1056
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
1057
- * @property {boolean} overrideForCli
1058
- * @property {boolean} parseOutput
1059
- * @property {libClient | undefined} sdk
1060
- */
1061
-
1062
- /**
1063
- * @param {SitesListLogsRequestParams} params
1064
- */
1065
- const sitesListLogs = async ({siteId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1066
- let client = !sdk ? await sdkForProject() :
1067
- sdk;
1068
- let apiPath = '/sites/{siteId}/logs'.replace('{siteId}', siteId);
1069
- let payload = {};
1070
- if (typeof queries !== 'undefined') {
1071
- payload['queries'] = queries;
1072
- }
1073
- if (typeof total !== 'undefined') {
1074
- payload['total'] = total;
1075
- }
1076
-
1077
- let response = undefined;
1078
-
1079
- response = await client.call('get', apiPath, {
1080
- }, payload);
1081
-
1082
- if (parseOutput) {
1083
- parse(response)
1084
- }
1085
-
1086
- return response;
1087
-
1088
- }
1089
- /**
1090
- * @typedef {Object} SitesGetLogRequestParams
1091
- * @property {string} siteId Site ID.
1092
- * @property {string} logId Log ID.
1093
- * @property {boolean} overrideForCli
1094
- * @property {boolean} parseOutput
1095
- * @property {libClient | undefined} sdk
1096
- */
1097
-
1098
- /**
1099
- * @param {SitesGetLogRequestParams} params
1100
- */
1101
- const sitesGetLog = async ({siteId,logId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1102
- let client = !sdk ? await sdkForProject() :
1103
- sdk;
1104
- let apiPath = '/sites/{siteId}/logs/{logId}'.replace('{siteId}', siteId).replace('{logId}', logId);
1105
- let payload = {};
1106
-
1107
- let response = undefined;
1108
-
1109
- response = await client.call('get', apiPath, {
1110
- }, payload);
1111
-
1112
- if (parseOutput) {
1113
- if(console) {
1114
- showConsoleLink('sites', 'getLog', siteId, logId);
1115
- } else {
1116
- parse(response)
1117
- }
1118
- }
1119
-
1120
- return response;
1121
-
1122
- }
1123
- /**
1124
- * @typedef {Object} SitesDeleteLogRequestParams
1125
- * @property {string} siteId Site ID.
1126
- * @property {string} logId Log ID.
1127
- * @property {boolean} overrideForCli
1128
- * @property {boolean} parseOutput
1129
- * @property {libClient | undefined} sdk
1130
- */
1131
-
1132
- /**
1133
- * @param {SitesDeleteLogRequestParams} params
1134
- */
1135
- const sitesDeleteLog = async ({siteId,logId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1136
- let client = !sdk ? await sdkForProject() :
1137
- sdk;
1138
- let apiPath = '/sites/{siteId}/logs/{logId}'.replace('{siteId}', siteId).replace('{logId}', logId);
1139
- let payload = {};
1140
-
1141
- let response = undefined;
1142
-
1143
- response = await client.call('delete', apiPath, {
1144
- 'content-type': 'application/json',
1145
- }, payload);
1146
-
1147
- if (parseOutput) {
1148
- parse(response)
1149
- }
1150
-
1151
- return response;
1152
-
1153
- }
1154
- /**
1155
- * @typedef {Object} SitesGetUsageRequestParams
1156
- * @property {string} siteId Site ID.
1157
- * @property {UsageRange} range Date range.
1158
- * @property {boolean} overrideForCli
1159
- * @property {boolean} parseOutput
1160
- * @property {libClient | undefined} sdk
1161
- */
1162
-
1163
- /**
1164
- * @param {SitesGetUsageRequestParams} params
1165
- */
1166
- const sitesGetUsage = async ({siteId,range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1167
- let client = !sdk ? await sdkForProject() :
1168
- sdk;
1169
- let apiPath = '/sites/{siteId}/usage'.replace('{siteId}', siteId);
1170
- let payload = {};
1171
- if (typeof range !== 'undefined') {
1172
- payload['range'] = range;
1173
- }
1174
-
1175
- let response = undefined;
1176
-
1177
- response = await client.call('get', apiPath, {
1178
- }, payload);
1179
-
1180
- if (parseOutput) {
1181
- parse(response)
1182
- }
1183
-
1184
- return response;
1185
-
1186
- }
1187
- /**
1188
- * @typedef {Object} SitesListVariablesRequestParams
1189
- * @property {string} siteId Site unique ID.
1190
- * @property {boolean} overrideForCli
1191
- * @property {boolean} parseOutput
1192
- * @property {libClient | undefined} sdk
1193
- */
1194
-
1195
- /**
1196
- * @param {SitesListVariablesRequestParams} params
1197
- */
1198
- const sitesListVariables = async ({siteId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1199
- let client = !sdk ? await sdkForProject() :
1200
- sdk;
1201
- let apiPath = '/sites/{siteId}/variables'.replace('{siteId}', siteId);
1202
- let payload = {};
1203
-
1204
- let response = undefined;
1205
-
1206
- response = await client.call('get', apiPath, {
1207
- }, payload);
1208
-
1209
- if (parseOutput) {
1210
- parse(response)
1211
- }
1212
-
1213
- return response;
1214
-
1215
- }
1216
- /**
1217
- * @typedef {Object} SitesCreateVariableRequestParams
1218
- * @property {string} siteId Site unique ID.
1219
- * @property {string} key Variable key. Max length: 255 chars.
1220
- * @property {string} value Variable value. Max length: 8192 chars.
1221
- * @property {boolean} secret Secret variables can be updated or deleted, but only sites can read them during build and runtime.
1222
- * @property {boolean} overrideForCli
1223
- * @property {boolean} parseOutput
1224
- * @property {libClient | undefined} sdk
1225
- */
1226
-
1227
- /**
1228
- * @param {SitesCreateVariableRequestParams} params
1229
- */
1230
- const sitesCreateVariable = async ({siteId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1231
- let client = !sdk ? await sdkForProject() :
1232
- sdk;
1233
- let apiPath = '/sites/{siteId}/variables'.replace('{siteId}', siteId);
1234
- let payload = {};
1235
- if (typeof key !== 'undefined') {
1236
- payload['key'] = key;
1237
- }
1238
- if (typeof value !== 'undefined') {
1239
- payload['value'] = value;
1240
- }
1241
- if (typeof secret !== 'undefined') {
1242
- payload['secret'] = secret;
1243
- }
1244
-
1245
- let response = undefined;
1246
-
1247
- response = await client.call('post', apiPath, {
1248
- 'content-type': 'application/json',
1249
- }, payload);
1250
-
1251
- if (parseOutput) {
1252
- parse(response)
1253
- }
1254
-
1255
- return response;
1256
-
1257
- }
1258
- /**
1259
- * @typedef {Object} SitesGetVariableRequestParams
1260
- * @property {string} siteId Site unique ID.
1261
- * @property {string} variableId Variable unique ID.
1262
- * @property {boolean} overrideForCli
1263
- * @property {boolean} parseOutput
1264
- * @property {libClient | undefined} sdk
1265
- */
1266
-
1267
- /**
1268
- * @param {SitesGetVariableRequestParams} params
1269
- */
1270
- const sitesGetVariable = async ({siteId,variableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1271
- let client = !sdk ? await sdkForProject() :
1272
- sdk;
1273
- let apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId);
1274
- let payload = {};
1275
-
1276
- let response = undefined;
1277
-
1278
- response = await client.call('get', apiPath, {
1279
- }, payload);
1280
-
1281
- if (parseOutput) {
1282
- parse(response)
1283
- }
1284
-
1285
- return response;
1286
-
1287
- }
1288
- /**
1289
- * @typedef {Object} SitesUpdateVariableRequestParams
1290
- * @property {string} siteId Site unique ID.
1291
- * @property {string} variableId Variable unique ID.
1292
- * @property {string} key Variable key. Max length: 255 chars.
1293
- * @property {string} value Variable value. Max length: 8192 chars.
1294
- * @property {boolean} secret Secret variables can be updated or deleted, but only sites can read them during build and runtime.
1295
- * @property {boolean} overrideForCli
1296
- * @property {boolean} parseOutput
1297
- * @property {libClient | undefined} sdk
1298
- */
1299
-
1300
- /**
1301
- * @param {SitesUpdateVariableRequestParams} params
1302
- */
1303
- const sitesUpdateVariable = async ({siteId,variableId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1304
- let client = !sdk ? await sdkForProject() :
1305
- sdk;
1306
- let apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId);
1307
- let payload = {};
1308
- if (typeof key !== 'undefined') {
1309
- payload['key'] = key;
1310
- }
1311
- if (typeof value !== 'undefined') {
1312
- payload['value'] = value;
1313
- }
1314
- if (typeof secret !== 'undefined') {
1315
- payload['secret'] = secret;
1316
- }
1317
-
1318
- let response = undefined;
1319
-
1320
- response = await client.call('put', apiPath, {
1321
- 'content-type': 'application/json',
1322
- }, payload);
1323
-
1324
- if (parseOutput) {
1325
- parse(response)
1326
- }
1327
-
1328
- return response;
1329
-
1330
- }
1331
- /**
1332
- * @typedef {Object} SitesDeleteVariableRequestParams
1333
- * @property {string} siteId Site unique ID.
1334
- * @property {string} variableId Variable unique ID.
1335
- * @property {boolean} overrideForCli
1336
- * @property {boolean} parseOutput
1337
- * @property {libClient | undefined} sdk
1338
- */
1339
-
1340
- /**
1341
- * @param {SitesDeleteVariableRequestParams} params
1342
- */
1343
- const sitesDeleteVariable = async ({siteId,variableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1344
- let client = !sdk ? await sdkForProject() :
1345
- sdk;
1346
- let apiPath = '/sites/{siteId}/variables/{variableId}'.replace('{siteId}', siteId).replace('{variableId}', variableId);
1347
- let payload = {};
1348
-
1349
- let response = undefined;
1350
-
1351
- response = await client.call('delete', apiPath, {
1352
- 'content-type': 'application/json',
1353
- }, payload);
1354
-
1355
- if (parseOutput) {
1356
- parse(response)
1357
- }
1358
-
1359
- return response;
1360
-
1361
- }
1362
- sites
1363
- .command(`list`)
1364
- .description(`Get a list of all the project's sites. You can use the query params to filter your results.`)
1365
- .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, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId`)
1366
- .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1367
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
1368
- .option(`--console`, `Get the resource console url`)
1369
- .action(actionRunner(sitesList))
1370
-
1371
- sites
1372
- .command(`create`)
1373
- .description(`Create a new site.`)
1374
- .requiredOption(`--site-id <site-id>`, `Site ID. Choose a custom ID or generate a random ID with 'ID.unique()'. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
1375
- .requiredOption(`--name <name>`, `Site name. Max length: 128 chars.`)
1376
- .requiredOption(`--framework <framework>`, `Sites framework.`)
1377
- .requiredOption(`--build-runtime <build-runtime>`, `Runtime to use during build step.`)
1378
- .option(`--enabled [value]`, `Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
1379
- .option(`--logging [value]`, `When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.`, (value) => value === undefined ? true : parseBool(value))
1380
- .option(`--timeout <timeout>`, `Maximum request time in seconds.`, parseInteger)
1381
- .option(`--install-command <install-command>`, `Install Command.`)
1382
- .option(`--build-command <build-command>`, `Build Command.`)
1383
- .option(`--output-directory <output-directory>`, `Output Directory for site.`)
1384
- .option(`--adapter <adapter>`, `Framework adapter defining rendering strategy. Allowed values are: static, ssr`)
1385
- .option(`--installation-id <installation-id>`, `Appwrite Installation ID for VCS (Version Control System) deployment.`)
1386
- .option(`--fallback-file <fallback-file>`, `Fallback file for single page application sites.`)
1387
- .option(`--provider-repository-id <provider-repository-id>`, `Repository ID of the repo linked to the site.`)
1388
- .option(`--provider-branch <provider-branch>`, `Production branch for the repo linked to the site.`)
1389
- .option(`--provider-silent-mode [value]`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.`, (value) => value === undefined ? true : parseBool(value))
1390
- .option(`--provider-root-directory <provider-root-directory>`, `Path to site code in the linked repo.`)
1391
- .option(`--specification <specification>`, `Framework specification for the site and builds.`)
1392
- .action(actionRunner(sitesCreate))
1393
-
1394
- sites
1395
- .command(`list-frameworks`)
1396
- .description(`Get a list of all frameworks that are currently available on the server instance.`)
1397
- .option(`--console`, `Get the resource console url`)
1398
- .action(actionRunner(sitesListFrameworks))
1399
-
1400
- sites
1401
- .command(`list-specifications`)
1402
- .description(`List allowed site specifications for this instance.`)
1403
- .option(`--console`, `Get the resource console url`)
1404
- .action(actionRunner(sitesListSpecifications))
1405
-
1406
- sites
1407
- .command(`list-templates`)
1408
- .description(`List available site templates. You can use template details in [createSite](/docs/references/cloud/server-nodejs/sites#create) method.`)
1409
- .option(`--frameworks [frameworks...]`, `List of frameworks allowed for filtering site templates. Maximum of 100 frameworks are allowed.`)
1410
- .option(`--use-cases [use-cases...]`, `List of use cases allowed for filtering site templates. Maximum of 100 use cases are allowed.`)
1411
- .option(`--limit <limit>`, `Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.`, parseInteger)
1412
- .option(`--offset <offset>`, `Offset the list of returned templates. Maximum offset is 5000.`, parseInteger)
1413
- .option(`--console`, `Get the resource console url`)
1414
- .action(actionRunner(sitesListTemplates))
1415
-
1416
- sites
1417
- .command(`get-template`)
1418
- .description(`Get a site template using ID. You can use template details in [createSite](/docs/references/cloud/server-nodejs/sites#create) method.`)
1419
- .requiredOption(`--template-id <template-id>`, `Template ID.`)
1420
- .option(`--console`, `Get the resource console url`)
1421
- .action(actionRunner(sitesGetTemplate))
1422
-
1423
- sites
1424
- .command(`list-usage`)
1425
- .description(`Get usage metrics and statistics for all sites in the project. View statistics including total deployments, builds, logs, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.`)
1426
- .option(`--range <range>`, `Date range.`)
1427
- .option(`--console`, `Get the resource console url`)
1428
- .action(actionRunner(sitesListUsage))
1429
-
1430
- sites
1431
- .command(`get`)
1432
- .description(`Get a site by its unique ID.`)
1433
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1434
- .option(`--console`, `Get the resource console url`)
1435
- .action(actionRunner(sitesGet))
1436
-
1437
- sites
1438
- .command(`update`)
1439
- .description(`Update site by its unique ID.`)
1440
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1441
- .requiredOption(`--name <name>`, `Site name. Max length: 128 chars.`)
1442
- .requiredOption(`--framework <framework>`, `Sites framework.`)
1443
- .option(`--enabled [value]`, `Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
1444
- .option(`--logging [value]`, `When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.`, (value) => value === undefined ? true : parseBool(value))
1445
- .option(`--timeout <timeout>`, `Maximum request time in seconds.`, parseInteger)
1446
- .option(`--install-command <install-command>`, `Install Command.`)
1447
- .option(`--build-command <build-command>`, `Build Command.`)
1448
- .option(`--output-directory <output-directory>`, `Output Directory for site.`)
1449
- .option(`--build-runtime <build-runtime>`, `Runtime to use during build step.`)
1450
- .option(`--adapter <adapter>`, `Framework adapter defining rendering strategy. Allowed values are: static, ssr`)
1451
- .option(`--fallback-file <fallback-file>`, `Fallback file for single page application sites.`)
1452
- .option(`--installation-id <installation-id>`, `Appwrite Installation ID for VCS (Version Control System) deployment.`)
1453
- .option(`--provider-repository-id <provider-repository-id>`, `Repository ID of the repo linked to the site.`)
1454
- .option(`--provider-branch <provider-branch>`, `Production branch for the repo linked to the site.`)
1455
- .option(`--provider-silent-mode [value]`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.`, (value) => value === undefined ? true : parseBool(value))
1456
- .option(`--provider-root-directory <provider-root-directory>`, `Path to site code in the linked repo.`)
1457
- .option(`--specification <specification>`, `Framework specification for the site and builds.`)
1458
- .action(actionRunner(sitesUpdate))
1459
-
1460
- sites
1461
- .command(`delete`)
1462
- .description(`Delete a site by its unique ID.`)
1463
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1464
- .action(actionRunner(sitesDelete))
1465
-
1466
- sites
1467
- .command(`update-site-deployment`)
1468
- .description(`Update the site active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your site.`)
1469
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1470
- .requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
1471
- .action(actionRunner(sitesUpdateSiteDeployment))
1472
-
1473
- sites
1474
- .command(`list-deployments`)
1475
- .description(`Get a list of all the site's code deployments. You can use the query params to filter your results.`)
1476
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1477
- .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: buildSize, sourceSize, totalSize, buildDuration, status, activate, type`)
1478
- .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1479
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
1480
- .option(`--console`, `Get the resource console url`)
1481
- .action(actionRunner(sitesListDeployments))
1482
-
1483
- sites
1484
- .command(`create-deployment`)
1485
- .description(`Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.`)
1486
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1487
- .requiredOption(`--code <code>`, `Gzip file with your code package. When used with the Appwrite CLI, pass the path to your code directory, and the CLI will automatically package your code. Use a path that is within the current directory.`)
1488
- .requiredOption(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
1489
- .option(`--install-command <install-command>`, `Install Commands.`)
1490
- .option(`--build-command <build-command>`, `Build Commands.`)
1491
- .option(`--output-directory <output-directory>`, `Output Directory.`)
1492
- .action(actionRunner(sitesCreateDeployment))
1493
-
1494
- sites
1495
- .command(`create-duplicate-deployment`)
1496
- .description(`Create a new build for an existing site deployment. This endpoint allows you to rebuild a deployment with the updated site configuration, including its commands and output directory if they have been modified. The build process will be queued and executed asynchronously. The original deployment's code will be preserved and used for the new build.`)
1497
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1498
- .requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
1499
- .action(actionRunner(sitesCreateDuplicateDeployment))
1500
-
1501
- sites
1502
- .command(`create-template-deployment`)
1503
- .description(`Create a deployment based on a template. Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/sites/templates) to find the template details.`)
1504
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1505
- .requiredOption(`--repository <repository>`, `Repository name of the template.`)
1506
- .requiredOption(`--owner <owner>`, `The name of the owner of the template.`)
1507
- .requiredOption(`--root-directory <root-directory>`, `Path to site code in the template repo.`)
1508
- .requiredOption(`--type <type>`, `Type for the reference provided. Can be commit, branch, or tag`)
1509
- .requiredOption(`--reference <reference>`, `Reference value, can be a commit hash, branch name, or release tag`)
1510
- .option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
1511
- .action(actionRunner(sitesCreateTemplateDeployment))
1512
-
1513
- sites
1514
- .command(`create-vcs-deployment`)
1515
- .description(`Create a deployment when a site is connected to VCS. This endpoint lets you create deployment from a branch, commit, or a tag.`)
1516
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1517
- .requiredOption(`--type <type>`, `Type of reference passed. Allowed values are: branch, commit`)
1518
- .requiredOption(`--reference <reference>`, `VCS reference to create deployment from. Depending on type this can be: branch name, commit hash`)
1519
- .option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
1520
- .action(actionRunner(sitesCreateVcsDeployment))
1521
-
1522
- sites
1523
- .command(`get-deployment`)
1524
- .description(`Get a site deployment by its unique ID.`)
1525
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1526
- .requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
1527
- .option(`--console`, `Get the resource console url`)
1528
- .action(actionRunner(sitesGetDeployment))
1529
-
1530
- sites
1531
- .command(`delete-deployment`)
1532
- .description(`Delete a site deployment by its unique ID.`)
1533
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1534
- .requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
1535
- .action(actionRunner(sitesDeleteDeployment))
1536
-
1537
- sites
1538
- .command(`get-deployment-download`)
1539
- .description(`Get a site deployment content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.`)
1540
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1541
- .requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
1542
- .option(`--type <type>`, `Deployment file to download. Can be: "source", "output".`)
1543
- .requiredOption(`--destination <path>`, `output file path.`)
1544
- .option(`--console`, `Get the resource console url`)
1545
- .action(actionRunner(sitesGetDeploymentDownload))
1546
-
1547
- sites
1548
- .command(`update-deployment-status`)
1549
- .description(`Cancel an ongoing site deployment build. If the build is already in progress, it will be stopped and marked as canceled. If the build hasn't started yet, it will be marked as canceled without executing. You cannot cancel builds that have already completed (status 'ready') or failed. The response includes the final build status and details.`)
1550
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1551
- .requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
1552
- .action(actionRunner(sitesUpdateDeploymentStatus))
1553
-
1554
- sites
1555
- .command(`list-logs`)
1556
- .description(`Get a list of all site logs. You can use the query params to filter your results.`)
1557
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1558
- .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: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId`)
1559
- .option(`--total [value]`, `When set to false, the total count returned will be 0 and will not be calculated.`, (value) => value === undefined ? true : parseBool(value))
1560
- .action(actionRunner(sitesListLogs))
1561
-
1562
- sites
1563
- .command(`get-log`)
1564
- .description(`Get a site request log by its unique ID.`)
1565
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1566
- .requiredOption(`--log-id <log-id>`, `Log ID.`)
1567
- .option(`--console`, `Get the resource console url`)
1568
- .action(actionRunner(sitesGetLog))
1569
-
1570
- sites
1571
- .command(`delete-log`)
1572
- .description(`Delete a site log by its unique ID.`)
1573
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1574
- .requiredOption(`--log-id <log-id>`, `Log ID.`)
1575
- .action(actionRunner(sitesDeleteLog))
1576
-
1577
- sites
1578
- .command(`get-usage`)
1579
- .description(`Get usage metrics and statistics for a for a specific site. View statistics including total deployments, builds, executions, storage usage, and compute time. The response includes both current totals and historical data for each metric. Use the optional range parameter to specify the time window for historical data: 24h (last 24 hours), 30d (last 30 days), or 90d (last 90 days). If not specified, defaults to 30 days.`)
1580
- .requiredOption(`--site-id <site-id>`, `Site ID.`)
1581
- .option(`--range <range>`, `Date range.`)
1582
- .action(actionRunner(sitesGetUsage))
1583
-
1584
- sites
1585
- .command(`list-variables`)
1586
- .description(`Get a list of all variables of a specific site.`)
1587
- .requiredOption(`--site-id <site-id>`, `Site unique ID.`)
1588
- .action(actionRunner(sitesListVariables))
1589
-
1590
- sites
1591
- .command(`create-variable`)
1592
- .description(`Create a new site variable. These variables can be accessed during build and runtime (server-side rendering) as environment variables.`)
1593
- .requiredOption(`--site-id <site-id>`, `Site unique ID.`)
1594
- .requiredOption(`--key <key>`, `Variable key. Max length: 255 chars.`)
1595
- .requiredOption(`--value <value>`, `Variable value. Max length: 8192 chars.`)
1596
- .option(`--secret [value]`, `Secret variables can be updated or deleted, but only sites can read them during build and runtime.`, (value) => value === undefined ? true : parseBool(value))
1597
- .action(actionRunner(sitesCreateVariable))
1598
-
1599
- sites
1600
- .command(`get-variable`)
1601
- .description(`Get a variable by its unique ID.`)
1602
- .requiredOption(`--site-id <site-id>`, `Site unique ID.`)
1603
- .requiredOption(`--variable-id <variable-id>`, `Variable unique ID.`)
1604
- .action(actionRunner(sitesGetVariable))
1605
-
1606
- sites
1607
- .command(`update-variable`)
1608
- .description(`Update variable by its unique ID.`)
1609
- .requiredOption(`--site-id <site-id>`, `Site unique ID.`)
1610
- .requiredOption(`--variable-id <variable-id>`, `Variable unique ID.`)
1611
- .requiredOption(`--key <key>`, `Variable key. Max length: 255 chars.`)
1612
- .option(`--value <value>`, `Variable value. Max length: 8192 chars.`)
1613
- .option(`--secret [value]`, `Secret variables can be updated or deleted, but only sites can read them during build and runtime.`, (value) => value === undefined ? true : parseBool(value))
1614
- .action(actionRunner(sitesUpdateVariable))
1615
-
1616
- sites
1617
- .command(`delete-variable`)
1618
- .description(`Delete a variable by its unique ID.`)
1619
- .requiredOption(`--site-id <site-id>`, `Site unique ID.`)
1620
- .requiredOption(`--variable-id <variable-id>`, `Variable unique ID.`)
1621
- .action(actionRunner(sitesDeleteVariable))
1622
-
1623
- module.exports = {
1624
- sites,
1625
- sitesList,
1626
- sitesCreate,
1627
- sitesListFrameworks,
1628
- sitesListSpecifications,
1629
- sitesListTemplates,
1630
- sitesGetTemplate,
1631
- sitesListUsage,
1632
- sitesGet,
1633
- sitesUpdate,
1634
- sitesDelete,
1635
- sitesUpdateSiteDeployment,
1636
- sitesListDeployments,
1637
- sitesCreateDeployment,
1638
- sitesCreateDuplicateDeployment,
1639
- sitesCreateTemplateDeployment,
1640
- sitesCreateVcsDeployment,
1641
- sitesGetDeployment,
1642
- sitesDeleteDeployment,
1643
- sitesGetDeploymentDownload,
1644
- sitesUpdateDeploymentStatus,
1645
- sitesListLogs,
1646
- sitesGetLog,
1647
- sitesDeleteLog,
1648
- sitesGetUsage,
1649
- sitesListVariables,
1650
- sitesCreateVariable,
1651
- sitesGetVariable,
1652
- sitesUpdateVariable,
1653
- sitesDeleteVariable
1654
- };