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
@@ -1,930 +0,0 @@
1
- const Service = require('../service.js');
2
- const AppwriteException = require('../exception.js');
3
- const InputFile = require('../inputFile.js');
4
- const client = require('../client.js');
5
- const Stream = require('stream');
6
- const { promisify } = require('util');
7
- const fs = require('fs');
8
- const { File } = require('undici');
9
- const Query = require('../query.js');
10
-
11
- class Functions extends Service {
12
-
13
- constructor(client)
14
- {
15
- super(client);
16
- }
17
-
18
-
19
- /**
20
- * List functions
21
- *
22
- * Get a list of all the project's functions. You can use the query params to
23
- * filter your results.
24
- *
25
- * @param {string[]} queries
26
- * @param {string} search
27
- * @throws {AppwriteException}
28
- * @returns {Promise}
29
- */
30
- async list(queries, search) {
31
- const apiPath = '/functions';
32
- let payload = {};
33
-
34
- if (typeof queries !== 'undefined') {
35
- payload['queries'] = queries;
36
- }
37
-
38
- if (typeof search !== 'undefined') {
39
- payload['search'] = search;
40
- }
41
-
42
- return await this.client.call('get', apiPath, {
43
- 'content-type': 'application/json',
44
- }, payload);
45
- }
46
-
47
- /**
48
- * Create function
49
- *
50
- * Create a new function. You can pass a list of
51
- * [permissions](https://appwrite.io/docs/permissions) to allow different
52
- * project users or team with access to execute the function using the client
53
- * API.
54
- *
55
- * @param {string} functionId
56
- * @param {string} name
57
- * @param {Runtime} runtime
58
- * @param {string[]} execute
59
- * @param {string[]} events
60
- * @param {string} schedule
61
- * @param {number} timeout
62
- * @param {boolean} enabled
63
- * @param {boolean} logging
64
- * @param {string} entrypoint
65
- * @param {string} commands
66
- * @param {string} installationId
67
- * @param {string} providerRepositoryId
68
- * @param {string} providerBranch
69
- * @param {boolean} providerSilentMode
70
- * @param {string} providerRootDirectory
71
- * @param {string} templateRepository
72
- * @param {string} templateOwner
73
- * @param {string} templateRootDirectory
74
- * @param {string} templateBranch
75
- * @throws {AppwriteException}
76
- * @returns {Promise}
77
- */
78
- async create(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, templateRepository, templateOwner, templateRootDirectory, templateBranch) {
79
- const apiPath = '/functions';
80
- let payload = {};
81
- if (typeof functionId === 'undefined') {
82
- throw new AppwriteException('Missing required parameter: "functionId"');
83
- }
84
-
85
- if (typeof name === 'undefined') {
86
- throw new AppwriteException('Missing required parameter: "name"');
87
- }
88
-
89
- if (typeof runtime === 'undefined') {
90
- throw new AppwriteException('Missing required parameter: "runtime"');
91
- }
92
-
93
-
94
- if (typeof functionId !== 'undefined') {
95
- payload['functionId'] = functionId;
96
- }
97
-
98
- if (typeof name !== 'undefined') {
99
- payload['name'] = name;
100
- }
101
-
102
- if (typeof runtime !== 'undefined') {
103
- payload['runtime'] = runtime;
104
- }
105
-
106
- if (typeof execute !== 'undefined') {
107
- payload['execute'] = execute;
108
- }
109
-
110
- if (typeof events !== 'undefined') {
111
- payload['events'] = events;
112
- }
113
-
114
- if (typeof schedule !== 'undefined') {
115
- payload['schedule'] = schedule;
116
- }
117
-
118
- if (typeof timeout !== 'undefined') {
119
- payload['timeout'] = timeout;
120
- }
121
-
122
- if (typeof enabled !== 'undefined') {
123
- payload['enabled'] = enabled;
124
- }
125
-
126
- if (typeof logging !== 'undefined') {
127
- payload['logging'] = logging;
128
- }
129
-
130
- if (typeof entrypoint !== 'undefined') {
131
- payload['entrypoint'] = entrypoint;
132
- }
133
-
134
- if (typeof commands !== 'undefined') {
135
- payload['commands'] = commands;
136
- }
137
-
138
- if (typeof installationId !== 'undefined') {
139
- payload['installationId'] = installationId;
140
- }
141
-
142
- if (typeof providerRepositoryId !== 'undefined') {
143
- payload['providerRepositoryId'] = providerRepositoryId;
144
- }
145
-
146
- if (typeof providerBranch !== 'undefined') {
147
- payload['providerBranch'] = providerBranch;
148
- }
149
-
150
- if (typeof providerSilentMode !== 'undefined') {
151
- payload['providerSilentMode'] = providerSilentMode;
152
- }
153
-
154
- if (typeof providerRootDirectory !== 'undefined') {
155
- payload['providerRootDirectory'] = providerRootDirectory;
156
- }
157
-
158
- if (typeof templateRepository !== 'undefined') {
159
- payload['templateRepository'] = templateRepository;
160
- }
161
-
162
- if (typeof templateOwner !== 'undefined') {
163
- payload['templateOwner'] = templateOwner;
164
- }
165
-
166
- if (typeof templateRootDirectory !== 'undefined') {
167
- payload['templateRootDirectory'] = templateRootDirectory;
168
- }
169
-
170
- if (typeof templateBranch !== 'undefined') {
171
- payload['templateBranch'] = templateBranch;
172
- }
173
-
174
- return await this.client.call('post', apiPath, {
175
- 'content-type': 'application/json',
176
- }, payload);
177
- }
178
-
179
- /**
180
- * List runtimes
181
- *
182
- * Get a list of all runtimes that are currently active on your instance.
183
- *
184
- * @throws {AppwriteException}
185
- * @returns {Promise}
186
- */
187
- async listRuntimes() {
188
- const apiPath = '/functions/runtimes';
189
- let payload = {};
190
-
191
- return await this.client.call('get', apiPath, {
192
- 'content-type': 'application/json',
193
- }, payload);
194
- }
195
-
196
- /**
197
- * Get function
198
- *
199
- * Get a function by its unique ID.
200
- *
201
- * @param {string} functionId
202
- * @throws {AppwriteException}
203
- * @returns {Promise}
204
- */
205
- async get(functionId) {
206
- const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
207
- let payload = {};
208
- if (typeof functionId === 'undefined') {
209
- throw new AppwriteException('Missing required parameter: "functionId"');
210
- }
211
-
212
-
213
- return await this.client.call('get', apiPath, {
214
- 'content-type': 'application/json',
215
- }, payload);
216
- }
217
-
218
- /**
219
- * Update function
220
- *
221
- * Update function by its unique ID.
222
- *
223
- * @param {string} functionId
224
- * @param {string} name
225
- * @param {Runtime} runtime
226
- * @param {string[]} execute
227
- * @param {string[]} events
228
- * @param {string} schedule
229
- * @param {number} timeout
230
- * @param {boolean} enabled
231
- * @param {boolean} logging
232
- * @param {string} entrypoint
233
- * @param {string} commands
234
- * @param {string} installationId
235
- * @param {string} providerRepositoryId
236
- * @param {string} providerBranch
237
- * @param {boolean} providerSilentMode
238
- * @param {string} providerRootDirectory
239
- * @throws {AppwriteException}
240
- * @returns {Promise}
241
- */
242
- async update(functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory) {
243
- const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
244
- let payload = {};
245
- if (typeof functionId === 'undefined') {
246
- throw new AppwriteException('Missing required parameter: "functionId"');
247
- }
248
-
249
- if (typeof name === 'undefined') {
250
- throw new AppwriteException('Missing required parameter: "name"');
251
- }
252
-
253
-
254
- if (typeof name !== 'undefined') {
255
- payload['name'] = name;
256
- }
257
-
258
- if (typeof runtime !== 'undefined') {
259
- payload['runtime'] = runtime;
260
- }
261
-
262
- if (typeof execute !== 'undefined') {
263
- payload['execute'] = execute;
264
- }
265
-
266
- if (typeof events !== 'undefined') {
267
- payload['events'] = events;
268
- }
269
-
270
- if (typeof schedule !== 'undefined') {
271
- payload['schedule'] = schedule;
272
- }
273
-
274
- if (typeof timeout !== 'undefined') {
275
- payload['timeout'] = timeout;
276
- }
277
-
278
- if (typeof enabled !== 'undefined') {
279
- payload['enabled'] = enabled;
280
- }
281
-
282
- if (typeof logging !== 'undefined') {
283
- payload['logging'] = logging;
284
- }
285
-
286
- if (typeof entrypoint !== 'undefined') {
287
- payload['entrypoint'] = entrypoint;
288
- }
289
-
290
- if (typeof commands !== 'undefined') {
291
- payload['commands'] = commands;
292
- }
293
-
294
- if (typeof installationId !== 'undefined') {
295
- payload['installationId'] = installationId;
296
- }
297
-
298
- if (typeof providerRepositoryId !== 'undefined') {
299
- payload['providerRepositoryId'] = providerRepositoryId;
300
- }
301
-
302
- if (typeof providerBranch !== 'undefined') {
303
- payload['providerBranch'] = providerBranch;
304
- }
305
-
306
- if (typeof providerSilentMode !== 'undefined') {
307
- payload['providerSilentMode'] = providerSilentMode;
308
- }
309
-
310
- if (typeof providerRootDirectory !== 'undefined') {
311
- payload['providerRootDirectory'] = providerRootDirectory;
312
- }
313
-
314
- return await this.client.call('put', apiPath, {
315
- 'content-type': 'application/json',
316
- }, payload);
317
- }
318
-
319
- /**
320
- * Delete function
321
- *
322
- * Delete a function by its unique ID.
323
- *
324
- * @param {string} functionId
325
- * @throws {AppwriteException}
326
- * @returns {Promise}
327
- */
328
- async delete(functionId) {
329
- const apiPath = '/functions/{functionId}'.replace('{functionId}', functionId);
330
- let payload = {};
331
- if (typeof functionId === 'undefined') {
332
- throw new AppwriteException('Missing required parameter: "functionId"');
333
- }
334
-
335
-
336
- return await this.client.call('delete', apiPath, {
337
- 'content-type': 'application/json',
338
- }, payload);
339
- }
340
-
341
- /**
342
- * List deployments
343
- *
344
- * Get a list of all the project's code deployments. You can use the query
345
- * params to filter your results.
346
- *
347
- * @param {string} functionId
348
- * @param {string[]} queries
349
- * @param {string} search
350
- * @throws {AppwriteException}
351
- * @returns {Promise}
352
- */
353
- async listDeployments(functionId, queries, search) {
354
- const apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);
355
- let payload = {};
356
- if (typeof functionId === 'undefined') {
357
- throw new AppwriteException('Missing required parameter: "functionId"');
358
- }
359
-
360
-
361
- if (typeof queries !== 'undefined') {
362
- payload['queries'] = queries;
363
- }
364
-
365
- if (typeof search !== 'undefined') {
366
- payload['search'] = search;
367
- }
368
-
369
- return await this.client.call('get', apiPath, {
370
- 'content-type': 'application/json',
371
- }, payload);
372
- }
373
-
374
- /**
375
- * Create deployment
376
- *
377
- * Create a new function code deployment. Use this endpoint to upload a new
378
- * version of your code function. To execute your newly uploaded code, you'll
379
- * need to update the function's deployment to use your new deployment UID.
380
- *
381
- * This endpoint accepts a tar.gz file compressed with your code. Make sure to
382
- * include any dependencies your code has within the compressed file. You can
383
- * learn more about code packaging in the [Appwrite Cloud Functions
384
- * tutorial](https://appwrite.io/docs/functions).
385
- *
386
- * Use the "command" param to set the entrypoint used to execute your code.
387
- *
388
- * @param {string} functionId
389
- * @param {InputFile} code
390
- * @param {boolean} activate
391
- * @param {string} entrypoint
392
- * @param {string} commands
393
- * @param {CallableFunction} onProgress
394
- * @throws {AppwriteException}
395
- * @returns {Promise}
396
- */
397
- async createDeployment(functionId, code, activate, entrypoint, commands, onProgress = () => {}) {
398
- const apiPath = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);
399
- let payload = {};
400
- if (typeof functionId === 'undefined') {
401
- throw new AppwriteException('Missing required parameter: "functionId"');
402
- }
403
-
404
- if (typeof code === 'undefined') {
405
- throw new AppwriteException('Missing required parameter: "code"');
406
- }
407
-
408
- if (typeof activate === 'undefined') {
409
- throw new AppwriteException('Missing required parameter: "activate"');
410
- }
411
-
412
-
413
- if (typeof entrypoint !== 'undefined') {
414
- payload['entrypoint'] = entrypoint;
415
- }
416
-
417
- if (typeof commands !== 'undefined') {
418
- payload['commands'] = commands;
419
- }
420
-
421
- if (typeof code !== 'undefined') {
422
- payload['code'] = code;
423
- }
424
-
425
- if (typeof activate !== 'undefined') {
426
- payload['activate'] = activate.toString();
427
- }
428
-
429
-
430
- const size = code.size;
431
-
432
- const apiHeaders = {
433
- 'content-type': 'multipart/form-data',
434
- };
435
-
436
- let id = undefined;
437
- let response = undefined;
438
-
439
- let chunksUploaded = 0;
440
-
441
-
442
- let currentChunk = 1;
443
- let currentPosition = 0;
444
- let uploadableChunk = new Uint8Array(client.CHUNK_SIZE);
445
-
446
-
447
- const uploadChunk = async (lastUpload = false) => {
448
- if(currentChunk <= chunksUploaded) {
449
- return;
450
- }
451
-
452
- const start = ((currentChunk - 1) * client.CHUNK_SIZE);
453
- let end = start + currentPosition - 1;
454
-
455
- if(!lastUpload || currentChunk !== 1) {
456
- apiHeaders['content-range'] = 'bytes ' + start + '-' + end + '/' + size;
457
- }
458
-
459
- let uploadableChunkTrimmed;
460
-
461
- if(currentPosition + 1 >= client.CHUNK_SIZE) {
462
- uploadableChunkTrimmed = uploadableChunk;
463
- } else {
464
- uploadableChunkTrimmed = new Uint8Array(currentPosition);
465
- for(let i = 0; i <= currentPosition; i++) {
466
- uploadableChunkTrimmed[i] = uploadableChunk[i];
467
- }
468
- }
469
-
470
- if (id) {
471
- apiHeaders['x-appwrite-id'] = id;
472
- }
473
-
474
- payload['code'] = { type: 'file', file: new File([uploadableChunkTrimmed], code.filename), filename: code.filename };
475
-
476
- response = await this.client.call('post', apiPath, apiHeaders, payload);
477
-
478
- if (!id) {
479
- id = response['$id'];
480
- }
481
-
482
- if (onProgress !== null) {
483
- onProgress({
484
- $id: response['$id'],
485
- progress: Math.min((currentChunk) * client.CHUNK_SIZE, size) / size * 100,
486
- sizeUploaded: end+1,
487
- chunksTotal: response['chunksTotal'],
488
- chunksUploaded: response['chunksUploaded']
489
- });
490
- }
491
-
492
- uploadableChunk = new Uint8Array(client.CHUNK_SIZE);
493
- currentChunk++;
494
- currentPosition = 0;
495
- }
496
-
497
- for await (const chunk of code.stream) {
498
- for(const b of chunk) {
499
- uploadableChunk[currentPosition] = b;
500
-
501
- currentPosition++;
502
- if(currentPosition >= client.CHUNK_SIZE) {
503
- await uploadChunk();
504
- currentPosition = 0;
505
- }
506
- }
507
- }
508
-
509
- if (currentPosition > 0) { // Check if there's any remaining data for the last chunk
510
- await uploadChunk(true);
511
- }
512
-
513
- return response;
514
-
515
- }
516
-
517
- /**
518
- * Get deployment
519
- *
520
- * Get a code deployment by its unique ID.
521
- *
522
- * @param {string} functionId
523
- * @param {string} deploymentId
524
- * @throws {AppwriteException}
525
- * @returns {Promise}
526
- */
527
- async getDeployment(functionId, deploymentId) {
528
- const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
529
- let payload = {};
530
- if (typeof functionId === 'undefined') {
531
- throw new AppwriteException('Missing required parameter: "functionId"');
532
- }
533
-
534
- if (typeof deploymentId === 'undefined') {
535
- throw new AppwriteException('Missing required parameter: "deploymentId"');
536
- }
537
-
538
-
539
- return await this.client.call('get', apiPath, {
540
- 'content-type': 'application/json',
541
- }, payload);
542
- }
543
-
544
- /**
545
- * Update function deployment
546
- *
547
- * Update the function code deployment ID using the unique function ID. Use
548
- * this endpoint to switch the code deployment that should be executed by the
549
- * execution endpoint.
550
- *
551
- * @param {string} functionId
552
- * @param {string} deploymentId
553
- * @throws {AppwriteException}
554
- * @returns {Promise}
555
- */
556
- async updateDeployment(functionId, deploymentId) {
557
- const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
558
- let payload = {};
559
- if (typeof functionId === 'undefined') {
560
- throw new AppwriteException('Missing required parameter: "functionId"');
561
- }
562
-
563
- if (typeof deploymentId === 'undefined') {
564
- throw new AppwriteException('Missing required parameter: "deploymentId"');
565
- }
566
-
567
-
568
- return await this.client.call('patch', apiPath, {
569
- 'content-type': 'application/json',
570
- }, payload);
571
- }
572
-
573
- /**
574
- * Delete deployment
575
- *
576
- * Delete a code deployment by its unique ID.
577
- *
578
- * @param {string} functionId
579
- * @param {string} deploymentId
580
- * @throws {AppwriteException}
581
- * @returns {Promise}
582
- */
583
- async deleteDeployment(functionId, deploymentId) {
584
- const apiPath = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
585
- let payload = {};
586
- if (typeof functionId === 'undefined') {
587
- throw new AppwriteException('Missing required parameter: "functionId"');
588
- }
589
-
590
- if (typeof deploymentId === 'undefined') {
591
- throw new AppwriteException('Missing required parameter: "deploymentId"');
592
- }
593
-
594
-
595
- return await this.client.call('delete', apiPath, {
596
- 'content-type': 'application/json',
597
- }, payload);
598
- }
599
-
600
- /**
601
- * Create build
602
- *
603
- * Create a new build for an Appwrite Function deployment. This endpoint can
604
- * be used to retry a failed build.
605
- *
606
- * @param {string} functionId
607
- * @param {string} deploymentId
608
- * @param {string} buildId
609
- * @throws {AppwriteException}
610
- * @returns {Promise}
611
- */
612
- async createBuild(functionId, deploymentId, buildId) {
613
- const apiPath = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId).replace('{buildId}', buildId);
614
- let payload = {};
615
- if (typeof functionId === 'undefined') {
616
- throw new AppwriteException('Missing required parameter: "functionId"');
617
- }
618
-
619
- if (typeof deploymentId === 'undefined') {
620
- throw new AppwriteException('Missing required parameter: "deploymentId"');
621
- }
622
-
623
- if (typeof buildId === 'undefined') {
624
- throw new AppwriteException('Missing required parameter: "buildId"');
625
- }
626
-
627
-
628
- return await this.client.call('post', apiPath, {
629
- 'content-type': 'application/json',
630
- }, payload);
631
- }
632
-
633
- /**
634
- * Download Deployment
635
- *
636
- * Get a Deployment's contents by its unique ID. This endpoint supports range
637
- * requests for partial or streaming file download.
638
- *
639
- * @param {string} functionId
640
- * @param {string} deploymentId
641
- * @throws {AppwriteException}
642
- * @returns {Promise}
643
- */
644
- async downloadDeployment(functionId, deploymentId) {
645
- const apiPath = '/functions/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);
646
- let payload = {};
647
- if (typeof functionId === 'undefined') {
648
- throw new AppwriteException('Missing required parameter: "functionId"');
649
- }
650
-
651
- if (typeof deploymentId === 'undefined') {
652
- throw new AppwriteException('Missing required parameter: "deploymentId"');
653
- }
654
-
655
-
656
- return await this.client.call('get', apiPath, {
657
- 'content-type': 'application/json',
658
- }, payload, 'arraybuffer');
659
- }
660
-
661
- /**
662
- * List executions
663
- *
664
- * Get a list of all the current user function execution logs. You can use the
665
- * query params to filter your results.
666
- *
667
- * @param {string} functionId
668
- * @param {string[]} queries
669
- * @param {string} search
670
- * @throws {AppwriteException}
671
- * @returns {Promise}
672
- */
673
- async listExecutions(functionId, queries, search) {
674
- const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
675
- let payload = {};
676
- if (typeof functionId === 'undefined') {
677
- throw new AppwriteException('Missing required parameter: "functionId"');
678
- }
679
-
680
-
681
- if (typeof queries !== 'undefined') {
682
- payload['queries'] = queries;
683
- }
684
-
685
- if (typeof search !== 'undefined') {
686
- payload['search'] = search;
687
- }
688
-
689
- return await this.client.call('get', apiPath, {
690
- 'content-type': 'application/json',
691
- }, payload);
692
- }
693
-
694
- /**
695
- * Create execution
696
- *
697
- * Trigger a function execution. The returned object will return you the
698
- * current execution status. You can ping the `Get Execution` endpoint to get
699
- * updates on the current execution status. Once this endpoint is called, your
700
- * function execution process will start asynchronously.
701
- *
702
- * @param {string} functionId
703
- * @param {string} body
704
- * @param {boolean} async
705
- * @param {string} xpath
706
- * @param {ExecutionMethod} method
707
- * @param {object} headers
708
- * @throws {AppwriteException}
709
- * @returns {Promise}
710
- */
711
- async createExecution(functionId, body, async, xpath, method, headers) {
712
- const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);
713
- let payload = {};
714
- if (typeof functionId === 'undefined') {
715
- throw new AppwriteException('Missing required parameter: "functionId"');
716
- }
717
-
718
-
719
- if (typeof body !== 'undefined') {
720
- payload['body'] = body;
721
- }
722
-
723
- if (typeof async !== 'undefined') {
724
- payload['async'] = async;
725
- }
726
-
727
- if (typeof xpath !== 'undefined') {
728
- payload['path'] = xpath;
729
- }
730
-
731
- if (typeof method !== 'undefined') {
732
- payload['method'] = method;
733
- }
734
-
735
- if (typeof headers !== 'undefined') {
736
- payload['headers'] = headers;
737
- }
738
-
739
- return await this.client.call('post', apiPath, {
740
- 'content-type': 'application/json',
741
- }, payload);
742
- }
743
-
744
- /**
745
- * Get execution
746
- *
747
- * Get a function execution log by its unique ID.
748
- *
749
- * @param {string} functionId
750
- * @param {string} executionId
751
- * @throws {AppwriteException}
752
- * @returns {Promise}
753
- */
754
- async getExecution(functionId, executionId) {
755
- const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);
756
- let payload = {};
757
- if (typeof functionId === 'undefined') {
758
- throw new AppwriteException('Missing required parameter: "functionId"');
759
- }
760
-
761
- if (typeof executionId === 'undefined') {
762
- throw new AppwriteException('Missing required parameter: "executionId"');
763
- }
764
-
765
-
766
- return await this.client.call('get', apiPath, {
767
- 'content-type': 'application/json',
768
- }, payload);
769
- }
770
-
771
- /**
772
- * List variables
773
- *
774
- * Get a list of all variables of a specific function.
775
- *
776
- * @param {string} functionId
777
- * @throws {AppwriteException}
778
- * @returns {Promise}
779
- */
780
- async listVariables(functionId) {
781
- const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId);
782
- let payload = {};
783
- if (typeof functionId === 'undefined') {
784
- throw new AppwriteException('Missing required parameter: "functionId"');
785
- }
786
-
787
-
788
- return await this.client.call('get', apiPath, {
789
- 'content-type': 'application/json',
790
- }, payload);
791
- }
792
-
793
- /**
794
- * Create variable
795
- *
796
- * Create a new function environment variable. These variables can be accessed
797
- * in the function at runtime as environment variables.
798
- *
799
- * @param {string} functionId
800
- * @param {string} key
801
- * @param {string} value
802
- * @throws {AppwriteException}
803
- * @returns {Promise}
804
- */
805
- async createVariable(functionId, key, value) {
806
- const apiPath = '/functions/{functionId}/variables'.replace('{functionId}', functionId);
807
- let payload = {};
808
- if (typeof functionId === 'undefined') {
809
- throw new AppwriteException('Missing required parameter: "functionId"');
810
- }
811
-
812
- if (typeof key === 'undefined') {
813
- throw new AppwriteException('Missing required parameter: "key"');
814
- }
815
-
816
- if (typeof value === 'undefined') {
817
- throw new AppwriteException('Missing required parameter: "value"');
818
- }
819
-
820
-
821
- if (typeof key !== 'undefined') {
822
- payload['key'] = key;
823
- }
824
-
825
- if (typeof value !== 'undefined') {
826
- payload['value'] = value;
827
- }
828
-
829
- return await this.client.call('post', apiPath, {
830
- 'content-type': 'application/json',
831
- }, payload);
832
- }
833
-
834
- /**
835
- * Get variable
836
- *
837
- * Get a variable by its unique ID.
838
- *
839
- * @param {string} functionId
840
- * @param {string} variableId
841
- * @throws {AppwriteException}
842
- * @returns {Promise}
843
- */
844
- async getVariable(functionId, variableId) {
845
- const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
846
- let payload = {};
847
- if (typeof functionId === 'undefined') {
848
- throw new AppwriteException('Missing required parameter: "functionId"');
849
- }
850
-
851
- if (typeof variableId === 'undefined') {
852
- throw new AppwriteException('Missing required parameter: "variableId"');
853
- }
854
-
855
-
856
- return await this.client.call('get', apiPath, {
857
- 'content-type': 'application/json',
858
- }, payload);
859
- }
860
-
861
- /**
862
- * Update variable
863
- *
864
- * Update variable by its unique ID.
865
- *
866
- * @param {string} functionId
867
- * @param {string} variableId
868
- * @param {string} key
869
- * @param {string} value
870
- * @throws {AppwriteException}
871
- * @returns {Promise}
872
- */
873
- async updateVariable(functionId, variableId, key, value) {
874
- const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
875
- let payload = {};
876
- if (typeof functionId === 'undefined') {
877
- throw new AppwriteException('Missing required parameter: "functionId"');
878
- }
879
-
880
- if (typeof variableId === 'undefined') {
881
- throw new AppwriteException('Missing required parameter: "variableId"');
882
- }
883
-
884
- if (typeof key === 'undefined') {
885
- throw new AppwriteException('Missing required parameter: "key"');
886
- }
887
-
888
-
889
- if (typeof key !== 'undefined') {
890
- payload['key'] = key;
891
- }
892
-
893
- if (typeof value !== 'undefined') {
894
- payload['value'] = value;
895
- }
896
-
897
- return await this.client.call('put', apiPath, {
898
- 'content-type': 'application/json',
899
- }, payload);
900
- }
901
-
902
- /**
903
- * Delete variable
904
- *
905
- * Delete a variable by its unique ID.
906
- *
907
- * @param {string} functionId
908
- * @param {string} variableId
909
- * @throws {AppwriteException}
910
- * @returns {Promise}
911
- */
912
- async deleteVariable(functionId, variableId) {
913
- const apiPath = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);
914
- let payload = {};
915
- if (typeof functionId === 'undefined') {
916
- throw new AppwriteException('Missing required parameter: "functionId"');
917
- }
918
-
919
- if (typeof variableId === 'undefined') {
920
- throw new AppwriteException('Missing required parameter: "variableId"');
921
- }
922
-
923
-
924
- return await this.client.call('delete', apiPath, {
925
- 'content-type': 'application/json',
926
- }, payload);
927
- }
928
- }
929
-
930
- module.exports = Functions;