node-appwrite 12.0.1 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (526) hide show
  1. package/README.md +1 -1
  2. package/dist/client.d.mts +131 -0
  3. package/dist/client.d.ts +131 -0
  4. package/dist/client.js +302 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/client.mjs +296 -0
  7. package/dist/client.mjs.map +1 -0
  8. package/dist/enums/authentication-factor.d.mts +8 -0
  9. package/dist/enums/authentication-factor.d.ts +8 -0
  10. package/dist/enums/authentication-factor.js +13 -0
  11. package/dist/enums/authentication-factor.js.map +1 -0
  12. package/dist/enums/authentication-factor.mjs +12 -0
  13. package/dist/enums/authentication-factor.mjs.map +1 -0
  14. package/dist/enums/authenticator-type.d.mts +5 -0
  15. package/dist/enums/authenticator-type.d.ts +5 -0
  16. package/dist/enums/authenticator-type.js +10 -0
  17. package/dist/enums/authenticator-type.js.map +1 -0
  18. package/dist/enums/authenticator-type.mjs +9 -0
  19. package/dist/enums/authenticator-type.mjs.map +1 -0
  20. package/dist/enums/browser.d.mts +18 -0
  21. package/dist/enums/browser.d.ts +18 -0
  22. package/dist/enums/browser.js +23 -0
  23. package/dist/enums/browser.js.map +1 -0
  24. package/dist/enums/browser.mjs +22 -0
  25. package/dist/enums/browser.mjs.map +1 -0
  26. package/dist/enums/compression.d.mts +7 -0
  27. package/dist/enums/compression.d.ts +7 -0
  28. package/dist/enums/compression.js +12 -0
  29. package/dist/enums/compression.js.map +1 -0
  30. package/dist/enums/compression.mjs +11 -0
  31. package/dist/enums/compression.mjs.map +1 -0
  32. package/dist/enums/credit-card.d.mts +20 -0
  33. package/dist/enums/credit-card.d.ts +20 -0
  34. package/dist/enums/credit-card.js +25 -0
  35. package/dist/enums/credit-card.js.map +1 -0
  36. package/dist/enums/credit-card.mjs +24 -0
  37. package/dist/enums/credit-card.mjs.map +1 -0
  38. package/dist/enums/execution-method.d.mts +10 -0
  39. package/dist/enums/execution-method.d.ts +10 -0
  40. package/dist/enums/execution-method.js +15 -0
  41. package/dist/enums/execution-method.js.map +1 -0
  42. package/dist/enums/execution-method.mjs +14 -0
  43. package/dist/enums/execution-method.mjs.map +1 -0
  44. package/dist/enums/flag.d.mts +199 -0
  45. package/dist/enums/flag.d.ts +199 -0
  46. package/dist/enums/flag.js +204 -0
  47. package/dist/enums/flag.js.map +1 -0
  48. package/dist/enums/flag.mjs +203 -0
  49. package/dist/enums/flag.mjs.map +1 -0
  50. package/dist/enums/image-format.d.mts +9 -0
  51. package/dist/enums/image-format.d.ts +9 -0
  52. package/dist/enums/image-format.js +14 -0
  53. package/dist/enums/image-format.js.map +1 -0
  54. package/dist/enums/image-format.mjs +13 -0
  55. package/dist/enums/image-format.mjs.map +1 -0
  56. package/dist/enums/image-gravity.d.mts +13 -0
  57. package/dist/enums/image-gravity.d.ts +13 -0
  58. package/dist/enums/image-gravity.js +18 -0
  59. package/dist/enums/image-gravity.js.map +1 -0
  60. package/dist/enums/image-gravity.mjs +17 -0
  61. package/dist/enums/image-gravity.mjs.map +1 -0
  62. package/dist/enums/index-type.d.mts +7 -0
  63. package/dist/enums/index-type.d.ts +7 -0
  64. package/dist/enums/index-type.js +12 -0
  65. package/dist/enums/index-type.js.map +1 -0
  66. package/dist/enums/index-type.mjs +11 -0
  67. package/dist/enums/index-type.mjs.map +1 -0
  68. package/dist/enums/messaging-provider-type.d.mts +7 -0
  69. package/dist/enums/messaging-provider-type.d.ts +7 -0
  70. package/dist/enums/messaging-provider-type.js +12 -0
  71. package/dist/enums/messaging-provider-type.js.map +1 -0
  72. package/dist/enums/messaging-provider-type.mjs +11 -0
  73. package/dist/enums/messaging-provider-type.mjs.map +1 -0
  74. package/dist/enums/name.d.mts +16 -0
  75. package/dist/enums/name.d.ts +16 -0
  76. package/dist/enums/name.js +21 -0
  77. package/dist/enums/name.js.map +1 -0
  78. package/dist/enums/name.mjs +20 -0
  79. package/dist/enums/name.mjs.map +1 -0
  80. package/dist/enums/o-auth-provider.d.mts +43 -0
  81. package/dist/enums/o-auth-provider.d.ts +43 -0
  82. package/dist/enums/o-auth-provider.js +48 -0
  83. package/dist/enums/o-auth-provider.js.map +1 -0
  84. package/dist/enums/o-auth-provider.mjs +47 -0
  85. package/dist/enums/o-auth-provider.mjs.map +1 -0
  86. package/dist/enums/password-hash.d.mts +15 -0
  87. package/dist/enums/password-hash.d.ts +15 -0
  88. package/dist/enums/password-hash.js +20 -0
  89. package/dist/enums/password-hash.js.map +1 -0
  90. package/dist/enums/password-hash.mjs +19 -0
  91. package/dist/enums/password-hash.mjs.map +1 -0
  92. package/dist/enums/relation-mutate.d.mts +7 -0
  93. package/dist/enums/relation-mutate.d.ts +7 -0
  94. package/dist/enums/relation-mutate.js +12 -0
  95. package/dist/enums/relation-mutate.js.map +1 -0
  96. package/dist/enums/relation-mutate.mjs +11 -0
  97. package/dist/enums/relation-mutate.mjs.map +1 -0
  98. package/dist/enums/relationship-type.d.mts +8 -0
  99. package/dist/enums/relationship-type.d.ts +8 -0
  100. package/dist/enums/relationship-type.js +13 -0
  101. package/dist/enums/relationship-type.js.map +1 -0
  102. package/dist/enums/relationship-type.mjs +12 -0
  103. package/dist/enums/relationship-type.mjs.map +1 -0
  104. package/dist/enums/runtime.d.mts +49 -0
  105. package/dist/enums/runtime.d.ts +49 -0
  106. package/dist/enums/runtime.js +54 -0
  107. package/dist/enums/runtime.js.map +1 -0
  108. package/dist/enums/runtime.mjs +53 -0
  109. package/dist/enums/runtime.mjs.map +1 -0
  110. package/dist/enums/smtp-encryption.d.mts +7 -0
  111. package/dist/enums/smtp-encryption.d.ts +7 -0
  112. package/dist/enums/smtp-encryption.js +12 -0
  113. package/dist/enums/smtp-encryption.js.map +1 -0
  114. package/dist/enums/smtp-encryption.mjs +11 -0
  115. package/dist/enums/smtp-encryption.mjs.map +1 -0
  116. package/dist/id.d.mts +7 -0
  117. package/dist/id.d.ts +7 -0
  118. package/dist/id.js +29 -0
  119. package/dist/id.js.map +1 -0
  120. package/dist/id.mjs +28 -0
  121. package/dist/id.mjs.map +1 -0
  122. package/dist/index.d.mts +35 -0
  123. package/dist/index.d.ts +35 -0
  124. package/dist/index.js +180 -0
  125. package/dist/index.js.map +1 -0
  126. package/dist/index.mjs +35 -0
  127. package/dist/index.mjs.map +1 -0
  128. package/dist/inputFile.d.mts +9 -0
  129. package/dist/inputFile.d.ts +9 -0
  130. package/dist/inputFile.js +23 -0
  131. package/dist/inputFile.js.map +1 -0
  132. package/dist/inputFile.mjs +22 -0
  133. package/dist/inputFile.mjs.map +1 -0
  134. package/dist/models.d.mts +2414 -0
  135. package/dist/models.d.ts +2414 -0
  136. package/dist/models.js +4 -0
  137. package/dist/models.js.map +1 -0
  138. package/dist/models.mjs +3 -0
  139. package/dist/models.mjs.map +1 -0
  140. package/dist/permission.d.mts +9 -0
  141. package/dist/permission.d.ts +9 -0
  142. package/dist/permission.js +23 -0
  143. package/dist/permission.js.map +1 -0
  144. package/dist/permission.mjs +22 -0
  145. package/dist/permission.mjs.map +1 -0
  146. package/dist/query.d.mts +35 -0
  147. package/dist/query.d.ts +35 -0
  148. package/dist/query.js +49 -0
  149. package/dist/query.js.map +1 -0
  150. package/dist/query.mjs +48 -0
  151. package/dist/query.mjs.map +1 -0
  152. package/{lib/role.js → dist/role.d.mts} +18 -48
  153. package/dist/role.d.ts +72 -0
  154. package/dist/role.js +96 -0
  155. package/dist/role.js.map +1 -0
  156. package/dist/role.mjs +95 -0
  157. package/dist/role.mjs.map +1 -0
  158. package/dist/services/account.d.mts +478 -0
  159. package/dist/services/account.d.ts +478 -0
  160. package/dist/services/account.js +1331 -0
  161. package/dist/services/account.js.map +1 -0
  162. package/dist/services/account.mjs +1330 -0
  163. package/dist/services/account.mjs.map +1 -0
  164. package/dist/services/avatars.d.mts +118 -0
  165. package/dist/services/avatars.d.ts +118 -0
  166. package/dist/services/avatars.js +297 -0
  167. package/dist/services/avatars.js.map +1 -0
  168. package/dist/services/avatars.mjs +296 -0
  169. package/dist/services/avatars.mjs.map +1 -0
  170. package/dist/services/databases.d.mts +606 -0
  171. package/dist/services/databases.d.ts +606 -0
  172. package/dist/services/databases.js +1908 -0
  173. package/dist/services/databases.js.map +1 -0
  174. package/dist/services/databases.mjs +1907 -0
  175. package/dist/services/databases.mjs.map +1 -0
  176. package/dist/services/functions.d.mts +287 -0
  177. package/dist/services/functions.d.ts +287 -0
  178. package/dist/services/functions.js +837 -0
  179. package/dist/services/functions.js.map +1 -0
  180. package/dist/services/functions.mjs +836 -0
  181. package/dist/services/functions.mjs.map +1 -0
  182. package/dist/services/graphql.d.mts +30 -0
  183. package/dist/services/graphql.d.ts +30 -0
  184. package/dist/services/graphql.js +73 -0
  185. package/dist/services/graphql.js.map +1 -0
  186. package/dist/services/graphql.mjs +72 -0
  187. package/dist/services/graphql.mjs.map +1 -0
  188. package/dist/services/health.d.mts +235 -0
  189. package/dist/services/health.d.ts +235 -0
  190. package/dist/services/health.js +584 -0
  191. package/dist/services/health.js.map +1 -0
  192. package/dist/services/health.mjs +583 -0
  193. package/dist/services/health.mjs.map +1 -0
  194. package/dist/services/locale.d.mts +84 -0
  195. package/dist/services/locale.d.ts +84 -0
  196. package/dist/services/locale.js +189 -0
  197. package/dist/services/locale.js.map +1 -0
  198. package/dist/services/locale.mjs +188 -0
  199. package/dist/services/locale.mjs.map +1 -0
  200. package/dist/services/messaging.d.mts +689 -0
  201. package/dist/services/messaging.d.ts +689 -0
  202. package/dist/services/messaging.js +2156 -0
  203. package/dist/services/messaging.js.map +1 -0
  204. package/dist/services/messaging.mjs +2155 -0
  205. package/dist/services/messaging.mjs.map +1 -0
  206. package/dist/services/storage.d.mts +193 -0
  207. package/dist/services/storage.d.ts +193 -0
  208. package/dist/services/storage.js +550 -0
  209. package/dist/services/storage.js.map +1 -0
  210. package/dist/services/storage.mjs +549 -0
  211. package/dist/services/storage.mjs.map +1 -0
  212. package/dist/services/teams.d.mts +171 -0
  213. package/dist/services/teams.d.ts +171 -0
  214. package/dist/services/teams.js +466 -0
  215. package/dist/services/teams.js.map +1 -0
  216. package/dist/services/teams.mjs +465 -0
  217. package/dist/services/teams.mjs.map +1 -0
  218. package/dist/services/users.d.mts +491 -0
  219. package/dist/services/users.d.ts +491 -0
  220. package/dist/services/users.js +1465 -0
  221. package/dist/services/users.js.map +1 -0
  222. package/dist/services/users.mjs +1464 -0
  223. package/dist/services/users.mjs.map +1 -0
  224. package/package.json +39 -5
  225. package/.github/ISSUE_TEMPLATE/bug.yaml +0 -82
  226. package/.github/ISSUE_TEMPLATE/documentation.yaml +0 -32
  227. package/.github/ISSUE_TEMPLATE/feature.yaml +0 -40
  228. package/.travis.yml +0 -25
  229. package/CHANGELOG.md +0 -1
  230. package/docs/examples/account/create-anonymous-session.md +0 -9
  231. package/docs/examples/account/create-email-password-session.md +0 -12
  232. package/docs/examples/account/create-email-token.md +0 -13
  233. package/docs/examples/account/create-j-w-t.md +0 -9
  234. package/docs/examples/account/create-magic-u-r-l-token.md +0 -14
  235. package/docs/examples/account/create-mfa-authenticator.md +0 -12
  236. package/docs/examples/account/create-mfa-challenge.md +0 -11
  237. package/docs/examples/account/create-mfa-recovery-codes.md +0 -10
  238. package/docs/examples/account/create-o-auth2token.md +0 -14
  239. package/docs/examples/account/create-phone-token.md +0 -12
  240. package/docs/examples/account/create-phone-verification.md +0 -10
  241. package/docs/examples/account/create-recovery.md +0 -13
  242. package/docs/examples/account/create-session.md +0 -12
  243. package/docs/examples/account/create-verification.md +0 -12
  244. package/docs/examples/account/create.md +0 -14
  245. package/docs/examples/account/delete-identity.md +0 -12
  246. package/docs/examples/account/delete-mfa-authenticator.md +0 -13
  247. package/docs/examples/account/delete-session.md +0 -12
  248. package/docs/examples/account/delete-sessions.md +0 -10
  249. package/docs/examples/account/get-mfa-recovery-codes.md +0 -10
  250. package/docs/examples/account/get-prefs.md +0 -10
  251. package/docs/examples/account/get-session.md +0 -12
  252. package/docs/examples/account/get.md +0 -10
  253. package/docs/examples/account/list-identities.md +0 -12
  254. package/docs/examples/account/list-logs.md +0 -12
  255. package/docs/examples/account/list-mfa-factors.md +0 -10
  256. package/docs/examples/account/list-sessions.md +0 -10
  257. package/docs/examples/account/update-email.md +0 -13
  258. package/docs/examples/account/update-m-f-a.md +0 -12
  259. package/docs/examples/account/update-magic-u-r-l-session.md +0 -12
  260. package/docs/examples/account/update-mfa-authenticator.md +0 -13
  261. package/docs/examples/account/update-mfa-challenge.md +0 -13
  262. package/docs/examples/account/update-mfa-recovery-codes.md +0 -10
  263. package/docs/examples/account/update-name.md +0 -12
  264. package/docs/examples/account/update-password.md +0 -13
  265. package/docs/examples/account/update-phone-session.md +0 -12
  266. package/docs/examples/account/update-phone-verification.md +0 -13
  267. package/docs/examples/account/update-phone.md +0 -13
  268. package/docs/examples/account/update-prefs.md +0 -12
  269. package/docs/examples/account/update-recovery.md +0 -14
  270. package/docs/examples/account/update-session.md +0 -12
  271. package/docs/examples/account/update-status.md +0 -10
  272. package/docs/examples/account/update-verification.md +0 -13
  273. package/docs/examples/avatars/get-browser.md +0 -15
  274. package/docs/examples/avatars/get-credit-card.md +0 -15
  275. package/docs/examples/avatars/get-favicon.md +0 -12
  276. package/docs/examples/avatars/get-flag.md +0 -15
  277. package/docs/examples/avatars/get-image.md +0 -14
  278. package/docs/examples/avatars/get-initials.md +0 -15
  279. package/docs/examples/avatars/get-q-r.md +0 -15
  280. package/docs/examples/databases/create-boolean-attribute.md +0 -17
  281. package/docs/examples/databases/create-collection.md +0 -17
  282. package/docs/examples/databases/create-datetime-attribute.md +0 -17
  283. package/docs/examples/databases/create-document.md +0 -16
  284. package/docs/examples/databases/create-email-attribute.md +0 -17
  285. package/docs/examples/databases/create-enum-attribute.md +0 -18
  286. package/docs/examples/databases/create-float-attribute.md +0 -19
  287. package/docs/examples/databases/create-index.md +0 -17
  288. package/docs/examples/databases/create-integer-attribute.md +0 -19
  289. package/docs/examples/databases/create-ip-attribute.md +0 -17
  290. package/docs/examples/databases/create-relationship-attribute.md +0 -19
  291. package/docs/examples/databases/create-string-attribute.md +0 -19
  292. package/docs/examples/databases/create-url-attribute.md +0 -17
  293. package/docs/examples/databases/create.md +0 -14
  294. package/docs/examples/databases/delete-attribute.md +0 -14
  295. package/docs/examples/databases/delete-collection.md +0 -13
  296. package/docs/examples/databases/delete-document.md +0 -14
  297. package/docs/examples/databases/delete-index.md +0 -14
  298. package/docs/examples/databases/delete.md +0 -12
  299. package/docs/examples/databases/get-attribute.md +0 -14
  300. package/docs/examples/databases/get-collection.md +0 -13
  301. package/docs/examples/databases/get-document.md +0 -15
  302. package/docs/examples/databases/get-index.md +0 -14
  303. package/docs/examples/databases/get.md +0 -12
  304. package/docs/examples/databases/list-attributes.md +0 -14
  305. package/docs/examples/databases/list-collections.md +0 -14
  306. package/docs/examples/databases/list-documents.md +0 -14
  307. package/docs/examples/databases/list-indexes.md +0 -14
  308. package/docs/examples/databases/list.md +0 -13
  309. package/docs/examples/databases/update-boolean-attribute.md +0 -16
  310. package/docs/examples/databases/update-collection.md +0 -17
  311. package/docs/examples/databases/update-datetime-attribute.md +0 -16
  312. package/docs/examples/databases/update-document.md +0 -16
  313. package/docs/examples/databases/update-email-attribute.md +0 -16
  314. package/docs/examples/databases/update-enum-attribute.md +0 -17
  315. package/docs/examples/databases/update-float-attribute.md +0 -18
  316. package/docs/examples/databases/update-integer-attribute.md +0 -18
  317. package/docs/examples/databases/update-ip-attribute.md +0 -16
  318. package/docs/examples/databases/update-relationship-attribute.md +0 -15
  319. package/docs/examples/databases/update-string-attribute.md +0 -16
  320. package/docs/examples/databases/update-url-attribute.md +0 -16
  321. package/docs/examples/databases/update.md +0 -14
  322. package/docs/examples/functions/create-build.md +0 -14
  323. package/docs/examples/functions/create-deployment.md +0 -17
  324. package/docs/examples/functions/create-execution.md +0 -17
  325. package/docs/examples/functions/create-variable.md +0 -14
  326. package/docs/examples/functions/create.md +0 -31
  327. package/docs/examples/functions/delete-deployment.md +0 -13
  328. package/docs/examples/functions/delete-variable.md +0 -13
  329. package/docs/examples/functions/delete.md +0 -12
  330. package/docs/examples/functions/download-deployment.md +0 -13
  331. package/docs/examples/functions/get-deployment.md +0 -13
  332. package/docs/examples/functions/get-execution.md +0 -13
  333. package/docs/examples/functions/get-variable.md +0 -13
  334. package/docs/examples/functions/get.md +0 -12
  335. package/docs/examples/functions/list-deployments.md +0 -14
  336. package/docs/examples/functions/list-executions.md +0 -14
  337. package/docs/examples/functions/list-runtimes.md +0 -10
  338. package/docs/examples/functions/list-variables.md +0 -12
  339. package/docs/examples/functions/list.md +0 -13
  340. package/docs/examples/functions/update-deployment.md +0 -13
  341. package/docs/examples/functions/update-variable.md +0 -15
  342. package/docs/examples/functions/update.md +0 -27
  343. package/docs/examples/graphql/mutation.md +0 -12
  344. package/docs/examples/graphql/query.md +0 -12
  345. package/docs/examples/health/get-antivirus.md +0 -10
  346. package/docs/examples/health/get-cache.md +0 -10
  347. package/docs/examples/health/get-certificate.md +0 -12
  348. package/docs/examples/health/get-d-b.md +0 -10
  349. package/docs/examples/health/get-failed-jobs.md +0 -13
  350. package/docs/examples/health/get-pub-sub.md +0 -10
  351. package/docs/examples/health/get-queue-builds.md +0 -12
  352. package/docs/examples/health/get-queue-certificates.md +0 -12
  353. package/docs/examples/health/get-queue-databases.md +0 -13
  354. package/docs/examples/health/get-queue-deletes.md +0 -12
  355. package/docs/examples/health/get-queue-functions.md +0 -12
  356. package/docs/examples/health/get-queue-logs.md +0 -12
  357. package/docs/examples/health/get-queue-mails.md +0 -12
  358. package/docs/examples/health/get-queue-messaging.md +0 -12
  359. package/docs/examples/health/get-queue-migrations.md +0 -12
  360. package/docs/examples/health/get-queue-usage-dump.md +0 -12
  361. package/docs/examples/health/get-queue-usage.md +0 -12
  362. package/docs/examples/health/get-queue-webhooks.md +0 -12
  363. package/docs/examples/health/get-queue.md +0 -10
  364. package/docs/examples/health/get-storage-local.md +0 -10
  365. package/docs/examples/health/get-storage.md +0 -10
  366. package/docs/examples/health/get-time.md +0 -10
  367. package/docs/examples/health/get.md +0 -10
  368. package/docs/examples/locale/get.md +0 -10
  369. package/docs/examples/locale/list-codes.md +0 -10
  370. package/docs/examples/locale/list-continents.md +0 -10
  371. package/docs/examples/locale/list-countries-e-u.md +0 -10
  372. package/docs/examples/locale/list-countries-phones.md +0 -10
  373. package/docs/examples/locale/list-countries.md +0 -10
  374. package/docs/examples/locale/list-currencies.md +0 -10
  375. package/docs/examples/locale/list-languages.md +0 -10
  376. package/docs/examples/messaging/create-apns-provider.md +0 -19
  377. package/docs/examples/messaging/create-email.md +0 -23
  378. package/docs/examples/messaging/create-fcm-provider.md +0 -15
  379. package/docs/examples/messaging/create-mailgun-provider.md +0 -21
  380. package/docs/examples/messaging/create-msg91provider.md +0 -17
  381. package/docs/examples/messaging/create-push.md +0 -27
  382. package/docs/examples/messaging/create-sendgrid-provider.md +0 -19
  383. package/docs/examples/messaging/create-sms.md +0 -18
  384. package/docs/examples/messaging/create-smtp-provider.md +0 -25
  385. package/docs/examples/messaging/create-subscriber.md +0 -14
  386. package/docs/examples/messaging/create-telesign-provider.md +0 -17
  387. package/docs/examples/messaging/create-textmagic-provider.md +0 -17
  388. package/docs/examples/messaging/create-topic.md +0 -14
  389. package/docs/examples/messaging/create-twilio-provider.md +0 -17
  390. package/docs/examples/messaging/create-vonage-provider.md +0 -17
  391. package/docs/examples/messaging/delete-provider.md +0 -12
  392. package/docs/examples/messaging/delete-subscriber.md +0 -13
  393. package/docs/examples/messaging/delete-topic.md +0 -12
  394. package/docs/examples/messaging/delete.md +0 -12
  395. package/docs/examples/messaging/get-message.md +0 -12
  396. package/docs/examples/messaging/get-provider.md +0 -12
  397. package/docs/examples/messaging/get-subscriber.md +0 -13
  398. package/docs/examples/messaging/get-topic.md +0 -12
  399. package/docs/examples/messaging/list-message-logs.md +0 -13
  400. package/docs/examples/messaging/list-messages.md +0 -13
  401. package/docs/examples/messaging/list-provider-logs.md +0 -13
  402. package/docs/examples/messaging/list-providers.md +0 -13
  403. package/docs/examples/messaging/list-subscriber-logs.md +0 -13
  404. package/docs/examples/messaging/list-subscribers.md +0 -14
  405. package/docs/examples/messaging/list-targets.md +0 -13
  406. package/docs/examples/messaging/list-topic-logs.md +0 -13
  407. package/docs/examples/messaging/list-topics.md +0 -13
  408. package/docs/examples/messaging/update-apns-provider.md +0 -19
  409. package/docs/examples/messaging/update-email.md +0 -22
  410. package/docs/examples/messaging/update-fcm-provider.md +0 -15
  411. package/docs/examples/messaging/update-mailgun-provider.md +0 -21
  412. package/docs/examples/messaging/update-msg91provider.md +0 -17
  413. package/docs/examples/messaging/update-push.md +0 -27
  414. package/docs/examples/messaging/update-sendgrid-provider.md +0 -19
  415. package/docs/examples/messaging/update-sms.md +0 -18
  416. package/docs/examples/messaging/update-smtp-provider.md +0 -25
  417. package/docs/examples/messaging/update-telesign-provider.md +0 -17
  418. package/docs/examples/messaging/update-textmagic-provider.md +0 -17
  419. package/docs/examples/messaging/update-topic.md +0 -14
  420. package/docs/examples/messaging/update-twilio-provider.md +0 -17
  421. package/docs/examples/messaging/update-vonage-provider.md +0 -17
  422. package/docs/examples/storage/create-bucket.md +0 -21
  423. package/docs/examples/storage/create-file.md +0 -16
  424. package/docs/examples/storage/delete-bucket.md +0 -12
  425. package/docs/examples/storage/delete-file.md +0 -13
  426. package/docs/examples/storage/get-bucket.md +0 -12
  427. package/docs/examples/storage/get-file-download.md +0 -13
  428. package/docs/examples/storage/get-file-preview.md +0 -24
  429. package/docs/examples/storage/get-file-view.md +0 -13
  430. package/docs/examples/storage/get-file.md +0 -13
  431. package/docs/examples/storage/list-buckets.md +0 -13
  432. package/docs/examples/storage/list-files.md +0 -14
  433. package/docs/examples/storage/update-bucket.md +0 -21
  434. package/docs/examples/storage/update-file.md +0 -15
  435. package/docs/examples/teams/create-membership.md +0 -18
  436. package/docs/examples/teams/create.md +0 -14
  437. package/docs/examples/teams/delete-membership.md +0 -13
  438. package/docs/examples/teams/delete.md +0 -12
  439. package/docs/examples/teams/get-membership.md +0 -13
  440. package/docs/examples/teams/get-prefs.md +0 -12
  441. package/docs/examples/teams/get.md +0 -12
  442. package/docs/examples/teams/list-memberships.md +0 -14
  443. package/docs/examples/teams/list.md +0 -13
  444. package/docs/examples/teams/update-membership-status.md +0 -15
  445. package/docs/examples/teams/update-membership.md +0 -14
  446. package/docs/examples/teams/update-name.md +0 -13
  447. package/docs/examples/teams/update-prefs.md +0 -13
  448. package/docs/examples/users/create-argon2user.md +0 -15
  449. package/docs/examples/users/create-bcrypt-user.md +0 -15
  450. package/docs/examples/users/create-m-d5user.md +0 -15
  451. package/docs/examples/users/create-mfa-recovery-codes.md +0 -12
  452. package/docs/examples/users/create-p-h-pass-user.md +0 -15
  453. package/docs/examples/users/create-s-h-a-user.md +0 -16
  454. package/docs/examples/users/create-scrypt-modified-user.md +0 -18
  455. package/docs/examples/users/create-scrypt-user.md +0 -20
  456. package/docs/examples/users/create-session.md +0 -12
  457. package/docs/examples/users/create-target.md +0 -17
  458. package/docs/examples/users/create-token.md +0 -14
  459. package/docs/examples/users/create.md +0 -16
  460. package/docs/examples/users/delete-identity.md +0 -12
  461. package/docs/examples/users/delete-mfa-authenticator.md +0 -13
  462. package/docs/examples/users/delete-session.md +0 -13
  463. package/docs/examples/users/delete-sessions.md +0 -12
  464. package/docs/examples/users/delete-target.md +0 -13
  465. package/docs/examples/users/delete.md +0 -12
  466. package/docs/examples/users/get-mfa-recovery-codes.md +0 -12
  467. package/docs/examples/users/get-prefs.md +0 -12
  468. package/docs/examples/users/get-target.md +0 -13
  469. package/docs/examples/users/get.md +0 -12
  470. package/docs/examples/users/list-identities.md +0 -13
  471. package/docs/examples/users/list-logs.md +0 -13
  472. package/docs/examples/users/list-memberships.md +0 -12
  473. package/docs/examples/users/list-mfa-factors.md +0 -12
  474. package/docs/examples/users/list-sessions.md +0 -12
  475. package/docs/examples/users/list-targets.md +0 -13
  476. package/docs/examples/users/list.md +0 -13
  477. package/docs/examples/users/update-email-verification.md +0 -13
  478. package/docs/examples/users/update-email.md +0 -13
  479. package/docs/examples/users/update-labels.md +0 -13
  480. package/docs/examples/users/update-mfa-recovery-codes.md +0 -12
  481. package/docs/examples/users/update-mfa.md +0 -13
  482. package/docs/examples/users/update-name.md +0 -13
  483. package/docs/examples/users/update-password.md +0 -13
  484. package/docs/examples/users/update-phone-verification.md +0 -13
  485. package/docs/examples/users/update-phone.md +0 -13
  486. package/docs/examples/users/update-prefs.md +0 -13
  487. package/docs/examples/users/update-status.md +0 -13
  488. package/docs/examples/users/update-target.md +0 -16
  489. package/index.d.ts +0 -6656
  490. package/index.js +0 -75
  491. package/lib/client.js +0 -245
  492. package/lib/enums/authentication-factor.js +0 -8
  493. package/lib/enums/authenticator-type.js +0 -5
  494. package/lib/enums/browser.js +0 -18
  495. package/lib/enums/compression.js +0 -7
  496. package/lib/enums/credit-card.js +0 -20
  497. package/lib/enums/execution-method.js +0 -10
  498. package/lib/enums/flag.js +0 -198
  499. package/lib/enums/image-format.js +0 -9
  500. package/lib/enums/image-gravity.js +0 -13
  501. package/lib/enums/index-type.js +0 -7
  502. package/lib/enums/messaging-provider-type.js +0 -7
  503. package/lib/enums/name.js +0 -17
  504. package/lib/enums/o-auth-provider.js +0 -43
  505. package/lib/enums/password-hash.js +0 -15
  506. package/lib/enums/relation-mutate.js +0 -7
  507. package/lib/enums/relationship-type.js +0 -8
  508. package/lib/enums/runtime.js +0 -48
  509. package/lib/enums/smtp-encryption.js +0 -7
  510. package/lib/exception.js +0 -10
  511. package/lib/id.js +0 -32
  512. package/lib/inputFile.js +0 -117
  513. package/lib/permission.js +0 -24
  514. package/lib/query.js +0 -90
  515. package/lib/service.js +0 -10
  516. package/lib/services/account.js +0 -1365
  517. package/lib/services/avatars.js +0 -325
  518. package/lib/services/databases.js +0 -1987
  519. package/lib/services/functions.js +0 -930
  520. package/lib/services/graphql.js +0 -74
  521. package/lib/services/health.js +0 -513
  522. package/lib/services/locale.js +0 -169
  523. package/lib/services/messaging.js +0 -2218
  524. package/lib/services/storage.js +0 -663
  525. package/lib/services/teams.js +0 -479
  526. package/lib/services/users.js +0 -1463
@@ -0,0 +1,837 @@
1
+ 'use strict';
2
+
3
+ var client = require('../client');
4
+
5
+ class Functions {
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ /**
10
+ * List functions
11
+ *
12
+ * Get a list of all the project's functions. You can use the query params to filter your results.
13
+ *
14
+ * @param {string[]} queries
15
+ * @param {string} search
16
+ * @throws {AppwriteException}
17
+ * @returns {Promise<Models.FunctionList>}
18
+ */
19
+ async list(queries, search) {
20
+ const apiPath = "/functions";
21
+ const payload = {};
22
+ if (typeof queries !== "undefined") {
23
+ payload["queries"] = queries;
24
+ }
25
+ if (typeof search !== "undefined") {
26
+ payload["search"] = search;
27
+ }
28
+ const uri = new URL(this.client.config.endpoint + apiPath);
29
+ const apiHeaders = {
30
+ "content-type": "application/json"
31
+ };
32
+ return await this.client.call(
33
+ "get",
34
+ uri,
35
+ apiHeaders,
36
+ payload
37
+ );
38
+ }
39
+ /**
40
+ * Create function
41
+ *
42
+ * 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.
43
+ *
44
+ * @param {string} functionId
45
+ * @param {string} name
46
+ * @param {Runtime} runtime
47
+ * @param {string[]} execute
48
+ * @param {string[]} events
49
+ * @param {string} schedule
50
+ * @param {number} timeout
51
+ * @param {boolean} enabled
52
+ * @param {boolean} logging
53
+ * @param {string} entrypoint
54
+ * @param {string} commands
55
+ * @param {string} installationId
56
+ * @param {string} providerRepositoryId
57
+ * @param {string} providerBranch
58
+ * @param {boolean} providerSilentMode
59
+ * @param {string} providerRootDirectory
60
+ * @param {string} templateRepository
61
+ * @param {string} templateOwner
62
+ * @param {string} templateRootDirectory
63
+ * @param {string} templateBranch
64
+ * @throws {AppwriteException}
65
+ * @returns {Promise<Models.Function>}
66
+ */
67
+ async create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, templateRepository, templateOwner, templateRootDirectory, templateBranch) {
68
+ if (typeof functionId === "undefined") {
69
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
70
+ }
71
+ if (typeof name === "undefined") {
72
+ throw new client.AppwriteException('Missing required parameter: "name"');
73
+ }
74
+ if (typeof runtime === "undefined") {
75
+ throw new client.AppwriteException('Missing required parameter: "runtime"');
76
+ }
77
+ const apiPath = "/functions";
78
+ const payload = {};
79
+ if (typeof functionId !== "undefined") {
80
+ payload["functionId"] = functionId;
81
+ }
82
+ if (typeof name !== "undefined") {
83
+ payload["name"] = name;
84
+ }
85
+ if (typeof runtime !== "undefined") {
86
+ payload["runtime"] = runtime;
87
+ }
88
+ if (typeof execute !== "undefined") {
89
+ payload["execute"] = execute;
90
+ }
91
+ if (typeof events !== "undefined") {
92
+ payload["events"] = events;
93
+ }
94
+ if (typeof schedule !== "undefined") {
95
+ payload["schedule"] = schedule;
96
+ }
97
+ if (typeof timeout !== "undefined") {
98
+ payload["timeout"] = timeout;
99
+ }
100
+ if (typeof enabled !== "undefined") {
101
+ payload["enabled"] = enabled;
102
+ }
103
+ if (typeof logging !== "undefined") {
104
+ payload["logging"] = logging;
105
+ }
106
+ if (typeof entrypoint !== "undefined") {
107
+ payload["entrypoint"] = entrypoint;
108
+ }
109
+ if (typeof commands !== "undefined") {
110
+ payload["commands"] = commands;
111
+ }
112
+ if (typeof installationId !== "undefined") {
113
+ payload["installationId"] = installationId;
114
+ }
115
+ if (typeof providerRepositoryId !== "undefined") {
116
+ payload["providerRepositoryId"] = providerRepositoryId;
117
+ }
118
+ if (typeof providerBranch !== "undefined") {
119
+ payload["providerBranch"] = providerBranch;
120
+ }
121
+ if (typeof providerSilentMode !== "undefined") {
122
+ payload["providerSilentMode"] = providerSilentMode;
123
+ }
124
+ if (typeof providerRootDirectory !== "undefined") {
125
+ payload["providerRootDirectory"] = providerRootDirectory;
126
+ }
127
+ if (typeof templateRepository !== "undefined") {
128
+ payload["templateRepository"] = templateRepository;
129
+ }
130
+ if (typeof templateOwner !== "undefined") {
131
+ payload["templateOwner"] = templateOwner;
132
+ }
133
+ if (typeof templateRootDirectory !== "undefined") {
134
+ payload["templateRootDirectory"] = templateRootDirectory;
135
+ }
136
+ if (typeof templateBranch !== "undefined") {
137
+ payload["templateBranch"] = templateBranch;
138
+ }
139
+ const uri = new URL(this.client.config.endpoint + apiPath);
140
+ const apiHeaders = {
141
+ "content-type": "application/json"
142
+ };
143
+ return await this.client.call(
144
+ "post",
145
+ uri,
146
+ apiHeaders,
147
+ payload
148
+ );
149
+ }
150
+ /**
151
+ * List runtimes
152
+ *
153
+ * Get a list of all runtimes that are currently active on your instance.
154
+ *
155
+ * @throws {AppwriteException}
156
+ * @returns {Promise<Models.RuntimeList>}
157
+ */
158
+ async listRuntimes() {
159
+ const apiPath = "/functions/runtimes";
160
+ const payload = {};
161
+ const uri = new URL(this.client.config.endpoint + apiPath);
162
+ const apiHeaders = {
163
+ "content-type": "application/json"
164
+ };
165
+ return await this.client.call(
166
+ "get",
167
+ uri,
168
+ apiHeaders,
169
+ payload
170
+ );
171
+ }
172
+ /**
173
+ * Get function
174
+ *
175
+ * Get a function by its unique ID.
176
+ *
177
+ * @param {string} functionId
178
+ * @throws {AppwriteException}
179
+ * @returns {Promise<Models.Function>}
180
+ */
181
+ async get(functionId) {
182
+ if (typeof functionId === "undefined") {
183
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
184
+ }
185
+ const apiPath = "/functions/{functionId}".replace("{functionId}", functionId);
186
+ const payload = {};
187
+ const uri = new URL(this.client.config.endpoint + apiPath);
188
+ const apiHeaders = {
189
+ "content-type": "application/json"
190
+ };
191
+ return await this.client.call(
192
+ "get",
193
+ uri,
194
+ apiHeaders,
195
+ payload
196
+ );
197
+ }
198
+ /**
199
+ * Update function
200
+ *
201
+ * Update function by its unique ID.
202
+ *
203
+ * @param {string} functionId
204
+ * @param {string} name
205
+ * @param {Runtime} runtime
206
+ * @param {string[]} execute
207
+ * @param {string[]} events
208
+ * @param {string} schedule
209
+ * @param {number} timeout
210
+ * @param {boolean} enabled
211
+ * @param {boolean} logging
212
+ * @param {string} entrypoint
213
+ * @param {string} commands
214
+ * @param {string} installationId
215
+ * @param {string} providerRepositoryId
216
+ * @param {string} providerBranch
217
+ * @param {boolean} providerSilentMode
218
+ * @param {string} providerRootDirectory
219
+ * @throws {AppwriteException}
220
+ * @returns {Promise<Models.Function>}
221
+ */
222
+ async update(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory) {
223
+ if (typeof functionId === "undefined") {
224
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
225
+ }
226
+ if (typeof name === "undefined") {
227
+ throw new client.AppwriteException('Missing required parameter: "name"');
228
+ }
229
+ const apiPath = "/functions/{functionId}".replace("{functionId}", functionId);
230
+ const payload = {};
231
+ if (typeof name !== "undefined") {
232
+ payload["name"] = name;
233
+ }
234
+ if (typeof runtime !== "undefined") {
235
+ payload["runtime"] = runtime;
236
+ }
237
+ if (typeof execute !== "undefined") {
238
+ payload["execute"] = execute;
239
+ }
240
+ if (typeof events !== "undefined") {
241
+ payload["events"] = events;
242
+ }
243
+ if (typeof schedule !== "undefined") {
244
+ payload["schedule"] = schedule;
245
+ }
246
+ if (typeof timeout !== "undefined") {
247
+ payload["timeout"] = timeout;
248
+ }
249
+ if (typeof enabled !== "undefined") {
250
+ payload["enabled"] = enabled;
251
+ }
252
+ if (typeof logging !== "undefined") {
253
+ payload["logging"] = logging;
254
+ }
255
+ if (typeof entrypoint !== "undefined") {
256
+ payload["entrypoint"] = entrypoint;
257
+ }
258
+ if (typeof commands !== "undefined") {
259
+ payload["commands"] = commands;
260
+ }
261
+ if (typeof installationId !== "undefined") {
262
+ payload["installationId"] = installationId;
263
+ }
264
+ if (typeof providerRepositoryId !== "undefined") {
265
+ payload["providerRepositoryId"] = providerRepositoryId;
266
+ }
267
+ if (typeof providerBranch !== "undefined") {
268
+ payload["providerBranch"] = providerBranch;
269
+ }
270
+ if (typeof providerSilentMode !== "undefined") {
271
+ payload["providerSilentMode"] = providerSilentMode;
272
+ }
273
+ if (typeof providerRootDirectory !== "undefined") {
274
+ payload["providerRootDirectory"] = providerRootDirectory;
275
+ }
276
+ const uri = new URL(this.client.config.endpoint + apiPath);
277
+ const apiHeaders = {
278
+ "content-type": "application/json"
279
+ };
280
+ return await this.client.call(
281
+ "put",
282
+ uri,
283
+ apiHeaders,
284
+ payload
285
+ );
286
+ }
287
+ /**
288
+ * Delete function
289
+ *
290
+ * Delete a function by its unique ID.
291
+ *
292
+ * @param {string} functionId
293
+ * @throws {AppwriteException}
294
+ * @returns {Promise<{}>}
295
+ */
296
+ async delete(functionId) {
297
+ if (typeof functionId === "undefined") {
298
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
299
+ }
300
+ const apiPath = "/functions/{functionId}".replace("{functionId}", functionId);
301
+ const payload = {};
302
+ const uri = new URL(this.client.config.endpoint + apiPath);
303
+ const apiHeaders = {
304
+ "content-type": "application/json"
305
+ };
306
+ return await this.client.call(
307
+ "delete",
308
+ uri,
309
+ apiHeaders,
310
+ payload
311
+ );
312
+ }
313
+ /**
314
+ * List deployments
315
+ *
316
+ * Get a list of all the project&#039;s code deployments. You can use the query params to filter your results.
317
+ *
318
+ * @param {string} functionId
319
+ * @param {string[]} queries
320
+ * @param {string} search
321
+ * @throws {AppwriteException}
322
+ * @returns {Promise<Models.DeploymentList>}
323
+ */
324
+ async listDeployments(functionId, queries, search) {
325
+ if (typeof functionId === "undefined") {
326
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
327
+ }
328
+ const apiPath = "/functions/{functionId}/deployments".replace("{functionId}", functionId);
329
+ const payload = {};
330
+ if (typeof queries !== "undefined") {
331
+ payload["queries"] = queries;
332
+ }
333
+ if (typeof search !== "undefined") {
334
+ payload["search"] = search;
335
+ }
336
+ const uri = new URL(this.client.config.endpoint + apiPath);
337
+ const apiHeaders = {
338
+ "content-type": "application/json"
339
+ };
340
+ return await this.client.call(
341
+ "get",
342
+ uri,
343
+ apiHeaders,
344
+ payload
345
+ );
346
+ }
347
+ /**
348
+ * Create deployment
349
+ *
350
+ * 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&#039;ll need to update the function&#039;s deployment to use your new deployment UID.
351
+
352
+ 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).
353
+
354
+ Use the &quot;command&quot; param to set the entrypoint used to execute your code.
355
+ *
356
+ * @param {string} functionId
357
+ * @param {File} code
358
+ * @param {boolean} activate
359
+ * @param {string} entrypoint
360
+ * @param {string} commands
361
+ * @throws {AppwriteException}
362
+ * @returns {Promise<Models.Deployment>}
363
+ */
364
+ async createDeployment(functionId, code, activate, entrypoint, commands, onProgress = (progress) => {
365
+ }) {
366
+ if (typeof functionId === "undefined") {
367
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
368
+ }
369
+ if (typeof code === "undefined") {
370
+ throw new client.AppwriteException('Missing required parameter: "code"');
371
+ }
372
+ if (typeof activate === "undefined") {
373
+ throw new client.AppwriteException('Missing required parameter: "activate"');
374
+ }
375
+ const apiPath = "/functions/{functionId}/deployments".replace("{functionId}", functionId);
376
+ const payload = {};
377
+ if (typeof entrypoint !== "undefined") {
378
+ payload["entrypoint"] = entrypoint;
379
+ }
380
+ if (typeof commands !== "undefined") {
381
+ payload["commands"] = commands;
382
+ }
383
+ if (typeof code !== "undefined") {
384
+ payload["code"] = code;
385
+ }
386
+ if (typeof activate !== "undefined") {
387
+ payload["activate"] = activate;
388
+ }
389
+ const uri = new URL(this.client.config.endpoint + apiPath);
390
+ const apiHeaders = {
391
+ "content-type": "multipart/form-data"
392
+ };
393
+ return await this.client.chunkedUpload(
394
+ "post",
395
+ uri,
396
+ apiHeaders,
397
+ payload,
398
+ onProgress
399
+ );
400
+ }
401
+ /**
402
+ * Get deployment
403
+ *
404
+ * Get a code deployment by its unique ID.
405
+ *
406
+ * @param {string} functionId
407
+ * @param {string} deploymentId
408
+ * @throws {AppwriteException}
409
+ * @returns {Promise<Models.Deployment>}
410
+ */
411
+ async getDeployment(functionId, deploymentId) {
412
+ if (typeof functionId === "undefined") {
413
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
414
+ }
415
+ if (typeof deploymentId === "undefined") {
416
+ throw new client.AppwriteException('Missing required parameter: "deploymentId"');
417
+ }
418
+ const apiPath = "/functions/{functionId}/deployments/{deploymentId}".replace("{functionId}", functionId).replace("{deploymentId}", deploymentId);
419
+ const payload = {};
420
+ const uri = new URL(this.client.config.endpoint + apiPath);
421
+ const apiHeaders = {
422
+ "content-type": "application/json"
423
+ };
424
+ return await this.client.call(
425
+ "get",
426
+ uri,
427
+ apiHeaders,
428
+ payload
429
+ );
430
+ }
431
+ /**
432
+ * Update function deployment
433
+ *
434
+ * Update the function code deployment ID using the unique function ID. Use this endpoint to switch the code deployment that should be executed by the execution endpoint.
435
+ *
436
+ * @param {string} functionId
437
+ * @param {string} deploymentId
438
+ * @throws {AppwriteException}
439
+ * @returns {Promise<Models.Function>}
440
+ */
441
+ async updateDeployment(functionId, deploymentId) {
442
+ if (typeof functionId === "undefined") {
443
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
444
+ }
445
+ if (typeof deploymentId === "undefined") {
446
+ throw new client.AppwriteException('Missing required parameter: "deploymentId"');
447
+ }
448
+ const apiPath = "/functions/{functionId}/deployments/{deploymentId}".replace("{functionId}", functionId).replace("{deploymentId}", deploymentId);
449
+ const payload = {};
450
+ const uri = new URL(this.client.config.endpoint + apiPath);
451
+ const apiHeaders = {
452
+ "content-type": "application/json"
453
+ };
454
+ return await this.client.call(
455
+ "patch",
456
+ uri,
457
+ apiHeaders,
458
+ payload
459
+ );
460
+ }
461
+ /**
462
+ * Delete deployment
463
+ *
464
+ * Delete a code deployment by its unique ID.
465
+ *
466
+ * @param {string} functionId
467
+ * @param {string} deploymentId
468
+ * @throws {AppwriteException}
469
+ * @returns {Promise<{}>}
470
+ */
471
+ async deleteDeployment(functionId, deploymentId) {
472
+ if (typeof functionId === "undefined") {
473
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
474
+ }
475
+ if (typeof deploymentId === "undefined") {
476
+ throw new client.AppwriteException('Missing required parameter: "deploymentId"');
477
+ }
478
+ const apiPath = "/functions/{functionId}/deployments/{deploymentId}".replace("{functionId}", functionId).replace("{deploymentId}", deploymentId);
479
+ const payload = {};
480
+ const uri = new URL(this.client.config.endpoint + apiPath);
481
+ const apiHeaders = {
482
+ "content-type": "application/json"
483
+ };
484
+ return await this.client.call(
485
+ "delete",
486
+ uri,
487
+ apiHeaders,
488
+ payload
489
+ );
490
+ }
491
+ /**
492
+ * Create build
493
+ *
494
+ * Create a new build for an Appwrite Function deployment. This endpoint can be used to retry a failed build.
495
+ *
496
+ * @param {string} functionId
497
+ * @param {string} deploymentId
498
+ * @param {string} buildId
499
+ * @throws {AppwriteException}
500
+ * @returns {Promise<{}>}
501
+ */
502
+ async createBuild(functionId, deploymentId, buildId) {
503
+ if (typeof functionId === "undefined") {
504
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
505
+ }
506
+ if (typeof deploymentId === "undefined") {
507
+ throw new client.AppwriteException('Missing required parameter: "deploymentId"');
508
+ }
509
+ if (typeof buildId === "undefined") {
510
+ throw new client.AppwriteException('Missing required parameter: "buildId"');
511
+ }
512
+ const apiPath = "/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}".replace("{functionId}", functionId).replace("{deploymentId}", deploymentId).replace("{buildId}", buildId);
513
+ const payload = {};
514
+ const uri = new URL(this.client.config.endpoint + apiPath);
515
+ const apiHeaders = {
516
+ "content-type": "application/json"
517
+ };
518
+ return await this.client.call(
519
+ "post",
520
+ uri,
521
+ apiHeaders,
522
+ payload
523
+ );
524
+ }
525
+ /**
526
+ * Download Deployment
527
+ *
528
+ * Get a Deployment&#039;s contents by its unique ID. This endpoint supports range requests for partial or streaming file download.
529
+ *
530
+ * @param {string} functionId
531
+ * @param {string} deploymentId
532
+ * @throws {AppwriteException}
533
+ * @returns {Promise<ArrayBuffer>}
534
+ */
535
+ async downloadDeployment(functionId, deploymentId) {
536
+ if (typeof functionId === "undefined") {
537
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
538
+ }
539
+ if (typeof deploymentId === "undefined") {
540
+ throw new client.AppwriteException('Missing required parameter: "deploymentId"');
541
+ }
542
+ const apiPath = "/functions/{functionId}/deployments/{deploymentId}/download".replace("{functionId}", functionId).replace("{deploymentId}", deploymentId);
543
+ const payload = {};
544
+ const uri = new URL(this.client.config.endpoint + apiPath);
545
+ const apiHeaders = {
546
+ "content-type": "application/json"
547
+ };
548
+ return await this.client.call(
549
+ "get",
550
+ uri,
551
+ apiHeaders,
552
+ payload,
553
+ "arrayBuffer"
554
+ );
555
+ }
556
+ /**
557
+ * List executions
558
+ *
559
+ * Get a list of all the current user function execution logs. You can use the query params to filter your results.
560
+ *
561
+ * @param {string} functionId
562
+ * @param {string[]} queries
563
+ * @param {string} search
564
+ * @throws {AppwriteException}
565
+ * @returns {Promise<Models.ExecutionList>}
566
+ */
567
+ async listExecutions(functionId, queries, search) {
568
+ if (typeof functionId === "undefined") {
569
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
570
+ }
571
+ const apiPath = "/functions/{functionId}/executions".replace("{functionId}", functionId);
572
+ const payload = {};
573
+ if (typeof queries !== "undefined") {
574
+ payload["queries"] = queries;
575
+ }
576
+ if (typeof search !== "undefined") {
577
+ payload["search"] = search;
578
+ }
579
+ const uri = new URL(this.client.config.endpoint + apiPath);
580
+ const apiHeaders = {
581
+ "content-type": "application/json"
582
+ };
583
+ return await this.client.call(
584
+ "get",
585
+ uri,
586
+ apiHeaders,
587
+ payload
588
+ );
589
+ }
590
+ /**
591
+ * Create execution
592
+ *
593
+ * 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.
594
+ *
595
+ * @param {string} functionId
596
+ * @param {string} body
597
+ * @param {boolean} async
598
+ * @param {string} xpath
599
+ * @param {ExecutionMethod} method
600
+ * @param {object} headers
601
+ * @throws {AppwriteException}
602
+ * @returns {Promise<Models.Execution>}
603
+ */
604
+ async createExecution(functionId, body, async, xpath, method, headers) {
605
+ if (typeof functionId === "undefined") {
606
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
607
+ }
608
+ const apiPath = "/functions/{functionId}/executions".replace("{functionId}", functionId);
609
+ const payload = {};
610
+ if (typeof body !== "undefined") {
611
+ payload["body"] = body;
612
+ }
613
+ if (typeof async !== "undefined") {
614
+ payload["async"] = async;
615
+ }
616
+ if (typeof xpath !== "undefined") {
617
+ payload["path"] = xpath;
618
+ }
619
+ if (typeof method !== "undefined") {
620
+ payload["method"] = method;
621
+ }
622
+ if (typeof headers !== "undefined") {
623
+ payload["headers"] = headers;
624
+ }
625
+ const uri = new URL(this.client.config.endpoint + apiPath);
626
+ const apiHeaders = {
627
+ "content-type": "application/json"
628
+ };
629
+ return await this.client.call(
630
+ "post",
631
+ uri,
632
+ apiHeaders,
633
+ payload
634
+ );
635
+ }
636
+ /**
637
+ * Get execution
638
+ *
639
+ * Get a function execution log by its unique ID.
640
+ *
641
+ * @param {string} functionId
642
+ * @param {string} executionId
643
+ * @throws {AppwriteException}
644
+ * @returns {Promise<Models.Execution>}
645
+ */
646
+ async getExecution(functionId, executionId) {
647
+ if (typeof functionId === "undefined") {
648
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
649
+ }
650
+ if (typeof executionId === "undefined") {
651
+ throw new client.AppwriteException('Missing required parameter: "executionId"');
652
+ }
653
+ const apiPath = "/functions/{functionId}/executions/{executionId}".replace("{functionId}", functionId).replace("{executionId}", executionId);
654
+ const payload = {};
655
+ const uri = new URL(this.client.config.endpoint + apiPath);
656
+ const apiHeaders = {
657
+ "content-type": "application/json"
658
+ };
659
+ return await this.client.call(
660
+ "get",
661
+ uri,
662
+ apiHeaders,
663
+ payload
664
+ );
665
+ }
666
+ /**
667
+ * List variables
668
+ *
669
+ * Get a list of all variables of a specific function.
670
+ *
671
+ * @param {string} functionId
672
+ * @throws {AppwriteException}
673
+ * @returns {Promise<Models.VariableList>}
674
+ */
675
+ async listVariables(functionId) {
676
+ if (typeof functionId === "undefined") {
677
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
678
+ }
679
+ const apiPath = "/functions/{functionId}/variables".replace("{functionId}", functionId);
680
+ const payload = {};
681
+ const uri = new URL(this.client.config.endpoint + apiPath);
682
+ const apiHeaders = {
683
+ "content-type": "application/json"
684
+ };
685
+ return await this.client.call(
686
+ "get",
687
+ uri,
688
+ apiHeaders,
689
+ payload
690
+ );
691
+ }
692
+ /**
693
+ * Create variable
694
+ *
695
+ * Create a new function environment variable. These variables can be accessed in the function at runtime as environment variables.
696
+ *
697
+ * @param {string} functionId
698
+ * @param {string} key
699
+ * @param {string} value
700
+ * @throws {AppwriteException}
701
+ * @returns {Promise<Models.Variable>}
702
+ */
703
+ async createVariable(functionId, key, value) {
704
+ if (typeof functionId === "undefined") {
705
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
706
+ }
707
+ if (typeof key === "undefined") {
708
+ throw new client.AppwriteException('Missing required parameter: "key"');
709
+ }
710
+ if (typeof value === "undefined") {
711
+ throw new client.AppwriteException('Missing required parameter: "value"');
712
+ }
713
+ const apiPath = "/functions/{functionId}/variables".replace("{functionId}", functionId);
714
+ const payload = {};
715
+ if (typeof key !== "undefined") {
716
+ payload["key"] = key;
717
+ }
718
+ if (typeof value !== "undefined") {
719
+ payload["value"] = value;
720
+ }
721
+ const uri = new URL(this.client.config.endpoint + apiPath);
722
+ const apiHeaders = {
723
+ "content-type": "application/json"
724
+ };
725
+ return await this.client.call(
726
+ "post",
727
+ uri,
728
+ apiHeaders,
729
+ payload
730
+ );
731
+ }
732
+ /**
733
+ * Get variable
734
+ *
735
+ * Get a variable by its unique ID.
736
+ *
737
+ * @param {string} functionId
738
+ * @param {string} variableId
739
+ * @throws {AppwriteException}
740
+ * @returns {Promise<Models.Variable>}
741
+ */
742
+ async getVariable(functionId, variableId) {
743
+ if (typeof functionId === "undefined") {
744
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
745
+ }
746
+ if (typeof variableId === "undefined") {
747
+ throw new client.AppwriteException('Missing required parameter: "variableId"');
748
+ }
749
+ const apiPath = "/functions/{functionId}/variables/{variableId}".replace("{functionId}", functionId).replace("{variableId}", variableId);
750
+ const payload = {};
751
+ const uri = new URL(this.client.config.endpoint + apiPath);
752
+ const apiHeaders = {
753
+ "content-type": "application/json"
754
+ };
755
+ return await this.client.call(
756
+ "get",
757
+ uri,
758
+ apiHeaders,
759
+ payload
760
+ );
761
+ }
762
+ /**
763
+ * Update variable
764
+ *
765
+ * Update variable by its unique ID.
766
+ *
767
+ * @param {string} functionId
768
+ * @param {string} variableId
769
+ * @param {string} key
770
+ * @param {string} value
771
+ * @throws {AppwriteException}
772
+ * @returns {Promise<Models.Variable>}
773
+ */
774
+ async updateVariable(functionId, variableId, key, value) {
775
+ if (typeof functionId === "undefined") {
776
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
777
+ }
778
+ if (typeof variableId === "undefined") {
779
+ throw new client.AppwriteException('Missing required parameter: "variableId"');
780
+ }
781
+ if (typeof key === "undefined") {
782
+ throw new client.AppwriteException('Missing required parameter: "key"');
783
+ }
784
+ const apiPath = "/functions/{functionId}/variables/{variableId}".replace("{functionId}", functionId).replace("{variableId}", variableId);
785
+ const payload = {};
786
+ if (typeof key !== "undefined") {
787
+ payload["key"] = key;
788
+ }
789
+ if (typeof value !== "undefined") {
790
+ payload["value"] = value;
791
+ }
792
+ const uri = new URL(this.client.config.endpoint + apiPath);
793
+ const apiHeaders = {
794
+ "content-type": "application/json"
795
+ };
796
+ return await this.client.call(
797
+ "put",
798
+ uri,
799
+ apiHeaders,
800
+ payload
801
+ );
802
+ }
803
+ /**
804
+ * Delete variable
805
+ *
806
+ * Delete a variable by its unique ID.
807
+ *
808
+ * @param {string} functionId
809
+ * @param {string} variableId
810
+ * @throws {AppwriteException}
811
+ * @returns {Promise<{}>}
812
+ */
813
+ async deleteVariable(functionId, variableId) {
814
+ if (typeof functionId === "undefined") {
815
+ throw new client.AppwriteException('Missing required parameter: "functionId"');
816
+ }
817
+ if (typeof variableId === "undefined") {
818
+ throw new client.AppwriteException('Missing required parameter: "variableId"');
819
+ }
820
+ const apiPath = "/functions/{functionId}/variables/{variableId}".replace("{functionId}", functionId).replace("{variableId}", variableId);
821
+ const payload = {};
822
+ const uri = new URL(this.client.config.endpoint + apiPath);
823
+ const apiHeaders = {
824
+ "content-type": "application/json"
825
+ };
826
+ return await this.client.call(
827
+ "delete",
828
+ uri,
829
+ apiHeaders,
830
+ payload
831
+ );
832
+ }
833
+ }
834
+
835
+ exports.Functions = Functions;
836
+ //# sourceMappingURL=out.js.map
837
+ //# sourceMappingURL=functions.js.map