hcloud-sdk 14.13.2 → 16.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 (181) hide show
  1. package/changelog.md +60 -806
  2. package/lib/Hcloud.d.ts +20 -10
  3. package/lib/Hcloud.js +60 -10
  4. package/lib/interfaces/auditor/index.d.ts +4 -2
  5. package/lib/interfaces/bouncer/features/index.d.ts +3 -6
  6. package/lib/interfaces/frontend/featureflags/index.d.ts +7 -0
  7. package/lib/interfaces/frontend/featureflags/index.js +2 -0
  8. package/lib/interfaces/high5/execution/index.d.ts +22 -0
  9. package/lib/interfaces/high5/execution/index.js +10 -0
  10. package/lib/interfaces/high5/index.d.ts +2 -2
  11. package/lib/interfaces/high5/index.js +2 -2
  12. package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +1 -0
  13. package/lib/interfaces/high5/space/event/stream/node/index.d.ts +16 -1
  14. package/lib/interfaces/high5/space/execution/index.d.ts +14 -0
  15. package/lib/interfaces/high5/space/pool/index.d.ts +30 -0
  16. package/lib/interfaces/high5/space/pool/index.js +9 -0
  17. package/lib/interfaces/high5/wave/changelog.d.ts +30 -0
  18. package/lib/interfaces/high5/wave/changelog.js +18 -0
  19. package/lib/interfaces/high5/wave/index.d.ts +48 -1
  20. package/lib/interfaces/high5/wave/index.js +14 -1
  21. package/lib/interfaces/idp/organization/member/index.d.ts +2 -0
  22. package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +1 -0
  23. package/lib/interfaces/idp/user/GeneralSettings.d.ts +1 -0
  24. package/lib/interfaces/idp/user/Scopes.d.ts +1 -0
  25. package/lib/interfaces/idp/user/Scopes.js +21 -1
  26. package/lib/interfaces/idp/user/Totp.d.ts +4 -2
  27. package/lib/interfaces/idp/user/index.d.ts +1 -0
  28. package/lib/interfaces/mothership/index.d.ts +1 -0
  29. package/lib/interfaces/nats/index.d.ts +35 -20
  30. package/lib/interfaces/nats/index.js +132 -94
  31. package/lib/service/agent/bundle/dev/index.d.ts +5 -2
  32. package/lib/service/agent/bundle/dev/index.js +30 -10
  33. package/lib/service/agent/context/index.d.ts +7 -9
  34. package/lib/service/agent/context/index.js +41 -32
  35. package/lib/service/agent/index.d.ts +9 -7
  36. package/lib/service/agent/index.js +23 -6
  37. package/lib/service/auditor/index.d.ts +6 -7
  38. package/lib/service/auditor/index.js +23 -17
  39. package/lib/service/auditor/internal/index.d.ts +2 -2
  40. package/lib/service/auditor/internal/index.js +24 -20
  41. package/lib/service/bouncer/features/index.d.ts +1 -1
  42. package/lib/service/bouncer/features/index.js +5 -3
  43. package/lib/service/bouncer/index.d.ts +3 -10
  44. package/lib/service/bouncer/index.js +6 -21
  45. package/lib/service/dali/DaliAvatar.d.ts +21 -11
  46. package/lib/service/dali/DaliAvatar.js +63 -8
  47. package/lib/service/dali/avatar/DaliFuseSpace.d.ts +5 -7
  48. package/lib/service/dali/avatar/DaliFuseSpace.js +29 -26
  49. package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +29 -0
  50. package/lib/service/dali/avatar/DaliHigh5Pool.js +61 -0
  51. package/lib/service/dali/avatar/DaliHigh5Space.d.ts +5 -7
  52. package/lib/service/dali/avatar/DaliHigh5Space.js +29 -26
  53. package/lib/service/dali/avatar/DaliOAuthApp.d.ts +4 -6
  54. package/lib/service/dali/avatar/DaliOAuthApp.js +26 -23
  55. package/lib/service/dali/avatar/DaliOrganization.d.ts +4 -6
  56. package/lib/service/dali/avatar/DaliOrganization.js +23 -20
  57. package/lib/service/dali/avatar/DaliTeam.d.ts +4 -6
  58. package/lib/service/dali/avatar/DaliTeam.js +26 -23
  59. package/lib/service/dali/avatar/DaliUser.d.ts +4 -6
  60. package/lib/service/dali/avatar/DaliUser.js +20 -17
  61. package/lib/service/dali/index.d.ts +4 -5
  62. package/lib/service/dali/index.js +14 -7
  63. package/lib/service/fuse/index.d.ts +8 -7
  64. package/lib/service/fuse/index.js +23 -9
  65. package/lib/service/fuse/internal/index.d.ts +3 -4
  66. package/lib/service/fuse/internal/index.js +5 -3
  67. package/lib/service/fuse/internal/space/cronjob/index.d.ts +3 -4
  68. package/lib/service/fuse/internal/space/cronjob/index.js +5 -3
  69. package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +2 -4
  70. package/lib/service/fuse/internal/space/cronjob/log/index.js +11 -12
  71. package/lib/service/fuse/internal/space/index.d.ts +5 -6
  72. package/lib/service/fuse/internal/space/index.js +24 -18
  73. package/lib/service/fuse/space/cronjob/index.d.ts +15 -15
  74. package/lib/service/fuse/space/cronjob/index.js +133 -105
  75. package/lib/service/fuse/space/cronjob/log/index.d.ts +3 -3
  76. package/lib/service/fuse/space/cronjob/log/index.js +24 -23
  77. package/lib/service/fuse/space/index.d.ts +13 -14
  78. package/lib/service/fuse/space/index.js +88 -70
  79. package/lib/service/high5/execution/index.d.ts +13 -5
  80. package/lib/service/high5/execution/index.js +32 -4
  81. package/lib/service/high5/execution/log/index.d.ts +2 -2
  82. package/lib/service/high5/execution/log/index.js +11 -12
  83. package/lib/service/high5/execution/status/index.d.ts +2 -2
  84. package/lib/service/high5/execution/status/index.js +11 -12
  85. package/lib/service/high5/index.d.ts +12 -9
  86. package/lib/service/high5/index.js +36 -12
  87. package/lib/service/high5/internal/index.d.ts +3 -4
  88. package/lib/service/high5/internal/index.js +5 -3
  89. package/lib/service/high5/internal/space/index.d.ts +2 -2
  90. package/lib/service/high5/internal/space/index.js +19 -15
  91. package/lib/service/high5/joinToken/index.d.ts +4 -4
  92. package/lib/service/high5/joinToken/index.js +36 -28
  93. package/lib/service/high5/space/event/index.d.ts +9 -10
  94. package/lib/service/high5/space/event/index.js +58 -46
  95. package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +1 -2
  96. package/lib/service/high5/space/event/stream/design/DesignOperations.js +2 -0
  97. package/lib/service/high5/space/event/stream/design/index.d.ts +23 -8
  98. package/lib/service/high5/space/event/stream/design/index.js +60 -25
  99. package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +5 -5
  100. package/lib/service/high5/space/event/stream/design/snapshot/index.js +65 -58
  101. package/lib/service/high5/space/event/stream/index.d.ts +14 -15
  102. package/lib/service/high5/space/event/stream/index.js +125 -103
  103. package/lib/service/high5/space/execution/index.d.ts +36 -9
  104. package/lib/service/high5/space/execution/index.js +96 -42
  105. package/lib/service/high5/space/execution/log/index.d.ts +4 -6
  106. package/lib/service/high5/space/execution/log/index.js +22 -21
  107. package/lib/service/high5/space/execution/status/index.d.ts +1 -1
  108. package/lib/service/high5/space/execution/status/index.js +10 -8
  109. package/lib/service/high5/space/index.d.ts +28 -21
  110. package/lib/service/high5/space/index.js +138 -86
  111. package/lib/service/high5/space/pool/index.d.ts +97 -0
  112. package/lib/service/high5/space/pool/index.js +171 -0
  113. package/lib/service/high5/space/secret/index.d.ts +6 -6
  114. package/lib/service/high5/space/secret/index.js +59 -49
  115. package/lib/service/high5/space/wave/index.d.ts +7 -9
  116. package/lib/service/high5/space/wave/index.js +40 -33
  117. package/lib/service/high5/space/webhook/index.d.ts +21 -14
  118. package/lib/service/high5/space/webhook/index.js +106 -73
  119. package/lib/service/high5/space/webhook/log/index.d.ts +2 -4
  120. package/lib/service/high5/space/webhook/log/index.js +11 -12
  121. package/lib/service/high5/wave/s3/index.d.ts +14 -7
  122. package/lib/service/high5/wave/s3/index.js +64 -38
  123. package/lib/service/idp/index.d.ts +17 -15
  124. package/lib/service/idp/index.js +104 -56
  125. package/lib/service/idp/internal/index.d.ts +2 -4
  126. package/lib/service/idp/internal/index.js +10 -11
  127. package/lib/service/idp/oauth/index.d.ts +16 -12
  128. package/lib/service/idp/oauth/index.js +56 -45
  129. package/lib/service/idp/organization/index.d.ts +12 -10
  130. package/lib/service/idp/organization/index.js +63 -28
  131. package/lib/service/idp/organization/license/index.d.ts +2 -2
  132. package/lib/service/idp/organization/license/index.js +5 -4
  133. package/lib/service/idp/organization/member/index.d.ts +10 -11
  134. package/lib/service/idp/organization/member/index.js +62 -48
  135. package/lib/service/idp/organization/member/invitations/index.d.ts +3 -3
  136. package/lib/service/idp/organization/member/invitations/index.js +47 -43
  137. package/lib/service/idp/organization/settings/domain/index.d.ts +7 -8
  138. package/lib/service/idp/organization/settings/domain/index.js +42 -29
  139. package/lib/service/idp/organization/settings/domain/saml/index.d.ts +5 -5
  140. package/lib/service/idp/organization/settings/domain/saml/index.js +58 -48
  141. package/lib/service/idp/organization/settings/index.d.ts +5 -5
  142. package/lib/service/idp/organization/settings/index.js +17 -4
  143. package/lib/service/idp/organization/settings/oauth/index.d.ts +9 -11
  144. package/lib/service/idp/organization/settings/oauth/index.js +67 -56
  145. package/lib/service/idp/organization/team/index.d.ts +8 -8
  146. package/lib/service/idp/organization/team/index.js +64 -55
  147. package/lib/service/idp/registration/index.d.ts +4 -6
  148. package/lib/service/idp/registration/index.js +38 -35
  149. package/lib/service/idp/user/index.d.ts +20 -15
  150. package/lib/service/idp/user/index.js +94 -51
  151. package/lib/service/idp/user/license/index.d.ts +2 -2
  152. package/lib/service/idp/user/license/index.js +5 -4
  153. package/lib/service/idp/user/password/index.d.ts +1 -1
  154. package/lib/service/idp/user/password/index.js +10 -11
  155. package/lib/service/idp/user/settings/connections/index.d.ts +2 -4
  156. package/lib/service/idp/user/settings/connections/index.js +9 -10
  157. package/lib/service/idp/user/settings/general/index.d.ts +10 -6
  158. package/lib/service/idp/user/settings/general/index.js +25 -13
  159. package/lib/service/idp/user/settings/index.d.ts +13 -9
  160. package/lib/service/idp/user/settings/index.js +53 -8
  161. package/lib/service/idp/user/settings/notifications/index.d.ts +3 -5
  162. package/lib/service/idp/user/settings/notifications/index.js +14 -13
  163. package/lib/service/idp/user/settings/oauthApps/index.d.ts +3 -5
  164. package/lib/service/idp/user/settings/oauthApps/index.js +17 -16
  165. package/lib/service/idp/user/settings/pats/index.d.ts +8 -10
  166. package/lib/service/idp/user/settings/pats/index.js +55 -44
  167. package/lib/service/idp/user/settings/twoFactor/index.d.ts +3 -4
  168. package/lib/service/idp/user/settings/twoFactor/index.js +8 -3
  169. package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +7 -9
  170. package/lib/service/idp/user/settings/twoFactor/totp/index.js +36 -29
  171. package/lib/service/mailer/index.d.ts +4 -5
  172. package/lib/service/mailer/index.js +12 -8
  173. package/lib/service/mailer/internal/index.d.ts +4 -4
  174. package/lib/service/mailer/internal/index.js +38 -33
  175. package/lib/service/mothership/index.d.ts +12 -12
  176. package/lib/service/mothership/index.js +92 -79
  177. package/lib/service/nats/index.d.ts +1 -3
  178. package/lib/service/nats/index.js +2 -2
  179. package/lib/utils/bouncer/features/Provider.d.ts +3 -0
  180. package/lib/utils/bouncer/features/Provider.js +20 -2
  181. package/package.json +1 -1
@@ -15,20 +15,22 @@ const searchFilter_1 = require("../../../../helper/searchFilter");
15
15
  class High5Secret extends Base_1.default {
16
16
  constructor(options, axios) {
17
17
  super(options, axios);
18
- /**
19
- * Requests all secret keys of the provided space which match the search filter(s) (paginated request).
20
- * Only the keys of the secret are sent back in the response by default, not the actual encrypted values.
21
- * Will return all secrets of the space if no filter is provided.
22
- * @param orgName - Name of the organization
23
- * @param spaceName - Name of the space
24
- * @param filters (optional) Array of search filters
25
- * @param sorting (optional) Sorting object
26
- * @param limit - (optional) Max number of results (1-100; defaults to 25)
27
- * @param page - (optional) Page number: Skip the first (page * limit) results (defaults to 0)
28
- * @param encrypted - (optional) Whether to get all secret values only in encrypted form.
29
- * @returns Object containing an array of secret keys as well as the total number of results found in the database (independent of limit and page)
30
- */
31
- this.searchSecrets = (_a) => __awaiter(this, [_a], void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, }) {
18
+ }
19
+ /**
20
+ * Requests all secret keys of the provided space which match the search filter(s) (paginated request).
21
+ * Only the keys of the secret are sent back in the response by default, not the actual encrypted values.
22
+ * Will return all secrets of the space if no filter is provided.
23
+ * @param orgName - Name of the organization
24
+ * @param spaceName - Name of the space
25
+ * @param filters (optional) Array of search filters
26
+ * @param sorting (optional) Sorting object
27
+ * @param limit - (optional) Max number of results (1-100; defaults to 25)
28
+ * @param page - (optional) Page number: Skip the first (page * limit) results (defaults to 0)
29
+ * @param encrypted - (optional) Whether to get all secret values only in encrypted form.
30
+ * @returns Object containing an array of secret keys as well as the total number of results found in the database (independent of limit and page)
31
+ */
32
+ searchSecrets(_a) {
33
+ return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, }) {
32
34
  const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
33
35
  return new searchFilter_1.SearchFilterDTO(f);
34
36
  });
@@ -38,49 +40,57 @@ class High5Secret extends Base_1.default {
38
40
  });
39
41
  return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
40
42
  });
41
- /**
42
- * Adds a secret key-value pair to a space.
43
- * @param orgName - Name of the organization
44
- * @param spaceName - Name of the space
45
- * @param key - Key of the key-value pair
46
- * @param value - Value of the key-value pair
47
- * @param encrypted - (optional) Boolean defining if the value should be stored encrypted (defaults to false).
48
- * @returns The created Secret
49
- */
50
- this.addSecret = (orgName, spaceName, secret) => __awaiter(this, void 0, void 0, function* () {
43
+ }
44
+ /**
45
+ * Adds a secret key-value pair to a space.
46
+ * @param orgName - Name of the organization
47
+ * @param spaceName - Name of the space
48
+ * @param key - Key of the key-value pair
49
+ * @param value - Value of the key-value pair
50
+ * @param encrypted - (optional) Boolean defining if the value should be stored encrypted (defaults to false).
51
+ * @returns The created Secret
52
+ */
53
+ addSecret(orgName, spaceName, secret) {
54
+ return __awaiter(this, void 0, void 0, function* () {
51
55
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/secrets`), secret);
52
56
  return resp.data;
53
57
  });
54
- /**
55
- * Updates the value for an existent secret key-value pair.
56
- * @param orgName - Name of the organization
57
- * @param spaceName - Name of the space
58
- * @param key - Key of the key-value pair
59
- * @param value - The new value of the key-value pair
60
- * @param encrypted - (optional) Boolean defining if the value should be stored encrypted (defaults to false).
61
- * @returns The updated Secret
62
- */
63
- this.updateSecret = (orgName, spaceName, key, secret) => __awaiter(this, void 0, void 0, function* () {
58
+ }
59
+ /**
60
+ * Updates the value for an existent secret key-value pair.
61
+ * @param orgName - Name of the organization
62
+ * @param spaceName - Name of the space
63
+ * @param key - Key of the key-value pair
64
+ * @param value - The new value of the key-value pair
65
+ * @param encrypted - (optional) Boolean defining if the value should be stored encrypted (defaults to false).
66
+ * @returns The updated Secret
67
+ */
68
+ updateSecret(orgName, spaceName, key, secret) {
69
+ return __awaiter(this, void 0, void 0, function* () {
64
70
  const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/secrets/${key}`), secret);
65
71
  return resp.data;
66
72
  });
67
- /**
68
- * Deletes a key-value pair of the space
69
- * @param orgName - Name of the organization
70
- * @param spaceName - Name of the space
71
- * @param key - Key of the key-value pair
72
- */
73
- this.deleteSecret = (orgName, spaceName, key) => __awaiter(this, void 0, void 0, function* () {
73
+ }
74
+ /**
75
+ * Deletes a key-value pair of the space
76
+ * @param orgName - Name of the organization
77
+ * @param spaceName - Name of the space
78
+ * @param key - Key of the key-value pair
79
+ */
80
+ deleteSecret(orgName, spaceName, key) {
81
+ return __awaiter(this, void 0, void 0, function* () {
74
82
  yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/secrets/${key}`));
75
83
  });
76
- /**
77
- * Get secret value by its key
78
- * @param orgName - Name of the organization
79
- * @param spaceName - Name of the space
80
- * @param key - Key of the key-value pair
81
- * @returns Secret details
82
- */
83
- this.getSecret = (orgName, spaceName, key) => __awaiter(this, void 0, void 0, function* () {
84
+ }
85
+ /**
86
+ * Get secret value by its key
87
+ * @param orgName - Name of the organization
88
+ * @param spaceName - Name of the space
89
+ * @param key - Key of the key-value pair
90
+ * @returns Secret details
91
+ */
92
+ getSecret(orgName, spaceName, key) {
93
+ return __awaiter(this, void 0, void 0, function* () {
84
94
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/secrets/${key}`));
85
95
  return resp.data;
86
96
  });
@@ -1,8 +1,6 @@
1
- import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../../Base";
1
+ import Base from "../../../../Base";
3
2
  import { SpacePatchWaveCatalog, SpacePatchWaveEngine, WaveCatalog, WaveEngine } from "../../../../interfaces/high5";
4
3
  export default class High5Wave extends Base {
5
- constructor(options: Options, axios: AxiosInstance);
6
4
  /**
7
5
  * Patch wave engine version for a space
8
6
  * @param orgName - Name of the organization
@@ -10,29 +8,29 @@ export default class High5Wave extends Base {
10
8
  * @param spacePatchWaveEngine - Patch wave engine object holding url and version
11
9
  * @returns WaveEngine object
12
10
  */
13
- patchSpaceWaveEngine: (orgName: string, spaceName: string, spacePatchWaveEngine: SpacePatchWaveEngine) => Promise<WaveEngine>;
11
+ patchSpaceWaveEngine(orgName: string, spaceName: string, spacePatchWaveEngine: SpacePatchWaveEngine): Promise<WaveEngine>;
14
12
  /**
15
13
  * Get wave engine version currently active for the space
16
14
  * @param orgName - Name of the organization
17
15
  * @param spaceName - Name of the space
18
16
  * @returns WaveEngine object
19
17
  */
20
- getSpaceWaveEngine: (orgName: string, spaceName: string) => Promise<WaveEngine>;
18
+ getSpaceWaveEngine(orgName: string, spaceName: string): Promise<WaveEngine>;
21
19
  /**
22
20
  * Adds a new wave catalog version for a space or updates existing
23
21
  * @param orgName - Name of the organization
24
22
  * @param spaceName - Name of the space
25
- * @param spacePatchWaveCatalog - Patch wave catalog object holding url and version
23
+ * @param spacePatchWaveCatalog - Patch wave catalog object holding url, version and optionally a minimumEngineVersion
26
24
  * @returns WaveCatalog object
27
25
  */
28
- addUpdateSpaceWaveCatalog: (orgName: string, spaceName: string, spacePatchCatalog: SpacePatchWaveCatalog) => Promise<WaveCatalog>;
26
+ addUpdateSpaceWaveCatalog(orgName: string, spaceName: string, spacePatchCatalog: SpacePatchWaveCatalog): Promise<WaveCatalog>;
29
27
  /**
30
28
  * Get wave catalogs currently active for the space
31
29
  * @param orgName - Name of the organization
32
30
  * @param spaceName - Name of the space
33
31
  * @returns WaveCatalog array
34
32
  */
35
- getSpaceWaveCatalogs: (orgName: string, spaceName: string) => Promise<WaveCatalog[]>;
36
- deleteSpaceWaveCatalog: (orgName: string, spaceName: string, catalogId: string) => Promise<void>;
33
+ getSpaceWaveCatalogs(orgName: string, spaceName: string): Promise<WaveCatalog[]>;
34
+ deleteSpaceWaveCatalog(orgName: string, spaceName: string, catalogId: string): Promise<void>;
37
35
  protected getEndpoint(endpoint: string): string;
38
36
  }
@@ -11,51 +11,58 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const Base_1 = require("../../../../Base");
13
13
  class High5Wave extends Base_1.default {
14
- constructor(options, axios) {
15
- super(options, axios);
16
- /**
17
- * Patch wave engine version for a space
18
- * @param orgName - Name of the organization
19
- * @param spaceName - Name of the space
20
- * @param spacePatchWaveEngine - Patch wave engine object holding url and version
21
- * @returns WaveEngine object
22
- */
23
- this.patchSpaceWaveEngine = (orgName, spaceName, spacePatchWaveEngine) => __awaiter(this, void 0, void 0, function* () {
14
+ /**
15
+ * Patch wave engine version for a space
16
+ * @param orgName - Name of the organization
17
+ * @param spaceName - Name of the space
18
+ * @param spacePatchWaveEngine - Patch wave engine object holding url and version
19
+ * @returns WaveEngine object
20
+ */
21
+ patchSpaceWaveEngine(orgName, spaceName, spacePatchWaveEngine) {
22
+ return __awaiter(this, void 0, void 0, function* () {
24
23
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/wave/engine`), spacePatchWaveEngine);
25
24
  return resp.data;
26
25
  });
27
- /**
28
- * Get wave engine version currently active for the space
29
- * @param orgName - Name of the organization
30
- * @param spaceName - Name of the space
31
- * @returns WaveEngine object
32
- */
33
- this.getSpaceWaveEngine = (orgName, spaceName) => __awaiter(this, void 0, void 0, function* () {
26
+ }
27
+ /**
28
+ * Get wave engine version currently active for the space
29
+ * @param orgName - Name of the organization
30
+ * @param spaceName - Name of the space
31
+ * @returns WaveEngine object
32
+ */
33
+ getSpaceWaveEngine(orgName, spaceName) {
34
+ return __awaiter(this, void 0, void 0, function* () {
34
35
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/wave/engine`));
35
36
  return resp.data;
36
37
  });
37
- /**
38
- * Adds a new wave catalog version for a space or updates existing
39
- * @param orgName - Name of the organization
40
- * @param spaceName - Name of the space
41
- * @param spacePatchWaveCatalog - Patch wave catalog object holding url and version
42
- * @returns WaveCatalog object
43
- */
44
- this.addUpdateSpaceWaveCatalog = (orgName, spaceName, spacePatchCatalog) => __awaiter(this, void 0, void 0, function* () {
38
+ }
39
+ /**
40
+ * Adds a new wave catalog version for a space or updates existing
41
+ * @param orgName - Name of the organization
42
+ * @param spaceName - Name of the space
43
+ * @param spacePatchWaveCatalog - Patch wave catalog object holding url, version and optionally a minimumEngineVersion
44
+ * @returns WaveCatalog object
45
+ */
46
+ addUpdateSpaceWaveCatalog(orgName, spaceName, spacePatchCatalog) {
47
+ return __awaiter(this, void 0, void 0, function* () {
45
48
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/wave/catalog`), spacePatchCatalog);
46
49
  return resp.data;
47
50
  });
48
- /**
49
- * Get wave catalogs currently active for the space
50
- * @param orgName - Name of the organization
51
- * @param spaceName - Name of the space
52
- * @returns WaveCatalog array
53
- */
54
- this.getSpaceWaveCatalogs = (orgName, spaceName) => __awaiter(this, void 0, void 0, function* () {
51
+ }
52
+ /**
53
+ * Get wave catalogs currently active for the space
54
+ * @param orgName - Name of the organization
55
+ * @param spaceName - Name of the space
56
+ * @returns WaveCatalog array
57
+ */
58
+ getSpaceWaveCatalogs(orgName, spaceName) {
59
+ return __awaiter(this, void 0, void 0, function* () {
55
60
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/wave/catalog`));
56
61
  return resp.data;
57
62
  });
58
- this.deleteSpaceWaveCatalog = (orgName, spaceName, catalogId) => __awaiter(this, void 0, void 0, function* () {
63
+ }
64
+ deleteSpaceWaveCatalog(orgName, spaceName, catalogId) {
65
+ return __awaiter(this, void 0, void 0, function* () {
59
66
  yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/wave/catalog/${catalogId}`));
60
67
  });
61
68
  }
@@ -1,11 +1,10 @@
1
- import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../../Base";
1
+ import Base from "../../../../Base";
3
2
  import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
4
3
  import { KeyValuePair, Webhook, WebhookCreate, WebhookUpdate } from "../../../../interfaces/high5/space/webhook";
5
4
  import { High5WebhookLog } from "./log";
6
5
  export declare class High5Webhook extends Base {
7
- log: High5WebhookLog;
8
- constructor(options: Options, axios: AxiosInstance);
6
+ get log(): High5WebhookLog;
7
+ private _log?;
9
8
  /**
10
9
  * Retrieves all Webhooks of the specified space that match the provided search filter(s). Will return all Webhooks if no search filter is provided.
11
10
  * @param orgName Name of the organization
@@ -16,10 +15,10 @@ export declare class High5Webhook extends Base {
16
15
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
17
16
  * @returns Object containing an array of Webhooks and the total number of results found in the database (independent of limit and page)
18
17
  */
19
- searchWebhooks: ({ orgName, spaceName, filters, sorting, limit, page, }: SearchParams & {
18
+ searchWebhooks({ orgName, spaceName, filters, sorting, limit, page, }: SearchParams & {
20
19
  orgName: string;
21
20
  spaceName: string;
22
- }) => Promise<PaginatedResponse<Webhook>>;
21
+ }): Promise<PaginatedResponse<Webhook>>;
23
22
  /**
24
23
  * Requests a Webhhok by its ID.
25
24
  * @param orgName Name of the Organization
@@ -27,7 +26,7 @@ export declare class High5Webhook extends Base {
27
26
  * @param webhookId ID of the Webhook
28
27
  * @returns The requested Webhook
29
28
  */
30
- getWebhook: (orgName: string, spaceName: string, webhookId: string) => Promise<Webhook>;
29
+ getWebhook(orgName: string, spaceName: string, webhookId: string): Promise<Webhook>;
31
30
  /**
32
31
  * Generates a new URL for the specified Webhook. This is suggested if a leak of the current URL is likely.
33
32
  * @param orgName Name of the Organization
@@ -35,7 +34,7 @@ export declare class High5Webhook extends Base {
35
34
  * @param webhookId ID of the Webhook
36
35
  * @returns The updated Webhook
37
36
  */
38
- regenerateWebhookUrl: (orgName: string, spaceName: string, webhookId: string) => Promise<Webhook>;
37
+ regenerateWebhookUrl(orgName: string, spaceName: string, webhookId: string): Promise<Webhook>;
39
38
  /**
40
39
  * Creates a new Webhook in the specified High5 space.
41
40
  * @param orgName Name of the Organization
@@ -43,7 +42,7 @@ export declare class High5Webhook extends Base {
43
42
  * @param WebhookCreate Object/JSON containing the name, token, eventId, spaceId, target and (optionally) security headers for the new webhook
44
43
  * @returns The created Webhook
45
44
  */
46
- createWebhook: (orgName: string, spaceName: string, WebhookCreate: WebhookCreate) => Promise<Webhook>;
45
+ createWebhook(orgName: string, spaceName: string, WebhookCreate: WebhookCreate): Promise<Webhook>;
47
46
  /**
48
47
  * Updates an existing Webhook.
49
48
  * @param orgName Name of the Organization
@@ -52,32 +51,40 @@ export declare class High5Webhook extends Base {
52
51
  * @param WebhookCreate Object/JSON containing the name, token, eventId, spaceId, target and (optionally) security headers for the updated webhook
53
52
  * @returns the updated Webhook
54
53
  */
55
- updateWebhook: (orgName: string, spaceName: string, webhookId: string, webhookUpdate: WebhookUpdate) => Promise<Webhook>;
54
+ updateWebhook(orgName: string, spaceName: string, webhookId: string, webhookUpdate: WebhookUpdate): Promise<Webhook>;
56
55
  /**
57
56
  * Deletes a Webhook by its ID.
58
57
  * @param orgName Name of the Organization
59
58
  * @param spaceName Name of the Space
60
59
  * @param webhookId ID of the webhook to be deleted
61
60
  */
62
- deleteWebhook: (orgName: string, spaceName: string, webhookId: string) => Promise<void>;
61
+ deleteWebhook(orgName: string, spaceName: string, webhookId: string): Promise<void>;
63
62
  /**
64
63
  * Executes all Events and Streams connected to the specified Webhook.
65
64
  * @param webhookUrl URL of the webhook to be triggered / executed
66
65
  */
67
- triggerWebhook: (webhookUrl: string) => Promise<void>;
66
+ triggerWebhook(webhookUrl: string): Promise<void>;
68
67
  /**
69
68
  * Executes a webhook by its URL.
70
69
  * @param webhookUrl Webhook URL to be triggered / executed (your hcloud domain + webhook.relativeUrl)
71
70
  * @param payload Payload to be used in the event execution that will be triggered by the webhook, as JSON.
72
71
  * @param headers (optional) Security headers.
73
72
  */
74
- executeWebhookByUrl: (webhookUrl: string, payload: unknown, headers?: KeyValuePair<string>) => Promise<void>;
73
+ executeWebhookByUrl(webhookUrl: string, payload: unknown, headers?: KeyValuePair<string>): Promise<void>;
74
+ /**
75
+ * Respond to a webhook via callback.
76
+ * @param callbackURL Full or partial URL callback URL. This URL is unique per webhook execution
77
+ * @param status HTTP status code to send in the response
78
+ * @param headers (optional) HTTP headers to send in the response
79
+ * @param body (optional) Body to send in the HTTP response
80
+ */
81
+ respondToWebhook(callbackURL: string, status: number, headers?: Record<string, string | string[]>, body?: string): Promise<void>;
75
82
  /**
76
83
  * Validates the provided webhook URL by sending a challenge query parameter.
77
84
  * @param url Webhook URL to be validated (your hcloud domain + webhook.relativeUrl)
78
85
  * @param challenge String to be returned
79
86
  * @returns The provided challenge string as plaint text
80
87
  */
81
- validateWebhookUrl: (webhookUrl: string, challenge: string) => Promise<string>;
88
+ validateWebhookUrl(webhookUrl: string, challenge: string): Promise<string>;
82
89
  protected getEndpoint(endpoint: string): string;
83
90
  }
@@ -15,19 +15,24 @@ const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseH
15
15
  const searchFilter_1 = require("../../../../helper/searchFilter");
16
16
  const log_1 = require("./log");
17
17
  class High5Webhook extends Base_1.default {
18
- constructor(options, axios) {
19
- super(options, axios);
20
- /**
21
- * Retrieves all Webhooks of the specified space that match the provided search filter(s). Will return all Webhooks if no search filter is provided.
22
- * @param orgName Name of the organization
23
- * @param spaceName Name of the space
24
- * @param filters (optional) Array of search filters
25
- * @param sorting (optional) Sorting object
26
- * @param limit (optional) Max number of results (1-100; defaults to 25)
27
- * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
28
- * @returns Object containing an array of Webhooks and the total number of results found in the database (independent of limit and page)
29
- */
30
- this.searchWebhooks = (_a) => __awaiter(this, [_a], void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, }) {
18
+ get log() {
19
+ if (this._log === undefined) {
20
+ this._log = new log_1.High5WebhookLog(this.options, this.axios);
21
+ }
22
+ return this._log;
23
+ }
24
+ /**
25
+ * Retrieves all Webhooks of the specified space that match the provided search filter(s). Will return all Webhooks if no search filter is provided.
26
+ * @param orgName Name of the organization
27
+ * @param spaceName Name of the space
28
+ * @param filters (optional) Array of search filters
29
+ * @param sorting (optional) Sorting object
30
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
31
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
32
+ * @returns Object containing an array of Webhooks and the total number of results found in the database (independent of limit and page)
33
+ */
34
+ searchWebhooks(_a) {
35
+ return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, }) {
31
36
  const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
32
37
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks/search?limit=${limit}&page=${page}`), {
33
38
  filters: filtersDTO,
@@ -35,74 +40,88 @@ class High5Webhook extends Base_1.default {
35
40
  });
36
41
  return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
37
42
  });
38
- /**
39
- * Requests a Webhhok by its ID.
40
- * @param orgName Name of the Organization
41
- * @param spaceName Name of the Space
42
- * @param webhookId ID of the Webhook
43
- * @returns The requested Webhook
44
- */
45
- this.getWebhook = (orgName, spaceName, webhookId) => __awaiter(this, void 0, void 0, function* () {
43
+ }
44
+ /**
45
+ * Requests a Webhhok by its ID.
46
+ * @param orgName Name of the Organization
47
+ * @param spaceName Name of the Space
48
+ * @param webhookId ID of the Webhook
49
+ * @returns The requested Webhook
50
+ */
51
+ getWebhook(orgName, spaceName, webhookId) {
52
+ return __awaiter(this, void 0, void 0, function* () {
46
53
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks/${webhookId}`));
47
54
  return resp.data;
48
55
  });
49
- /**
50
- * Generates a new URL for the specified Webhook. This is suggested if a leak of the current URL is likely.
51
- * @param orgName Name of the Organization
52
- * @param spaceName Name of the Space
53
- * @param webhookId ID of the Webhook
54
- * @returns The updated Webhook
55
- */
56
- this.regenerateWebhookUrl = (orgName, spaceName, webhookId) => __awaiter(this, void 0, void 0, function* () {
56
+ }
57
+ /**
58
+ * Generates a new URL for the specified Webhook. This is suggested if a leak of the current URL is likely.
59
+ * @param orgName Name of the Organization
60
+ * @param spaceName Name of the Space
61
+ * @param webhookId ID of the Webhook
62
+ * @returns The updated Webhook
63
+ */
64
+ regenerateWebhookUrl(orgName, spaceName, webhookId) {
65
+ return __awaiter(this, void 0, void 0, function* () {
57
66
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks/${webhookId}/regenerateUrl`));
58
67
  return resp.data;
59
68
  });
60
- /**
61
- * Creates a new Webhook in the specified High5 space.
62
- * @param orgName Name of the Organization
63
- * @param spaceName Name of the Space
64
- * @param WebhookCreate Object/JSON containing the name, token, eventId, spaceId, target and (optionally) security headers for the new webhook
65
- * @returns The created Webhook
66
- */
67
- this.createWebhook = (orgName, spaceName, WebhookCreate) => __awaiter(this, void 0, void 0, function* () {
69
+ }
70
+ /**
71
+ * Creates a new Webhook in the specified High5 space.
72
+ * @param orgName Name of the Organization
73
+ * @param spaceName Name of the Space
74
+ * @param WebhookCreate Object/JSON containing the name, token, eventId, spaceId, target and (optionally) security headers for the new webhook
75
+ * @returns The created Webhook
76
+ */
77
+ createWebhook(orgName, spaceName, WebhookCreate) {
78
+ return __awaiter(this, void 0, void 0, function* () {
68
79
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks`), WebhookCreate);
69
80
  return resp.data;
70
81
  });
71
- /**
72
- * Updates an existing Webhook.
73
- * @param orgName Name of the Organization
74
- * @param spaceName Name of the Space
75
- * @param webhookId ID of the Webhook to be updated
76
- * @param WebhookCreate Object/JSON containing the name, token, eventId, spaceId, target and (optionally) security headers for the updated webhook
77
- * @returns the updated Webhook
78
- */
79
- this.updateWebhook = (orgName, spaceName, webhookId, webhookUpdate) => __awaiter(this, void 0, void 0, function* () {
82
+ }
83
+ /**
84
+ * Updates an existing Webhook.
85
+ * @param orgName Name of the Organization
86
+ * @param spaceName Name of the Space
87
+ * @param webhookId ID of the Webhook to be updated
88
+ * @param WebhookCreate Object/JSON containing the name, token, eventId, spaceId, target and (optionally) security headers for the updated webhook
89
+ * @returns the updated Webhook
90
+ */
91
+ updateWebhook(orgName, spaceName, webhookId, webhookUpdate) {
92
+ return __awaiter(this, void 0, void 0, function* () {
80
93
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks/${webhookId}`), webhookUpdate);
81
94
  return resp.data;
82
95
  });
83
- /**
84
- * Deletes a Webhook by its ID.
85
- * @param orgName Name of the Organization
86
- * @param spaceName Name of the Space
87
- * @param webhookId ID of the webhook to be deleted
88
- */
89
- this.deleteWebhook = (orgName, spaceName, webhookId) => __awaiter(this, void 0, void 0, function* () {
96
+ }
97
+ /**
98
+ * Deletes a Webhook by its ID.
99
+ * @param orgName Name of the Organization
100
+ * @param spaceName Name of the Space
101
+ * @param webhookId ID of the webhook to be deleted
102
+ */
103
+ deleteWebhook(orgName, spaceName, webhookId) {
104
+ return __awaiter(this, void 0, void 0, function* () {
90
105
  yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks/${webhookId}`));
91
106
  });
92
- /**
93
- * Executes all Events and Streams connected to the specified Webhook.
94
- * @param webhookUrl URL of the webhook to be triggered / executed
95
- */
96
- this.triggerWebhook = (webhookUrl) => __awaiter(this, void 0, void 0, function* () {
107
+ }
108
+ /**
109
+ * Executes all Events and Streams connected to the specified Webhook.
110
+ * @param webhookUrl URL of the webhook to be triggered / executed
111
+ */
112
+ triggerWebhook(webhookUrl) {
113
+ return __awaiter(this, void 0, void 0, function* () {
97
114
  yield this.axios.post(this.getEndpoint(webhookUrl));
98
115
  });
99
- /**
100
- * Executes a webhook by its URL.
101
- * @param webhookUrl Webhook URL to be triggered / executed (your hcloud domain + webhook.relativeUrl)
102
- * @param payload Payload to be used in the event execution that will be triggered by the webhook, as JSON.
103
- * @param headers (optional) Security headers.
104
- */
105
- this.executeWebhookByUrl = (webhookUrl, payload, headers) => __awaiter(this, void 0, void 0, function* () {
116
+ }
117
+ /**
118
+ * Executes a webhook by its URL.
119
+ * @param webhookUrl Webhook URL to be triggered / executed (your hcloud domain + webhook.relativeUrl)
120
+ * @param payload Payload to be used in the event execution that will be triggered by the webhook, as JSON.
121
+ * @param headers (optional) Security headers.
122
+ */
123
+ executeWebhookByUrl(webhookUrl, payload, headers) {
124
+ return __awaiter(this, void 0, void 0, function* () {
106
125
  const h = {};
107
126
  if (headers) {
108
127
  Object.keys(headers).forEach((key) => {
@@ -113,17 +132,31 @@ class High5Webhook extends Base_1.default {
113
132
  headers: h,
114
133
  });
115
134
  });
116
- /**
117
- * Validates the provided webhook URL by sending a challenge query parameter.
118
- * @param url Webhook URL to be validated (your hcloud domain + webhook.relativeUrl)
119
- * @param challenge String to be returned
120
- * @returns The provided challenge string as plaint text
121
- */
122
- this.validateWebhookUrl = (webhookUrl, challenge) => __awaiter(this, void 0, void 0, function* () {
135
+ }
136
+ /**
137
+ * Respond to a webhook via callback.
138
+ * @param callbackURL Full or partial URL callback URL. This URL is unique per webhook execution
139
+ * @param status HTTP status code to send in the response
140
+ * @param headers (optional) HTTP headers to send in the response
141
+ * @param body (optional) Body to send in the HTTP response
142
+ */
143
+ respondToWebhook(callbackURL, status, headers, body) {
144
+ return __awaiter(this, void 0, void 0, function* () {
145
+ const url = callbackURL.startsWith("http") ? callbackURL : this.getEndpoint(callbackURL);
146
+ yield this.axios.post(url, { status, headers: headers !== null && headers !== void 0 ? headers : {}, body }, { headers: { "Content-Type": "application/json" } });
147
+ });
148
+ }
149
+ /**
150
+ * Validates the provided webhook URL by sending a challenge query parameter.
151
+ * @param url Webhook URL to be validated (your hcloud domain + webhook.relativeUrl)
152
+ * @param challenge String to be returned
153
+ * @returns The provided challenge string as plaint text
154
+ */
155
+ validateWebhookUrl(webhookUrl, challenge) {
156
+ return __awaiter(this, void 0, void 0, function* () {
123
157
  const resp = yield this.axios.get(this.getEndpoint(`${webhookUrl}?challenge=${challenge}`));
124
158
  return resp.data;
125
159
  });
126
- this.log = new log_1.High5WebhookLog(this.options, this.axios);
127
160
  }
128
161
  getEndpoint(endpoint) {
129
162
  return `${this.options.server}/api/high5${endpoint}`;
@@ -1,9 +1,7 @@
1
- import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../../../Base";
1
+ import Base from "../../../../../Base";
3
2
  import { PaginatedResponse } from "../../../../../interfaces/global";
4
3
  import { WebhookLog } from "../../../../../interfaces/high5/space/webhook";
5
4
  export declare class High5WebhookLog extends Base {
6
- constructor(options: Options, axios: AxiosInstance);
7
5
  /**
8
6
  * Retrieves all Webhook logs for the specified Webhook.
9
7
  * @param orgName Name of the Organization
@@ -13,6 +11,6 @@ export declare class High5WebhookLog extends Base {
13
11
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
14
12
  * @returns Object containing an array of Webhook logs and the total number of results found in the database (independent of limit and page)
15
13
  */
16
- getWebhookLogs: (orgName: string, spaceName: string, webhookId: string, limit?: number, page?: number) => Promise<PaginatedResponse<WebhookLog>>;
14
+ getWebhookLogs(orgName: string, spaceName: string, webhookId: string, limit?: number, page?: number): Promise<PaginatedResponse<WebhookLog>>;
17
15
  protected getEndpoint(endpoint: string): string;
18
16
  }