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,55 @@
|
|
|
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.AgentBundle = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
const axios_1 = require("../../../interfaces/axios");
|
|
15
|
+
class AgentBundle extends Base_1.default {
|
|
16
|
+
constructor(options, axios) {
|
|
17
|
+
var _a;
|
|
18
|
+
super(options, axios);
|
|
19
|
+
this.sourceServer = ((_a = options.agent) === null || _a === void 0 ? void 0 : _a.server) || "https://agent.s3.helmut.cloud";
|
|
20
|
+
}
|
|
21
|
+
getVersions() {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const resp = yield this.axios.get(this.getEndpoint("/bundles/index.json"), { headers: axios_1.disableCacheHeaders });
|
|
24
|
+
const registry = resp.data;
|
|
25
|
+
for (const v in registry.versions) {
|
|
26
|
+
setDev(registry.versions[v]);
|
|
27
|
+
}
|
|
28
|
+
return resp.data;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getLatestVersion() {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const resp = yield this.getVersions();
|
|
34
|
+
return setDev(resp.versions[resp.latest]);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
getVersion(version) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const resp = yield this.getVersions();
|
|
40
|
+
return setDev(resp.versions[version]);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
getEndpoint(endpoint) {
|
|
44
|
+
return this.sourceServer + endpoint;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.AgentBundle = AgentBundle;
|
|
48
|
+
function setDev(v) {
|
|
49
|
+
// We check false because this way if there is a problem
|
|
50
|
+
// and the registry gets updated without a dev flag it will
|
|
51
|
+
// be undefined and therefore considered dev since false !== undefined
|
|
52
|
+
v.dev = v["dev-release"] !== false;
|
|
53
|
+
delete v["dev-release"];
|
|
54
|
+
return v;
|
|
55
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Base from "../../../Base";
|
|
2
|
+
import { Context } from "../../../interfaces/agent/context";
|
|
3
|
+
export declare class AgentContext extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* Retrieves all contexts.
|
|
6
|
+
* @returns The requested contexts
|
|
7
|
+
*/
|
|
8
|
+
getContexts(): Promise<Context[]>;
|
|
9
|
+
/**
|
|
10
|
+
* Add a new context.
|
|
11
|
+
* @returns The newly created context
|
|
12
|
+
*/
|
|
13
|
+
addContext(server: string, email: string, token: string, enabled: boolean): Promise<Context>;
|
|
14
|
+
/**
|
|
15
|
+
* Update an existing context.
|
|
16
|
+
* @returns The updated context
|
|
17
|
+
*/
|
|
18
|
+
updateContext(uuid: string, server: string, email: string, token: string, enabled: boolean): Promise<Context>;
|
|
19
|
+
/**
|
|
20
|
+
* Get an existing context.
|
|
21
|
+
* @returns The requested context
|
|
22
|
+
*/
|
|
23
|
+
getContext(uuid: string): Promise<Context>;
|
|
24
|
+
/**
|
|
25
|
+
* Delete a context.
|
|
26
|
+
* @returns void
|
|
27
|
+
*/
|
|
28
|
+
deleteContext(uuid: string): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Patch the enabled property of a Context.
|
|
31
|
+
* @returns Updated Context
|
|
32
|
+
*/
|
|
33
|
+
patchContextEnabled(uuid: string, enabled: boolean): Promise<Context>;
|
|
34
|
+
protected getEndpoint(endpoint: string): string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
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.AgentContext = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
class AgentContext extends Base_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Retrieves all contexts.
|
|
17
|
+
* @returns The requested contexts
|
|
18
|
+
*/
|
|
19
|
+
getContexts() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/context`));
|
|
22
|
+
return resp.data;
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Add a new context.
|
|
27
|
+
* @returns The newly created context
|
|
28
|
+
*/
|
|
29
|
+
addContext(server, email, token, enabled) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/context`), {
|
|
32
|
+
server,
|
|
33
|
+
email,
|
|
34
|
+
token,
|
|
35
|
+
enabled,
|
|
36
|
+
});
|
|
37
|
+
return resp.data;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Update an existing context.
|
|
42
|
+
* @returns The updated context
|
|
43
|
+
*/
|
|
44
|
+
updateContext(uuid, server, email, token, enabled) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/context/${uuid}`), {
|
|
47
|
+
server,
|
|
48
|
+
email,
|
|
49
|
+
token,
|
|
50
|
+
enabled,
|
|
51
|
+
});
|
|
52
|
+
return resp.data;
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get an existing context.
|
|
57
|
+
* @returns The requested context
|
|
58
|
+
*/
|
|
59
|
+
getContext(uuid) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/context/${uuid}`));
|
|
62
|
+
return resp.data;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Delete a context.
|
|
67
|
+
* @returns void
|
|
68
|
+
*/
|
|
69
|
+
deleteContext(uuid) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
yield this.axios.delete(this.getEndpoint(`/v1/context/${uuid}`));
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Patch the enabled property of a Context.
|
|
76
|
+
* @returns Updated Context
|
|
77
|
+
*/
|
|
78
|
+
patchContextEnabled(uuid, enabled) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
const res = yield this.axios.patch(this.getEndpoint(`/v1/context/${uuid}/enabled`), {
|
|
81
|
+
enabled,
|
|
82
|
+
});
|
|
83
|
+
return res.data;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
getEndpoint(endpoint) {
|
|
87
|
+
return `${this.options.server}/api/agent${endpoint}`;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
exports.AgentContext = AgentContext;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Base from "../../Base";
|
|
2
|
+
import { AgentBundle } from "./bundle";
|
|
3
|
+
import { DevBundle } from "./bundle/dev";
|
|
4
|
+
import { AgentContext } from "./context";
|
|
5
|
+
import { AgentInstaller } from "./installer";
|
|
6
|
+
export default class Agent extends Base {
|
|
7
|
+
get context(): AgentContext;
|
|
8
|
+
private _context?;
|
|
9
|
+
get bundle(): AgentBundle;
|
|
10
|
+
private _bundle?;
|
|
11
|
+
get devBundle(): DevBundle;
|
|
12
|
+
private _devBundle?;
|
|
13
|
+
get installer(): AgentInstaller;
|
|
14
|
+
private _installer?;
|
|
15
|
+
protected getEndpoint(endpoint: string): string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Base_1 = require("../../Base");
|
|
4
|
+
const bundle_1 = require("./bundle");
|
|
5
|
+
const dev_1 = require("./bundle/dev");
|
|
6
|
+
const context_1 = require("./context");
|
|
7
|
+
const installer_1 = require("./installer");
|
|
8
|
+
class Agent extends Base_1.default {
|
|
9
|
+
get context() {
|
|
10
|
+
if (this._context === undefined) {
|
|
11
|
+
this._context = new context_1.AgentContext(this.options, this.axios);
|
|
12
|
+
}
|
|
13
|
+
return this._context;
|
|
14
|
+
}
|
|
15
|
+
get bundle() {
|
|
16
|
+
if (this._bundle === undefined) {
|
|
17
|
+
this._bundle = new bundle_1.AgentBundle(this.options, this.axios);
|
|
18
|
+
}
|
|
19
|
+
return this._bundle;
|
|
20
|
+
}
|
|
21
|
+
get devBundle() {
|
|
22
|
+
if (this._devBundle === undefined) {
|
|
23
|
+
this._devBundle = new dev_1.DevBundle(this.options, this.axios);
|
|
24
|
+
}
|
|
25
|
+
return this._devBundle;
|
|
26
|
+
}
|
|
27
|
+
get installer() {
|
|
28
|
+
if (this._installer === undefined) {
|
|
29
|
+
this._installer = new installer_1.AgentInstaller(this.options, this.axios);
|
|
30
|
+
}
|
|
31
|
+
return this._installer;
|
|
32
|
+
}
|
|
33
|
+
getEndpoint(endpoint) {
|
|
34
|
+
return `${this.options.server}/api/agent${endpoint}`;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.default = Agent;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import Base, { Options } from "../../../Base";
|
|
3
|
+
import { AgentInstallerVersions, InstallerVersion } from "../../../interfaces/agent";
|
|
4
|
+
export declare class AgentInstaller extends Base {
|
|
5
|
+
private sourceServer;
|
|
6
|
+
constructor(options: Options, axios: AxiosInstance);
|
|
7
|
+
getVersions(): Promise<AgentInstallerVersions>;
|
|
8
|
+
getLatestVersion(dev?: boolean): Promise<InstallerVersion[]>;
|
|
9
|
+
getLatestVersionDarwin(): Promise<InstallerVersion | null>;
|
|
10
|
+
getLatestVersionWindows(): Promise<InstallerVersion | null>;
|
|
11
|
+
getVersion(version: string): Promise<InstallerVersion[] | void>;
|
|
12
|
+
getVersionDarwin(version: string): Promise<InstallerVersion | null>;
|
|
13
|
+
getVersionWindows(version: string): Promise<InstallerVersion | null>;
|
|
14
|
+
protected getEndpoint(endpoint: string): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
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.AgentInstaller = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
const axios_1 = require("../../../interfaces/axios");
|
|
15
|
+
class AgentInstaller extends Base_1.default {
|
|
16
|
+
constructor(options, axios) {
|
|
17
|
+
var _a;
|
|
18
|
+
super(options, axios);
|
|
19
|
+
this.sourceServer = ((_a = options.agent) === null || _a === void 0 ? void 0 : _a.server) || "https://agent.s3.helmut.cloud";
|
|
20
|
+
}
|
|
21
|
+
getVersions() {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
const resp = yield this.axios.get(this.getEndpoint("/install/index.json"), { headers: axios_1.disableCacheHeaders });
|
|
24
|
+
const registry = resp.data;
|
|
25
|
+
for (const version in registry.versions) {
|
|
26
|
+
setDev(registry.versions[version]);
|
|
27
|
+
}
|
|
28
|
+
return registry;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getLatestVersion() {
|
|
32
|
+
return __awaiter(this, arguments, void 0, function* (dev = false) {
|
|
33
|
+
const resp = yield this.getVersions();
|
|
34
|
+
const releases = Object.values(resp.versions)
|
|
35
|
+
.flat()
|
|
36
|
+
.filter(r => r.dev === dev);
|
|
37
|
+
releases.sort((r1, r2) => r2.published_date - r1.published_date);
|
|
38
|
+
const windowsInstaller = releases.find(r => r.os === "windows");
|
|
39
|
+
const macInstaller = releases.find(r => r.os === "darwin");
|
|
40
|
+
const installers = [];
|
|
41
|
+
if (windowsInstaller) {
|
|
42
|
+
installers.push(windowsInstaller);
|
|
43
|
+
}
|
|
44
|
+
if (macInstaller) {
|
|
45
|
+
installers.push(macInstaller);
|
|
46
|
+
}
|
|
47
|
+
return installers;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
getLatestVersionDarwin() {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
var _a;
|
|
53
|
+
const versions = yield this.getLatestVersion();
|
|
54
|
+
return (_a = versions === null || versions === void 0 ? void 0 : versions.find(v => v.os === "darwin")) !== null && _a !== void 0 ? _a : null;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
getLatestVersionWindows() {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
var _a;
|
|
60
|
+
const versions = yield this.getLatestVersion();
|
|
61
|
+
return (_a = versions === null || versions === void 0 ? void 0 : versions.find(v => v.os === "windows")) !== null && _a !== void 0 ? _a : null;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
getVersion(version) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const resp = yield this.getVersions();
|
|
67
|
+
return resp.versions[version];
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
getVersionDarwin(version) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
var _a;
|
|
73
|
+
const versions = yield this.getVersion(version);
|
|
74
|
+
return (_a = versions === null || versions === void 0 ? void 0 : versions.find(v => v.os === "darwin")) !== null && _a !== void 0 ? _a : null;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
getVersionWindows(version) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
var _a;
|
|
80
|
+
const versions = yield this.getVersion(version);
|
|
81
|
+
return (_a = versions === null || versions === void 0 ? void 0 : versions.find(v => v.os === "windows")) !== null && _a !== void 0 ? _a : null;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
getEndpoint(endpoint) {
|
|
85
|
+
return this.sourceServer + endpoint;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.AgentInstaller = AgentInstaller;
|
|
89
|
+
function setDev(vs) {
|
|
90
|
+
for (const v of vs) {
|
|
91
|
+
if (v.dev !== false) {
|
|
92
|
+
// This catches undefined, etc. even though it may seem dumb
|
|
93
|
+
v.dev = true;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return vs;
|
|
97
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Base from "../../Base";
|
|
2
|
+
import { AuditLog } from "../../interfaces/auditor";
|
|
3
|
+
import { PaginatedResponse, SearchParams, Version } from "../../interfaces/global";
|
|
4
|
+
import { AuditorInternal } from "./internal";
|
|
5
|
+
export default class Auditor extends Base {
|
|
6
|
+
get internal(): AuditorInternal;
|
|
7
|
+
private _internal?;
|
|
8
|
+
/**
|
|
9
|
+
* @returns An object containing the endpoint version as a string
|
|
10
|
+
*/
|
|
11
|
+
version(): Promise<Version>;
|
|
12
|
+
/**
|
|
13
|
+
* Returns all audit logs for an organization which match the search filter
|
|
14
|
+
* @param organizationName Name of the organization
|
|
15
|
+
* @param filters (optional) Array of search filters
|
|
16
|
+
* @param sorting (optional) Sorting object
|
|
17
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
18
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
19
|
+
* @returns Object containing an array of audit logs and the total number of results found in the database (independent of limit and page)
|
|
20
|
+
*/
|
|
21
|
+
searchAuditLogs({ organizationName, filters, sorting, limit, page, }: SearchParams & {
|
|
22
|
+
organizationName: string;
|
|
23
|
+
}): Promise<PaginatedResponse<AuditLog>>;
|
|
24
|
+
protected getEndpoint(endpoint: string): string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
const internal_1 = require("./internal");
|
|
16
|
+
class Auditor extends Base_1.default {
|
|
17
|
+
get internal() {
|
|
18
|
+
if (this._internal === undefined) {
|
|
19
|
+
this._internal = new internal_1.AuditorInternal(this.options, this.axios);
|
|
20
|
+
}
|
|
21
|
+
return this._internal;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @returns An object containing the endpoint version as a string
|
|
25
|
+
*/
|
|
26
|
+
version() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const resp = yield this.axios.get(this.getEndpoint("/v1/version"), {});
|
|
29
|
+
return resp.data;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Returns all audit logs for an organization which match the search filter
|
|
34
|
+
* @param organizationName Name of the organization
|
|
35
|
+
* @param filters (optional) Array of search filters
|
|
36
|
+
* @param sorting (optional) Sorting object
|
|
37
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
38
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
39
|
+
* @returns Object containing an array of audit logs and the total number of results found in the database (independent of limit and page)
|
|
40
|
+
*/
|
|
41
|
+
searchAuditLogs(_a) {
|
|
42
|
+
return __awaiter(this, arguments, void 0, function* ({ organizationName, filters, sorting, limit = 25, page = 0, }) {
|
|
43
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
|
|
44
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${organizationName}/logs/search?page=${page}&limit=${limit}`), {
|
|
45
|
+
filters: filtersDTO,
|
|
46
|
+
sorting: sorting,
|
|
47
|
+
});
|
|
48
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
getEndpoint(endpoint) {
|
|
52
|
+
return `${this.options.server}/api/auditor${endpoint}`;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.default = Auditor;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Base from "../../../Base";
|
|
2
|
+
import { AuditLogCreate } from "../../../interfaces/auditor";
|
|
3
|
+
export declare class AuditorInternal extends Base {
|
|
4
|
+
private queueExecutionInterval;
|
|
5
|
+
private logQueue;
|
|
6
|
+
private logQueueTimer;
|
|
7
|
+
/**
|
|
8
|
+
* Adds log entries to a queue that will be processed periodically.
|
|
9
|
+
*
|
|
10
|
+
* No exceptions are thrown in case of an error as this function runs periodically asynchronous.
|
|
11
|
+
*
|
|
12
|
+
* This also comes with the downside of log timesstamps being inaccurate as they are created by the Auditor Server.
|
|
13
|
+
* Timestamps might differ as much as: this.options.auditor.queue.executionInterval || 500
|
|
14
|
+
* @param logs array (add multiple logs entries at once)
|
|
15
|
+
*/
|
|
16
|
+
queueAuditLogs(logs: AuditLogCreate[]): Promise<void>;
|
|
17
|
+
private startQueue;
|
|
18
|
+
/**
|
|
19
|
+
* Deletes all audit logs of an organization
|
|
20
|
+
*
|
|
21
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
22
|
+
* @param orgId the organizations's ID
|
|
23
|
+
* @returns void
|
|
24
|
+
*/
|
|
25
|
+
deleteAllAuditLogsOfOrganization(orgId: string): Promise<void>;
|
|
26
|
+
protected getEndpoint(endpoint: string): string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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.AuditorInternal = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
class AuditorInternal extends Base_1.default {
|
|
15
|
+
constructor() {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.queueExecutionInterval = ((_b = (_a = this.options.auditor) === null || _a === void 0 ? void 0 : _a.queue) === null || _b === void 0 ? void 0 : _b.executionInterval) || 500;
|
|
19
|
+
this.logQueue = [];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Adds log entries to a queue that will be processed periodically.
|
|
23
|
+
*
|
|
24
|
+
* No exceptions are thrown in case of an error as this function runs periodically asynchronous.
|
|
25
|
+
*
|
|
26
|
+
* This also comes with the downside of log timesstamps being inaccurate as they are created by the Auditor Server.
|
|
27
|
+
* Timestamps might differ as much as: this.options.auditor.queue.executionInterval || 500
|
|
28
|
+
* @param logs array (add multiple logs entries at once)
|
|
29
|
+
*/
|
|
30
|
+
queueAuditLogs(logs) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
if (!this.logQueueTimer) {
|
|
33
|
+
this.startQueue();
|
|
34
|
+
}
|
|
35
|
+
this.logQueue = this.logQueue.concat(logs);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
startQueue() {
|
|
39
|
+
if (!this.logQueueTimer) {
|
|
40
|
+
this.logQueueTimer = setTimeout(() => {
|
|
41
|
+
if (this.logQueue.length > 0) {
|
|
42
|
+
// DO NOT REMOVE THE IGNORE CATCH AS IT WOULD LEAD TO UNHANDLED PROMISE REJECTION IN OTHER ENDPOINTS AND THEIR CRASH
|
|
43
|
+
this.axios.post(this.getEndpoint("/v1/logs"), this.logQueue).catch(ignored => ignored);
|
|
44
|
+
this.logQueue = [];
|
|
45
|
+
}
|
|
46
|
+
}, this.queueExecutionInterval);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Deletes all audit logs of an organization
|
|
51
|
+
*
|
|
52
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
53
|
+
* @param orgId the organizations's ID
|
|
54
|
+
* @returns void
|
|
55
|
+
*/
|
|
56
|
+
deleteAllAuditLogsOfOrganization(orgId) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgId}/logs`));
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
getEndpoint(endpoint) {
|
|
62
|
+
return `${this.options.server}/api/auditor/internal${endpoint}`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.AuditorInternal = AuditorInternal;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import Base, { Options } from "../../../Base";
|
|
3
|
+
import { HcloudFeature } from "../../../interfaces/bouncer";
|
|
4
|
+
export default class BouncerFeatures extends Base {
|
|
5
|
+
constructor(options: Options, axios: AxiosInstance);
|
|
6
|
+
getHcloudFeatures(): Promise<HcloudFeature[]>;
|
|
7
|
+
protected getEndpoint(endpoint: string): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
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 BouncerFeatures extends Base_1.default {
|
|
14
|
+
constructor(options, axios) {
|
|
15
|
+
super(options, axios);
|
|
16
|
+
}
|
|
17
|
+
getHcloudFeatures() {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const resp = yield this.axios.get(this.getEndpoint("/default.json"), {});
|
|
20
|
+
return resp.data;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
getEndpoint(endpoint) {
|
|
24
|
+
return `https://config.s3.helmut.cloud/featureflags${endpoint}`;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = BouncerFeatures;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Base_1 = require("../../Base");
|
|
4
|
+
const features_1 = require("./features");
|
|
5
|
+
class Bouncer extends Base_1.default {
|
|
6
|
+
get features() {
|
|
7
|
+
if (this._features === undefined) {
|
|
8
|
+
this._features = new features_1.default(this.options, this.axios);
|
|
9
|
+
}
|
|
10
|
+
return this._features;
|
|
11
|
+
}
|
|
12
|
+
getEndpoint(endpoint) {
|
|
13
|
+
return `https://config.s3.helmut.cloud/featureflags${endpoint}`;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.default = Bouncer;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import Base from "../../Base";
|
|
2
|
+
import { DaliFuse } from "./avatar/DaliFuseSpace";
|
|
3
|
+
import { DaliHigh5 } from "./avatar/DaliHigh5Space";
|
|
4
|
+
import { DaliOAuthApp } from "./avatar/DaliOAuthApp";
|
|
5
|
+
import { DaliOrganization } from "./avatar/DaliOrganization";
|
|
6
|
+
import { DaliTeam } from "./avatar/DaliTeam";
|
|
7
|
+
import { DaliUser } from "./avatar/DaliUser";
|
|
8
|
+
export declare class DaliAvatar extends Base {
|
|
9
|
+
/**
|
|
10
|
+
* Handles everything around user avatars
|
|
11
|
+
*/
|
|
12
|
+
get user(): DaliUser;
|
|
13
|
+
private _user?;
|
|
14
|
+
/**
|
|
15
|
+
* Handles everything around team avatars
|
|
16
|
+
*/
|
|
17
|
+
get team(): DaliTeam;
|
|
18
|
+
private _team?;
|
|
19
|
+
/**
|
|
20
|
+
* Handles everything around organization avatars
|
|
21
|
+
*/
|
|
22
|
+
get organization(): DaliOrganization;
|
|
23
|
+
private _organization?;
|
|
24
|
+
/**
|
|
25
|
+
* Handles everything around high5 spaces avatars
|
|
26
|
+
*/
|
|
27
|
+
get high5Space(): DaliHigh5;
|
|
28
|
+
private _high5Space?;
|
|
29
|
+
/**
|
|
30
|
+
* Handles everything around fuse spaces avatars
|
|
31
|
+
*/
|
|
32
|
+
get fuseSpace(): DaliFuse;
|
|
33
|
+
private _fuseSpace?;
|
|
34
|
+
/**
|
|
35
|
+
* Handles everything around OAuth applications avatars
|
|
36
|
+
*/
|
|
37
|
+
get oauth(): DaliOAuthApp;
|
|
38
|
+
private _oauth?;
|
|
39
|
+
protected getEndpoint(endpoint: string): string;
|
|
40
|
+
}
|