hcloud-sdk 18.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 (223) hide show
  1. package/changelog.md +86 -175
  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/logging/cloudwatch.d.ts +23 -0
  8. package/lib/interfaces/agent/logging/index.d.ts +2 -0
  9. package/lib/interfaces/{fuse → agent/logging}/index.js +2 -3
  10. package/lib/interfaces/agent/logging/log-collector.d.ts +35 -0
  11. package/lib/interfaces/agent/logging/log-collector.js +2 -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 +0 -1
  15. package/lib/interfaces/auditor/index.js +0 -1
  16. package/lib/interfaces/axios/index.d.ts +5 -0
  17. package/lib/interfaces/cosmo/asset/index.d.ts +40 -9
  18. package/lib/interfaces/cosmo/asset/index.js +9 -1
  19. package/lib/interfaces/cosmo/comment/index.d.ts +4 -1
  20. package/lib/interfaces/cosmo/event/index.d.ts +34 -5
  21. package/lib/interfaces/cosmo/event/index.js +16 -2
  22. package/lib/interfaces/cosmo/share/index.d.ts +89 -7
  23. package/lib/interfaces/cosmo/share/index.js +21 -0
  24. package/lib/interfaces/cosmo/space/index.d.ts +6 -0
  25. package/lib/interfaces/cosmo/stats/index.d.ts +11 -0
  26. package/lib/interfaces/cosmo/stats/index.js +2 -0
  27. package/lib/interfaces/cosmo/tag/tag.d.ts +2 -1
  28. package/lib/interfaces/global/Products.d.ts +0 -1
  29. package/lib/interfaces/global/Products.js +0 -1
  30. package/lib/interfaces/global/Views.d.ts +0 -1
  31. package/lib/interfaces/global/Views.js +0 -1
  32. package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +1 -0
  33. package/lib/interfaces/high5/space/event/stream/node/index.d.ts +1 -0
  34. package/lib/interfaces/high5/space/execution/index.d.ts +1 -0
  35. package/lib/interfaces/high5/space/job/index.d.ts +64 -19
  36. package/lib/interfaces/high5/space/job/index.js +9 -6
  37. package/lib/interfaces/high5/wave/dependentInputs.d.ts +42 -0
  38. package/lib/interfaces/high5/wave/dependentInputs.js +144 -0
  39. package/lib/interfaces/high5/wave/dependentInputsValidation.d.ts +22 -0
  40. package/lib/interfaces/high5/wave/dependentInputsValidation.js +220 -0
  41. package/lib/interfaces/idp/index.d.ts +3 -3
  42. package/lib/interfaces/idp/index.js +3 -3
  43. package/lib/interfaces/idp/oauth/device.d.ts +18 -0
  44. package/lib/interfaces/idp/oauth/device.js +2 -0
  45. package/lib/interfaces/idp/oauth/index.d.ts +17 -4
  46. package/lib/interfaces/idp/organization/index.d.ts +1 -0
  47. package/lib/interfaces/idp/organization/index.js +1 -0
  48. package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +4 -0
  49. package/lib/interfaces/idp/user/Message.d.ts +1 -0
  50. package/lib/interfaces/idp/user/Scopes.d.ts +1 -9
  51. package/lib/interfaces/idp/user/Scopes.js +0 -12
  52. package/lib/interfaces/idp/user/index.d.ts +3 -0
  53. package/lib/interfaces/mailer/index.d.ts +20 -1
  54. package/lib/interfaces/mailer/index.js +14 -2
  55. package/lib/interfaces/nats/index.d.ts +30 -32
  56. package/lib/interfaces/nats/index.js +103 -117
  57. package/lib/interfaces/shorts/index.d.ts +7 -0
  58. package/lib/interfaces/shorts/index.js +6 -0
  59. package/lib/service/agent/bundle/dev/index.js +4 -1
  60. package/lib/service/agent/bundle/index.js +4 -1
  61. package/lib/service/agent/context/index.js +4 -1
  62. package/lib/service/agent/index.d.ts +6 -0
  63. package/lib/service/agent/index.js +18 -1
  64. package/lib/service/agent/installer/index.js +4 -1
  65. package/lib/service/agent/logging/index.d.ts +69 -0
  66. package/lib/service/agent/logging/index.js +117 -0
  67. package/lib/service/agent/module/index.d.ts +36 -0
  68. package/lib/service/agent/module/index.js +65 -0
  69. package/lib/service/auditor/index.js +4 -1
  70. package/lib/service/auditor/internal/index.js +4 -1
  71. package/lib/service/bouncer/features/index.js +4 -1
  72. package/lib/service/bouncer/index.js +5 -2
  73. package/lib/service/cosmo/asset/index.d.ts +49 -3
  74. package/lib/service/cosmo/asset/index.js +111 -5
  75. package/lib/service/cosmo/comment/index.d.ts +7 -36
  76. package/lib/service/cosmo/comment/index.js +18 -43
  77. package/lib/service/cosmo/event/index.js +4 -1
  78. package/lib/service/cosmo/folder/index.js +4 -1
  79. package/lib/service/cosmo/index.d.ts +3 -0
  80. package/lib/service/cosmo/index.js +11 -1
  81. package/lib/service/cosmo/internal/index.js +4 -1
  82. package/lib/service/cosmo/internal/space/index.js +4 -1
  83. package/lib/service/cosmo/location/index.js +4 -1
  84. package/lib/service/cosmo/namespace/index.d.ts +15 -1
  85. package/lib/service/cosmo/namespace/index.js +21 -1
  86. package/lib/service/cosmo/organization/index.js +4 -1
  87. package/lib/service/cosmo/permissions/index.js +4 -1
  88. package/lib/service/cosmo/production/index.js +4 -1
  89. package/lib/service/cosmo/share/index.d.ts +37 -29
  90. package/lib/service/cosmo/share/index.js +47 -35
  91. package/lib/service/cosmo/space/index.d.ts +28 -1
  92. package/lib/service/cosmo/space/index.js +45 -1
  93. package/lib/service/cosmo/stats/index.d.ts +35 -0
  94. package/lib/service/cosmo/stats/index.js +58 -0
  95. package/lib/service/cosmo/tag/index.js +4 -1
  96. package/lib/service/dali/DaliAvatar.d.ts +0 -6
  97. package/lib/service/dali/DaliAvatar.js +4 -11
  98. package/lib/service/dali/avatar/DaliCosmoSpace.js +4 -1
  99. package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +2 -1
  100. package/lib/service/dali/avatar/DaliHigh5Pool.js +5 -2
  101. package/lib/service/dali/avatar/DaliHigh5Space.d.ts +2 -1
  102. package/lib/service/dali/avatar/DaliHigh5Space.js +5 -2
  103. package/lib/service/dali/avatar/DaliOAuthApp.d.ts +2 -1
  104. package/lib/service/dali/avatar/DaliOAuthApp.js +5 -2
  105. package/lib/service/dali/avatar/DaliOrganization.d.ts +2 -1
  106. package/lib/service/dali/avatar/DaliOrganization.js +5 -2
  107. package/lib/service/dali/avatar/DaliServiceAccount.d.ts +1 -1
  108. package/lib/service/dali/avatar/DaliServiceAccount.js +6 -3
  109. package/lib/service/dali/avatar/DaliTeam.d.ts +2 -1
  110. package/lib/service/dali/avatar/DaliTeam.js +5 -2
  111. package/lib/service/dali/avatar/DaliUser.d.ts +2 -1
  112. package/lib/service/dali/avatar/DaliUser.js +5 -2
  113. package/lib/service/dali/index.js +4 -1
  114. package/lib/service/high5/execution/index.js +4 -1
  115. package/lib/service/high5/execution/log/index.js +4 -1
  116. package/lib/service/high5/execution/status/index.js +4 -1
  117. package/lib/service/high5/index.js +4 -1
  118. package/lib/service/high5/internal/index.js +4 -1
  119. package/lib/service/high5/internal/space/index.js +4 -1
  120. package/lib/service/high5/internal/space/job/index.js +4 -1
  121. package/lib/service/high5/internal/space/job/log/index.js +4 -1
  122. package/lib/service/high5/joinToken/index.js +4 -1
  123. package/lib/service/high5/space/database/document/array/index.js +4 -1
  124. package/lib/service/high5/space/database/document/index.js +4 -1
  125. package/lib/service/high5/space/database/document/number/index.js +4 -1
  126. package/lib/service/high5/space/database/index.js +4 -1
  127. package/lib/service/high5/space/event/index.js +4 -1
  128. package/lib/service/high5/space/event/stream/design/DesignOperations.js +4 -1
  129. package/lib/service/high5/space/event/stream/design/index.js +6 -3
  130. package/lib/service/high5/space/event/stream/design/snapshot/index.js +4 -1
  131. package/lib/service/high5/space/event/stream/index.js +4 -1
  132. package/lib/service/high5/space/execution/index.js +4 -1
  133. package/lib/service/high5/space/execution/log/index.js +4 -1
  134. package/lib/service/high5/space/execution/status/index.js +4 -1
  135. package/lib/service/high5/space/index.d.ts +10 -0
  136. package/lib/service/high5/space/index.js +25 -5
  137. package/lib/service/high5/space/job/index.js +4 -1
  138. package/lib/service/high5/space/job/log/index.js +4 -1
  139. package/lib/service/high5/space/node/index.js +4 -1
  140. package/lib/service/high5/space/pool/index.d.ts +11 -0
  141. package/lib/service/high5/space/pool/index.js +22 -1
  142. package/lib/service/high5/space/secret/index.js +4 -1
  143. package/lib/service/high5/space/stat/index.js +4 -1
  144. package/lib/service/high5/space/wave/index.js +4 -1
  145. package/lib/service/high5/space/webhook/index.js +4 -1
  146. package/lib/service/high5/space/webhook/log/index.js +4 -1
  147. package/lib/service/high5/stat/index.js +4 -1
  148. package/lib/service/high5/wave/index.js +4 -1
  149. package/lib/service/high5/wave/s3/index.js +5 -2
  150. package/lib/service/idp/guest/index.js +4 -1
  151. package/lib/service/idp/index.js +4 -1
  152. package/lib/service/idp/internal/index.js +4 -1
  153. package/lib/service/idp/oauth/device.d.ts +131 -0
  154. package/lib/service/idp/oauth/device.js +177 -0
  155. package/lib/service/idp/oauth/index.d.ts +3 -0
  156. package/lib/service/idp/oauth/index.js +11 -1
  157. package/lib/service/idp/organization/index.d.ts +9 -0
  158. package/lib/service/idp/organization/index.js +22 -3
  159. package/lib/service/idp/organization/license/index.js +4 -1
  160. package/lib/service/idp/organization/member/index.js +5 -2
  161. package/lib/service/idp/organization/member/invitations/index.d.ts +19 -0
  162. package/lib/service/idp/organization/member/invitations/index.js +23 -1
  163. package/lib/service/idp/organization/service-accounts/index.d.ts +11 -1
  164. package/lib/service/idp/organization/service-accounts/index.js +22 -2
  165. package/lib/service/idp/organization/settings/domain/index.js +4 -1
  166. package/lib/service/idp/organization/settings/domain/saml/index.js +4 -1
  167. package/lib/service/idp/organization/settings/index.js +4 -1
  168. package/lib/service/idp/organization/settings/oauth/index.d.ts +10 -0
  169. package/lib/service/idp/organization/settings/oauth/index.js +21 -1
  170. package/lib/service/idp/organization/stat/index.js +4 -1
  171. package/lib/service/idp/organization/team/index.d.ts +10 -0
  172. package/lib/service/idp/organization/team/index.js +21 -1
  173. package/lib/service/idp/registration/index.js +4 -1
  174. package/lib/service/idp/user/index.d.ts +8 -0
  175. package/lib/service/idp/user/index.js +20 -3
  176. package/lib/service/idp/user/license/index.js +4 -1
  177. package/lib/service/idp/user/message/index.d.ts +1 -0
  178. package/lib/service/idp/user/message/index.js +4 -1
  179. package/lib/service/idp/user/password/index.js +4 -1
  180. package/lib/service/idp/user/settings/connections/index.js +4 -1
  181. package/lib/service/idp/user/settings/general/index.js +4 -1
  182. package/lib/service/idp/user/settings/index.js +4 -1
  183. package/lib/service/idp/user/settings/notifications/index.js +4 -1
  184. package/lib/service/idp/user/settings/oauthApps/index.js +4 -1
  185. package/lib/service/idp/user/settings/pats/index.js +4 -1
  186. package/lib/service/idp/user/settings/twoFactor/index.js +4 -1
  187. package/lib/service/idp/user/settings/twoFactor/totp/index.js +4 -1
  188. package/lib/service/mailer/index.js +5 -2
  189. package/lib/service/mailer/internal/index.d.ts +2 -2
  190. package/lib/service/mailer/internal/index.js +5 -2
  191. package/lib/service/mothership/index.js +4 -1
  192. package/lib/service/nats/index.d.ts +7 -0
  193. package/lib/service/nats/index.js +19 -1
  194. package/lib/service/shorts/index.js +4 -1
  195. package/lib/service/shorts/internal/index.d.ts +6 -3
  196. package/lib/service/shorts/internal/index.js +20 -6
  197. package/lib/utils/bouncer/features/Provider.js +0 -1
  198. package/package.json +2 -2
  199. package/lib/interfaces/fuse/index.d.ts +0 -3
  200. package/lib/interfaces/fuse/space/cronjob/Cronjob.d.ts +0 -38
  201. package/lib/interfaces/fuse/space/cronjob/Cronjob.js +0 -8
  202. package/lib/interfaces/fuse/space/cronjob/CronjobLog.d.ts +0 -16
  203. package/lib/interfaces/fuse/space/index.d.ts +0 -22
  204. package/lib/interfaces/fuse/space/index.js +0 -11
  205. package/lib/service/dali/avatar/DaliFuseSpace.d.ts +0 -32
  206. package/lib/service/dali/avatar/DaliFuseSpace.js +0 -59
  207. package/lib/service/fuse/index.d.ts +0 -20
  208. package/lib/service/fuse/index.js +0 -48
  209. package/lib/service/fuse/internal/index.d.ts +0 -10
  210. package/lib/service/fuse/internal/index.js +0 -32
  211. package/lib/service/fuse/internal/space/cronjob/index.d.ts +0 -7
  212. package/lib/service/fuse/internal/space/cronjob/index.js +0 -17
  213. package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +0 -17
  214. package/lib/service/fuse/internal/space/cronjob/log/index.js +0 -34
  215. package/lib/service/fuse/internal/space/index.d.ts +0 -26
  216. package/lib/service/fuse/internal/space/index.js +0 -51
  217. package/lib/service/fuse/space/cronjob/index.d.ts +0 -145
  218. package/lib/service/fuse/space/cronjob/index.js +0 -201
  219. package/lib/service/fuse/space/cronjob/log/index.d.ts +0 -35
  220. package/lib/service/fuse/space/cronjob/log/index.js +0 -58
  221. package/lib/service/fuse/space/index.d.ts +0 -97
  222. package/lib/service/fuse/space/index.js +0 -153
  223. /package/lib/interfaces/{fuse/space/cronjob/CronjobLog.js → agent/logging/cloudwatch.js} +0 -0
@@ -8,14 +8,17 @@ 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.IdpUser = void 0;
13
- const Base_1 = require("../../../Base");
16
+ const Base_1 = __importDefault(require("../../../Base"));
14
17
  const paginatedResponseHelper_1 = require("../../../helper/paginatedResponseHelper");
15
18
  const searchFilter_1 = require("../../../helper/searchFilter");
16
19
  const license_1 = require("./license");
17
20
  const message_1 = require("./message");
18
- const password_1 = require("./password");
21
+ const password_1 = __importDefault(require("./password"));
19
22
  const settings_1 = require("./settings");
20
23
  class IdpUser extends Base_1.default {
21
24
  /**
@@ -114,6 +117,21 @@ class IdpUser extends Base_1.default {
114
117
  return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
115
118
  });
116
119
  }
120
+ /**
121
+ * Updates user's avatar
122
+ * @param file Image as Javascript File
123
+ * @returns User details with updated avatar
124
+ */
125
+ updateAvatar(file, raw) {
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ const data = new FormData();
128
+ data.append("avatar", file);
129
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/avatar`), data, {
130
+ headers: { "Content-Type": "multipart/form-data" },
131
+ });
132
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
133
+ });
134
+ }
117
135
  /**
118
136
  * Retrieves all Organizations of a user that match the provided search filter(s). Returns all Organizations of the user if no search filter is provided.
119
137
  * @param filters (optional) Array of search filters
@@ -123,7 +141,6 @@ class IdpUser extends Base_1.default {
123
141
  * @param options (optional) Defines query options to retrieve additional properties for the returned Organization objects.
124
142
  * @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
125
143
  */
126
- // eslint-disable-next-line complexity
127
144
  searchOrganizations(params, raw) {
128
145
  return __awaiter(this, void 0, void 0, function* () {
129
146
  var _a, _b, _c;
@@ -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.IdpUserLicense = void 0;
13
- const Base_1 = require("../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../Base"));
14
17
  class IdpUserLicense extends Base_1.default {
15
18
  getLicense(raw) {
16
19
  return __awaiter(this, void 0, void 0, function* () {
@@ -54,6 +54,7 @@ export declare class IdpMessage extends Base {
54
54
  title?: string;
55
55
  subject?: string;
56
56
  message: string;
57
+ link?: string;
57
58
  }, raw?: {
58
59
  raw: R;
59
60
  }): Promise<MaybeRaw<R, Message>>;
@@ -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.IdpMessage = void 0;
13
- const Base_1 = require("../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../Base"));
14
17
  const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
15
18
  const searchFilter_1 = require("../../../../helper/searchFilter");
16
19
  class IdpMessage extends Base_1.default {
@@ -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 UserPasswordService extends Base_1.default {
14
17
  /**
15
18
  * 2nd phase of the reset password flow
@@ -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.IdpConnections = void 0;
13
- const Base_1 = require("../../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../../Base"));
14
17
  class IdpConnections extends Base_1.default {
15
18
  /**
16
19
  * Get connection settings for all organizations the user is a part of.
@@ -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.IdpGeneral = void 0;
13
- const Base_1 = require("../../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../../Base"));
14
17
  class IdpGeneral extends Base_1.default {
15
18
  /**
16
19
  * Retrieves the current active user settings.
@@ -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
6
  exports.IdpSettings = void 0;
4
- const Base_1 = require("../../../../Base");
7
+ const Base_1 = __importDefault(require("../../../../Base"));
5
8
  const connections_1 = require("./connections");
6
9
  const general_1 = require("./general");
7
10
  const notifications_1 = require("./notifications");
@@ -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.IdpNotifications = void 0;
13
- const Base_1 = require("../../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../../Base"));
14
17
  class IdpNotifications extends Base_1.default {
15
18
  /**
16
19
  * Retrieves the notification settings of the requesting user.
@@ -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.IdpOAuthApps = void 0;
13
- const Base_1 = require("../../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../../Base"));
14
17
  const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
15
18
  const searchFilter_1 = require("../../../../../helper/searchFilter");
16
19
  class IdpOAuthApps extends Base_1.default {
@@ -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.IdpPat = void 0;
13
- const Base_1 = require("../../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../../Base"));
14
17
  const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
15
18
  const searchFilter_1 = require("../../../../../helper/searchFilter");
16
19
  class IdpPat extends Base_1.default {
@@ -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
6
  exports.IdpTwoFactor = void 0;
4
- const Base_1 = require("../../../../../Base");
7
+ const Base_1 = __importDefault(require("../../../../../Base"));
5
8
  const totp_1 = require("./totp");
6
9
  class IdpTwoFactor extends Base_1.default {
7
10
  /**
@@ -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.IdpTotp = void 0;
13
- const Base_1 = require("../../../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../../../Base"));
14
17
  class IdpTotp extends Base_1.default {
15
18
  /**
16
19
  * Creates a new TOTP for the requesting User.
@@ -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
- const Base_1 = require("../../Base");
13
- const internal_1 = require("./internal");
15
+ const Base_1 = __importDefault(require("../../Base"));
16
+ const internal_1 = __importDefault(require("./internal"));
14
17
  class Mailer extends Base_1.default {
15
18
  get internal() {
16
19
  if (this._internal === undefined) {
@@ -1,5 +1,5 @@
1
1
  import Base, { MaybeRaw } from "../../../Base";
2
- import { HtmlMail, MailjetMailDTO, MustacheMail, TemplateMail } from "../../../interfaces/mailer";
2
+ import { HtmlMail, MailjetMailDTO, MailjetResponse, MustacheMail, TemplateMail } from "../../../interfaces/mailer";
3
3
  export default class MailerInternal extends Base {
4
4
  /**
5
5
  * Sends a new mail based on a mailjet template.
@@ -9,7 +9,7 @@ export default class MailerInternal extends Base {
9
9
  */
10
10
  sendMailMailjet<R extends boolean = false>(mail: MailjetMailDTO, raw?: {
11
11
  raw: R;
12
- }): Promise<MaybeRaw<R, void>>;
12
+ }): Promise<MaybeRaw<R, MailjetResponse>>;
13
13
  /**
14
14
  * Sends a new mail based on a mustache html body.
15
15
  *
@@ -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 MailerInternal extends Base_1.default {
14
17
  /**
15
18
  * Sends a new mail based on a mailjet template.
@@ -20,7 +23,7 @@ class MailerInternal extends Base_1.default {
20
23
  sendMailMailjet(mail, raw) {
21
24
  return __awaiter(this, void 0, void 0, function* () {
22
25
  const resp = yield this.axios.post(this.getEndpoint("/v1/send/mailjet"), mail);
23
- return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
26
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
24
27
  });
25
28
  }
26
29
  /**
@@ -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 MothershipService extends Base_1.default {
@@ -45,5 +45,12 @@ declare class Nats extends Base {
45
45
  requestAndWaitForResponse(subject: string, type: NatsMessageType, objectType: NatsObjectType, object: unknown, options?: RequestOptions): Promise<Msg | undefined>;
46
46
  respond(msg: Msg | RawMsg, data: unknown): void;
47
47
  protected getEndpoint(endpoint: string): string;
48
+ /**
49
+ * Gracefully closes the NATS connection.
50
+ * * This method uses 'drain' to ensure that all outgoing messages are sent
51
+ * and all buffered incoming messages are processed by their respective subscribers before the connection is physically closed
52
+ * * @returns {Promise<void>} A promise that resolves when the connection is fully drained and closed
53
+ */
54
+ disconnect(): Promise<void>;
48
55
  }
49
56
  export default Nats;
@@ -8,10 +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
  const nats_1 = require("nats");
13
16
  const nats_ws_1 = require("nats.ws");
14
- const Base_1 = require("../../Base");
17
+ const Base_1 = __importDefault(require("../../Base"));
15
18
  const isBrowser = typeof window !== "undefined";
16
19
  class Nats extends Base_1.default {
17
20
  constructor() {
@@ -148,5 +151,20 @@ class Nats extends Base_1.default {
148
151
  getEndpoint(endpoint) {
149
152
  return `${this.options.server}/ws/nats${endpoint}`;
150
153
  }
154
+ /**
155
+ * Gracefully closes the NATS connection.
156
+ * * This method uses 'drain' to ensure that all outgoing messages are sent
157
+ * and all buffered incoming messages are processed by their respective subscribers before the connection is physically closed
158
+ * * @returns {Promise<void>} A promise that resolves when the connection is fully drained and closed
159
+ */
160
+ disconnect() {
161
+ return __awaiter(this, void 0, void 0, function* () {
162
+ if (this.natsConnection && !this.natsConnection.isClosed()) {
163
+ yield this.natsConnection.drain();
164
+ this.natsConnection = undefined;
165
+ this.subMap = [];
166
+ }
167
+ });
168
+ }
151
169
  }
152
170
  exports.default = Nats;
@@ -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 internal_1 = require("./internal");
14
17
  class Shorts extends Base_1.default {
15
18
  /**
@@ -1,5 +1,5 @@
1
1
  import Base, { MaybeRaw } from "../../../Base";
2
- import { Short } from "../../../interfaces/shorts";
2
+ import { Short, ShortType } from "../../../interfaces/shorts";
3
3
  export declare class ShortsInternal extends Base {
4
4
  /**
5
5
  * Generates a shortened alias for the provided long URL and sets a maximum number of allowed visits.
@@ -9,10 +9,13 @@ export declare class ShortsInternal extends Base {
9
9
  * @param organizationId ID of the organization
10
10
  * @param spaceId ID of the space
11
11
  * @param url Original long URL that needs to be shortened
12
- * @param visitsLimit Maximum number of times the shortened link can be accessed
12
+ * @param type Type of the short URL, can be GENERIC or COSMO
13
+ * @param visitsLimit Optional maximum number of times the shortened link can be accessed, after which it will become inactive (max 100 for GENERIC type)
14
+ * @param expireDate Optional expiration date for the shortened URL, represented as a timestamp in milliseconds
15
+ *
13
16
  * @returns the created short url
14
17
  */
15
- createShort<R extends boolean = false>(organizationId: string, spaceId: string, url: string, visitsLimit: number, raw?: {
18
+ createShort<R extends boolean = false>(organizationId: string, spaceId: string, url: string, type?: ShortType, visitsLimit?: number, expireDate?: number, raw?: {
16
19
  raw: R;
17
20
  }): Promise<MaybeRaw<R, Short>>;
18
21
  /**
@@ -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.ShortsInternal = void 0;
13
- const Base_1 = require("../../../Base");
16
+ const Base_1 = __importDefault(require("../../../Base"));
17
+ const shorts_1 = require("../../../interfaces/shorts");
14
18
  class ShortsInternal extends Base_1.default {
15
19
  /**
16
20
  * Generates a shortened alias for the provided long URL and sets a maximum number of allowed visits.
@@ -20,12 +24,22 @@ class ShortsInternal extends Base_1.default {
20
24
  * @param organizationId ID of the organization
21
25
  * @param spaceId ID of the space
22
26
  * @param url Original long URL that needs to be shortened
23
- * @param visitsLimit Maximum number of times the shortened link can be accessed
27
+ * @param type Type of the short URL, can be GENERIC or COSMO
28
+ * @param visitsLimit Optional maximum number of times the shortened link can be accessed, after which it will become inactive (max 100 for GENERIC type)
29
+ * @param expireDate Optional expiration date for the shortened URL, represented as a timestamp in milliseconds
30
+ *
24
31
  * @returns the created short url
25
32
  */
26
- createShort(organizationId, spaceId, url, visitsLimit, raw) {
27
- return __awaiter(this, void 0, void 0, function* () {
28
- const res = yield this.axios.post(this.getEndpoint(`/internal/v1/short`), { url, visitsLimit, organizationId, spaceId });
33
+ createShort(organizationId_1, spaceId_1, url_1) {
34
+ return __awaiter(this, arguments, void 0, function* (organizationId, spaceId, url, type = shorts_1.ShortType.GENERIC, visitsLimit, expireDate, raw) {
35
+ const res = yield this.axios.post(this.getEndpoint(`/internal/v1/short`), {
36
+ organizationId,
37
+ spaceId,
38
+ url,
39
+ type,
40
+ visitsLimit,
41
+ expireDate,
42
+ });
29
43
  return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
30
44
  });
31
45
  }
@@ -98,7 +112,7 @@ class ShortsInternal extends Base_1.default {
98
112
  });
99
113
  }
100
114
  getEndpoint(endpoint) {
101
- return `${this.options.server}/api/account${endpoint}`;
115
+ return `${this.options.server}/api/shorts${endpoint}`;
102
116
  }
103
117
  }
104
118
  exports.ShortsInternal = ShortsInternal;
@@ -11,7 +11,6 @@ class BouncerProvider {
11
11
  this.context = context;
12
12
  this.logger = logger;
13
13
  }
14
- /* eslint-disable complexity */
15
14
  isEnabled(featureName, defaultValue, context) {
16
15
  const feature = this.features.find(f => f.name === featureName);
17
16
  let result = defaultValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hcloud-sdk",
3
- "version": "18.0.0",
3
+ "version": "19.0.0",
4
4
  "description": "hcloud platform sdk",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -50,7 +50,7 @@
50
50
  "typescript": "^5.8.3"
51
51
  },
52
52
  "dependencies": {
53
- "axios": "^1.9.0",
53
+ "axios": "^1.13.2",
54
54
  "nats": "^2.29.3",
55
55
  "nats.ws": "^1.30.3"
56
56
  }
@@ -1,3 +0,0 @@
1
- export * from "./space";
2
- export * from "./space/cronjob/Cronjob";
3
- export * from "./space/cronjob/CronjobLog";
@@ -1,38 +0,0 @@
1
- import { Select } from "../../../../utils/Types";
2
- import { Header, HttpMethod, ReducedSpace } from "../../../global";
3
- import { ReducedOrganization } from "../../../idp/organization";
4
- import { ReducedUser } from "../../../idp/user";
5
- export interface Cronjob {
6
- _id: string;
7
- name: string;
8
- expression: string;
9
- organization: ReducedOrganization;
10
- creator: ReducedUser;
11
- space: ReducedSpace;
12
- targetUrl: string;
13
- httpMethod: HttpMethod;
14
- acceptInvalidSSL: boolean;
15
- timezone: string;
16
- description?: string;
17
- headers?: Header[];
18
- body?: string;
19
- enabled?: boolean;
20
- createDate: number;
21
- modifyDate: number;
22
- nextExecution?: number[];
23
- lastStatus?: number;
24
- lastTriggered?: number;
25
- hmacSettings?: HmacSettings;
26
- }
27
- export type HmacSettings = {
28
- headerName: string;
29
- secret: string;
30
- algorithm: HmacHashingAlgo;
31
- };
32
- export declare enum HmacHashingAlgo {
33
- SHA_1 = "SHA-1",
34
- SHA_256 = "SHA-256"
35
- }
36
- export type CronjobCreate = Pick<Cronjob, "name" | "expression" | "targetUrl" | "httpMethod" | "headers" | "body" | "enabled" | "description" | "lastStatus" | "lastTriggered"> & Partial<Pick<Cronjob, "acceptInvalidSSL" | "timezone">> & {
37
- hmacSettings: Select<HmacSettings, "headerName" | "algorithm", "secret">;
38
- };
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HmacHashingAlgo = void 0;
4
- var HmacHashingAlgo;
5
- (function (HmacHashingAlgo) {
6
- HmacHashingAlgo["SHA_1"] = "SHA-1";
7
- HmacHashingAlgo["SHA_256"] = "SHA-256";
8
- })(HmacHashingAlgo || (exports.HmacHashingAlgo = HmacHashingAlgo = {}));
@@ -1,16 +0,0 @@
1
- import { Header, ReducedSpace } from "../../../global";
2
- import { ReducedOrganization } from "../../../idp/organization";
3
- import { ReducedUser } from "../../../idp/user";
4
- export interface CronjobLogDto {
5
- _id: string;
6
- cronjobId: string;
7
- statusCode: number;
8
- organization: ReducedOrganization;
9
- creator: ReducedUser;
10
- space: ReducedSpace;
11
- headers?: Header[];
12
- body?: string;
13
- createDate: number;
14
- modifyDate: number;
15
- }
16
- export type CronjobLogCreate = Pick<CronjobLogDto, "statusCode" | "headers" | "body">;
@@ -1,22 +0,0 @@
1
- import { ReducedSpace, Space, SpaceEntity } from "../../global";
2
- import { ReducedOrganization } from "../../idp";
3
- export interface FuseSpace extends Space {
4
- highestPermissionOfUser: FuseSpacePermission;
5
- }
6
- export interface FuseSpaceEntityPermission {
7
- organization: ReducedOrganization;
8
- space: ReducedSpace;
9
- entityId: string;
10
- entityName: string;
11
- type: SpaceEntity;
12
- permission: FuseSpacePermission;
13
- avatarUrl: string;
14
- serviceAccount?: boolean;
15
- }
16
- export declare enum FuseSpacePermission {
17
- NONE = "NONE",
18
- READ = "READ",
19
- WRITE = "WRITE",
20
- MANAGE = "MANAGE",
21
- OWNER = "OWNER"
22
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FuseSpacePermission = void 0;
4
- var FuseSpacePermission;
5
- (function (FuseSpacePermission) {
6
- FuseSpacePermission["NONE"] = "NONE";
7
- FuseSpacePermission["READ"] = "READ";
8
- FuseSpacePermission["WRITE"] = "WRITE";
9
- FuseSpacePermission["MANAGE"] = "MANAGE";
10
- FuseSpacePermission["OWNER"] = "OWNER";
11
- })(FuseSpacePermission || (exports.FuseSpacePermission = FuseSpacePermission = {}));
@@ -1,32 +0,0 @@
1
- import Base, { MaybeRaw } from "../../../Base";
2
- import { AvatarCreated } from "../../../interfaces/dali";
3
- export declare class DaliFuseSpace extends Base {
4
- /**
5
- * Creates a default avatar for the specified Fuse space.
6
- * @param orgName Name of the organization
7
- * @param spaceName Name of the space
8
- * @returns Public URL of the created avatar
9
- */
10
- createAvatar<R extends boolean = false>(orgName: string, spaceName: string, raw?: {
11
- raw: R;
12
- }): Promise<MaybeRaw<R, AvatarCreated>>;
13
- /**
14
- * Deletes the avatar of the Fuse space from cloud storage. If you want to update it instead, use updateAvatar().
15
- * @param orgName Name of the organization
16
- * @param spaceName Name of the space
17
- */
18
- deleteAvatar<R extends boolean = false>(orgName: string, spaceName: string, raw?: {
19
- raw: R;
20
- }): Promise<MaybeRaw<R, string>>;
21
- /**
22
- * Updates the avatar of the specified Fuse space
23
- * @param orgName Name of the organization
24
- * @param spaceName Name of the space
25
- * @param file Image as Javascript File
26
- * @returns Public URL of the new avatar
27
- */
28
- updateAvatar<R extends boolean = false>(orgName: string, spaceName: string, file: File, raw?: {
29
- raw: R;
30
- }): Promise<MaybeRaw<R, AvatarCreated>>;
31
- protected getEndpoint(endpoint: string): string;
32
- }