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,87 @@
|
|
|
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.IdpRegistration = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
class IdpRegistration extends Base_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Registers a User in the HCloud system. This endpoint will send a verification link (with expiration date) to the Users' email address.
|
|
17
|
+
* 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
|
|
18
|
+
* validated before the expiration date, the user will be deleted again.
|
|
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
|
+
register(name, email, password, captcha, company, regionId, targetUrl) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
yield this.axios.post(this.getEndpoint("/v1/register"), {
|
|
30
|
+
name: name,
|
|
31
|
+
email: email,
|
|
32
|
+
password: password,
|
|
33
|
+
captcha: captcha,
|
|
34
|
+
company,
|
|
35
|
+
regionId,
|
|
36
|
+
targetUrl,
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Triggers the registration mail to be resend if the first one got lost
|
|
42
|
+
* @param name - Name of the User
|
|
43
|
+
* @param email - Email of the User
|
|
44
|
+
* @param password - Password
|
|
45
|
+
* @param captcha - Captcha
|
|
46
|
+
* @param company - Optional company name
|
|
47
|
+
* @param regionId - Optional region id
|
|
48
|
+
* @param targetUrl Optional url the link in the mail will point to
|
|
49
|
+
*/
|
|
50
|
+
resendRegistrationMail(name, email, password, captcha, company, regionId, targetUrl) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
yield this.axios.patch(this.getEndpoint("/v1/register/resendRegistrationEmail"), {
|
|
53
|
+
name: name,
|
|
54
|
+
email: email,
|
|
55
|
+
password: password,
|
|
56
|
+
captcha: captcha,
|
|
57
|
+
company,
|
|
58
|
+
regionId,
|
|
59
|
+
targetUrl,
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Validates a previous registration. If successful, the Users account status will be set to 'Active'.
|
|
65
|
+
* @param email - Email of the User
|
|
66
|
+
* @param verificationCode - Email verification code
|
|
67
|
+
* @param regionId - Optional region id
|
|
68
|
+
* @returns Bearer Token and User object
|
|
69
|
+
*/
|
|
70
|
+
validateRegistration(email, verificationCode) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
var _a;
|
|
73
|
+
const resp = yield this.axios.patch(this.getEndpoint("/v1/register/verify"), {
|
|
74
|
+
email,
|
|
75
|
+
verificationCode,
|
|
76
|
+
});
|
|
77
|
+
return {
|
|
78
|
+
token: ((_a = resp.headers["authorization"]) === null || _a === void 0 ? void 0 : _a.toString()) || "",
|
|
79
|
+
user: resp.data,
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
getEndpoint(endpoint) {
|
|
84
|
+
return `${this.options.server}/api/account${endpoint}`;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
exports.IdpRegistration = IdpRegistration;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import Base from "../../../Base";
|
|
2
|
+
import { PaginatedResponse, SearchFilter, Sorting } from "../../../interfaces/global";
|
|
3
|
+
import { Organization, OrganizationQueryOptions } from "../../../interfaces/idp/organization";
|
|
4
|
+
import { OrganizationMemberInvitation } from "../../../interfaces/idp/organization/member/invitations";
|
|
5
|
+
import { User, UserPatch } from "../../../interfaces/idp/user";
|
|
6
|
+
import { IdpUserLicense } from "./license";
|
|
7
|
+
import UserPasswordService from "./password";
|
|
8
|
+
import { IdpSettings } from "./settings";
|
|
9
|
+
export declare class IdpUser extends Base {
|
|
10
|
+
/**
|
|
11
|
+
* Handles everything around a user's settings
|
|
12
|
+
*/
|
|
13
|
+
get settings(): IdpSettings;
|
|
14
|
+
private _settings?;
|
|
15
|
+
/**
|
|
16
|
+
* Handles everything around a user's password
|
|
17
|
+
*/
|
|
18
|
+
get password(): UserPasswordService;
|
|
19
|
+
private _password?;
|
|
20
|
+
/**
|
|
21
|
+
* Handles everything around a user's license
|
|
22
|
+
*/
|
|
23
|
+
get license(): IdpUserLicense;
|
|
24
|
+
private _license?;
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves the User database entry for the requesting user.
|
|
27
|
+
* @returns User object
|
|
28
|
+
*/
|
|
29
|
+
getUser(): Promise<User>;
|
|
30
|
+
/**
|
|
31
|
+
* Updates the User database entry of the requesting user.
|
|
32
|
+
* @param user UserPatch object holding the new User values
|
|
33
|
+
* @returns User object
|
|
34
|
+
*/
|
|
35
|
+
patchUser(user: UserPatch): Promise<User>;
|
|
36
|
+
/**
|
|
37
|
+
* Updates the Password of the requesting user.
|
|
38
|
+
* @param oldPassword String object holding the old password
|
|
39
|
+
* @param newPassword String object holding the new password
|
|
40
|
+
* @param token String (optional) object holding the current TOTP token
|
|
41
|
+
* @returns User object
|
|
42
|
+
*/
|
|
43
|
+
patchUserPassword(oldPassword: string, newPassword: string, totp?: string): Promise<User>;
|
|
44
|
+
/**
|
|
45
|
+
* Deletes user session and logs him out of HCloud on all devices.
|
|
46
|
+
*/
|
|
47
|
+
deleteUserSession(): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Deletes the requesting user.
|
|
50
|
+
*/
|
|
51
|
+
deleteUser(): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Retrieves all Organizations of a user that match the provided search filter(s). Returns all Organizations of the user if no search filter is provided.
|
|
54
|
+
* @param filters (optional) Array of search filters
|
|
55
|
+
* @param sorting (optional) Sorting object
|
|
56
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
57
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
58
|
+
* @param options (optional) Defines query options to retrieve additional properties for the returned Organization objects.
|
|
59
|
+
* @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
|
|
60
|
+
*/
|
|
61
|
+
searchOrganizations(params: {
|
|
62
|
+
filters: SearchFilter[];
|
|
63
|
+
sorting?: Sorting;
|
|
64
|
+
limit?: number;
|
|
65
|
+
page?: number;
|
|
66
|
+
options?: OrganizationQueryOptions;
|
|
67
|
+
}): Promise<PaginatedResponse<Organization>>;
|
|
68
|
+
/**
|
|
69
|
+
* Retrieves all organization invitations of a user that match the provided search filter(s). Returns all invitations of the user if no search filter is provided.
|
|
70
|
+
* @param filters (optional) Array of search filters
|
|
71
|
+
* @param sorting (optional) Sorting object
|
|
72
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
73
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
74
|
+
* @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
|
|
75
|
+
*/
|
|
76
|
+
searchInvitations(params: {
|
|
77
|
+
filters: SearchFilter[];
|
|
78
|
+
sorting?: Sorting;
|
|
79
|
+
limit?: number;
|
|
80
|
+
page?: number;
|
|
81
|
+
}): Promise<PaginatedResponse<OrganizationMemberInvitation>>;
|
|
82
|
+
protected getEndpoint(endpoint: string): string;
|
|
83
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
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.IdpUser = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
const paginatedResponseHelper_1 = require("../../../helper/paginatedResponseHelper");
|
|
15
|
+
const searchFilter_1 = require("../../../helper/searchFilter");
|
|
16
|
+
const license_1 = require("./license");
|
|
17
|
+
const password_1 = require("./password");
|
|
18
|
+
const settings_1 = require("./settings");
|
|
19
|
+
class IdpUser extends Base_1.default {
|
|
20
|
+
/**
|
|
21
|
+
* Handles everything around a user's settings
|
|
22
|
+
*/
|
|
23
|
+
get settings() {
|
|
24
|
+
if (this._settings === undefined) {
|
|
25
|
+
this._settings = new settings_1.IdpSettings(this.options, this.axios);
|
|
26
|
+
}
|
|
27
|
+
return this._settings;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Handles everything around a user's password
|
|
31
|
+
*/
|
|
32
|
+
get password() {
|
|
33
|
+
if (this._password === undefined) {
|
|
34
|
+
this._password = new password_1.default(this.options, this.axios);
|
|
35
|
+
}
|
|
36
|
+
return this._password;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Handles everything around a user's license
|
|
40
|
+
*/
|
|
41
|
+
get license() {
|
|
42
|
+
if (this._license === undefined) {
|
|
43
|
+
this._license = new license_1.IdpUserLicense(this.options, this.axios);
|
|
44
|
+
}
|
|
45
|
+
return this._license;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves the User database entry for the requesting user.
|
|
49
|
+
* @returns User object
|
|
50
|
+
*/
|
|
51
|
+
getUser() {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
const resp = yield this.axios.get(this.getEndpoint("/v1/user"));
|
|
54
|
+
return resp.data;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Updates the User database entry of the requesting user.
|
|
59
|
+
* @param user UserPatch object holding the new User values
|
|
60
|
+
* @returns User object
|
|
61
|
+
*/
|
|
62
|
+
patchUser(user) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/user`), user);
|
|
65
|
+
return resp.data;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Updates the Password of the requesting user.
|
|
70
|
+
* @param oldPassword String object holding the old password
|
|
71
|
+
* @param newPassword String object holding the new password
|
|
72
|
+
* @param token String (optional) object holding the current TOTP token
|
|
73
|
+
* @returns User object
|
|
74
|
+
*/
|
|
75
|
+
patchUserPassword(oldPassword, newPassword, totp) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const t = {
|
|
78
|
+
old: oldPassword,
|
|
79
|
+
new: newPassword,
|
|
80
|
+
token: totp,
|
|
81
|
+
};
|
|
82
|
+
if (!totp) {
|
|
83
|
+
delete t.token;
|
|
84
|
+
}
|
|
85
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/password`), t);
|
|
86
|
+
return resp.data;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Deletes user session and logs him out of HCloud on all devices.
|
|
91
|
+
*/
|
|
92
|
+
deleteUserSession() {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
yield this.axios.delete(this.getEndpoint(`/v1/user/sessions`));
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Deletes the requesting user.
|
|
99
|
+
*/
|
|
100
|
+
deleteUser() {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
yield this.axios.delete(this.getEndpoint(`/v1/user`));
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Retrieves all Organizations of a user that match the provided search filter(s). Returns all Organizations of the user if no search filter is provided.
|
|
107
|
+
* @param filters (optional) Array of search filters
|
|
108
|
+
* @param sorting (optional) Sorting object
|
|
109
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
110
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
111
|
+
* @param options (optional) Defines query options to retrieve additional properties for the returned Organization objects.
|
|
112
|
+
* @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
|
|
113
|
+
*/
|
|
114
|
+
searchOrganizations(params) {
|
|
115
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
+
var _a, _b, _c;
|
|
117
|
+
const limit = params.limit || 25;
|
|
118
|
+
const page = params.page || 0;
|
|
119
|
+
const getTeamsOfUser = ((_a = params.options) === null || _a === void 0 ? void 0 : _a.getTeamsOfUser) ? `&teamsOfUser=${params.options.getTeamsOfUser}` : "";
|
|
120
|
+
const getTotalMemberCount = ((_b = params.options) === null || _b === void 0 ? void 0 : _b.getTotalMemberCount) ? `&totalMemberCount=${params.options.getTotalMemberCount}` : "";
|
|
121
|
+
const getMembersSample = ((_c = params.options) === null || _c === void 0 ? void 0 : _c.getMembersSample) ? `&membersSample=${params.options.getMembersSample}` : "";
|
|
122
|
+
// convert SearchFilters to DTO
|
|
123
|
+
const filtersDTO = params.filters.map((f) => {
|
|
124
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
125
|
+
});
|
|
126
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/user/orgs/search?limit=${limit}&page=${page}` + getTeamsOfUser + getTotalMemberCount + getMembersSample), {
|
|
127
|
+
filters: filtersDTO,
|
|
128
|
+
sorting: params.sorting,
|
|
129
|
+
});
|
|
130
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Retrieves all organization invitations of a user that match the provided search filter(s). Returns all invitations of the user if no search filter is provided.
|
|
135
|
+
* @param filters (optional) Array of search filters
|
|
136
|
+
* @param sorting (optional) Sorting object
|
|
137
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
138
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
139
|
+
* @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
|
|
140
|
+
*/
|
|
141
|
+
searchInvitations(params) {
|
|
142
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
const limit = params.limit || 25;
|
|
144
|
+
const page = params.page || 0;
|
|
145
|
+
// convert SearchFilters to DTO
|
|
146
|
+
const filtersDTO = params.filters.map((f) => {
|
|
147
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
148
|
+
});
|
|
149
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/user/orgs/invitations/search?limit=${limit}&page=${page}`), {
|
|
150
|
+
filters: filtersDTO,
|
|
151
|
+
sorting: params.sorting,
|
|
152
|
+
});
|
|
153
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
getEndpoint(endpoint) {
|
|
157
|
+
return `${this.options.server}/api/account${endpoint}`;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
exports.IdpUser = IdpUser;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Base from "../../../../Base";
|
|
2
|
+
import { License } from "../../../../interfaces/idp/organization/license";
|
|
3
|
+
export declare class IdpUserLicense extends Base {
|
|
4
|
+
getLicense(): Promise<License>;
|
|
5
|
+
updateLicense(token: string): Promise<License>;
|
|
6
|
+
protected getEndpoint(endpoint: string): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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.IdpUserLicense = void 0;
|
|
13
|
+
const Base_1 = require("../../../../Base");
|
|
14
|
+
class IdpUserLicense extends Base_1.default {
|
|
15
|
+
getLicense() {
|
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
+
const res = yield this.axios.get(this.getEndpoint(`/user/license`));
|
|
18
|
+
return res.data;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
updateLicense(token) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const res = yield this.axios.put(this.getEndpoint(`/user/license`), { identifier: token });
|
|
24
|
+
return res.data;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
getEndpoint(endpoint) {
|
|
28
|
+
return `${this.options.server}/api/account/v1${endpoint}`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.IdpUserLicense = IdpUserLicense;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Base from "../../../../Base";
|
|
2
|
+
import { User } from "../../../../interfaces/idp";
|
|
3
|
+
export default class UserPasswordService extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* 2nd phase of the reset password flow
|
|
6
|
+
* @param email Email of the user
|
|
7
|
+
* @param nonce Nonce present in the link sent via email
|
|
8
|
+
* @param newPassword New password
|
|
9
|
+
* @param totpToken (Optional) TOTP token in case the user had 2FA enabled
|
|
10
|
+
* @returns User object
|
|
11
|
+
*/
|
|
12
|
+
resetPassword(email: string, nonce: string, newPassword: string, totpToken?: string): Promise<User>;
|
|
13
|
+
parseResetPasswordToken(token: string): {
|
|
14
|
+
email: string;
|
|
15
|
+
nonce: string;
|
|
16
|
+
regionId?: string;
|
|
17
|
+
};
|
|
18
|
+
protected getEndpoint(endpoint: string): string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
const Base_1 = require("../../../../Base");
|
|
13
|
+
class UserPasswordService extends Base_1.default {
|
|
14
|
+
/**
|
|
15
|
+
* 2nd phase of the reset password flow
|
|
16
|
+
* @param email Email of the user
|
|
17
|
+
* @param nonce Nonce present in the link sent via email
|
|
18
|
+
* @param newPassword New password
|
|
19
|
+
* @param totpToken (Optional) TOTP token in case the user had 2FA enabled
|
|
20
|
+
* @returns User object
|
|
21
|
+
*/
|
|
22
|
+
resetPassword(email, nonce, newPassword, totpToken) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const res = yield this.axios.post(this.getEndpoint("/v1/user/password/reset"), {
|
|
25
|
+
email,
|
|
26
|
+
nonce,
|
|
27
|
+
newPassword,
|
|
28
|
+
totpToken,
|
|
29
|
+
});
|
|
30
|
+
return res.data;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
parseResetPasswordToken(token) {
|
|
34
|
+
const decoded = atob(token.replace("_", "/").replace("-", "+"));
|
|
35
|
+
let obj;
|
|
36
|
+
try {
|
|
37
|
+
obj = JSON.parse(decoded);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
throw new Error(`Token ${token} is poorly formatted. Decoded to ${decoded}.`);
|
|
41
|
+
}
|
|
42
|
+
if (!("email" in obj) || !("nonce" in obj)) {
|
|
43
|
+
throw new Error(`Decoded token ${decoded} is missing email or nonce property.`);
|
|
44
|
+
}
|
|
45
|
+
return obj;
|
|
46
|
+
}
|
|
47
|
+
getEndpoint(endpoint) {
|
|
48
|
+
return `${this.options.server}/api/account${endpoint}`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = UserPasswordService;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Base from "../../../../../Base";
|
|
2
|
+
import { ConnectionSettings } from "../../../../../interfaces/idp/user/ConnectionSettings";
|
|
3
|
+
export declare class IdpConnections extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* Get connection settings for all organizations the user is a part of.
|
|
6
|
+
*
|
|
7
|
+
* Must have a set authentication token.
|
|
8
|
+
*
|
|
9
|
+
* @returns connection settings for each organization
|
|
10
|
+
*/
|
|
11
|
+
get(): Promise<ConnectionSettings>;
|
|
12
|
+
protected getEndpoint(): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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.IdpConnections = void 0;
|
|
13
|
+
const Base_1 = require("../../../../../Base");
|
|
14
|
+
class IdpConnections extends Base_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Get connection settings for all organizations the user is a part of.
|
|
17
|
+
*
|
|
18
|
+
* Must have a set authentication token.
|
|
19
|
+
*
|
|
20
|
+
* @returns connection settings for each organization
|
|
21
|
+
*/
|
|
22
|
+
get() {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const res = yield this.axios.get(this.getEndpoint());
|
|
25
|
+
return res.data;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
getEndpoint() {
|
|
29
|
+
return `${this.options.server}/api/account/v1/user/settings/connections`;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.IdpConnections = IdpConnections;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Base from "../../../../../Base";
|
|
2
|
+
import { GeneralSettings, GeneralSettingsLastVisitPatch, GeneralSettingsPatch } from "../../../../../interfaces/idp/user/GeneralSettings";
|
|
3
|
+
export declare class IdpGeneral extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves the current active user settings.
|
|
6
|
+
* @returns the current active user settings
|
|
7
|
+
*/
|
|
8
|
+
getGeneralSettings(): Promise<GeneralSettings>;
|
|
9
|
+
/**
|
|
10
|
+
* Changes the user settings.
|
|
11
|
+
* @param generalSettingsPatch Object containing the new user settings
|
|
12
|
+
* @returns the updated user settings
|
|
13
|
+
*/
|
|
14
|
+
patchGeneralSettings(generalSettingsPatch: GeneralSettingsPatch): Promise<GeneralSettings>;
|
|
15
|
+
/**
|
|
16
|
+
* Changes the user last visit settings.
|
|
17
|
+
* @param generalSettingsLastVisitPatch Object containing the new user settings in case of lastView and lastURL
|
|
18
|
+
* @returns the updated user settings
|
|
19
|
+
*/
|
|
20
|
+
patchGeneralSettingsLastVisit(generalSettingsLastVisitPatch: GeneralSettingsLastVisitPatch): Promise<GeneralSettings>;
|
|
21
|
+
protected getEndpoint(endpoint: string): string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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.IdpGeneral = void 0;
|
|
13
|
+
const Base_1 = require("../../../../../Base");
|
|
14
|
+
class IdpGeneral extends Base_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves the current active user settings.
|
|
17
|
+
* @returns the current active user settings
|
|
18
|
+
*/
|
|
19
|
+
getGeneralSettings() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/user/settings/general`));
|
|
22
|
+
return resp.data;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Changes the user settings.
|
|
27
|
+
* @param generalSettingsPatch Object containing the new user settings
|
|
28
|
+
* @returns the updated user settings
|
|
29
|
+
*/
|
|
30
|
+
patchGeneralSettings(generalSettingsPatch) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/general`), generalSettingsPatch);
|
|
33
|
+
return resp.data;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Changes the user last visit settings.
|
|
38
|
+
* @param generalSettingsLastVisitPatch Object containing the new user settings in case of lastView and lastURL
|
|
39
|
+
* @returns the updated user settings
|
|
40
|
+
*/
|
|
41
|
+
patchGeneralSettingsLastVisit(generalSettingsLastVisitPatch) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/general/lastVisit`), generalSettingsLastVisitPatch);
|
|
44
|
+
return resp.data;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
getEndpoint(endpoint) {
|
|
48
|
+
return `${this.options.server}/api/account${endpoint}`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.IdpGeneral = IdpGeneral;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import Base from "../../../../Base";
|
|
2
|
+
import { IdpConnections } from "./connections";
|
|
3
|
+
import { IdpGeneral } from "./general";
|
|
4
|
+
import { IdpNotifications } from "./notifications";
|
|
5
|
+
import { IdpOAuthApps } from "./oauthApps";
|
|
6
|
+
import { IdpPat } from "./pats";
|
|
7
|
+
import { IdpTwoFactor } from "./twoFactor";
|
|
8
|
+
export declare class IdpSettings extends Base {
|
|
9
|
+
/**
|
|
10
|
+
* Handles everything around a user's pats (Personal Access Tokens)
|
|
11
|
+
*/
|
|
12
|
+
get pat(): IdpPat;
|
|
13
|
+
private _pat?;
|
|
14
|
+
/**
|
|
15
|
+
* Handles everything around general user settings
|
|
16
|
+
*/
|
|
17
|
+
get general(): IdpGeneral;
|
|
18
|
+
private _general?;
|
|
19
|
+
/**
|
|
20
|
+
* Handles everything around notification settings of user
|
|
21
|
+
*/
|
|
22
|
+
get notifications(): IdpNotifications;
|
|
23
|
+
private _notifications?;
|
|
24
|
+
/**
|
|
25
|
+
* Manages user's OAuth applications
|
|
26
|
+
*/
|
|
27
|
+
get oAuthApps(): IdpOAuthApps;
|
|
28
|
+
private _oAuthApps?;
|
|
29
|
+
/**
|
|
30
|
+
* Handles everything around a user's two factor authentication
|
|
31
|
+
*/
|
|
32
|
+
get twoFactor(): IdpTwoFactor;
|
|
33
|
+
private _twoFactor?;
|
|
34
|
+
/**
|
|
35
|
+
* Handles everything around a user's two factor authentication
|
|
36
|
+
*/
|
|
37
|
+
get connections(): IdpConnections;
|
|
38
|
+
private _connections?;
|
|
39
|
+
protected getEndpoint(endpoint: string): string;
|
|
40
|
+
}
|