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.
- package/changelog.md +60 -806
- package/lib/Hcloud.d.ts +20 -10
- package/lib/Hcloud.js +60 -10
- package/lib/interfaces/auditor/index.d.ts +4 -2
- package/lib/interfaces/bouncer/features/index.d.ts +3 -6
- package/lib/interfaces/frontend/featureflags/index.d.ts +7 -0
- package/lib/interfaces/frontend/featureflags/index.js +2 -0
- package/lib/interfaces/high5/execution/index.d.ts +22 -0
- package/lib/interfaces/high5/execution/index.js +10 -0
- package/lib/interfaces/high5/index.d.ts +2 -2
- package/lib/interfaces/high5/index.js +2 -2
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +1 -0
- package/lib/interfaces/high5/space/event/stream/node/index.d.ts +16 -1
- package/lib/interfaces/high5/space/execution/index.d.ts +14 -0
- package/lib/interfaces/high5/space/pool/index.d.ts +30 -0
- package/lib/interfaces/high5/space/pool/index.js +9 -0
- package/lib/interfaces/high5/wave/changelog.d.ts +30 -0
- package/lib/interfaces/high5/wave/changelog.js +18 -0
- package/lib/interfaces/high5/wave/index.d.ts +48 -1
- package/lib/interfaces/high5/wave/index.js +14 -1
- package/lib/interfaces/idp/organization/member/index.d.ts +2 -0
- package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +1 -0
- package/lib/interfaces/idp/user/GeneralSettings.d.ts +1 -0
- package/lib/interfaces/idp/user/Scopes.d.ts +1 -0
- package/lib/interfaces/idp/user/Scopes.js +21 -1
- package/lib/interfaces/idp/user/Totp.d.ts +4 -2
- package/lib/interfaces/idp/user/index.d.ts +1 -0
- package/lib/interfaces/mothership/index.d.ts +1 -0
- package/lib/interfaces/nats/index.d.ts +35 -20
- package/lib/interfaces/nats/index.js +132 -94
- package/lib/service/agent/bundle/dev/index.d.ts +5 -2
- package/lib/service/agent/bundle/dev/index.js +30 -10
- package/lib/service/agent/context/index.d.ts +7 -9
- package/lib/service/agent/context/index.js +41 -32
- package/lib/service/agent/index.d.ts +9 -7
- package/lib/service/agent/index.js +23 -6
- package/lib/service/auditor/index.d.ts +6 -7
- package/lib/service/auditor/index.js +23 -17
- package/lib/service/auditor/internal/index.d.ts +2 -2
- package/lib/service/auditor/internal/index.js +24 -20
- package/lib/service/bouncer/features/index.d.ts +1 -1
- package/lib/service/bouncer/features/index.js +5 -3
- package/lib/service/bouncer/index.d.ts +3 -10
- package/lib/service/bouncer/index.js +6 -21
- package/lib/service/dali/DaliAvatar.d.ts +21 -11
- package/lib/service/dali/DaliAvatar.js +63 -8
- package/lib/service/dali/avatar/DaliFuseSpace.d.ts +5 -7
- package/lib/service/dali/avatar/DaliFuseSpace.js +29 -26
- package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +29 -0
- package/lib/service/dali/avatar/DaliHigh5Pool.js +61 -0
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +5 -7
- package/lib/service/dali/avatar/DaliHigh5Space.js +29 -26
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +4 -6
- package/lib/service/dali/avatar/DaliOAuthApp.js +26 -23
- package/lib/service/dali/avatar/DaliOrganization.d.ts +4 -6
- package/lib/service/dali/avatar/DaliOrganization.js +23 -20
- package/lib/service/dali/avatar/DaliTeam.d.ts +4 -6
- package/lib/service/dali/avatar/DaliTeam.js +26 -23
- package/lib/service/dali/avatar/DaliUser.d.ts +4 -6
- package/lib/service/dali/avatar/DaliUser.js +20 -17
- package/lib/service/dali/index.d.ts +4 -5
- package/lib/service/dali/index.js +14 -7
- package/lib/service/fuse/index.d.ts +8 -7
- package/lib/service/fuse/index.js +23 -9
- package/lib/service/fuse/internal/index.d.ts +3 -4
- package/lib/service/fuse/internal/index.js +5 -3
- package/lib/service/fuse/internal/space/cronjob/index.d.ts +3 -4
- package/lib/service/fuse/internal/space/cronjob/index.js +5 -3
- package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +2 -4
- package/lib/service/fuse/internal/space/cronjob/log/index.js +11 -12
- package/lib/service/fuse/internal/space/index.d.ts +5 -6
- package/lib/service/fuse/internal/space/index.js +24 -18
- package/lib/service/fuse/space/cronjob/index.d.ts +15 -15
- package/lib/service/fuse/space/cronjob/index.js +133 -105
- package/lib/service/fuse/space/cronjob/log/index.d.ts +3 -3
- package/lib/service/fuse/space/cronjob/log/index.js +24 -23
- package/lib/service/fuse/space/index.d.ts +13 -14
- package/lib/service/fuse/space/index.js +88 -70
- package/lib/service/high5/execution/index.d.ts +13 -5
- package/lib/service/high5/execution/index.js +32 -4
- package/lib/service/high5/execution/log/index.d.ts +2 -2
- package/lib/service/high5/execution/log/index.js +11 -12
- package/lib/service/high5/execution/status/index.d.ts +2 -2
- package/lib/service/high5/execution/status/index.js +11 -12
- package/lib/service/high5/index.d.ts +12 -9
- package/lib/service/high5/index.js +36 -12
- package/lib/service/high5/internal/index.d.ts +3 -4
- package/lib/service/high5/internal/index.js +5 -3
- package/lib/service/high5/internal/space/index.d.ts +2 -2
- package/lib/service/high5/internal/space/index.js +19 -15
- package/lib/service/high5/joinToken/index.d.ts +4 -4
- package/lib/service/high5/joinToken/index.js +36 -28
- package/lib/service/high5/space/event/index.d.ts +9 -10
- package/lib/service/high5/space/event/index.js +58 -46
- package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +1 -2
- package/lib/service/high5/space/event/stream/design/DesignOperations.js +2 -0
- package/lib/service/high5/space/event/stream/design/index.d.ts +23 -8
- package/lib/service/high5/space/event/stream/design/index.js +60 -25
- package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +5 -5
- package/lib/service/high5/space/event/stream/design/snapshot/index.js +65 -58
- package/lib/service/high5/space/event/stream/index.d.ts +14 -15
- package/lib/service/high5/space/event/stream/index.js +125 -103
- package/lib/service/high5/space/execution/index.d.ts +36 -9
- package/lib/service/high5/space/execution/index.js +96 -42
- package/lib/service/high5/space/execution/log/index.d.ts +4 -6
- package/lib/service/high5/space/execution/log/index.js +22 -21
- package/lib/service/high5/space/execution/status/index.d.ts +1 -1
- package/lib/service/high5/space/execution/status/index.js +10 -8
- package/lib/service/high5/space/index.d.ts +28 -21
- package/lib/service/high5/space/index.js +138 -86
- package/lib/service/high5/space/pool/index.d.ts +97 -0
- package/lib/service/high5/space/pool/index.js +171 -0
- package/lib/service/high5/space/secret/index.d.ts +6 -6
- package/lib/service/high5/space/secret/index.js +59 -49
- package/lib/service/high5/space/wave/index.d.ts +7 -9
- package/lib/service/high5/space/wave/index.js +40 -33
- package/lib/service/high5/space/webhook/index.d.ts +21 -14
- package/lib/service/high5/space/webhook/index.js +106 -73
- package/lib/service/high5/space/webhook/log/index.d.ts +2 -4
- package/lib/service/high5/space/webhook/log/index.js +11 -12
- package/lib/service/high5/wave/s3/index.d.ts +14 -7
- package/lib/service/high5/wave/s3/index.js +64 -38
- package/lib/service/idp/index.d.ts +17 -15
- package/lib/service/idp/index.js +104 -56
- package/lib/service/idp/internal/index.d.ts +2 -4
- package/lib/service/idp/internal/index.js +10 -11
- package/lib/service/idp/oauth/index.d.ts +16 -12
- package/lib/service/idp/oauth/index.js +56 -45
- package/lib/service/idp/organization/index.d.ts +12 -10
- package/lib/service/idp/organization/index.js +63 -28
- package/lib/service/idp/organization/license/index.d.ts +2 -2
- package/lib/service/idp/organization/license/index.js +5 -4
- package/lib/service/idp/organization/member/index.d.ts +10 -11
- package/lib/service/idp/organization/member/index.js +62 -48
- package/lib/service/idp/organization/member/invitations/index.d.ts +3 -3
- package/lib/service/idp/organization/member/invitations/index.js +47 -43
- package/lib/service/idp/organization/settings/domain/index.d.ts +7 -8
- package/lib/service/idp/organization/settings/domain/index.js +42 -29
- package/lib/service/idp/organization/settings/domain/saml/index.d.ts +5 -5
- package/lib/service/idp/organization/settings/domain/saml/index.js +58 -48
- package/lib/service/idp/organization/settings/index.d.ts +5 -5
- package/lib/service/idp/organization/settings/index.js +17 -4
- package/lib/service/idp/organization/settings/oauth/index.d.ts +9 -11
- package/lib/service/idp/organization/settings/oauth/index.js +67 -56
- package/lib/service/idp/organization/team/index.d.ts +8 -8
- package/lib/service/idp/organization/team/index.js +64 -55
- package/lib/service/idp/registration/index.d.ts +4 -6
- package/lib/service/idp/registration/index.js +38 -35
- package/lib/service/idp/user/index.d.ts +20 -15
- package/lib/service/idp/user/index.js +94 -51
- package/lib/service/idp/user/license/index.d.ts +2 -2
- package/lib/service/idp/user/license/index.js +5 -4
- package/lib/service/idp/user/password/index.d.ts +1 -1
- package/lib/service/idp/user/password/index.js +10 -11
- package/lib/service/idp/user/settings/connections/index.d.ts +2 -4
- package/lib/service/idp/user/settings/connections/index.js +9 -10
- package/lib/service/idp/user/settings/general/index.d.ts +10 -6
- package/lib/service/idp/user/settings/general/index.js +25 -13
- package/lib/service/idp/user/settings/index.d.ts +13 -9
- package/lib/service/idp/user/settings/index.js +53 -8
- package/lib/service/idp/user/settings/notifications/index.d.ts +3 -5
- package/lib/service/idp/user/settings/notifications/index.js +14 -13
- package/lib/service/idp/user/settings/oauthApps/index.d.ts +3 -5
- package/lib/service/idp/user/settings/oauthApps/index.js +17 -16
- package/lib/service/idp/user/settings/pats/index.d.ts +8 -10
- package/lib/service/idp/user/settings/pats/index.js +55 -44
- package/lib/service/idp/user/settings/twoFactor/index.d.ts +3 -4
- package/lib/service/idp/user/settings/twoFactor/index.js +8 -3
- package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +7 -9
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +36 -29
- package/lib/service/mailer/index.d.ts +4 -5
- package/lib/service/mailer/index.js +12 -8
- package/lib/service/mailer/internal/index.d.ts +4 -4
- package/lib/service/mailer/internal/index.js +38 -33
- package/lib/service/mothership/index.d.ts +12 -12
- package/lib/service/mothership/index.js +92 -79
- package/lib/service/nats/index.d.ts +1 -3
- package/lib/service/nats/index.js +2 -2
- package/lib/utils/bouncer/features/Provider.d.ts +3 -0
- package/lib/utils/bouncer/features/Provider.js +20 -2
- 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
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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,14 @@ class IdpUser extends Base_1.default {
|
|
|
114
152
|
});
|
|
115
153
|
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
116
154
|
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Maintains a user's online status
|
|
158
|
+
*/
|
|
159
|
+
ping() {
|
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
yield this.axios.get(this.getEndpoint("/v1/user/ping"));
|
|
162
|
+
});
|
|
120
163
|
}
|
|
121
164
|
getEndpoint(endpoint) {
|
|
122
165
|
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
|
|
5
|
-
updateLicense
|
|
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
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
|
2
|
-
import
|
|
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
|
|
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
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
this.
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
this.
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
}
|