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,1732 +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 functions = new Command("functions").description(commandDescriptions['functions'] ?? '').configureHelp({
39
- helpWidth: process.stdout.columns || 80
40
- })
41
-
42
- /**
43
- * @typedef {Object} FunctionsListRequestParams
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, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, 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 {FunctionsListRequestParams} params
54
- */
55
- const functionsList = async ({queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
56
- let client = !sdk ? await sdkForProject() :
57
- sdk;
58
- let apiPath = '/functions';
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('functions', 'list');
78
- } else {
79
- parse(response)
80
- }
81
- }
82
-
83
- return response;
84
-
85
- }
86
- /**
87
- * @typedef {Object} FunctionsCreateRequestParams
88
- * @property {string} functionId Function 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 Function name. Max length: 128 chars.
90
- * @property {Runtime} runtime Execution runtime.
91
- * @property {string[]} execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
92
- * @property {string[]} events Events list. Maximum of 100 events are allowed.
93
- * @property {string} schedule Schedule CRON syntax.
94
- * @property {number} timeout Function maximum execution time in seconds.
95
- * @property {boolean} enabled Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
96
- * @property {boolean} logging When disabled, executions will exclude logs and errors, and will be slightly faster.
97
- * @property {string} entrypoint Entrypoint File. This path is relative to the "providerRootDirectory".
98
- * @property {string} commands Build Commands.
99
- * @property {string[]} scopes List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.
100
- * @property {string} installationId Appwrite Installation ID for VCS (Version Control System) deployment.
101
- * @property {string} providerRepositoryId Repository ID of the repo linked to the function.
102
- * @property {string} providerBranch Production branch for the repo linked to the function.
103
- * @property {boolean} providerSilentMode Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
104
- * @property {string} providerRootDirectory Path to function code in the linked repo.
105
- * @property {string} specification Runtime specification for the function and builds.
106
- * @property {boolean} overrideForCli
107
- * @property {boolean} parseOutput
108
- * @property {libClient | undefined} sdk
109
- */
110
-
111
- /**
112
- * @param {FunctionsCreateRequestParams} params
113
- */
114
- const functionsCreate = async ({functionId,name,runtime,execute,events,schedule,timeout,enabled,logging,entrypoint,commands,scopes,installationId,providerRepositoryId,providerBranch,providerSilentMode,providerRootDirectory,specification,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
115
- let client = !sdk ? await sdkForProject() :
116
- sdk;
117
- let apiPath = '/functions';
118
- let payload = {};
119
- if (typeof functionId !== 'undefined') {
120
- payload['functionId'] = functionId;
121
- }
122
- if (typeof name !== 'undefined') {
123
- payload['name'] = name;
124
- }
125
- if (typeof runtime !== 'undefined') {
126
- payload['runtime'] = runtime;
127
- }
128
- execute = execute === true ? [] : execute;
129
- if (typeof execute !== 'undefined') {
130
- payload['execute'] = execute;
131
- }
132
- events = events === true ? [] : events;
133
- if (typeof events !== 'undefined') {
134
- payload['events'] = events;
135
- }
136
- if (typeof schedule !== 'undefined') {
137
- payload['schedule'] = schedule;
138
- }
139
- if (typeof timeout !== 'undefined') {
140
- payload['timeout'] = timeout;
141
- }
142
- if (typeof enabled !== 'undefined') {
143
- payload['enabled'] = enabled;
144
- }
145
- if (typeof logging !== 'undefined') {
146
- payload['logging'] = logging;
147
- }
148
- if (typeof entrypoint !== 'undefined') {
149
- payload['entrypoint'] = entrypoint;
150
- }
151
- if (typeof commands !== 'undefined') {
152
- payload['commands'] = commands;
153
- }
154
- scopes = scopes === true ? [] : scopes;
155
- if (typeof scopes !== 'undefined') {
156
- payload['scopes'] = scopes;
157
- }
158
- if (typeof installationId !== 'undefined') {
159
- payload['installationId'] = installationId;
160
- }
161
- if (typeof providerRepositoryId !== 'undefined') {
162
- payload['providerRepositoryId'] = providerRepositoryId;
163
- }
164
- if (typeof providerBranch !== 'undefined') {
165
- payload['providerBranch'] = providerBranch;
166
- }
167
- if (typeof providerSilentMode !== 'undefined') {
168
- payload['providerSilentMode'] = providerSilentMode;
169
- }
170
- if (typeof providerRootDirectory !== 'undefined') {
171
- payload['providerRootDirectory'] = providerRootDirectory;
172
- }
173
- if (typeof specification !== 'undefined') {
174
- payload['specification'] = specification;
175
- }
176
-
177
- let response = undefined;
178
-
179
- response = await client.call('post', apiPath, {
180
- 'content-type': 'application/json',
181
- }, payload);
182
-
183
- if (parseOutput) {
184
- parse(response)
185
- }
186
-
187
- return response;
188
-
189
- }
190
- /**
191
- * @typedef {Object} FunctionsListRuntimesRequestParams
192
- * @property {boolean} overrideForCli
193
- * @property {boolean} parseOutput
194
- * @property {libClient | undefined} sdk
195
- */
196
-
197
- /**
198
- * @param {FunctionsListRuntimesRequestParams} params
199
- */
200
- const functionsListRuntimes = async ({parseOutput = true, overrideForCli = false, sdk = undefined}) => {
201
- let client = !sdk ? await sdkForProject() :
202
- sdk;
203
- let apiPath = '/functions/runtimes';
204
- let payload = {};
205
-
206
- let response = undefined;
207
-
208
- response = await client.call('get', apiPath, {
209
- }, payload);
210
-
211
- if (parseOutput) {
212
- parse(response)
213
- }
214
-
215
- return response;
216
-
217
- }
218
- /**
219
- * @typedef {Object} FunctionsListSpecificationsRequestParams
220
- * @property {boolean} overrideForCli
221
- * @property {boolean} parseOutput
222
- * @property {libClient | undefined} sdk
223
- */
224
-
225
- /**
226
- * @param {FunctionsListSpecificationsRequestParams} params
227
- */
228
- const functionsListSpecifications = async ({parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
229
- let client = !sdk ? await sdkForProject() :
230
- sdk;
231
- let apiPath = '/functions/specifications';
232
- let payload = {};
233
-
234
- let response = undefined;
235
-
236
- response = await client.call('get', apiPath, {
237
- }, payload);
238
-
239
- if (parseOutput) {
240
- if(console) {
241
- showConsoleLink('functions', 'listSpecifications');
242
- } else {
243
- parse(response)
244
- }
245
- }
246
-
247
- return response;
248
-
249
- }
250
- /**
251
- * @typedef {Object} FunctionsListTemplatesRequestParams
252
- * @property {string[]} runtimes List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.
253
- * @property {string[]} useCases List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.
254
- * @property {number} limit Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.
255
- * @property {number} offset Offset the list of returned templates. Maximum offset is 5000.
256
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
257
- * @property {boolean} overrideForCli
258
- * @property {boolean} parseOutput
259
- * @property {libClient | undefined} sdk
260
- */
261
-
262
- /**
263
- * @param {FunctionsListTemplatesRequestParams} params
264
- */
265
- const functionsListTemplates = async ({runtimes,useCases,limit,offset,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
266
- let client = !sdk ? await sdkForProject() :
267
- sdk;
268
- let apiPath = '/functions/templates';
269
- let payload = {};
270
- if (typeof runtimes !== 'undefined') {
271
- payload['runtimes'] = runtimes;
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
- if (typeof total !== 'undefined') {
283
- payload['total'] = total;
284
- }
285
-
286
- let response = undefined;
287
-
288
- response = await client.call('get', apiPath, {
289
- }, payload);
290
-
291
- if (parseOutput) {
292
- if(console) {
293
- showConsoleLink('functions', 'listTemplates');
294
- } else {
295
- parse(response)
296
- }
297
- }
298
-
299
- return response;
300
-
301
- }
302
- /**
303
- * @typedef {Object} FunctionsGetTemplateRequestParams
304
- * @property {string} templateId Template ID.
305
- * @property {boolean} overrideForCli
306
- * @property {boolean} parseOutput
307
- * @property {libClient | undefined} sdk
308
- */
309
-
310
- /**
311
- * @param {FunctionsGetTemplateRequestParams} params
312
- */
313
- const functionsGetTemplate = async ({templateId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
314
- let client = !sdk ? await sdkForProject() :
315
- sdk;
316
- let apiPath = '/functions/templates/{templateId}'.replace('{templateId}', templateId);
317
- let payload = {};
318
-
319
- let response = undefined;
320
-
321
- response = await client.call('get', apiPath, {
322
- }, payload);
323
-
324
- if (parseOutput) {
325
- if(console) {
326
- showConsoleLink('functions', 'getTemplate', templateId);
327
- } else {
328
- parse(response)
329
- }
330
- }
331
-
332
- return response;
333
-
334
- }
335
- /**
336
- * @typedef {Object} FunctionsListUsageRequestParams
337
- * @property {UsageRange} range Date range.
338
- * @property {boolean} overrideForCli
339
- * @property {boolean} parseOutput
340
- * @property {libClient | undefined} sdk
341
- */
342
-
343
- /**
344
- * @param {FunctionsListUsageRequestParams} params
345
- */
346
- const functionsListUsage = async ({range,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
347
- let client = !sdk ? await sdkForProject() :
348
- sdk;
349
- let apiPath = '/functions/usage';
350
- let payload = {};
351
- if (typeof range !== 'undefined') {
352
- payload['range'] = range;
353
- }
354
-
355
- let response = undefined;
356
-
357
- response = await client.call('get', apiPath, {
358
- }, payload);
359
-
360
- if (parseOutput) {
361
- if(console) {
362
- showConsoleLink('functions', 'listUsage');
363
- } else {
364
- parse(response)
365
- }
366
- }
367
-
368
- return response;
369
-
370
- }
371
- /**
372
- * @typedef {Object} FunctionsGetRequestParams
373
- * @property {string} functionId Function ID.
374
- * @property {boolean} overrideForCli
375
- * @property {boolean} parseOutput
376
- * @property {libClient | undefined} sdk
377
- */
378
-
379
- /**
380
- * @param {FunctionsGetRequestParams} params
381
- */
382
- const functionsGet = async ({functionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
383
- let client = !sdk ? await sdkForProject() :
384
- sdk;
385
- let apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
386
- let payload = {};
387
-
388
- let response = undefined;
389
-
390
- response = await client.call('get', apiPath, {
391
- }, payload);
392
-
393
- if (parseOutput) {
394
- if(console) {
395
- showConsoleLink('functions', 'get', functionId);
396
- } else {
397
- parse(response)
398
- }
399
- }
400
-
401
- return response;
402
-
403
- }
404
- /**
405
- * @typedef {Object} FunctionsUpdateRequestParams
406
- * @property {string} functionId Function ID.
407
- * @property {string} name Function name. Max length: 128 chars.
408
- * @property {Runtime} runtime Execution runtime.
409
- * @property {string[]} execute An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.
410
- * @property {string[]} events Events list. Maximum of 100 events are allowed.
411
- * @property {string} schedule Schedule CRON syntax.
412
- * @property {number} timeout Maximum execution time in seconds.
413
- * @property {boolean} enabled Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.
414
- * @property {boolean} logging When disabled, executions will exclude logs and errors, and will be slightly faster.
415
- * @property {string} entrypoint Entrypoint File. This path is relative to the "providerRootDirectory".
416
- * @property {string} commands Build Commands.
417
- * @property {string[]} scopes List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.
418
- * @property {string} installationId Appwrite Installation ID for VCS (Version Controle System) deployment.
419
- * @property {string} providerRepositoryId Repository ID of the repo linked to the function
420
- * @property {string} providerBranch Production branch for the repo linked to the function
421
- * @property {boolean} providerSilentMode Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.
422
- * @property {string} providerRootDirectory Path to function code in the linked repo.
423
- * @property {string} specification Runtime specification for the function and builds.
424
- * @property {boolean} overrideForCli
425
- * @property {boolean} parseOutput
426
- * @property {libClient | undefined} sdk
427
- */
428
-
429
- /**
430
- * @param {FunctionsUpdateRequestParams} params
431
- */
432
- const functionsUpdate = async ({functionId,name,runtime,execute,events,schedule,timeout,enabled,logging,entrypoint,commands,scopes,installationId,providerRepositoryId,providerBranch,providerSilentMode,providerRootDirectory,specification,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
433
- let client = !sdk ? await sdkForProject() :
434
- sdk;
435
- let apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
436
- let payload = {};
437
- if (typeof name !== 'undefined') {
438
- payload['name'] = name;
439
- }
440
- if (typeof runtime !== 'undefined') {
441
- payload['runtime'] = runtime;
442
- }
443
- execute = execute === true ? [] : execute;
444
- if (typeof execute !== 'undefined') {
445
- payload['execute'] = execute;
446
- }
447
- events = events === true ? [] : events;
448
- if (typeof events !== 'undefined') {
449
- payload['events'] = events;
450
- }
451
- if (typeof schedule !== 'undefined') {
452
- payload['schedule'] = schedule;
453
- }
454
- if (typeof timeout !== 'undefined') {
455
- payload['timeout'] = timeout;
456
- }
457
- if (typeof enabled !== 'undefined') {
458
- payload['enabled'] = enabled;
459
- }
460
- if (typeof logging !== 'undefined') {
461
- payload['logging'] = logging;
462
- }
463
- if (typeof entrypoint !== 'undefined') {
464
- payload['entrypoint'] = entrypoint;
465
- }
466
- if (typeof commands !== 'undefined') {
467
- payload['commands'] = commands;
468
- }
469
- scopes = scopes === true ? [] : scopes;
470
- if (typeof scopes !== 'undefined') {
471
- payload['scopes'] = scopes;
472
- }
473
- if (typeof installationId !== 'undefined') {
474
- payload['installationId'] = installationId;
475
- }
476
- if (typeof providerRepositoryId !== 'undefined') {
477
- payload['providerRepositoryId'] = providerRepositoryId;
478
- }
479
- if (typeof providerBranch !== 'undefined') {
480
- payload['providerBranch'] = providerBranch;
481
- }
482
- if (typeof providerSilentMode !== 'undefined') {
483
- payload['providerSilentMode'] = providerSilentMode;
484
- }
485
- if (typeof providerRootDirectory !== 'undefined') {
486
- payload['providerRootDirectory'] = providerRootDirectory;
487
- }
488
- if (typeof specification !== 'undefined') {
489
- payload['specification'] = specification;
490
- }
491
-
492
- let response = undefined;
493
-
494
- response = await client.call('put', apiPath, {
495
- 'content-type': 'application/json',
496
- }, payload);
497
-
498
- if (parseOutput) {
499
- parse(response)
500
- }
501
-
502
- return response;
503
-
504
- }
505
- /**
506
- * @typedef {Object} FunctionsDeleteRequestParams
507
- * @property {string} functionId Function ID.
508
- * @property {boolean} overrideForCli
509
- * @property {boolean} parseOutput
510
- * @property {libClient | undefined} sdk
511
- */
512
-
513
- /**
514
- * @param {FunctionsDeleteRequestParams} params
515
- */
516
- const functionsDelete = async ({functionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
517
- let client = !sdk ? await sdkForProject() :
518
- sdk;
519
- let apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
520
- let payload = {};
521
-
522
- let response = undefined;
523
-
524
- response = await client.call('delete', apiPath, {
525
- 'content-type': 'application/json',
526
- }, payload);
527
-
528
- if (parseOutput) {
529
- parse(response)
530
- }
531
-
532
- return response;
533
-
534
- }
535
- /**
536
- * @typedef {Object} FunctionsUpdateFunctionDeploymentRequestParams
537
- * @property {string} functionId Function ID.
538
- * @property {string} deploymentId Deployment ID.
539
- * @property {boolean} overrideForCli
540
- * @property {boolean} parseOutput
541
- * @property {libClient | undefined} sdk
542
- */
543
-
544
- /**
545
- * @param {FunctionsUpdateFunctionDeploymentRequestParams} params
546
- */
547
- const functionsUpdateFunctionDeployment = async ({functionId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
548
- let client = !sdk ? await sdkForProject() :
549
- sdk;
550
- let apiPath = '/functions/{functionId}/deployment'.replace('{functionId}', functionId);
551
- let payload = {};
552
- if (typeof deploymentId !== 'undefined') {
553
- payload['deploymentId'] = deploymentId;
554
- }
555
-
556
- let response = undefined;
557
-
558
- response = await client.call('patch', apiPath, {
559
- 'content-type': 'application/json',
560
- }, payload);
561
-
562
- if (parseOutput) {
563
- parse(response)
564
- }
565
-
566
- return response;
567
-
568
- }
569
- /**
570
- * @typedef {Object} FunctionsListDeploymentsRequestParams
571
- * @property {string} functionId Function ID.
572
- * @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
573
- * @property {string} search Search term to filter your list results. Max length: 256 chars.
574
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
575
- * @property {boolean} overrideForCli
576
- * @property {boolean} parseOutput
577
- * @property {libClient | undefined} sdk
578
- */
579
-
580
- /**
581
- * @param {FunctionsListDeploymentsRequestParams} params
582
- */
583
- const functionsListDeployments = async ({functionId,queries,search,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
584
- let client = !sdk ? await sdkForProject() :
585
- sdk;
586
- let apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);
587
- let payload = {};
588
- if (typeof queries !== 'undefined') {
589
- payload['queries'] = queries;
590
- }
591
- if (typeof search !== 'undefined') {
592
- payload['search'] = search;
593
- }
594
- if (typeof total !== 'undefined') {
595
- payload['total'] = total;
596
- }
597
-
598
- let response = undefined;
599
-
600
- response = await client.call('get', apiPath, {
601
- }, payload);
602
-
603
- if (parseOutput) {
604
- if(console) {
605
- showConsoleLink('functions', 'listDeployments', functionId);
606
- } else {
607
- parse(response)
608
- }
609
- }
610
-
611
- return response;
612
-
613
- }
614
- /**
615
- * @typedef {Object} FunctionsCreateDeploymentRequestParams
616
- * @property {string} functionId Function ID.
617
- * @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.
618
- * @property {boolean} activate Automatically activate the deployment when it is finished building.
619
- * @property {string} entrypoint Entrypoint File.
620
- * @property {string} commands Build Commands.
621
- * @property {boolean} overrideForCli
622
- * @property {boolean} parseOutput
623
- * @property {libClient | undefined} sdk
624
- * @property {CallableFunction} onProgress
625
- */
626
-
627
- /**
628
- * @param {FunctionsCreateDeploymentRequestParams} params
629
- */
630
- const functionsCreateDeployment = async ({functionId,code,activate,entrypoint,commands,parseOutput = true, overrideForCli = false, sdk = undefined,onProgress = () => {}}) => {
631
- let client = !sdk ? await sdkForProject() :
632
- sdk;
633
- let apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);
634
- let payload = {};
635
- if (typeof entrypoint !== 'undefined') {
636
- payload['entrypoint'] = entrypoint;
637
- }
638
- if (typeof commands !== 'undefined') {
639
- payload['commands'] = commands;
640
- }
641
- const folderPath = fs.realpathSync(code);
642
- if (!fs.lstatSync(folderPath).isDirectory()) {
643
- throw new Error('The path is not a directory.');
644
- }
645
-
646
- const ignorer = ignore();
647
-
648
- const resourceId = functionId;
649
- const resourceConfig = localConfig.getFunction(resourceId);
650
-
651
- ignorer.add('.appwrite');
652
-
653
- if (resourceConfig.ignore) {
654
- ignorer.add(resourceConfig.ignore);
655
- } else if (fs.existsSync(pathLib.join(code, '.gitignore'))) {
656
- ignorer.add(fs.readFileSync(pathLib.join(code, '.gitignore')).toString());
657
- }
658
-
659
- const files = getAllFiles(code).map((file) => pathLib.relative(code, file)).filter((file) => !ignorer.ignores(file));
660
-
661
- const archiveFileName = `functions-${resourceId}-code.tar.gz`;
662
-
663
- await tar
664
- .create({
665
- gzip: true,
666
- sync: true,
667
- cwd: folderPath,
668
- file: archiveFileName
669
- }, files);
670
-
671
- let archivePath = fs.realpathSync(archiveFileName)
672
- if (typeof archivePath !== 'undefined') {
673
- payload['code'] = archivePath;
674
- code = archivePath;
675
- }
676
-
677
- const filePath = fs.realpathSync(code);
678
- const nodeStream = fs.createReadStream(filePath);
679
- const stream = convertReadStreamToReadableStream(nodeStream);
680
-
681
- if (typeof filePath !== 'undefined') {
682
- code = { type: 'file', stream, filename: pathLib.basename(filePath), size: fs.statSync(filePath).size };
683
- payload['code'] = code
684
- }
685
- if (typeof activate !== 'undefined') {
686
- payload['activate'] = activate;
687
- }
688
-
689
- const size = code.size;
690
-
691
- const apiHeaders = {
692
- 'content-type': 'multipart/form-data',
693
- };
694
-
695
- let id = undefined;
696
- let response = undefined;
697
-
698
- let chunksUploaded = 0;
699
-
700
- let currentChunk = 1;
701
- let currentPosition = 0;
702
- let uploadableChunk = new Uint8Array(client.CHUNK_SIZE);
703
-
704
- const uploadChunk = async (lastUpload = false) => {
705
- if(currentChunk <= chunksUploaded) {
706
- return;
707
- }
708
-
709
- const start = ((currentChunk - 1) * client.CHUNK_SIZE);
710
- let end = start + currentPosition - 1;
711
-
712
- if(!lastUpload || currentChunk !== 1) {
713
- apiHeaders['content-range'] = 'bytes ' + start + '-' + end + '/' + size;
714
- }
715
-
716
- let uploadableChunkTrimmed;
717
-
718
- if(currentPosition + 1 >= client.CHUNK_SIZE) {
719
- uploadableChunkTrimmed = uploadableChunk;
720
- } else {
721
- uploadableChunkTrimmed = new Uint8Array(currentPosition);
722
- for(let i = 0; i <= currentPosition; i++) {
723
- uploadableChunkTrimmed[i] = uploadableChunk[i];
724
- }
725
- }
726
-
727
- if (id) {
728
- apiHeaders['x-appwrite-id'] = id;
729
- }
730
-
731
- payload['code'] = { type: 'file', file: new File([uploadableChunkTrimmed], code.filename), filename: code.filename };
732
-
733
- response = await client.call('post', apiPath, apiHeaders, payload);
734
-
735
- if (!id) {
736
- id = response['$id'];
737
- }
738
-
739
- if (onProgress !== null) {
740
- onProgress({
741
- $id: response['$id'],
742
- progress: Math.min((currentChunk) * client.CHUNK_SIZE, size) / size * 100,
743
- sizeUploaded: end+1,
744
- chunksTotal: response['chunksTotal'],
745
- chunksUploaded: response['chunksUploaded']
746
- });
747
- }
748
-
749
- uploadableChunk = new Uint8Array(client.CHUNK_SIZE);
750
- currentChunk++;
751
- currentPosition = 0;
752
- }
753
-
754
- for await (const chunk of code.stream) {
755
- for(const b of chunk) {
756
- uploadableChunk[currentPosition] = b;
757
-
758
- currentPosition++;
759
- if(currentPosition >= client.CHUNK_SIZE) {
760
- await uploadChunk();
761
- currentPosition = 0;
762
- }
763
- }
764
- }
765
-
766
- if (currentPosition > 0) { // Check if there's any remaining data for the last chunk
767
- await uploadChunk(true);
768
- }
769
-
770
- await fs.unlink(filePath,()=>{});
771
-
772
- if (parseOutput) {
773
- parse(response)
774
- }
775
-
776
- return response;
777
- }
778
- /**
779
- * @typedef {Object} FunctionsCreateDuplicateDeploymentRequestParams
780
- * @property {string} functionId Function ID.
781
- * @property {string} deploymentId Deployment ID.
782
- * @property {string} buildId Build unique ID.
783
- * @property {boolean} overrideForCli
784
- * @property {boolean} parseOutput
785
- * @property {libClient | undefined} sdk
786
- */
787
-
788
- /**
789
- * @param {FunctionsCreateDuplicateDeploymentRequestParams} params
790
- */
791
- const functionsCreateDuplicateDeployment = async ({functionId,deploymentId,buildId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
792
- let client = !sdk ? await sdkForProject() :
793
- sdk;
794
- let apiPath = '/functions/{functionId}/deployments/duplicate'.replace('{functionId}', functionId);
795
- let payload = {};
796
- if (typeof deploymentId !== 'undefined') {
797
- payload['deploymentId'] = deploymentId;
798
- }
799
- if (typeof buildId !== 'undefined') {
800
- payload['buildId'] = buildId;
801
- }
802
-
803
- let response = undefined;
804
-
805
- response = await client.call('post', apiPath, {
806
- 'content-type': 'application/json',
807
- }, payload);
808
-
809
- if (parseOutput) {
810
- parse(response)
811
- }
812
-
813
- return response;
814
-
815
- }
816
- /**
817
- * @typedef {Object} FunctionsCreateTemplateDeploymentRequestParams
818
- * @property {string} functionId Function ID.
819
- * @property {string} repository Repository name of the template.
820
- * @property {string} owner The name of the owner of the template.
821
- * @property {string} rootDirectory Path to function code in the template repo.
822
- * @property {TemplateReferenceType} type Type for the reference provided. Can be commit, branch, or tag
823
- * @property {string} reference Reference value, can be a commit hash, branch name, or release tag
824
- * @property {boolean} activate Automatically activate the deployment when it is finished building.
825
- * @property {boolean} overrideForCli
826
- * @property {boolean} parseOutput
827
- * @property {libClient | undefined} sdk
828
- */
829
-
830
- /**
831
- * @param {FunctionsCreateTemplateDeploymentRequestParams} params
832
- */
833
- const functionsCreateTemplateDeployment = async ({functionId,repository,owner,rootDirectory,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
834
- let client = !sdk ? await sdkForProject() :
835
- sdk;
836
- let apiPath = '/functions/{functionId}/deployments/template'.replace('{functionId}', functionId);
837
- let payload = {};
838
- if (typeof repository !== 'undefined') {
839
- payload['repository'] = repository;
840
- }
841
- if (typeof owner !== 'undefined') {
842
- payload['owner'] = owner;
843
- }
844
- if (typeof rootDirectory !== 'undefined') {
845
- payload['rootDirectory'] = rootDirectory;
846
- }
847
- if (typeof type !== 'undefined') {
848
- payload['type'] = type;
849
- }
850
- if (typeof reference !== 'undefined') {
851
- payload['reference'] = reference;
852
- }
853
- if (typeof activate !== 'undefined') {
854
- payload['activate'] = activate;
855
- }
856
-
857
- let response = undefined;
858
-
859
- response = await client.call('post', apiPath, {
860
- 'content-type': 'application/json',
861
- }, payload);
862
-
863
- if (parseOutput) {
864
- parse(response)
865
- }
866
-
867
- return response;
868
-
869
- }
870
- /**
871
- * @typedef {Object} FunctionsCreateVcsDeploymentRequestParams
872
- * @property {string} functionId Function ID.
873
- * @property {VCSReferenceType} type Type of reference passed. Allowed values are: branch, commit
874
- * @property {string} reference VCS reference to create deployment from. Depending on type this can be: branch name, commit hash
875
- * @property {boolean} activate Automatically activate the deployment when it is finished building.
876
- * @property {boolean} overrideForCli
877
- * @property {boolean} parseOutput
878
- * @property {libClient | undefined} sdk
879
- */
880
-
881
- /**
882
- * @param {FunctionsCreateVcsDeploymentRequestParams} params
883
- */
884
- const functionsCreateVcsDeployment = async ({functionId,type,reference,activate,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
885
- let client = !sdk ? await sdkForProject() :
886
- sdk;
887
- let apiPath = '/functions/{functionId}/deployments/vcs'.replace('{functionId}', functionId);
888
- let payload = {};
889
- if (typeof type !== 'undefined') {
890
- payload['type'] = type;
891
- }
892
- if (typeof reference !== 'undefined') {
893
- payload['reference'] = reference;
894
- }
895
- if (typeof activate !== 'undefined') {
896
- payload['activate'] = activate;
897
- }
898
-
899
- let response = undefined;
900
-
901
- response = await client.call('post', apiPath, {
902
- 'content-type': 'application/json',
903
- }, payload);
904
-
905
- if (parseOutput) {
906
- parse(response)
907
- }
908
-
909
- return response;
910
-
911
- }
912
- /**
913
- * @typedef {Object} FunctionsGetDeploymentRequestParams
914
- * @property {string} functionId Function ID.
915
- * @property {string} deploymentId Deployment ID.
916
- * @property {boolean} overrideForCli
917
- * @property {boolean} parseOutput
918
- * @property {libClient | undefined} sdk
919
- */
920
-
921
- /**
922
- * @param {FunctionsGetDeploymentRequestParams} params
923
- */
924
- const functionsGetDeployment = async ({functionId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
925
- let client = !sdk ? await sdkForProject() :
926
- sdk;
927
- let apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
928
- let payload = {};
929
-
930
- let response = undefined;
931
-
932
- response = await client.call('get', apiPath, {
933
- }, payload);
934
-
935
- if (parseOutput) {
936
- if(console) {
937
- showConsoleLink('functions', 'getDeployment', functionId, deploymentId);
938
- } else {
939
- parse(response)
940
- }
941
- }
942
-
943
- return response;
944
-
945
- }
946
- /**
947
- * @typedef {Object} FunctionsDeleteDeploymentRequestParams
948
- * @property {string} functionId Function ID.
949
- * @property {string} deploymentId Deployment ID.
950
- * @property {boolean} overrideForCli
951
- * @property {boolean} parseOutput
952
- * @property {libClient | undefined} sdk
953
- */
954
-
955
- /**
956
- * @param {FunctionsDeleteDeploymentRequestParams} params
957
- */
958
- const functionsDeleteDeployment = async ({functionId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
959
- let client = !sdk ? await sdkForProject() :
960
- sdk;
961
- let apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
962
- let payload = {};
963
-
964
- let response = undefined;
965
-
966
- response = await client.call('delete', apiPath, {
967
- 'content-type': 'application/json',
968
- }, payload);
969
-
970
- if (parseOutput) {
971
- parse(response)
972
- }
973
-
974
- return response;
975
-
976
- }
977
- /**
978
- * @typedef {Object} FunctionsGetDeploymentDownloadRequestParams
979
- * @property {string} functionId Function ID.
980
- * @property {string} deploymentId Deployment ID.
981
- * @property {DeploymentDownloadType} type Deployment file to download. Can be: &quot;source&quot;, &quot;output&quot;.
982
- * @property {boolean} overrideForCli
983
- * @property {boolean} parseOutput
984
- * @property {libClient | undefined} sdk
985
- * @property {string} destination
986
- */
987
-
988
- /**
989
- * @param {FunctionsGetDeploymentDownloadRequestParams} params
990
- */
991
- const functionsGetDeploymentDownload = async ({functionId,deploymentId,type,parseOutput = true, overrideForCli = false, sdk = undefined, destination, console}) => {
992
- let client = !sdk ? await sdkForProject() :
993
- sdk;
994
- let apiPath = '/functions/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
995
- let payload = {};
996
- if (typeof type !== 'undefined') {
997
- payload['type'] = type;
998
- }
999
- if (!overrideForCli) {
1000
- payload['project'] = localConfig.getProject().projectId
1001
- payload['key'] = globalConfig.getKey();
1002
- const queryParams = new URLSearchParams(payload);
1003
- apiPath = `${globalConfig.getEndpoint()}${apiPath}?${queryParams.toString()}`;
1004
- }
1005
-
1006
- let response = undefined;
1007
-
1008
- response = await client.call('get', apiPath, {
1009
- }, payload, 'arraybuffer');
1010
-
1011
- if (overrideForCli) {
1012
- response = Buffer.from(response);
1013
- }
1014
-
1015
- fs.writeFileSync(destination, response);
1016
- if (parseOutput) {
1017
- if(console) {
1018
- showConsoleLink('functions', 'getDeploymentDownload', functionId, deploymentId);
1019
- } else {
1020
- parse(response)
1021
- }
1022
- }
1023
-
1024
- return response;
1025
-
1026
- }
1027
- /**
1028
- * @typedef {Object} FunctionsUpdateDeploymentStatusRequestParams
1029
- * @property {string} functionId Function ID.
1030
- * @property {string} deploymentId Deployment ID.
1031
- * @property {boolean} overrideForCli
1032
- * @property {boolean} parseOutput
1033
- * @property {libClient | undefined} sdk
1034
- */
1035
-
1036
- /**
1037
- * @param {FunctionsUpdateDeploymentStatusRequestParams} params
1038
- */
1039
- const functionsUpdateDeploymentStatus = async ({functionId,deploymentId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1040
- let client = !sdk ? await sdkForProject() :
1041
- sdk;
1042
- let apiPath = '/functions/{functionId}/deployments/{deploymentId}/status'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
1043
- let payload = {};
1044
-
1045
- let response = undefined;
1046
-
1047
- response = await client.call('patch', apiPath, {
1048
- 'content-type': 'application/json',
1049
- }, payload);
1050
-
1051
- if (parseOutput) {
1052
- parse(response)
1053
- }
1054
-
1055
- return response;
1056
-
1057
- }
1058
- /**
1059
- * @typedef {Object} FunctionsListExecutionsRequestParams
1060
- * @property {string} functionId Function ID.
1061
- * @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
1062
- * @property {boolean} total When set to false, the total count returned will be 0 and will not be calculated.
1063
- * @property {boolean} overrideForCli
1064
- * @property {boolean} parseOutput
1065
- * @property {libClient | undefined} sdk
1066
- */
1067
-
1068
- /**
1069
- * @param {FunctionsListExecutionsRequestParams} params
1070
- */
1071
- const functionsListExecutions = async ({functionId,queries,total,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1072
- let client = !sdk ? await sdkForProject() :
1073
- sdk;
1074
- let apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
1075
- let payload = {};
1076
- if (typeof queries !== 'undefined') {
1077
- payload['queries'] = queries;
1078
- }
1079
- if (typeof total !== 'undefined') {
1080
- payload['total'] = total;
1081
- }
1082
-
1083
- let response = undefined;
1084
-
1085
- response = await client.call('get', apiPath, {
1086
- }, payload);
1087
-
1088
- if (parseOutput) {
1089
- if(console) {
1090
- showConsoleLink('functions', 'listExecutions', functionId);
1091
- } else {
1092
- parse(response)
1093
- }
1094
- }
1095
-
1096
- return response;
1097
-
1098
- }
1099
- /**
1100
- * @typedef {Object} FunctionsCreateExecutionRequestParams
1101
- * @property {string} functionId Function ID.
1102
- * @property {string} body HTTP body of execution. Default value is empty string.
1103
- * @property {boolean} async Execute code in the background. Default value is false.
1104
- * @property {string} xpath HTTP path of execution. Path can include query params. Default value is /
1105
- * @property {ExecutionMethod} method HTTP method of execution. Default value is POST.
1106
- * @property {object} headers HTTP headers of execution. Defaults to empty.
1107
- * @property {string} scheduledAt Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.
1108
- * @property {boolean} overrideForCli
1109
- * @property {boolean} parseOutput
1110
- * @property {libClient | undefined} sdk
1111
- */
1112
-
1113
- /**
1114
- * @param {FunctionsCreateExecutionRequestParams} params
1115
- */
1116
- const functionsCreateExecution = async ({functionId,body,async,xpath,method,headers,scheduledAt,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1117
- let client = !sdk ? await sdkForProject() :
1118
- sdk;
1119
- let apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
1120
- let payload = {};
1121
- if (typeof body !== 'undefined') {
1122
- payload['body'] = body;
1123
- }
1124
- if (typeof async !== 'undefined') {
1125
- payload['async'] = async;
1126
- }
1127
- if (typeof xpath !== 'undefined') {
1128
- payload['path'] = xpath;
1129
- }
1130
- if (typeof method !== 'undefined') {
1131
- payload['method'] = method;
1132
- }
1133
- if (typeof headers !== 'undefined') {
1134
- payload['headers'] = JSON.parse(headers);
1135
- }
1136
- if (typeof scheduledAt !== 'undefined') {
1137
- payload['scheduledAt'] = scheduledAt;
1138
- }
1139
-
1140
- let response = undefined;
1141
-
1142
- response = await client.call('post', apiPath, {
1143
- 'content-type': 'application/json',
1144
- }, payload);
1145
-
1146
- if (parseOutput) {
1147
- parse(response)
1148
- }
1149
-
1150
- return response;
1151
-
1152
- }
1153
- /**
1154
- * @typedef {Object} FunctionsGetExecutionRequestParams
1155
- * @property {string} functionId Function ID.
1156
- * @property {string} executionId Execution ID.
1157
- * @property {boolean} overrideForCli
1158
- * @property {boolean} parseOutput
1159
- * @property {libClient | undefined} sdk
1160
- */
1161
-
1162
- /**
1163
- * @param {FunctionsGetExecutionRequestParams} params
1164
- */
1165
- const functionsGetExecution = async ({functionId,executionId,parseOutput = true, overrideForCli = false, sdk = undefined, console}) => {
1166
- let client = !sdk ? await sdkForProject() :
1167
- sdk;
1168
- let apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
1169
- let payload = {};
1170
-
1171
- let response = undefined;
1172
-
1173
- response = await client.call('get', apiPath, {
1174
- }, payload);
1175
-
1176
- if (parseOutput) {
1177
- if(console) {
1178
- showConsoleLink('functions', 'getExecution', functionId, executionId);
1179
- } else {
1180
- parse(response)
1181
- }
1182
- }
1183
-
1184
- return response;
1185
-
1186
- }
1187
- /**
1188
- * @typedef {Object} FunctionsDeleteExecutionRequestParams
1189
- * @property {string} functionId Function ID.
1190
- * @property {string} executionId Execution ID.
1191
- * @property {boolean} overrideForCli
1192
- * @property {boolean} parseOutput
1193
- * @property {libClient | undefined} sdk
1194
- */
1195
-
1196
- /**
1197
- * @param {FunctionsDeleteExecutionRequestParams} params
1198
- */
1199
- const functionsDeleteExecution = async ({functionId,executionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1200
- let client = !sdk ? await sdkForProject() :
1201
- sdk;
1202
- let apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
1203
- let payload = {};
1204
-
1205
- let response = undefined;
1206
-
1207
- response = await client.call('delete', apiPath, {
1208
- 'content-type': 'application/json',
1209
- }, payload);
1210
-
1211
- if (parseOutput) {
1212
- parse(response)
1213
- }
1214
-
1215
- return response;
1216
-
1217
- }
1218
- /**
1219
- * @typedef {Object} FunctionsGetUsageRequestParams
1220
- * @property {string} functionId Function ID.
1221
- * @property {UsageRange} range Date range.
1222
- * @property {boolean} overrideForCli
1223
- * @property {boolean} parseOutput
1224
- * @property {libClient | undefined} sdk
1225
- */
1226
-
1227
- /**
1228
- * @param {FunctionsGetUsageRequestParams} params
1229
- */
1230
- const functionsGetUsage = async ({functionId,range,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1231
- let client = !sdk ? await sdkForProject() :
1232
- sdk;
1233
- let apiPath = '/functions/{functionId}/usage'.replace('{functionId}', functionId);
1234
- let payload = {};
1235
- if (typeof range !== 'undefined') {
1236
- payload['range'] = range;
1237
- }
1238
-
1239
- let response = undefined;
1240
-
1241
- response = await client.call('get', apiPath, {
1242
- }, payload);
1243
-
1244
- if (parseOutput) {
1245
- parse(response)
1246
- }
1247
-
1248
- return response;
1249
-
1250
- }
1251
- /**
1252
- * @typedef {Object} FunctionsListVariablesRequestParams
1253
- * @property {string} functionId Function unique ID.
1254
- * @property {boolean} overrideForCli
1255
- * @property {boolean} parseOutput
1256
- * @property {libClient | undefined} sdk
1257
- */
1258
-
1259
- /**
1260
- * @param {FunctionsListVariablesRequestParams} params
1261
- */
1262
- const functionsListVariables = async ({functionId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1263
- let client = !sdk ? await sdkForProject() :
1264
- sdk;
1265
- let apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId);
1266
- let payload = {};
1267
-
1268
- let response = undefined;
1269
-
1270
- response = await client.call('get', apiPath, {
1271
- }, payload);
1272
-
1273
- if (parseOutput) {
1274
- parse(response)
1275
- }
1276
-
1277
- return response;
1278
-
1279
- }
1280
- /**
1281
- * @typedef {Object} FunctionsCreateVariableRequestParams
1282
- * @property {string} functionId Function unique ID.
1283
- * @property {string} key Variable key. Max length: 255 chars.
1284
- * @property {string} value Variable value. Max length: 8192 chars.
1285
- * @property {boolean} secret Secret variables can be updated or deleted, but only functions can read them during build and runtime.
1286
- * @property {boolean} overrideForCli
1287
- * @property {boolean} parseOutput
1288
- * @property {libClient | undefined} sdk
1289
- */
1290
-
1291
- /**
1292
- * @param {FunctionsCreateVariableRequestParams} params
1293
- */
1294
- const functionsCreateVariable = async ({functionId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1295
- let client = !sdk ? await sdkForProject() :
1296
- sdk;
1297
- let apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId);
1298
- let payload = {};
1299
- if (typeof key !== 'undefined') {
1300
- payload['key'] = key;
1301
- }
1302
- if (typeof value !== 'undefined') {
1303
- payload['value'] = value;
1304
- }
1305
- if (typeof secret !== 'undefined') {
1306
- payload['secret'] = secret;
1307
- }
1308
-
1309
- let response = undefined;
1310
-
1311
- response = await client.call('post', apiPath, {
1312
- 'content-type': 'application/json',
1313
- }, payload);
1314
-
1315
- if (parseOutput) {
1316
- parse(response)
1317
- }
1318
-
1319
- return response;
1320
-
1321
- }
1322
- /**
1323
- * @typedef {Object} FunctionsGetVariableRequestParams
1324
- * @property {string} functionId Function unique ID.
1325
- * @property {string} variableId Variable unique ID.
1326
- * @property {boolean} overrideForCli
1327
- * @property {boolean} parseOutput
1328
- * @property {libClient | undefined} sdk
1329
- */
1330
-
1331
- /**
1332
- * @param {FunctionsGetVariableRequestParams} params
1333
- */
1334
- const functionsGetVariable = async ({functionId,variableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1335
- let client = !sdk ? await sdkForProject() :
1336
- sdk;
1337
- let apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
1338
- let payload = {};
1339
-
1340
- let response = undefined;
1341
-
1342
- response = await client.call('get', apiPath, {
1343
- }, payload);
1344
-
1345
- if (parseOutput) {
1346
- parse(response)
1347
- }
1348
-
1349
- return response;
1350
-
1351
- }
1352
- /**
1353
- * @typedef {Object} FunctionsUpdateVariableRequestParams
1354
- * @property {string} functionId Function unique ID.
1355
- * @property {string} variableId Variable unique ID.
1356
- * @property {string} key Variable key. Max length: 255 chars.
1357
- * @property {string} value Variable value. Max length: 8192 chars.
1358
- * @property {boolean} secret Secret variables can be updated or deleted, but only functions can read them during build and runtime.
1359
- * @property {boolean} overrideForCli
1360
- * @property {boolean} parseOutput
1361
- * @property {libClient | undefined} sdk
1362
- */
1363
-
1364
- /**
1365
- * @param {FunctionsUpdateVariableRequestParams} params
1366
- */
1367
- const functionsUpdateVariable = async ({functionId,variableId,key,value,secret,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1368
- let client = !sdk ? await sdkForProject() :
1369
- sdk;
1370
- let apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
1371
- let payload = {};
1372
- if (typeof key !== 'undefined') {
1373
- payload['key'] = key;
1374
- }
1375
- if (typeof value !== 'undefined') {
1376
- payload['value'] = value;
1377
- }
1378
- if (typeof secret !== 'undefined') {
1379
- payload['secret'] = secret;
1380
- }
1381
-
1382
- let response = undefined;
1383
-
1384
- response = await client.call('put', apiPath, {
1385
- 'content-type': 'application/json',
1386
- }, payload);
1387
-
1388
- if (parseOutput) {
1389
- parse(response)
1390
- }
1391
-
1392
- return response;
1393
-
1394
- }
1395
- /**
1396
- * @typedef {Object} FunctionsDeleteVariableRequestParams
1397
- * @property {string} functionId Function unique ID.
1398
- * @property {string} variableId Variable unique ID.
1399
- * @property {boolean} overrideForCli
1400
- * @property {boolean} parseOutput
1401
- * @property {libClient | undefined} sdk
1402
- */
1403
-
1404
- /**
1405
- * @param {FunctionsDeleteVariableRequestParams} params
1406
- */
1407
- const functionsDeleteVariable = async ({functionId,variableId,parseOutput = true, overrideForCli = false, sdk = undefined}) => {
1408
- let client = !sdk ? await sdkForProject() :
1409
- sdk;
1410
- let apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
1411
- let payload = {};
1412
-
1413
- let response = undefined;
1414
-
1415
- response = await client.call('delete', apiPath, {
1416
- 'content-type': 'application/json',
1417
- }, payload);
1418
-
1419
- if (parseOutput) {
1420
- parse(response)
1421
- }
1422
-
1423
- return response;
1424
-
1425
- }
1426
- functions
1427
- .command(`list`)
1428
- .description(`Get a list of all the project's functions. You can use the query params to filter your results.`)
1429
- .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, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId`)
1430
- .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1431
- .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))
1432
- .option(`--console`, `Get the resource console url`)
1433
- .action(actionRunner(functionsList))
1434
-
1435
- functions
1436
- .command(`create`)
1437
- .description(`Create a new function. You can pass a list of [permissions](https://appwrite.io/docs/permissions) to allow different project users or team with access to execute the function using the client API.`)
1438
- .requiredOption(`--function-id <function-id>`, `Function 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.`)
1439
- .requiredOption(`--name <name>`, `Function name. Max length: 128 chars.`)
1440
- .requiredOption(`--runtime <runtime>`, `Execution runtime.`)
1441
- .option(`--execute [execute...]`, `An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.`)
1442
- .option(`--events [events...]`, `Events list. Maximum of 100 events are allowed.`)
1443
- .option(`--schedule <schedule>`, `Schedule CRON syntax.`)
1444
- .option(`--timeout <timeout>`, `Function maximum execution time in seconds.`, parseInteger)
1445
- .option(`--enabled [value]`, `Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
1446
- .option(`--logging [value]`, `When disabled, executions will exclude logs and errors, and will be slightly faster.`, (value) => value === undefined ? true : parseBool(value))
1447
- .option(`--entrypoint <entrypoint>`, `Entrypoint File. This path is relative to the "providerRootDirectory".`)
1448
- .option(`--commands <commands>`, `Build Commands.`)
1449
- .option(`--scopes [scopes...]`, `List of scopes allowed for API key auto-generated for every execution. Maximum of 100 scopes are allowed.`)
1450
- .option(`--installation-id <installation-id>`, `Appwrite Installation ID for VCS (Version Control System) deployment.`)
1451
- .option(`--provider-repository-id <provider-repository-id>`, `Repository ID of the repo linked to the function.`)
1452
- .option(`--provider-branch <provider-branch>`, `Production branch for the repo linked to the function.`)
1453
- .option(`--provider-silent-mode [value]`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.`, (value) => value === undefined ? true : parseBool(value))
1454
- .option(`--provider-root-directory <provider-root-directory>`, `Path to function code in the linked repo.`)
1455
- .option(`--specification <specification>`, `Runtime specification for the function and builds.`)
1456
- .action(actionRunner(functionsCreate))
1457
-
1458
- functions
1459
- .command(`list-runtimes`)
1460
- .description(`Get a list of all runtimes that are currently active on your instance.`)
1461
- .action(actionRunner(functionsListRuntimes))
1462
-
1463
- functions
1464
- .command(`list-specifications`)
1465
- .description(`List allowed function specifications for this instance.`)
1466
- .option(`--console`, `Get the resource console url`)
1467
- .action(actionRunner(functionsListSpecifications))
1468
-
1469
- functions
1470
- .command(`list-templates`)
1471
- .description(`List available function templates. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.`)
1472
- .option(`--runtimes [runtimes...]`, `List of runtimes allowed for filtering function templates. Maximum of 100 runtimes are allowed.`)
1473
- .option(`--use-cases [use-cases...]`, `List of use cases allowed for filtering function templates. Maximum of 100 use cases are allowed.`)
1474
- .option(`--limit <limit>`, `Limit the number of templates returned in the response. Default limit is 25, and maximum limit is 5000.`, parseInteger)
1475
- .option(`--offset <offset>`, `Offset the list of returned templates. Maximum offset is 5000.`, parseInteger)
1476
- .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))
1477
- .option(`--console`, `Get the resource console url`)
1478
- .action(actionRunner(functionsListTemplates))
1479
-
1480
- functions
1481
- .command(`get-template`)
1482
- .description(`Get a function template using ID. You can use template details in [createFunction](/docs/references/cloud/server-nodejs/functions#create) method.`)
1483
- .requiredOption(`--template-id <template-id>`, `Template ID.`)
1484
- .option(`--console`, `Get the resource console url`)
1485
- .action(actionRunner(functionsGetTemplate))
1486
-
1487
- functions
1488
- .command(`list-usage`)
1489
- .description(`Get usage metrics and statistics for all functions 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.`)
1490
- .option(`--range <range>`, `Date range.`)
1491
- .option(`--console`, `Get the resource console url`)
1492
- .action(actionRunner(functionsListUsage))
1493
-
1494
- functions
1495
- .command(`get`)
1496
- .description(`Get a function by its unique ID.`)
1497
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1498
- .option(`--console`, `Get the resource console url`)
1499
- .action(actionRunner(functionsGet))
1500
-
1501
- functions
1502
- .command(`update`)
1503
- .description(`Update function by its unique ID.`)
1504
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1505
- .requiredOption(`--name <name>`, `Function name. Max length: 128 chars.`)
1506
- .option(`--runtime <runtime>`, `Execution runtime.`)
1507
- .option(`--execute [execute...]`, `An array of role strings with execution permissions. By default no user is granted with any execute permissions. [learn more about roles](https://appwrite.io/docs/permissions#permission-roles). Maximum of 100 roles are allowed, each 64 characters long.`)
1508
- .option(`--events [events...]`, `Events list. Maximum of 100 events are allowed.`)
1509
- .option(`--schedule <schedule>`, `Schedule CRON syntax.`)
1510
- .option(`--timeout <timeout>`, `Maximum execution time in seconds.`, parseInteger)
1511
- .option(`--enabled [value]`, `Is function enabled? When set to 'disabled', users cannot access the function but Server SDKs with and API key can still access the function. No data is lost when this is toggled.`, (value) => value === undefined ? true : parseBool(value))
1512
- .option(`--logging [value]`, `When disabled, executions will exclude logs and errors, and will be slightly faster.`, (value) => value === undefined ? true : parseBool(value))
1513
- .option(`--entrypoint <entrypoint>`, `Entrypoint File. This path is relative to the "providerRootDirectory".`)
1514
- .option(`--commands <commands>`, `Build Commands.`)
1515
- .option(`--scopes [scopes...]`, `List of scopes allowed for API Key auto-generated for every execution. Maximum of 100 scopes are allowed.`)
1516
- .option(`--installation-id <installation-id>`, `Appwrite Installation ID for VCS (Version Controle System) deployment.`)
1517
- .option(`--provider-repository-id <provider-repository-id>`, `Repository ID of the repo linked to the function`)
1518
- .option(`--provider-branch <provider-branch>`, `Production branch for the repo linked to the function`)
1519
- .option(`--provider-silent-mode [value]`, `Is the VCS (Version Control System) connection in silent mode for the repo linked to the function? In silent mode, comments will not be made on commits and pull requests.`, (value) => value === undefined ? true : parseBool(value))
1520
- .option(`--provider-root-directory <provider-root-directory>`, `Path to function code in the linked repo.`)
1521
- .option(`--specification <specification>`, `Runtime specification for the function and builds.`)
1522
- .action(actionRunner(functionsUpdate))
1523
-
1524
- functions
1525
- .command(`delete`)
1526
- .description(`Delete a function by its unique ID.`)
1527
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1528
- .action(actionRunner(functionsDelete))
1529
-
1530
- functions
1531
- .command(`update-function-deployment`)
1532
- .description(`Update the function active deployment. Use this endpoint to switch the code deployment that should be used when visitor opens your function.`)
1533
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1534
- .requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
1535
- .action(actionRunner(functionsUpdateFunctionDeployment))
1536
-
1537
- functions
1538
- .command(`list-deployments`)
1539
- .description(`Get a list of all the function's code deployments. You can use the query params to filter your results.`)
1540
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1541
- .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`)
1542
- .option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`)
1543
- .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))
1544
- .option(`--console`, `Get the resource console url`)
1545
- .action(actionRunner(functionsListDeployments))
1546
-
1547
- functions
1548
- .command(`create-deployment`)
1549
- .description(`Create a new function code deployment. Use this endpoint to upload a new version of your code function. To execute your newly uploaded code, you'll need to update the function's deployment to use your new deployment UID. This endpoint accepts a tar.gz file compressed with your code. Make sure to include any dependencies your code has within the compressed file. You can learn more about code packaging in the [Appwrite Cloud Functions tutorial](https://appwrite.io/docs/functions). Use the "command" param to set the entrypoint used to execute your code.`)
1550
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1551
- .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.`)
1552
- .requiredOption(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
1553
- .option(`--entrypoint <entrypoint>`, `Entrypoint File.`)
1554
- .option(`--commands <commands>`, `Build Commands.`)
1555
- .action(actionRunner(functionsCreateDeployment))
1556
-
1557
- functions
1558
- .command(`create-duplicate-deployment`)
1559
- .description(`Create a new build for an existing function deployment. This endpoint allows you to rebuild a deployment with the updated function configuration, including its entrypoint and build commands 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.`)
1560
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1561
- .requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
1562
- .option(`--build-id <build-id>`, `Build unique ID.`)
1563
- .action(actionRunner(functionsCreateDuplicateDeployment))
1564
-
1565
- functions
1566
- .command(`create-template-deployment`)
1567
- .description(`Create a deployment based on a template. Use this endpoint with combination of [listTemplates](https://appwrite.io/docs/products/functions/templates) to find the template details.`)
1568
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1569
- .requiredOption(`--repository <repository>`, `Repository name of the template.`)
1570
- .requiredOption(`--owner <owner>`, `The name of the owner of the template.`)
1571
- .requiredOption(`--root-directory <root-directory>`, `Path to function code in the template repo.`)
1572
- .requiredOption(`--type <type>`, `Type for the reference provided. Can be commit, branch, or tag`)
1573
- .requiredOption(`--reference <reference>`, `Reference value, can be a commit hash, branch name, or release tag`)
1574
- .option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
1575
- .action(actionRunner(functionsCreateTemplateDeployment))
1576
-
1577
- functions
1578
- .command(`create-vcs-deployment`)
1579
- .description(`Create a deployment when a function is connected to VCS. This endpoint lets you create deployment from a branch, commit, or a tag.`)
1580
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1581
- .requiredOption(`--type <type>`, `Type of reference passed. Allowed values are: branch, commit`)
1582
- .requiredOption(`--reference <reference>`, `VCS reference to create deployment from. Depending on type this can be: branch name, commit hash`)
1583
- .option(`--activate [value]`, `Automatically activate the deployment when it is finished building.`, (value) => value === undefined ? true : parseBool(value))
1584
- .action(actionRunner(functionsCreateVcsDeployment))
1585
-
1586
- functions
1587
- .command(`get-deployment`)
1588
- .description(`Get a function deployment by its unique ID.`)
1589
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1590
- .requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
1591
- .option(`--console`, `Get the resource console url`)
1592
- .action(actionRunner(functionsGetDeployment))
1593
-
1594
- functions
1595
- .command(`delete-deployment`)
1596
- .description(`Delete a code deployment by its unique ID.`)
1597
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1598
- .requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
1599
- .action(actionRunner(functionsDeleteDeployment))
1600
-
1601
- functions
1602
- .command(`get-deployment-download`)
1603
- .description(`Get a function 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.`)
1604
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1605
- .requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
1606
- .option(`--type <type>`, `Deployment file to download. Can be: "source", "output".`)
1607
- .requiredOption(`--destination <path>`, `output file path.`)
1608
- .option(`--console`, `Get the resource console url`)
1609
- .action(actionRunner(functionsGetDeploymentDownload))
1610
-
1611
- functions
1612
- .command(`update-deployment-status`)
1613
- .description(`Cancel an ongoing function 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.`)
1614
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1615
- .requiredOption(`--deployment-id <deployment-id>`, `Deployment ID.`)
1616
- .action(actionRunner(functionsUpdateDeploymentStatus))
1617
-
1618
- functions
1619
- .command(`list-executions`)
1620
- .description(`Get a list of all the current user function execution logs. You can use the query params to filter your results.`)
1621
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1622
- .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`)
1623
- .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))
1624
- .option(`--console`, `Get the resource console url`)
1625
- .action(actionRunner(functionsListExecutions))
1626
-
1627
- functions
1628
- .command(`create-execution`)
1629
- .description(`Trigger a function execution. The returned object will return you the current execution status. You can ping the 'Get Execution' endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.`)
1630
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1631
- .option(`--body <body>`, `HTTP body of execution. Default value is empty string.`)
1632
- .option(`--async [value]`, `Execute code in the background. Default value is false.`, (value) => value === undefined ? true : parseBool(value))
1633
- .option(`--xpath <xpath>`, `HTTP path of execution. Path can include query params. Default value is /`)
1634
- .option(`--method <method>`, `HTTP method of execution. Default value is POST.`)
1635
- .option(`--headers <headers>`, `HTTP headers of execution. Defaults to empty.`)
1636
- .option(`--scheduled-at <scheduled-at>`, `Scheduled execution time in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. DateTime value must be in future with precision in minutes.`)
1637
- .action(actionRunner(functionsCreateExecution))
1638
-
1639
- functions
1640
- .command(`get-execution`)
1641
- .description(`Get a function execution log by its unique ID.`)
1642
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1643
- .requiredOption(`--execution-id <execution-id>`, `Execution ID.`)
1644
- .option(`--console`, `Get the resource console url`)
1645
- .action(actionRunner(functionsGetExecution))
1646
-
1647
- functions
1648
- .command(`delete-execution`)
1649
- .description(`Delete a function execution by its unique ID.`)
1650
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1651
- .requiredOption(`--execution-id <execution-id>`, `Execution ID.`)
1652
- .action(actionRunner(functionsDeleteExecution))
1653
-
1654
- functions
1655
- .command(`get-usage`)
1656
- .description(`Get usage metrics and statistics for a for a specific function. 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.`)
1657
- .requiredOption(`--function-id <function-id>`, `Function ID.`)
1658
- .option(`--range <range>`, `Date range.`)
1659
- .action(actionRunner(functionsGetUsage))
1660
-
1661
- functions
1662
- .command(`list-variables`)
1663
- .description(`Get a list of all variables of a specific function.`)
1664
- .requiredOption(`--function-id <function-id>`, `Function unique ID.`)
1665
- .action(actionRunner(functionsListVariables))
1666
-
1667
- functions
1668
- .command(`create-variable`)
1669
- .description(`Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.`)
1670
- .requiredOption(`--function-id <function-id>`, `Function unique ID.`)
1671
- .requiredOption(`--key <key>`, `Variable key. Max length: 255 chars.`)
1672
- .requiredOption(`--value <value>`, `Variable value. Max length: 8192 chars.`)
1673
- .option(`--secret [value]`, `Secret variables can be updated or deleted, but only functions can read them during build and runtime.`, (value) => value === undefined ? true : parseBool(value))
1674
- .action(actionRunner(functionsCreateVariable))
1675
-
1676
- functions
1677
- .command(`get-variable`)
1678
- .description(`Get a variable by its unique ID.`)
1679
- .requiredOption(`--function-id <function-id>`, `Function unique ID.`)
1680
- .requiredOption(`--variable-id <variable-id>`, `Variable unique ID.`)
1681
- .action(actionRunner(functionsGetVariable))
1682
-
1683
- functions
1684
- .command(`update-variable`)
1685
- .description(`Update variable by its unique ID.`)
1686
- .requiredOption(`--function-id <function-id>`, `Function unique ID.`)
1687
- .requiredOption(`--variable-id <variable-id>`, `Variable unique ID.`)
1688
- .requiredOption(`--key <key>`, `Variable key. Max length: 255 chars.`)
1689
- .option(`--value <value>`, `Variable value. Max length: 8192 chars.`)
1690
- .option(`--secret [value]`, `Secret variables can be updated or deleted, but only functions can read them during build and runtime.`, (value) => value === undefined ? true : parseBool(value))
1691
- .action(actionRunner(functionsUpdateVariable))
1692
-
1693
- functions
1694
- .command(`delete-variable`)
1695
- .description(`Delete a variable by its unique ID.`)
1696
- .requiredOption(`--function-id <function-id>`, `Function unique ID.`)
1697
- .requiredOption(`--variable-id <variable-id>`, `Variable unique ID.`)
1698
- .action(actionRunner(functionsDeleteVariable))
1699
-
1700
- module.exports = {
1701
- functions,
1702
- functionsList,
1703
- functionsCreate,
1704
- functionsListRuntimes,
1705
- functionsListSpecifications,
1706
- functionsListTemplates,
1707
- functionsGetTemplate,
1708
- functionsListUsage,
1709
- functionsGet,
1710
- functionsUpdate,
1711
- functionsDelete,
1712
- functionsUpdateFunctionDeployment,
1713
- functionsListDeployments,
1714
- functionsCreateDeployment,
1715
- functionsCreateDuplicateDeployment,
1716
- functionsCreateTemplateDeployment,
1717
- functionsCreateVcsDeployment,
1718
- functionsGetDeployment,
1719
- functionsDeleteDeployment,
1720
- functionsGetDeploymentDownload,
1721
- functionsUpdateDeploymentStatus,
1722
- functionsListExecutions,
1723
- functionsCreateExecution,
1724
- functionsGetExecution,
1725
- functionsDeleteExecution,
1726
- functionsGetUsage,
1727
- functionsListVariables,
1728
- functionsCreateVariable,
1729
- functionsGetVariable,
1730
- functionsUpdateVariable,
1731
- functionsDeleteVariable
1732
- };