hcloud-sdk 0.0.15 → 14.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/changelog.md +809 -0
- package/index.d.ts +3 -2
- package/index.js +5 -2
- package/lib/Base.d.ts +26 -0
- package/lib/Base.js +12 -0
- package/lib/Hcloud.d.ts +80 -0
- package/lib/Hcloud.js +134 -0
- package/lib/helper/ErrorHelper.d.ts +7 -0
- package/lib/helper/ErrorHelper.js +19 -0
- package/lib/helper/paginatedResponseHelper.d.ts +3 -0
- package/lib/helper/paginatedResponseHelper.js +9 -0
- package/lib/helper/searchFilter.d.ts +9 -0
- package/lib/helper/searchFilter.js +12 -0
- package/lib/interfaces/agent/bundle/dev/index.d.ts +3 -0
- package/lib/interfaces/agent/context/index.d.ts +19 -0
- package/lib/interfaces/agent/index.d.ts +21 -0
- package/lib/interfaces/agent/index.js +2 -0
- package/lib/interfaces/auditor/index.d.ts +72 -0
- package/lib/interfaces/{Auditor.js → auditor/index.js} +21 -5
- package/lib/interfaces/axios/index.d.ts +5 -0
- package/lib/interfaces/axios/index.js +8 -0
- package/lib/interfaces/bouncer/features/index.d.ts +10 -0
- package/lib/interfaces/bouncer/features/index.js +2 -0
- package/lib/interfaces/bouncer/index.d.ts +6 -0
- package/lib/interfaces/bouncer/index.js +17 -0
- package/lib/interfaces/dali/index.d.ts +3 -0
- package/lib/interfaces/dali/index.js +2 -0
- package/lib/interfaces/frontend/config/index.d.ts +33 -0
- package/lib/interfaces/frontend/config/index.js +10 -0
- package/lib/interfaces/fuse/index.d.ts +3 -0
- package/lib/interfaces/fuse/index.js +19 -0
- package/lib/interfaces/fuse/space/cronjob/Cronjob.d.ts +38 -0
- package/lib/interfaces/fuse/space/cronjob/Cronjob.js +8 -0
- package/lib/interfaces/fuse/space/cronjob/CronjobLog.d.ts +16 -0
- package/lib/interfaces/fuse/space/cronjob/CronjobLog.js +2 -0
- package/lib/interfaces/fuse/space/index.d.ts +21 -0
- package/lib/interfaces/fuse/space/index.js +11 -0
- package/lib/interfaces/global/HCloudError.d.ts +8 -0
- package/lib/interfaces/global/HCloudError.js +13 -0
- package/lib/interfaces/global/Header.d.ts +4 -0
- package/lib/interfaces/global/Header.js +2 -0
- package/lib/interfaces/global/HttpMethod.d.ts +7 -0
- package/lib/interfaces/global/HttpMethod.js +11 -0
- package/lib/interfaces/global/PaginatedResponse.d.ts +4 -0
- package/lib/interfaces/global/PaginatedResponse.js +2 -0
- package/lib/interfaces/global/Products.d.ts +11 -0
- package/lib/interfaces/global/Products.js +15 -0
- package/lib/interfaces/global/SearchFilters.d.ts +86 -0
- package/lib/interfaces/global/SearchFilters.js +49 -0
- package/lib/interfaces/global/Space.d.ts +20 -0
- package/lib/interfaces/global/Space.js +8 -0
- package/lib/interfaces/global/Version.d.ts +3 -0
- package/lib/interfaces/global/Version.js +2 -0
- package/lib/interfaces/global/Views.d.ts +8 -0
- package/lib/interfaces/global/Views.js +12 -0
- package/lib/interfaces/global/index.d.ts +9 -0
- package/lib/interfaces/global/index.js +25 -0
- package/lib/interfaces/high5/index.d.ts +16 -0
- package/lib/interfaces/high5/index.js +32 -0
- package/lib/interfaces/high5/joinToken/index.d.ts +10 -0
- package/lib/interfaces/high5/joinToken/index.js +2 -0
- package/lib/interfaces/high5/space/event/index.d.ts +15 -0
- package/lib/interfaces/high5/space/event/index.js +2 -0
- package/lib/interfaces/high5/space/event/stream/design/DesignOperation.d.ts +68 -0
- package/lib/interfaces/high5/space/event/stream/design/DesignOperation.js +20 -0
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +92 -0
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.js +20 -0
- package/lib/interfaces/high5/space/event/stream/design/index.d.ts +22 -0
- package/lib/interfaces/high5/space/event/stream/design/index.js +2 -0
- package/lib/interfaces/high5/space/event/stream/design/snapshot/index.d.ts +30 -0
- package/lib/interfaces/high5/space/event/stream/design/snapshot/index.js +8 -0
- package/lib/interfaces/high5/space/event/stream/index.d.ts +77 -0
- package/lib/interfaces/high5/space/event/stream/index.js +13 -0
- package/lib/interfaces/high5/space/event/stream/node/index.d.ts +60 -0
- package/lib/interfaces/high5/space/event/stream/node/index.js +7 -0
- package/lib/interfaces/high5/space/execution/index.d.ts +137 -0
- package/lib/interfaces/high5/space/execution/index.js +21 -0
- package/lib/interfaces/high5/space/index.d.ts +23 -0
- package/lib/interfaces/high5/space/index.js +12 -0
- package/lib/interfaces/high5/space/secret/index.d.ts +12 -0
- package/lib/interfaces/high5/space/secret/index.js +2 -0
- package/lib/interfaces/high5/space/webhook/index.d.ts +75 -0
- package/lib/interfaces/high5/space/webhook/index.js +9 -0
- package/lib/interfaces/high5/wave/index.d.ts +171 -0
- package/lib/interfaces/high5/wave/index.js +52 -0
- package/lib/interfaces/idp/index.d.ts +26 -0
- package/lib/interfaces/idp/index.js +38 -0
- package/lib/interfaces/idp/oauth/index.d.ts +19 -0
- package/lib/interfaces/idp/oauth/index.js +8 -0
- package/lib/interfaces/idp/organization/index.d.ts +32 -0
- package/lib/interfaces/idp/organization/index.js +25 -0
- package/lib/interfaces/idp/organization/license/index.d.ts +84 -0
- package/lib/interfaces/idp/organization/license/index.js +15 -0
- package/lib/interfaces/idp/organization/member/index.d.ts +15 -0
- package/lib/interfaces/idp/organization/member/index.js +2 -0
- package/lib/interfaces/idp/organization/member/invitations/index.d.ts +26 -0
- package/lib/interfaces/idp/organization/member/invitations/index.js +18 -0
- package/lib/interfaces/idp/organization/settings/domain/index.d.ts +19 -0
- package/lib/interfaces/idp/organization/settings/domain/index.js +8 -0
- package/lib/interfaces/idp/organization/settings/domain/saml/index.d.ts +10 -0
- package/lib/interfaces/idp/organization/settings/domain/saml/index.js +2 -0
- package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +37 -0
- package/lib/interfaces/idp/organization/settings/oauthApp/index.js +2 -0
- package/lib/interfaces/idp/organization/team/index.d.ts +24 -0
- package/lib/interfaces/idp/organization/team/index.js +9 -0
- package/lib/interfaces/idp/user/ConnectionSettings.d.ts +6 -0
- package/lib/interfaces/idp/user/ConnectionSettings.js +2 -0
- package/lib/interfaces/idp/user/GeneralSettings.d.ts +44 -0
- package/lib/interfaces/idp/user/GeneralSettings.js +38 -0
- package/lib/interfaces/idp/user/NotificationSettings.d.ts +8 -0
- package/lib/interfaces/idp/user/NotificationSettings.js +2 -0
- package/lib/interfaces/idp/user/Pat.d.ts +19 -0
- package/lib/interfaces/idp/user/Pat.js +2 -0
- package/lib/interfaces/idp/user/Scopes.d.ts +40 -0
- package/lib/interfaces/idp/user/Scopes.js +50 -0
- package/lib/interfaces/idp/user/SuccessfulAuth.d.ts +5 -0
- package/lib/interfaces/idp/user/SuccessfulAuth.js +2 -0
- package/lib/interfaces/idp/user/Totp.d.ts +20 -0
- package/lib/interfaces/idp/user/Totp.js +2 -0
- package/lib/interfaces/idp/user/index.d.ts +23 -0
- package/lib/interfaces/idp/user/index.js +2 -0
- package/lib/interfaces/mailer/index.d.ts +66 -0
- package/lib/interfaces/mailer/index.js +81 -0
- package/lib/interfaces/mothership/index.d.ts +27 -0
- package/lib/interfaces/mothership/index.js +8 -0
- package/lib/interfaces/nats/index.d.ts +252 -0
- package/lib/interfaces/nats/index.js +334 -0
- package/lib/service/agent/bundle/dev/index.d.ts +17 -0
- package/lib/service/agent/bundle/dev/index.js +40 -0
- package/lib/service/agent/bundle/index.d.ts +11 -0
- package/lib/service/agent/bundle/index.js +55 -0
- package/lib/service/agent/context/index.d.ts +37 -0
- package/lib/service/agent/context/index.js +81 -0
- package/lib/service/agent/index.d.ts +14 -0
- package/lib/service/agent/index.js +20 -0
- package/lib/service/agent/installer/index.d.ts +15 -0
- package/lib/service/agent/installer/index.js +97 -0
- package/lib/service/auditor/index.d.ts +26 -0
- package/lib/service/auditor/index.js +49 -0
- package/lib/service/auditor/internal/index.d.ts +27 -0
- package/lib/service/auditor/internal/index.js +61 -0
- package/lib/service/bouncer/features/index.d.ts +8 -0
- package/lib/service/bouncer/features/index.js +25 -0
- package/lib/service/bouncer/index.d.ts +14 -0
- package/lib/service/bouncer/index.js +31 -0
- package/lib/service/dali/DaliAvatar.d.ts +36 -0
- package/lib/service/dali/DaliAvatar.js +25 -0
- package/lib/service/dali/avatar/DaliFuseSpace.d.ts +28 -0
- package/lib/service/dali/avatar/DaliFuseSpace.js +55 -0
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +28 -0
- package/lib/service/dali/avatar/DaliHigh5Space.js +55 -0
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +28 -0
- package/lib/service/dali/avatar/DaliOAuthApp.js +55 -0
- package/lib/service/dali/avatar/DaliOrganization.d.ts +25 -0
- package/lib/service/dali/avatar/DaliOrganization.js +52 -0
- package/lib/service/dali/avatar/DaliTeam.d.ts +28 -0
- package/lib/service/dali/avatar/DaliTeam.js +55 -0
- package/lib/service/dali/avatar/DaliUser.d.ts +22 -0
- package/lib/service/dali/avatar/DaliUser.js +49 -0
- package/lib/service/dali/index.d.ts +16 -0
- package/lib/service/dali/index.js +30 -0
- package/lib/service/fuse/index.d.ts +17 -0
- package/lib/service/fuse/index.js +34 -0
- package/lib/service/fuse/internal/index.d.ts +9 -0
- package/lib/service/fuse/internal/index.js +29 -0
- package/lib/service/fuse/internal/space/cronjob/index.d.ts +8 -0
- package/lib/service/fuse/internal/space/cronjob/index.js +15 -0
- package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +17 -0
- package/lib/service/fuse/internal/space/cronjob/log/index.js +35 -0
- package/lib/service/fuse/internal/space/index.d.ts +23 -0
- package/lib/service/fuse/internal/space/index.js +43 -0
- package/lib/service/fuse/space/cronjob/index.d.ts +123 -0
- package/lib/service/fuse/space/cronjob/index.js +175 -0
- package/lib/service/fuse/space/cronjob/log/index.d.ts +31 -0
- package/lib/service/fuse/space/cronjob/log/index.js +57 -0
- package/lib/service/fuse/space/index.d.ts +82 -0
- package/lib/service/fuse/space/index.js +134 -0
- package/lib/service/high5/execution/index.d.ts +10 -0
- package/lib/service/high5/execution/index.js +17 -0
- package/lib/service/high5/execution/log/index.d.ts +19 -0
- package/lib/service/high5/execution/log/index.js +41 -0
- package/lib/service/high5/execution/status/index.d.ts +18 -0
- package/lib/service/high5/execution/status/index.js +41 -0
- package/lib/service/high5/index.d.ts +22 -0
- package/lib/service/high5/index.js +39 -0
- package/lib/service/high5/internal/index.d.ts +9 -0
- package/lib/service/high5/internal/index.js +29 -0
- package/lib/service/high5/internal/space/index.d.ts +21 -0
- package/lib/service/high5/internal/space/index.js +41 -0
- package/lib/service/high5/joinToken/index.d.ts +40 -0
- package/lib/service/high5/joinToken/index.js +64 -0
- package/lib/service/high5/space/event/index.d.ts +56 -0
- package/lib/service/high5/space/event/index.js +89 -0
- package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +31 -0
- package/lib/service/high5/space/event/stream/design/DesignOperations.js +117 -0
- package/lib/service/high5/space/event/stream/design/index.d.ts +38 -0
- package/lib/service/high5/space/event/stream/design/index.js +56 -0
- package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +62 -0
- package/lib/service/high5/space/event/stream/design/snapshot/index.js +100 -0
- package/lib/service/high5/space/event/stream/index.d.ts +114 -0
- package/lib/service/high5/space/event/stream/index.js +164 -0
- package/lib/service/high5/space/execution/index.d.ts +48 -0
- package/lib/service/high5/space/execution/index.js +74 -0
- package/lib/service/high5/space/execution/log/index.d.ts +31 -0
- package/lib/service/high5/space/execution/log/index.js +57 -0
- package/lib/service/high5/space/execution/status/index.d.ts +16 -0
- package/lib/service/high5/space/execution/status/index.js +34 -0
- package/lib/service/high5/space/index.d.ts +107 -0
- package/lib/service/high5/space/index.js +160 -0
- package/lib/service/high5/space/node/index.d.ts +58 -0
- package/lib/service/high5/space/node/index.js +116 -0
- package/lib/service/high5/space/secret/index.d.ts +60 -0
- package/lib/service/high5/space/secret/index.js +92 -0
- package/lib/service/high5/space/wave/index.d.ts +38 -0
- package/lib/service/high5/space/wave/index.js +66 -0
- package/lib/service/high5/space/webhook/index.d.ts +83 -0
- package/lib/service/high5/space/webhook/index.js +132 -0
- package/lib/service/high5/space/webhook/log/index.d.ts +18 -0
- package/lib/service/high5/space/webhook/log/index.js +38 -0
- package/lib/service/high5/wave/index.d.ts +8 -0
- package/lib/service/high5/wave/index.js +15 -0
- package/lib/service/high5/wave/s3/index.d.ts +48 -0
- package/lib/service/high5/wave/s3/index.js +88 -0
- package/lib/service/idp/index.d.ts +82 -0
- package/lib/service/idp/index.js +137 -0
- package/lib/service/idp/internal/index.d.ts +19 -0
- package/lib/service/idp/internal/index.js +34 -0
- package/lib/service/idp/oauth/index.d.ts +45 -0
- package/lib/service/idp/oauth/index.js +105 -0
- package/lib/service/idp/organization/index.d.ts +54 -0
- package/lib/service/idp/organization/index.js +79 -0
- package/lib/service/idp/organization/license/index.d.ts +7 -0
- package/lib/service/idp/organization/license/index.js +30 -0
- package/lib/service/idp/organization/member/index.d.ts +58 -0
- package/lib/service/idp/organization/member/index.js +96 -0
- package/lib/service/idp/organization/member/invitations/index.d.ts +79 -0
- package/lib/service/idp/organization/member/invitations/index.js +118 -0
- package/lib/service/idp/organization/settings/domain/index.d.ts +38 -0
- package/lib/service/idp/organization/settings/domain/index.js +63 -0
- package/lib/service/idp/organization/settings/domain/saml/index.d.ts +43 -0
- package/lib/service/idp/organization/settings/domain/saml/index.js +88 -0
- package/lib/service/idp/organization/settings/index.d.ts +16 -0
- package/lib/service/idp/organization/settings/index.js +16 -0
- package/lib/service/idp/organization/settings/oauth/index.d.ts +64 -0
- package/lib/service/idp/organization/settings/oauth/index.js +106 -0
- package/lib/service/idp/organization/team/index.d.ts +72 -0
- package/lib/service/idp/organization/team/index.js +115 -0
- package/lib/service/idp/registration/index.d.ts +39 -0
- package/lib/service/idp/registration/index.js +84 -0
- package/lib/service/idp/user/index.d.ts +82 -0
- package/lib/service/idp/user/index.js +125 -0
- package/lib/service/idp/user/license/index.d.ts +7 -0
- package/lib/service/idp/user/license/index.js +30 -0
- package/lib/service/idp/user/password/index.d.ts +19 -0
- package/lib/service/idp/user/password/index.js +52 -0
- package/lib/service/idp/user/settings/connections/index.d.ts +15 -0
- package/lib/service/idp/user/settings/connections/index.js +33 -0
- package/lib/service/idp/user/settings/general/index.d.ts +18 -0
- package/lib/service/idp/user/settings/general/index.js +39 -0
- package/lib/service/idp/user/settings/index.d.ts +36 -0
- package/lib/service/idp/user/settings/index.js +25 -0
- package/lib/service/idp/user/settings/notifications/index.d.ts +18 -0
- package/lib/service/idp/user/settings/notifications/index.js +39 -0
- package/lib/service/idp/user/settings/oauthApps/index.d.ts +22 -0
- package/lib/service/idp/user/settings/oauthApps/index.js +54 -0
- package/lib/service/idp/user/settings/pats/index.d.ts +50 -0
- package/lib/service/idp/user/settings/pats/index.js +93 -0
- package/lib/service/idp/user/settings/twoFactor/index.d.ts +11 -0
- package/lib/service/idp/user/settings/twoFactor/index.js +15 -0
- package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +34 -0
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +65 -0
- package/lib/service/mailer/index.d.ts +14 -0
- package/lib/service/mailer/index.js +31 -0
- package/lib/service/mailer/internal/index.d.ts +36 -0
- package/lib/service/mailer/internal/index.js +64 -0
- package/lib/service/mothership/index.d.ts +97 -0
- package/lib/service/mothership/index.js +136 -0
- package/lib/service/nats/index.d.ts +51 -0
- package/lib/service/nats/index.js +138 -0
- package/lib/utils/Types.d.ts +1 -0
- package/lib/utils/Types.js +2 -0
- package/lib/utils/bouncer/features/Provider.d.ts +16 -0
- package/lib/utils/bouncer/features/Provider.js +83 -0
- package/package.json +36 -27
- package/lib/base.d.ts +0 -12
- package/lib/base.js +0 -8
- package/lib/hcloud.d.ts +0 -11
- package/lib/hcloud.js +0 -27
- package/lib/interfaces/Auditor.d.ts +0 -40
- package/lib/interfaces/Global.d.ts +0 -8
- package/lib/interfaces/IDP.d.ts +0 -9
- package/lib/service/Auditor.d.ts +0 -42
- package/lib/service/Auditor.js +0 -101
- 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/interfaces/{Global.js → agent/bundle/dev/index.js} +0 -0
- /package/lib/interfaces/{IDP.js → agent/context/index.js} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
constructor(options, axios) {
|
|
8
|
+
super(options, axios);
|
|
9
|
+
this.cronjobLog = new log_1.FuseCronjobLogInternal(this.options, this.axios);
|
|
10
|
+
}
|
|
11
|
+
getEndpoint(endpoint) {
|
|
12
|
+
return `${this.options.server}/api/fuse/internal${endpoint}`;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.FuseCronjobInternal = FuseCronjobInternal;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import Base, { Options } from "../../../../../../Base";
|
|
3
|
+
import { CronjobLogCreate, CronjobLogDto } from "../../../../../../interfaces/fuse/space/cronjob/CronjobLog";
|
|
4
|
+
export declare class FuseCronjobLogInternal extends Base {
|
|
5
|
+
constructor(options: Options, axios: AxiosInstance);
|
|
6
|
+
/**
|
|
7
|
+
* Creates a log for a cronjob.
|
|
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
|
+
* @param spaceName Name of the Fuse space
|
|
12
|
+
* @param createCronjob Cronjob log to be created
|
|
13
|
+
* @returns the created cronjob log with metadata
|
|
14
|
+
*/
|
|
15
|
+
createCronjobLog: (orgName: string, spaceName: string, cronjobId: string, log: CronjobLogCreate) => Promise<CronjobLogDto>;
|
|
16
|
+
protected getEndpoint(endpoint: string): string;
|
|
17
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
constructor(options, axios) {
|
|
16
|
+
super(options, axios);
|
|
17
|
+
/**
|
|
18
|
+
* Creates a log for a cronjob.
|
|
19
|
+
*
|
|
20
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
21
|
+
* @param orgName Name of the organization
|
|
22
|
+
* @param spaceName Name of the Fuse space
|
|
23
|
+
* @param createCronjob Cronjob log to be created
|
|
24
|
+
* @returns the created cronjob log with metadata
|
|
25
|
+
*/
|
|
26
|
+
this.createCronjobLog = (orgName, spaceName, cronjobId, log) => __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/logs}`), log);
|
|
28
|
+
return resp.data;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
getEndpoint(endpoint) {
|
|
32
|
+
return `${this.options.server}/api/fuse/internal${endpoint}`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.FuseCronjobLogInternal = FuseCronjobLogInternal;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import Base, { Options } from "../../../../Base";
|
|
3
|
+
import { FuseCronjobInternal } from "./cronjob";
|
|
4
|
+
export declare class FuseSpaceInternal extends Base {
|
|
5
|
+
cronjob: FuseCronjobInternal;
|
|
6
|
+
constructor(options: Options, axios: AxiosInstance);
|
|
7
|
+
/**
|
|
8
|
+
* Deletes all spaces of an organization.
|
|
9
|
+
*
|
|
10
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
11
|
+
* @param orgName Name of the organization
|
|
12
|
+
*/
|
|
13
|
+
deleteAllSpacesOfOrganization: (orgName: string) => Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Removes the user from all spaces of an organization.
|
|
16
|
+
*
|
|
17
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
18
|
+
* @param orgName Name of the organization
|
|
19
|
+
* @param userId ID of the user
|
|
20
|
+
*/
|
|
21
|
+
removeUserFromAllSpacesOfOrganization: (orgName: string, userId: string) => Promise<void>;
|
|
22
|
+
protected getEndpoint(endpoint: string): string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
constructor(options, axios) {
|
|
17
|
+
super(options, axios);
|
|
18
|
+
/**
|
|
19
|
+
* Deletes all spaces of an organization.
|
|
20
|
+
*
|
|
21
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
22
|
+
* @param orgName Name of the organization
|
|
23
|
+
*/
|
|
24
|
+
this.deleteAllSpacesOfOrganization = (orgName) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}`));
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Removes the user from all spaces of an organization.
|
|
29
|
+
*
|
|
30
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
31
|
+
* @param orgName Name of the organization
|
|
32
|
+
* @param userId ID of the user
|
|
33
|
+
*/
|
|
34
|
+
this.removeUserFromAllSpacesOfOrganization = (orgName, userId) => __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/user/${userId}`));
|
|
36
|
+
});
|
|
37
|
+
this.cronjob = new cronjob_1.FuseCronjobInternal(this.options, this.axios);
|
|
38
|
+
}
|
|
39
|
+
getEndpoint(endpoint) {
|
|
40
|
+
return `${this.options.server}/api/fuse/internal${endpoint}`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.FuseSpaceInternal = FuseSpaceInternal;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import Base, { Options } from "../../../../Base";
|
|
3
|
+
import { Cronjob, CronjobCreate } from "../../../../interfaces/fuse/space/cronjob/Cronjob";
|
|
4
|
+
import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
|
|
5
|
+
import { FuseCronjobLogInternal } from "../../internal/space/cronjob/log";
|
|
6
|
+
import { FuseCronjobLog } from "./log";
|
|
7
|
+
export declare class FuseCronjob extends Base {
|
|
8
|
+
cronjobLog: FuseCronjobLog;
|
|
9
|
+
cronjobLogInternal: FuseCronjobLogInternal;
|
|
10
|
+
constructor(options: Options, axios: AxiosInstance);
|
|
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,175 @@
|
|
|
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(options, axios) {
|
|
20
|
+
super(options, axios);
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves a cronjob by it's ID.
|
|
23
|
+
* @param orgName Name of the organization
|
|
24
|
+
* @param spaceName Name of the Fuse space
|
|
25
|
+
* @param cronjobId ID of the cronjob
|
|
26
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
27
|
+
* @returns The requested cronjob
|
|
28
|
+
*/
|
|
29
|
+
this.getCronjob = (orgName_1, spaceName_1, cronjobId_1, ...args_1) => __awaiter(this, [orgName_1, spaceName_1, cronjobId_1, ...args_1], void 0, function* (orgName, spaceName, cronjobId, exposeNextExecution = false) {
|
|
30
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}?nextExecution=${exposeNextExecution}`));
|
|
31
|
+
return resp.data;
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves the next n cronjob executions as Unix timestamps (in milliseconds).
|
|
35
|
+
* @param orgName Name of the organization
|
|
36
|
+
* @param spaceName Name of the space
|
|
37
|
+
* @param cronjobId ID of the cronjob
|
|
38
|
+
* @returns Array of Unix timestamps
|
|
39
|
+
*/
|
|
40
|
+
this.getNextCronjobExecutions = (orgName, spaceName, cronjobId) => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/next`));
|
|
42
|
+
return resp.data;
|
|
43
|
+
});
|
|
44
|
+
/**
|
|
45
|
+
* Creates a new cronjob in the specified Fuse space.
|
|
46
|
+
* @param orgName Name of the organisation
|
|
47
|
+
* @param spaceName Name of the Fuse space
|
|
48
|
+
* @param createCronjob Cronjob to be created
|
|
49
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
50
|
+
* @returns Created cronjob
|
|
51
|
+
*/
|
|
52
|
+
this.createCronjob = (orgName_1, spaceName_1, createCronjob_1, ...args_1) => __awaiter(this, [orgName_1, spaceName_1, createCronjob_1, ...args_1], void 0, function* (orgName, spaceName, createCronjob, exposeNextExecution = false) {
|
|
53
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs?nextExecution=${exposeNextExecution}`), createCronjob);
|
|
54
|
+
return resp.data;
|
|
55
|
+
});
|
|
56
|
+
/**
|
|
57
|
+
* Updates an existing cronjob.
|
|
58
|
+
* @param orgName Name of the organization
|
|
59
|
+
* @param spaceName Name of the space
|
|
60
|
+
* @param cronjobId ID of the cronjob
|
|
61
|
+
* @param createCronjob Cronjob to be updated
|
|
62
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
63
|
+
* @returns Updated cronjob
|
|
64
|
+
*/
|
|
65
|
+
this.updateCronjob = (orgName_1, spaceName_1, cronjobId_1, createCronjob_1, ...args_1) => __awaiter(this, [orgName_1, spaceName_1, cronjobId_1, createCronjob_1, ...args_1], void 0, function* (orgName, spaceName, cronjobId, createCronjob, exposeNextExecution = false) {
|
|
66
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}?nextExecution=${exposeNextExecution}`), createCronjob);
|
|
67
|
+
return resp.data;
|
|
68
|
+
});
|
|
69
|
+
/**
|
|
70
|
+
* Change the cron expression of an existing cronjob
|
|
71
|
+
* @param orgName Name of the organization
|
|
72
|
+
* @param spaceName Name of the space
|
|
73
|
+
* @param cronjobId ID of the cronjob
|
|
74
|
+
* @param expression New cron expression
|
|
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
|
+
this.patchCronjobExpression = (orgName_1, spaceName_1, cronjobId_1, expression_1, ...args_1) => __awaiter(this, [orgName_1, spaceName_1, cronjobId_1, expression_1, ...args_1], void 0, function* (orgName, spaceName, cronjobId, expression, exposeNextExecution = false) {
|
|
79
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/expression?nextExecution=${exposeNextExecution}`), { expression: expression });
|
|
80
|
+
return resp.data;
|
|
81
|
+
});
|
|
82
|
+
/**
|
|
83
|
+
* Change the enabled flag of an existing cronjob
|
|
84
|
+
* @param orgName Name of the organization
|
|
85
|
+
* @param spaceName Name of the space
|
|
86
|
+
* @param cronjobId ID of the cronjob
|
|
87
|
+
* @param enabled Boolean flag to set
|
|
88
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
89
|
+
* @returns The patched cronjob
|
|
90
|
+
*/
|
|
91
|
+
this.patchCronjobEnabled = (orgName_1, spaceName_1, cronjobId_1, enabled_1, ...args_1) => __awaiter(this, [orgName_1, spaceName_1, cronjobId_1, enabled_1, ...args_1], void 0, function* (orgName, spaceName, cronjobId, enabled, exposeNextExecution = false) {
|
|
92
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/enabled?nextExecution=${exposeNextExecution}`), { enabled });
|
|
93
|
+
return resp.data;
|
|
94
|
+
});
|
|
95
|
+
/**
|
|
96
|
+
* Enable a cronjob.
|
|
97
|
+
*
|
|
98
|
+
* This is a wrapper around patchCronjobEnabled.
|
|
99
|
+
*
|
|
100
|
+
* @param orgName Name of the organization
|
|
101
|
+
* @param spaceName Name of the space
|
|
102
|
+
* @param cronjobId ID of the cronjob
|
|
103
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
104
|
+
* @returns The patched cronjob
|
|
105
|
+
*/
|
|
106
|
+
this.enableCronjob = (orgName, spaceName, cronjobId, exposeNextExecution = false) => {
|
|
107
|
+
return this.patchCronjobEnabled(orgName, spaceName, cronjobId, true, exposeNextExecution);
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Disable a cronjob.
|
|
111
|
+
*
|
|
112
|
+
* This is a wrapper around patchCronjobEnabled.
|
|
113
|
+
*
|
|
114
|
+
* @param orgName Name of the organization
|
|
115
|
+
* @param spaceName Name of the space
|
|
116
|
+
* @param cronjobId ID of the cronjob
|
|
117
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
118
|
+
* @returns The patched cronjob
|
|
119
|
+
*/
|
|
120
|
+
this.disableCronjob = (orgName, spaceName, cronjobId, exposeNextExecution = false) => {
|
|
121
|
+
return this.patchCronjobEnabled(orgName, spaceName, cronjobId, false, exposeNextExecution);
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Deletes a cronjob by its ID
|
|
125
|
+
* @param orgName Name of the organization
|
|
126
|
+
* @param spaceName Name of the space
|
|
127
|
+
* @param cronjobId ID of the cronjob
|
|
128
|
+
*/
|
|
129
|
+
this.deleteCronjob = (orgName, spaceName, cronjobId) => __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}`));
|
|
131
|
+
});
|
|
132
|
+
/**
|
|
133
|
+
* Retrieves all cronjobs of a Fuse space which match the provided search filter(s). Will return all cronjobs if no filter is provided.
|
|
134
|
+
* @param orgName Name of the organization
|
|
135
|
+
* @param spaceName Name of the space
|
|
136
|
+
* @param filters (optional) Array of search filters
|
|
137
|
+
* @param sorting (optional) Sorting object
|
|
138
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
139
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
140
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the returned cronjob objects
|
|
141
|
+
* @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)
|
|
142
|
+
*/
|
|
143
|
+
this.searchCronjobs = (_a) => __awaiter(this, [_a], void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, exposeNextExecution = false, }) {
|
|
144
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
145
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
146
|
+
});
|
|
147
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/search?limit=${limit}&page=${page}&nextExecution=${exposeNextExecution}`), {
|
|
148
|
+
filters: filtersDTO,
|
|
149
|
+
sorting,
|
|
150
|
+
});
|
|
151
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
152
|
+
});
|
|
153
|
+
/**
|
|
154
|
+
* Resolve a cron pattern along with a timezone to get the next executions in mili-seconds.
|
|
155
|
+
* @param expression The cron expression
|
|
156
|
+
* @param timezone The target IANA timezone
|
|
157
|
+
* @param amount The amount of returned execution-dates (limited between 1 and 10, default is 3)
|
|
158
|
+
* @returns Array of Unix timestamps
|
|
159
|
+
*/
|
|
160
|
+
this.resolveCronPatternWithTimezone = (expression_1, timezone_1, ...args_1) => __awaiter(this, [expression_1, timezone_1, ...args_1], void 0, function* (expression, timezone, amount = 3) {
|
|
161
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/cron/resolve`), {
|
|
162
|
+
expression: expression,
|
|
163
|
+
timezone: timezone,
|
|
164
|
+
amount: amount,
|
|
165
|
+
});
|
|
166
|
+
return resp.data;
|
|
167
|
+
});
|
|
168
|
+
this.cronjobLog = new log_2.FuseCronjobLog(this.options, this.axios);
|
|
169
|
+
this.cronjobLogInternal = new log_1.FuseCronjobLogInternal(this.options, this.axios);
|
|
170
|
+
}
|
|
171
|
+
getEndpoint(endpoint) {
|
|
172
|
+
return `${this.options.server}/api/fuse${endpoint}`;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
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,57 @@
|
|
|
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
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves all cronjobs of a Fuse space which match the provided search filter(s). Will return all cronjobs if no filter is provided.
|
|
21
|
+
* @param orgName Name of the organization
|
|
22
|
+
* @param spaceName Name of the space
|
|
23
|
+
* @param cronjobId ID of the cronjob
|
|
24
|
+
* @param filters (optional) Array of search filters
|
|
25
|
+
* @param sorting (optional) Sorting object
|
|
26
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
27
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
28
|
+
* @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)
|
|
29
|
+
*/
|
|
30
|
+
this.searchCronjobLogs = (_a) => __awaiter(this, [_a], void 0, function* ({ orgName, spaceName, cronjobId, filters, sorting, limit = 25, page = 0, }) {
|
|
31
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
32
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
33
|
+
});
|
|
34
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/logs/search?page=${page}&limit=${limit}`), {
|
|
35
|
+
filters: filtersDTO,
|
|
36
|
+
sorting,
|
|
37
|
+
});
|
|
38
|
+
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
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
|
+
this.getCronjobLog = (orgName, spaceName, cronjobId, cronjobLogId) => __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${cronjobId}/logs/${cronjobLogId}`));
|
|
50
|
+
return resp.data;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
getEndpoint(endpoint) {
|
|
54
|
+
return `${this.options.server}/api/fuse${endpoint}`;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.FuseCronjobLog = FuseCronjobLog;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import Base, { Options } from "../../../Base";
|
|
3
|
+
import { FuseSpace as IFuseSpace, FuseSpaceEntityPermission as SpaceEntityPermission, FuseSpacePermission as SpacePermission } from "../../../interfaces/fuse/space";
|
|
4
|
+
import { PaginatedResponse, SearchParams } from "../../../interfaces/global";
|
|
5
|
+
import { FuseCronjob } from "./cronjob";
|
|
6
|
+
export declare class FuseSpace extends Base {
|
|
7
|
+
cronjob: FuseCronjob;
|
|
8
|
+
constructor(options: Options, axios: AxiosInstance);
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves a Fuse space by its name
|
|
11
|
+
* @param orgName Name of the organization
|
|
12
|
+
* @param spaceName Name of the space
|
|
13
|
+
* @returns The requested space
|
|
14
|
+
*/
|
|
15
|
+
getSpace: (orgName: string, spaceName: string) => Promise<IFuseSpace>;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new Fuse space
|
|
18
|
+
* @param orgName Name of the organization
|
|
19
|
+
* @param name Name of the space to be created
|
|
20
|
+
* @returns The created space
|
|
21
|
+
*/
|
|
22
|
+
createSpace: (orgName: string, name: string) => Promise<IFuseSpace>;
|
|
23
|
+
/**
|
|
24
|
+
* Deletes a space by its name
|
|
25
|
+
* @param orgName Name of the organization
|
|
26
|
+
* @param spaceName Name of the space
|
|
27
|
+
*/
|
|
28
|
+
deleteSpace: (orgName: string, spaceName: string) => Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Adds/Updates/Removes the permission a user has in the specified space.
|
|
31
|
+
* @param orgName Name of the organization
|
|
32
|
+
* @param spaceName Name of the space
|
|
33
|
+
* @param userId ID of the user
|
|
34
|
+
* @param permission New permission
|
|
35
|
+
* @returns The Fuse space with the updated permissions
|
|
36
|
+
*/
|
|
37
|
+
updateUserSpacePermission: (orgName: string, spaceName: string, userId: string, permission: SpacePermission) => Promise<SpaceEntityPermission>;
|
|
38
|
+
/**
|
|
39
|
+
* Adds/Updates/Removes the permission a team has in the specified space. Note: A team cannot be an owner of a Space.
|
|
40
|
+
* @param orgName Name of the organization
|
|
41
|
+
* @param spaceName Name of the space
|
|
42
|
+
* @param teamName Name of the team
|
|
43
|
+
* @param permission New permission
|
|
44
|
+
* @returns The Fuse space with the updated permissions
|
|
45
|
+
*/
|
|
46
|
+
updateTeamSpacePermission: (orgName: string, spaceName: string, teamName: string, permission: SpacePermission) => Promise<SpaceEntityPermission>;
|
|
47
|
+
/**
|
|
48
|
+
* Retrieves all Fuse spaces of an organization which match the provided search filter(s). Will return all spaces of the organization if no filter is provided.
|
|
49
|
+
* @param orgName Name of the organization
|
|
50
|
+
* @param filters (optional) Array of search filters
|
|
51
|
+
* @param sorting (optional) Sorting object
|
|
52
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
53
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
54
|
+
* @returns Object containing an array of filtered Fuse spaces as well as the total number of results found in the database (independent of limit and page)
|
|
55
|
+
*/
|
|
56
|
+
searchSpaces: ({ orgName, filters, sorting, limit, page, }: SearchParams & {
|
|
57
|
+
orgName: string;
|
|
58
|
+
}) => Promise<PaginatedResponse<IFuseSpace>>;
|
|
59
|
+
/**
|
|
60
|
+
* Retrieves permissions of a space matching the search filter(s). Will return all permissions of the space if no search filter is provided.
|
|
61
|
+
* @param orgName Name of the organization
|
|
62
|
+
* @param spaceName Name of the space
|
|
63
|
+
* @param filters (optional) Array of search filters
|
|
64
|
+
* @param sorting (optional) Sorting object
|
|
65
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
66
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
67
|
+
* @returns Object containing an array of High5 Space Permissions and the total number of results found in the database (independent of limit and page)
|
|
68
|
+
*/
|
|
69
|
+
searchSpacePermissions: ({ orgName, spaceName, filters, sorting, limit, page, }: SearchParams & {
|
|
70
|
+
orgName: string;
|
|
71
|
+
spaceName: string;
|
|
72
|
+
}) => Promise<PaginatedResponse<SpaceEntityPermission>>;
|
|
73
|
+
/**
|
|
74
|
+
* Updates the name of a space.
|
|
75
|
+
* @param orgName Name of the organization
|
|
76
|
+
* @param spaceName Current name of the space
|
|
77
|
+
* @param newSpaceName New name for the space
|
|
78
|
+
* @returns The updated space
|
|
79
|
+
*/
|
|
80
|
+
renameSpace: (orgName: string, spaceName: string, newSpaceName: string) => Promise<IFuseSpace>;
|
|
81
|
+
protected getEndpoint(endpoint: string): string;
|
|
82
|
+
}
|