hcloud-sdk 14.13.2 → 15.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 (161) hide show
  1. package/changelog.md +36 -800
  2. package/lib/Hcloud.d.ts +20 -10
  3. package/lib/Hcloud.js +60 -10
  4. package/lib/interfaces/bouncer/features/index.d.ts +3 -6
  5. package/lib/interfaces/frontend/featureflags/index.d.ts +7 -0
  6. package/lib/interfaces/frontend/featureflags/index.js +2 -0
  7. package/lib/interfaces/high5/space/event/stream/node/index.d.ts +2 -0
  8. package/lib/interfaces/high5/space/execution/index.d.ts +11 -0
  9. package/lib/interfaces/high5/wave/changelog.d.ts +30 -0
  10. package/lib/interfaces/high5/wave/changelog.js +18 -0
  11. package/lib/interfaces/high5/wave/index.d.ts +31 -1
  12. package/lib/interfaces/high5/wave/index.js +10 -1
  13. package/lib/interfaces/idp/user/GeneralSettings.d.ts +1 -0
  14. package/lib/interfaces/mothership/index.d.ts +1 -0
  15. package/lib/interfaces/nats/index.d.ts +8 -21
  16. package/lib/interfaces/nats/index.js +72 -90
  17. package/lib/service/agent/bundle/dev/index.d.ts +2 -2
  18. package/lib/service/agent/bundle/dev/index.js +14 -10
  19. package/lib/service/agent/context/index.d.ts +7 -9
  20. package/lib/service/agent/context/index.js +41 -32
  21. package/lib/service/agent/index.d.ts +9 -7
  22. package/lib/service/agent/index.js +23 -6
  23. package/lib/service/auditor/index.d.ts +6 -7
  24. package/lib/service/auditor/index.js +23 -17
  25. package/lib/service/auditor/internal/index.d.ts +2 -2
  26. package/lib/service/auditor/internal/index.js +24 -20
  27. package/lib/service/bouncer/features/index.d.ts +1 -1
  28. package/lib/service/bouncer/features/index.js +5 -3
  29. package/lib/service/bouncer/index.d.ts +3 -10
  30. package/lib/service/bouncer/index.js +6 -21
  31. package/lib/service/dali/DaliAvatar.d.ts +13 -9
  32. package/lib/service/dali/DaliAvatar.js +53 -8
  33. package/lib/service/dali/avatar/DaliFuseSpace.d.ts +4 -6
  34. package/lib/service/dali/avatar/DaliFuseSpace.js +26 -23
  35. package/lib/service/dali/avatar/DaliHigh5Space.d.ts +4 -6
  36. package/lib/service/dali/avatar/DaliHigh5Space.js +26 -23
  37. package/lib/service/dali/avatar/DaliOAuthApp.d.ts +4 -6
  38. package/lib/service/dali/avatar/DaliOAuthApp.js +26 -23
  39. package/lib/service/dali/avatar/DaliOrganization.d.ts +4 -6
  40. package/lib/service/dali/avatar/DaliOrganization.js +23 -20
  41. package/lib/service/dali/avatar/DaliTeam.d.ts +4 -6
  42. package/lib/service/dali/avatar/DaliTeam.js +26 -23
  43. package/lib/service/dali/avatar/DaliUser.d.ts +4 -6
  44. package/lib/service/dali/avatar/DaliUser.js +20 -17
  45. package/lib/service/dali/index.d.ts +4 -5
  46. package/lib/service/dali/index.js +14 -7
  47. package/lib/service/fuse/index.d.ts +8 -7
  48. package/lib/service/fuse/index.js +23 -9
  49. package/lib/service/fuse/internal/index.d.ts +3 -4
  50. package/lib/service/fuse/internal/index.js +5 -3
  51. package/lib/service/fuse/internal/space/cronjob/index.d.ts +3 -4
  52. package/lib/service/fuse/internal/space/cronjob/index.js +5 -3
  53. package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +2 -4
  54. package/lib/service/fuse/internal/space/cronjob/log/index.js +11 -12
  55. package/lib/service/fuse/internal/space/index.d.ts +5 -6
  56. package/lib/service/fuse/internal/space/index.js +24 -18
  57. package/lib/service/fuse/space/cronjob/index.d.ts +15 -15
  58. package/lib/service/fuse/space/cronjob/index.js +133 -105
  59. package/lib/service/fuse/space/cronjob/log/index.d.ts +3 -3
  60. package/lib/service/fuse/space/cronjob/log/index.js +24 -23
  61. package/lib/service/fuse/space/index.d.ts +13 -14
  62. package/lib/service/fuse/space/index.js +88 -70
  63. package/lib/service/high5/execution/index.d.ts +5 -5
  64. package/lib/service/high5/execution/index.js +11 -4
  65. package/lib/service/high5/execution/log/index.d.ts +2 -2
  66. package/lib/service/high5/execution/log/index.js +11 -12
  67. package/lib/service/high5/execution/status/index.d.ts +2 -2
  68. package/lib/service/high5/execution/status/index.js +11 -12
  69. package/lib/service/high5/index.d.ts +12 -9
  70. package/lib/service/high5/index.js +36 -12
  71. package/lib/service/high5/internal/index.d.ts +3 -4
  72. package/lib/service/high5/internal/index.js +5 -3
  73. package/lib/service/high5/internal/space/index.d.ts +2 -2
  74. package/lib/service/high5/internal/space/index.js +19 -15
  75. package/lib/service/high5/joinToken/index.d.ts +4 -4
  76. package/lib/service/high5/joinToken/index.js +36 -28
  77. package/lib/service/high5/space/event/index.d.ts +9 -10
  78. package/lib/service/high5/space/event/index.js +58 -46
  79. package/lib/service/high5/space/event/stream/design/index.d.ts +23 -8
  80. package/lib/service/high5/space/event/stream/design/index.js +60 -25
  81. package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +5 -5
  82. package/lib/service/high5/space/event/stream/design/snapshot/index.js +65 -58
  83. package/lib/service/high5/space/event/stream/index.d.ts +14 -15
  84. package/lib/service/high5/space/event/stream/index.js +125 -103
  85. package/lib/service/high5/space/execution/index.d.ts +9 -9
  86. package/lib/service/high5/space/execution/index.js +57 -42
  87. package/lib/service/high5/space/execution/log/index.d.ts +4 -6
  88. package/lib/service/high5/space/execution/log/index.js +22 -21
  89. package/lib/service/high5/space/execution/status/index.d.ts +1 -1
  90. package/lib/service/high5/space/execution/status/index.js +10 -8
  91. package/lib/service/high5/space/index.d.ts +25 -21
  92. package/lib/service/high5/space/index.js +131 -86
  93. package/lib/service/high5/space/secret/index.d.ts +6 -6
  94. package/lib/service/high5/space/secret/index.js +59 -49
  95. package/lib/service/high5/space/wave/index.d.ts +7 -9
  96. package/lib/service/high5/space/wave/index.js +40 -33
  97. package/lib/service/high5/space/webhook/index.d.ts +21 -14
  98. package/lib/service/high5/space/webhook/index.js +106 -73
  99. package/lib/service/high5/space/webhook/log/index.d.ts +2 -4
  100. package/lib/service/high5/space/webhook/log/index.js +11 -12
  101. package/lib/service/high5/wave/s3/index.d.ts +6 -6
  102. package/lib/service/high5/wave/s3/index.js +50 -38
  103. package/lib/service/idp/index.d.ts +17 -15
  104. package/lib/service/idp/index.js +104 -56
  105. package/lib/service/idp/internal/index.d.ts +2 -4
  106. package/lib/service/idp/internal/index.js +10 -11
  107. package/lib/service/idp/oauth/index.d.ts +16 -12
  108. package/lib/service/idp/oauth/index.js +55 -43
  109. package/lib/service/idp/organization/index.d.ts +12 -10
  110. package/lib/service/idp/organization/index.js +63 -28
  111. package/lib/service/idp/organization/license/index.d.ts +2 -2
  112. package/lib/service/idp/organization/license/index.js +5 -4
  113. package/lib/service/idp/organization/member/index.d.ts +10 -11
  114. package/lib/service/idp/organization/member/index.js +62 -48
  115. package/lib/service/idp/organization/member/invitations/index.d.ts +3 -3
  116. package/lib/service/idp/organization/member/invitations/index.js +47 -43
  117. package/lib/service/idp/organization/settings/domain/index.d.ts +7 -8
  118. package/lib/service/idp/organization/settings/domain/index.js +42 -29
  119. package/lib/service/idp/organization/settings/domain/saml/index.d.ts +5 -5
  120. package/lib/service/idp/organization/settings/domain/saml/index.js +58 -48
  121. package/lib/service/idp/organization/settings/index.d.ts +5 -5
  122. package/lib/service/idp/organization/settings/index.js +17 -4
  123. package/lib/service/idp/organization/settings/oauth/index.d.ts +9 -11
  124. package/lib/service/idp/organization/settings/oauth/index.js +67 -56
  125. package/lib/service/idp/organization/team/index.d.ts +8 -8
  126. package/lib/service/idp/organization/team/index.js +64 -55
  127. package/lib/service/idp/registration/index.d.ts +4 -6
  128. package/lib/service/idp/registration/index.js +37 -34
  129. package/lib/service/idp/user/index.d.ts +16 -15
  130. package/lib/service/idp/user/index.js +86 -51
  131. package/lib/service/idp/user/license/index.d.ts +2 -2
  132. package/lib/service/idp/user/license/index.js +5 -4
  133. package/lib/service/idp/user/password/index.d.ts +1 -1
  134. package/lib/service/idp/user/password/index.js +10 -11
  135. package/lib/service/idp/user/settings/connections/index.d.ts +2 -4
  136. package/lib/service/idp/user/settings/connections/index.js +9 -10
  137. package/lib/service/idp/user/settings/general/index.d.ts +10 -6
  138. package/lib/service/idp/user/settings/general/index.js +25 -13
  139. package/lib/service/idp/user/settings/index.d.ts +13 -9
  140. package/lib/service/idp/user/settings/index.js +53 -8
  141. package/lib/service/idp/user/settings/notifications/index.d.ts +3 -5
  142. package/lib/service/idp/user/settings/notifications/index.js +14 -13
  143. package/lib/service/idp/user/settings/oauthApps/index.d.ts +3 -5
  144. package/lib/service/idp/user/settings/oauthApps/index.js +17 -16
  145. package/lib/service/idp/user/settings/pats/index.d.ts +8 -10
  146. package/lib/service/idp/user/settings/pats/index.js +55 -44
  147. package/lib/service/idp/user/settings/twoFactor/index.d.ts +3 -4
  148. package/lib/service/idp/user/settings/twoFactor/index.js +8 -3
  149. package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +6 -8
  150. package/lib/service/idp/user/settings/twoFactor/totp/index.js +36 -29
  151. package/lib/service/mailer/index.d.ts +4 -5
  152. package/lib/service/mailer/index.js +12 -8
  153. package/lib/service/mailer/internal/index.d.ts +4 -4
  154. package/lib/service/mailer/internal/index.js +38 -33
  155. package/lib/service/mothership/index.d.ts +12 -12
  156. package/lib/service/mothership/index.js +92 -79
  157. package/lib/service/nats/index.d.ts +1 -3
  158. package/lib/service/nats/index.js +2 -2
  159. package/lib/utils/bouncer/features/Provider.d.ts +3 -0
  160. package/lib/utils/bouncer/features/Provider.js +20 -2
  161. package/package.json +1 -1
@@ -17,33 +17,63 @@ const license_1 = require("./license");
17
17
  const password_1 = require("./password");
18
18
  const settings_1 = require("./settings");
19
19
  class IdpUser extends Base_1.default {
20
- constructor(options, axios) {
21
- super(options, axios);
22
- /**
23
- * Retrieves the User database entry for the requesting user.
24
- * @returns User object
25
- */
26
- this.getUser = () => __awaiter(this, void 0, void 0, function* () {
20
+ /**
21
+ * Handles everything around a user's settings
22
+ */
23
+ get settings() {
24
+ if (this._settings === undefined) {
25
+ this._settings = new settings_1.IdpSettings(this.options, this.axios);
26
+ }
27
+ return this._settings;
28
+ }
29
+ /**
30
+ * Handles everything around a user's password
31
+ */
32
+ get password() {
33
+ if (this._password === undefined) {
34
+ this._password = new password_1.default(this.options, this.axios);
35
+ }
36
+ return this._password;
37
+ }
38
+ /**
39
+ * Handles everything around a user's license
40
+ */
41
+ get license() {
42
+ if (this._license === undefined) {
43
+ this._license = new license_1.IdpUserLicense(this.options, this.axios);
44
+ }
45
+ return this._license;
46
+ }
47
+ /**
48
+ * Retrieves the User database entry for the requesting user.
49
+ * @returns User object
50
+ */
51
+ getUser() {
52
+ return __awaiter(this, void 0, void 0, function* () {
27
53
  const resp = yield this.axios.get(this.getEndpoint("/v1/user"));
28
54
  return resp.data;
29
55
  });
30
- /**
31
- * Updates the User database entry of the requesting user.
32
- * @param user UserPatch object holding the new User values
33
- * @returns User object
34
- */
35
- this.patchUser = (user) => __awaiter(this, void 0, void 0, function* () {
56
+ }
57
+ /**
58
+ * Updates the User database entry of the requesting user.
59
+ * @param user UserPatch object holding the new User values
60
+ * @returns User object
61
+ */
62
+ patchUser(user) {
63
+ return __awaiter(this, void 0, void 0, function* () {
36
64
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user`), user);
37
65
  return resp.data;
38
66
  });
39
- /**
40
- * Updates the Password of the requesting user.
41
- * @param oldPassword String object holding the old password
42
- * @param newPassword String object holding the new password
43
- * @param token String (optional) object holding the current TOTP token
44
- * @returns User object
45
- */
46
- this.patchUserPassword = (oldPassword, newPassword, totp) => __awaiter(this, void 0, void 0, function* () {
67
+ }
68
+ /**
69
+ * Updates the Password of the requesting user.
70
+ * @param oldPassword String object holding the old password
71
+ * @param newPassword String object holding the new password
72
+ * @param token String (optional) object holding the current TOTP token
73
+ * @returns User object
74
+ */
75
+ patchUserPassword(oldPassword, newPassword, totp) {
76
+ return __awaiter(this, void 0, void 0, function* () {
47
77
  const t = {
48
78
  old: oldPassword,
49
79
  new: newPassword,
@@ -55,28 +85,34 @@ class IdpUser extends Base_1.default {
55
85
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/password`), t);
56
86
  return resp.data;
57
87
  });
58
- /**
59
- * Deletes user session and logs him out of HCloud on all devices.
60
- */
61
- this.deleteUserSession = () => __awaiter(this, void 0, void 0, function* () {
88
+ }
89
+ /**
90
+ * Deletes user session and logs him out of HCloud on all devices.
91
+ */
92
+ deleteUserSession() {
93
+ return __awaiter(this, void 0, void 0, function* () {
62
94
  yield this.axios.delete(this.getEndpoint(`/v1/user/sessions`));
63
95
  });
64
- /**
65
- * Deletes the requesting user.
66
- */
67
- this.deleteUser = () => __awaiter(this, void 0, void 0, function* () {
96
+ }
97
+ /**
98
+ * Deletes the requesting user.
99
+ */
100
+ deleteUser() {
101
+ return __awaiter(this, void 0, void 0, function* () {
68
102
  yield this.axios.delete(this.getEndpoint(`/v1/user`));
69
103
  });
70
- /**
71
- * Retrieves all Organizations of a user that match the provided search filter(s). Returns all Organizations of the user if no search filter is provided.
72
- * @param filters (optional) Array of search filters
73
- * @param sorting (optional) Sorting object
74
- * @param limit (optional) Max number of results (1-100; defaults to 25)
75
- * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
76
- * @param options (optional) Defines query options to retrieve additional properties for the returned Organization objects.
77
- * @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
78
- */
79
- this.searchOrganizations = (params) => __awaiter(this, void 0, void 0, function* () {
104
+ }
105
+ /**
106
+ * Retrieves all Organizations of a user that match the provided search filter(s). Returns all Organizations of the user if no search filter is provided.
107
+ * @param filters (optional) Array of search filters
108
+ * @param sorting (optional) Sorting object
109
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
110
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
111
+ * @param options (optional) Defines query options to retrieve additional properties for the returned Organization objects.
112
+ * @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
113
+ */
114
+ searchOrganizations(params) {
115
+ return __awaiter(this, void 0, void 0, function* () {
80
116
  var _a, _b, _c;
81
117
  const limit = params.limit || 25;
82
118
  const page = params.page || 0;
@@ -93,15 +129,17 @@ class IdpUser extends Base_1.default {
93
129
  });
94
130
  return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
95
131
  });
96
- /**
97
- * Retrieves all organization invitations of a user that match the provided search filter(s). Returns all invitations of the user if no search filter is provided.
98
- * @param filters (optional) Array of search filters
99
- * @param sorting (optional) Sorting object
100
- * @param limit (optional) Max number of results (1-100; defaults to 25)
101
- * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
102
- * @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
103
- */
104
- this.searchInvitations = (params) => __awaiter(this, void 0, void 0, function* () {
132
+ }
133
+ /**
134
+ * Retrieves all organization invitations of a user that match the provided search filter(s). Returns all invitations of the user if no search filter is provided.
135
+ * @param filters (optional) Array of search filters
136
+ * @param sorting (optional) Sorting object
137
+ * @param limit (optional) Max number of results (1-100; defaults to 25)
138
+ * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
139
+ * @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
140
+ */
141
+ searchInvitations(params) {
142
+ return __awaiter(this, void 0, void 0, function* () {
105
143
  const limit = params.limit || 25;
106
144
  const page = params.page || 0;
107
145
  // convert SearchFilters to DTO
@@ -114,9 +152,6 @@ class IdpUser extends Base_1.default {
114
152
  });
115
153
  return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
116
154
  });
117
- this.settings = new settings_1.IdpSettings(options, axios);
118
- this.password = new password_1.default(options, axios);
119
- this.license = new license_1.IdpUserLicense(options, axios);
120
155
  }
121
156
  getEndpoint(endpoint) {
122
157
  return `${this.options.server}/api/account${endpoint}`;
@@ -1,7 +1,7 @@
1
1
  import Base from "../../../../Base";
2
2
  import { License } from "../../../../interfaces/idp/organization/license";
3
3
  export declare class IdpUserLicense extends Base {
4
- getLicense: () => Promise<License>;
5
- updateLicense: (token: string) => Promise<License>;
4
+ getLicense(): Promise<License>;
5
+ updateLicense(token: string): Promise<License>;
6
6
  protected getEndpoint(endpoint: string): string;
7
7
  }
@@ -12,13 +12,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.IdpUserLicense = void 0;
13
13
  const Base_1 = require("../../../../Base");
14
14
  class IdpUserLicense extends Base_1.default {
15
- constructor() {
16
- super(...arguments);
17
- this.getLicense = () => __awaiter(this, void 0, void 0, function* () {
15
+ getLicense() {
16
+ return __awaiter(this, void 0, void 0, function* () {
18
17
  const res = yield this.axios.get(this.getEndpoint(`/user/license`));
19
18
  return res.data;
20
19
  });
21
- this.updateLicense = (token) => __awaiter(this, void 0, void 0, function* () {
20
+ }
21
+ updateLicense(token) {
22
+ return __awaiter(this, void 0, void 0, function* () {
22
23
  const res = yield this.axios.put(this.getEndpoint(`/user/license`), { identifier: token });
23
24
  return res.data;
24
25
  });
@@ -9,7 +9,7 @@ export default class UserPasswordService extends Base {
9
9
  * @param totpToken (Optional) TOTP token in case the user had 2FA enabled
10
10
  * @returns User object
11
11
  */
12
- resetPassword: (email: string, nonce: string, newPassword: string, totpToken?: string) => Promise<User>;
12
+ resetPassword(email: string, nonce: string, newPassword: string, totpToken?: string): Promise<User>;
13
13
  parseResetPasswordToken(token: string): {
14
14
  email: string;
15
15
  nonce: string;
@@ -11,17 +11,16 @@ 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 UserPasswordService extends Base_1.default {
14
- constructor() {
15
- super(...arguments);
16
- /**
17
- * 2nd phase of the reset password flow
18
- * @param email Email of the user
19
- * @param nonce Nonce present in the link sent via email
20
- * @param newPassword New password
21
- * @param totpToken (Optional) TOTP token in case the user had 2FA enabled
22
- * @returns User object
23
- */
24
- this.resetPassword = (email, nonce, newPassword, totpToken) => __awaiter(this, void 0, void 0, function* () {
14
+ /**
15
+ * 2nd phase of the reset password flow
16
+ * @param email Email of the user
17
+ * @param nonce Nonce present in the link sent via email
18
+ * @param newPassword New password
19
+ * @param totpToken (Optional) TOTP token in case the user had 2FA enabled
20
+ * @returns User object
21
+ */
22
+ resetPassword(email, nonce, newPassword, totpToken) {
23
+ return __awaiter(this, void 0, void 0, function* () {
25
24
  const res = yield this.axios.post(this.getEndpoint("/v1/user/password/reset"), {
26
25
  email,
27
26
  nonce,
@@ -1,8 +1,6 @@
1
- import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../../../Base";
1
+ import Base from "../../../../../Base";
3
2
  import { ConnectionSettings } from "../../../../../interfaces/idp/user/ConnectionSettings";
4
3
  export declare class IdpConnections extends Base {
5
- constructor(options: Options, axios: AxiosInstance);
6
4
  /**
7
5
  * Get connection settings for all organizations the user is a part of.
8
6
  *
@@ -10,6 +8,6 @@ export declare class IdpConnections extends Base {
10
8
  *
11
9
  * @returns connection settings for each organization
12
10
  */
13
- get: () => Promise<ConnectionSettings>;
11
+ get(): Promise<ConnectionSettings>;
14
12
  protected getEndpoint(): string;
15
13
  }
@@ -12,16 +12,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.IdpConnections = void 0;
13
13
  const Base_1 = require("../../../../../Base");
14
14
  class IdpConnections extends Base_1.default {
15
- constructor(options, axios) {
16
- super(options, axios);
17
- /**
18
- * Get connection settings for all organizations the user is a part of.
19
- *
20
- * Must have a set authentication token.
21
- *
22
- * @returns connection settings for each organization
23
- */
24
- this.get = () => __awaiter(this, void 0, void 0, function* () {
15
+ /**
16
+ * Get connection settings for all organizations the user is a part of.
17
+ *
18
+ * Must have a set authentication token.
19
+ *
20
+ * @returns connection settings for each organization
21
+ */
22
+ get() {
23
+ return __awaiter(this, void 0, void 0, function* () {
25
24
  const res = yield this.axios.get(this.getEndpoint());
26
25
  return res.data;
27
26
  });
@@ -1,18 +1,22 @@
1
- import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../../../Base";
3
- import { GeneralSettings, GeneralSettingsPatch } from "../../../../../interfaces/idp/user/GeneralSettings";
1
+ import Base from "../../../../../Base";
2
+ import { GeneralSettings, GeneralSettingsLastVisitPatch, GeneralSettingsPatch } from "../../../../../interfaces/idp/user/GeneralSettings";
4
3
  export declare class IdpGeneral extends Base {
5
- constructor(options: Options, axios: AxiosInstance);
6
4
  /**
7
5
  * Retrieves the current active user settings.
8
6
  * @returns the current active user settings
9
7
  */
10
- getGeneralSettings: () => Promise<GeneralSettings>;
8
+ getGeneralSettings(): Promise<GeneralSettings>;
11
9
  /**
12
10
  * Changes the user settings.
13
11
  * @param generalSettingsPatch Object containing the new user settings
14
12
  * @returns the updated user settings
15
13
  */
16
- patchGeneralSettings: (generalSettingsPatch: GeneralSettingsPatch) => Promise<GeneralSettings>;
14
+ patchGeneralSettings(generalSettingsPatch: GeneralSettingsPatch): Promise<GeneralSettings>;
15
+ /**
16
+ * Changes the user last visit settings.
17
+ * @param generalSettingsLastVisitPatch Object containing the new user settings in case of lastView and lastURL
18
+ * @returns the updated user settings
19
+ */
20
+ patchGeneralSettingsLastVisit(generalSettingsLastVisitPatch: GeneralSettingsLastVisitPatch): Promise<GeneralSettings>;
17
21
  protected getEndpoint(endpoint: string): string;
18
22
  }
@@ -12,26 +12,38 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.IdpGeneral = void 0;
13
13
  const Base_1 = require("../../../../../Base");
14
14
  class IdpGeneral extends Base_1.default {
15
- constructor(options, axios) {
16
- super(options, axios);
17
- /**
18
- * Retrieves the current active user settings.
19
- * @returns the current active user settings
20
- */
21
- this.getGeneralSettings = () => __awaiter(this, void 0, void 0, function* () {
15
+ /**
16
+ * Retrieves the current active user settings.
17
+ * @returns the current active user settings
18
+ */
19
+ getGeneralSettings() {
20
+ return __awaiter(this, void 0, void 0, function* () {
22
21
  const resp = yield this.axios.get(this.getEndpoint(`/v1/user/settings/general`));
23
22
  return resp.data;
24
23
  });
25
- /**
26
- * Changes the user settings.
27
- * @param generalSettingsPatch Object containing the new user settings
28
- * @returns the updated user settings
29
- */
30
- this.patchGeneralSettings = (generalSettingsPatch) => __awaiter(this, void 0, void 0, function* () {
24
+ }
25
+ /**
26
+ * Changes the user settings.
27
+ * @param generalSettingsPatch Object containing the new user settings
28
+ * @returns the updated user settings
29
+ */
30
+ patchGeneralSettings(generalSettingsPatch) {
31
+ return __awaiter(this, void 0, void 0, function* () {
31
32
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/general`), generalSettingsPatch);
32
33
  return resp.data;
33
34
  });
34
35
  }
36
+ /**
37
+ * Changes the user last visit settings.
38
+ * @param generalSettingsLastVisitPatch Object containing the new user settings in case of lastView and lastURL
39
+ * @returns the updated user settings
40
+ */
41
+ patchGeneralSettingsLastVisit(generalSettingsLastVisitPatch) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/general/lastVisit`), generalSettingsLastVisitPatch);
44
+ return resp.data;
45
+ });
46
+ }
35
47
  getEndpoint(endpoint) {
36
48
  return `${this.options.server}/api/account${endpoint}`;
37
49
  }
@@ -1,5 +1,4 @@
1
- import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../../Base";
1
+ import Base from "../../../../Base";
3
2
  import { IdpConnections } from "./connections";
4
3
  import { IdpGeneral } from "./general";
5
4
  import { IdpNotifications } from "./notifications";
@@ -10,27 +9,32 @@ export declare class IdpSettings extends Base {
10
9
  /**
11
10
  * Handles everything around a user's pats (Personal Access Tokens)
12
11
  */
13
- pat: IdpPat;
12
+ get pat(): IdpPat;
13
+ private _pat?;
14
14
  /**
15
15
  * Handles everything around general user settings
16
16
  */
17
- general: IdpGeneral;
17
+ get general(): IdpGeneral;
18
+ private _general?;
18
19
  /**
19
20
  * Handles everything around notification settings of user
20
21
  */
21
- notifications: IdpNotifications;
22
+ get notifications(): IdpNotifications;
23
+ private _notifications?;
22
24
  /**
23
25
  * Manages user's OAuth applications
24
26
  */
25
- oAuthApps: IdpOAuthApps;
27
+ get oAuthApps(): IdpOAuthApps;
28
+ private _oAuthApps?;
26
29
  /**
27
30
  * Handles everything around a user's two factor authentication
28
31
  */
29
- twoFactor: IdpTwoFactor;
32
+ get twoFactor(): IdpTwoFactor;
33
+ private _twoFactor?;
30
34
  /**
31
35
  * Handles everything around a user's two factor authentication
32
36
  */
33
- connections: IdpConnections;
34
- constructor(options: Options, axios: AxiosInstance);
37
+ get connections(): IdpConnections;
38
+ private _connections?;
35
39
  protected getEndpoint(endpoint: string): string;
36
40
  }
@@ -9,14 +9,59 @@ const oauthApps_1 = require("./oauthApps");
9
9
  const pats_1 = require("./pats");
10
10
  const twoFactor_1 = require("./twoFactor");
11
11
  class IdpSettings extends Base_1.default {
12
- constructor(options, axios) {
13
- super(options, axios);
14
- this.pat = new pats_1.IdpPat(options, axios);
15
- this.twoFactor = new twoFactor_1.IdpTwoFactor(options, axios);
16
- this.general = new general_1.IdpGeneral(options, axios);
17
- this.notifications = new notifications_1.IdpNotifications(options, axios);
18
- this.oAuthApps = new oauthApps_1.IdpOAuthApps(options, axios);
19
- this.connections = new connections_1.IdpConnections(options, axios);
12
+ /**
13
+ * Handles everything around a user's pats (Personal Access Tokens)
14
+ */
15
+ get pat() {
16
+ if (this._pat === undefined) {
17
+ this._pat = new pats_1.IdpPat(this.options, this.axios);
18
+ }
19
+ return this._pat;
20
+ }
21
+ /**
22
+ * Handles everything around general user settings
23
+ */
24
+ get general() {
25
+ if (this._general === undefined) {
26
+ this._general = new general_1.IdpGeneral(this.options, this.axios);
27
+ }
28
+ return this._general;
29
+ }
30
+ /**
31
+ * Handles everything around notification settings of user
32
+ */
33
+ get notifications() {
34
+ if (this._notifications === undefined) {
35
+ this._notifications = new notifications_1.IdpNotifications(this.options, this.axios);
36
+ }
37
+ return this._notifications;
38
+ }
39
+ /**
40
+ * Manages user's OAuth applications
41
+ */
42
+ get oAuthApps() {
43
+ if (this._oAuthApps === undefined) {
44
+ this._oAuthApps = new oauthApps_1.IdpOAuthApps(this.options, this.axios);
45
+ }
46
+ return this._oAuthApps;
47
+ }
48
+ /**
49
+ * Handles everything around a user's two factor authentication
50
+ */
51
+ get twoFactor() {
52
+ if (this._twoFactor === undefined) {
53
+ this._twoFactor = new twoFactor_1.IdpTwoFactor(this.options, this.axios);
54
+ }
55
+ return this._twoFactor;
56
+ }
57
+ /**
58
+ * Handles everything around a user's two factor authentication
59
+ */
60
+ get connections() {
61
+ if (this._connections === undefined) {
62
+ this._connections = new connections_1.IdpConnections(this.options, this.axios);
63
+ }
64
+ return this._connections;
20
65
  }
21
66
  getEndpoint(endpoint) {
22
67
  return `${this.options.server}/api/account${endpoint}`;
@@ -1,18 +1,16 @@
1
- import { AxiosInstance } from "axios";
2
- import Base, { Options } from "../../../../../Base";
1
+ import Base from "../../../../../Base";
3
2
  import { NotificationSettings, NotificationSettingsPatch } from "../../../../../interfaces/idp/user/NotificationSettings";
4
3
  export declare class IdpNotifications extends Base {
5
- constructor(options: Options, axios: AxiosInstance);
6
4
  /**
7
5
  * Retrieves the notification settings of the requesting user.
8
6
  * @returns general settings of requesting user
9
7
  */
10
- getNotificationSettingsOfUser: () => Promise<NotificationSettings>;
8
+ getNotificationSettingsOfUser(): Promise<NotificationSettings>;
11
9
  /**
12
10
  * Updates the notification settings of the requesting user.
13
11
  * @param notificationSettingsPatch Object containing the new notification settings
14
12
  * @returns the updated notification settings
15
13
  */
16
- patchNotificationSettings: (notificationSettingsPatch: NotificationSettingsPatch) => Promise<NotificationSettings>;
14
+ patchNotificationSettings(notificationSettingsPatch: NotificationSettingsPatch): Promise<NotificationSettings>;
17
15
  protected getEndpoint(endpoint: string): string;
18
16
  }
@@ -12,22 +12,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.IdpNotifications = void 0;
13
13
  const Base_1 = require("../../../../../Base");
14
14
  class IdpNotifications extends Base_1.default {
15
- constructor(options, axios) {
16
- super(options, axios);
17
- /**
18
- * Retrieves the notification settings of the requesting user.
19
- * @returns general settings of requesting user
20
- */
21
- this.getNotificationSettingsOfUser = () => __awaiter(this, void 0, void 0, function* () {
15
+ /**
16
+ * Retrieves the notification settings of the requesting user.
17
+ * @returns general settings of requesting user
18
+ */
19
+ getNotificationSettingsOfUser() {
20
+ return __awaiter(this, void 0, void 0, function* () {
22
21
  const resp = yield this.axios.get(this.getEndpoint(`/v1/user/settings/notifications`));
23
22
  return resp.data;
24
23
  });
25
- /**
26
- * Updates the notification settings of the requesting user.
27
- * @param notificationSettingsPatch Object containing the new notification settings
28
- * @returns the updated notification settings
29
- */
30
- this.patchNotificationSettings = (notificationSettingsPatch) => __awaiter(this, void 0, void 0, function* () {
24
+ }
25
+ /**
26
+ * Updates the notification settings of the requesting user.
27
+ * @param notificationSettingsPatch Object containing the new notification settings
28
+ * @returns the updated notification settings
29
+ */
30
+ patchNotificationSettings(notificationSettingsPatch) {
31
+ return __awaiter(this, void 0, void 0, function* () {
31
32
  const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/notifications`), notificationSettingsPatch);
32
33
  return resp.data;
33
34
  });
@@ -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 { OAuthAppWithConsent } from "../../../../../interfaces/idp/organization/settings/oauthApp";
5
4
  export declare class IdpOAuthApps extends Base {
6
- constructor(options: Options, axios: AxiosInstance);
7
5
  /**
8
6
  * Retrieves all OAuth apps of the requesting User that match the provided search filter(s). Returns all OAuth apps if no search filter is provided.
9
7
  * @param filters (optional) Array of search filters
@@ -12,11 +10,11 @@ export declare class IdpOAuthApps extends Base {
12
10
  * @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
13
11
  * @returns Object containing an array of OAuth apps and the total number of results found in the database (independent of limit and page)
14
12
  */
15
- searchOAuthApps: ({ filters, sorting, limit, page }: SearchParams) => Promise<PaginatedResponse<OAuthAppWithConsent>>;
13
+ searchOAuthApps({ filters, sorting, limit, page }: SearchParams): Promise<PaginatedResponse<OAuthAppWithConsent>>;
16
14
  /**
17
15
  * Revokes user access from the provided OAuth app.
18
16
  * @param oAuthAppId ID of the OAuth app
19
17
  */
20
- revokeOAuthAppAccess: (oAuthAppId: string) => Promise<void>;
18
+ revokeOAuthAppAccess(oAuthAppId: string): Promise<void>;
21
19
  protected getEndpoint(endpoint: string): string;
22
20
  }
@@ -14,17 +14,16 @@ const Base_1 = require("../../../../../Base");
14
14
  const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
15
15
  const searchFilter_1 = require("../../../../../helper/searchFilter");
16
16
  class IdpOAuthApps extends Base_1.default {
17
- constructor(options, axios) {
18
- super(options, axios);
19
- /**
20
- * Retrieves all OAuth apps of the requesting User that match the provided search filter(s). Returns all OAuth apps if no search filter is provided.
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 OAuth apps and the total number of results found in the database (independent of limit and page)
26
- */
27
- this.searchOAuthApps = (_a) => __awaiter(this, [_a], void 0, function* ({ filters, sorting, limit = 25, page = 0 }) {
17
+ /**
18
+ * Retrieves all OAuth apps of the requesting User that match the provided search filter(s). Returns all OAuth apps if no search filter is provided.
19
+ * @param filters (optional) Array of search filters
20
+ * @param sorting (optional) Sorting object
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 OAuth apps and the total number of results found in the database (independent of limit and page)
24
+ */
25
+ searchOAuthApps(_a) {
26
+ return __awaiter(this, arguments, void 0, function* ({ filters, sorting, limit = 25, page = 0 }) {
28
27
  const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
29
28
  return new searchFilter_1.SearchFilterDTO(f);
30
29
  });
@@ -39,11 +38,13 @@ class IdpOAuthApps extends Base_1.default {
39
38
  });
40
39
  return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
41
40
  });
42
- /**
43
- * Revokes user access from the provided OAuth app.
44
- * @param oAuthAppId ID of the OAuth app
45
- */
46
- this.revokeOAuthAppAccess = (oAuthAppId) => __awaiter(this, void 0, void 0, function* () {
41
+ }
42
+ /**
43
+ * Revokes user access from the provided OAuth app.
44
+ * @param oAuthAppId ID of the OAuth app
45
+ */
46
+ revokeOAuthAppAccess(oAuthAppId) {
47
+ return __awaiter(this, void 0, void 0, function* () {
47
48
  yield this.axios.delete(this.getEndpoint(`/v1/user/settings/oauth/${oAuthAppId}/revoke`));
48
49
  });
49
50
  }