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,43 @@
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.CosmoEvent = void 0;
16
+ const Base_1 = __importDefault(require("../../../Base"));
17
+ /**
18
+ * @class Event
19
+ * @extends Base
20
+ *
21
+ * @remarks
22
+ * **Under development, breaking changes possible**
23
+ *
24
+ * Represents a Event resource in Cosmo, providing methods to interact with the Event API.
25
+ */
26
+ class CosmoEvent extends Base_1.default {
27
+ getEndpoint(endpoint) {
28
+ return `${this.options.server}/api/cosmo${endpoint}`;
29
+ }
30
+ /**
31
+ * Get a list of Events available in Cosmo
32
+ * @remarks
33
+ * ** Under development, breaking changes possible**
34
+ * @returns An Object holding all cosmo events sorted
35
+ */
36
+ getCosmoEvents(raw) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/events`));
39
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
40
+ });
41
+ }
42
+ }
43
+ exports.CosmoEvent = CosmoEvent;
@@ -0,0 +1,27 @@
1
+ import Base, { MaybeRaw } from "../../../Base";
2
+ import { Asset } from "../../../interfaces/cosmo/asset";
3
+ /**
4
+ * @class Folder
5
+ * @extends Base
6
+ *
7
+ * @remarks
8
+ * **Under development, breaking changes possible**
9
+ *
10
+ * Represents a Folder resource in Cosmo, providing methods to interact with the Folder API.
11
+ */
12
+ export declare class CosmoFolder extends Base {
13
+ protected getEndpoint(endpoint: string): string;
14
+ /**
15
+ * Create a new Folder in the specified Organization and Space.
16
+ * @remarks
17
+ * ** Under development, breaking changes possible**
18
+ * @param orgName Name of the Organization
19
+ * @param spaceName Name of the Space
20
+ * @param folderName Name of the Folder to create
21
+ * @param parentId Optional ID of the parent Folder. If not provided, the Folder will be created at the root level.
22
+ * @returns The created Folder
23
+ */
24
+ createFolder<R extends boolean = false>(orgName: string, spaceName: string, folderName: string, parentId?: string, raw?: {
25
+ raw: R;
26
+ }): Promise<MaybeRaw<R, Asset>>;
27
+ }
@@ -0,0 +1,50 @@
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.CosmoFolder = void 0;
16
+ const Base_1 = __importDefault(require("../../../Base"));
17
+ /**
18
+ * @class Folder
19
+ * @extends Base
20
+ *
21
+ * @remarks
22
+ * **Under development, breaking changes possible**
23
+ *
24
+ * Represents a Folder resource in Cosmo, providing methods to interact with the Folder API.
25
+ */
26
+ class CosmoFolder extends Base_1.default {
27
+ getEndpoint(endpoint) {
28
+ return `${this.options.server}/api/cosmo${endpoint}`;
29
+ }
30
+ /**
31
+ * Create a new Folder in the specified Organization and Space.
32
+ * @remarks
33
+ * ** Under development, breaking changes possible**
34
+ * @param orgName Name of the Organization
35
+ * @param spaceName Name of the Space
36
+ * @param folderName Name of the Folder to create
37
+ * @param parentId Optional ID of the parent Folder. If not provided, the Folder will be created at the root level.
38
+ * @returns The created Folder
39
+ */
40
+ createFolder(orgName, spaceName, folderName, parentId, raw) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/folders`), {
43
+ name: folderName,
44
+ parentId: parentId,
45
+ });
46
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
47
+ });
48
+ }
49
+ }
50
+ exports.CosmoFolder = CosmoFolder;
@@ -0,0 +1,52 @@
1
+ import Base from "../../Base";
2
+ import { Version } from "../../interfaces/global";
3
+ import { CosmoAsset } from "./asset";
4
+ import { CosmoComment } from "./comment";
5
+ import { CosmoEvent } from "./event";
6
+ import { CosmoFolder } from "./folder";
7
+ import { CosmoSpaceInternal } from "./internal/space";
8
+ import { CosmoLocation } from "./location";
9
+ import { CosmoNamespace } from "./namespace";
10
+ import { CosmoOrganization } from "./organization";
11
+ import { CosmoPermissions } from "./permissions";
12
+ import { CosmoProduction } from "./production";
13
+ import { CosmoShare } from "./share";
14
+ import { CosmoSpace } from "./space";
15
+ import { CosmoStats } from "./stats";
16
+ import { CosmoTag } from "./tag";
17
+ export default class CosmoService extends Base {
18
+ get cosmoAsset(): CosmoAsset;
19
+ private _cosmoAsset?;
20
+ get cosmoSpace(): CosmoSpace;
21
+ private _cosmoSpace?;
22
+ get cosmoLocation(): CosmoLocation;
23
+ private _cosmoLocation?;
24
+ get cosmoProduction(): CosmoProduction;
25
+ private _cosmoProduction?;
26
+ get cosmoFolder(): CosmoFolder;
27
+ private _cosmoFolder?;
28
+ get cosmoNamespace(): CosmoNamespace;
29
+ private _cosmoNamespace?;
30
+ get cosmoComment(): CosmoComment;
31
+ private _cosmoComment?;
32
+ get cosmoShare(): CosmoShare;
33
+ private _cosmoShare?;
34
+ get cosmoOrganization(): CosmoOrganization;
35
+ private _cosmoOrganization?;
36
+ get cosmoSpaceInternal(): CosmoSpaceInternal;
37
+ private _cosmoSpaceInternal?;
38
+ get cosmoEvent(): CosmoEvent;
39
+ private _cosmoEvent?;
40
+ get cosmoTag(): CosmoTag;
41
+ private _cosmoTag?;
42
+ get cosmoPermissions(): CosmoPermissions;
43
+ private _cosmoPermissions?;
44
+ get cosmoStats(): CosmoStats;
45
+ private _cosmoStats?;
46
+ /**
47
+ * Requests the endpoint version
48
+ * @returns Version object
49
+ */
50
+ version(): Promise<Version>;
51
+ protected getEndpoint(endpoint: string): string;
52
+ }
@@ -0,0 +1,129 @@
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
+ const Base_1 = __importDefault(require("../../Base"));
16
+ const asset_1 = require("./asset");
17
+ const comment_1 = require("./comment");
18
+ const event_1 = require("./event");
19
+ const folder_1 = require("./folder");
20
+ const space_1 = require("./internal/space");
21
+ const location_1 = require("./location");
22
+ const namespace_1 = require("./namespace");
23
+ const organization_1 = require("./organization");
24
+ const permissions_1 = require("./permissions");
25
+ const production_1 = require("./production");
26
+ const share_1 = require("./share");
27
+ const space_2 = require("./space");
28
+ const stats_1 = require("./stats");
29
+ const tag_1 = require("./tag");
30
+ class CosmoService extends Base_1.default {
31
+ get cosmoAsset() {
32
+ if (this._cosmoAsset === undefined) {
33
+ this._cosmoAsset = new asset_1.CosmoAsset(this.options, this.axios);
34
+ }
35
+ return this._cosmoAsset;
36
+ }
37
+ get cosmoSpace() {
38
+ if (this._cosmoSpace === undefined) {
39
+ this._cosmoSpace = new space_2.CosmoSpace(this.options, this.axios);
40
+ }
41
+ return this._cosmoSpace;
42
+ }
43
+ get cosmoLocation() {
44
+ if (this._cosmoLocation === undefined) {
45
+ this._cosmoLocation = new location_1.CosmoLocation(this.options, this.axios);
46
+ }
47
+ return this._cosmoLocation;
48
+ }
49
+ get cosmoProduction() {
50
+ if (this._cosmoProduction === undefined) {
51
+ this._cosmoProduction = new production_1.CosmoProduction(this.options, this.axios);
52
+ }
53
+ return this._cosmoProduction;
54
+ }
55
+ get cosmoFolder() {
56
+ if (this._cosmoFolder === undefined) {
57
+ this._cosmoFolder = new folder_1.CosmoFolder(this.options, this.axios);
58
+ }
59
+ return this._cosmoFolder;
60
+ }
61
+ get cosmoNamespace() {
62
+ if (this._cosmoNamespace === undefined) {
63
+ this._cosmoNamespace = new namespace_1.CosmoNamespace(this.options, this.axios);
64
+ }
65
+ return this._cosmoNamespace;
66
+ }
67
+ get cosmoComment() {
68
+ if (this._cosmoComment === undefined) {
69
+ this._cosmoComment = new comment_1.CosmoComment(this.options, this.axios);
70
+ }
71
+ return this._cosmoComment;
72
+ }
73
+ get cosmoShare() {
74
+ if (this._cosmoShare === undefined) {
75
+ this._cosmoShare = new share_1.CosmoShare(this.options, this.axios);
76
+ }
77
+ return this._cosmoShare;
78
+ }
79
+ get cosmoOrganization() {
80
+ if (this._cosmoOrganization === undefined) {
81
+ this._cosmoOrganization = new organization_1.CosmoOrganization(this.options, this.axios);
82
+ }
83
+ return this._cosmoOrganization;
84
+ }
85
+ get cosmoSpaceInternal() {
86
+ if (this._cosmoSpaceInternal === undefined) {
87
+ this._cosmoSpaceInternal = new space_1.CosmoSpaceInternal(this.options, this.axios);
88
+ }
89
+ return this._cosmoSpaceInternal;
90
+ }
91
+ get cosmoEvent() {
92
+ if (this._cosmoEvent === undefined) {
93
+ this._cosmoEvent = new event_1.CosmoEvent(this.options, this.axios);
94
+ }
95
+ return this._cosmoEvent;
96
+ }
97
+ get cosmoTag() {
98
+ if (this._cosmoTag === undefined) {
99
+ this._cosmoTag = new tag_1.CosmoTag(this.options, this.axios);
100
+ }
101
+ return this._cosmoTag;
102
+ }
103
+ get cosmoPermissions() {
104
+ if (this._cosmoPermissions === undefined) {
105
+ this._cosmoPermissions = new permissions_1.CosmoPermissions(this.options, this.axios);
106
+ }
107
+ return this._cosmoPermissions;
108
+ }
109
+ get cosmoStats() {
110
+ if (this._cosmoStats === undefined) {
111
+ this._cosmoStats = new stats_1.CosmoStats(this.options, this.axios);
112
+ }
113
+ return this._cosmoStats;
114
+ }
115
+ /**
116
+ * Requests the endpoint version
117
+ * @returns Version object
118
+ */
119
+ version() {
120
+ return __awaiter(this, void 0, void 0, function* () {
121
+ const resp = yield this.axios.get(this.getEndpoint("/v1/version"));
122
+ return resp.data;
123
+ });
124
+ }
125
+ getEndpoint(endpoint) {
126
+ return `${this.options.server}/api/cosmo${endpoint}`;
127
+ }
128
+ }
129
+ exports.default = CosmoService;
@@ -0,0 +1,7 @@
1
+ import Base from "../../../Base";
2
+ import { CosmoSpaceInternal } from "./space";
3
+ export declare class CosmoInternal extends Base {
4
+ get space(): CosmoSpaceInternal;
5
+ private _space?;
6
+ protected getEndpoint(endpoint: string): string;
7
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CosmoInternal = void 0;
7
+ const Base_1 = __importDefault(require("../../../Base"));
8
+ const space_1 = require("./space");
9
+ class CosmoInternal extends Base_1.default {
10
+ get space() {
11
+ if (this._space === undefined) {
12
+ this._space = new space_1.CosmoSpaceInternal(this.options, this.axios);
13
+ }
14
+ return this._space;
15
+ }
16
+ getEndpoint(endpoint) {
17
+ return `${this.options.server}/api/cosmo/internal${endpoint}`;
18
+ }
19
+ }
20
+ exports.CosmoInternal = CosmoInternal;
@@ -0,0 +1,15 @@
1
+ import { AxiosInstance } from "axios";
2
+ import Base, { MaybeRaw, Options } from "../../../../Base";
3
+ export declare class CosmoSpaceInternal extends Base {
4
+ constructor(options: Options, axios: AxiosInstance);
5
+ /**
6
+ * Deletes all spaces of an organization and the organization itself.
7
+ *
8
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
9
+ * @param orgId ID of the organization
10
+ */
11
+ deleteSpacesOfDeletedOrg<R extends boolean = false>(orgId: string, raw?: {
12
+ raw: R;
13
+ }): Promise<MaybeRaw<R, void>>;
14
+ protected getEndpoint(endpoint: string): string;
15
+ }
@@ -0,0 +1,37 @@
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.CosmoSpaceInternal = void 0;
16
+ const Base_1 = __importDefault(require("../../../../Base"));
17
+ class CosmoSpaceInternal extends Base_1.default {
18
+ constructor(options, axios) {
19
+ super(options, axios);
20
+ }
21
+ /**
22
+ * Deletes all spaces of an organization and the organization itself.
23
+ *
24
+ * THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
25
+ * @param orgId ID of the organization
26
+ */
27
+ deleteSpacesOfDeletedOrg(orgId, raw) {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgId}/spaces`));
30
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
31
+ });
32
+ }
33
+ getEndpoint(endpoint) {
34
+ return `${this.options.server}/api/cosmo/internal${endpoint}`;
35
+ }
36
+ }
37
+ exports.CosmoSpaceInternal = CosmoSpaceInternal;
@@ -0,0 +1,40 @@
1
+ import Base, { MaybeRaw } from "../../../Base";
2
+ import { Asset, AssetFilter } from "../../../interfaces/cosmo/asset";
3
+ import { Location } from "../../../interfaces/cosmo/location";
4
+ /**
5
+ * @class Location
6
+ * @extends Base
7
+ *
8
+ * @remarks
9
+ * **Under development, breaking changes possible**
10
+ *
11
+ * Represents a Location resource in Cosmo, providing methods to interact with the Location API.
12
+ */
13
+ export declare class CosmoLocation extends Base {
14
+ protected getEndpoint(endpoint: string): string;
15
+ /**
16
+ * Create a new Location in the specified Organization and Space.
17
+ * @remarks
18
+ * ** Under development, breaking changes possible**
19
+ * @param orgName Name of the Organization
20
+ * @param spaceName Name of the Space
21
+ * @param locationName Name of the Location to create
22
+ * @returns The created Location
23
+ */
24
+ createLocation<R extends boolean = false>(orgName: string, spaceName: string, locationName: string, raw?: {
25
+ raw: R;
26
+ }): Promise<MaybeRaw<R, Location>>;
27
+ /**
28
+ * Search assets of a Location.
29
+ * @remarks
30
+ * ** Under development, breaking changes possible**
31
+ * @param orgName Name of the Organization
32
+ * @param spaceName Name of the Space
33
+ * @param locationId ID of the Location to search
34
+ * @param assetFilter Filter for assets in the Space
35
+ * @returns The found Assets
36
+ */
37
+ searchAssetsOfLocation<R extends boolean = false>(orgName: string, spaceName: string, locationId: string, assetFilter: AssetFilter[], raw?: {
38
+ raw: R;
39
+ }): Promise<MaybeRaw<R, Asset[]>>;
40
+ }
@@ -0,0 +1,66 @@
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.CosmoLocation = void 0;
16
+ const Base_1 = __importDefault(require("../../../Base"));
17
+ /**
18
+ * @class Location
19
+ * @extends Base
20
+ *
21
+ * @remarks
22
+ * **Under development, breaking changes possible**
23
+ *
24
+ * Represents a Location resource in Cosmo, providing methods to interact with the Location API.
25
+ */
26
+ class CosmoLocation extends Base_1.default {
27
+ getEndpoint(endpoint) {
28
+ return `${this.options.server}/api/cosmo${endpoint}`;
29
+ }
30
+ /**
31
+ * Create a new Location in the specified Organization and Space.
32
+ * @remarks
33
+ * ** Under development, breaking changes possible**
34
+ * @param orgName Name of the Organization
35
+ * @param spaceName Name of the Space
36
+ * @param locationName Name of the Location to create
37
+ * @returns The created Location
38
+ */
39
+ createLocation(orgName, spaceName, locationName, raw) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/locations`), {
42
+ name: locationName,
43
+ });
44
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
45
+ });
46
+ }
47
+ /**
48
+ * Search assets of a Location.
49
+ * @remarks
50
+ * ** Under development, breaking changes possible**
51
+ * @param orgName Name of the Organization
52
+ * @param spaceName Name of the Space
53
+ * @param locationId ID of the Location to search
54
+ * @param assetFilter Filter for assets in the Space
55
+ * @returns The found Assets
56
+ */
57
+ searchAssetsOfLocation(orgName, spaceName, locationId, assetFilter, raw) {
58
+ return __awaiter(this, void 0, void 0, function* () {
59
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/locations/${locationId}/assets`), {
60
+ filters: assetFilter,
61
+ });
62
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
63
+ });
64
+ }
65
+ }
66
+ exports.CosmoLocation = CosmoLocation;
@@ -0,0 +1,56 @@
1
+ import Base, { MaybeRaw } from "../../../Base";
2
+ import { Asset, NamespaceMetadata, NamespaceRushStatus } from "../../../interfaces/cosmo/asset";
3
+ import { Namespace } from "../../../interfaces/cosmo/namespace";
4
+ /**
5
+ * @class Namespace
6
+ * @extends Base
7
+ *
8
+ * @remarks
9
+ * **Under development, breaking changes possible**
10
+ *
11
+ * Represents a Namespace resource in Cosmo, providing methods to interact with the Namespace API.
12
+ */
13
+ export declare class CosmoNamespace extends Base {
14
+ protected getEndpoint(endpoint: string): string;
15
+ /**
16
+ * Create a new Namespace in the specified Organization and Space.
17
+ * @remarks
18
+ * ** Under development, breaking changes possible**
19
+ * @param orgName Name of the Organization
20
+ * @param spaceName Name of the Space
21
+ * @param namespaceName Name of the Namespace to create
22
+ * @param defaultStatus Status that asset references within this namespace will have by default
23
+ * @returns The created Namespace
24
+ */
25
+ createNamespace<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, defaultStatus?: string, raw?: {
26
+ raw: R;
27
+ }): Promise<MaybeRaw<R, Namespace>>;
28
+ /**
29
+ * Change the status of a reference (e.g. Asset)
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 refId ID of the reference to change status
36
+ * @param status New status to set for the reference
37
+ * @returns The updated Reference
38
+ */
39
+ changeStatus<R extends boolean = false>(orgName: string, spaceName: string, refId: string, namespaceName: string, status: NamespaceRushStatus, raw?: {
40
+ raw: R;
41
+ }): Promise<MaybeRaw<R, Asset>>;
42
+ /**
43
+ * Update the metadata of a reference (e.g. Asset)
44
+ * @remarks
45
+ * ** Under development, breaking changes possible**
46
+ * @param orgName Name of the Organization
47
+ * @param spaceName Name of the Space
48
+ * @param namespaceName Name of the Namespace
49
+ * @param refId ID of the reference to change status
50
+ * @param metadata New metadata to set
51
+ * @returns The updated Reference
52
+ */
53
+ updateMetadata<R extends boolean = false>(orgName: string, spaceName: string, refId: string, namespaceName: string, metadata: NamespaceMetadata, raw?: {
54
+ raw: R;
55
+ }): Promise<MaybeRaw<R, Asset>>;
56
+ }
@@ -0,0 +1,85 @@
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.CosmoNamespace = void 0;
16
+ const Base_1 = __importDefault(require("../../../Base"));
17
+ /**
18
+ * @class Namespace
19
+ * @extends Base
20
+ *
21
+ * @remarks
22
+ * **Under development, breaking changes possible**
23
+ *
24
+ * Represents a Namespace resource in Cosmo, providing methods to interact with the Namespace API.
25
+ */
26
+ class CosmoNamespace extends Base_1.default {
27
+ getEndpoint(endpoint) {
28
+ return `${this.options.server}/api/cosmo${endpoint}`;
29
+ }
30
+ /**
31
+ * Create a new Namespace in the specified Organization and Space.
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 to create
37
+ * @param defaultStatus Status that asset references within this namespace will have by default
38
+ * @returns The created Namespace
39
+ */
40
+ createNamespace(orgName_1, spaceName_1, namespaceName_1) {
41
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, defaultStatus = "none", raw) {
42
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces`), {
43
+ name: namespaceName,
44
+ defaultStatus,
45
+ });
46
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
47
+ });
48
+ }
49
+ /**
50
+ * Change the status of a reference (e.g. Asset)
51
+ * @remarks
52
+ * ** Under development, breaking changes possible**
53
+ * @param orgName Name of the Organization
54
+ * @param spaceName Name of the Space
55
+ * @param namespaceName Name of the Namespace
56
+ * @param refId ID of the reference to change status
57
+ * @param status New status to set for the reference
58
+ * @returns The updated Reference
59
+ */
60
+ changeStatus(orgName, spaceName, refId, namespaceName, status, raw) {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/ref/${refId}/status`), { status });
63
+ // TypeScript can't infer conditional type at runtime, so we assert
64
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
65
+ });
66
+ }
67
+ /**
68
+ * Update the metadata of a reference (e.g. Asset)
69
+ * @remarks
70
+ * ** Under development, breaking changes possible**
71
+ * @param orgName Name of the Organization
72
+ * @param spaceName Name of the Space
73
+ * @param namespaceName Name of the Namespace
74
+ * @param refId ID of the reference to change status
75
+ * @param metadata New metadata to set
76
+ * @returns The updated Reference
77
+ */
78
+ updateMetadata(orgName, spaceName, refId, namespaceName, metadata, raw) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/ref/${refId}/metadata`), metadata);
81
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
82
+ });
83
+ }
84
+ }
85
+ exports.CosmoNamespace = CosmoNamespace;