hcloud-sdk 0.0.16 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/changelog.md +45 -0
- package/index.d.ts +3 -2
- package/index.js +5 -2
- package/lib/Base.d.ts +26 -0
- package/lib/Base.js +12 -0
- package/lib/Hcloud.d.ts +90 -0
- package/lib/Hcloud.js +184 -0
- package/lib/helper/ErrorHelper.d.ts +7 -0
- package/lib/helper/ErrorHelper.js +19 -0
- package/lib/helper/paginatedResponseHelper.d.ts +3 -0
- package/lib/helper/paginatedResponseHelper.js +9 -0
- package/lib/helper/searchFilter.d.ts +9 -0
- package/lib/helper/searchFilter.js +12 -0
- package/lib/interfaces/agent/bundle/dev/index.d.ts +3 -0
- package/lib/interfaces/agent/context/index.d.ts +19 -0
- package/lib/interfaces/agent/index.d.ts +21 -0
- package/lib/interfaces/agent/index.js +2 -0
- package/lib/interfaces/{Auditor.d.ts → auditor/index.d.ts} +31 -5
- package/lib/interfaces/{Auditor.js → auditor/index.js} +15 -5
- package/lib/interfaces/axios/index.d.ts +5 -0
- package/lib/interfaces/axios/index.js +8 -0
- package/lib/interfaces/bouncer/features/index.d.ts +7 -0
- package/lib/interfaces/bouncer/features/index.js +2 -0
- package/lib/interfaces/bouncer/index.d.ts +6 -0
- package/lib/interfaces/bouncer/index.js +17 -0
- package/lib/interfaces/dali/index.d.ts +3 -0
- package/lib/interfaces/dali/index.js +2 -0
- package/lib/interfaces/frontend/config/index.d.ts +33 -0
- package/lib/interfaces/frontend/config/index.js +10 -0
- package/lib/interfaces/frontend/featureflags/index.d.ts +7 -0
- package/lib/interfaces/frontend/featureflags/index.js +2 -0
- package/lib/interfaces/fuse/index.d.ts +3 -0
- package/lib/interfaces/fuse/index.js +19 -0
- package/lib/interfaces/fuse/space/cronjob/Cronjob.d.ts +38 -0
- package/lib/interfaces/fuse/space/cronjob/Cronjob.js +8 -0
- package/lib/interfaces/fuse/space/cronjob/CronjobLog.d.ts +16 -0
- package/lib/interfaces/fuse/space/cronjob/CronjobLog.js +2 -0
- package/lib/interfaces/fuse/space/index.d.ts +21 -0
- package/lib/interfaces/fuse/space/index.js +11 -0
- package/lib/interfaces/global/HCloudError.d.ts +8 -0
- package/lib/interfaces/global/HCloudError.js +13 -0
- package/lib/interfaces/global/Header.d.ts +4 -0
- package/lib/interfaces/global/Header.js +2 -0
- package/lib/interfaces/global/HttpMethod.d.ts +7 -0
- package/lib/interfaces/global/HttpMethod.js +11 -0
- package/lib/interfaces/global/PaginatedResponse.d.ts +4 -0
- package/lib/interfaces/global/PaginatedResponse.js +2 -0
- package/lib/interfaces/global/Products.d.ts +11 -0
- package/lib/interfaces/global/Products.js +15 -0
- package/lib/interfaces/global/SearchFilters.d.ts +86 -0
- package/lib/interfaces/global/SearchFilters.js +49 -0
- package/lib/interfaces/global/Space.d.ts +20 -0
- package/lib/interfaces/global/Space.js +8 -0
- package/lib/interfaces/global/Version.d.ts +3 -0
- package/lib/interfaces/global/Version.js +2 -0
- package/lib/interfaces/global/Views.d.ts +8 -0
- package/lib/interfaces/global/Views.js +12 -0
- package/lib/interfaces/global/index.d.ts +9 -0
- package/lib/interfaces/global/index.js +25 -0
- package/lib/interfaces/high5/index.d.ts +16 -0
- package/lib/interfaces/high5/index.js +32 -0
- package/lib/interfaces/high5/joinToken/index.d.ts +10 -0
- package/lib/interfaces/high5/joinToken/index.js +2 -0
- package/lib/interfaces/high5/space/event/index.d.ts +15 -0
- package/lib/interfaces/high5/space/event/index.js +2 -0
- package/lib/interfaces/high5/space/event/stream/design/DesignOperation.d.ts +68 -0
- package/lib/interfaces/high5/space/event/stream/design/DesignOperation.js +20 -0
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +92 -0
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.js +20 -0
- package/lib/interfaces/high5/space/event/stream/design/index.d.ts +22 -0
- package/lib/interfaces/high5/space/event/stream/design/index.js +2 -0
- package/lib/interfaces/high5/space/event/stream/design/snapshot/index.d.ts +30 -0
- package/lib/interfaces/high5/space/event/stream/design/snapshot/index.js +8 -0
- package/lib/interfaces/high5/space/event/stream/index.d.ts +77 -0
- package/lib/interfaces/high5/space/event/stream/index.js +13 -0
- package/lib/interfaces/high5/space/event/stream/node/index.d.ts +62 -0
- package/lib/interfaces/high5/space/event/stream/node/index.js +7 -0
- package/lib/interfaces/high5/space/execution/index.d.ts +148 -0
- package/lib/interfaces/high5/space/execution/index.js +21 -0
- package/lib/interfaces/high5/space/index.d.ts +23 -0
- package/lib/interfaces/high5/space/index.js +12 -0
- package/lib/interfaces/high5/space/secret/index.d.ts +12 -0
- package/lib/interfaces/high5/space/secret/index.js +2 -0
- package/lib/interfaces/high5/space/webhook/index.d.ts +75 -0
- package/lib/interfaces/high5/space/webhook/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 +201 -0
- package/lib/interfaces/high5/wave/index.js +61 -0
- package/lib/interfaces/idp/index.d.ts +26 -0
- package/lib/interfaces/idp/index.js +38 -0
- package/lib/interfaces/idp/oauth/index.d.ts +19 -0
- package/lib/interfaces/idp/oauth/index.js +8 -0
- package/lib/interfaces/idp/organization/index.d.ts +32 -0
- package/lib/interfaces/idp/organization/index.js +25 -0
- package/lib/interfaces/idp/organization/license/index.d.ts +84 -0
- package/lib/interfaces/idp/organization/license/index.js +15 -0
- package/lib/interfaces/idp/organization/member/index.d.ts +15 -0
- package/lib/interfaces/idp/organization/member/index.js +2 -0
- package/lib/interfaces/idp/organization/member/invitations/index.d.ts +26 -0
- package/lib/interfaces/idp/organization/member/invitations/index.js +18 -0
- package/lib/interfaces/idp/organization/settings/domain/index.d.ts +19 -0
- package/lib/interfaces/idp/organization/settings/domain/index.js +8 -0
- package/lib/interfaces/idp/organization/settings/domain/saml/index.d.ts +10 -0
- package/lib/interfaces/idp/organization/settings/domain/saml/index.js +2 -0
- package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +37 -0
- package/lib/interfaces/idp/organization/settings/oauthApp/index.js +2 -0
- package/lib/interfaces/idp/organization/team/index.d.ts +24 -0
- package/lib/interfaces/idp/organization/team/index.js +9 -0
- package/lib/interfaces/idp/user/ConnectionSettings.d.ts +6 -0
- package/lib/interfaces/idp/user/ConnectionSettings.js +2 -0
- package/lib/interfaces/idp/user/GeneralSettings.d.ts +45 -0
- package/lib/interfaces/idp/user/GeneralSettings.js +38 -0
- package/lib/interfaces/idp/user/NotificationSettings.d.ts +8 -0
- package/lib/interfaces/idp/user/NotificationSettings.js +2 -0
- package/lib/interfaces/idp/user/Pat.d.ts +19 -0
- package/lib/interfaces/idp/user/Pat.js +2 -0
- package/lib/interfaces/idp/user/Scopes.d.ts +40 -0
- package/lib/interfaces/idp/user/Scopes.js +50 -0
- package/lib/interfaces/idp/user/SuccessfulAuth.d.ts +5 -0
- package/lib/interfaces/idp/user/SuccessfulAuth.js +2 -0
- package/lib/interfaces/idp/user/Totp.d.ts +20 -0
- package/lib/interfaces/idp/user/Totp.js +2 -0
- package/lib/interfaces/idp/user/index.d.ts +23 -0
- package/lib/interfaces/idp/user/index.js +2 -0
- package/lib/interfaces/mailer/index.d.ts +66 -0
- package/lib/interfaces/mailer/index.js +81 -0
- package/lib/interfaces/mothership/index.d.ts +28 -0
- package/lib/interfaces/mothership/index.js +8 -0
- package/lib/interfaces/nats/index.d.ts +239 -0
- package/lib/interfaces/nats/index.js +316 -0
- package/lib/service/agent/bundle/dev/index.d.ts +17 -0
- package/lib/service/agent/bundle/dev/index.js +44 -0
- package/lib/service/agent/bundle/index.d.ts +11 -0
- package/lib/service/agent/bundle/index.js +55 -0
- package/lib/service/agent/context/index.d.ts +35 -0
- package/lib/service/agent/context/index.js +90 -0
- package/lib/service/agent/index.d.ts +16 -0
- package/lib/service/agent/index.js +37 -0
- package/lib/service/agent/installer/index.d.ts +15 -0
- package/lib/service/agent/installer/index.js +97 -0
- package/lib/service/auditor/index.d.ts +25 -0
- package/lib/service/auditor/index.js +55 -0
- package/lib/service/auditor/internal/index.d.ts +27 -0
- package/lib/service/auditor/internal/index.js +65 -0
- package/lib/service/bouncer/features/index.d.ts +8 -0
- package/lib/service/bouncer/features/index.js +27 -0
- package/lib/service/bouncer/index.d.ts +7 -0
- package/lib/service/bouncer/index.js +16 -0
- package/lib/service/dali/DaliAvatar.d.ts +40 -0
- package/lib/service/dali/DaliAvatar.js +70 -0
- package/lib/service/dali/avatar/DaliFuseSpace.d.ts +26 -0
- package/lib/service/dali/avatar/DaliFuseSpace.js +58 -0
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +26 -0
- package/lib/service/dali/avatar/DaliHigh5Space.js +58 -0
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +26 -0
- package/lib/service/dali/avatar/DaliOAuthApp.js +58 -0
- package/lib/service/dali/avatar/DaliOrganization.d.ts +23 -0
- package/lib/service/dali/avatar/DaliOrganization.js +55 -0
- package/lib/service/dali/avatar/DaliTeam.d.ts +26 -0
- package/lib/service/dali/avatar/DaliTeam.js +58 -0
- package/lib/service/dali/avatar/DaliUser.d.ts +20 -0
- package/lib/service/dali/avatar/DaliUser.js +52 -0
- package/lib/service/dali/index.d.ts +15 -0
- package/lib/service/dali/index.js +37 -0
- package/lib/service/fuse/index.d.ts +18 -0
- package/lib/service/fuse/index.js +48 -0
- package/lib/service/fuse/internal/index.d.ts +8 -0
- package/lib/service/fuse/internal/index.js +31 -0
- package/lib/service/fuse/internal/space/cronjob/index.d.ts +7 -0
- package/lib/service/fuse/internal/space/cronjob/index.js +17 -0
- package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +15 -0
- package/lib/service/fuse/internal/space/cronjob/log/index.js +34 -0
- package/lib/service/fuse/internal/space/index.d.ts +22 -0
- package/lib/service/fuse/internal/space/index.js +49 -0
- package/lib/service/fuse/space/cronjob/index.d.ts +123 -0
- package/lib/service/fuse/space/cronjob/index.js +203 -0
- package/lib/service/fuse/space/cronjob/log/index.d.ts +31 -0
- package/lib/service/fuse/space/cronjob/log/index.js +58 -0
- package/lib/service/fuse/space/index.d.ts +81 -0
- package/lib/service/fuse/space/index.js +152 -0
- package/lib/service/high5/execution/index.d.ts +10 -0
- package/lib/service/high5/execution/index.js +24 -0
- package/lib/service/high5/execution/log/index.d.ts +19 -0
- package/lib/service/high5/execution/log/index.js +40 -0
- package/lib/service/high5/execution/status/index.d.ts +18 -0
- package/lib/service/high5/execution/status/index.js +40 -0
- package/lib/service/high5/index.d.ts +25 -0
- package/lib/service/high5/index.js +63 -0
- package/lib/service/high5/internal/index.d.ts +8 -0
- package/lib/service/high5/internal/index.js +31 -0
- package/lib/service/high5/internal/space/index.d.ts +21 -0
- package/lib/service/high5/internal/space/index.js +45 -0
- package/lib/service/high5/joinToken/index.d.ts +40 -0
- package/lib/service/high5/joinToken/index.js +72 -0
- package/lib/service/high5/space/event/index.d.ts +55 -0
- package/lib/service/high5/space/event/index.js +101 -0
- package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +31 -0
- package/lib/service/high5/space/event/stream/design/DesignOperations.js +117 -0
- package/lib/service/high5/space/event/stream/design/index.d.ts +53 -0
- package/lib/service/high5/space/event/stream/design/index.js +91 -0
- package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +62 -0
- package/lib/service/high5/space/event/stream/design/snapshot/index.js +107 -0
- package/lib/service/high5/space/event/stream/index.d.ts +113 -0
- package/lib/service/high5/space/event/stream/index.js +186 -0
- package/lib/service/high5/space/execution/index.d.ts +48 -0
- package/lib/service/high5/space/execution/index.js +89 -0
- package/lib/service/high5/space/execution/log/index.d.ts +29 -0
- package/lib/service/high5/space/execution/log/index.js +58 -0
- package/lib/service/high5/space/execution/status/index.d.ts +16 -0
- package/lib/service/high5/space/execution/status/index.js +36 -0
- package/lib/service/high5/space/index.d.ts +111 -0
- package/lib/service/high5/space/index.js +205 -0
- package/lib/service/high5/space/node/index.d.ts +58 -0
- package/lib/service/high5/space/node/index.js +116 -0
- package/lib/service/high5/space/secret/index.d.ts +60 -0
- package/lib/service/high5/space/secret/index.js +102 -0
- package/lib/service/high5/space/wave/index.d.ts +36 -0
- package/lib/service/high5/space/wave/index.js +73 -0
- package/lib/service/high5/space/webhook/index.d.ts +90 -0
- package/lib/service/high5/space/webhook/index.js +165 -0
- package/lib/service/high5/space/webhook/log/index.d.ts +16 -0
- package/lib/service/high5/space/webhook/log/index.js +37 -0
- package/lib/service/high5/wave/index.d.ts +8 -0
- package/lib/service/high5/wave/index.js +15 -0
- package/lib/service/high5/wave/s3/index.d.ts +48 -0
- package/lib/service/high5/wave/s3/index.js +100 -0
- package/lib/service/idp/index.d.ts +84 -0
- package/lib/service/idp/index.js +185 -0
- package/lib/service/idp/internal/index.d.ts +17 -0
- package/lib/service/idp/internal/index.js +33 -0
- package/lib/service/idp/oauth/index.d.ts +49 -0
- package/lib/service/idp/oauth/index.js +117 -0
- package/lib/service/idp/organization/index.d.ts +56 -0
- package/lib/service/idp/organization/index.js +114 -0
- package/lib/service/idp/organization/license/index.d.ts +7 -0
- package/lib/service/idp/organization/license/index.js +31 -0
- package/lib/service/idp/organization/member/index.d.ts +57 -0
- package/lib/service/idp/organization/member/index.js +110 -0
- package/lib/service/idp/organization/member/invitations/index.d.ts +79 -0
- package/lib/service/idp/organization/member/invitations/index.js +122 -0
- package/lib/service/idp/organization/settings/domain/index.d.ts +37 -0
- package/lib/service/idp/organization/settings/domain/index.js +76 -0
- package/lib/service/idp/organization/settings/domain/saml/index.d.ts +43 -0
- package/lib/service/idp/organization/settings/domain/saml/index.js +98 -0
- package/lib/service/idp/organization/settings/index.d.ts +16 -0
- package/lib/service/idp/organization/settings/index.js +29 -0
- package/lib/service/idp/organization/settings/oauth/index.d.ts +62 -0
- package/lib/service/idp/organization/settings/oauth/index.js +117 -0
- package/lib/service/idp/organization/team/index.d.ts +72 -0
- package/lib/service/idp/organization/team/index.js +124 -0
- package/lib/service/idp/registration/index.d.ts +37 -0
- package/lib/service/idp/registration/index.js +87 -0
- package/lib/service/idp/user/index.d.ts +83 -0
- package/lib/service/idp/user/index.js +160 -0
- package/lib/service/idp/user/license/index.d.ts +7 -0
- package/lib/service/idp/user/license/index.js +31 -0
- package/lib/service/idp/user/password/index.d.ts +19 -0
- package/lib/service/idp/user/password/index.js +51 -0
- package/lib/service/idp/user/settings/connections/index.d.ts +13 -0
- package/lib/service/idp/user/settings/connections/index.js +32 -0
- package/lib/service/idp/user/settings/general/index.d.ts +22 -0
- package/lib/service/idp/user/settings/general/index.js +51 -0
- package/lib/service/idp/user/settings/index.d.ts +40 -0
- package/lib/service/idp/user/settings/index.js +70 -0
- package/lib/service/idp/user/settings/notifications/index.d.ts +16 -0
- package/lib/service/idp/user/settings/notifications/index.js +40 -0
- package/lib/service/idp/user/settings/oauthApps/index.d.ts +20 -0
- package/lib/service/idp/user/settings/oauthApps/index.js +55 -0
- package/lib/service/idp/user/settings/pats/index.d.ts +48 -0
- package/lib/service/idp/user/settings/pats/index.js +104 -0
- package/lib/service/idp/user/settings/twoFactor/index.d.ts +10 -0
- package/lib/service/idp/user/settings/twoFactor/index.js +20 -0
- package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +32 -0
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +72 -0
- package/lib/service/mailer/index.d.ts +13 -0
- package/lib/service/{Mailer.js → mailer/index.js} +17 -16
- package/lib/service/mailer/internal/index.d.ts +36 -0
- package/lib/service/mailer/internal/index.js +69 -0
- package/lib/service/mothership/index.d.ts +97 -0
- package/lib/service/mothership/index.js +149 -0
- package/lib/service/nats/index.d.ts +49 -0
- package/lib/service/nats/index.js +138 -0
- package/lib/utils/Types.d.ts +1 -0
- package/lib/utils/Types.js +2 -0
- package/lib/utils/bouncer/features/Provider.d.ts +19 -0
- package/lib/utils/bouncer/features/Provider.js +101 -0
- package/package.json +37 -29
- package/lib/base.d.ts +0 -12
- package/lib/base.js +0 -8
- package/lib/hcloud.d.ts +0 -13
- package/lib/hcloud.js +0 -29
- package/lib/interfaces/Global.d.ts +0 -8
- package/lib/interfaces/IDP.d.ts +0 -9
- package/lib/interfaces/Mail.d.ts +0 -29
- package/lib/interfaces/Mail.js +0 -8
- package/lib/service/Auditor.d.ts +0 -22
- package/lib/service/Auditor.js +0 -61
- package/lib/service/AuditorInternal.d.ts +0 -28
- package/lib/service/AuditorInternal.js +0 -65
- package/lib/service/High5.d.ts +0 -4
- package/lib/service/High5.js +0 -9
- package/lib/service/IDP.d.ts +0 -39
- package/lib/service/IDP.js +0 -84
- package/lib/service/Mailer.d.ts +0 -13
- package/lib/service/MailerInternal.d.ts +0 -32
- package/lib/service/MailerInternal.js +0 -64
- /package/lib/interfaces/{Global.js → agent/bundle/dev/index.js} +0 -0
- /package/lib/interfaces/{IDP.js → agent/context/index.js} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import Base from "../../../../../../Base";
|
|
2
|
+
import { FullSAMLProvider, SAMLProvider, SAMLProviderCreateDto } from "../../../../../../interfaces/idp/organization/settings/domain/saml";
|
|
3
|
+
export declare class IdpSAMLProvider extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves all SAML providers associated with a given Organization.
|
|
6
|
+
* @param orgName Name of the Organization
|
|
7
|
+
* @returns Array of SAML providers
|
|
8
|
+
*/
|
|
9
|
+
getAllSAMLProvidersOfOrganization(orgName: string): Promise<FullSAMLProvider[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new SAML provider for the specified domain.
|
|
12
|
+
* @param orgName Name of the Organization
|
|
13
|
+
* @param domainName Name of the Domain
|
|
14
|
+
* @param provider SAML provider object containing the login URL, logout URL, certificates and a boolean to allow unencrypted assertion
|
|
15
|
+
* @returns The created SAML provider
|
|
16
|
+
*/
|
|
17
|
+
createProvider(orgName: string, domainName: string, provider: SAMLProviderCreateDto): Promise<SAMLProvider>;
|
|
18
|
+
/**
|
|
19
|
+
* Updates a SAML provider for the specified domain
|
|
20
|
+
* @param orgName Name of the Organization
|
|
21
|
+
* @param domainName Name of the Domain
|
|
22
|
+
* @param provider SAML provider object containing the login URL, logout URL, certificates and a boolean to allow unencrypted assertion
|
|
23
|
+
* @returns The updated SAML provider
|
|
24
|
+
*/
|
|
25
|
+
updateProvider(orgName: string, domainName: string, provider: SAMLProviderCreateDto): Promise<SAMLProvider>;
|
|
26
|
+
/**
|
|
27
|
+
* Adds certificates to a SAML provider
|
|
28
|
+
* @param orgName Name of the Organization
|
|
29
|
+
* @param domainName Name of the Domain
|
|
30
|
+
* @param certificates Certificates to add
|
|
31
|
+
* @returns The updated SAML provider
|
|
32
|
+
*/
|
|
33
|
+
addCertificatesToProvider(orgName: string, domainName: string, certificates: string[]): Promise<SAMLProvider>;
|
|
34
|
+
/**
|
|
35
|
+
* Removes a SAML provider from the specified domain
|
|
36
|
+
* @param orgName Name of the Organization
|
|
37
|
+
* @param domainName Name of the Domain
|
|
38
|
+
*/
|
|
39
|
+
deleteProvider(orgName: string, domainName: string): Promise<void>;
|
|
40
|
+
private convertProviderToFormData;
|
|
41
|
+
private createFileFromString;
|
|
42
|
+
protected getEndpoint(endpoint: string): string;
|
|
43
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.IdpSAMLProvider = void 0;
|
|
13
|
+
const Base_1 = require("../../../../../../Base");
|
|
14
|
+
class IdpSAMLProvider extends Base_1.default {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.convertProviderToFormData = (provider) => {
|
|
18
|
+
const formData = new FormData();
|
|
19
|
+
formData.append("ssoLoginURL", provider.ssoLoginURL);
|
|
20
|
+
formData.append("ssoLogoutURL", provider.ssoLogoutURL);
|
|
21
|
+
provider.certificates.forEach(c => formData.append("certificate", this.createFileFromString(c)));
|
|
22
|
+
provider.allowUnencryptedAssertion && formData.append("allowUnencryptedAssertion", provider.allowUnencryptedAssertion.toString());
|
|
23
|
+
return formData;
|
|
24
|
+
};
|
|
25
|
+
this.createFileFromString = (certificate) => {
|
|
26
|
+
const blob = new Blob([certificate]);
|
|
27
|
+
return new File([blob], "certificate");
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Retrieves all SAML providers associated with a given Organization.
|
|
32
|
+
* @param orgName Name of the Organization
|
|
33
|
+
* @returns Array of SAML providers
|
|
34
|
+
*/
|
|
35
|
+
getAllSAMLProvidersOfOrganization(orgName) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/settings/domains/saml`));
|
|
38
|
+
return resp.data;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new SAML provider for the specified domain.
|
|
43
|
+
* @param orgName Name of the Organization
|
|
44
|
+
* @param domainName Name of the Domain
|
|
45
|
+
* @param provider SAML provider object containing the login URL, logout URL, certificates and a boolean to allow unencrypted assertion
|
|
46
|
+
* @returns The created SAML provider
|
|
47
|
+
*/
|
|
48
|
+
createProvider(orgName, domainName, provider) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const formData = this.convertProviderToFormData(provider);
|
|
51
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/saml`), formData);
|
|
52
|
+
return resp.data;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Updates a SAML provider for the specified domain
|
|
57
|
+
* @param orgName Name of the Organization
|
|
58
|
+
* @param domainName Name of the Domain
|
|
59
|
+
* @param provider SAML provider object containing the login URL, logout URL, certificates and a boolean to allow unencrypted assertion
|
|
60
|
+
* @returns The updated SAML provider
|
|
61
|
+
*/
|
|
62
|
+
updateProvider(orgName, domainName, provider) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const formData = this.convertProviderToFormData(provider);
|
|
65
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/saml`), formData);
|
|
66
|
+
return resp.data;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Adds certificates to a SAML provider
|
|
71
|
+
* @param orgName Name of the Organization
|
|
72
|
+
* @param domainName Name of the Domain
|
|
73
|
+
* @param certificates Certificates to add
|
|
74
|
+
* @returns The updated SAML provider
|
|
75
|
+
*/
|
|
76
|
+
addCertificatesToProvider(orgName, domainName, certificates) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
const formData = new FormData();
|
|
79
|
+
certificates.forEach(c => formData.append("certificate", this.createFileFromString(c)));
|
|
80
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/saml/certificates`), formData);
|
|
81
|
+
return resp.data;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Removes a SAML provider from the specified domain
|
|
86
|
+
* @param orgName Name of the Organization
|
|
87
|
+
* @param domainName Name of the Domain
|
|
88
|
+
*/
|
|
89
|
+
deleteProvider(orgName, domainName) {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
91
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/saml`));
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
getEndpoint(endpoint) {
|
|
95
|
+
return `${this.options.server}/api/account${endpoint}`;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.IdpSAMLProvider = IdpSAMLProvider;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Base from "../../../../Base";
|
|
2
|
+
import { IdpDomain } from "./domain";
|
|
3
|
+
import { IdpOAuthApp } from "./oauth";
|
|
4
|
+
export default class IdpOrganizationSettings extends Base {
|
|
5
|
+
/**
|
|
6
|
+
* Handles everything around open authorization applications
|
|
7
|
+
*/
|
|
8
|
+
get oAuthApp(): IdpOAuthApp;
|
|
9
|
+
private _oAuthApp?;
|
|
10
|
+
/**
|
|
11
|
+
* Handles everything around domains of organizations.
|
|
12
|
+
*/
|
|
13
|
+
get domains(): IdpDomain;
|
|
14
|
+
private _domains?;
|
|
15
|
+
protected getEndpoint(): string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Base_1 = require("../../../../Base");
|
|
4
|
+
const domain_1 = require("./domain");
|
|
5
|
+
const oauth_1 = require("./oauth");
|
|
6
|
+
class IdpOrganizationSettings extends Base_1.default {
|
|
7
|
+
/**
|
|
8
|
+
* Handles everything around open authorization applications
|
|
9
|
+
*/
|
|
10
|
+
get oAuthApp() {
|
|
11
|
+
if (this._oAuthApp === undefined) {
|
|
12
|
+
this._oAuthApp = new oauth_1.IdpOAuthApp(this.options, this.axios);
|
|
13
|
+
}
|
|
14
|
+
return this._oAuthApp;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Handles everything around domains of organizations.
|
|
18
|
+
*/
|
|
19
|
+
get domains() {
|
|
20
|
+
if (this._domains === undefined) {
|
|
21
|
+
this._domains = new domain_1.IdpDomain(this.options, this.axios);
|
|
22
|
+
}
|
|
23
|
+
return this._domains;
|
|
24
|
+
}
|
|
25
|
+
getEndpoint() {
|
|
26
|
+
throw new Error("Method not implemented.");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.default = IdpOrganizationSettings;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import Base from "../../../../../Base";
|
|
2
|
+
import { PaginatedResponse, SearchParams } from "../../../../../interfaces/global";
|
|
3
|
+
import { OAuthApp, OAuthAppCreate } from "../../../../../interfaces/idp/organization/settings/oauthApp";
|
|
4
|
+
export declare class IdpOAuthApp extends Base {
|
|
5
|
+
/**
|
|
6
|
+
* Retrieves all OAuth apps of the specified Organization matching the provided search filter(s). Will return all OAuth apps if no search filter is provided.
|
|
7
|
+
* @param orgName Name of the Organization
|
|
8
|
+
* @param filters (optional) Array of search filters
|
|
9
|
+
* @param sorting (optional) Sorting object
|
|
10
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
11
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
12
|
+
* @returns Object containing an array of OAuth apps and the total number of results found in the database (independent of limit and page)
|
|
13
|
+
*/
|
|
14
|
+
searchOauthAppsOfOrganization({ organizationName, filters, sorting, limit, page, }: SearchParams & {
|
|
15
|
+
organizationName: string;
|
|
16
|
+
}): Promise<PaginatedResponse<OAuthApp>>;
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves an OAuthApp by its ID.
|
|
19
|
+
* @param orgName Name of the Organization
|
|
20
|
+
* @param oauthAppId ID of the OAuthApp
|
|
21
|
+
* @returns the requested OAuthApp
|
|
22
|
+
*/
|
|
23
|
+
getOAuthApp(orgName: string, oauthAppId: string): Promise<OAuthApp>;
|
|
24
|
+
/**
|
|
25
|
+
* Creates a new OAuth app in the specified Organization.
|
|
26
|
+
* @param orgName Name of the Organization
|
|
27
|
+
* @param oAuthAppCreate Object containing the app's name, secretName, callback and optionally a base64 encoded avatar and a description
|
|
28
|
+
* @returns The created OAuth app
|
|
29
|
+
*/
|
|
30
|
+
createOAuthApp(orgName: string, oAuthAppCreate: OAuthAppCreate): Promise<OAuthApp>;
|
|
31
|
+
/**
|
|
32
|
+
* Updates an existing OAuth app.
|
|
33
|
+
* @param orgName Name of the Organization
|
|
34
|
+
* @param oauthAppId ID of the OAuth app to be updated
|
|
35
|
+
* @param oAuthAppCreate Object containing the app's name, secretName, callback and optionally a base64 encoded avatar and a description
|
|
36
|
+
* @returns the updated OAuth app
|
|
37
|
+
*/
|
|
38
|
+
updateOAuthApp(orgName: string, oauthAppId: string, oAuthAppCreate: OAuthAppCreate): Promise<OAuthApp>;
|
|
39
|
+
/**
|
|
40
|
+
* Deletes an OAuthApp by its ID.
|
|
41
|
+
* @param orgName Name of the Organization
|
|
42
|
+
* @param oauthAppId ID of the OAuthApp
|
|
43
|
+
*/
|
|
44
|
+
deleteOAuthApp(orgName: string, oauthAppId: string): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Creates a new secret for an existing OAuthApp.
|
|
47
|
+
* @param orgName Name of the Organization
|
|
48
|
+
* @param oauthAppId ID of the OAuthApp
|
|
49
|
+
* @param secretName Name of the Secret
|
|
50
|
+
* @returns the updated OAuth app
|
|
51
|
+
*/
|
|
52
|
+
createOAuthAppSecret(orgName: string, oauthAppId: string, secretName: string): Promise<OAuthApp>;
|
|
53
|
+
/**
|
|
54
|
+
* Deletes the specified OAuthApp secret.
|
|
55
|
+
* @param orgName Name of the Organization
|
|
56
|
+
* @param oauthAppId ID of the OAuthApp
|
|
57
|
+
* @param secret Name of the secret that shall be deleted
|
|
58
|
+
* @returns the updated OAuthApp
|
|
59
|
+
*/
|
|
60
|
+
deleteOAuthAppSecret(orgName: string, oauthAppId: string, secret: string): Promise<OAuthApp>;
|
|
61
|
+
protected getEndpoint(endpoint: string): string;
|
|
62
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.IdpOAuthApp = void 0;
|
|
13
|
+
const Base_1 = require("../../../../../Base");
|
|
14
|
+
const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
|
|
15
|
+
const searchFilter_1 = require("../../../../../helper/searchFilter");
|
|
16
|
+
class IdpOAuthApp extends Base_1.default {
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves all OAuth apps of the specified Organization matching the provided search filter(s). Will return all OAuth apps if no search filter is provided.
|
|
19
|
+
* @param orgName Name of the Organization
|
|
20
|
+
* @param filters (optional) Array of search filters
|
|
21
|
+
* @param sorting (optional) Sorting object
|
|
22
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
23
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
24
|
+
* @returns Object containing an array of OAuth apps and the total number of results found in the database (independent of limit and page)
|
|
25
|
+
*/
|
|
26
|
+
searchOauthAppsOfOrganization(_a) {
|
|
27
|
+
return __awaiter(this, arguments, void 0, function* ({ organizationName, filters, sorting, limit = 25, page = 0, }) {
|
|
28
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
29
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
30
|
+
});
|
|
31
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${organizationName}/settings/applications/oauth/search?limit=${limit}&page=${page}`), {
|
|
32
|
+
filters: filtersDTO,
|
|
33
|
+
sorting: sorting,
|
|
34
|
+
});
|
|
35
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves an OAuthApp by its ID.
|
|
40
|
+
* @param orgName Name of the Organization
|
|
41
|
+
* @param oauthAppId ID of the OAuthApp
|
|
42
|
+
* @returns the requested OAuthApp
|
|
43
|
+
*/
|
|
44
|
+
getOAuthApp(orgName, oauthAppId) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth/${oauthAppId}`));
|
|
47
|
+
return resp.data;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Creates a new OAuth app in the specified Organization.
|
|
52
|
+
* @param orgName Name of the Organization
|
|
53
|
+
* @param oAuthAppCreate Object containing the app's name, secretName, callback and optionally a base64 encoded avatar and a description
|
|
54
|
+
* @returns The created OAuth app
|
|
55
|
+
*/
|
|
56
|
+
createOAuthApp(orgName, oAuthAppCreate) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth`), oAuthAppCreate);
|
|
59
|
+
return resp.data;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Updates an existing OAuth app.
|
|
64
|
+
* @param orgName Name of the Organization
|
|
65
|
+
* @param oauthAppId ID of the OAuth app to be updated
|
|
66
|
+
* @param oAuthAppCreate Object containing the app's name, secretName, callback and optionally a base64 encoded avatar and a description
|
|
67
|
+
* @returns the updated OAuth app
|
|
68
|
+
*/
|
|
69
|
+
updateOAuthApp(orgName, oauthAppId, oAuthAppCreate) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth/${oauthAppId}`), oAuthAppCreate);
|
|
72
|
+
return resp.data;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Deletes an OAuthApp by its ID.
|
|
77
|
+
* @param orgName Name of the Organization
|
|
78
|
+
* @param oauthAppId ID of the OAuthApp
|
|
79
|
+
*/
|
|
80
|
+
deleteOAuthApp(orgName, oauthAppId) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth/${oauthAppId}`));
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Creates a new secret for an existing OAuthApp.
|
|
87
|
+
* @param orgName Name of the Organization
|
|
88
|
+
* @param oauthAppId ID of the OAuthApp
|
|
89
|
+
* @param secretName Name of the Secret
|
|
90
|
+
* @returns the updated OAuth app
|
|
91
|
+
*/
|
|
92
|
+
createOAuthAppSecret(orgName, oauthAppId, secretName) {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth/${oauthAppId}/secret`), {
|
|
95
|
+
secretName,
|
|
96
|
+
});
|
|
97
|
+
return resp.data;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Deletes the specified OAuthApp secret.
|
|
102
|
+
* @param orgName Name of the Organization
|
|
103
|
+
* @param oauthAppId ID of the OAuthApp
|
|
104
|
+
* @param secret Name of the secret that shall be deleted
|
|
105
|
+
* @returns the updated OAuthApp
|
|
106
|
+
*/
|
|
107
|
+
deleteOAuthAppSecret(orgName, oauthAppId, secret) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth/${oauthAppId}/secret/${secret}`));
|
|
110
|
+
return resp.data;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
getEndpoint(endpoint) {
|
|
114
|
+
return `${this.options.server}/api/account${endpoint}`;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.IdpOAuthApp = IdpOAuthApp;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import Base from "../../../../Base";
|
|
2
|
+
import { PaginatedResponse, SearchFilter, SearchParams, Sorting } from "../../../../interfaces/global";
|
|
3
|
+
import { Team, TeamQueryOptions, TeamUsersPatchOperation } from "../../../../interfaces/idp/organization/team";
|
|
4
|
+
import { ReducedUser } from "../../../../interfaces/idp/user";
|
|
5
|
+
export declare class IdpOrganizationTeams extends Base {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new Team in the specified Organization.
|
|
8
|
+
* @param orgName Name of the Organization
|
|
9
|
+
* @param teamName Name of the Team
|
|
10
|
+
* @param userIds List of User IDs to be added to the Team
|
|
11
|
+
* @returns The created Team
|
|
12
|
+
*/
|
|
13
|
+
createTeam(orgName: string, teamName: string, userIds: string[]): Promise<Team>;
|
|
14
|
+
/**
|
|
15
|
+
* Deletes a Team.
|
|
16
|
+
* @param orgName Name of the Organization
|
|
17
|
+
* @param teamName Name of the Team
|
|
18
|
+
*/
|
|
19
|
+
deleteTeam(orgName: string, teamName: string): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Updates an existing Team.
|
|
22
|
+
* @param orgName Name of the Organization
|
|
23
|
+
* @param teamName Name of the Team
|
|
24
|
+
* @param newName (optional) New Team name
|
|
25
|
+
* @param userIds (optional) List of user IDs to be added to, deleted from or set to the Team depending on the parameter 'teamUserPatchOperation'
|
|
26
|
+
* @param teamUsersPatchOperation (optional) Enum describing what operation shall be executed: Add, set or remove
|
|
27
|
+
* @returns The updated Team object
|
|
28
|
+
*/
|
|
29
|
+
patchTeam(orgName: string, teamName: string, newName?: string, userIds?: string[], teamUsersPatchOperation?: TeamUsersPatchOperation): Promise<Team>;
|
|
30
|
+
/**
|
|
31
|
+
* Retrieve a Team by its name.
|
|
32
|
+
* @param orgName Name of the Organization
|
|
33
|
+
* @param teamName Name of the Team
|
|
34
|
+
* @returns The requested Team
|
|
35
|
+
*/
|
|
36
|
+
getTeam(orgName: string, teamName: string): Promise<Team>;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieves all Teams of an Organization that match the provided search filter(s). Returns all Teams if no search filter is provided.
|
|
39
|
+
* @param organizationName Name of the organization
|
|
40
|
+
* @param filters (optional) Array of search filters
|
|
41
|
+
* @param sorting (optional) Sorting object
|
|
42
|
+
* @param options (optional) Defines query options to retrieve additional properties for the returned Team objects.
|
|
43
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
44
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
45
|
+
* @returns Object containing an array of Teams and the total number of results found in the database (independent of limit and page)
|
|
46
|
+
*/
|
|
47
|
+
searchTeams(params: {
|
|
48
|
+
organizationName: string;
|
|
49
|
+
filters: SearchFilter[];
|
|
50
|
+
sorting?: Sorting;
|
|
51
|
+
options?: TeamQueryOptions;
|
|
52
|
+
limit?: number;
|
|
53
|
+
page?: number;
|
|
54
|
+
}): Promise<PaginatedResponse<Team>>;
|
|
55
|
+
/**
|
|
56
|
+
* Retrieves all Members of a Team that match the provided search filter(s). Returns all Members if no search filter is provided.
|
|
57
|
+
* @param organizationName Name of the organization
|
|
58
|
+
* @param teamName Name of the Team
|
|
59
|
+
* @param filters (optional) Array of search filters
|
|
60
|
+
* @param sorting (optional) Sorting object
|
|
61
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
62
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
63
|
+
* @returns Object containing an array of Team members and the total number of results found in the database (independent of limit and page)
|
|
64
|
+
*/
|
|
65
|
+
searchTeamMembers({ organizationName, teamName, filters, sorting, limit, page, }: SearchParams & {
|
|
66
|
+
organizationName: string;
|
|
67
|
+
teamName: string;
|
|
68
|
+
}): Promise<PaginatedResponse<ReducedUser & {
|
|
69
|
+
email: string;
|
|
70
|
+
}>>;
|
|
71
|
+
protected getEndpoint(endpoint: string): string;
|
|
72
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.IdpOrganizationTeams = void 0;
|
|
13
|
+
const Base_1 = require("../../../../Base");
|
|
14
|
+
const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
|
|
15
|
+
const searchFilter_1 = require("../../../../helper/searchFilter");
|
|
16
|
+
class IdpOrganizationTeams extends Base_1.default {
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new Team in the specified Organization.
|
|
19
|
+
* @param orgName Name of the Organization
|
|
20
|
+
* @param teamName Name of the Team
|
|
21
|
+
* @param userIds List of User IDs to be added to the Team
|
|
22
|
+
* @returns The created Team
|
|
23
|
+
*/
|
|
24
|
+
createTeam(orgName, teamName, userIds) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const resp = yield this.axios.post(this.getEndpoint(`/${orgName}/teams`), { name: teamName, userIds: userIds });
|
|
27
|
+
return resp.data;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Deletes a Team.
|
|
32
|
+
* @param orgName Name of the Organization
|
|
33
|
+
* @param teamName Name of the Team
|
|
34
|
+
*/
|
|
35
|
+
deleteTeam(orgName, teamName) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
yield this.axios.delete(this.getEndpoint(`/${orgName}/teams/${teamName}`));
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Updates an existing Team.
|
|
42
|
+
* @param orgName Name of the Organization
|
|
43
|
+
* @param teamName Name of the Team
|
|
44
|
+
* @param newName (optional) New Team name
|
|
45
|
+
* @param userIds (optional) List of user IDs to be added to, deleted from or set to the Team depending on the parameter 'teamUserPatchOperation'
|
|
46
|
+
* @param teamUsersPatchOperation (optional) Enum describing what operation shall be executed: Add, set or remove
|
|
47
|
+
* @returns The updated Team object
|
|
48
|
+
*/
|
|
49
|
+
patchTeam(orgName, teamName, newName, userIds, teamUsersPatchOperation) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/teams/${teamName}`), {
|
|
52
|
+
name: newName,
|
|
53
|
+
userIds: userIds,
|
|
54
|
+
usersOperation: teamUsersPatchOperation,
|
|
55
|
+
});
|
|
56
|
+
return resp.data;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Retrieve a Team by its name.
|
|
61
|
+
* @param orgName Name of the Organization
|
|
62
|
+
* @param teamName Name of the Team
|
|
63
|
+
* @returns The requested Team
|
|
64
|
+
*/
|
|
65
|
+
getTeam(orgName, teamName) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const resp = yield this.axios.get(this.getEndpoint(`/${orgName}/teams/${teamName}`));
|
|
68
|
+
return resp.data;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Retrieves all Teams of an Organization that match the provided search filter(s). Returns all Teams if no search filter is provided.
|
|
73
|
+
* @param organizationName Name of the organization
|
|
74
|
+
* @param filters (optional) Array of search filters
|
|
75
|
+
* @param sorting (optional) Sorting object
|
|
76
|
+
* @param options (optional) Defines query options to retrieve additional properties for the returned Team objects.
|
|
77
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
78
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
79
|
+
* @returns Object containing an array of Teams and the total number of results found in the database (independent of limit and page)
|
|
80
|
+
*/
|
|
81
|
+
searchTeams(params) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
var _a, _b;
|
|
84
|
+
const limit = params.limit || 25;
|
|
85
|
+
const page = params.page || 0;
|
|
86
|
+
const getTotalMemberCount = ((_a = params.options) === null || _a === void 0 ? void 0 : _a.getTotalMemberCount) ? `&totalMemberCount=${params.options.getTotalMemberCount}` : "";
|
|
87
|
+
const getMembersSample = ((_b = params.options) === null || _b === void 0 ? void 0 : _b.getMembersSample) ? `&membersSample=${params.options.getMembersSample}` : "";
|
|
88
|
+
const filtersDTO = params.filters.map((f) => {
|
|
89
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
90
|
+
});
|
|
91
|
+
const resp = yield this.axios.post(this.getEndpoint(`/${params.organizationName}/teams/search?limit=${limit}&page=${page}` + getMembersSample + getTotalMemberCount), {
|
|
92
|
+
filters: filtersDTO,
|
|
93
|
+
sorting: params.sorting,
|
|
94
|
+
});
|
|
95
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Retrieves all Members of a Team that match the provided search filter(s). Returns all Members if no search filter is provided.
|
|
100
|
+
* @param organizationName Name of the organization
|
|
101
|
+
* @param teamName Name of the Team
|
|
102
|
+
* @param filters (optional) Array of search filters
|
|
103
|
+
* @param sorting (optional) Sorting object
|
|
104
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
105
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
106
|
+
* @returns Object containing an array of Team members and the total number of results found in the database (independent of limit and page)
|
|
107
|
+
*/
|
|
108
|
+
searchTeamMembers(_a) {
|
|
109
|
+
return __awaiter(this, arguments, void 0, function* ({ organizationName, teamName, filters, sorting, limit = 25, page = 0, }) {
|
|
110
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
111
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
112
|
+
});
|
|
113
|
+
const resp = yield this.axios.post(this.getEndpoint(`/${organizationName}/teams/${teamName}/members/search?limit=${limit}&page=${page}`), {
|
|
114
|
+
filters: filtersDTO,
|
|
115
|
+
sorting: sorting,
|
|
116
|
+
});
|
|
117
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
getEndpoint(endpoint) {
|
|
121
|
+
return `${this.options.server}/api/account/v1/org${endpoint}`;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.IdpOrganizationTeams = IdpOrganizationTeams;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Base from "../../../Base";
|
|
2
|
+
import { SuccessfulAuth } from "../../../interfaces/idp/user/SuccessfulAuth";
|
|
3
|
+
export declare class IdpRegistration extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* Registers a User in the HCloud system. This endpoint will send a verification link (with expiration date) to the Users' email address.
|
|
6
|
+
* At this point the User will have an account status of 'AWAITING_VALIDATION' and cannot sign into his account. If the registration won't be
|
|
7
|
+
* validated before the expiration date, the user will be deleted again.
|
|
8
|
+
* @param name - Name of the User
|
|
9
|
+
* @param email - Email of the User
|
|
10
|
+
* @param password - Password
|
|
11
|
+
* @param captcha - Captcha
|
|
12
|
+
* @param company - Optional company name
|
|
13
|
+
* @param regionId - Optional region id
|
|
14
|
+
* @param targetUrl Optional url the link in the mail will point to
|
|
15
|
+
*/
|
|
16
|
+
register(name: string, email: string, password: string, captcha: string, company?: string, regionId?: string, targetUrl?: string): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Triggers the registration mail to be resend if the first one got lost
|
|
19
|
+
* @param name - Name of the User
|
|
20
|
+
* @param email - Email of the User
|
|
21
|
+
* @param password - Password
|
|
22
|
+
* @param captcha - Captcha
|
|
23
|
+
* @param company - Optional company name
|
|
24
|
+
* @param regionId - Optional region id
|
|
25
|
+
* @param targetUrl Optional url the link in the mail will point to
|
|
26
|
+
*/
|
|
27
|
+
resendRegistrationMail(name: string, email: string, password: string, captcha: string, company?: string, regionId?: string, targetUrl?: string): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Validates a previous registration. If successful, the Users account status will be set to 'Active'.
|
|
30
|
+
* @param email - Email of the User
|
|
31
|
+
* @param verificationCode - Email verification code
|
|
32
|
+
* @param regionId - Optional region id
|
|
33
|
+
* @returns Bearer Token and User object
|
|
34
|
+
*/
|
|
35
|
+
validateRegistration(email: string, verificationCode: string): Promise<SuccessfulAuth>;
|
|
36
|
+
protected getEndpoint(endpoint: string): string;
|
|
37
|
+
}
|