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
|
@@ -13,18 +13,17 @@ exports.High5WebhookLog = void 0;
|
|
|
13
13
|
const Base_1 = require("../../../../../Base");
|
|
14
14
|
const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
|
|
15
15
|
class High5WebhookLog extends Base_1.default {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this.getWebhookLogs = (orgName, spaceName, webhookId, limit, page) => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves all Webhook logs for the specified Webhook.
|
|
18
|
+
* @param orgName Name of the Organization
|
|
19
|
+
* @param spaceName Name of the Space
|
|
20
|
+
* @param webhookId ID of the Webhook
|
|
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 Webhook logs and the total number of results found in the database (independent of limit and page)
|
|
24
|
+
*/
|
|
25
|
+
getWebhookLogs(orgName, spaceName, webhookId, limit, page) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
27
|
limit = limit || 25;
|
|
29
28
|
page = page || 0;
|
|
30
29
|
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/webhooks/${webhookId}/logs?limit=${limit}&page=${page}`));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
2
|
import Base, { Options } from "../../../../Base";
|
|
3
|
-
import { Catalog, CatalogRegistry, Engine, EngineRegistry, StreamNodeSpecifications, StreamNodeSpecificationWrappedWithEngineVersion } from "../../../../interfaces/high5";
|
|
3
|
+
import { Catalog, CatalogRegistry, Engine, EngineRegistry, StreamNodeSpecifications, StreamNodeSpecificationWrappedWithEngineVersion, WildcardRegistry } from "../../../../interfaces/high5";
|
|
4
4
|
/**
|
|
5
5
|
* Class for reading the S3 bucket of a wave engine and catalogs
|
|
6
6
|
*/
|
|
@@ -11,38 +11,45 @@ export declare class S3 extends Base {
|
|
|
11
11
|
* @param waveBucketUrl Public base url to S3 bucket
|
|
12
12
|
* @returns registry.json
|
|
13
13
|
*/
|
|
14
|
-
getCatalogRegistry
|
|
14
|
+
getCatalogRegistry(waveBucketUrl: string): Promise<CatalogRegistry>;
|
|
15
15
|
/**
|
|
16
16
|
* Get the registry.json of the default wave engine from the S3 bucket
|
|
17
17
|
* @param waveBucketUrl Public base url to S3 bucket
|
|
18
18
|
* @returns registry.json
|
|
19
19
|
*/
|
|
20
|
-
getEngineRegistry
|
|
20
|
+
getEngineRegistry(waveBucketUrl: string): Promise<EngineRegistry>;
|
|
21
21
|
/**
|
|
22
22
|
* Get the catalog.json from the S3 bucket
|
|
23
23
|
* @param catalogUrl Public url of the catalog
|
|
24
24
|
* @returns index.json of catalog
|
|
25
25
|
*/
|
|
26
|
-
getCatalog
|
|
26
|
+
getCatalog(catalogUrl: string): Promise<Catalog>;
|
|
27
27
|
/**
|
|
28
28
|
* Get the catalog.json from the S3 bucket
|
|
29
29
|
* @param catalogUrl Public url of the catalog
|
|
30
30
|
* @returns index.json of catalog
|
|
31
31
|
*/
|
|
32
|
-
getEngine
|
|
32
|
+
getEngine(engineUrl: string): Promise<Engine>;
|
|
33
|
+
/**
|
|
34
|
+
* Get a list of available wildcards of a specific engine version from the S3 bucket
|
|
35
|
+
* @param engineUrl Public url of the engine
|
|
36
|
+
* @param engineVersion Version of the enigne
|
|
37
|
+
* @returns Wildcards.json list of available wildcards
|
|
38
|
+
*/
|
|
39
|
+
getWildcardsOfEngine(engineUrl: string, engineVersion: string): Promise<WildcardRegistry>;
|
|
33
40
|
/**
|
|
34
41
|
* Get the node specifications of all nodes of a specific catalog version from the S3 bucket
|
|
35
42
|
* @param catalogUrl Public url of the catalog
|
|
36
43
|
* @param version The catalog version
|
|
37
44
|
* @returns StreamNodeSpecification[] | StreamNodeSpecificationWrappedWithEngineVersion an array of all node specification of that catalog version, maybe wrapped in an object with the engine version
|
|
38
45
|
*/
|
|
39
|
-
getCatalogVersion
|
|
46
|
+
getCatalogVersion(catalogUrl: string, version: string): Promise<StreamNodeSpecifications[] | StreamNodeSpecificationWrappedWithEngineVersion>;
|
|
40
47
|
/**
|
|
41
48
|
* Get the node documentation from the S3 bucket
|
|
42
49
|
* @param catalogUrl Public url of the catalog
|
|
43
50
|
* @param version The catalog version
|
|
44
51
|
* @returns string the markdown documentation of the node
|
|
45
52
|
*/
|
|
46
|
-
getNodeDocumentation
|
|
53
|
+
getNodeDocumentation(catalogUrl: string, version: string, nodeName: string): Promise<string>;
|
|
47
54
|
protected getEndpoint(): string;
|
|
48
55
|
}
|
|
@@ -18,62 +18,88 @@ const axios_1 = require("../../../../interfaces/axios");
|
|
|
18
18
|
class S3 extends Base_1.default {
|
|
19
19
|
constructor(options, axios) {
|
|
20
20
|
super(options, axios);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get the registry.json of the default wave catalog from the S3 bucket
|
|
24
|
+
* @param waveBucketUrl Public base url to S3 bucket
|
|
25
|
+
* @returns registry.json
|
|
26
|
+
*/
|
|
27
|
+
getCatalogRegistry(waveBucketUrl) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
29
|
const resp = yield this.axios.get(`${waveBucketUrl}/catalogs/registry.json`, { headers: axios_1.disableCacheHeaders });
|
|
28
30
|
return resp.data;
|
|
29
31
|
});
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get the registry.json of the default wave engine from the S3 bucket
|
|
35
|
+
* @param waveBucketUrl Public base url to S3 bucket
|
|
36
|
+
* @returns registry.json
|
|
37
|
+
*/
|
|
38
|
+
getEngineRegistry(waveBucketUrl) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
40
|
const resp = yield this.axios.get(`${waveBucketUrl}/engines/registry.json`, { headers: axios_1.disableCacheHeaders });
|
|
37
41
|
return resp.data;
|
|
38
42
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get the catalog.json from the S3 bucket
|
|
46
|
+
* @param catalogUrl Public url of the catalog
|
|
47
|
+
* @returns index.json of catalog
|
|
48
|
+
*/
|
|
49
|
+
getCatalog(catalogUrl) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
51
|
const resp = yield this.axios.get(`${catalogUrl}`, { headers: axios_1.disableCacheHeaders });
|
|
46
52
|
return resp.data;
|
|
47
53
|
});
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get the catalog.json from the S3 bucket
|
|
57
|
+
* @param catalogUrl Public url of the catalog
|
|
58
|
+
* @returns index.json of catalog
|
|
59
|
+
*/
|
|
60
|
+
getEngine(engineUrl) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
62
|
const resp = yield this.axios.get(`${engineUrl}`, { headers: axios_1.disableCacheHeaders });
|
|
55
63
|
return resp.data;
|
|
56
64
|
});
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Get a list of available wildcards of a specific engine version from the S3 bucket
|
|
68
|
+
* @param engineUrl Public url of the engine
|
|
69
|
+
* @param engineVersion Version of the enigne
|
|
70
|
+
* @returns Wildcards.json list of available wildcards
|
|
71
|
+
*/
|
|
72
|
+
getWildcardsOfEngine(engineUrl, engineVersion) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const resp = yield this.axios.get(`${engineUrl.replace("/index.json", "")}/${engineVersion}/wildcards.json`, {
|
|
75
|
+
headers: axios_1.disableCacheHeaders,
|
|
76
|
+
});
|
|
77
|
+
return resp.data;
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Get the node specifications of all nodes of a specific catalog version from the S3 bucket
|
|
82
|
+
* @param catalogUrl Public url of the catalog
|
|
83
|
+
* @param version The catalog version
|
|
84
|
+
* @returns StreamNodeSpecification[] | StreamNodeSpecificationWrappedWithEngineVersion an array of all node specification of that catalog version, maybe wrapped in an object with the engine version
|
|
85
|
+
*/
|
|
86
|
+
getCatalogVersion(catalogUrl, version) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
88
|
const specificationUrl = catalogUrl.split("/").slice(0, -1).join("/") + "/" + version + "/specification.json";
|
|
65
89
|
const resp = yield this.axios.get(specificationUrl, {
|
|
66
90
|
headers: axios_1.disableCacheHeaders,
|
|
67
91
|
});
|
|
68
92
|
return resp.data;
|
|
69
93
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Get the node documentation from the S3 bucket
|
|
97
|
+
* @param catalogUrl Public url of the catalog
|
|
98
|
+
* @param version The catalog version
|
|
99
|
+
* @returns string the markdown documentation of the node
|
|
100
|
+
*/
|
|
101
|
+
getNodeDocumentation(catalogUrl, version, nodeName) {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
103
|
const specificationUrl = catalogUrl.split("/").slice(0, -1).join("/") + `/${version}/docs/${nodeName}.md`;
|
|
78
104
|
const resp = yield this.axios.get(specificationUrl).catch(err => {
|
|
79
105
|
throw new Error(`Node documentation not found: ${err}`);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Base, { Options } from "../../Base";
|
|
1
|
+
import Base from "../../Base";
|
|
3
2
|
import { Version } from "../../interfaces/global";
|
|
4
3
|
import { PreLoginResponse } from "../../interfaces/idp";
|
|
5
4
|
import { SuccessfulAuth } from "../../interfaces/idp/user/SuccessfulAuth";
|
|
@@ -12,29 +11,33 @@ export default class Idp extends Base {
|
|
|
12
11
|
/**
|
|
13
12
|
* Handles everything around organizations
|
|
14
13
|
*/
|
|
15
|
-
organization: IdpOrganization;
|
|
14
|
+
get organization(): IdpOrganization;
|
|
15
|
+
private _organization?;
|
|
16
16
|
/**
|
|
17
17
|
* Handles everything around registration
|
|
18
18
|
*/
|
|
19
|
-
registration: IdpRegistration;
|
|
19
|
+
get registration(): IdpRegistration;
|
|
20
|
+
private _registration?;
|
|
20
21
|
/**
|
|
21
22
|
* Handles everything around open authorization and openId requests
|
|
22
23
|
*/
|
|
23
|
-
oAuth: IdpOAuth;
|
|
24
|
+
get oAuth(): IdpOAuth;
|
|
25
|
+
private _oAuth?;
|
|
24
26
|
/**
|
|
25
27
|
* Handles everything around a user
|
|
26
28
|
*/
|
|
27
|
-
user: IdpUser;
|
|
29
|
+
get user(): IdpUser;
|
|
30
|
+
private _user?;
|
|
28
31
|
/**
|
|
29
32
|
* Handles everything around idp's internal endpoints
|
|
30
33
|
*/
|
|
31
|
-
internal: IdpInternal;
|
|
32
|
-
|
|
34
|
+
get internal(): IdpInternal;
|
|
35
|
+
private _internal?;
|
|
33
36
|
/**
|
|
34
37
|
* Requests the endpoint version
|
|
35
38
|
* @returns Version object
|
|
36
39
|
*/
|
|
37
|
-
version
|
|
40
|
+
version(): Promise<Version>;
|
|
38
41
|
/**
|
|
39
42
|
* Authenticates against the identity provider with a given email and password.
|
|
40
43
|
* @param email Email of the user
|
|
@@ -42,7 +45,7 @@ export default class Idp extends Base {
|
|
|
42
45
|
* @param token (optional) token if 2FA-TOTP is enabled
|
|
43
46
|
* @returns SuccessfulAuth object holding the token and the user
|
|
44
47
|
*/
|
|
45
|
-
login
|
|
48
|
+
login(email: string, password: string, token?: string): Promise<SuccessfulAuth>;
|
|
46
49
|
/**
|
|
47
50
|
* Starts the login process via OIDC
|
|
48
51
|
* @param origin The starting URL of the process. After obtaining the credentials, the user will be redirected back to this url.
|
|
@@ -51,14 +54,14 @@ export default class Idp extends Base {
|
|
|
51
54
|
* @param hint Valid email address of the user that wants to login. Hint must be defined when provider is not.
|
|
52
55
|
* @returns URL that must be accessed via a browser to continue the login process.
|
|
53
56
|
*/
|
|
54
|
-
loginWithOIDC
|
|
57
|
+
loginWithOIDC(origin: string, oidcProvider?: string, hint?: string): Promise<string>;
|
|
55
58
|
/**
|
|
56
59
|
* Starts the login process via SAML 2.0
|
|
57
60
|
* @param origin The starting URL of the process. After obtaining the credentials, the user will be redirected back to this url.
|
|
58
61
|
* @param email Email of the user. The email domain will be used to determine the appropriate SAML 2.0 provider to use going forward.
|
|
59
62
|
* @returns URL that must be accessed via a browser to continue the login process.
|
|
60
63
|
*/
|
|
61
|
-
loginWithSAML
|
|
64
|
+
loginWithSAML(origin: string, email: string): Promise<string>;
|
|
62
65
|
/**
|
|
63
66
|
* Determine if/how the given email can authenticate.
|
|
64
67
|
*
|
|
@@ -68,15 +71,14 @@ export default class Idp extends Base {
|
|
|
68
71
|
* @returns object that dictates if: the user needs to REGISTER; the user needs to VERIFY_EMAIL; the user can LOGIN using this email;
|
|
69
72
|
* or the authentication process should continue via an EXTERNAL provider that can be found via the location property.
|
|
70
73
|
*/
|
|
71
|
-
preLogin
|
|
74
|
+
preLogin(email: string, origin: string): Promise<PreLoginResponse>;
|
|
72
75
|
/**
|
|
73
76
|
* Initiate the password reset process. An email will be sent to the user to move to the next phase.
|
|
74
77
|
*
|
|
75
78
|
* @param email Email of the user
|
|
76
79
|
* @param captcha Valid google reCAPTCHAV2
|
|
77
|
-
* @param regionId Optional region id to use for the password reset email
|
|
78
80
|
* @param targetUrl Optional url the link in the mail will point to
|
|
79
81
|
*/
|
|
80
|
-
resetPassword
|
|
82
|
+
resetPassword(email: string, captcha: string, targetUrl?: string): Promise<void>;
|
|
81
83
|
protected getEndpoint(endpoint: string): string;
|
|
82
84
|
}
|
package/lib/service/idp/index.js
CHANGED
|
@@ -16,24 +16,70 @@ const organization_1 = require("./organization");
|
|
|
16
16
|
const registration_1 = require("./registration");
|
|
17
17
|
const user_1 = require("./user");
|
|
18
18
|
class Idp extends Base_1.default {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Handles everything around organizations
|
|
21
|
+
*/
|
|
22
|
+
get organization() {
|
|
23
|
+
if (this._organization === undefined) {
|
|
24
|
+
this._organization = new organization_1.IdpOrganization(this.options, this.axios);
|
|
25
|
+
}
|
|
26
|
+
return this._organization;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Handles everything around registration
|
|
30
|
+
*/
|
|
31
|
+
get registration() {
|
|
32
|
+
if (this._registration === undefined) {
|
|
33
|
+
this._registration = new registration_1.IdpRegistration(this.options, this.axios);
|
|
34
|
+
}
|
|
35
|
+
return this._registration;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Handles everything around open authorization and openId requests
|
|
39
|
+
*/
|
|
40
|
+
get oAuth() {
|
|
41
|
+
if (this._oAuth === undefined) {
|
|
42
|
+
this._oAuth = new oauth_1.IdpOAuth(this.options, this.axios);
|
|
43
|
+
}
|
|
44
|
+
return this._oAuth;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Handles everything around a user
|
|
48
|
+
*/
|
|
49
|
+
get user() {
|
|
50
|
+
if (this._user === undefined) {
|
|
51
|
+
this._user = new user_1.IdpUser(this.options, this.axios);
|
|
52
|
+
}
|
|
53
|
+
return this._user;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Handles everything around idp's internal endpoints
|
|
57
|
+
*/
|
|
58
|
+
get internal() {
|
|
59
|
+
if (this._internal === undefined) {
|
|
60
|
+
this._internal = new internal_1.IdpInternal(this.options, this.axios);
|
|
61
|
+
}
|
|
62
|
+
return this._internal;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Requests the endpoint version
|
|
66
|
+
* @returns Version object
|
|
67
|
+
*/
|
|
68
|
+
version() {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
70
|
const resp = yield this.axios.get(this.getEndpoint("/v1/version"));
|
|
27
71
|
return resp.data;
|
|
28
72
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Authenticates against the identity provider with a given email and password.
|
|
76
|
+
* @param email Email of the user
|
|
77
|
+
* @param password Password of the user
|
|
78
|
+
* @param token (optional) token if 2FA-TOTP is enabled
|
|
79
|
+
* @returns SuccessfulAuth object holding the token and the user
|
|
80
|
+
*/
|
|
81
|
+
login(email, password, token) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
83
|
var _a;
|
|
38
84
|
let body = { email: email, password: password };
|
|
39
85
|
if (token) {
|
|
@@ -46,15 +92,17 @@ class Idp extends Base_1.default {
|
|
|
46
92
|
};
|
|
47
93
|
return authed;
|
|
48
94
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Starts the login process via OIDC
|
|
98
|
+
* @param origin The starting URL of the process. After obtaining the credentials, the user will be redirected back to this url.
|
|
99
|
+
* @param oidcProvider The provider to use for the process. Only optional if the user is part of an organization that has a preferred
|
|
100
|
+
* OIDC provider and an associated email that matches the user's. The list of available providers can be found in the public config endpoint.
|
|
101
|
+
* @param hint Valid email address of the user that wants to login. Hint must be defined when provider is not.
|
|
102
|
+
* @returns URL that must be accessed via a browser to continue the login process.
|
|
103
|
+
*/
|
|
104
|
+
loginWithOIDC(origin, oidcProvider, hint) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
106
|
const resp = yield this.axios.get(this.getEndpoint("/v1/login/oidc"), {
|
|
59
107
|
params: {
|
|
60
108
|
origin,
|
|
@@ -72,13 +120,15 @@ class Idp extends Base_1.default {
|
|
|
72
120
|
}
|
|
73
121
|
return location;
|
|
74
122
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Starts the login process via SAML 2.0
|
|
126
|
+
* @param origin The starting URL of the process. After obtaining the credentials, the user will be redirected back to this url.
|
|
127
|
+
* @param email Email of the user. The email domain will be used to determine the appropriate SAML 2.0 provider to use going forward.
|
|
128
|
+
* @returns URL that must be accessed via a browser to continue the login process.
|
|
129
|
+
*/
|
|
130
|
+
loginWithSAML(origin, email) {
|
|
131
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
132
|
const resp = yield this.axios.get(this.getEndpoint("/v1/login/saml"), {
|
|
83
133
|
params: {
|
|
84
134
|
origin,
|
|
@@ -95,16 +145,18 @@ class Idp extends Base_1.default {
|
|
|
95
145
|
}
|
|
96
146
|
return location;
|
|
97
147
|
});
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Determine if/how the given email can authenticate.
|
|
151
|
+
*
|
|
152
|
+
* @param email Email of the user
|
|
153
|
+
* @param origin The starting URL of the process. If the authentication process bound to this email is SAML or OIDC,
|
|
154
|
+
* then the response's location property will include this origin.
|
|
155
|
+
* @returns object that dictates if: the user needs to REGISTER; the user needs to VERIFY_EMAIL; the user can LOGIN using this email;
|
|
156
|
+
* or the authentication process should continue via an EXTERNAL provider that can be found via the location property.
|
|
157
|
+
*/
|
|
158
|
+
preLogin(email, origin) {
|
|
159
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
160
|
const resp = yield this.axios.get(this.getEndpoint("/v1/login/pre"), {
|
|
109
161
|
params: {
|
|
110
162
|
origin,
|
|
@@ -113,22 +165,18 @@ class Idp extends Base_1.default {
|
|
|
113
165
|
});
|
|
114
166
|
return resp.data;
|
|
115
167
|
});
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Initiate the password reset process. An email will be sent to the user to move to the next phase.
|
|
171
|
+
*
|
|
172
|
+
* @param email Email of the user
|
|
173
|
+
* @param captcha Valid google reCAPTCHAV2
|
|
174
|
+
* @param targetUrl Optional url the link in the mail will point to
|
|
175
|
+
*/
|
|
176
|
+
resetPassword(email, captcha, targetUrl) {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
yield this.axios.post(this.getEndpoint("/v1/login/forgot_password"), { email, captcha, targetUrl });
|
|
126
179
|
});
|
|
127
|
-
this.organization = new organization_1.IdpOrganization(this.options, this.axios);
|
|
128
|
-
this.user = new user_1.IdpUser(this.options, this.axios);
|
|
129
|
-
this.registration = new registration_1.IdpRegistration(this.options, this.axios);
|
|
130
|
-
this.oAuth = new oauth_1.IdpOAuth(this.options, this.axios);
|
|
131
|
-
this.internal = new internal_1.IdpInternal(this.options, this.axios);
|
|
132
180
|
}
|
|
133
181
|
getEndpoint(endpoint) {
|
|
134
182
|
return `${this.options.server}/api/account${endpoint}`;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Base, { Options } from "../../../Base";
|
|
1
|
+
import Base from "../../../Base";
|
|
3
2
|
import { User } from "../../../interfaces/idp/user";
|
|
4
3
|
export declare class IdpInternal extends Base {
|
|
5
|
-
constructor(options: Options, axios: AxiosInstance);
|
|
6
4
|
/**
|
|
7
5
|
* Creates an agent user for an organization.
|
|
8
6
|
*
|
|
@@ -11,7 +9,7 @@ export declare class IdpInternal extends Base {
|
|
|
11
9
|
* @param orgName Name of the organization
|
|
12
10
|
* @returns the created user and a pat token
|
|
13
11
|
*/
|
|
14
|
-
createAgentUser
|
|
12
|
+
createAgentUser(orgName: string): Promise<{
|
|
15
13
|
user: User;
|
|
16
14
|
pat: string;
|
|
17
15
|
}>;
|
|
@@ -12,17 +12,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.IdpInternal = void 0;
|
|
13
13
|
const Base_1 = require("../../../Base");
|
|
14
14
|
class IdpInternal extends Base_1.default {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
this.createAgentUser = (orgName) => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
/**
|
|
16
|
+
* Creates an agent user for an organization.
|
|
17
|
+
*
|
|
18
|
+
* This is an internal endpoint and requires HCloud admin credentials to use.
|
|
19
|
+
*
|
|
20
|
+
* @param orgName Name of the organization
|
|
21
|
+
* @returns the created user and a pat token
|
|
22
|
+
*/
|
|
23
|
+
createAgentUser(orgName) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
25
|
const res = yield this.axios.post(this.getEndpoint(`/internal/v1/org/${orgName}/agent`));
|
|
27
26
|
return { user: res.data, pat: res.headers.authorization };
|
|
28
27
|
});
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Base, { Options } from "../../../Base";
|
|
1
|
+
import Base from "../../../Base";
|
|
3
2
|
import { OAuthToken, OAuthTokenRequest } from "../../../interfaces/idp/oauth";
|
|
4
|
-
import {
|
|
3
|
+
import { OAuthAppPublicInfo } from "../../../interfaces/idp/organization/settings/oauthApp";
|
|
5
4
|
export declare class IdpOAuth extends Base {
|
|
6
|
-
constructor(options: Options, axios: AxiosInstance);
|
|
7
5
|
/**
|
|
8
6
|
* getAuthorizationCodeInsideRedirectUrl throws for an invalid request (query params do not match OAuthApp).
|
|
9
7
|
* It returns the redirect URL with the code, which is used to redirect to the client application,
|
|
@@ -12,13 +10,12 @@ export declare class IdpOAuth extends Base {
|
|
|
12
10
|
* redirect_uri, scopes and optionally state.
|
|
13
11
|
* @returns the entire redirect uri including the authorization code if successful
|
|
14
12
|
*/
|
|
15
|
-
getAuthorizationCodeInsideRedirectUrl
|
|
13
|
+
getAuthorizationCodeInsideRedirectUrl(queryString: string, doNotRedirect?: boolean): Promise<string>;
|
|
16
14
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* Check if the user has consented to specified scopes. If the user has already consented this request
|
|
16
|
+
* will return the redirect URL, otherwise, it will be a consent.not.given error.
|
|
19
17
|
*
|
|
20
|
-
*
|
|
21
|
-
* createScopesAndGetAuthorizationCodeInsideRedirectUrl method should be used.
|
|
18
|
+
* To consent the createScopesAndGetAuthorizationCodeInsideRedirectUrl method should be used.
|
|
22
19
|
* @see IdpOAuth.createScopesAndGetAuthorizationCodeInsideRedirectUrl
|
|
23
20
|
*
|
|
24
21
|
* @param queryString {string} - Query string containing the OAuth parameters: response_type, client_id, scope, state
|
|
@@ -26,7 +23,7 @@ export declare class IdpOAuth extends Base {
|
|
|
26
23
|
* @returns A string with the redirect URL if the user already consented to the specificied scope. Otherwise, an OAuthApp
|
|
27
24
|
* @see OAuthApp
|
|
28
25
|
*/
|
|
29
|
-
getInfoOrAuthorizationCodeInsideRedirectUrl
|
|
26
|
+
getInfoOrAuthorizationCodeInsideRedirectUrl(queryString: string, doNotRedirect?: boolean): Promise<string>;
|
|
30
27
|
/**
|
|
31
28
|
* createScopesAndGetAuthorizationCodeInsideRedirectUrl throws for an invalid request (query params do not match OAuthApp).
|
|
32
29
|
* It returns the redirect URL with the code, which is used to redirect to the client application,
|
|
@@ -35,11 +32,18 @@ export declare class IdpOAuth extends Base {
|
|
|
35
32
|
* redirect_uri, scopes and optionally state.
|
|
36
33
|
* @returns the entire redirect uri including the authorization code if successful
|
|
37
34
|
*/
|
|
38
|
-
createScopesAndGetAuthorizationCodeInsideRedirectUrl
|
|
35
|
+
createScopesAndGetAuthorizationCodeInsideRedirectUrl(queryString: string, doNotRedirect?: boolean): Promise<string>;
|
|
39
36
|
/**
|
|
40
37
|
* A valid code can be used to request a new API token.
|
|
41
38
|
* @param tokenRequest contains the code, client_id, client_secret and redirect_uri
|
|
42
39
|
*/
|
|
43
|
-
exchangeCodeForToken
|
|
40
|
+
exchangeCodeForToken(tokenRequest: OAuthTokenRequest): Promise<OAuthToken>;
|
|
41
|
+
/**
|
|
42
|
+
* Get OAuth app public information via client ID
|
|
43
|
+
*
|
|
44
|
+
* @param clientId {string} - Client ID of the OAuth app
|
|
45
|
+
* @returns Public OAuth app information
|
|
46
|
+
*/
|
|
47
|
+
getOAuthAppInfo(clientId: string): Promise<OAuthAppPublicInfo>;
|
|
44
48
|
protected getEndpoint(endpoint: string): string;
|
|
45
49
|
}
|