hcloud-sdk 16.0.0 → 18.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 (291) hide show
  1. package/changelog.md +178 -51
  2. package/lib/Base.d.ts +2 -1
  3. package/lib/Hcloud.d.ts +6 -0
  4. package/lib/Hcloud.js +18 -0
  5. package/lib/helper/ValidationHelper.d.ts +74 -0
  6. package/lib/helper/ValidationHelper.js +360 -0
  7. package/lib/interfaces/auditor/index.d.ts +17 -2
  8. package/lib/interfaces/auditor/index.js +12 -0
  9. package/lib/interfaces/cosmo/asset/index.d.ts +185 -0
  10. package/lib/interfaces/cosmo/asset/index.js +82 -0
  11. package/lib/interfaces/cosmo/comment/index.d.ts +38 -0
  12. package/lib/interfaces/cosmo/comment/index.js +8 -0
  13. package/lib/interfaces/cosmo/event/index.d.ts +31 -0
  14. package/lib/interfaces/cosmo/event/index.js +17 -0
  15. package/lib/interfaces/cosmo/location/index.d.ts +4 -0
  16. package/lib/interfaces/cosmo/location/index.js +2 -0
  17. package/lib/interfaces/cosmo/namespace/index.d.ts +9 -0
  18. package/lib/interfaces/cosmo/namespace/index.js +9 -0
  19. package/lib/interfaces/cosmo/permissions.d.ts +96 -0
  20. package/lib/interfaces/cosmo/permissions.js +58 -0
  21. package/lib/interfaces/cosmo/share/index.d.ts +28 -0
  22. package/lib/interfaces/cosmo/share/index.js +2 -0
  23. package/lib/interfaces/cosmo/space/index.d.ts +25 -0
  24. package/lib/interfaces/cosmo/space/index.js +2 -0
  25. package/lib/interfaces/cosmo/tag/tag.d.ts +12 -0
  26. package/lib/interfaces/cosmo/tag/tag.js +2 -0
  27. package/lib/interfaces/frontend/config/index.d.ts +1 -0
  28. package/lib/interfaces/fuse/space/index.d.ts +1 -0
  29. package/lib/interfaces/global/Products.d.ts +3 -1
  30. package/lib/interfaces/global/Products.js +2 -0
  31. package/lib/interfaces/global/Views.d.ts +2 -1
  32. package/lib/interfaces/global/Views.js +1 -0
  33. package/lib/interfaces/high5/execution/index.d.ts +23 -2
  34. package/lib/interfaces/high5/execution/index.js +2 -0
  35. package/lib/interfaces/high5/index.d.ts +7 -7
  36. package/lib/interfaces/high5/index.js +7 -7
  37. package/lib/interfaces/high5/space/database/document/index.d.ts +34 -0
  38. package/lib/interfaces/high5/space/database/document/index.js +14 -0
  39. package/lib/interfaces/high5/space/database/index.d.ts +12 -0
  40. package/lib/interfaces/high5/space/database/index.js +2 -0
  41. package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +9 -2
  42. package/lib/interfaces/high5/space/event/stream/node/index.d.ts +10 -2
  43. package/lib/interfaces/high5/space/event/stream/node/index.js +6 -1
  44. package/lib/interfaces/high5/space/execution/index.d.ts +56 -2
  45. package/lib/interfaces/high5/space/execution/index.js +8 -0
  46. package/lib/interfaces/high5/space/index.d.ts +2 -0
  47. package/lib/interfaces/high5/space/job/JobLog.d.ts +16 -0
  48. package/lib/interfaces/high5/space/job/JobLog.js +2 -0
  49. package/lib/interfaces/high5/space/job/index.d.ts +38 -0
  50. package/lib/interfaces/high5/space/job/index.js +8 -0
  51. package/lib/interfaces/high5/space/pool/index.d.ts +5 -7
  52. package/lib/interfaces/high5/space/pool/index.js +0 -7
  53. package/lib/interfaces/high5/space/webhook/index.d.ts +3 -1
  54. package/lib/interfaces/high5/stats.d.ts +21 -0
  55. package/lib/interfaces/high5/stats.js +2 -0
  56. package/lib/interfaces/high5/wave/index.d.ts +8 -3
  57. package/lib/interfaces/idp/index.d.ts +1 -0
  58. package/lib/interfaces/idp/index.js +1 -0
  59. package/lib/interfaces/idp/oauth/index.d.ts +4 -3
  60. package/lib/interfaces/idp/organization/index.d.ts +1 -0
  61. package/lib/interfaces/idp/organization/index.js +1 -0
  62. package/lib/interfaces/idp/organization/license/index.d.ts +13 -0
  63. package/lib/interfaces/idp/organization/member/index.d.ts +2 -0
  64. package/lib/interfaces/idp/organization/service-accounts.d.ts +8 -0
  65. package/lib/interfaces/idp/organization/service-accounts.js +2 -0
  66. package/lib/interfaces/idp/organization/stats.d.ts +7 -0
  67. package/lib/interfaces/idp/organization/stats.js +2 -0
  68. package/lib/interfaces/idp/organization/team/index.d.ts +0 -1
  69. package/lib/interfaces/idp/user/GeneralSettings.d.ts +1 -0
  70. package/lib/interfaces/idp/user/GeneralSettings.js +1 -0
  71. package/lib/interfaces/idp/user/Message.d.ts +21 -0
  72. package/lib/interfaces/idp/user/Message.js +14 -0
  73. package/lib/interfaces/idp/user/NotificationSettings.d.ts +1 -0
  74. package/lib/interfaces/idp/user/Scopes.d.ts +8 -2
  75. package/lib/interfaces/idp/user/Scopes.js +9 -0
  76. package/lib/interfaces/idp/user/index.d.ts +2 -1
  77. package/lib/interfaces/mailer/index.d.ts +30 -1
  78. package/lib/interfaces/mailer/index.js +87 -1
  79. package/lib/interfaces/mothership/index.d.ts +3 -1
  80. package/lib/interfaces/mothership/index.js +15 -0
  81. package/lib/interfaces/mothership/stats.d.ts +4 -0
  82. package/lib/interfaces/mothership/stats.js +2 -0
  83. package/lib/interfaces/nats/index.d.ts +98 -9
  84. package/lib/interfaces/nats/index.js +136 -19
  85. package/lib/interfaces/shorts/index.d.ts +10 -0
  86. package/lib/interfaces/shorts/index.js +2 -0
  87. package/lib/service/agent/bundle/dev/index.d.ts +16 -6
  88. package/lib/service/agent/bundle/dev/index.js +12 -10
  89. package/lib/service/agent/bundle/index.d.ts +10 -4
  90. package/lib/service/agent/bundle/index.js +6 -6
  91. package/lib/service/agent/context/index.d.ts +26 -7
  92. package/lib/service/agent/context/index.js +27 -12
  93. package/lib/service/auditor/index.d.ts +8 -4
  94. package/lib/service/auditor/index.js +5 -5
  95. package/lib/service/auditor/internal/index.d.ts +27 -3
  96. package/lib/service/auditor/internal/index.js +34 -5
  97. package/lib/service/bouncer/features/index.d.ts +4 -2
  98. package/lib/service/bouncer/features/index.js +2 -2
  99. package/lib/service/cosmo/asset/index.d.ts +219 -0
  100. package/lib/service/cosmo/asset/index.js +314 -0
  101. package/lib/service/cosmo/comment/index.d.ts +122 -0
  102. package/lib/service/cosmo/comment/index.js +161 -0
  103. package/lib/service/cosmo/event/index.d.ts +23 -0
  104. package/lib/service/cosmo/event/index.js +40 -0
  105. package/lib/service/cosmo/folder/index.d.ts +27 -0
  106. package/lib/service/cosmo/folder/index.js +47 -0
  107. package/lib/service/cosmo/index.d.ts +49 -0
  108. package/lib/service/cosmo/index.js +119 -0
  109. package/lib/service/cosmo/internal/index.d.ts +7 -0
  110. package/lib/service/cosmo/internal/index.js +17 -0
  111. package/lib/service/cosmo/internal/space/index.d.ts +15 -0
  112. package/lib/service/cosmo/internal/space/index.js +34 -0
  113. package/lib/service/cosmo/location/index.d.ts +40 -0
  114. package/lib/service/cosmo/location/index.js +63 -0
  115. package/lib/service/cosmo/namespace/index.d.ts +42 -0
  116. package/lib/service/cosmo/namespace/index.js +65 -0
  117. package/lib/service/cosmo/organization/index.d.ts +47 -0
  118. package/lib/service/cosmo/organization/index.js +64 -0
  119. package/lib/service/cosmo/permissions/index.d.ts +131 -0
  120. package/lib/service/cosmo/permissions/index.js +181 -0
  121. package/lib/service/cosmo/production/index.d.ts +26 -0
  122. package/lib/service/cosmo/production/index.js +45 -0
  123. package/lib/service/cosmo/share/index.d.ts +161 -0
  124. package/lib/service/cosmo/share/index.js +215 -0
  125. package/lib/service/cosmo/space/index.d.ts +104 -0
  126. package/lib/service/cosmo/space/index.js +146 -0
  127. package/lib/service/cosmo/tag/index.d.ts +67 -0
  128. package/lib/service/cosmo/tag/index.js +93 -0
  129. package/lib/service/dali/DaliAvatar.d.ts +12 -0
  130. package/lib/service/dali/DaliAvatar.js +20 -0
  131. package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +32 -0
  132. package/lib/service/dali/avatar/DaliCosmoSpace.js +59 -0
  133. package/lib/service/dali/avatar/DaliFuseSpace.d.ts +10 -4
  134. package/lib/service/dali/avatar/DaliFuseSpace.js +7 -6
  135. package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +10 -4
  136. package/lib/service/dali/avatar/DaliHigh5Pool.js +7 -6
  137. package/lib/service/dali/avatar/DaliHigh5Space.d.ts +10 -4
  138. package/lib/service/dali/avatar/DaliHigh5Space.js +7 -6
  139. package/lib/service/dali/avatar/DaliOAuthApp.d.ts +10 -4
  140. package/lib/service/dali/avatar/DaliOAuthApp.js +7 -6
  141. package/lib/service/dali/avatar/DaliOrganization.d.ts +10 -4
  142. package/lib/service/dali/avatar/DaliOrganization.js +7 -6
  143. package/lib/service/dali/avatar/DaliServiceAccount.d.ts +32 -0
  144. package/lib/service/dali/avatar/DaliServiceAccount.js +59 -0
  145. package/lib/service/dali/avatar/DaliTeam.d.ts +10 -4
  146. package/lib/service/dali/avatar/DaliTeam.js +7 -6
  147. package/lib/service/dali/avatar/DaliUser.d.ts +10 -4
  148. package/lib/service/dali/avatar/DaliUser.js +7 -6
  149. package/lib/service/dali/index.d.ts +4 -5
  150. package/lib/service/dali/index.js +2 -5
  151. package/lib/service/fuse/index.d.ts +4 -2
  152. package/lib/service/fuse/index.js +2 -2
  153. package/lib/service/fuse/internal/index.d.ts +4 -2
  154. package/lib/service/fuse/internal/index.js +3 -2
  155. package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +4 -2
  156. package/lib/service/fuse/internal/space/cronjob/log/index.js +2 -2
  157. package/lib/service/fuse/internal/space/index.d.ts +7 -3
  158. package/lib/service/fuse/internal/space/index.js +6 -4
  159. package/lib/service/fuse/space/cronjob/index.d.ts +35 -13
  160. package/lib/service/fuse/space/cronjob/index.js +48 -50
  161. package/lib/service/fuse/space/cronjob/log/index.d.ts +8 -4
  162. package/lib/service/fuse/space/cronjob/log/index.js +5 -5
  163. package/lib/service/fuse/space/index.d.ts +27 -11
  164. package/lib/service/fuse/space/index.js +19 -18
  165. package/lib/service/high5/execution/index.d.ts +4 -2
  166. package/lib/service/high5/execution/index.js +3 -2
  167. package/lib/service/high5/execution/status/index.d.ts +5 -3
  168. package/lib/service/high5/execution/status/index.js +3 -3
  169. package/lib/service/high5/index.d.ts +7 -2
  170. package/lib/service/high5/index.js +9 -2
  171. package/lib/service/high5/internal/index.d.ts +4 -2
  172. package/lib/service/high5/internal/index.js +3 -2
  173. package/lib/service/high5/internal/space/index.d.ts +10 -3
  174. package/lib/service/high5/internal/space/index.js +13 -4
  175. package/lib/service/high5/internal/space/job/index.d.ts +7 -0
  176. package/lib/service/high5/internal/space/job/index.js +17 -0
  177. package/lib/service/high5/internal/space/job/log/index.d.ts +17 -0
  178. package/lib/service/high5/internal/space/job/log/index.js +34 -0
  179. package/lib/service/high5/joinToken/index.d.ts +14 -6
  180. package/lib/service/high5/joinToken/index.js +10 -9
  181. package/lib/service/high5/space/database/document/array/index.d.ts +73 -0
  182. package/lib/service/high5/space/database/document/array/index.js +102 -0
  183. package/lib/service/high5/space/database/document/index.d.ts +74 -0
  184. package/lib/service/high5/space/database/document/index.js +112 -0
  185. package/lib/service/high5/space/database/document/number/index.d.ts +51 -0
  186. package/lib/service/high5/space/database/document/number/index.js +77 -0
  187. package/lib/service/high5/space/database/index.d.ts +65 -0
  188. package/lib/service/high5/space/database/index.js +102 -0
  189. package/lib/service/high5/space/event/index.d.ts +17 -7
  190. package/lib/service/high5/space/event/index.js +12 -11
  191. package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +4 -2
  192. package/lib/service/high5/space/event/stream/design/DesignOperations.js +5 -3
  193. package/lib/service/high5/space/event/stream/design/index.d.ts +10 -4
  194. package/lib/service/high5/space/event/stream/design/index.js +7 -6
  195. package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +16 -6
  196. package/lib/service/high5/space/event/stream/design/snapshot/index.js +12 -10
  197. package/lib/service/high5/space/event/stream/index.d.ts +32 -12
  198. package/lib/service/high5/space/event/stream/index.js +22 -21
  199. package/lib/service/high5/space/execution/index.d.ts +22 -7
  200. package/lib/service/high5/space/execution/index.js +23 -12
  201. package/lib/service/high5/space/execution/log/index.d.ts +8 -4
  202. package/lib/service/high5/space/execution/log/index.js +5 -5
  203. package/lib/service/high5/space/execution/status/index.d.ts +18 -7
  204. package/lib/service/high5/space/execution/status/index.js +20 -8
  205. package/lib/service/high5/space/index.d.ts +56 -18
  206. package/lib/service/high5/space/index.js +65 -27
  207. package/lib/service/high5/space/job/index.d.ts +145 -0
  208. package/lib/service/high5/space/job/index.js +201 -0
  209. package/lib/service/high5/space/job/log/index.d.ts +35 -0
  210. package/lib/service/high5/space/job/log/index.js +58 -0
  211. package/lib/service/high5/space/node/index.d.ts +20 -8
  212. package/lib/service/high5/space/node/index.js +14 -13
  213. package/lib/service/high5/space/pool/index.d.ts +27 -11
  214. package/lib/service/high5/space/pool/index.js +19 -18
  215. package/lib/service/high5/space/secret/index.d.ts +17 -7
  216. package/lib/service/high5/space/secret/index.js +12 -11
  217. package/lib/service/high5/space/stat/index.d.ts +12 -0
  218. package/lib/service/high5/space/stat/index.js +31 -0
  219. package/lib/service/high5/space/wave/index.d.ts +16 -6
  220. package/lib/service/high5/space/wave/index.js +11 -10
  221. package/lib/service/high5/space/webhook/index.d.ts +32 -12
  222. package/lib/service/high5/space/webhook/index.js +25 -21
  223. package/lib/service/high5/space/webhook/log/index.d.ts +4 -2
  224. package/lib/service/high5/space/webhook/log/index.js +2 -2
  225. package/lib/service/high5/stat/index.d.ts +11 -0
  226. package/lib/service/high5/stat/index.js +30 -0
  227. package/lib/service/high5/wave/s3/index.d.ts +31 -8
  228. package/lib/service/high5/wave/s3/index.js +52 -24
  229. package/lib/service/idp/guest/index.d.ts +42 -0
  230. package/lib/service/idp/guest/index.js +66 -0
  231. package/lib/service/idp/index.d.ts +25 -7
  232. package/lib/service/idp/index.js +23 -12
  233. package/lib/service/idp/internal/index.d.ts +5 -3
  234. package/lib/service/idp/internal/index.js +5 -3
  235. package/lib/service/idp/oauth/index.d.ts +16 -6
  236. package/lib/service/idp/oauth/index.js +15 -15
  237. package/lib/service/idp/organization/index.d.ts +25 -5
  238. package/lib/service/idp/organization/index.js +29 -8
  239. package/lib/service/idp/organization/license/index.d.ts +7 -3
  240. package/lib/service/idp/organization/license/index.js +4 -4
  241. package/lib/service/idp/organization/member/index.d.ts +21 -8
  242. package/lib/service/idp/organization/member/index.js +16 -13
  243. package/lib/service/idp/organization/member/invitations/index.d.ts +23 -9
  244. package/lib/service/idp/organization/member/invitations/index.js +72 -59
  245. package/lib/service/idp/organization/service-accounts/index.d.ts +76 -0
  246. package/lib/service/idp/organization/service-accounts/index.js +109 -0
  247. package/lib/service/idp/organization/settings/domain/index.d.ts +13 -5
  248. package/lib/service/idp/organization/settings/domain/index.js +9 -8
  249. package/lib/service/idp/organization/settings/domain/saml/index.d.ts +16 -6
  250. package/lib/service/idp/organization/settings/domain/saml/index.js +19 -18
  251. package/lib/service/idp/organization/settings/oauth/index.d.ts +23 -9
  252. package/lib/service/idp/organization/settings/oauth/index.js +16 -15
  253. package/lib/service/idp/organization/stat/index.d.ts +11 -0
  254. package/lib/service/idp/organization/stat/index.js +30 -0
  255. package/lib/service/idp/organization/team/index.d.ts +22 -10
  256. package/lib/service/idp/organization/team/index.js +14 -13
  257. package/lib/service/idp/registration/index.d.ts +10 -4
  258. package/lib/service/idp/registration/index.js +15 -9
  259. package/lib/service/idp/user/index.d.ts +33 -11
  260. package/lib/service/idp/user/index.js +30 -16
  261. package/lib/service/idp/user/license/index.d.ts +7 -3
  262. package/lib/service/idp/user/license/index.js +4 -4
  263. package/lib/service/idp/user/message/index.d.ts +61 -0
  264. package/lib/service/idp/user/message/index.js +92 -0
  265. package/lib/service/idp/user/password/index.d.ts +4 -2
  266. package/lib/service/idp/user/password/index.js +3 -3
  267. package/lib/service/idp/user/settings/connections/index.d.ts +4 -2
  268. package/lib/service/idp/user/settings/connections/index.js +2 -2
  269. package/lib/service/idp/user/settings/general/index.d.ts +10 -4
  270. package/lib/service/idp/user/settings/general/index.js +6 -6
  271. package/lib/service/idp/user/settings/notifications/index.d.ts +7 -3
  272. package/lib/service/idp/user/settings/notifications/index.js +4 -4
  273. package/lib/service/idp/user/settings/oauthApps/index.d.ts +7 -3
  274. package/lib/service/idp/user/settings/oauthApps/index.js +6 -5
  275. package/lib/service/idp/user/settings/pats/index.d.ts +22 -8
  276. package/lib/service/idp/user/settings/pats/index.js +17 -15
  277. package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +16 -6
  278. package/lib/service/idp/user/settings/twoFactor/totp/index.js +13 -10
  279. package/lib/service/mailer/index.d.ts +4 -2
  280. package/lib/service/mailer/index.js +2 -2
  281. package/lib/service/mailer/internal/index.d.ts +13 -5
  282. package/lib/service/mailer/internal/index.js +8 -8
  283. package/lib/service/mothership/index.d.ts +35 -13
  284. package/lib/service/mothership/index.js +32 -18
  285. package/lib/service/nats/index.js +58 -44
  286. package/lib/service/shorts/index.d.ts +18 -0
  287. package/lib/service/shorts/index.js +38 -0
  288. package/lib/service/shorts/internal/index.d.ts +72 -0
  289. package/lib/service/shorts/internal/index.js +104 -0
  290. package/lib/utils/bouncer/features/Provider.js +0 -3
  291. package/package.json +22 -24
@@ -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,21 @@ 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>>;
52
68
  /**
53
69
  * 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
70
  * @param filters (optional) Array of search filters
@@ -58,13 +74,15 @@ export declare class IdpUser extends Base {
58
74
  * @param options (optional) Defines query options to retrieve additional properties for the returned Organization objects.
59
75
  * @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
60
76
  */
61
- searchOrganizations(params: {
77
+ searchOrganizations<R extends boolean = false>(params: {
62
78
  filters: SearchFilter[];
63
79
  sorting?: Sorting;
64
80
  limit?: number;
65
81
  page?: number;
66
82
  options?: OrganizationQueryOptions;
67
- }): Promise<PaginatedResponse<Organization>>;
83
+ }, raw?: {
84
+ raw: R;
85
+ }): Promise<MaybeRaw<R, PaginatedResponse<Organization>>>;
68
86
  /**
69
87
  * 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
88
  * @param filters (optional) Array of search filters
@@ -73,15 +91,19 @@ export declare class IdpUser extends Base {
73
91
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
74
92
  * @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
75
93
  */
76
- searchInvitations(params: {
94
+ searchInvitations<R extends boolean = false>(params: {
77
95
  filters: SearchFilter[];
78
96
  sorting?: Sorting;
79
97
  limit?: number;
80
98
  page?: number;
81
- }): Promise<PaginatedResponse<OrganizationMemberInvitation>>;
99
+ }, raw?: {
100
+ raw: R;
101
+ }): Promise<MaybeRaw<R, PaginatedResponse<OrganizationMemberInvitation>>>;
82
102
  /**
83
103
  * Maintains a user's online status
84
104
  */
85
- ping(): Promise<void>;
105
+ ping<R extends boolean = false>(raw?: {
106
+ raw: R;
107
+ }): Promise<MaybeRaw<R, void>>;
86
108
  protected getEndpoint(endpoint: string): string;
87
109
  }
@@ -14,6 +14,7 @@ const Base_1 = require("../../../Base");
14
14
  const paginatedResponseHelper_1 = require("../../../helper/paginatedResponseHelper");
15
15
  const searchFilter_1 = require("../../../helper/searchFilter");
16
16
  const license_1 = require("./license");
17
+ const message_1 = require("./message");
17
18
  const password_1 = require("./password");
18
19
  const settings_1 = require("./settings");
19
20
  class IdpUser extends Base_1.default {
@@ -44,14 +45,23 @@ class IdpUser extends Base_1.default {
44
45
  }
45
46
  return this._license;
46
47
  }
48
+ /**
49
+ * Handles everything around a user's messages
50
+ */
51
+ get message() {
52
+ if (this._message === undefined) {
53
+ this._message = new message_1.IdpMessage(this.options, this.axios);
54
+ }
55
+ return this._message;
56
+ }
47
57
  /**
48
58
  * Retrieves the User database entry for the requesting user.
49
59
  * @returns User object
50
60
  */
51
- getUser() {
61
+ getUser(raw) {
52
62
  return __awaiter(this, void 0, void 0, function* () {
53
63
  const resp = yield this.axios.get(this.getEndpoint("/v1/user"));
54
- return resp.data;
64
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
55
65
  });
56
66
  }
57
67
  /**
@@ -59,10 +69,10 @@ class IdpUser extends Base_1.default {
59
69
  * @param user UserPatch object holding the new User values
60
70
  * @returns User object
61
71
  */
62
- patchUser(user) {
72
+ patchUser(user, raw) {
63
73
  return __awaiter(this, void 0, void 0, function* () {
64
74
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user`), user);
65
- return resp.data;
75
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
66
76
  });
67
77
  }
68
78
  /**
@@ -72,7 +82,7 @@ class IdpUser extends Base_1.default {
72
82
  * @param token String (optional) object holding the current TOTP token
73
83
  * @returns User object
74
84
  */
75
- patchUserPassword(oldPassword, newPassword, totp) {
85
+ patchUserPassword(oldPassword, newPassword, totp, raw) {
76
86
  return __awaiter(this, void 0, void 0, function* () {
77
87
  const t = {
78
88
  old: oldPassword,
@@ -83,23 +93,25 @@ class IdpUser extends Base_1.default {
83
93
  delete t.token;
84
94
  }
85
95
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/password`), t);
86
- return resp.data;
96
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
87
97
  });
88
98
  }
89
99
  /**
90
100
  * Deletes user session and logs him out of HCloud on all devices.
91
101
  */
92
- deleteUserSession() {
102
+ deleteUserSession(raw) {
93
103
  return __awaiter(this, void 0, void 0, function* () {
94
- yield this.axios.delete(this.getEndpoint(`/v1/user/sessions`));
104
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/user/sessions`));
105
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
95
106
  });
96
107
  }
97
108
  /**
98
109
  * Deletes the requesting user.
99
110
  */
100
- deleteUser() {
111
+ deleteUser(raw) {
101
112
  return __awaiter(this, void 0, void 0, function* () {
102
- yield this.axios.delete(this.getEndpoint(`/v1/user`));
113
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/user`));
114
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
103
115
  });
104
116
  }
105
117
  /**
@@ -111,7 +123,8 @@ class IdpUser extends Base_1.default {
111
123
  * @param options (optional) Defines query options to retrieve additional properties for the returned Organization objects.
112
124
  * @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
113
125
  */
114
- searchOrganizations(params) {
126
+ // eslint-disable-next-line complexity
127
+ searchOrganizations(params, raw) {
115
128
  return __awaiter(this, void 0, void 0, function* () {
116
129
  var _a, _b, _c;
117
130
  const limit = params.limit || 25;
@@ -127,7 +140,7 @@ class IdpUser extends Base_1.default {
127
140
  filters: filtersDTO,
128
141
  sorting: params.sorting,
129
142
  });
130
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
143
+ 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));
131
144
  });
132
145
  }
133
146
  /**
@@ -138,7 +151,7 @@ class IdpUser extends Base_1.default {
138
151
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
139
152
  * @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
140
153
  */
141
- searchInvitations(params) {
154
+ searchInvitations(params, raw) {
142
155
  return __awaiter(this, void 0, void 0, function* () {
143
156
  const limit = params.limit || 25;
144
157
  const page = params.page || 0;
@@ -150,15 +163,16 @@ class IdpUser extends Base_1.default {
150
163
  filters: filtersDTO,
151
164
  sorting: params.sorting,
152
165
  });
153
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
166
+ 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));
154
167
  });
155
168
  }
156
169
  /**
157
170
  * Maintains a user's online status
158
171
  */
159
- ping() {
172
+ ping(raw) {
160
173
  return __awaiter(this, void 0, void 0, function* () {
161
- yield this.axios.get(this.getEndpoint("/v1/user/ping"));
174
+ const resp = yield this.axios.get(this.getEndpoint("/v1/user/ping"));
175
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
162
176
  });
163
177
  }
164
178
  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
  }
@@ -12,16 +12,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.IdpUserLicense = void 0;
13
13
  const Base_1 = require("../../../../Base");
14
14
  class IdpUserLicense extends Base_1.default {
15
- getLicense() {
15
+ getLicense(raw) {
16
16
  return __awaiter(this, void 0, void 0, function* () {
17
17
  const res = yield this.axios.get(this.getEndpoint(`/user/license`));
18
- return res.data;
18
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
19
19
  });
20
20
  }
21
- updateLicense(token) {
21
+ updateLicense(token, raw) {
22
22
  return __awaiter(this, void 0, void 0, function* () {
23
23
  const res = yield this.axios.put(this.getEndpoint(`/user/license`), { identifier: token });
24
- return res.data;
24
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
25
25
  });
26
26
  }
27
27
  getEndpoint(endpoint) {
@@ -0,0 +1,61 @@
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
+ }, raw?: {
58
+ raw: R;
59
+ }): Promise<MaybeRaw<R, Message>>;
60
+ protected getEndpoint(endpoint: string): string;
61
+ }
@@ -0,0 +1,92 @@
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.IdpMessage = void 0;
13
+ const Base_1 = require("../../../../Base");
14
+ const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
15
+ const searchFilter_1 = require("../../../../helper/searchFilter");
16
+ class IdpMessage extends Base_1.default {
17
+ /**
18
+ * Search all messages of the requesting user.
19
+ * @returns Paginated response of Message objects
20
+ */
21
+ searchMessages(_a, raw_1) {
22
+ return __awaiter(this, arguments, void 0, function* ({ filters, sorting, limit = 100, page = 0 }, raw) {
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/messages/search`), {
27
+ filters: filtersDTO,
28
+ sorting,
29
+ }, {
30
+ params: { limit, page },
31
+ });
32
+ 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));
33
+ });
34
+ }
35
+ /**
36
+ * Retrieves a single message by ID.
37
+ * @param messageId ID of the message
38
+ * @returns The requested Message object
39
+ */
40
+ getMessage(messageId, raw) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/messages/${messageId}`));
43
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
44
+ });
45
+ }
46
+ /**
47
+ * Mark message as read or unread.
48
+ *
49
+ * @param messageId ID of the Message object
50
+ * @returns the updated Message object
51
+ */
52
+ updateMessage(messageId, read, raw) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/messages/${messageId}/read`), { read });
55
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
56
+ });
57
+ }
58
+ /**
59
+ * Deletes a message of the requesting User.
60
+ * @param messageId Id of the Message
61
+ */
62
+ deleteMessage(messageId, raw) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/messages/${messageId}`));
65
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
66
+ });
67
+ }
68
+ /**
69
+ * Send message to single user or all users of organization or team.
70
+ *
71
+ * This is an internal endpoint.
72
+ *
73
+ * @param msg Message to send
74
+ * - to - should be email, orgName or teamName
75
+ * - recipient - enum type USER, ORGANIZATION or TEAM (by default is USER)
76
+ * - orgName - should be only specified if recipient===TEAM
77
+ * - title - title of the message (max 255 characters)
78
+ * - subject - subject of the message (max 255 characters)
79
+ * - message - content of the message (max 5000 characters)
80
+ * @returns the Message object
81
+ */
82
+ sendMessage(msg, raw) {
83
+ return __awaiter(this, void 0, void 0, function* () {
84
+ const res = yield this.axios.post(this.getEndpoint(`/internal/v1/messages`), msg);
85
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
86
+ });
87
+ }
88
+ getEndpoint(endpoint) {
89
+ return `${this.options.server}/api/account${endpoint}`;
90
+ }
91
+ }
92
+ exports.IdpMessage = IdpMessage;
@@ -1,4 +1,4 @@
1
- import Base from "../../../../Base";
1
+ import Base, { MaybeRaw } from "../../../../Base";
2
2
  import { User } from "../../../../interfaces/idp";
3
3
  export default class UserPasswordService extends Base {
4
4
  /**
@@ -9,7 +9,9 @@ export default class UserPasswordService extends Base {
9
9
  * @param totpToken (Optional) TOTP token in case the user had 2FA enabled
10
10
  * @returns User object
11
11
  */
12
- resetPassword(email: string, nonce: string, newPassword: string, totpToken?: string): Promise<User>;
12
+ resetPassword<R extends boolean = false>(email: string, nonce: string, newPassword: string, totpToken?: string, raw?: {
13
+ raw: R;
14
+ }): Promise<MaybeRaw<R, User>>;
13
15
  parseResetPasswordToken(token: string): {
14
16
  email: string;
15
17
  nonce: string;
@@ -19,7 +19,7 @@ class UserPasswordService extends Base_1.default {
19
19
  * @param totpToken (Optional) TOTP token in case the user had 2FA enabled
20
20
  * @returns User object
21
21
  */
22
- resetPassword(email, nonce, newPassword, totpToken) {
22
+ resetPassword(email, nonce, newPassword, totpToken, raw) {
23
23
  return __awaiter(this, void 0, void 0, function* () {
24
24
  const res = yield this.axios.post(this.getEndpoint("/v1/user/password/reset"), {
25
25
  email,
@@ -27,7 +27,7 @@ class UserPasswordService extends Base_1.default {
27
27
  newPassword,
28
28
  totpToken,
29
29
  });
30
- return res.data;
30
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
31
31
  });
32
32
  }
33
33
  parseResetPasswordToken(token) {
@@ -36,7 +36,7 @@ class UserPasswordService extends Base_1.default {
36
36
  try {
37
37
  obj = JSON.parse(decoded);
38
38
  }
39
- catch (err) {
39
+ catch (_a) {
40
40
  throw new Error(`Token ${token} is poorly formatted. Decoded to ${decoded}.`);
41
41
  }
42
42
  if (!("email" in obj) || !("nonce" in obj)) {
@@ -1,4 +1,4 @@
1
- import Base from "../../../../../Base";
1
+ import Base, { MaybeRaw } from "../../../../../Base";
2
2
  import { ConnectionSettings } from "../../../../../interfaces/idp/user/ConnectionSettings";
3
3
  export declare class IdpConnections extends Base {
4
4
  /**
@@ -8,6 +8,8 @@ export declare class IdpConnections extends Base {
8
8
  *
9
9
  * @returns connection settings for each organization
10
10
  */
11
- get(): Promise<ConnectionSettings>;
11
+ get<R extends boolean = false>(raw?: {
12
+ raw: R;
13
+ }): Promise<MaybeRaw<R, ConnectionSettings>>;
12
14
  protected getEndpoint(): string;
13
15
  }
@@ -19,10 +19,10 @@ class IdpConnections extends Base_1.default {
19
19
  *
20
20
  * @returns connection settings for each organization
21
21
  */
22
- get() {
22
+ get(raw) {
23
23
  return __awaiter(this, void 0, void 0, function* () {
24
24
  const res = yield this.axios.get(this.getEndpoint());
25
- return res.data;
25
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
26
26
  });
27
27
  }
28
28
  getEndpoint() {
@@ -1,22 +1,28 @@
1
- import Base from "../../../../../Base";
1
+ import Base, { MaybeRaw } from "../../../../../Base";
2
2
  import { GeneralSettings, GeneralSettingsLastVisitPatch, GeneralSettingsPatch } from "../../../../../interfaces/idp/user/GeneralSettings";
3
3
  export declare class IdpGeneral extends Base {
4
4
  /**
5
5
  * Retrieves the current active user settings.
6
6
  * @returns the current active user settings
7
7
  */
8
- getGeneralSettings(): Promise<GeneralSettings>;
8
+ getGeneralSettings<R extends boolean = false>(raw?: {
9
+ raw: R;
10
+ }): Promise<MaybeRaw<R, GeneralSettings>>;
9
11
  /**
10
12
  * Changes the user settings.
11
13
  * @param generalSettingsPatch Object containing the new user settings
12
14
  * @returns the updated user settings
13
15
  */
14
- patchGeneralSettings(generalSettingsPatch: GeneralSettingsPatch): Promise<GeneralSettings>;
16
+ patchGeneralSettings<R extends boolean = false>(generalSettingsPatch: GeneralSettingsPatch, raw?: {
17
+ raw: R;
18
+ }): Promise<MaybeRaw<R, GeneralSettings>>;
15
19
  /**
16
20
  * Changes the user last visit settings.
17
21
  * @param generalSettingsLastVisitPatch Object containing the new user settings in case of lastView and lastURL
18
22
  * @returns the updated user settings
19
23
  */
20
- patchGeneralSettingsLastVisit(generalSettingsLastVisitPatch: GeneralSettingsLastVisitPatch): Promise<GeneralSettings>;
24
+ patchGeneralSettingsLastVisit<R extends boolean = false>(generalSettingsLastVisitPatch: GeneralSettingsLastVisitPatch, raw?: {
25
+ raw: R;
26
+ }): Promise<MaybeRaw<R, GeneralSettings>>;
21
27
  protected getEndpoint(endpoint: string): string;
22
28
  }
@@ -16,10 +16,10 @@ class IdpGeneral extends Base_1.default {
16
16
  * Retrieves the current active user settings.
17
17
  * @returns the current active user settings
18
18
  */
19
- getGeneralSettings() {
19
+ getGeneralSettings(raw) {
20
20
  return __awaiter(this, void 0, void 0, function* () {
21
21
  const resp = yield this.axios.get(this.getEndpoint(`/v1/user/settings/general`));
22
- return resp.data;
22
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
23
23
  });
24
24
  }
25
25
  /**
@@ -27,10 +27,10 @@ class IdpGeneral extends Base_1.default {
27
27
  * @param generalSettingsPatch Object containing the new user settings
28
28
  * @returns the updated user settings
29
29
  */
30
- patchGeneralSettings(generalSettingsPatch) {
30
+ patchGeneralSettings(generalSettingsPatch, raw) {
31
31
  return __awaiter(this, void 0, void 0, function* () {
32
32
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/general`), generalSettingsPatch);
33
- return resp.data;
33
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
34
34
  });
35
35
  }
36
36
  /**
@@ -38,10 +38,10 @@ class IdpGeneral extends Base_1.default {
38
38
  * @param generalSettingsLastVisitPatch Object containing the new user settings in case of lastView and lastURL
39
39
  * @returns the updated user settings
40
40
  */
41
- patchGeneralSettingsLastVisit(generalSettingsLastVisitPatch) {
41
+ patchGeneralSettingsLastVisit(generalSettingsLastVisitPatch, raw) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
43
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/general/lastVisit`), generalSettingsLastVisitPatch);
44
- return resp.data;
44
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
45
45
  });
46
46
  }
47
47
  getEndpoint(endpoint) {
@@ -1,16 +1,20 @@
1
- import Base from "../../../../../Base";
1
+ import Base, { MaybeRaw } from "../../../../../Base";
2
2
  import { NotificationSettings, NotificationSettingsPatch } from "../../../../../interfaces/idp/user/NotificationSettings";
3
3
  export declare class IdpNotifications extends Base {
4
4
  /**
5
5
  * Retrieves the notification settings of the requesting user.
6
6
  * @returns general settings of requesting user
7
7
  */
8
- getNotificationSettingsOfUser(): Promise<NotificationSettings>;
8
+ getNotificationSettingsOfUser<R extends boolean = false>(raw?: {
9
+ raw: R;
10
+ }): Promise<MaybeRaw<R, NotificationSettings>>;
9
11
  /**
10
12
  * Updates the notification settings of the requesting user.
11
13
  * @param notificationSettingsPatch Object containing the new notification settings
12
14
  * @returns the updated notification settings
13
15
  */
14
- patchNotificationSettings(notificationSettingsPatch: NotificationSettingsPatch): Promise<NotificationSettings>;
16
+ patchNotificationSettings<R extends boolean = false>(notificationSettingsPatch: NotificationSettingsPatch, raw?: {
17
+ raw: R;
18
+ }): Promise<MaybeRaw<R, NotificationSettings>>;
15
19
  protected getEndpoint(endpoint: string): string;
16
20
  }
@@ -16,10 +16,10 @@ class IdpNotifications extends Base_1.default {
16
16
  * Retrieves the notification settings of the requesting user.
17
17
  * @returns general settings of requesting user
18
18
  */
19
- getNotificationSettingsOfUser() {
19
+ getNotificationSettingsOfUser(raw) {
20
20
  return __awaiter(this, void 0, void 0, function* () {
21
21
  const resp = yield this.axios.get(this.getEndpoint(`/v1/user/settings/notifications`));
22
- return resp.data;
22
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
23
23
  });
24
24
  }
25
25
  /**
@@ -27,10 +27,10 @@ class IdpNotifications extends Base_1.default {
27
27
  * @param notificationSettingsPatch Object containing the new notification settings
28
28
  * @returns the updated notification settings
29
29
  */
30
- patchNotificationSettings(notificationSettingsPatch) {
30
+ patchNotificationSettings(notificationSettingsPatch, raw) {
31
31
  return __awaiter(this, void 0, void 0, function* () {
32
32
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/notifications`), notificationSettingsPatch);
33
- return resp.data;
33
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
34
34
  });
35
35
  }
36
36
  getEndpoint(endpoint) {
@@ -1,4 +1,4 @@
1
- import Base from "../../../../../Base";
1
+ import Base, { MaybeRaw } from "../../../../../Base";
2
2
  import { PaginatedResponse, SearchParams } from "../../../../../interfaces/global";
3
3
  import { OAuthAppWithConsent } from "../../../../../interfaces/idp/organization/settings/oauthApp";
4
4
  export declare class IdpOAuthApps extends Base {
@@ -10,11 +10,15 @@ export declare class IdpOAuthApps extends Base {
10
10
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
11
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
12
  */
13
- searchOAuthApps({ filters, sorting, limit, page }: SearchParams): Promise<PaginatedResponse<OAuthAppWithConsent>>;
13
+ searchOAuthApps<R extends boolean = false>({ filters, sorting, limit, page }: SearchParams, raw?: {
14
+ raw: R;
15
+ }): Promise<MaybeRaw<R, PaginatedResponse<OAuthAppWithConsent>>>;
14
16
  /**
15
17
  * Revokes user access from the provided OAuth app.
16
18
  * @param oAuthAppId ID of the OAuth app
17
19
  */
18
- revokeOAuthAppAccess(oAuthAppId: string): Promise<void>;
20
+ revokeOAuthAppAccess<R extends boolean = false>(oAuthAppId: string, raw?: {
21
+ raw: R;
22
+ }): Promise<MaybeRaw<R, void>>;
19
23
  protected getEndpoint(endpoint: string): string;
20
24
  }