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,48 @@
|
|
|
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 internal_1 = require("./internal");
|
|
14
|
+
const space_1 = require("./internal/space");
|
|
15
|
+
const space_2 = require("./space");
|
|
16
|
+
class Fuse extends Base_1.default {
|
|
17
|
+
get space() {
|
|
18
|
+
if (this._space === undefined) {
|
|
19
|
+
this._space = new space_2.FuseSpace(this.options, this.axios);
|
|
20
|
+
}
|
|
21
|
+
return this._space;
|
|
22
|
+
}
|
|
23
|
+
get internal() {
|
|
24
|
+
if (this._internal === undefined) {
|
|
25
|
+
this._internal = new internal_1.FuseInternal(this.options, this.axios);
|
|
26
|
+
}
|
|
27
|
+
return this._internal;
|
|
28
|
+
}
|
|
29
|
+
get spaceInternal() {
|
|
30
|
+
if (this._spaceInternal === undefined) {
|
|
31
|
+
this._spaceInternal = new space_1.FuseSpaceInternal(this.options, this.axios);
|
|
32
|
+
}
|
|
33
|
+
return this._spaceInternal;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @returns Object containing the version as a string
|
|
37
|
+
*/
|
|
38
|
+
version() {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const resp = yield this.axios.get(this.getEndpoint("/v1/version"), {});
|
|
41
|
+
return resp.data;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
getEndpoint(endpoint) {
|
|
45
|
+
return `${this.options.server}/api/fuse${endpoint}`;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.default = Fuse;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Base from "../../../Base";
|
|
2
|
+
import { FuseSpaceInternal } from "./space";
|
|
3
|
+
export declare class FuseInternal extends Base {
|
|
4
|
+
get space(): FuseSpaceInternal;
|
|
5
|
+
private _space?;
|
|
6
|
+
deleteUsers(userIds: string[]): Promise<void>;
|
|
7
|
+
protected getEndpoint(endpoint: string): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.FuseInternal = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
const space_1 = require("./space");
|
|
15
|
+
class FuseInternal extends Base_1.default {
|
|
16
|
+
get space() {
|
|
17
|
+
if (this._space === undefined) {
|
|
18
|
+
this._space = new space_1.FuseSpaceInternal(this.options, this.axios);
|
|
19
|
+
}
|
|
20
|
+
return this._space;
|
|
21
|
+
}
|
|
22
|
+
deleteUsers(userIds) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
yield this.axios.delete(this.getEndpoint("/v1/users"), { data: { userIds } });
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
getEndpoint(endpoint) {
|
|
28
|
+
return `${this.options.server}/api/fuse/internal${endpoint}`;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.FuseInternal = FuseInternal;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Base from "../../../../../Base";
|
|
2
|
+
import { FuseCronjobLogInternal } from "./log";
|
|
3
|
+
export declare class FuseCronjobInternal extends Base {
|
|
4
|
+
get cronjobLog(): FuseCronjobLogInternal;
|
|
5
|
+
private _cronjobLog?;
|
|
6
|
+
protected getEndpoint(endpoint: string): string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FuseCronjobInternal = void 0;
|
|
4
|
+
const Base_1 = require("../../../../../Base");
|
|
5
|
+
const log_1 = require("./log");
|
|
6
|
+
class FuseCronjobInternal extends Base_1.default {
|
|
7
|
+
get cronjobLog() {
|
|
8
|
+
if (this._cronjobLog === undefined) {
|
|
9
|
+
this._cronjobLog = new log_1.FuseCronjobLogInternal(this.options, this.axios);
|
|
10
|
+
}
|
|
11
|
+
return this._cronjobLog;
|
|
12
|
+
}
|
|
13
|
+
getEndpoint(endpoint) {
|
|
14
|
+
return `${this.options.server}/api/fuse/internal${endpoint}`;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.FuseCronjobInternal = FuseCronjobInternal;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Base from "../../../../../../Base";
|
|
2
|
+
import { CronjobLogCreate, CronjobLogDto } from "../../../../../../interfaces/fuse/space/cronjob/CronjobLog";
|
|
3
|
+
export declare class FuseCronjobLogInternal extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* Creates a log for a cronjob.
|
|
6
|
+
*
|
|
7
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
8
|
+
* @param orgName Name of the organization
|
|
9
|
+
* @param spaceName Name of the Fuse space
|
|
10
|
+
* @param createCronjob Cronjob log to be created
|
|
11
|
+
* @returns the created cronjob log with metadata
|
|
12
|
+
*/
|
|
13
|
+
createCronjobLog(orgName: string, spaceName: string, cronjobId: string, log: CronjobLogCreate): Promise<CronjobLogDto>;
|
|
14
|
+
protected getEndpoint(endpoint: string): string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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.FuseCronjobLogInternal = void 0;
|
|
13
|
+
const Base_1 = require("../../../../../../Base");
|
|
14
|
+
class FuseCronjobLogInternal extends Base_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Creates a log for a cronjob.
|
|
17
|
+
*
|
|
18
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
19
|
+
* @param orgName Name of the organization
|
|
20
|
+
* @param spaceName Name of the Fuse space
|
|
21
|
+
* @param createCronjob Cronjob log to be created
|
|
22
|
+
* @returns the created cronjob log with metadata
|
|
23
|
+
*/
|
|
24
|
+
createCronjobLog(orgName, spaceName, cronjobId, log) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/logs}`), log);
|
|
27
|
+
return resp.data;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
getEndpoint(endpoint) {
|
|
31
|
+
return `${this.options.server}/api/fuse/internal${endpoint}`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.FuseCronjobLogInternal = FuseCronjobLogInternal;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import Base from "../../../../Base";
|
|
2
|
+
import { FuseCronjobInternal } from "./cronjob";
|
|
3
|
+
export declare class FuseSpaceInternal extends Base {
|
|
4
|
+
get cronjob(): FuseCronjobInternal;
|
|
5
|
+
private _cronjob?;
|
|
6
|
+
/**
|
|
7
|
+
* Deletes all spaces of an organization.
|
|
8
|
+
*
|
|
9
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
10
|
+
* @param orgName Name of the organization
|
|
11
|
+
*/
|
|
12
|
+
deleteAllSpacesOfOrganization(orgName: string): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Removes the user from all spaces of an organization.
|
|
15
|
+
*
|
|
16
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
17
|
+
* @param orgName Name of the organization
|
|
18
|
+
* @param userId ID of the user
|
|
19
|
+
*/
|
|
20
|
+
removeUserFromAllSpacesOfOrganization(orgName: string, userId: string): Promise<void>;
|
|
21
|
+
protected getEndpoint(endpoint: string): string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
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.FuseSpaceInternal = void 0;
|
|
13
|
+
const Base_1 = require("../../../../Base");
|
|
14
|
+
const cronjob_1 = require("./cronjob");
|
|
15
|
+
class FuseSpaceInternal extends Base_1.default {
|
|
16
|
+
get cronjob() {
|
|
17
|
+
if (this._cronjob === undefined) {
|
|
18
|
+
this._cronjob = new cronjob_1.FuseCronjobInternal(this.options, this.axios);
|
|
19
|
+
}
|
|
20
|
+
return this._cronjob;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Deletes all spaces of an organization.
|
|
24
|
+
*
|
|
25
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
26
|
+
* @param orgName Name of the organization
|
|
27
|
+
*/
|
|
28
|
+
deleteAllSpacesOfOrganization(orgName) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}`));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Removes the user from all spaces of an organization.
|
|
35
|
+
*
|
|
36
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
37
|
+
* @param orgName Name of the organization
|
|
38
|
+
* @param userId ID of the user
|
|
39
|
+
*/
|
|
40
|
+
removeUserFromAllSpacesOfOrganization(orgName, userId) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/user/${userId}`));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
getEndpoint(endpoint) {
|
|
46
|
+
return `${this.options.server}/api/fuse/internal${endpoint}`;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.FuseSpaceInternal = FuseSpaceInternal;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import Base from "../../../../Base";
|
|
2
|
+
import { Cronjob, CronjobCreate } from "../../../../interfaces/fuse/space/cronjob/Cronjob";
|
|
3
|
+
import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
|
|
4
|
+
import { FuseCronjobLogInternal } from "../../internal/space/cronjob/log";
|
|
5
|
+
import { FuseCronjobLog } from "./log";
|
|
6
|
+
export declare class FuseCronjob extends Base {
|
|
7
|
+
get cronjobLog(): FuseCronjobLog;
|
|
8
|
+
private _cronjobLog?;
|
|
9
|
+
get cronjobLogInternal(): FuseCronjobLogInternal;
|
|
10
|
+
private _cronjobLogInternal?;
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves a cronjob by it's ID.
|
|
13
|
+
* @param orgName Name of the organization
|
|
14
|
+
* @param spaceName Name of the Fuse space
|
|
15
|
+
* @param cronjobId ID of the cronjob
|
|
16
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
17
|
+
* @returns The requested cronjob
|
|
18
|
+
*/
|
|
19
|
+
getCronjob(orgName: string, spaceName: string, cronjobId: string, exposeNextExecution?: boolean): Promise<Cronjob>;
|
|
20
|
+
/**
|
|
21
|
+
* Retrieves the next n cronjob executions as Unix timestamps (in milliseconds).
|
|
22
|
+
* @param orgName Name of the organization
|
|
23
|
+
* @param spaceName Name of the space
|
|
24
|
+
* @param cronjobId ID of the cronjob
|
|
25
|
+
* @returns Array of Unix timestamps
|
|
26
|
+
*/
|
|
27
|
+
getNextCronjobExecutions(orgName: string, spaceName: string, cronjobId: string): Promise<number[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Creates a new cronjob in the specified Fuse space.
|
|
30
|
+
* @param orgName Name of the organisation
|
|
31
|
+
* @param spaceName Name of the Fuse space
|
|
32
|
+
* @param createCronjob Cronjob to be created
|
|
33
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
34
|
+
* @returns Created cronjob
|
|
35
|
+
*/
|
|
36
|
+
createCronjob(orgName: string, spaceName: string, createCronjob: CronjobCreate, exposeNextExecution?: boolean): Promise<Cronjob>;
|
|
37
|
+
/**
|
|
38
|
+
* Updates an existing cronjob.
|
|
39
|
+
* @param orgName Name of the organization
|
|
40
|
+
* @param spaceName Name of the space
|
|
41
|
+
* @param cronjobId ID of the cronjob
|
|
42
|
+
* @param createCronjob Cronjob to be updated
|
|
43
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
44
|
+
* @returns Updated cronjob
|
|
45
|
+
*/
|
|
46
|
+
updateCronjob(orgName: string, spaceName: string, cronjobId: string, createCronjob: CronjobCreate, exposeNextExecution?: boolean): Promise<Cronjob>;
|
|
47
|
+
/**
|
|
48
|
+
* Change the cron expression of an existing cronjob
|
|
49
|
+
* @param orgName Name of the organization
|
|
50
|
+
* @param spaceName Name of the space
|
|
51
|
+
* @param cronjobId ID of the cronjob
|
|
52
|
+
* @param expression New cron expression
|
|
53
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
54
|
+
* @returns The patched cronjob
|
|
55
|
+
*/
|
|
56
|
+
patchCronjobExpression(orgName: string, spaceName: string, cronjobId: string, expression: string, exposeNextExecution?: boolean): Promise<Cronjob>;
|
|
57
|
+
/**
|
|
58
|
+
* Change the enabled flag of an existing cronjob
|
|
59
|
+
* @param orgName Name of the organization
|
|
60
|
+
* @param spaceName Name of the space
|
|
61
|
+
* @param cronjobId ID of the cronjob
|
|
62
|
+
* @param enabled Boolean flag to set
|
|
63
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
64
|
+
* @returns The patched cronjob
|
|
65
|
+
*/
|
|
66
|
+
patchCronjobEnabled(orgName: string, spaceName: string, cronjobId: string, enabled: boolean, exposeNextExecution?: boolean): Promise<Cronjob>;
|
|
67
|
+
/**
|
|
68
|
+
* Enable a cronjob.
|
|
69
|
+
*
|
|
70
|
+
* This is a wrapper around patchCronjobEnabled.
|
|
71
|
+
*
|
|
72
|
+
* @param orgName Name of the organization
|
|
73
|
+
* @param spaceName Name of the space
|
|
74
|
+
* @param cronjobId ID of the cronjob
|
|
75
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
76
|
+
* @returns The patched cronjob
|
|
77
|
+
*/
|
|
78
|
+
enableCronjob: (orgName: string, spaceName: string, cronjobId: string, exposeNextExecution?: boolean) => Promise<Cronjob>;
|
|
79
|
+
/**
|
|
80
|
+
* Disable a cronjob.
|
|
81
|
+
*
|
|
82
|
+
* This is a wrapper around patchCronjobEnabled.
|
|
83
|
+
*
|
|
84
|
+
* @param orgName Name of the organization
|
|
85
|
+
* @param spaceName Name of the space
|
|
86
|
+
* @param cronjobId ID of the cronjob
|
|
87
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
88
|
+
* @returns The patched cronjob
|
|
89
|
+
*/
|
|
90
|
+
disableCronjob: (orgName: string, spaceName: string, cronjobId: string, exposeNextExecution?: boolean) => Promise<Cronjob>;
|
|
91
|
+
/**
|
|
92
|
+
* Deletes a cronjob by its ID
|
|
93
|
+
* @param orgName Name of the organization
|
|
94
|
+
* @param spaceName Name of the space
|
|
95
|
+
* @param cronjobId ID of the cronjob
|
|
96
|
+
*/
|
|
97
|
+
deleteCronjob(orgName: string, spaceName: string, cronjobId: string): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Retrieves all cronjobs of a Fuse space which match the provided search filter(s). Will return all cronjobs if no filter is provided.
|
|
100
|
+
* @param orgName Name of the organization
|
|
101
|
+
* @param spaceName Name of the space
|
|
102
|
+
* @param filters (optional) Array of search filters
|
|
103
|
+
* @param sorting (optional) Sorting object
|
|
104
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
105
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
106
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the returned cronjob objects
|
|
107
|
+
* @returns Object containing an array of filtered cronjobs as well as the total number of results found in the database (independent of limit and page)
|
|
108
|
+
*/
|
|
109
|
+
searchCronjobs({ orgName, spaceName, filters, sorting, limit, page, exposeNextExecution, }: SearchParams & {
|
|
110
|
+
orgName: string;
|
|
111
|
+
spaceName: string;
|
|
112
|
+
exposeNextExecution?: boolean;
|
|
113
|
+
}): Promise<PaginatedResponse<Cronjob>>;
|
|
114
|
+
/**
|
|
115
|
+
* Resolve a cron pattern along with a timezone to get the next executions in mili-seconds.
|
|
116
|
+
* @param expression The cron expression
|
|
117
|
+
* @param timezone The target IANA timezone
|
|
118
|
+
* @param amount The amount of returned execution-dates (limited between 1 and 10, default is 3)
|
|
119
|
+
* @returns Array of Unix timestamps
|
|
120
|
+
*/
|
|
121
|
+
resolveCronPatternWithTimezone(expression: string, timezone: string, amount?: number): Promise<number[]>;
|
|
122
|
+
protected getEndpoint(endpoint: string): string;
|
|
123
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
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.FuseCronjob = void 0;
|
|
13
|
+
const Base_1 = require("../../../../Base");
|
|
14
|
+
const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
|
|
15
|
+
const searchFilter_1 = require("../../../../helper/searchFilter");
|
|
16
|
+
const log_1 = require("../../internal/space/cronjob/log");
|
|
17
|
+
const log_2 = require("./log");
|
|
18
|
+
class FuseCronjob extends Base_1.default {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
/**
|
|
22
|
+
* Enable a cronjob.
|
|
23
|
+
*
|
|
24
|
+
* This is a wrapper around patchCronjobEnabled.
|
|
25
|
+
*
|
|
26
|
+
* @param orgName Name of the organization
|
|
27
|
+
* @param spaceName Name of the space
|
|
28
|
+
* @param cronjobId ID of the cronjob
|
|
29
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
30
|
+
* @returns The patched cronjob
|
|
31
|
+
*/
|
|
32
|
+
this.enableCronjob = (orgName, spaceName, cronjobId, exposeNextExecution = false) => {
|
|
33
|
+
return this.patchCronjobEnabled(orgName, spaceName, cronjobId, true, exposeNextExecution);
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Disable a cronjob.
|
|
37
|
+
*
|
|
38
|
+
* This is a wrapper around patchCronjobEnabled.
|
|
39
|
+
*
|
|
40
|
+
* @param orgName Name of the organization
|
|
41
|
+
* @param spaceName Name of the space
|
|
42
|
+
* @param cronjobId ID of the cronjob
|
|
43
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
44
|
+
* @returns The patched cronjob
|
|
45
|
+
*/
|
|
46
|
+
this.disableCronjob = (orgName, spaceName, cronjobId, exposeNextExecution = false) => {
|
|
47
|
+
return this.patchCronjobEnabled(orgName, spaceName, cronjobId, false, exposeNextExecution);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
get cronjobLog() {
|
|
51
|
+
if (this._cronjobLog === undefined) {
|
|
52
|
+
this._cronjobLog = new log_2.FuseCronjobLog(this.options, this.axios);
|
|
53
|
+
}
|
|
54
|
+
return this._cronjobLog;
|
|
55
|
+
}
|
|
56
|
+
get cronjobLogInternal() {
|
|
57
|
+
if (this._cronjobLogInternal === undefined) {
|
|
58
|
+
this._cronjobLogInternal = new log_1.FuseCronjobLogInternal(this.options, this.axios);
|
|
59
|
+
}
|
|
60
|
+
return this._cronjobLogInternal;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Retrieves a cronjob by it's ID.
|
|
64
|
+
* @param orgName Name of the organization
|
|
65
|
+
* @param spaceName Name of the Fuse space
|
|
66
|
+
* @param cronjobId ID of the cronjob
|
|
67
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
68
|
+
* @returns The requested cronjob
|
|
69
|
+
*/
|
|
70
|
+
getCronjob(orgName_1, spaceName_1, cronjobId_1) {
|
|
71
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, cronjobId, exposeNextExecution = false) {
|
|
72
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}?nextExecution=${exposeNextExecution}`));
|
|
73
|
+
return resp.data;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Retrieves the next n cronjob executions as Unix timestamps (in milliseconds).
|
|
78
|
+
* @param orgName Name of the organization
|
|
79
|
+
* @param spaceName Name of the space
|
|
80
|
+
* @param cronjobId ID of the cronjob
|
|
81
|
+
* @returns Array of Unix timestamps
|
|
82
|
+
*/
|
|
83
|
+
getNextCronjobExecutions(orgName, spaceName, cronjobId) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/next`));
|
|
86
|
+
return resp.data;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Creates a new cronjob in the specified Fuse space.
|
|
91
|
+
* @param orgName Name of the organisation
|
|
92
|
+
* @param spaceName Name of the Fuse space
|
|
93
|
+
* @param createCronjob Cronjob to be created
|
|
94
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
95
|
+
* @returns Created cronjob
|
|
96
|
+
*/
|
|
97
|
+
createCronjob(orgName_1, spaceName_1, createCronjob_1) {
|
|
98
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, createCronjob, exposeNextExecution = false) {
|
|
99
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs?nextExecution=${exposeNextExecution}`), createCronjob);
|
|
100
|
+
return resp.data;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Updates an existing cronjob.
|
|
105
|
+
* @param orgName Name of the organization
|
|
106
|
+
* @param spaceName Name of the space
|
|
107
|
+
* @param cronjobId ID of the cronjob
|
|
108
|
+
* @param createCronjob Cronjob to be updated
|
|
109
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
110
|
+
* @returns Updated cronjob
|
|
111
|
+
*/
|
|
112
|
+
updateCronjob(orgName_1, spaceName_1, cronjobId_1, createCronjob_1) {
|
|
113
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, cronjobId, createCronjob, exposeNextExecution = false) {
|
|
114
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}?nextExecution=${exposeNextExecution}`), createCronjob);
|
|
115
|
+
return resp.data;
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Change the cron expression of an existing cronjob
|
|
120
|
+
* @param orgName Name of the organization
|
|
121
|
+
* @param spaceName Name of the space
|
|
122
|
+
* @param cronjobId ID of the cronjob
|
|
123
|
+
* @param expression New cron expression
|
|
124
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
125
|
+
* @returns The patched cronjob
|
|
126
|
+
*/
|
|
127
|
+
patchCronjobExpression(orgName_1, spaceName_1, cronjobId_1, expression_1) {
|
|
128
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, cronjobId, expression, exposeNextExecution = false) {
|
|
129
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/expression?nextExecution=${exposeNextExecution}`), { expression: expression });
|
|
130
|
+
return resp.data;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Change the enabled flag of an existing cronjob
|
|
135
|
+
* @param orgName Name of the organization
|
|
136
|
+
* @param spaceName Name of the space
|
|
137
|
+
* @param cronjobId ID of the cronjob
|
|
138
|
+
* @param enabled Boolean flag to set
|
|
139
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
140
|
+
* @returns The patched cronjob
|
|
141
|
+
*/
|
|
142
|
+
patchCronjobEnabled(orgName_1, spaceName_1, cronjobId_1, enabled_1) {
|
|
143
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, cronjobId, enabled, exposeNextExecution = false) {
|
|
144
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/enabled?nextExecution=${exposeNextExecution}`), { enabled });
|
|
145
|
+
return resp.data;
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Deletes a cronjob by its ID
|
|
150
|
+
* @param orgName Name of the organization
|
|
151
|
+
* @param spaceName Name of the space
|
|
152
|
+
* @param cronjobId ID of the cronjob
|
|
153
|
+
*/
|
|
154
|
+
deleteCronjob(orgName, spaceName, cronjobId) {
|
|
155
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
156
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}`));
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Retrieves all cronjobs of a Fuse space which match the provided search filter(s). Will return all cronjobs if no filter is provided.
|
|
161
|
+
* @param orgName Name of the organization
|
|
162
|
+
* @param spaceName Name of the space
|
|
163
|
+
* @param filters (optional) Array of search filters
|
|
164
|
+
* @param sorting (optional) Sorting object
|
|
165
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
166
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
167
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the returned cronjob objects
|
|
168
|
+
* @returns Object containing an array of filtered cronjobs as well as the total number of results found in the database (independent of limit and page)
|
|
169
|
+
*/
|
|
170
|
+
searchCronjobs(_a) {
|
|
171
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, exposeNextExecution = false, }) {
|
|
172
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
173
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
174
|
+
});
|
|
175
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/search?limit=${limit}&page=${page}&nextExecution=${exposeNextExecution}`), {
|
|
176
|
+
filters: filtersDTO,
|
|
177
|
+
sorting,
|
|
178
|
+
});
|
|
179
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Resolve a cron pattern along with a timezone to get the next executions in mili-seconds.
|
|
184
|
+
* @param expression The cron expression
|
|
185
|
+
* @param timezone The target IANA timezone
|
|
186
|
+
* @param amount The amount of returned execution-dates (limited between 1 and 10, default is 3)
|
|
187
|
+
* @returns Array of Unix timestamps
|
|
188
|
+
*/
|
|
189
|
+
resolveCronPatternWithTimezone(expression_1, timezone_1) {
|
|
190
|
+
return __awaiter(this, arguments, void 0, function* (expression, timezone, amount = 3) {
|
|
191
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/cron/resolve`), {
|
|
192
|
+
expression: expression,
|
|
193
|
+
timezone: timezone,
|
|
194
|
+
amount: amount,
|
|
195
|
+
});
|
|
196
|
+
return resp.data;
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
getEndpoint(endpoint) {
|
|
200
|
+
return `${this.options.server}/api/fuse${endpoint}`;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
exports.FuseCronjob = FuseCronjob;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Base from "../../../../../Base";
|
|
2
|
+
import { CronjobLogDto } from "../../../../../interfaces/fuse/space/cronjob/CronjobLog";
|
|
3
|
+
import { PaginatedResponse, SearchParams } from "../../../../../interfaces/global";
|
|
4
|
+
export declare class FuseCronjobLog extends Base {
|
|
5
|
+
/**
|
|
6
|
+
* Retrieves all cronjobs of a Fuse space which match the provided search filter(s). Will return all cronjobs if no filter is provided.
|
|
7
|
+
* @param orgName Name of the organization
|
|
8
|
+
* @param spaceName Name of the space
|
|
9
|
+
* @param cronjobId ID of the cronjob
|
|
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 filtered cronjob logs as well as the total number of results found in the database (independent of limit and page)
|
|
15
|
+
*/
|
|
16
|
+
searchCronjobLogs({ orgName, spaceName, cronjobId, filters, sorting, limit, page, }: SearchParams & {
|
|
17
|
+
orgName: string;
|
|
18
|
+
spaceName: string;
|
|
19
|
+
cronjobId: string;
|
|
20
|
+
}): Promise<PaginatedResponse<CronjobLogDto>>;
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves a cronjob log by it's ID
|
|
23
|
+
* @param orgName Name of the organization
|
|
24
|
+
* @param spaceName Name of the space
|
|
25
|
+
* @param cronjobId ID of the cronjob
|
|
26
|
+
* @param cronjobLogId ID of the cronjob log
|
|
27
|
+
* @returns the cronjob log
|
|
28
|
+
*/
|
|
29
|
+
getCronjobLog(orgName: string, spaceName: string, cronjobId: string, cronjobLogId: string): Promise<CronjobLogDto>;
|
|
30
|
+
protected getEndpoint(endpoint: string): string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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.FuseCronjobLog = void 0;
|
|
13
|
+
const Base_1 = require("../../../../../Base");
|
|
14
|
+
const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
|
|
15
|
+
const searchFilter_1 = require("../../../../../helper/searchFilter");
|
|
16
|
+
class FuseCronjobLog extends Base_1.default {
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves all cronjobs of a Fuse space which match the provided search filter(s). Will return all cronjobs if no filter is provided.
|
|
19
|
+
* @param orgName Name of the organization
|
|
20
|
+
* @param spaceName Name of the space
|
|
21
|
+
* @param cronjobId ID of the cronjob
|
|
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 filtered cronjob logs as well as the total number of results found in the database (independent of limit and page)
|
|
27
|
+
*/
|
|
28
|
+
searchCronjobLogs(_a) {
|
|
29
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, cronjobId, filters, sorting, limit = 25, page = 0, }) {
|
|
30
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
31
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
32
|
+
});
|
|
33
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/logs/search?page=${page}&limit=${limit}`), {
|
|
34
|
+
filters: filtersDTO,
|
|
35
|
+
sorting,
|
|
36
|
+
});
|
|
37
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves a cronjob log by it's ID
|
|
42
|
+
* @param orgName Name of the organization
|
|
43
|
+
* @param spaceName Name of the space
|
|
44
|
+
* @param cronjobId ID of the cronjob
|
|
45
|
+
* @param cronjobLogId ID of the cronjob log
|
|
46
|
+
* @returns the cronjob log
|
|
47
|
+
*/
|
|
48
|
+
getCronjobLog(orgName, spaceName, cronjobId, cronjobLogId) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/logs/${cronjobLogId}`));
|
|
51
|
+
return resp.data;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
getEndpoint(endpoint) {
|
|
55
|
+
return `${this.options.server}/api/fuse${endpoint}`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.FuseCronjobLog = FuseCronjobLog;
|