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
@@ -1,32 +1,42 @@
1
- import Base from "../../../../../../Base";
1
+ import Base, { MaybeRaw } from "../../../../../../Base";
2
2
  import { ActivatedTotp, DeactivatedTotp, UserTotp } from "../../../../../../interfaces/idp/user/Totp";
3
3
  export declare class IdpTotp extends Base {
4
4
  /**
5
5
  * Creates a new TOTP for the requesting User.
6
6
  * @returns A deactivated TOTP object containing all necessary data to create a QR code
7
7
  */
8
- createTotp(): Promise<DeactivatedTotp>;
8
+ createTotp<R extends boolean = false>(raw?: {
9
+ raw: R;
10
+ }): Promise<MaybeRaw<R, DeactivatedTotp>>;
9
11
  /**
10
12
  * Activates a previously created TOTP.
11
13
  * @returns Object containing a list of recover codes in case of TOTP authenticator loss
12
14
  */
13
- activateTotp(token: string): Promise<ActivatedTotp>;
15
+ activateTotp<R extends boolean = false>(token: string, raw?: {
16
+ raw: R;
17
+ }): Promise<MaybeRaw<R, ActivatedTotp>>;
14
18
  /**
15
19
  * Verifies a TOTP.
16
20
  * @param userTotp TOTP to verify
17
21
  */
18
- verifyTotp(userTotp: UserTotp): Promise<void>;
22
+ verifyTotp<R extends boolean = false>(userTotp: UserTotp, raw?: {
23
+ raw: R;
24
+ }): Promise<MaybeRaw<R, void>>;
19
25
  /**
20
26
  * Deactivates (deletes) a previously activated TOTP.
21
27
  * @param token TOTP to deactivate
22
28
  */
23
- deactivateTotp(token: string): Promise<void>;
29
+ deactivateTotp<R extends boolean = false>(token: string, raw?: {
30
+ raw: R;
31
+ }): Promise<MaybeRaw<R, void>>;
24
32
  /**
25
33
  * Deactivates (deletes) a previously activated TOTP by using a recovery code.
26
34
  * @param email Email of the User
27
35
  * @param password Password
28
36
  * @param code Recovery code
29
37
  */
30
- deactivateTotpByRecoverCode(email: string, password: string, code: string): Promise<void>;
38
+ deactivateTotpByRecoverCode<R extends boolean = false>(email: string, password: string, code: string, raw?: {
39
+ raw: R;
40
+ }): Promise<MaybeRaw<R, void>>;
31
41
  protected getEndpoint(endpoint: string): string;
32
42
  }
@@ -8,48 +8,53 @@ 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.IdpTotp = void 0;
13
- const Base_1 = require("../../../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../../../Base"));
14
17
  class IdpTotp extends Base_1.default {
15
18
  /**
16
19
  * Creates a new TOTP for the requesting User.
17
20
  * @returns A deactivated TOTP object containing all necessary data to create a QR code
18
21
  */
19
- createTotp() {
22
+ createTotp(raw) {
20
23
  return __awaiter(this, void 0, void 0, function* () {
21
24
  const resp = yield this.axios.post(this.getEndpoint(`/v1/user/settings/security/2fa/totp`));
22
- return resp.data;
25
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
23
26
  });
24
27
  }
25
28
  /**
26
29
  * Activates a previously created TOTP.
27
30
  * @returns Object containing a list of recover codes in case of TOTP authenticator loss
28
31
  */
29
- activateTotp(token) {
32
+ activateTotp(token, raw) {
30
33
  return __awaiter(this, void 0, void 0, function* () {
31
34
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/security/2fa/totp/activate`), { token });
32
- return resp.data;
35
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
33
36
  });
34
37
  }
35
38
  /**
36
39
  * Verifies a TOTP.
37
40
  * @param userTotp TOTP to verify
38
41
  */
39
- verifyTotp(userTotp) {
42
+ verifyTotp(userTotp, raw) {
40
43
  return __awaiter(this, void 0, void 0, function* () {
41
- yield this.axios.patch(this.getEndpoint(`/v1/login/verify/totp`), {
44
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/login/verify/totp`), {
42
45
  userTotp,
43
46
  });
47
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
44
48
  });
45
49
  }
46
50
  /**
47
51
  * Deactivates (deletes) a previously activated TOTP.
48
52
  * @param token TOTP to deactivate
49
53
  */
50
- deactivateTotp(token) {
54
+ deactivateTotp(token, raw) {
51
55
  return __awaiter(this, void 0, void 0, function* () {
52
- yield this.axios.delete(this.getEndpoint(`/v1/user/settings/security/2fa/totp`), { data: { token } });
56
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/user/settings/security/2fa/totp`), { data: { token } });
57
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
53
58
  });
54
59
  }
55
60
  /**
@@ -58,11 +63,12 @@ class IdpTotp extends Base_1.default {
58
63
  * @param password Password
59
64
  * @param code Recovery code
60
65
  */
61
- deactivateTotpByRecoverCode(email, password, code) {
66
+ deactivateTotpByRecoverCode(email, password, code, raw) {
62
67
  return __awaiter(this, void 0, void 0, function* () {
63
- yield this.axios.delete(this.getEndpoint(`/v1/user/recover/totp`), {
68
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/user/recover/totp`), {
64
69
  data: { email, password, code },
65
70
  });
71
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
66
72
  });
67
73
  }
68
74
  getEndpoint(endpoint) {
@@ -1,4 +1,4 @@
1
- import Base from "../../Base";
1
+ import Base, { MaybeRaw } from "../../Base";
2
2
  import { Version } from "../../interfaces/global";
3
3
  import MailerInternal from "./internal";
4
4
  export default class Mailer extends Base {
@@ -8,6 +8,8 @@ export default class Mailer extends Base {
8
8
  * Requests the endpoint version
9
9
  * @returns Version object
10
10
  */
11
- version(): Promise<Version>;
11
+ version<R extends boolean = false>(raw?: {
12
+ raw: R;
13
+ }): Promise<MaybeRaw<R, Version>>;
12
14
  protected getEndpoint(endpoint: string): string;
13
15
  }
@@ -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
- const Base_1 = require("../../Base");
13
- const internal_1 = require("./internal");
15
+ const Base_1 = __importDefault(require("../../Base"));
16
+ const internal_1 = __importDefault(require("./internal"));
14
17
  class Mailer extends Base_1.default {
15
18
  get internal() {
16
19
  if (this._internal === undefined) {
@@ -22,10 +25,10 @@ class Mailer extends Base_1.default {
22
25
  * Requests the endpoint version
23
26
  * @returns Version object
24
27
  */
25
- version() {
28
+ version(raw) {
26
29
  return __awaiter(this, void 0, void 0, function* () {
27
30
  const resp = yield this.axios.get(this.getEndpoint("/v1/version"), {});
28
- return resp.data;
31
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
29
32
  });
30
33
  }
31
34
  getEndpoint(endpoint) {
@@ -1,5 +1,5 @@
1
- import Base from "../../../Base";
2
- import { HtmlMail, MailjetMailDTO, MustacheMail, TemplateMail } from "../../../interfaces/mailer";
1
+ import Base, { MaybeRaw } from "../../../Base";
2
+ import { HtmlMail, MailjetMailDTO, MailjetResponse, MustacheMail, TemplateMail } from "../../../interfaces/mailer";
3
3
  export default class MailerInternal extends Base {
4
4
  /**
5
5
  * Sends a new mail based on a mailjet template.
@@ -7,7 +7,9 @@ export default class MailerInternal extends Base {
7
7
  * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
8
8
  * @param mail MailjetMailDTO
9
9
  */
10
- sendMailMailjet(mail: MailjetMailDTO): Promise<void>;
10
+ sendMailMailjet<R extends boolean = false>(mail: MailjetMailDTO, raw?: {
11
+ raw: R;
12
+ }): Promise<MaybeRaw<R, MailjetResponse>>;
11
13
  /**
12
14
  * Sends a new mail based on a mustache html body.
13
15
  *
@@ -15,7 +17,9 @@ export default class MailerInternal extends Base {
15
17
  * @param mail TemplateMail
16
18
  * @deprecated in favor of sendMailMailjet
17
19
  */
18
- sendMailMustache(mail: MustacheMail): Promise<void>;
20
+ sendMailMustache<R extends boolean = false>(mail: MustacheMail, raw?: {
21
+ raw: R;
22
+ }): Promise<MaybeRaw<R, void>>;
19
23
  /**
20
24
  * Sends a new mail based on a html body.
21
25
  *
@@ -23,7 +27,9 @@ export default class MailerInternal extends Base {
23
27
  * @param mail TemplateMail
24
28
  * @deprecated in favor of sendMailMailjet
25
29
  */
26
- sendMailHtml(mail: HtmlMail): Promise<void>;
30
+ sendMailHtml<R extends boolean = false>(mail: HtmlMail, raw?: {
31
+ raw: R;
32
+ }): Promise<MaybeRaw<R, void>>;
27
33
  /**
28
34
  * Sends a new mail based on an existing template.
29
35
  *
@@ -31,6 +37,8 @@ export default class MailerInternal extends Base {
31
37
  * @param mail TemplateMail
32
38
  * @deprecated in favor of sendMailMailjet
33
39
  */
34
- sendMailTemplate(mail: TemplateMail): Promise<void>;
40
+ sendMailTemplate<R extends boolean = false>(mail: TemplateMail, raw?: {
41
+ raw: R;
42
+ }): Promise<MaybeRaw<R, void>>;
35
43
  protected getEndpoint(endpoint: string): string;
36
44
  }
@@ -8,8 +8,11 @@ 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
- const Base_1 = require("../../../Base");
15
+ const Base_1 = __importDefault(require("../../../Base"));
13
16
  class MailerInternal extends Base_1.default {
14
17
  /**
15
18
  * Sends a new mail based on a mailjet template.
@@ -17,10 +20,10 @@ class MailerInternal extends Base_1.default {
17
20
  * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
18
21
  * @param mail MailjetMailDTO
19
22
  */
20
- sendMailMailjet(mail) {
23
+ sendMailMailjet(mail, raw) {
21
24
  return __awaiter(this, void 0, void 0, function* () {
22
25
  const resp = yield this.axios.post(this.getEndpoint("/v1/send/mailjet"), mail);
23
- return resp.data;
26
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
24
27
  });
25
28
  }
26
29
  /**
@@ -30,10 +33,10 @@ class MailerInternal extends Base_1.default {
30
33
  * @param mail TemplateMail
31
34
  * @deprecated in favor of sendMailMailjet
32
35
  */
33
- sendMailMustache(mail) {
36
+ sendMailMustache(mail, raw) {
34
37
  return __awaiter(this, void 0, void 0, function* () {
35
38
  const resp = yield this.axios.post(this.getEndpoint("/v1/send/mustache"), mail);
36
- return resp.data;
39
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
37
40
  });
38
41
  }
39
42
  /**
@@ -43,10 +46,10 @@ class MailerInternal extends Base_1.default {
43
46
  * @param mail TemplateMail
44
47
  * @deprecated in favor of sendMailMailjet
45
48
  */
46
- sendMailHtml(mail) {
49
+ sendMailHtml(mail, raw) {
47
50
  return __awaiter(this, void 0, void 0, function* () {
48
51
  const resp = yield this.axios.post(this.getEndpoint("/v1/send/html"), mail);
49
- return resp.data;
52
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
50
53
  });
51
54
  }
52
55
  /**
@@ -56,10 +59,10 @@ class MailerInternal extends Base_1.default {
56
59
  * @param mail TemplateMail
57
60
  * @deprecated in favor of sendMailMailjet
58
61
  */
59
- sendMailTemplate(mail) {
62
+ sendMailTemplate(mail, raw) {
60
63
  return __awaiter(this, void 0, void 0, function* () {
61
64
  const resp = yield this.axios.post(this.getEndpoint("/v1/send/template"), mail);
62
- return resp.data;
65
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
63
66
  });
64
67
  }
65
68
  getEndpoint(endpoint) {
@@ -1,6 +1,6 @@
1
- import Base from "../../Base";
1
+ import Base, { MaybeRaw } from "../../Base";
2
2
  import { PaginatedResponse, SearchParams, Version } from "../../interfaces/global";
3
- import { Agent, TargetAgent } from "../../interfaces/mothership";
3
+ import { Agent, Stats, TargetAgent } from "../../interfaces/mothership";
4
4
  type RecurrentInfo = Pick<Agent, "uptime" | "cpuUtilization" | "memoryUsed" | "status">;
5
5
  type HelloInfo = RecurrentInfo & {
6
6
  nickname?: string;
@@ -13,7 +13,9 @@ export default class MothershipService extends Base {
13
13
  * Requests the endpoint version
14
14
  * @returns Version object
15
15
  */
16
- version(): Promise<Version>;
16
+ version<R extends boolean = false>(raw?: {
17
+ raw: R;
18
+ }): Promise<MaybeRaw<R, Version>>;
17
19
  /**
18
20
  * Say hello as an agent to the mothership
19
21
  *
@@ -22,10 +24,12 @@ export default class MothershipService extends Base {
22
24
  * @param info Information about the agent's uuid, hardware and nickname
23
25
  * @return an Agent object
24
26
  */
25
- hello(uuid: string, uuidSignature: string, info: HelloInfo): Promise<{
27
+ hello<R extends boolean = false>(uuid: string, uuidSignature: string, info: HelloInfo, raw?: {
28
+ raw: R;
29
+ }): Promise<MaybeRaw<R, {
26
30
  agent: Agent;
27
31
  token: string;
28
- }>;
32
+ }>>;
29
33
  /**
30
34
  * Say hello again as an agent to the mothership.
31
35
  *
@@ -36,7 +40,9 @@ export default class MothershipService extends Base {
36
40
  * @param info Information about the agent's system resources.
37
41
  * @return an Agent object
38
42
  */
39
- helloAgain(info: RecurrentInfo): Promise<Agent>;
43
+ helloAgain<R extends boolean = false>(info: RecurrentInfo, raw?: {
44
+ raw: R;
45
+ }): Promise<MaybeRaw<R, Agent>>;
40
46
  /**
41
47
  * Register an agent to the mothership.
42
48
  *
@@ -47,9 +53,11 @@ export default class MothershipService extends Base {
47
53
  * @param publicKey the public key of the agent that will be used for cryptography. The agent should remember its private key.
48
54
  * @return an object holding a secret encrypted with the public key. The agent must decrypt it using its private key in order to use the /hello endpoint.
49
55
  */
50
- register(uuid: string, info: Pick<Agent, Exclude<keyof Agent, "uuid" | "createDate" | "modifyDate" | "_id" | "ip">>, publicKey: string | Buffer): Promise<{
56
+ register<R extends boolean = false>(uuid: string, info: Pick<Agent, Exclude<keyof Agent, "uuid" | "createDate" | "modifyDate" | "_id" | "ip">>, publicKey: string | Buffer, raw?: {
57
+ raw: R;
58
+ }): Promise<MaybeRaw<R, {
51
59
  secret: string;
52
- }>;
60
+ }>>;
53
61
  /**
54
62
  * Connect to an organization.
55
63
  *
@@ -61,7 +69,9 @@ export default class MothershipService extends Base {
61
69
  * @param memberToken JWT assigned to a member of the organization
62
70
  * @param email Email of the user owner of the JWT
63
71
  */
64
- connect(orgName: string, memberToken: string, email: string): Promise<void>;
72
+ connect<R extends boolean = false>(orgName: string, memberToken: string, email: string, raw?: {
73
+ raw: R;
74
+ }): Promise<MaybeRaw<R, void>>;
65
75
  /**
66
76
  * Disconnect from an organization.
67
77
  *
@@ -72,7 +82,9 @@ export default class MothershipService extends Base {
72
82
  * @param orgName Name of the organization
73
83
  * @param email Email of the user
74
84
  */
75
- disconnect(orgName: string, email: string): Promise<void>;
85
+ disconnect<R extends boolean = false>(orgName: string, email: string, raw?: {
86
+ raw: R;
87
+ }): Promise<MaybeRaw<R, void>>;
76
88
  /**
77
89
  * Disconnect as a target.
78
90
  *
@@ -82,16 +94,26 @@ export default class MothershipService extends Base {
82
94
  *
83
95
  * @param email Email of the target
84
96
  */
85
- disconnectTarget(email: string): Promise<void>;
97
+ disconnectTarget<R extends boolean = false>(email: string, raw?: {
98
+ raw: R;
99
+ }): Promise<MaybeRaw<R, void>>;
86
100
  /**
87
101
  * Search among the available targets for a given organization.
88
102
  *
89
103
  * @param orgName Name of the organization
90
104
  * @returns Object containing an array of retrieved agents and the total number of available found in the database (independent of limit and page)
91
105
  */
92
- searchAvailableTargets({ orgName, filters, sorting, limit, page, }: SearchParams & {
106
+ searchAvailableTargets<R extends boolean = false>({ orgName, filters, sorting, limit, page }: SearchParams & {
93
107
  orgName: string;
94
- }): Promise<PaginatedResponse<TargetAgent>>;
108
+ }, raw?: {
109
+ raw: R;
110
+ }): Promise<MaybeRaw<R, PaginatedResponse<TargetAgent>>>;
111
+ /**
112
+ * Retrieves usage statistics for a specific organization.
113
+ * @param orgName Name of the organization
114
+ * @returns Statistics information
115
+ */
116
+ getStats(orgName: string): Promise<Stats>;
95
117
  protected getEndpoint(endpoint: string): string;
96
118
  }
97
119
  export {};
@@ -8,8 +8,11 @@ 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
- const Base_1 = require("../../Base");
15
+ const Base_1 = __importDefault(require("../../Base"));
13
16
  const paginatedResponseHelper_1 = require("../../helper/paginatedResponseHelper");
14
17
  const searchFilter_1 = require("../../helper/searchFilter");
15
18
  class MothershipService extends Base_1.default {
@@ -17,10 +20,10 @@ class MothershipService extends Base_1.default {
17
20
  * Requests the endpoint version
18
21
  * @returns Version object
19
22
  */
20
- version() {
23
+ version(raw) {
21
24
  return __awaiter(this, void 0, void 0, function* () {
22
25
  const resp = yield this.axios.get(this.getEndpoint("/v1/version"));
23
- return resp.data;
26
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
24
27
  });
25
28
  }
26
29
  /**
@@ -31,14 +34,15 @@ class MothershipService extends Base_1.default {
31
34
  * @param info Information about the agent's uuid, hardware and nickname
32
35
  * @return an Agent object
33
36
  */
34
- hello(uuid, uuidSignature, info) {
37
+ hello(uuid, uuidSignature, info, raw) {
35
38
  return __awaiter(this, void 0, void 0, function* () {
36
39
  const resp = yield this.axios.post(this.getEndpoint("/v1/hello"), info, {
37
40
  headers: {
38
41
  Authorization: `Bearer ${uuid}.${uuidSignature}`,
39
42
  },
40
43
  });
41
- return { agent: resp.data, token: resp.headers.authorization };
44
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw)
45
+ ? Object.assign(Object.assign({}, resp), { data: { agent: resp.data, token: resp.headers.authorization } }) : { agent: resp.data, token: resp.headers.authorization });
42
46
  });
43
47
  }
44
48
  /**
@@ -51,10 +55,10 @@ class MothershipService extends Base_1.default {
51
55
  * @param info Information about the agent's system resources.
52
56
  * @return an Agent object
53
57
  */
54
- helloAgain(info) {
58
+ helloAgain(info, raw) {
55
59
  return __awaiter(this, void 0, void 0, function* () {
56
60
  const resp = yield this.axios.patch(this.getEndpoint("/v1/hello/again"), info);
57
- return resp.data;
61
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
58
62
  });
59
63
  }
60
64
  /**
@@ -67,13 +71,13 @@ class MothershipService extends Base_1.default {
67
71
  * @param publicKey the public key of the agent that will be used for cryptography. The agent should remember its private key.
68
72
  * @return an object holding a secret encrypted with the public key. The agent must decrypt it using its private key in order to use the /hello endpoint.
69
73
  */
70
- register(uuid, info, publicKey) {
74
+ register(uuid, info, publicKey, raw) {
71
75
  return __awaiter(this, void 0, void 0, function* () {
72
76
  if (typeof publicKey !== "string") {
73
77
  publicKey = publicKey.toString("hex");
74
78
  }
75
79
  const resp = yield this.axios.post(this.getEndpoint("/v1/register"), Object.assign({ uuid, publicKey }, info));
76
- return resp.data;
80
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
77
81
  });
78
82
  }
79
83
  /**
@@ -87,9 +91,10 @@ class MothershipService extends Base_1.default {
87
91
  * @param memberToken JWT assigned to a member of the organization
88
92
  * @param email Email of the user owner of the JWT
89
93
  */
90
- connect(orgName, memberToken, email) {
94
+ connect(orgName, memberToken, email, raw) {
91
95
  return __awaiter(this, void 0, void 0, function* () {
92
- yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/connect`), { memberToken, email });
96
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/connect`), { memberToken, email });
97
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
93
98
  });
94
99
  }
95
100
  /**
@@ -102,9 +107,10 @@ class MothershipService extends Base_1.default {
102
107
  * @param orgName Name of the organization
103
108
  * @param email Email of the user
104
109
  */
105
- disconnect(orgName, email) {
110
+ disconnect(orgName, email, raw) {
106
111
  return __awaiter(this, void 0, void 0, function* () {
107
- yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/connect/${email}`));
112
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/connect/${email}`));
113
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
108
114
  });
109
115
  }
110
116
  /**
@@ -116,9 +122,10 @@ class MothershipService extends Base_1.default {
116
122
  *
117
123
  * @param email Email of the target
118
124
  */
119
- disconnectTarget(email) {
125
+ disconnectTarget(email, raw) {
120
126
  return __awaiter(this, void 0, void 0, function* () {
121
- yield this.axios.delete(this.getEndpoint(`/v1/connect/${email}`));
127
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/connect/${email}`));
128
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
122
129
  });
123
130
  }
124
131
  /**
@@ -127,8 +134,8 @@ class MothershipService extends Base_1.default {
127
134
  * @param orgName Name of the organization
128
135
  * @returns Object containing an array of retrieved agents and the total number of available found in the database (independent of limit and page)
129
136
  */
130
- searchAvailableTargets(_a) {
131
- return __awaiter(this, arguments, void 0, function* ({ orgName, filters, sorting, limit = 25, page = 0, }) {
137
+ searchAvailableTargets(_a, raw_1) {
138
+ return __awaiter(this, arguments, void 0, function* ({ orgName, filters, sorting, limit = 25, page = 0 }, raw) {
132
139
  const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
133
140
  return new searchFilter_1.SearchFilterDTO(f);
134
141
  });
@@ -138,7 +145,18 @@ class MothershipService extends Base_1.default {
138
145
  }, {
139
146
  params: { limit, page },
140
147
  });
141
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
148
+ 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));
149
+ });
150
+ }
151
+ /**
152
+ * Retrieves usage statistics for a specific organization.
153
+ * @param orgName Name of the organization
154
+ * @returns Statistics information
155
+ */
156
+ getStats(orgName) {
157
+ return __awaiter(this, void 0, void 0, function* () {
158
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/stats`));
159
+ return resp.data;
142
160
  });
143
161
  }
144
162
  getEndpoint(endpoint) {
@@ -45,5 +45,12 @@ declare class Nats extends Base {
45
45
  requestAndWaitForResponse(subject: string, type: NatsMessageType, objectType: NatsObjectType, object: unknown, options?: RequestOptions): Promise<Msg | undefined>;
46
46
  respond(msg: Msg | RawMsg, data: unknown): void;
47
47
  protected getEndpoint(endpoint: string): string;
48
+ /**
49
+ * Gracefully closes the NATS connection.
50
+ * * This method uses 'drain' to ensure that all outgoing messages are sent
51
+ * and all buffered incoming messages are processed by their respective subscribers before the connection is physically closed
52
+ * * @returns {Promise<void>} A promise that resolves when the connection is fully drained and closed
53
+ */
54
+ disconnect(): Promise<void>;
48
55
  }
49
56
  export default Nats;