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
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Base, { Options } from "../../../../../Base";
|
|
1
|
+
import Base from "../../../../../Base";
|
|
3
2
|
import { PaginatedResponse, SearchParams } from "../../../../../interfaces/global";
|
|
4
3
|
import { Pat, PatCreate, PatUpdate } from "../../../../../interfaces/idp/user/Pat";
|
|
5
4
|
export declare class IdpPat extends Base {
|
|
6
|
-
constructor(options: Options, axios: AxiosInstance);
|
|
7
5
|
/**
|
|
8
6
|
* Search all personal access tokens (PATs) of the requesting user.
|
|
9
7
|
* @returns Paginated response of PAT objects
|
|
10
8
|
*/
|
|
11
|
-
searchPats
|
|
9
|
+
searchPats({ filters, sorting, limit, page }: SearchParams): Promise<PaginatedResponse<Pat>>;
|
|
12
10
|
/**
|
|
13
11
|
* Retrieves a single personal access token (PAT) by ID.
|
|
14
12
|
* @param patId ID of the PAT
|
|
15
13
|
* @returns The requested PAT object
|
|
16
14
|
*/
|
|
17
|
-
getPat
|
|
15
|
+
getPat(patId: string): Promise<Pat>;
|
|
18
16
|
/**
|
|
19
17
|
* Regenerates a personal access token (PAT).
|
|
20
18
|
* @param patId ID of the PAT
|
|
21
19
|
* @returns PAT object holding the updated token
|
|
22
20
|
*/
|
|
23
|
-
regeneratePat
|
|
21
|
+
regeneratePat(patId: string, token?: string): Promise<Pat>;
|
|
24
22
|
/**
|
|
25
23
|
* Creates a new personal access token (PAT) for requesting user
|
|
26
24
|
* @param patCreate Object with informations needed to create a PAT: Name, expiration and scopes
|
|
27
25
|
* @returns the created PAT object
|
|
28
26
|
*/
|
|
29
|
-
generatePat
|
|
27
|
+
generatePat(patCreate: PatCreate): Promise<Pat>;
|
|
30
28
|
/**
|
|
31
29
|
* Updates an existing PAT object.
|
|
32
30
|
*
|
|
@@ -36,15 +34,15 @@ export declare class IdpPat extends Base {
|
|
|
36
34
|
* @param patUpdate Object containing new name, expiration and scopes
|
|
37
35
|
* @returns the updated PAT object
|
|
38
36
|
*/
|
|
39
|
-
updatePat
|
|
37
|
+
updatePat(patId: string, patUpdate: PatUpdate): Promise<Pat>;
|
|
40
38
|
/**
|
|
41
39
|
* Deletes a personal access token (PAT) of the requesting User.
|
|
42
40
|
* @param patId Id of the PAT
|
|
43
41
|
*/
|
|
44
|
-
deletePat
|
|
42
|
+
deletePat(patId: string): Promise<void>;
|
|
45
43
|
/**
|
|
46
44
|
* Deletes all personal access tokens (PATs) of the requesting User.
|
|
47
45
|
*/
|
|
48
|
-
deleteAllPats
|
|
46
|
+
deleteAllPats(): Promise<void>;
|
|
49
47
|
protected getEndpoint(endpoint: string): string;
|
|
50
48
|
}
|
|
@@ -14,13 +14,12 @@ const Base_1 = require("../../../../../Base");
|
|
|
14
14
|
const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
|
|
15
15
|
const searchFilter_1 = require("../../../../../helper/searchFilter");
|
|
16
16
|
class IdpPat extends Base_1.default {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
this.searchPats = (_a) => __awaiter(this, [_a], void 0, function* ({ filters, sorting, limit = 25, page = 0 }) {
|
|
17
|
+
/**
|
|
18
|
+
* Search all personal access tokens (PATs) of the requesting user.
|
|
19
|
+
* @returns Paginated response of PAT objects
|
|
20
|
+
*/
|
|
21
|
+
searchPats(_a) {
|
|
22
|
+
return __awaiter(this, arguments, void 0, function* ({ filters, sorting, limit = 25, page = 0 }) {
|
|
24
23
|
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
25
24
|
return new searchFilter_1.SearchFilterDTO(f);
|
|
26
25
|
});
|
|
@@ -32,57 +31,69 @@ class IdpPat extends Base_1.default {
|
|
|
32
31
|
});
|
|
33
32
|
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
34
33
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Retrieves a single personal access token (PAT) by ID.
|
|
37
|
+
* @param patId ID of the PAT
|
|
38
|
+
* @returns The requested PAT object
|
|
39
|
+
*/
|
|
40
|
+
getPat(patId) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
42
|
const resp = yield this.axios.get(this.getEndpoint(`/v1/user/settings/pats/${patId}`));
|
|
42
43
|
return resp.data;
|
|
43
44
|
});
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Regenerates a personal access token (PAT).
|
|
48
|
+
* @param patId ID of the PAT
|
|
49
|
+
* @returns PAT object holding the updated token
|
|
50
|
+
*/
|
|
51
|
+
regeneratePat(patId, token) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
53
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/pats/${patId}/regenerate`), { token });
|
|
51
54
|
return resp.data;
|
|
52
55
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Creates a new personal access token (PAT) for requesting user
|
|
59
|
+
* @param patCreate Object with informations needed to create a PAT: Name, expiration and scopes
|
|
60
|
+
* @returns the created PAT object
|
|
61
|
+
*/
|
|
62
|
+
generatePat(patCreate) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
64
|
const resp = yield this.axios.post(this.getEndpoint(`/v1/user/settings/pats`), patCreate);
|
|
60
65
|
return resp.data;
|
|
61
66
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Updates an existing PAT object.
|
|
70
|
+
*
|
|
71
|
+
* Use an expiration value of -1 to remove the token's expiration date.
|
|
72
|
+
*
|
|
73
|
+
* @param patId ID of the pat object
|
|
74
|
+
* @param patUpdate Object containing new name, expiration and scopes
|
|
75
|
+
* @returns the updated PAT object
|
|
76
|
+
*/
|
|
77
|
+
updatePat(patId, patUpdate) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
79
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/pats/${patId}`), patUpdate);
|
|
73
80
|
return resp.data;
|
|
74
81
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Deletes a personal access token (PAT) of the requesting User.
|
|
85
|
+
* @param patId Id of the PAT
|
|
86
|
+
*/
|
|
87
|
+
deletePat(patId) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
89
|
yield this.axios.delete(this.getEndpoint(`/v1/user/settings/pats/${patId}`));
|
|
81
90
|
});
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Deletes all personal access tokens (PATs) of the requesting User.
|
|
94
|
+
*/
|
|
95
|
+
deleteAllPats() {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
97
|
yield this.axios.delete(this.getEndpoint(`/v1/user/settings/pats`));
|
|
87
98
|
});
|
|
88
99
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Base, { Options } from "../../../../../Base";
|
|
1
|
+
import Base from "../../../../../Base";
|
|
3
2
|
import { IdpTotp } from "./totp";
|
|
4
3
|
export declare class IdpTwoFactor extends Base {
|
|
5
4
|
/**
|
|
6
5
|
* Handles everything around a user's pats (Personal Access Tokens)
|
|
7
6
|
*/
|
|
8
|
-
totp: IdpTotp;
|
|
9
|
-
|
|
7
|
+
get totp(): IdpTotp;
|
|
8
|
+
private _totp?;
|
|
10
9
|
protected getEndpoint(endpoint: string): string;
|
|
11
10
|
}
|
|
@@ -4,9 +4,14 @@ exports.IdpTwoFactor = void 0;
|
|
|
4
4
|
const Base_1 = require("../../../../../Base");
|
|
5
5
|
const totp_1 = require("./totp");
|
|
6
6
|
class IdpTwoFactor extends Base_1.default {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Handles everything around a user's pats (Personal Access Tokens)
|
|
9
|
+
*/
|
|
10
|
+
get totp() {
|
|
11
|
+
if (this._totp === undefined) {
|
|
12
|
+
this._totp = new totp_1.IdpTotp(this.options, this.axios);
|
|
13
|
+
}
|
|
14
|
+
return this._totp;
|
|
10
15
|
}
|
|
11
16
|
getEndpoint(endpoint) {
|
|
12
17
|
return `${this.options.server}/api/account${endpoint}`;
|
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Base, { Options } from "../../../../../../Base";
|
|
1
|
+
import Base from "../../../../../../Base";
|
|
3
2
|
import { ActivatedTotp, DeactivatedTotp, UserTotp } from "../../../../../../interfaces/idp/user/Totp";
|
|
4
3
|
export declare class IdpTotp extends Base {
|
|
5
|
-
constructor(options: Options, axios: AxiosInstance);
|
|
6
4
|
/**
|
|
7
5
|
* Creates a new TOTP for the requesting User.
|
|
8
|
-
* @returns A deactivated TOTP object containing
|
|
6
|
+
* @returns A deactivated TOTP object containing all necessary data to create a QR code
|
|
9
7
|
*/
|
|
10
|
-
createTotp
|
|
8
|
+
createTotp(): Promise<DeactivatedTotp>;
|
|
11
9
|
/**
|
|
12
10
|
* Activates a previously created TOTP.
|
|
13
11
|
* @returns Object containing a list of recover codes in case of TOTP authenticator loss
|
|
14
12
|
*/
|
|
15
|
-
activateTotp
|
|
13
|
+
activateTotp(token: string): Promise<ActivatedTotp>;
|
|
16
14
|
/**
|
|
17
15
|
* Verifies a TOTP.
|
|
18
16
|
* @param userTotp TOTP to verify
|
|
19
17
|
*/
|
|
20
|
-
verifyTotp
|
|
18
|
+
verifyTotp(userTotp: UserTotp): Promise<void>;
|
|
21
19
|
/**
|
|
22
20
|
* Deactivates (deletes) a previously activated TOTP.
|
|
23
21
|
* @param token TOTP to deactivate
|
|
24
22
|
*/
|
|
25
|
-
deactivateTotp
|
|
23
|
+
deactivateTotp(token: string): Promise<void>;
|
|
26
24
|
/**
|
|
27
25
|
* Deactivates (deletes) a previously activated TOTP by using a recovery code.
|
|
28
26
|
* @param email Email of the User
|
|
29
27
|
* @param password Password
|
|
30
28
|
* @param code Recovery code
|
|
31
29
|
*/
|
|
32
|
-
deactivateTotpByRecoverCode
|
|
30
|
+
deactivateTotpByRecoverCode(email: string, password: string, code: string): Promise<void>;
|
|
33
31
|
protected getEndpoint(endpoint: string): string;
|
|
34
32
|
}
|
|
@@ -12,47 +12,54 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.IdpTotp = void 0;
|
|
13
13
|
const Base_1 = require("../../../../../../Base");
|
|
14
14
|
class IdpTotp extends Base_1.default {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
this.createTotp = () => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new TOTP for the requesting User.
|
|
17
|
+
* @returns A deactivated TOTP object containing all necessary data to create a QR code
|
|
18
|
+
*/
|
|
19
|
+
createTotp() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
21
|
const resp = yield this.axios.post(this.getEndpoint(`/v1/user/settings/security/2fa/totp`));
|
|
23
22
|
return resp.data;
|
|
24
23
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Activates a previously created TOTP.
|
|
27
|
+
* @returns Object containing a list of recover codes in case of TOTP authenticator loss
|
|
28
|
+
*/
|
|
29
|
+
activateTotp(token) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
31
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/security/2fa/totp/activate`), { token });
|
|
31
32
|
return resp.data;
|
|
32
33
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Verifies a TOTP.
|
|
37
|
+
* @param userTotp TOTP to verify
|
|
38
|
+
*/
|
|
39
|
+
verifyTotp(userTotp) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
41
|
yield this.axios.patch(this.getEndpoint(`/v1/login/verify/totp`), {
|
|
39
42
|
userTotp,
|
|
40
43
|
});
|
|
41
44
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Deactivates (deletes) a previously activated TOTP.
|
|
48
|
+
* @param token TOTP to deactivate
|
|
49
|
+
*/
|
|
50
|
+
deactivateTotp(token) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
52
|
yield this.axios.delete(this.getEndpoint(`/v1/user/settings/security/2fa/totp`), { data: { token } });
|
|
48
53
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Deactivates (deletes) a previously activated TOTP by using a recovery code.
|
|
57
|
+
* @param email Email of the User
|
|
58
|
+
* @param password Password
|
|
59
|
+
* @param code Recovery code
|
|
60
|
+
*/
|
|
61
|
+
deactivateTotpByRecoverCode(email, password, code) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
63
|
yield this.axios.delete(this.getEndpoint(`/v1/user/recover/totp`), {
|
|
57
64
|
data: { email, password, code },
|
|
58
65
|
});
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Base, { Options } from "../../Base";
|
|
1
|
+
import Base from "../../Base";
|
|
3
2
|
import { Version } from "../../interfaces/global";
|
|
4
3
|
import MailerInternal from "./internal";
|
|
5
4
|
export default class Mailer extends Base {
|
|
6
|
-
internal: MailerInternal;
|
|
7
|
-
|
|
5
|
+
get internal(): MailerInternal;
|
|
6
|
+
private _internal?;
|
|
8
7
|
/**
|
|
9
8
|
* Requests the endpoint version
|
|
10
9
|
* @returns Version object
|
|
11
10
|
*/
|
|
12
|
-
version
|
|
11
|
+
version(): Promise<Version>;
|
|
13
12
|
protected getEndpoint(endpoint: string): string;
|
|
14
13
|
}
|
|
@@ -12,17 +12,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
const Base_1 = require("../../Base");
|
|
13
13
|
const internal_1 = require("./internal");
|
|
14
14
|
class Mailer extends Base_1.default {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
get internal() {
|
|
16
|
+
if (this._internal === undefined) {
|
|
17
|
+
this._internal = new internal_1.default(this.options, this.axios);
|
|
18
|
+
}
|
|
19
|
+
return this._internal;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Requests the endpoint version
|
|
23
|
+
* @returns Version object
|
|
24
|
+
*/
|
|
25
|
+
version() {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
27
|
const resp = yield this.axios.get(this.getEndpoint("/v1/version"), {});
|
|
23
28
|
return resp.data;
|
|
24
29
|
});
|
|
25
|
-
this.internal = new internal_1.default(this.options, this.axios);
|
|
26
30
|
}
|
|
27
31
|
getEndpoint(endpoint) {
|
|
28
32
|
return `${this.options.server}/api/mailer${endpoint}`;
|
|
@@ -7,7 +7,7 @@ export default class MailerInternal extends Base {
|
|
|
7
7
|
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
8
8
|
* @param mail MailjetMailDTO
|
|
9
9
|
*/
|
|
10
|
-
sendMailMailjet
|
|
10
|
+
sendMailMailjet(mail: MailjetMailDTO): Promise<void>;
|
|
11
11
|
/**
|
|
12
12
|
* Sends a new mail based on a mustache html body.
|
|
13
13
|
*
|
|
@@ -15,7 +15,7 @@ export default class MailerInternal extends Base {
|
|
|
15
15
|
* @param mail TemplateMail
|
|
16
16
|
* @deprecated in favor of sendMailMailjet
|
|
17
17
|
*/
|
|
18
|
-
sendMailMustache
|
|
18
|
+
sendMailMustache(mail: MustacheMail): Promise<void>;
|
|
19
19
|
/**
|
|
20
20
|
* Sends a new mail based on a html body.
|
|
21
21
|
*
|
|
@@ -23,7 +23,7 @@ export default class MailerInternal extends Base {
|
|
|
23
23
|
* @param mail TemplateMail
|
|
24
24
|
* @deprecated in favor of sendMailMailjet
|
|
25
25
|
*/
|
|
26
|
-
sendMailHtml
|
|
26
|
+
sendMailHtml(mail: HtmlMail): Promise<void>;
|
|
27
27
|
/**
|
|
28
28
|
* Sends a new mail based on an existing template.
|
|
29
29
|
*
|
|
@@ -31,6 +31,6 @@ export default class MailerInternal extends Base {
|
|
|
31
31
|
* @param mail TemplateMail
|
|
32
32
|
* @deprecated in favor of sendMailMailjet
|
|
33
33
|
*/
|
|
34
|
-
sendMailTemplate
|
|
34
|
+
sendMailTemplate(mail: TemplateMail): Promise<void>;
|
|
35
35
|
protected getEndpoint(endpoint: string): string;
|
|
36
36
|
}
|
|
@@ -11,48 +11,53 @@ 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 MailerInternal extends Base_1.default {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.sendMailMailjet = (mail) => __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
/**
|
|
15
|
+
* Sends a new mail based on a mailjet template.
|
|
16
|
+
*
|
|
17
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
18
|
+
* @param mail MailjetMailDTO
|
|
19
|
+
*/
|
|
20
|
+
sendMailMailjet(mail) {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
22
|
const resp = yield this.axios.post(this.getEndpoint("/v1/send/mailjet"), mail);
|
|
24
23
|
return resp.data;
|
|
25
24
|
});
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Sends a new mail based on a mustache html body.
|
|
28
|
+
*
|
|
29
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
30
|
+
* @param mail TemplateMail
|
|
31
|
+
* @deprecated in favor of sendMailMailjet
|
|
32
|
+
*/
|
|
33
|
+
sendMailMustache(mail) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
35
|
const resp = yield this.axios.post(this.getEndpoint("/v1/send/mustache"), mail);
|
|
35
36
|
return resp.data;
|
|
36
37
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Sends a new mail based on a html body.
|
|
41
|
+
*
|
|
42
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
43
|
+
* @param mail TemplateMail
|
|
44
|
+
* @deprecated in favor of sendMailMailjet
|
|
45
|
+
*/
|
|
46
|
+
sendMailHtml(mail) {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
48
|
const resp = yield this.axios.post(this.getEndpoint("/v1/send/html"), mail);
|
|
46
49
|
return resp.data;
|
|
47
50
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Sends a new mail based on an existing template.
|
|
54
|
+
*
|
|
55
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
56
|
+
* @param mail TemplateMail
|
|
57
|
+
* @deprecated in favor of sendMailMailjet
|
|
58
|
+
*/
|
|
59
|
+
sendMailTemplate(mail) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
61
|
const resp = yield this.axios.post(this.getEndpoint("/v1/send/template"), mail);
|
|
57
62
|
return resp.data;
|
|
58
63
|
});
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Base, { Options } from "../../Base";
|
|
1
|
+
import Base from "../../Base";
|
|
3
2
|
import { PaginatedResponse, SearchParams, Version } from "../../interfaces/global";
|
|
4
3
|
import { Agent, TargetAgent } from "../../interfaces/mothership";
|
|
5
4
|
type RecurrentInfo = Pick<Agent, "uptime" | "cpuUtilization" | "memoryUsed" | "status">;
|
|
6
5
|
type HelloInfo = RecurrentInfo & {
|
|
7
6
|
nickname?: string;
|
|
8
7
|
bundleVersion: string;
|
|
8
|
+
installerVersion?: string;
|
|
9
|
+
ip?: string;
|
|
9
10
|
};
|
|
10
11
|
export default class MothershipService extends Base {
|
|
11
|
-
constructor(options: Options, axios: AxiosInstance);
|
|
12
12
|
/**
|
|
13
13
|
* Requests the endpoint version
|
|
14
14
|
* @returns Version object
|
|
15
15
|
*/
|
|
16
|
-
version
|
|
16
|
+
version(): Promise<Version>;
|
|
17
17
|
/**
|
|
18
18
|
* Say hello as an agent to the mothership
|
|
19
19
|
*
|
|
@@ -22,7 +22,7 @@ export default class MothershipService extends Base {
|
|
|
22
22
|
* @param info Information about the agent's uuid, hardware and nickname
|
|
23
23
|
* @return an Agent object
|
|
24
24
|
*/
|
|
25
|
-
hello
|
|
25
|
+
hello(uuid: string, uuidSignature: string, info: HelloInfo): Promise<{
|
|
26
26
|
agent: Agent;
|
|
27
27
|
token: string;
|
|
28
28
|
}>;
|
|
@@ -36,7 +36,7 @@ export default class MothershipService extends Base {
|
|
|
36
36
|
* @param info Information about the agent's system resources.
|
|
37
37
|
* @return an Agent object
|
|
38
38
|
*/
|
|
39
|
-
helloAgain
|
|
39
|
+
helloAgain(info: RecurrentInfo): Promise<Agent>;
|
|
40
40
|
/**
|
|
41
41
|
* Register an agent to the mothership.
|
|
42
42
|
*
|
|
@@ -47,7 +47,7 @@ export default class MothershipService extends Base {
|
|
|
47
47
|
* @param publicKey the public key of the agent that will be used for cryptography. The agent should remember its private key.
|
|
48
48
|
* @return an object holding a secret encrypted with the public key. The agent must decrypt it using its private key in order to use the /hello endpoint.
|
|
49
49
|
*/
|
|
50
|
-
register
|
|
50
|
+
register(uuid: string, info: Pick<Agent, Exclude<keyof Agent, "uuid" | "createDate" | "modifyDate" | "_id" | "ip">>, publicKey: string | Buffer): Promise<{
|
|
51
51
|
secret: string;
|
|
52
52
|
}>;
|
|
53
53
|
/**
|
|
@@ -61,7 +61,7 @@ export default class MothershipService extends Base {
|
|
|
61
61
|
* @param memberToken JWT assigned to a member of the organization
|
|
62
62
|
* @param email Email of the user owner of the JWT
|
|
63
63
|
*/
|
|
64
|
-
connect
|
|
64
|
+
connect(orgName: string, memberToken: string, email: string): Promise<void>;
|
|
65
65
|
/**
|
|
66
66
|
* Disconnect from an organization.
|
|
67
67
|
*
|
|
@@ -72,7 +72,7 @@ export default class MothershipService extends Base {
|
|
|
72
72
|
* @param orgName Name of the organization
|
|
73
73
|
* @param email Email of the user
|
|
74
74
|
*/
|
|
75
|
-
disconnect
|
|
75
|
+
disconnect(orgName: string, email: string): Promise<void>;
|
|
76
76
|
/**
|
|
77
77
|
* Disconnect as a target.
|
|
78
78
|
*
|
|
@@ -82,16 +82,16 @@ export default class MothershipService extends Base {
|
|
|
82
82
|
*
|
|
83
83
|
* @param email Email of the target
|
|
84
84
|
*/
|
|
85
|
-
disconnectTarget
|
|
85
|
+
disconnectTarget(email: string): Promise<void>;
|
|
86
86
|
/**
|
|
87
87
|
* Search among the available targets for a given organization.
|
|
88
88
|
*
|
|
89
89
|
* @param orgName Name of the organization
|
|
90
90
|
* @returns Object containing an array of retrieved agents and the total number of available found in the database (independent of limit and page)
|
|
91
91
|
*/
|
|
92
|
-
searchAvailableTargets
|
|
92
|
+
searchAvailableTargets({ orgName, filters, sorting, limit, page, }: SearchParams & {
|
|
93
93
|
orgName: string;
|
|
94
|
-
})
|
|
94
|
+
}): Promise<PaginatedResponse<TargetAgent>>;
|
|
95
95
|
protected getEndpoint(endpoint: string): string;
|
|
96
96
|
}
|
|
97
97
|
export {};
|