hcloud-sdk 0.0.16 → 14.13.2
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 +809 -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 +80 -0
- package/lib/Hcloud.js +134 -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 +10 -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/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 +60 -0
- package/lib/interfaces/high5/space/event/stream/node/index.js +7 -0
- package/lib/interfaces/high5/space/execution/index.d.ts +137 -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/index.d.ts +171 -0
- package/lib/interfaces/high5/wave/index.js +52 -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 +44 -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 +27 -0
- package/lib/interfaces/mothership/index.js +8 -0
- package/lib/interfaces/nats/index.d.ts +252 -0
- package/lib/interfaces/nats/index.js +334 -0
- package/lib/service/agent/bundle/dev/index.d.ts +17 -0
- package/lib/service/agent/bundle/dev/index.js +40 -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 +37 -0
- package/lib/service/agent/context/index.js +81 -0
- package/lib/service/agent/index.d.ts +14 -0
- package/lib/service/agent/index.js +20 -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 +26 -0
- package/lib/service/auditor/index.js +49 -0
- package/lib/service/auditor/internal/index.d.ts +27 -0
- package/lib/service/{AuditorInternal.js → auditor/internal/index.js} +20 -24
- package/lib/service/bouncer/features/index.d.ts +8 -0
- package/lib/service/bouncer/features/index.js +25 -0
- package/lib/service/bouncer/index.d.ts +14 -0
- package/lib/service/bouncer/index.js +31 -0
- package/lib/service/dali/DaliAvatar.d.ts +36 -0
- package/lib/service/dali/DaliAvatar.js +25 -0
- package/lib/service/dali/avatar/DaliFuseSpace.d.ts +28 -0
- package/lib/service/dali/avatar/DaliFuseSpace.js +55 -0
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +28 -0
- package/lib/service/dali/avatar/DaliHigh5Space.js +55 -0
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +28 -0
- package/lib/service/dali/avatar/DaliOAuthApp.js +55 -0
- package/lib/service/dali/avatar/DaliOrganization.d.ts +25 -0
- package/lib/service/dali/avatar/DaliOrganization.js +52 -0
- package/lib/service/dali/avatar/DaliTeam.d.ts +28 -0
- package/lib/service/dali/avatar/DaliTeam.js +55 -0
- package/lib/service/dali/avatar/DaliUser.d.ts +22 -0
- package/lib/service/dali/avatar/DaliUser.js +49 -0
- package/lib/service/dali/index.d.ts +16 -0
- package/lib/service/dali/index.js +30 -0
- package/lib/service/fuse/index.d.ts +17 -0
- package/lib/service/fuse/index.js +34 -0
- package/lib/service/fuse/internal/index.d.ts +9 -0
- package/lib/service/fuse/internal/index.js +29 -0
- package/lib/service/fuse/internal/space/cronjob/index.d.ts +8 -0
- package/lib/service/fuse/internal/space/cronjob/index.js +15 -0
- package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +17 -0
- package/lib/service/fuse/internal/space/cronjob/log/index.js +35 -0
- package/lib/service/fuse/internal/space/index.d.ts +23 -0
- package/lib/service/fuse/internal/space/index.js +43 -0
- package/lib/service/fuse/space/cronjob/index.d.ts +123 -0
- package/lib/service/fuse/space/cronjob/index.js +175 -0
- package/lib/service/fuse/space/cronjob/log/index.d.ts +31 -0
- package/lib/service/fuse/space/cronjob/log/index.js +57 -0
- package/lib/service/fuse/space/index.d.ts +82 -0
- package/lib/service/fuse/space/index.js +134 -0
- package/lib/service/high5/execution/index.d.ts +10 -0
- package/lib/service/high5/execution/index.js +17 -0
- package/lib/service/high5/execution/log/index.d.ts +19 -0
- package/lib/service/high5/execution/log/index.js +41 -0
- package/lib/service/high5/execution/status/index.d.ts +18 -0
- package/lib/service/high5/execution/status/index.js +41 -0
- package/lib/service/high5/index.d.ts +22 -0
- package/lib/service/high5/index.js +39 -0
- package/lib/service/high5/internal/index.d.ts +9 -0
- package/lib/service/high5/internal/index.js +29 -0
- package/lib/service/high5/internal/space/index.d.ts +21 -0
- package/lib/service/high5/internal/space/index.js +41 -0
- package/lib/service/high5/joinToken/index.d.ts +40 -0
- package/lib/service/high5/joinToken/index.js +64 -0
- package/lib/service/high5/space/event/index.d.ts +56 -0
- package/lib/service/high5/space/event/index.js +89 -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 +38 -0
- package/lib/service/high5/space/event/stream/design/index.js +56 -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 +100 -0
- package/lib/service/high5/space/event/stream/index.d.ts +114 -0
- package/lib/service/high5/space/event/stream/index.js +164 -0
- package/lib/service/high5/space/execution/index.d.ts +48 -0
- package/lib/service/high5/space/execution/index.js +74 -0
- package/lib/service/high5/space/execution/log/index.d.ts +31 -0
- package/lib/service/high5/space/execution/log/index.js +57 -0
- package/lib/service/high5/space/execution/status/index.d.ts +16 -0
- package/lib/service/high5/space/execution/status/index.js +34 -0
- package/lib/service/high5/space/index.d.ts +107 -0
- package/lib/service/high5/space/index.js +160 -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 +92 -0
- package/lib/service/high5/space/wave/index.d.ts +38 -0
- package/lib/service/high5/space/wave/index.js +66 -0
- package/lib/service/high5/space/webhook/index.d.ts +83 -0
- package/lib/service/high5/space/webhook/index.js +132 -0
- package/lib/service/high5/space/webhook/log/index.d.ts +18 -0
- package/lib/service/high5/space/webhook/log/index.js +38 -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 +88 -0
- package/lib/service/idp/index.d.ts +82 -0
- package/lib/service/idp/index.js +137 -0
- package/lib/service/idp/internal/index.d.ts +19 -0
- package/lib/service/idp/internal/index.js +34 -0
- package/lib/service/idp/oauth/index.d.ts +45 -0
- package/lib/service/idp/oauth/index.js +105 -0
- package/lib/service/idp/organization/index.d.ts +54 -0
- package/lib/service/idp/organization/index.js +79 -0
- package/lib/service/idp/organization/license/index.d.ts +7 -0
- package/lib/service/idp/organization/license/index.js +30 -0
- package/lib/service/idp/organization/member/index.d.ts +58 -0
- package/lib/service/idp/organization/member/index.js +96 -0
- package/lib/service/idp/organization/member/invitations/index.d.ts +79 -0
- package/lib/service/idp/organization/member/invitations/index.js +118 -0
- package/lib/service/idp/organization/settings/domain/index.d.ts +38 -0
- package/lib/service/idp/organization/settings/domain/index.js +63 -0
- package/lib/service/idp/organization/settings/domain/saml/index.d.ts +43 -0
- package/lib/service/idp/organization/settings/domain/saml/index.js +88 -0
- package/lib/service/idp/organization/settings/index.d.ts +16 -0
- package/lib/service/idp/organization/settings/index.js +16 -0
- package/lib/service/idp/organization/settings/oauth/index.d.ts +64 -0
- package/lib/service/idp/organization/settings/oauth/index.js +106 -0
- package/lib/service/idp/organization/team/index.d.ts +72 -0
- package/lib/service/idp/organization/team/index.js +115 -0
- package/lib/service/idp/registration/index.d.ts +39 -0
- package/lib/service/idp/registration/index.js +84 -0
- package/lib/service/idp/user/index.d.ts +82 -0
- package/lib/service/idp/user/index.js +125 -0
- package/lib/service/idp/user/license/index.d.ts +7 -0
- package/lib/service/idp/user/license/index.js +30 -0
- package/lib/service/idp/user/password/index.d.ts +19 -0
- package/lib/service/idp/user/password/index.js +52 -0
- package/lib/service/idp/user/settings/connections/index.d.ts +15 -0
- package/lib/service/idp/user/settings/connections/index.js +33 -0
- package/lib/service/idp/user/settings/general/index.d.ts +18 -0
- package/lib/service/idp/user/settings/general/index.js +39 -0
- package/lib/service/idp/user/settings/index.d.ts +36 -0
- package/lib/service/idp/user/settings/index.js +25 -0
- package/lib/service/idp/user/settings/notifications/index.d.ts +18 -0
- package/lib/service/idp/user/settings/notifications/index.js +39 -0
- package/lib/service/idp/user/settings/oauthApps/index.d.ts +22 -0
- package/lib/service/idp/user/settings/oauthApps/index.js +54 -0
- package/lib/service/idp/user/settings/pats/index.d.ts +50 -0
- package/lib/service/idp/user/settings/pats/index.js +93 -0
- package/lib/service/idp/user/settings/twoFactor/index.d.ts +11 -0
- package/lib/service/idp/user/settings/twoFactor/index.js +15 -0
- package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +34 -0
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +65 -0
- package/lib/service/mailer/index.d.ts +14 -0
- package/lib/service/{Mailer.js → mailer/index.js} +9 -12
- package/lib/service/mailer/internal/index.d.ts +36 -0
- package/lib/service/mailer/internal/index.js +64 -0
- package/lib/service/mothership/index.d.ts +97 -0
- package/lib/service/mothership/index.js +136 -0
- package/lib/service/nats/index.d.ts +51 -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 +16 -0
- package/lib/utils/bouncer/features/Provider.js +83 -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/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,118 @@
|
|
|
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
|
+
const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
|
|
14
|
+
const searchFilter_1 = require("../../../../../helper/searchFilter");
|
|
15
|
+
class IdpOrganizationMemberInvitations extends Base_1.default {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves all invitations sent out by the organization that match the provided search filter(s). Returns all invitations if no search filter is provided.
|
|
20
|
+
* @param orgName Name of the organization
|
|
21
|
+
* @param filters (optional) Array of search filters
|
|
22
|
+
* @param sorting (optional) Sorting object
|
|
23
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
24
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
25
|
+
* @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
|
|
26
|
+
*/
|
|
27
|
+
this.search = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const limit = params.limit || 25;
|
|
29
|
+
const page = params.page || 0;
|
|
30
|
+
// convert SearchFilters to DTO
|
|
31
|
+
const filtersDTO = params.filters.map((f) => {
|
|
32
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
33
|
+
});
|
|
34
|
+
const resp = yield this.axios.post(this.getEndpoint(`/${params.orgName}/members/invitations/search?limit=${limit}&page=${page}`), {
|
|
35
|
+
filters: filtersDTO,
|
|
36
|
+
sorting: params.sorting,
|
|
37
|
+
});
|
|
38
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Invites a User to an Organization.
|
|
42
|
+
*
|
|
43
|
+
* @param orgName Name of the Organization
|
|
44
|
+
* @param email Email of the person to be invited
|
|
45
|
+
* @param role The role they will have within the organization if they accept the invitation
|
|
46
|
+
* @param allowNonRegisteredUsers Flag to determine if the invitation should go through in the case that the email is not bound to an Helmut Cloud user.
|
|
47
|
+
* If this is set to true and the email is unbound, then an email will be sent asking the person to register.
|
|
48
|
+
* When they do they will automatically join the organization.
|
|
49
|
+
* @param targetUrl Optional url the link in the mail will point to
|
|
50
|
+
* @returns The created invitation
|
|
51
|
+
*/
|
|
52
|
+
this.create = (orgName_1, email_1, role_1, ...args_1) => __awaiter(this, [orgName_1, email_1, role_1, ...args_1], void 0, function* (orgName, email, role, allowNonRegisteredUsers = false, targetUrl) {
|
|
53
|
+
const resp = yield this.axios.post(this.getEndpoint(`/${orgName}/members/invitations`), {
|
|
54
|
+
email,
|
|
55
|
+
role,
|
|
56
|
+
allowNonRegisteredUsers,
|
|
57
|
+
targetUrl,
|
|
58
|
+
});
|
|
59
|
+
return resp.data;
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* Accept an invitation.
|
|
63
|
+
*
|
|
64
|
+
* Internally this calls respond.
|
|
65
|
+
*
|
|
66
|
+
* @param orgName Name of the Organization
|
|
67
|
+
* @param invitationId ID of the invitation
|
|
68
|
+
* @returns The patched invitation
|
|
69
|
+
*/
|
|
70
|
+
this.accept = (orgName, invitationId) => __awaiter(this, void 0, void 0, function* () { return this.respond(orgName, invitationId, true); });
|
|
71
|
+
/**
|
|
72
|
+
* Reject an invitation.
|
|
73
|
+
*
|
|
74
|
+
* Internally this calls respond.
|
|
75
|
+
*
|
|
76
|
+
* @param orgName Name of the Organization
|
|
77
|
+
* @param invitationId ID of the invitation
|
|
78
|
+
* @returns The patched invitation
|
|
79
|
+
*/
|
|
80
|
+
this.reject = (orgName, invitationId) => __awaiter(this, void 0, void 0, function* () { return this.respond(orgName, invitationId, false); });
|
|
81
|
+
/**
|
|
82
|
+
* Respond to an invitation.
|
|
83
|
+
*
|
|
84
|
+
* @param orgName Name of the Organization
|
|
85
|
+
* @param invitationId ID of the invitation
|
|
86
|
+
* @param accept Whether or not to accept the invitation
|
|
87
|
+
* @returns The patched invitation
|
|
88
|
+
*/
|
|
89
|
+
this.respond = (orgName, invitationId, accept) => __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/members/invitations/${invitationId}/approval`), {
|
|
91
|
+
accept,
|
|
92
|
+
});
|
|
93
|
+
return resp.data;
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* Resends an invitation email.
|
|
97
|
+
*
|
|
98
|
+
* @param orgName Name of the Organization
|
|
99
|
+
* @param invitationId ID of the invitation
|
|
100
|
+
*/
|
|
101
|
+
this.resendInvitationEmail = (orgName, invitationId) => __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
yield this.axios.post(this.getEndpoint(`/${orgName}/members/invitations/${invitationId}/resend`));
|
|
103
|
+
});
|
|
104
|
+
/**
|
|
105
|
+
* Cancel/Delete an invitation.
|
|
106
|
+
*
|
|
107
|
+
* @param orgName Name of the Organization
|
|
108
|
+
* @param invitationId ID of the invitation
|
|
109
|
+
*/
|
|
110
|
+
this.delete = (orgName, invitationId) => __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
yield this.axios.delete(this.getEndpoint(`/${orgName}/members/invitations/${invitationId}`));
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
getEndpoint(endpoint) {
|
|
115
|
+
return `${this.options.server}/api/account/v1/org${endpoint}`;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.default = IdpOrganizationMemberInvitations;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import Base, { Options } from "../../../../../Base";
|
|
3
|
+
import { Domain } from "../../../../../interfaces/idp/organization/settings/domain";
|
|
4
|
+
import { IdpSAMLProvider } from "./saml";
|
|
5
|
+
export declare class IdpDomain extends Base {
|
|
6
|
+
/**
|
|
7
|
+
* Handles everything around a SAML provider of a domain.
|
|
8
|
+
*/
|
|
9
|
+
samlProvider: IdpSAMLProvider;
|
|
10
|
+
constructor(options: Options, axios: AxiosInstance);
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves all the Domains associated with a given Organization.
|
|
13
|
+
* @param orgName Name of Organization
|
|
14
|
+
* @returns Array of Domains
|
|
15
|
+
*/
|
|
16
|
+
getDomains: (orgName: string) => Promise<Domain[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a new Domain for the given Organization
|
|
19
|
+
* @param orgName Name of the Organization
|
|
20
|
+
* @param domainName Name of the Domain
|
|
21
|
+
* @returns the created Domain
|
|
22
|
+
*/
|
|
23
|
+
createDomain: (orgName: string, domainName: string) => Promise<Domain>;
|
|
24
|
+
/**
|
|
25
|
+
* Verifies the provided Domain.
|
|
26
|
+
* @param orgName Name of the organization
|
|
27
|
+
* @param domainName Name of the Domain
|
|
28
|
+
* @returns Domain object with domain.verified set to 'true' if verification was succesful.
|
|
29
|
+
*/
|
|
30
|
+
verifyDomain: (orgName: string, domainName: string) => Promise<Domain>;
|
|
31
|
+
/**
|
|
32
|
+
* Deletes a domain.
|
|
33
|
+
* @param orgName Name of the organization
|
|
34
|
+
* @param domainName Name of the domain
|
|
35
|
+
*/
|
|
36
|
+
deleteDomain: (orgName: string, domainName: string) => Promise<void>;
|
|
37
|
+
protected getEndpoint(endpoint: string): string;
|
|
38
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
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.IdpDomain = void 0;
|
|
13
|
+
const Base_1 = require("../../../../../Base");
|
|
14
|
+
const saml_1 = require("./saml");
|
|
15
|
+
class IdpDomain extends Base_1.default {
|
|
16
|
+
constructor(options, axios) {
|
|
17
|
+
super(options, axios);
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves all the Domains associated with a given Organization.
|
|
20
|
+
* @param orgName Name of Organization
|
|
21
|
+
* @returns Array of Domains
|
|
22
|
+
*/
|
|
23
|
+
this.getDomains = (orgName) => __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/settings/domains`));
|
|
25
|
+
return resp.data;
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Creates a new Domain for the given Organization
|
|
29
|
+
* @param orgName Name of the Organization
|
|
30
|
+
* @param domainName Name of the Domain
|
|
31
|
+
* @returns the created Domain
|
|
32
|
+
*/
|
|
33
|
+
this.createDomain = (orgName, domainName) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/settings/domains`), {
|
|
35
|
+
name: domainName,
|
|
36
|
+
});
|
|
37
|
+
return resp.data;
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* Verifies the provided Domain.
|
|
41
|
+
* @param orgName Name of the organization
|
|
42
|
+
* @param domainName Name of the Domain
|
|
43
|
+
* @returns Domain object with domain.verified set to 'true' if verification was succesful.
|
|
44
|
+
*/
|
|
45
|
+
this.verifyDomain = (orgName, domainName) => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/verify`));
|
|
47
|
+
return resp.data;
|
|
48
|
+
});
|
|
49
|
+
/**
|
|
50
|
+
* Deletes a domain.
|
|
51
|
+
* @param orgName Name of the organization
|
|
52
|
+
* @param domainName Name of the domain
|
|
53
|
+
*/
|
|
54
|
+
this.deleteDomain = (orgName, domainName) => __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}`));
|
|
56
|
+
});
|
|
57
|
+
this.samlProvider = new saml_1.IdpSAMLProvider(this.options, this.axios);
|
|
58
|
+
}
|
|
59
|
+
getEndpoint(endpoint) {
|
|
60
|
+
return `${this.options.server}/api/account${endpoint}`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.IdpDomain = IdpDomain;
|
|
@@ -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,88 @@
|
|
|
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
|
+
/**
|
|
18
|
+
* Retrieves all SAML providers associated with a given Organization.
|
|
19
|
+
* @param orgName Name of the Organization
|
|
20
|
+
* @returns Array of SAML providers
|
|
21
|
+
*/
|
|
22
|
+
this.getAllSAMLProvidersOfOrganization = (orgName) => __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/settings/domains/saml`));
|
|
24
|
+
return resp.data;
|
|
25
|
+
});
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new SAML provider for the specified domain.
|
|
28
|
+
* @param orgName Name of the Organization
|
|
29
|
+
* @param domainName Name of the Domain
|
|
30
|
+
* @param provider SAML provider object containing the login URL, logout URL, certificates and a boolean to allow unencrypted assertion
|
|
31
|
+
* @returns The created SAML provider
|
|
32
|
+
*/
|
|
33
|
+
this.createProvider = (orgName, domainName, provider) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const formData = this.convertProviderToFormData(provider);
|
|
35
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/saml`), formData);
|
|
36
|
+
return resp.data;
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Updates a SAML provider for the specified domain
|
|
40
|
+
* @param orgName Name of the Organization
|
|
41
|
+
* @param domainName Name of the Domain
|
|
42
|
+
* @param provider SAML provider object containing the login URL, logout URL, certificates and a boolean to allow unencrypted assertion
|
|
43
|
+
* @returns The updated SAML provider
|
|
44
|
+
*/
|
|
45
|
+
this.updateProvider = (orgName, domainName, provider) => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const formData = this.convertProviderToFormData(provider);
|
|
47
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/saml`), formData);
|
|
48
|
+
return resp.data;
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* Adds certificates to a SAML provider
|
|
52
|
+
* @param orgName Name of the Organization
|
|
53
|
+
* @param domainName Name of the Domain
|
|
54
|
+
* @param certificates Certificates to add
|
|
55
|
+
* @returns The updated SAML provider
|
|
56
|
+
*/
|
|
57
|
+
this.addCertificatesToProvider = (orgName, domainName, certificates) => __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const formData = new FormData();
|
|
59
|
+
certificates.forEach(c => formData.append("certificate", this.createFileFromString(c)));
|
|
60
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/saml/certificates`), formData);
|
|
61
|
+
return resp.data;
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* Removes a SAML provider from the specified domain
|
|
65
|
+
* @param orgName Name of the Organization
|
|
66
|
+
* @param domainName Name of the Domain
|
|
67
|
+
*/
|
|
68
|
+
this.deleteProvider = (orgName, domainName) => __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/settings/domains/${domainName}/saml`));
|
|
70
|
+
});
|
|
71
|
+
this.convertProviderToFormData = (provider) => {
|
|
72
|
+
const formData = new FormData();
|
|
73
|
+
formData.append("ssoLoginURL", provider.ssoLoginURL);
|
|
74
|
+
formData.append("ssoLogoutURL", provider.ssoLogoutURL);
|
|
75
|
+
provider.certificates.forEach(c => formData.append("certificate", this.createFileFromString(c)));
|
|
76
|
+
provider.allowUnencryptedAssertion && formData.append("allowUnencryptedAssertion", provider.allowUnencryptedAssertion.toString());
|
|
77
|
+
return formData;
|
|
78
|
+
};
|
|
79
|
+
this.createFileFromString = (certificate) => {
|
|
80
|
+
const blob = new Blob([certificate]);
|
|
81
|
+
return new File([blob], "certificate");
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
getEndpoint(endpoint) {
|
|
85
|
+
return `${this.options.server}/api/account${endpoint}`;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.IdpSAMLProvider = IdpSAMLProvider;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import Base, { Options } from "../../../../Base";
|
|
3
|
+
import { IdpDomain } from "./domain";
|
|
4
|
+
import { IdpOAuthApp } from "./oauth";
|
|
5
|
+
export default class IdpOrganizationSettings extends Base {
|
|
6
|
+
/**
|
|
7
|
+
* Handles everything around open authorization applications
|
|
8
|
+
*/
|
|
9
|
+
oAuthApp: IdpOAuthApp;
|
|
10
|
+
/**
|
|
11
|
+
* Handles everything around domains of organizations.
|
|
12
|
+
*/
|
|
13
|
+
domains: IdpDomain;
|
|
14
|
+
constructor(options: Options, axios: AxiosInstance);
|
|
15
|
+
protected getEndpoint(): string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
constructor(options, axios) {
|
|
8
|
+
super(options, axios);
|
|
9
|
+
this.domains = new domain_1.IdpDomain(this.options, this.axios);
|
|
10
|
+
this.oAuthApp = new oauth_1.IdpOAuthApp(this.options, this.axios);
|
|
11
|
+
}
|
|
12
|
+
getEndpoint() {
|
|
13
|
+
throw new Error("Method not implemented.");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.default = IdpOrganizationSettings;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import Base, { Options } from "../../../../../Base";
|
|
3
|
+
import { PaginatedResponse, SearchParams } from "../../../../../interfaces/global";
|
|
4
|
+
import { OAuthApp, OAuthAppCreate } from "../../../../../interfaces/idp/organization/settings/oauthApp";
|
|
5
|
+
export declare class IdpOAuthApp extends Base {
|
|
6
|
+
constructor(options: Options, axios: AxiosInstance);
|
|
7
|
+
/**
|
|
8
|
+
* 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.
|
|
9
|
+
* @param orgName Name of the Organization
|
|
10
|
+
* @param filters (optional) Array of search filters
|
|
11
|
+
* @param sorting (optional) Sorting object
|
|
12
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
13
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
14
|
+
* @returns Object containing an array of OAuth apps and the total number of results found in the database (independent of limit and page)
|
|
15
|
+
*/
|
|
16
|
+
searchOauthAppsOfOrganization: ({ organizationName, filters, sorting, limit, page, }: SearchParams & {
|
|
17
|
+
organizationName: string;
|
|
18
|
+
}) => Promise<PaginatedResponse<OAuthApp>>;
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves an OAuthApp by its ID.
|
|
21
|
+
* @param orgName Name of the Organization
|
|
22
|
+
* @param oauthAppId ID of the OAuthApp
|
|
23
|
+
* @returns the requested OAuthApp
|
|
24
|
+
*/
|
|
25
|
+
getOAuthApp: (orgName: string, oauthAppId: string) => Promise<OAuthApp>;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a new OAuth app in the specified Organization.
|
|
28
|
+
* @param orgName Name of the Organization
|
|
29
|
+
* @param oAuthAppCreate Object containing the app's name, secretName, callback and optionally a base64 encoded avatar and a description
|
|
30
|
+
* @returns The created OAuth app
|
|
31
|
+
*/
|
|
32
|
+
createOAuthApp: (orgName: string, oAuthAppCreate: OAuthAppCreate) => Promise<OAuthApp>;
|
|
33
|
+
/**
|
|
34
|
+
* Updates an existing OAuth app.
|
|
35
|
+
* @param orgName Name of the Organization
|
|
36
|
+
* @param oauthAppId ID of the OAuth app to be updated
|
|
37
|
+
* @param oAuthAppCreate Object containing the app's name, secretName, callback and optionally a base64 encoded avatar and a description
|
|
38
|
+
* @returns the updated OAuth app
|
|
39
|
+
*/
|
|
40
|
+
updateOAuthApp: (orgName: string, oauthAppId: string, oAuthAppCreate: OAuthAppCreate) => Promise<OAuthApp>;
|
|
41
|
+
/**
|
|
42
|
+
* Deletes an OAuthApp by its ID.
|
|
43
|
+
* @param orgName Name of the Organization
|
|
44
|
+
* @param oauthAppId ID of the OAuthApp
|
|
45
|
+
*/
|
|
46
|
+
deleteOAuthApp: (orgName: string, oauthAppId: string) => Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Creates a new secret for an existing OAuthApp.
|
|
49
|
+
* @param orgName Name of the Organization
|
|
50
|
+
* @param oauthAppId ID of the OAuthApp
|
|
51
|
+
* @param secretName Name of the Secret
|
|
52
|
+
* @returns the updated OAuth app
|
|
53
|
+
*/
|
|
54
|
+
createOAuthAppSecret: (orgName: string, oauthAppId: string, secretName: string) => Promise<OAuthApp>;
|
|
55
|
+
/**
|
|
56
|
+
* Deletes the specified OAuthApp secret.
|
|
57
|
+
* @param orgName Name of the Organization
|
|
58
|
+
* @param oauthAppId ID of the OAuthApp
|
|
59
|
+
* @param secret Name of the secret that shall be deleted
|
|
60
|
+
* @returns the updated OAuthApp
|
|
61
|
+
*/
|
|
62
|
+
deleteOAuthAppSecret: (orgName: string, oauthAppId: string, secret: string) => Promise<OAuthApp>;
|
|
63
|
+
protected getEndpoint(endpoint: string): string;
|
|
64
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
constructor(options, axios) {
|
|
18
|
+
super(options, axios);
|
|
19
|
+
/**
|
|
20
|
+
* 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.
|
|
21
|
+
* @param orgName Name of the Organization
|
|
22
|
+
* @param filters (optional) Array of search filters
|
|
23
|
+
* @param sorting (optional) Sorting object
|
|
24
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
25
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
26
|
+
* @returns Object containing an array of OAuth apps and the total number of results found in the database (independent of limit and page)
|
|
27
|
+
*/
|
|
28
|
+
this.searchOauthAppsOfOrganization = (_a) => __awaiter(this, [_a], void 0, function* ({ organizationName, filters, sorting, limit = 25, page = 0, }) {
|
|
29
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
30
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
31
|
+
});
|
|
32
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${organizationName}/settings/applications/oauth/search?limit=${limit}&page=${page}`), {
|
|
33
|
+
filters: filtersDTO,
|
|
34
|
+
sorting: sorting,
|
|
35
|
+
});
|
|
36
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
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
|
+
this.getOAuthApp = (orgName, oauthAppId) => __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth/${oauthAppId}`));
|
|
46
|
+
return resp.data;
|
|
47
|
+
});
|
|
48
|
+
/**
|
|
49
|
+
* Creates a new OAuth app in the specified Organization.
|
|
50
|
+
* @param orgName Name of the Organization
|
|
51
|
+
* @param oAuthAppCreate Object containing the app's name, secretName, callback and optionally a base64 encoded avatar and a description
|
|
52
|
+
* @returns The created OAuth app
|
|
53
|
+
*/
|
|
54
|
+
this.createOAuthApp = (orgName, oAuthAppCreate) => __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth`), oAuthAppCreate);
|
|
56
|
+
return resp.data;
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Updates an existing OAuth app.
|
|
60
|
+
* @param orgName Name of the Organization
|
|
61
|
+
* @param oauthAppId ID of the OAuth app to be updated
|
|
62
|
+
* @param oAuthAppCreate Object containing the app's name, secretName, callback and optionally a base64 encoded avatar and a description
|
|
63
|
+
* @returns the updated OAuth app
|
|
64
|
+
*/
|
|
65
|
+
this.updateOAuthApp = (orgName, oauthAppId, oAuthAppCreate) => __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth/${oauthAppId}`), oAuthAppCreate);
|
|
67
|
+
return resp.data;
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* Deletes an OAuthApp by its ID.
|
|
71
|
+
* @param orgName Name of the Organization
|
|
72
|
+
* @param oauthAppId ID of the OAuthApp
|
|
73
|
+
*/
|
|
74
|
+
this.deleteOAuthApp = (orgName, oauthAppId) => __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth/${oauthAppId}`));
|
|
76
|
+
});
|
|
77
|
+
/**
|
|
78
|
+
* Creates a new secret for an existing OAuthApp.
|
|
79
|
+
* @param orgName Name of the Organization
|
|
80
|
+
* @param oauthAppId ID of the OAuthApp
|
|
81
|
+
* @param secretName Name of the Secret
|
|
82
|
+
* @returns the updated OAuth app
|
|
83
|
+
*/
|
|
84
|
+
this.createOAuthAppSecret = (orgName, oauthAppId, secretName) => __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth/${oauthAppId}/secret`), {
|
|
86
|
+
secretName,
|
|
87
|
+
});
|
|
88
|
+
return resp.data;
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* Deletes the specified OAuthApp secret.
|
|
92
|
+
* @param orgName Name of the Organization
|
|
93
|
+
* @param oauthAppId ID of the OAuthApp
|
|
94
|
+
* @param secret Name of the secret that shall be deleted
|
|
95
|
+
* @returns the updated OAuthApp
|
|
96
|
+
*/
|
|
97
|
+
this.deleteOAuthAppSecret = (orgName, oauthAppId, secret) => __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/settings/applications/oauth/${oauthAppId}/secret/${secret}`));
|
|
99
|
+
return resp.data;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
getEndpoint(endpoint) {
|
|
103
|
+
return `${this.options.server}/api/account${endpoint}`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
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
|
+
}
|