@appconda/nextjs 1.0.12

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 (597) hide show
  1. package/.github/workflows/autoclose.yml +11 -0
  2. package/.github/workflows/publish.yml +42 -0
  3. package/.travis.yml +32 -0
  4. package/CHANGELOG.md +1 -0
  5. package/LICENSE +12 -0
  6. package/README.md +0 -0
  7. package/dist/cjs/sdk.js +10608 -0
  8. package/dist/cjs/sdk.js.map +1 -0
  9. package/dist/esm/sdk.js +10589 -0
  10. package/dist/esm/sdk.js.map +1 -0
  11. package/dist/iife/sdk.js +10609 -0
  12. package/docs/examples/account/create-anonymous-session.md +11 -0
  13. package/docs/examples/account/create-email-password-session.md +14 -0
  14. package/docs/examples/account/create-email-token.md +15 -0
  15. package/docs/examples/account/create-j-w-t.md +11 -0
  16. package/docs/examples/account/create-magic-u-r-l-token.md +16 -0
  17. package/docs/examples/account/create-mfa-authenticator.md +13 -0
  18. package/docs/examples/account/create-mfa-challenge.md +13 -0
  19. package/docs/examples/account/create-mfa-recovery-codes.md +11 -0
  20. package/docs/examples/account/create-o-auth2session.md +15 -0
  21. package/docs/examples/account/create-o-auth2token.md +15 -0
  22. package/docs/examples/account/create-phone-token.md +14 -0
  23. package/docs/examples/account/create-phone-verification.md +11 -0
  24. package/docs/examples/account/create-push-target.md +15 -0
  25. package/docs/examples/account/create-recovery.md +14 -0
  26. package/docs/examples/account/create-session.md +14 -0
  27. package/docs/examples/account/create-verification.md +13 -0
  28. package/docs/examples/account/create.md +16 -0
  29. package/docs/examples/account/delete-identity.md +13 -0
  30. package/docs/examples/account/delete-mfa-authenticator.md +13 -0
  31. package/docs/examples/account/delete-push-target.md +13 -0
  32. package/docs/examples/account/delete-session.md +13 -0
  33. package/docs/examples/account/delete-sessions.md +11 -0
  34. package/docs/examples/account/delete.md +11 -0
  35. package/docs/examples/account/get-mfa-recovery-codes.md +11 -0
  36. package/docs/examples/account/get-prefs.md +11 -0
  37. package/docs/examples/account/get-session.md +13 -0
  38. package/docs/examples/account/get.md +11 -0
  39. package/docs/examples/account/list-identities.md +13 -0
  40. package/docs/examples/account/list-logs.md +13 -0
  41. package/docs/examples/account/list-mfa-factors.md +11 -0
  42. package/docs/examples/account/list-sessions.md +11 -0
  43. package/docs/examples/account/update-email.md +14 -0
  44. package/docs/examples/account/update-m-f-a.md +13 -0
  45. package/docs/examples/account/update-magic-u-r-l-session.md +14 -0
  46. package/docs/examples/account/update-mfa-authenticator.md +14 -0
  47. package/docs/examples/account/update-mfa-challenge.md +14 -0
  48. package/docs/examples/account/update-mfa-recovery-codes.md +11 -0
  49. package/docs/examples/account/update-name.md +13 -0
  50. package/docs/examples/account/update-password.md +14 -0
  51. package/docs/examples/account/update-phone-session.md +14 -0
  52. package/docs/examples/account/update-phone-verification.md +14 -0
  53. package/docs/examples/account/update-phone.md +14 -0
  54. package/docs/examples/account/update-prefs.md +13 -0
  55. package/docs/examples/account/update-push-target.md +14 -0
  56. package/docs/examples/account/update-recovery.md +15 -0
  57. package/docs/examples/account/update-session.md +13 -0
  58. package/docs/examples/account/update-status.md +11 -0
  59. package/docs/examples/account/update-verification.md +14 -0
  60. package/docs/examples/assistant/chat.md +13 -0
  61. package/docs/examples/avatars/get-browser.md +16 -0
  62. package/docs/examples/avatars/get-credit-card.md +16 -0
  63. package/docs/examples/avatars/get-favicon.md +13 -0
  64. package/docs/examples/avatars/get-flag.md +16 -0
  65. package/docs/examples/avatars/get-image.md +15 -0
  66. package/docs/examples/avatars/get-initials.md +16 -0
  67. package/docs/examples/avatars/get-q-r.md +16 -0
  68. package/docs/examples/console/variables.md +11 -0
  69. package/docs/examples/databases/create-boolean-attribute.md +18 -0
  70. package/docs/examples/databases/create-collection.md +18 -0
  71. package/docs/examples/databases/create-datetime-attribute.md +18 -0
  72. package/docs/examples/databases/create-document.md +17 -0
  73. package/docs/examples/databases/create-email-attribute.md +18 -0
  74. package/docs/examples/databases/create-enum-attribute.md +19 -0
  75. package/docs/examples/databases/create-float-attribute.md +20 -0
  76. package/docs/examples/databases/create-index.md +18 -0
  77. package/docs/examples/databases/create-integer-attribute.md +20 -0
  78. package/docs/examples/databases/create-ip-attribute.md +18 -0
  79. package/docs/examples/databases/create-relationship-attribute.md +20 -0
  80. package/docs/examples/databases/create-string-attribute.md +20 -0
  81. package/docs/examples/databases/create-url-attribute.md +18 -0
  82. package/docs/examples/databases/create.md +15 -0
  83. package/docs/examples/databases/delete-attribute.md +15 -0
  84. package/docs/examples/databases/delete-collection.md +14 -0
  85. package/docs/examples/databases/delete-document.md +15 -0
  86. package/docs/examples/databases/delete-index.md +15 -0
  87. package/docs/examples/databases/delete.md +13 -0
  88. package/docs/examples/databases/get-attribute.md +15 -0
  89. package/docs/examples/databases/get-collection-usage.md +15 -0
  90. package/docs/examples/databases/get-collection.md +14 -0
  91. package/docs/examples/databases/get-database-usage.md +14 -0
  92. package/docs/examples/databases/get-document.md +16 -0
  93. package/docs/examples/databases/get-index.md +15 -0
  94. package/docs/examples/databases/get-usage.md +13 -0
  95. package/docs/examples/databases/get.md +13 -0
  96. package/docs/examples/databases/list-attributes.md +15 -0
  97. package/docs/examples/databases/list-collection-logs.md +15 -0
  98. package/docs/examples/databases/list-collections.md +15 -0
  99. package/docs/examples/databases/list-document-logs.md +16 -0
  100. package/docs/examples/databases/list-documents.md +15 -0
  101. package/docs/examples/databases/list-indexes.md +15 -0
  102. package/docs/examples/databases/list-logs.md +14 -0
  103. package/docs/examples/databases/list.md +14 -0
  104. package/docs/examples/databases/update-boolean-attribute.md +17 -0
  105. package/docs/examples/databases/update-collection.md +18 -0
  106. package/docs/examples/databases/update-datetime-attribute.md +17 -0
  107. package/docs/examples/databases/update-document.md +17 -0
  108. package/docs/examples/databases/update-email-attribute.md +17 -0
  109. package/docs/examples/databases/update-enum-attribute.md +18 -0
  110. package/docs/examples/databases/update-float-attribute.md +19 -0
  111. package/docs/examples/databases/update-integer-attribute.md +19 -0
  112. package/docs/examples/databases/update-ip-attribute.md +17 -0
  113. package/docs/examples/databases/update-relationship-attribute.md +16 -0
  114. package/docs/examples/databases/update-string-attribute.md +17 -0
  115. package/docs/examples/databases/update-url-attribute.md +17 -0
  116. package/docs/examples/databases/update.md +15 -0
  117. package/docs/examples/functions/create-build.md +15 -0
  118. package/docs/examples/functions/create-deployment.md +17 -0
  119. package/docs/examples/functions/create-execution.md +19 -0
  120. package/docs/examples/functions/create-variable.md +15 -0
  121. package/docs/examples/functions/create.md +34 -0
  122. package/docs/examples/functions/delete-deployment.md +14 -0
  123. package/docs/examples/functions/delete-execution.md +14 -0
  124. package/docs/examples/functions/delete-variable.md +14 -0
  125. package/docs/examples/functions/delete.md +13 -0
  126. package/docs/examples/functions/get-deployment-download.md +14 -0
  127. package/docs/examples/functions/get-deployment.md +14 -0
  128. package/docs/examples/functions/get-execution.md +14 -0
  129. package/docs/examples/functions/get-function-usage.md +14 -0
  130. package/docs/examples/functions/get-template.md +13 -0
  131. package/docs/examples/functions/get-usage.md +13 -0
  132. package/docs/examples/functions/get-variable.md +14 -0
  133. package/docs/examples/functions/get.md +13 -0
  134. package/docs/examples/functions/list-deployments.md +15 -0
  135. package/docs/examples/functions/list-executions.md +15 -0
  136. package/docs/examples/functions/list-runtimes.md +11 -0
  137. package/docs/examples/functions/list-specifications.md +11 -0
  138. package/docs/examples/functions/list-templates.md +16 -0
  139. package/docs/examples/functions/list-variables.md +13 -0
  140. package/docs/examples/functions/list.md +14 -0
  141. package/docs/examples/functions/update-deployment-build.md +14 -0
  142. package/docs/examples/functions/update-deployment.md +14 -0
  143. package/docs/examples/functions/update-variable.md +16 -0
  144. package/docs/examples/functions/update.md +30 -0
  145. package/docs/examples/graphql/mutation.md +13 -0
  146. package/docs/examples/graphql/query.md +13 -0
  147. package/docs/examples/health/get-antivirus.md +11 -0
  148. package/docs/examples/health/get-cache.md +11 -0
  149. package/docs/examples/health/get-certificate.md +13 -0
  150. package/docs/examples/health/get-d-b.md +11 -0
  151. package/docs/examples/health/get-failed-jobs.md +14 -0
  152. package/docs/examples/health/get-pub-sub.md +11 -0
  153. package/docs/examples/health/get-queue-builds.md +13 -0
  154. package/docs/examples/health/get-queue-certificates.md +13 -0
  155. package/docs/examples/health/get-queue-databases.md +14 -0
  156. package/docs/examples/health/get-queue-deletes.md +13 -0
  157. package/docs/examples/health/get-queue-functions.md +13 -0
  158. package/docs/examples/health/get-queue-logs.md +13 -0
  159. package/docs/examples/health/get-queue-mails.md +13 -0
  160. package/docs/examples/health/get-queue-messaging.md +13 -0
  161. package/docs/examples/health/get-queue-migrations.md +13 -0
  162. package/docs/examples/health/get-queue-usage-dump.md +13 -0
  163. package/docs/examples/health/get-queue-usage.md +13 -0
  164. package/docs/examples/health/get-queue-webhooks.md +13 -0
  165. package/docs/examples/health/get-queue.md +11 -0
  166. package/docs/examples/health/get-storage-local.md +11 -0
  167. package/docs/examples/health/get-storage.md +11 -0
  168. package/docs/examples/health/get-time.md +11 -0
  169. package/docs/examples/health/get.md +11 -0
  170. package/docs/examples/locale/get.md +11 -0
  171. package/docs/examples/locale/list-codes.md +11 -0
  172. package/docs/examples/locale/list-continents.md +11 -0
  173. package/docs/examples/locale/list-countries-e-u.md +11 -0
  174. package/docs/examples/locale/list-countries-phones.md +11 -0
  175. package/docs/examples/locale/list-countries.md +11 -0
  176. package/docs/examples/locale/list-currencies.md +11 -0
  177. package/docs/examples/locale/list-languages.md +11 -0
  178. package/docs/examples/messaging/create-apns-provider.md +20 -0
  179. package/docs/examples/messaging/create-email.md +24 -0
  180. package/docs/examples/messaging/create-fcm-provider.md +16 -0
  181. package/docs/examples/messaging/create-mailgun-provider.md +22 -0
  182. package/docs/examples/messaging/create-msg91provider.md +18 -0
  183. package/docs/examples/messaging/create-push.md +28 -0
  184. package/docs/examples/messaging/create-sendgrid-provider.md +20 -0
  185. package/docs/examples/messaging/create-sms.md +19 -0
  186. package/docs/examples/messaging/create-smtp-provider.md +26 -0
  187. package/docs/examples/messaging/create-subscriber.md +15 -0
  188. package/docs/examples/messaging/create-telesign-provider.md +18 -0
  189. package/docs/examples/messaging/create-textmagic-provider.md +18 -0
  190. package/docs/examples/messaging/create-topic.md +15 -0
  191. package/docs/examples/messaging/create-twilio-provider.md +18 -0
  192. package/docs/examples/messaging/create-vonage-provider.md +18 -0
  193. package/docs/examples/messaging/delete-provider.md +13 -0
  194. package/docs/examples/messaging/delete-subscriber.md +14 -0
  195. package/docs/examples/messaging/delete-topic.md +13 -0
  196. package/docs/examples/messaging/delete.md +13 -0
  197. package/docs/examples/messaging/get-message.md +13 -0
  198. package/docs/examples/messaging/get-provider.md +13 -0
  199. package/docs/examples/messaging/get-subscriber.md +14 -0
  200. package/docs/examples/messaging/get-topic.md +13 -0
  201. package/docs/examples/messaging/list-message-logs.md +14 -0
  202. package/docs/examples/messaging/list-messages.md +14 -0
  203. package/docs/examples/messaging/list-provider-logs.md +14 -0
  204. package/docs/examples/messaging/list-providers.md +14 -0
  205. package/docs/examples/messaging/list-subscriber-logs.md +14 -0
  206. package/docs/examples/messaging/list-subscribers.md +15 -0
  207. package/docs/examples/messaging/list-targets.md +14 -0
  208. package/docs/examples/messaging/list-topic-logs.md +14 -0
  209. package/docs/examples/messaging/list-topics.md +14 -0
  210. package/docs/examples/messaging/update-apns-provider.md +20 -0
  211. package/docs/examples/messaging/update-email.md +24 -0
  212. package/docs/examples/messaging/update-fcm-provider.md +16 -0
  213. package/docs/examples/messaging/update-mailgun-provider.md +22 -0
  214. package/docs/examples/messaging/update-msg91provider.md +18 -0
  215. package/docs/examples/messaging/update-push.md +28 -0
  216. package/docs/examples/messaging/update-sendgrid-provider.md +20 -0
  217. package/docs/examples/messaging/update-sms.md +19 -0
  218. package/docs/examples/messaging/update-smtp-provider.md +26 -0
  219. package/docs/examples/messaging/update-telesign-provider.md +18 -0
  220. package/docs/examples/messaging/update-textmagic-provider.md +18 -0
  221. package/docs/examples/messaging/update-topic.md +15 -0
  222. package/docs/examples/messaging/update-twilio-provider.md +18 -0
  223. package/docs/examples/messaging/update-vonage-provider.md +18 -0
  224. package/docs/examples/migrations/create-appwrite-migration.md +16 -0
  225. package/docs/examples/migrations/create-firebase-migration.md +14 -0
  226. package/docs/examples/migrations/create-firebase-o-auth-migration.md +14 -0
  227. package/docs/examples/migrations/create-n-host-migration.md +20 -0
  228. package/docs/examples/migrations/create-supabase-migration.md +19 -0
  229. package/docs/examples/migrations/delete-firebase-auth.md +11 -0
  230. package/docs/examples/migrations/delete.md +13 -0
  231. package/docs/examples/migrations/get-appwrite-report.md +16 -0
  232. package/docs/examples/migrations/get-firebase-report-o-auth.md +14 -0
  233. package/docs/examples/migrations/get-firebase-report.md +14 -0
  234. package/docs/examples/migrations/get-n-host-report.md +20 -0
  235. package/docs/examples/migrations/get-supabase-report.md +19 -0
  236. package/docs/examples/migrations/get.md +13 -0
  237. package/docs/examples/migrations/list-firebase-projects.md +11 -0
  238. package/docs/examples/migrations/list.md +14 -0
  239. package/docs/examples/migrations/retry.md +13 -0
  240. package/docs/examples/project/create-variable.md +14 -0
  241. package/docs/examples/project/delete-variable.md +13 -0
  242. package/docs/examples/project/get-usage.md +15 -0
  243. package/docs/examples/project/get-variable.md +13 -0
  244. package/docs/examples/project/list-variables.md +11 -0
  245. package/docs/examples/project/update-variable.md +15 -0
  246. package/docs/examples/projects/create-j-w-t.md +15 -0
  247. package/docs/examples/projects/create-key.md +16 -0
  248. package/docs/examples/projects/create-platform.md +18 -0
  249. package/docs/examples/projects/create-smtp-test.md +22 -0
  250. package/docs/examples/projects/create-webhook.md +20 -0
  251. package/docs/examples/projects/create.md +25 -0
  252. package/docs/examples/projects/delete-email-template.md +15 -0
  253. package/docs/examples/projects/delete-key.md +14 -0
  254. package/docs/examples/projects/delete-platform.md +14 -0
  255. package/docs/examples/projects/delete-sms-template.md +15 -0
  256. package/docs/examples/projects/delete-webhook.md +14 -0
  257. package/docs/examples/projects/delete.md +13 -0
  258. package/docs/examples/projects/get-email-template.md +15 -0
  259. package/docs/examples/projects/get-key.md +14 -0
  260. package/docs/examples/projects/get-platform.md +14 -0
  261. package/docs/examples/projects/get-sms-template.md +15 -0
  262. package/docs/examples/projects/get-webhook.md +14 -0
  263. package/docs/examples/projects/get.md +13 -0
  264. package/docs/examples/projects/list-keys.md +13 -0
  265. package/docs/examples/projects/list-platforms.md +13 -0
  266. package/docs/examples/projects/list-webhooks.md +13 -0
  267. package/docs/examples/projects/list.md +14 -0
  268. package/docs/examples/projects/update-api-status-all.md +14 -0
  269. package/docs/examples/projects/update-api-status.md +15 -0
  270. package/docs/examples/projects/update-auth-duration.md +14 -0
  271. package/docs/examples/projects/update-auth-limit.md +14 -0
  272. package/docs/examples/projects/update-auth-password-dictionary.md +14 -0
  273. package/docs/examples/projects/update-auth-password-history.md +14 -0
  274. package/docs/examples/projects/update-auth-sessions-limit.md +14 -0
  275. package/docs/examples/projects/update-auth-status.md +15 -0
  276. package/docs/examples/projects/update-email-template.md +20 -0
  277. package/docs/examples/projects/update-key.md +17 -0
  278. package/docs/examples/projects/update-mock-numbers.md +14 -0
  279. package/docs/examples/projects/update-o-auth2.md +17 -0
  280. package/docs/examples/projects/update-personal-data-check.md +14 -0
  281. package/docs/examples/projects/update-platform.md +18 -0
  282. package/docs/examples/projects/update-service-status-all.md +14 -0
  283. package/docs/examples/projects/update-service-status.md +15 -0
  284. package/docs/examples/projects/update-session-alerts.md +14 -0
  285. package/docs/examples/projects/update-sms-template.md +16 -0
  286. package/docs/examples/projects/update-smtp.md +22 -0
  287. package/docs/examples/projects/update-team.md +14 -0
  288. package/docs/examples/projects/update-webhook-signature.md +14 -0
  289. package/docs/examples/projects/update-webhook.md +21 -0
  290. package/docs/examples/projects/update.md +23 -0
  291. package/docs/examples/proxy/create-rule.md +15 -0
  292. package/docs/examples/proxy/delete-rule.md +13 -0
  293. package/docs/examples/proxy/get-rule.md +13 -0
  294. package/docs/examples/proxy/list-rules.md +14 -0
  295. package/docs/examples/proxy/update-rule-verification.md +13 -0
  296. package/docs/examples/storage/create-bucket.md +22 -0
  297. package/docs/examples/storage/create-file.md +16 -0
  298. package/docs/examples/storage/delete-bucket.md +13 -0
  299. package/docs/examples/storage/delete-file.md +14 -0
  300. package/docs/examples/storage/get-bucket-usage.md +14 -0
  301. package/docs/examples/storage/get-bucket.md +13 -0
  302. package/docs/examples/storage/get-file-download.md +14 -0
  303. package/docs/examples/storage/get-file-preview.md +25 -0
  304. package/docs/examples/storage/get-file-view.md +14 -0
  305. package/docs/examples/storage/get-file.md +14 -0
  306. package/docs/examples/storage/get-usage.md +13 -0
  307. package/docs/examples/storage/list-buckets.md +14 -0
  308. package/docs/examples/storage/list-files.md +15 -0
  309. package/docs/examples/storage/update-bucket.md +22 -0
  310. package/docs/examples/storage/update-file.md +16 -0
  311. package/docs/examples/teams/create-membership.md +19 -0
  312. package/docs/examples/teams/create.md +15 -0
  313. package/docs/examples/teams/delete-membership.md +14 -0
  314. package/docs/examples/teams/delete.md +13 -0
  315. package/docs/examples/teams/get-membership.md +14 -0
  316. package/docs/examples/teams/get-prefs.md +13 -0
  317. package/docs/examples/teams/get.md +13 -0
  318. package/docs/examples/teams/list-logs.md +14 -0
  319. package/docs/examples/teams/list-memberships.md +15 -0
  320. package/docs/examples/teams/list.md +14 -0
  321. package/docs/examples/teams/update-membership-status.md +16 -0
  322. package/docs/examples/teams/update-membership.md +15 -0
  323. package/docs/examples/teams/update-name.md +14 -0
  324. package/docs/examples/teams/update-prefs.md +14 -0
  325. package/docs/examples/users/create-argon2user.md +16 -0
  326. package/docs/examples/users/create-bcrypt-user.md +16 -0
  327. package/docs/examples/users/create-j-w-t.md +15 -0
  328. package/docs/examples/users/create-m-d5user.md +16 -0
  329. package/docs/examples/users/create-mfa-recovery-codes.md +13 -0
  330. package/docs/examples/users/create-p-h-pass-user.md +16 -0
  331. package/docs/examples/users/create-s-h-a-user.md +17 -0
  332. package/docs/examples/users/create-scrypt-modified-user.md +19 -0
  333. package/docs/examples/users/create-scrypt-user.md +21 -0
  334. package/docs/examples/users/create-session.md +13 -0
  335. package/docs/examples/users/create-target.md +18 -0
  336. package/docs/examples/users/create-token.md +15 -0
  337. package/docs/examples/users/create.md +17 -0
  338. package/docs/examples/users/delete-identity.md +13 -0
  339. package/docs/examples/users/delete-mfa-authenticator.md +14 -0
  340. package/docs/examples/users/delete-session.md +14 -0
  341. package/docs/examples/users/delete-sessions.md +13 -0
  342. package/docs/examples/users/delete-target.md +14 -0
  343. package/docs/examples/users/delete.md +13 -0
  344. package/docs/examples/users/get-mfa-recovery-codes.md +13 -0
  345. package/docs/examples/users/get-prefs.md +13 -0
  346. package/docs/examples/users/get-target.md +14 -0
  347. package/docs/examples/users/get-usage.md +13 -0
  348. package/docs/examples/users/get.md +13 -0
  349. package/docs/examples/users/list-identities.md +14 -0
  350. package/docs/examples/users/list-logs.md +14 -0
  351. package/docs/examples/users/list-memberships.md +13 -0
  352. package/docs/examples/users/list-mfa-factors.md +13 -0
  353. package/docs/examples/users/list-sessions.md +13 -0
  354. package/docs/examples/users/list-targets.md +14 -0
  355. package/docs/examples/users/list.md +14 -0
  356. package/docs/examples/users/update-email-verification.md +14 -0
  357. package/docs/examples/users/update-email.md +14 -0
  358. package/docs/examples/users/update-labels.md +14 -0
  359. package/docs/examples/users/update-mfa-recovery-codes.md +13 -0
  360. package/docs/examples/users/update-mfa.md +14 -0
  361. package/docs/examples/users/update-name.md +14 -0
  362. package/docs/examples/users/update-password.md +14 -0
  363. package/docs/examples/users/update-phone-verification.md +14 -0
  364. package/docs/examples/users/update-phone.md +14 -0
  365. package/docs/examples/users/update-prefs.md +14 -0
  366. package/docs/examples/users/update-status.md +14 -0
  367. package/docs/examples/users/update-target.md +17 -0
  368. package/docs/examples/vcs/create-repository-detection.md +15 -0
  369. package/docs/examples/vcs/create-repository.md +15 -0
  370. package/docs/examples/vcs/delete-installation.md +13 -0
  371. package/docs/examples/vcs/get-installation.md +13 -0
  372. package/docs/examples/vcs/get-repository-contents.md +15 -0
  373. package/docs/examples/vcs/get-repository.md +14 -0
  374. package/docs/examples/vcs/list-installations.md +14 -0
  375. package/docs/examples/vcs/list-repositories.md +14 -0
  376. package/docs/examples/vcs/list-repository-branches.md +14 -0
  377. package/docs/examples/vcs/update-external-deployments.md +15 -0
  378. package/package.json +42 -0
  379. package/publish.sh +4 -0
  380. package/rollup.config.js +27 -0
  381. package/src/Cache/Adapter.ts +11 -0
  382. package/src/Cache/Adapters/Filesystem.ts +126 -0
  383. package/src/Cache/Adapters/Memory.ts +57 -0
  384. package/src/Cache/Adapters/None.ts +36 -0
  385. package/src/Cache/Adapters/Redis.ts +106 -0
  386. package/src/Cache/Adapters/Sharding.ts +87 -0
  387. package/src/Cache/Cache.ts +75 -0
  388. package/src/Cache/index.ts +5 -0
  389. package/src/Cache/test.ts +0 -0
  390. package/src/Services.ts +41 -0
  391. package/src/client.ts +397 -0
  392. package/src/decorators/Cache.ts +102 -0
  393. package/src/decorators/CacheKey.ts +9 -0
  394. package/src/decorators/Invalidate.ts +68 -0
  395. package/src/enums/api-service.ts +13 -0
  396. package/src/enums/api.ts +5 -0
  397. package/src/enums/auth-method.ts +9 -0
  398. package/src/enums/authentication-factor.ts +6 -0
  399. package/src/enums/authenticator-type.ts +3 -0
  400. package/src/enums/browser.ts +16 -0
  401. package/src/enums/compression.ts +5 -0
  402. package/src/enums/credit-card.ts +18 -0
  403. package/src/enums/database-usage-range.ts +5 -0
  404. package/src/enums/email-template-locale.ts +133 -0
  405. package/src/enums/email-template-type.ts +9 -0
  406. package/src/enums/entities/EntityLimitType.ts +4 -0
  407. package/src/enums/entities/PropertyAttributeName.ts +27 -0
  408. package/src/enums/entities/PropertyCondition.ts +8 -0
  409. package/src/enums/entities/PropertyType.ts +16 -0
  410. package/src/enums/entities/PropertyValueType.ts +6 -0
  411. package/src/enums/entities/RowAccess.ts +2 -0
  412. package/src/enums/entities/ViewFilterCondition.ts +12 -0
  413. package/src/enums/execution-method.ts +8 -0
  414. package/src/enums/flag.ts +197 -0
  415. package/src/enums/function-usage-range.ts +5 -0
  416. package/src/enums/image-format.ts +7 -0
  417. package/src/enums/image-gravity.ts +11 -0
  418. package/src/enums/index-type.ts +5 -0
  419. package/src/enums/messaging-provider-type.ts +5 -0
  420. package/src/enums/name.ts +14 -0
  421. package/src/enums/o-auth-provider copy.ts +41 -0
  422. package/src/enums/o-auth-provider.ts +41 -0
  423. package/src/enums/password-hash.ts +13 -0
  424. package/src/enums/platform-type.ts +17 -0
  425. package/src/enums/project-usage-range.ts +4 -0
  426. package/src/enums/region.ts +4 -0
  427. package/src/enums/relation-mutate.ts +5 -0
  428. package/src/enums/relationship-type.ts +6 -0
  429. package/src/enums/resource-type.ts +4 -0
  430. package/src/enums/runtime.ts +48 -0
  431. package/src/enums/s-m-t-p-secure.ts +3 -0
  432. package/src/enums/shared/ApplicationLayout.ts +4 -0
  433. package/src/enums/shared/Colors.ts +24 -0
  434. package/src/enums/shared/InputType.ts +6 -0
  435. package/src/enums/shared/Periodicity.ts +7 -0
  436. package/src/enums/shared/SvgIcon.ts +37 -0
  437. package/src/enums/shared/Theme.ts +4 -0
  438. package/src/enums/sms-template-locale.ts +133 -0
  439. package/src/enums/sms-template-type.ts +6 -0
  440. package/src/enums/smtp-encryption.ts +5 -0
  441. package/src/enums/storage-usage-range.ts +5 -0
  442. package/src/enums/subscriptions/PricingModel.ts +14 -0
  443. package/src/enums/subscriptions/SubscriptionBillingPeriod.ts +15 -0
  444. package/src/enums/subscriptions/SubscriptionFeatureLimitType.ts +16 -0
  445. package/src/enums/subscriptions/SubscriptionPriceType.ts +10 -0
  446. package/src/enums/tenants/LinkedAccountStatus.ts +5 -0
  447. package/src/enums/tenants/TenantUserJoined.ts +6 -0
  448. package/src/enums/tenants/TenantUserStatus.ts +6 -0
  449. package/src/enums/tenants/TenantUserType.ts +5 -0
  450. package/src/enums/user-usage-range.ts +5 -0
  451. package/src/id.ts +47 -0
  452. package/src/index.ts +36 -0
  453. package/src/inputFile.ts +23 -0
  454. package/src/lib/Registry/Registry.ts +66 -0
  455. package/src/lib/Registry/index.ts +1 -0
  456. package/src/models.ts +3339 -0
  457. package/src/permission.ts +57 -0
  458. package/src/query.ts +261 -0
  459. package/src/role.ts +100 -0
  460. package/src/service-client.ts +29 -0
  461. package/src/service.ts +30 -0
  462. package/src/services/account.ts +1643 -0
  463. package/src/services/applets.ts +75 -0
  464. package/src/services/avatars.ts +314 -0
  465. package/src/services/community.ts +102 -0
  466. package/src/services/configuration.ts +15 -0
  467. package/src/services/databases.ts +2037 -0
  468. package/src/services/functions.ts +986 -0
  469. package/src/services/graphql.ts +75 -0
  470. package/src/services/health.ts +629 -0
  471. package/src/services/locale.ts +205 -0
  472. package/src/services/messaging.ts +2247 -0
  473. package/src/services/node.ts +15 -0
  474. package/src/services/permissions.ts +131 -0
  475. package/src/services/pricing.ts +30 -0
  476. package/src/services/projects.ts +1901 -0
  477. package/src/services/roles.ts +101 -0
  478. package/src/services/schema.ts +65 -0
  479. package/src/services/storage.ts +576 -0
  480. package/src/services/subscription.ts +40 -0
  481. package/src/services/teams.ts +490 -0
  482. package/src/services/tenant-subscription.ts +93 -0
  483. package/src/services/tenant.ts +194 -0
  484. package/src/services/users.ts +1584 -0
  485. package/tsconfig.json +29 -0
  486. package/types/Cache/Adapter.d.ts +10 -0
  487. package/types/Cache/Adapters/Filesystem.d.ts +16 -0
  488. package/types/Cache/Adapters/Memory.d.ts +18 -0
  489. package/types/Cache/Adapters/None.d.ts +12 -0
  490. package/types/Cache/Adapters/Redis.d.ts +14 -0
  491. package/types/Cache/Adapters/Sharding.d.ts +17 -0
  492. package/types/Cache/Cache.d.ts +16 -0
  493. package/types/Cache/index.d.ts +5 -0
  494. package/types/Cache/test.d.ts +0 -0
  495. package/types/Services.d.ts +6 -0
  496. package/types/client.d.ts +141 -0
  497. package/types/decorators/Cache.d.ts +1 -0
  498. package/types/decorators/CacheKey.d.ts +1 -0
  499. package/types/decorators/Invalidate.d.ts +1 -0
  500. package/types/enums/api-service.d.ts +13 -0
  501. package/types/enums/api.d.ts +5 -0
  502. package/types/enums/auth-method.d.ts +9 -0
  503. package/types/enums/authentication-factor.d.ts +6 -0
  504. package/types/enums/authenticator-type.d.ts +3 -0
  505. package/types/enums/browser.d.ts +16 -0
  506. package/types/enums/compression.d.ts +5 -0
  507. package/types/enums/credit-card.d.ts +18 -0
  508. package/types/enums/database-usage-range.d.ts +5 -0
  509. package/types/enums/email-template-locale.d.ts +133 -0
  510. package/types/enums/email-template-type.d.ts +9 -0
  511. package/types/enums/entities/EntityLimitType.d.ts +4 -0
  512. package/types/enums/entities/PropertyAttributeName.d.ts +27 -0
  513. package/types/enums/entities/PropertyCondition.d.ts +7 -0
  514. package/types/enums/entities/PropertyType.d.ts +12 -0
  515. package/types/enums/entities/PropertyValueType.d.ts +6 -0
  516. package/types/enums/entities/RowAccess.d.ts +2 -0
  517. package/types/enums/entities/ViewFilterCondition.d.ts +12 -0
  518. package/types/enums/execution-method.d.ts +8 -0
  519. package/types/enums/flag.d.ts +197 -0
  520. package/types/enums/function-usage-range.d.ts +5 -0
  521. package/types/enums/image-format.d.ts +7 -0
  522. package/types/enums/image-gravity.d.ts +11 -0
  523. package/types/enums/index-type.d.ts +5 -0
  524. package/types/enums/messaging-provider-type.d.ts +5 -0
  525. package/types/enums/name.d.ts +14 -0
  526. package/types/enums/o-auth-provider copy.d.ts +41 -0
  527. package/types/enums/o-auth-provider.d.ts +41 -0
  528. package/types/enums/password-hash.d.ts +13 -0
  529. package/types/enums/platform-type.d.ts +17 -0
  530. package/types/enums/project-usage-range.d.ts +4 -0
  531. package/types/enums/region.d.ts +4 -0
  532. package/types/enums/relation-mutate.d.ts +5 -0
  533. package/types/enums/relationship-type.d.ts +6 -0
  534. package/types/enums/resource-type.d.ts +4 -0
  535. package/types/enums/runtime.d.ts +48 -0
  536. package/types/enums/s-m-t-p-secure.d.ts +3 -0
  537. package/types/enums/shared/ApplicationLayout.d.ts +4 -0
  538. package/types/enums/shared/Colors.d.ts +24 -0
  539. package/types/enums/shared/InputType.d.ts +6 -0
  540. package/types/enums/shared/Periodicity.d.ts +7 -0
  541. package/types/enums/shared/SvgIcon.d.ts +37 -0
  542. package/types/enums/shared/Theme.d.ts +4 -0
  543. package/types/enums/sms-template-locale.d.ts +133 -0
  544. package/types/enums/sms-template-type.d.ts +6 -0
  545. package/types/enums/smtp-encryption.d.ts +5 -0
  546. package/types/enums/storage-usage-range.d.ts +5 -0
  547. package/types/enums/subscriptions/PricingModel.d.ts +11 -0
  548. package/types/enums/subscriptions/SubscriptionBillingPeriod.d.ts +10 -0
  549. package/types/enums/subscriptions/SubscriptionFeatureLimitType.d.ts +10 -0
  550. package/types/enums/subscriptions/SubscriptionPriceType.d.ts +7 -0
  551. package/types/enums/tenants/LinkedAccountStatus.d.ts +5 -0
  552. package/types/enums/tenants/TenantUserJoined.d.ts +6 -0
  553. package/types/enums/tenants/TenantUserStatus.d.ts +6 -0
  554. package/types/enums/tenants/TenantUserType.d.ts +5 -0
  555. package/types/enums/user-usage-range.d.ts +5 -0
  556. package/types/id.d.ts +20 -0
  557. package/types/index.d.ts +36 -0
  558. package/types/inputFile.d.ts +6 -0
  559. package/types/lib/Registry/Registry.d.ts +38 -0
  560. package/types/lib/Registry/index.d.ts +1 -0
  561. package/types/models.d.ts +3272 -0
  562. package/types/permission.d.ts +43 -0
  563. package/types/query.d.ts +194 -0
  564. package/types/role.d.ts +70 -0
  565. package/types/service-client.d.ts +7 -0
  566. package/types/service.d.ts +11 -0
  567. package/types/services/account.d.ts +530 -0
  568. package/types/services/acl.d.ts +28 -0
  569. package/types/services/applets.d.ts +9 -0
  570. package/types/services/assistant.d.ts +14 -0
  571. package/types/services/avatars.d.ts +115 -0
  572. package/types/services/community.d.ts +19 -0
  573. package/types/services/configuration.d.ts +5 -0
  574. package/types/services/console.d.ts +15 -0
  575. package/types/services/databases.d.ts +613 -0
  576. package/types/services/functions.d.ts +319 -0
  577. package/types/services/graphql.d.ts +25 -0
  578. package/types/services/health.d.ts +231 -0
  579. package/types/services/locale.d.ts +80 -0
  580. package/types/services/messaging.d.ts +685 -0
  581. package/types/services/migrations.d.ts +185 -0
  582. package/types/services/node.d.ts +5 -0
  583. package/types/services/permissions.d.ts +20 -0
  584. package/types/services/pricing.d.ts +15 -0
  585. package/types/services/project.d.ts +70 -0
  586. package/types/services/projects.d.ts +542 -0
  587. package/types/services/proxy.d.ts +59 -0
  588. package/types/services/roles.d.ts +19 -0
  589. package/types/services/schema.d.ts +17 -0
  590. package/types/services/storage.d.ts +189 -0
  591. package/types/services/subscription-product.d.ts +77 -0
  592. package/types/services/subscription.d.ts +15 -0
  593. package/types/services/teams.d.ts +167 -0
  594. package/types/services/tenant-subscription.d.ts +12 -0
  595. package/types/services/tenant.d.ts +32 -0
  596. package/types/services/users.d.ts +499 -0
  597. package/types/services/vcs.d.ts +108 -0
@@ -0,0 +1,1584 @@
1
+ import { AppcondaException, Client, type Payload, UploadProgress } from '../client';
2
+ import type { Models } from '../models';
3
+ import { PasswordHash } from '../enums/password-hash';
4
+ import { AuthenticatorType } from '../enums/authenticator-type';
5
+ import { MessagingProviderType } from '../enums/messaging-provider-type';
6
+
7
+ export class Users {
8
+ client: Client;
9
+
10
+ constructor(client: Client) {
11
+ this.client = client;
12
+ }
13
+
14
+ /**
15
+ * List users
16
+ *
17
+ * Get a list of all the project's users. You can use the query params to filter your results.
18
+ *
19
+ * @param {string[]} queries
20
+ * @param {string} search
21
+ * @throws {AppcondaException}
22
+ * @returns {Promise<Models.UserList<Preferences>>}
23
+ */
24
+ async list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.UserList<Preferences>> {
25
+ const apiPath = '/users';
26
+ const payload: Payload = {};
27
+ if (typeof queries !== 'undefined') {
28
+ payload['queries'] = queries;
29
+ }
30
+ if (typeof search !== 'undefined') {
31
+ payload['search'] = search;
32
+ }
33
+ const uri = new URL(this.client.config.endpoint + apiPath);
34
+
35
+ const apiHeaders: { [header: string]: string } = {
36
+ 'content-type': 'application/json',
37
+ }
38
+
39
+ return await this.client.call(
40
+ 'get',
41
+ uri,
42
+ apiHeaders,
43
+ payload,
44
+ );
45
+ }
46
+ /**
47
+ * Create user
48
+ *
49
+ * Create a new user.
50
+ *
51
+ * @param {string} userId
52
+ * @param {string} email
53
+ * @param {string} phone
54
+ * @param {string} password
55
+ * @param {string} name
56
+ * @throws {AppcondaException}
57
+ * @returns {Promise<Models.User<Preferences>>}
58
+ */
59
+ async create<Preferences extends Models.Preferences>(userId: string, email?: string, phone?: string, password?: string, name?: string): Promise<Models.User<Preferences>> {
60
+ if (typeof userId === 'undefined') {
61
+ throw new AppcondaException('Missing required parameter: "userId"');
62
+ }
63
+ const apiPath = '/users';
64
+ const payload: Payload = {};
65
+ if (typeof userId !== 'undefined') {
66
+ payload['userId'] = userId;
67
+ }
68
+ if (typeof email !== 'undefined') {
69
+ payload['email'] = email;
70
+ }
71
+ if (typeof phone !== 'undefined') {
72
+ payload['phone'] = phone;
73
+ }
74
+ if (typeof password !== 'undefined') {
75
+ payload['password'] = password;
76
+ }
77
+ if (typeof name !== 'undefined') {
78
+ payload['name'] = name;
79
+ }
80
+ const uri = new URL(this.client.config.endpoint + apiPath);
81
+
82
+ const apiHeaders: { [header: string]: string } = {
83
+ 'content-type': 'application/json',
84
+ }
85
+
86
+ return await this.client.call(
87
+ 'post',
88
+ uri,
89
+ apiHeaders,
90
+ payload,
91
+ );
92
+ }
93
+ /**
94
+ * Create user with Argon2 password
95
+ *
96
+ * Create a new user. Password provided must be hashed with the [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST /users](https://appconda.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
97
+ *
98
+ * @param {string} userId
99
+ * @param {string} email
100
+ * @param {string} password
101
+ * @param {string} name
102
+ * @throws {AppcondaException}
103
+ * @returns {Promise<Models.User<Preferences>>}
104
+ */
105
+ async createArgon2User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
106
+ if (typeof userId === 'undefined') {
107
+ throw new AppcondaException('Missing required parameter: "userId"');
108
+ }
109
+ if (typeof email === 'undefined') {
110
+ throw new AppcondaException('Missing required parameter: "email"');
111
+ }
112
+ if (typeof password === 'undefined') {
113
+ throw new AppcondaException('Missing required parameter: "password"');
114
+ }
115
+ const apiPath = '/users/argon2';
116
+ const payload: Payload = {};
117
+ if (typeof userId !== 'undefined') {
118
+ payload['userId'] = userId;
119
+ }
120
+ if (typeof email !== 'undefined') {
121
+ payload['email'] = email;
122
+ }
123
+ if (typeof password !== 'undefined') {
124
+ payload['password'] = password;
125
+ }
126
+ if (typeof name !== 'undefined') {
127
+ payload['name'] = name;
128
+ }
129
+ const uri = new URL(this.client.config.endpoint + apiPath);
130
+
131
+ const apiHeaders: { [header: string]: string } = {
132
+ 'content-type': 'application/json',
133
+ }
134
+
135
+ return await this.client.call(
136
+ 'post',
137
+ uri,
138
+ apiHeaders,
139
+ payload,
140
+ );
141
+ }
142
+ /**
143
+ * Create user with bcrypt password
144
+ *
145
+ * Create a new user. Password provided must be hashed with the [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST /users](https://appconda.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
146
+ *
147
+ * @param {string} userId
148
+ * @param {string} email
149
+ * @param {string} password
150
+ * @param {string} name
151
+ * @throws {AppcondaException}
152
+ * @returns {Promise<Models.User<Preferences>>}
153
+ */
154
+ async createBcryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
155
+ if (typeof userId === 'undefined') {
156
+ throw new AppcondaException('Missing required parameter: "userId"');
157
+ }
158
+ if (typeof email === 'undefined') {
159
+ throw new AppcondaException('Missing required parameter: "email"');
160
+ }
161
+ if (typeof password === 'undefined') {
162
+ throw new AppcondaException('Missing required parameter: "password"');
163
+ }
164
+ const apiPath = '/users/bcrypt';
165
+ const payload: Payload = {};
166
+ if (typeof userId !== 'undefined') {
167
+ payload['userId'] = userId;
168
+ }
169
+ if (typeof email !== 'undefined') {
170
+ payload['email'] = email;
171
+ }
172
+ if (typeof password !== 'undefined') {
173
+ payload['password'] = password;
174
+ }
175
+ if (typeof name !== 'undefined') {
176
+ payload['name'] = name;
177
+ }
178
+ const uri = new URL(this.client.config.endpoint + apiPath);
179
+
180
+ const apiHeaders: { [header: string]: string } = {
181
+ 'content-type': 'application/json',
182
+ }
183
+
184
+ return await this.client.call(
185
+ 'post',
186
+ uri,
187
+ apiHeaders,
188
+ payload,
189
+ );
190
+ }
191
+ /**
192
+ * List Identities
193
+ *
194
+ * Get identities for all users.
195
+ *
196
+ * @param {string[]} queries
197
+ * @param {string} search
198
+ * @throws {AppcondaException}
199
+ * @returns {Promise<Models.IdentityList>}
200
+ */
201
+ async listIdentities(queries?: string[], search?: string): Promise<Models.IdentityList> {
202
+ const apiPath = '/users/identities';
203
+ const payload: Payload = {};
204
+ if (typeof queries !== 'undefined') {
205
+ payload['queries'] = queries;
206
+ }
207
+ if (typeof search !== 'undefined') {
208
+ payload['search'] = search;
209
+ }
210
+ const uri = new URL(this.client.config.endpoint + apiPath);
211
+
212
+ const apiHeaders: { [header: string]: string } = {
213
+ 'content-type': 'application/json',
214
+ }
215
+
216
+ return await this.client.call(
217
+ 'get',
218
+ uri,
219
+ apiHeaders,
220
+ payload,
221
+ );
222
+ }
223
+ /**
224
+ * Delete identity
225
+ *
226
+ * Delete an identity by its unique ID.
227
+ *
228
+ * @param {string} identityId
229
+ * @throws {AppcondaException}
230
+ * @returns {Promise<{}>}
231
+ */
232
+ async deleteIdentity(identityId: string): Promise<{}> {
233
+ if (typeof identityId === 'undefined') {
234
+ throw new AppcondaException('Missing required parameter: "identityId"');
235
+ }
236
+ const apiPath = '/users/identities/{identityId}'.replace('{identityId}', identityId);
237
+ const payload: Payload = {};
238
+ const uri = new URL(this.client.config.endpoint + apiPath);
239
+
240
+ const apiHeaders: { [header: string]: string } = {
241
+ 'content-type': 'application/json',
242
+ }
243
+
244
+ return await this.client.call(
245
+ 'delete',
246
+ uri,
247
+ apiHeaders,
248
+ payload,
249
+ );
250
+ }
251
+ /**
252
+ * Create user with MD5 password
253
+ *
254
+ * Create a new user. Password provided must be hashed with the [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST /users](https://appconda.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
255
+ *
256
+ * @param {string} userId
257
+ * @param {string} email
258
+ * @param {string} password
259
+ * @param {string} name
260
+ * @throws {AppcondaException}
261
+ * @returns {Promise<Models.User<Preferences>>}
262
+ */
263
+ async createMD5User<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
264
+ if (typeof userId === 'undefined') {
265
+ throw new AppcondaException('Missing required parameter: "userId"');
266
+ }
267
+ if (typeof email === 'undefined') {
268
+ throw new AppcondaException('Missing required parameter: "email"');
269
+ }
270
+ if (typeof password === 'undefined') {
271
+ throw new AppcondaException('Missing required parameter: "password"');
272
+ }
273
+ const apiPath = '/users/md5';
274
+ const payload: Payload = {};
275
+ if (typeof userId !== 'undefined') {
276
+ payload['userId'] = userId;
277
+ }
278
+ if (typeof email !== 'undefined') {
279
+ payload['email'] = email;
280
+ }
281
+ if (typeof password !== 'undefined') {
282
+ payload['password'] = password;
283
+ }
284
+ if (typeof name !== 'undefined') {
285
+ payload['name'] = name;
286
+ }
287
+ const uri = new URL(this.client.config.endpoint + apiPath);
288
+
289
+ const apiHeaders: { [header: string]: string } = {
290
+ 'content-type': 'application/json',
291
+ }
292
+
293
+ return await this.client.call(
294
+ 'post',
295
+ uri,
296
+ apiHeaders,
297
+ payload,
298
+ );
299
+ }
300
+ /**
301
+ * Create user with PHPass password
302
+ *
303
+ * Create a new user. Password provided must be hashed with the [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST /users](https://appconda.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
304
+ *
305
+ * @param {string} userId
306
+ * @param {string} email
307
+ * @param {string} password
308
+ * @param {string} name
309
+ * @throws {AppcondaException}
310
+ * @returns {Promise<Models.User<Preferences>>}
311
+ */
312
+ async createPHPassUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, name?: string): Promise<Models.User<Preferences>> {
313
+ if (typeof userId === 'undefined') {
314
+ throw new AppcondaException('Missing required parameter: "userId"');
315
+ }
316
+ if (typeof email === 'undefined') {
317
+ throw new AppcondaException('Missing required parameter: "email"');
318
+ }
319
+ if (typeof password === 'undefined') {
320
+ throw new AppcondaException('Missing required parameter: "password"');
321
+ }
322
+ const apiPath = '/users/phpass';
323
+ const payload: Payload = {};
324
+ if (typeof userId !== 'undefined') {
325
+ payload['userId'] = userId;
326
+ }
327
+ if (typeof email !== 'undefined') {
328
+ payload['email'] = email;
329
+ }
330
+ if (typeof password !== 'undefined') {
331
+ payload['password'] = password;
332
+ }
333
+ if (typeof name !== 'undefined') {
334
+ payload['name'] = name;
335
+ }
336
+ const uri = new URL(this.client.config.endpoint + apiPath);
337
+
338
+ const apiHeaders: { [header: string]: string } = {
339
+ 'content-type': 'application/json',
340
+ }
341
+
342
+ return await this.client.call(
343
+ 'post',
344
+ uri,
345
+ apiHeaders,
346
+ payload,
347
+ );
348
+ }
349
+ /**
350
+ * Create user with Scrypt password
351
+ *
352
+ * Create a new user. Password provided must be hashed with the [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST /users](https://appconda.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
353
+ *
354
+ * @param {string} userId
355
+ * @param {string} email
356
+ * @param {string} password
357
+ * @param {string} passwordSalt
358
+ * @param {number} passwordCpu
359
+ * @param {number} passwordMemory
360
+ * @param {number} passwordParallel
361
+ * @param {number} passwordLength
362
+ * @param {string} name
363
+ * @throws {AppcondaException}
364
+ * @returns {Promise<Models.User<Preferences>>}
365
+ */
366
+ async createScryptUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordCpu: number, passwordMemory: number, passwordParallel: number, passwordLength: number, name?: string): Promise<Models.User<Preferences>> {
367
+ if (typeof userId === 'undefined') {
368
+ throw new AppcondaException('Missing required parameter: "userId"');
369
+ }
370
+ if (typeof email === 'undefined') {
371
+ throw new AppcondaException('Missing required parameter: "email"');
372
+ }
373
+ if (typeof password === 'undefined') {
374
+ throw new AppcondaException('Missing required parameter: "password"');
375
+ }
376
+ if (typeof passwordSalt === 'undefined') {
377
+ throw new AppcondaException('Missing required parameter: "passwordSalt"');
378
+ }
379
+ if (typeof passwordCpu === 'undefined') {
380
+ throw new AppcondaException('Missing required parameter: "passwordCpu"');
381
+ }
382
+ if (typeof passwordMemory === 'undefined') {
383
+ throw new AppcondaException('Missing required parameter: "passwordMemory"');
384
+ }
385
+ if (typeof passwordParallel === 'undefined') {
386
+ throw new AppcondaException('Missing required parameter: "passwordParallel"');
387
+ }
388
+ if (typeof passwordLength === 'undefined') {
389
+ throw new AppcondaException('Missing required parameter: "passwordLength"');
390
+ }
391
+ const apiPath = '/users/scrypt';
392
+ const payload: Payload = {};
393
+ if (typeof userId !== 'undefined') {
394
+ payload['userId'] = userId;
395
+ }
396
+ if (typeof email !== 'undefined') {
397
+ payload['email'] = email;
398
+ }
399
+ if (typeof password !== 'undefined') {
400
+ payload['password'] = password;
401
+ }
402
+ if (typeof passwordSalt !== 'undefined') {
403
+ payload['passwordSalt'] = passwordSalt;
404
+ }
405
+ if (typeof passwordCpu !== 'undefined') {
406
+ payload['passwordCpu'] = passwordCpu;
407
+ }
408
+ if (typeof passwordMemory !== 'undefined') {
409
+ payload['passwordMemory'] = passwordMemory;
410
+ }
411
+ if (typeof passwordParallel !== 'undefined') {
412
+ payload['passwordParallel'] = passwordParallel;
413
+ }
414
+ if (typeof passwordLength !== 'undefined') {
415
+ payload['passwordLength'] = passwordLength;
416
+ }
417
+ if (typeof name !== 'undefined') {
418
+ payload['name'] = name;
419
+ }
420
+ const uri = new URL(this.client.config.endpoint + apiPath);
421
+
422
+ const apiHeaders: { [header: string]: string } = {
423
+ 'content-type': 'application/json',
424
+ }
425
+
426
+ return await this.client.call(
427
+ 'post',
428
+ uri,
429
+ apiHeaders,
430
+ payload,
431
+ );
432
+ }
433
+ /**
434
+ * Create user with Scrypt modified password
435
+ *
436
+ * 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://appconda.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
437
+ *
438
+ * @param {string} userId
439
+ * @param {string} email
440
+ * @param {string} password
441
+ * @param {string} passwordSalt
442
+ * @param {string} passwordSaltSeparator
443
+ * @param {string} passwordSignerKey
444
+ * @param {string} name
445
+ * @throws {AppcondaException}
446
+ * @returns {Promise<Models.User<Preferences>>}
447
+ */
448
+ async createScryptModifiedUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordSalt: string, passwordSaltSeparator: string, passwordSignerKey: string, name?: string): Promise<Models.User<Preferences>> {
449
+ if (typeof userId === 'undefined') {
450
+ throw new AppcondaException('Missing required parameter: "userId"');
451
+ }
452
+ if (typeof email === 'undefined') {
453
+ throw new AppcondaException('Missing required parameter: "email"');
454
+ }
455
+ if (typeof password === 'undefined') {
456
+ throw new AppcondaException('Missing required parameter: "password"');
457
+ }
458
+ if (typeof passwordSalt === 'undefined') {
459
+ throw new AppcondaException('Missing required parameter: "passwordSalt"');
460
+ }
461
+ if (typeof passwordSaltSeparator === 'undefined') {
462
+ throw new AppcondaException('Missing required parameter: "passwordSaltSeparator"');
463
+ }
464
+ if (typeof passwordSignerKey === 'undefined') {
465
+ throw new AppcondaException('Missing required parameter: "passwordSignerKey"');
466
+ }
467
+ const apiPath = '/users/scrypt-modified';
468
+ const payload: Payload = {};
469
+ if (typeof userId !== 'undefined') {
470
+ payload['userId'] = userId;
471
+ }
472
+ if (typeof email !== 'undefined') {
473
+ payload['email'] = email;
474
+ }
475
+ if (typeof password !== 'undefined') {
476
+ payload['password'] = password;
477
+ }
478
+ if (typeof passwordSalt !== 'undefined') {
479
+ payload['passwordSalt'] = passwordSalt;
480
+ }
481
+ if (typeof passwordSaltSeparator !== 'undefined') {
482
+ payload['passwordSaltSeparator'] = passwordSaltSeparator;
483
+ }
484
+ if (typeof passwordSignerKey !== 'undefined') {
485
+ payload['passwordSignerKey'] = passwordSignerKey;
486
+ }
487
+ if (typeof name !== 'undefined') {
488
+ payload['name'] = name;
489
+ }
490
+ const uri = new URL(this.client.config.endpoint + apiPath);
491
+
492
+ const apiHeaders: { [header: string]: string } = {
493
+ 'content-type': 'application/json',
494
+ }
495
+
496
+ return await this.client.call(
497
+ 'post',
498
+ uri,
499
+ apiHeaders,
500
+ payload,
501
+ );
502
+ }
503
+ /**
504
+ * Create user with SHA password
505
+ *
506
+ * 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://appconda.io/docs/server/users#usersCreate) endpoint to create users with a plain text password.
507
+ *
508
+ * @param {string} userId
509
+ * @param {string} email
510
+ * @param {string} password
511
+ * @param {PasswordHash} passwordVersion
512
+ * @param {string} name
513
+ * @throws {AppcondaException}
514
+ * @returns {Promise<Models.User<Preferences>>}
515
+ */
516
+ async createSHAUser<Preferences extends Models.Preferences>(userId: string, email: string, password: string, passwordVersion?: PasswordHash, name?: string): Promise<Models.User<Preferences>> {
517
+ if (typeof userId === 'undefined') {
518
+ throw new AppcondaException('Missing required parameter: "userId"');
519
+ }
520
+ if (typeof email === 'undefined') {
521
+ throw new AppcondaException('Missing required parameter: "email"');
522
+ }
523
+ if (typeof password === 'undefined') {
524
+ throw new AppcondaException('Missing required parameter: "password"');
525
+ }
526
+ const apiPath = '/users/sha';
527
+ const payload: Payload = {};
528
+ if (typeof userId !== 'undefined') {
529
+ payload['userId'] = userId;
530
+ }
531
+ if (typeof email !== 'undefined') {
532
+ payload['email'] = email;
533
+ }
534
+ if (typeof password !== 'undefined') {
535
+ payload['password'] = password;
536
+ }
537
+ if (typeof passwordVersion !== 'undefined') {
538
+ payload['passwordVersion'] = passwordVersion;
539
+ }
540
+ if (typeof name !== 'undefined') {
541
+ payload['name'] = name;
542
+ }
543
+ const uri = new URL(this.client.config.endpoint + apiPath);
544
+
545
+ const apiHeaders: { [header: string]: string } = {
546
+ 'content-type': 'application/json',
547
+ }
548
+
549
+ return await this.client.call(
550
+ 'post',
551
+ uri,
552
+ apiHeaders,
553
+ payload,
554
+ );
555
+ }
556
+ /**
557
+ * Get user
558
+ *
559
+ * Get a user by its unique ID.
560
+ *
561
+ * @param {string} userId
562
+ * @throws {AppcondaException}
563
+ * @returns {Promise<Models.User<Preferences>>}
564
+ */
565
+ async get<Preferences extends Models.Preferences>(userId: string): Promise<Models.User<Preferences>> {
566
+ if (typeof userId === 'undefined') {
567
+ throw new AppcondaException('Missing required parameter: "userId"');
568
+ }
569
+ const apiPath = '/users/{userId}'.replace('{userId}', userId);
570
+ const payload: Payload = {};
571
+ const uri = new URL(this.client.config.endpoint + apiPath);
572
+
573
+ const apiHeaders: { [header: string]: string } = {
574
+ 'content-type': 'application/json',
575
+ }
576
+
577
+ return await this.client.call(
578
+ 'get',
579
+ uri,
580
+ apiHeaders,
581
+ payload,
582
+ );
583
+ }
584
+ /**
585
+ * Delete user
586
+ *
587
+ * 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://appconda.io/docs/server/users#usersUpdateStatus) endpoint instead.
588
+ *
589
+ * @param {string} userId
590
+ * @throws {AppcondaException}
591
+ * @returns {Promise<{}>}
592
+ */
593
+ async delete(userId: string): Promise<{}> {
594
+ if (typeof userId === 'undefined') {
595
+ throw new AppcondaException('Missing required parameter: "userId"');
596
+ }
597
+ const apiPath = '/users/{userId}'.replace('{userId}', userId);
598
+ const payload: Payload = {};
599
+ const uri = new URL(this.client.config.endpoint + apiPath);
600
+
601
+ const apiHeaders: { [header: string]: string } = {
602
+ 'content-type': 'application/json',
603
+ }
604
+
605
+ return await this.client.call(
606
+ 'delete',
607
+ uri,
608
+ apiHeaders,
609
+ payload,
610
+ );
611
+ }
612
+ /**
613
+ * Update email
614
+ *
615
+ * Update the user email by its unique ID.
616
+ *
617
+ * @param {string} userId
618
+ * @param {string} email
619
+ * @throws {AppcondaException}
620
+ * @returns {Promise<Models.User<Preferences>>}
621
+ */
622
+ async updateEmail<Preferences extends Models.Preferences>(userId: string, email: string): Promise<Models.User<Preferences>> {
623
+ if (typeof userId === 'undefined') {
624
+ throw new AppcondaException('Missing required parameter: "userId"');
625
+ }
626
+ if (typeof email === 'undefined') {
627
+ throw new AppcondaException('Missing required parameter: "email"');
628
+ }
629
+ const apiPath = '/users/{userId}/email'.replace('{userId}', userId);
630
+ const payload: Payload = {};
631
+ if (typeof email !== 'undefined') {
632
+ payload['email'] = email;
633
+ }
634
+ const uri = new URL(this.client.config.endpoint + apiPath);
635
+
636
+ const apiHeaders: { [header: string]: string } = {
637
+ 'content-type': 'application/json',
638
+ }
639
+
640
+ return await this.client.call(
641
+ 'patch',
642
+ uri,
643
+ apiHeaders,
644
+ payload,
645
+ );
646
+ }
647
+ /**
648
+ * Create user JWT
649
+ *
650
+ * Use this endpoint to create a JSON Web Token for user by its unique ID. You can use the resulting JWT to authenticate on behalf of the user. The JWT secret will become invalid if the session it uses gets deleted.
651
+ *
652
+ * @param {string} userId
653
+ * @param {string} sessionId
654
+ * @param {number} duration
655
+ * @throws {AppcondaException}
656
+ * @returns {Promise<Models.Jwt>}
657
+ */
658
+ async createJWT(userId: string, sessionId?: string, duration?: number): Promise<Models.Jwt> {
659
+ if (typeof userId === 'undefined') {
660
+ throw new AppcondaException('Missing required parameter: "userId"');
661
+ }
662
+ const apiPath = '/users/{userId}/jwts'.replace('{userId}', userId);
663
+ const payload: Payload = {};
664
+ if (typeof sessionId !== 'undefined') {
665
+ payload['sessionId'] = sessionId;
666
+ }
667
+ if (typeof duration !== 'undefined') {
668
+ payload['duration'] = duration;
669
+ }
670
+ const uri = new URL(this.client.config.endpoint + apiPath);
671
+
672
+ const apiHeaders: { [header: string]: string } = {
673
+ 'content-type': 'application/json',
674
+ }
675
+
676
+ return await this.client.call(
677
+ 'post',
678
+ uri,
679
+ apiHeaders,
680
+ payload,
681
+ );
682
+ }
683
+ /**
684
+ * Update user labels
685
+ *
686
+ * Update the user labels by its unique ID.
687
+
688
+ 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://appconda.io/docs/permissions) for more info.
689
+ *
690
+ * @param {string} userId
691
+ * @param {string[]} labels
692
+ * @throws {AppcondaException}
693
+ * @returns {Promise<Models.User<Preferences>>}
694
+ */
695
+ async updateLabels<Preferences extends Models.Preferences>(userId: string, labels: string[]): Promise<Models.User<Preferences>> {
696
+ if (typeof userId === 'undefined') {
697
+ throw new AppcondaException('Missing required parameter: "userId"');
698
+ }
699
+ if (typeof labels === 'undefined') {
700
+ throw new AppcondaException('Missing required parameter: "labels"');
701
+ }
702
+ const apiPath = '/users/{userId}/labels'.replace('{userId}', userId);
703
+ const payload: Payload = {};
704
+ if (typeof labels !== 'undefined') {
705
+ payload['labels'] = labels;
706
+ }
707
+ const uri = new URL(this.client.config.endpoint + apiPath);
708
+
709
+ const apiHeaders: { [header: string]: string } = {
710
+ 'content-type': 'application/json',
711
+ }
712
+
713
+ return await this.client.call(
714
+ 'put',
715
+ uri,
716
+ apiHeaders,
717
+ payload,
718
+ );
719
+ }
720
+ /**
721
+ * List user logs
722
+ *
723
+ * Get the user activity logs list by its unique ID.
724
+ *
725
+ * @param {string} userId
726
+ * @param {string[]} queries
727
+ * @throws {AppcondaException}
728
+ * @returns {Promise<Models.LogList>}
729
+ */
730
+ async listLogs(userId: string, queries?: string[]): Promise<Models.LogList> {
731
+ if (typeof userId === 'undefined') {
732
+ throw new AppcondaException('Missing required parameter: "userId"');
733
+ }
734
+ const apiPath = '/users/{userId}/logs'.replace('{userId}', userId);
735
+ const payload: Payload = {};
736
+ if (typeof queries !== 'undefined') {
737
+ payload['queries'] = queries;
738
+ }
739
+ const uri = new URL(this.client.config.endpoint + apiPath);
740
+
741
+ const apiHeaders: { [header: string]: string } = {
742
+ 'content-type': 'application/json',
743
+ }
744
+
745
+ return await this.client.call(
746
+ 'get',
747
+ uri,
748
+ apiHeaders,
749
+ payload,
750
+ );
751
+ }
752
+ /**
753
+ * List user memberships
754
+ *
755
+ * Get the user membership list by its unique ID.
756
+ *
757
+ * @param {string} userId
758
+ * @throws {AppcondaException}
759
+ * @returns {Promise<Models.MembershipList>}
760
+ */
761
+ async listMemberships(userId: string): Promise<Models.MembershipList> {
762
+ if (typeof userId === 'undefined') {
763
+ throw new AppcondaException('Missing required parameter: "userId"');
764
+ }
765
+ const apiPath = '/users/{userId}/memberships'.replace('{userId}', userId);
766
+ const payload: Payload = {};
767
+ const uri = new URL(this.client.config.endpoint + apiPath);
768
+
769
+ const apiHeaders: { [header: string]: string } = {
770
+ 'content-type': 'application/json',
771
+ }
772
+
773
+ return await this.client.call(
774
+ 'get',
775
+ uri,
776
+ apiHeaders,
777
+ payload,
778
+ );
779
+ }
780
+ /**
781
+ * Update MFA
782
+ *
783
+ * Enable or disable MFA on a user account.
784
+ *
785
+ * @param {string} userId
786
+ * @param {boolean} mfa
787
+ * @throws {AppcondaException}
788
+ * @returns {Promise<Models.User<Preferences>>}
789
+ */
790
+ async updateMfa<Preferences extends Models.Preferences>(userId: string, mfa: boolean): Promise<Models.User<Preferences>> {
791
+ if (typeof userId === 'undefined') {
792
+ throw new AppcondaException('Missing required parameter: "userId"');
793
+ }
794
+ if (typeof mfa === 'undefined') {
795
+ throw new AppcondaException('Missing required parameter: "mfa"');
796
+ }
797
+ const apiPath = '/users/{userId}/mfa'.replace('{userId}', userId);
798
+ const payload: Payload = {};
799
+ if (typeof mfa !== 'undefined') {
800
+ payload['mfa'] = mfa;
801
+ }
802
+ const uri = new URL(this.client.config.endpoint + apiPath);
803
+
804
+ const apiHeaders: { [header: string]: string } = {
805
+ 'content-type': 'application/json',
806
+ }
807
+
808
+ return await this.client.call(
809
+ 'patch',
810
+ uri,
811
+ apiHeaders,
812
+ payload,
813
+ );
814
+ }
815
+ /**
816
+ * Delete Authenticator
817
+ *
818
+ * Delete an authenticator app.
819
+ *
820
+ * @param {string} userId
821
+ * @param {AuthenticatorType} type
822
+ * @throws {AppcondaException}
823
+ * @returns {Promise<Models.User<Preferences>>}
824
+ */
825
+ async deleteMfaAuthenticator<Preferences extends Models.Preferences>(userId: string, type: AuthenticatorType): Promise<Models.User<Preferences>> {
826
+ if (typeof userId === 'undefined') {
827
+ throw new AppcondaException('Missing required parameter: "userId"');
828
+ }
829
+ if (typeof type === 'undefined') {
830
+ throw new AppcondaException('Missing required parameter: "type"');
831
+ }
832
+ const apiPath = '/users/{userId}/mfa/authenticators/{type}'.replace('{userId}', userId).replace('{type}', type);
833
+ const payload: Payload = {};
834
+ const uri = new URL(this.client.config.endpoint + apiPath);
835
+
836
+ const apiHeaders: { [header: string]: string } = {
837
+ 'content-type': 'application/json',
838
+ }
839
+
840
+ return await this.client.call(
841
+ 'delete',
842
+ uri,
843
+ apiHeaders,
844
+ payload,
845
+ );
846
+ }
847
+ /**
848
+ * List Factors
849
+ *
850
+ * List the factors available on the account to be used as a MFA challange.
851
+ *
852
+ * @param {string} userId
853
+ * @throws {AppcondaException}
854
+ * @returns {Promise<Models.MfaFactors>}
855
+ */
856
+ async listMfaFactors(userId: string): Promise<Models.MfaFactors> {
857
+ if (typeof userId === 'undefined') {
858
+ throw new AppcondaException('Missing required parameter: "userId"');
859
+ }
860
+ const apiPath = '/users/{userId}/mfa/factors'.replace('{userId}', userId);
861
+ const payload: Payload = {};
862
+ const uri = new URL(this.client.config.endpoint + apiPath);
863
+
864
+ const apiHeaders: { [header: string]: string } = {
865
+ 'content-type': 'application/json',
866
+ }
867
+
868
+ return await this.client.call(
869
+ 'get',
870
+ uri,
871
+ apiHeaders,
872
+ payload,
873
+ );
874
+ }
875
+ /**
876
+ * Get MFA Recovery Codes
877
+ *
878
+ * 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.
879
+ *
880
+ * @param {string} userId
881
+ * @throws {AppcondaException}
882
+ * @returns {Promise<Models.MfaRecoveryCodes>}
883
+ */
884
+ async getMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> {
885
+ if (typeof userId === 'undefined') {
886
+ throw new AppcondaException('Missing required parameter: "userId"');
887
+ }
888
+ const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
889
+ const payload: Payload = {};
890
+ const uri = new URL(this.client.config.endpoint + apiPath);
891
+
892
+ const apiHeaders: { [header: string]: string } = {
893
+ 'content-type': 'application/json',
894
+ }
895
+
896
+ return await this.client.call(
897
+ 'get',
898
+ uri,
899
+ apiHeaders,
900
+ payload,
901
+ );
902
+ }
903
+ /**
904
+ * Regenerate MFA Recovery Codes
905
+ *
906
+ * 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.
907
+ *
908
+ * @param {string} userId
909
+ * @throws {AppcondaException}
910
+ * @returns {Promise<Models.MfaRecoveryCodes>}
911
+ */
912
+ async updateMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> {
913
+ if (typeof userId === 'undefined') {
914
+ throw new AppcondaException('Missing required parameter: "userId"');
915
+ }
916
+ const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
917
+ const payload: Payload = {};
918
+ const uri = new URL(this.client.config.endpoint + apiPath);
919
+
920
+ const apiHeaders: { [header: string]: string } = {
921
+ 'content-type': 'application/json',
922
+ }
923
+
924
+ return await this.client.call(
925
+ 'put',
926
+ uri,
927
+ apiHeaders,
928
+ payload,
929
+ );
930
+ }
931
+ /**
932
+ * Create MFA Recovery Codes
933
+ *
934
+ * 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.
935
+ *
936
+ * @param {string} userId
937
+ * @throws {AppcondaException}
938
+ * @returns {Promise<Models.MfaRecoveryCodes>}
939
+ */
940
+ async createMfaRecoveryCodes(userId: string): Promise<Models.MfaRecoveryCodes> {
941
+ if (typeof userId === 'undefined') {
942
+ throw new AppcondaException('Missing required parameter: "userId"');
943
+ }
944
+ const apiPath = '/users/{userId}/mfa/recovery-codes'.replace('{userId}', userId);
945
+ const payload: Payload = {};
946
+ const uri = new URL(this.client.config.endpoint + apiPath);
947
+
948
+ const apiHeaders: { [header: string]: string } = {
949
+ 'content-type': 'application/json',
950
+ }
951
+
952
+ return await this.client.call(
953
+ 'patch',
954
+ uri,
955
+ apiHeaders,
956
+ payload,
957
+ );
958
+ }
959
+ /**
960
+ * Update name
961
+ *
962
+ * Update the user name by its unique ID.
963
+ *
964
+ * @param {string} userId
965
+ * @param {string} name
966
+ * @throws {AppcondaException}
967
+ * @returns {Promise<Models.User<Preferences>>}
968
+ */
969
+ async updateName<Preferences extends Models.Preferences>(userId: string, name: string): Promise<Models.User<Preferences>> {
970
+ if (typeof userId === 'undefined') {
971
+ throw new AppcondaException('Missing required parameter: "userId"');
972
+ }
973
+ if (typeof name === 'undefined') {
974
+ throw new AppcondaException('Missing required parameter: "name"');
975
+ }
976
+ const apiPath = '/users/{userId}/name'.replace('{userId}', userId);
977
+ const payload: Payload = {};
978
+ if (typeof name !== 'undefined') {
979
+ payload['name'] = name;
980
+ }
981
+ const uri = new URL(this.client.config.endpoint + apiPath);
982
+
983
+ const apiHeaders: { [header: string]: string } = {
984
+ 'content-type': 'application/json',
985
+ }
986
+
987
+ return await this.client.call(
988
+ 'patch',
989
+ uri,
990
+ apiHeaders,
991
+ payload,
992
+ );
993
+ }
994
+ /**
995
+ * Update password
996
+ *
997
+ * Update the user password by its unique ID.
998
+ *
999
+ * @param {string} userId
1000
+ * @param {string} password
1001
+ * @throws {AppcondaException}
1002
+ * @returns {Promise<Models.User<Preferences>>}
1003
+ */
1004
+ async updatePassword<Preferences extends Models.Preferences>(userId: string, password: string): Promise<Models.User<Preferences>> {
1005
+ if (typeof userId === 'undefined') {
1006
+ throw new AppcondaException('Missing required parameter: "userId"');
1007
+ }
1008
+ if (typeof password === 'undefined') {
1009
+ throw new AppcondaException('Missing required parameter: "password"');
1010
+ }
1011
+ const apiPath = '/users/{userId}/password'.replace('{userId}', userId);
1012
+ const payload: Payload = {};
1013
+ if (typeof password !== 'undefined') {
1014
+ payload['password'] = password;
1015
+ }
1016
+ const uri = new URL(this.client.config.endpoint + apiPath);
1017
+
1018
+ const apiHeaders: { [header: string]: string } = {
1019
+ 'content-type': 'application/json',
1020
+ }
1021
+
1022
+ return await this.client.call(
1023
+ 'patch',
1024
+ uri,
1025
+ apiHeaders,
1026
+ payload,
1027
+ );
1028
+ }
1029
+ /**
1030
+ * Update phone
1031
+ *
1032
+ * Update the user phone by its unique ID.
1033
+ *
1034
+ * @param {string} userId
1035
+ * @param {string} number
1036
+ * @throws {AppcondaException}
1037
+ * @returns {Promise<Models.User<Preferences>>}
1038
+ */
1039
+ async updatePhone<Preferences extends Models.Preferences>(userId: string, number: string): Promise<Models.User<Preferences>> {
1040
+ if (typeof userId === 'undefined') {
1041
+ throw new AppcondaException('Missing required parameter: "userId"');
1042
+ }
1043
+ if (typeof number === 'undefined') {
1044
+ throw new AppcondaException('Missing required parameter: "number"');
1045
+ }
1046
+ const apiPath = '/users/{userId}/phone'.replace('{userId}', userId);
1047
+ const payload: Payload = {};
1048
+ if (typeof number !== 'undefined') {
1049
+ payload['number'] = number;
1050
+ }
1051
+ const uri = new URL(this.client.config.endpoint + apiPath);
1052
+
1053
+ const apiHeaders: { [header: string]: string } = {
1054
+ 'content-type': 'application/json',
1055
+ }
1056
+
1057
+ return await this.client.call(
1058
+ 'patch',
1059
+ uri,
1060
+ apiHeaders,
1061
+ payload,
1062
+ );
1063
+ }
1064
+ /**
1065
+ * Get user preferences
1066
+ *
1067
+ * Get the user preferences by its unique ID.
1068
+ *
1069
+ * @param {string} userId
1070
+ * @throws {AppcondaException}
1071
+ * @returns {Promise<Preferences>}
1072
+ */
1073
+ async getPrefs<Preferences extends Models.Preferences>(userId: string): Promise<Preferences> {
1074
+ if (typeof userId === 'undefined') {
1075
+ throw new AppcondaException('Missing required parameter: "userId"');
1076
+ }
1077
+ const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
1078
+ const payload: Payload = {};
1079
+ const uri = new URL(this.client.config.endpoint + apiPath);
1080
+
1081
+ const apiHeaders: { [header: string]: string } = {
1082
+ 'content-type': 'application/json',
1083
+ }
1084
+
1085
+ return await this.client.call(
1086
+ 'get',
1087
+ uri,
1088
+ apiHeaders,
1089
+ payload,
1090
+ );
1091
+ }
1092
+ /**
1093
+ * Update user preferences
1094
+ *
1095
+ * 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.
1096
+ *
1097
+ * @param {string} userId
1098
+ * @param {object} prefs
1099
+ * @throws {AppcondaException}
1100
+ * @returns {Promise<Preferences>}
1101
+ */
1102
+ async updatePrefs<Preferences extends Models.Preferences>(userId: string, prefs: object): Promise<Preferences> {
1103
+ if (typeof userId === 'undefined') {
1104
+ throw new AppcondaException('Missing required parameter: "userId"');
1105
+ }
1106
+ if (typeof prefs === 'undefined') {
1107
+ throw new AppcondaException('Missing required parameter: "prefs"');
1108
+ }
1109
+ const apiPath = '/users/{userId}/prefs'.replace('{userId}', userId);
1110
+ const payload: Payload = {};
1111
+ if (typeof prefs !== 'undefined') {
1112
+ payload['prefs'] = prefs;
1113
+ }
1114
+ const uri = new URL(this.client.config.endpoint + apiPath);
1115
+
1116
+ const apiHeaders: { [header: string]: string } = {
1117
+ 'content-type': 'application/json',
1118
+ }
1119
+
1120
+ return await this.client.call(
1121
+ 'patch',
1122
+ uri,
1123
+ apiHeaders,
1124
+ payload,
1125
+ );
1126
+ }
1127
+ /**
1128
+ * List user sessions
1129
+ *
1130
+ * Get the user sessions list by its unique ID.
1131
+ *
1132
+ * @param {string} userId
1133
+ * @throws {AppcondaException}
1134
+ * @returns {Promise<Models.SessionList>}
1135
+ */
1136
+ async listSessions(userId: string): Promise<Models.SessionList> {
1137
+ if (typeof userId === 'undefined') {
1138
+ throw new AppcondaException('Missing required parameter: "userId"');
1139
+ }
1140
+ const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
1141
+ const payload: Payload = {};
1142
+ const uri = new URL(this.client.config.endpoint + apiPath);
1143
+
1144
+ const apiHeaders: { [header: string]: string } = {
1145
+ 'content-type': 'application/json',
1146
+ }
1147
+
1148
+ return await this.client.call(
1149
+ 'get',
1150
+ uri,
1151
+ apiHeaders,
1152
+ payload,
1153
+ );
1154
+ }
1155
+ /**
1156
+ * Create session
1157
+ *
1158
+ * Creates a session for a user. Returns an immediately usable session object.
1159
+
1160
+ If you want to generate a token for a custom authentication flow, use the [POST /users/{userId}/tokens](https://appconda.io/docs/server/users#createToken) endpoint.
1161
+ *
1162
+ * @param {string} userId
1163
+ * @throws {AppcondaException}
1164
+ * @returns {Promise<Models.Session>}
1165
+ */
1166
+ async createSession(userId: string): Promise<Models.Session> {
1167
+ if (typeof userId === 'undefined') {
1168
+ throw new AppcondaException('Missing required parameter: "userId"');
1169
+ }
1170
+ const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
1171
+ const payload: Payload = {};
1172
+ const uri = new URL(this.client.config.endpoint + apiPath);
1173
+
1174
+ const apiHeaders: { [header: string]: string } = {
1175
+ 'content-type': 'application/json',
1176
+ }
1177
+
1178
+ return await this.client.call(
1179
+ 'post',
1180
+ uri,
1181
+ apiHeaders,
1182
+ payload,
1183
+ );
1184
+ }
1185
+ /**
1186
+ * Delete user sessions
1187
+ *
1188
+ * Delete all user&#039;s sessions by using the user&#039;s unique ID.
1189
+ *
1190
+ * @param {string} userId
1191
+ * @throws {AppcondaException}
1192
+ * @returns {Promise<{}>}
1193
+ */
1194
+ async deleteSessions(userId: string): Promise<{}> {
1195
+ if (typeof userId === 'undefined') {
1196
+ throw new AppcondaException('Missing required parameter: "userId"');
1197
+ }
1198
+ const apiPath = '/users/{userId}/sessions'.replace('{userId}', userId);
1199
+ const payload: Payload = {};
1200
+ const uri = new URL(this.client.config.endpoint + apiPath);
1201
+
1202
+ const apiHeaders: { [header: string]: string } = {
1203
+ 'content-type': 'application/json',
1204
+ }
1205
+
1206
+ return await this.client.call(
1207
+ 'delete',
1208
+ uri,
1209
+ apiHeaders,
1210
+ payload,
1211
+ );
1212
+ }
1213
+ /**
1214
+ * Delete user session
1215
+ *
1216
+ * Delete a user sessions by its unique ID.
1217
+ *
1218
+ * @param {string} userId
1219
+ * @param {string} sessionId
1220
+ * @throws {AppcondaException}
1221
+ * @returns {Promise<{}>}
1222
+ */
1223
+ async deleteSession(userId: string, sessionId: string): Promise<{}> {
1224
+ if (typeof userId === 'undefined') {
1225
+ throw new AppcondaException('Missing required parameter: "userId"');
1226
+ }
1227
+ if (typeof sessionId === 'undefined') {
1228
+ throw new AppcondaException('Missing required parameter: "sessionId"');
1229
+ }
1230
+ const apiPath = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', userId).replace('{sessionId}', sessionId);
1231
+ const payload: Payload = {};
1232
+ const uri = new URL(this.client.config.endpoint + apiPath);
1233
+
1234
+ const apiHeaders: { [header: string]: string } = {
1235
+ 'content-type': 'application/json',
1236
+ }
1237
+
1238
+ return await this.client.call(
1239
+ 'delete',
1240
+ uri,
1241
+ apiHeaders,
1242
+ payload,
1243
+ );
1244
+ }
1245
+ /**
1246
+ * Update user status
1247
+ *
1248
+ * 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.
1249
+ *
1250
+ * @param {string} userId
1251
+ * @param {boolean} status
1252
+ * @throws {AppcondaException}
1253
+ * @returns {Promise<Models.User<Preferences>>}
1254
+ */
1255
+ async updateStatus<Preferences extends Models.Preferences>(userId: string, status: boolean): Promise<Models.User<Preferences>> {
1256
+ if (typeof userId === 'undefined') {
1257
+ throw new AppcondaException('Missing required parameter: "userId"');
1258
+ }
1259
+ if (typeof status === 'undefined') {
1260
+ throw new AppcondaException('Missing required parameter: "status"');
1261
+ }
1262
+ const apiPath = '/users/{userId}/status'.replace('{userId}', userId);
1263
+ const payload: Payload = {};
1264
+ if (typeof status !== 'undefined') {
1265
+ payload['status'] = status;
1266
+ }
1267
+ const uri = new URL(this.client.config.endpoint + apiPath);
1268
+
1269
+ const apiHeaders: { [header: string]: string } = {
1270
+ 'content-type': 'application/json',
1271
+ }
1272
+
1273
+ return await this.client.call(
1274
+ 'patch',
1275
+ uri,
1276
+ apiHeaders,
1277
+ payload,
1278
+ );
1279
+ }
1280
+ /**
1281
+ * List User Targets
1282
+ *
1283
+ * List the messaging targets that are associated with a user.
1284
+ *
1285
+ * @param {string} userId
1286
+ * @param {string[]} queries
1287
+ * @throws {AppcondaException}
1288
+ * @returns {Promise<Models.TargetList>}
1289
+ */
1290
+ async listTargets(userId: string, queries?: string[]): Promise<Models.TargetList> {
1291
+ if (typeof userId === 'undefined') {
1292
+ throw new AppcondaException('Missing required parameter: "userId"');
1293
+ }
1294
+ const apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
1295
+ const payload: Payload = {};
1296
+ if (typeof queries !== 'undefined') {
1297
+ payload['queries'] = queries;
1298
+ }
1299
+ const uri = new URL(this.client.config.endpoint + apiPath);
1300
+
1301
+ const apiHeaders: { [header: string]: string } = {
1302
+ 'content-type': 'application/json',
1303
+ }
1304
+
1305
+ return await this.client.call(
1306
+ 'get',
1307
+ uri,
1308
+ apiHeaders,
1309
+ payload,
1310
+ );
1311
+ }
1312
+ /**
1313
+ * Create User Target
1314
+ *
1315
+ * Create a messaging target.
1316
+ *
1317
+ * @param {string} userId
1318
+ * @param {string} targetId
1319
+ * @param {MessagingProviderType} providerType
1320
+ * @param {string} identifier
1321
+ * @param {string} providerId
1322
+ * @param {string} name
1323
+ * @throws {AppcondaException}
1324
+ * @returns {Promise<Models.Target>}
1325
+ */
1326
+ async createTarget(userId: string, targetId: string, providerType: MessagingProviderType, identifier: string, providerId?: string, name?: string): Promise<Models.Target> {
1327
+ if (typeof userId === 'undefined') {
1328
+ throw new AppcondaException('Missing required parameter: "userId"');
1329
+ }
1330
+ if (typeof targetId === 'undefined') {
1331
+ throw new AppcondaException('Missing required parameter: "targetId"');
1332
+ }
1333
+ if (typeof providerType === 'undefined') {
1334
+ throw new AppcondaException('Missing required parameter: "providerType"');
1335
+ }
1336
+ if (typeof identifier === 'undefined') {
1337
+ throw new AppcondaException('Missing required parameter: "identifier"');
1338
+ }
1339
+ const apiPath = '/users/{userId}/targets'.replace('{userId}', userId);
1340
+ const payload: Payload = {};
1341
+ if (typeof targetId !== 'undefined') {
1342
+ payload['targetId'] = targetId;
1343
+ }
1344
+ if (typeof providerType !== 'undefined') {
1345
+ payload['providerType'] = providerType;
1346
+ }
1347
+ if (typeof identifier !== 'undefined') {
1348
+ payload['identifier'] = identifier;
1349
+ }
1350
+ if (typeof providerId !== 'undefined') {
1351
+ payload['providerId'] = providerId;
1352
+ }
1353
+ if (typeof name !== 'undefined') {
1354
+ payload['name'] = name;
1355
+ }
1356
+ const uri = new URL(this.client.config.endpoint + apiPath);
1357
+
1358
+ const apiHeaders: { [header: string]: string } = {
1359
+ 'content-type': 'application/json',
1360
+ }
1361
+
1362
+ return await this.client.call(
1363
+ 'post',
1364
+ uri,
1365
+ apiHeaders,
1366
+ payload,
1367
+ );
1368
+ }
1369
+ /**
1370
+ * Get User Target
1371
+ *
1372
+ * Get a user&#039;s push notification target by ID.
1373
+ *
1374
+ * @param {string} userId
1375
+ * @param {string} targetId
1376
+ * @throws {AppcondaException}
1377
+ * @returns {Promise<Models.Target>}
1378
+ */
1379
+ async getTarget(userId: string, targetId: string): Promise<Models.Target> {
1380
+ if (typeof userId === 'undefined') {
1381
+ throw new AppcondaException('Missing required parameter: "userId"');
1382
+ }
1383
+ if (typeof targetId === 'undefined') {
1384
+ throw new AppcondaException('Missing required parameter: "targetId"');
1385
+ }
1386
+ const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
1387
+ const payload: Payload = {};
1388
+ const uri = new URL(this.client.config.endpoint + apiPath);
1389
+
1390
+ const apiHeaders: { [header: string]: string } = {
1391
+ 'content-type': 'application/json',
1392
+ }
1393
+
1394
+ return await this.client.call(
1395
+ 'get',
1396
+ uri,
1397
+ apiHeaders,
1398
+ payload,
1399
+ );
1400
+ }
1401
+ /**
1402
+ * Update User target
1403
+ *
1404
+ * Update a messaging target.
1405
+ *
1406
+ * @param {string} userId
1407
+ * @param {string} targetId
1408
+ * @param {string} identifier
1409
+ * @param {string} providerId
1410
+ * @param {string} name
1411
+ * @throws {AppcondaException}
1412
+ * @returns {Promise<Models.Target>}
1413
+ */
1414
+ async updateTarget(userId: string, targetId: string, identifier?: string, providerId?: string, name?: string): Promise<Models.Target> {
1415
+ if (typeof userId === 'undefined') {
1416
+ throw new AppcondaException('Missing required parameter: "userId"');
1417
+ }
1418
+ if (typeof targetId === 'undefined') {
1419
+ throw new AppcondaException('Missing required parameter: "targetId"');
1420
+ }
1421
+ const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
1422
+ const payload: Payload = {};
1423
+ if (typeof identifier !== 'undefined') {
1424
+ payload['identifier'] = identifier;
1425
+ }
1426
+ if (typeof providerId !== 'undefined') {
1427
+ payload['providerId'] = providerId;
1428
+ }
1429
+ if (typeof name !== 'undefined') {
1430
+ payload['name'] = name;
1431
+ }
1432
+ const uri = new URL(this.client.config.endpoint + apiPath);
1433
+
1434
+ const apiHeaders: { [header: string]: string } = {
1435
+ 'content-type': 'application/json',
1436
+ }
1437
+
1438
+ return await this.client.call(
1439
+ 'patch',
1440
+ uri,
1441
+ apiHeaders,
1442
+ payload,
1443
+ );
1444
+ }
1445
+ /**
1446
+ * Delete user target
1447
+ *
1448
+ * Delete a messaging target.
1449
+ *
1450
+ * @param {string} userId
1451
+ * @param {string} targetId
1452
+ * @throws {AppcondaException}
1453
+ * @returns {Promise<{}>}
1454
+ */
1455
+ async deleteTarget(userId: string, targetId: string): Promise<{}> {
1456
+ if (typeof userId === 'undefined') {
1457
+ throw new AppcondaException('Missing required parameter: "userId"');
1458
+ }
1459
+ if (typeof targetId === 'undefined') {
1460
+ throw new AppcondaException('Missing required parameter: "targetId"');
1461
+ }
1462
+ const apiPath = '/users/{userId}/targets/{targetId}'.replace('{userId}', userId).replace('{targetId}', targetId);
1463
+ const payload: Payload = {};
1464
+ const uri = new URL(this.client.config.endpoint + apiPath);
1465
+
1466
+ const apiHeaders: { [header: string]: string } = {
1467
+ 'content-type': 'application/json',
1468
+ }
1469
+
1470
+ return await this.client.call(
1471
+ 'delete',
1472
+ uri,
1473
+ apiHeaders,
1474
+ payload,
1475
+ );
1476
+ }
1477
+ /**
1478
+ * Create token
1479
+ *
1480
+ * 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://appconda.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process.
1481
+
1482
+ *
1483
+ * @param {string} userId
1484
+ * @param {number} length
1485
+ * @param {number} expire
1486
+ * @throws {AppcondaException}
1487
+ * @returns {Promise<Models.Token>}
1488
+ */
1489
+ async createToken(userId: string, length?: number, expire?: number): Promise<Models.Token> {
1490
+ if (typeof userId === 'undefined') {
1491
+ throw new AppcondaException('Missing required parameter: "userId"');
1492
+ }
1493
+ const apiPath = '/users/{userId}/tokens'.replace('{userId}', userId);
1494
+ const payload: Payload = {};
1495
+ if (typeof length !== 'undefined') {
1496
+ payload['length'] = length;
1497
+ }
1498
+ if (typeof expire !== 'undefined') {
1499
+ payload['expire'] = expire;
1500
+ }
1501
+ const uri = new URL(this.client.config.endpoint + apiPath);
1502
+
1503
+ const apiHeaders: { [header: string]: string } = {
1504
+ 'content-type': 'application/json',
1505
+ }
1506
+
1507
+ return await this.client.call(
1508
+ 'post',
1509
+ uri,
1510
+ apiHeaders,
1511
+ payload,
1512
+ );
1513
+ }
1514
+ /**
1515
+ * Update email verification
1516
+ *
1517
+ * Update the user email verification status by its unique ID.
1518
+ *
1519
+ * @param {string} userId
1520
+ * @param {boolean} emailVerification
1521
+ * @throws {AppcondaException}
1522
+ * @returns {Promise<Models.User<Preferences>>}
1523
+ */
1524
+ async updateEmailVerification<Preferences extends Models.Preferences>(userId: string, emailVerification: boolean): Promise<Models.User<Preferences>> {
1525
+ if (typeof userId === 'undefined') {
1526
+ throw new AppcondaException('Missing required parameter: "userId"');
1527
+ }
1528
+ if (typeof emailVerification === 'undefined') {
1529
+ throw new AppcondaException('Missing required parameter: "emailVerification"');
1530
+ }
1531
+ const apiPath = '/users/{userId}/verification'.replace('{userId}', userId);
1532
+ const payload: Payload = {};
1533
+ if (typeof emailVerification !== 'undefined') {
1534
+ payload['emailVerification'] = emailVerification;
1535
+ }
1536
+ const uri = new URL(this.client.config.endpoint + apiPath);
1537
+
1538
+ const apiHeaders: { [header: string]: string } = {
1539
+ 'content-type': 'application/json',
1540
+ }
1541
+
1542
+ return await this.client.call(
1543
+ 'patch',
1544
+ uri,
1545
+ apiHeaders,
1546
+ payload,
1547
+ );
1548
+ }
1549
+ /**
1550
+ * Update phone verification
1551
+ *
1552
+ * Update the user phone verification status by its unique ID.
1553
+ *
1554
+ * @param {string} userId
1555
+ * @param {boolean} phoneVerification
1556
+ * @throws {AppcondaException}
1557
+ * @returns {Promise<Models.User<Preferences>>}
1558
+ */
1559
+ async updatePhoneVerification<Preferences extends Models.Preferences>(userId: string, phoneVerification: boolean): Promise<Models.User<Preferences>> {
1560
+ if (typeof userId === 'undefined') {
1561
+ throw new AppcondaException('Missing required parameter: "userId"');
1562
+ }
1563
+ if (typeof phoneVerification === 'undefined') {
1564
+ throw new AppcondaException('Missing required parameter: "phoneVerification"');
1565
+ }
1566
+ const apiPath = '/users/{userId}/verification/phone'.replace('{userId}', userId);
1567
+ const payload: Payload = {};
1568
+ if (typeof phoneVerification !== 'undefined') {
1569
+ payload['phoneVerification'] = phoneVerification;
1570
+ }
1571
+ const uri = new URL(this.client.config.endpoint + apiPath);
1572
+
1573
+ const apiHeaders: { [header: string]: string } = {
1574
+ 'content-type': 'application/json',
1575
+ }
1576
+
1577
+ return await this.client.call(
1578
+ 'patch',
1579
+ uri,
1580
+ apiHeaders,
1581
+ payload,
1582
+ );
1583
+ }
1584
+ }