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,49 +15,6 @@ const searchFilter_1 = require("../../../../../helper/searchFilter");
15
15
  class IdpOrganizationMemberInvitations extends Base_1.default {
16
16
  constructor() {
17
17
  super(...arguments);
18
- /**
19
- * Retrieves all invitations sent out by the organization that match the provided search filter(s). Returns all invitations if no search filter is provided.
20
- * @param orgName Name of the organization
21
- * @param filters (optional) Array of search filters
22
- * @param sorting (optional) Sorting object
23
- * @param limit (optional) Max number of results (1-100; defaults to 25)
24
- * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
25
- * @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
26
- */
27
- this.search = (params) => __awaiter(this, void 0, void 0, function* () {
28
- const limit = params.limit || 25;
29
- const page = params.page || 0;
30
- // convert SearchFilters to DTO
31
- const filtersDTO = params.filters.map((f) => {
32
- return new searchFilter_1.SearchFilterDTO(f);
33
- });
34
- const resp = yield this.axios.post(this.getEndpoint(`/${params.orgName}/members/invitations/search?limit=${limit}&page=${page}`), {
35
- filters: filtersDTO,
36
- sorting: params.sorting,
37
- });
38
- return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
39
- });
40
- /**
41
- * Invites a User to an Organization.
42
- *
43
- * @param orgName Name of the Organization
44
- * @param email Email of the person to be invited
45
- * @param role The role they will have within the organization if they accept the invitation
46
- * @param 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
- * @param targetUrl Optional url the link in the mail will point to
50
- * @returns The created invitation
51
- */
52
- this.create = (orgName_1, email_1, role_1, ...args_1) => __awaiter(this, [orgName_1, email_1, role_1, ...args_1], void 0, function* (orgName, email, role, allowNonRegisteredUsers = false, targetUrl) {
53
- const resp = yield this.axios.post(this.getEndpoint(`/${orgName}/members/invitations`), {
54
- email,
55
- role,
56
- allowNonRegisteredUsers,
57
- targetUrl,
58
- });
59
- return resp.data;
60
- });
61
18
  /**
62
19
  * Accept an invitation.
63
20
  *
@@ -111,6 +68,53 @@ class IdpOrganizationMemberInvitations extends Base_1.default {
111
68
  yield this.axios.delete(this.getEndpoint(`/${orgName}/members/invitations/${invitationId}`));
112
69
  });
113
70
  }
71
+ /**
72
+ * Retrieves all invitations sent out by the organization that match the provided search filter(s). Returns all invitations if no search filter is provided.
73
+ * @param orgName Name of the organization
74
+ * @param filters (optional) Array of search filters
75
+ * @param sorting (optional) Sorting object
76
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
77
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
78
+ * @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
79
+ */
80
+ search(params) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ const limit = params.limit || 25;
83
+ const page = params.page || 0;
84
+ // convert SearchFilters to DTO
85
+ const filtersDTO = params.filters.map((f) => {
86
+ return new searchFilter_1.SearchFilterDTO(f);
87
+ });
88
+ const resp = yield this.axios.post(this.getEndpoint(`/${params.orgName}/members/invitations/search?limit=${limit}&page=${page}`), {
89
+ filters: filtersDTO,
90
+ sorting: params.sorting,
91
+ });
92
+ return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
93
+ });
94
+ }
95
+ /**
96
+ * Invites a User to an Organization.
97
+ *
98
+ * @param orgName Name of the Organization
99
+ * @param email Email of the person to be invited
100
+ * @param role The role they will have within the organization if they accept the invitation
101
+ * @param allowNonRegisteredUsers Flag to determine if the invitation should go through in the case that the email is not bound to an Helmut Cloud user.
102
+ * If this is set to true and the email is unbound, then an email will be sent asking the person to register.
103
+ * When they do they will automatically join the organization.
104
+ * @param targetUrl Optional url the link in the mail will point to
105
+ * @returns The created invitation
106
+ */
107
+ create(orgName_1, email_1, role_1) {
108
+ return __awaiter(this, arguments, void 0, function* (orgName, email, role, allowNonRegisteredUsers = false, targetUrl) {
109
+ const resp = yield this.axios.post(this.getEndpoint(`/${orgName}/members/invitations`), {
110
+ email,
111
+ role,
112
+ allowNonRegisteredUsers,
113
+ targetUrl,
114
+ });
115
+ return resp.data;
116
+ });
117
+ }
114
118
  getEndpoint(endpoint) {
115
119
  return `${this.options.server}/api/account/v1/org${endpoint}`;
116
120
  }
@@ -1,38 +1,37 @@
1
- import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../../../Base";
1
+ import Base from "../../../../../Base";
3
2
  import { Domain } from "../../../../../interfaces/idp/organization/settings/domain";
4
3
  import { IdpSAMLProvider } from "./saml";
5
4
  export declare class IdpDomain extends Base {
6
5
  /**
7
6
  * Handles everything around a SAML provider of a domain.
8
7
  */
9
- samlProvider: IdpSAMLProvider;
10
- constructor(options: Options, axios: AxiosInstance);
8
+ get samlProvider(): IdpSAMLProvider;
9
+ private _samlProvider?;
11
10
  /**
12
11
  * Retrieves all the Domains associated with a given Organization.
13
12
  * @param orgName Name of Organization
14
13
  * @returns Array of Domains
15
14
  */
16
- getDomains: (orgName: string) => Promise<Domain[]>;
15
+ getDomains(orgName: string): Promise<Domain[]>;
17
16
  /**
18
17
  * Creates a new Domain for the given Organization
19
18
  * @param orgName Name of the Organization
20
19
  * @param domainName Name of the Domain
21
20
  * @returns the created Domain
22
21
  */
23
- createDomain: (orgName: string, domainName: string) => Promise<Domain>;
22
+ createDomain(orgName: string, domainName: string): Promise<Domain>;
24
23
  /**
25
24
  * Verifies the provided Domain.
26
25
  * @param orgName Name of the organization
27
26
  * @param domainName Name of the Domain
28
27
  * @returns Domain object with domain.verified set to 'true' if verification was succesful.
29
28
  */
30
- verifyDomain: (orgName: string, domainName: string) => Promise<Domain>;
29
+ verifyDomain(orgName: string, domainName: string): Promise<Domain>;
31
30
  /**
32
31
  * Deletes a domain.
33
32
  * @param orgName Name of the organization
34
33
  * @param domainName Name of the domain
35
34
  */
36
- deleteDomain: (orgName: string, domainName: string) => Promise<void>;
35
+ deleteDomain(orgName: string, domainName: string): Promise<void>;
37
36
  protected getEndpoint(endpoint: string): string;
38
37
  }
@@ -13,48 +13,61 @@ exports.IdpDomain = void 0;
13
13
  const Base_1 = require("../../../../../Base");
14
14
  const saml_1 = require("./saml");
15
15
  class IdpDomain extends Base_1.default {
16
- constructor(options, axios) {
17
- super(options, axios);
18
- /**
19
- * Retrieves all the Domains associated with a given Organization.
20
- * @param orgName Name of Organization
21
- * @returns Array of Domains
22
- */
23
- this.getDomains = (orgName) => __awaiter(this, void 0, void 0, function* () {
16
+ /**
17
+ * Handles everything around a SAML provider of a domain.
18
+ */
19
+ get samlProvider() {
20
+ if (this._samlProvider === undefined) {
21
+ this._samlProvider = new saml_1.IdpSAMLProvider(this.options, this.axios);
22
+ }
23
+ return this._samlProvider;
24
+ }
25
+ /**
26
+ * Retrieves all the Domains associated with a given Organization.
27
+ * @param orgName Name of Organization
28
+ * @returns Array of Domains
29
+ */
30
+ getDomains(orgName) {
31
+ return __awaiter(this, void 0, void 0, function* () {
24
32
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/settings/domains`));
25
33
  return resp.data;
26
34
  });
27
- /**
28
- * Creates a new Domain for the given Organization
29
- * @param orgName Name of the Organization
30
- * @param domainName Name of the Domain
31
- * @returns the created Domain
32
- */
33
- this.createDomain = (orgName, domainName) => __awaiter(this, void 0, void 0, function* () {
35
+ }
36
+ /**
37
+ * Creates a new Domain for the given Organization
38
+ * @param orgName Name of the Organization
39
+ * @param domainName Name of the Domain
40
+ * @returns the created Domain
41
+ */
42
+ createDomain(orgName, domainName) {
43
+ return __awaiter(this, void 0, void 0, function* () {
34
44
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/settings/domains`), {
35
45
  name: domainName,
36
46
  });
37
47
  return resp.data;
38
48
  });
39
- /**
40
- * Verifies the provided Domain.
41
- * @param orgName Name of the organization
42
- * @param domainName Name of the Domain
43
- * @returns Domain object with domain.verified set to 'true' if verification was succesful.
44
- */
45
- this.verifyDomain = (orgName, domainName) => __awaiter(this, void 0, void 0, function* () {
49
+ }
50
+ /**
51
+ * Verifies the provided Domain.
52
+ * @param orgName Name of the organization
53
+ * @param domainName Name of the Domain
54
+ * @returns Domain object with domain.verified set to 'true' if verification was succesful.
55
+ */
56
+ verifyDomain(orgName, domainName) {
57
+ return __awaiter(this, void 0, void 0, function* () {
46
58
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/verify`));
47
59
  return resp.data;
48
60
  });
49
- /**
50
- * Deletes a domain.
51
- * @param orgName Name of the organization
52
- * @param domainName Name of the domain
53
- */
54
- this.deleteDomain = (orgName, domainName) => __awaiter(this, void 0, void 0, function* () {
61
+ }
62
+ /**
63
+ * Deletes a domain.
64
+ * @param orgName Name of the organization
65
+ * @param domainName Name of the domain
66
+ */
67
+ deleteDomain(orgName, domainName) {
68
+ return __awaiter(this, void 0, void 0, function* () {
55
69
  yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}`));
56
70
  });
57
- this.samlProvider = new saml_1.IdpSAMLProvider(this.options, this.axios);
58
71
  }
59
72
  getEndpoint(endpoint) {
60
73
  return `${this.options.server}/api/account${endpoint}`;
@@ -6,7 +6,7 @@ export declare class IdpSAMLProvider extends Base {
6
6
  * @param orgName Name of the Organization
7
7
  * @returns Array of SAML providers
8
8
  */
9
- getAllSAMLProvidersOfOrganization: (orgName: string) => Promise<FullSAMLProvider[]>;
9
+ getAllSAMLProvidersOfOrganization(orgName: string): Promise<FullSAMLProvider[]>;
10
10
  /**
11
11
  * Creates a new SAML provider for the specified domain.
12
12
  * @param orgName Name of the Organization
@@ -14,7 +14,7 @@ export declare class IdpSAMLProvider extends Base {
14
14
  * @param provider SAML provider object containing the login URL, logout URL, certificates and a boolean to allow unencrypted assertion
15
15
  * @returns The created SAML provider
16
16
  */
17
- createProvider: (orgName: string, domainName: string, provider: SAMLProviderCreateDto) => Promise<SAMLProvider>;
17
+ createProvider(orgName: string, domainName: string, provider: SAMLProviderCreateDto): Promise<SAMLProvider>;
18
18
  /**
19
19
  * Updates a SAML provider for the specified domain
20
20
  * @param orgName Name of the Organization
@@ -22,7 +22,7 @@ export declare class IdpSAMLProvider extends Base {
22
22
  * @param provider SAML provider object containing the login URL, logout URL, certificates and a boolean to allow unencrypted assertion
23
23
  * @returns The updated SAML provider
24
24
  */
25
- updateProvider: (orgName: string, domainName: string, provider: SAMLProviderCreateDto) => Promise<SAMLProvider>;
25
+ updateProvider(orgName: string, domainName: string, provider: SAMLProviderCreateDto): Promise<SAMLProvider>;
26
26
  /**
27
27
  * Adds certificates to a SAML provider
28
28
  * @param orgName Name of the Organization
@@ -30,13 +30,13 @@ export declare class IdpSAMLProvider extends Base {
30
30
  * @param certificates Certificates to add
31
31
  * @returns The updated SAML provider
32
32
  */
33
- addCertificatesToProvider: (orgName: string, domainName: string, certificates: string[]) => Promise<SAMLProvider>;
33
+ addCertificatesToProvider(orgName: string, domainName: string, certificates: string[]): Promise<SAMLProvider>;
34
34
  /**
35
35
  * Removes a SAML provider from the specified domain
36
36
  * @param orgName Name of the Organization
37
37
  * @param domainName Name of the Domain
38
38
  */
39
- deleteProvider: (orgName: string, domainName: string) => Promise<void>;
39
+ deleteProvider(orgName: string, domainName: string): Promise<void>;
40
40
  private convertProviderToFormData;
41
41
  private createFileFromString;
42
42
  protected getEndpoint(endpoint: string): string;
@@ -14,72 +14,82 @@ const Base_1 = require("../../../../../../Base");
14
14
  class IdpSAMLProvider extends Base_1.default {
15
15
  constructor() {
16
16
  super(...arguments);
17
- /**
18
- * Retrieves all SAML providers associated with a given Organization.
19
- * @param orgName Name of the Organization
20
- * @returns Array of SAML providers
21
- */
22
- this.getAllSAMLProvidersOfOrganization = (orgName) => __awaiter(this, void 0, void 0, function* () {
17
+ this.convertProviderToFormData = (provider) => {
18
+ const formData = new FormData();
19
+ formData.append("ssoLoginURL", provider.ssoLoginURL);
20
+ formData.append("ssoLogoutURL", provider.ssoLogoutURL);
21
+ provider.certificates.forEach(c => formData.append("certificate", this.createFileFromString(c)));
22
+ provider.allowUnencryptedAssertion && formData.append("allowUnencryptedAssertion", provider.allowUnencryptedAssertion.toString());
23
+ return formData;
24
+ };
25
+ this.createFileFromString = (certificate) => {
26
+ const blob = new Blob([certificate]);
27
+ return new File([blob], "certificate");
28
+ };
29
+ }
30
+ /**
31
+ * Retrieves all SAML providers associated with a given Organization.
32
+ * @param orgName Name of the Organization
33
+ * @returns Array of SAML providers
34
+ */
35
+ getAllSAMLProvidersOfOrganization(orgName) {
36
+ return __awaiter(this, void 0, void 0, function* () {
23
37
  const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/settings/domains/saml`));
24
38
  return resp.data;
25
39
  });
26
- /**
27
- * Creates a new SAML provider for the specified domain.
28
- * @param orgName Name of the Organization
29
- * @param domainName Name of the Domain
30
- * @param provider SAML provider object containing the login URL, logout URL, certificates and a boolean to allow unencrypted assertion
31
- * @returns The created SAML provider
32
- */
33
- this.createProvider = (orgName, domainName, provider) => __awaiter(this, void 0, void 0, function* () {
40
+ }
41
+ /**
42
+ * Creates a new SAML provider for the specified domain.
43
+ * @param orgName Name of the Organization
44
+ * @param domainName Name of the Domain
45
+ * @param provider SAML provider object containing the login URL, logout URL, certificates and a boolean to allow unencrypted assertion
46
+ * @returns The created SAML provider
47
+ */
48
+ createProvider(orgName, domainName, provider) {
49
+ return __awaiter(this, void 0, void 0, function* () {
34
50
  const formData = this.convertProviderToFormData(provider);
35
51
  const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/saml`), formData);
36
52
  return resp.data;
37
53
  });
38
- /**
39
- * Updates a SAML provider for the specified domain
40
- * @param orgName Name of the Organization
41
- * @param domainName Name of the Domain
42
- * @param provider SAML provider object containing the login URL, logout URL, certificates and a boolean to allow unencrypted assertion
43
- * @returns The updated SAML provider
44
- */
45
- this.updateProvider = (orgName, domainName, provider) => __awaiter(this, void 0, void 0, function* () {
54
+ }
55
+ /**
56
+ * Updates a SAML provider for the specified domain
57
+ * @param orgName Name of the Organization
58
+ * @param domainName Name of the Domain
59
+ * @param provider SAML provider object containing the login URL, logout URL, certificates and a boolean to allow unencrypted assertion
60
+ * @returns The updated SAML provider
61
+ */
62
+ updateProvider(orgName, domainName, provider) {
63
+ return __awaiter(this, void 0, void 0, function* () {
46
64
  const formData = this.convertProviderToFormData(provider);
47
65
  const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/saml`), formData);
48
66
  return resp.data;
49
67
  });
50
- /**
51
- * Adds certificates to a SAML provider
52
- * @param orgName Name of the Organization
53
- * @param domainName Name of the Domain
54
- * @param certificates Certificates to add
55
- * @returns The updated SAML provider
56
- */
57
- this.addCertificatesToProvider = (orgName, domainName, certificates) => __awaiter(this, void 0, void 0, function* () {
68
+ }
69
+ /**
70
+ * Adds certificates to a SAML provider
71
+ * @param orgName Name of the Organization
72
+ * @param domainName Name of the Domain
73
+ * @param certificates Certificates to add
74
+ * @returns The updated SAML provider
75
+ */
76
+ addCertificatesToProvider(orgName, domainName, certificates) {
77
+ return __awaiter(this, void 0, void 0, function* () {
58
78
  const formData = new FormData();
59
79
  certificates.forEach(c => formData.append("certificate", this.createFileFromString(c)));
60
80
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/saml/certificates`), formData);
61
81
  return resp.data;
62
82
  });
63
- /**
64
- * Removes a SAML provider from the specified domain
65
- * @param orgName Name of the Organization
66
- * @param domainName Name of the Domain
67
- */
68
- this.deleteProvider = (orgName, domainName) => __awaiter(this, void 0, void 0, function* () {
83
+ }
84
+ /**
85
+ * Removes a SAML provider from the specified domain
86
+ * @param orgName Name of the Organization
87
+ * @param domainName Name of the Domain
88
+ */
89
+ deleteProvider(orgName, domainName) {
90
+ return __awaiter(this, void 0, void 0, function* () {
69
91
  yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/saml`));
70
92
  });
71
- this.convertProviderToFormData = (provider) => {
72
- const formData = new FormData();
73
- formData.append("ssoLoginURL", provider.ssoLoginURL);
74
- formData.append("ssoLogoutURL", provider.ssoLogoutURL);
75
- provider.certificates.forEach(c => formData.append("certificate", this.createFileFromString(c)));
76
- provider.allowUnencryptedAssertion && formData.append("allowUnencryptedAssertion", provider.allowUnencryptedAssertion.toString());
77
- return formData;
78
- };
79
- this.createFileFromString = (certificate) => {
80
- const blob = new Blob([certificate]);
81
- return new File([blob], "certificate");
82
- };
83
93
  }
84
94
  getEndpoint(endpoint) {
85
95
  return `${this.options.server}/api/account${endpoint}`;
@@ -1,16 +1,16 @@
1
- import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../../Base";
1
+ import Base from "../../../../Base";
3
2
  import { IdpDomain } from "./domain";
4
3
  import { IdpOAuthApp } from "./oauth";
5
4
  export default class IdpOrganizationSettings extends Base {
6
5
  /**
7
6
  * Handles everything around open authorization applications
8
7
  */
9
- oAuthApp: IdpOAuthApp;
8
+ get oAuthApp(): IdpOAuthApp;
9
+ private _oAuthApp?;
10
10
  /**
11
11
  * Handles everything around domains of organizations.
12
12
  */
13
- domains: IdpDomain;
14
- constructor(options: Options, axios: AxiosInstance);
13
+ get domains(): IdpDomain;
14
+ private _domains?;
15
15
  protected getEndpoint(): string;
16
16
  }
@@ -4,10 +4,23 @@ const Base_1 = require("../../../../Base");
4
4
  const domain_1 = require("./domain");
5
5
  const oauth_1 = require("./oauth");
6
6
  class IdpOrganizationSettings extends Base_1.default {
7
- constructor(options, axios) {
8
- super(options, axios);
9
- this.domains = new domain_1.IdpDomain(this.options, this.axios);
10
- this.oAuthApp = new oauth_1.IdpOAuthApp(this.options, this.axios);
7
+ /**
8
+ * Handles everything around open authorization applications
9
+ */
10
+ get oAuthApp() {
11
+ if (this._oAuthApp === undefined) {
12
+ this._oAuthApp = new oauth_1.IdpOAuthApp(this.options, this.axios);
13
+ }
14
+ return this._oAuthApp;
15
+ }
16
+ /**
17
+ * Handles everything around domains of organizations.
18
+ */
19
+ get domains() {
20
+ if (this._domains === undefined) {
21
+ this._domains = new domain_1.IdpDomain(this.options, this.axios);
22
+ }
23
+ return this._domains;
11
24
  }
12
25
  getEndpoint() {
13
26
  throw new Error("Method not implemented.");
@@ -1,9 +1,7 @@
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 { OAuthApp, OAuthAppCreate } from "../../../../../interfaces/idp/organization/settings/oauthApp";
5
4
  export declare class IdpOAuthApp extends Base {
6
- constructor(options: Options, axios: AxiosInstance);
7
5
  /**
8
6
  * Retrieves all OAuth apps of the specified Organization matching the provided search filter(s). Will return all OAuth apps if no search filter is provided.
9
7
  * @param orgName Name of the Organization
@@ -13,23 +11,23 @@ export declare class IdpOAuthApp 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 OAuth apps and the total number of results found in the database (independent of limit and page)
15
13
  */
16
- searchOauthAppsOfOrganization: ({ organizationName, filters, sorting, limit, page, }: SearchParams & {
14
+ searchOauthAppsOfOrganization({ organizationName, filters, sorting, limit, page, }: SearchParams & {
17
15
  organizationName: string;
18
- }) => Promise<PaginatedResponse<OAuthApp>>;
16
+ }): Promise<PaginatedResponse<OAuthApp>>;
19
17
  /**
20
18
  * Retrieves an OAuthApp by its ID.
21
19
  * @param orgName Name of the Organization
22
20
  * @param oauthAppId ID of the OAuthApp
23
21
  * @returns the requested OAuthApp
24
22
  */
25
- getOAuthApp: (orgName: string, oauthAppId: string) => Promise<OAuthApp>;
23
+ getOAuthApp(orgName: string, oauthAppId: string): Promise<OAuthApp>;
26
24
  /**
27
25
  * Creates a new OAuth app in the specified Organization.
28
26
  * @param orgName Name of the Organization
29
27
  * @param oAuthAppCreate Object containing the app's name, secretName, callback and optionally a base64 encoded avatar and a description
30
28
  * @returns The created OAuth app
31
29
  */
32
- createOAuthApp: (orgName: string, oAuthAppCreate: OAuthAppCreate) => Promise<OAuthApp>;
30
+ createOAuthApp(orgName: string, oAuthAppCreate: OAuthAppCreate): Promise<OAuthApp>;
33
31
  /**
34
32
  * Updates an existing OAuth app.
35
33
  * @param orgName Name of the Organization
@@ -37,13 +35,13 @@ export declare class IdpOAuthApp extends Base {
37
35
  * @param oAuthAppCreate Object containing the app's name, secretName, callback and optionally a base64 encoded avatar and a description
38
36
  * @returns the updated OAuth app
39
37
  */
40
- updateOAuthApp: (orgName: string, oauthAppId: string, oAuthAppCreate: OAuthAppCreate) => Promise<OAuthApp>;
38
+ updateOAuthApp(orgName: string, oauthAppId: string, oAuthAppCreate: OAuthAppCreate): Promise<OAuthApp>;
41
39
  /**
42
40
  * Deletes an OAuthApp by its ID.
43
41
  * @param orgName Name of the Organization
44
42
  * @param oauthAppId ID of the OAuthApp
45
43
  */
46
- deleteOAuthApp: (orgName: string, oauthAppId: string) => Promise<void>;
44
+ deleteOAuthApp(orgName: string, oauthAppId: string): Promise<void>;
47
45
  /**
48
46
  * Creates a new secret for an existing OAuthApp.
49
47
  * @param orgName Name of the Organization
@@ -51,7 +49,7 @@ export declare class IdpOAuthApp extends Base {
51
49
  * @param secretName Name of the Secret
52
50
  * @returns the updated OAuth app
53
51
  */
54
- createOAuthAppSecret: (orgName: string, oauthAppId: string, secretName: string) => Promise<OAuthApp>;
52
+ createOAuthAppSecret(orgName: string, oauthAppId: string, secretName: string): Promise<OAuthApp>;
55
53
  /**
56
54
  * Deletes the specified OAuthApp secret.
57
55
  * @param orgName Name of the Organization
@@ -59,6 +57,6 @@ export declare class IdpOAuthApp extends Base {
59
57
  * @param secret Name of the secret that shall be deleted
60
58
  * @returns the updated OAuthApp
61
59
  */
62
- deleteOAuthAppSecret: (orgName: string, oauthAppId: string, secret: string) => Promise<OAuthApp>;
60
+ deleteOAuthAppSecret(orgName: string, oauthAppId: string, secret: string): Promise<OAuthApp>;
63
61
  protected getEndpoint(endpoint: string): string;
64
62
  }