hcloud-sdk 16.0.0 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/changelog.md +178 -51
  2. package/lib/Base.d.ts +2 -1
  3. package/lib/Hcloud.d.ts +6 -0
  4. package/lib/Hcloud.js +18 -0
  5. package/lib/helper/ValidationHelper.d.ts +74 -0
  6. package/lib/helper/ValidationHelper.js +360 -0
  7. package/lib/interfaces/auditor/index.d.ts +17 -2
  8. package/lib/interfaces/auditor/index.js +12 -0
  9. package/lib/interfaces/cosmo/asset/index.d.ts +185 -0
  10. package/lib/interfaces/cosmo/asset/index.js +82 -0
  11. package/lib/interfaces/cosmo/comment/index.d.ts +38 -0
  12. package/lib/interfaces/cosmo/comment/index.js +8 -0
  13. package/lib/interfaces/cosmo/event/index.d.ts +31 -0
  14. package/lib/interfaces/cosmo/event/index.js +17 -0
  15. package/lib/interfaces/cosmo/location/index.d.ts +4 -0
  16. package/lib/interfaces/cosmo/location/index.js +2 -0
  17. package/lib/interfaces/cosmo/namespace/index.d.ts +9 -0
  18. package/lib/interfaces/cosmo/namespace/index.js +9 -0
  19. package/lib/interfaces/cosmo/permissions.d.ts +96 -0
  20. package/lib/interfaces/cosmo/permissions.js +58 -0
  21. package/lib/interfaces/cosmo/share/index.d.ts +28 -0
  22. package/lib/interfaces/cosmo/share/index.js +2 -0
  23. package/lib/interfaces/cosmo/space/index.d.ts +25 -0
  24. package/lib/interfaces/cosmo/space/index.js +2 -0
  25. package/lib/interfaces/cosmo/tag/tag.d.ts +12 -0
  26. package/lib/interfaces/cosmo/tag/tag.js +2 -0
  27. package/lib/interfaces/frontend/config/index.d.ts +1 -0
  28. package/lib/interfaces/fuse/space/index.d.ts +1 -0
  29. package/lib/interfaces/global/Products.d.ts +3 -1
  30. package/lib/interfaces/global/Products.js +2 -0
  31. package/lib/interfaces/global/Views.d.ts +2 -1
  32. package/lib/interfaces/global/Views.js +1 -0
  33. package/lib/interfaces/high5/execution/index.d.ts +23 -2
  34. package/lib/interfaces/high5/execution/index.js +2 -0
  35. package/lib/interfaces/high5/index.d.ts +7 -7
  36. package/lib/interfaces/high5/index.js +7 -7
  37. package/lib/interfaces/high5/space/database/document/index.d.ts +34 -0
  38. package/lib/interfaces/high5/space/database/document/index.js +14 -0
  39. package/lib/interfaces/high5/space/database/index.d.ts +12 -0
  40. package/lib/interfaces/high5/space/database/index.js +2 -0
  41. package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +9 -2
  42. package/lib/interfaces/high5/space/event/stream/node/index.d.ts +10 -2
  43. package/lib/interfaces/high5/space/event/stream/node/index.js +6 -1
  44. package/lib/interfaces/high5/space/execution/index.d.ts +56 -2
  45. package/lib/interfaces/high5/space/execution/index.js +8 -0
  46. package/lib/interfaces/high5/space/index.d.ts +2 -0
  47. package/lib/interfaces/high5/space/job/JobLog.d.ts +16 -0
  48. package/lib/interfaces/high5/space/job/JobLog.js +2 -0
  49. package/lib/interfaces/high5/space/job/index.d.ts +38 -0
  50. package/lib/interfaces/high5/space/job/index.js +8 -0
  51. package/lib/interfaces/high5/space/pool/index.d.ts +5 -7
  52. package/lib/interfaces/high5/space/pool/index.js +0 -7
  53. package/lib/interfaces/high5/space/webhook/index.d.ts +3 -1
  54. package/lib/interfaces/high5/stats.d.ts +21 -0
  55. package/lib/interfaces/high5/stats.js +2 -0
  56. package/lib/interfaces/high5/wave/index.d.ts +8 -3
  57. package/lib/interfaces/idp/index.d.ts +1 -0
  58. package/lib/interfaces/idp/index.js +1 -0
  59. package/lib/interfaces/idp/oauth/index.d.ts +4 -3
  60. package/lib/interfaces/idp/organization/index.d.ts +1 -0
  61. package/lib/interfaces/idp/organization/index.js +1 -0
  62. package/lib/interfaces/idp/organization/license/index.d.ts +13 -0
  63. package/lib/interfaces/idp/organization/member/index.d.ts +2 -0
  64. package/lib/interfaces/idp/organization/service-accounts.d.ts +8 -0
  65. package/lib/interfaces/idp/organization/service-accounts.js +2 -0
  66. package/lib/interfaces/idp/organization/stats.d.ts +7 -0
  67. package/lib/interfaces/idp/organization/stats.js +2 -0
  68. package/lib/interfaces/idp/organization/team/index.d.ts +0 -1
  69. package/lib/interfaces/idp/user/GeneralSettings.d.ts +1 -0
  70. package/lib/interfaces/idp/user/GeneralSettings.js +1 -0
  71. package/lib/interfaces/idp/user/Message.d.ts +21 -0
  72. package/lib/interfaces/idp/user/Message.js +14 -0
  73. package/lib/interfaces/idp/user/NotificationSettings.d.ts +1 -0
  74. package/lib/interfaces/idp/user/Scopes.d.ts +8 -2
  75. package/lib/interfaces/idp/user/Scopes.js +9 -0
  76. package/lib/interfaces/idp/user/index.d.ts +2 -1
  77. package/lib/interfaces/mailer/index.d.ts +30 -1
  78. package/lib/interfaces/mailer/index.js +87 -1
  79. package/lib/interfaces/mothership/index.d.ts +3 -1
  80. package/lib/interfaces/mothership/index.js +15 -0
  81. package/lib/interfaces/mothership/stats.d.ts +4 -0
  82. package/lib/interfaces/mothership/stats.js +2 -0
  83. package/lib/interfaces/nats/index.d.ts +98 -9
  84. package/lib/interfaces/nats/index.js +136 -19
  85. package/lib/interfaces/shorts/index.d.ts +10 -0
  86. package/lib/interfaces/shorts/index.js +2 -0
  87. package/lib/service/agent/bundle/dev/index.d.ts +16 -6
  88. package/lib/service/agent/bundle/dev/index.js +12 -10
  89. package/lib/service/agent/bundle/index.d.ts +10 -4
  90. package/lib/service/agent/bundle/index.js +6 -6
  91. package/lib/service/agent/context/index.d.ts +26 -7
  92. package/lib/service/agent/context/index.js +27 -12
  93. package/lib/service/auditor/index.d.ts +8 -4
  94. package/lib/service/auditor/index.js +5 -5
  95. package/lib/service/auditor/internal/index.d.ts +27 -3
  96. package/lib/service/auditor/internal/index.js +34 -5
  97. package/lib/service/bouncer/features/index.d.ts +4 -2
  98. package/lib/service/bouncer/features/index.js +2 -2
  99. package/lib/service/cosmo/asset/index.d.ts +219 -0
  100. package/lib/service/cosmo/asset/index.js +314 -0
  101. package/lib/service/cosmo/comment/index.d.ts +122 -0
  102. package/lib/service/cosmo/comment/index.js +161 -0
  103. package/lib/service/cosmo/event/index.d.ts +23 -0
  104. package/lib/service/cosmo/event/index.js +40 -0
  105. package/lib/service/cosmo/folder/index.d.ts +27 -0
  106. package/lib/service/cosmo/folder/index.js +47 -0
  107. package/lib/service/cosmo/index.d.ts +49 -0
  108. package/lib/service/cosmo/index.js +119 -0
  109. package/lib/service/cosmo/internal/index.d.ts +7 -0
  110. package/lib/service/cosmo/internal/index.js +17 -0
  111. package/lib/service/cosmo/internal/space/index.d.ts +15 -0
  112. package/lib/service/cosmo/internal/space/index.js +34 -0
  113. package/lib/service/cosmo/location/index.d.ts +40 -0
  114. package/lib/service/cosmo/location/index.js +63 -0
  115. package/lib/service/cosmo/namespace/index.d.ts +42 -0
  116. package/lib/service/cosmo/namespace/index.js +65 -0
  117. package/lib/service/cosmo/organization/index.d.ts +47 -0
  118. package/lib/service/cosmo/organization/index.js +64 -0
  119. package/lib/service/cosmo/permissions/index.d.ts +131 -0
  120. package/lib/service/cosmo/permissions/index.js +181 -0
  121. package/lib/service/cosmo/production/index.d.ts +26 -0
  122. package/lib/service/cosmo/production/index.js +45 -0
  123. package/lib/service/cosmo/share/index.d.ts +161 -0
  124. package/lib/service/cosmo/share/index.js +215 -0
  125. package/lib/service/cosmo/space/index.d.ts +104 -0
  126. package/lib/service/cosmo/space/index.js +146 -0
  127. package/lib/service/cosmo/tag/index.d.ts +67 -0
  128. package/lib/service/cosmo/tag/index.js +93 -0
  129. package/lib/service/dali/DaliAvatar.d.ts +12 -0
  130. package/lib/service/dali/DaliAvatar.js +20 -0
  131. package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +32 -0
  132. package/lib/service/dali/avatar/DaliCosmoSpace.js +59 -0
  133. package/lib/service/dali/avatar/DaliFuseSpace.d.ts +10 -4
  134. package/lib/service/dali/avatar/DaliFuseSpace.js +7 -6
  135. package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +10 -4
  136. package/lib/service/dali/avatar/DaliHigh5Pool.js +7 -6
  137. package/lib/service/dali/avatar/DaliHigh5Space.d.ts +10 -4
  138. package/lib/service/dali/avatar/DaliHigh5Space.js +7 -6
  139. package/lib/service/dali/avatar/DaliOAuthApp.d.ts +10 -4
  140. package/lib/service/dali/avatar/DaliOAuthApp.js +7 -6
  141. package/lib/service/dali/avatar/DaliOrganization.d.ts +10 -4
  142. package/lib/service/dali/avatar/DaliOrganization.js +7 -6
  143. package/lib/service/dali/avatar/DaliServiceAccount.d.ts +32 -0
  144. package/lib/service/dali/avatar/DaliServiceAccount.js +59 -0
  145. package/lib/service/dali/avatar/DaliTeam.d.ts +10 -4
  146. package/lib/service/dali/avatar/DaliTeam.js +7 -6
  147. package/lib/service/dali/avatar/DaliUser.d.ts +10 -4
  148. package/lib/service/dali/avatar/DaliUser.js +7 -6
  149. package/lib/service/dali/index.d.ts +4 -5
  150. package/lib/service/dali/index.js +2 -5
  151. package/lib/service/fuse/index.d.ts +4 -2
  152. package/lib/service/fuse/index.js +2 -2
  153. package/lib/service/fuse/internal/index.d.ts +4 -2
  154. package/lib/service/fuse/internal/index.js +3 -2
  155. package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +4 -2
  156. package/lib/service/fuse/internal/space/cronjob/log/index.js +2 -2
  157. package/lib/service/fuse/internal/space/index.d.ts +7 -3
  158. package/lib/service/fuse/internal/space/index.js +6 -4
  159. package/lib/service/fuse/space/cronjob/index.d.ts +35 -13
  160. package/lib/service/fuse/space/cronjob/index.js +48 -50
  161. package/lib/service/fuse/space/cronjob/log/index.d.ts +8 -4
  162. package/lib/service/fuse/space/cronjob/log/index.js +5 -5
  163. package/lib/service/fuse/space/index.d.ts +27 -11
  164. package/lib/service/fuse/space/index.js +19 -18
  165. package/lib/service/high5/execution/index.d.ts +4 -2
  166. package/lib/service/high5/execution/index.js +3 -2
  167. package/lib/service/high5/execution/status/index.d.ts +5 -3
  168. package/lib/service/high5/execution/status/index.js +3 -3
  169. package/lib/service/high5/index.d.ts +7 -2
  170. package/lib/service/high5/index.js +9 -2
  171. package/lib/service/high5/internal/index.d.ts +4 -2
  172. package/lib/service/high5/internal/index.js +3 -2
  173. package/lib/service/high5/internal/space/index.d.ts +10 -3
  174. package/lib/service/high5/internal/space/index.js +13 -4
  175. package/lib/service/high5/internal/space/job/index.d.ts +7 -0
  176. package/lib/service/high5/internal/space/job/index.js +17 -0
  177. package/lib/service/high5/internal/space/job/log/index.d.ts +17 -0
  178. package/lib/service/high5/internal/space/job/log/index.js +34 -0
  179. package/lib/service/high5/joinToken/index.d.ts +14 -6
  180. package/lib/service/high5/joinToken/index.js +10 -9
  181. package/lib/service/high5/space/database/document/array/index.d.ts +73 -0
  182. package/lib/service/high5/space/database/document/array/index.js +102 -0
  183. package/lib/service/high5/space/database/document/index.d.ts +74 -0
  184. package/lib/service/high5/space/database/document/index.js +112 -0
  185. package/lib/service/high5/space/database/document/number/index.d.ts +51 -0
  186. package/lib/service/high5/space/database/document/number/index.js +77 -0
  187. package/lib/service/high5/space/database/index.d.ts +65 -0
  188. package/lib/service/high5/space/database/index.js +102 -0
  189. package/lib/service/high5/space/event/index.d.ts +17 -7
  190. package/lib/service/high5/space/event/index.js +12 -11
  191. package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +4 -2
  192. package/lib/service/high5/space/event/stream/design/DesignOperations.js +5 -3
  193. package/lib/service/high5/space/event/stream/design/index.d.ts +10 -4
  194. package/lib/service/high5/space/event/stream/design/index.js +7 -6
  195. package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +16 -6
  196. package/lib/service/high5/space/event/stream/design/snapshot/index.js +12 -10
  197. package/lib/service/high5/space/event/stream/index.d.ts +32 -12
  198. package/lib/service/high5/space/event/stream/index.js +22 -21
  199. package/lib/service/high5/space/execution/index.d.ts +22 -7
  200. package/lib/service/high5/space/execution/index.js +23 -12
  201. package/lib/service/high5/space/execution/log/index.d.ts +8 -4
  202. package/lib/service/high5/space/execution/log/index.js +5 -5
  203. package/lib/service/high5/space/execution/status/index.d.ts +18 -7
  204. package/lib/service/high5/space/execution/status/index.js +20 -8
  205. package/lib/service/high5/space/index.d.ts +56 -18
  206. package/lib/service/high5/space/index.js +65 -27
  207. package/lib/service/high5/space/job/index.d.ts +145 -0
  208. package/lib/service/high5/space/job/index.js +201 -0
  209. package/lib/service/high5/space/job/log/index.d.ts +35 -0
  210. package/lib/service/high5/space/job/log/index.js +58 -0
  211. package/lib/service/high5/space/node/index.d.ts +20 -8
  212. package/lib/service/high5/space/node/index.js +14 -13
  213. package/lib/service/high5/space/pool/index.d.ts +27 -11
  214. package/lib/service/high5/space/pool/index.js +19 -18
  215. package/lib/service/high5/space/secret/index.d.ts +17 -7
  216. package/lib/service/high5/space/secret/index.js +12 -11
  217. package/lib/service/high5/space/stat/index.d.ts +12 -0
  218. package/lib/service/high5/space/stat/index.js +31 -0
  219. package/lib/service/high5/space/wave/index.d.ts +16 -6
  220. package/lib/service/high5/space/wave/index.js +11 -10
  221. package/lib/service/high5/space/webhook/index.d.ts +32 -12
  222. package/lib/service/high5/space/webhook/index.js +25 -21
  223. package/lib/service/high5/space/webhook/log/index.d.ts +4 -2
  224. package/lib/service/high5/space/webhook/log/index.js +2 -2
  225. package/lib/service/high5/stat/index.d.ts +11 -0
  226. package/lib/service/high5/stat/index.js +30 -0
  227. package/lib/service/high5/wave/s3/index.d.ts +31 -8
  228. package/lib/service/high5/wave/s3/index.js +52 -24
  229. package/lib/service/idp/guest/index.d.ts +42 -0
  230. package/lib/service/idp/guest/index.js +66 -0
  231. package/lib/service/idp/index.d.ts +25 -7
  232. package/lib/service/idp/index.js +23 -12
  233. package/lib/service/idp/internal/index.d.ts +5 -3
  234. package/lib/service/idp/internal/index.js +5 -3
  235. package/lib/service/idp/oauth/index.d.ts +16 -6
  236. package/lib/service/idp/oauth/index.js +15 -15
  237. package/lib/service/idp/organization/index.d.ts +25 -5
  238. package/lib/service/idp/organization/index.js +29 -8
  239. package/lib/service/idp/organization/license/index.d.ts +7 -3
  240. package/lib/service/idp/organization/license/index.js +4 -4
  241. package/lib/service/idp/organization/member/index.d.ts +21 -8
  242. package/lib/service/idp/organization/member/index.js +16 -13
  243. package/lib/service/idp/organization/member/invitations/index.d.ts +23 -9
  244. package/lib/service/idp/organization/member/invitations/index.js +72 -59
  245. package/lib/service/idp/organization/service-accounts/index.d.ts +76 -0
  246. package/lib/service/idp/organization/service-accounts/index.js +109 -0
  247. package/lib/service/idp/organization/settings/domain/index.d.ts +13 -5
  248. package/lib/service/idp/organization/settings/domain/index.js +9 -8
  249. package/lib/service/idp/organization/settings/domain/saml/index.d.ts +16 -6
  250. package/lib/service/idp/organization/settings/domain/saml/index.js +19 -18
  251. package/lib/service/idp/organization/settings/oauth/index.d.ts +23 -9
  252. package/lib/service/idp/organization/settings/oauth/index.js +16 -15
  253. package/lib/service/idp/organization/stat/index.d.ts +11 -0
  254. package/lib/service/idp/organization/stat/index.js +30 -0
  255. package/lib/service/idp/organization/team/index.d.ts +22 -10
  256. package/lib/service/idp/organization/team/index.js +14 -13
  257. package/lib/service/idp/registration/index.d.ts +10 -4
  258. package/lib/service/idp/registration/index.js +15 -9
  259. package/lib/service/idp/user/index.d.ts +33 -11
  260. package/lib/service/idp/user/index.js +30 -16
  261. package/lib/service/idp/user/license/index.d.ts +7 -3
  262. package/lib/service/idp/user/license/index.js +4 -4
  263. package/lib/service/idp/user/message/index.d.ts +61 -0
  264. package/lib/service/idp/user/message/index.js +92 -0
  265. package/lib/service/idp/user/password/index.d.ts +4 -2
  266. package/lib/service/idp/user/password/index.js +3 -3
  267. package/lib/service/idp/user/settings/connections/index.d.ts +4 -2
  268. package/lib/service/idp/user/settings/connections/index.js +2 -2
  269. package/lib/service/idp/user/settings/general/index.d.ts +10 -4
  270. package/lib/service/idp/user/settings/general/index.js +6 -6
  271. package/lib/service/idp/user/settings/notifications/index.d.ts +7 -3
  272. package/lib/service/idp/user/settings/notifications/index.js +4 -4
  273. package/lib/service/idp/user/settings/oauthApps/index.d.ts +7 -3
  274. package/lib/service/idp/user/settings/oauthApps/index.js +6 -5
  275. package/lib/service/idp/user/settings/pats/index.d.ts +22 -8
  276. package/lib/service/idp/user/settings/pats/index.js +17 -15
  277. package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +16 -6
  278. package/lib/service/idp/user/settings/twoFactor/totp/index.js +13 -10
  279. package/lib/service/mailer/index.d.ts +4 -2
  280. package/lib/service/mailer/index.js +2 -2
  281. package/lib/service/mailer/internal/index.d.ts +13 -5
  282. package/lib/service/mailer/internal/index.js +8 -8
  283. package/lib/service/mothership/index.d.ts +35 -13
  284. package/lib/service/mothership/index.js +32 -18
  285. package/lib/service/nats/index.js +58 -44
  286. package/lib/service/shorts/index.d.ts +18 -0
  287. package/lib/service/shorts/index.js +38 -0
  288. package/lib/service/shorts/internal/index.d.ts +72 -0
  289. package/lib/service/shorts/internal/index.js +104 -0
  290. package/lib/utils/bouncer/features/Provider.js +0 -3
  291. package/package.json +22 -24
@@ -1,9 +1,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
+ }
@@ -0,0 +1,314 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CosmoAsset = void 0;
13
+ const Base_1 = require("../../../Base");
14
+ /**
15
+ * @class Asset
16
+ * @extends Base
17
+ *
18
+ * @remarks
19
+ * **Under development, breaking changes possible**
20
+ *
21
+ * Represents an Asset resource in Cosmo, providing methods to interact with the Asset API.
22
+ */
23
+ class CosmoAsset extends Base_1.default {
24
+ getEndpoint(endpoint) {
25
+ return `${this.options.server}/api/cosmo${endpoint}`;
26
+ }
27
+ /**
28
+ * Create a new Asset in Cosmo inside the specified Organization and Space.
29
+ * @remarks
30
+ * ** Under development, breaking changes possible**
31
+ * @param orgName Name of the Organization
32
+ * @param spaceName Name of the Space
33
+ * @param createAsset The Asset to be created
34
+ * @returns The created asset
35
+ */
36
+ createAsset(orgName, spaceName, createAsset, raw) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets`), createAsset);
39
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
40
+ });
41
+ }
42
+ /**
43
+ * Bulk move or copy multiple assets to a new parent.
44
+ * @remarks
45
+ * ** Under development, breaking changes possible**
46
+ * @param orgName Name of the Organization
47
+ * @param spaceName Name of the Space
48
+ * @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.
49
+ * @param assetIdList List of Asset IDs to be moved to trash
50
+ * @param copy Whether to copy (true) or move (false) the assets
51
+ * @returns The moved assets
52
+ */
53
+ bulkMove(orgName_1, spaceName_1, assetIdList_1, newParentId_1) {
54
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, assetIdList, newParentId, copy = false, raw) {
55
+ const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/bulk-move-copy`), {
56
+ assetIds: assetIdList,
57
+ parentId: newParentId,
58
+ copy: copy,
59
+ });
60
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
61
+ });
62
+ }
63
+ /**
64
+ * Attach an asset to a location.
65
+ * @remarks
66
+ * ** Under development, breaking changes possible**
67
+ * @param orgName Name of the Organization
68
+ * @param spaceName Name of the Space
69
+ * @param assetId ID of the Asset to be attached
70
+ * @param locationId ID of the Location to which the Asset will be attached to
71
+ * @returns 204 No Content if successful
72
+ */
73
+ attachAssetToLocation(orgName, spaceName, assetId, locationId, raw) {
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/location`), {
76
+ locationId: locationId,
77
+ });
78
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
79
+ });
80
+ }
81
+ /**
82
+ * Patch an asset.
83
+ * @remarks
84
+ * ** Under development, breaking changes possible**
85
+ * @param orgName Name of the Organization
86
+ * @param spaceName Name of the Space
87
+ * @param assetId ID of the Asset to be attached
88
+ * @param patchAsset The Asset to be patched
89
+ * @returns The patched asset
90
+ */
91
+ patchAsset(orgName, spaceName, assetId, patchAsset, raw) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}`), patchAsset);
94
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
95
+ });
96
+ }
97
+ /**
98
+ * Get an asset by its ID.
99
+ * @remarks
100
+ * ** Under development, breaking changes possible**
101
+ * @param orgName Name of the Organization
102
+ * @param spaceName Name of the Space
103
+ * @param assetId ID of the Asset to be attached
104
+ * @param namespace Optional Namespaces of which information should be included in the returned object
105
+ * @param includePermissions Whether to include permissions in the result or not
106
+ * @returns The requested asset
107
+ */
108
+ getAsset(orgName_1, spaceName_1, assetId_1, namespace_1) {
109
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, assetId, namespace, includePermissions = false, raw) {
110
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}`), {
111
+ params: {
112
+ namespace,
113
+ permissions: includePermissions ? "true" : "false",
114
+ },
115
+ });
116
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
117
+ });
118
+ }
119
+ /**
120
+ * Delete multiple assets permanently by their IDs.
121
+ * @remarks
122
+ * ** Under development, breaking changes possible**
123
+ * @param orgName Name of the Organization
124
+ * @param spaceName Name of the Space
125
+ * @param assetIds IDs of the Assets to delete
126
+ * @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
127
+ * @returns 204 No Content if successful
128
+ */
129
+ deleteAssets(orgName, spaceName, assetIds, force, raw) {
130
+ return __awaiter(this, void 0, void 0, function* () {
131
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets`), {
132
+ data: { assetIds },
133
+ params: { force },
134
+ });
135
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
136
+ });
137
+ }
138
+ /**
139
+ * Request download URLs for multiple assets.
140
+ * @remarks
141
+ * ** Under development, breaking changes possible**
142
+ * @param orgName Name of the Organization
143
+ * @param spaceName Name of the Space
144
+ * @param assetIdList List of Asset IDs for which download URLs are requested
145
+ * @param resolution The desired resolution for the download URLs
146
+ * @returns A map of Asset IDs to their download URLs
147
+ */
148
+ requestDownloadUrls(orgName, spaceName, assetIdList, resolution, raw) {
149
+ return __awaiter(this, void 0, void 0, function* () {
150
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/downloadUrls`), {
151
+ assetIds: assetIdList,
152
+ resolution: resolution,
153
+ });
154
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
155
+ });
156
+ }
157
+ /**
158
+ * Upload an asset.
159
+ * @remarks
160
+ * ** Under development, breaking changes possible**
161
+ * ** Check this endpoint for currency as it looks outdated.**
162
+ * @param token An upload token for the asset
163
+ * @returns The uploaded asset
164
+ */
165
+ uploadAsset(token, raw) {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ const resp = yield this.axios.put(this.getEndpoint(`/v1/assets/upload?${token}`));
168
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
169
+ });
170
+ }
171
+ /**
172
+ * Move assets to the trash bin.
173
+ * @remarks
174
+ * ** Under development, breaking changes possible**
175
+ * @param orgName Name of the Organization
176
+ * @param spaceName Name of the Space
177
+ * @param assetIdList List of Asset IDs to be moved to trash
178
+ * @returns The moved assets
179
+ */
180
+ moveAssetsToTrash(orgName, spaceName, assetIdList, raw) {
181
+ return __awaiter(this, void 0, void 0, function* () {
182
+ const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/trash`), {
183
+ assetIds: assetIdList,
184
+ });
185
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
186
+ });
187
+ }
188
+ /**
189
+ * Fetch permissions for a group of assets.
190
+ * @remarks
191
+ * ** Under development, breaking changes possible**
192
+ * @param orgName Name of the Organization
193
+ * @param spaceName Name of the Space
194
+ * @param assetIdList List of Asset IDs to be moved to trash
195
+ * @returns A map of Asset IDs to their permissions
196
+ */
197
+ fetchAssetPermissions(orgName, spaceName, assetIdList, raw) {
198
+ return __awaiter(this, void 0, void 0, function* () {
199
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/permissions`), {
200
+ assetIds: assetIdList,
201
+ });
202
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
203
+ });
204
+ }
205
+ /**
206
+ * Fetches the activity log for a specific asset within a given organization and space.
207
+ *
208
+ * @param {string} orgName - The name of the organization that owns the space.
209
+ * @param {string} spaceName - The name of the space containing the asset.
210
+ * @param {string} assetId - The unique identifier of the asset whose activity is being fetched.
211
+ * @param {number} limit - The maximum number of audit log entries to retrieve per page.
212
+ * @param {number} page - The page number to retrieve (for pagination).
213
+ * @returns {Promise<AuditLog[]>} A promise that resolves to an array of `AuditLog` objects representing the asset’s activity history.
214
+ */
215
+ fetchAssetActivity(orgName, spaceName, assetId, limit, page, raw) {
216
+ return __awaiter(this, void 0, void 0, function* () {
217
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/activity`), {
218
+ params: {
219
+ limit,
220
+ page,
221
+ },
222
+ });
223
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
224
+ });
225
+ }
226
+ /**
227
+ * Rename an asset.
228
+ * @remarks
229
+ * ** Under development, breaking changes possible**
230
+ * @param orgName Name of the Organization
231
+ * @param spaceName Name of the Space
232
+ * @param assetId ID of the Asset to be renamed
233
+ * @returns The renamed asset
234
+ */
235
+ renameAsset(orgName, spaceName, assetId, newName, raw) {
236
+ return __awaiter(this, void 0, void 0, function* () {
237
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/name`), {
238
+ name: newName,
239
+ });
240
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
241
+ });
242
+ }
243
+ /**
244
+ * Move assets out of trash and therewith recover them.
245
+ * @remarks
246
+ * ** Under development, breaking changes possible**
247
+ * @param orgName Name of the Organization
248
+ * @param spaceName Name of the Space
249
+ * @param assetIdList List of Asset IDs to be moved out of trash
250
+ * @returns The moved assets
251
+ */
252
+ moveAssetsOutOfTrash(orgName, spaceName, assetIdList, raw) {
253
+ return __awaiter(this, void 0, void 0, function* () {
254
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/trash`), {
255
+ data: {
256
+ assetIds: assetIdList,
257
+ },
258
+ });
259
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
260
+ });
261
+ }
262
+ /**
263
+ * Attach a tag to an asset or replace an existing one.
264
+ * @remarks
265
+ * ** Under development, breaking changes possible**
266
+ * @param orgName Name of the Organization
267
+ * @param spaceName Name of the Space
268
+ * @param namespaceName Name of the namespace
269
+ * @param assetId ID of the Asset to be attached
270
+ * @param tagName Name of the tag
271
+ * @returns The updated asset
272
+ */
273
+ attachTagToAsset(orgName, spaceName, namespaceName, assetId, tagName, raw) {
274
+ return __awaiter(this, void 0, void 0, function* () {
275
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/assets/${assetId}/tags/${tagName}`));
276
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
277
+ });
278
+ }
279
+ /**
280
+ * Remove a tag from an asset.
281
+ * @remarks
282
+ * ** Under development, breaking changes possible**
283
+ * @param orgName Name of the Organization
284
+ * @param spaceName Name of the Space
285
+ * @param namespaceName Name of the Namespace
286
+ * @param assetId ID of the Asset to be attached
287
+ * @returns The updated asset
288
+ */
289
+ removeTagFromAsset(orgName, spaceName, namespaceName, assetId, raw) {
290
+ return __awaiter(this, void 0, void 0, function* () {
291
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/assets/${assetId}/tags`));
292
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
293
+ });
294
+ }
295
+ /**
296
+ * List users allowed to be mentioned in a comment of an asset.
297
+ * @param assetId ID of the Asset
298
+ * @param limit Maximum number of users to return
299
+ * @param page Page number for pagination
300
+ * @returns A list of users allowed to be mentioned in a comment of the asset
301
+ */
302
+ listUsersAllowedToMention(orgName, spaceName, assetId, limit, page, raw) {
303
+ return __awaiter(this, void 0, void 0, function* () {
304
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/users`), {
305
+ params: {
306
+ limit,
307
+ page,
308
+ },
309
+ });
310
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
311
+ });
312
+ }
313
+ }
314
+ exports.CosmoAsset = CosmoAsset;