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
@@ -0,0 +1,177 @@
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
+ /* eslint-disable camelcase */
16
+ const Base_1 = __importDefault(require("../../../Base"));
17
+ /**
18
+ * IdpOAuthDevice
19
+ *
20
+ * Client wrapper for OAuth 2.0 Device Authorization Grant (RFC 8628).
21
+ *
22
+ * This class provides methods to:
23
+ * - Initiate a device authorization request
24
+ * - Validate a user-provided code
25
+ * - Approve or reject a device authorization
26
+ * - Exchange a device code for an access token
27
+ *
28
+ * All methods support returning either the parsed response body or the raw Axios
29
+ * response via the `{ raw: true }` option.
30
+ *
31
+ * @extends Base
32
+ */
33
+ class IdpOAuthDevice extends Base_1.default {
34
+ /**
35
+ * Initiates the OAuth Device Authorization flow.
36
+ *
37
+ * This endpoint returns a `device_code` and `user_code` which should be:
38
+ * - Displayed to the user on the device
39
+ * - Entered by the user on a separate verification page
40
+ *
41
+ * @typeParam R - Whether to return the raw Axios response
42
+ *
43
+ * @param clientId - OAuth client identifier
44
+ * @param scope - Optional OAuth scope string (space-delimited)
45
+ * @param raw - Optional flag to return the raw Axios response
46
+ *
47
+ * @returns Device authorization response or raw Axios response
48
+ */
49
+ authorize(clientId, scope, raw) {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/login/oauth/device/authorize`), {
52
+ client_id: clientId,
53
+ scope,
54
+ }, { headers: { "Content-Type": "application/x-www-form-urlencoded" } });
55
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
56
+ });
57
+ }
58
+ /**
59
+ * Validates a user-entered device code.
60
+ *
61
+ * This is typically called by the authorization UI after the user enters
62
+ * the `user_code`. It returns public information about the requesting
63
+ * application and the requested scopes.
64
+ *
65
+ * @typeParam R - Whether to return the raw Axios response
66
+ *
67
+ * @param clientId - OAuth client identifier
68
+ * @param userCode - User-facing verification code
69
+ * @param raw - Optional flag to return the raw Axios response
70
+ *
71
+ * @returns Application public info and requested scopes
72
+ */
73
+ validateUserCode(clientId, userCode, raw) {
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ const resp = yield this.axios.get(this.getEndpoint(`/v1/login/oauth/device/authorize`), {
76
+ params: {
77
+ client_id: clientId,
78
+ user_code: userCode,
79
+ },
80
+ });
81
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
82
+ });
83
+ }
84
+ /**
85
+ * Approves or rejects a device authorization request.
86
+ *
87
+ * ⚠️ This endpoint requires an `Authorization` header to be set
88
+ * on the HCloud instance (e.g., a logged-in user session or access token).
89
+ *
90
+ * @typeParam R - Whether to return the raw Axios response
91
+ *
92
+ * @param clientId - OAuth client identifier
93
+ * @param userCode - User-facing verification code
94
+ * @param status - Authorization decision (`APPROVED` or `REJECTED`)
95
+ * @param raw - Optional flag to return the raw Axios response
96
+ *
97
+ * @throws Error if the Authorization header is not set
98
+ *
99
+ * @returns Void response or raw Axios response
100
+ */
101
+ decide(clientId, userCode, status, raw) {
102
+ return __awaiter(this, void 0, void 0, function* () {
103
+ if (this.axios.defaults.headers.common.Authorization === undefined && this.axios.defaults.headers.post.Authorization === undefined) {
104
+ throw new Error("this endpoint requires the authorization header to be set");
105
+ }
106
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/login/oauth/device/authorize/${clientId}/${userCode}`), {
107
+ status,
108
+ }, { headers: { "Content-Type": "application/json" } });
109
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
110
+ });
111
+ }
112
+ /**
113
+ * Approves a device authorization request.
114
+ *
115
+ * Shorthand for {@link decide} with status `"APPROVED"`.
116
+ *
117
+ * @typeParam R - Whether to return the raw Axios response
118
+ *
119
+ * @param clientId - OAuth client identifier
120
+ * @param userCode - User-facing verification code
121
+ * @param raw - Optional flag to return the raw Axios response
122
+ *
123
+ * @returns Void response or raw Axios response
124
+ */
125
+ approve(clientId, userCode, raw) {
126
+ return __awaiter(this, void 0, void 0, function* () {
127
+ return this.decide(clientId, userCode, "APPROVED", raw);
128
+ });
129
+ }
130
+ /**
131
+ * Rejects a device authorization request.
132
+ *
133
+ * Shorthand for {@link decide} with status `"REJECTED"`.
134
+ *
135
+ * @typeParam R - Whether to return the raw Axios response
136
+ *
137
+ * @param clientId - OAuth client identifier
138
+ * @param userCode - User-facing verification code
139
+ * @param raw - Optional flag to return the raw Axios response
140
+ *
141
+ * @returns Void response or raw Axios response
142
+ */
143
+ reject(clientId, userCode, raw) {
144
+ return __awaiter(this, void 0, void 0, function* () {
145
+ return this.decide(clientId, userCode, "REJECTED", raw);
146
+ });
147
+ }
148
+ /**
149
+ * Exchanges a device code for an access token.
150
+ *
151
+ * This endpoint may return HTTP 400 responses for non-fatal OAuth states
152
+ * such as `authorization_pending` or `slow_down`. These responses are
153
+ * returned normally and should be handled by the caller.
154
+ *
155
+ * @typeParam R - Whether to return the raw Axios response
156
+ *
157
+ * @param clientId - OAuth client identifier
158
+ * @param deviceCode - Device code obtained from {@link authorize}
159
+ * @param raw - Optional flag to return the raw Axios response
160
+ *
161
+ * @returns Device token response or raw Axios response
162
+ */
163
+ token(clientId, deviceCode, raw) {
164
+ return __awaiter(this, void 0, void 0, function* () {
165
+ const resp = yield this.axios.post(this.getEndpoint(`/v1/login/oauth/device/access_token`), {
166
+ client_id: clientId,
167
+ device_code: deviceCode,
168
+ grant_type: "urn:ietf:params:oauth:grant-type:device_code",
169
+ }, { headers: { "Content-Type": "application/x-www-form-urlencoded" }, validateStatus: status => status === 200 || status === 400 });
170
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
171
+ });
172
+ }
173
+ getEndpoint(endpoint) {
174
+ return `${this.options.server}/api/account${endpoint}`;
175
+ }
176
+ }
177
+ exports.default = IdpOAuthDevice;
@@ -1,7 +1,10 @@
1
1
  import Base, { MaybeRaw } from "../../../Base";
2
2
  import { OAuthToken, OAuthTokenRequest } from "../../../interfaces/idp/oauth";
3
3
  import { OAuthAppPublicInfo } from "../../../interfaces/idp/organization/settings/oauthApp";
4
+ import IdpOAuthDevice from "./device";
4
5
  export declare class IdpOAuth extends Base {
6
+ get device(): IdpOAuthDevice;
7
+ private _device?;
5
8
  /**
6
9
  * getAuthorizationCodeInsideRedirectUrl throws for an invalid request (query params do not match OAuthApp).
7
10
  * It returns the redirect URL with the code, which is used to redirect to the client application,
@@ -8,10 +8,20 @@ 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.IdpOAuth = void 0;
13
- const Base_1 = require("../../../Base");
16
+ const Base_1 = __importDefault(require("../../../Base"));
17
+ const device_1 = __importDefault(require("./device"));
14
18
  class IdpOAuth extends Base_1.default {
19
+ get device() {
20
+ if (this._device === undefined) {
21
+ this._device = new device_1.default(this.options, this.axios);
22
+ }
23
+ return this._device;
24
+ }
15
25
  /**
16
26
  * getAuthorizationCodeInsideRedirectUrl throws for an invalid request (query params do not match OAuthApp).
17
27
  * It returns the redirect URL with the code, which is used to redirect to the client application,
@@ -72,5 +72,14 @@ export declare class IdpOrganization extends Base {
72
72
  deleteOrganization<R extends boolean = false>(orgName: string, raw?: {
73
73
  raw: R;
74
74
  }): Promise<MaybeRaw<R, void>>;
75
+ /**
76
+ * Updates the avatar of the specified organization
77
+ * @param orgName Name of the organization
78
+ * @param file Image as Javascript File
79
+ * @returns Organization details with updated avatar
80
+ */
81
+ updateAvatar<R extends boolean = false>(orgName: string, file: File, raw?: {
82
+ raw: R;
83
+ }): Promise<MaybeRaw<R, Organization>>;
75
84
  protected getEndpoint(endpoint: string): string;
76
85
  }
@@ -8,13 +8,16 @@ 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.IdpOrganization = void 0;
13
- const Base_1 = require("../../../Base");
16
+ const Base_1 = __importDefault(require("../../../Base"));
14
17
  const license_1 = require("./license");
15
18
  const member_1 = require("./member");
16
- const service_accounts_1 = require("./service-accounts");
17
- const settings_1 = require("./settings");
19
+ const service_accounts_1 = __importDefault(require("./service-accounts"));
20
+ const settings_1 = __importDefault(require("./settings"));
18
21
  const stat_1 = require("./stat");
19
22
  const team_1 = require("./team");
20
23
  class IdpOrganization extends Base_1.default {
@@ -128,6 +131,22 @@ class IdpOrganization extends Base_1.default {
128
131
  return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
129
132
  });
130
133
  }
134
+ /**
135
+ * Updates the avatar of the specified organization
136
+ * @param orgName Name of the organization
137
+ * @param file Image as Javascript File
138
+ * @returns Organization details with updated avatar
139
+ */
140
+ updateAvatar(orgName, file, raw) {
141
+ return __awaiter(this, void 0, void 0, function* () {
142
+ const data = new FormData();
143
+ data.append("avatar", file);
144
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/avatar`), data, {
145
+ headers: { "Content-Type": "multipart/form-data" },
146
+ });
147
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
148
+ });
149
+ }
131
150
  getEndpoint(endpoint) {
132
151
  return `${this.options.server}/api/account${endpoint}`;
133
152
  }
@@ -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.IdpOrganizationLicense = void 0;
13
- const Base_1 = require("../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../Base"));
14
17
  class IdpOrganizationLicense extends Base_1.default {
15
18
  getLicense(orgName, raw) {
16
19
  return __awaiter(this, void 0, void 0, function* () {
@@ -8,12 +8,15 @@ 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.IdpOrganizationMember = 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
- const invitations_1 = require("./invitations");
19
+ const invitations_1 = __importDefault(require("./invitations"));
17
20
  class IdpOrganizationMember extends Base_1.default {
18
21
  get invitations() {
19
22
  if (this._invitations === undefined) {
@@ -36,6 +36,25 @@ export default class IdpOrganizationMemberInvitations extends Base {
36
36
  create<R extends boolean = false>(orgName: string, email: string, role: OrganizationRole, allowNonRegisteredUsers?: boolean, targetUrl?: string, raw?: {
37
37
  raw: R;
38
38
  }): Promise<MaybeRaw<R, OrganizationMemberInvitation>>;
39
+ /**
40
+ * Invites list of users to an Organization.
41
+ *
42
+ * @param orgName Name of the Organization
43
+ * @param users - List of users to be invited should contain the following data:
44
+ * - email of the person to be invited
45
+ * - the role they will have within the organization if they accept the invitation
46
+ * - allowNonRegisteredUsers Flag to determine if the invitation should go through in the case that the email is not bound to an Helmut Cloud user.
47
+ * If this is set to true and the email is unbound, then an email will be sent asking the person to register.
48
+ * When they do they will automatically join the organization.
49
+ * - targetUrl Optional url the link in the mail will point to
50
+ * @returns The list of created invitations
51
+ */
52
+ createList(orgName: string, users: Array<{
53
+ email: string;
54
+ role: OrganizationRole;
55
+ allowNonRegisteredUsers: false;
56
+ targetUrl?: string;
57
+ }>): Promise<OrganizationMemberInvitation[]>;
39
58
  /**
40
59
  * Accept an invitation.
41
60
  *
@@ -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 IdpOrganizationMemberInvitations extends Base_1.default {
@@ -60,6 +63,25 @@ class IdpOrganizationMemberInvitations extends Base_1.default {
60
63
  return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
61
64
  });
62
65
  }
66
+ /**
67
+ * Invites list of users to an Organization.
68
+ *
69
+ * @param orgName Name of the Organization
70
+ * @param users - List of users to be invited should contain the following data:
71
+ * - email of the person to be invited
72
+ * - the role they will have within the organization if they accept the invitation
73
+ * - allowNonRegisteredUsers Flag to determine if the invitation should go through in the case that the email is not bound to an Helmut Cloud user.
74
+ * If this is set to true and the email is unbound, then an email will be sent asking the person to register.
75
+ * When they do they will automatically join the organization.
76
+ * - targetUrl Optional url the link in the mail will point to
77
+ * @returns The list of created invitations
78
+ */
79
+ createList(orgName, users) {
80
+ return __awaiter(this, void 0, void 0, function* () {
81
+ const resp = yield this.axios.post(this.getEndpoint(`/${orgName}/members/invitations-list`), { users });
82
+ return resp.data;
83
+ });
84
+ }
63
85
  /**
64
86
  * Accept an invitation.
65
87
  *
@@ -17,7 +17,7 @@ export default class IdpOrganizationServiceAccounts extends Base {
17
17
  *
18
18
  * @param orgName {string} Organization name
19
19
  * @param id {string} Service account ID
20
- * @returns {void}
20
+ * @returns {ServiceAccountNoToken}
21
21
  */
22
22
  delete<R extends boolean = false>(orgName: string, id: string, raw?: {
23
23
  raw: R;
@@ -72,5 +72,15 @@ export default class IdpOrganizationServiceAccounts extends Base {
72
72
  rename<R extends boolean = false>(orgName: string, id: string, newName: string, raw?: {
73
73
  raw: R;
74
74
  }): Promise<MaybeRaw<R, ServiceAccountNoToken>>;
75
+ /**
76
+ * Updates the avatar of the specified service account
77
+ * @param orgName Name of the organization
78
+ * @param id {string} Service account ID
79
+ * @param file Image as Javascript File
80
+ * @returns Service account details with updated avatar
81
+ */
82
+ updateAvatar<R extends boolean = false>(orgName: string, id: string, file: File, raw?: {
83
+ raw: R;
84
+ }): Promise<MaybeRaw<R, void>>;
75
85
  protected getEndpoint(endpoint: string): string;
76
86
  }
@@ -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 IdpOrganizationServiceAccounts extends Base_1.default {
@@ -31,7 +34,7 @@ class IdpOrganizationServiceAccounts extends Base_1.default {
31
34
  *
32
35
  * @param orgName {string} Organization name
33
36
  * @param id {string} Service account ID
34
- * @returns {void}
37
+ * @returns {ServiceAccountNoToken}
35
38
  */
36
39
  delete(orgName, id, raw) {
37
40
  return __awaiter(this, void 0, void 0, function* () {
@@ -102,6 +105,23 @@ class IdpOrganizationServiceAccounts extends Base_1.default {
102
105
  return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
103
106
  });
104
107
  }
108
+ /**
109
+ * Updates the avatar of the specified service account
110
+ * @param orgName Name of the organization
111
+ * @param id {string} Service account ID
112
+ * @param file Image as Javascript File
113
+ * @returns Service account details with updated avatar
114
+ */
115
+ updateAvatar(orgName, id, file, raw) {
116
+ return __awaiter(this, void 0, void 0, function* () {
117
+ const data = new FormData();
118
+ data.append("avatar", file);
119
+ const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/service-accounts/${id}/avatar`), data, {
120
+ headers: { "Content-Type": "multipart/form-data" },
121
+ });
122
+ return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
123
+ });
124
+ }
105
125
  getEndpoint(endpoint) {
106
126
  return `${this.options.server}/api/account/v1/org${endpoint}`;
107
127
  }
@@ -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.IdpDomain = void 0;
13
- const Base_1 = require("../../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../../Base"));
14
17
  const saml_1 = require("./saml");
15
18
  class IdpDomain extends Base_1.default {
16
19
  /**
@@ -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.IdpSAMLProvider = void 0;
13
- const Base_1 = require("../../../../../../Base");
16
+ const Base_1 = __importDefault(require("../../../../../../Base"));
14
17
  class IdpSAMLProvider extends Base_1.default {
15
18
  constructor() {
16
19
  super(...arguments);
@@ -1,6 +1,9 @@
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");
6
+ const Base_1 = __importDefault(require("../../../../Base"));
4
7
  const domain_1 = require("./domain");
5
8
  const oauth_1 = require("./oauth");
6
9
  class IdpOrganizationSettings extends Base_1.default {
@@ -72,5 +72,15 @@ export declare class IdpOAuthApp extends Base {
72
72
  deleteOAuthAppSecret<R extends boolean = false>(orgName: string, oauthAppId: string, secret: string, raw?: {
73
73
  raw: R;
74
74
  }): Promise<MaybeRaw<R, OAuthApp>>;
75
+ /**
76
+ * Updates the avatar of the specified OAuth App
77
+ * @param orgName Name of the organization
78
+ * @param oauthAppId ID of the OAuthApp
79
+ * @param file Image as Javascript File
80
+ * @returns OAuth App details with updated avatar
81
+ */
82
+ updateAvatar<R extends boolean = false>(orgName: string, oauthAppId: string, file: File, raw?: {
83
+ raw: R;
84
+ }): Promise<MaybeRaw<R, OAuthApp>>;
75
85
  protected getEndpoint(endpoint: string): string;
76
86
  }
@@ -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