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
@@ -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.IdpOAuthApp = 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 IdpOAuthApp extends Base_1.default {
@@ -111,6 +114,23 @@ class IdpOAuthApp extends Base_1.default {
111
114
  return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
112
115
  });
113
116
  }
117
+ /**
118
+ * Updates the avatar of the specified OAuth App
119
+ * @param orgName Name of the organization
120
+ * @param oauthAppId ID of the OAuthApp
121
+ * @param file Image as Javascript File
122
+ * @returns OAuth App details with updated avatar
123
+ */
124
+ updateAvatar(orgName, oauthAppId, file, raw) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ const data = new FormData();
127
+ data.append("avatar", file);
128
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth/${oauthAppId}/avatar`), data, {
129
+ headers: { "Content-Type": "multipart/form-data" },
130
+ });
131
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
132
+ });
133
+ }
114
134
  getEndpoint(endpoint) {
115
135
  return `${this.options.server}/api/account${endpoint}`;
116
136
  }
@@ -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.IdpOrganizationStat = void 0;
13
- const Base_1 = require("../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../Base"));
14
17
  class IdpOrganizationStat extends Base_1.default {
15
18
  /**
16
19
  * Retrieves usage statistics for a specific organization.
@@ -80,5 +80,15 @@ export declare class IdpOrganizationTeams extends Base {
80
80
  }): Promise<MaybeRaw<R, PaginatedResponse<ReducedUser & {
81
81
  email: string;
82
82
  }>>>;
83
+ /**
84
+ * Updates the avatar of the specified team
85
+ * @param orgName Name of the organization
86
+ * @param teamName Name of the Team
87
+ * @param file Image as Javascript File
88
+ * @returns Team details with updated avatar
89
+ */
90
+ updateAvatar<R extends boolean = false>(orgName: string, teamName: string, file: File, raw?: {
91
+ raw: R;
92
+ }): Promise<MaybeRaw<R, Team>>;
83
93
  protected getEndpoint(endpoint: string): string;
84
94
  }
@@ -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.IdpOrganizationTeams = 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 IdpOrganizationTeams extends Base_1.default {
@@ -118,6 +121,23 @@ class IdpOrganizationTeams extends Base_1.default {
118
121
  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));
119
122
  });
120
123
  }
124
+ /**
125
+ * Updates the avatar of the specified team
126
+ * @param orgName Name of the organization
127
+ * @param teamName Name of the Team
128
+ * @param file Image as Javascript File
129
+ * @returns Team details with updated avatar
130
+ */
131
+ updateAvatar(orgName, teamName, file, raw) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ const data = new FormData();
134
+ data.append("avatar", file);
135
+ const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/teams/${teamName}/avatar`), data, {
136
+ headers: { "Content-Type": "multipart/form-data" },
137
+ });
138
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
139
+ });
140
+ }
121
141
  getEndpoint(endpoint) {
122
142
  return `${this.options.server}/api/account/v1/org${endpoint}`;
123
143
  }
@@ -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.IdpRegistration = void 0;
13
- const Base_1 = require("../../../Base");
16
+ const Base_1 = __importDefault(require("../../../Base"));
14
17
  class IdpRegistration extends Base_1.default {
15
18
  /**
16
19
  * Registers a User in the HCloud system. This endpoint will send a verification link (with expiration date) to the Users' email address.
@@ -65,6 +65,14 @@ export declare class IdpUser extends Base {
65
65
  deleteUser<R extends boolean = false>(raw?: {
66
66
  raw: R;
67
67
  }): Promise<MaybeRaw<R, void>>;
68
+ /**
69
+ * Updates user's avatar
70
+ * @param file Image as Javascript File
71
+ * @returns User details with updated avatar
72
+ */
73
+ updateAvatar<R extends boolean = false>(file: File, raw?: {
74
+ raw: R;
75
+ }): Promise<MaybeRaw<R, User>>;
68
76
  /**
69
77
  * 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.
70
78
  * @param filters (optional) Array of search filters
@@ -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.1.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
- };