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
@@ -1,4 +1,4 @@
1
- import Base from "../../../../Base";
1
+ import Base, { MaybeRaw } from "../../../../Base";
2
2
  import { Node, NodeCategory } from "../../../../interfaces/high5/space/event/stream/node";
3
3
  export default class High5Node extends Base {
4
4
  /**
@@ -9,7 +9,9 @@ export default class High5Node extends Base {
9
9
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
10
10
  * @returns Array containg the Nodes
11
11
  */
12
- getAllNodes(orgName: string, spaceName: string, limit?: number, page?: number): Promise<Node[]>;
12
+ getAllNodes<R extends boolean = false>(orgName: string, spaceName: string, limit?: number, page?: number, raw?: {
13
+ raw: R;
14
+ }): Promise<MaybeRaw<R, Node[]>>;
13
15
  /**
14
16
  * Retrieves a Node by its ID.
15
17
  * @param orgName Name of the organization
@@ -17,7 +19,9 @@ export default class High5Node extends Base {
17
19
  * @param nodeId Id of the Node
18
20
  * @returns The requested Node
19
21
  */
20
- getNode(orgName: string, spaceName: string, nodeId: string): Promise<Node>;
22
+ getNode<R extends boolean = false>(orgName: string, spaceName: string, nodeId: string, raw?: {
23
+ raw: R;
24
+ }): Promise<MaybeRaw<R, Node>>;
21
25
  /**
22
26
  * Adds a new Node to a stream.
23
27
  * @param orgName Name of the organization
@@ -27,14 +31,18 @@ export default class High5Node extends Base {
27
31
  * @param typescript Typescript code as a base64 string
28
32
  * @returns The created Node
29
33
  */
30
- createNode(orgName: string, spaceName: string, nodeCategory: NodeCategory, specification: string, typescript: string): Promise<Node>;
34
+ createNode<R extends boolean = false>(orgName: string, spaceName: string, nodeCategory: NodeCategory, specification: string, typescript: string, raw?: {
35
+ raw: R;
36
+ }): Promise<MaybeRaw<R, Node>>;
31
37
  /**
32
38
  * Deletes a Node by its ID
33
39
  * @param orgName Name of the organization
34
40
  * @param spaceName Name of the space
35
41
  * @param nodeId Id of the node
36
42
  */
37
- deleteNode(orgName: string, spaceName: string, nodeId: string): Promise<void>;
43
+ deleteNode<R extends boolean = false>(orgName: string, spaceName: string, nodeId: string, raw?: {
44
+ raw: R;
45
+ }): Promise<MaybeRaw<R, void>>;
38
46
  /**
39
47
  * Patches the Typescript code and specification of the Node.
40
48
  * @param orgName Name of the organization
@@ -45,14 +53,18 @@ export default class High5Node extends Base {
45
53
  * @param typescript (optional) Typescript code as a base64 string
46
54
  * @return The updated Node
47
55
  */
48
- patchNode(orgName: string, spaceName: string, nodeId: string, regenerateSecret: boolean, specification?: string, typescript?: string): Promise<Node>;
56
+ patchNode<R extends boolean = false>(orgName: string, spaceName: string, nodeId: string, regenerateSecret: boolean, specification?: string, typescript?: string, raw?: {
57
+ raw: R;
58
+ }): Promise<MaybeRaw<R, Node>>;
49
59
  /**
50
60
  * Retrieves the content (raw javascript code) of a Node.
51
61
  * @param orgName Name of the organization
52
62
  * @param spaceName Name of the space
53
63
  * @param secret Secret of the Node (a unique sha512 hash)
54
- * @rerurns Raw javascript representation of the Node's content
64
+ * @returns Raw javascript representation of the Node's content
55
65
  */
56
- getNodeContent(orgName: string, spaceName: string, secret: string): Promise<string>;
66
+ getNodeContent<R extends boolean = false>(orgName: string, spaceName: string, secret: string, raw?: {
67
+ raw: R;
68
+ }): Promise<MaybeRaw<R, string>>;
57
69
  protected getEndpoint(endpoint: string): string;
58
70
  }
@@ -8,8 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const Base_1 = require("../../../../Base");
15
+ const Base_1 = __importDefault(require("../../../../Base"));
13
16
  class High5Node extends Base_1.default {
14
17
  /**
15
18
  * Retrieves all Nodes for the specified stream.
@@ -19,12 +22,12 @@ class High5Node extends Base_1.default {
19
22
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
20
23
  * @returns Array containg the Nodes
21
24
  */
22
- getAllNodes(orgName, spaceName, limit, page) {
25
+ getAllNodes(orgName, spaceName, limit, page, raw) {
23
26
  return __awaiter(this, void 0, void 0, function* () {
24
27
  limit = limit || 25;
25
28
  page = page || 0;
26
29
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/nodes?page=${page}&limit=${limit}`));
27
- return resp.data;
30
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
28
31
  });
29
32
  }
30
33
  /**
@@ -34,10 +37,10 @@ class High5Node extends Base_1.default {
34
37
  * @param nodeId Id of the Node
35
38
  * @returns The requested Node
36
39
  */
37
- getNode(orgName, spaceName, nodeId) {
40
+ getNode(orgName, spaceName, nodeId, raw) {
38
41
  return __awaiter(this, void 0, void 0, function* () {
39
42
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/nodes/${nodeId}`));
40
- return resp.data;
43
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
41
44
  });
42
45
  }
43
46
  /**
@@ -49,14 +52,14 @@ class High5Node extends Base_1.default {
49
52
  * @param typescript Typescript code as a base64 string
50
53
  * @returns The created Node
51
54
  */
52
- createNode(orgName, spaceName, nodeCategory, specification, typescript) {
55
+ createNode(orgName, spaceName, nodeCategory, specification, typescript, raw) {
53
56
  return __awaiter(this, void 0, void 0, function* () {
54
57
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/nodes`), {
55
58
  category: nodeCategory,
56
59
  specification: specification,
57
60
  typescript: typescript,
58
61
  });
59
- return resp.data;
62
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
60
63
  });
61
64
  }
62
65
  /**
@@ -65,9 +68,10 @@ class High5Node extends Base_1.default {
65
68
  * @param spaceName Name of the space
66
69
  * @param nodeId Id of the node
67
70
  */
68
- deleteNode(orgName, spaceName, nodeId) {
71
+ deleteNode(orgName, spaceName, nodeId, raw) {
69
72
  return __awaiter(this, void 0, void 0, function* () {
70
- yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/nodes/${nodeId}`));
73
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/nodes/${nodeId}`));
74
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
71
75
  });
72
76
  }
73
77
  /**
@@ -80,7 +84,7 @@ class High5Node extends Base_1.default {
80
84
  * @param typescript (optional) Typescript code as a base64 string
81
85
  * @return The updated Node
82
86
  */
83
- patchNode(orgName, spaceName, nodeId, regenerateSecret, specification, typescript) {
87
+ patchNode(orgName, spaceName, nodeId, regenerateSecret, specification, typescript, raw) {
84
88
  return __awaiter(this, void 0, void 0, function* () {
85
89
  const patchNode = {
86
90
  specification: specification,
@@ -93,7 +97,7 @@ class High5Node extends Base_1.default {
93
97
  delete patchNode.typescript;
94
98
  }
95
99
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/nodes/${nodeId}?regenerateSecret=${regenerateSecret}`), patchNode);
96
- return resp.data;
100
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
97
101
  });
98
102
  }
99
103
  /**
@@ -101,12 +105,12 @@ class High5Node extends Base_1.default {
101
105
  * @param orgName Name of the organization
102
106
  * @param spaceName Name of the space
103
107
  * @param secret Secret of the Node (a unique sha512 hash)
104
- * @rerurns Raw javascript representation of the Node's content
108
+ * @returns Raw javascript representation of the Node's content
105
109
  */
106
- getNodeContent(orgName, spaceName, secret) {
110
+ getNodeContent(orgName, spaceName, secret, raw) {
107
111
  return __awaiter(this, void 0, void 0, function* () {
108
112
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/nodes/content/${secret}`));
109
- return resp.data;
113
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
110
114
  });
111
115
  }
112
116
  getEndpoint(endpoint) {
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../../Base";
2
+ import Base, { MaybeRaw, Options } from "../../../../Base";
3
3
  import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
4
4
  import { Pool, PoolChange, PoolQueryOptions, PoolTargetPatch } from "../../../../interfaces/high5/space/pool";
5
5
  import { OrganizationMember } from "../../../../interfaces/idp";
@@ -13,7 +13,9 @@ export default class High5Pool extends Base {
13
13
  * @param name - Name of the pool
14
14
  * @returns Pool
15
15
  */
16
- getPool(orgName: string, spaceName: string, name: string): Promise<Pool>;
16
+ getPool<R extends boolean = false>(orgName: string, spaceName: string, name: string, raw?: {
17
+ raw: R;
18
+ }): Promise<MaybeRaw<R, Pool>>;
17
19
  /**
18
20
  * Replace a pool of a space
19
21
  *
@@ -24,7 +26,9 @@ export default class High5Pool extends Base {
24
26
  * @param targets - Execution targets that compromise the pool
25
27
  * @returns The new Pool
26
28
  */
27
- replacePool(orgName: string, spaceName: string, poolName: string, name: string, targets: string[]): Promise<PoolChange>;
29
+ replacePool<R extends boolean = false>(orgName: string, spaceName: string, poolName: string, name: string, targets: string[], raw?: {
30
+ raw: R;
31
+ }): Promise<MaybeRaw<R, PoolChange>>;
28
32
  /**
29
33
  * Patch a pool of a space
30
34
  *
@@ -35,7 +39,9 @@ export default class High5Pool extends Base {
35
39
  * @param targets - Execution targets that compromise the pool
36
40
  * @returns The patched Pool
37
41
  */
38
- patchPool(orgName: string, spaceName: string, poolName: string, name?: string, targets?: PoolTargetPatch): Promise<PoolChange>;
42
+ patchPool<R extends boolean = false>(orgName: string, spaceName: string, poolName: string, name?: string, targets?: PoolTargetPatch, raw?: {
43
+ raw: R;
44
+ }): Promise<MaybeRaw<R, PoolChange>>;
39
45
  /**
40
46
  * Delete a pool of a space
41
47
  *
@@ -43,7 +49,9 @@ export default class High5Pool extends Base {
43
49
  * @param spaceName - Name of the space
44
50
  * @param poolName - Name of the pool
45
51
  */
46
- deletePool(orgName: string, spaceName: string, poolName: string): Promise<void>;
52
+ deletePool<R extends boolean = false>(orgName: string, spaceName: string, poolName: string, raw?: {
53
+ raw: R;
54
+ }): Promise<MaybeRaw<R, Pool>>;
47
55
  /**
48
56
  * Retrieves all pools of a High5 Space which match the provided search filter(s). Will return all pools of the Space if no filter is provided.
49
57
  *
@@ -55,11 +63,13 @@ export default class High5Pool extends Base {
55
63
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
56
64
  * @returns Object containing an array of Pool and the total number of results found in the database (independent of limit and page)
57
65
  */
58
- searchPools({ orgName, spaceName, filters, sorting, options, limit, page, }: SearchParams & {
66
+ searchPools<R extends boolean = false>({ orgName, spaceName, filters, sorting, options, limit, page, }: SearchParams & {
59
67
  orgName: string;
60
68
  spaceName: string;
61
69
  options?: PoolQueryOptions;
62
- }): Promise<PaginatedResponse<Pool>>;
70
+ }, raw?: {
71
+ raw: R;
72
+ }): Promise<MaybeRaw<R, PaginatedResponse<Pool>>>;
63
73
  /**
64
74
  * Add a pool to a space
65
75
  *
@@ -69,13 +79,17 @@ export default class High5Pool extends Base {
69
79
  * @param targets - Execution targets that compromise the pool
70
80
  * @returns The created Pool
71
81
  */
72
- addPool(orgName: string, spaceName: string, name: string, targets: string[]): Promise<PoolChange>;
82
+ addPool<R extends boolean = false>(orgName: string, spaceName: string, name: string, targets: string[], raw?: {
83
+ raw: R;
84
+ }): Promise<MaybeRaw<R, PoolChange>>;
73
85
  /**
74
86
  * Retrieves all the pools the current user is assigned to as an execution target
75
87
  *
76
88
  * @returns Array of pools the user is assigned to as execution target
77
89
  */
78
- getPools(): Promise<Pool[]>;
90
+ getPools<R extends boolean = false>(raw?: {
91
+ raw: R;
92
+ }): Promise<MaybeRaw<R, Pool[]>>;
79
93
  /**
80
94
  * Retrieves all targets of a pool which match the provided search filter(s). Will return all targets of the pool if no filter is provided.
81
95
  *
@@ -88,10 +102,23 @@ export default class High5Pool extends Base {
88
102
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
89
103
  * @returns Object containing an array of OrganizationMember and the total number of results found in the database (independent of limit and page)
90
104
  */
91
- searchTargetsOfPool({ orgName, spaceName, poolName, filters, sorting, limit, page, }: SearchParams & {
105
+ searchTargetsOfPool<R extends boolean = false>({ orgName, spaceName, poolName, filters, sorting, limit, page, }: SearchParams & {
92
106
  orgName: string;
93
107
  spaceName: string;
94
108
  poolName: string;
95
- }): Promise<PaginatedResponse<OrganizationMember>>;
109
+ }, raw?: {
110
+ raw: R;
111
+ }): Promise<MaybeRaw<R, PaginatedResponse<OrganizationMember>>>;
112
+ /**
113
+ * Updates the avatar of the specified pool
114
+ * @param orgName Name of the organization
115
+ * @param spaceName Name of the space
116
+ * @param name Name of the pool
117
+ * @param file Image as Javascript File
118
+ * @returns Pool details with updated avatar
119
+ */
120
+ updateAvatar<R extends boolean = false>(orgName: string, spaceName: string, name: string, file: File, raw?: {
121
+ raw: R;
122
+ }): Promise<MaybeRaw<R, Pool>>;
96
123
  protected getEndpoint(endpoint: string): string;
97
124
  }
@@ -8,8 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const Base_1 = require("../../../../Base");
15
+ const Base_1 = __importDefault(require("../../../../Base"));
13
16
  const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
14
17
  const searchFilter_1 = require("../../../../helper/searchFilter");
15
18
  class High5Pool extends Base_1.default {
@@ -24,10 +27,10 @@ class High5Pool extends Base_1.default {
24
27
  * @param name - Name of the pool
25
28
  * @returns Pool
26
29
  */
27
- getPool(orgName, spaceName, name) {
30
+ getPool(orgName, spaceName, name, raw) {
28
31
  return __awaiter(this, void 0, void 0, function* () {
29
32
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/pools/${name}`));
30
- return resp.data;
33
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
31
34
  });
32
35
  }
33
36
  /**
@@ -40,13 +43,13 @@ class High5Pool extends Base_1.default {
40
43
  * @param targets - Execution targets that compromise the pool
41
44
  * @returns The new Pool
42
45
  */
43
- replacePool(orgName, spaceName, poolName, name, targets) {
46
+ replacePool(orgName, spaceName, poolName, name, targets, raw) {
44
47
  return __awaiter(this, void 0, void 0, function* () {
45
48
  const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/pools/${poolName}`), {
46
49
  name,
47
50
  targets,
48
51
  });
49
- return resp.data;
52
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
50
53
  });
51
54
  }
52
55
  /**
@@ -59,7 +62,7 @@ class High5Pool extends Base_1.default {
59
62
  * @param targets - Execution targets that compromise the pool
60
63
  * @returns The patched Pool
61
64
  */
62
- patchPool(orgName, spaceName, poolName, name, targets) {
65
+ patchPool(orgName, spaceName, poolName, name, targets, raw) {
63
66
  return __awaiter(this, void 0, void 0, function* () {
64
67
  if (name === undefined && targets === undefined) {
65
68
  throw new Error("unable to patch pool when there are no arguments to send");
@@ -68,7 +71,7 @@ class High5Pool extends Base_1.default {
68
71
  name,
69
72
  targets,
70
73
  });
71
- return resp.data;
74
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
72
75
  });
73
76
  }
74
77
  /**
@@ -78,9 +81,10 @@ class High5Pool extends Base_1.default {
78
81
  * @param spaceName - Name of the space
79
82
  * @param poolName - Name of the pool
80
83
  */
81
- deletePool(orgName, spaceName, poolName) {
84
+ deletePool(orgName, spaceName, poolName, raw) {
82
85
  return __awaiter(this, void 0, void 0, function* () {
83
- yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/pools/${poolName}`));
86
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/pools/${poolName}`));
87
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
84
88
  });
85
89
  }
86
90
  /**
@@ -94,8 +98,8 @@ class High5Pool extends Base_1.default {
94
98
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
95
99
  * @returns Object containing an array of Pool and the total number of results found in the database (independent of limit and page)
96
100
  */
97
- searchPools(_a) {
98
- return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, options, limit = 25, page = 0, }) {
101
+ searchPools(_a, raw_1) {
102
+ return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, options, limit = 25, page = 0, }, raw) {
99
103
  const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
100
104
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/pools/search`), {
101
105
  filters: filtersDTO,
@@ -108,7 +112,7 @@ class High5Pool extends Base_1.default {
108
112
  targetsSample: options === null || options === void 0 ? void 0 : options.getTargetsSample,
109
113
  },
110
114
  });
111
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
115
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
112
116
  });
113
117
  }
114
118
  /**
@@ -120,10 +124,10 @@ class High5Pool extends Base_1.default {
120
124
  * @param targets - Execution targets that compromise the pool
121
125
  * @returns The created Pool
122
126
  */
123
- addPool(orgName, spaceName, name, targets) {
127
+ addPool(orgName, spaceName, name, targets, raw) {
124
128
  return __awaiter(this, void 0, void 0, function* () {
125
129
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/pools`), { name, targets });
126
- return resp.data;
130
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
127
131
  });
128
132
  }
129
133
  /**
@@ -131,10 +135,10 @@ class High5Pool extends Base_1.default {
131
135
  *
132
136
  * @returns Array of pools the user is assigned to as execution target
133
137
  */
134
- getPools() {
138
+ getPools(raw) {
135
139
  return __awaiter(this, void 0, void 0, function* () {
136
140
  const resp = yield this.axios.get(this.getEndpoint("/v1/pools"));
137
- return resp.data;
141
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
138
142
  });
139
143
  }
140
144
  /**
@@ -149,8 +153,8 @@ class High5Pool extends Base_1.default {
149
153
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
150
154
  * @returns Object containing an array of OrganizationMember and the total number of results found in the database (independent of limit and page)
151
155
  */
152
- searchTargetsOfPool(_a) {
153
- return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, poolName, filters, sorting, limit = 25, page = 0, }) {
156
+ searchTargetsOfPool(_a, raw_1) {
157
+ return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, poolName, filters, sorting, limit = 25, page = 0, }, raw) {
154
158
  const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
155
159
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/pools/${poolName}/targets/search`), {
156
160
  filters: filtersDTO,
@@ -161,7 +165,25 @@ class High5Pool extends Base_1.default {
161
165
  limit,
162
166
  },
163
167
  });
164
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
168
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
169
+ });
170
+ }
171
+ /**
172
+ * Updates the avatar of the specified pool
173
+ * @param orgName Name of the organization
174
+ * @param spaceName Name of the space
175
+ * @param name Name of the pool
176
+ * @param file Image as Javascript File
177
+ * @returns Pool details with updated avatar
178
+ */
179
+ updateAvatar(orgName, spaceName, name, file, raw) {
180
+ return __awaiter(this, void 0, void 0, function* () {
181
+ const data = new FormData();
182
+ data.append("avatar", file);
183
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/pools/${name}/avatar`), data, {
184
+ headers: { "Content-Type": "multipart/form-data" },
185
+ });
186
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
165
187
  });
166
188
  }
167
189
  getEndpoint(endpoint) {
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../../Base";
2
+ import Base, { MaybeRaw, Options } from "../../../../Base";
3
3
  import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
4
4
  import { CreateSecret, Secret, UpdateSecret } from "../../../../interfaces/high5/space/secret";
5
5
  export default class High5Secret extends Base {
@@ -17,10 +17,12 @@ export default class High5Secret extends Base {
17
17
  * @param encrypted - (optional) Whether to get all secret values only in encrypted form.
18
18
  * @returns Object containing an array of secret keys as well as the total number of results found in the database (independent of limit and page)
19
19
  */
20
- searchSecrets({ orgName, spaceName, filters, sorting, limit, page, }: SearchParams & {
20
+ searchSecrets<R extends boolean = false>({ orgName, spaceName, filters, sorting, limit, page }: SearchParams & {
21
21
  orgName: string;
22
22
  spaceName: string;
23
- }): Promise<PaginatedResponse<Secret>>;
23
+ }, raw?: {
24
+ raw: R;
25
+ }): Promise<MaybeRaw<R, PaginatedResponse<Secret>>>;
24
26
  /**
25
27
  * Adds a secret key-value pair to a space.
26
28
  * @param orgName - Name of the organization
@@ -30,7 +32,9 @@ export default class High5Secret extends Base {
30
32
  * @param encrypted - (optional) Boolean defining if the value should be stored encrypted (defaults to false).
31
33
  * @returns The created Secret
32
34
  */
33
- addSecret(orgName: string, spaceName: string, secret: CreateSecret): Promise<Secret>;
35
+ addSecret<R extends boolean = false>(orgName: string, spaceName: string, secret: CreateSecret, raw?: {
36
+ raw: R;
37
+ }): Promise<MaybeRaw<R, Secret>>;
34
38
  /**
35
39
  * Updates the value for an existent secret key-value pair.
36
40
  * @param orgName - Name of the organization
@@ -40,14 +44,18 @@ export default class High5Secret extends Base {
40
44
  * @param encrypted - (optional) Boolean defining if the value should be stored encrypted (defaults to false).
41
45
  * @returns The updated Secret
42
46
  */
43
- updateSecret(orgName: string, spaceName: string, key: string, secret: UpdateSecret): Promise<Secret>;
47
+ updateSecret<R extends boolean = false>(orgName: string, spaceName: string, key: string, secret: UpdateSecret, raw?: {
48
+ raw: R;
49
+ }): Promise<MaybeRaw<R, Secret>>;
44
50
  /**
45
51
  * Deletes a key-value pair of the space
46
52
  * @param orgName - Name of the organization
47
53
  * @param spaceName - Name of the space
48
54
  * @param key - Key of the key-value pair
49
55
  */
50
- deleteSecret(orgName: string, spaceName: string, key: string): Promise<void>;
56
+ deleteSecret<R extends boolean = false>(orgName: string, spaceName: string, key: string, raw?: {
57
+ raw: R;
58
+ }): Promise<MaybeRaw<R, void>>;
51
59
  /**
52
60
  * Get secret value by its key
53
61
  * @param orgName - Name of the organization
@@ -55,6 +63,8 @@ export default class High5Secret extends Base {
55
63
  * @param key - Key of the key-value pair
56
64
  * @returns Secret details
57
65
  */
58
- getSecret(orgName: string, spaceName: string, key: string): Promise<Secret>;
66
+ getSecret<R extends boolean = false>(orgName: string, spaceName: string, key: string, raw?: {
67
+ raw: R;
68
+ }): Promise<MaybeRaw<R, Secret>>;
59
69
  protected getEndpoint(endpoint: string): string;
60
70
  }
@@ -8,8 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
11
14
  Object.defineProperty(exports, "__esModule", { value: true });
12
- const Base_1 = require("../../../../Base");
15
+ const Base_1 = __importDefault(require("../../../../Base"));
13
16
  const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
14
17
  const searchFilter_1 = require("../../../../helper/searchFilter");
15
18
  class High5Secret extends Base_1.default {
@@ -29,8 +32,8 @@ class High5Secret extends Base_1.default {
29
32
  * @param encrypted - (optional) Whether to get all secret values only in encrypted form.
30
33
  * @returns Object containing an array of secret keys as well as the total number of results found in the database (independent of limit and page)
31
34
  */
32
- searchSecrets(_a) {
33
- return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, }) {
35
+ searchSecrets(_a, raw_1) {
36
+ return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0 }, raw) {
34
37
  const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
35
38
  return new searchFilter_1.SearchFilterDTO(f);
36
39
  });
@@ -38,7 +41,7 @@ class High5Secret extends Base_1.default {
38
41
  filters: filtersDTO,
39
42
  sorting,
40
43
  });
41
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
44
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
42
45
  });
43
46
  }
44
47
  /**
@@ -50,10 +53,10 @@ class High5Secret extends Base_1.default {
50
53
  * @param encrypted - (optional) Boolean defining if the value should be stored encrypted (defaults to false).
51
54
  * @returns The created Secret
52
55
  */
53
- addSecret(orgName, spaceName, secret) {
56
+ addSecret(orgName, spaceName, secret, raw) {
54
57
  return __awaiter(this, void 0, void 0, function* () {
55
58
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/secrets`), secret);
56
- return resp.data;
59
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
57
60
  });
58
61
  }
59
62
  /**
@@ -65,10 +68,10 @@ class High5Secret extends Base_1.default {
65
68
  * @param encrypted - (optional) Boolean defining if the value should be stored encrypted (defaults to false).
66
69
  * @returns The updated Secret
67
70
  */
68
- updateSecret(orgName, spaceName, key, secret) {
71
+ updateSecret(orgName, spaceName, key, secret, raw) {
69
72
  return __awaiter(this, void 0, void 0, function* () {
70
73
  const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/secrets/${key}`), secret);
71
- return resp.data;
74
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
72
75
  });
73
76
  }
74
77
  /**
@@ -77,9 +80,10 @@ class High5Secret extends Base_1.default {
77
80
  * @param spaceName - Name of the space
78
81
  * @param key - Key of the key-value pair
79
82
  */
80
- deleteSecret(orgName, spaceName, key) {
83
+ deleteSecret(orgName, spaceName, key, raw) {
81
84
  return __awaiter(this, void 0, void 0, function* () {
82
- yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/secrets/${key}`));
85
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/secrets/${key}`));
86
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
83
87
  });
84
88
  }
85
89
  /**
@@ -89,10 +93,10 @@ class High5Secret extends Base_1.default {
89
93
  * @param key - Key of the key-value pair
90
94
  * @returns Secret details
91
95
  */
92
- getSecret(orgName, spaceName, key) {
96
+ getSecret(orgName, spaceName, key, raw) {
93
97
  return __awaiter(this, void 0, void 0, function* () {
94
98
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/secrets/${key}`));
95
- return resp.data;
99
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
96
100
  });
97
101
  }
98
102
  getEndpoint(endpoint) {
@@ -0,0 +1,12 @@
1
+ import Base from "../../../../Base";
2
+ import { Stats } from "../../../../interfaces/high5/stats";
3
+ export declare class High5SpaceStat extends Base {
4
+ /**
5
+ * Retrieves usage statistics for a specific space.
6
+ * @param orgName Name of the organization
7
+ * @param spaceName Name of the space
8
+ * @returns Statistics information
9
+ */
10
+ getStats(orgName: string, spaceName: string): Promise<Stats>;
11
+ protected getEndpoint(endpoint: string): string;
12
+ }
@@ -0,0 +1,34 @@
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.High5SpaceStat = void 0;
16
+ const Base_1 = __importDefault(require("../../../../Base"));
17
+ class High5SpaceStat extends Base_1.default {
18
+ /**
19
+ * Retrieves usage statistics for a specific space.
20
+ * @param orgName Name of the organization
21
+ * @param spaceName Name of the space
22
+ * @returns Statistics information
23
+ */
24
+ getStats(orgName, spaceName) {
25
+ return __awaiter(this, void 0, void 0, function* () {
26
+ const resp = yield this.axios.get(this.getEndpoint(`/org/${orgName}/spaces/${spaceName}/stats`));
27
+ return resp.data;
28
+ });
29
+ }
30
+ getEndpoint(endpoint) {
31
+ return `${this.options.server}/api/high5/v1${endpoint}`;
32
+ }
33
+ }
34
+ exports.High5SpaceStat = High5SpaceStat;