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,1464 @@
1
+ import { AppwriteException } from '../client.mjs';
2
+
3
+ // src/services/users.ts
4
+ var Users = class {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ /**
9
+ * List users
10
+ *
11
+ * Get a list of all the project's users. You can use the query params to filter your results.
12
+ *
13
+ * @param {string[]} queries
14
+ * @param {string} search
15
+ * @throws {AppwriteException}
16
+ * @returns {Promise<Models.UserList<Preferences>>}
17
+ */
18
+ async list(queries, search) {
19
+ const apiPath = "/users";
20
+ const payload = {};
21
+ if (typeof queries !== "undefined") {
22
+ payload["queries"] = queries;
23
+ }
24
+ if (typeof search !== "undefined") {
25
+ payload["search"] = search;
26
+ }
27
+ const uri = new URL(this.client.config.endpoint + apiPath);
28
+ const apiHeaders = {
29
+ "content-type": "application/json"
30
+ };
31
+ return await this.client.call(
32
+ "get",
33
+ uri,
34
+ apiHeaders,
35
+ payload
36
+ );
37
+ }
38
+ /**
39
+ * Create user
40
+ *
41
+ * Create a new user.
42
+ *
43
+ * @param {string} userId
44
+ * @param {string} email
45
+ * @param {string} phone
46
+ * @param {string} password
47
+ * @param {string} name
48
+ * @throws {AppwriteException}
49
+ * @returns {Promise<Models.User<Preferences>>}
50
+ */
51
+ async create(userId, email, phone, password, name) {
52
+ if (typeof userId === "undefined") {
53
+ throw new AppwriteException('Missing required parameter: "userId"');
54
+ }
55
+ const apiPath = "/users";
56
+ const payload = {};
57
+ if (typeof userId !== "undefined") {
58
+ payload["userId"] = userId;
59
+ }
60
+ if (typeof email !== "undefined") {
61
+ payload["email"] = email;
62
+ }
63
+ if (typeof phone !== "undefined") {
64
+ payload["phone"] = phone;
65
+ }
66
+ if (typeof password !== "undefined") {
67
+ payload["password"] = password;
68
+ }
69
+ if (typeof name !== "undefined") {
70
+ payload["name"] = name;
71
+ }
72
+ const uri = new URL(this.client.config.endpoint + apiPath);
73
+ const apiHeaders = {
74
+ "content-type": "application/json"
75
+ };
76
+ return await this.client.call(
77
+ "post",
78
+ uri,
79
+ apiHeaders,
80
+ payload
81
+ );
82
+ }
83
+ /**
84
+ * Create user with Argon2 password
85
+ *
86
+ * Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
87
+ *
88
+ * @param {string} userId
89
+ * @param {string} email
90
+ * @param {string} password
91
+ * @param {string} name
92
+ * @throws {AppwriteException}
93
+ * @returns {Promise<Models.User<Preferences>>}
94
+ */
95
+ async createArgon2User(userId, email, password, name) {
96
+ if (typeof userId === "undefined") {
97
+ throw new AppwriteException('Missing required parameter: "userId"');
98
+ }
99
+ if (typeof email === "undefined") {
100
+ throw new AppwriteException('Missing required parameter: "email"');
101
+ }
102
+ if (typeof password === "undefined") {
103
+ throw new AppwriteException('Missing required parameter: "password"');
104
+ }
105
+ const apiPath = "/users/argon2";
106
+ const payload = {};
107
+ if (typeof userId !== "undefined") {
108
+ payload["userId"] = userId;
109
+ }
110
+ if (typeof email !== "undefined") {
111
+ payload["email"] = email;
112
+ }
113
+ if (typeof password !== "undefined") {
114
+ payload["password"] = password;
115
+ }
116
+ if (typeof name !== "undefined") {
117
+ payload["name"] = name;
118
+ }
119
+ const uri = new URL(this.client.config.endpoint + apiPath);
120
+ const apiHeaders = {
121
+ "content-type": "application/json"
122
+ };
123
+ return await this.client.call(
124
+ "post",
125
+ uri,
126
+ apiHeaders,
127
+ payload
128
+ );
129
+ }
130
+ /**
131
+ * Create user with bcrypt password
132
+ *
133
+ * Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
134
+ *
135
+ * @param {string} userId
136
+ * @param {string} email
137
+ * @param {string} password
138
+ * @param {string} name
139
+ * @throws {AppwriteException}
140
+ * @returns {Promise<Models.User<Preferences>>}
141
+ */
142
+ async createBcryptUser(userId, email, password, name) {
143
+ if (typeof userId === "undefined") {
144
+ throw new AppwriteException('Missing required parameter: "userId"');
145
+ }
146
+ if (typeof email === "undefined") {
147
+ throw new AppwriteException('Missing required parameter: "email"');
148
+ }
149
+ if (typeof password === "undefined") {
150
+ throw new AppwriteException('Missing required parameter: "password"');
151
+ }
152
+ const apiPath = "/users/bcrypt";
153
+ const payload = {};
154
+ if (typeof userId !== "undefined") {
155
+ payload["userId"] = userId;
156
+ }
157
+ if (typeof email !== "undefined") {
158
+ payload["email"] = email;
159
+ }
160
+ if (typeof password !== "undefined") {
161
+ payload["password"] = password;
162
+ }
163
+ if (typeof name !== "undefined") {
164
+ payload["name"] = name;
165
+ }
166
+ const uri = new URL(this.client.config.endpoint + apiPath);
167
+ const apiHeaders = {
168
+ "content-type": "application/json"
169
+ };
170
+ return await this.client.call(
171
+ "post",
172
+ uri,
173
+ apiHeaders,
174
+ payload
175
+ );
176
+ }
177
+ /**
178
+ * List Identities
179
+ *
180
+ * Get identities for all users.
181
+ *
182
+ * @param {string[]} queries
183
+ * @param {string} search
184
+ * @throws {AppwriteException}
185
+ * @returns {Promise<Models.IdentityList>}
186
+ */
187
+ async listIdentities(queries, search) {
188
+ const apiPath = "/users/identities";
189
+ const payload = {};
190
+ if (typeof queries !== "undefined") {
191
+ payload["queries"] = queries;
192
+ }
193
+ if (typeof search !== "undefined") {
194
+ payload["search"] = search;
195
+ }
196
+ const uri = new URL(this.client.config.endpoint + apiPath);
197
+ const apiHeaders = {
198
+ "content-type": "application/json"
199
+ };
200
+ return await this.client.call(
201
+ "get",
202
+ uri,
203
+ apiHeaders,
204
+ payload
205
+ );
206
+ }
207
+ /**
208
+ * Delete identity
209
+ *
210
+ * Delete an identity by its unique ID.
211
+ *
212
+ * @param {string} identityId
213
+ * @throws {AppwriteException}
214
+ * @returns {Promise<{}>}
215
+ */
216
+ async deleteIdentity(identityId) {
217
+ if (typeof identityId === "undefined") {
218
+ throw new AppwriteException('Missing required parameter: "identityId"');
219
+ }
220
+ const apiPath = "/users/identities/{identityId}".replace("{identityId}", identityId);
221
+ const payload = {};
222
+ const uri = new URL(this.client.config.endpoint + apiPath);
223
+ const apiHeaders = {
224
+ "content-type": "application/json"
225
+ };
226
+ return await this.client.call(
227
+ "delete",
228
+ uri,
229
+ apiHeaders,
230
+ payload
231
+ );
232
+ }
233
+ /**
234
+ * Create user with MD5 password
235
+ *
236
+ * Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
237
+ *
238
+ * @param {string} userId
239
+ * @param {string} email
240
+ * @param {string} password
241
+ * @param {string} name
242
+ * @throws {AppwriteException}
243
+ * @returns {Promise<Models.User<Preferences>>}
244
+ */
245
+ async createMD5User(userId, email, password, name) {
246
+ if (typeof userId === "undefined") {
247
+ throw new AppwriteException('Missing required parameter: "userId"');
248
+ }
249
+ if (typeof email === "undefined") {
250
+ throw new AppwriteException('Missing required parameter: "email"');
251
+ }
252
+ if (typeof password === "undefined") {
253
+ throw new AppwriteException('Missing required parameter: "password"');
254
+ }
255
+ const apiPath = "/users/md5";
256
+ const payload = {};
257
+ if (typeof userId !== "undefined") {
258
+ payload["userId"] = userId;
259
+ }
260
+ if (typeof email !== "undefined") {
261
+ payload["email"] = email;
262
+ }
263
+ if (typeof password !== "undefined") {
264
+ payload["password"] = password;
265
+ }
266
+ if (typeof name !== "undefined") {
267
+ payload["name"] = name;
268
+ }
269
+ const uri = new URL(this.client.config.endpoint + apiPath);
270
+ const apiHeaders = {
271
+ "content-type": "application/json"
272
+ };
273
+ return await this.client.call(
274
+ "post",
275
+ uri,
276
+ apiHeaders,
277
+ payload
278
+ );
279
+ }
280
+ /**
281
+ * Create user with PHPass password
282
+ *
283
+ * Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
284
+ *
285
+ * @param {string} userId
286
+ * @param {string} email
287
+ * @param {string} password
288
+ * @param {string} name
289
+ * @throws {AppwriteException}
290
+ * @returns {Promise<Models.User<Preferences>>}
291
+ */
292
+ async createPHPassUser(userId, email, password, name) {
293
+ if (typeof userId === "undefined") {
294
+ throw new AppwriteException('Missing required parameter: "userId"');
295
+ }
296
+ if (typeof email === "undefined") {
297
+ throw new AppwriteException('Missing required parameter: "email"');
298
+ }
299
+ if (typeof password === "undefined") {
300
+ throw new AppwriteException('Missing required parameter: "password"');
301
+ }
302
+ const apiPath = "/users/phpass";
303
+ const payload = {};
304
+ if (typeof userId !== "undefined") {
305
+ payload["userId"] = userId;
306
+ }
307
+ if (typeof email !== "undefined") {
308
+ payload["email"] = email;
309
+ }
310
+ if (typeof password !== "undefined") {
311
+ payload["password"] = password;
312
+ }
313
+ if (typeof name !== "undefined") {
314
+ payload["name"] = name;
315
+ }
316
+ const uri = new URL(this.client.config.endpoint + apiPath);
317
+ const apiHeaders = {
318
+ "content-type": "application/json"
319
+ };
320
+ return await this.client.call(
321
+ "post",
322
+ uri,
323
+ apiHeaders,
324
+ payload
325
+ );
326
+ }
327
+ /**
328
+ * Create user with Scrypt password
329
+ *
330
+ * Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
331
+ *
332
+ * @param {string} userId
333
+ * @param {string} email
334
+ * @param {string} password
335
+ * @param {string} passwordSalt
336
+ * @param {number} passwordCpu
337
+ * @param {number} passwordMemory
338
+ * @param {number} passwordParallel
339
+ * @param {number} passwordLength
340
+ * @param {string} name
341
+ * @throws {AppwriteException}
342
+ * @returns {Promise<Models.User<Preferences>>}
343
+ */
344
+ async createScryptUser(userId, email, password, passwordSalt, passwordCpu, passwordMemory, passwordParallel, passwordLength, name) {
345
+ if (typeof userId === "undefined") {
346
+ throw new AppwriteException('Missing required parameter: "userId"');
347
+ }
348
+ if (typeof email === "undefined") {
349
+ throw new AppwriteException('Missing required parameter: "email"');
350
+ }
351
+ if (typeof password === "undefined") {
352
+ throw new AppwriteException('Missing required parameter: "password"');
353
+ }
354
+ if (typeof passwordSalt === "undefined") {
355
+ throw new AppwriteException('Missing required parameter: "passwordSalt"');
356
+ }
357
+ if (typeof passwordCpu === "undefined") {
358
+ throw new AppwriteException('Missing required parameter: "passwordCpu"');
359
+ }
360
+ if (typeof passwordMemory === "undefined") {
361
+ throw new AppwriteException('Missing required parameter: "passwordMemory"');
362
+ }
363
+ if (typeof passwordParallel === "undefined") {
364
+ throw new AppwriteException('Missing required parameter: "passwordParallel"');
365
+ }
366
+ if (typeof passwordLength === "undefined") {
367
+ throw new AppwriteException('Missing required parameter: "passwordLength"');
368
+ }
369
+ const apiPath = "/users/scrypt";
370
+ const payload = {};
371
+ if (typeof userId !== "undefined") {
372
+ payload["userId"] = userId;
373
+ }
374
+ if (typeof email !== "undefined") {
375
+ payload["email"] = email;
376
+ }
377
+ if (typeof password !== "undefined") {
378
+ payload["password"] = password;
379
+ }
380
+ if (typeof passwordSalt !== "undefined") {
381
+ payload["passwordSalt"] = passwordSalt;
382
+ }
383
+ if (typeof passwordCpu !== "undefined") {
384
+ payload["passwordCpu"] = passwordCpu;
385
+ }
386
+ if (typeof passwordMemory !== "undefined") {
387
+ payload["passwordMemory"] = passwordMemory;
388
+ }
389
+ if (typeof passwordParallel !== "undefined") {
390
+ payload["passwordParallel"] = passwordParallel;
391
+ }
392
+ if (typeof passwordLength !== "undefined") {
393
+ payload["passwordLength"] = passwordLength;
394
+ }
395
+ if (typeof name !== "undefined") {
396
+ payload["name"] = name;
397
+ }
398
+ const uri = new URL(this.client.config.endpoint + apiPath);
399
+ const apiHeaders = {
400
+ "content-type": "application/json"
401
+ };
402
+ return await this.client.call(
403
+ "post",
404
+ uri,
405
+ apiHeaders,
406
+ payload
407
+ );
408
+ }
409
+ /**
410
+ * Create user with Scrypt modified password
411
+ *
412
+ * Create a new user. Password provided must be hashed with the [Scrypt Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
413
+ *
414
+ * @param {string} userId
415
+ * @param {string} email
416
+ * @param {string} password
417
+ * @param {string} passwordSalt
418
+ * @param {string} passwordSaltSeparator
419
+ * @param {string} passwordSignerKey
420
+ * @param {string} name
421
+ * @throws {AppwriteException}
422
+ * @returns {Promise<Models.User<Preferences>>}
423
+ */
424
+ async createScryptModifiedUser(userId, email, password, passwordSalt, passwordSaltSeparator, passwordSignerKey, name) {
425
+ if (typeof userId === "undefined") {
426
+ throw new AppwriteException('Missing required parameter: "userId"');
427
+ }
428
+ if (typeof email === "undefined") {
429
+ throw new AppwriteException('Missing required parameter: "email"');
430
+ }
431
+ if (typeof password === "undefined") {
432
+ throw new AppwriteException('Missing required parameter: "password"');
433
+ }
434
+ if (typeof passwordSalt === "undefined") {
435
+ throw new AppwriteException('Missing required parameter: "passwordSalt"');
436
+ }
437
+ if (typeof passwordSaltSeparator === "undefined") {
438
+ throw new AppwriteException('Missing required parameter: "passwordSaltSeparator"');
439
+ }
440
+ if (typeof passwordSignerKey === "undefined") {
441
+ throw new AppwriteException('Missing required parameter: "passwordSignerKey"');
442
+ }
443
+ const apiPath = "/users/scrypt-modified";
444
+ const payload = {};
445
+ if (typeof userId !== "undefined") {
446
+ payload["userId"] = userId;
447
+ }
448
+ if (typeof email !== "undefined") {
449
+ payload["email"] = email;
450
+ }
451
+ if (typeof password !== "undefined") {
452
+ payload["password"] = password;
453
+ }
454
+ if (typeof passwordSalt !== "undefined") {
455
+ payload["passwordSalt"] = passwordSalt;
456
+ }
457
+ if (typeof passwordSaltSeparator !== "undefined") {
458
+ payload["passwordSaltSeparator"] = passwordSaltSeparator;
459
+ }
460
+ if (typeof passwordSignerKey !== "undefined") {
461
+ payload["passwordSignerKey"] = passwordSignerKey;
462
+ }
463
+ if (typeof name !== "undefined") {
464
+ payload["name"] = name;
465
+ }
466
+ const uri = new URL(this.client.config.endpoint + apiPath);
467
+ const apiHeaders = {
468
+ "content-type": "application/json"
469
+ };
470
+ return await this.client.call(
471
+ "post",
472
+ uri,
473
+ apiHeaders,
474
+ payload
475
+ );
476
+ }
477
+ /**
478
+ * Create user with SHA password
479
+ *
480
+ * Create a new user. Password provided must be hashed with the [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use the [POST /users](https://appwrite.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
481
+ *
482
+ * @param {string} userId
483
+ * @param {string} email
484
+ * @param {string} password
485
+ * @param {PasswordHash} passwordVersion
486
+ * @param {string} name
487
+ * @throws {AppwriteException}
488
+ * @returns {Promise<Models.User<Preferences>>}
489
+ */
490
+ async createSHAUser(userId, email, password, passwordVersion, name) {
491
+ if (typeof userId === "undefined") {
492
+ throw new AppwriteException('Missing required parameter: "userId"');
493
+ }
494
+ if (typeof email === "undefined") {
495
+ throw new AppwriteException('Missing required parameter: "email"');
496
+ }
497
+ if (typeof password === "undefined") {
498
+ throw new AppwriteException('Missing required parameter: "password"');
499
+ }
500
+ const apiPath = "/users/sha";
501
+ const payload = {};
502
+ if (typeof userId !== "undefined") {
503
+ payload["userId"] = userId;
504
+ }
505
+ if (typeof email !== "undefined") {
506
+ payload["email"] = email;
507
+ }
508
+ if (typeof password !== "undefined") {
509
+ payload["password"] = password;
510
+ }
511
+ if (typeof passwordVersion !== "undefined") {
512
+ payload["passwordVersion"] = passwordVersion;
513
+ }
514
+ if (typeof name !== "undefined") {
515
+ payload["name"] = name;
516
+ }
517
+ const uri = new URL(this.client.config.endpoint + apiPath);
518
+ const apiHeaders = {
519
+ "content-type": "application/json"
520
+ };
521
+ return await this.client.call(
522
+ "post",
523
+ uri,
524
+ apiHeaders,
525
+ payload
526
+ );
527
+ }
528
+ /**
529
+ * Get user
530
+ *
531
+ * Get a user by its unique ID.
532
+ *
533
+ * @param {string} userId
534
+ * @throws {AppwriteException}
535
+ * @returns {Promise<Models.User<Preferences>>}
536
+ */
537
+ async get(userId) {
538
+ if (typeof userId === "undefined") {
539
+ throw new AppwriteException('Missing required parameter: "userId"');
540
+ }
541
+ const apiPath = "/users/{userId}".replace("{userId}", userId);
542
+ const payload = {};
543
+ const uri = new URL(this.client.config.endpoint + apiPath);
544
+ const apiHeaders = {
545
+ "content-type": "application/json"
546
+ };
547
+ return await this.client.call(
548
+ "get",
549
+ uri,
550
+ apiHeaders,
551
+ payload
552
+ );
553
+ }
554
+ /**
555
+ * Delete user
556
+ *
557
+ * Delete a user by its unique ID, thereby releasing it&#039;s ID. Since ID is released and can be reused, all user-related resources like documents or storage files should be deleted before user deletion. If you want to keep ID reserved, use the [updateStatus](https://appwrite.io/docs/server/users#usersUpdateStatus) endpoint instead.
558
+ *
559
+ * @param {string} userId
560
+ * @throws {AppwriteException}
561
+ * @returns {Promise<{}>}
562
+ */
563
+ async delete(userId) {
564
+ if (typeof userId === "undefined") {
565
+ throw new AppwriteException('Missing required parameter: "userId"');
566
+ }
567
+ const apiPath = "/users/{userId}".replace("{userId}", userId);
568
+ const payload = {};
569
+ const uri = new URL(this.client.config.endpoint + apiPath);
570
+ const apiHeaders = {
571
+ "content-type": "application/json"
572
+ };
573
+ return await this.client.call(
574
+ "delete",
575
+ uri,
576
+ apiHeaders,
577
+ payload
578
+ );
579
+ }
580
+ /**
581
+ * Update email
582
+ *
583
+ * Update the user email by its unique ID.
584
+ *
585
+ * @param {string} userId
586
+ * @param {string} email
587
+ * @throws {AppwriteException}
588
+ * @returns {Promise<Models.User<Preferences>>}
589
+ */
590
+ async updateEmail(userId, email) {
591
+ if (typeof userId === "undefined") {
592
+ throw new AppwriteException('Missing required parameter: "userId"');
593
+ }
594
+ if (typeof email === "undefined") {
595
+ throw new AppwriteException('Missing required parameter: "email"');
596
+ }
597
+ const apiPath = "/users/{userId}/email".replace("{userId}", userId);
598
+ const payload = {};
599
+ if (typeof email !== "undefined") {
600
+ payload["email"] = email;
601
+ }
602
+ const uri = new URL(this.client.config.endpoint + apiPath);
603
+ const apiHeaders = {
604
+ "content-type": "application/json"
605
+ };
606
+ return await this.client.call(
607
+ "patch",
608
+ uri,
609
+ apiHeaders,
610
+ payload
611
+ );
612
+ }
613
+ /**
614
+ * Update user labels
615
+ *
616
+ * Update the user labels by its unique ID.
617
+
618
+ Labels can be used to grant access to resources. While teams are a way for user&#039;s to share access to a resource, labels can be defined by the developer to grant access without an invitation. See the [Permissions docs](https://appwrite.io/docs/permissions) for more info.
619
+ *
620
+ * @param {string} userId
621
+ * @param {string[]} labels
622
+ * @throws {AppwriteException}
623
+ * @returns {Promise<Models.User<Preferences>>}
624
+ */
625
+ async updateLabels(userId, labels) {
626
+ if (typeof userId === "undefined") {
627
+ throw new AppwriteException('Missing required parameter: "userId"');
628
+ }
629
+ if (typeof labels === "undefined") {
630
+ throw new AppwriteException('Missing required parameter: "labels"');
631
+ }
632
+ const apiPath = "/users/{userId}/labels".replace("{userId}", userId);
633
+ const payload = {};
634
+ if (typeof labels !== "undefined") {
635
+ payload["labels"] = labels;
636
+ }
637
+ const uri = new URL(this.client.config.endpoint + apiPath);
638
+ const apiHeaders = {
639
+ "content-type": "application/json"
640
+ };
641
+ return await this.client.call(
642
+ "put",
643
+ uri,
644
+ apiHeaders,
645
+ payload
646
+ );
647
+ }
648
+ /**
649
+ * List user logs
650
+ *
651
+ * Get the user activity logs list by its unique ID.
652
+ *
653
+ * @param {string} userId
654
+ * @param {string[]} queries
655
+ * @throws {AppwriteException}
656
+ * @returns {Promise<Models.LogList>}
657
+ */
658
+ async listLogs(userId, queries) {
659
+ if (typeof userId === "undefined") {
660
+ throw new AppwriteException('Missing required parameter: "userId"');
661
+ }
662
+ const apiPath = "/users/{userId}/logs".replace("{userId}", userId);
663
+ const payload = {};
664
+ if (typeof queries !== "undefined") {
665
+ payload["queries"] = queries;
666
+ }
667
+ const uri = new URL(this.client.config.endpoint + apiPath);
668
+ const apiHeaders = {
669
+ "content-type": "application/json"
670
+ };
671
+ return await this.client.call(
672
+ "get",
673
+ uri,
674
+ apiHeaders,
675
+ payload
676
+ );
677
+ }
678
+ /**
679
+ * List user memberships
680
+ *
681
+ * Get the user membership list by its unique ID.
682
+ *
683
+ * @param {string} userId
684
+ * @throws {AppwriteException}
685
+ * @returns {Promise<Models.MembershipList>}
686
+ */
687
+ async listMemberships(userId) {
688
+ if (typeof userId === "undefined") {
689
+ throw new AppwriteException('Missing required parameter: "userId"');
690
+ }
691
+ const apiPath = "/users/{userId}/memberships".replace("{userId}", userId);
692
+ const payload = {};
693
+ const uri = new URL(this.client.config.endpoint + apiPath);
694
+ const apiHeaders = {
695
+ "content-type": "application/json"
696
+ };
697
+ return await this.client.call(
698
+ "get",
699
+ uri,
700
+ apiHeaders,
701
+ payload
702
+ );
703
+ }
704
+ /**
705
+ * Update MFA
706
+ *
707
+ * Enable or disable MFA on a user account.
708
+ *
709
+ * @param {string} userId
710
+ * @param {boolean} mfa
711
+ * @throws {AppwriteException}
712
+ * @returns {Promise<Models.User<Preferences>>}
713
+ */
714
+ async updateMfa(userId, mfa) {
715
+ if (typeof userId === "undefined") {
716
+ throw new AppwriteException('Missing required parameter: "userId"');
717
+ }
718
+ if (typeof mfa === "undefined") {
719
+ throw new AppwriteException('Missing required parameter: "mfa"');
720
+ }
721
+ const apiPath = "/users/{userId}/mfa".replace("{userId}", userId);
722
+ const payload = {};
723
+ if (typeof mfa !== "undefined") {
724
+ payload["mfa"] = mfa;
725
+ }
726
+ const uri = new URL(this.client.config.endpoint + apiPath);
727
+ const apiHeaders = {
728
+ "content-type": "application/json"
729
+ };
730
+ return await this.client.call(
731
+ "patch",
732
+ uri,
733
+ apiHeaders,
734
+ payload
735
+ );
736
+ }
737
+ /**
738
+ * Delete Authenticator
739
+ *
740
+ * Delete an authenticator app.
741
+ *
742
+ * @param {string} userId
743
+ * @param {AuthenticatorType} type
744
+ * @throws {AppwriteException}
745
+ * @returns {Promise<Models.User<Preferences>>}
746
+ */
747
+ async deleteMfaAuthenticator(userId, type) {
748
+ if (typeof userId === "undefined") {
749
+ throw new AppwriteException('Missing required parameter: "userId"');
750
+ }
751
+ if (typeof type === "undefined") {
752
+ throw new AppwriteException('Missing required parameter: "type"');
753
+ }
754
+ const apiPath = "/users/{userId}/mfa/authenticators/{type}".replace("{userId}", userId).replace("{type}", type);
755
+ const payload = {};
756
+ const uri = new URL(this.client.config.endpoint + apiPath);
757
+ const apiHeaders = {
758
+ "content-type": "application/json"
759
+ };
760
+ return await this.client.call(
761
+ "delete",
762
+ uri,
763
+ apiHeaders,
764
+ payload
765
+ );
766
+ }
767
+ /**
768
+ * List Factors
769
+ *
770
+ * List the factors available on the account to be used as a MFA challange.
771
+ *
772
+ * @param {string} userId
773
+ * @throws {AppwriteException}
774
+ * @returns {Promise<Models.MfaFactors>}
775
+ */
776
+ async listMfaFactors(userId) {
777
+ if (typeof userId === "undefined") {
778
+ throw new AppwriteException('Missing required parameter: "userId"');
779
+ }
780
+ const apiPath = "/users/{userId}/mfa/factors".replace("{userId}", userId);
781
+ const payload = {};
782
+ const uri = new URL(this.client.config.endpoint + apiPath);
783
+ const apiHeaders = {
784
+ "content-type": "application/json"
785
+ };
786
+ return await this.client.call(
787
+ "get",
788
+ uri,
789
+ apiHeaders,
790
+ payload
791
+ );
792
+ }
793
+ /**
794
+ * Get MFA Recovery Codes
795
+ *
796
+ * Get recovery codes that can be used as backup for MFA flow by User ID. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
797
+ *
798
+ * @param {string} userId
799
+ * @throws {AppwriteException}
800
+ * @returns {Promise<Models.MfaRecoveryCodes>}
801
+ */
802
+ async getMfaRecoveryCodes(userId) {
803
+ if (typeof userId === "undefined") {
804
+ throw new AppwriteException('Missing required parameter: "userId"');
805
+ }
806
+ const apiPath = "/users/{userId}/mfa/recovery-codes".replace("{userId}", userId);
807
+ const payload = {};
808
+ const uri = new URL(this.client.config.endpoint + apiPath);
809
+ const apiHeaders = {
810
+ "content-type": "application/json"
811
+ };
812
+ return await this.client.call(
813
+ "get",
814
+ uri,
815
+ apiHeaders,
816
+ payload
817
+ );
818
+ }
819
+ /**
820
+ * Regenerate MFA Recovery Codes
821
+ *
822
+ * Regenerate recovery codes that can be used as backup for MFA flow by User ID. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method.
823
+ *
824
+ * @param {string} userId
825
+ * @throws {AppwriteException}
826
+ * @returns {Promise<Models.MfaRecoveryCodes>}
827
+ */
828
+ async updateMfaRecoveryCodes(userId) {
829
+ if (typeof userId === "undefined") {
830
+ throw new AppwriteException('Missing required parameter: "userId"');
831
+ }
832
+ const apiPath = "/users/{userId}/mfa/recovery-codes".replace("{userId}", userId);
833
+ const payload = {};
834
+ const uri = new URL(this.client.config.endpoint + apiPath);
835
+ const apiHeaders = {
836
+ "content-type": "application/json"
837
+ };
838
+ return await this.client.call(
839
+ "put",
840
+ uri,
841
+ apiHeaders,
842
+ payload
843
+ );
844
+ }
845
+ /**
846
+ * Create MFA Recovery Codes
847
+ *
848
+ * Generate recovery codes used as backup for MFA flow for User ID. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method by client SDK.
849
+ *
850
+ * @param {string} userId
851
+ * @throws {AppwriteException}
852
+ * @returns {Promise<Models.MfaRecoveryCodes>}
853
+ */
854
+ async createMfaRecoveryCodes(userId) {
855
+ if (typeof userId === "undefined") {
856
+ throw new AppwriteException('Missing required parameter: "userId"');
857
+ }
858
+ const apiPath = "/users/{userId}/mfa/recovery-codes".replace("{userId}", userId);
859
+ const payload = {};
860
+ const uri = new URL(this.client.config.endpoint + apiPath);
861
+ const apiHeaders = {
862
+ "content-type": "application/json"
863
+ };
864
+ return await this.client.call(
865
+ "patch",
866
+ uri,
867
+ apiHeaders,
868
+ payload
869
+ );
870
+ }
871
+ /**
872
+ * Update name
873
+ *
874
+ * Update the user name by its unique ID.
875
+ *
876
+ * @param {string} userId
877
+ * @param {string} name
878
+ * @throws {AppwriteException}
879
+ * @returns {Promise<Models.User<Preferences>>}
880
+ */
881
+ async updateName(userId, name) {
882
+ if (typeof userId === "undefined") {
883
+ throw new AppwriteException('Missing required parameter: "userId"');
884
+ }
885
+ if (typeof name === "undefined") {
886
+ throw new AppwriteException('Missing required parameter: "name"');
887
+ }
888
+ const apiPath = "/users/{userId}/name".replace("{userId}", userId);
889
+ const payload = {};
890
+ if (typeof name !== "undefined") {
891
+ payload["name"] = name;
892
+ }
893
+ const uri = new URL(this.client.config.endpoint + apiPath);
894
+ const apiHeaders = {
895
+ "content-type": "application/json"
896
+ };
897
+ return await this.client.call(
898
+ "patch",
899
+ uri,
900
+ apiHeaders,
901
+ payload
902
+ );
903
+ }
904
+ /**
905
+ * Update password
906
+ *
907
+ * Update the user password by its unique ID.
908
+ *
909
+ * @param {string} userId
910
+ * @param {string} password
911
+ * @throws {AppwriteException}
912
+ * @returns {Promise<Models.User<Preferences>>}
913
+ */
914
+ async updatePassword(userId, password) {
915
+ if (typeof userId === "undefined") {
916
+ throw new AppwriteException('Missing required parameter: "userId"');
917
+ }
918
+ if (typeof password === "undefined") {
919
+ throw new AppwriteException('Missing required parameter: "password"');
920
+ }
921
+ const apiPath = "/users/{userId}/password".replace("{userId}", userId);
922
+ const payload = {};
923
+ if (typeof password !== "undefined") {
924
+ payload["password"] = password;
925
+ }
926
+ const uri = new URL(this.client.config.endpoint + apiPath);
927
+ const apiHeaders = {
928
+ "content-type": "application/json"
929
+ };
930
+ return await this.client.call(
931
+ "patch",
932
+ uri,
933
+ apiHeaders,
934
+ payload
935
+ );
936
+ }
937
+ /**
938
+ * Update phone
939
+ *
940
+ * Update the user phone by its unique ID.
941
+ *
942
+ * @param {string} userId
943
+ * @param {string} number
944
+ * @throws {AppwriteException}
945
+ * @returns {Promise<Models.User<Preferences>>}
946
+ */
947
+ async updatePhone(userId, number) {
948
+ if (typeof userId === "undefined") {
949
+ throw new AppwriteException('Missing required parameter: "userId"');
950
+ }
951
+ if (typeof number === "undefined") {
952
+ throw new AppwriteException('Missing required parameter: "number"');
953
+ }
954
+ const apiPath = "/users/{userId}/phone".replace("{userId}", userId);
955
+ const payload = {};
956
+ if (typeof number !== "undefined") {
957
+ payload["number"] = number;
958
+ }
959
+ const uri = new URL(this.client.config.endpoint + apiPath);
960
+ const apiHeaders = {
961
+ "content-type": "application/json"
962
+ };
963
+ return await this.client.call(
964
+ "patch",
965
+ uri,
966
+ apiHeaders,
967
+ payload
968
+ );
969
+ }
970
+ /**
971
+ * Get user preferences
972
+ *
973
+ * Get the user preferences by its unique ID.
974
+ *
975
+ * @param {string} userId
976
+ * @throws {AppwriteException}
977
+ * @returns {Promise<Preferences>}
978
+ */
979
+ async getPrefs(userId) {
980
+ if (typeof userId === "undefined") {
981
+ throw new AppwriteException('Missing required parameter: "userId"');
982
+ }
983
+ const apiPath = "/users/{userId}/prefs".replace("{userId}", userId);
984
+ const payload = {};
985
+ const uri = new URL(this.client.config.endpoint + apiPath);
986
+ const apiHeaders = {
987
+ "content-type": "application/json"
988
+ };
989
+ return await this.client.call(
990
+ "get",
991
+ uri,
992
+ apiHeaders,
993
+ payload
994
+ );
995
+ }
996
+ /**
997
+ * Update user preferences
998
+ *
999
+ * Update the user preferences by its unique ID. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.
1000
+ *
1001
+ * @param {string} userId
1002
+ * @param {object} prefs
1003
+ * @throws {AppwriteException}
1004
+ * @returns {Promise<Preferences>}
1005
+ */
1006
+ async updatePrefs(userId, prefs) {
1007
+ if (typeof userId === "undefined") {
1008
+ throw new AppwriteException('Missing required parameter: "userId"');
1009
+ }
1010
+ if (typeof prefs === "undefined") {
1011
+ throw new AppwriteException('Missing required parameter: "prefs"');
1012
+ }
1013
+ const apiPath = "/users/{userId}/prefs".replace("{userId}", userId);
1014
+ const payload = {};
1015
+ if (typeof prefs !== "undefined") {
1016
+ payload["prefs"] = prefs;
1017
+ }
1018
+ const uri = new URL(this.client.config.endpoint + apiPath);
1019
+ const apiHeaders = {
1020
+ "content-type": "application/json"
1021
+ };
1022
+ return await this.client.call(
1023
+ "patch",
1024
+ uri,
1025
+ apiHeaders,
1026
+ payload
1027
+ );
1028
+ }
1029
+ /**
1030
+ * List user sessions
1031
+ *
1032
+ * Get the user sessions list by its unique ID.
1033
+ *
1034
+ * @param {string} userId
1035
+ * @throws {AppwriteException}
1036
+ * @returns {Promise<Models.SessionList>}
1037
+ */
1038
+ async listSessions(userId) {
1039
+ if (typeof userId === "undefined") {
1040
+ throw new AppwriteException('Missing required parameter: "userId"');
1041
+ }
1042
+ const apiPath = "/users/{userId}/sessions".replace("{userId}", userId);
1043
+ const payload = {};
1044
+ const uri = new URL(this.client.config.endpoint + apiPath);
1045
+ const apiHeaders = {
1046
+ "content-type": "application/json"
1047
+ };
1048
+ return await this.client.call(
1049
+ "get",
1050
+ uri,
1051
+ apiHeaders,
1052
+ payload
1053
+ );
1054
+ }
1055
+ /**
1056
+ * Create session
1057
+ *
1058
+ * Creates a session for a user. Returns an immediately usable session object.
1059
+
1060
+ If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appwrite.io/docs/server/users#createToken) endpoint.
1061
+ *
1062
+ * @param {string} userId
1063
+ * @throws {AppwriteException}
1064
+ * @returns {Promise<Models.Session>}
1065
+ */
1066
+ async createSession(userId) {
1067
+ if (typeof userId === "undefined") {
1068
+ throw new AppwriteException('Missing required parameter: "userId"');
1069
+ }
1070
+ const apiPath = "/users/{userId}/sessions".replace("{userId}", userId);
1071
+ const payload = {};
1072
+ const uri = new URL(this.client.config.endpoint + apiPath);
1073
+ const apiHeaders = {
1074
+ "content-type": "application/json"
1075
+ };
1076
+ return await this.client.call(
1077
+ "post",
1078
+ uri,
1079
+ apiHeaders,
1080
+ payload
1081
+ );
1082
+ }
1083
+ /**
1084
+ * Delete user sessions
1085
+ *
1086
+ * Delete all user&#039;s sessions by using the user&#039;s unique ID.
1087
+ *
1088
+ * @param {string} userId
1089
+ * @throws {AppwriteException}
1090
+ * @returns {Promise<{}>}
1091
+ */
1092
+ async deleteSessions(userId) {
1093
+ if (typeof userId === "undefined") {
1094
+ throw new AppwriteException('Missing required parameter: "userId"');
1095
+ }
1096
+ const apiPath = "/users/{userId}/sessions".replace("{userId}", userId);
1097
+ const payload = {};
1098
+ const uri = new URL(this.client.config.endpoint + apiPath);
1099
+ const apiHeaders = {
1100
+ "content-type": "application/json"
1101
+ };
1102
+ return await this.client.call(
1103
+ "delete",
1104
+ uri,
1105
+ apiHeaders,
1106
+ payload
1107
+ );
1108
+ }
1109
+ /**
1110
+ * Delete user session
1111
+ *
1112
+ * Delete a user sessions by its unique ID.
1113
+ *
1114
+ * @param {string} userId
1115
+ * @param {string} sessionId
1116
+ * @throws {AppwriteException}
1117
+ * @returns {Promise<{}>}
1118
+ */
1119
+ async deleteSession(userId, sessionId) {
1120
+ if (typeof userId === "undefined") {
1121
+ throw new AppwriteException('Missing required parameter: "userId"');
1122
+ }
1123
+ if (typeof sessionId === "undefined") {
1124
+ throw new AppwriteException('Missing required parameter: "sessionId"');
1125
+ }
1126
+ const apiPath = "/users/{userId}/sessions/{sessionId}".replace("{userId}", userId).replace("{sessionId}", sessionId);
1127
+ const payload = {};
1128
+ const uri = new URL(this.client.config.endpoint + apiPath);
1129
+ const apiHeaders = {
1130
+ "content-type": "application/json"
1131
+ };
1132
+ return await this.client.call(
1133
+ "delete",
1134
+ uri,
1135
+ apiHeaders,
1136
+ payload
1137
+ );
1138
+ }
1139
+ /**
1140
+ * Update user status
1141
+ *
1142
+ * Update the user status by its unique ID. Use this endpoint as an alternative to deleting a user if you want to keep user&#039;s ID reserved.
1143
+ *
1144
+ * @param {string} userId
1145
+ * @param {boolean} status
1146
+ * @throws {AppwriteException}
1147
+ * @returns {Promise<Models.User<Preferences>>}
1148
+ */
1149
+ async updateStatus(userId, status) {
1150
+ if (typeof userId === "undefined") {
1151
+ throw new AppwriteException('Missing required parameter: "userId"');
1152
+ }
1153
+ if (typeof status === "undefined") {
1154
+ throw new AppwriteException('Missing required parameter: "status"');
1155
+ }
1156
+ const apiPath = "/users/{userId}/status".replace("{userId}", userId);
1157
+ const payload = {};
1158
+ if (typeof status !== "undefined") {
1159
+ payload["status"] = status;
1160
+ }
1161
+ const uri = new URL(this.client.config.endpoint + apiPath);
1162
+ const apiHeaders = {
1163
+ "content-type": "application/json"
1164
+ };
1165
+ return await this.client.call(
1166
+ "patch",
1167
+ uri,
1168
+ apiHeaders,
1169
+ payload
1170
+ );
1171
+ }
1172
+ /**
1173
+ * List User Targets
1174
+ *
1175
+ * List the messaging targets that are associated with a user.
1176
+ *
1177
+ * @param {string} userId
1178
+ * @param {string[]} queries
1179
+ * @throws {AppwriteException}
1180
+ * @returns {Promise<Models.TargetList>}
1181
+ */
1182
+ async listTargets(userId, queries) {
1183
+ if (typeof userId === "undefined") {
1184
+ throw new AppwriteException('Missing required parameter: "userId"');
1185
+ }
1186
+ const apiPath = "/users/{userId}/targets".replace("{userId}", userId);
1187
+ const payload = {};
1188
+ if (typeof queries !== "undefined") {
1189
+ payload["queries"] = queries;
1190
+ }
1191
+ const uri = new URL(this.client.config.endpoint + apiPath);
1192
+ const apiHeaders = {
1193
+ "content-type": "application/json"
1194
+ };
1195
+ return await this.client.call(
1196
+ "get",
1197
+ uri,
1198
+ apiHeaders,
1199
+ payload
1200
+ );
1201
+ }
1202
+ /**
1203
+ * Create User Target
1204
+ *
1205
+ * Create a messaging target.
1206
+ *
1207
+ * @param {string} userId
1208
+ * @param {string} targetId
1209
+ * @param {MessagingProviderType} providerType
1210
+ * @param {string} identifier
1211
+ * @param {string} providerId
1212
+ * @param {string} name
1213
+ * @throws {AppwriteException}
1214
+ * @returns {Promise<Models.Target>}
1215
+ */
1216
+ async createTarget(userId, targetId, providerType, identifier, providerId, name) {
1217
+ if (typeof userId === "undefined") {
1218
+ throw new AppwriteException('Missing required parameter: "userId"');
1219
+ }
1220
+ if (typeof targetId === "undefined") {
1221
+ throw new AppwriteException('Missing required parameter: "targetId"');
1222
+ }
1223
+ if (typeof providerType === "undefined") {
1224
+ throw new AppwriteException('Missing required parameter: "providerType"');
1225
+ }
1226
+ if (typeof identifier === "undefined") {
1227
+ throw new AppwriteException('Missing required parameter: "identifier"');
1228
+ }
1229
+ const apiPath = "/users/{userId}/targets".replace("{userId}", userId);
1230
+ const payload = {};
1231
+ if (typeof targetId !== "undefined") {
1232
+ payload["targetId"] = targetId;
1233
+ }
1234
+ if (typeof providerType !== "undefined") {
1235
+ payload["providerType"] = providerType;
1236
+ }
1237
+ if (typeof identifier !== "undefined") {
1238
+ payload["identifier"] = identifier;
1239
+ }
1240
+ if (typeof providerId !== "undefined") {
1241
+ payload["providerId"] = providerId;
1242
+ }
1243
+ if (typeof name !== "undefined") {
1244
+ payload["name"] = name;
1245
+ }
1246
+ const uri = new URL(this.client.config.endpoint + apiPath);
1247
+ const apiHeaders = {
1248
+ "content-type": "application/json"
1249
+ };
1250
+ return await this.client.call(
1251
+ "post",
1252
+ uri,
1253
+ apiHeaders,
1254
+ payload
1255
+ );
1256
+ }
1257
+ /**
1258
+ * Get User Target
1259
+ *
1260
+ * Get a user&#039;s push notification target by ID.
1261
+ *
1262
+ * @param {string} userId
1263
+ * @param {string} targetId
1264
+ * @throws {AppwriteException}
1265
+ * @returns {Promise<Models.Target>}
1266
+ */
1267
+ async getTarget(userId, targetId) {
1268
+ if (typeof userId === "undefined") {
1269
+ throw new AppwriteException('Missing required parameter: "userId"');
1270
+ }
1271
+ if (typeof targetId === "undefined") {
1272
+ throw new AppwriteException('Missing required parameter: "targetId"');
1273
+ }
1274
+ const apiPath = "/users/{userId}/targets/{targetId}".replace("{userId}", userId).replace("{targetId}", targetId);
1275
+ const payload = {};
1276
+ const uri = new URL(this.client.config.endpoint + apiPath);
1277
+ const apiHeaders = {
1278
+ "content-type": "application/json"
1279
+ };
1280
+ return await this.client.call(
1281
+ "get",
1282
+ uri,
1283
+ apiHeaders,
1284
+ payload
1285
+ );
1286
+ }
1287
+ /**
1288
+ * Update User target
1289
+ *
1290
+ * Update a messaging target.
1291
+ *
1292
+ * @param {string} userId
1293
+ * @param {string} targetId
1294
+ * @param {string} identifier
1295
+ * @param {string} providerId
1296
+ * @param {string} name
1297
+ * @throws {AppwriteException}
1298
+ * @returns {Promise<Models.Target>}
1299
+ */
1300
+ async updateTarget(userId, targetId, identifier, providerId, name) {
1301
+ if (typeof userId === "undefined") {
1302
+ throw new AppwriteException('Missing required parameter: "userId"');
1303
+ }
1304
+ if (typeof targetId === "undefined") {
1305
+ throw new AppwriteException('Missing required parameter: "targetId"');
1306
+ }
1307
+ const apiPath = "/users/{userId}/targets/{targetId}".replace("{userId}", userId).replace("{targetId}", targetId);
1308
+ const payload = {};
1309
+ if (typeof identifier !== "undefined") {
1310
+ payload["identifier"] = identifier;
1311
+ }
1312
+ if (typeof providerId !== "undefined") {
1313
+ payload["providerId"] = providerId;
1314
+ }
1315
+ if (typeof name !== "undefined") {
1316
+ payload["name"] = name;
1317
+ }
1318
+ const uri = new URL(this.client.config.endpoint + apiPath);
1319
+ const apiHeaders = {
1320
+ "content-type": "application/json"
1321
+ };
1322
+ return await this.client.call(
1323
+ "patch",
1324
+ uri,
1325
+ apiHeaders,
1326
+ payload
1327
+ );
1328
+ }
1329
+ /**
1330
+ * Delete user target
1331
+ *
1332
+ * Delete a messaging target.
1333
+ *
1334
+ * @param {string} userId
1335
+ * @param {string} targetId
1336
+ * @throws {AppwriteException}
1337
+ * @returns {Promise<{}>}
1338
+ */
1339
+ async deleteTarget(userId, targetId) {
1340
+ if (typeof userId === "undefined") {
1341
+ throw new AppwriteException('Missing required parameter: "userId"');
1342
+ }
1343
+ if (typeof targetId === "undefined") {
1344
+ throw new AppwriteException('Missing required parameter: "targetId"');
1345
+ }
1346
+ const apiPath = "/users/{userId}/targets/{targetId}".replace("{userId}", userId).replace("{targetId}", targetId);
1347
+ const payload = {};
1348
+ const uri = new URL(this.client.config.endpoint + apiPath);
1349
+ const apiHeaders = {
1350
+ "content-type": "application/json"
1351
+ };
1352
+ return await this.client.call(
1353
+ "delete",
1354
+ uri,
1355
+ apiHeaders,
1356
+ payload
1357
+ );
1358
+ }
1359
+ /**
1360
+ * Create token
1361
+ *
1362
+ * Returns a token with a secret key for creating a session. Use the user ID and secret and submit a request to the [PUT /account/sessions/token](https://appwrite.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process.
1363
+
1364
+ *
1365
+ * @param {string} userId
1366
+ * @param {number} length
1367
+ * @param {number} expire
1368
+ * @throws {AppwriteException}
1369
+ * @returns {Promise<Models.Token>}
1370
+ */
1371
+ async createToken(userId, length, expire) {
1372
+ if (typeof userId === "undefined") {
1373
+ throw new AppwriteException('Missing required parameter: "userId"');
1374
+ }
1375
+ const apiPath = "/users/{userId}/tokens".replace("{userId}", userId);
1376
+ const payload = {};
1377
+ if (typeof length !== "undefined") {
1378
+ payload["length"] = length;
1379
+ }
1380
+ if (typeof expire !== "undefined") {
1381
+ payload["expire"] = expire;
1382
+ }
1383
+ const uri = new URL(this.client.config.endpoint + apiPath);
1384
+ const apiHeaders = {
1385
+ "content-type": "application/json"
1386
+ };
1387
+ return await this.client.call(
1388
+ "post",
1389
+ uri,
1390
+ apiHeaders,
1391
+ payload
1392
+ );
1393
+ }
1394
+ /**
1395
+ * Update email verification
1396
+ *
1397
+ * Update the user email verification status by its unique ID.
1398
+ *
1399
+ * @param {string} userId
1400
+ * @param {boolean} emailVerification
1401
+ * @throws {AppwriteException}
1402
+ * @returns {Promise<Models.User<Preferences>>}
1403
+ */
1404
+ async updateEmailVerification(userId, emailVerification) {
1405
+ if (typeof userId === "undefined") {
1406
+ throw new AppwriteException('Missing required parameter: "userId"');
1407
+ }
1408
+ if (typeof emailVerification === "undefined") {
1409
+ throw new AppwriteException('Missing required parameter: "emailVerification"');
1410
+ }
1411
+ const apiPath = "/users/{userId}/verification".replace("{userId}", userId);
1412
+ const payload = {};
1413
+ if (typeof emailVerification !== "undefined") {
1414
+ payload["emailVerification"] = emailVerification;
1415
+ }
1416
+ const uri = new URL(this.client.config.endpoint + apiPath);
1417
+ const apiHeaders = {
1418
+ "content-type": "application/json"
1419
+ };
1420
+ return await this.client.call(
1421
+ "patch",
1422
+ uri,
1423
+ apiHeaders,
1424
+ payload
1425
+ );
1426
+ }
1427
+ /**
1428
+ * Update phone verification
1429
+ *
1430
+ * Update the user phone verification status by its unique ID.
1431
+ *
1432
+ * @param {string} userId
1433
+ * @param {boolean} phoneVerification
1434
+ * @throws {AppwriteException}
1435
+ * @returns {Promise<Models.User<Preferences>>}
1436
+ */
1437
+ async updatePhoneVerification(userId, phoneVerification) {
1438
+ if (typeof userId === "undefined") {
1439
+ throw new AppwriteException('Missing required parameter: "userId"');
1440
+ }
1441
+ if (typeof phoneVerification === "undefined") {
1442
+ throw new AppwriteException('Missing required parameter: "phoneVerification"');
1443
+ }
1444
+ const apiPath = "/users/{userId}/verification/phone".replace("{userId}", userId);
1445
+ const payload = {};
1446
+ if (typeof phoneVerification !== "undefined") {
1447
+ payload["phoneVerification"] = phoneVerification;
1448
+ }
1449
+ const uri = new URL(this.client.config.endpoint + apiPath);
1450
+ const apiHeaders = {
1451
+ "content-type": "application/json"
1452
+ };
1453
+ return await this.client.call(
1454
+ "patch",
1455
+ uri,
1456
+ apiHeaders,
1457
+ payload
1458
+ );
1459
+ }
1460
+ };
1461
+
1462
+ export { Users };
1463
+ //# sourceMappingURL=out.js.map
1464
+ //# sourceMappingURL=users.mjs.map