hcloud-sdk 17.0.0 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/changelog.md +87 -76
  2. package/lib/Base.d.ts +2 -1
  3. package/lib/Hcloud.d.ts +24 -6
  4. package/lib/Hcloud.js +127 -24
  5. package/lib/helper/ErrorHelper.js +5 -2
  6. package/lib/helper/ValidationHelper.d.ts +14 -4
  7. package/lib/helper/ValidationHelper.js +71 -11
  8. package/lib/interfaces/agent/logging/cloudwatch.d.ts +23 -0
  9. package/lib/interfaces/agent/logging/index.d.ts +2 -0
  10. package/lib/interfaces/{friday → agent/logging}/index.js +2 -3
  11. package/lib/interfaces/agent/logging/log-collector.d.ts +35 -0
  12. package/lib/interfaces/agent/module/index.d.ts +7 -0
  13. package/lib/interfaces/agent/module/index.js +2 -0
  14. package/lib/interfaces/auditor/index.d.ts +13 -3
  15. package/lib/interfaces/auditor/index.js +9 -2
  16. package/lib/interfaces/axios/index.d.ts +5 -0
  17. package/lib/interfaces/cosmo/asset/index.d.ts +216 -0
  18. package/lib/interfaces/cosmo/asset/index.js +90 -0
  19. package/lib/interfaces/cosmo/comment/index.d.ts +41 -0
  20. package/lib/interfaces/cosmo/comment/index.js +8 -0
  21. package/lib/interfaces/cosmo/event/index.d.ts +60 -0
  22. package/lib/interfaces/cosmo/event/index.js +31 -0
  23. package/lib/interfaces/cosmo/location/index.d.ts +4 -0
  24. package/lib/interfaces/cosmo/location/index.js +2 -0
  25. package/lib/interfaces/cosmo/namespace/index.d.ts +9 -0
  26. package/lib/interfaces/cosmo/namespace/index.js +9 -0
  27. package/lib/interfaces/cosmo/permissions.d.ts +96 -0
  28. package/lib/interfaces/cosmo/permissions.js +58 -0
  29. package/lib/interfaces/cosmo/share/index.d.ts +110 -0
  30. package/lib/interfaces/cosmo/share/index.js +23 -0
  31. package/lib/interfaces/cosmo/space/index.d.ts +31 -0
  32. package/lib/interfaces/cosmo/space/index.js +2 -0
  33. package/lib/interfaces/cosmo/stats/index.d.ts +11 -0
  34. package/lib/interfaces/cosmo/stats/index.js +2 -0
  35. package/lib/interfaces/cosmo/tag/tag.d.ts +13 -0
  36. package/lib/interfaces/cosmo/tag/tag.js +2 -0
  37. package/lib/interfaces/global/Products.d.ts +2 -3
  38. package/lib/interfaces/global/Products.js +1 -2
  39. package/lib/interfaces/global/Views.d.ts +0 -1
  40. package/lib/interfaces/global/Views.js +0 -1
  41. package/lib/interfaces/high5/index.d.ts +7 -7
  42. package/lib/interfaces/high5/index.js +7 -7
  43. package/lib/interfaces/{friday → high5}/space/database/document/index.d.ts +1 -1
  44. package/lib/interfaces/{friday → high5}/space/database/document/index.js +2 -1
  45. package/lib/interfaces/high5/space/database/index.js +2 -0
  46. package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +10 -2
  47. package/lib/interfaces/high5/space/event/stream/node/index.d.ts +1 -0
  48. package/lib/interfaces/high5/space/execution/index.d.ts +3 -1
  49. package/lib/interfaces/{fuse/space/cronjob/CronjobLog.d.ts → high5/space/job/JobLog.d.ts} +3 -3
  50. package/lib/interfaces/high5/space/job/JobLog.js +2 -0
  51. package/lib/interfaces/high5/space/job/index.d.ts +83 -0
  52. package/lib/interfaces/high5/space/job/index.js +11 -0
  53. package/lib/interfaces/high5/stats.d.ts +21 -0
  54. package/lib/interfaces/high5/stats.js +2 -0
  55. package/lib/interfaces/high5/wave/dependentInputs.d.ts +42 -0
  56. package/lib/interfaces/high5/wave/dependentInputs.js +144 -0
  57. package/lib/interfaces/high5/wave/dependentInputsValidation.d.ts +22 -0
  58. package/lib/interfaces/high5/wave/dependentInputsValidation.js +220 -0
  59. package/lib/interfaces/idp/index.d.ts +3 -3
  60. package/lib/interfaces/idp/index.js +3 -3
  61. package/lib/interfaces/idp/oauth/device.d.ts +18 -0
  62. package/lib/interfaces/idp/oauth/device.js +2 -0
  63. package/lib/interfaces/idp/oauth/index.d.ts +19 -5
  64. package/lib/interfaces/idp/organization/index.d.ts +2 -0
  65. package/lib/interfaces/idp/organization/index.js +2 -0
  66. package/lib/interfaces/idp/organization/license/index.d.ts +13 -11
  67. package/lib/interfaces/idp/organization/member/index.d.ts +1 -0
  68. package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +4 -0
  69. package/lib/interfaces/idp/organization/stats.d.ts +7 -0
  70. package/lib/interfaces/idp/organization/stats.js +2 -0
  71. package/lib/interfaces/idp/organization/team/index.d.ts +0 -1
  72. package/lib/interfaces/idp/user/Message.d.ts +22 -0
  73. package/lib/interfaces/idp/user/Message.js +14 -0
  74. package/lib/interfaces/idp/user/NotificationSettings.d.ts +1 -0
  75. package/lib/interfaces/idp/user/Scopes.d.ts +1 -15
  76. package/lib/interfaces/idp/user/Scopes.js +0 -21
  77. package/lib/interfaces/idp/user/index.d.ts +5 -1
  78. package/lib/interfaces/mailer/index.d.ts +50 -2
  79. package/lib/interfaces/mailer/index.js +100 -2
  80. package/lib/interfaces/mothership/index.d.ts +3 -1
  81. package/lib/interfaces/mothership/index.js +15 -0
  82. package/lib/interfaces/mothership/stats.d.ts +4 -0
  83. package/lib/interfaces/mothership/stats.js +2 -0
  84. package/lib/interfaces/nats/index.d.ts +79 -51
  85. package/lib/interfaces/nats/index.js +140 -125
  86. package/lib/interfaces/shorts/index.d.ts +17 -0
  87. package/lib/interfaces/shorts/index.js +8 -0
  88. package/lib/service/agent/bundle/dev/index.d.ts +16 -6
  89. package/lib/service/agent/bundle/dev/index.js +16 -11
  90. package/lib/service/agent/bundle/index.d.ts +10 -4
  91. package/lib/service/agent/bundle/index.js +10 -7
  92. package/lib/service/agent/context/index.d.ts +22 -8
  93. package/lib/service/agent/context/index.js +19 -15
  94. package/lib/service/agent/index.d.ts +6 -0
  95. package/lib/service/agent/index.js +18 -1
  96. package/lib/service/agent/installer/index.js +4 -1
  97. package/lib/service/agent/logging/index.d.ts +69 -0
  98. package/lib/service/agent/logging/index.js +117 -0
  99. package/lib/service/agent/module/index.d.ts +36 -0
  100. package/lib/service/agent/module/index.js +65 -0
  101. package/lib/service/auditor/index.d.ts +8 -4
  102. package/lib/service/auditor/index.js +9 -6
  103. package/lib/service/auditor/internal/index.d.ts +27 -3
  104. package/lib/service/auditor/internal/index.js +38 -6
  105. package/lib/service/bouncer/features/index.d.ts +4 -2
  106. package/lib/service/bouncer/features/index.js +6 -3
  107. package/lib/service/bouncer/index.js +5 -2
  108. package/lib/service/cosmo/asset/index.d.ts +265 -0
  109. package/lib/service/cosmo/asset/index.js +420 -0
  110. package/lib/service/cosmo/comment/index.d.ts +93 -0
  111. package/lib/service/cosmo/comment/index.js +136 -0
  112. package/lib/service/cosmo/event/index.d.ts +23 -0
  113. package/lib/service/cosmo/event/index.js +43 -0
  114. package/lib/service/cosmo/folder/index.d.ts +27 -0
  115. package/lib/service/cosmo/folder/index.js +50 -0
  116. package/lib/service/cosmo/index.d.ts +52 -0
  117. package/lib/service/cosmo/index.js +129 -0
  118. package/lib/service/cosmo/internal/index.d.ts +7 -0
  119. package/lib/service/cosmo/internal/index.js +20 -0
  120. package/lib/service/cosmo/internal/space/index.d.ts +15 -0
  121. package/lib/service/cosmo/internal/space/index.js +37 -0
  122. package/lib/service/cosmo/location/index.d.ts +40 -0
  123. package/lib/service/cosmo/location/index.js +66 -0
  124. package/lib/service/cosmo/namespace/index.d.ts +56 -0
  125. package/lib/service/cosmo/namespace/index.js +85 -0
  126. package/lib/service/cosmo/organization/index.d.ts +47 -0
  127. package/lib/service/cosmo/organization/index.js +67 -0
  128. package/lib/service/cosmo/permissions/index.d.ts +131 -0
  129. package/lib/service/cosmo/permissions/index.js +184 -0
  130. package/lib/service/cosmo/production/index.d.ts +26 -0
  131. package/lib/service/cosmo/production/index.js +48 -0
  132. package/lib/service/cosmo/share/index.d.ts +169 -0
  133. package/lib/service/cosmo/share/index.js +227 -0
  134. package/lib/service/cosmo/space/index.d.ts +131 -0
  135. package/lib/service/cosmo/space/index.js +190 -0
  136. package/lib/service/cosmo/stats/index.d.ts +35 -0
  137. package/lib/service/cosmo/stats/index.js +58 -0
  138. package/lib/service/cosmo/tag/index.d.ts +67 -0
  139. package/lib/service/cosmo/tag/index.js +96 -0
  140. package/lib/service/dali/DaliAvatar.d.ts +0 -6
  141. package/lib/service/dali/DaliAvatar.js +4 -11
  142. package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +10 -4
  143. package/lib/service/dali/avatar/DaliCosmoSpace.js +12 -8
  144. package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +11 -4
  145. package/lib/service/dali/avatar/DaliHigh5Pool.js +12 -8
  146. package/lib/service/dali/avatar/DaliHigh5Space.d.ts +11 -4
  147. package/lib/service/dali/avatar/DaliHigh5Space.js +12 -8
  148. package/lib/service/dali/avatar/DaliOAuthApp.d.ts +11 -4
  149. package/lib/service/dali/avatar/DaliOAuthApp.js +12 -8
  150. package/lib/service/dali/avatar/DaliOrganization.d.ts +11 -4
  151. package/lib/service/dali/avatar/DaliOrganization.js +12 -8
  152. package/lib/service/dali/avatar/DaliServiceAccount.d.ts +10 -4
  153. package/lib/service/dali/avatar/DaliServiceAccount.js +12 -8
  154. package/lib/service/dali/avatar/DaliTeam.d.ts +11 -4
  155. package/lib/service/dali/avatar/DaliTeam.js +12 -8
  156. package/lib/service/dali/avatar/DaliUser.d.ts +11 -4
  157. package/lib/service/dali/avatar/DaliUser.js +12 -8
  158. package/lib/service/dali/index.d.ts +4 -5
  159. package/lib/service/dali/index.js +6 -6
  160. package/lib/service/high5/execution/index.d.ts +4 -2
  161. package/lib/service/high5/execution/index.js +7 -3
  162. package/lib/service/high5/execution/log/index.js +4 -1
  163. package/lib/service/high5/execution/status/index.d.ts +5 -3
  164. package/lib/service/high5/execution/status/index.js +7 -4
  165. package/lib/service/high5/index.d.ts +7 -2
  166. package/lib/service/high5/index.js +13 -3
  167. package/lib/service/high5/internal/index.d.ts +4 -2
  168. package/lib/service/high5/internal/index.js +7 -3
  169. package/lib/service/high5/internal/space/index.d.ts +10 -3
  170. package/lib/service/high5/internal/space/index.js +17 -5
  171. package/lib/service/high5/internal/space/job/index.d.ts +7 -0
  172. package/lib/service/high5/internal/space/job/index.js +20 -0
  173. package/lib/service/high5/internal/space/job/log/index.d.ts +17 -0
  174. package/lib/service/{fuse/internal/space/cronjob → high5/internal/space/job}/log/index.js +13 -10
  175. package/lib/service/high5/joinToken/index.d.ts +14 -6
  176. package/lib/service/high5/joinToken/index.js +14 -10
  177. package/lib/service/high5/space/database/document/array/index.d.ts +73 -0
  178. package/lib/service/high5/space/database/document/array/index.js +105 -0
  179. package/lib/service/{friday → high5}/space/database/document/index.d.ts +26 -10
  180. package/lib/service/{friday → high5}/space/database/document/index.js +35 -17
  181. package/lib/service/high5/space/database/document/number/index.d.ts +51 -0
  182. package/lib/service/high5/space/database/document/number/index.js +80 -0
  183. package/lib/service/{friday → high5}/space/database/index.d.ts +22 -12
  184. package/lib/service/{friday → high5}/space/database/index.js +22 -18
  185. package/lib/service/high5/space/event/index.d.ts +17 -7
  186. package/lib/service/high5/space/event/index.js +16 -12
  187. package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +4 -2
  188. package/lib/service/high5/space/event/stream/design/DesignOperations.js +6 -3
  189. package/lib/service/high5/space/event/stream/design/index.d.ts +10 -4
  190. package/lib/service/high5/space/event/stream/design/index.js +13 -9
  191. package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +16 -6
  192. package/lib/service/high5/space/event/stream/design/snapshot/index.js +16 -11
  193. package/lib/service/high5/space/event/stream/index.d.ts +32 -12
  194. package/lib/service/high5/space/event/stream/index.js +26 -22
  195. package/lib/service/high5/space/execution/index.d.ts +19 -7
  196. package/lib/service/high5/space/execution/index.js +21 -13
  197. package/lib/service/high5/space/execution/log/index.d.ts +8 -4
  198. package/lib/service/high5/space/execution/log/index.js +9 -6
  199. package/lib/service/high5/space/execution/status/index.d.ts +7 -3
  200. package/lib/service/high5/space/execution/status/index.js +8 -5
  201. package/lib/service/high5/space/index.d.ts +53 -14
  202. package/lib/service/high5/space/index.js +70 -28
  203. package/lib/service/{fuse/space/cronjob → high5/space/job}/index.d.ts +57 -35
  204. package/lib/service/{fuse/space/cronjob → high5/space/job}/index.js +88 -87
  205. package/lib/service/{fuse/space/cronjob → high5/space/job}/log/index.d.ts +15 -11
  206. package/lib/service/{fuse/space/cronjob → high5/space/job}/log/index.js +19 -16
  207. package/lib/service/high5/space/node/index.d.ts +20 -8
  208. package/lib/service/high5/space/node/index.js +18 -14
  209. package/lib/service/high5/space/pool/index.d.ts +38 -11
  210. package/lib/service/high5/space/pool/index.js +41 -19
  211. package/lib/service/high5/space/secret/index.d.ts +17 -7
  212. package/lib/service/high5/space/secret/index.js +16 -12
  213. package/lib/service/high5/space/stat/index.d.ts +12 -0
  214. package/lib/service/high5/space/stat/index.js +34 -0
  215. package/lib/service/high5/space/wave/index.d.ts +16 -6
  216. package/lib/service/high5/space/wave/index.js +15 -11
  217. package/lib/service/high5/space/webhook/index.d.ts +32 -12
  218. package/lib/service/high5/space/webhook/index.js +29 -22
  219. package/lib/service/high5/space/webhook/log/index.d.ts +4 -2
  220. package/lib/service/high5/space/webhook/log/index.js +6 -3
  221. package/lib/service/high5/stat/index.d.ts +11 -0
  222. package/lib/service/{fuse/internal → high5/stat}/index.js +16 -14
  223. package/lib/service/high5/wave/index.js +4 -1
  224. package/lib/service/high5/wave/s3/index.d.ts +31 -8
  225. package/lib/service/high5/wave/s3/index.js +47 -23
  226. package/lib/service/idp/guest/index.d.ts +42 -0
  227. package/lib/service/idp/guest/index.js +69 -0
  228. package/lib/service/idp/index.d.ts +25 -7
  229. package/lib/service/idp/index.js +27 -13
  230. package/lib/service/idp/internal/index.d.ts +5 -3
  231. package/lib/service/idp/internal/index.js +9 -4
  232. package/lib/service/idp/oauth/device.d.ts +131 -0
  233. package/lib/service/idp/oauth/device.js +177 -0
  234. package/lib/service/idp/oauth/index.d.ts +19 -6
  235. package/lib/service/idp/oauth/index.js +26 -16
  236. package/lib/service/idp/organization/index.d.ts +28 -5
  237. package/lib/service/idp/organization/index.js +41 -11
  238. package/lib/service/idp/organization/license/index.d.ts +7 -3
  239. package/lib/service/idp/organization/license/index.js +8 -5
  240. package/lib/service/idp/organization/member/index.d.ts +20 -8
  241. package/lib/service/idp/organization/member/index.js +20 -15
  242. package/lib/service/idp/organization/member/invitations/index.d.ts +42 -9
  243. package/lib/service/idp/organization/member/invitations/index.js +94 -59
  244. package/lib/service/idp/organization/service-accounts/index.d.ts +31 -9
  245. package/lib/service/idp/organization/service-accounts/index.js +35 -14
  246. package/lib/service/idp/organization/settings/domain/index.d.ts +13 -5
  247. package/lib/service/idp/organization/settings/domain/index.js +13 -9
  248. package/lib/service/idp/organization/settings/domain/saml/index.d.ts +16 -6
  249. package/lib/service/idp/organization/settings/domain/saml/index.js +23 -19
  250. package/lib/service/idp/organization/settings/index.js +4 -1
  251. package/lib/service/idp/organization/settings/oauth/index.d.ts +33 -9
  252. package/lib/service/idp/organization/settings/oauth/index.js +37 -16
  253. package/lib/service/idp/organization/stat/index.d.ts +11 -0
  254. package/lib/service/idp/organization/stat/index.js +33 -0
  255. package/lib/service/idp/organization/team/index.d.ts +32 -10
  256. package/lib/service/idp/organization/team/index.js +35 -14
  257. package/lib/service/idp/registration/index.d.ts +10 -4
  258. package/lib/service/idp/registration/index.js +19 -10
  259. package/lib/service/idp/user/index.d.ts +41 -11
  260. package/lib/service/idp/user/index.js +49 -19
  261. package/lib/service/idp/user/license/index.d.ts +7 -3
  262. package/lib/service/idp/user/license/index.js +8 -5
  263. package/lib/service/idp/user/message/index.d.ts +62 -0
  264. package/lib/service/idp/user/message/index.js +95 -0
  265. package/lib/service/idp/user/password/index.d.ts +4 -2
  266. package/lib/service/idp/user/password/index.js +6 -3
  267. package/lib/service/idp/user/settings/connections/index.d.ts +4 -2
  268. package/lib/service/idp/user/settings/connections/index.js +6 -3
  269. package/lib/service/idp/user/settings/general/index.d.ts +10 -4
  270. package/lib/service/idp/user/settings/general/index.js +10 -7
  271. package/lib/service/idp/user/settings/index.js +4 -1
  272. package/lib/service/idp/user/settings/notifications/index.d.ts +7 -3
  273. package/lib/service/idp/user/settings/notifications/index.js +8 -5
  274. package/lib/service/idp/user/settings/oauthApps/index.d.ts +7 -3
  275. package/lib/service/idp/user/settings/oauthApps/index.js +10 -6
  276. package/lib/service/idp/user/settings/pats/index.d.ts +22 -8
  277. package/lib/service/idp/user/settings/pats/index.js +21 -16
  278. package/lib/service/idp/user/settings/twoFactor/index.js +4 -1
  279. package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +16 -6
  280. package/lib/service/idp/user/settings/twoFactor/totp/index.js +17 -11
  281. package/lib/service/mailer/index.d.ts +4 -2
  282. package/lib/service/mailer/index.js +7 -4
  283. package/lib/service/mailer/internal/index.d.ts +14 -6
  284. package/lib/service/mailer/internal/index.js +12 -9
  285. package/lib/service/mothership/index.d.ts +35 -13
  286. package/lib/service/mothership/index.js +36 -18
  287. package/lib/service/nats/index.d.ts +7 -0
  288. package/lib/service/nats/index.js +77 -44
  289. package/lib/service/shorts/index.d.ts +18 -0
  290. package/lib/service/{friday → shorts}/index.js +17 -11
  291. package/lib/service/shorts/internal/index.d.ts +75 -0
  292. package/lib/service/shorts/internal/index.js +118 -0
  293. package/lib/utils/bouncer/features/Provider.js +0 -1
  294. package/package.json +2 -2
  295. package/lib/interfaces/friday/index.d.ts +0 -3
  296. package/lib/interfaces/friday/space/index.d.ts +0 -21
  297. package/lib/interfaces/friday/space/index.js +0 -11
  298. package/lib/interfaces/fuse/index.d.ts +0 -3
  299. package/lib/interfaces/fuse/index.js +0 -19
  300. package/lib/interfaces/fuse/space/cronjob/Cronjob.d.ts +0 -38
  301. package/lib/interfaces/fuse/space/cronjob/Cronjob.js +0 -8
  302. package/lib/interfaces/fuse/space/index.d.ts +0 -22
  303. package/lib/interfaces/fuse/space/index.js +0 -11
  304. package/lib/service/dali/avatar/DaliFuseSpace.d.ts +0 -26
  305. package/lib/service/dali/avatar/DaliFuseSpace.js +0 -58
  306. package/lib/service/friday/index.d.ts +0 -13
  307. package/lib/service/friday/space/index.d.ts +0 -81
  308. package/lib/service/friday/space/index.js +0 -150
  309. package/lib/service/fuse/index.d.ts +0 -18
  310. package/lib/service/fuse/index.js +0 -48
  311. package/lib/service/fuse/internal/index.d.ts +0 -8
  312. package/lib/service/fuse/internal/space/cronjob/index.d.ts +0 -7
  313. package/lib/service/fuse/internal/space/cronjob/index.js +0 -17
  314. package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +0 -15
  315. package/lib/service/fuse/internal/space/index.d.ts +0 -22
  316. package/lib/service/fuse/internal/space/index.js +0 -49
  317. package/lib/service/fuse/space/index.d.ts +0 -81
  318. package/lib/service/fuse/space/index.js +0 -152
  319. /package/lib/interfaces/{friday/space/database/index.js → agent/logging/cloudwatch.js} +0 -0
  320. /package/lib/interfaces/{fuse/space/cronjob/CronjobLog.js → agent/logging/log-collector.js} +0 -0
  321. /package/lib/interfaces/{friday → high5}/space/database/index.d.ts +0 -0
@@ -0,0 +1,420 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.CosmoAsset = void 0;
16
+ const Base_1 = __importDefault(require("../../../Base"));
17
+ const axios_1 = require("../../../interfaces/axios");
18
+ /**
19
+ * @class Asset
20
+ * @extends Base
21
+ *
22
+ * @remarks
23
+ * **Under development, breaking changes possible**
24
+ *
25
+ * Represents an Asset resource in Cosmo, providing methods to interact with the Asset API.
26
+ */
27
+ class CosmoAsset extends Base_1.default {
28
+ getEndpoint(endpoint) {
29
+ return `${this.options.server}/api/cosmo${endpoint}`;
30
+ }
31
+ /**
32
+ * Create a new Asset in Cosmo inside the specified Organization and Space.
33
+ * @remarks
34
+ * ** Under development, breaking changes possible**
35
+ * @param orgName Name of the Organization
36
+ * @param spaceName Name of the Space
37
+ * @param createAsset The Asset to be created
38
+ * @returns The created asset
39
+ */
40
+ createAsset(orgName, spaceName, createAsset, raw) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets`), createAsset);
43
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
44
+ });
45
+ }
46
+ /**
47
+ * Bulk move or copy multiple assets to a new parent.
48
+ * @remarks
49
+ * ** Under development, breaking changes possible**
50
+ * @param orgName Name of the Organization
51
+ * @param spaceName Name of the Space
52
+ * @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.
53
+ * @param assetIdList List of Asset IDs to be moved to trash
54
+ * @param copy Whether to copy (true) or move (false) the assets
55
+ * @returns The moved assets
56
+ */
57
+ bulkMove(orgName_1, spaceName_1, assetIdList_1, newParentId_1) {
58
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, assetIdList, newParentId, copy = false, raw) {
59
+ const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/bulk-move-copy`), {
60
+ assetIds: assetIdList,
61
+ parentId: newParentId,
62
+ copy: copy,
63
+ });
64
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
65
+ });
66
+ }
67
+ /**
68
+ * Attach an asset to a location.
69
+ * @remarks
70
+ * ** Under development, breaking changes possible**
71
+ * @param orgName Name of the Organization
72
+ * @param spaceName Name of the Space
73
+ * @param assetId ID of the Asset to be attached
74
+ * @param locationId ID of the Location to which the Asset will be attached to
75
+ * @returns 204 No Content if successful
76
+ */
77
+ attachAssetToLocation(orgName, spaceName, assetId, locationId, raw) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/location`), {
80
+ locationId: locationId,
81
+ });
82
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
83
+ });
84
+ }
85
+ /**
86
+ * Patch an asset.
87
+ * @remarks
88
+ * ** Under development, breaking changes possible**
89
+ * @param orgName Name of the Organization
90
+ * @param spaceName Name of the Space
91
+ * @param assetId ID of the Asset to be attached
92
+ * @param patchAsset The Asset to be patched
93
+ * @returns The patched asset
94
+ */
95
+ patchAsset(orgName, spaceName, assetId, patchAsset, raw) {
96
+ return __awaiter(this, void 0, void 0, function* () {
97
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}`), patchAsset);
98
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
99
+ });
100
+ }
101
+ /**
102
+ * Get an asset by its ID.
103
+ * @remarks
104
+ * ** Under development, breaking changes possible**
105
+ * @param orgName Name of the Organization
106
+ * @param spaceName Name of the Space
107
+ * @param assetId ID of the Asset to be attached
108
+ * @param namespace Optional Namespaces of which information should be included in the returned object
109
+ * @param includePermissions Whether to include permissions in the result or not
110
+ * @returns The requested asset
111
+ */
112
+ getAsset(orgName_1, spaceName_1, assetId_1, namespace_1) {
113
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, assetId, namespace, includePermissions = false, raw) {
114
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}`), {
115
+ params: {
116
+ namespace,
117
+ permissions: includePermissions ? "true" : "false",
118
+ },
119
+ });
120
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
121
+ });
122
+ }
123
+ /**
124
+ * Delete multiple assets permanently by their IDs.
125
+ * @remarks
126
+ * ** Under development, breaking changes possible**
127
+ * @param orgName Name of the Organization
128
+ * @param spaceName Name of the Space
129
+ * @param assetIds IDs of the Assets to delete
130
+ * @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
131
+ * @returns 204 No Content if successful
132
+ */
133
+ deleteAssets(orgName, spaceName, assetIds, force, raw) {
134
+ return __awaiter(this, void 0, void 0, function* () {
135
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets`), {
136
+ data: { assetIds },
137
+ params: { force },
138
+ });
139
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
140
+ });
141
+ }
142
+ /**
143
+ * Request download URLs for multiple assets.
144
+ * @remarks
145
+ * ** Under development, breaking changes possible**
146
+ * @param orgName Name of the Organization
147
+ * @param spaceName Name of the Space
148
+ * @param assetIdList List of Asset IDs for which download URLs are requested
149
+ * @param resolution The desired resolution for the download URLs
150
+ * @returns A map of Asset IDs to their download URLs
151
+ */
152
+ requestDownloadUrls(orgName, spaceName, assetIdList, resolution, raw) {
153
+ return __awaiter(this, void 0, void 0, function* () {
154
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/downloadUrls`), {
155
+ assetIds: assetIdList,
156
+ resolution: resolution,
157
+ });
158
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
159
+ });
160
+ }
161
+ /**
162
+ * Upload an asset.
163
+ * @remarks
164
+ * ** Under development, breaking changes possible**
165
+ * ** Check this endpoint for currency as it looks outdated.**
166
+ * @param token An upload token for the asset
167
+ * @returns The uploaded asset
168
+ */
169
+ uploadAsset(token, raw) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ const resp = yield this.axios.put(this.getEndpoint(`/v1/assets/upload?${token}`));
172
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
173
+ });
174
+ }
175
+ /**
176
+ * Move assets to the trash bin.
177
+ * @remarks
178
+ * ** Under development, breaking changes possible**
179
+ * @param orgName Name of the Organization
180
+ * @param spaceName Name of the Space
181
+ * @param assetIdList List of Asset IDs to be moved to trash
182
+ * @returns The moved assets
183
+ */
184
+ moveAssetsToTrash(orgName, spaceName, assetIdList, raw) {
185
+ return __awaiter(this, void 0, void 0, function* () {
186
+ const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/trash`), {
187
+ assetIds: assetIdList,
188
+ });
189
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
190
+ });
191
+ }
192
+ /**
193
+ * Fetch permissions for a group of assets.
194
+ * @remarks
195
+ * ** Under development, breaking changes possible**
196
+ * @param orgName Name of the Organization
197
+ * @param spaceName Name of the Space
198
+ * @param assetIdList List of Asset IDs to be moved to trash
199
+ * @returns A map of Asset IDs to their permissions
200
+ */
201
+ fetchAssetPermissions(orgName, spaceName, assetIdList, raw) {
202
+ return __awaiter(this, void 0, void 0, function* () {
203
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/permissions`), {
204
+ assetIds: assetIdList,
205
+ });
206
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
207
+ });
208
+ }
209
+ /**
210
+ * Fetches the activity log for a specific asset within a given organization and space.
211
+ *
212
+ * @param {string} orgName - The name of the organization that owns the space.
213
+ * @param {string} spaceName - The name of the space containing the asset.
214
+ * @param {string} assetId - The unique identifier of the asset whose activity is being fetched.
215
+ * @param {number} limit - The maximum number of audit log entries to retrieve per page.
216
+ * @param {number} page - The page number to retrieve (for pagination).
217
+ * @returns {Promise<AuditLog[]>} A promise that resolves to an array of `AuditLog` objects representing the asset’s activity history.
218
+ */
219
+ fetchAssetActivity(orgName, spaceName, assetId, limit, page, raw) {
220
+ return __awaiter(this, void 0, void 0, function* () {
221
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/activity`), {
222
+ params: {
223
+ limit,
224
+ page,
225
+ },
226
+ });
227
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
228
+ });
229
+ }
230
+ /**
231
+ * Fetches an assets VTT file and parses it to return an array of VTTThumbnail objects.
232
+ *
233
+ * @param {string} url - The URL of the VTT file to fetch and parse.
234
+ * @returns {Promise<VTTThumbnail[]>} A promise that resolves to an array of `VTTThumbnail` objects representing the asset’s thumbnails.
235
+ */
236
+ fetchAndParseAssetVTT(url, raw) {
237
+ return __awaiter(this, void 0, void 0, function* () {
238
+ var _a;
239
+ const resp = yield this.axios.get(url, {
240
+ headers: Object.assign(Object.assign({}, axios_1.disableCacheHeaders), { Authorization: undefined }),
241
+ });
242
+ const parseTimestamp = (ts) => {
243
+ const parts = ts.split(":").map(Number);
244
+ if (parts.length === 3) {
245
+ return parts[0] * 3600 + parts[1] * 60 + parts[2];
246
+ }
247
+ return parts[0] * 60 + parts[1];
248
+ };
249
+ const lines = resp.data.split(/\r?\n/);
250
+ const thumbnails = [];
251
+ for (let i = 0; i < lines.length; i++) {
252
+ const timeMatch = lines[i].match(/(\d{2}:\d{2}:\d{2}\.\d{3})\s-->\s(\d{2}:\d{2}:\d{2}\.\d{3})/);
253
+ if (timeMatch) {
254
+ const start = parseTimestamp(timeMatch[1]);
255
+ const end = parseTimestamp(timeMatch[2]);
256
+ const imageLine = (_a = lines[i + 1]) === null || _a === void 0 ? void 0 : _a.trim();
257
+ if (!imageLine)
258
+ continue;
259
+ const [url, fragment] = imageLine.split("#");
260
+ let xywh = undefined;
261
+ if (fragment === null || fragment === void 0 ? void 0 : fragment.startsWith("xywh=")) {
262
+ const [x, y, w, h] = fragment.replace("xywh=", "").split(",").map(Number);
263
+ xywh = { x, y, w, h };
264
+ }
265
+ thumbnails.push({
266
+ start,
267
+ end,
268
+ url,
269
+ xywh,
270
+ });
271
+ }
272
+ }
273
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : thumbnails);
274
+ });
275
+ }
276
+ /**
277
+ * Rename an asset.
278
+ * @remarks
279
+ * ** Under development, breaking changes possible**
280
+ * @param orgName Name of the Organization
281
+ * @param spaceName Name of the Space
282
+ * @param assetId ID of the Asset to be renamed
283
+ * @returns The renamed asset
284
+ */
285
+ renameAsset(orgName, spaceName, assetId, newName, raw) {
286
+ return __awaiter(this, void 0, void 0, function* () {
287
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/name`), {
288
+ name: newName,
289
+ });
290
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
291
+ });
292
+ }
293
+ /**
294
+ * Move assets out of trash and therewith recover them.
295
+ * @remarks
296
+ * ** Under development, breaking changes possible**
297
+ * @param orgName Name of the Organization
298
+ * @param spaceName Name of the Space
299
+ * @param assetIdList List of Asset IDs to be moved out of trash
300
+ * @returns The moved assets
301
+ */
302
+ moveAssetsOutOfTrash(orgName, spaceName, assetIdList, raw) {
303
+ return __awaiter(this, void 0, void 0, function* () {
304
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/trash`), {
305
+ data: {
306
+ assetIds: assetIdList,
307
+ },
308
+ });
309
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
310
+ });
311
+ }
312
+ /**
313
+ * Attach a tag to an asset or replace an existing one.
314
+ * @remarks
315
+ * ** Under development, breaking changes possible**
316
+ * @param orgName Name of the Organization
317
+ * @param spaceName Name of the Space
318
+ * @param namespaceName Name of the namespace
319
+ * @param assetId ID of the Asset to be attached
320
+ * @param tagName Name of the tag
321
+ * @returns The updated asset
322
+ */
323
+ attachTagToAsset(orgName, spaceName, namespaceName, assetId, tagName, raw) {
324
+ return __awaiter(this, void 0, void 0, function* () {
325
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/assets/${assetId}/tags/${tagName}`));
326
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
327
+ });
328
+ }
329
+ /**
330
+ * Remove a tag from an asset.
331
+ * @remarks
332
+ * ** Under development, breaking changes possible**
333
+ * @param orgName Name of the Organization
334
+ * @param spaceName Name of the Space
335
+ * @param namespaceName Name of the Namespace
336
+ * @param assetId ID of the Asset to be attached
337
+ * @returns The updated asset
338
+ */
339
+ removeTagFromAsset(orgName, spaceName, namespaceName, assetId, raw) {
340
+ return __awaiter(this, void 0, void 0, function* () {
341
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/assets/${assetId}/tags`));
342
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
343
+ });
344
+ }
345
+ /**
346
+ * List users allowed to be mentioned in a comment of an asset.
347
+ * @param assetId ID of the Asset
348
+ * @param limit Maximum number of users to return
349
+ * @param page Page number for pagination
350
+ * @returns A list of users allowed to be mentioned in a comment of the asset
351
+ */
352
+ listUsersAllowedToMention(orgName, spaceName, assetId, limit, page, raw) {
353
+ return __awaiter(this, void 0, void 0, function* () {
354
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/users`), {
355
+ params: { limit, page },
356
+ });
357
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
358
+ });
359
+ }
360
+ /**
361
+ * Clone one or more assets within a space.
362
+ *
363
+ * This operation creates copies of the specified assets in the same organization and space.
364
+ *
365
+ * @param orgName Name of the Organization
366
+ * @param spaceName Name of the Space
367
+ * @param assetIds List of Asset IDs to be cloned. If folder IDs are specified, they will be recursively cloned.
368
+ * @param parentId (optional) Id of parent asset of the newly cloned asset. If undefined will default to space as parent.
369
+ * @returns The cloned assets
370
+ */
371
+ cloneAsset(orgName, spaceName, assetIds, parentId, raw) {
372
+ return __awaiter(this, void 0, void 0, function* () {
373
+ const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/clone`), { assetIds, parentId });
374
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
375
+ });
376
+ }
377
+ /**
378
+ * Subscribe to notifications for a specific asset or all assets in a space.
379
+ *
380
+ * @param orgName Name of the Organization
381
+ * @param spaceName Name of the Space
382
+ * @param assetId (optional) ID of the Asset to subscribe to. If not provided, subscribes to the space.
383
+ * @param filters (optional) Subscription configuration. If 'filters' is omitted or empty, all notification types will be sent.
384
+ * @param raw
385
+ * @returns 204 No Content if successful
386
+ */
387
+ subscribe(orgName, spaceName, assetId, filters, raw) {
388
+ return __awaiter(this, void 0, void 0, function* () {
389
+ let resp;
390
+ if (assetId) {
391
+ resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/subscribe`), { filters });
392
+ }
393
+ else {
394
+ resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/subscribe`), { filters });
395
+ }
396
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
397
+ });
398
+ }
399
+ /**
400
+ * Unsubscribe from notifications for a specific asset or all assets in a space.
401
+ *
402
+ * @param orgName Name of the Organization
403
+ * @param spaceName Name of the Space
404
+ * @param assetId (optional) ID of the Asset to unsubscribe from. If not provided, unsubscribes from the space.
405
+ * @returns 204 No Content if successful
406
+ */
407
+ unsubscribe(orgName, spaceName, assetId, raw) {
408
+ return __awaiter(this, void 0, void 0, function* () {
409
+ let resp;
410
+ if (assetId) {
411
+ resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/subscribe`));
412
+ }
413
+ else {
414
+ resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/subscribe`));
415
+ }
416
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
417
+ });
418
+ }
419
+ }
420
+ exports.CosmoAsset = CosmoAsset;
@@ -0,0 +1,93 @@
1
+ import Base, { MaybeRaw } from "../../../Base";
2
+ import { Comment, CreateComment, EditComment, Reply } from "../../../interfaces/cosmo/comment";
3
+ /**
4
+ * @class Comment
5
+ * @extends Base
6
+ *
7
+ * @remarks
8
+ * **Under development, breaking changes possible**
9
+ *
10
+ * Represents a Comment resource in Cosmo, providing methods to interact with the Comment API.
11
+ */
12
+ export declare class CosmoComment extends Base {
13
+ protected getEndpoint(endpoint: string): string;
14
+ /**
15
+ * Create a new Comment in the specified Organization, Space and Namespace for a specific Asset Reference.
16
+ * @remarks
17
+ * ** Under development, breaking changes possible**
18
+ * @param orgName Name of the Organization
19
+ * @param spaceName Name of the Space
20
+ * @param namespaceName Name of the Namespace
21
+ * @param comment Content of the Comment to create
22
+ * @param annotation Whether to include annotations in the response
23
+ * @returns The created Comment
24
+ */
25
+ createComment<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, comment: CreateComment, annotation?: boolean, raw?: {
26
+ raw: R;
27
+ }): Promise<MaybeRaw<R, Comment | Reply>>;
28
+ /**
29
+ * List Comments
30
+ * @remarks
31
+ * ** Under development, breaking changes possible**
32
+ * @param orgName Name of the Organization
33
+ * @param spaceName Name of the Space
34
+ * @param namespaceName Name of the Namespace
35
+ * @param limit Maximum number of comments to return, user -1 for no limit
36
+ * @param page Page number for pagination
37
+ * @param annotation Whether to include annotations in the response
38
+ * @param replySample Amount of replies to load
39
+ * @param accept The Accept header value, either "application/json" (comments response as json)
40
+ * or "application/mediacomposer+xml" (comments response as media composer xml as download)
41
+ * or "application/fcp+xml" (comments response as fcp xml as download => i.e. for Adobe Premiere Pro)
42
+ * or "text/edl" (comments response as edl as download => i.e. for Davinci Resolve)
43
+ * @returns A list of Comments
44
+ */
45
+ listComments<R extends boolean = false, A extends string = "application/json">(orgName: string, spaceName: string, namespaceName: string, refId: string, limit?: number, page?: number, annotation?: boolean, replySample?: number, accept?: A, raw?: {
46
+ raw: R;
47
+ }): Promise<A extends "application/mediacomposer+xml" | "application/fcp+xml" | "text/edl" ? ArrayBuffer : MaybeRaw<R, Comment[]>>;
48
+ /**
49
+ * Edit a Comment
50
+ * @remarks
51
+ * ** Under development, breaking changes possible**
52
+ * @param orgName Name of the Organization
53
+ * @param spaceName Name of the Space
54
+ * @param namespaceName Name of the Namespace
55
+ * @param commentId ID of the Comment to edit
56
+ * @param editComment Content of the Comment to edit
57
+ * @param annotation Whether to include annotations in the response
58
+ *
59
+ * @returns The edited Comment
60
+ */
61
+ editComment<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, commentId: string, editComment: EditComment, annotation?: boolean, raw?: {
62
+ raw: R;
63
+ }): Promise<MaybeRaw<R, Comment | Reply>>;
64
+ /**
65
+ * Get a single Comment by ID
66
+ * @remarks
67
+ * ** Under development, breaking changes possible**
68
+ * @param orgName Name of the Organization
69
+ * @param spaceName Name of the Space
70
+ * @param namespaceName Name of the Namespace
71
+ * @param commentId ID of the Comment to edit
72
+ * @param annotation Whether to include annotations in the response
73
+ *
74
+ * @returns The requested Comment
75
+ */
76
+ getComment<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, commentId: string, annotation?: boolean, raw?: {
77
+ raw: R;
78
+ }): Promise<MaybeRaw<R, Comment | Reply>>;
79
+ /**
80
+ * Delete Comments by ID
81
+ * @remarks
82
+ * ** Under development, breaking changes possible**
83
+ * @param orgName Name of the Organization
84
+ * @param spaceName Name of the Space
85
+ * @param namespaceName Name of the Namespace
86
+ * @param commentIds IDs of the Comments to delete
87
+ *
88
+ * @returns 204 No Content on success
89
+ */
90
+ deleteComment<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, commentIds: string[], raw?: {
91
+ raw: R;
92
+ }): Promise<MaybeRaw<R, void>>;
93
+ }
@@ -0,0 +1,136 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.CosmoComment = void 0;
16
+ const Base_1 = __importDefault(require("../../../Base"));
17
+ /**
18
+ * @class Comment
19
+ * @extends Base
20
+ *
21
+ * @remarks
22
+ * **Under development, breaking changes possible**
23
+ *
24
+ * Represents a Comment resource in Cosmo, providing methods to interact with the Comment API.
25
+ */
26
+ class CosmoComment extends Base_1.default {
27
+ getEndpoint(endpoint) {
28
+ return `${this.options.server}/api/cosmo${endpoint}`;
29
+ }
30
+ /**
31
+ * Create a new Comment in the specified Organization, Space and Namespace for a specific Asset Reference.
32
+ * @remarks
33
+ * ** Under development, breaking changes possible**
34
+ * @param orgName Name of the Organization
35
+ * @param spaceName Name of the Space
36
+ * @param namespaceName Name of the Namespace
37
+ * @param comment Content of the Comment to create
38
+ * @param annotation Whether to include annotations in the response
39
+ * @returns The created Comment
40
+ */
41
+ createComment(orgName_1, spaceName_1, namespaceName_1, comment_1) {
42
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, comment, annotation = false, raw) {
43
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments?annotation=${annotation}`), comment);
44
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
45
+ });
46
+ }
47
+ /**
48
+ * List Comments
49
+ * @remarks
50
+ * ** Under development, breaking changes possible**
51
+ * @param orgName Name of the Organization
52
+ * @param spaceName Name of the Space
53
+ * @param namespaceName Name of the Namespace
54
+ * @param limit Maximum number of comments to return, user -1 for no limit
55
+ * @param page Page number for pagination
56
+ * @param annotation Whether to include annotations in the response
57
+ * @param replySample Amount of replies to load
58
+ * @param accept The Accept header value, either "application/json" (comments response as json)
59
+ * or "application/mediacomposer+xml" (comments response as media composer xml as download)
60
+ * or "application/fcp+xml" (comments response as fcp xml as download => i.e. for Adobe Premiere Pro)
61
+ * or "text/edl" (comments response as edl as download => i.e. for Davinci Resolve)
62
+ * @returns A list of Comments
63
+ */
64
+ listComments(orgName_1, spaceName_1, namespaceName_1, refId_1, limit_1, page_1) {
65
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, refId, limit, page, annotation = false, replySample = 0, accept, raw) {
66
+ limit = limit !== null && limit !== void 0 ? limit : 100;
67
+ page = page !== null && page !== void 0 ? page : 0;
68
+ const fileDownloadTypes = new Set(["application/mediacomposer+xml", "application/fcp+xml", "text/edl"]);
69
+ const isFileDownload = accept !== undefined && fileDownloadTypes.has(accept);
70
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments?limit=${limit}&page=${page}&annotation=${annotation}&refId=${refId}&replySample=${replySample}`), Object.assign({ headers: {
71
+ Accept: accept !== null && accept !== void 0 ? accept : "application/json",
72
+ } }, (isFileDownload && { responseType: "arraybuffer" })));
73
+ if (isFileDownload) {
74
+ return resp.data;
75
+ }
76
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
77
+ });
78
+ }
79
+ /**
80
+ * Edit a Comment
81
+ * @remarks
82
+ * ** Under development, breaking changes possible**
83
+ * @param orgName Name of the Organization
84
+ * @param spaceName Name of the Space
85
+ * @param namespaceName Name of the Namespace
86
+ * @param commentId ID of the Comment to edit
87
+ * @param editComment Content of the Comment to edit
88
+ * @param annotation Whether to include annotations in the response
89
+ *
90
+ * @returns The edited Comment
91
+ */
92
+ editComment(orgName_1, spaceName_1, namespaceName_1, commentId_1, editComment_1) {
93
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, commentId, editComment, annotation = false, raw) {
94
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments/${commentId}?annotation=${annotation}`), editComment);
95
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
96
+ });
97
+ }
98
+ /**
99
+ * Get a single Comment by ID
100
+ * @remarks
101
+ * ** Under development, breaking changes possible**
102
+ * @param orgName Name of the Organization
103
+ * @param spaceName Name of the Space
104
+ * @param namespaceName Name of the Namespace
105
+ * @param commentId ID of the Comment to edit
106
+ * @param annotation Whether to include annotations in the response
107
+ *
108
+ * @returns The requested Comment
109
+ */
110
+ getComment(orgName_1, spaceName_1, namespaceName_1, commentId_1) {
111
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, commentId, annotation = false, raw) {
112
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments/${commentId}?annotation=${annotation}`));
113
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
114
+ });
115
+ }
116
+ /**
117
+ * Delete Comments by ID
118
+ * @remarks
119
+ * ** Under development, breaking changes possible**
120
+ * @param orgName Name of the Organization
121
+ * @param spaceName Name of the Space
122
+ * @param namespaceName Name of the Namespace
123
+ * @param commentIds IDs of the Comments to delete
124
+ *
125
+ * @returns 204 No Content on success
126
+ */
127
+ deleteComment(orgName, spaceName, namespaceName, commentIds, raw) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments`), {
130
+ data: { commentIds },
131
+ });
132
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
133
+ });
134
+ }
135
+ }
136
+ exports.CosmoComment = CosmoComment;
@@ -0,0 +1,23 @@
1
+ import Base, { MaybeRaw } from "../../../Base";
2
+ import { CosmoEvents as ICosmoEvents } from "../../../interfaces/cosmo/event";
3
+ /**
4
+ * @class Event
5
+ * @extends Base
6
+ *
7
+ * @remarks
8
+ * **Under development, breaking changes possible**
9
+ *
10
+ * Represents a Event resource in Cosmo, providing methods to interact with the Event API.
11
+ */
12
+ export declare class CosmoEvent extends Base {
13
+ protected getEndpoint(endpoint: string): string;
14
+ /**
15
+ * Get a list of Events available in Cosmo
16
+ * @remarks
17
+ * ** Under development, breaking changes possible**
18
+ * @returns An Object holding all cosmo events sorted
19
+ */
20
+ getCosmoEvents<R extends boolean = false>(raw?: {
21
+ raw: R;
22
+ }): Promise<MaybeRaw<R, ICosmoEvents>>;
23
+ }