@appconda/sdk 1.0.194 → 1.0.409

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