hcloud-sdk 18.0.0 → 19.1.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 (230) hide show
  1. package/changelog.md +17 -184
  2. package/lib/Hcloud.d.ts +18 -3
  3. package/lib/Hcloud.js +113 -21
  4. package/lib/helper/ErrorHelper.js +5 -2
  5. package/lib/helper/ValidationHelper.d.ts +6 -4
  6. package/lib/helper/ValidationHelper.js +30 -18
  7. package/lib/interfaces/agent/index.d.ts +1 -0
  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/{fuse → agent/logging}/index.js +2 -3
  11. package/lib/interfaces/agent/logging/log-collector.d.ts +35 -0
  12. package/lib/interfaces/agent/logging/log-collector.js +2 -0
  13. package/lib/interfaces/agent/module/index.d.ts +7 -0
  14. package/lib/interfaces/agent/module/index.js +2 -0
  15. package/lib/interfaces/auditor/index.d.ts +0 -1
  16. package/lib/interfaces/auditor/index.js +0 -1
  17. package/lib/interfaces/axios/index.d.ts +5 -0
  18. package/lib/interfaces/cosmo/asset/index.d.ts +45 -9
  19. package/lib/interfaces/cosmo/asset/index.js +9 -1
  20. package/lib/interfaces/cosmo/comment/index.d.ts +18 -1
  21. package/lib/interfaces/cosmo/comment/index.js +13 -1
  22. package/lib/interfaces/cosmo/event/index.d.ts +34 -5
  23. package/lib/interfaces/cosmo/event/index.js +16 -2
  24. package/lib/interfaces/cosmo/share/index.d.ts +100 -8
  25. package/lib/interfaces/cosmo/share/index.js +21 -0
  26. package/lib/interfaces/cosmo/space/index.d.ts +6 -0
  27. package/lib/interfaces/cosmo/stats/index.d.ts +11 -0
  28. package/lib/interfaces/cosmo/stats/index.js +2 -0
  29. package/lib/interfaces/cosmo/tag/tag.d.ts +3 -1
  30. package/lib/interfaces/global/Products.d.ts +0 -1
  31. package/lib/interfaces/global/Products.js +0 -1
  32. package/lib/interfaces/global/Views.d.ts +0 -1
  33. package/lib/interfaces/global/Views.js +0 -1
  34. package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +1 -0
  35. package/lib/interfaces/high5/space/event/stream/node/index.d.ts +1 -0
  36. package/lib/interfaces/high5/space/execution/index.d.ts +5 -1
  37. package/lib/interfaces/high5/space/job/JobLog.d.ts +10 -6
  38. package/lib/interfaces/high5/space/job/index.d.ts +65 -20
  39. package/lib/interfaces/high5/space/job/index.js +9 -6
  40. package/lib/interfaces/high5/wave/dependentInputs.d.ts +42 -0
  41. package/lib/interfaces/high5/wave/dependentInputs.js +144 -0
  42. package/lib/interfaces/high5/wave/dependentInputsValidation.d.ts +22 -0
  43. package/lib/interfaces/high5/wave/dependentInputsValidation.js +220 -0
  44. package/lib/interfaces/high5/wave/index.d.ts +9 -0
  45. package/lib/interfaces/high5/wave/index.js +4 -0
  46. package/lib/interfaces/idp/index.d.ts +3 -3
  47. package/lib/interfaces/idp/index.js +3 -3
  48. package/lib/interfaces/idp/oauth/device.d.ts +18 -0
  49. package/lib/interfaces/idp/oauth/device.js +2 -0
  50. package/lib/interfaces/idp/oauth/index.d.ts +17 -4
  51. package/lib/interfaces/idp/organization/index.d.ts +1 -0
  52. package/lib/interfaces/idp/organization/index.js +1 -0
  53. package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +4 -0
  54. package/lib/interfaces/idp/user/Message.d.ts +1 -0
  55. package/lib/interfaces/idp/user/Scopes.d.ts +1 -9
  56. package/lib/interfaces/idp/user/Scopes.js +0 -12
  57. package/lib/interfaces/idp/user/index.d.ts +3 -0
  58. package/lib/interfaces/mailer/index.d.ts +20 -1
  59. package/lib/interfaces/mailer/index.js +14 -2
  60. package/lib/interfaces/nats/index.d.ts +30 -32
  61. package/lib/interfaces/nats/index.js +103 -117
  62. package/lib/interfaces/shorts/index.d.ts +7 -0
  63. package/lib/interfaces/shorts/index.js +6 -0
  64. package/lib/service/agent/bundle/dev/index.js +4 -1
  65. package/lib/service/agent/bundle/index.js +4 -1
  66. package/lib/service/agent/context/index.js +4 -1
  67. package/lib/service/agent/index.d.ts +6 -0
  68. package/lib/service/agent/index.js +18 -1
  69. package/lib/service/agent/installer/index.js +4 -1
  70. package/lib/service/agent/logging/index.d.ts +69 -0
  71. package/lib/service/agent/logging/index.js +117 -0
  72. package/lib/service/agent/module/index.d.ts +36 -0
  73. package/lib/service/agent/module/index.js +65 -0
  74. package/lib/service/auditor/index.js +4 -1
  75. package/lib/service/auditor/internal/index.js +4 -1
  76. package/lib/service/bouncer/features/index.js +4 -1
  77. package/lib/service/bouncer/index.js +5 -2
  78. package/lib/service/cosmo/asset/index.d.ts +49 -3
  79. package/lib/service/cosmo/asset/index.js +111 -5
  80. package/lib/service/cosmo/comment/index.d.ts +10 -37
  81. package/lib/service/cosmo/comment/index.js +20 -43
  82. package/lib/service/cosmo/event/index.js +4 -1
  83. package/lib/service/cosmo/folder/index.js +4 -1
  84. package/lib/service/cosmo/index.d.ts +3 -0
  85. package/lib/service/cosmo/index.js +11 -1
  86. package/lib/service/cosmo/internal/index.js +4 -1
  87. package/lib/service/cosmo/internal/space/index.js +4 -1
  88. package/lib/service/cosmo/location/index.js +4 -1
  89. package/lib/service/cosmo/namespace/index.d.ts +15 -1
  90. package/lib/service/cosmo/namespace/index.js +21 -1
  91. package/lib/service/cosmo/organization/index.js +4 -1
  92. package/lib/service/cosmo/permissions/index.js +4 -1
  93. package/lib/service/cosmo/production/index.js +4 -1
  94. package/lib/service/cosmo/share/index.d.ts +55 -29
  95. package/lib/service/cosmo/share/index.js +71 -35
  96. package/lib/service/cosmo/space/index.d.ts +28 -1
  97. package/lib/service/cosmo/space/index.js +45 -1
  98. package/lib/service/cosmo/stats/index.d.ts +35 -0
  99. package/lib/service/cosmo/stats/index.js +58 -0
  100. package/lib/service/cosmo/tag/index.d.ts +13 -0
  101. package/lib/service/cosmo/tag/index.js +22 -1
  102. package/lib/service/dali/DaliAvatar.d.ts +0 -6
  103. package/lib/service/dali/DaliAvatar.js +4 -11
  104. package/lib/service/dali/avatar/DaliCosmoSpace.js +4 -1
  105. package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +2 -1
  106. package/lib/service/dali/avatar/DaliHigh5Pool.js +5 -2
  107. package/lib/service/dali/avatar/DaliHigh5Space.d.ts +2 -1
  108. package/lib/service/dali/avatar/DaliHigh5Space.js +5 -2
  109. package/lib/service/dali/avatar/DaliOAuthApp.d.ts +2 -1
  110. package/lib/service/dali/avatar/DaliOAuthApp.js +5 -2
  111. package/lib/service/dali/avatar/DaliOrganization.d.ts +2 -1
  112. package/lib/service/dali/avatar/DaliOrganization.js +5 -2
  113. package/lib/service/dali/avatar/DaliServiceAccount.d.ts +1 -1
  114. package/lib/service/dali/avatar/DaliServiceAccount.js +6 -3
  115. package/lib/service/dali/avatar/DaliTeam.d.ts +2 -1
  116. package/lib/service/dali/avatar/DaliTeam.js +5 -2
  117. package/lib/service/dali/avatar/DaliUser.d.ts +2 -1
  118. package/lib/service/dali/avatar/DaliUser.js +5 -2
  119. package/lib/service/dali/index.js +4 -1
  120. package/lib/service/high5/execution/index.js +4 -1
  121. package/lib/service/high5/execution/log/index.js +4 -1
  122. package/lib/service/high5/execution/status/index.js +4 -1
  123. package/lib/service/high5/index.js +4 -1
  124. package/lib/service/high5/internal/index.js +4 -1
  125. package/lib/service/high5/internal/space/index.js +4 -1
  126. package/lib/service/high5/internal/space/job/index.js +4 -1
  127. package/lib/service/high5/internal/space/job/log/index.js +4 -1
  128. package/lib/service/high5/joinToken/index.js +4 -1
  129. package/lib/service/high5/space/database/document/array/index.js +4 -1
  130. package/lib/service/high5/space/database/document/index.js +4 -1
  131. package/lib/service/high5/space/database/document/number/index.js +4 -1
  132. package/lib/service/high5/space/database/index.js +4 -1
  133. package/lib/service/high5/space/event/index.js +4 -1
  134. package/lib/service/high5/space/event/stream/design/DesignOperations.js +4 -1
  135. package/lib/service/high5/space/event/stream/design/index.js +6 -3
  136. package/lib/service/high5/space/event/stream/design/snapshot/index.js +4 -1
  137. package/lib/service/high5/space/event/stream/index.js +4 -1
  138. package/lib/service/high5/space/execution/index.d.ts +2 -1
  139. package/lib/service/high5/space/execution/index.js +7 -3
  140. package/lib/service/high5/space/execution/log/index.js +4 -1
  141. package/lib/service/high5/space/execution/status/index.js +4 -1
  142. package/lib/service/high5/space/index.d.ts +10 -0
  143. package/lib/service/high5/space/index.js +25 -5
  144. package/lib/service/high5/space/job/index.js +4 -1
  145. package/lib/service/high5/space/job/log/index.js +4 -1
  146. package/lib/service/high5/space/node/index.js +4 -1
  147. package/lib/service/high5/space/pool/index.d.ts +11 -0
  148. package/lib/service/high5/space/pool/index.js +22 -1
  149. package/lib/service/high5/space/secret/index.js +4 -1
  150. package/lib/service/high5/space/stat/index.js +4 -1
  151. package/lib/service/high5/space/wave/index.js +4 -1
  152. package/lib/service/high5/space/webhook/index.js +4 -1
  153. package/lib/service/high5/space/webhook/log/index.js +4 -1
  154. package/lib/service/high5/stat/index.js +4 -1
  155. package/lib/service/high5/wave/index.js +4 -1
  156. package/lib/service/high5/wave/s3/index.js +5 -2
  157. package/lib/service/idp/guest/index.js +4 -1
  158. package/lib/service/idp/index.js +4 -1
  159. package/lib/service/idp/internal/index.js +4 -1
  160. package/lib/service/idp/oauth/device.d.ts +131 -0
  161. package/lib/service/idp/oauth/device.js +177 -0
  162. package/lib/service/idp/oauth/index.d.ts +3 -0
  163. package/lib/service/idp/oauth/index.js +11 -1
  164. package/lib/service/idp/organization/index.d.ts +9 -0
  165. package/lib/service/idp/organization/index.js +22 -3
  166. package/lib/service/idp/organization/license/index.js +4 -1
  167. package/lib/service/idp/organization/member/index.js +5 -2
  168. package/lib/service/idp/organization/member/invitations/index.d.ts +19 -0
  169. package/lib/service/idp/organization/member/invitations/index.js +23 -1
  170. package/lib/service/idp/organization/service-accounts/index.d.ts +11 -1
  171. package/lib/service/idp/organization/service-accounts/index.js +22 -2
  172. package/lib/service/idp/organization/settings/domain/index.js +4 -1
  173. package/lib/service/idp/organization/settings/domain/saml/index.js +4 -1
  174. package/lib/service/idp/organization/settings/index.js +4 -1
  175. package/lib/service/idp/organization/settings/oauth/index.d.ts +10 -0
  176. package/lib/service/idp/organization/settings/oauth/index.js +21 -1
  177. package/lib/service/idp/organization/stat/index.js +4 -1
  178. package/lib/service/idp/organization/team/index.d.ts +10 -0
  179. package/lib/service/idp/organization/team/index.js +21 -1
  180. package/lib/service/idp/registration/index.js +4 -1
  181. package/lib/service/idp/user/index.d.ts +8 -0
  182. package/lib/service/idp/user/index.js +20 -3
  183. package/lib/service/idp/user/license/index.js +4 -1
  184. package/lib/service/idp/user/message/index.d.ts +1 -0
  185. package/lib/service/idp/user/message/index.js +4 -1
  186. package/lib/service/idp/user/password/index.js +4 -1
  187. package/lib/service/idp/user/settings/connections/index.js +4 -1
  188. package/lib/service/idp/user/settings/general/index.js +4 -1
  189. package/lib/service/idp/user/settings/index.js +4 -1
  190. package/lib/service/idp/user/settings/notifications/index.js +4 -1
  191. package/lib/service/idp/user/settings/oauthApps/index.js +4 -1
  192. package/lib/service/idp/user/settings/pats/index.js +4 -1
  193. package/lib/service/idp/user/settings/twoFactor/index.js +4 -1
  194. package/lib/service/idp/user/settings/twoFactor/totp/index.js +4 -1
  195. package/lib/service/mailer/index.js +5 -2
  196. package/lib/service/mailer/internal/index.d.ts +2 -2
  197. package/lib/service/mailer/internal/index.js +5 -2
  198. package/lib/service/mothership/index.js +4 -1
  199. package/lib/service/nats/index.d.ts +7 -0
  200. package/lib/service/nats/index.js +19 -1
  201. package/lib/service/shorts/index.js +4 -1
  202. package/lib/service/shorts/internal/index.d.ts +6 -3
  203. package/lib/service/shorts/internal/index.js +20 -6
  204. package/lib/utils/bouncer/features/Provider.js +0 -1
  205. package/package.json +2 -2
  206. package/lib/interfaces/fuse/index.d.ts +0 -3
  207. package/lib/interfaces/fuse/space/cronjob/Cronjob.d.ts +0 -38
  208. package/lib/interfaces/fuse/space/cronjob/Cronjob.js +0 -8
  209. package/lib/interfaces/fuse/space/cronjob/CronjobLog.d.ts +0 -16
  210. package/lib/interfaces/fuse/space/index.d.ts +0 -22
  211. package/lib/interfaces/fuse/space/index.js +0 -11
  212. package/lib/service/dali/avatar/DaliFuseSpace.d.ts +0 -32
  213. package/lib/service/dali/avatar/DaliFuseSpace.js +0 -59
  214. package/lib/service/fuse/index.d.ts +0 -20
  215. package/lib/service/fuse/index.js +0 -48
  216. package/lib/service/fuse/internal/index.d.ts +0 -10
  217. package/lib/service/fuse/internal/index.js +0 -32
  218. package/lib/service/fuse/internal/space/cronjob/index.d.ts +0 -7
  219. package/lib/service/fuse/internal/space/cronjob/index.js +0 -17
  220. package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +0 -17
  221. package/lib/service/fuse/internal/space/cronjob/log/index.js +0 -34
  222. package/lib/service/fuse/internal/space/index.d.ts +0 -26
  223. package/lib/service/fuse/internal/space/index.js +0 -51
  224. package/lib/service/fuse/space/cronjob/index.d.ts +0 -145
  225. package/lib/service/fuse/space/cronjob/index.js +0 -201
  226. package/lib/service/fuse/space/cronjob/log/index.d.ts +0 -35
  227. package/lib/service/fuse/space/cronjob/log/index.js +0 -58
  228. package/lib/service/fuse/space/index.d.ts +0 -97
  229. package/lib/service/fuse/space/index.js +0 -153
  230. /package/lib/interfaces/{fuse/space/cronjob/CronjobLog.js → agent/logging/cloudwatch.js} +0 -0
@@ -0,0 +1,117 @@
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.AgentLogging = void 0;
16
+ const Base_1 = __importDefault(require("../../../Base"));
17
+ class AgentLogging extends Base_1.default {
18
+ /**
19
+ * Retrieves a list of all currently registered and connected external logging destinations.
20
+ * @returns List of active external log collector configurations
21
+ */
22
+ getLogCollectors(raw) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/log/collectors`));
25
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
26
+ });
27
+ }
28
+ /**
29
+ * Registers a new external destination and initializes a persistent Winston HTTP transport for log forwarding.
30
+ * @param collector - The configuration for the new log collector
31
+ * @returns The newly created log collector details
32
+ */
33
+ addLogCollector(collector, raw) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/log/collectors`), collector);
36
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
37
+ });
38
+ }
39
+ /**
40
+ * Retrieves configuration and status information for a specific external log collector by its name.
41
+ * @param name - Unique identifier of the external log collector
42
+ * @returns The requested log collector details
43
+ */
44
+ getLogCollector(name, raw) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/log/collectors/${name}`));
47
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
48
+ });
49
+ }
50
+ /**
51
+ * Removes an external log destination and immediately terminates the associated Winston transport.
52
+ * @param name - Unique identifier of the external log collector to be deleted
53
+ * @returns void (or raw response)
54
+ */
55
+ deleteLogCollector(name, raw) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/log/collectors/${name}`));
58
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
59
+ });
60
+ }
61
+ /**
62
+ * Updates the activation status of a specific log collector,
63
+ * this toggles log forwarding to the destination without removing its configuration.
64
+ * @param name - Unique identifier of the external log collector
65
+ * @param enabled - Flag to enable or disable the collector
66
+ * @returns The updated log collector details
67
+ */
68
+ patchLogCollectorEnabled(name, enabled, raw) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/log/collectors/${name}/enabled`), { enabled });
71
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
72
+ });
73
+ }
74
+ /**
75
+ * Registers and initializes a new Amazon CloudWatch transport for log forwarding
76
+ * @param options - AWS credentials and CloudWatch group/stream configuration
77
+ * @returns The registered CloudWatch collector details
78
+ */
79
+ addCloudWatch(options, raw) {
80
+ return __awaiter(this, void 0, void 0, function* () {
81
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/log/cloudwatch`), options);
82
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
83
+ });
84
+ }
85
+ /**
86
+ * Removes the Amazon CloudWatch logging destination and terminates its Winston transport
87
+ * @returns void (or raw response)
88
+ */
89
+ deleteCloudWatch(raw) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/log/cloudwatch`));
92
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
93
+ });
94
+ }
95
+ /**
96
+ * Establishes a persistent Server-Sent Events (SSE) connection to stream logs in real-time.
97
+ * Note: This method returns the raw Axios response because SSE requires stream handling.
98
+ * @param level - Optional filter by severity level
99
+ * @param entity - Optional filter by originating component
100
+ * @returns Raw response with the event stream
101
+ */
102
+ streamLogs(level, entity) {
103
+ return __awaiter(this, void 0, void 0, function* () {
104
+ return this.axios.get(this.getEndpoint(`/v1/logs`), {
105
+ params: { level, entity },
106
+ responseType: "stream",
107
+ headers: {
108
+ Accept: "text/event-stream",
109
+ },
110
+ });
111
+ });
112
+ }
113
+ getEndpoint(endpoint) {
114
+ return `${this.options.server}/api/agent${endpoint}`;
115
+ }
116
+ }
117
+ exports.AgentLogging = AgentLogging;
@@ -0,0 +1,36 @@
1
+ import Base, { MaybeRaw } from "../../../Base";
2
+ import { ModuleDto } from "../../../interfaces/agent/module";
3
+ export declare class AgentModule extends Base {
4
+ /**
5
+ * Retrieves a list of all loaded modules available in the agent.
6
+ * @returns A list of modules metadata
7
+ */
8
+ listModules<R extends boolean = false>(raw?: {
9
+ raw: R;
10
+ }): Promise<MaybeRaw<R, ModuleDto[]>>;
11
+ /**
12
+ * Creates a new module template based on the received metadata.
13
+ * @param module - Metadata for the new module template
14
+ * @returns Newly created module data
15
+ */
16
+ addModule<R extends boolean = false>(module: ModuleDto, raw?: {
17
+ raw: R;
18
+ }): Promise<MaybeRaw<R, ModuleDto>>;
19
+ /**
20
+ * Retrieves detailed information about a specific module by its name.
21
+ * @param modName - Unique name identifier of the module
22
+ * @returns Requested module details
23
+ */
24
+ getModule<R extends boolean = false>(modName: string, raw?: {
25
+ raw: R;
26
+ }): Promise<MaybeRaw<R, ModuleDto>>;
27
+ /**
28
+ * Removes the module from the agent by its name.
29
+ * @param modName - Unique name identifier of the module to be deleted
30
+ * @returns void (or raw response)
31
+ */
32
+ deleteModule<R extends boolean = false>(modName: string, raw?: {
33
+ raw: R;
34
+ }): Promise<MaybeRaw<R, void>>;
35
+ protected getEndpoint(endpoint: string): string;
36
+ }
@@ -0,0 +1,65 @@
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.AgentModule = void 0;
16
+ const Base_1 = __importDefault(require("../../../Base"));
17
+ class AgentModule extends Base_1.default {
18
+ /**
19
+ * Retrieves a list of all loaded modules available in the agent.
20
+ * @returns A list of modules metadata
21
+ */
22
+ listModules(raw) {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/management/modules`));
25
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
26
+ });
27
+ }
28
+ /**
29
+ * Creates a new module template based on the received metadata.
30
+ * @param module - Metadata for the new module template
31
+ * @returns Newly created module data
32
+ */
33
+ addModule(module, raw) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/management/modules`), module);
36
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
37
+ });
38
+ }
39
+ /**
40
+ * Retrieves detailed information about a specific module by its name.
41
+ * @param modName - Unique name identifier of the module
42
+ * @returns Requested module details
43
+ */
44
+ getModule(modName, raw) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/management/modules/${modName}`));
47
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
48
+ });
49
+ }
50
+ /**
51
+ * Removes the module from the agent by its name.
52
+ * @param modName - Unique name identifier of the module to be deleted
53
+ * @returns void (or raw response)
54
+ */
55
+ deleteModule(modName, raw) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const resp = yield this.axios.delete(this.getEndpoint(`/v1/management/modules/${modName}`));
58
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
59
+ });
60
+ }
61
+ getEndpoint(endpoint) {
62
+ return `${this.options.server}/api/agent${endpoint}`;
63
+ }
64
+ }
65
+ exports.AgentModule = AgentModule;
@@ -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
  const internal_1 = require("./internal");
@@ -8,9 +8,12 @@ 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
15
  exports.AuditorInternal = void 0;
13
- const Base_1 = require("../../../Base");
16
+ const Base_1 = __importDefault(require("../../../Base"));
14
17
  class AuditorInternal extends Base_1.default {
15
18
  constructor() {
16
19
  var _a, _b;
@@ -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 BouncerFeatures extends Base_1.default {
14
17
  constructor(options, axios) {
15
18
  super(options, axios);
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const Base_1 = require("../../Base");
4
- const features_1 = require("./features");
6
+ const Base_1 = __importDefault(require("../../Base"));
7
+ const features_1 = __importDefault(require("./features"));
5
8
  class Bouncer extends Base_1.default {
6
9
  get features() {
7
10
  if (this._features === undefined) {
@@ -1,7 +1,6 @@
1
1
  import Base, { MaybeRaw } from "../../../Base";
2
2
  import { AuditLog } from "../../../interfaces/auditor";
3
- import { Asset, AssetPermission, CreateAsset, PatchAsset, Resolution, Upload } from "../../../interfaces/cosmo/asset";
4
- import { ReducedUser } from "../../../interfaces/idp/user";
3
+ import { Asset, AssetPermission, CreateAsset, Mentionable, PatchAsset, Resolution, SubscriptionFilter, Upload, VTTThumbnail } from "../../../interfaces/cosmo/asset";
5
4
  /**
6
5
  * @class Asset
7
6
  * @extends Base
@@ -155,6 +154,15 @@ export declare class CosmoAsset extends Base {
155
154
  fetchAssetActivity<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, limit: number, page: number, raw?: {
156
155
  raw: R;
157
156
  }): Promise<MaybeRaw<R, AuditLog[]>>;
157
+ /**
158
+ * Fetches an assets VTT file and parses it to return an array of VTTThumbnail objects.
159
+ *
160
+ * @param {string} url - The URL of the VTT file to fetch and parse.
161
+ * @returns {Promise<VTTThumbnail[]>} A promise that resolves to an array of `VTTThumbnail` objects representing the asset’s thumbnails.
162
+ */
163
+ fetchAndParseAssetVTT<R extends boolean = false>(url: string, raw?: {
164
+ raw: R;
165
+ }): Promise<MaybeRaw<R, VTTThumbnail[]>>;
158
166
  /**
159
167
  * Rename an asset.
160
168
  * @remarks
@@ -215,5 +223,43 @@ export declare class CosmoAsset extends Base {
215
223
  */
216
224
  listUsersAllowedToMention<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, limit?: number, page?: number, raw?: {
217
225
  raw: R;
218
- }): Promise<MaybeRaw<R, ReducedUser[]>>;
226
+ }): Promise<MaybeRaw<R, Mentionable[]>>;
227
+ /**
228
+ * Clone one or more assets within a space.
229
+ *
230
+ * This operation creates copies of the specified assets in the same organization and space.
231
+ *
232
+ * @param orgName Name of the Organization
233
+ * @param spaceName Name of the Space
234
+ * @param assetIds List of Asset IDs to be cloned. If folder IDs are specified, they will be recursively cloned.
235
+ * @param parentId (optional) Id of parent asset of the newly cloned asset. If undefined will default to space as parent.
236
+ * @returns The cloned assets
237
+ */
238
+ cloneAsset<R extends boolean = false>(orgName: string, spaceName: string, assetIds: string[], parentId?: string, raw?: {
239
+ raw: R;
240
+ }): Promise<MaybeRaw<R, Asset[]>>;
241
+ /**
242
+ * Subscribe to notifications for a specific asset or all assets in a space.
243
+ *
244
+ * @param orgName Name of the Organization
245
+ * @param spaceName Name of the Space
246
+ * @param assetId (optional) ID of the Asset to subscribe to. If not provided, subscribes to the space.
247
+ * @param filters (optional) Subscription configuration. If 'filters' is omitted or empty, all notification types will be sent.
248
+ * @param raw
249
+ * @returns 204 No Content if successful
250
+ */
251
+ subscribe<R extends boolean = false>(orgName: string, spaceName: string, assetId?: string, filters?: SubscriptionFilter[], raw?: {
252
+ raw: R;
253
+ }): Promise<MaybeRaw<R, void>>;
254
+ /**
255
+ * Unsubscribe from notifications for a specific asset or all assets in a space.
256
+ *
257
+ * @param orgName Name of the Organization
258
+ * @param spaceName Name of the Space
259
+ * @param assetId (optional) ID of the Asset to unsubscribe from. If not provided, unsubscribes from the space.
260
+ * @returns 204 No Content if successful
261
+ */
262
+ unsubscribe<R extends boolean = false>(orgName: string, spaceName: string, assetId?: string, raw?: {
263
+ raw: R;
264
+ }): Promise<MaybeRaw<R, void>>;
219
265
  }
@@ -8,9 +8,13 @@ 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
15
  exports.CosmoAsset = void 0;
13
- const Base_1 = require("../../../Base");
16
+ const Base_1 = __importDefault(require("../../../Base"));
17
+ const axios_1 = require("../../../interfaces/axios");
14
18
  /**
15
19
  * @class Asset
16
20
  * @extends Base
@@ -223,6 +227,52 @@ class CosmoAsset extends Base_1.default {
223
227
  return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
224
228
  });
225
229
  }
230
+ /**
231
+ * Fetches an assets VTT file and parses it to return an array of VTTThumbnail objects.
232
+ *
233
+ * @param {string} url - The URL of the VTT file to fetch and parse.
234
+ * @returns {Promise<VTTThumbnail[]>} A promise that resolves to an array of `VTTThumbnail` objects representing the asset’s thumbnails.
235
+ */
236
+ fetchAndParseAssetVTT(url, raw) {
237
+ return __awaiter(this, void 0, void 0, function* () {
238
+ var _a;
239
+ const resp = yield this.axios.get(url, {
240
+ headers: Object.assign(Object.assign({}, axios_1.disableCacheHeaders), { Authorization: undefined }),
241
+ });
242
+ const parseTimestamp = (ts) => {
243
+ const parts = ts.split(":").map(Number);
244
+ if (parts.length === 3) {
245
+ return parts[0] * 3600 + parts[1] * 60 + parts[2];
246
+ }
247
+ return parts[0] * 60 + parts[1];
248
+ };
249
+ const lines = resp.data.split(/\r?\n/);
250
+ const thumbnails = [];
251
+ for (let i = 0; i < lines.length; i++) {
252
+ const timeMatch = lines[i].match(/(\d{2}:\d{2}:\d{2}\.\d{3})\s-->\s(\d{2}:\d{2}:\d{2}\.\d{3})/);
253
+ if (timeMatch) {
254
+ const start = parseTimestamp(timeMatch[1]);
255
+ const end = parseTimestamp(timeMatch[2]);
256
+ const imageLine = (_a = lines[i + 1]) === null || _a === void 0 ? void 0 : _a.trim();
257
+ if (!imageLine)
258
+ continue;
259
+ const [url, fragment] = imageLine.split("#");
260
+ let xywh = undefined;
261
+ if (fragment === null || fragment === void 0 ? void 0 : fragment.startsWith("xywh=")) {
262
+ const [x, y, w, h] = fragment.replace("xywh=", "").split(",").map(Number);
263
+ xywh = { x, y, w, h };
264
+ }
265
+ thumbnails.push({
266
+ start,
267
+ end,
268
+ url,
269
+ xywh,
270
+ });
271
+ }
272
+ }
273
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : thumbnails);
274
+ });
275
+ }
226
276
  /**
227
277
  * Rename an asset.
228
278
  * @remarks
@@ -302,13 +352,69 @@ class CosmoAsset extends Base_1.default {
302
352
  listUsersAllowedToMention(orgName, spaceName, assetId, limit, page, raw) {
303
353
  return __awaiter(this, void 0, void 0, function* () {
304
354
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/users`), {
305
- params: {
306
- limit,
307
- page,
308
- },
355
+ params: { limit, page },
309
356
  });
310
357
  return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
311
358
  });
312
359
  }
360
+ /**
361
+ * Clone one or more assets within a space.
362
+ *
363
+ * This operation creates copies of the specified assets in the same organization and space.
364
+ *
365
+ * @param orgName Name of the Organization
366
+ * @param spaceName Name of the Space
367
+ * @param assetIds List of Asset IDs to be cloned. If folder IDs are specified, they will be recursively cloned.
368
+ * @param parentId (optional) Id of parent asset of the newly cloned asset. If undefined will default to space as parent.
369
+ * @returns The cloned assets
370
+ */
371
+ cloneAsset(orgName, spaceName, assetIds, parentId, raw) {
372
+ return __awaiter(this, void 0, void 0, function* () {
373
+ const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/clone`), { assetIds, parentId });
374
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
375
+ });
376
+ }
377
+ /**
378
+ * Subscribe to notifications for a specific asset or all assets in a space.
379
+ *
380
+ * @param orgName Name of the Organization
381
+ * @param spaceName Name of the Space
382
+ * @param assetId (optional) ID of the Asset to subscribe to. If not provided, subscribes to the space.
383
+ * @param filters (optional) Subscription configuration. If 'filters' is omitted or empty, all notification types will be sent.
384
+ * @param raw
385
+ * @returns 204 No Content if successful
386
+ */
387
+ subscribe(orgName, spaceName, assetId, filters, raw) {
388
+ return __awaiter(this, void 0, void 0, function* () {
389
+ let resp;
390
+ if (assetId) {
391
+ resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/subscribe`), { filters });
392
+ }
393
+ else {
394
+ resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/subscribe`), { filters });
395
+ }
396
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
397
+ });
398
+ }
399
+ /**
400
+ * Unsubscribe from notifications for a specific asset or all assets in a space.
401
+ *
402
+ * @param orgName Name of the Organization
403
+ * @param spaceName Name of the Space
404
+ * @param assetId (optional) ID of the Asset to unsubscribe from. If not provided, unsubscribes from the space.
405
+ * @returns 204 No Content if successful
406
+ */
407
+ unsubscribe(orgName, spaceName, assetId, raw) {
408
+ return __awaiter(this, void 0, void 0, function* () {
409
+ let resp;
410
+ if (assetId) {
411
+ resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/subscribe`));
412
+ }
413
+ else {
414
+ resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/subscribe`));
415
+ }
416
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
417
+ });
418
+ }
313
419
  }
314
420
  exports.CosmoAsset = CosmoAsset;
@@ -1,5 +1,5 @@
1
1
  import Base, { MaybeRaw } from "../../../Base";
2
- import { Comment, CreateComment, EditComment, Reply } from "../../../interfaces/cosmo/comment";
2
+ import { Comment, CommentSortDirection, CommentSortField, CreateComment, EditComment, Reply } from "../../../interfaces/cosmo/comment";
3
3
  /**
4
4
  * @class Comment
5
5
  * @extends Base
@@ -32,16 +32,21 @@ export declare class CosmoComment extends Base {
32
32
  * @param orgName Name of the Organization
33
33
  * @param spaceName Name of the Space
34
34
  * @param namespaceName Name of the Namespace
35
- * @param limit Maximum number of comments to return
35
+ * @param limit Maximum number of comments to return, user -1 for no limit
36
36
  * @param page Page number for pagination
37
37
  * @param annotation Whether to include annotations in the response
38
38
  * @param replySample Amount of replies to load
39
- *
39
+ * @param sortField Field to sort comments by
40
+ * @param sortDirection Sort direction for comments
41
+ * @param accept The Accept header value, either "application/json" (comments response as json)
42
+ * or "application/mediacomposer+xml" (comments response as media composer xml as download)
43
+ * or "application/fcp+xml" (comments response as fcp xml as download => i.e. for Adobe Premiere Pro)
44
+ * or "text/edl" (comments response as edl as download => i.e. for Davinci Resolve)
40
45
  * @returns A list of Comments
41
46
  */
42
- listComments<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, refId: string, limit?: number, page?: number, annotation?: boolean, replySample?: number, raw?: {
47
+ listComments<R extends boolean = false, A extends string = "application/json">(orgName: string, spaceName: string, namespaceName: string, refId: string, limit?: number, page?: number, annotation?: boolean, replySample?: number, sortField?: CommentSortField, sortDirection?: CommentSortDirection, accept?: A, raw?: {
43
48
  raw: R;
44
- }): Promise<MaybeRaw<R, Comment[]>>;
49
+ }): Promise<A extends "application/mediacomposer+xml" | "application/fcp+xml" | "text/edl" ? ArrayBuffer : MaybeRaw<R, Comment[]>>;
45
50
  /**
46
51
  * Edit a Comment
47
52
  * @remarks
@@ -87,36 +92,4 @@ export declare class CosmoComment extends Base {
87
92
  deleteComment<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, commentIds: string[], raw?: {
88
93
  raw: R;
89
94
  }): Promise<MaybeRaw<R, void>>;
90
- /**
91
- * Edit a Comments text
92
- * @remarks
93
- * ** Under development, breaking changes possible**
94
- * @param orgName Name of the Organization
95
- * @param spaceName Name of the Space
96
- * @param namespaceName Name of the Namespace
97
- * @param commentId ID of the Comment to edit
98
- * @param text New text for the Comment
99
- * @param annotation Whether to include annotations in the response
100
- *
101
- * @returns The edited Comment
102
- */
103
- editCommentText<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, commentId: string, text: string, annotation?: boolean, raw?: {
104
- raw: R;
105
- }): Promise<MaybeRaw<R, Comment | Reply>>;
106
- /**
107
- * Edit a Comments annotation
108
- * @remarks
109
- * ** Under development, breaking changes possible**
110
- * @param orgName Name of the Organization
111
- * @param spaceName Name of the Space
112
- * @param namespaceName Name of the Namespace
113
- * @param commentId ID of the Comment to edit
114
- * @param newAnnotationContent New annotation for the Comment
115
- * @param annotation Whether to include annotations in the response
116
- *
117
- * @returns The edited Comment
118
- */
119
- editCommentAnnotation<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, commentId: string, newAnnotationContent: string, annotation?: boolean, raw?: {
120
- raw: R;
121
- }): Promise<MaybeRaw<R, Comment | Reply>>;
122
95
  }
@@ -8,9 +8,12 @@ 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
15
  exports.CosmoComment = void 0;
13
- const Base_1 = require("../../../Base");
16
+ const Base_1 = __importDefault(require("../../../Base"));
14
17
  /**
15
18
  * @class Comment
16
19
  * @extends Base
@@ -48,18 +51,30 @@ class CosmoComment extends Base_1.default {
48
51
  * @param orgName Name of the Organization
49
52
  * @param spaceName Name of the Space
50
53
  * @param namespaceName Name of the Namespace
51
- * @param limit Maximum number of comments to return
54
+ * @param limit Maximum number of comments to return, user -1 for no limit
52
55
  * @param page Page number for pagination
53
56
  * @param annotation Whether to include annotations in the response
54
57
  * @param replySample Amount of replies to load
55
- *
58
+ * @param sortField Field to sort comments by
59
+ * @param sortDirection Sort direction for comments
60
+ * @param accept The Accept header value, either "application/json" (comments response as json)
61
+ * or "application/mediacomposer+xml" (comments response as media composer xml as download)
62
+ * or "application/fcp+xml" (comments response as fcp xml as download => i.e. for Adobe Premiere Pro)
63
+ * or "text/edl" (comments response as edl as download => i.e. for Davinci Resolve)
56
64
  * @returns A list of Comments
57
65
  */
58
66
  listComments(orgName_1, spaceName_1, namespaceName_1, refId_1, limit_1, page_1) {
59
- return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, refId, limit, page, annotation = false, replySample = 0, raw) {
67
+ return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, refId, limit, page, annotation = false, replySample = 0, sortField, sortDirection, accept, raw) {
60
68
  limit = limit !== null && limit !== void 0 ? limit : 100;
61
69
  page = page !== null && page !== void 0 ? page : 0;
62
- const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments?limit=${limit}&page=${page}&annotation=${annotation}&refId=${refId}&replySample=${replySample}`));
70
+ const fileDownloadTypes = new Set(["application/mediacomposer+xml", "application/fcp+xml", "text/edl"]);
71
+ const isFileDownload = accept !== undefined && fileDownloadTypes.has(accept);
72
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments?limit=${limit}&page=${page}&annotation=${annotation}&refId=${refId}&replySample=${replySample}${sortField !== undefined ? `&sort_field=${sortField}` : ""}${sortDirection !== undefined ? `&sort_direction=${sortDirection}` : ""}`), Object.assign({ headers: {
73
+ Accept: accept !== null && accept !== void 0 ? accept : "application/json",
74
+ } }, (isFileDownload && { responseType: "arraybuffer" })));
75
+ if (isFileDownload) {
76
+ return resp.data;
77
+ }
63
78
  return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
64
79
  });
65
80
  }
@@ -119,43 +134,5 @@ class CosmoComment extends Base_1.default {
119
134
  return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
120
135
  });
121
136
  }
122
- /**
123
- * Edit a Comments text
124
- * @remarks
125
- * ** Under development, breaking changes possible**
126
- * @param orgName Name of the Organization
127
- * @param spaceName Name of the Space
128
- * @param namespaceName Name of the Namespace
129
- * @param commentId ID of the Comment to edit
130
- * @param text New text for the Comment
131
- * @param annotation Whether to include annotations in the response
132
- *
133
- * @returns The edited Comment
134
- */
135
- editCommentText(orgName_1, spaceName_1, namespaceName_1, commentId_1, text_1) {
136
- return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, commentId, text, annotation = false, raw) {
137
- const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments/${commentId}?annotation=${annotation}`), { text: text });
138
- return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
139
- });
140
- }
141
- /**
142
- * Edit a Comments annotation
143
- * @remarks
144
- * ** Under development, breaking changes possible**
145
- * @param orgName Name of the Organization
146
- * @param spaceName Name of the Space
147
- * @param namespaceName Name of the Namespace
148
- * @param commentId ID of the Comment to edit
149
- * @param newAnnotationContent New annotation for the Comment
150
- * @param annotation Whether to include annotations in the response
151
- *
152
- * @returns The edited Comment
153
- */
154
- editCommentAnnotation(orgName_1, spaceName_1, namespaceName_1, commentId_1, newAnnotationContent_1) {
155
- return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, commentId, newAnnotationContent, annotation = false, raw) {
156
- const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments/${commentId}?annotation=${annotation}`), { annotation: newAnnotationContent });
157
- return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
158
- });
159
- }
160
137
  }
161
138
  exports.CosmoComment = CosmoComment;