@eveai/eve-sdk-for-node 0.0.1 → 0.0.3

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 (447) hide show
  1. package/README.md.bak +510 -0
  2. package/README.md.orig +510 -0
  3. package/dist/client.d.mts +110 -0
  4. package/dist/client.d.ts +110 -0
  5. package/dist/client.js +292 -0
  6. package/dist/client.js.map +1 -0
  7. package/dist/client.mjs +286 -0
  8. package/dist/client.mjs.map +1 -0
  9. package/dist/enums/adapter.d.mts +6 -0
  10. package/dist/enums/adapter.d.ts +6 -0
  11. package/dist/enums/adapter.js +11 -0
  12. package/dist/enums/adapter.js.map +1 -0
  13. package/dist/enums/adapter.mjs +10 -0
  14. package/dist/enums/adapter.mjs.map +1 -0
  15. package/dist/enums/attribute-status.d.mts +9 -0
  16. package/dist/enums/attribute-status.d.ts +9 -0
  17. package/dist/enums/attribute-status.js +14 -0
  18. package/dist/enums/attribute-status.js.map +1 -0
  19. package/dist/enums/attribute-status.mjs +13 -0
  20. package/dist/enums/attribute-status.mjs.map +1 -0
  21. package/dist/enums/authentication-factor.d.mts +8 -0
  22. package/dist/enums/authentication-factor.d.ts +8 -0
  23. package/dist/enums/authentication-factor.js +13 -0
  24. package/dist/enums/authentication-factor.js.map +1 -0
  25. package/dist/enums/authentication-factor.mjs +12 -0
  26. package/dist/enums/authentication-factor.mjs.map +1 -0
  27. package/dist/enums/authenticator-type.d.mts +5 -0
  28. package/dist/enums/authenticator-type.d.ts +5 -0
  29. package/dist/enums/authenticator-type.js +10 -0
  30. package/dist/enums/authenticator-type.js.map +1 -0
  31. package/dist/enums/authenticator-type.mjs +9 -0
  32. package/dist/enums/authenticator-type.mjs.map +1 -0
  33. package/dist/enums/browser.d.mts +18 -0
  34. package/dist/enums/browser.d.ts +18 -0
  35. package/dist/enums/browser.js +23 -0
  36. package/dist/enums/browser.js.map +1 -0
  37. package/dist/enums/browser.mjs +22 -0
  38. package/dist/enums/browser.mjs.map +1 -0
  39. package/dist/enums/build-runtime.d.mts +71 -0
  40. package/dist/enums/build-runtime.d.ts +71 -0
  41. package/dist/enums/build-runtime.js +76 -0
  42. package/dist/enums/build-runtime.js.map +1 -0
  43. package/dist/enums/build-runtime.mjs +75 -0
  44. package/dist/enums/build-runtime.mjs.map +1 -0
  45. package/dist/enums/column-status.d.mts +9 -0
  46. package/dist/enums/column-status.d.ts +9 -0
  47. package/dist/enums/column-status.js +14 -0
  48. package/dist/enums/column-status.js.map +1 -0
  49. package/dist/enums/column-status.mjs +13 -0
  50. package/dist/enums/column-status.mjs.map +1 -0
  51. package/dist/enums/compression.d.mts +7 -0
  52. package/dist/enums/compression.d.ts +7 -0
  53. package/dist/enums/compression.js +12 -0
  54. package/dist/enums/compression.js.map +1 -0
  55. package/dist/enums/compression.mjs +11 -0
  56. package/dist/enums/compression.mjs.map +1 -0
  57. package/dist/enums/credit-card.d.mts +21 -0
  58. package/dist/enums/credit-card.d.ts +21 -0
  59. package/dist/enums/credit-card.js +26 -0
  60. package/dist/enums/credit-card.js.map +1 -0
  61. package/dist/enums/credit-card.mjs +25 -0
  62. package/dist/enums/credit-card.mjs.map +1 -0
  63. package/dist/enums/database-type.d.mts +6 -0
  64. package/dist/enums/database-type.d.ts +6 -0
  65. package/dist/enums/database-type.js +11 -0
  66. package/dist/enums/database-type.js.map +1 -0
  67. package/dist/enums/database-type.mjs +10 -0
  68. package/dist/enums/database-type.mjs.map +1 -0
  69. package/dist/enums/deployment-download-type.d.mts +6 -0
  70. package/dist/enums/deployment-download-type.d.ts +6 -0
  71. package/dist/enums/deployment-download-type.js +11 -0
  72. package/dist/enums/deployment-download-type.js.map +1 -0
  73. package/dist/enums/deployment-download-type.mjs +10 -0
  74. package/dist/enums/deployment-download-type.mjs.map +1 -0
  75. package/dist/enums/deployment-status.d.mts +9 -0
  76. package/dist/enums/deployment-status.d.ts +9 -0
  77. package/dist/enums/deployment-status.js +14 -0
  78. package/dist/enums/deployment-status.js.map +1 -0
  79. package/dist/enums/deployment-status.mjs +13 -0
  80. package/dist/enums/deployment-status.mjs.map +1 -0
  81. package/dist/enums/execution-method.d.mts +11 -0
  82. package/dist/enums/execution-method.d.ts +11 -0
  83. package/dist/enums/execution-method.js +16 -0
  84. package/dist/enums/execution-method.js.map +1 -0
  85. package/dist/enums/execution-method.mjs +15 -0
  86. package/dist/enums/execution-method.mjs.map +1 -0
  87. package/dist/enums/execution-status.d.mts +9 -0
  88. package/dist/enums/execution-status.d.ts +9 -0
  89. package/dist/enums/execution-status.js +14 -0
  90. package/dist/enums/execution-status.js.map +1 -0
  91. package/dist/enums/execution-status.mjs +13 -0
  92. package/dist/enums/execution-status.mjs.map +1 -0
  93. package/dist/enums/execution-trigger.d.mts +7 -0
  94. package/dist/enums/execution-trigger.d.ts +7 -0
  95. package/dist/enums/execution-trigger.js +12 -0
  96. package/dist/enums/execution-trigger.js.map +1 -0
  97. package/dist/enums/execution-trigger.mjs +11 -0
  98. package/dist/enums/execution-trigger.mjs.map +1 -0
  99. package/dist/enums/flag.d.mts +199 -0
  100. package/dist/enums/flag.d.ts +199 -0
  101. package/dist/enums/flag.js +204 -0
  102. package/dist/enums/flag.js.map +1 -0
  103. package/dist/enums/flag.mjs +203 -0
  104. package/dist/enums/flag.mjs.map +1 -0
  105. package/dist/enums/framework.d.mts +19 -0
  106. package/dist/enums/framework.d.ts +19 -0
  107. package/dist/enums/framework.js +24 -0
  108. package/dist/enums/framework.js.map +1 -0
  109. package/dist/enums/framework.mjs +23 -0
  110. package/dist/enums/framework.mjs.map +1 -0
  111. package/dist/enums/health-antivirus-status.d.mts +7 -0
  112. package/dist/enums/health-antivirus-status.d.ts +7 -0
  113. package/dist/enums/health-antivirus-status.js +12 -0
  114. package/dist/enums/health-antivirus-status.js.map +1 -0
  115. package/dist/enums/health-antivirus-status.mjs +11 -0
  116. package/dist/enums/health-antivirus-status.mjs.map +1 -0
  117. package/dist/enums/health-check-status.d.mts +6 -0
  118. package/dist/enums/health-check-status.d.ts +6 -0
  119. package/dist/enums/health-check-status.js +11 -0
  120. package/dist/enums/health-check-status.js.map +1 -0
  121. package/dist/enums/health-check-status.mjs +10 -0
  122. package/dist/enums/health-check-status.mjs.map +1 -0
  123. package/dist/enums/image-format.d.mts +11 -0
  124. package/dist/enums/image-format.d.ts +11 -0
  125. package/dist/enums/image-format.js +16 -0
  126. package/dist/enums/image-format.js.map +1 -0
  127. package/dist/enums/image-format.mjs +15 -0
  128. package/dist/enums/image-format.mjs.map +1 -0
  129. package/dist/enums/image-gravity.d.mts +13 -0
  130. package/dist/enums/image-gravity.d.ts +13 -0
  131. package/dist/enums/image-gravity.js +18 -0
  132. package/dist/enums/image-gravity.js.map +1 -0
  133. package/dist/enums/image-gravity.mjs +17 -0
  134. package/dist/enums/image-gravity.mjs.map +1 -0
  135. package/dist/enums/index-status.d.mts +9 -0
  136. package/dist/enums/index-status.d.ts +9 -0
  137. package/dist/enums/index-status.js +14 -0
  138. package/dist/enums/index-status.js.map +1 -0
  139. package/dist/enums/index-status.mjs +13 -0
  140. package/dist/enums/index-status.mjs.map +1 -0
  141. package/dist/enums/index-type.d.mts +8 -0
  142. package/dist/enums/index-type.d.ts +8 -0
  143. package/dist/enums/index-type.js +13 -0
  144. package/dist/enums/index-type.js.map +1 -0
  145. package/dist/enums/index-type.mjs +12 -0
  146. package/dist/enums/index-type.mjs.map +1 -0
  147. package/dist/enums/message-priority.d.mts +6 -0
  148. package/dist/enums/message-priority.d.ts +6 -0
  149. package/dist/enums/message-priority.js +11 -0
  150. package/dist/enums/message-priority.js.map +1 -0
  151. package/dist/enums/message-priority.mjs +10 -0
  152. package/dist/enums/message-priority.mjs.map +1 -0
  153. package/dist/enums/message-status.d.mts +9 -0
  154. package/dist/enums/message-status.d.ts +9 -0
  155. package/dist/enums/message-status.js +14 -0
  156. package/dist/enums/message-status.js.map +1 -0
  157. package/dist/enums/message-status.mjs +13 -0
  158. package/dist/enums/message-status.mjs.map +1 -0
  159. package/dist/enums/messaging-provider-type.d.mts +7 -0
  160. package/dist/enums/messaging-provider-type.d.ts +7 -0
  161. package/dist/enums/messaging-provider-type.js +12 -0
  162. package/dist/enums/messaging-provider-type.js.map +1 -0
  163. package/dist/enums/messaging-provider-type.mjs +11 -0
  164. package/dist/enums/messaging-provider-type.mjs.map +1 -0
  165. package/dist/enums/name.d.mts +16 -0
  166. package/dist/enums/name.d.ts +16 -0
  167. package/dist/enums/name.js +21 -0
  168. package/dist/enums/name.js.map +1 -0
  169. package/dist/enums/name.mjs +20 -0
  170. package/dist/enums/name.mjs.map +1 -0
  171. package/dist/enums/o-auth-provider.d.mts +44 -0
  172. package/dist/enums/o-auth-provider.d.ts +44 -0
  173. package/dist/enums/o-auth-provider.js +49 -0
  174. package/dist/enums/o-auth-provider.js.map +1 -0
  175. package/dist/enums/o-auth-provider.mjs +48 -0
  176. package/dist/enums/o-auth-provider.mjs.map +1 -0
  177. package/dist/enums/output.d.mts +11 -0
  178. package/dist/enums/output.d.ts +11 -0
  179. package/dist/enums/output.js +16 -0
  180. package/dist/enums/output.js.map +1 -0
  181. package/dist/enums/output.mjs +15 -0
  182. package/dist/enums/output.mjs.map +1 -0
  183. package/dist/enums/password-hash.d.mts +15 -0
  184. package/dist/enums/password-hash.d.ts +15 -0
  185. package/dist/enums/password-hash.js +20 -0
  186. package/dist/enums/password-hash.js.map +1 -0
  187. package/dist/enums/password-hash.mjs +19 -0
  188. package/dist/enums/password-hash.mjs.map +1 -0
  189. package/dist/enums/relation-mutate.d.mts +7 -0
  190. package/dist/enums/relation-mutate.d.ts +7 -0
  191. package/dist/enums/relation-mutate.js +12 -0
  192. package/dist/enums/relation-mutate.js.map +1 -0
  193. package/dist/enums/relation-mutate.mjs +11 -0
  194. package/dist/enums/relation-mutate.mjs.map +1 -0
  195. package/dist/enums/relationship-type.d.mts +8 -0
  196. package/dist/enums/relationship-type.d.ts +8 -0
  197. package/dist/enums/relationship-type.js +13 -0
  198. package/dist/enums/relationship-type.js.map +1 -0
  199. package/dist/enums/relationship-type.mjs +12 -0
  200. package/dist/enums/relationship-type.mjs.map +1 -0
  201. package/dist/enums/runtime.d.mts +71 -0
  202. package/dist/enums/runtime.d.ts +71 -0
  203. package/dist/enums/runtime.js +76 -0
  204. package/dist/enums/runtime.js.map +1 -0
  205. package/dist/enums/runtime.mjs +75 -0
  206. package/dist/enums/runtime.mjs.map +1 -0
  207. package/dist/enums/smtp-encryption.d.mts +7 -0
  208. package/dist/enums/smtp-encryption.d.ts +7 -0
  209. package/dist/enums/smtp-encryption.js +12 -0
  210. package/dist/enums/smtp-encryption.js.map +1 -0
  211. package/dist/enums/smtp-encryption.mjs +11 -0
  212. package/dist/enums/smtp-encryption.mjs.map +1 -0
  213. package/dist/enums/template-reference-type.d.mts +7 -0
  214. package/dist/enums/template-reference-type.d.ts +7 -0
  215. package/dist/enums/template-reference-type.js +12 -0
  216. package/dist/enums/template-reference-type.js.map +1 -0
  217. package/dist/enums/template-reference-type.mjs +11 -0
  218. package/dist/enums/template-reference-type.mjs.map +1 -0
  219. package/dist/enums/theme.d.mts +6 -0
  220. package/dist/enums/theme.d.ts +6 -0
  221. package/dist/enums/theme.js +11 -0
  222. package/dist/enums/theme.js.map +1 -0
  223. package/dist/enums/theme.mjs +10 -0
  224. package/dist/enums/theme.mjs.map +1 -0
  225. package/dist/enums/timezone.d.mts +423 -0
  226. package/dist/enums/timezone.d.ts +423 -0
  227. package/dist/enums/timezone.js +428 -0
  228. package/dist/enums/timezone.js.map +1 -0
  229. package/dist/enums/timezone.mjs +427 -0
  230. package/dist/enums/timezone.mjs.map +1 -0
  231. package/dist/enums/vcs-reference-type.d.mts +7 -0
  232. package/dist/enums/vcs-reference-type.d.ts +7 -0
  233. package/dist/enums/vcs-reference-type.js +12 -0
  234. package/dist/enums/vcs-reference-type.js.map +1 -0
  235. package/dist/enums/vcs-reference-type.mjs +11 -0
  236. package/dist/enums/vcs-reference-type.mjs.map +1 -0
  237. package/dist/id.d.mts +22 -0
  238. package/dist/id.d.ts +22 -0
  239. package/dist/id.js +45 -0
  240. package/dist/id.js.map +1 -0
  241. package/dist/id.mjs +44 -0
  242. package/dist/id.mjs.map +1 -0
  243. package/dist/index.d.mts +72 -0
  244. package/dist/index.d.ts +72 -0
  245. package/dist/index.js +369 -0
  246. package/dist/index.js.map +1 -0
  247. package/dist/index.mjs +72 -0
  248. package/dist/index.mjs.map +1 -0
  249. package/dist/inputFile.d.mts +9 -0
  250. package/dist/inputFile.d.ts +9 -0
  251. package/dist/inputFile.js +23 -0
  252. package/dist/inputFile.js.map +1 -0
  253. package/dist/inputFile.mjs +22 -0
  254. package/dist/inputFile.mjs.map +1 -0
  255. package/dist/models.d.mts +3829 -0
  256. package/dist/models.d.ts +3829 -0
  257. package/dist/models.js +4 -0
  258. package/dist/models.js.map +1 -0
  259. package/dist/models.mjs +3 -0
  260. package/dist/models.mjs.map +1 -0
  261. package/dist/operator.d.mts +181 -0
  262. package/dist/operator.d.ts +181 -0
  263. package/dist/operator.js +268 -0
  264. package/dist/operator.js.map +1 -0
  265. package/dist/operator.mjs +266 -0
  266. package/dist/operator.mjs.map +1 -0
  267. package/dist/permission.d.mts +45 -0
  268. package/dist/permission.d.ts +45 -0
  269. package/dist/permission.js +56 -0
  270. package/dist/permission.js.map +1 -0
  271. package/dist/permission.mjs +55 -0
  272. package/dist/permission.mjs.map +1 -0
  273. package/dist/query.d.mts +391 -0
  274. package/dist/query.d.ts +391 -0
  275. package/dist/query.js +402 -0
  276. package/dist/query.js.map +1 -0
  277. package/dist/query.mjs +401 -0
  278. package/dist/query.mjs.map +1 -0
  279. package/dist/role.d.mts +72 -0
  280. package/dist/role.d.ts +72 -0
  281. package/dist/role.js +96 -0
  282. package/dist/role.js.map +1 -0
  283. package/dist/role.mjs +95 -0
  284. package/dist/role.mjs.map +1 -0
  285. package/dist/services/account.d.mts +1011 -0
  286. package/dist/services/account.d.ts +1011 -0
  287. package/dist/services/account.js +1596 -0
  288. package/dist/services/account.js.map +1 -0
  289. package/dist/services/account.mjs +1595 -0
  290. package/dist/services/account.mjs.map +1 -0
  291. package/dist/services/auth.d.mts +52 -0
  292. package/dist/services/auth.d.ts +52 -0
  293. package/dist/services/auth.js +85 -0
  294. package/dist/services/auth.js.map +1 -0
  295. package/dist/services/auth.mjs +84 -0
  296. package/dist/services/auth.mjs.map +1 -0
  297. package/dist/services/avatars.d.mts +334 -0
  298. package/dist/services/avatars.d.ts +334 -0
  299. package/dist/services/avatars.js +405 -0
  300. package/dist/services/avatars.js.map +1 -0
  301. package/dist/services/avatars.mjs +404 -0
  302. package/dist/services/avatars.mjs.map +1 -0
  303. package/dist/services/comment.d.mts +92 -0
  304. package/dist/services/comment.d.ts +92 -0
  305. package/dist/services/comment.js +175 -0
  306. package/dist/services/comment.js.map +1 -0
  307. package/dist/services/comment.mjs +174 -0
  308. package/dist/services/comment.mjs.map +1 -0
  309. package/dist/services/databases.d.mts +1991 -0
  310. package/dist/services/databases.d.ts +1991 -0
  311. package/dist/services/databases.js +2957 -0
  312. package/dist/services/databases.js.map +1 -0
  313. package/dist/services/databases.mjs +2956 -0
  314. package/dist/services/databases.mjs.map +1 -0
  315. package/dist/services/eveai-chat.d.mts +118 -0
  316. package/dist/services/eveai-chat.d.ts +118 -0
  317. package/dist/services/eveai-chat.js +115 -0
  318. package/dist/services/eveai-chat.js.map +1 -0
  319. package/dist/services/eveai-chat.mjs +114 -0
  320. package/dist/services/eveai-chat.mjs.map +1 -0
  321. package/dist/services/eveai-payment.d.mts +145 -0
  322. package/dist/services/eveai-payment.d.ts +145 -0
  323. package/dist/services/eveai-payment.js +132 -0
  324. package/dist/services/eveai-payment.js.map +1 -0
  325. package/dist/services/eveai-payment.mjs +131 -0
  326. package/dist/services/eveai-payment.mjs.map +1 -0
  327. package/dist/services/eveai-provider-discovery.d.mts +126 -0
  328. package/dist/services/eveai-provider-discovery.d.ts +126 -0
  329. package/dist/services/eveai-provider-discovery.js +96 -0
  330. package/dist/services/eveai-provider-discovery.js.map +1 -0
  331. package/dist/services/eveai-provider-discovery.mjs +95 -0
  332. package/dist/services/eveai-provider-discovery.mjs.map +1 -0
  333. package/dist/services/eveai-task.d.mts +137 -0
  334. package/dist/services/eveai-task.d.ts +137 -0
  335. package/dist/services/eveai-task.js +143 -0
  336. package/dist/services/eveai-task.js.map +1 -0
  337. package/dist/services/eveai-task.mjs +142 -0
  338. package/dist/services/eveai-task.mjs.map +1 -0
  339. package/dist/services/favorite.d.mts +68 -0
  340. package/dist/services/favorite.d.ts +68 -0
  341. package/dist/services/favorite.js +127 -0
  342. package/dist/services/favorite.js.map +1 -0
  343. package/dist/services/favorite.mjs +126 -0
  344. package/dist/services/favorite.mjs.map +1 -0
  345. package/dist/services/feed.d.mts +62 -0
  346. package/dist/services/feed.d.ts +62 -0
  347. package/dist/services/feed.js +76 -0
  348. package/dist/services/feed.js.map +1 -0
  349. package/dist/services/feed.mjs +75 -0
  350. package/dist/services/feed.mjs.map +1 -0
  351. package/dist/services/functions.d.mts +749 -0
  352. package/dist/services/functions.d.ts +749 -0
  353. package/dist/services/functions.js +1109 -0
  354. package/dist/services/functions.js.map +1 -0
  355. package/dist/services/functions.mjs +1108 -0
  356. package/dist/services/functions.mjs.map +1 -0
  357. package/dist/services/graphql.d.mts +58 -0
  358. package/dist/services/graphql.d.ts +58 -0
  359. package/dist/services/graphql.js +73 -0
  360. package/dist/services/graphql.js.map +1 -0
  361. package/dist/services/graphql.mjs +72 -0
  362. package/dist/services/graphql.mjs.map +1 -0
  363. package/dist/services/gugotik-storage.d.mts +34 -0
  364. package/dist/services/gugotik-storage.d.ts +34 -0
  365. package/dist/services/gugotik-storage.js +40 -0
  366. package/dist/services/gugotik-storage.js.map +1 -0
  367. package/dist/services/gugotik-storage.mjs +39 -0
  368. package/dist/services/gugotik-storage.mjs.map +1 -0
  369. package/dist/services/health.d.mts +351 -0
  370. package/dist/services/health.d.ts +351 -0
  371. package/dist/services/health.js +503 -0
  372. package/dist/services/health.js.map +1 -0
  373. package/dist/services/health.mjs +502 -0
  374. package/dist/services/health.mjs.map +1 -0
  375. package/dist/services/locale.d.mts +78 -0
  376. package/dist/services/locale.d.ts +78 -0
  377. package/dist/services/locale.js +157 -0
  378. package/dist/services/locale.js.map +1 -0
  379. package/dist/services/locale.mjs +156 -0
  380. package/dist/services/locale.mjs.map +1 -0
  381. package/dist/services/message.d.mts +60 -0
  382. package/dist/services/message.d.ts +60 -0
  383. package/dist/services/message.js +98 -0
  384. package/dist/services/message.js.map +1 -0
  385. package/dist/services/message.mjs +97 -0
  386. package/dist/services/message.mjs.map +1 -0
  387. package/dist/services/messaging.d.mts +2003 -0
  388. package/dist/services/messaging.d.ts +2003 -0
  389. package/dist/services/messaging.js +3054 -0
  390. package/dist/services/messaging.js.map +1 -0
  391. package/dist/services/messaging.mjs +3053 -0
  392. package/dist/services/messaging.mjs.map +1 -0
  393. package/dist/services/publish.d.mts +70 -0
  394. package/dist/services/publish.d.ts +70 -0
  395. package/dist/services/publish.js +154 -0
  396. package/dist/services/publish.js.map +1 -0
  397. package/dist/services/publish.mjs +153 -0
  398. package/dist/services/publish.mjs.map +1 -0
  399. package/dist/services/relation.d.mts +113 -0
  400. package/dist/services/relation.d.ts +113 -0
  401. package/dist/services/relation.js +239 -0
  402. package/dist/services/relation.js.map +1 -0
  403. package/dist/services/relation.mjs +238 -0
  404. package/dist/services/relation.mjs.map +1 -0
  405. package/dist/services/sites.d.mts +705 -0
  406. package/dist/services/sites.d.ts +705 -0
  407. package/dist/services/sites.js +1059 -0
  408. package/dist/services/sites.js.map +1 -0
  409. package/dist/services/sites.mjs +1058 -0
  410. package/dist/services/sites.mjs.map +1 -0
  411. package/dist/services/storage.d.mts +435 -0
  412. package/dist/services/storage.d.ts +435 -0
  413. package/dist/services/storage.js +609 -0
  414. package/dist/services/storage.js.map +1 -0
  415. package/dist/services/storage.mjs +608 -0
  416. package/dist/services/storage.mjs.map +1 -0
  417. package/dist/services/tables-db.d.mts +1934 -0
  418. package/dist/services/tables-db.d.ts +1934 -0
  419. package/dist/services/tables-db.js +2954 -0
  420. package/dist/services/tables-db.js.map +1 -0
  421. package/dist/services/tables-db.mjs +2953 -0
  422. package/dist/services/tables-db.mjs.map +1 -0
  423. package/dist/services/teams.d.mts +355 -0
  424. package/dist/services/teams.d.ts +355 -0
  425. package/dist/services/teams.js +475 -0
  426. package/dist/services/teams.js.map +1 -0
  427. package/dist/services/teams.mjs +474 -0
  428. package/dist/services/teams.mjs.map +1 -0
  429. package/dist/services/tokens.d.mts +133 -0
  430. package/dist/services/tokens.d.ts +133 -0
  431. package/dist/services/tokens.js +169 -0
  432. package/dist/services/tokens.js.map +1 -0
  433. package/dist/services/tokens.mjs +168 -0
  434. package/dist/services/tokens.mjs.map +1 -0
  435. package/dist/services/user.d.mts +66 -0
  436. package/dist/services/user.d.ts +66 -0
  437. package/dist/services/user.js +101 -0
  438. package/dist/services/user.js.map +1 -0
  439. package/dist/services/user.mjs +100 -0
  440. package/dist/services/user.mjs.map +1 -0
  441. package/dist/services/users.d.mts +1176 -0
  442. package/dist/services/users.d.ts +1176 -0
  443. package/dist/services/users.js +1742 -0
  444. package/dist/services/users.js.map +1 -0
  445. package/dist/services/users.mjs +1741 -0
  446. package/dist/services/users.mjs.map +1 -0
  447. package/package.json +15 -1
@@ -0,0 +1,1596 @@
1
+ 'use strict';
2
+
3
+ var client = require('../client');
4
+
5
+ class Account {
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ /**
10
+ * Get the currently logged in user.
11
+ *
12
+ * @throws {AppwriteException}
13
+ * @returns {Promise<Models.User<Preferences>>}
14
+ */
15
+ get() {
16
+ const apiPath = "/account";
17
+ const payload = {};
18
+ const uri = new URL(this.client.config.endpoint + apiPath);
19
+ const apiHeaders = {};
20
+ return this.client.call(
21
+ "get",
22
+ uri,
23
+ apiHeaders,
24
+ payload
25
+ );
26
+ }
27
+ create(paramsOrFirst, ...rest) {
28
+ let params;
29
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
30
+ params = paramsOrFirst || {};
31
+ } else {
32
+ params = {
33
+ userId: paramsOrFirst,
34
+ email: rest[0],
35
+ password: rest[1],
36
+ name: rest[2]
37
+ };
38
+ }
39
+ const userId = params.userId;
40
+ const email = params.email;
41
+ const password = params.password;
42
+ const name = params.name;
43
+ if (typeof userId === "undefined") {
44
+ throw new client.AppwriteException('Missing required parameter: "userId"');
45
+ }
46
+ if (typeof email === "undefined") {
47
+ throw new client.AppwriteException('Missing required parameter: "email"');
48
+ }
49
+ if (typeof password === "undefined") {
50
+ throw new client.AppwriteException('Missing required parameter: "password"');
51
+ }
52
+ const apiPath = "/account";
53
+ const payload = {};
54
+ if (typeof userId !== "undefined") {
55
+ payload["userId"] = userId;
56
+ }
57
+ if (typeof email !== "undefined") {
58
+ payload["email"] = email;
59
+ }
60
+ if (typeof password !== "undefined") {
61
+ payload["password"] = password;
62
+ }
63
+ if (typeof name !== "undefined") {
64
+ payload["name"] = name;
65
+ }
66
+ const uri = new URL(this.client.config.endpoint + apiPath);
67
+ const apiHeaders = {
68
+ "content-type": "application/json"
69
+ };
70
+ return this.client.call(
71
+ "post",
72
+ uri,
73
+ apiHeaders,
74
+ payload
75
+ );
76
+ }
77
+ updateEmail(paramsOrFirst, ...rest) {
78
+ let params;
79
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
80
+ params = paramsOrFirst || {};
81
+ } else {
82
+ params = {
83
+ email: paramsOrFirst,
84
+ password: rest[0]
85
+ };
86
+ }
87
+ const email = params.email;
88
+ const password = params.password;
89
+ if (typeof email === "undefined") {
90
+ throw new client.AppwriteException('Missing required parameter: "email"');
91
+ }
92
+ if (typeof password === "undefined") {
93
+ throw new client.AppwriteException('Missing required parameter: "password"');
94
+ }
95
+ const apiPath = "/account/email";
96
+ const payload = {};
97
+ if (typeof email !== "undefined") {
98
+ payload["email"] = email;
99
+ }
100
+ if (typeof password !== "undefined") {
101
+ payload["password"] = password;
102
+ }
103
+ const uri = new URL(this.client.config.endpoint + apiPath);
104
+ const apiHeaders = {
105
+ "content-type": "application/json"
106
+ };
107
+ return this.client.call(
108
+ "patch",
109
+ uri,
110
+ apiHeaders,
111
+ payload
112
+ );
113
+ }
114
+ listIdentities(paramsOrFirst, ...rest) {
115
+ let params;
116
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
117
+ params = paramsOrFirst || {};
118
+ } else {
119
+ params = {
120
+ queries: paramsOrFirst,
121
+ total: rest[0]
122
+ };
123
+ }
124
+ const queries = params.queries;
125
+ const total = params.total;
126
+ const apiPath = "/account/identities";
127
+ const payload = {};
128
+ if (typeof queries !== "undefined") {
129
+ payload["queries"] = queries;
130
+ }
131
+ if (typeof total !== "undefined") {
132
+ payload["total"] = total;
133
+ }
134
+ const uri = new URL(this.client.config.endpoint + apiPath);
135
+ const apiHeaders = {};
136
+ return this.client.call(
137
+ "get",
138
+ uri,
139
+ apiHeaders,
140
+ payload
141
+ );
142
+ }
143
+ deleteIdentity(paramsOrFirst) {
144
+ let params;
145
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
146
+ params = paramsOrFirst || {};
147
+ } else {
148
+ params = {
149
+ identityId: paramsOrFirst
150
+ };
151
+ }
152
+ const identityId = params.identityId;
153
+ if (typeof identityId === "undefined") {
154
+ throw new client.AppwriteException('Missing required parameter: "identityId"');
155
+ }
156
+ const apiPath = "/account/identities/{identityId}".replace("{identityId}", identityId);
157
+ const payload = {};
158
+ const uri = new URL(this.client.config.endpoint + apiPath);
159
+ const apiHeaders = {
160
+ "content-type": "application/json"
161
+ };
162
+ return this.client.call(
163
+ "delete",
164
+ uri,
165
+ apiHeaders,
166
+ payload
167
+ );
168
+ }
169
+ /**
170
+ * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.
171
+ *
172
+ * @throws {AppwriteException}
173
+ * @returns {Promise<Models.Jwt>}
174
+ */
175
+ createJWT() {
176
+ const apiPath = "/account/jwts";
177
+ const payload = {};
178
+ const uri = new URL(this.client.config.endpoint + apiPath);
179
+ const apiHeaders = {
180
+ "content-type": "application/json"
181
+ };
182
+ return this.client.call(
183
+ "post",
184
+ uri,
185
+ apiHeaders,
186
+ payload
187
+ );
188
+ }
189
+ listLogs(paramsOrFirst, ...rest) {
190
+ let params;
191
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
192
+ params = paramsOrFirst || {};
193
+ } else {
194
+ params = {
195
+ queries: paramsOrFirst,
196
+ total: rest[0]
197
+ };
198
+ }
199
+ const queries = params.queries;
200
+ const total = params.total;
201
+ const apiPath = "/account/logs";
202
+ const payload = {};
203
+ if (typeof queries !== "undefined") {
204
+ payload["queries"] = queries;
205
+ }
206
+ if (typeof total !== "undefined") {
207
+ payload["total"] = total;
208
+ }
209
+ const uri = new URL(this.client.config.endpoint + apiPath);
210
+ const apiHeaders = {};
211
+ return this.client.call(
212
+ "get",
213
+ uri,
214
+ apiHeaders,
215
+ payload
216
+ );
217
+ }
218
+ updateMFA(paramsOrFirst) {
219
+ let params;
220
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
221
+ params = paramsOrFirst || {};
222
+ } else {
223
+ params = {
224
+ mfa: paramsOrFirst
225
+ };
226
+ }
227
+ const mfa = params.mfa;
228
+ if (typeof mfa === "undefined") {
229
+ throw new client.AppwriteException('Missing required parameter: "mfa"');
230
+ }
231
+ const apiPath = "/account/mfa";
232
+ const payload = {};
233
+ if (typeof mfa !== "undefined") {
234
+ payload["mfa"] = mfa;
235
+ }
236
+ const uri = new URL(this.client.config.endpoint + apiPath);
237
+ const apiHeaders = {
238
+ "content-type": "application/json"
239
+ };
240
+ return this.client.call(
241
+ "patch",
242
+ uri,
243
+ apiHeaders,
244
+ payload
245
+ );
246
+ }
247
+ createMfaAuthenticator(paramsOrFirst) {
248
+ let params;
249
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "type" in paramsOrFirst) {
250
+ params = paramsOrFirst || {};
251
+ } else {
252
+ params = {
253
+ type: paramsOrFirst
254
+ };
255
+ }
256
+ const type = params.type;
257
+ if (typeof type === "undefined") {
258
+ throw new client.AppwriteException('Missing required parameter: "type"');
259
+ }
260
+ const apiPath = "/account/mfa/authenticators/{type}".replace("{type}", type);
261
+ const payload = {};
262
+ const uri = new URL(this.client.config.endpoint + apiPath);
263
+ const apiHeaders = {
264
+ "content-type": "application/json"
265
+ };
266
+ return this.client.call(
267
+ "post",
268
+ uri,
269
+ apiHeaders,
270
+ payload
271
+ );
272
+ }
273
+ createMFAAuthenticator(paramsOrFirst) {
274
+ let params;
275
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "type" in paramsOrFirst) {
276
+ params = paramsOrFirst || {};
277
+ } else {
278
+ params = {
279
+ type: paramsOrFirst
280
+ };
281
+ }
282
+ const type = params.type;
283
+ if (typeof type === "undefined") {
284
+ throw new client.AppwriteException('Missing required parameter: "type"');
285
+ }
286
+ const apiPath = "/account/mfa/authenticators/{type}".replace("{type}", type);
287
+ const payload = {};
288
+ const uri = new URL(this.client.config.endpoint + apiPath);
289
+ const apiHeaders = {
290
+ "content-type": "application/json"
291
+ };
292
+ return this.client.call(
293
+ "post",
294
+ uri,
295
+ apiHeaders,
296
+ payload
297
+ );
298
+ }
299
+ updateMfaAuthenticator(paramsOrFirst, ...rest) {
300
+ let params;
301
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "type" in paramsOrFirst) {
302
+ params = paramsOrFirst || {};
303
+ } else {
304
+ params = {
305
+ type: paramsOrFirst,
306
+ otp: rest[0]
307
+ };
308
+ }
309
+ const type = params.type;
310
+ const otp = params.otp;
311
+ if (typeof type === "undefined") {
312
+ throw new client.AppwriteException('Missing required parameter: "type"');
313
+ }
314
+ if (typeof otp === "undefined") {
315
+ throw new client.AppwriteException('Missing required parameter: "otp"');
316
+ }
317
+ const apiPath = "/account/mfa/authenticators/{type}".replace("{type}", type);
318
+ const payload = {};
319
+ if (typeof otp !== "undefined") {
320
+ payload["otp"] = otp;
321
+ }
322
+ const uri = new URL(this.client.config.endpoint + apiPath);
323
+ const apiHeaders = {
324
+ "content-type": "application/json"
325
+ };
326
+ return this.client.call(
327
+ "put",
328
+ uri,
329
+ apiHeaders,
330
+ payload
331
+ );
332
+ }
333
+ updateMFAAuthenticator(paramsOrFirst, ...rest) {
334
+ let params;
335
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "type" in paramsOrFirst) {
336
+ params = paramsOrFirst || {};
337
+ } else {
338
+ params = {
339
+ type: paramsOrFirst,
340
+ otp: rest[0]
341
+ };
342
+ }
343
+ const type = params.type;
344
+ const otp = params.otp;
345
+ if (typeof type === "undefined") {
346
+ throw new client.AppwriteException('Missing required parameter: "type"');
347
+ }
348
+ if (typeof otp === "undefined") {
349
+ throw new client.AppwriteException('Missing required parameter: "otp"');
350
+ }
351
+ const apiPath = "/account/mfa/authenticators/{type}".replace("{type}", type);
352
+ const payload = {};
353
+ if (typeof otp !== "undefined") {
354
+ payload["otp"] = otp;
355
+ }
356
+ const uri = new URL(this.client.config.endpoint + apiPath);
357
+ const apiHeaders = {
358
+ "content-type": "application/json"
359
+ };
360
+ return this.client.call(
361
+ "put",
362
+ uri,
363
+ apiHeaders,
364
+ payload
365
+ );
366
+ }
367
+ deleteMfaAuthenticator(paramsOrFirst) {
368
+ let params;
369
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "type" in paramsOrFirst) {
370
+ params = paramsOrFirst || {};
371
+ } else {
372
+ params = {
373
+ type: paramsOrFirst
374
+ };
375
+ }
376
+ const type = params.type;
377
+ if (typeof type === "undefined") {
378
+ throw new client.AppwriteException('Missing required parameter: "type"');
379
+ }
380
+ const apiPath = "/account/mfa/authenticators/{type}".replace("{type}", type);
381
+ const payload = {};
382
+ const uri = new URL(this.client.config.endpoint + apiPath);
383
+ const apiHeaders = {
384
+ "content-type": "application/json"
385
+ };
386
+ return this.client.call(
387
+ "delete",
388
+ uri,
389
+ apiHeaders,
390
+ payload
391
+ );
392
+ }
393
+ deleteMFAAuthenticator(paramsOrFirst) {
394
+ let params;
395
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "type" in paramsOrFirst) {
396
+ params = paramsOrFirst || {};
397
+ } else {
398
+ params = {
399
+ type: paramsOrFirst
400
+ };
401
+ }
402
+ const type = params.type;
403
+ if (typeof type === "undefined") {
404
+ throw new client.AppwriteException('Missing required parameter: "type"');
405
+ }
406
+ const apiPath = "/account/mfa/authenticators/{type}".replace("{type}", type);
407
+ const payload = {};
408
+ const uri = new URL(this.client.config.endpoint + apiPath);
409
+ const apiHeaders = {
410
+ "content-type": "application/json"
411
+ };
412
+ return this.client.call(
413
+ "delete",
414
+ uri,
415
+ apiHeaders,
416
+ payload
417
+ );
418
+ }
419
+ createMfaChallenge(paramsOrFirst) {
420
+ let params;
421
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "factor" in paramsOrFirst) {
422
+ params = paramsOrFirst || {};
423
+ } else {
424
+ params = {
425
+ factor: paramsOrFirst
426
+ };
427
+ }
428
+ const factor = params.factor;
429
+ if (typeof factor === "undefined") {
430
+ throw new client.AppwriteException('Missing required parameter: "factor"');
431
+ }
432
+ const apiPath = "/account/mfa/challenges";
433
+ const payload = {};
434
+ if (typeof factor !== "undefined") {
435
+ payload["factor"] = factor;
436
+ }
437
+ const uri = new URL(this.client.config.endpoint + apiPath);
438
+ const apiHeaders = {
439
+ "content-type": "application/json"
440
+ };
441
+ return this.client.call(
442
+ "post",
443
+ uri,
444
+ apiHeaders,
445
+ payload
446
+ );
447
+ }
448
+ createMFAChallenge(paramsOrFirst) {
449
+ let params;
450
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "factor" in paramsOrFirst) {
451
+ params = paramsOrFirst || {};
452
+ } else {
453
+ params = {
454
+ factor: paramsOrFirst
455
+ };
456
+ }
457
+ const factor = params.factor;
458
+ if (typeof factor === "undefined") {
459
+ throw new client.AppwriteException('Missing required parameter: "factor"');
460
+ }
461
+ const apiPath = "/account/mfa/challenges";
462
+ const payload = {};
463
+ if (typeof factor !== "undefined") {
464
+ payload["factor"] = factor;
465
+ }
466
+ const uri = new URL(this.client.config.endpoint + apiPath);
467
+ const apiHeaders = {
468
+ "content-type": "application/json"
469
+ };
470
+ return this.client.call(
471
+ "post",
472
+ uri,
473
+ apiHeaders,
474
+ payload
475
+ );
476
+ }
477
+ updateMfaChallenge(paramsOrFirst, ...rest) {
478
+ let params;
479
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
480
+ params = paramsOrFirst || {};
481
+ } else {
482
+ params = {
483
+ challengeId: paramsOrFirst,
484
+ otp: rest[0]
485
+ };
486
+ }
487
+ const challengeId = params.challengeId;
488
+ const otp = params.otp;
489
+ if (typeof challengeId === "undefined") {
490
+ throw new client.AppwriteException('Missing required parameter: "challengeId"');
491
+ }
492
+ if (typeof otp === "undefined") {
493
+ throw new client.AppwriteException('Missing required parameter: "otp"');
494
+ }
495
+ const apiPath = "/account/mfa/challenges";
496
+ const payload = {};
497
+ if (typeof challengeId !== "undefined") {
498
+ payload["challengeId"] = challengeId;
499
+ }
500
+ if (typeof otp !== "undefined") {
501
+ payload["otp"] = otp;
502
+ }
503
+ const uri = new URL(this.client.config.endpoint + apiPath);
504
+ const apiHeaders = {
505
+ "content-type": "application/json"
506
+ };
507
+ return this.client.call(
508
+ "put",
509
+ uri,
510
+ apiHeaders,
511
+ payload
512
+ );
513
+ }
514
+ updateMFAChallenge(paramsOrFirst, ...rest) {
515
+ let params;
516
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
517
+ params = paramsOrFirst || {};
518
+ } else {
519
+ params = {
520
+ challengeId: paramsOrFirst,
521
+ otp: rest[0]
522
+ };
523
+ }
524
+ const challengeId = params.challengeId;
525
+ const otp = params.otp;
526
+ if (typeof challengeId === "undefined") {
527
+ throw new client.AppwriteException('Missing required parameter: "challengeId"');
528
+ }
529
+ if (typeof otp === "undefined") {
530
+ throw new client.AppwriteException('Missing required parameter: "otp"');
531
+ }
532
+ const apiPath = "/account/mfa/challenges";
533
+ const payload = {};
534
+ if (typeof challengeId !== "undefined") {
535
+ payload["challengeId"] = challengeId;
536
+ }
537
+ if (typeof otp !== "undefined") {
538
+ payload["otp"] = otp;
539
+ }
540
+ const uri = new URL(this.client.config.endpoint + apiPath);
541
+ const apiHeaders = {
542
+ "content-type": "application/json"
543
+ };
544
+ return this.client.call(
545
+ "put",
546
+ uri,
547
+ apiHeaders,
548
+ payload
549
+ );
550
+ }
551
+ /**
552
+ * List the factors available on the account to be used as a MFA challange.
553
+ *
554
+ * @throws {AppwriteException}
555
+ * @returns {Promise<Models.MfaFactors>}
556
+ * @deprecated This API has been deprecated since 1.8.0. Please use `Account.listMFAFactors` instead.
557
+ */
558
+ listMfaFactors() {
559
+ const apiPath = "/account/mfa/factors";
560
+ const payload = {};
561
+ const uri = new URL(this.client.config.endpoint + apiPath);
562
+ const apiHeaders = {};
563
+ return this.client.call(
564
+ "get",
565
+ uri,
566
+ apiHeaders,
567
+ payload
568
+ );
569
+ }
570
+ /**
571
+ * List the factors available on the account to be used as a MFA challange.
572
+ *
573
+ * @throws {AppwriteException}
574
+ * @returns {Promise<Models.MfaFactors>}
575
+ */
576
+ listMFAFactors() {
577
+ const apiPath = "/account/mfa/factors";
578
+ const payload = {};
579
+ const uri = new URL(this.client.config.endpoint + apiPath);
580
+ const apiHeaders = {};
581
+ return this.client.call(
582
+ "get",
583
+ uri,
584
+ apiHeaders,
585
+ payload
586
+ );
587
+ }
588
+ /**
589
+ * Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.
590
+ *
591
+ * @throws {AppwriteException}
592
+ * @returns {Promise<Models.MfaRecoveryCodes>}
593
+ * @deprecated This API has been deprecated since 1.8.0. Please use `Account.getMFARecoveryCodes` instead.
594
+ */
595
+ getMfaRecoveryCodes() {
596
+ const apiPath = "/account/mfa/recovery-codes";
597
+ const payload = {};
598
+ const uri = new URL(this.client.config.endpoint + apiPath);
599
+ const apiHeaders = {};
600
+ return this.client.call(
601
+ "get",
602
+ uri,
603
+ apiHeaders,
604
+ payload
605
+ );
606
+ }
607
+ /**
608
+ * Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.
609
+ *
610
+ * @throws {AppwriteException}
611
+ * @returns {Promise<Models.MfaRecoveryCodes>}
612
+ */
613
+ getMFARecoveryCodes() {
614
+ const apiPath = "/account/mfa/recovery-codes";
615
+ const payload = {};
616
+ const uri = new URL(this.client.config.endpoint + apiPath);
617
+ const apiHeaders = {};
618
+ return this.client.call(
619
+ "get",
620
+ uri,
621
+ apiHeaders,
622
+ payload
623
+ );
624
+ }
625
+ /**
626
+ * Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
627
+ *
628
+ * @throws {AppwriteException}
629
+ * @returns {Promise<Models.MfaRecoveryCodes>}
630
+ * @deprecated This API has been deprecated since 1.8.0. Please use `Account.createMFARecoveryCodes` instead.
631
+ */
632
+ createMfaRecoveryCodes() {
633
+ const apiPath = "/account/mfa/recovery-codes";
634
+ const payload = {};
635
+ const uri = new URL(this.client.config.endpoint + apiPath);
636
+ const apiHeaders = {
637
+ "content-type": "application/json"
638
+ };
639
+ return this.client.call(
640
+ "post",
641
+ uri,
642
+ apiHeaders,
643
+ payload
644
+ );
645
+ }
646
+ /**
647
+ * Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.
648
+ *
649
+ * @throws {AppwriteException}
650
+ * @returns {Promise<Models.MfaRecoveryCodes>}
651
+ */
652
+ createMFARecoveryCodes() {
653
+ const apiPath = "/account/mfa/recovery-codes";
654
+ const payload = {};
655
+ const uri = new URL(this.client.config.endpoint + apiPath);
656
+ const apiHeaders = {
657
+ "content-type": "application/json"
658
+ };
659
+ return this.client.call(
660
+ "post",
661
+ uri,
662
+ apiHeaders,
663
+ payload
664
+ );
665
+ }
666
+ /**
667
+ * Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.
668
+ *
669
+ * @throws {AppwriteException}
670
+ * @returns {Promise<Models.MfaRecoveryCodes>}
671
+ * @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateMFARecoveryCodes` instead.
672
+ */
673
+ updateMfaRecoveryCodes() {
674
+ const apiPath = "/account/mfa/recovery-codes";
675
+ const payload = {};
676
+ const uri = new URL(this.client.config.endpoint + apiPath);
677
+ const apiHeaders = {
678
+ "content-type": "application/json"
679
+ };
680
+ return this.client.call(
681
+ "patch",
682
+ uri,
683
+ apiHeaders,
684
+ payload
685
+ );
686
+ }
687
+ /**
688
+ * Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.
689
+ *
690
+ * @throws {AppwriteException}
691
+ * @returns {Promise<Models.MfaRecoveryCodes>}
692
+ */
693
+ updateMFARecoveryCodes() {
694
+ const apiPath = "/account/mfa/recovery-codes";
695
+ const payload = {};
696
+ const uri = new URL(this.client.config.endpoint + apiPath);
697
+ const apiHeaders = {
698
+ "content-type": "application/json"
699
+ };
700
+ return this.client.call(
701
+ "patch",
702
+ uri,
703
+ apiHeaders,
704
+ payload
705
+ );
706
+ }
707
+ updateName(paramsOrFirst) {
708
+ let params;
709
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
710
+ params = paramsOrFirst || {};
711
+ } else {
712
+ params = {
713
+ name: paramsOrFirst
714
+ };
715
+ }
716
+ const name = params.name;
717
+ if (typeof name === "undefined") {
718
+ throw new client.AppwriteException('Missing required parameter: "name"');
719
+ }
720
+ const apiPath = "/account/name";
721
+ const payload = {};
722
+ if (typeof name !== "undefined") {
723
+ payload["name"] = name;
724
+ }
725
+ const uri = new URL(this.client.config.endpoint + apiPath);
726
+ const apiHeaders = {
727
+ "content-type": "application/json"
728
+ };
729
+ return this.client.call(
730
+ "patch",
731
+ uri,
732
+ apiHeaders,
733
+ payload
734
+ );
735
+ }
736
+ updatePassword(paramsOrFirst, ...rest) {
737
+ let params;
738
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
739
+ params = paramsOrFirst || {};
740
+ } else {
741
+ params = {
742
+ password: paramsOrFirst,
743
+ oldPassword: rest[0]
744
+ };
745
+ }
746
+ const password = params.password;
747
+ const oldPassword = params.oldPassword;
748
+ if (typeof password === "undefined") {
749
+ throw new client.AppwriteException('Missing required parameter: "password"');
750
+ }
751
+ const apiPath = "/account/password";
752
+ const payload = {};
753
+ if (typeof password !== "undefined") {
754
+ payload["password"] = password;
755
+ }
756
+ if (typeof oldPassword !== "undefined") {
757
+ payload["oldPassword"] = oldPassword;
758
+ }
759
+ const uri = new URL(this.client.config.endpoint + apiPath);
760
+ const apiHeaders = {
761
+ "content-type": "application/json"
762
+ };
763
+ return this.client.call(
764
+ "patch",
765
+ uri,
766
+ apiHeaders,
767
+ payload
768
+ );
769
+ }
770
+ updatePhone(paramsOrFirst, ...rest) {
771
+ let params;
772
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
773
+ params = paramsOrFirst || {};
774
+ } else {
775
+ params = {
776
+ phone: paramsOrFirst,
777
+ password: rest[0]
778
+ };
779
+ }
780
+ const phone = params.phone;
781
+ const password = params.password;
782
+ if (typeof phone === "undefined") {
783
+ throw new client.AppwriteException('Missing required parameter: "phone"');
784
+ }
785
+ if (typeof password === "undefined") {
786
+ throw new client.AppwriteException('Missing required parameter: "password"');
787
+ }
788
+ const apiPath = "/account/phone";
789
+ const payload = {};
790
+ if (typeof phone !== "undefined") {
791
+ payload["phone"] = phone;
792
+ }
793
+ if (typeof password !== "undefined") {
794
+ payload["password"] = password;
795
+ }
796
+ const uri = new URL(this.client.config.endpoint + apiPath);
797
+ const apiHeaders = {
798
+ "content-type": "application/json"
799
+ };
800
+ return this.client.call(
801
+ "patch",
802
+ uri,
803
+ apiHeaders,
804
+ payload
805
+ );
806
+ }
807
+ /**
808
+ * Get the preferences as a key-value object for the currently logged in user.
809
+ *
810
+ * @throws {AppwriteException}
811
+ * @returns {Promise<Preferences>}
812
+ */
813
+ getPrefs() {
814
+ const apiPath = "/account/prefs";
815
+ const payload = {};
816
+ const uri = new URL(this.client.config.endpoint + apiPath);
817
+ const apiHeaders = {};
818
+ return this.client.call(
819
+ "get",
820
+ uri,
821
+ apiHeaders,
822
+ payload
823
+ );
824
+ }
825
+ updatePrefs(paramsOrFirst) {
826
+ let params;
827
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "prefs" in paramsOrFirst) {
828
+ params = paramsOrFirst || {};
829
+ } else {
830
+ params = {
831
+ prefs: paramsOrFirst
832
+ };
833
+ }
834
+ const prefs = params.prefs;
835
+ if (typeof prefs === "undefined") {
836
+ throw new client.AppwriteException('Missing required parameter: "prefs"');
837
+ }
838
+ const apiPath = "/account/prefs";
839
+ const payload = {};
840
+ if (typeof prefs !== "undefined") {
841
+ payload["prefs"] = prefs;
842
+ }
843
+ const uri = new URL(this.client.config.endpoint + apiPath);
844
+ const apiHeaders = {
845
+ "content-type": "application/json"
846
+ };
847
+ return this.client.call(
848
+ "patch",
849
+ uri,
850
+ apiHeaders,
851
+ payload
852
+ );
853
+ }
854
+ createRecovery(paramsOrFirst, ...rest) {
855
+ let params;
856
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
857
+ params = paramsOrFirst || {};
858
+ } else {
859
+ params = {
860
+ email: paramsOrFirst,
861
+ url: rest[0]
862
+ };
863
+ }
864
+ const email = params.email;
865
+ const url = params.url;
866
+ if (typeof email === "undefined") {
867
+ throw new client.AppwriteException('Missing required parameter: "email"');
868
+ }
869
+ if (typeof url === "undefined") {
870
+ throw new client.AppwriteException('Missing required parameter: "url"');
871
+ }
872
+ const apiPath = "/account/recovery";
873
+ const payload = {};
874
+ if (typeof email !== "undefined") {
875
+ payload["email"] = email;
876
+ }
877
+ if (typeof url !== "undefined") {
878
+ payload["url"] = url;
879
+ }
880
+ const uri = new URL(this.client.config.endpoint + apiPath);
881
+ const apiHeaders = {
882
+ "content-type": "application/json"
883
+ };
884
+ return this.client.call(
885
+ "post",
886
+ uri,
887
+ apiHeaders,
888
+ payload
889
+ );
890
+ }
891
+ updateRecovery(paramsOrFirst, ...rest) {
892
+ let params;
893
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
894
+ params = paramsOrFirst || {};
895
+ } else {
896
+ params = {
897
+ userId: paramsOrFirst,
898
+ secret: rest[0],
899
+ password: rest[1]
900
+ };
901
+ }
902
+ const userId = params.userId;
903
+ const secret = params.secret;
904
+ const password = params.password;
905
+ if (typeof userId === "undefined") {
906
+ throw new client.AppwriteException('Missing required parameter: "userId"');
907
+ }
908
+ if (typeof secret === "undefined") {
909
+ throw new client.AppwriteException('Missing required parameter: "secret"');
910
+ }
911
+ if (typeof password === "undefined") {
912
+ throw new client.AppwriteException('Missing required parameter: "password"');
913
+ }
914
+ const apiPath = "/account/recovery";
915
+ const payload = {};
916
+ if (typeof userId !== "undefined") {
917
+ payload["userId"] = userId;
918
+ }
919
+ if (typeof secret !== "undefined") {
920
+ payload["secret"] = secret;
921
+ }
922
+ if (typeof password !== "undefined") {
923
+ payload["password"] = password;
924
+ }
925
+ const uri = new URL(this.client.config.endpoint + apiPath);
926
+ const apiHeaders = {
927
+ "content-type": "application/json"
928
+ };
929
+ return this.client.call(
930
+ "put",
931
+ uri,
932
+ apiHeaders,
933
+ payload
934
+ );
935
+ }
936
+ /**
937
+ * Get the list of active sessions across different devices for the currently logged in user.
938
+ *
939
+ * @throws {AppwriteException}
940
+ * @returns {Promise<Models.SessionList>}
941
+ */
942
+ listSessions() {
943
+ const apiPath = "/account/sessions";
944
+ const payload = {};
945
+ const uri = new URL(this.client.config.endpoint + apiPath);
946
+ const apiHeaders = {};
947
+ return this.client.call(
948
+ "get",
949
+ uri,
950
+ apiHeaders,
951
+ payload
952
+ );
953
+ }
954
+ /**
955
+ * Delete all sessions from the user account and remove any sessions cookies from the end client.
956
+ *
957
+ * @throws {AppwriteException}
958
+ * @returns {Promise<{}>}
959
+ */
960
+ deleteSessions() {
961
+ const apiPath = "/account/sessions";
962
+ const payload = {};
963
+ const uri = new URL(this.client.config.endpoint + apiPath);
964
+ const apiHeaders = {
965
+ "content-type": "application/json"
966
+ };
967
+ return this.client.call(
968
+ "delete",
969
+ uri,
970
+ apiHeaders,
971
+ payload
972
+ );
973
+ }
974
+ /**
975
+ * Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https://appwrite.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appwrite.io/docs/references/cloud/client-web/account#CreateOAuth2Session).
976
+ *
977
+ * @throws {AppwriteException}
978
+ * @returns {Promise<Models.Session>}
979
+ */
980
+ createAnonymousSession() {
981
+ const apiPath = "/account/sessions/anonymous";
982
+ const payload = {};
983
+ const uri = new URL(this.client.config.endpoint + apiPath);
984
+ const apiHeaders = {
985
+ "content-type": "application/json"
986
+ };
987
+ return this.client.call(
988
+ "post",
989
+ uri,
990
+ apiHeaders,
991
+ payload
992
+ );
993
+ }
994
+ createEmailPasswordSession(paramsOrFirst, ...rest) {
995
+ let params;
996
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
997
+ params = paramsOrFirst || {};
998
+ } else {
999
+ params = {
1000
+ email: paramsOrFirst,
1001
+ password: rest[0]
1002
+ };
1003
+ }
1004
+ const email = params.email;
1005
+ const password = params.password;
1006
+ if (typeof email === "undefined") {
1007
+ throw new client.AppwriteException('Missing required parameter: "email"');
1008
+ }
1009
+ if (typeof password === "undefined") {
1010
+ throw new client.AppwriteException('Missing required parameter: "password"');
1011
+ }
1012
+ const apiPath = "/account/sessions/email";
1013
+ const payload = {};
1014
+ if (typeof email !== "undefined") {
1015
+ payload["email"] = email;
1016
+ }
1017
+ if (typeof password !== "undefined") {
1018
+ payload["password"] = password;
1019
+ }
1020
+ const uri = new URL(this.client.config.endpoint + apiPath);
1021
+ const apiHeaders = {
1022
+ "content-type": "application/json"
1023
+ };
1024
+ return this.client.call(
1025
+ "post",
1026
+ uri,
1027
+ apiHeaders,
1028
+ payload
1029
+ );
1030
+ }
1031
+ updateMagicURLSession(paramsOrFirst, ...rest) {
1032
+ let params;
1033
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1034
+ params = paramsOrFirst || {};
1035
+ } else {
1036
+ params = {
1037
+ userId: paramsOrFirst,
1038
+ secret: rest[0]
1039
+ };
1040
+ }
1041
+ const userId = params.userId;
1042
+ const secret = params.secret;
1043
+ if (typeof userId === "undefined") {
1044
+ throw new client.AppwriteException('Missing required parameter: "userId"');
1045
+ }
1046
+ if (typeof secret === "undefined") {
1047
+ throw new client.AppwriteException('Missing required parameter: "secret"');
1048
+ }
1049
+ const apiPath = "/account/sessions/magic-url";
1050
+ const payload = {};
1051
+ if (typeof userId !== "undefined") {
1052
+ payload["userId"] = userId;
1053
+ }
1054
+ if (typeof secret !== "undefined") {
1055
+ payload["secret"] = secret;
1056
+ }
1057
+ const uri = new URL(this.client.config.endpoint + apiPath);
1058
+ const apiHeaders = {
1059
+ "content-type": "application/json"
1060
+ };
1061
+ return this.client.call(
1062
+ "put",
1063
+ uri,
1064
+ apiHeaders,
1065
+ payload
1066
+ );
1067
+ }
1068
+ updatePhoneSession(paramsOrFirst, ...rest) {
1069
+ let params;
1070
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1071
+ params = paramsOrFirst || {};
1072
+ } else {
1073
+ params = {
1074
+ userId: paramsOrFirst,
1075
+ secret: rest[0]
1076
+ };
1077
+ }
1078
+ const userId = params.userId;
1079
+ const secret = params.secret;
1080
+ if (typeof userId === "undefined") {
1081
+ throw new client.AppwriteException('Missing required parameter: "userId"');
1082
+ }
1083
+ if (typeof secret === "undefined") {
1084
+ throw new client.AppwriteException('Missing required parameter: "secret"');
1085
+ }
1086
+ const apiPath = "/account/sessions/phone";
1087
+ const payload = {};
1088
+ if (typeof userId !== "undefined") {
1089
+ payload["userId"] = userId;
1090
+ }
1091
+ if (typeof secret !== "undefined") {
1092
+ payload["secret"] = secret;
1093
+ }
1094
+ const uri = new URL(this.client.config.endpoint + apiPath);
1095
+ const apiHeaders = {
1096
+ "content-type": "application/json"
1097
+ };
1098
+ return this.client.call(
1099
+ "put",
1100
+ uri,
1101
+ apiHeaders,
1102
+ payload
1103
+ );
1104
+ }
1105
+ createSession(paramsOrFirst, ...rest) {
1106
+ let params;
1107
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1108
+ params = paramsOrFirst || {};
1109
+ } else {
1110
+ params = {
1111
+ userId: paramsOrFirst,
1112
+ secret: rest[0]
1113
+ };
1114
+ }
1115
+ const userId = params.userId;
1116
+ const secret = params.secret;
1117
+ if (typeof userId === "undefined") {
1118
+ throw new client.AppwriteException('Missing required parameter: "userId"');
1119
+ }
1120
+ if (typeof secret === "undefined") {
1121
+ throw new client.AppwriteException('Missing required parameter: "secret"');
1122
+ }
1123
+ const apiPath = "/account/sessions/token";
1124
+ const payload = {};
1125
+ if (typeof userId !== "undefined") {
1126
+ payload["userId"] = userId;
1127
+ }
1128
+ if (typeof secret !== "undefined") {
1129
+ payload["secret"] = secret;
1130
+ }
1131
+ const uri = new URL(this.client.config.endpoint + apiPath);
1132
+ const apiHeaders = {
1133
+ "content-type": "application/json"
1134
+ };
1135
+ return this.client.call(
1136
+ "post",
1137
+ uri,
1138
+ apiHeaders,
1139
+ payload
1140
+ );
1141
+ }
1142
+ getSession(paramsOrFirst) {
1143
+ let params;
1144
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1145
+ params = paramsOrFirst || {};
1146
+ } else {
1147
+ params = {
1148
+ sessionId: paramsOrFirst
1149
+ };
1150
+ }
1151
+ const sessionId = params.sessionId;
1152
+ if (typeof sessionId === "undefined") {
1153
+ throw new client.AppwriteException('Missing required parameter: "sessionId"');
1154
+ }
1155
+ const apiPath = "/account/sessions/{sessionId}".replace("{sessionId}", sessionId);
1156
+ const payload = {};
1157
+ const uri = new URL(this.client.config.endpoint + apiPath);
1158
+ const apiHeaders = {};
1159
+ return this.client.call(
1160
+ "get",
1161
+ uri,
1162
+ apiHeaders,
1163
+ payload
1164
+ );
1165
+ }
1166
+ updateSession(paramsOrFirst) {
1167
+ let params;
1168
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1169
+ params = paramsOrFirst || {};
1170
+ } else {
1171
+ params = {
1172
+ sessionId: paramsOrFirst
1173
+ };
1174
+ }
1175
+ const sessionId = params.sessionId;
1176
+ if (typeof sessionId === "undefined") {
1177
+ throw new client.AppwriteException('Missing required parameter: "sessionId"');
1178
+ }
1179
+ const apiPath = "/account/sessions/{sessionId}".replace("{sessionId}", sessionId);
1180
+ const payload = {};
1181
+ const uri = new URL(this.client.config.endpoint + apiPath);
1182
+ const apiHeaders = {
1183
+ "content-type": "application/json"
1184
+ };
1185
+ return this.client.call(
1186
+ "patch",
1187
+ uri,
1188
+ apiHeaders,
1189
+ payload
1190
+ );
1191
+ }
1192
+ deleteSession(paramsOrFirst) {
1193
+ let params;
1194
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1195
+ params = paramsOrFirst || {};
1196
+ } else {
1197
+ params = {
1198
+ sessionId: paramsOrFirst
1199
+ };
1200
+ }
1201
+ const sessionId = params.sessionId;
1202
+ if (typeof sessionId === "undefined") {
1203
+ throw new client.AppwriteException('Missing required parameter: "sessionId"');
1204
+ }
1205
+ const apiPath = "/account/sessions/{sessionId}".replace("{sessionId}", sessionId);
1206
+ const payload = {};
1207
+ const uri = new URL(this.client.config.endpoint + apiPath);
1208
+ const apiHeaders = {
1209
+ "content-type": "application/json"
1210
+ };
1211
+ return this.client.call(
1212
+ "delete",
1213
+ uri,
1214
+ apiHeaders,
1215
+ payload
1216
+ );
1217
+ }
1218
+ /**
1219
+ * Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.
1220
+ *
1221
+ * @throws {AppwriteException}
1222
+ * @returns {Promise<Models.User<Preferences>>}
1223
+ */
1224
+ updateStatus() {
1225
+ const apiPath = "/account/status";
1226
+ const payload = {};
1227
+ const uri = new URL(this.client.config.endpoint + apiPath);
1228
+ const apiHeaders = {
1229
+ "content-type": "application/json"
1230
+ };
1231
+ return this.client.call(
1232
+ "patch",
1233
+ uri,
1234
+ apiHeaders,
1235
+ payload
1236
+ );
1237
+ }
1238
+ createEmailToken(paramsOrFirst, ...rest) {
1239
+ let params;
1240
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1241
+ params = paramsOrFirst || {};
1242
+ } else {
1243
+ params = {
1244
+ userId: paramsOrFirst,
1245
+ email: rest[0],
1246
+ phrase: rest[1]
1247
+ };
1248
+ }
1249
+ const userId = params.userId;
1250
+ const email = params.email;
1251
+ const phrase = params.phrase;
1252
+ if (typeof userId === "undefined") {
1253
+ throw new client.AppwriteException('Missing required parameter: "userId"');
1254
+ }
1255
+ if (typeof email === "undefined") {
1256
+ throw new client.AppwriteException('Missing required parameter: "email"');
1257
+ }
1258
+ const apiPath = "/account/tokens/email";
1259
+ const payload = {};
1260
+ if (typeof userId !== "undefined") {
1261
+ payload["userId"] = userId;
1262
+ }
1263
+ if (typeof email !== "undefined") {
1264
+ payload["email"] = email;
1265
+ }
1266
+ if (typeof phrase !== "undefined") {
1267
+ payload["phrase"] = phrase;
1268
+ }
1269
+ const uri = new URL(this.client.config.endpoint + apiPath);
1270
+ const apiHeaders = {
1271
+ "content-type": "application/json"
1272
+ };
1273
+ return this.client.call(
1274
+ "post",
1275
+ uri,
1276
+ apiHeaders,
1277
+ payload
1278
+ );
1279
+ }
1280
+ createMagicURLToken(paramsOrFirst, ...rest) {
1281
+ let params;
1282
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1283
+ params = paramsOrFirst || {};
1284
+ } else {
1285
+ params = {
1286
+ userId: paramsOrFirst,
1287
+ email: rest[0],
1288
+ url: rest[1],
1289
+ phrase: rest[2]
1290
+ };
1291
+ }
1292
+ const userId = params.userId;
1293
+ const email = params.email;
1294
+ const url = params.url;
1295
+ const phrase = params.phrase;
1296
+ if (typeof userId === "undefined") {
1297
+ throw new client.AppwriteException('Missing required parameter: "userId"');
1298
+ }
1299
+ if (typeof email === "undefined") {
1300
+ throw new client.AppwriteException('Missing required parameter: "email"');
1301
+ }
1302
+ const apiPath = "/account/tokens/magic-url";
1303
+ const payload = {};
1304
+ if (typeof userId !== "undefined") {
1305
+ payload["userId"] = userId;
1306
+ }
1307
+ if (typeof email !== "undefined") {
1308
+ payload["email"] = email;
1309
+ }
1310
+ if (typeof url !== "undefined") {
1311
+ payload["url"] = url;
1312
+ }
1313
+ if (typeof phrase !== "undefined") {
1314
+ payload["phrase"] = phrase;
1315
+ }
1316
+ const uri = new URL(this.client.config.endpoint + apiPath);
1317
+ const apiHeaders = {
1318
+ "content-type": "application/json"
1319
+ };
1320
+ return this.client.call(
1321
+ "post",
1322
+ uri,
1323
+ apiHeaders,
1324
+ payload
1325
+ );
1326
+ }
1327
+ createOAuth2Token(paramsOrFirst, ...rest) {
1328
+ let params;
1329
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && "provider" in paramsOrFirst) {
1330
+ params = paramsOrFirst || {};
1331
+ } else {
1332
+ params = {
1333
+ provider: paramsOrFirst,
1334
+ success: rest[0],
1335
+ failure: rest[1],
1336
+ scopes: rest[2]
1337
+ };
1338
+ }
1339
+ const provider = params.provider;
1340
+ const success = params.success;
1341
+ const failure = params.failure;
1342
+ const scopes = params.scopes;
1343
+ if (typeof provider === "undefined") {
1344
+ throw new client.AppwriteException('Missing required parameter: "provider"');
1345
+ }
1346
+ const apiPath = "/account/tokens/oauth2/{provider}".replace("{provider}", provider);
1347
+ const payload = {};
1348
+ if (typeof success !== "undefined") {
1349
+ payload["success"] = success;
1350
+ }
1351
+ if (typeof failure !== "undefined") {
1352
+ payload["failure"] = failure;
1353
+ }
1354
+ if (typeof scopes !== "undefined") {
1355
+ payload["scopes"] = scopes;
1356
+ }
1357
+ const uri = new URL(this.client.config.endpoint + apiPath);
1358
+ const apiHeaders = {};
1359
+ return this.client.redirect(
1360
+ "get",
1361
+ uri,
1362
+ apiHeaders,
1363
+ payload
1364
+ );
1365
+ }
1366
+ createPhoneToken(paramsOrFirst, ...rest) {
1367
+ let params;
1368
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1369
+ params = paramsOrFirst || {};
1370
+ } else {
1371
+ params = {
1372
+ userId: paramsOrFirst,
1373
+ phone: rest[0]
1374
+ };
1375
+ }
1376
+ const userId = params.userId;
1377
+ const phone = params.phone;
1378
+ if (typeof userId === "undefined") {
1379
+ throw new client.AppwriteException('Missing required parameter: "userId"');
1380
+ }
1381
+ if (typeof phone === "undefined") {
1382
+ throw new client.AppwriteException('Missing required parameter: "phone"');
1383
+ }
1384
+ const apiPath = "/account/tokens/phone";
1385
+ const payload = {};
1386
+ if (typeof userId !== "undefined") {
1387
+ payload["userId"] = userId;
1388
+ }
1389
+ if (typeof phone !== "undefined") {
1390
+ payload["phone"] = phone;
1391
+ }
1392
+ const uri = new URL(this.client.config.endpoint + apiPath);
1393
+ const apiHeaders = {
1394
+ "content-type": "application/json"
1395
+ };
1396
+ return this.client.call(
1397
+ "post",
1398
+ uri,
1399
+ apiHeaders,
1400
+ payload
1401
+ );
1402
+ }
1403
+ createEmailVerification(paramsOrFirst) {
1404
+ let params;
1405
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1406
+ params = paramsOrFirst || {};
1407
+ } else {
1408
+ params = {
1409
+ url: paramsOrFirst
1410
+ };
1411
+ }
1412
+ const url = params.url;
1413
+ if (typeof url === "undefined") {
1414
+ throw new client.AppwriteException('Missing required parameter: "url"');
1415
+ }
1416
+ const apiPath = "/account/verifications/email";
1417
+ const payload = {};
1418
+ if (typeof url !== "undefined") {
1419
+ payload["url"] = url;
1420
+ }
1421
+ const uri = new URL(this.client.config.endpoint + apiPath);
1422
+ const apiHeaders = {
1423
+ "content-type": "application/json"
1424
+ };
1425
+ return this.client.call(
1426
+ "post",
1427
+ uri,
1428
+ apiHeaders,
1429
+ payload
1430
+ );
1431
+ }
1432
+ createVerification(paramsOrFirst) {
1433
+ let params;
1434
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1435
+ params = paramsOrFirst || {};
1436
+ } else {
1437
+ params = {
1438
+ url: paramsOrFirst
1439
+ };
1440
+ }
1441
+ const url = params.url;
1442
+ if (typeof url === "undefined") {
1443
+ throw new client.AppwriteException('Missing required parameter: "url"');
1444
+ }
1445
+ const apiPath = "/account/verifications/email";
1446
+ const payload = {};
1447
+ if (typeof url !== "undefined") {
1448
+ payload["url"] = url;
1449
+ }
1450
+ const uri = new URL(this.client.config.endpoint + apiPath);
1451
+ const apiHeaders = {
1452
+ "content-type": "application/json"
1453
+ };
1454
+ return this.client.call(
1455
+ "post",
1456
+ uri,
1457
+ apiHeaders,
1458
+ payload
1459
+ );
1460
+ }
1461
+ updateEmailVerification(paramsOrFirst, ...rest) {
1462
+ let params;
1463
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1464
+ params = paramsOrFirst || {};
1465
+ } else {
1466
+ params = {
1467
+ userId: paramsOrFirst,
1468
+ secret: rest[0]
1469
+ };
1470
+ }
1471
+ const userId = params.userId;
1472
+ const secret = params.secret;
1473
+ if (typeof userId === "undefined") {
1474
+ throw new client.AppwriteException('Missing required parameter: "userId"');
1475
+ }
1476
+ if (typeof secret === "undefined") {
1477
+ throw new client.AppwriteException('Missing required parameter: "secret"');
1478
+ }
1479
+ const apiPath = "/account/verifications/email";
1480
+ const payload = {};
1481
+ if (typeof userId !== "undefined") {
1482
+ payload["userId"] = userId;
1483
+ }
1484
+ if (typeof secret !== "undefined") {
1485
+ payload["secret"] = secret;
1486
+ }
1487
+ const uri = new URL(this.client.config.endpoint + apiPath);
1488
+ const apiHeaders = {
1489
+ "content-type": "application/json"
1490
+ };
1491
+ return this.client.call(
1492
+ "put",
1493
+ uri,
1494
+ apiHeaders,
1495
+ payload
1496
+ );
1497
+ }
1498
+ updateVerification(paramsOrFirst, ...rest) {
1499
+ let params;
1500
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1501
+ params = paramsOrFirst || {};
1502
+ } else {
1503
+ params = {
1504
+ userId: paramsOrFirst,
1505
+ secret: rest[0]
1506
+ };
1507
+ }
1508
+ const userId = params.userId;
1509
+ const secret = params.secret;
1510
+ if (typeof userId === "undefined") {
1511
+ throw new client.AppwriteException('Missing required parameter: "userId"');
1512
+ }
1513
+ if (typeof secret === "undefined") {
1514
+ throw new client.AppwriteException('Missing required parameter: "secret"');
1515
+ }
1516
+ const apiPath = "/account/verifications/email";
1517
+ const payload = {};
1518
+ if (typeof userId !== "undefined") {
1519
+ payload["userId"] = userId;
1520
+ }
1521
+ if (typeof secret !== "undefined") {
1522
+ payload["secret"] = secret;
1523
+ }
1524
+ const uri = new URL(this.client.config.endpoint + apiPath);
1525
+ const apiHeaders = {
1526
+ "content-type": "application/json"
1527
+ };
1528
+ return this.client.call(
1529
+ "put",
1530
+ uri,
1531
+ apiHeaders,
1532
+ payload
1533
+ );
1534
+ }
1535
+ /**
1536
+ * Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.
1537
+ *
1538
+ * @throws {AppwriteException}
1539
+ * @returns {Promise<Models.Token>}
1540
+ */
1541
+ createPhoneVerification() {
1542
+ const apiPath = "/account/verifications/phone";
1543
+ const payload = {};
1544
+ const uri = new URL(this.client.config.endpoint + apiPath);
1545
+ const apiHeaders = {
1546
+ "content-type": "application/json"
1547
+ };
1548
+ return this.client.call(
1549
+ "post",
1550
+ uri,
1551
+ apiHeaders,
1552
+ payload
1553
+ );
1554
+ }
1555
+ updatePhoneVerification(paramsOrFirst, ...rest) {
1556
+ let params;
1557
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1558
+ params = paramsOrFirst || {};
1559
+ } else {
1560
+ params = {
1561
+ userId: paramsOrFirst,
1562
+ secret: rest[0]
1563
+ };
1564
+ }
1565
+ const userId = params.userId;
1566
+ const secret = params.secret;
1567
+ if (typeof userId === "undefined") {
1568
+ throw new client.AppwriteException('Missing required parameter: "userId"');
1569
+ }
1570
+ if (typeof secret === "undefined") {
1571
+ throw new client.AppwriteException('Missing required parameter: "secret"');
1572
+ }
1573
+ const apiPath = "/account/verifications/phone";
1574
+ const payload = {};
1575
+ if (typeof userId !== "undefined") {
1576
+ payload["userId"] = userId;
1577
+ }
1578
+ if (typeof secret !== "undefined") {
1579
+ payload["secret"] = secret;
1580
+ }
1581
+ const uri = new URL(this.client.config.endpoint + apiPath);
1582
+ const apiHeaders = {
1583
+ "content-type": "application/json"
1584
+ };
1585
+ return this.client.call(
1586
+ "put",
1587
+ uri,
1588
+ apiHeaders,
1589
+ payload
1590
+ );
1591
+ }
1592
+ }
1593
+
1594
+ exports.Account = Account;
1595
+ //# sourceMappingURL=out.js.map
1596
+ //# sourceMappingURL=account.js.map