hcloud-sdk 0.0.16 → 14.13.2

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 (305) hide show
  1. package/README.md +1 -0
  2. package/changelog.md +809 -0
  3. package/index.d.ts +3 -2
  4. package/index.js +5 -2
  5. package/lib/Base.d.ts +26 -0
  6. package/lib/Base.js +12 -0
  7. package/lib/Hcloud.d.ts +80 -0
  8. package/lib/Hcloud.js +134 -0
  9. package/lib/helper/ErrorHelper.d.ts +7 -0
  10. package/lib/helper/ErrorHelper.js +19 -0
  11. package/lib/helper/paginatedResponseHelper.d.ts +3 -0
  12. package/lib/helper/paginatedResponseHelper.js +9 -0
  13. package/lib/helper/searchFilter.d.ts +9 -0
  14. package/lib/helper/searchFilter.js +12 -0
  15. package/lib/interfaces/agent/bundle/dev/index.d.ts +3 -0
  16. package/lib/interfaces/agent/context/index.d.ts +19 -0
  17. package/lib/interfaces/agent/index.d.ts +21 -0
  18. package/lib/interfaces/agent/index.js +2 -0
  19. package/lib/interfaces/{Auditor.d.ts → auditor/index.d.ts} +31 -5
  20. package/lib/interfaces/{Auditor.js → auditor/index.js} +15 -5
  21. package/lib/interfaces/axios/index.d.ts +5 -0
  22. package/lib/interfaces/axios/index.js +8 -0
  23. package/lib/interfaces/bouncer/features/index.d.ts +10 -0
  24. package/lib/interfaces/bouncer/features/index.js +2 -0
  25. package/lib/interfaces/bouncer/index.d.ts +6 -0
  26. package/lib/interfaces/bouncer/index.js +17 -0
  27. package/lib/interfaces/dali/index.d.ts +3 -0
  28. package/lib/interfaces/dali/index.js +2 -0
  29. package/lib/interfaces/frontend/config/index.d.ts +33 -0
  30. package/lib/interfaces/frontend/config/index.js +10 -0
  31. package/lib/interfaces/fuse/index.d.ts +3 -0
  32. package/lib/interfaces/fuse/index.js +19 -0
  33. package/lib/interfaces/fuse/space/cronjob/Cronjob.d.ts +38 -0
  34. package/lib/interfaces/fuse/space/cronjob/Cronjob.js +8 -0
  35. package/lib/interfaces/fuse/space/cronjob/CronjobLog.d.ts +16 -0
  36. package/lib/interfaces/fuse/space/cronjob/CronjobLog.js +2 -0
  37. package/lib/interfaces/fuse/space/index.d.ts +21 -0
  38. package/lib/interfaces/fuse/space/index.js +11 -0
  39. package/lib/interfaces/global/HCloudError.d.ts +8 -0
  40. package/lib/interfaces/global/HCloudError.js +13 -0
  41. package/lib/interfaces/global/Header.d.ts +4 -0
  42. package/lib/interfaces/global/Header.js +2 -0
  43. package/lib/interfaces/global/HttpMethod.d.ts +7 -0
  44. package/lib/interfaces/global/HttpMethod.js +11 -0
  45. package/lib/interfaces/global/PaginatedResponse.d.ts +4 -0
  46. package/lib/interfaces/global/PaginatedResponse.js +2 -0
  47. package/lib/interfaces/global/Products.d.ts +11 -0
  48. package/lib/interfaces/global/Products.js +15 -0
  49. package/lib/interfaces/global/SearchFilters.d.ts +86 -0
  50. package/lib/interfaces/global/SearchFilters.js +49 -0
  51. package/lib/interfaces/global/Space.d.ts +20 -0
  52. package/lib/interfaces/global/Space.js +8 -0
  53. package/lib/interfaces/global/Version.d.ts +3 -0
  54. package/lib/interfaces/global/Version.js +2 -0
  55. package/lib/interfaces/global/Views.d.ts +8 -0
  56. package/lib/interfaces/global/Views.js +12 -0
  57. package/lib/interfaces/global/index.d.ts +9 -0
  58. package/lib/interfaces/global/index.js +25 -0
  59. package/lib/interfaces/high5/index.d.ts +16 -0
  60. package/lib/interfaces/high5/index.js +32 -0
  61. package/lib/interfaces/high5/joinToken/index.d.ts +10 -0
  62. package/lib/interfaces/high5/joinToken/index.js +2 -0
  63. package/lib/interfaces/high5/space/event/index.d.ts +15 -0
  64. package/lib/interfaces/high5/space/event/index.js +2 -0
  65. package/lib/interfaces/high5/space/event/stream/design/DesignOperation.d.ts +68 -0
  66. package/lib/interfaces/high5/space/event/stream/design/DesignOperation.js +20 -0
  67. package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +92 -0
  68. package/lib/interfaces/high5/space/event/stream/design/StreamDesign.js +20 -0
  69. package/lib/interfaces/high5/space/event/stream/design/index.d.ts +22 -0
  70. package/lib/interfaces/high5/space/event/stream/design/index.js +2 -0
  71. package/lib/interfaces/high5/space/event/stream/design/snapshot/index.d.ts +30 -0
  72. package/lib/interfaces/high5/space/event/stream/design/snapshot/index.js +8 -0
  73. package/lib/interfaces/high5/space/event/stream/index.d.ts +77 -0
  74. package/lib/interfaces/high5/space/event/stream/index.js +13 -0
  75. package/lib/interfaces/high5/space/event/stream/node/index.d.ts +60 -0
  76. package/lib/interfaces/high5/space/event/stream/node/index.js +7 -0
  77. package/lib/interfaces/high5/space/execution/index.d.ts +137 -0
  78. package/lib/interfaces/high5/space/execution/index.js +21 -0
  79. package/lib/interfaces/high5/space/index.d.ts +23 -0
  80. package/lib/interfaces/high5/space/index.js +12 -0
  81. package/lib/interfaces/high5/space/secret/index.d.ts +12 -0
  82. package/lib/interfaces/high5/space/secret/index.js +2 -0
  83. package/lib/interfaces/high5/space/webhook/index.d.ts +75 -0
  84. package/lib/interfaces/high5/space/webhook/index.js +9 -0
  85. package/lib/interfaces/high5/wave/index.d.ts +171 -0
  86. package/lib/interfaces/high5/wave/index.js +52 -0
  87. package/lib/interfaces/idp/index.d.ts +26 -0
  88. package/lib/interfaces/idp/index.js +38 -0
  89. package/lib/interfaces/idp/oauth/index.d.ts +19 -0
  90. package/lib/interfaces/idp/oauth/index.js +8 -0
  91. package/lib/interfaces/idp/organization/index.d.ts +32 -0
  92. package/lib/interfaces/idp/organization/index.js +25 -0
  93. package/lib/interfaces/idp/organization/license/index.d.ts +84 -0
  94. package/lib/interfaces/idp/organization/license/index.js +15 -0
  95. package/lib/interfaces/idp/organization/member/index.d.ts +15 -0
  96. package/lib/interfaces/idp/organization/member/index.js +2 -0
  97. package/lib/interfaces/idp/organization/member/invitations/index.d.ts +26 -0
  98. package/lib/interfaces/idp/organization/member/invitations/index.js +18 -0
  99. package/lib/interfaces/idp/organization/settings/domain/index.d.ts +19 -0
  100. package/lib/interfaces/idp/organization/settings/domain/index.js +8 -0
  101. package/lib/interfaces/idp/organization/settings/domain/saml/index.d.ts +10 -0
  102. package/lib/interfaces/idp/organization/settings/domain/saml/index.js +2 -0
  103. package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +37 -0
  104. package/lib/interfaces/idp/organization/settings/oauthApp/index.js +2 -0
  105. package/lib/interfaces/idp/organization/team/index.d.ts +24 -0
  106. package/lib/interfaces/idp/organization/team/index.js +9 -0
  107. package/lib/interfaces/idp/user/ConnectionSettings.d.ts +6 -0
  108. package/lib/interfaces/idp/user/ConnectionSettings.js +2 -0
  109. package/lib/interfaces/idp/user/GeneralSettings.d.ts +44 -0
  110. package/lib/interfaces/idp/user/GeneralSettings.js +38 -0
  111. package/lib/interfaces/idp/user/NotificationSettings.d.ts +8 -0
  112. package/lib/interfaces/idp/user/NotificationSettings.js +2 -0
  113. package/lib/interfaces/idp/user/Pat.d.ts +19 -0
  114. package/lib/interfaces/idp/user/Pat.js +2 -0
  115. package/lib/interfaces/idp/user/Scopes.d.ts +40 -0
  116. package/lib/interfaces/idp/user/Scopes.js +50 -0
  117. package/lib/interfaces/idp/user/SuccessfulAuth.d.ts +5 -0
  118. package/lib/interfaces/idp/user/SuccessfulAuth.js +2 -0
  119. package/lib/interfaces/idp/user/Totp.d.ts +20 -0
  120. package/lib/interfaces/idp/user/Totp.js +2 -0
  121. package/lib/interfaces/idp/user/index.d.ts +23 -0
  122. package/lib/interfaces/idp/user/index.js +2 -0
  123. package/lib/interfaces/mailer/index.d.ts +66 -0
  124. package/lib/interfaces/mailer/index.js +81 -0
  125. package/lib/interfaces/mothership/index.d.ts +27 -0
  126. package/lib/interfaces/mothership/index.js +8 -0
  127. package/lib/interfaces/nats/index.d.ts +252 -0
  128. package/lib/interfaces/nats/index.js +334 -0
  129. package/lib/service/agent/bundle/dev/index.d.ts +17 -0
  130. package/lib/service/agent/bundle/dev/index.js +40 -0
  131. package/lib/service/agent/bundle/index.d.ts +11 -0
  132. package/lib/service/agent/bundle/index.js +55 -0
  133. package/lib/service/agent/context/index.d.ts +37 -0
  134. package/lib/service/agent/context/index.js +81 -0
  135. package/lib/service/agent/index.d.ts +14 -0
  136. package/lib/service/agent/index.js +20 -0
  137. package/lib/service/agent/installer/index.d.ts +15 -0
  138. package/lib/service/agent/installer/index.js +97 -0
  139. package/lib/service/auditor/index.d.ts +26 -0
  140. package/lib/service/auditor/index.js +49 -0
  141. package/lib/service/auditor/internal/index.d.ts +27 -0
  142. package/lib/service/{AuditorInternal.js → auditor/internal/index.js} +20 -24
  143. package/lib/service/bouncer/features/index.d.ts +8 -0
  144. package/lib/service/bouncer/features/index.js +25 -0
  145. package/lib/service/bouncer/index.d.ts +14 -0
  146. package/lib/service/bouncer/index.js +31 -0
  147. package/lib/service/dali/DaliAvatar.d.ts +36 -0
  148. package/lib/service/dali/DaliAvatar.js +25 -0
  149. package/lib/service/dali/avatar/DaliFuseSpace.d.ts +28 -0
  150. package/lib/service/dali/avatar/DaliFuseSpace.js +55 -0
  151. package/lib/service/dali/avatar/DaliHigh5Space.d.ts +28 -0
  152. package/lib/service/dali/avatar/DaliHigh5Space.js +55 -0
  153. package/lib/service/dali/avatar/DaliOAuthApp.d.ts +28 -0
  154. package/lib/service/dali/avatar/DaliOAuthApp.js +55 -0
  155. package/lib/service/dali/avatar/DaliOrganization.d.ts +25 -0
  156. package/lib/service/dali/avatar/DaliOrganization.js +52 -0
  157. package/lib/service/dali/avatar/DaliTeam.d.ts +28 -0
  158. package/lib/service/dali/avatar/DaliTeam.js +55 -0
  159. package/lib/service/dali/avatar/DaliUser.d.ts +22 -0
  160. package/lib/service/dali/avatar/DaliUser.js +49 -0
  161. package/lib/service/dali/index.d.ts +16 -0
  162. package/lib/service/dali/index.js +30 -0
  163. package/lib/service/fuse/index.d.ts +17 -0
  164. package/lib/service/fuse/index.js +34 -0
  165. package/lib/service/fuse/internal/index.d.ts +9 -0
  166. package/lib/service/fuse/internal/index.js +29 -0
  167. package/lib/service/fuse/internal/space/cronjob/index.d.ts +8 -0
  168. package/lib/service/fuse/internal/space/cronjob/index.js +15 -0
  169. package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +17 -0
  170. package/lib/service/fuse/internal/space/cronjob/log/index.js +35 -0
  171. package/lib/service/fuse/internal/space/index.d.ts +23 -0
  172. package/lib/service/fuse/internal/space/index.js +43 -0
  173. package/lib/service/fuse/space/cronjob/index.d.ts +123 -0
  174. package/lib/service/fuse/space/cronjob/index.js +175 -0
  175. package/lib/service/fuse/space/cronjob/log/index.d.ts +31 -0
  176. package/lib/service/fuse/space/cronjob/log/index.js +57 -0
  177. package/lib/service/fuse/space/index.d.ts +82 -0
  178. package/lib/service/fuse/space/index.js +134 -0
  179. package/lib/service/high5/execution/index.d.ts +10 -0
  180. package/lib/service/high5/execution/index.js +17 -0
  181. package/lib/service/high5/execution/log/index.d.ts +19 -0
  182. package/lib/service/high5/execution/log/index.js +41 -0
  183. package/lib/service/high5/execution/status/index.d.ts +18 -0
  184. package/lib/service/high5/execution/status/index.js +41 -0
  185. package/lib/service/high5/index.d.ts +22 -0
  186. package/lib/service/high5/index.js +39 -0
  187. package/lib/service/high5/internal/index.d.ts +9 -0
  188. package/lib/service/high5/internal/index.js +29 -0
  189. package/lib/service/high5/internal/space/index.d.ts +21 -0
  190. package/lib/service/high5/internal/space/index.js +41 -0
  191. package/lib/service/high5/joinToken/index.d.ts +40 -0
  192. package/lib/service/high5/joinToken/index.js +64 -0
  193. package/lib/service/high5/space/event/index.d.ts +56 -0
  194. package/lib/service/high5/space/event/index.js +89 -0
  195. package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +31 -0
  196. package/lib/service/high5/space/event/stream/design/DesignOperations.js +117 -0
  197. package/lib/service/high5/space/event/stream/design/index.d.ts +38 -0
  198. package/lib/service/high5/space/event/stream/design/index.js +56 -0
  199. package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +62 -0
  200. package/lib/service/high5/space/event/stream/design/snapshot/index.js +100 -0
  201. package/lib/service/high5/space/event/stream/index.d.ts +114 -0
  202. package/lib/service/high5/space/event/stream/index.js +164 -0
  203. package/lib/service/high5/space/execution/index.d.ts +48 -0
  204. package/lib/service/high5/space/execution/index.js +74 -0
  205. package/lib/service/high5/space/execution/log/index.d.ts +31 -0
  206. package/lib/service/high5/space/execution/log/index.js +57 -0
  207. package/lib/service/high5/space/execution/status/index.d.ts +16 -0
  208. package/lib/service/high5/space/execution/status/index.js +34 -0
  209. package/lib/service/high5/space/index.d.ts +107 -0
  210. package/lib/service/high5/space/index.js +160 -0
  211. package/lib/service/high5/space/node/index.d.ts +58 -0
  212. package/lib/service/high5/space/node/index.js +116 -0
  213. package/lib/service/high5/space/secret/index.d.ts +60 -0
  214. package/lib/service/high5/space/secret/index.js +92 -0
  215. package/lib/service/high5/space/wave/index.d.ts +38 -0
  216. package/lib/service/high5/space/wave/index.js +66 -0
  217. package/lib/service/high5/space/webhook/index.d.ts +83 -0
  218. package/lib/service/high5/space/webhook/index.js +132 -0
  219. package/lib/service/high5/space/webhook/log/index.d.ts +18 -0
  220. package/lib/service/high5/space/webhook/log/index.js +38 -0
  221. package/lib/service/high5/wave/index.d.ts +8 -0
  222. package/lib/service/high5/wave/index.js +15 -0
  223. package/lib/service/high5/wave/s3/index.d.ts +48 -0
  224. package/lib/service/high5/wave/s3/index.js +88 -0
  225. package/lib/service/idp/index.d.ts +82 -0
  226. package/lib/service/idp/index.js +137 -0
  227. package/lib/service/idp/internal/index.d.ts +19 -0
  228. package/lib/service/idp/internal/index.js +34 -0
  229. package/lib/service/idp/oauth/index.d.ts +45 -0
  230. package/lib/service/idp/oauth/index.js +105 -0
  231. package/lib/service/idp/organization/index.d.ts +54 -0
  232. package/lib/service/idp/organization/index.js +79 -0
  233. package/lib/service/idp/organization/license/index.d.ts +7 -0
  234. package/lib/service/idp/organization/license/index.js +30 -0
  235. package/lib/service/idp/organization/member/index.d.ts +58 -0
  236. package/lib/service/idp/organization/member/index.js +96 -0
  237. package/lib/service/idp/organization/member/invitations/index.d.ts +79 -0
  238. package/lib/service/idp/organization/member/invitations/index.js +118 -0
  239. package/lib/service/idp/organization/settings/domain/index.d.ts +38 -0
  240. package/lib/service/idp/organization/settings/domain/index.js +63 -0
  241. package/lib/service/idp/organization/settings/domain/saml/index.d.ts +43 -0
  242. package/lib/service/idp/organization/settings/domain/saml/index.js +88 -0
  243. package/lib/service/idp/organization/settings/index.d.ts +16 -0
  244. package/lib/service/idp/organization/settings/index.js +16 -0
  245. package/lib/service/idp/organization/settings/oauth/index.d.ts +64 -0
  246. package/lib/service/idp/organization/settings/oauth/index.js +106 -0
  247. package/lib/service/idp/organization/team/index.d.ts +72 -0
  248. package/lib/service/idp/organization/team/index.js +115 -0
  249. package/lib/service/idp/registration/index.d.ts +39 -0
  250. package/lib/service/idp/registration/index.js +84 -0
  251. package/lib/service/idp/user/index.d.ts +82 -0
  252. package/lib/service/idp/user/index.js +125 -0
  253. package/lib/service/idp/user/license/index.d.ts +7 -0
  254. package/lib/service/idp/user/license/index.js +30 -0
  255. package/lib/service/idp/user/password/index.d.ts +19 -0
  256. package/lib/service/idp/user/password/index.js +52 -0
  257. package/lib/service/idp/user/settings/connections/index.d.ts +15 -0
  258. package/lib/service/idp/user/settings/connections/index.js +33 -0
  259. package/lib/service/idp/user/settings/general/index.d.ts +18 -0
  260. package/lib/service/idp/user/settings/general/index.js +39 -0
  261. package/lib/service/idp/user/settings/index.d.ts +36 -0
  262. package/lib/service/idp/user/settings/index.js +25 -0
  263. package/lib/service/idp/user/settings/notifications/index.d.ts +18 -0
  264. package/lib/service/idp/user/settings/notifications/index.js +39 -0
  265. package/lib/service/idp/user/settings/oauthApps/index.d.ts +22 -0
  266. package/lib/service/idp/user/settings/oauthApps/index.js +54 -0
  267. package/lib/service/idp/user/settings/pats/index.d.ts +50 -0
  268. package/lib/service/idp/user/settings/pats/index.js +93 -0
  269. package/lib/service/idp/user/settings/twoFactor/index.d.ts +11 -0
  270. package/lib/service/idp/user/settings/twoFactor/index.js +15 -0
  271. package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +34 -0
  272. package/lib/service/idp/user/settings/twoFactor/totp/index.js +65 -0
  273. package/lib/service/mailer/index.d.ts +14 -0
  274. package/lib/service/{Mailer.js → mailer/index.js} +9 -12
  275. package/lib/service/mailer/internal/index.d.ts +36 -0
  276. package/lib/service/mailer/internal/index.js +64 -0
  277. package/lib/service/mothership/index.d.ts +97 -0
  278. package/lib/service/mothership/index.js +136 -0
  279. package/lib/service/nats/index.d.ts +51 -0
  280. package/lib/service/nats/index.js +138 -0
  281. package/lib/utils/Types.d.ts +1 -0
  282. package/lib/utils/Types.js +2 -0
  283. package/lib/utils/bouncer/features/Provider.d.ts +16 -0
  284. package/lib/utils/bouncer/features/Provider.js +83 -0
  285. package/package.json +37 -29
  286. package/lib/base.d.ts +0 -12
  287. package/lib/base.js +0 -8
  288. package/lib/hcloud.d.ts +0 -13
  289. package/lib/hcloud.js +0 -29
  290. package/lib/interfaces/Global.d.ts +0 -8
  291. package/lib/interfaces/IDP.d.ts +0 -9
  292. package/lib/interfaces/Mail.d.ts +0 -29
  293. package/lib/interfaces/Mail.js +0 -8
  294. package/lib/service/Auditor.d.ts +0 -22
  295. package/lib/service/Auditor.js +0 -61
  296. package/lib/service/AuditorInternal.d.ts +0 -28
  297. package/lib/service/High5.d.ts +0 -4
  298. package/lib/service/High5.js +0 -9
  299. package/lib/service/IDP.d.ts +0 -39
  300. package/lib/service/IDP.js +0 -84
  301. package/lib/service/Mailer.d.ts +0 -13
  302. package/lib/service/MailerInternal.d.ts +0 -32
  303. package/lib/service/MailerInternal.js +0 -64
  304. /package/lib/interfaces/{Global.js → agent/bundle/dev/index.js} +0 -0
  305. /package/lib/interfaces/{IDP.js → agent/context/index.js} +0 -0
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.IdpOrganizationTeams = void 0;
13
+ const Base_1 = require("../../../../Base");
14
+ const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
15
+ const searchFilter_1 = require("../../../../helper/searchFilter");
16
+ class IdpOrganizationTeams extends Base_1.default {
17
+ constructor() {
18
+ super(...arguments);
19
+ /**
20
+ * Creates a new Team in the specified Organization.
21
+ * @param orgName Name of the Organization
22
+ * @param teamName Name of the Team
23
+ * @param userIds List of User IDs to be added to the Team
24
+ * @returns The created Team
25
+ */
26
+ this.createTeam = (orgName, teamName, userIds) => __awaiter(this, void 0, void 0, function* () {
27
+ const resp = yield this.axios.post(this.getEndpoint(`/${orgName}/teams`), { name: teamName, userIds: userIds });
28
+ return resp.data;
29
+ });
30
+ /**
31
+ * Deletes a Team.
32
+ * @param orgName Name of the Organization
33
+ * @param teamName Name of the Team
34
+ */
35
+ this.deleteTeam = (orgName, teamName) => __awaiter(this, void 0, void 0, function* () {
36
+ yield this.axios.delete(this.getEndpoint(`/${orgName}/teams/${teamName}`));
37
+ });
38
+ /**
39
+ * Updates an existing Team.
40
+ * @param orgName Name of the Organization
41
+ * @param teamName Name of the Team
42
+ * @param newName (optional) New Team name
43
+ * @param userIds (optional) List of user IDs to be added to, deleted from or set to the Team depending on the parameter 'teamUserPatchOperation'
44
+ * @param teamUsersPatchOperation (optional) Enum describing what operation shall be executed: Add, set or remove
45
+ * @returns The updated Team object
46
+ */
47
+ this.patchTeam = (orgName, teamName, newName, userIds, teamUsersPatchOperation) => __awaiter(this, void 0, void 0, function* () {
48
+ const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/teams/${teamName}`), {
49
+ name: newName,
50
+ userIds: userIds,
51
+ usersOperation: teamUsersPatchOperation,
52
+ });
53
+ return resp.data;
54
+ });
55
+ /**
56
+ * Retrieve a Team by its name.
57
+ * @param orgName Name of the Organization
58
+ * @param teamName Name of the Team
59
+ * @returns The requested Team
60
+ */
61
+ this.getTeam = (orgName, teamName) => __awaiter(this, void 0, void 0, function* () {
62
+ const resp = yield this.axios.get(this.getEndpoint(`/${orgName}/teams/${teamName}`));
63
+ return resp.data;
64
+ });
65
+ /**
66
+ * Retrieves all Teams of an Organization that match the provided search filter(s). Returns all Teams if no search filter is provided.
67
+ * @param organizationName Name of the organization
68
+ * @param filters (optional) Array of search filters
69
+ * @param sorting (optional) Sorting object
70
+ * @param options (optional) Defines query options to retrieve additional properties for the returned Team objects.
71
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
72
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
73
+ * @returns Object containing an array of Teams and the total number of results found in the database (independent of limit and page)
74
+ */
75
+ this.searchTeams = (params) => __awaiter(this, void 0, void 0, function* () {
76
+ var _a, _b;
77
+ const limit = params.limit || 25;
78
+ const page = params.page || 0;
79
+ const getTotalMemberCount = ((_a = params.options) === null || _a === void 0 ? void 0 : _a.getTotalMemberCount) ? `&totalMemberCount=${params.options.getTotalMemberCount}` : "";
80
+ const getMembersSample = ((_b = params.options) === null || _b === void 0 ? void 0 : _b.getMembersSample) ? `&membersSample=${params.options.getMembersSample}` : "";
81
+ const filtersDTO = params.filters.map((f) => {
82
+ return new searchFilter_1.SearchFilterDTO(f);
83
+ });
84
+ const resp = yield this.axios.post(this.getEndpoint(`/${params.organizationName}/teams/search?limit=${limit}&page=${page}` + getMembersSample + getTotalMemberCount), {
85
+ filters: filtersDTO,
86
+ sorting: params.sorting,
87
+ });
88
+ return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
89
+ });
90
+ /**
91
+ * Retrieves all Members of a Team that match the provided search filter(s). Returns all Members if no search filter is provided.
92
+ * @param organizationName Name of the organization
93
+ * @param teamName Name of the Team
94
+ * @param filters (optional) Array of search filters
95
+ * @param sorting (optional) Sorting object
96
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
97
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
98
+ * @returns Object containing an array of Team members and the total number of results found in the database (independent of limit and page)
99
+ */
100
+ this.searchTeamMembers = (_a) => __awaiter(this, [_a], void 0, function* ({ organizationName, teamName, filters, sorting, limit = 25, page = 0, }) {
101
+ const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
102
+ return new searchFilter_1.SearchFilterDTO(f);
103
+ });
104
+ const resp = yield this.axios.post(this.getEndpoint(`/${organizationName}/teams/${teamName}/members/search?limit=${limit}&page=${page}`), {
105
+ filters: filtersDTO,
106
+ sorting: sorting,
107
+ });
108
+ return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
109
+ });
110
+ }
111
+ getEndpoint(endpoint) {
112
+ return `${this.options.server}/api/account/v1/org${endpoint}`;
113
+ }
114
+ }
115
+ exports.IdpOrganizationTeams = IdpOrganizationTeams;
@@ -0,0 +1,39 @@
1
+ import { AxiosInstance } from "axios";
2
+ import Base, { Options } from "../../../Base";
3
+ import { SuccessfulAuth } from "../../../interfaces/idp/user/SuccessfulAuth";
4
+ export declare class IdpRegistration extends Base {
5
+ constructor(options: Options, axios: AxiosInstance);
6
+ /**
7
+ * Registers a User in the HCloud system. This endpoint will send a verification link (with expiration date) to the Users' email address.
8
+ * At this point the User will have an account status of 'AWAITING_VALIDATION' and cannot sign into his account. If the registration won't be
9
+ * validated before the expiration date, the user will be deleted again.
10
+ * @param name - Name of the User
11
+ * @param email - Email of the User
12
+ * @param password - Password
13
+ * @param captcha - Captcha
14
+ * @param company - Optional company name
15
+ * @param regionId - Optional region id
16
+ * @param targetUrl Optional url the link in the mail will point to
17
+ */
18
+ register: (name: string, email: string, password: string, captcha: string, company?: string, regionId?: string, targetUrl?: string) => Promise<void>;
19
+ /**
20
+ * Triggers the registration mail to be resend if the first one got lost
21
+ * @param name - Name of the User
22
+ * @param email - Email of the User
23
+ * @param password - Password
24
+ * @param captcha - Captcha
25
+ * @param company - Optional company name
26
+ * @param regionId - Optional region id
27
+ * @param targetUrl Optional url the link in the mail will point to
28
+ */
29
+ resendRegistrationMail: (name: string, email: string, password: string, captcha: string, company?: string, regionId?: string, targetUrl?: string) => Promise<void>;
30
+ /**
31
+ * Validates a previous registration. If successful, the Users account status will be set to 'Active'.
32
+ * @param email - Email of the User
33
+ * @param verificationCode - Email verification code
34
+ * @param regionId - Optional region id
35
+ * @returns Bearer Token and User object
36
+ */
37
+ validateRegistration: (email: string, verificationCode: string) => Promise<SuccessfulAuth>;
38
+ protected getEndpoint(endpoint: string): string;
39
+ }
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.IdpRegistration = void 0;
13
+ const Base_1 = require("../../../Base");
14
+ class IdpRegistration extends Base_1.default {
15
+ constructor(options, axios) {
16
+ super(options, axios);
17
+ /**
18
+ * Registers a User in the HCloud system. This endpoint will send a verification link (with expiration date) to the Users' email address.
19
+ * At this point the User will have an account status of 'AWAITING_VALIDATION' and cannot sign into his account. If the registration won't be
20
+ * validated before the expiration date, the user will be deleted again.
21
+ * @param name - Name of the User
22
+ * @param email - Email of the User
23
+ * @param password - Password
24
+ * @param captcha - Captcha
25
+ * @param company - Optional company name
26
+ * @param regionId - Optional region id
27
+ * @param targetUrl Optional url the link in the mail will point to
28
+ */
29
+ this.register = (name, email, password, captcha, company, regionId, targetUrl) => __awaiter(this, void 0, void 0, function* () {
30
+ yield this.axios.post(this.getEndpoint("/v1/register"), {
31
+ name: name,
32
+ email: email,
33
+ password: password,
34
+ captcha: captcha,
35
+ company,
36
+ regionId,
37
+ targetUrl,
38
+ });
39
+ });
40
+ /**
41
+ * Triggers the registration mail to be resend if the first one got lost
42
+ * @param name - Name of the User
43
+ * @param email - Email of the User
44
+ * @param password - Password
45
+ * @param captcha - Captcha
46
+ * @param company - Optional company name
47
+ * @param regionId - Optional region id
48
+ * @param targetUrl Optional url the link in the mail will point to
49
+ */
50
+ this.resendRegistrationMail = (name, email, password, captcha, company, regionId, targetUrl) => __awaiter(this, void 0, void 0, function* () {
51
+ yield this.axios.patch(this.getEndpoint("/v1/register/resendRegistrationEmail"), {
52
+ name: name,
53
+ email: email,
54
+ password: password,
55
+ captcha: captcha,
56
+ company,
57
+ regionId,
58
+ targetUrl,
59
+ });
60
+ });
61
+ /**
62
+ * Validates a previous registration. If successful, the Users account status will be set to 'Active'.
63
+ * @param email - Email of the User
64
+ * @param verificationCode - Email verification code
65
+ * @param regionId - Optional region id
66
+ * @returns Bearer Token and User object
67
+ */
68
+ this.validateRegistration = (email, verificationCode) => __awaiter(this, void 0, void 0, function* () {
69
+ var _a;
70
+ const resp = yield this.axios.patch(this.getEndpoint("/v1/register/verify"), {
71
+ email,
72
+ verificationCode,
73
+ });
74
+ return {
75
+ token: ((_a = resp.headers["authorization"]) === null || _a === void 0 ? void 0 : _a.toString()) || "",
76
+ user: resp.data,
77
+ };
78
+ });
79
+ }
80
+ getEndpoint(endpoint) {
81
+ return `${this.options.server}/api/account${endpoint}`;
82
+ }
83
+ }
84
+ exports.IdpRegistration = IdpRegistration;
@@ -0,0 +1,82 @@
1
+ import { AxiosInstance } from "axios";
2
+ import Base, { Options } from "../../../Base";
3
+ import { PaginatedResponse, SearchFilter, Sorting } from "../../../interfaces/global";
4
+ import { Organization, OrganizationQueryOptions } from "../../../interfaces/idp/organization";
5
+ import { OrganizationMemberInvitation } from "../../../interfaces/idp/organization/member/invitations";
6
+ import { User, UserPatch } from "../../../interfaces/idp/user";
7
+ import { IdpUserLicense } from "./license";
8
+ import UserPasswordService from "./password";
9
+ import { IdpSettings } from "./settings";
10
+ export declare class IdpUser extends Base {
11
+ /**
12
+ * Handles everything around a user's settings
13
+ */
14
+ settings: IdpSettings;
15
+ /**
16
+ * Handles everything around a user's password
17
+ */
18
+ password: UserPasswordService;
19
+ /**
20
+ * Handles everything around a user's license
21
+ */
22
+ license: IdpUserLicense;
23
+ constructor(options: Options, axios: AxiosInstance);
24
+ /**
25
+ * Retrieves the User database entry for the requesting user.
26
+ * @returns User object
27
+ */
28
+ getUser: () => Promise<User>;
29
+ /**
30
+ * Updates the User database entry of the requesting user.
31
+ * @param user UserPatch object holding the new User values
32
+ * @returns User object
33
+ */
34
+ patchUser: (user: UserPatch) => Promise<User>;
35
+ /**
36
+ * Updates the Password of the requesting user.
37
+ * @param oldPassword String object holding the old password
38
+ * @param newPassword String object holding the new password
39
+ * @param token String (optional) object holding the current TOTP token
40
+ * @returns User object
41
+ */
42
+ patchUserPassword: (oldPassword: string, newPassword: string, totp?: string) => Promise<User>;
43
+ /**
44
+ * Deletes user session and logs him out of HCloud on all devices.
45
+ */
46
+ deleteUserSession: () => Promise<void>;
47
+ /**
48
+ * Deletes the requesting user.
49
+ */
50
+ deleteUser: () => Promise<void>;
51
+ /**
52
+ * Retrieves all Organizations of a user that match the provided search filter(s). Returns all Organizations of the user if no search filter is provided.
53
+ * @param filters (optional) Array of search filters
54
+ * @param sorting (optional) Sorting object
55
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
56
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
57
+ * @param options (optional) Defines query options to retrieve additional properties for the returned Organization objects.
58
+ * @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
59
+ */
60
+ searchOrganizations: (params: {
61
+ filters: SearchFilter[];
62
+ sorting?: Sorting;
63
+ limit?: number;
64
+ page?: number;
65
+ options?: OrganizationQueryOptions;
66
+ }) => Promise<PaginatedResponse<Organization>>;
67
+ /**
68
+ * Retrieves all organization invitations of a user that match the provided search filter(s). Returns all invitations of the user if no search filter is provided.
69
+ * @param filters (optional) Array of search filters
70
+ * @param sorting (optional) Sorting object
71
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
72
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
73
+ * @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
74
+ */
75
+ searchInvitations: (params: {
76
+ filters: SearchFilter[];
77
+ sorting?: Sorting;
78
+ limit?: number;
79
+ page?: number;
80
+ }) => Promise<PaginatedResponse<OrganizationMemberInvitation>>;
81
+ protected getEndpoint(endpoint: string): string;
82
+ }
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.IdpUser = void 0;
13
+ const Base_1 = require("../../../Base");
14
+ const paginatedResponseHelper_1 = require("../../../helper/paginatedResponseHelper");
15
+ const searchFilter_1 = require("../../../helper/searchFilter");
16
+ const license_1 = require("./license");
17
+ const password_1 = require("./password");
18
+ const settings_1 = require("./settings");
19
+ class IdpUser extends Base_1.default {
20
+ constructor(options, axios) {
21
+ super(options, axios);
22
+ /**
23
+ * Retrieves the User database entry for the requesting user.
24
+ * @returns User object
25
+ */
26
+ this.getUser = () => __awaiter(this, void 0, void 0, function* () {
27
+ const resp = yield this.axios.get(this.getEndpoint("/v1/user"));
28
+ return resp.data;
29
+ });
30
+ /**
31
+ * Updates the User database entry of the requesting user.
32
+ * @param user UserPatch object holding the new User values
33
+ * @returns User object
34
+ */
35
+ this.patchUser = (user) => __awaiter(this, void 0, void 0, function* () {
36
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/user`), user);
37
+ return resp.data;
38
+ });
39
+ /**
40
+ * Updates the Password of the requesting user.
41
+ * @param oldPassword String object holding the old password
42
+ * @param newPassword String object holding the new password
43
+ * @param token String (optional) object holding the current TOTP token
44
+ * @returns User object
45
+ */
46
+ this.patchUserPassword = (oldPassword, newPassword, totp) => __awaiter(this, void 0, void 0, function* () {
47
+ const t = {
48
+ old: oldPassword,
49
+ new: newPassword,
50
+ token: totp,
51
+ };
52
+ if (!totp) {
53
+ delete t.token;
54
+ }
55
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/password`), t);
56
+ return resp.data;
57
+ });
58
+ /**
59
+ * Deletes user session and logs him out of HCloud on all devices.
60
+ */
61
+ this.deleteUserSession = () => __awaiter(this, void 0, void 0, function* () {
62
+ yield this.axios.delete(this.getEndpoint(`/v1/user/sessions`));
63
+ });
64
+ /**
65
+ * Deletes the requesting user.
66
+ */
67
+ this.deleteUser = () => __awaiter(this, void 0, void 0, function* () {
68
+ yield this.axios.delete(this.getEndpoint(`/v1/user`));
69
+ });
70
+ /**
71
+ * Retrieves all Organizations of a user that match the provided search filter(s). Returns all Organizations of the user if no search filter is provided.
72
+ * @param filters (optional) Array of search filters
73
+ * @param sorting (optional) Sorting object
74
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
75
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
76
+ * @param options (optional) Defines query options to retrieve additional properties for the returned Organization objects.
77
+ * @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
78
+ */
79
+ this.searchOrganizations = (params) => __awaiter(this, void 0, void 0, function* () {
80
+ var _a, _b, _c;
81
+ const limit = params.limit || 25;
82
+ const page = params.page || 0;
83
+ const getTeamsOfUser = ((_a = params.options) === null || _a === void 0 ? void 0 : _a.getTeamsOfUser) ? `&teamsOfUser=${params.options.getTeamsOfUser}` : "";
84
+ const getTotalMemberCount = ((_b = params.options) === null || _b === void 0 ? void 0 : _b.getTotalMemberCount) ? `&totalMemberCount=${params.options.getTotalMemberCount}` : "";
85
+ const getMembersSample = ((_c = params.options) === null || _c === void 0 ? void 0 : _c.getMembersSample) ? `&membersSample=${params.options.getMembersSample}` : "";
86
+ // convert SearchFilters to DTO
87
+ const filtersDTO = params.filters.map((f) => {
88
+ return new searchFilter_1.SearchFilterDTO(f);
89
+ });
90
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/user/orgs/search?limit=${limit}&page=${page}` + getTeamsOfUser + getTotalMemberCount + getMembersSample), {
91
+ filters: filtersDTO,
92
+ sorting: params.sorting,
93
+ });
94
+ return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
95
+ });
96
+ /**
97
+ * Retrieves all organization invitations of a user that match the provided search filter(s). Returns all invitations of the user if no search filter is provided.
98
+ * @param filters (optional) Array of search filters
99
+ * @param sorting (optional) Sorting object
100
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
101
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
102
+ * @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
103
+ */
104
+ this.searchInvitations = (params) => __awaiter(this, void 0, void 0, function* () {
105
+ const limit = params.limit || 25;
106
+ const page = params.page || 0;
107
+ // convert SearchFilters to DTO
108
+ const filtersDTO = params.filters.map((f) => {
109
+ return new searchFilter_1.SearchFilterDTO(f);
110
+ });
111
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/user/orgs/invitations/search?limit=${limit}&page=${page}`), {
112
+ filters: filtersDTO,
113
+ sorting: params.sorting,
114
+ });
115
+ return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
116
+ });
117
+ this.settings = new settings_1.IdpSettings(options, axios);
118
+ this.password = new password_1.default(options, axios);
119
+ this.license = new license_1.IdpUserLicense(options, axios);
120
+ }
121
+ getEndpoint(endpoint) {
122
+ return `${this.options.server}/api/account${endpoint}`;
123
+ }
124
+ }
125
+ exports.IdpUser = IdpUser;
@@ -0,0 +1,7 @@
1
+ import Base from "../../../../Base";
2
+ import { License } from "../../../../interfaces/idp/organization/license";
3
+ export declare class IdpUserLicense extends Base {
4
+ getLicense: () => Promise<License>;
5
+ updateLicense: (token: string) => Promise<License>;
6
+ protected getEndpoint(endpoint: string): string;
7
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.IdpUserLicense = void 0;
13
+ const Base_1 = require("../../../../Base");
14
+ class IdpUserLicense extends Base_1.default {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.getLicense = () => __awaiter(this, void 0, void 0, function* () {
18
+ const res = yield this.axios.get(this.getEndpoint(`/user/license`));
19
+ return res.data;
20
+ });
21
+ this.updateLicense = (token) => __awaiter(this, void 0, void 0, function* () {
22
+ const res = yield this.axios.put(this.getEndpoint(`/user/license`), { identifier: token });
23
+ return res.data;
24
+ });
25
+ }
26
+ getEndpoint(endpoint) {
27
+ return `${this.options.server}/api/account/v1${endpoint}`;
28
+ }
29
+ }
30
+ exports.IdpUserLicense = IdpUserLicense;
@@ -0,0 +1,19 @@
1
+ import Base from "../../../../Base";
2
+ import { User } from "../../../../interfaces/idp";
3
+ export default class UserPasswordService extends Base {
4
+ /**
5
+ * 2nd phase of the reset password flow
6
+ * @param email Email of the user
7
+ * @param nonce Nonce present in the link sent via email
8
+ * @param newPassword New password
9
+ * @param totpToken (Optional) TOTP token in case the user had 2FA enabled
10
+ * @returns User object
11
+ */
12
+ resetPassword: (email: string, nonce: string, newPassword: string, totpToken?: string) => Promise<User>;
13
+ parseResetPasswordToken(token: string): {
14
+ email: string;
15
+ nonce: string;
16
+ regionId?: string;
17
+ };
18
+ protected getEndpoint(endpoint: string): string;
19
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const Base_1 = require("../../../../Base");
13
+ class UserPasswordService extends Base_1.default {
14
+ constructor() {
15
+ super(...arguments);
16
+ /**
17
+ * 2nd phase of the reset password flow
18
+ * @param email Email of the user
19
+ * @param nonce Nonce present in the link sent via email
20
+ * @param newPassword New password
21
+ * @param totpToken (Optional) TOTP token in case the user had 2FA enabled
22
+ * @returns User object
23
+ */
24
+ this.resetPassword = (email, nonce, newPassword, totpToken) => __awaiter(this, void 0, void 0, function* () {
25
+ const res = yield this.axios.post(this.getEndpoint("/v1/user/password/reset"), {
26
+ email,
27
+ nonce,
28
+ newPassword,
29
+ totpToken,
30
+ });
31
+ return res.data;
32
+ });
33
+ }
34
+ parseResetPasswordToken(token) {
35
+ const decoded = atob(token.replace("_", "/").replace("-", "+"));
36
+ let obj;
37
+ try {
38
+ obj = JSON.parse(decoded);
39
+ }
40
+ catch (err) {
41
+ throw new Error(`Token ${token} is poorly formatted. Decoded to ${decoded}.`);
42
+ }
43
+ if (!("email" in obj) || !("nonce" in obj)) {
44
+ throw new Error(`Decoded token ${decoded} is missing email or nonce property.`);
45
+ }
46
+ return obj;
47
+ }
48
+ getEndpoint(endpoint) {
49
+ return `${this.options.server}/api/account${endpoint}`;
50
+ }
51
+ }
52
+ exports.default = UserPasswordService;
@@ -0,0 +1,15 @@
1
+ import { AxiosInstance } from "axios";
2
+ import Base, { Options } from "../../../../../Base";
3
+ import { ConnectionSettings } from "../../../../../interfaces/idp/user/ConnectionSettings";
4
+ export declare class IdpConnections extends Base {
5
+ constructor(options: Options, axios: AxiosInstance);
6
+ /**
7
+ * Get connection settings for all organizations the user is a part of.
8
+ *
9
+ * Must have a set authentication token.
10
+ *
11
+ * @returns connection settings for each organization
12
+ */
13
+ get: () => Promise<ConnectionSettings>;
14
+ protected getEndpoint(): string;
15
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.IdpConnections = void 0;
13
+ const Base_1 = require("../../../../../Base");
14
+ class IdpConnections extends Base_1.default {
15
+ constructor(options, axios) {
16
+ super(options, axios);
17
+ /**
18
+ * Get connection settings for all organizations the user is a part of.
19
+ *
20
+ * Must have a set authentication token.
21
+ *
22
+ * @returns connection settings for each organization
23
+ */
24
+ this.get = () => __awaiter(this, void 0, void 0, function* () {
25
+ const res = yield this.axios.get(this.getEndpoint());
26
+ return res.data;
27
+ });
28
+ }
29
+ getEndpoint() {
30
+ return `${this.options.server}/api/account/v1/user/settings/connections`;
31
+ }
32
+ }
33
+ exports.IdpConnections = IdpConnections;
@@ -0,0 +1,18 @@
1
+ import { AxiosInstance } from "axios";
2
+ import Base, { Options } from "../../../../../Base";
3
+ import { GeneralSettings, GeneralSettingsPatch } from "../../../../../interfaces/idp/user/GeneralSettings";
4
+ export declare class IdpGeneral extends Base {
5
+ constructor(options: Options, axios: AxiosInstance);
6
+ /**
7
+ * Retrieves the current active user settings.
8
+ * @returns the current active user settings
9
+ */
10
+ getGeneralSettings: () => Promise<GeneralSettings>;
11
+ /**
12
+ * Changes the user settings.
13
+ * @param generalSettingsPatch Object containing the new user settings
14
+ * @returns the updated user settings
15
+ */
16
+ patchGeneralSettings: (generalSettingsPatch: GeneralSettingsPatch) => Promise<GeneralSettings>;
17
+ protected getEndpoint(endpoint: string): string;
18
+ }