hcloud-sdk 17.0.0 → 19.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 (321) hide show
  1. package/changelog.md +87 -76
  2. package/lib/Base.d.ts +2 -1
  3. package/lib/Hcloud.d.ts +24 -6
  4. package/lib/Hcloud.js +127 -24
  5. package/lib/helper/ErrorHelper.js +5 -2
  6. package/lib/helper/ValidationHelper.d.ts +14 -4
  7. package/lib/helper/ValidationHelper.js +71 -11
  8. package/lib/interfaces/agent/logging/cloudwatch.d.ts +23 -0
  9. package/lib/interfaces/agent/logging/index.d.ts +2 -0
  10. package/lib/interfaces/{friday → agent/logging}/index.js +2 -3
  11. package/lib/interfaces/agent/logging/log-collector.d.ts +35 -0
  12. package/lib/interfaces/agent/module/index.d.ts +7 -0
  13. package/lib/interfaces/agent/module/index.js +2 -0
  14. package/lib/interfaces/auditor/index.d.ts +13 -3
  15. package/lib/interfaces/auditor/index.js +9 -2
  16. package/lib/interfaces/axios/index.d.ts +5 -0
  17. package/lib/interfaces/cosmo/asset/index.d.ts +216 -0
  18. package/lib/interfaces/cosmo/asset/index.js +90 -0
  19. package/lib/interfaces/cosmo/comment/index.d.ts +41 -0
  20. package/lib/interfaces/cosmo/comment/index.js +8 -0
  21. package/lib/interfaces/cosmo/event/index.d.ts +60 -0
  22. package/lib/interfaces/cosmo/event/index.js +31 -0
  23. package/lib/interfaces/cosmo/location/index.d.ts +4 -0
  24. package/lib/interfaces/cosmo/location/index.js +2 -0
  25. package/lib/interfaces/cosmo/namespace/index.d.ts +9 -0
  26. package/lib/interfaces/cosmo/namespace/index.js +9 -0
  27. package/lib/interfaces/cosmo/permissions.d.ts +96 -0
  28. package/lib/interfaces/cosmo/permissions.js +58 -0
  29. package/lib/interfaces/cosmo/share/index.d.ts +110 -0
  30. package/lib/interfaces/cosmo/share/index.js +23 -0
  31. package/lib/interfaces/cosmo/space/index.d.ts +31 -0
  32. package/lib/interfaces/cosmo/space/index.js +2 -0
  33. package/lib/interfaces/cosmo/stats/index.d.ts +11 -0
  34. package/lib/interfaces/cosmo/stats/index.js +2 -0
  35. package/lib/interfaces/cosmo/tag/tag.d.ts +13 -0
  36. package/lib/interfaces/cosmo/tag/tag.js +2 -0
  37. package/lib/interfaces/global/Products.d.ts +2 -3
  38. package/lib/interfaces/global/Products.js +1 -2
  39. package/lib/interfaces/global/Views.d.ts +0 -1
  40. package/lib/interfaces/global/Views.js +0 -1
  41. package/lib/interfaces/high5/index.d.ts +7 -7
  42. package/lib/interfaces/high5/index.js +7 -7
  43. package/lib/interfaces/{friday → high5}/space/database/document/index.d.ts +1 -1
  44. package/lib/interfaces/{friday → high5}/space/database/document/index.js +2 -1
  45. package/lib/interfaces/high5/space/database/index.js +2 -0
  46. package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +10 -2
  47. package/lib/interfaces/high5/space/event/stream/node/index.d.ts +1 -0
  48. package/lib/interfaces/high5/space/execution/index.d.ts +3 -1
  49. package/lib/interfaces/{fuse/space/cronjob/CronjobLog.d.ts → high5/space/job/JobLog.d.ts} +3 -3
  50. package/lib/interfaces/high5/space/job/JobLog.js +2 -0
  51. package/lib/interfaces/high5/space/job/index.d.ts +83 -0
  52. package/lib/interfaces/high5/space/job/index.js +11 -0
  53. package/lib/interfaces/high5/stats.d.ts +21 -0
  54. package/lib/interfaces/high5/stats.js +2 -0
  55. package/lib/interfaces/high5/wave/dependentInputs.d.ts +42 -0
  56. package/lib/interfaces/high5/wave/dependentInputs.js +144 -0
  57. package/lib/interfaces/high5/wave/dependentInputsValidation.d.ts +22 -0
  58. package/lib/interfaces/high5/wave/dependentInputsValidation.js +220 -0
  59. package/lib/interfaces/idp/index.d.ts +3 -3
  60. package/lib/interfaces/idp/index.js +3 -3
  61. package/lib/interfaces/idp/oauth/device.d.ts +18 -0
  62. package/lib/interfaces/idp/oauth/device.js +2 -0
  63. package/lib/interfaces/idp/oauth/index.d.ts +19 -5
  64. package/lib/interfaces/idp/organization/index.d.ts +2 -0
  65. package/lib/interfaces/idp/organization/index.js +2 -0
  66. package/lib/interfaces/idp/organization/license/index.d.ts +13 -11
  67. package/lib/interfaces/idp/organization/member/index.d.ts +1 -0
  68. package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +4 -0
  69. package/lib/interfaces/idp/organization/stats.d.ts +7 -0
  70. package/lib/interfaces/idp/organization/stats.js +2 -0
  71. package/lib/interfaces/idp/organization/team/index.d.ts +0 -1
  72. package/lib/interfaces/idp/user/Message.d.ts +22 -0
  73. package/lib/interfaces/idp/user/Message.js +14 -0
  74. package/lib/interfaces/idp/user/NotificationSettings.d.ts +1 -0
  75. package/lib/interfaces/idp/user/Scopes.d.ts +1 -15
  76. package/lib/interfaces/idp/user/Scopes.js +0 -21
  77. package/lib/interfaces/idp/user/index.d.ts +5 -1
  78. package/lib/interfaces/mailer/index.d.ts +50 -2
  79. package/lib/interfaces/mailer/index.js +100 -2
  80. package/lib/interfaces/mothership/index.d.ts +3 -1
  81. package/lib/interfaces/mothership/index.js +15 -0
  82. package/lib/interfaces/mothership/stats.d.ts +4 -0
  83. package/lib/interfaces/mothership/stats.js +2 -0
  84. package/lib/interfaces/nats/index.d.ts +79 -51
  85. package/lib/interfaces/nats/index.js +140 -125
  86. package/lib/interfaces/shorts/index.d.ts +17 -0
  87. package/lib/interfaces/shorts/index.js +8 -0
  88. package/lib/service/agent/bundle/dev/index.d.ts +16 -6
  89. package/lib/service/agent/bundle/dev/index.js +16 -11
  90. package/lib/service/agent/bundle/index.d.ts +10 -4
  91. package/lib/service/agent/bundle/index.js +10 -7
  92. package/lib/service/agent/context/index.d.ts +22 -8
  93. package/lib/service/agent/context/index.js +19 -15
  94. package/lib/service/agent/index.d.ts +6 -0
  95. package/lib/service/agent/index.js +18 -1
  96. package/lib/service/agent/installer/index.js +4 -1
  97. package/lib/service/agent/logging/index.d.ts +69 -0
  98. package/lib/service/agent/logging/index.js +117 -0
  99. package/lib/service/agent/module/index.d.ts +36 -0
  100. package/lib/service/agent/module/index.js +65 -0
  101. package/lib/service/auditor/index.d.ts +8 -4
  102. package/lib/service/auditor/index.js +9 -6
  103. package/lib/service/auditor/internal/index.d.ts +27 -3
  104. package/lib/service/auditor/internal/index.js +38 -6
  105. package/lib/service/bouncer/features/index.d.ts +4 -2
  106. package/lib/service/bouncer/features/index.js +6 -3
  107. package/lib/service/bouncer/index.js +5 -2
  108. package/lib/service/cosmo/asset/index.d.ts +265 -0
  109. package/lib/service/cosmo/asset/index.js +420 -0
  110. package/lib/service/cosmo/comment/index.d.ts +93 -0
  111. package/lib/service/cosmo/comment/index.js +136 -0
  112. package/lib/service/cosmo/event/index.d.ts +23 -0
  113. package/lib/service/cosmo/event/index.js +43 -0
  114. package/lib/service/cosmo/folder/index.d.ts +27 -0
  115. package/lib/service/cosmo/folder/index.js +50 -0
  116. package/lib/service/cosmo/index.d.ts +52 -0
  117. package/lib/service/cosmo/index.js +129 -0
  118. package/lib/service/cosmo/internal/index.d.ts +7 -0
  119. package/lib/service/cosmo/internal/index.js +20 -0
  120. package/lib/service/cosmo/internal/space/index.d.ts +15 -0
  121. package/lib/service/cosmo/internal/space/index.js +37 -0
  122. package/lib/service/cosmo/location/index.d.ts +40 -0
  123. package/lib/service/cosmo/location/index.js +66 -0
  124. package/lib/service/cosmo/namespace/index.d.ts +56 -0
  125. package/lib/service/cosmo/namespace/index.js +85 -0
  126. package/lib/service/cosmo/organization/index.d.ts +47 -0
  127. package/lib/service/cosmo/organization/index.js +67 -0
  128. package/lib/service/cosmo/permissions/index.d.ts +131 -0
  129. package/lib/service/cosmo/permissions/index.js +184 -0
  130. package/lib/service/cosmo/production/index.d.ts +26 -0
  131. package/lib/service/cosmo/production/index.js +48 -0
  132. package/lib/service/cosmo/share/index.d.ts +169 -0
  133. package/lib/service/cosmo/share/index.js +227 -0
  134. package/lib/service/cosmo/space/index.d.ts +131 -0
  135. package/lib/service/cosmo/space/index.js +190 -0
  136. package/lib/service/cosmo/stats/index.d.ts +35 -0
  137. package/lib/service/cosmo/stats/index.js +58 -0
  138. package/lib/service/cosmo/tag/index.d.ts +67 -0
  139. package/lib/service/cosmo/tag/index.js +96 -0
  140. package/lib/service/dali/DaliAvatar.d.ts +0 -6
  141. package/lib/service/dali/DaliAvatar.js +4 -11
  142. package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +10 -4
  143. package/lib/service/dali/avatar/DaliCosmoSpace.js +12 -8
  144. package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +11 -4
  145. package/lib/service/dali/avatar/DaliHigh5Pool.js +12 -8
  146. package/lib/service/dali/avatar/DaliHigh5Space.d.ts +11 -4
  147. package/lib/service/dali/avatar/DaliHigh5Space.js +12 -8
  148. package/lib/service/dali/avatar/DaliOAuthApp.d.ts +11 -4
  149. package/lib/service/dali/avatar/DaliOAuthApp.js +12 -8
  150. package/lib/service/dali/avatar/DaliOrganization.d.ts +11 -4
  151. package/lib/service/dali/avatar/DaliOrganization.js +12 -8
  152. package/lib/service/dali/avatar/DaliServiceAccount.d.ts +10 -4
  153. package/lib/service/dali/avatar/DaliServiceAccount.js +12 -8
  154. package/lib/service/dali/avatar/DaliTeam.d.ts +11 -4
  155. package/lib/service/dali/avatar/DaliTeam.js +12 -8
  156. package/lib/service/dali/avatar/DaliUser.d.ts +11 -4
  157. package/lib/service/dali/avatar/DaliUser.js +12 -8
  158. package/lib/service/dali/index.d.ts +4 -5
  159. package/lib/service/dali/index.js +6 -6
  160. package/lib/service/high5/execution/index.d.ts +4 -2
  161. package/lib/service/high5/execution/index.js +7 -3
  162. package/lib/service/high5/execution/log/index.js +4 -1
  163. package/lib/service/high5/execution/status/index.d.ts +5 -3
  164. package/lib/service/high5/execution/status/index.js +7 -4
  165. package/lib/service/high5/index.d.ts +7 -2
  166. package/lib/service/high5/index.js +13 -3
  167. package/lib/service/high5/internal/index.d.ts +4 -2
  168. package/lib/service/high5/internal/index.js +7 -3
  169. package/lib/service/high5/internal/space/index.d.ts +10 -3
  170. package/lib/service/high5/internal/space/index.js +17 -5
  171. package/lib/service/high5/internal/space/job/index.d.ts +7 -0
  172. package/lib/service/high5/internal/space/job/index.js +20 -0
  173. package/lib/service/high5/internal/space/job/log/index.d.ts +17 -0
  174. package/lib/service/{fuse/internal/space/cronjob → high5/internal/space/job}/log/index.js +13 -10
  175. package/lib/service/high5/joinToken/index.d.ts +14 -6
  176. package/lib/service/high5/joinToken/index.js +14 -10
  177. package/lib/service/high5/space/database/document/array/index.d.ts +73 -0
  178. package/lib/service/high5/space/database/document/array/index.js +105 -0
  179. package/lib/service/{friday → high5}/space/database/document/index.d.ts +26 -10
  180. package/lib/service/{friday → high5}/space/database/document/index.js +35 -17
  181. package/lib/service/high5/space/database/document/number/index.d.ts +51 -0
  182. package/lib/service/high5/space/database/document/number/index.js +80 -0
  183. package/lib/service/{friday → high5}/space/database/index.d.ts +22 -12
  184. package/lib/service/{friday → high5}/space/database/index.js +22 -18
  185. package/lib/service/high5/space/event/index.d.ts +17 -7
  186. package/lib/service/high5/space/event/index.js +16 -12
  187. package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +4 -2
  188. package/lib/service/high5/space/event/stream/design/DesignOperations.js +6 -3
  189. package/lib/service/high5/space/event/stream/design/index.d.ts +10 -4
  190. package/lib/service/high5/space/event/stream/design/index.js +13 -9
  191. package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +16 -6
  192. package/lib/service/high5/space/event/stream/design/snapshot/index.js +16 -11
  193. package/lib/service/high5/space/event/stream/index.d.ts +32 -12
  194. package/lib/service/high5/space/event/stream/index.js +26 -22
  195. package/lib/service/high5/space/execution/index.d.ts +19 -7
  196. package/lib/service/high5/space/execution/index.js +21 -13
  197. package/lib/service/high5/space/execution/log/index.d.ts +8 -4
  198. package/lib/service/high5/space/execution/log/index.js +9 -6
  199. package/lib/service/high5/space/execution/status/index.d.ts +7 -3
  200. package/lib/service/high5/space/execution/status/index.js +8 -5
  201. package/lib/service/high5/space/index.d.ts +53 -14
  202. package/lib/service/high5/space/index.js +70 -28
  203. package/lib/service/{fuse/space/cronjob → high5/space/job}/index.d.ts +57 -35
  204. package/lib/service/{fuse/space/cronjob → high5/space/job}/index.js +88 -87
  205. package/lib/service/{fuse/space/cronjob → high5/space/job}/log/index.d.ts +15 -11
  206. package/lib/service/{fuse/space/cronjob → high5/space/job}/log/index.js +19 -16
  207. package/lib/service/high5/space/node/index.d.ts +20 -8
  208. package/lib/service/high5/space/node/index.js +18 -14
  209. package/lib/service/high5/space/pool/index.d.ts +38 -11
  210. package/lib/service/high5/space/pool/index.js +41 -19
  211. package/lib/service/high5/space/secret/index.d.ts +17 -7
  212. package/lib/service/high5/space/secret/index.js +16 -12
  213. package/lib/service/high5/space/stat/index.d.ts +12 -0
  214. package/lib/service/high5/space/stat/index.js +34 -0
  215. package/lib/service/high5/space/wave/index.d.ts +16 -6
  216. package/lib/service/high5/space/wave/index.js +15 -11
  217. package/lib/service/high5/space/webhook/index.d.ts +32 -12
  218. package/lib/service/high5/space/webhook/index.js +29 -22
  219. package/lib/service/high5/space/webhook/log/index.d.ts +4 -2
  220. package/lib/service/high5/space/webhook/log/index.js +6 -3
  221. package/lib/service/high5/stat/index.d.ts +11 -0
  222. package/lib/service/{fuse/internal → high5/stat}/index.js +16 -14
  223. package/lib/service/high5/wave/index.js +4 -1
  224. package/lib/service/high5/wave/s3/index.d.ts +31 -8
  225. package/lib/service/high5/wave/s3/index.js +47 -23
  226. package/lib/service/idp/guest/index.d.ts +42 -0
  227. package/lib/service/idp/guest/index.js +69 -0
  228. package/lib/service/idp/index.d.ts +25 -7
  229. package/lib/service/idp/index.js +27 -13
  230. package/lib/service/idp/internal/index.d.ts +5 -3
  231. package/lib/service/idp/internal/index.js +9 -4
  232. package/lib/service/idp/oauth/device.d.ts +131 -0
  233. package/lib/service/idp/oauth/device.js +177 -0
  234. package/lib/service/idp/oauth/index.d.ts +19 -6
  235. package/lib/service/idp/oauth/index.js +26 -16
  236. package/lib/service/idp/organization/index.d.ts +28 -5
  237. package/lib/service/idp/organization/index.js +41 -11
  238. package/lib/service/idp/organization/license/index.d.ts +7 -3
  239. package/lib/service/idp/organization/license/index.js +8 -5
  240. package/lib/service/idp/organization/member/index.d.ts +20 -8
  241. package/lib/service/idp/organization/member/index.js +20 -15
  242. package/lib/service/idp/organization/member/invitations/index.d.ts +42 -9
  243. package/lib/service/idp/organization/member/invitations/index.js +94 -59
  244. package/lib/service/idp/organization/service-accounts/index.d.ts +31 -9
  245. package/lib/service/idp/organization/service-accounts/index.js +35 -14
  246. package/lib/service/idp/organization/settings/domain/index.d.ts +13 -5
  247. package/lib/service/idp/organization/settings/domain/index.js +13 -9
  248. package/lib/service/idp/organization/settings/domain/saml/index.d.ts +16 -6
  249. package/lib/service/idp/organization/settings/domain/saml/index.js +23 -19
  250. package/lib/service/idp/organization/settings/index.js +4 -1
  251. package/lib/service/idp/organization/settings/oauth/index.d.ts +33 -9
  252. package/lib/service/idp/organization/settings/oauth/index.js +37 -16
  253. package/lib/service/idp/organization/stat/index.d.ts +11 -0
  254. package/lib/service/idp/organization/stat/index.js +33 -0
  255. package/lib/service/idp/organization/team/index.d.ts +32 -10
  256. package/lib/service/idp/organization/team/index.js +35 -14
  257. package/lib/service/idp/registration/index.d.ts +10 -4
  258. package/lib/service/idp/registration/index.js +19 -10
  259. package/lib/service/idp/user/index.d.ts +41 -11
  260. package/lib/service/idp/user/index.js +49 -19
  261. package/lib/service/idp/user/license/index.d.ts +7 -3
  262. package/lib/service/idp/user/license/index.js +8 -5
  263. package/lib/service/idp/user/message/index.d.ts +62 -0
  264. package/lib/service/idp/user/message/index.js +95 -0
  265. package/lib/service/idp/user/password/index.d.ts +4 -2
  266. package/lib/service/idp/user/password/index.js +6 -3
  267. package/lib/service/idp/user/settings/connections/index.d.ts +4 -2
  268. package/lib/service/idp/user/settings/connections/index.js +6 -3
  269. package/lib/service/idp/user/settings/general/index.d.ts +10 -4
  270. package/lib/service/idp/user/settings/general/index.js +10 -7
  271. package/lib/service/idp/user/settings/index.js +4 -1
  272. package/lib/service/idp/user/settings/notifications/index.d.ts +7 -3
  273. package/lib/service/idp/user/settings/notifications/index.js +8 -5
  274. package/lib/service/idp/user/settings/oauthApps/index.d.ts +7 -3
  275. package/lib/service/idp/user/settings/oauthApps/index.js +10 -6
  276. package/lib/service/idp/user/settings/pats/index.d.ts +22 -8
  277. package/lib/service/idp/user/settings/pats/index.js +21 -16
  278. package/lib/service/idp/user/settings/twoFactor/index.js +4 -1
  279. package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +16 -6
  280. package/lib/service/idp/user/settings/twoFactor/totp/index.js +17 -11
  281. package/lib/service/mailer/index.d.ts +4 -2
  282. package/lib/service/mailer/index.js +7 -4
  283. package/lib/service/mailer/internal/index.d.ts +14 -6
  284. package/lib/service/mailer/internal/index.js +12 -9
  285. package/lib/service/mothership/index.d.ts +35 -13
  286. package/lib/service/mothership/index.js +36 -18
  287. package/lib/service/nats/index.d.ts +7 -0
  288. package/lib/service/nats/index.js +77 -44
  289. package/lib/service/shorts/index.d.ts +18 -0
  290. package/lib/service/{friday → shorts}/index.js +17 -11
  291. package/lib/service/shorts/internal/index.d.ts +75 -0
  292. package/lib/service/shorts/internal/index.js +118 -0
  293. package/lib/utils/bouncer/features/Provider.js +0 -1
  294. package/package.json +2 -2
  295. package/lib/interfaces/friday/index.d.ts +0 -3
  296. package/lib/interfaces/friday/space/index.d.ts +0 -21
  297. package/lib/interfaces/friday/space/index.js +0 -11
  298. package/lib/interfaces/fuse/index.d.ts +0 -3
  299. package/lib/interfaces/fuse/index.js +0 -19
  300. package/lib/interfaces/fuse/space/cronjob/Cronjob.d.ts +0 -38
  301. package/lib/interfaces/fuse/space/cronjob/Cronjob.js +0 -8
  302. package/lib/interfaces/fuse/space/index.d.ts +0 -22
  303. package/lib/interfaces/fuse/space/index.js +0 -11
  304. package/lib/service/dali/avatar/DaliFuseSpace.d.ts +0 -26
  305. package/lib/service/dali/avatar/DaliFuseSpace.js +0 -58
  306. package/lib/service/friday/index.d.ts +0 -13
  307. package/lib/service/friday/space/index.d.ts +0 -81
  308. package/lib/service/friday/space/index.js +0 -150
  309. package/lib/service/fuse/index.d.ts +0 -18
  310. package/lib/service/fuse/index.js +0 -48
  311. package/lib/service/fuse/internal/index.d.ts +0 -8
  312. package/lib/service/fuse/internal/space/cronjob/index.d.ts +0 -7
  313. package/lib/service/fuse/internal/space/cronjob/index.js +0 -17
  314. package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +0 -15
  315. package/lib/service/fuse/internal/space/index.d.ts +0 -22
  316. package/lib/service/fuse/internal/space/index.js +0 -49
  317. package/lib/service/fuse/space/index.d.ts +0 -81
  318. package/lib/service/fuse/space/index.js +0 -152
  319. /package/lib/interfaces/{friday/space/database/index.js → agent/logging/cloudwatch.js} +0 -0
  320. /package/lib/interfaces/{fuse/space/cronjob/CronjobLog.js → agent/logging/log-collector.js} +0 -0
  321. /package/lib/interfaces/{friday → high5}/space/database/index.d.ts +0 -0
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.IdpOrganizationTeams = void 0;
13
- const Base_1 = require("../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../Base"));
14
17
  const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
15
18
  const searchFilter_1 = require("../../../../helper/searchFilter");
16
19
  class IdpOrganizationTeams extends Base_1.default {
@@ -21,10 +24,10 @@ class IdpOrganizationTeams extends Base_1.default {
21
24
  * @param userIds List of User IDs to be added to the Team
22
25
  * @returns The created Team
23
26
  */
24
- createTeam(orgName, teamName, userIds) {
27
+ createTeam(orgName, teamName, userIds, raw) {
25
28
  return __awaiter(this, void 0, void 0, function* () {
26
29
  const resp = yield this.axios.post(this.getEndpoint(`/${orgName}/teams`), { name: teamName, userIds: userIds });
27
- return resp.data;
30
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
28
31
  });
29
32
  }
30
33
  /**
@@ -32,9 +35,10 @@ class IdpOrganizationTeams extends Base_1.default {
32
35
  * @param orgName Name of the Organization
33
36
  * @param teamName Name of the Team
34
37
  */
35
- deleteTeam(orgName, teamName) {
38
+ deleteTeam(orgName, teamName, raw) {
36
39
  return __awaiter(this, void 0, void 0, function* () {
37
- yield this.axios.delete(this.getEndpoint(`/${orgName}/teams/${teamName}`));
40
+ const resp = yield this.axios.delete(this.getEndpoint(`/${orgName}/teams/${teamName}`));
41
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
38
42
  });
39
43
  }
40
44
  /**
@@ -46,14 +50,14 @@ class IdpOrganizationTeams extends Base_1.default {
46
50
  * @param teamUsersPatchOperation (optional) Enum describing what operation shall be executed: Add, set or remove
47
51
  * @returns The updated Team object
48
52
  */
49
- patchTeam(orgName, teamName, newName, userIds, teamUsersPatchOperation) {
53
+ patchTeam(orgName, teamName, newName, userIds, teamUsersPatchOperation, raw) {
50
54
  return __awaiter(this, void 0, void 0, function* () {
51
55
  const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/teams/${teamName}`), {
52
56
  name: newName,
53
57
  userIds: userIds,
54
58
  usersOperation: teamUsersPatchOperation,
55
59
  });
56
- return resp.data;
60
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
57
61
  });
58
62
  }
59
63
  /**
@@ -62,10 +66,10 @@ class IdpOrganizationTeams extends Base_1.default {
62
66
  * @param teamName Name of the Team
63
67
  * @returns The requested Team
64
68
  */
65
- getTeam(orgName, teamName) {
69
+ getTeam(orgName, teamName, raw) {
66
70
  return __awaiter(this, void 0, void 0, function* () {
67
71
  const resp = yield this.axios.get(this.getEndpoint(`/${orgName}/teams/${teamName}`));
68
- return resp.data;
72
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
69
73
  });
70
74
  }
71
75
  /**
@@ -78,7 +82,7 @@ class IdpOrganizationTeams extends Base_1.default {
78
82
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
79
83
  * @returns Object containing an array of Teams and the total number of results found in the database (independent of limit and page)
80
84
  */
81
- searchTeams(params) {
85
+ searchTeams(params, raw) {
82
86
  return __awaiter(this, void 0, void 0, function* () {
83
87
  var _a, _b;
84
88
  const limit = params.limit || 25;
@@ -92,7 +96,7 @@ class IdpOrganizationTeams extends Base_1.default {
92
96
  filters: filtersDTO,
93
97
  sorting: params.sorting,
94
98
  });
95
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
99
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
96
100
  });
97
101
  }
98
102
  /**
@@ -105,8 +109,8 @@ class IdpOrganizationTeams extends Base_1.default {
105
109
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
106
110
  * @returns Object containing an array of Team members and the total number of results found in the database (independent of limit and page)
107
111
  */
108
- searchTeamMembers(_a) {
109
- return __awaiter(this, arguments, void 0, function* ({ organizationName, teamName, filters, sorting, limit = 25, page = 0, }) {
112
+ searchTeamMembers(_a, raw_1) {
113
+ return __awaiter(this, arguments, void 0, function* ({ organizationName, teamName, filters, sorting, limit = 25, page = 0 }, raw) {
110
114
  const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
111
115
  return new searchFilter_1.SearchFilterDTO(f);
112
116
  });
@@ -114,7 +118,24 @@ class IdpOrganizationTeams extends Base_1.default {
114
118
  filters: filtersDTO,
115
119
  sorting: sorting,
116
120
  });
117
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
121
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
122
+ });
123
+ }
124
+ /**
125
+ * Updates the avatar of the specified team
126
+ * @param orgName Name of the organization
127
+ * @param teamName Name of the Team
128
+ * @param file Image as Javascript File
129
+ * @returns Team details with updated avatar
130
+ */
131
+ updateAvatar(orgName, teamName, file, raw) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ const data = new FormData();
134
+ data.append("avatar", file);
135
+ const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/teams/${teamName}/avatar`), data, {
136
+ headers: { "Content-Type": "multipart/form-data" },
137
+ });
138
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
118
139
  });
119
140
  }
120
141
  getEndpoint(endpoint) {
@@ -1,4 +1,4 @@
1
- import Base from "../../../Base";
1
+ import Base, { MaybeRaw } from "../../../Base";
2
2
  import { SuccessfulAuth } from "../../../interfaces/idp/user/SuccessfulAuth";
3
3
  export declare class IdpRegistration extends Base {
4
4
  /**
@@ -13,7 +13,9 @@ export declare class IdpRegistration extends Base {
13
13
  * @param regionId - Optional region id
14
14
  * @param targetUrl Optional url the link in the mail will point to
15
15
  */
16
- register(name: string, email: string, password: string, captcha: string, company?: string, regionId?: string, targetUrl?: string, validationCode?: string): Promise<void>;
16
+ register<R extends boolean = false>(name: string, email: string, password: string, captcha: string, company?: string, regionId?: string, targetUrl?: string, validationCode?: string, raw?: {
17
+ raw: R;
18
+ }): Promise<MaybeRaw<R, void>>;
17
19
  /**
18
20
  * Triggers the registration mail to be resend if the first one got lost
19
21
  * @param name - Name of the User
@@ -24,7 +26,9 @@ export declare class IdpRegistration extends Base {
24
26
  * @param regionId - Optional region id
25
27
  * @param targetUrl Optional url the link in the mail will point to
26
28
  */
27
- resendRegistrationMail(name: string, email: string, password: string, captcha: string, company?: string, regionId?: string, targetUrl?: string): Promise<void>;
29
+ resendRegistrationMail<R extends boolean = false>(name: string, email: string, password: string, captcha: string, company?: string, regionId?: string, targetUrl?: string, raw?: {
30
+ raw: R;
31
+ }): Promise<MaybeRaw<R, void>>;
28
32
  /**
29
33
  * Validates a previous registration. If successful, the Users account status will be set to 'Active'.
30
34
  * @param email - Email of the User
@@ -32,6 +36,8 @@ export declare class IdpRegistration extends Base {
32
36
  * @param regionId - Optional region id
33
37
  * @returns Bearer Token and User object
34
38
  */
35
- validateRegistration(email: string, verificationCode: string): Promise<SuccessfulAuth>;
39
+ validateRegistration<R extends boolean = false>(email: string, verificationCode: string, raw?: {
40
+ raw: R;
41
+ }): Promise<MaybeRaw<R, SuccessfulAuth>>;
36
42
  protected getEndpoint(endpoint: string): string;
37
43
  }
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.IdpRegistration = void 0;
13
- const Base_1 = require("../../../Base");
16
+ const Base_1 = __importDefault(require("../../../Base"));
14
17
  class IdpRegistration extends Base_1.default {
15
18
  /**
16
19
  * Registers a User in the HCloud system. This endpoint will send a verification link (with expiration date) to the Users' email address.
@@ -24,9 +27,9 @@ class IdpRegistration extends Base_1.default {
24
27
  * @param regionId - Optional region id
25
28
  * @param targetUrl Optional url the link in the mail will point to
26
29
  */
27
- register(name, email, password, captcha, company, regionId, targetUrl, validationCode) {
30
+ register(name, email, password, captcha, company, regionId, targetUrl, validationCode, raw) {
28
31
  return __awaiter(this, void 0, void 0, function* () {
29
- yield this.axios.post(this.getEndpoint("/v1/register"), {
32
+ const resp = yield this.axios.post(this.getEndpoint("/v1/register"), {
30
33
  name: name,
31
34
  email: email,
32
35
  password: password,
@@ -35,6 +38,7 @@ class IdpRegistration extends Base_1.default {
35
38
  regionId,
36
39
  targetUrl,
37
40
  }, { params: { validationCode } });
41
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
38
42
  });
39
43
  }
40
44
  /**
@@ -47,9 +51,9 @@ class IdpRegistration extends Base_1.default {
47
51
  * @param regionId - Optional region id
48
52
  * @param targetUrl Optional url the link in the mail will point to
49
53
  */
50
- resendRegistrationMail(name, email, password, captcha, company, regionId, targetUrl) {
54
+ resendRegistrationMail(name, email, password, captcha, company, regionId, targetUrl, raw) {
51
55
  return __awaiter(this, void 0, void 0, function* () {
52
- yield this.axios.patch(this.getEndpoint("/v1/register/resendRegistrationEmail"), {
56
+ const resp = yield this.axios.patch(this.getEndpoint("/v1/register/resendRegistrationEmail"), {
53
57
  name: name,
54
58
  email: email,
55
59
  password: password,
@@ -58,6 +62,7 @@ class IdpRegistration extends Base_1.default {
58
62
  regionId,
59
63
  targetUrl,
60
64
  });
65
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
61
66
  });
62
67
  }
63
68
  /**
@@ -67,17 +72,21 @@ class IdpRegistration extends Base_1.default {
67
72
  * @param regionId - Optional region id
68
73
  * @returns Bearer Token and User object
69
74
  */
70
- validateRegistration(email, verificationCode) {
75
+ validateRegistration(email, verificationCode, raw) {
71
76
  return __awaiter(this, void 0, void 0, function* () {
72
- var _a;
77
+ var _a, _b;
73
78
  const resp = yield this.axios.patch(this.getEndpoint("/v1/register/verify"), {
74
79
  email,
75
80
  verificationCode,
76
81
  });
77
- return {
78
- token: ((_a = resp.headers["authorization"]) === null || _a === void 0 ? void 0 : _a.toString()) || "",
82
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw)
83
+ ? Object.assign(Object.assign({}, resp), { data: {
84
+ token: ((_a = resp.headers["authorization"]) === null || _a === void 0 ? void 0 : _a.toString()) || "",
85
+ user: resp.data,
86
+ } }) : {
87
+ token: ((_b = resp.headers["authorization"]) === null || _b === void 0 ? void 0 : _b.toString()) || "",
79
88
  user: resp.data,
80
- };
89
+ });
81
90
  });
82
91
  }
83
92
  getEndpoint(endpoint) {
@@ -1,9 +1,10 @@
1
- import Base from "../../../Base";
1
+ import Base, { MaybeRaw } from "../../../Base";
2
2
  import { PaginatedResponse, SearchFilter, Sorting } from "../../../interfaces/global";
3
3
  import { Organization, OrganizationQueryOptions } from "../../../interfaces/idp/organization";
4
4
  import { OrganizationMemberInvitation } from "../../../interfaces/idp/organization/member/invitations";
5
5
  import { User, UserPatch } from "../../../interfaces/idp/user";
6
6
  import { IdpUserLicense } from "./license";
7
+ import { IdpMessage } from "./message";
7
8
  import UserPasswordService from "./password";
8
9
  import { IdpSettings } from "./settings";
9
10
  export declare class IdpUser extends Base {
@@ -22,17 +23,26 @@ export declare class IdpUser extends Base {
22
23
  */
23
24
  get license(): IdpUserLicense;
24
25
  private _license?;
26
+ /**
27
+ * Handles everything around a user's messages
28
+ */
29
+ get message(): IdpMessage;
30
+ private _message?;
25
31
  /**
26
32
  * Retrieves the User database entry for the requesting user.
27
33
  * @returns User object
28
34
  */
29
- getUser(): Promise<User>;
35
+ getUser<R extends boolean = false>(raw?: {
36
+ raw: R;
37
+ }): Promise<MaybeRaw<R, User>>;
30
38
  /**
31
39
  * Updates the User database entry of the requesting user.
32
40
  * @param user UserPatch object holding the new User values
33
41
  * @returns User object
34
42
  */
35
- patchUser(user: UserPatch): Promise<User>;
43
+ patchUser<R extends boolean = false>(user: UserPatch, raw?: {
44
+ raw: R;
45
+ }): Promise<MaybeRaw<R, User>>;
36
46
  /**
37
47
  * Updates the Password of the requesting user.
38
48
  * @param oldPassword String object holding the old password
@@ -40,15 +50,29 @@ export declare class IdpUser extends Base {
40
50
  * @param token String (optional) object holding the current TOTP token
41
51
  * @returns User object
42
52
  */
43
- patchUserPassword(oldPassword: string, newPassword: string, totp?: string): Promise<User>;
53
+ patchUserPassword<R extends boolean = false>(oldPassword: string, newPassword: string, totp?: string, raw?: {
54
+ raw: R;
55
+ }): Promise<MaybeRaw<R, User>>;
44
56
  /**
45
57
  * Deletes user session and logs him out of HCloud on all devices.
46
58
  */
47
- deleteUserSession(): Promise<void>;
59
+ deleteUserSession<R extends boolean = false>(raw?: {
60
+ raw: R;
61
+ }): Promise<MaybeRaw<R, void>>;
48
62
  /**
49
63
  * Deletes the requesting user.
50
64
  */
51
- deleteUser(): Promise<void>;
65
+ deleteUser<R extends boolean = false>(raw?: {
66
+ raw: R;
67
+ }): Promise<MaybeRaw<R, void>>;
68
+ /**
69
+ * Updates user's avatar
70
+ * @param file Image as Javascript File
71
+ * @returns User details with updated avatar
72
+ */
73
+ updateAvatar<R extends boolean = false>(file: File, raw?: {
74
+ raw: R;
75
+ }): Promise<MaybeRaw<R, User>>;
52
76
  /**
53
77
  * Retrieves all Organizations of a user that match the provided search filter(s). Returns all Organizations of the user if no search filter is provided.
54
78
  * @param filters (optional) Array of search filters
@@ -58,13 +82,15 @@ export declare class IdpUser extends Base {
58
82
  * @param options (optional) Defines query options to retrieve additional properties for the returned Organization objects.
59
83
  * @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
60
84
  */
61
- searchOrganizations(params: {
85
+ searchOrganizations<R extends boolean = false>(params: {
62
86
  filters: SearchFilter[];
63
87
  sorting?: Sorting;
64
88
  limit?: number;
65
89
  page?: number;
66
90
  options?: OrganizationQueryOptions;
67
- }): Promise<PaginatedResponse<Organization>>;
91
+ }, raw?: {
92
+ raw: R;
93
+ }): Promise<MaybeRaw<R, PaginatedResponse<Organization>>>;
68
94
  /**
69
95
  * Retrieves all organization invitations of a user that match the provided search filter(s). Returns all invitations of the user if no search filter is provided.
70
96
  * @param filters (optional) Array of search filters
@@ -73,15 +99,19 @@ export declare class IdpUser extends Base {
73
99
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
74
100
  * @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
75
101
  */
76
- searchInvitations(params: {
102
+ searchInvitations<R extends boolean = false>(params: {
77
103
  filters: SearchFilter[];
78
104
  sorting?: Sorting;
79
105
  limit?: number;
80
106
  page?: number;
81
- }): Promise<PaginatedResponse<OrganizationMemberInvitation>>;
107
+ }, raw?: {
108
+ raw: R;
109
+ }): Promise<MaybeRaw<R, PaginatedResponse<OrganizationMemberInvitation>>>;
82
110
  /**
83
111
  * Maintains a user's online status
84
112
  */
85
- ping(): Promise<void>;
113
+ ping<R extends boolean = false>(raw?: {
114
+ raw: R;
115
+ }): Promise<MaybeRaw<R, void>>;
86
116
  protected getEndpoint(endpoint: string): string;
87
117
  }
@@ -8,13 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.IdpUser = void 0;
13
- const Base_1 = require("../../../Base");
16
+ const Base_1 = __importDefault(require("../../../Base"));
14
17
  const paginatedResponseHelper_1 = require("../../../helper/paginatedResponseHelper");
15
18
  const searchFilter_1 = require("../../../helper/searchFilter");
16
19
  const license_1 = require("./license");
17
- const password_1 = require("./password");
20
+ const message_1 = require("./message");
21
+ const password_1 = __importDefault(require("./password"));
18
22
  const settings_1 = require("./settings");
19
23
  class IdpUser extends Base_1.default {
20
24
  /**
@@ -44,14 +48,23 @@ class IdpUser extends Base_1.default {
44
48
  }
45
49
  return this._license;
46
50
  }
51
+ /**
52
+ * Handles everything around a user's messages
53
+ */
54
+ get message() {
55
+ if (this._message === undefined) {
56
+ this._message = new message_1.IdpMessage(this.options, this.axios);
57
+ }
58
+ return this._message;
59
+ }
47
60
  /**
48
61
  * Retrieves the User database entry for the requesting user.
49
62
  * @returns User object
50
63
  */
51
- getUser() {
64
+ getUser(raw) {
52
65
  return __awaiter(this, void 0, void 0, function* () {
53
66
  const resp = yield this.axios.get(this.getEndpoint("/v1/user"));
54
- return resp.data;
67
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
55
68
  });
56
69
  }
57
70
  /**
@@ -59,10 +72,10 @@ class IdpUser extends Base_1.default {
59
72
  * @param user UserPatch object holding the new User values
60
73
  * @returns User object
61
74
  */
62
- patchUser(user) {
75
+ patchUser(user, raw) {
63
76
  return __awaiter(this, void 0, void 0, function* () {
64
77
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user`), user);
65
- return resp.data;
78
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
66
79
  });
67
80
  }
68
81
  /**
@@ -72,7 +85,7 @@ class IdpUser extends Base_1.default {
72
85
  * @param token String (optional) object holding the current TOTP token
73
86
  * @returns User object
74
87
  */
75
- patchUserPassword(oldPassword, newPassword, totp) {
88
+ patchUserPassword(oldPassword, newPassword, totp, raw) {
76
89
  return __awaiter(this, void 0, void 0, function* () {
77
90
  const t = {
78
91
  old: oldPassword,
@@ -83,23 +96,40 @@ class IdpUser extends Base_1.default {
83
96
  delete t.token;
84
97
  }
85
98
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/password`), t);
86
- return resp.data;
99
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
87
100
  });
88
101
  }
89
102
  /**
90
103
  * Deletes user session and logs him out of HCloud on all devices.
91
104
  */
92
- deleteUserSession() {
105
+ deleteUserSession(raw) {
93
106
  return __awaiter(this, void 0, void 0, function* () {
94
- yield this.axios.delete(this.getEndpoint(`/v1/user/sessions`));
107
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/user/sessions`));
108
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
95
109
  });
96
110
  }
97
111
  /**
98
112
  * Deletes the requesting user.
99
113
  */
100
- deleteUser() {
114
+ deleteUser(raw) {
101
115
  return __awaiter(this, void 0, void 0, function* () {
102
- yield this.axios.delete(this.getEndpoint(`/v1/user`));
116
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/user`));
117
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
118
+ });
119
+ }
120
+ /**
121
+ * Updates user's avatar
122
+ * @param file Image as Javascript File
123
+ * @returns User details with updated avatar
124
+ */
125
+ updateAvatar(file, raw) {
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ const data = new FormData();
128
+ data.append("avatar", file);
129
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/avatar`), data, {
130
+ headers: { "Content-Type": "multipart/form-data" },
131
+ });
132
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
103
133
  });
104
134
  }
105
135
  /**
@@ -111,8 +141,7 @@ class IdpUser extends Base_1.default {
111
141
  * @param options (optional) Defines query options to retrieve additional properties for the returned Organization objects.
112
142
  * @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
113
143
  */
114
- // eslint-disable-next-line complexity
115
- searchOrganizations(params) {
144
+ searchOrganizations(params, raw) {
116
145
  return __awaiter(this, void 0, void 0, function* () {
117
146
  var _a, _b, _c;
118
147
  const limit = params.limit || 25;
@@ -128,7 +157,7 @@ class IdpUser extends Base_1.default {
128
157
  filters: filtersDTO,
129
158
  sorting: params.sorting,
130
159
  });
131
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
160
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
132
161
  });
133
162
  }
134
163
  /**
@@ -139,7 +168,7 @@ class IdpUser extends Base_1.default {
139
168
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
140
169
  * @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
141
170
  */
142
- searchInvitations(params) {
171
+ searchInvitations(params, raw) {
143
172
  return __awaiter(this, void 0, void 0, function* () {
144
173
  const limit = params.limit || 25;
145
174
  const page = params.page || 0;
@@ -151,15 +180,16 @@ class IdpUser extends Base_1.default {
151
180
  filters: filtersDTO,
152
181
  sorting: params.sorting,
153
182
  });
154
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
183
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
155
184
  });
156
185
  }
157
186
  /**
158
187
  * Maintains a user's online status
159
188
  */
160
- ping() {
189
+ ping(raw) {
161
190
  return __awaiter(this, void 0, void 0, function* () {
162
- yield this.axios.get(this.getEndpoint("/v1/user/ping"));
191
+ const resp = yield this.axios.get(this.getEndpoint("/v1/user/ping"));
192
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
163
193
  });
164
194
  }
165
195
  getEndpoint(endpoint) {
@@ -1,7 +1,11 @@
1
- import Base from "../../../../Base";
1
+ import Base, { MaybeRaw } from "../../../../Base";
2
2
  import { License } from "../../../../interfaces/idp/organization/license";
3
3
  export declare class IdpUserLicense extends Base {
4
- getLicense(): Promise<License>;
5
- updateLicense(token: string): Promise<License>;
4
+ getLicense<R extends boolean = false>(raw?: {
5
+ raw: R;
6
+ }): Promise<MaybeRaw<R, License>>;
7
+ updateLicense<R extends boolean = false>(token: string, raw?: {
8
+ raw: R;
9
+ }): Promise<MaybeRaw<R, License>>;
6
10
  protected getEndpoint(endpoint: string): string;
7
11
  }
@@ -8,20 +8,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
15
  exports.IdpUserLicense = void 0;
13
- const Base_1 = require("../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../Base"));
14
17
  class IdpUserLicense extends Base_1.default {
15
- getLicense() {
18
+ getLicense(raw) {
16
19
  return __awaiter(this, void 0, void 0, function* () {
17
20
  const res = yield this.axios.get(this.getEndpoint(`/user/license`));
18
- return res.data;
21
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
19
22
  });
20
23
  }
21
- updateLicense(token) {
24
+ updateLicense(token, raw) {
22
25
  return __awaiter(this, void 0, void 0, function* () {
23
26
  const res = yield this.axios.put(this.getEndpoint(`/user/license`), { identifier: token });
24
- return res.data;
27
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
25
28
  });
26
29
  }
27
30
  getEndpoint(endpoint) {
@@ -0,0 +1,62 @@
1
+ import Base, { MaybeRaw } from "../../../../Base";
2
+ import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
3
+ import { Message, RecipientType } from "../../../../interfaces/idp/user/Message";
4
+ export declare class IdpMessage extends Base {
5
+ /**
6
+ * Search all messages of the requesting user.
7
+ * @returns Paginated response of Message objects
8
+ */
9
+ searchMessages<R extends boolean = false>({ filters, sorting, limit, page }: SearchParams, raw?: {
10
+ raw: R;
11
+ }): Promise<MaybeRaw<R, PaginatedResponse<Message>>>;
12
+ /**
13
+ * Retrieves a single message by ID.
14
+ * @param messageId ID of the message
15
+ * @returns The requested Message object
16
+ */
17
+ getMessage<R extends boolean = false>(messageId: string, raw?: {
18
+ raw: R;
19
+ }): Promise<MaybeRaw<R, Message>>;
20
+ /**
21
+ * Mark message as read or unread.
22
+ *
23
+ * @param messageId ID of the Message object
24
+ * @returns the updated Message object
25
+ */
26
+ updateMessage<R extends boolean = false>(messageId: string, read: boolean, raw?: {
27
+ raw: R;
28
+ }): Promise<MaybeRaw<R, Message>>;
29
+ /**
30
+ * Deletes a message of the requesting User.
31
+ * @param messageId Id of the Message
32
+ */
33
+ deleteMessage<R extends boolean = false>(messageId: string, raw?: {
34
+ raw: R;
35
+ }): Promise<MaybeRaw<R, void>>;
36
+ /**
37
+ * Send message to single user or all users of organization or team.
38
+ *
39
+ * This is an internal endpoint.
40
+ *
41
+ * @param msg Message to send
42
+ * - to - should be email, orgName or teamName
43
+ * - recipient - enum type USER, ORGANIZATION or TEAM (by default is USER)
44
+ * - orgName - should be only specified if recipient===TEAM
45
+ * - title - title of the message (max 255 characters)
46
+ * - subject - subject of the message (max 255 characters)
47
+ * - message - content of the message (max 5000 characters)
48
+ * @returns the Message object
49
+ */
50
+ sendMessage<R extends boolean = false>(msg: {
51
+ to: string;
52
+ recipient?: RecipientType;
53
+ orgName?: string;
54
+ title?: string;
55
+ subject?: string;
56
+ message: string;
57
+ link?: string;
58
+ }, raw?: {
59
+ raw: R;
60
+ }): Promise<MaybeRaw<R, Message>>;
61
+ protected getEndpoint(endpoint: string): string;
62
+ }