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,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IdpSettings = void 0;
4
+ const Base_1 = require("../../../../Base");
5
+ const connections_1 = require("./connections");
6
+ const general_1 = require("./general");
7
+ const notifications_1 = require("./notifications");
8
+ const oauthApps_1 = require("./oauthApps");
9
+ const pats_1 = require("./pats");
10
+ const twoFactor_1 = require("./twoFactor");
11
+ class IdpSettings extends Base_1.default {
12
+ /**
13
+ * Handles everything around a user's pats (Personal Access Tokens)
14
+ */
15
+ get pat() {
16
+ if (this._pat === undefined) {
17
+ this._pat = new pats_1.IdpPat(this.options, this.axios);
18
+ }
19
+ return this._pat;
20
+ }
21
+ /**
22
+ * Handles everything around general user settings
23
+ */
24
+ get general() {
25
+ if (this._general === undefined) {
26
+ this._general = new general_1.IdpGeneral(this.options, this.axios);
27
+ }
28
+ return this._general;
29
+ }
30
+ /**
31
+ * Handles everything around notification settings of user
32
+ */
33
+ get notifications() {
34
+ if (this._notifications === undefined) {
35
+ this._notifications = new notifications_1.IdpNotifications(this.options, this.axios);
36
+ }
37
+ return this._notifications;
38
+ }
39
+ /**
40
+ * Manages user's OAuth applications
41
+ */
42
+ get oAuthApps() {
43
+ if (this._oAuthApps === undefined) {
44
+ this._oAuthApps = new oauthApps_1.IdpOAuthApps(this.options, this.axios);
45
+ }
46
+ return this._oAuthApps;
47
+ }
48
+ /**
49
+ * Handles everything around a user's two factor authentication
50
+ */
51
+ get twoFactor() {
52
+ if (this._twoFactor === undefined) {
53
+ this._twoFactor = new twoFactor_1.IdpTwoFactor(this.options, this.axios);
54
+ }
55
+ return this._twoFactor;
56
+ }
57
+ /**
58
+ * Handles everything around a user's two factor authentication
59
+ */
60
+ get connections() {
61
+ if (this._connections === undefined) {
62
+ this._connections = new connections_1.IdpConnections(this.options, this.axios);
63
+ }
64
+ return this._connections;
65
+ }
66
+ getEndpoint(endpoint) {
67
+ return `${this.options.server}/api/account${endpoint}`;
68
+ }
69
+ }
70
+ exports.IdpSettings = IdpSettings;
@@ -0,0 +1,16 @@
1
+ import Base from "../../../../../Base";
2
+ import { NotificationSettings, NotificationSettingsPatch } from "../../../../../interfaces/idp/user/NotificationSettings";
3
+ export declare class IdpNotifications extends Base {
4
+ /**
5
+ * Retrieves the notification settings of the requesting user.
6
+ * @returns general settings of requesting user
7
+ */
8
+ getNotificationSettingsOfUser(): Promise<NotificationSettings>;
9
+ /**
10
+ * Updates the notification settings of the requesting user.
11
+ * @param notificationSettingsPatch Object containing the new notification settings
12
+ * @returns the updated notification settings
13
+ */
14
+ patchNotificationSettings(notificationSettingsPatch: NotificationSettingsPatch): Promise<NotificationSettings>;
15
+ protected getEndpoint(endpoint: string): string;
16
+ }
@@ -0,0 +1,40 @@
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.IdpNotifications = void 0;
13
+ const Base_1 = require("../../../../../Base");
14
+ class IdpNotifications extends Base_1.default {
15
+ /**
16
+ * Retrieves the notification settings of the requesting user.
17
+ * @returns general settings of requesting user
18
+ */
19
+ getNotificationSettingsOfUser() {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/user/settings/notifications`));
22
+ return resp.data;
23
+ });
24
+ }
25
+ /**
26
+ * Updates the notification settings of the requesting user.
27
+ * @param notificationSettingsPatch Object containing the new notification settings
28
+ * @returns the updated notification settings
29
+ */
30
+ patchNotificationSettings(notificationSettingsPatch) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/notifications`), notificationSettingsPatch);
33
+ return resp.data;
34
+ });
35
+ }
36
+ getEndpoint(endpoint) {
37
+ return `${this.options.server}/api/account${endpoint}`;
38
+ }
39
+ }
40
+ exports.IdpNotifications = IdpNotifications;
@@ -0,0 +1,20 @@
1
+ import Base from "../../../../../Base";
2
+ import { PaginatedResponse, SearchParams } from "../../../../../interfaces/global";
3
+ import { OAuthAppWithConsent } from "../../../../../interfaces/idp/organization/settings/oauthApp";
4
+ export declare class IdpOAuthApps extends Base {
5
+ /**
6
+ * Retrieves all OAuth apps of the requesting User that match the provided search filter(s). Returns all OAuth apps if no search filter is provided.
7
+ * @param filters (optional) Array of search filters
8
+ * @param sorting (optional) Sorting object
9
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
10
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
11
+ * @returns Object containing an array of OAuth apps and the total number of results found in the database (independent of limit and page)
12
+ */
13
+ searchOAuthApps({ filters, sorting, limit, page }: SearchParams): Promise<PaginatedResponse<OAuthAppWithConsent>>;
14
+ /**
15
+ * Revokes user access from the provided OAuth app.
16
+ * @param oAuthAppId ID of the OAuth app
17
+ */
18
+ revokeOAuthAppAccess(oAuthAppId: string): Promise<void>;
19
+ protected getEndpoint(endpoint: string): string;
20
+ }
@@ -0,0 +1,55 @@
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.IdpOAuthApps = void 0;
13
+ const Base_1 = require("../../../../../Base");
14
+ const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
15
+ const searchFilter_1 = require("../../../../../helper/searchFilter");
16
+ class IdpOAuthApps extends Base_1.default {
17
+ /**
18
+ * Retrieves all OAuth apps of the requesting User that match the provided search filter(s). Returns all OAuth apps if no search filter is provided.
19
+ * @param filters (optional) Array of search filters
20
+ * @param sorting (optional) Sorting object
21
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
22
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
23
+ * @returns Object containing an array of OAuth apps and the total number of results found in the database (independent of limit and page)
24
+ */
25
+ searchOAuthApps(_a) {
26
+ return __awaiter(this, arguments, void 0, function* ({ filters, sorting, limit = 25, page = 0 }) {
27
+ const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
28
+ return new searchFilter_1.SearchFilterDTO(f);
29
+ });
30
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/user/settings/oauth/search`), {
31
+ filters: filtersDTO,
32
+ sorting: sorting,
33
+ }, {
34
+ params: {
35
+ limit,
36
+ page,
37
+ },
38
+ });
39
+ return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
40
+ });
41
+ }
42
+ /**
43
+ * Revokes user access from the provided OAuth app.
44
+ * @param oAuthAppId ID of the OAuth app
45
+ */
46
+ revokeOAuthAppAccess(oAuthAppId) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ yield this.axios.delete(this.getEndpoint(`/v1/user/settings/oauth/${oAuthAppId}/revoke`));
49
+ });
50
+ }
51
+ getEndpoint(endpoint) {
52
+ return `${this.options.server}/api/account${endpoint}`;
53
+ }
54
+ }
55
+ exports.IdpOAuthApps = IdpOAuthApps;
@@ -0,0 +1,48 @@
1
+ import Base from "../../../../../Base";
2
+ import { PaginatedResponse, SearchParams } from "../../../../../interfaces/global";
3
+ import { Pat, PatCreate, PatUpdate } from "../../../../../interfaces/idp/user/Pat";
4
+ export declare class IdpPat extends Base {
5
+ /**
6
+ * Search all personal access tokens (PATs) of the requesting user.
7
+ * @returns Paginated response of PAT objects
8
+ */
9
+ searchPats({ filters, sorting, limit, page }: SearchParams): Promise<PaginatedResponse<Pat>>;
10
+ /**
11
+ * Retrieves a single personal access token (PAT) by ID.
12
+ * @param patId ID of the PAT
13
+ * @returns The requested PAT object
14
+ */
15
+ getPat(patId: string): Promise<Pat>;
16
+ /**
17
+ * Regenerates a personal access token (PAT).
18
+ * @param patId ID of the PAT
19
+ * @returns PAT object holding the updated token
20
+ */
21
+ regeneratePat(patId: string, token?: string): Promise<Pat>;
22
+ /**
23
+ * Creates a new personal access token (PAT) for requesting user
24
+ * @param patCreate Object with informations needed to create a PAT: Name, expiration and scopes
25
+ * @returns the created PAT object
26
+ */
27
+ generatePat(patCreate: PatCreate): Promise<Pat>;
28
+ /**
29
+ * Updates an existing PAT object.
30
+ *
31
+ * Use an expiration value of -1 to remove the token's expiration date.
32
+ *
33
+ * @param patId ID of the pat object
34
+ * @param patUpdate Object containing new name, expiration and scopes
35
+ * @returns the updated PAT object
36
+ */
37
+ updatePat(patId: string, patUpdate: PatUpdate): Promise<Pat>;
38
+ /**
39
+ * Deletes a personal access token (PAT) of the requesting User.
40
+ * @param patId Id of the PAT
41
+ */
42
+ deletePat(patId: string): Promise<void>;
43
+ /**
44
+ * Deletes all personal access tokens (PATs) of the requesting User.
45
+ */
46
+ deleteAllPats(): Promise<void>;
47
+ protected getEndpoint(endpoint: string): string;
48
+ }
@@ -0,0 +1,104 @@
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.IdpPat = void 0;
13
+ const Base_1 = require("../../../../../Base");
14
+ const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
15
+ const searchFilter_1 = require("../../../../../helper/searchFilter");
16
+ class IdpPat extends Base_1.default {
17
+ /**
18
+ * Search all personal access tokens (PATs) of the requesting user.
19
+ * @returns Paginated response of PAT objects
20
+ */
21
+ searchPats(_a) {
22
+ return __awaiter(this, arguments, void 0, function* ({ filters, sorting, limit = 25, page = 0 }) {
23
+ const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
24
+ return new searchFilter_1.SearchFilterDTO(f);
25
+ });
26
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/user/settings/pats/search`), {
27
+ filters: filtersDTO,
28
+ sorting,
29
+ }, {
30
+ params: { limit, page },
31
+ });
32
+ return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
33
+ });
34
+ }
35
+ /**
36
+ * Retrieves a single personal access token (PAT) by ID.
37
+ * @param patId ID of the PAT
38
+ * @returns The requested PAT object
39
+ */
40
+ getPat(patId) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/user/settings/pats/${patId}`));
43
+ return resp.data;
44
+ });
45
+ }
46
+ /**
47
+ * Regenerates a personal access token (PAT).
48
+ * @param patId ID of the PAT
49
+ * @returns PAT object holding the updated token
50
+ */
51
+ regeneratePat(patId, token) {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/pats/${patId}/regenerate`), { token });
54
+ return resp.data;
55
+ });
56
+ }
57
+ /**
58
+ * Creates a new personal access token (PAT) for requesting user
59
+ * @param patCreate Object with informations needed to create a PAT: Name, expiration and scopes
60
+ * @returns the created PAT object
61
+ */
62
+ generatePat(patCreate) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/user/settings/pats`), patCreate);
65
+ return resp.data;
66
+ });
67
+ }
68
+ /**
69
+ * Updates an existing PAT object.
70
+ *
71
+ * Use an expiration value of -1 to remove the token's expiration date.
72
+ *
73
+ * @param patId ID of the pat object
74
+ * @param patUpdate Object containing new name, expiration and scopes
75
+ * @returns the updated PAT object
76
+ */
77
+ updatePat(patId, patUpdate) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/pats/${patId}`), patUpdate);
80
+ return resp.data;
81
+ });
82
+ }
83
+ /**
84
+ * Deletes a personal access token (PAT) of the requesting User.
85
+ * @param patId Id of the PAT
86
+ */
87
+ deletePat(patId) {
88
+ return __awaiter(this, void 0, void 0, function* () {
89
+ yield this.axios.delete(this.getEndpoint(`/v1/user/settings/pats/${patId}`));
90
+ });
91
+ }
92
+ /**
93
+ * Deletes all personal access tokens (PATs) of the requesting User.
94
+ */
95
+ deleteAllPats() {
96
+ return __awaiter(this, void 0, void 0, function* () {
97
+ yield this.axios.delete(this.getEndpoint(`/v1/user/settings/pats`));
98
+ });
99
+ }
100
+ getEndpoint(endpoint) {
101
+ return `${this.options.server}/api/account${endpoint}`;
102
+ }
103
+ }
104
+ exports.IdpPat = IdpPat;
@@ -0,0 +1,10 @@
1
+ import Base from "../../../../../Base";
2
+ import { IdpTotp } from "./totp";
3
+ export declare class IdpTwoFactor extends Base {
4
+ /**
5
+ * Handles everything around a user's pats (Personal Access Tokens)
6
+ */
7
+ get totp(): IdpTotp;
8
+ private _totp?;
9
+ protected getEndpoint(endpoint: string): string;
10
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IdpTwoFactor = void 0;
4
+ const Base_1 = require("../../../../../Base");
5
+ const totp_1 = require("./totp");
6
+ class IdpTwoFactor extends Base_1.default {
7
+ /**
8
+ * Handles everything around a user's pats (Personal Access Tokens)
9
+ */
10
+ get totp() {
11
+ if (this._totp === undefined) {
12
+ this._totp = new totp_1.IdpTotp(this.options, this.axios);
13
+ }
14
+ return this._totp;
15
+ }
16
+ getEndpoint(endpoint) {
17
+ return `${this.options.server}/api/account${endpoint}`;
18
+ }
19
+ }
20
+ exports.IdpTwoFactor = IdpTwoFactor;
@@ -0,0 +1,32 @@
1
+ import Base from "../../../../../../Base";
2
+ import { ActivatedTotp, DeactivatedTotp, UserTotp } from "../../../../../../interfaces/idp/user/Totp";
3
+ export declare class IdpTotp extends Base {
4
+ /**
5
+ * Creates a new TOTP for the requesting User.
6
+ * @returns A deactivated TOTP object containing a QR code and the OTPAuth URL
7
+ */
8
+ createTotp(): Promise<DeactivatedTotp>;
9
+ /**
10
+ * Activates a previously created TOTP.
11
+ * @returns Object containing a list of recover codes in case of TOTP authenticator loss
12
+ */
13
+ activateTotp(token: string): Promise<ActivatedTotp>;
14
+ /**
15
+ * Verifies a TOTP.
16
+ * @param userTotp TOTP to verify
17
+ */
18
+ verifyTotp(userTotp: UserTotp): Promise<void>;
19
+ /**
20
+ * Deactivates (deletes) a previously activated TOTP.
21
+ * @param token TOTP to deactivate
22
+ */
23
+ deactivateTotp(token: string): Promise<void>;
24
+ /**
25
+ * Deactivates (deletes) a previously activated TOTP by using a recovery code.
26
+ * @param email Email of the User
27
+ * @param password Password
28
+ * @param code Recovery code
29
+ */
30
+ deactivateTotpByRecoverCode(email: string, password: string, code: string): Promise<void>;
31
+ protected getEndpoint(endpoint: string): string;
32
+ }
@@ -0,0 +1,72 @@
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.IdpTotp = void 0;
13
+ const Base_1 = require("../../../../../../Base");
14
+ class IdpTotp extends Base_1.default {
15
+ /**
16
+ * Creates a new TOTP for the requesting User.
17
+ * @returns A deactivated TOTP object containing a QR code and the OTPAuth URL
18
+ */
19
+ createTotp() {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/user/settings/security/2fa/totp`));
22
+ return resp.data;
23
+ });
24
+ }
25
+ /**
26
+ * Activates a previously created TOTP.
27
+ * @returns Object containing a list of recover codes in case of TOTP authenticator loss
28
+ */
29
+ activateTotp(token) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/security/2fa/totp/activate`), { token });
32
+ return resp.data;
33
+ });
34
+ }
35
+ /**
36
+ * Verifies a TOTP.
37
+ * @param userTotp TOTP to verify
38
+ */
39
+ verifyTotp(userTotp) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ yield this.axios.patch(this.getEndpoint(`/v1/login/verify/totp`), {
42
+ userTotp,
43
+ });
44
+ });
45
+ }
46
+ /**
47
+ * Deactivates (deletes) a previously activated TOTP.
48
+ * @param token TOTP to deactivate
49
+ */
50
+ deactivateTotp(token) {
51
+ return __awaiter(this, void 0, void 0, function* () {
52
+ yield this.axios.delete(this.getEndpoint(`/v1/user/settings/security/2fa/totp`), { data: { token } });
53
+ });
54
+ }
55
+ /**
56
+ * Deactivates (deletes) a previously activated TOTP by using a recovery code.
57
+ * @param email Email of the User
58
+ * @param password Password
59
+ * @param code Recovery code
60
+ */
61
+ deactivateTotpByRecoverCode(email, password, code) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ yield this.axios.delete(this.getEndpoint(`/v1/user/recover/totp`), {
64
+ data: { email, password, code },
65
+ });
66
+ });
67
+ }
68
+ getEndpoint(endpoint) {
69
+ return `${this.options.server}/api/account${endpoint}`;
70
+ }
71
+ }
72
+ exports.IdpTotp = IdpTotp;
@@ -0,0 +1,13 @@
1
+ import Base from "../../Base";
2
+ import { Version } from "../../interfaces/global";
3
+ import MailerInternal from "./internal";
4
+ export default class Mailer extends Base {
5
+ get internal(): MailerInternal;
6
+ private _internal?;
7
+ /**
8
+ * Requests the endpoint version
9
+ * @returns Version object
10
+ */
11
+ version(): Promise<Version>;
12
+ protected getEndpoint(endpoint: string): string;
13
+ }
@@ -9,26 +9,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const base_1 = require("../base");
13
- const axios_1 = require("axios");
14
- const MailerInternal_1 = require("./MailerInternal");
15
- class Mailer extends base_1.default {
16
- constructor(opts) {
17
- super(opts);
18
- /**
19
- * Version requests the endpoint version
20
- * @returns Version object
21
- */
22
- this.version = () => __awaiter(this, void 0, void 0, function* () {
23
- const resp = yield axios_1.default.get(this.getEndpoint("/v1/version"), {}).catch((err) => {
24
- throw err;
25
- });
12
+ const Base_1 = require("../../Base");
13
+ const internal_1 = require("./internal");
14
+ class Mailer extends Base_1.default {
15
+ get internal() {
16
+ if (this._internal === undefined) {
17
+ this._internal = new internal_1.default(this.options, this.axios);
18
+ }
19
+ return this._internal;
20
+ }
21
+ /**
22
+ * Requests the endpoint version
23
+ * @returns Version object
24
+ */
25
+ version() {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ const resp = yield this.axios.get(this.getEndpoint("/v1/version"), {});
26
28
  return resp.data;
27
29
  });
28
- this.interal = new MailerInternal_1.default(opts);
29
30
  }
30
31
  getEndpoint(endpoint) {
31
- return `${this.opts.api}/api/mailer${endpoint}`;
32
+ return `${this.options.server}/api/mailer${endpoint}`;
32
33
  }
33
34
  }
34
35
  exports.default = Mailer;
@@ -0,0 +1,36 @@
1
+ import Base from "../../../Base";
2
+ import { HtmlMail, MailjetMailDTO, MustacheMail, TemplateMail } from "../../../interfaces/mailer";
3
+ export default class MailerInternal extends Base {
4
+ /**
5
+ * Sends a new mail based on a mailjet template.
6
+ *
7
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
8
+ * @param mail MailjetMailDTO
9
+ */
10
+ sendMailMailjet(mail: MailjetMailDTO): Promise<void>;
11
+ /**
12
+ * Sends a new mail based on a mustache html body.
13
+ *
14
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
15
+ * @param mail TemplateMail
16
+ * @deprecated in favor of sendMailMailjet
17
+ */
18
+ sendMailMustache(mail: MustacheMail): Promise<void>;
19
+ /**
20
+ * Sends a new mail based on a html body.
21
+ *
22
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
23
+ * @param mail TemplateMail
24
+ * @deprecated in favor of sendMailMailjet
25
+ */
26
+ sendMailHtml(mail: HtmlMail): Promise<void>;
27
+ /**
28
+ * Sends a new mail based on an existing template.
29
+ *
30
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
31
+ * @param mail TemplateMail
32
+ * @deprecated in favor of sendMailMailjet
33
+ */
34
+ sendMailTemplate(mail: TemplateMail): Promise<void>;
35
+ protected getEndpoint(endpoint: string): string;
36
+ }
@@ -0,0 +1,69 @@
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 MailerInternal extends Base_1.default {
14
+ /**
15
+ * Sends a new mail based on a mailjet template.
16
+ *
17
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
18
+ * @param mail MailjetMailDTO
19
+ */
20
+ sendMailMailjet(mail) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ const resp = yield this.axios.post(this.getEndpoint("/v1/send/mailjet"), mail);
23
+ return resp.data;
24
+ });
25
+ }
26
+ /**
27
+ * Sends a new mail based on a mustache html body.
28
+ *
29
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
30
+ * @param mail TemplateMail
31
+ * @deprecated in favor of sendMailMailjet
32
+ */
33
+ sendMailMustache(mail) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ const resp = yield this.axios.post(this.getEndpoint("/v1/send/mustache"), mail);
36
+ return resp.data;
37
+ });
38
+ }
39
+ /**
40
+ * Sends a new mail based on a html body.
41
+ *
42
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
43
+ * @param mail TemplateMail
44
+ * @deprecated in favor of sendMailMailjet
45
+ */
46
+ sendMailHtml(mail) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ const resp = yield this.axios.post(this.getEndpoint("/v1/send/html"), mail);
49
+ return resp.data;
50
+ });
51
+ }
52
+ /**
53
+ * Sends a new mail based on an existing template.
54
+ *
55
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
56
+ * @param mail TemplateMail
57
+ * @deprecated in favor of sendMailMailjet
58
+ */
59
+ sendMailTemplate(mail) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ const resp = yield this.axios.post(this.getEndpoint("/v1/send/template"), mail);
62
+ return resp.data;
63
+ });
64
+ }
65
+ getEndpoint(endpoint) {
66
+ return `${this.options.server}/api/mailer/internal${endpoint}`;
67
+ }
68
+ }
69
+ exports.default = MailerInternal;