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,44 +15,52 @@ const paginatedResponseHelper_1 = require("../../../helper/paginatedResponseHelp
15
15
  class High5JoinToken extends Base_1.default {
16
16
  constructor(options, axios) {
17
17
  super(options, axios);
18
- /**
19
- * Retrieves join tokens of the specified organization (paginated request)
20
- * @param orgName Name of the Organization
21
- * @param limit (optional) Max number of results (1-100; defaults to 25)
22
- * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
23
- * @returns Object containing an array of join tokens and the total number of results found in the database (independent of limit and page)
24
- */
25
- this.get = (orgName, limit, page) => __awaiter(this, void 0, void 0, function* () {
18
+ }
19
+ /**
20
+ * Retrieves join tokens of the specified organization (paginated request)
21
+ * @param orgName Name of the Organization
22
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
23
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
24
+ * @returns Object containing an array of join tokens and the total number of results found in the database (independent of limit and page)
25
+ */
26
+ get(orgName, limit, page) {
27
+ return __awaiter(this, void 0, void 0, function* () {
26
28
  limit = limit || 25;
27
29
  page = page || 0;
28
30
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/join/token?page=${page}&limit=${limit}`));
29
31
  return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
30
32
  });
31
- /**
32
- * Creates a join token for the specified organization
33
- * @param orgName Name of the Organization
34
- * @param name Name of the Join Token
35
- * @returns Created join token
36
- */
37
- this.create = (orgName, name) => __awaiter(this, void 0, void 0, function* () {
33
+ }
34
+ /**
35
+ * Creates a join token for the specified organization
36
+ * @param orgName Name of the Organization
37
+ * @param name Name of the Join Token
38
+ * @returns Created join token
39
+ */
40
+ create(orgName, name) {
41
+ return __awaiter(this, void 0, void 0, function* () {
38
42
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/join/token`), { name });
39
43
  return resp.data;
40
44
  });
41
- /**
42
- * Revokes a join token of the specified organization
43
- * @param orgName Name of the Organization
44
- * @param tokenId ID of the Join Token
45
- */
46
- this.revoke = (orgName, tokenId) => __awaiter(this, void 0, void 0, function* () {
45
+ }
46
+ /**
47
+ * Revokes a join token of the specified organization
48
+ * @param orgName Name of the Organization
49
+ * @param tokenId ID of the Join Token
50
+ */
51
+ revoke(orgName, tokenId) {
52
+ return __awaiter(this, void 0, void 0, function* () {
47
53
  yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/join/token/${tokenId}`));
48
54
  });
49
- /**
50
- * Exchanges a join token for an agent user
51
- *
52
- * @param joinToken Join token
53
- * @returns An object containing the User object and the PAT that represents the agent user
54
- */
55
- this.exchange = (joinToken) => __awaiter(this, void 0, void 0, function* () {
55
+ }
56
+ /**
57
+ * Exchanges a join token for an agent user
58
+ *
59
+ * @param joinToken Join token
60
+ * @returns An object containing the User object and the PAT that represents the agent user
61
+ */
62
+ exchange(joinToken) {
63
+ return __awaiter(this, void 0, void 0, function* () {
56
64
  const res = yield this.axios.post(this.getEndpoint(`/v1/join/token`), {}, { headers: { Authorization: joinToken } });
57
65
  return { user: res.data, pat: res.headers.authorization };
58
66
  });
@@ -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 { Event } from "../../../../interfaces/high5/space/event";
5
4
  import { High5Stream } from "./stream";
6
5
  export declare class High5Event extends Base {
7
- stream: High5Stream;
8
- constructor(options: Options, axios: AxiosInstance);
6
+ get stream(): High5Stream;
7
+ private _stream?;
9
8
  /**
10
9
  * Retrieves all Events of a High5 Space which match the provided search filter(s). Will return all Events of the Space if no filter is provided.
11
10
  * @param orgName Name of the Organization
@@ -16,10 +15,10 @@ export declare class High5Event 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 Events and the total number of results found in the database (independent of limit and page)
18
17
  */
19
- searchEvents: ({ orgName, spaceName, filters, sorting, limit, page, }: SearchParams & {
18
+ searchEvents({ orgName, spaceName, filters, sorting, limit, page, }: SearchParams & {
20
19
  orgName: string;
21
20
  spaceName: string;
22
- }) => Promise<PaginatedResponse<Event>>;
21
+ }): Promise<PaginatedResponse<Event>>;
23
22
  /**
24
23
  * Retrieves an Event by its name.
25
24
  * @param orgName Name of the Organization
@@ -27,7 +26,7 @@ export declare class High5Event extends Base {
27
26
  * @param eventName Name of the Event
28
27
  * @returns The requested Event
29
28
  */
30
- getEvent: (orgName: string, spaceName: string, eventName: string) => Promise<Event>;
29
+ getEvent(orgName: string, spaceName: string, eventName: string): Promise<Event>;
31
30
  /**
32
31
  * Creates a new Event in the provided Space.
33
32
  * @param orgName Name of the Organization
@@ -35,7 +34,7 @@ export declare class High5Event extends Base {
35
34
  * @param name Name of the new Event
36
35
  * @returns The created Event
37
36
  */
38
- createEvent: (orgName: string, spaceName: string, name: string) => Promise<Event>;
37
+ createEvent(orgName: string, spaceName: string, name: string): Promise<Event>;
39
38
  /**
40
39
  * Rename an event
41
40
  * @param orgName Name of the Organization
@@ -44,13 +43,13 @@ export declare class High5Event extends Base {
44
43
  * @param name New name of the Event
45
44
  * @returns Updated Event
46
45
  */
47
- renameEvent: (orgName: string, spaceName: string, eventName: string, name: string) => Promise<Event>;
46
+ renameEvent(orgName: string, spaceName: string, eventName: string, name: string): Promise<Event>;
48
47
  /**
49
48
  * Deletes an Event by its name.
50
49
  * @param orgName Name of the Organization
51
50
  * @param spaceName Name of the Space
52
51
  * @param eventName Name of the Event
53
52
  */
54
- deleteEvent: (orgName: string, spaceName: string, eventName: string) => Promise<void>;
53
+ deleteEvent(orgName: string, spaceName: string, eventName: string): Promise<void>;
55
54
  protected getEndpoint(endpoint: string): string;
56
55
  }
@@ -15,19 +15,24 @@ const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseH
15
15
  const searchFilter_1 = require("../../../../helper/searchFilter");
16
16
  const stream_1 = require("./stream");
17
17
  class High5Event extends Base_1.default {
18
- constructor(options, axios) {
19
- super(options, axios);
20
- /**
21
- * Retrieves all Events of a High5 Space which match the provided search filter(s). Will return all Events 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
- * @returns Object containing an array of Events and the total number of results found in the database (independent of limit and page)
29
- */
30
- this.searchEvents = (_a) => __awaiter(this, [_a], void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, }) {
18
+ get stream() {
19
+ if (this._stream === undefined) {
20
+ this._stream = new stream_1.High5Stream(this.options, this.axios);
21
+ }
22
+ return this._stream;
23
+ }
24
+ /**
25
+ * Retrieves all Events of a High5 Space which match the provided search filter(s). Will return all Events of the Space if no 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 Events and the total number of results found in the database (independent of limit and page)
33
+ */
34
+ searchEvents(_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}/events/search?page=${page}&limit=${limit}`), {
33
38
  filters: filtersDTO,
@@ -35,52 +40,59 @@ class High5Event extends Base_1.default {
35
40
  });
36
41
  return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
37
42
  });
38
- /**
39
- * Retrieves an Event by its name.
40
- * @param orgName Name of the Organization
41
- * @param spaceName Name of the Space
42
- * @param eventName Name of the Event
43
- * @returns The requested Event
44
- */
45
- this.getEvent = (orgName, spaceName, eventName) => __awaiter(this, void 0, void 0, function* () {
43
+ }
44
+ /**
45
+ * Retrieves an Event by its name.
46
+ * @param orgName Name of the Organization
47
+ * @param spaceName Name of the Space
48
+ * @param eventName Name of the Event
49
+ * @returns The requested Event
50
+ */
51
+ getEvent(orgName, spaceName, eventName) {
52
+ return __awaiter(this, void 0, void 0, function* () {
46
53
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}`));
47
54
  return resp.data;
48
55
  });
49
- /**
50
- * Creates a new Event in the provided Space.
51
- * @param orgName Name of the Organization
52
- * @param spaceName Name of the Space
53
- * @param name Name of the new Event
54
- * @returns The created Event
55
- */
56
- this.createEvent = (orgName, spaceName, name) => __awaiter(this, void 0, void 0, function* () {
56
+ }
57
+ /**
58
+ * Creates a new Event in the provided Space.
59
+ * @param orgName Name of the Organization
60
+ * @param spaceName Name of the Space
61
+ * @param name Name of the new Event
62
+ * @returns The created Event
63
+ */
64
+ createEvent(orgName, spaceName, name) {
65
+ return __awaiter(this, void 0, void 0, function* () {
57
66
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events`), { name: name });
58
67
  return resp.data;
59
68
  });
60
- /**
61
- * Rename an event
62
- * @param orgName Name of the Organization
63
- * @param spaceName Name of the Space
64
- * @param eventName Name of the Event
65
- * @param name New name of the Event
66
- * @returns Updated Event
67
- */
68
- this.renameEvent = (orgName, spaceName, eventName, name) => __awaiter(this, void 0, void 0, function* () {
69
+ }
70
+ /**
71
+ * Rename an event
72
+ * @param orgName Name of the Organization
73
+ * @param spaceName Name of the Space
74
+ * @param eventName Name of the Event
75
+ * @param name New name of the Event
76
+ * @returns Updated Event
77
+ */
78
+ renameEvent(orgName, spaceName, eventName, name) {
79
+ return __awaiter(this, void 0, void 0, function* () {
69
80
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}/name`), {
70
81
  name: name,
71
82
  });
72
83
  return resp.data;
73
84
  });
74
- /**
75
- * Deletes an Event by its name.
76
- * @param orgName Name of the Organization
77
- * @param spaceName Name of the Space
78
- * @param eventName Name of the Event
79
- */
80
- this.deleteEvent = (orgName, spaceName, eventName) => __awaiter(this, void 0, void 0, function* () {
85
+ }
86
+ /**
87
+ * Deletes an Event by its name.
88
+ * @param orgName Name of the Organization
89
+ * @param spaceName Name of the Space
90
+ * @param eventName Name of the Event
91
+ */
92
+ deleteEvent(orgName, spaceName, eventName) {
93
+ return __awaiter(this, void 0, void 0, function* () {
81
94
  yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}`));
82
95
  });
83
- this.stream = new stream_1.High5Stream(this.options, this.axios);
84
96
  }
85
97
  getEndpoint(endpoint) {
86
98
  return `${this.options.server}/api/high5${endpoint}`;
@@ -13,7 +13,7 @@ export default class DesignOperations extends Base {
13
13
  unlinkNodes(uuid: string): OperationQueue;
14
14
  protected getEndpoint(endpoint: string): string;
15
15
  }
16
- declare class OperationQueue {
16
+ export declare class OperationQueue {
17
17
  operations: DesignOperation[];
18
18
  parent: DesignOperations;
19
19
  constructor(parent: DesignOperations);
@@ -28,4 +28,3 @@ declare class OperationQueue {
28
28
  linkNodes(details: LinkNodes["details"]): this;
29
29
  unlinkNodes(uuid: string): this;
30
30
  }
31
- export {};
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OperationQueue = void 0;
12
13
  const Base_1 = require("../../../../../../Base");
13
14
  const DesignOperation_1 = require("../../../../../../interfaces/high5/space/event/stream/design/DesignOperation");
14
15
  class DesignOperations extends Base_1.default {
@@ -115,3 +116,4 @@ class OperationQueue {
115
116
  return this;
116
117
  }
117
118
  }
119
+ exports.OperationQueue = OperationQueue;
@@ -1,5 +1,4 @@
1
- import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../../../../Base";
1
+ import Base from "../../../../../../Base";
3
2
  import { Design } from "../../../../../../interfaces/high5/space/event/stream/design";
4
3
  import { DesignContent } from "../../../../../../interfaces/high5/space/event/stream/design/StreamDesign";
5
4
  import DesignOperations from "./DesignOperations";
@@ -8,12 +7,13 @@ export declare class High5Design extends Base {
8
7
  /**
9
8
  * API to manage design snapshots
10
9
  */
11
- snapshots: High5DesignSnapshots;
10
+ get snapshots(): High5DesignSnapshots;
11
+ private _snapshots?;
12
12
  /**
13
13
  * API to perform operations on the Stream Design
14
14
  */
15
- operations: DesignOperations;
16
- constructor(options: Options, axios: AxiosInstance);
15
+ get operations(): DesignOperations;
16
+ private _operations?;
17
17
  /**
18
18
  * Retrieves a stream's design.
19
19
  * @param orgName Name of the organization
@@ -22,17 +22,32 @@ export declare class High5Design extends Base {
22
22
  * @param streamId ID of the stream
23
23
  * @returns The requested design
24
24
  */
25
- getDesign: (orgName: string, spaceName: string, eventName: string, streamId: string) => Promise<Design>;
25
+ getDesign(orgName: string, spaceName: string, eventName: string, streamId: string): Promise<Design>;
26
26
  /**
27
27
  * Creates/overwrites a new design for the specified stream.
28
+ *
29
+ * To publish the current design for execution use the {@link publishDesign} method
30
+ *
28
31
  * @param orgName Name of the organization
29
32
  * @param spaceName Name of the space
30
33
  * @param eventName Name of the event
31
34
  * @param streamId ID of the stream
32
35
  * @param content Design as Json payload (schema created by Stream Designer Studio)
33
- * @param build Rendered design as Json payload (schema created by Stream Designer Studio; ready to be executed by wave engine)
34
36
  * @returns The created design
35
37
  */
36
- createDesign: (orgName: string, spaceName: string, eventName: string, streamId: string, name: string, content: DesignContent, build?: unknown) => Promise<Design>;
38
+ createDesign(orgName: string, spaceName: string, eventName: string, streamId: string, name: string, content: DesignContent): Promise<Design>;
39
+ /**
40
+ * Publish the current design for a specified stream
41
+ *
42
+ * To set the current design use the {@link createDesign} method
43
+ *
44
+ * @param orgName Name of the organization
45
+ * @param spaceName Name of the space
46
+ * @param eventName Name of the event
47
+ * @param streamId ID of the stream
48
+ * @param content Design as Json payload (schema created by Stream Designer Studio)
49
+ * @returns The created design
50
+ */
51
+ publishDesign(orgName: string, spaceName: string, eventName: string, streamId: string): Promise<void>;
37
52
  protected getEndpoint(endpoint: string): string;
38
53
  }
@@ -14,40 +14,75 @@ const Base_1 = require("../../../../../../Base");
14
14
  const DesignOperations_1 = require("./DesignOperations");
15
15
  const snapshot_1 = require("./snapshot");
16
16
  class High5Design extends Base_1.default {
17
- constructor(options, axios) {
18
- super(options, axios);
19
- /**
20
- * Retrieves a stream's design.
21
- * @param orgName Name of the organization
22
- * @param spaceName Name of the space
23
- * @param eventName Name of the event
24
- * @param streamId ID of the stream
25
- * @returns The requested design
26
- */
27
- this.getDesign = (orgName, spaceName, eventName, streamId) => __awaiter(this, void 0, void 0, function* () {
17
+ /**
18
+ * API to manage design snapshots
19
+ */
20
+ get snapshots() {
21
+ if (this._snapshots === undefined) {
22
+ this._snapshots = new snapshot_1.default(this.options, this.axios);
23
+ }
24
+ return this._snapshots;
25
+ }
26
+ /**
27
+ * API to perform operations on the Stream Design
28
+ */
29
+ get operations() {
30
+ if (this._operations === undefined) {
31
+ this._operations = new DesignOperations_1.default(this.options, this.axios);
32
+ }
33
+ return this._operations;
34
+ }
35
+ /**
36
+ * Retrieves a stream's design.
37
+ * @param orgName Name of the organization
38
+ * @param spaceName Name of the space
39
+ * @param eventName Name of the event
40
+ * @param streamId ID of the stream
41
+ * @returns The requested design
42
+ */
43
+ getDesign(orgName, spaceName, eventName, streamId) {
44
+ return __awaiter(this, void 0, void 0, function* () {
28
45
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}/streams/${streamId}/design`));
29
46
  return resp.data;
30
47
  });
31
- /**
32
- * Creates/overwrites a new design for the specified stream.
33
- * @param orgName Name of the organization
34
- * @param spaceName Name of the space
35
- * @param eventName Name of the event
36
- * @param streamId ID of the stream
37
- * @param content Design as Json payload (schema created by Stream Designer Studio)
38
- * @param build Rendered design as Json payload (schema created by Stream Designer Studio; ready to be executed by wave engine)
39
- * @returns The created design
40
- */
41
- this.createDesign = (orgName, spaceName, eventName, streamId, name, content, build) => __awaiter(this, void 0, void 0, function* () {
48
+ }
49
+ /**
50
+ * Creates/overwrites a new design for the specified stream.
51
+ *
52
+ * To publish the current design for execution use the {@link publishDesign} method
53
+ *
54
+ * @param orgName Name of the organization
55
+ * @param spaceName Name of the space
56
+ * @param eventName Name of the event
57
+ * @param streamId ID of the stream
58
+ * @param content Design as Json payload (schema created by Stream Designer Studio)
59
+ * @returns The created design
60
+ */
61
+ createDesign(orgName, spaceName, eventName, streamId, name, content) {
62
+ return __awaiter(this, void 0, void 0, function* () {
42
63
  const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}/streams/${streamId}/design`), {
43
64
  name,
44
65
  content,
45
- build,
46
66
  });
47
67
  return resp.data;
48
68
  });
49
- this.operations = new DesignOperations_1.default(options, axios);
50
- this.snapshots = new snapshot_1.default(options, axios);
69
+ }
70
+ /**
71
+ * Publish the current design for a specified stream
72
+ *
73
+ * To set the current design use the {@link createDesign} method
74
+ *
75
+ * @param orgName Name of the organization
76
+ * @param spaceName Name of the space
77
+ * @param eventName Name of the event
78
+ * @param streamId ID of the stream
79
+ * @param content Design as Json payload (schema created by Stream Designer Studio)
80
+ * @returns The created design
81
+ */
82
+ publishDesign(orgName, spaceName, eventName, streamId) {
83
+ return __awaiter(this, void 0, void 0, function* () {
84
+ yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/events/${eventName}/streams/${streamId}/design/publish`));
85
+ });
51
86
  }
52
87
  getEndpoint(endpoint) {
53
88
  return `${this.options.server}/api/high5${endpoint}`;
@@ -15,7 +15,7 @@ export default class High5DesignSnapshots extends Base {
15
15
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
16
16
  * @returns Object containing an array of snapshots of the stream design and the total number of results found in the database (independent of limit and page)
17
17
  */
18
- search: (orgName: string, spaceName: string, eventName: string, streamId: string, content: boolean | undefined, { filters, sorting, limit, page }: SearchParams) => Promise<PaginatedResponse<DesignSnapshot>>;
18
+ search(orgName: string, spaceName: string, eventName: string, streamId: string, content: boolean | undefined, { filters, sorting, limit, page }: SearchParams): Promise<PaginatedResponse<DesignSnapshot>>;
19
19
  /**
20
20
  * Create a snapshot of stream's design.
21
21
  * @param orgName Name of the organization
@@ -25,7 +25,7 @@ export default class High5DesignSnapshots extends Base {
25
25
  * @param name Name of the snapshot
26
26
  * @returns The snapshot
27
27
  */
28
- create: (orgName: string, spaceName: string, eventName: string, streamId: string, name: string) => Promise<DesignSnapshot>;
28
+ create(orgName: string, spaceName: string, eventName: string, streamId: string, name: string): Promise<DesignSnapshot>;
29
29
  /**
30
30
  * Update a snapshot's name.
31
31
  * @param orgName Name of the organization
@@ -36,7 +36,7 @@ export default class High5DesignSnapshots extends Base {
36
36
  * @param name Name of the snapshot
37
37
  * @returns The snapshot
38
38
  */
39
- update: (orgName: string, spaceName: string, eventName: string, streamId: string, snapshotId: string, name: string) => Promise<DesignSnapshot>;
39
+ update(orgName: string, spaceName: string, eventName: string, streamId: string, snapshotId: string, name: string): Promise<DesignSnapshot>;
40
40
  /**
41
41
  * Delete a stream design's snapshot.
42
42
  * @param orgName Name of the organization
@@ -45,7 +45,7 @@ export default class High5DesignSnapshots extends Base {
45
45
  * @param streamId ID of the stream
46
46
  * @param snapshotId ID of the snapshot
47
47
  */
48
- delete: (orgName: string, spaceName: string, eventName: string, streamId: string, snapshotId: string) => Promise<void>;
48
+ delete(orgName: string, spaceName: string, eventName: string, streamId: string, snapshotId: string): Promise<void>;
49
49
  /**
50
50
  * Restore a stream's design to a certain snapshot.
51
51
  *
@@ -57,6 +57,6 @@ export default class High5DesignSnapshots extends Base {
57
57
  * @param streamId ID of the stream
58
58
  * @param snapshotId ID of the snapshot
59
59
  */
60
- restore: (orgName: string, spaceName: string, eventName: string, streamId: string, snapshotId: string) => Promise<void>;
60
+ restore(orgName: string, spaceName: string, eventName: string, streamId: string, snapshotId: string): Promise<void>;
61
61
  protected getEndpoint(endpoint: string): string;
62
62
  }