hcloud-sdk 0.0.16 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (310) hide show
  1. package/README.md +1 -0
  2. package/changelog.md +45 -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 +90 -0
  8. package/lib/Hcloud.js +184 -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 +7 -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/frontend/featureflags/index.d.ts +7 -0
  32. package/lib/interfaces/frontend/featureflags/index.js +2 -0
  33. package/lib/interfaces/fuse/index.d.ts +3 -0
  34. package/lib/interfaces/fuse/index.js +19 -0
  35. package/lib/interfaces/fuse/space/cronjob/Cronjob.d.ts +38 -0
  36. package/lib/interfaces/fuse/space/cronjob/Cronjob.js +8 -0
  37. package/lib/interfaces/fuse/space/cronjob/CronjobLog.d.ts +16 -0
  38. package/lib/interfaces/fuse/space/cronjob/CronjobLog.js +2 -0
  39. package/lib/interfaces/fuse/space/index.d.ts +21 -0
  40. package/lib/interfaces/fuse/space/index.js +11 -0
  41. package/lib/interfaces/global/HCloudError.d.ts +8 -0
  42. package/lib/interfaces/global/HCloudError.js +13 -0
  43. package/lib/interfaces/global/Header.d.ts +4 -0
  44. package/lib/interfaces/global/Header.js +2 -0
  45. package/lib/interfaces/global/HttpMethod.d.ts +7 -0
  46. package/lib/interfaces/global/HttpMethod.js +11 -0
  47. package/lib/interfaces/global/PaginatedResponse.d.ts +4 -0
  48. package/lib/interfaces/global/PaginatedResponse.js +2 -0
  49. package/lib/interfaces/global/Products.d.ts +11 -0
  50. package/lib/interfaces/global/Products.js +15 -0
  51. package/lib/interfaces/global/SearchFilters.d.ts +86 -0
  52. package/lib/interfaces/global/SearchFilters.js +49 -0
  53. package/lib/interfaces/global/Space.d.ts +20 -0
  54. package/lib/interfaces/global/Space.js +8 -0
  55. package/lib/interfaces/global/Version.d.ts +3 -0
  56. package/lib/interfaces/global/Version.js +2 -0
  57. package/lib/interfaces/global/Views.d.ts +8 -0
  58. package/lib/interfaces/global/Views.js +12 -0
  59. package/lib/interfaces/global/index.d.ts +9 -0
  60. package/lib/interfaces/global/index.js +25 -0
  61. package/lib/interfaces/high5/index.d.ts +16 -0
  62. package/lib/interfaces/high5/index.js +32 -0
  63. package/lib/interfaces/high5/joinToken/index.d.ts +10 -0
  64. package/lib/interfaces/high5/joinToken/index.js +2 -0
  65. package/lib/interfaces/high5/space/event/index.d.ts +15 -0
  66. package/lib/interfaces/high5/space/event/index.js +2 -0
  67. package/lib/interfaces/high5/space/event/stream/design/DesignOperation.d.ts +68 -0
  68. package/lib/interfaces/high5/space/event/stream/design/DesignOperation.js +20 -0
  69. package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +92 -0
  70. package/lib/interfaces/high5/space/event/stream/design/StreamDesign.js +20 -0
  71. package/lib/interfaces/high5/space/event/stream/design/index.d.ts +22 -0
  72. package/lib/interfaces/high5/space/event/stream/design/index.js +2 -0
  73. package/lib/interfaces/high5/space/event/stream/design/snapshot/index.d.ts +30 -0
  74. package/lib/interfaces/high5/space/event/stream/design/snapshot/index.js +8 -0
  75. package/lib/interfaces/high5/space/event/stream/index.d.ts +77 -0
  76. package/lib/interfaces/high5/space/event/stream/index.js +13 -0
  77. package/lib/interfaces/high5/space/event/stream/node/index.d.ts +62 -0
  78. package/lib/interfaces/high5/space/event/stream/node/index.js +7 -0
  79. package/lib/interfaces/high5/space/execution/index.d.ts +148 -0
  80. package/lib/interfaces/high5/space/execution/index.js +21 -0
  81. package/lib/interfaces/high5/space/index.d.ts +23 -0
  82. package/lib/interfaces/high5/space/index.js +12 -0
  83. package/lib/interfaces/high5/space/secret/index.d.ts +12 -0
  84. package/lib/interfaces/high5/space/secret/index.js +2 -0
  85. package/lib/interfaces/high5/space/webhook/index.d.ts +75 -0
  86. package/lib/interfaces/high5/space/webhook/index.js +9 -0
  87. package/lib/interfaces/high5/wave/changelog.d.ts +30 -0
  88. package/lib/interfaces/high5/wave/changelog.js +18 -0
  89. package/lib/interfaces/high5/wave/index.d.ts +201 -0
  90. package/lib/interfaces/high5/wave/index.js +61 -0
  91. package/lib/interfaces/idp/index.d.ts +26 -0
  92. package/lib/interfaces/idp/index.js +38 -0
  93. package/lib/interfaces/idp/oauth/index.d.ts +19 -0
  94. package/lib/interfaces/idp/oauth/index.js +8 -0
  95. package/lib/interfaces/idp/organization/index.d.ts +32 -0
  96. package/lib/interfaces/idp/organization/index.js +25 -0
  97. package/lib/interfaces/idp/organization/license/index.d.ts +84 -0
  98. package/lib/interfaces/idp/organization/license/index.js +15 -0
  99. package/lib/interfaces/idp/organization/member/index.d.ts +15 -0
  100. package/lib/interfaces/idp/organization/member/index.js +2 -0
  101. package/lib/interfaces/idp/organization/member/invitations/index.d.ts +26 -0
  102. package/lib/interfaces/idp/organization/member/invitations/index.js +18 -0
  103. package/lib/interfaces/idp/organization/settings/domain/index.d.ts +19 -0
  104. package/lib/interfaces/idp/organization/settings/domain/index.js +8 -0
  105. package/lib/interfaces/idp/organization/settings/domain/saml/index.d.ts +10 -0
  106. package/lib/interfaces/idp/organization/settings/domain/saml/index.js +2 -0
  107. package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +37 -0
  108. package/lib/interfaces/idp/organization/settings/oauthApp/index.js +2 -0
  109. package/lib/interfaces/idp/organization/team/index.d.ts +24 -0
  110. package/lib/interfaces/idp/organization/team/index.js +9 -0
  111. package/lib/interfaces/idp/user/ConnectionSettings.d.ts +6 -0
  112. package/lib/interfaces/idp/user/ConnectionSettings.js +2 -0
  113. package/lib/interfaces/idp/user/GeneralSettings.d.ts +45 -0
  114. package/lib/interfaces/idp/user/GeneralSettings.js +38 -0
  115. package/lib/interfaces/idp/user/NotificationSettings.d.ts +8 -0
  116. package/lib/interfaces/idp/user/NotificationSettings.js +2 -0
  117. package/lib/interfaces/idp/user/Pat.d.ts +19 -0
  118. package/lib/interfaces/idp/user/Pat.js +2 -0
  119. package/lib/interfaces/idp/user/Scopes.d.ts +40 -0
  120. package/lib/interfaces/idp/user/Scopes.js +50 -0
  121. package/lib/interfaces/idp/user/SuccessfulAuth.d.ts +5 -0
  122. package/lib/interfaces/idp/user/SuccessfulAuth.js +2 -0
  123. package/lib/interfaces/idp/user/Totp.d.ts +20 -0
  124. package/lib/interfaces/idp/user/Totp.js +2 -0
  125. package/lib/interfaces/idp/user/index.d.ts +23 -0
  126. package/lib/interfaces/idp/user/index.js +2 -0
  127. package/lib/interfaces/mailer/index.d.ts +66 -0
  128. package/lib/interfaces/mailer/index.js +81 -0
  129. package/lib/interfaces/mothership/index.d.ts +28 -0
  130. package/lib/interfaces/mothership/index.js +8 -0
  131. package/lib/interfaces/nats/index.d.ts +239 -0
  132. package/lib/interfaces/nats/index.js +316 -0
  133. package/lib/service/agent/bundle/dev/index.d.ts +17 -0
  134. package/lib/service/agent/bundle/dev/index.js +44 -0
  135. package/lib/service/agent/bundle/index.d.ts +11 -0
  136. package/lib/service/agent/bundle/index.js +55 -0
  137. package/lib/service/agent/context/index.d.ts +35 -0
  138. package/lib/service/agent/context/index.js +90 -0
  139. package/lib/service/agent/index.d.ts +16 -0
  140. package/lib/service/agent/index.js +37 -0
  141. package/lib/service/agent/installer/index.d.ts +15 -0
  142. package/lib/service/agent/installer/index.js +97 -0
  143. package/lib/service/auditor/index.d.ts +25 -0
  144. package/lib/service/auditor/index.js +55 -0
  145. package/lib/service/auditor/internal/index.d.ts +27 -0
  146. package/lib/service/auditor/internal/index.js +65 -0
  147. package/lib/service/bouncer/features/index.d.ts +8 -0
  148. package/lib/service/bouncer/features/index.js +27 -0
  149. package/lib/service/bouncer/index.d.ts +7 -0
  150. package/lib/service/bouncer/index.js +16 -0
  151. package/lib/service/dali/DaliAvatar.d.ts +40 -0
  152. package/lib/service/dali/DaliAvatar.js +70 -0
  153. package/lib/service/dali/avatar/DaliFuseSpace.d.ts +26 -0
  154. package/lib/service/dali/avatar/DaliFuseSpace.js +58 -0
  155. package/lib/service/dali/avatar/DaliHigh5Space.d.ts +26 -0
  156. package/lib/service/dali/avatar/DaliHigh5Space.js +58 -0
  157. package/lib/service/dali/avatar/DaliOAuthApp.d.ts +26 -0
  158. package/lib/service/dali/avatar/DaliOAuthApp.js +58 -0
  159. package/lib/service/dali/avatar/DaliOrganization.d.ts +23 -0
  160. package/lib/service/dali/avatar/DaliOrganization.js +55 -0
  161. package/lib/service/dali/avatar/DaliTeam.d.ts +26 -0
  162. package/lib/service/dali/avatar/DaliTeam.js +58 -0
  163. package/lib/service/dali/avatar/DaliUser.d.ts +20 -0
  164. package/lib/service/dali/avatar/DaliUser.js +52 -0
  165. package/lib/service/dali/index.d.ts +15 -0
  166. package/lib/service/dali/index.js +37 -0
  167. package/lib/service/fuse/index.d.ts +18 -0
  168. package/lib/service/fuse/index.js +48 -0
  169. package/lib/service/fuse/internal/index.d.ts +8 -0
  170. package/lib/service/fuse/internal/index.js +31 -0
  171. package/lib/service/fuse/internal/space/cronjob/index.d.ts +7 -0
  172. package/lib/service/fuse/internal/space/cronjob/index.js +17 -0
  173. package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +15 -0
  174. package/lib/service/fuse/internal/space/cronjob/log/index.js +34 -0
  175. package/lib/service/fuse/internal/space/index.d.ts +22 -0
  176. package/lib/service/fuse/internal/space/index.js +49 -0
  177. package/lib/service/fuse/space/cronjob/index.d.ts +123 -0
  178. package/lib/service/fuse/space/cronjob/index.js +203 -0
  179. package/lib/service/fuse/space/cronjob/log/index.d.ts +31 -0
  180. package/lib/service/fuse/space/cronjob/log/index.js +58 -0
  181. package/lib/service/fuse/space/index.d.ts +81 -0
  182. package/lib/service/fuse/space/index.js +152 -0
  183. package/lib/service/high5/execution/index.d.ts +10 -0
  184. package/lib/service/high5/execution/index.js +24 -0
  185. package/lib/service/high5/execution/log/index.d.ts +19 -0
  186. package/lib/service/high5/execution/log/index.js +40 -0
  187. package/lib/service/high5/execution/status/index.d.ts +18 -0
  188. package/lib/service/high5/execution/status/index.js +40 -0
  189. package/lib/service/high5/index.d.ts +25 -0
  190. package/lib/service/high5/index.js +63 -0
  191. package/lib/service/high5/internal/index.d.ts +8 -0
  192. package/lib/service/high5/internal/index.js +31 -0
  193. package/lib/service/high5/internal/space/index.d.ts +21 -0
  194. package/lib/service/high5/internal/space/index.js +45 -0
  195. package/lib/service/high5/joinToken/index.d.ts +40 -0
  196. package/lib/service/high5/joinToken/index.js +72 -0
  197. package/lib/service/high5/space/event/index.d.ts +55 -0
  198. package/lib/service/high5/space/event/index.js +101 -0
  199. package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +31 -0
  200. package/lib/service/high5/space/event/stream/design/DesignOperations.js +117 -0
  201. package/lib/service/high5/space/event/stream/design/index.d.ts +53 -0
  202. package/lib/service/high5/space/event/stream/design/index.js +91 -0
  203. package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +62 -0
  204. package/lib/service/high5/space/event/stream/design/snapshot/index.js +107 -0
  205. package/lib/service/high5/space/event/stream/index.d.ts +113 -0
  206. package/lib/service/high5/space/event/stream/index.js +186 -0
  207. package/lib/service/high5/space/execution/index.d.ts +48 -0
  208. package/lib/service/high5/space/execution/index.js +89 -0
  209. package/lib/service/high5/space/execution/log/index.d.ts +29 -0
  210. package/lib/service/high5/space/execution/log/index.js +58 -0
  211. package/lib/service/high5/space/execution/status/index.d.ts +16 -0
  212. package/lib/service/high5/space/execution/status/index.js +36 -0
  213. package/lib/service/high5/space/index.d.ts +111 -0
  214. package/lib/service/high5/space/index.js +205 -0
  215. package/lib/service/high5/space/node/index.d.ts +58 -0
  216. package/lib/service/high5/space/node/index.js +116 -0
  217. package/lib/service/high5/space/secret/index.d.ts +60 -0
  218. package/lib/service/high5/space/secret/index.js +102 -0
  219. package/lib/service/high5/space/wave/index.d.ts +36 -0
  220. package/lib/service/high5/space/wave/index.js +73 -0
  221. package/lib/service/high5/space/webhook/index.d.ts +90 -0
  222. package/lib/service/high5/space/webhook/index.js +165 -0
  223. package/lib/service/high5/space/webhook/log/index.d.ts +16 -0
  224. package/lib/service/high5/space/webhook/log/index.js +37 -0
  225. package/lib/service/high5/wave/index.d.ts +8 -0
  226. package/lib/service/high5/wave/index.js +15 -0
  227. package/lib/service/high5/wave/s3/index.d.ts +48 -0
  228. package/lib/service/high5/wave/s3/index.js +100 -0
  229. package/lib/service/idp/index.d.ts +84 -0
  230. package/lib/service/idp/index.js +185 -0
  231. package/lib/service/idp/internal/index.d.ts +17 -0
  232. package/lib/service/idp/internal/index.js +33 -0
  233. package/lib/service/idp/oauth/index.d.ts +49 -0
  234. package/lib/service/idp/oauth/index.js +117 -0
  235. package/lib/service/idp/organization/index.d.ts +56 -0
  236. package/lib/service/idp/organization/index.js +114 -0
  237. package/lib/service/idp/organization/license/index.d.ts +7 -0
  238. package/lib/service/idp/organization/license/index.js +31 -0
  239. package/lib/service/idp/organization/member/index.d.ts +57 -0
  240. package/lib/service/idp/organization/member/index.js +110 -0
  241. package/lib/service/idp/organization/member/invitations/index.d.ts +79 -0
  242. package/lib/service/idp/organization/member/invitations/index.js +122 -0
  243. package/lib/service/idp/organization/settings/domain/index.d.ts +37 -0
  244. package/lib/service/idp/organization/settings/domain/index.js +76 -0
  245. package/lib/service/idp/organization/settings/domain/saml/index.d.ts +43 -0
  246. package/lib/service/idp/organization/settings/domain/saml/index.js +98 -0
  247. package/lib/service/idp/organization/settings/index.d.ts +16 -0
  248. package/lib/service/idp/organization/settings/index.js +29 -0
  249. package/lib/service/idp/organization/settings/oauth/index.d.ts +62 -0
  250. package/lib/service/idp/organization/settings/oauth/index.js +117 -0
  251. package/lib/service/idp/organization/team/index.d.ts +72 -0
  252. package/lib/service/idp/organization/team/index.js +124 -0
  253. package/lib/service/idp/registration/index.d.ts +37 -0
  254. package/lib/service/idp/registration/index.js +87 -0
  255. package/lib/service/idp/user/index.d.ts +83 -0
  256. package/lib/service/idp/user/index.js +160 -0
  257. package/lib/service/idp/user/license/index.d.ts +7 -0
  258. package/lib/service/idp/user/license/index.js +31 -0
  259. package/lib/service/idp/user/password/index.d.ts +19 -0
  260. package/lib/service/idp/user/password/index.js +51 -0
  261. package/lib/service/idp/user/settings/connections/index.d.ts +13 -0
  262. package/lib/service/idp/user/settings/connections/index.js +32 -0
  263. package/lib/service/idp/user/settings/general/index.d.ts +22 -0
  264. package/lib/service/idp/user/settings/general/index.js +51 -0
  265. package/lib/service/idp/user/settings/index.d.ts +40 -0
  266. package/lib/service/idp/user/settings/index.js +70 -0
  267. package/lib/service/idp/user/settings/notifications/index.d.ts +16 -0
  268. package/lib/service/idp/user/settings/notifications/index.js +40 -0
  269. package/lib/service/idp/user/settings/oauthApps/index.d.ts +20 -0
  270. package/lib/service/idp/user/settings/oauthApps/index.js +55 -0
  271. package/lib/service/idp/user/settings/pats/index.d.ts +48 -0
  272. package/lib/service/idp/user/settings/pats/index.js +104 -0
  273. package/lib/service/idp/user/settings/twoFactor/index.d.ts +10 -0
  274. package/lib/service/idp/user/settings/twoFactor/index.js +20 -0
  275. package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +32 -0
  276. package/lib/service/idp/user/settings/twoFactor/totp/index.js +72 -0
  277. package/lib/service/mailer/index.d.ts +13 -0
  278. package/lib/service/{Mailer.js → mailer/index.js} +17 -16
  279. package/lib/service/mailer/internal/index.d.ts +36 -0
  280. package/lib/service/mailer/internal/index.js +69 -0
  281. package/lib/service/mothership/index.d.ts +97 -0
  282. package/lib/service/mothership/index.js +149 -0
  283. package/lib/service/nats/index.d.ts +49 -0
  284. package/lib/service/nats/index.js +138 -0
  285. package/lib/utils/Types.d.ts +1 -0
  286. package/lib/utils/Types.js +2 -0
  287. package/lib/utils/bouncer/features/Provider.d.ts +19 -0
  288. package/lib/utils/bouncer/features/Provider.js +101 -0
  289. package/package.json +37 -29
  290. package/lib/base.d.ts +0 -12
  291. package/lib/base.js +0 -8
  292. package/lib/hcloud.d.ts +0 -13
  293. package/lib/hcloud.js +0 -29
  294. package/lib/interfaces/Global.d.ts +0 -8
  295. package/lib/interfaces/IDP.d.ts +0 -9
  296. package/lib/interfaces/Mail.d.ts +0 -29
  297. package/lib/interfaces/Mail.js +0 -8
  298. package/lib/service/Auditor.d.ts +0 -22
  299. package/lib/service/Auditor.js +0 -61
  300. package/lib/service/AuditorInternal.d.ts +0 -28
  301. package/lib/service/AuditorInternal.js +0 -65
  302. package/lib/service/High5.d.ts +0 -4
  303. package/lib/service/High5.js +0 -9
  304. package/lib/service/IDP.d.ts +0 -39
  305. package/lib/service/IDP.js +0 -84
  306. package/lib/service/Mailer.d.ts +0 -13
  307. package/lib/service/MailerInternal.d.ts +0 -32
  308. package/lib/service/MailerInternal.js +0 -64
  309. /package/lib/interfaces/{Global.js → agent/bundle/dev/index.js} +0 -0
  310. /package/lib/interfaces/{IDP.js → agent/context/index.js} +0 -0
@@ -0,0 +1,114 @@
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.IdpOrganization = void 0;
13
+ const Base_1 = require("../../../Base");
14
+ const license_1 = require("./license");
15
+ const member_1 = require("./member");
16
+ const settings_1 = require("./settings");
17
+ const team_1 = require("./team");
18
+ class IdpOrganization extends Base_1.default {
19
+ /**
20
+ * Handles everything around organization members
21
+ */
22
+ get member() {
23
+ if (this._member === undefined) {
24
+ this._member = new member_1.IdpOrganizationMember(this.options, this.axios);
25
+ }
26
+ return this._member;
27
+ }
28
+ /**
29
+ * Handles everything around organization settings
30
+ */
31
+ get settings() {
32
+ if (this._settings === undefined) {
33
+ this._settings = new settings_1.default(this.options, this.axios);
34
+ }
35
+ return this._settings;
36
+ }
37
+ /**
38
+ * Handles everything around teams of organizations.
39
+ */
40
+ get teams() {
41
+ if (this._teams === undefined) {
42
+ this._teams = new team_1.IdpOrganizationTeams(this.options, this.axios);
43
+ }
44
+ return this._teams;
45
+ }
46
+ /**
47
+ * Handles everything around licenses.
48
+ */
49
+ get license() {
50
+ if (this._license === undefined) {
51
+ this._license = new license_1.IdpOrganizationLicense(this.options, this.axios);
52
+ }
53
+ return this._license;
54
+ }
55
+ /**
56
+ * Updates an Organization.
57
+ * @param orgName Current name of the Organization
58
+ * @param newName New name for the organization
59
+ * @param company (optional) New company name
60
+ * @returns The updated Organization
61
+ */
62
+ updateOrganization(orgName, newName, company) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ const organization = { name: newName, company: company };
65
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}`), organization);
66
+ return resp.data;
67
+ });
68
+ }
69
+ /**
70
+ * Creates a new Organization.
71
+ * @param name Name of the new Organization
72
+ * @param company (optional) Company name for the new Organization
73
+ * @returns The created Organization
74
+ */
75
+ createOrganization(name, company) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ const organization = { name: name, company: company };
78
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org`), organization);
79
+ return resp.data;
80
+ });
81
+ }
82
+ /**
83
+ * Retrieves an Organization by its name.
84
+ * @param orgName Name of the Organization
85
+ * @param options Defines query options to retrieve additional properties in the response
86
+ * @returns The requested Organization
87
+ */
88
+ getOrganization(orgName, options) {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}`), {
91
+ params: {
92
+ teamsOfUser: options === null || options === void 0 ? void 0 : options.getTeamsOfUser,
93
+ totalMemberCount: options === null || options === void 0 ? void 0 : options.getTotalMemberCount,
94
+ membersSample: options === null || options === void 0 ? void 0 : options.getMembersSample,
95
+ license: options === null || options === void 0 ? void 0 : options.getLicense,
96
+ },
97
+ });
98
+ return resp.data;
99
+ });
100
+ }
101
+ /**
102
+ * Deletes an Organization. This will also delete all dependencies that the Organization has (Teams, Spaces, apps, ...).
103
+ * @param orgName Name of the Organization to be deleted
104
+ */
105
+ deleteOrganization(orgName) {
106
+ return __awaiter(this, void 0, void 0, function* () {
107
+ yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}`));
108
+ });
109
+ }
110
+ getEndpoint(endpoint) {
111
+ return `${this.options.server}/api/account${endpoint}`;
112
+ }
113
+ }
114
+ exports.IdpOrganization = IdpOrganization;
@@ -0,0 +1,7 @@
1
+ import Base from "../../../../Base";
2
+ import { License } from "../../../../interfaces/idp/organization/license";
3
+ export declare class IdpOrganizationLicense extends Base {
4
+ getLicense(orgName: string): Promise<License>;
5
+ updateLicense(orgName: string, token: string): Promise<License>;
6
+ protected getEndpoint(endpoint: string): string;
7
+ }
@@ -0,0 +1,31 @@
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.IdpOrganizationLicense = void 0;
13
+ const Base_1 = require("../../../../Base");
14
+ class IdpOrganizationLicense extends Base_1.default {
15
+ getLicense(orgName) {
16
+ return __awaiter(this, void 0, void 0, function* () {
17
+ const res = yield this.axios.get(this.getEndpoint(`/org/${orgName}/license`));
18
+ return res.data;
19
+ });
20
+ }
21
+ updateLicense(orgName, token) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const res = yield this.axios.put(this.getEndpoint(`/org/${orgName}/license`), { identifier: token });
24
+ return res.data;
25
+ });
26
+ }
27
+ getEndpoint(endpoint) {
28
+ return `${this.options.server}/api/account/v1${endpoint}`;
29
+ }
30
+ }
31
+ exports.IdpOrganizationLicense = IdpOrganizationLicense;
@@ -0,0 +1,57 @@
1
+ import Base from "../../../../Base";
2
+ import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
3
+ import { OrganizationMember, OrgMemberPatch } from "../../../../interfaces/idp/organization/member";
4
+ import IdpOrganizationMemberInvitations from "./invitations";
5
+ export declare class IdpOrganizationMember extends Base {
6
+ get invitations(): IdpOrganizationMemberInvitations;
7
+ private _invitations?;
8
+ /**
9
+ * Retrieves all organization members that match the provided search filter(s). Will return all members of the organization if no search filter is provided.
10
+ * @param orgName Name of the Organization
11
+ * @param filters (optional) Array of search filters
12
+ * @param excludeTeamByName (optional) Name of a team whos members shall be excluded
13
+ * @param sorting (optional) Sorting object
14
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
15
+ * @param page (optional) Page number to skip the first (page * limit) results (defaults to 0)
16
+ * @returns Object containing an array of Organization Members and the total number of results found in the database (independent of limit and page)
17
+ */
18
+ searchOrganizationMembers({ orgName, filters, excludeTeamByName, sorting, limit, page, }: SearchParams & {
19
+ orgName: string;
20
+ excludeTeamByName?: string;
21
+ }): Promise<PaginatedResponse<OrganizationMember>>;
22
+ /**
23
+ * Retrieves an organization member by its user ID.
24
+ * @param orgName Name of the organization
25
+ * @param userId ID of the user
26
+ * @returns The requested Organization Member
27
+ */
28
+ getOrganizationMember(orgName: string, userId: string): Promise<OrganizationMember>;
29
+ /**
30
+ * Updates the role of a User in the specified Organization.
31
+ * @param orgName Name of the Organization
32
+ * @param userId ID of the User
33
+ * @param orgMemberPatch New role
34
+ * @returns The updated OrganizationMember
35
+ */
36
+ patchOrganizationMemberRole(orgName: string, userId: string, orgMemberPatch: OrgMemberPatch): Promise<OrganizationMember>;
37
+ /**
38
+ * Updates the executionTarget flag of a User in the specified Organization.
39
+ * @param orgName Name of the Organization
40
+ * @param userId ID of the User
41
+ * @param executionTarget Boolean value to set
42
+ * @returns The updated OrganizationMember
43
+ */
44
+ patchOrganizationExecutionTarget(orgName: string, userId: string, executionTarget: boolean): Promise<OrganizationMember>;
45
+ /**
46
+ * Removes a Member from an Organization.
47
+ * @param orgName Name of the Organization
48
+ * @param userId ID of the User
49
+ */
50
+ removeOrganizationMember(orgName: string, userId: string): Promise<void>;
51
+ /**
52
+ * Member leaves the organization independently.
53
+ * @param orgName Name of the Organization
54
+ */
55
+ leaveOrganization(orgName: string): Promise<void>;
56
+ protected getEndpoint(endpoint: string): string;
57
+ }
@@ -0,0 +1,110 @@
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.IdpOrganizationMember = void 0;
13
+ const Base_1 = require("../../../../Base");
14
+ const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
15
+ const searchFilter_1 = require("../../../../helper/searchFilter");
16
+ const invitations_1 = require("./invitations");
17
+ class IdpOrganizationMember extends Base_1.default {
18
+ get invitations() {
19
+ if (this._invitations === undefined) {
20
+ this._invitations = new invitations_1.default(this.options, this.axios);
21
+ }
22
+ return this._invitations;
23
+ }
24
+ /**
25
+ * Retrieves all organization members that match the provided search filter(s). Will return all members of the organization if no search filter is provided.
26
+ * @param orgName Name of the Organization
27
+ * @param filters (optional) Array of search filters
28
+ * @param excludeTeamByName (optional) Name of a team whos members shall be excluded
29
+ * @param sorting (optional) Sorting object
30
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
31
+ * @param page (optional) Page number to skip the first (page * limit) results (defaults to 0)
32
+ * @returns Object containing an array of Organization Members and the total number of results found in the database (independent of limit and page)
33
+ */
34
+ searchOrganizationMembers(_a) {
35
+ return __awaiter(this, arguments, void 0, function* ({ orgName, filters, excludeTeamByName, sorting, limit = 25, page = 0, }) {
36
+ const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
37
+ return new searchFilter_1.SearchFilterDTO(f);
38
+ });
39
+ const resp = yield this.axios.post(this.getEndpoint(`/${orgName}/members/search?limit=${limit}&page=${page}`), {
40
+ filters: filtersDTO,
41
+ sorting,
42
+ excludeTeamByName,
43
+ });
44
+ return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
45
+ });
46
+ }
47
+ /**
48
+ * Retrieves an organization member by its user ID.
49
+ * @param orgName Name of the organization
50
+ * @param userId ID of the user
51
+ * @returns The requested Organization Member
52
+ */
53
+ getOrganizationMember(orgName, userId) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ const resp = yield this.axios.get(this.getEndpoint(`/${orgName}/members/${userId}`));
56
+ return resp.data;
57
+ });
58
+ }
59
+ /**
60
+ * Updates the role of a User in the specified Organization.
61
+ * @param orgName Name of the Organization
62
+ * @param userId ID of the User
63
+ * @param orgMemberPatch New role
64
+ * @returns The updated OrganizationMember
65
+ */
66
+ patchOrganizationMemberRole(orgName, userId, orgMemberPatch) {
67
+ return __awaiter(this, void 0, void 0, function* () {
68
+ const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/members/${userId}/role`), orgMemberPatch);
69
+ return resp.data;
70
+ });
71
+ }
72
+ /**
73
+ * Updates the executionTarget flag of a User in the specified Organization.
74
+ * @param orgName Name of the Organization
75
+ * @param userId ID of the User
76
+ * @param executionTarget Boolean value to set
77
+ * @returns The updated OrganizationMember
78
+ */
79
+ patchOrganizationExecutionTarget(orgName, userId, executionTarget) {
80
+ return __awaiter(this, void 0, void 0, function* () {
81
+ const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/members/${userId}/executionTarget`), {
82
+ executionTarget,
83
+ });
84
+ return resp.data;
85
+ });
86
+ }
87
+ /**
88
+ * Removes a Member from an Organization.
89
+ * @param orgName Name of the Organization
90
+ * @param userId ID of the User
91
+ */
92
+ removeOrganizationMember(orgName, userId) {
93
+ return __awaiter(this, void 0, void 0, function* () {
94
+ yield this.axios.delete(this.getEndpoint(`/${orgName}/members/${userId}`));
95
+ });
96
+ }
97
+ /**
98
+ * Member leaves the organization independently.
99
+ * @param orgName Name of the Organization
100
+ */
101
+ leaveOrganization(orgName) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ yield this.axios.delete(this.getEndpoint(`/${orgName}/members`));
104
+ });
105
+ }
106
+ getEndpoint(endpoint) {
107
+ return `${this.options.server}/api/account/v1/org${endpoint}`;
108
+ }
109
+ }
110
+ exports.IdpOrganizationMember = IdpOrganizationMember;
@@ -0,0 +1,79 @@
1
+ import Base from "../../../../../Base";
2
+ import { PaginatedResponse, SearchFilter, Sorting } from "../../../../../interfaces/global";
3
+ import { OrganizationRole } from "../../../../../interfaces/idp";
4
+ import { OrganizationMemberInvitation } from "../../../../../interfaces/idp/organization/member/invitations";
5
+ export default class IdpOrganizationMemberInvitations extends Base {
6
+ /**
7
+ * Retrieves all invitations sent out by the organization that match the provided search filter(s). Returns all invitations if no search filter is provided.
8
+ * @param orgName Name of the organization
9
+ * @param filters (optional) Array of search filters
10
+ * @param sorting (optional) Sorting object
11
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
12
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
13
+ * @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
14
+ */
15
+ search(params: {
16
+ orgName: string;
17
+ filters: SearchFilter[];
18
+ sorting?: Sorting;
19
+ limit?: number;
20
+ page?: number;
21
+ }): Promise<PaginatedResponse<OrganizationMemberInvitation>>;
22
+ /**
23
+ * Invites a User to an Organization.
24
+ *
25
+ * @param orgName Name of the Organization
26
+ * @param email Email of the person to be invited
27
+ * @param role The role they will have within the organization if they accept the invitation
28
+ * @param allowNonRegisteredUsers Flag to determine if the invitation should go through in the case that the email is not bound to an Helmut Cloud user.
29
+ * If this is set to true and the email is unbound, then an email will be sent asking the person to register.
30
+ * When they do they will automatically join the organization.
31
+ * @param targetUrl Optional url the link in the mail will point to
32
+ * @returns The created invitation
33
+ */
34
+ create(orgName: string, email: string, role: OrganizationRole, allowNonRegisteredUsers?: boolean, targetUrl?: string): Promise<OrganizationMemberInvitation>;
35
+ /**
36
+ * Accept an invitation.
37
+ *
38
+ * Internally this calls respond.
39
+ *
40
+ * @param orgName Name of the Organization
41
+ * @param invitationId ID of the invitation
42
+ * @returns The patched invitation
43
+ */
44
+ accept: (orgName: string, invitationId: string) => Promise<OrganizationMemberInvitation>;
45
+ /**
46
+ * Reject an invitation.
47
+ *
48
+ * Internally this calls respond.
49
+ *
50
+ * @param orgName Name of the Organization
51
+ * @param invitationId ID of the invitation
52
+ * @returns The patched invitation
53
+ */
54
+ reject: (orgName: string, invitationId: string) => Promise<OrganizationMemberInvitation>;
55
+ /**
56
+ * Respond to an invitation.
57
+ *
58
+ * @param orgName Name of the Organization
59
+ * @param invitationId ID of the invitation
60
+ * @param accept Whether or not to accept the invitation
61
+ * @returns The patched invitation
62
+ */
63
+ respond: (orgName: string, invitationId: string, accept: boolean) => Promise<OrganizationMemberInvitation>;
64
+ /**
65
+ * Resends an invitation email.
66
+ *
67
+ * @param orgName Name of the Organization
68
+ * @param invitationId ID of the invitation
69
+ */
70
+ resendInvitationEmail: (orgName: string, invitationId: string) => Promise<void>;
71
+ /**
72
+ * Cancel/Delete an invitation.
73
+ *
74
+ * @param orgName Name of the Organization
75
+ * @param invitationId ID of the invitation
76
+ */
77
+ delete: (orgName: string, invitationId: string) => Promise<void>;
78
+ protected getEndpoint(endpoint: string): string;
79
+ }
@@ -0,0 +1,122 @@
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
+ const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
14
+ const searchFilter_1 = require("../../../../../helper/searchFilter");
15
+ class IdpOrganizationMemberInvitations extends Base_1.default {
16
+ constructor() {
17
+ super(...arguments);
18
+ /**
19
+ * Accept an invitation.
20
+ *
21
+ * Internally this calls respond.
22
+ *
23
+ * @param orgName Name of the Organization
24
+ * @param invitationId ID of the invitation
25
+ * @returns The patched invitation
26
+ */
27
+ this.accept = (orgName, invitationId) => __awaiter(this, void 0, void 0, function* () { return this.respond(orgName, invitationId, true); });
28
+ /**
29
+ * Reject an invitation.
30
+ *
31
+ * Internally this calls respond.
32
+ *
33
+ * @param orgName Name of the Organization
34
+ * @param invitationId ID of the invitation
35
+ * @returns The patched invitation
36
+ */
37
+ this.reject = (orgName, invitationId) => __awaiter(this, void 0, void 0, function* () { return this.respond(orgName, invitationId, false); });
38
+ /**
39
+ * Respond to an invitation.
40
+ *
41
+ * @param orgName Name of the Organization
42
+ * @param invitationId ID of the invitation
43
+ * @param accept Whether or not to accept the invitation
44
+ * @returns The patched invitation
45
+ */
46
+ this.respond = (orgName, invitationId, accept) => __awaiter(this, void 0, void 0, function* () {
47
+ const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/members/invitations/${invitationId}/approval`), {
48
+ accept,
49
+ });
50
+ return resp.data;
51
+ });
52
+ /**
53
+ * Resends an invitation email.
54
+ *
55
+ * @param orgName Name of the Organization
56
+ * @param invitationId ID of the invitation
57
+ */
58
+ this.resendInvitationEmail = (orgName, invitationId) => __awaiter(this, void 0, void 0, function* () {
59
+ yield this.axios.post(this.getEndpoint(`/${orgName}/members/invitations/${invitationId}/resend`));
60
+ });
61
+ /**
62
+ * Cancel/Delete an invitation.
63
+ *
64
+ * @param orgName Name of the Organization
65
+ * @param invitationId ID of the invitation
66
+ */
67
+ this.delete = (orgName, invitationId) => __awaiter(this, void 0, void 0, function* () {
68
+ yield this.axios.delete(this.getEndpoint(`/${orgName}/members/invitations/${invitationId}`));
69
+ });
70
+ }
71
+ /**
72
+ * Retrieves all invitations sent out by the organization that match the provided search filter(s). Returns all invitations if no search filter is provided.
73
+ * @param orgName Name of the organization
74
+ * @param filters (optional) Array of search filters
75
+ * @param sorting (optional) Sorting object
76
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
77
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
78
+ * @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
79
+ */
80
+ search(params) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ const limit = params.limit || 25;
83
+ const page = params.page || 0;
84
+ // convert SearchFilters to DTO
85
+ const filtersDTO = params.filters.map((f) => {
86
+ return new searchFilter_1.SearchFilterDTO(f);
87
+ });
88
+ const resp = yield this.axios.post(this.getEndpoint(`/${params.orgName}/members/invitations/search?limit=${limit}&page=${page}`), {
89
+ filters: filtersDTO,
90
+ sorting: params.sorting,
91
+ });
92
+ return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
93
+ });
94
+ }
95
+ /**
96
+ * Invites a User to an Organization.
97
+ *
98
+ * @param orgName Name of the Organization
99
+ * @param email Email of the person to be invited
100
+ * @param role The role they will have within the organization if they accept the invitation
101
+ * @param allowNonRegisteredUsers Flag to determine if the invitation should go through in the case that the email is not bound to an Helmut Cloud user.
102
+ * If this is set to true and the email is unbound, then an email will be sent asking the person to register.
103
+ * When they do they will automatically join the organization.
104
+ * @param targetUrl Optional url the link in the mail will point to
105
+ * @returns The created invitation
106
+ */
107
+ create(orgName_1, email_1, role_1) {
108
+ return __awaiter(this, arguments, void 0, function* (orgName, email, role, allowNonRegisteredUsers = false, targetUrl) {
109
+ const resp = yield this.axios.post(this.getEndpoint(`/${orgName}/members/invitations`), {
110
+ email,
111
+ role,
112
+ allowNonRegisteredUsers,
113
+ targetUrl,
114
+ });
115
+ return resp.data;
116
+ });
117
+ }
118
+ getEndpoint(endpoint) {
119
+ return `${this.options.server}/api/account/v1/org${endpoint}`;
120
+ }
121
+ }
122
+ exports.default = IdpOrganizationMemberInvitations;
@@ -0,0 +1,37 @@
1
+ import Base from "../../../../../Base";
2
+ import { Domain } from "../../../../../interfaces/idp/organization/settings/domain";
3
+ import { IdpSAMLProvider } from "./saml";
4
+ export declare class IdpDomain extends Base {
5
+ /**
6
+ * Handles everything around a SAML provider of a domain.
7
+ */
8
+ get samlProvider(): IdpSAMLProvider;
9
+ private _samlProvider?;
10
+ /**
11
+ * Retrieves all the Domains associated with a given Organization.
12
+ * @param orgName Name of Organization
13
+ * @returns Array of Domains
14
+ */
15
+ getDomains(orgName: string): Promise<Domain[]>;
16
+ /**
17
+ * Creates a new Domain for the given Organization
18
+ * @param orgName Name of the Organization
19
+ * @param domainName Name of the Domain
20
+ * @returns the created Domain
21
+ */
22
+ createDomain(orgName: string, domainName: string): Promise<Domain>;
23
+ /**
24
+ * Verifies the provided Domain.
25
+ * @param orgName Name of the organization
26
+ * @param domainName Name of the Domain
27
+ * @returns Domain object with domain.verified set to 'true' if verification was succesful.
28
+ */
29
+ verifyDomain(orgName: string, domainName: string): Promise<Domain>;
30
+ /**
31
+ * Deletes a domain.
32
+ * @param orgName Name of the organization
33
+ * @param domainName Name of the domain
34
+ */
35
+ deleteDomain(orgName: string, domainName: string): Promise<void>;
36
+ protected getEndpoint(endpoint: string): string;
37
+ }
@@ -0,0 +1,76 @@
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.IdpDomain = void 0;
13
+ const Base_1 = require("../../../../../Base");
14
+ const saml_1 = require("./saml");
15
+ class IdpDomain extends Base_1.default {
16
+ /**
17
+ * Handles everything around a SAML provider of a domain.
18
+ */
19
+ get samlProvider() {
20
+ if (this._samlProvider === undefined) {
21
+ this._samlProvider = new saml_1.IdpSAMLProvider(this.options, this.axios);
22
+ }
23
+ return this._samlProvider;
24
+ }
25
+ /**
26
+ * Retrieves all the Domains associated with a given Organization.
27
+ * @param orgName Name of Organization
28
+ * @returns Array of Domains
29
+ */
30
+ getDomains(orgName) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/settings/domains`));
33
+ return resp.data;
34
+ });
35
+ }
36
+ /**
37
+ * Creates a new Domain for the given Organization
38
+ * @param orgName Name of the Organization
39
+ * @param domainName Name of the Domain
40
+ * @returns the created Domain
41
+ */
42
+ createDomain(orgName, domainName) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/settings/domains`), {
45
+ name: domainName,
46
+ });
47
+ return resp.data;
48
+ });
49
+ }
50
+ /**
51
+ * Verifies the provided Domain.
52
+ * @param orgName Name of the organization
53
+ * @param domainName Name of the Domain
54
+ * @returns Domain object with domain.verified set to 'true' if verification was succesful.
55
+ */
56
+ verifyDomain(orgName, domainName) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/verify`));
59
+ return resp.data;
60
+ });
61
+ }
62
+ /**
63
+ * Deletes a domain.
64
+ * @param orgName Name of the organization
65
+ * @param domainName Name of the domain
66
+ */
67
+ deleteDomain(orgName, domainName) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}`));
70
+ });
71
+ }
72
+ getEndpoint(endpoint) {
73
+ return `${this.options.server}/api/account${endpoint}`;
74
+ }
75
+ }
76
+ exports.IdpDomain = IdpDomain;