hcloud-sdk 17.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 (275) hide show
  1. package/changelog.md +176 -76
  2. package/lib/Base.d.ts +2 -1
  3. package/lib/Hcloud.d.ts +6 -3
  4. package/lib/Hcloud.js +16 -5
  5. package/lib/helper/ValidationHelper.d.ts +10 -2
  6. package/lib/helper/ValidationHelper.js +55 -7
  7. package/lib/interfaces/auditor/index.d.ts +13 -2
  8. package/lib/interfaces/auditor/index.js +9 -1
  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/namespace/index.d.ts +9 -0
  17. package/lib/interfaces/cosmo/namespace/index.js +9 -0
  18. package/lib/interfaces/cosmo/permissions.d.ts +96 -0
  19. package/lib/interfaces/cosmo/permissions.js +58 -0
  20. package/lib/interfaces/cosmo/share/index.d.ts +28 -0
  21. package/lib/interfaces/cosmo/share/index.js +2 -0
  22. package/lib/interfaces/cosmo/space/index.d.ts +25 -0
  23. package/lib/interfaces/cosmo/space/index.js +2 -0
  24. package/lib/interfaces/cosmo/tag/tag.d.ts +12 -0
  25. package/lib/interfaces/cosmo/tag/tag.js +2 -0
  26. package/lib/interfaces/global/Products.d.ts +2 -2
  27. package/lib/interfaces/global/Products.js +1 -1
  28. package/lib/interfaces/high5/index.d.ts +7 -7
  29. package/lib/interfaces/high5/index.js +7 -7
  30. package/lib/interfaces/{friday → high5}/space/database/document/index.d.ts +1 -1
  31. package/lib/interfaces/{friday → high5}/space/database/document/index.js +2 -1
  32. package/lib/interfaces/high5/space/database/index.js +2 -0
  33. package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +9 -2
  34. package/lib/interfaces/high5/space/execution/index.d.ts +2 -1
  35. package/lib/interfaces/high5/space/job/JobLog.d.ts +16 -0
  36. package/lib/interfaces/high5/space/job/JobLog.js +2 -0
  37. package/lib/interfaces/high5/space/job/index.d.ts +38 -0
  38. package/lib/interfaces/high5/space/job/index.js +8 -0
  39. package/lib/interfaces/high5/stats.d.ts +21 -0
  40. package/lib/interfaces/high5/stats.js +2 -0
  41. package/lib/interfaces/idp/oauth/index.d.ts +4 -3
  42. package/lib/interfaces/idp/organization/index.d.ts +1 -0
  43. package/lib/interfaces/idp/organization/index.js +1 -0
  44. package/lib/interfaces/idp/organization/license/index.d.ts +13 -11
  45. package/lib/interfaces/idp/organization/member/index.d.ts +1 -0
  46. package/lib/interfaces/idp/organization/stats.d.ts +7 -0
  47. package/lib/interfaces/idp/organization/stats.js +2 -0
  48. package/lib/interfaces/idp/organization/team/index.d.ts +0 -1
  49. package/lib/interfaces/idp/user/Message.d.ts +21 -0
  50. package/lib/interfaces/idp/user/Message.js +14 -0
  51. package/lib/interfaces/idp/user/NotificationSettings.d.ts +1 -0
  52. package/lib/interfaces/idp/user/Scopes.d.ts +1 -7
  53. package/lib/interfaces/idp/user/Scopes.js +0 -9
  54. package/lib/interfaces/idp/user/index.d.ts +2 -1
  55. package/lib/interfaces/mailer/index.d.ts +30 -1
  56. package/lib/interfaces/mailer/index.js +87 -1
  57. package/lib/interfaces/mothership/index.d.ts +3 -1
  58. package/lib/interfaces/mothership/index.js +15 -0
  59. package/lib/interfaces/mothership/stats.d.ts +4 -0
  60. package/lib/interfaces/mothership/stats.js +2 -0
  61. package/lib/interfaces/nats/index.d.ts +54 -24
  62. package/lib/interfaces/nats/index.js +87 -58
  63. package/lib/interfaces/shorts/index.d.ts +10 -0
  64. package/lib/interfaces/shorts/index.js +2 -0
  65. package/lib/service/agent/bundle/dev/index.d.ts +16 -6
  66. package/lib/service/agent/bundle/dev/index.js +12 -10
  67. package/lib/service/agent/bundle/index.d.ts +10 -4
  68. package/lib/service/agent/bundle/index.js +6 -6
  69. package/lib/service/agent/context/index.d.ts +22 -8
  70. package/lib/service/agent/context/index.js +15 -14
  71. package/lib/service/auditor/index.d.ts +8 -4
  72. package/lib/service/auditor/index.js +5 -5
  73. package/lib/service/auditor/internal/index.d.ts +27 -3
  74. package/lib/service/auditor/internal/index.js +34 -5
  75. package/lib/service/bouncer/features/index.d.ts +4 -2
  76. package/lib/service/bouncer/features/index.js +2 -2
  77. package/lib/service/cosmo/asset/index.d.ts +219 -0
  78. package/lib/service/cosmo/asset/index.js +314 -0
  79. package/lib/service/cosmo/comment/index.d.ts +122 -0
  80. package/lib/service/cosmo/comment/index.js +161 -0
  81. package/lib/service/cosmo/event/index.d.ts +23 -0
  82. package/lib/service/cosmo/event/index.js +40 -0
  83. package/lib/service/cosmo/folder/index.d.ts +27 -0
  84. package/lib/service/cosmo/folder/index.js +47 -0
  85. package/lib/service/cosmo/index.d.ts +49 -0
  86. package/lib/service/cosmo/index.js +119 -0
  87. package/lib/service/cosmo/internal/index.d.ts +7 -0
  88. package/lib/service/cosmo/internal/index.js +17 -0
  89. package/lib/service/cosmo/internal/space/index.d.ts +15 -0
  90. package/lib/service/cosmo/internal/space/index.js +34 -0
  91. package/lib/service/cosmo/location/index.d.ts +40 -0
  92. package/lib/service/cosmo/location/index.js +63 -0
  93. package/lib/service/cosmo/namespace/index.d.ts +42 -0
  94. package/lib/service/cosmo/namespace/index.js +65 -0
  95. package/lib/service/cosmo/organization/index.d.ts +47 -0
  96. package/lib/service/cosmo/organization/index.js +64 -0
  97. package/lib/service/cosmo/permissions/index.d.ts +131 -0
  98. package/lib/service/cosmo/permissions/index.js +181 -0
  99. package/lib/service/cosmo/production/index.d.ts +26 -0
  100. package/lib/service/cosmo/production/index.js +45 -0
  101. package/lib/service/cosmo/share/index.d.ts +161 -0
  102. package/lib/service/cosmo/share/index.js +215 -0
  103. package/lib/service/cosmo/space/index.d.ts +104 -0
  104. package/lib/service/cosmo/space/index.js +146 -0
  105. package/lib/service/cosmo/tag/index.d.ts +67 -0
  106. package/lib/service/cosmo/tag/index.js +93 -0
  107. package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +10 -4
  108. package/lib/service/dali/avatar/DaliCosmoSpace.js +8 -7
  109. package/lib/service/dali/avatar/DaliFuseSpace.d.ts +10 -4
  110. package/lib/service/dali/avatar/DaliFuseSpace.js +7 -6
  111. package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +10 -4
  112. package/lib/service/dali/avatar/DaliHigh5Pool.js +7 -6
  113. package/lib/service/dali/avatar/DaliHigh5Space.d.ts +10 -4
  114. package/lib/service/dali/avatar/DaliHigh5Space.js +7 -6
  115. package/lib/service/dali/avatar/DaliOAuthApp.d.ts +10 -4
  116. package/lib/service/dali/avatar/DaliOAuthApp.js +7 -6
  117. package/lib/service/dali/avatar/DaliOrganization.d.ts +10 -4
  118. package/lib/service/dali/avatar/DaliOrganization.js +7 -6
  119. package/lib/service/dali/avatar/DaliServiceAccount.d.ts +10 -4
  120. package/lib/service/dali/avatar/DaliServiceAccount.js +7 -6
  121. package/lib/service/dali/avatar/DaliTeam.d.ts +10 -4
  122. package/lib/service/dali/avatar/DaliTeam.js +7 -6
  123. package/lib/service/dali/avatar/DaliUser.d.ts +10 -4
  124. package/lib/service/dali/avatar/DaliUser.js +7 -6
  125. package/lib/service/dali/index.d.ts +4 -5
  126. package/lib/service/dali/index.js +2 -5
  127. package/lib/service/fuse/index.d.ts +4 -2
  128. package/lib/service/fuse/index.js +2 -2
  129. package/lib/service/fuse/internal/index.d.ts +4 -2
  130. package/lib/service/fuse/internal/index.js +3 -2
  131. package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +4 -2
  132. package/lib/service/fuse/internal/space/cronjob/log/index.js +2 -2
  133. package/lib/service/fuse/internal/space/index.d.ts +7 -3
  134. package/lib/service/fuse/internal/space/index.js +6 -4
  135. package/lib/service/fuse/space/cronjob/index.d.ts +35 -13
  136. package/lib/service/fuse/space/cronjob/index.js +48 -50
  137. package/lib/service/fuse/space/cronjob/log/index.d.ts +8 -4
  138. package/lib/service/fuse/space/cronjob/log/index.js +5 -5
  139. package/lib/service/fuse/space/index.d.ts +27 -11
  140. package/lib/service/fuse/space/index.js +19 -18
  141. package/lib/service/high5/execution/index.d.ts +4 -2
  142. package/lib/service/high5/execution/index.js +3 -2
  143. package/lib/service/high5/execution/status/index.d.ts +5 -3
  144. package/lib/service/high5/execution/status/index.js +3 -3
  145. package/lib/service/high5/index.d.ts +7 -2
  146. package/lib/service/high5/index.js +9 -2
  147. package/lib/service/high5/internal/index.d.ts +4 -2
  148. package/lib/service/high5/internal/index.js +3 -2
  149. package/lib/service/high5/internal/space/index.d.ts +10 -3
  150. package/lib/service/high5/internal/space/index.js +13 -4
  151. package/lib/service/high5/internal/space/job/index.d.ts +7 -0
  152. package/lib/service/high5/internal/space/job/index.js +17 -0
  153. package/lib/service/high5/internal/space/job/log/index.d.ts +17 -0
  154. package/lib/service/high5/internal/space/job/log/index.js +34 -0
  155. package/lib/service/high5/joinToken/index.d.ts +14 -6
  156. package/lib/service/high5/joinToken/index.js +10 -9
  157. package/lib/service/high5/space/database/document/array/index.d.ts +73 -0
  158. package/lib/service/high5/space/database/document/array/index.js +102 -0
  159. package/lib/service/{friday → high5}/space/database/document/index.d.ts +26 -10
  160. package/lib/service/{friday → high5}/space/database/document/index.js +31 -16
  161. package/lib/service/high5/space/database/document/number/index.d.ts +51 -0
  162. package/lib/service/high5/space/database/document/number/index.js +77 -0
  163. package/lib/service/{friday → high5}/space/database/index.d.ts +22 -12
  164. package/lib/service/{friday → high5}/space/database/index.js +18 -17
  165. package/lib/service/high5/space/event/index.d.ts +17 -7
  166. package/lib/service/high5/space/event/index.js +12 -11
  167. package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +4 -2
  168. package/lib/service/high5/space/event/stream/design/DesignOperations.js +2 -2
  169. package/lib/service/high5/space/event/stream/design/index.d.ts +10 -4
  170. package/lib/service/high5/space/event/stream/design/index.js +7 -6
  171. package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +16 -6
  172. package/lib/service/high5/space/event/stream/design/snapshot/index.js +12 -10
  173. package/lib/service/high5/space/event/stream/index.d.ts +32 -12
  174. package/lib/service/high5/space/event/stream/index.js +22 -21
  175. package/lib/service/high5/space/execution/index.d.ts +19 -7
  176. package/lib/service/high5/space/execution/index.js +17 -12
  177. package/lib/service/high5/space/execution/log/index.d.ts +8 -4
  178. package/lib/service/high5/space/execution/log/index.js +5 -5
  179. package/lib/service/high5/space/execution/status/index.d.ts +7 -3
  180. package/lib/service/high5/space/execution/status/index.js +4 -4
  181. package/lib/service/high5/space/index.d.ts +43 -14
  182. package/lib/service/high5/space/index.js +45 -23
  183. package/lib/service/high5/space/job/index.d.ts +145 -0
  184. package/lib/service/high5/space/job/index.js +201 -0
  185. package/lib/service/high5/space/job/log/index.d.ts +35 -0
  186. package/lib/service/high5/space/job/log/index.js +58 -0
  187. package/lib/service/high5/space/node/index.d.ts +20 -8
  188. package/lib/service/high5/space/node/index.js +14 -13
  189. package/lib/service/high5/space/pool/index.d.ts +27 -11
  190. package/lib/service/high5/space/pool/index.js +19 -18
  191. package/lib/service/high5/space/secret/index.d.ts +17 -7
  192. package/lib/service/high5/space/secret/index.js +12 -11
  193. package/lib/service/high5/space/stat/index.d.ts +12 -0
  194. package/lib/service/high5/space/stat/index.js +31 -0
  195. package/lib/service/high5/space/wave/index.d.ts +16 -6
  196. package/lib/service/high5/space/wave/index.js +11 -10
  197. package/lib/service/high5/space/webhook/index.d.ts +32 -12
  198. package/lib/service/high5/space/webhook/index.js +25 -21
  199. package/lib/service/high5/space/webhook/log/index.d.ts +4 -2
  200. package/lib/service/high5/space/webhook/log/index.js +2 -2
  201. package/lib/service/high5/stat/index.d.ts +11 -0
  202. package/lib/service/high5/stat/index.js +30 -0
  203. package/lib/service/high5/wave/s3/index.d.ts +31 -8
  204. package/lib/service/high5/wave/s3/index.js +42 -21
  205. package/lib/service/idp/guest/index.d.ts +42 -0
  206. package/lib/service/idp/guest/index.js +66 -0
  207. package/lib/service/idp/index.d.ts +25 -7
  208. package/lib/service/idp/index.js +23 -12
  209. package/lib/service/idp/internal/index.d.ts +5 -3
  210. package/lib/service/idp/internal/index.js +5 -3
  211. package/lib/service/idp/oauth/index.d.ts +16 -6
  212. package/lib/service/idp/oauth/index.js +15 -15
  213. package/lib/service/idp/organization/index.d.ts +19 -5
  214. package/lib/service/idp/organization/index.js +19 -8
  215. package/lib/service/idp/organization/license/index.d.ts +7 -3
  216. package/lib/service/idp/organization/license/index.js +4 -4
  217. package/lib/service/idp/organization/member/index.d.ts +20 -8
  218. package/lib/service/idp/organization/member/index.js +15 -13
  219. package/lib/service/idp/organization/member/invitations/index.d.ts +23 -9
  220. package/lib/service/idp/organization/member/invitations/index.js +72 -59
  221. package/lib/service/idp/organization/service-accounts/index.d.ts +20 -8
  222. package/lib/service/idp/organization/service-accounts/index.js +13 -12
  223. package/lib/service/idp/organization/settings/domain/index.d.ts +13 -5
  224. package/lib/service/idp/organization/settings/domain/index.js +9 -8
  225. package/lib/service/idp/organization/settings/domain/saml/index.d.ts +16 -6
  226. package/lib/service/idp/organization/settings/domain/saml/index.js +19 -18
  227. package/lib/service/idp/organization/settings/oauth/index.d.ts +23 -9
  228. package/lib/service/idp/organization/settings/oauth/index.js +16 -15
  229. package/lib/service/idp/organization/stat/index.d.ts +11 -0
  230. package/lib/service/idp/organization/stat/index.js +30 -0
  231. package/lib/service/idp/organization/team/index.d.ts +22 -10
  232. package/lib/service/idp/organization/team/index.js +14 -13
  233. package/lib/service/idp/registration/index.d.ts +10 -4
  234. package/lib/service/idp/registration/index.js +15 -9
  235. package/lib/service/idp/user/index.d.ts +33 -11
  236. package/lib/service/idp/user/index.js +29 -16
  237. package/lib/service/idp/user/license/index.d.ts +7 -3
  238. package/lib/service/idp/user/license/index.js +4 -4
  239. package/lib/service/idp/user/message/index.d.ts +61 -0
  240. package/lib/service/idp/user/message/index.js +92 -0
  241. package/lib/service/idp/user/password/index.d.ts +4 -2
  242. package/lib/service/idp/user/password/index.js +2 -2
  243. package/lib/service/idp/user/settings/connections/index.d.ts +4 -2
  244. package/lib/service/idp/user/settings/connections/index.js +2 -2
  245. package/lib/service/idp/user/settings/general/index.d.ts +10 -4
  246. package/lib/service/idp/user/settings/general/index.js +6 -6
  247. package/lib/service/idp/user/settings/notifications/index.d.ts +7 -3
  248. package/lib/service/idp/user/settings/notifications/index.js +4 -4
  249. package/lib/service/idp/user/settings/oauthApps/index.d.ts +7 -3
  250. package/lib/service/idp/user/settings/oauthApps/index.js +6 -5
  251. package/lib/service/idp/user/settings/pats/index.d.ts +22 -8
  252. package/lib/service/idp/user/settings/pats/index.js +17 -15
  253. package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +16 -6
  254. package/lib/service/idp/user/settings/twoFactor/totp/index.js +13 -10
  255. package/lib/service/mailer/index.d.ts +4 -2
  256. package/lib/service/mailer/index.js +2 -2
  257. package/lib/service/mailer/internal/index.d.ts +13 -5
  258. package/lib/service/mailer/internal/index.js +8 -8
  259. package/lib/service/mothership/index.d.ts +35 -13
  260. package/lib/service/mothership/index.js +32 -17
  261. package/lib/service/nats/index.js +58 -43
  262. package/lib/service/shorts/index.d.ts +18 -0
  263. package/lib/service/{friday → shorts}/index.js +13 -10
  264. package/lib/service/shorts/internal/index.d.ts +72 -0
  265. package/lib/service/shorts/internal/index.js +104 -0
  266. package/package.json +1 -1
  267. package/lib/interfaces/friday/index.d.ts +0 -3
  268. package/lib/interfaces/friday/index.js +0 -19
  269. package/lib/interfaces/friday/space/index.d.ts +0 -21
  270. package/lib/interfaces/friday/space/index.js +0 -11
  271. package/lib/service/friday/index.d.ts +0 -13
  272. package/lib/service/friday/space/index.d.ts +0 -81
  273. package/lib/service/friday/space/index.js +0 -150
  274. /package/lib/interfaces/{friday/space/database → cosmo/location}/index.js +0 -0
  275. /package/lib/interfaces/{friday → high5}/space/database/index.d.ts +0 -0
@@ -22,8 +22,8 @@ class IdpOAuthApps extends Base_1.default {
22
22
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
23
23
  * @returns Object containing an array of OAuth apps and the total number of results found in the database (independent of limit and page)
24
24
  */
25
- searchOAuthApps(_a) {
26
- return __awaiter(this, arguments, void 0, function* ({ filters, sorting, limit = 25, page = 0 }) {
25
+ searchOAuthApps(_a, raw_1) {
26
+ return __awaiter(this, arguments, void 0, function* ({ filters, sorting, limit = 25, page = 0 }, raw) {
27
27
  const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
28
28
  return new searchFilter_1.SearchFilterDTO(f);
29
29
  });
@@ -36,16 +36,17 @@ class IdpOAuthApps extends Base_1.default {
36
36
  page,
37
37
  },
38
38
  });
39
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
39
+ 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));
40
40
  });
41
41
  }
42
42
  /**
43
43
  * Revokes user access from the provided OAuth app.
44
44
  * @param oAuthAppId ID of the OAuth app
45
45
  */
46
- revokeOAuthAppAccess(oAuthAppId) {
46
+ revokeOAuthAppAccess(oAuthAppId, raw) {
47
47
  return __awaiter(this, void 0, void 0, function* () {
48
- yield this.axios.delete(this.getEndpoint(`/v1/user/settings/oauth/${oAuthAppId}/revoke`));
48
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/user/settings/oauth/${oAuthAppId}/revoke`));
49
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
49
50
  });
50
51
  }
51
52
  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 { Pat, PatCreate, PatUpdate } from "../../../../../interfaces/idp/user/Pat";
4
4
  export declare class IdpPat extends Base {
@@ -6,25 +6,33 @@ export declare class IdpPat extends Base {
6
6
  * Search all personal access tokens (PATs) of the requesting user.
7
7
  * @returns Paginated response of PAT objects
8
8
  */
9
- searchPats({ filters, sorting, limit, page }: SearchParams): Promise<PaginatedResponse<Pat>>;
9
+ searchPats<R extends boolean = false>({ filters, sorting, limit, page }: SearchParams, raw?: {
10
+ raw: R;
11
+ }): Promise<MaybeRaw<R, PaginatedResponse<Pat>>>;
10
12
  /**
11
13
  * Retrieves a single personal access token (PAT) by ID.
12
14
  * @param patId ID of the PAT
13
15
  * @returns The requested PAT object
14
16
  */
15
- getPat(patId: string): Promise<Pat>;
17
+ getPat<R extends boolean = false>(patId: string, raw?: {
18
+ raw: R;
19
+ }): Promise<MaybeRaw<R, Pat>>;
16
20
  /**
17
21
  * Regenerates a personal access token (PAT).
18
22
  * @param patId ID of the PAT
19
23
  * @returns PAT object holding the updated token
20
24
  */
21
- regeneratePat(patId: string, token?: string): Promise<Pat>;
25
+ regeneratePat<R extends boolean = false>(patId: string, token?: string, raw?: {
26
+ raw: R;
27
+ }): Promise<MaybeRaw<R, Pat>>;
22
28
  /**
23
29
  * Creates a new personal access token (PAT) for requesting user
24
30
  * @param patCreate Object with informations needed to create a PAT: Name, expiration and scopes
25
31
  * @returns the created PAT object
26
32
  */
27
- generatePat(patCreate: PatCreate): Promise<Pat>;
33
+ generatePat<R extends boolean = false>(patCreate: PatCreate, raw?: {
34
+ raw: R;
35
+ }): Promise<MaybeRaw<R, Pat>>;
28
36
  /**
29
37
  * Updates an existing PAT object.
30
38
  *
@@ -34,15 +42,21 @@ export declare class IdpPat extends Base {
34
42
  * @param patUpdate Object containing new name, expiration and scopes
35
43
  * @returns the updated PAT object
36
44
  */
37
- updatePat(patId: string, patUpdate: PatUpdate): Promise<Pat>;
45
+ updatePat<R extends boolean = false>(patId: string, patUpdate: PatUpdate, raw?: {
46
+ raw: R;
47
+ }): Promise<MaybeRaw<R, Pat>>;
38
48
  /**
39
49
  * Deletes a personal access token (PAT) of the requesting User.
40
50
  * @param patId Id of the PAT
41
51
  */
42
- deletePat(patId: string): Promise<void>;
52
+ deletePat<R extends boolean = false>(patId: string, raw?: {
53
+ raw: R;
54
+ }): Promise<MaybeRaw<R, void>>;
43
55
  /**
44
56
  * Deletes all personal access tokens (PATs) of the requesting User.
45
57
  */
46
- deleteAllPats(): Promise<void>;
58
+ deleteAllPats<R extends boolean = false>(raw?: {
59
+ raw: R;
60
+ }): Promise<MaybeRaw<R, void>>;
47
61
  protected getEndpoint(endpoint: string): string;
48
62
  }
@@ -18,8 +18,8 @@ class IdpPat extends Base_1.default {
18
18
  * Search all personal access tokens (PATs) of the requesting user.
19
19
  * @returns Paginated response of PAT objects
20
20
  */
21
- searchPats(_a) {
22
- return __awaiter(this, arguments, void 0, function* ({ filters, sorting, limit = 25, page = 0 }) {
21
+ searchPats(_a, raw_1) {
22
+ return __awaiter(this, arguments, void 0, function* ({ filters, sorting, limit = 25, page = 0 }, raw) {
23
23
  const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
24
24
  return new searchFilter_1.SearchFilterDTO(f);
25
25
  });
@@ -29,7 +29,7 @@ class IdpPat extends Base_1.default {
29
29
  }, {
30
30
  params: { limit, page },
31
31
  });
32
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
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
33
  });
34
34
  }
35
35
  /**
@@ -37,10 +37,10 @@ class IdpPat extends Base_1.default {
37
37
  * @param patId ID of the PAT
38
38
  * @returns The requested PAT object
39
39
  */
40
- getPat(patId) {
40
+ getPat(patId, raw) {
41
41
  return __awaiter(this, void 0, void 0, function* () {
42
42
  const resp = yield this.axios.get(this.getEndpoint(`/v1/user/settings/pats/${patId}`));
43
- return resp.data;
43
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
44
44
  });
45
45
  }
46
46
  /**
@@ -48,10 +48,10 @@ class IdpPat extends Base_1.default {
48
48
  * @param patId ID of the PAT
49
49
  * @returns PAT object holding the updated token
50
50
  */
51
- regeneratePat(patId, token) {
51
+ regeneratePat(patId, token, raw) {
52
52
  return __awaiter(this, void 0, void 0, function* () {
53
53
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/pats/${patId}/regenerate`), { token });
54
- return resp.data;
54
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
55
55
  });
56
56
  }
57
57
  /**
@@ -59,10 +59,10 @@ class IdpPat extends Base_1.default {
59
59
  * @param patCreate Object with informations needed to create a PAT: Name, expiration and scopes
60
60
  * @returns the created PAT object
61
61
  */
62
- generatePat(patCreate) {
62
+ generatePat(patCreate, raw) {
63
63
  return __awaiter(this, void 0, void 0, function* () {
64
64
  const resp = yield this.axios.post(this.getEndpoint(`/v1/user/settings/pats`), patCreate);
65
- return resp.data;
65
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
66
66
  });
67
67
  }
68
68
  /**
@@ -74,27 +74,29 @@ class IdpPat extends Base_1.default {
74
74
  * @param patUpdate Object containing new name, expiration and scopes
75
75
  * @returns the updated PAT object
76
76
  */
77
- updatePat(patId, patUpdate) {
77
+ updatePat(patId, patUpdate, raw) {
78
78
  return __awaiter(this, void 0, void 0, function* () {
79
79
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/pats/${patId}`), patUpdate);
80
- return resp.data;
80
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
81
81
  });
82
82
  }
83
83
  /**
84
84
  * Deletes a personal access token (PAT) of the requesting User.
85
85
  * @param patId Id of the PAT
86
86
  */
87
- deletePat(patId) {
87
+ deletePat(patId, raw) {
88
88
  return __awaiter(this, void 0, void 0, function* () {
89
- yield this.axios.delete(this.getEndpoint(`/v1/user/settings/pats/${patId}`));
89
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/user/settings/pats/${patId}`));
90
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
90
91
  });
91
92
  }
92
93
  /**
93
94
  * Deletes all personal access tokens (PATs) of the requesting User.
94
95
  */
95
- deleteAllPats() {
96
+ deleteAllPats(raw) {
96
97
  return __awaiter(this, void 0, void 0, function* () {
97
- yield this.axios.delete(this.getEndpoint(`/v1/user/settings/pats`));
98
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/user/settings/pats`));
99
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
98
100
  });
99
101
  }
100
102
  getEndpoint(endpoint) {
@@ -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
  }
@@ -16,40 +16,42 @@ class IdpTotp extends Base_1.default {
16
16
  * Creates a new TOTP for the requesting User.
17
17
  * @returns A deactivated TOTP object containing all necessary data to create a QR code
18
18
  */
19
- createTotp() {
19
+ createTotp(raw) {
20
20
  return __awaiter(this, void 0, void 0, function* () {
21
21
  const resp = yield this.axios.post(this.getEndpoint(`/v1/user/settings/security/2fa/totp`));
22
- return resp.data;
22
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
23
23
  });
24
24
  }
25
25
  /**
26
26
  * Activates a previously created TOTP.
27
27
  * @returns Object containing a list of recover codes in case of TOTP authenticator loss
28
28
  */
29
- activateTotp(token) {
29
+ activateTotp(token, raw) {
30
30
  return __awaiter(this, void 0, void 0, function* () {
31
31
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/security/2fa/totp/activate`), { token });
32
- return resp.data;
32
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
33
33
  });
34
34
  }
35
35
  /**
36
36
  * Verifies a TOTP.
37
37
  * @param userTotp TOTP to verify
38
38
  */
39
- verifyTotp(userTotp) {
39
+ verifyTotp(userTotp, raw) {
40
40
  return __awaiter(this, void 0, void 0, function* () {
41
- yield this.axios.patch(this.getEndpoint(`/v1/login/verify/totp`), {
41
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/login/verify/totp`), {
42
42
  userTotp,
43
43
  });
44
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
44
45
  });
45
46
  }
46
47
  /**
47
48
  * Deactivates (deletes) a previously activated TOTP.
48
49
  * @param token TOTP to deactivate
49
50
  */
50
- deactivateTotp(token) {
51
+ deactivateTotp(token, raw) {
51
52
  return __awaiter(this, void 0, void 0, function* () {
52
- yield this.axios.delete(this.getEndpoint(`/v1/user/settings/security/2fa/totp`), { data: { token } });
53
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/user/settings/security/2fa/totp`), { data: { token } });
54
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
53
55
  });
54
56
  }
55
57
  /**
@@ -58,11 +60,12 @@ class IdpTotp extends Base_1.default {
58
60
  * @param password Password
59
61
  * @param code Recovery code
60
62
  */
61
- deactivateTotpByRecoverCode(email, password, code) {
63
+ deactivateTotpByRecoverCode(email, password, code, raw) {
62
64
  return __awaiter(this, void 0, void 0, function* () {
63
- yield this.axios.delete(this.getEndpoint(`/v1/user/recover/totp`), {
65
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/user/recover/totp`), {
64
66
  data: { email, password, code },
65
67
  });
68
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
66
69
  });
67
70
  }
68
71
  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
  }
@@ -22,10 +22,10 @@ class Mailer extends Base_1.default {
22
22
  * Requests the endpoint version
23
23
  * @returns Version object
24
24
  */
25
- version() {
25
+ version(raw) {
26
26
  return __awaiter(this, void 0, void 0, function* () {
27
27
  const resp = yield this.axios.get(this.getEndpoint("/v1/version"), {});
28
- return resp.data;
28
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
29
29
  });
30
30
  }
31
31
  getEndpoint(endpoint) {
@@ -1,4 +1,4 @@
1
- import Base from "../../../Base";
1
+ import Base, { MaybeRaw } from "../../../Base";
2
2
  import { HtmlMail, MailjetMailDTO, MustacheMail, TemplateMail } from "../../../interfaces/mailer";
3
3
  export default class MailerInternal extends Base {
4
4
  /**
@@ -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, void>>;
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
  }
@@ -17,10 +17,10 @@ class MailerInternal extends Base_1.default {
17
17
  * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
18
18
  * @param mail MailjetMailDTO
19
19
  */
20
- sendMailMailjet(mail) {
20
+ sendMailMailjet(mail, raw) {
21
21
  return __awaiter(this, void 0, void 0, function* () {
22
22
  const resp = yield this.axios.post(this.getEndpoint("/v1/send/mailjet"), mail);
23
- return resp.data;
23
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
24
24
  });
25
25
  }
26
26
  /**
@@ -30,10 +30,10 @@ class MailerInternal extends Base_1.default {
30
30
  * @param mail TemplateMail
31
31
  * @deprecated in favor of sendMailMailjet
32
32
  */
33
- sendMailMustache(mail) {
33
+ sendMailMustache(mail, raw) {
34
34
  return __awaiter(this, void 0, void 0, function* () {
35
35
  const resp = yield this.axios.post(this.getEndpoint("/v1/send/mustache"), mail);
36
- return resp.data;
36
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
37
37
  });
38
38
  }
39
39
  /**
@@ -43,10 +43,10 @@ class MailerInternal extends Base_1.default {
43
43
  * @param mail TemplateMail
44
44
  * @deprecated in favor of sendMailMailjet
45
45
  */
46
- sendMailHtml(mail) {
46
+ sendMailHtml(mail, raw) {
47
47
  return __awaiter(this, void 0, void 0, function* () {
48
48
  const resp = yield this.axios.post(this.getEndpoint("/v1/send/html"), mail);
49
- return resp.data;
49
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
50
50
  });
51
51
  }
52
52
  /**
@@ -56,10 +56,10 @@ class MailerInternal extends Base_1.default {
56
56
  * @param mail TemplateMail
57
57
  * @deprecated in favor of sendMailMailjet
58
58
  */
59
- sendMailTemplate(mail) {
59
+ sendMailTemplate(mail, raw) {
60
60
  return __awaiter(this, void 0, void 0, function* () {
61
61
  const resp = yield this.axios.post(this.getEndpoint("/v1/send/template"), mail);
62
- return resp.data;
62
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
63
63
  });
64
64
  }
65
65
  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 {};