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
|
@@ -12,17 +12,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.IdpOAuth = void 0;
|
|
13
13
|
const Base_1 = require("../../../Base");
|
|
14
14
|
class IdpOAuth extends Base_1.default {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.getAuthorizationCodeInsideRedirectUrl = (queryString, doNotRedirect) => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
/**
|
|
16
|
+
* getAuthorizationCodeInsideRedirectUrl throws for an invalid request (query params do not match OAuthApp).
|
|
17
|
+
* It returns the redirect URL with the code, which is used to redirect to the client application,
|
|
18
|
+
* which can use the code for a back-channel request to get the access token.
|
|
19
|
+
* @param queryString expect the user's / browser's query string, containing the response_type, client_id,
|
|
20
|
+
* redirect_uri, scopes and optionally state.
|
|
21
|
+
* @returns the entire redirect uri including the authorization code if successful
|
|
22
|
+
*/
|
|
23
|
+
getAuthorizationCodeInsideRedirectUrl(queryString, doNotRedirect) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
25
|
if (!queryString.startsWith("?")) {
|
|
27
26
|
queryString = `?${queryString}`;
|
|
28
27
|
}
|
|
@@ -35,20 +34,21 @@ class IdpOAuth extends Base_1.default {
|
|
|
35
34
|
}
|
|
36
35
|
return response.headers.location;
|
|
37
36
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Check if the user has consented to specified scopes. If the user has already consented this request
|
|
40
|
+
* will return the redirect URL, otherwise, it will be a consent.not.given error.
|
|
41
|
+
*
|
|
42
|
+
* To consent the createScopesAndGetAuthorizationCodeInsideRedirectUrl method should be used.
|
|
43
|
+
* @see IdpOAuth.createScopesAndGetAuthorizationCodeInsideRedirectUrl
|
|
44
|
+
*
|
|
45
|
+
* @param queryString {string} - Query string containing the OAuth parameters: response_type, client_id, scope, state
|
|
46
|
+
* @param doNotRedirect [boolean] - Flag to make the request return a 200 instead of a 3xx status code
|
|
47
|
+
* @returns A string with the redirect URL if the user already consented to the specificied scope. Otherwise, an OAuthApp
|
|
48
|
+
* @see OAuthApp
|
|
49
|
+
*/
|
|
50
|
+
getInfoOrAuthorizationCodeInsideRedirectUrl(queryString, doNotRedirect) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
52
|
if (!queryString.startsWith("?")) {
|
|
53
53
|
queryString = `?${queryString}`;
|
|
54
54
|
}
|
|
@@ -59,24 +59,21 @@ class IdpOAuth extends Base_1.default {
|
|
|
59
59
|
maxRedirects: 0,
|
|
60
60
|
});
|
|
61
61
|
if (response.status < 300) {
|
|
62
|
-
|
|
63
|
-
return response.data.redirectUrl;
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
return response.data;
|
|
67
|
-
}
|
|
62
|
+
return response.data.redirectUrl;
|
|
68
63
|
}
|
|
69
64
|
return response.headers.location;
|
|
70
65
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* createScopesAndGetAuthorizationCodeInsideRedirectUrl throws for an invalid request (query params do not match OAuthApp).
|
|
69
|
+
* It returns the redirect URL with the code, which is used to redirect to the client application,
|
|
70
|
+
* which can use the code for a back-channel request to get the access token. It also adds the scopes for the user.
|
|
71
|
+
* @param queryString expect the user's / browser's query string, containing the response_type, client_id,
|
|
72
|
+
* redirect_uri, scopes and optionally state.
|
|
73
|
+
* @returns the entire redirect uri including the authorization code if successful
|
|
74
|
+
*/
|
|
75
|
+
createScopesAndGetAuthorizationCodeInsideRedirectUrl(queryString, doNotRedirect) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
77
|
if (!queryString.startsWith("?")) {
|
|
81
78
|
queryString = `?${queryString}`;
|
|
82
79
|
}
|
|
@@ -89,15 +86,29 @@ class IdpOAuth extends Base_1.default {
|
|
|
89
86
|
}
|
|
90
87
|
return response.data;
|
|
91
88
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A valid code can be used to request a new API token.
|
|
92
|
+
* @param tokenRequest contains the code, client_id, client_secret and redirect_uri
|
|
93
|
+
*/
|
|
94
|
+
exchangeCodeForToken(tokenRequest) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
97
96
|
const response = yield this.axios.post(this.getEndpoint(`/v1/login/oauth/access_token`), tokenRequest);
|
|
98
97
|
return response.data;
|
|
99
98
|
});
|
|
100
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Get OAuth app public information via client ID
|
|
102
|
+
*
|
|
103
|
+
* @param clientId {string} - Client ID of the OAuth app
|
|
104
|
+
* @returns Public OAuth app information
|
|
105
|
+
*/
|
|
106
|
+
getOAuthAppInfo(clientId) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
const response = yield this.axios.get(this.getEndpoint(`/v1/login/oauth/app/${clientId}`));
|
|
109
|
+
return response.data;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
101
112
|
getEndpoint(endpoint) {
|
|
102
113
|
return `${this.options.server}/api/account${endpoint}`;
|
|
103
114
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Base, { Options } from "../../../Base";
|
|
1
|
+
import Base from "../../../Base";
|
|
3
2
|
import { Organization, OrganizationQueryOptions } from "../../../interfaces/idp/organization";
|
|
4
3
|
import { IdpOrganizationLicense } from "./license";
|
|
5
4
|
import { IdpOrganizationMember } from "./member";
|
|
@@ -9,20 +8,23 @@ export declare class IdpOrganization extends Base {
|
|
|
9
8
|
/**
|
|
10
9
|
* Handles everything around organization members
|
|
11
10
|
*/
|
|
12
|
-
member: IdpOrganizationMember;
|
|
11
|
+
get member(): IdpOrganizationMember;
|
|
12
|
+
private _member?;
|
|
13
13
|
/**
|
|
14
14
|
* Handles everything around organization settings
|
|
15
15
|
*/
|
|
16
|
-
settings: IdpOrganizationSettings;
|
|
16
|
+
get settings(): IdpOrganizationSettings;
|
|
17
|
+
private _settings?;
|
|
17
18
|
/**
|
|
18
19
|
* Handles everything around teams of organizations.
|
|
19
20
|
*/
|
|
20
|
-
teams: IdpOrganizationTeams;
|
|
21
|
+
get teams(): IdpOrganizationTeams;
|
|
22
|
+
private _teams?;
|
|
21
23
|
/**
|
|
22
24
|
* Handles everything around licenses.
|
|
23
25
|
*/
|
|
24
|
-
license: IdpOrganizationLicense;
|
|
25
|
-
|
|
26
|
+
get license(): IdpOrganizationLicense;
|
|
27
|
+
private _license?;
|
|
26
28
|
/**
|
|
27
29
|
* Updates an Organization.
|
|
28
30
|
* @param orgName Current name of the Organization
|
|
@@ -30,14 +32,14 @@ export declare class IdpOrganization extends Base {
|
|
|
30
32
|
* @param company (optional) New company name
|
|
31
33
|
* @returns The updated Organization
|
|
32
34
|
*/
|
|
33
|
-
updateOrganization
|
|
35
|
+
updateOrganization(orgName: string, newName: string, company?: string): Promise<Organization>;
|
|
34
36
|
/**
|
|
35
37
|
* Creates a new Organization.
|
|
36
38
|
* @param name Name of the new Organization
|
|
37
39
|
* @param company (optional) Company name for the new Organization
|
|
38
40
|
* @returns The created Organization
|
|
39
41
|
*/
|
|
40
|
-
createOrganization
|
|
42
|
+
createOrganization(name: string, company?: string): Promise<Organization>;
|
|
41
43
|
/**
|
|
42
44
|
* Retrieves an Organization by its name.
|
|
43
45
|
* @param orgName Name of the Organization
|
|
@@ -49,6 +51,6 @@ export declare class IdpOrganization extends Base {
|
|
|
49
51
|
* Deletes an Organization. This will also delete all dependencies that the Organization has (Teams, Spaces, apps, ...).
|
|
50
52
|
* @param orgName Name of the Organization to be deleted
|
|
51
53
|
*/
|
|
52
|
-
deleteOrganization
|
|
54
|
+
deleteOrganization(orgName: string): Promise<void>;
|
|
53
55
|
protected getEndpoint(endpoint: string): string;
|
|
54
56
|
}
|
|
@@ -16,42 +16,68 @@ const member_1 = require("./member");
|
|
|
16
16
|
const settings_1 = require("./settings");
|
|
17
17
|
const team_1 = require("./team");
|
|
18
18
|
class IdpOrganization extends Base_1.default {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Handles everything around organization members
|
|
21
|
+
*/
|
|
22
|
+
get member() {
|
|
23
|
+
if (this._member === undefined) {
|
|
24
|
+
this._member = new member_1.IdpOrganizationMember(this.options, this.axios);
|
|
25
|
+
}
|
|
26
|
+
return this._member;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Handles everything around organization settings
|
|
30
|
+
*/
|
|
31
|
+
get settings() {
|
|
32
|
+
if (this._settings === undefined) {
|
|
33
|
+
this._settings = new settings_1.default(this.options, this.axios);
|
|
34
|
+
}
|
|
35
|
+
return this._settings;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Handles everything around teams of organizations.
|
|
39
|
+
*/
|
|
40
|
+
get teams() {
|
|
41
|
+
if (this._teams === undefined) {
|
|
42
|
+
this._teams = new team_1.IdpOrganizationTeams(this.options, this.axios);
|
|
43
|
+
}
|
|
44
|
+
return this._teams;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Handles everything around licenses.
|
|
48
|
+
*/
|
|
49
|
+
get license() {
|
|
50
|
+
if (this._license === undefined) {
|
|
51
|
+
this._license = new license_1.IdpOrganizationLicense(this.options, this.axios);
|
|
52
|
+
}
|
|
53
|
+
return this._license;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Updates an Organization.
|
|
57
|
+
* @param orgName Current name of the Organization
|
|
58
|
+
* @param newName New name for the organization
|
|
59
|
+
* @param company (optional) New company name
|
|
60
|
+
* @returns The updated Organization
|
|
61
|
+
*/
|
|
62
|
+
updateOrganization(orgName, newName, company) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
64
|
const organization = { name: newName, company: company };
|
|
30
65
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}`), organization);
|
|
31
66
|
return resp.data;
|
|
32
67
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Creates a new Organization.
|
|
71
|
+
* @param name Name of the new Organization
|
|
72
|
+
* @param company (optional) Company name for the new Organization
|
|
73
|
+
* @returns The created Organization
|
|
74
|
+
*/
|
|
75
|
+
createOrganization(name, company) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
77
|
const organization = { name: name, company: company };
|
|
41
78
|
const resp = yield this.axios.post(this.getEndpoint(`/v1/org`), organization);
|
|
42
79
|
return resp.data;
|
|
43
80
|
});
|
|
44
|
-
/**
|
|
45
|
-
* Deletes an Organization. This will also delete all dependencies that the Organization has (Teams, Spaces, apps, ...).
|
|
46
|
-
* @param orgName Name of the Organization to be deleted
|
|
47
|
-
*/
|
|
48
|
-
this.deleteOrganization = (orgName) => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}`));
|
|
50
|
-
});
|
|
51
|
-
this.member = new member_1.IdpOrganizationMember(this.options, this.axios);
|
|
52
|
-
this.teams = new team_1.IdpOrganizationTeams(this.options, this.axios);
|
|
53
|
-
this.settings = new settings_1.default(this.options, this.axios);
|
|
54
|
-
this.license = new license_1.IdpOrganizationLicense(this.options, this.axios);
|
|
55
81
|
}
|
|
56
82
|
/**
|
|
57
83
|
* Retrieves an Organization by its name.
|
|
@@ -72,6 +98,15 @@ class IdpOrganization extends Base_1.default {
|
|
|
72
98
|
return resp.data;
|
|
73
99
|
});
|
|
74
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Deletes an Organization. This will also delete all dependencies that the Organization has (Teams, Spaces, apps, ...).
|
|
103
|
+
* @param orgName Name of the Organization to be deleted
|
|
104
|
+
*/
|
|
105
|
+
deleteOrganization(orgName) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}`));
|
|
108
|
+
});
|
|
109
|
+
}
|
|
75
110
|
getEndpoint(endpoint) {
|
|
76
111
|
return `${this.options.server}/api/account${endpoint}`;
|
|
77
112
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Base from "../../../../Base";
|
|
2
2
|
import { License } from "../../../../interfaces/idp/organization/license";
|
|
3
3
|
export declare class IdpOrganizationLicense extends Base {
|
|
4
|
-
getLicense
|
|
5
|
-
updateLicense
|
|
4
|
+
getLicense(orgName: string): Promise<License>;
|
|
5
|
+
updateLicense(orgName: string, 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.IdpOrganizationLicense = void 0;
|
|
13
13
|
const Base_1 = require("../../../../Base");
|
|
14
14
|
class IdpOrganizationLicense extends Base_1.default {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.getLicense = (orgName) => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
getLicense(orgName) {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
17
|
const res = yield this.axios.get(this.getEndpoint(`/org/${orgName}/license`));
|
|
19
18
|
return res.data;
|
|
20
19
|
});
|
|
21
|
-
|
|
20
|
+
}
|
|
21
|
+
updateLicense(orgName, token) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
23
|
const res = yield this.axios.put(this.getEndpoint(`/org/${orgName}/license`), { identifier: token });
|
|
23
24
|
return res.data;
|
|
24
25
|
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Base, { Options } from "../../../../Base";
|
|
1
|
+
import Base from "../../../../Base";
|
|
3
2
|
import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
|
|
4
3
|
import { OrganizationMember, OrgMemberPatch } from "../../../../interfaces/idp/organization/member";
|
|
5
4
|
import IdpOrganizationMemberInvitations from "./invitations";
|
|
6
5
|
export declare class IdpOrganizationMember extends Base {
|
|
7
|
-
invitations: IdpOrganizationMemberInvitations;
|
|
8
|
-
|
|
6
|
+
get invitations(): IdpOrganizationMemberInvitations;
|
|
7
|
+
private _invitations?;
|
|
9
8
|
/**
|
|
10
9
|
* Retrieves all organization members that match the provided search filter(s). Will return all members of the organization if no search filter is provided.
|
|
11
10
|
* @param orgName Name of the Organization
|
|
@@ -16,17 +15,17 @@ export declare class IdpOrganizationMember extends Base {
|
|
|
16
15
|
* @param page (optional) Page number to skip the first (page * limit) results (defaults to 0)
|
|
17
16
|
* @returns Object containing an array of Organization Members and the total number of results found in the database (independent of limit and page)
|
|
18
17
|
*/
|
|
19
|
-
searchOrganizationMembers
|
|
18
|
+
searchOrganizationMembers({ orgName, filters, excludeTeamByName, sorting, limit, page, }: SearchParams & {
|
|
20
19
|
orgName: string;
|
|
21
20
|
excludeTeamByName?: string;
|
|
22
|
-
})
|
|
21
|
+
}): Promise<PaginatedResponse<OrganizationMember>>;
|
|
23
22
|
/**
|
|
24
23
|
* Retrieves an organization member by its user ID.
|
|
25
24
|
* @param orgName Name of the organization
|
|
26
25
|
* @param userId ID of the user
|
|
27
26
|
* @returns The requested Organization Member
|
|
28
27
|
*/
|
|
29
|
-
getOrganizationMember
|
|
28
|
+
getOrganizationMember(orgName: string, userId: string): Promise<OrganizationMember>;
|
|
30
29
|
/**
|
|
31
30
|
* Updates the role of a User in the specified Organization.
|
|
32
31
|
* @param orgName Name of the Organization
|
|
@@ -34,7 +33,7 @@ export declare class IdpOrganizationMember extends Base {
|
|
|
34
33
|
* @param orgMemberPatch New role
|
|
35
34
|
* @returns The updated OrganizationMember
|
|
36
35
|
*/
|
|
37
|
-
patchOrganizationMemberRole
|
|
36
|
+
patchOrganizationMemberRole(orgName: string, userId: string, orgMemberPatch: OrgMemberPatch): Promise<OrganizationMember>;
|
|
38
37
|
/**
|
|
39
38
|
* Updates the executionTarget flag of a User in the specified Organization.
|
|
40
39
|
* @param orgName Name of the Organization
|
|
@@ -42,17 +41,17 @@ export declare class IdpOrganizationMember extends Base {
|
|
|
42
41
|
* @param executionTarget Boolean value to set
|
|
43
42
|
* @returns The updated OrganizationMember
|
|
44
43
|
*/
|
|
45
|
-
patchOrganizationExecutionTarget
|
|
44
|
+
patchOrganizationExecutionTarget(orgName: string, userId: string, executionTarget: boolean): Promise<OrganizationMember>;
|
|
46
45
|
/**
|
|
47
46
|
* Removes a Member from an Organization.
|
|
48
47
|
* @param orgName Name of the Organization
|
|
49
48
|
* @param userId ID of the User
|
|
50
49
|
*/
|
|
51
|
-
removeOrganizationMember
|
|
50
|
+
removeOrganizationMember(orgName: string, userId: string): Promise<void>;
|
|
52
51
|
/**
|
|
53
52
|
* Member leaves the organization independently.
|
|
54
53
|
* @param orgName Name of the Organization
|
|
55
54
|
*/
|
|
56
|
-
leaveOrganization
|
|
55
|
+
leaveOrganization(orgName: string): Promise<void>;
|
|
57
56
|
protected getEndpoint(endpoint: string): string;
|
|
58
57
|
}
|
|
@@ -15,19 +15,24 @@ const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseH
|
|
|
15
15
|
const searchFilter_1 = require("../../../../helper/searchFilter");
|
|
16
16
|
const invitations_1 = require("./invitations");
|
|
17
17
|
class IdpOrganizationMember extends Base_1.default {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
get invitations() {
|
|
19
|
+
if (this._invitations === undefined) {
|
|
20
|
+
this._invitations = new invitations_1.default(this.options, this.axios);
|
|
21
|
+
}
|
|
22
|
+
return this._invitations;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves all organization members that match the provided search filter(s). Will return all members of the organization if no search filter is provided.
|
|
26
|
+
* @param orgName Name of the Organization
|
|
27
|
+
* @param filters (optional) Array of search filters
|
|
28
|
+
* @param excludeTeamByName (optional) Name of a team whos members shall be excluded
|
|
29
|
+
* @param sorting (optional) Sorting object
|
|
30
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
31
|
+
* @param page (optional) Page number to skip the first (page * limit) results (defaults to 0)
|
|
32
|
+
* @returns Object containing an array of Organization Members and the total number of results found in the database (independent of limit and page)
|
|
33
|
+
*/
|
|
34
|
+
searchOrganizationMembers(_a) {
|
|
35
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, filters, excludeTeamByName, sorting, limit = 25, page = 0, }) {
|
|
31
36
|
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
32
37
|
return new searchFilter_1.SearchFilterDTO(f);
|
|
33
38
|
});
|
|
@@ -38,56 +43,65 @@ class IdpOrganizationMember extends Base_1.default {
|
|
|
38
43
|
});
|
|
39
44
|
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
40
45
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves an organization member by its user ID.
|
|
49
|
+
* @param orgName Name of the organization
|
|
50
|
+
* @param userId ID of the user
|
|
51
|
+
* @returns The requested Organization Member
|
|
52
|
+
*/
|
|
53
|
+
getOrganizationMember(orgName, userId) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
55
|
const resp = yield this.axios.get(this.getEndpoint(`/${orgName}/members/${userId}`));
|
|
49
56
|
return resp.data;
|
|
50
57
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Updates the role of a User in the specified Organization.
|
|
61
|
+
* @param orgName Name of the Organization
|
|
62
|
+
* @param userId ID of the User
|
|
63
|
+
* @param orgMemberPatch New role
|
|
64
|
+
* @returns The updated OrganizationMember
|
|
65
|
+
*/
|
|
66
|
+
patchOrganizationMemberRole(orgName, userId, orgMemberPatch) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
68
|
const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/members/${userId}/role`), orgMemberPatch);
|
|
60
69
|
return resp.data;
|
|
61
70
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Updates the executionTarget flag of a User in the specified Organization.
|
|
74
|
+
* @param orgName Name of the Organization
|
|
75
|
+
* @param userId ID of the User
|
|
76
|
+
* @param executionTarget Boolean value to set
|
|
77
|
+
* @returns The updated OrganizationMember
|
|
78
|
+
*/
|
|
79
|
+
patchOrganizationExecutionTarget(orgName, userId, executionTarget) {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
81
|
const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/members/${userId}/executionTarget`), {
|
|
71
82
|
executionTarget,
|
|
72
83
|
});
|
|
73
84
|
return resp.data;
|
|
74
85
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Removes a Member from an Organization.
|
|
89
|
+
* @param orgName Name of the Organization
|
|
90
|
+
* @param userId ID of the User
|
|
91
|
+
*/
|
|
92
|
+
removeOrganizationMember(orgName, userId) {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
81
94
|
yield this.axios.delete(this.getEndpoint(`/${orgName}/members/${userId}`));
|
|
82
95
|
});
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Member leaves the organization independently.
|
|
99
|
+
* @param orgName Name of the Organization
|
|
100
|
+
*/
|
|
101
|
+
leaveOrganization(orgName) {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
103
|
yield this.axios.delete(this.getEndpoint(`/${orgName}/members`));
|
|
89
104
|
});
|
|
90
|
-
this.invitations = new invitations_1.default(options, axios);
|
|
91
105
|
}
|
|
92
106
|
getEndpoint(endpoint) {
|
|
93
107
|
return `${this.options.server}/api/account/v1/org${endpoint}`;
|
|
@@ -12,13 +12,13 @@ export default class IdpOrganizationMemberInvitations extends Base {
|
|
|
12
12
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
13
13
|
* @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
|
|
14
14
|
*/
|
|
15
|
-
search
|
|
15
|
+
search(params: {
|
|
16
16
|
orgName: string;
|
|
17
17
|
filters: SearchFilter[];
|
|
18
18
|
sorting?: Sorting;
|
|
19
19
|
limit?: number;
|
|
20
20
|
page?: number;
|
|
21
|
-
})
|
|
21
|
+
}): Promise<PaginatedResponse<OrganizationMemberInvitation>>;
|
|
22
22
|
/**
|
|
23
23
|
* Invites a User to an Organization.
|
|
24
24
|
*
|
|
@@ -31,7 +31,7 @@ export default class IdpOrganizationMemberInvitations extends Base {
|
|
|
31
31
|
* @param targetUrl Optional url the link in the mail will point to
|
|
32
32
|
* @returns The created invitation
|
|
33
33
|
*/
|
|
34
|
-
create
|
|
34
|
+
create(orgName: string, email: string, role: OrganizationRole, allowNonRegisteredUsers?: boolean, targetUrl?: string): Promise<OrganizationMemberInvitation>;
|
|
35
35
|
/**
|
|
36
36
|
* Accept an invitation.
|
|
37
37
|
*
|