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
@@ -16,17 +16,17 @@ class AgentContext extends Base_1.default {
16
16
  * Retrieves all contexts.
17
17
  * @returns The requested contexts
18
18
  */
19
- getContexts() {
19
+ getContexts(raw) {
20
20
  return __awaiter(this, void 0, void 0, function* () {
21
21
  const resp = yield this.axios.get(this.getEndpoint(`/v1/context`));
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
  * Add a new context.
27
27
  * @returns The newly created context
28
28
  */
29
- addContext(server, email, token, enabled) {
29
+ addContext(server, email, token, enabled, raw) {
30
30
  return __awaiter(this, void 0, void 0, function* () {
31
31
  const resp = yield this.axios.post(this.getEndpoint(`/v1/context`), {
32
32
  server,
@@ -34,28 +34,28 @@ class AgentContext extends Base_1.default {
34
34
  token,
35
35
  enabled,
36
36
  });
37
- return resp.data;
37
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
38
38
  });
39
39
  }
40
40
  /**
41
41
  * Add a new context by using a service accounts PAT token.
42
42
  * @returns The newly created context
43
43
  */
44
- addServiceAccountContext(server, token, enabled) {
44
+ addServiceAccountContext(server, token, enabled, raw) {
45
45
  return __awaiter(this, void 0, void 0, function* () {
46
46
  const resp = yield this.axios.post(this.getEndpoint(`/v1/context`), {
47
47
  server,
48
48
  token: token.toLowerCase().startsWith("bearer") ? token : `Bearer ${token}`,
49
49
  enabled,
50
50
  });
51
- return resp.data;
51
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
52
52
  });
53
53
  }
54
54
  /**
55
55
  * Update an existing context.
56
56
  * @returns The updated context
57
57
  */
58
- updateContext(uuid, server, email, token, enabled) {
58
+ updateContext(uuid, server, email, token, enabled, raw) {
59
59
  return __awaiter(this, void 0, void 0, function* () {
60
60
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/context/${uuid}`), {
61
61
  server,
@@ -63,38 +63,39 @@ class AgentContext extends Base_1.default {
63
63
  token,
64
64
  enabled,
65
65
  });
66
- return resp.data;
66
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
67
67
  });
68
68
  }
69
69
  /**
70
70
  * Get an existing context.
71
71
  * @returns The requested context
72
72
  */
73
- getContext(uuid) {
73
+ getContext(uuid, raw) {
74
74
  return __awaiter(this, void 0, void 0, function* () {
75
75
  const resp = yield this.axios.get(this.getEndpoint(`/v1/context/${uuid}`));
76
- return resp.data;
76
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
77
77
  });
78
78
  }
79
79
  /**
80
80
  * Delete a context.
81
81
  * @returns void
82
82
  */
83
- deleteContext(uuid) {
83
+ deleteContext(uuid, raw) {
84
84
  return __awaiter(this, void 0, void 0, function* () {
85
- yield this.axios.delete(this.getEndpoint(`/v1/context/${uuid}`));
85
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/context/${uuid}`));
86
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
86
87
  });
87
88
  }
88
89
  /**
89
90
  * Patch the enabled property of a Context.
90
91
  * @returns Updated Context
91
92
  */
92
- patchContextEnabled(uuid, enabled) {
93
+ patchContextEnabled(uuid, enabled, raw) {
93
94
  return __awaiter(this, void 0, void 0, function* () {
94
95
  const res = yield this.axios.patch(this.getEndpoint(`/v1/context/${uuid}/enabled`), {
95
96
  enabled,
96
97
  });
97
- return res.data;
98
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
98
99
  });
99
100
  }
100
101
  getEndpoint(endpoint) {
@@ -1,4 +1,4 @@
1
- import Base from "../../Base";
1
+ import Base, { MaybeRaw } from "../../Base";
2
2
  import { AuditLog } from "../../interfaces/auditor";
3
3
  import { PaginatedResponse, SearchParams, Version } from "../../interfaces/global";
4
4
  import { AuditorInternal } from "./internal";
@@ -8,7 +8,9 @@ export default class Auditor extends Base {
8
8
  /**
9
9
  * @returns An object containing the endpoint version as a string
10
10
  */
11
- version(): Promise<Version>;
11
+ version<R extends boolean = false>(raw?: {
12
+ raw: R;
13
+ }): Promise<MaybeRaw<R, Version>>;
12
14
  /**
13
15
  * Returns all audit logs for an organization which match the search filter
14
16
  * @param organizationName Name of the organization
@@ -18,8 +20,10 @@ export default class Auditor extends Base {
18
20
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
19
21
  * @returns Object containing an array of audit logs and the total number of results found in the database (independent of limit and page)
20
22
  */
21
- searchAuditLogs({ organizationName, filters, sorting, limit, page, }: SearchParams & {
23
+ searchAuditLogs<R extends boolean = false>({ organizationName, filters, sorting, limit, page }: SearchParams & {
22
24
  organizationName: string;
23
- }): Promise<PaginatedResponse<AuditLog>>;
25
+ }, raw?: {
26
+ raw: R;
27
+ }): Promise<MaybeRaw<R, PaginatedResponse<AuditLog>>>;
24
28
  protected getEndpoint(endpoint: string): string;
25
29
  }
@@ -23,10 +23,10 @@ class Auditor extends Base_1.default {
23
23
  /**
24
24
  * @returns An object containing the endpoint version as a string
25
25
  */
26
- version() {
26
+ version(raw) {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
28
  const resp = yield this.axios.get(this.getEndpoint("/v1/version"), {});
29
- return resp.data;
29
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
30
30
  });
31
31
  }
32
32
  /**
@@ -38,14 +38,14 @@ class Auditor extends Base_1.default {
38
38
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
39
39
  * @returns Object containing an array of audit logs and the total number of results found in the database (independent of limit and page)
40
40
  */
41
- searchAuditLogs(_a) {
42
- return __awaiter(this, arguments, void 0, function* ({ organizationName, filters, sorting, limit = 25, page = 0, }) {
41
+ searchAuditLogs(_a, raw_1) {
42
+ return __awaiter(this, arguments, void 0, function* ({ organizationName, filters, sorting, limit = 25, page = 0 }, raw) {
43
43
  const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
44
44
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${organizationName}/logs/search?page=${page}&limit=${limit}`), {
45
45
  filters: filtersDTO,
46
46
  sorting: sorting,
47
47
  });
48
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
48
+ 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));
49
49
  });
50
50
  }
51
51
  getEndpoint(endpoint) {
@@ -1,9 +1,9 @@
1
- import Base from "../../../Base";
1
+ import Base, { MaybeRaw } from "../../../Base";
2
2
  import { AuditLogCreate } from "../../../interfaces/auditor";
3
3
  export declare class AuditorInternal extends Base {
4
4
  private queueExecutionInterval;
5
5
  private logQueue;
6
- private logQueueTimer;
6
+ private logQueueInterval;
7
7
  /**
8
8
  * Adds log entries to a queue that will be processed periodically.
9
9
  *
@@ -22,6 +22,30 @@ export declare class AuditorInternal extends Base {
22
22
  * @param orgId the organizations's ID
23
23
  * @returns void
24
24
  */
25
- deleteAllAuditLogsOfOrganization(orgId: string): Promise<void>;
25
+ deleteAllAuditLogsOfOrganization<R extends boolean = false>(orgId: string, raw?: {
26
+ raw: R;
27
+ }): Promise<MaybeRaw<R, void>>;
28
+ /**
29
+ * Deletes all audit logs of an Asset by space
30
+ *
31
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
32
+ * @param orgId the organizations's ID
33
+ * @param spaceName the Space's name
34
+ * @returns void
35
+ */
36
+ deleteAllAuditLogsOfSpace<R extends boolean = false>(orgId: string, spaceName: string, raw?: {
37
+ raw: R;
38
+ }): Promise<MaybeRaw<R, void>>;
39
+ /**
40
+ * Deletes all audit logs of an Asset
41
+ *
42
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
43
+ * @param orgId the organizations's ID
44
+ * @param assetId the Asset's ID
45
+ * @returns void
46
+ */
47
+ deleteAllAuditLogsOfAsset<R extends boolean = false>(orgId: string, assetId: string, raw?: {
48
+ raw: R;
49
+ }): Promise<MaybeRaw<R, void>>;
26
50
  protected getEndpoint(endpoint: string): string;
27
51
  }
@@ -29,15 +29,15 @@ class AuditorInternal extends Base_1.default {
29
29
  */
30
30
  queueAuditLogs(logs) {
31
31
  return __awaiter(this, void 0, void 0, function* () {
32
- if (!this.logQueueTimer) {
32
+ if (!this.logQueueInterval) {
33
33
  this.startQueue();
34
34
  }
35
35
  this.logQueue = this.logQueue.concat(logs);
36
36
  });
37
37
  }
38
38
  startQueue() {
39
- if (!this.logQueueTimer) {
40
- this.logQueueTimer = setTimeout(() => {
39
+ if (!this.logQueueInterval) {
40
+ this.logQueueInterval = setInterval(() => {
41
41
  if (this.logQueue.length > 0) {
42
42
  // DO NOT REMOVE THE IGNORE CATCH AS IT WOULD LEAD TO UNHANDLED PROMISE REJECTION IN OTHER ENDPOINTS AND THEIR CRASH
43
43
  this.axios.post(this.getEndpoint("/v1/logs"), this.logQueue).catch(ignored => ignored);
@@ -53,9 +53,38 @@ class AuditorInternal extends Base_1.default {
53
53
  * @param orgId the organizations's ID
54
54
  * @returns void
55
55
  */
56
- deleteAllAuditLogsOfOrganization(orgId) {
56
+ deleteAllAuditLogsOfOrganization(orgId, raw) {
57
57
  return __awaiter(this, void 0, void 0, function* () {
58
- yield this.axios.delete(this.getEndpoint(`/v1/org/${orgId}/logs`));
58
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgId}/logs`));
59
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
60
+ });
61
+ }
62
+ /**
63
+ * Deletes all audit logs of an Asset by space
64
+ *
65
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
66
+ * @param orgId the organizations's ID
67
+ * @param spaceName the Space's name
68
+ * @returns void
69
+ */
70
+ deleteAllAuditLogsOfSpace(orgId, spaceName, raw) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgId}/spaces/${spaceName}/logs`));
73
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
74
+ });
75
+ }
76
+ /**
77
+ * Deletes all audit logs of an Asset
78
+ *
79
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
80
+ * @param orgId the organizations's ID
81
+ * @param assetId the Asset's ID
82
+ * @returns void
83
+ */
84
+ deleteAllAuditLogsOfAsset(orgId, assetId, raw) {
85
+ return __awaiter(this, void 0, void 0, function* () {
86
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgId}/assets/${assetId}/logs`));
87
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
59
88
  });
60
89
  }
61
90
  getEndpoint(endpoint) {
@@ -1,8 +1,10 @@
1
1
  import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../Base";
2
+ import Base, { MaybeRaw, Options } from "../../../Base";
3
3
  import { HcloudFeature } from "../../../interfaces/bouncer";
4
4
  export default class BouncerFeatures extends Base {
5
5
  constructor(options: Options, axios: AxiosInstance);
6
- getHcloudFeatures(): Promise<HcloudFeature[]>;
6
+ getHcloudFeatures<R extends boolean = false>(raw?: {
7
+ raw: R;
8
+ }): Promise<MaybeRaw<R, HcloudFeature[]>>;
7
9
  protected getEndpoint(endpoint: string): string;
8
10
  }
@@ -14,10 +14,10 @@ class BouncerFeatures extends Base_1.default {
14
14
  constructor(options, axios) {
15
15
  super(options, axios);
16
16
  }
17
- getHcloudFeatures() {
17
+ getHcloudFeatures(raw) {
18
18
  return __awaiter(this, void 0, void 0, function* () {
19
19
  const resp = yield this.axios.get(this.getEndpoint("/default.json"), {});
20
- return resp.data;
20
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
21
21
  });
22
22
  }
23
23
  getEndpoint(endpoint) {
@@ -0,0 +1,219 @@
1
+ import Base, { MaybeRaw } from "../../../Base";
2
+ import { AuditLog } from "../../../interfaces/auditor";
3
+ import { Asset, AssetPermission, CreateAsset, PatchAsset, Resolution, Upload } from "../../../interfaces/cosmo/asset";
4
+ import { ReducedUser } from "../../../interfaces/idp/user";
5
+ /**
6
+ * @class Asset
7
+ * @extends Base
8
+ *
9
+ * @remarks
10
+ * **Under development, breaking changes possible**
11
+ *
12
+ * Represents an Asset resource in Cosmo, providing methods to interact with the Asset API.
13
+ */
14
+ export declare class CosmoAsset extends Base {
15
+ protected getEndpoint(endpoint: string): string;
16
+ /**
17
+ * Create a new Asset in Cosmo inside the specified Organization and Space.
18
+ * @remarks
19
+ * ** Under development, breaking changes possible**
20
+ * @param orgName Name of the Organization
21
+ * @param spaceName Name of the Space
22
+ * @param createAsset The Asset to be created
23
+ * @returns The created asset
24
+ */
25
+ createAsset<R extends boolean = false>(orgName: string, spaceName: string, createAsset: CreateAsset, raw?: {
26
+ raw: R;
27
+ }): Promise<MaybeRaw<R, Asset & {
28
+ upload: Upload;
29
+ }>>;
30
+ /**
31
+ * Bulk move or copy multiple assets to a new parent.
32
+ * @remarks
33
+ * ** Under development, breaking changes possible**
34
+ * @param orgName Name of the Organization
35
+ * @param spaceName Name of the Space
36
+ * @param newParentId (optional) ID of the new parent Asset to which the assets will be moved. Assets will be moved to the root if not provided.
37
+ * @param assetIdList List of Asset IDs to be moved to trash
38
+ * @param copy Whether to copy (true) or move (false) the assets
39
+ * @returns The moved assets
40
+ */
41
+ bulkMove<R extends boolean = false>(orgName: string, spaceName: string, assetIdList: string[], newParentId?: string, copy?: boolean, raw?: {
42
+ raw: R;
43
+ }): Promise<MaybeRaw<R, Asset[]>>;
44
+ /**
45
+ * Attach an asset to a location.
46
+ * @remarks
47
+ * ** Under development, breaking changes possible**
48
+ * @param orgName Name of the Organization
49
+ * @param spaceName Name of the Space
50
+ * @param assetId ID of the Asset to be attached
51
+ * @param locationId ID of the Location to which the Asset will be attached to
52
+ * @returns 204 No Content if successful
53
+ */
54
+ attachAssetToLocation<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, locationId: string, raw?: {
55
+ raw: R;
56
+ }): Promise<MaybeRaw<R, void>>;
57
+ /**
58
+ * Patch an asset.
59
+ * @remarks
60
+ * ** Under development, breaking changes possible**
61
+ * @param orgName Name of the Organization
62
+ * @param spaceName Name of the Space
63
+ * @param assetId ID of the Asset to be attached
64
+ * @param patchAsset The Asset to be patched
65
+ * @returns The patched asset
66
+ */
67
+ patchAsset<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, patchAsset: PatchAsset, raw?: {
68
+ raw: R;
69
+ }): Promise<MaybeRaw<R, Asset>>;
70
+ /**
71
+ * Get an asset by its ID.
72
+ * @remarks
73
+ * ** Under development, breaking changes possible**
74
+ * @param orgName Name of the Organization
75
+ * @param spaceName Name of the Space
76
+ * @param assetId ID of the Asset to be attached
77
+ * @param namespace Optional Namespaces of which information should be included in the returned object
78
+ * @param includePermissions Whether to include permissions in the result or not
79
+ * @returns The requested asset
80
+ */
81
+ getAsset<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, namespace?: string | string[], includePermissions?: boolean, raw?: {
82
+ raw: R;
83
+ }): Promise<MaybeRaw<R, Asset>>;
84
+ /**
85
+ * Delete multiple assets permanently by their IDs.
86
+ * @remarks
87
+ * ** Under development, breaking changes possible**
88
+ * @param orgName Name of the Organization
89
+ * @param spaceName Name of the Space
90
+ * @param assetIds IDs of the Assets to delete
91
+ * @param force If asset is folder and force is set to false, it will only succeed if the folder is empty. If set to true, it will always succeed, but delete all children in the process
92
+ * @returns 204 No Content if successful
93
+ */
94
+ deleteAssets<R extends boolean = false>(orgName: string, spaceName: string, assetIds: string[], force?: boolean, raw?: {
95
+ raw: R;
96
+ }): Promise<MaybeRaw<R, void>>;
97
+ /**
98
+ * Request download URLs for multiple assets.
99
+ * @remarks
100
+ * ** Under development, breaking changes possible**
101
+ * @param orgName Name of the Organization
102
+ * @param spaceName Name of the Space
103
+ * @param assetIdList List of Asset IDs for which download URLs are requested
104
+ * @param resolution The desired resolution for the download URLs
105
+ * @returns A map of Asset IDs to their download URLs
106
+ */
107
+ requestDownloadUrls<R extends boolean = false>(orgName: string, spaceName: string, assetIdList: string[], resolution: Resolution, raw?: {
108
+ raw: R;
109
+ }): Promise<MaybeRaw<R, Record<string, string>>>;
110
+ /**
111
+ * Upload an asset.
112
+ * @remarks
113
+ * ** Under development, breaking changes possible**
114
+ * ** Check this endpoint for currency as it looks outdated.**
115
+ * @param token An upload token for the asset
116
+ * @returns The uploaded asset
117
+ */
118
+ uploadAsset<R extends boolean = false>(token: string, raw?: {
119
+ raw: R;
120
+ }): Promise<MaybeRaw<R, Asset>>;
121
+ /**
122
+ * Move assets to the trash bin.
123
+ * @remarks
124
+ * ** Under development, breaking changes possible**
125
+ * @param orgName Name of the Organization
126
+ * @param spaceName Name of the Space
127
+ * @param assetIdList List of Asset IDs to be moved to trash
128
+ * @returns The moved assets
129
+ */
130
+ moveAssetsToTrash<R extends boolean = false>(orgName: string, spaceName: string, assetIdList: string[], raw?: {
131
+ raw: R;
132
+ }): Promise<MaybeRaw<R, Asset[]>>;
133
+ /**
134
+ * Fetch permissions for a group of assets.
135
+ * @remarks
136
+ * ** Under development, breaking changes possible**
137
+ * @param orgName Name of the Organization
138
+ * @param spaceName Name of the Space
139
+ * @param assetIdList List of Asset IDs to be moved to trash
140
+ * @returns A map of Asset IDs to their permissions
141
+ */
142
+ fetchAssetPermissions<R extends boolean = false>(orgName: string, spaceName: string, assetIdList: string[], raw?: {
143
+ raw: R;
144
+ }): Promise<MaybeRaw<R, Record<string, AssetPermission[]>>>;
145
+ /**
146
+ * Fetches the activity log for a specific asset within a given organization and space.
147
+ *
148
+ * @param {string} orgName - The name of the organization that owns the space.
149
+ * @param {string} spaceName - The name of the space containing the asset.
150
+ * @param {string} assetId - The unique identifier of the asset whose activity is being fetched.
151
+ * @param {number} limit - The maximum number of audit log entries to retrieve per page.
152
+ * @param {number} page - The page number to retrieve (for pagination).
153
+ * @returns {Promise<AuditLog[]>} A promise that resolves to an array of `AuditLog` objects representing the asset’s activity history.
154
+ */
155
+ fetchAssetActivity<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, limit: number, page: number, raw?: {
156
+ raw: R;
157
+ }): Promise<MaybeRaw<R, AuditLog[]>>;
158
+ /**
159
+ * Rename an asset.
160
+ * @remarks
161
+ * ** Under development, breaking changes possible**
162
+ * @param orgName Name of the Organization
163
+ * @param spaceName Name of the Space
164
+ * @param assetId ID of the Asset to be renamed
165
+ * @returns The renamed asset
166
+ */
167
+ renameAsset<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, newName: string, raw?: {
168
+ raw: R;
169
+ }): Promise<MaybeRaw<R, Asset>>;
170
+ /**
171
+ * Move assets out of trash and therewith recover them.
172
+ * @remarks
173
+ * ** Under development, breaking changes possible**
174
+ * @param orgName Name of the Organization
175
+ * @param spaceName Name of the Space
176
+ * @param assetIdList List of Asset IDs to be moved out of trash
177
+ * @returns The moved assets
178
+ */
179
+ moveAssetsOutOfTrash<R extends boolean = false>(orgName: string, spaceName: string, assetIdList: string[], raw?: {
180
+ raw: R;
181
+ }): Promise<MaybeRaw<R, Asset[]>>;
182
+ /**
183
+ * Attach a tag to an asset or replace an existing one.
184
+ * @remarks
185
+ * ** Under development, breaking changes possible**
186
+ * @param orgName Name of the Organization
187
+ * @param spaceName Name of the Space
188
+ * @param namespaceName Name of the namespace
189
+ * @param assetId ID of the Asset to be attached
190
+ * @param tagName Name of the tag
191
+ * @returns The updated asset
192
+ */
193
+ attachTagToAsset<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, assetId: string, tagName: string, raw?: {
194
+ raw: R;
195
+ }): Promise<MaybeRaw<R, Asset>>;
196
+ /**
197
+ * Remove a tag from an asset.
198
+ * @remarks
199
+ * ** Under development, breaking changes possible**
200
+ * @param orgName Name of the Organization
201
+ * @param spaceName Name of the Space
202
+ * @param namespaceName Name of the Namespace
203
+ * @param assetId ID of the Asset to be attached
204
+ * @returns The updated asset
205
+ */
206
+ removeTagFromAsset<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, assetId: string, raw?: {
207
+ raw: R;
208
+ }): Promise<MaybeRaw<R, Asset>>;
209
+ /**
210
+ * List users allowed to be mentioned in a comment of an asset.
211
+ * @param assetId ID of the Asset
212
+ * @param limit Maximum number of users to return
213
+ * @param page Page number for pagination
214
+ * @returns A list of users allowed to be mentioned in a comment of the asset
215
+ */
216
+ listUsersAllowedToMention<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, limit?: number, page?: number, raw?: {
217
+ raw: R;
218
+ }): Promise<MaybeRaw<R, ReducedUser[]>>;
219
+ }