hcloud-sdk 17.0.0 → 18.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/changelog.md +176 -76
- package/lib/Base.d.ts +2 -1
- package/lib/Hcloud.d.ts +6 -3
- package/lib/Hcloud.js +16 -5
- package/lib/helper/ValidationHelper.d.ts +10 -2
- package/lib/helper/ValidationHelper.js +55 -7
- package/lib/interfaces/auditor/index.d.ts +13 -2
- package/lib/interfaces/auditor/index.js +9 -1
- package/lib/interfaces/cosmo/asset/index.d.ts +185 -0
- package/lib/interfaces/cosmo/asset/index.js +82 -0
- package/lib/interfaces/cosmo/comment/index.d.ts +38 -0
- package/lib/interfaces/cosmo/comment/index.js +8 -0
- package/lib/interfaces/cosmo/event/index.d.ts +31 -0
- package/lib/interfaces/cosmo/event/index.js +17 -0
- package/lib/interfaces/cosmo/location/index.d.ts +4 -0
- package/lib/interfaces/cosmo/namespace/index.d.ts +9 -0
- package/lib/interfaces/cosmo/namespace/index.js +9 -0
- package/lib/interfaces/cosmo/permissions.d.ts +96 -0
- package/lib/interfaces/cosmo/permissions.js +58 -0
- package/lib/interfaces/cosmo/share/index.d.ts +28 -0
- package/lib/interfaces/cosmo/share/index.js +2 -0
- package/lib/interfaces/cosmo/space/index.d.ts +25 -0
- package/lib/interfaces/cosmo/space/index.js +2 -0
- package/lib/interfaces/cosmo/tag/tag.d.ts +12 -0
- package/lib/interfaces/cosmo/tag/tag.js +2 -0
- package/lib/interfaces/global/Products.d.ts +2 -2
- package/lib/interfaces/global/Products.js +1 -1
- package/lib/interfaces/high5/index.d.ts +7 -7
- package/lib/interfaces/high5/index.js +7 -7
- package/lib/interfaces/{friday → high5}/space/database/document/index.d.ts +1 -1
- package/lib/interfaces/{friday → high5}/space/database/document/index.js +2 -1
- package/lib/interfaces/high5/space/database/index.js +2 -0
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +9 -2
- package/lib/interfaces/high5/space/execution/index.d.ts +2 -1
- package/lib/interfaces/high5/space/job/JobLog.d.ts +16 -0
- package/lib/interfaces/high5/space/job/JobLog.js +2 -0
- package/lib/interfaces/high5/space/job/index.d.ts +38 -0
- package/lib/interfaces/high5/space/job/index.js +8 -0
- package/lib/interfaces/high5/stats.d.ts +21 -0
- package/lib/interfaces/high5/stats.js +2 -0
- package/lib/interfaces/idp/oauth/index.d.ts +4 -3
- package/lib/interfaces/idp/organization/index.d.ts +1 -0
- package/lib/interfaces/idp/organization/index.js +1 -0
- package/lib/interfaces/idp/organization/license/index.d.ts +13 -11
- package/lib/interfaces/idp/organization/member/index.d.ts +1 -0
- package/lib/interfaces/idp/organization/stats.d.ts +7 -0
- package/lib/interfaces/idp/organization/stats.js +2 -0
- package/lib/interfaces/idp/organization/team/index.d.ts +0 -1
- package/lib/interfaces/idp/user/Message.d.ts +21 -0
- package/lib/interfaces/idp/user/Message.js +14 -0
- package/lib/interfaces/idp/user/NotificationSettings.d.ts +1 -0
- package/lib/interfaces/idp/user/Scopes.d.ts +1 -7
- package/lib/interfaces/idp/user/Scopes.js +0 -9
- package/lib/interfaces/idp/user/index.d.ts +2 -1
- package/lib/interfaces/mailer/index.d.ts +30 -1
- package/lib/interfaces/mailer/index.js +87 -1
- package/lib/interfaces/mothership/index.d.ts +3 -1
- package/lib/interfaces/mothership/index.js +15 -0
- package/lib/interfaces/mothership/stats.d.ts +4 -0
- package/lib/interfaces/mothership/stats.js +2 -0
- package/lib/interfaces/nats/index.d.ts +54 -24
- package/lib/interfaces/nats/index.js +87 -58
- package/lib/interfaces/shorts/index.d.ts +10 -0
- package/lib/interfaces/shorts/index.js +2 -0
- package/lib/service/agent/bundle/dev/index.d.ts +16 -6
- package/lib/service/agent/bundle/dev/index.js +12 -10
- package/lib/service/agent/bundle/index.d.ts +10 -4
- package/lib/service/agent/bundle/index.js +6 -6
- package/lib/service/agent/context/index.d.ts +22 -8
- package/lib/service/agent/context/index.js +15 -14
- package/lib/service/auditor/index.d.ts +8 -4
- package/lib/service/auditor/index.js +5 -5
- package/lib/service/auditor/internal/index.d.ts +27 -3
- package/lib/service/auditor/internal/index.js +34 -5
- package/lib/service/bouncer/features/index.d.ts +4 -2
- package/lib/service/bouncer/features/index.js +2 -2
- package/lib/service/cosmo/asset/index.d.ts +219 -0
- package/lib/service/cosmo/asset/index.js +314 -0
- package/lib/service/cosmo/comment/index.d.ts +122 -0
- package/lib/service/cosmo/comment/index.js +161 -0
- package/lib/service/cosmo/event/index.d.ts +23 -0
- package/lib/service/cosmo/event/index.js +40 -0
- package/lib/service/cosmo/folder/index.d.ts +27 -0
- package/lib/service/cosmo/folder/index.js +47 -0
- package/lib/service/cosmo/index.d.ts +49 -0
- package/lib/service/cosmo/index.js +119 -0
- package/lib/service/cosmo/internal/index.d.ts +7 -0
- package/lib/service/cosmo/internal/index.js +17 -0
- package/lib/service/cosmo/internal/space/index.d.ts +15 -0
- package/lib/service/cosmo/internal/space/index.js +34 -0
- package/lib/service/cosmo/location/index.d.ts +40 -0
- package/lib/service/cosmo/location/index.js +63 -0
- package/lib/service/cosmo/namespace/index.d.ts +42 -0
- package/lib/service/cosmo/namespace/index.js +65 -0
- package/lib/service/cosmo/organization/index.d.ts +47 -0
- package/lib/service/cosmo/organization/index.js +64 -0
- package/lib/service/cosmo/permissions/index.d.ts +131 -0
- package/lib/service/cosmo/permissions/index.js +181 -0
- package/lib/service/cosmo/production/index.d.ts +26 -0
- package/lib/service/cosmo/production/index.js +45 -0
- package/lib/service/cosmo/share/index.d.ts +161 -0
- package/lib/service/cosmo/share/index.js +215 -0
- package/lib/service/cosmo/space/index.d.ts +104 -0
- package/lib/service/cosmo/space/index.js +146 -0
- package/lib/service/cosmo/tag/index.d.ts +67 -0
- package/lib/service/cosmo/tag/index.js +93 -0
- package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +10 -4
- package/lib/service/dali/avatar/DaliCosmoSpace.js +8 -7
- package/lib/service/dali/avatar/DaliFuseSpace.d.ts +10 -4
- package/lib/service/dali/avatar/DaliFuseSpace.js +7 -6
- package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +10 -4
- package/lib/service/dali/avatar/DaliHigh5Pool.js +7 -6
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +10 -4
- package/lib/service/dali/avatar/DaliHigh5Space.js +7 -6
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +10 -4
- package/lib/service/dali/avatar/DaliOAuthApp.js +7 -6
- package/lib/service/dali/avatar/DaliOrganization.d.ts +10 -4
- package/lib/service/dali/avatar/DaliOrganization.js +7 -6
- package/lib/service/dali/avatar/DaliServiceAccount.d.ts +10 -4
- package/lib/service/dali/avatar/DaliServiceAccount.js +7 -6
- package/lib/service/dali/avatar/DaliTeam.d.ts +10 -4
- package/lib/service/dali/avatar/DaliTeam.js +7 -6
- package/lib/service/dali/avatar/DaliUser.d.ts +10 -4
- package/lib/service/dali/avatar/DaliUser.js +7 -6
- package/lib/service/dali/index.d.ts +4 -5
- package/lib/service/dali/index.js +2 -5
- package/lib/service/fuse/index.d.ts +4 -2
- package/lib/service/fuse/index.js +2 -2
- package/lib/service/fuse/internal/index.d.ts +4 -2
- package/lib/service/fuse/internal/index.js +3 -2
- package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +4 -2
- package/lib/service/fuse/internal/space/cronjob/log/index.js +2 -2
- package/lib/service/fuse/internal/space/index.d.ts +7 -3
- package/lib/service/fuse/internal/space/index.js +6 -4
- package/lib/service/fuse/space/cronjob/index.d.ts +35 -13
- package/lib/service/fuse/space/cronjob/index.js +48 -50
- package/lib/service/fuse/space/cronjob/log/index.d.ts +8 -4
- package/lib/service/fuse/space/cronjob/log/index.js +5 -5
- package/lib/service/fuse/space/index.d.ts +27 -11
- package/lib/service/fuse/space/index.js +19 -18
- package/lib/service/high5/execution/index.d.ts +4 -2
- package/lib/service/high5/execution/index.js +3 -2
- package/lib/service/high5/execution/status/index.d.ts +5 -3
- package/lib/service/high5/execution/status/index.js +3 -3
- package/lib/service/high5/index.d.ts +7 -2
- package/lib/service/high5/index.js +9 -2
- package/lib/service/high5/internal/index.d.ts +4 -2
- package/lib/service/high5/internal/index.js +3 -2
- package/lib/service/high5/internal/space/index.d.ts +10 -3
- package/lib/service/high5/internal/space/index.js +13 -4
- package/lib/service/high5/internal/space/job/index.d.ts +7 -0
- package/lib/service/high5/internal/space/job/index.js +17 -0
- package/lib/service/high5/internal/space/job/log/index.d.ts +17 -0
- package/lib/service/high5/internal/space/job/log/index.js +34 -0
- package/lib/service/high5/joinToken/index.d.ts +14 -6
- package/lib/service/high5/joinToken/index.js +10 -9
- package/lib/service/high5/space/database/document/array/index.d.ts +73 -0
- package/lib/service/high5/space/database/document/array/index.js +102 -0
- package/lib/service/{friday → high5}/space/database/document/index.d.ts +26 -10
- package/lib/service/{friday → high5}/space/database/document/index.js +31 -16
- package/lib/service/high5/space/database/document/number/index.d.ts +51 -0
- package/lib/service/high5/space/database/document/number/index.js +77 -0
- package/lib/service/{friday → high5}/space/database/index.d.ts +22 -12
- package/lib/service/{friday → high5}/space/database/index.js +18 -17
- package/lib/service/high5/space/event/index.d.ts +17 -7
- package/lib/service/high5/space/event/index.js +12 -11
- package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +4 -2
- package/lib/service/high5/space/event/stream/design/DesignOperations.js +2 -2
- package/lib/service/high5/space/event/stream/design/index.d.ts +10 -4
- package/lib/service/high5/space/event/stream/design/index.js +7 -6
- package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +16 -6
- package/lib/service/high5/space/event/stream/design/snapshot/index.js +12 -10
- package/lib/service/high5/space/event/stream/index.d.ts +32 -12
- package/lib/service/high5/space/event/stream/index.js +22 -21
- package/lib/service/high5/space/execution/index.d.ts +19 -7
- package/lib/service/high5/space/execution/index.js +17 -12
- package/lib/service/high5/space/execution/log/index.d.ts +8 -4
- package/lib/service/high5/space/execution/log/index.js +5 -5
- package/lib/service/high5/space/execution/status/index.d.ts +7 -3
- package/lib/service/high5/space/execution/status/index.js +4 -4
- package/lib/service/high5/space/index.d.ts +43 -14
- package/lib/service/high5/space/index.js +45 -23
- package/lib/service/high5/space/job/index.d.ts +145 -0
- package/lib/service/high5/space/job/index.js +201 -0
- package/lib/service/high5/space/job/log/index.d.ts +35 -0
- package/lib/service/high5/space/job/log/index.js +58 -0
- package/lib/service/high5/space/node/index.d.ts +20 -8
- package/lib/service/high5/space/node/index.js +14 -13
- package/lib/service/high5/space/pool/index.d.ts +27 -11
- package/lib/service/high5/space/pool/index.js +19 -18
- package/lib/service/high5/space/secret/index.d.ts +17 -7
- package/lib/service/high5/space/secret/index.js +12 -11
- package/lib/service/high5/space/stat/index.d.ts +12 -0
- package/lib/service/high5/space/stat/index.js +31 -0
- package/lib/service/high5/space/wave/index.d.ts +16 -6
- package/lib/service/high5/space/wave/index.js +11 -10
- package/lib/service/high5/space/webhook/index.d.ts +32 -12
- package/lib/service/high5/space/webhook/index.js +25 -21
- package/lib/service/high5/space/webhook/log/index.d.ts +4 -2
- package/lib/service/high5/space/webhook/log/index.js +2 -2
- package/lib/service/high5/stat/index.d.ts +11 -0
- package/lib/service/high5/stat/index.js +30 -0
- package/lib/service/high5/wave/s3/index.d.ts +31 -8
- package/lib/service/high5/wave/s3/index.js +42 -21
- package/lib/service/idp/guest/index.d.ts +42 -0
- package/lib/service/idp/guest/index.js +66 -0
- package/lib/service/idp/index.d.ts +25 -7
- package/lib/service/idp/index.js +23 -12
- package/lib/service/idp/internal/index.d.ts +5 -3
- package/lib/service/idp/internal/index.js +5 -3
- package/lib/service/idp/oauth/index.d.ts +16 -6
- package/lib/service/idp/oauth/index.js +15 -15
- package/lib/service/idp/organization/index.d.ts +19 -5
- package/lib/service/idp/organization/index.js +19 -8
- package/lib/service/idp/organization/license/index.d.ts +7 -3
- package/lib/service/idp/organization/license/index.js +4 -4
- package/lib/service/idp/organization/member/index.d.ts +20 -8
- package/lib/service/idp/organization/member/index.js +15 -13
- package/lib/service/idp/organization/member/invitations/index.d.ts +23 -9
- package/lib/service/idp/organization/member/invitations/index.js +72 -59
- package/lib/service/idp/organization/service-accounts/index.d.ts +20 -8
- package/lib/service/idp/organization/service-accounts/index.js +13 -12
- package/lib/service/idp/organization/settings/domain/index.d.ts +13 -5
- package/lib/service/idp/organization/settings/domain/index.js +9 -8
- package/lib/service/idp/organization/settings/domain/saml/index.d.ts +16 -6
- package/lib/service/idp/organization/settings/domain/saml/index.js +19 -18
- package/lib/service/idp/organization/settings/oauth/index.d.ts +23 -9
- package/lib/service/idp/organization/settings/oauth/index.js +16 -15
- package/lib/service/idp/organization/stat/index.d.ts +11 -0
- package/lib/service/idp/organization/stat/index.js +30 -0
- package/lib/service/idp/organization/team/index.d.ts +22 -10
- package/lib/service/idp/organization/team/index.js +14 -13
- package/lib/service/idp/registration/index.d.ts +10 -4
- package/lib/service/idp/registration/index.js +15 -9
- package/lib/service/idp/user/index.d.ts +33 -11
- package/lib/service/idp/user/index.js +29 -16
- package/lib/service/idp/user/license/index.d.ts +7 -3
- package/lib/service/idp/user/license/index.js +4 -4
- package/lib/service/idp/user/message/index.d.ts +61 -0
- package/lib/service/idp/user/message/index.js +92 -0
- package/lib/service/idp/user/password/index.d.ts +4 -2
- package/lib/service/idp/user/password/index.js +2 -2
- package/lib/service/idp/user/settings/connections/index.d.ts +4 -2
- package/lib/service/idp/user/settings/connections/index.js +2 -2
- package/lib/service/idp/user/settings/general/index.d.ts +10 -4
- package/lib/service/idp/user/settings/general/index.js +6 -6
- package/lib/service/idp/user/settings/notifications/index.d.ts +7 -3
- package/lib/service/idp/user/settings/notifications/index.js +4 -4
- package/lib/service/idp/user/settings/oauthApps/index.d.ts +7 -3
- package/lib/service/idp/user/settings/oauthApps/index.js +6 -5
- package/lib/service/idp/user/settings/pats/index.d.ts +22 -8
- package/lib/service/idp/user/settings/pats/index.js +17 -15
- package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +16 -6
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +13 -10
- package/lib/service/mailer/index.d.ts +4 -2
- package/lib/service/mailer/index.js +2 -2
- package/lib/service/mailer/internal/index.d.ts +13 -5
- package/lib/service/mailer/internal/index.js +8 -8
- package/lib/service/mothership/index.d.ts +35 -13
- package/lib/service/mothership/index.js +32 -17
- package/lib/service/nats/index.js +58 -43
- package/lib/service/shorts/index.d.ts +18 -0
- package/lib/service/{friday → shorts}/index.js +13 -10
- package/lib/service/shorts/internal/index.d.ts +72 -0
- package/lib/service/shorts/internal/index.js +104 -0
- package/package.json +1 -1
- package/lib/interfaces/friday/index.d.ts +0 -3
- package/lib/interfaces/friday/index.js +0 -19
- package/lib/interfaces/friday/space/index.d.ts +0 -21
- package/lib/interfaces/friday/space/index.js +0 -11
- package/lib/service/friday/index.d.ts +0 -13
- package/lib/service/friday/space/index.d.ts +0 -81
- package/lib/service/friday/space/index.js +0 -150
- /package/lib/interfaces/{friday/space/database → cosmo/location}/index.js +0 -0
- /package/lib/interfaces/{friday → high5}/space/database/index.d.ts +0 -0
|
@@ -13,11 +13,14 @@ exports.High5Space = void 0;
|
|
|
13
13
|
const Base_1 = require("../../../Base");
|
|
14
14
|
const paginatedResponseHelper_1 = require("../../../helper/paginatedResponseHelper");
|
|
15
15
|
const searchFilter_1 = require("../../../helper/searchFilter");
|
|
16
|
+
const database_1 = require("./database");
|
|
16
17
|
const event_1 = require("./event");
|
|
17
18
|
const execution_1 = require("./execution");
|
|
19
|
+
const job_1 = require("./job");
|
|
18
20
|
const node_1 = require("./node");
|
|
19
21
|
const pool_1 = require("./pool");
|
|
20
22
|
const secret_1 = require("./secret");
|
|
23
|
+
const stat_1 = require("./stat");
|
|
21
24
|
const wave_1 = require("./wave");
|
|
22
25
|
const webhook_1 = require("./webhook");
|
|
23
26
|
class High5Space extends Base_1.default {
|
|
@@ -63,6 +66,24 @@ class High5Space extends Base_1.default {
|
|
|
63
66
|
}
|
|
64
67
|
return this._node;
|
|
65
68
|
}
|
|
69
|
+
get database() {
|
|
70
|
+
if (this._database === undefined) {
|
|
71
|
+
this._database = new database_1.High5Database(this.options, this.axios);
|
|
72
|
+
}
|
|
73
|
+
return this._database;
|
|
74
|
+
}
|
|
75
|
+
get job() {
|
|
76
|
+
if (this._job === undefined) {
|
|
77
|
+
this._job = new job_1.High5Job(this.options, this.axios);
|
|
78
|
+
}
|
|
79
|
+
return this._job;
|
|
80
|
+
}
|
|
81
|
+
get stat() {
|
|
82
|
+
if (this._stat === undefined) {
|
|
83
|
+
this._stat = new stat_1.High5SpaceStat(this.options, this.axios);
|
|
84
|
+
}
|
|
85
|
+
return this._stat;
|
|
86
|
+
}
|
|
66
87
|
/**
|
|
67
88
|
* Retrieves all High5 Spaces of the specified Organization matching the search filter(s). Will return all Spaces if no search filter is provided.
|
|
68
89
|
* @param orgName Name of the organization
|
|
@@ -72,14 +93,14 @@ class High5Space extends Base_1.default {
|
|
|
72
93
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
73
94
|
* @returns Object containing an array of High5 Spaces and the total number of results found in the database (independent of limit and page)
|
|
74
95
|
*/
|
|
75
|
-
searchSpaces(_a) {
|
|
76
|
-
return __awaiter(this, arguments, void 0, function* ({ orgName, filters, sorting, limit = 25, page = 0 }) {
|
|
96
|
+
searchSpaces(_a, raw_1) {
|
|
97
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, filters, sorting, limit = 25, page = 0 }, raw) {
|
|
77
98
|
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
|
|
78
99
|
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/search?page=${page}&limit=${limit}`), {
|
|
79
100
|
filters: filtersDTO,
|
|
80
101
|
sorting: sorting,
|
|
81
102
|
});
|
|
82
|
-
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
103
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
|
|
83
104
|
});
|
|
84
105
|
}
|
|
85
106
|
/**
|
|
@@ -92,14 +113,14 @@ class High5Space extends Base_1.default {
|
|
|
92
113
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
93
114
|
* @returns Object containing an array of High5 Space Permissions and the total number of results found in the database (independent of limit and page)
|
|
94
115
|
*/
|
|
95
|
-
searchSpacePermissions(_a) {
|
|
96
|
-
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0,
|
|
116
|
+
searchSpacePermissions(_a, raw_1) {
|
|
117
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0 }, raw) {
|
|
97
118
|
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
|
|
98
119
|
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/permissions/search?page=${page}&limit=${limit}`), {
|
|
99
120
|
filters: filtersDTO,
|
|
100
121
|
sorting: sorting,
|
|
101
122
|
});
|
|
102
|
-
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
123
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
|
|
103
124
|
});
|
|
104
125
|
}
|
|
105
126
|
/**
|
|
@@ -108,10 +129,10 @@ class High5Space extends Base_1.default {
|
|
|
108
129
|
* @param spaceName Name of the space
|
|
109
130
|
* @returns The requested Space
|
|
110
131
|
*/
|
|
111
|
-
getSpace(orgName, spaceName) {
|
|
132
|
+
getSpace(orgName, spaceName, raw) {
|
|
112
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
113
134
|
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}`));
|
|
114
|
-
return resp.data;
|
|
135
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
115
136
|
});
|
|
116
137
|
}
|
|
117
138
|
/**
|
|
@@ -121,10 +142,10 @@ class High5Space extends Base_1.default {
|
|
|
121
142
|
* @param enableDev (optional) Specifies to the front-end whether to display the versions in the development of Wave Engines and Node Catalogs
|
|
122
143
|
* @returns The created Space
|
|
123
144
|
*/
|
|
124
|
-
createSpace(orgName, name, enableDev) {
|
|
145
|
+
createSpace(orgName, name, enableDev, raw) {
|
|
125
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
126
147
|
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces`), { name, enableDev: Boolean(enableDev) });
|
|
127
|
-
return resp.data;
|
|
148
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
128
149
|
});
|
|
129
150
|
}
|
|
130
151
|
/**
|
|
@@ -132,9 +153,10 @@ class High5Space extends Base_1.default {
|
|
|
132
153
|
* @param orgName Name of the Organization
|
|
133
154
|
* @param spaceName Name of the Space
|
|
134
155
|
*/
|
|
135
|
-
deleteSpace(orgName, spaceName) {
|
|
156
|
+
deleteSpace(orgName, spaceName, raw) {
|
|
136
157
|
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
-
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}`));
|
|
158
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}`));
|
|
159
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
138
160
|
});
|
|
139
161
|
}
|
|
140
162
|
/**
|
|
@@ -145,13 +167,13 @@ class High5Space extends Base_1.default {
|
|
|
145
167
|
* @param permission New permission
|
|
146
168
|
* @returns The Space with updated permissions
|
|
147
169
|
*/
|
|
148
|
-
updateUserSpacePermission(orgName, spaceName, userId, permission) {
|
|
170
|
+
updateUserSpacePermission(orgName, spaceName, userId, permission, raw) {
|
|
149
171
|
return __awaiter(this, void 0, void 0, function* () {
|
|
150
172
|
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/permissions/user`), {
|
|
151
173
|
userId,
|
|
152
174
|
permission,
|
|
153
175
|
});
|
|
154
|
-
return resp.data;
|
|
176
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
155
177
|
});
|
|
156
178
|
}
|
|
157
179
|
/**
|
|
@@ -162,13 +184,13 @@ class High5Space extends Base_1.default {
|
|
|
162
184
|
* @param permission New permission
|
|
163
185
|
* @returns The Space with updated permissions
|
|
164
186
|
*/
|
|
165
|
-
updateTeamSpacePermission(orgName, spaceName, teamName, permission) {
|
|
187
|
+
updateTeamSpacePermission(orgName, spaceName, teamName, permission, raw) {
|
|
166
188
|
return __awaiter(this, void 0, void 0, function* () {
|
|
167
189
|
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/permissions/team`), {
|
|
168
190
|
teamName,
|
|
169
191
|
permission,
|
|
170
192
|
});
|
|
171
|
-
return resp.data;
|
|
193
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
172
194
|
});
|
|
173
195
|
}
|
|
174
196
|
/**
|
|
@@ -181,14 +203,14 @@ class High5Space extends Base_1.default {
|
|
|
181
203
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
182
204
|
* @returns Object containing an array of streams and the total number of results found in the database (independent of limit and page)
|
|
183
205
|
*/
|
|
184
|
-
searchStreamsOfSpace(_a) {
|
|
185
|
-
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0,
|
|
206
|
+
searchStreamsOfSpace(_a, raw_1) {
|
|
207
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0 }, raw) {
|
|
186
208
|
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
|
|
187
209
|
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/streams/search?page=${page}&limit=${limit}`), {
|
|
188
210
|
filters: filtersDTO,
|
|
189
211
|
sorting: sorting,
|
|
190
212
|
});
|
|
191
|
-
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
213
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
|
|
192
214
|
});
|
|
193
215
|
}
|
|
194
216
|
/**
|
|
@@ -198,12 +220,12 @@ class High5Space extends Base_1.default {
|
|
|
198
220
|
* @param newSpaceName New name for the space
|
|
199
221
|
* @returns The updated space
|
|
200
222
|
*/
|
|
201
|
-
renameSpace(orgName, spaceName, newSpaceName) {
|
|
223
|
+
renameSpace(orgName, spaceName, newSpaceName, raw) {
|
|
202
224
|
return __awaiter(this, void 0, void 0, function* () {
|
|
203
225
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/name`), {
|
|
204
226
|
newSpaceName,
|
|
205
227
|
});
|
|
206
|
-
return resp.data;
|
|
228
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
207
229
|
});
|
|
208
230
|
}
|
|
209
231
|
/**
|
|
@@ -213,12 +235,12 @@ class High5Space extends Base_1.default {
|
|
|
213
235
|
* @param enableDev Specifies to the front-end whether to display the versions under development of Wave Engines and Node Catalogs
|
|
214
236
|
* @returns The updated space
|
|
215
237
|
*/
|
|
216
|
-
enableDev(orgName, spaceName, enableDev) {
|
|
238
|
+
enableDev(orgName, spaceName, enableDev, raw) {
|
|
217
239
|
return __awaiter(this, void 0, void 0, function* () {
|
|
218
240
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/dev`), {
|
|
219
241
|
enableDev,
|
|
220
242
|
});
|
|
221
|
-
return resp.data;
|
|
243
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
222
244
|
});
|
|
223
245
|
}
|
|
224
246
|
getEndpoint(endpoint) {
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../Base";
|
|
2
|
+
import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
|
|
3
|
+
import { Job, JobCreate } from "../../../../interfaces/high5/space/job";
|
|
4
|
+
import { High5JobLogInternal } from "../../internal/space/job/log";
|
|
5
|
+
import { High5JobLog } from "./log";
|
|
6
|
+
export declare class High5Job extends Base {
|
|
7
|
+
get jobLog(): High5JobLog;
|
|
8
|
+
private _jobLog?;
|
|
9
|
+
get jobLogInternal(): High5JobLogInternal;
|
|
10
|
+
private _jobLogInternal?;
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves a cronjob by it's ID.
|
|
13
|
+
* @param orgName Name of the organization
|
|
14
|
+
* @param spaceName Name of the High5 space
|
|
15
|
+
* @param jobId 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
|
+
getJob<R extends boolean = false>(orgName: string, spaceName: string, jobId: string, exposeNextExecution?: boolean, raw?: {
|
|
20
|
+
raw: R;
|
|
21
|
+
}): Promise<MaybeRaw<R, Job>>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves the next n cronjob executions as Unix timestamps (in milliseconds).
|
|
24
|
+
* @param orgName Name of the organization
|
|
25
|
+
* @param spaceName Name of the space
|
|
26
|
+
* @param jobId ID of the cronjob
|
|
27
|
+
* @returns Array of Unix timestamps
|
|
28
|
+
*/
|
|
29
|
+
getNextCronjobExecutions<R extends boolean = false>(orgName: string, spaceName: string, jobId: string, raw?: {
|
|
30
|
+
raw: R;
|
|
31
|
+
}): Promise<MaybeRaw<R, number[]>>;
|
|
32
|
+
/**
|
|
33
|
+
* Creates a new cronjob in the specified High5 space.
|
|
34
|
+
* @param orgName Name of the organisation
|
|
35
|
+
* @param spaceName Name of the High5 space
|
|
36
|
+
* @param createJob Cronjob to be created
|
|
37
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
38
|
+
* @returns Created cronjob
|
|
39
|
+
*/
|
|
40
|
+
createJob<R extends boolean = false>(orgName: string, spaceName: string, createJob: JobCreate, exposeNextExecution?: boolean, raw?: {
|
|
41
|
+
raw: R;
|
|
42
|
+
}): Promise<MaybeRaw<R, Job>>;
|
|
43
|
+
/**
|
|
44
|
+
* Updates an existing cronjob.
|
|
45
|
+
* @param orgName Name of the organization
|
|
46
|
+
* @param spaceName Name of the space
|
|
47
|
+
* @param jobId ID of the cronjob
|
|
48
|
+
* @param createJob Cronjob to be updated
|
|
49
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
50
|
+
* @returns Updated cronjob
|
|
51
|
+
*/
|
|
52
|
+
updateJob<R extends boolean = false>(orgName: string, spaceName: string, jobId: string, createJob: JobCreate, exposeNextExecution?: boolean, raw?: {
|
|
53
|
+
raw: R;
|
|
54
|
+
}): Promise<MaybeRaw<R, Job>>;
|
|
55
|
+
/**
|
|
56
|
+
* Change the cron expression of an existing cronjob
|
|
57
|
+
* @param orgName Name of the organization
|
|
58
|
+
* @param spaceName Name of the space
|
|
59
|
+
* @param jobId ID of the cronjob
|
|
60
|
+
* @param expression New cron expression
|
|
61
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
62
|
+
* @returns The patched cronjob
|
|
63
|
+
*/
|
|
64
|
+
patchCronjobExpression<R extends boolean = false>(orgName: string, spaceName: string, jobId: string, expression: string, exposeNextExecution?: boolean, raw?: {
|
|
65
|
+
raw: R;
|
|
66
|
+
}): Promise<MaybeRaw<R, Job>>;
|
|
67
|
+
/**
|
|
68
|
+
* Change the enabled flag of an existing cronjob
|
|
69
|
+
* @param orgName Name of the organization
|
|
70
|
+
* @param spaceName Name of the space
|
|
71
|
+
* @param jobId ID of the cronjob
|
|
72
|
+
* @param enabled Boolean flag to set
|
|
73
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
74
|
+
* @returns The patched cronjob
|
|
75
|
+
*/
|
|
76
|
+
patchCronjobEnabled<R extends boolean = false>(orgName: string, spaceName: string, jobId: string, enabled: boolean, exposeNextExecution?: boolean, raw?: {
|
|
77
|
+
raw: R;
|
|
78
|
+
}): Promise<MaybeRaw<R, Job>>;
|
|
79
|
+
/**
|
|
80
|
+
* Enable 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 jobId 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
|
+
enableCronjob<R extends boolean = false>(orgName: string, spaceName: string, jobId: string, exposeNextExecution?: boolean, raw?: {
|
|
91
|
+
raw: R;
|
|
92
|
+
}): Promise<MaybeRaw<R, Job>>;
|
|
93
|
+
/**
|
|
94
|
+
* Disable a cronjob.
|
|
95
|
+
*
|
|
96
|
+
* This is a wrapper around patchCronjobEnabled.
|
|
97
|
+
*
|
|
98
|
+
* @param orgName Name of the organization
|
|
99
|
+
* @param spaceName Name of the space
|
|
100
|
+
* @param jobId ID of the cronjob
|
|
101
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
102
|
+
* @returns The patched cronjob
|
|
103
|
+
*/
|
|
104
|
+
disableCronjob<R extends boolean = false>(orgName: string, spaceName: string, jobId: string, exposeNextExecution?: boolean, raw?: {
|
|
105
|
+
raw: R;
|
|
106
|
+
}): Promise<MaybeRaw<R, Job>>;
|
|
107
|
+
/**
|
|
108
|
+
* Deletes a cronjob by its ID
|
|
109
|
+
* @param orgName Name of the organization
|
|
110
|
+
* @param spaceName Name of the space
|
|
111
|
+
* @param jobId ID of the cronjob
|
|
112
|
+
*/
|
|
113
|
+
deleteJob<R extends boolean = false>(orgName: string, spaceName: string, jobId: string, raw?: {
|
|
114
|
+
raw: R;
|
|
115
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
116
|
+
/**
|
|
117
|
+
* Retrieves all cronjobs of a High5 space which match the provided search filter(s). Will return all cronjobs if no filter is provided.
|
|
118
|
+
* @param orgName Name of the organization
|
|
119
|
+
* @param spaceName Name of the space
|
|
120
|
+
* @param filters (optional) Array of search filters
|
|
121
|
+
* @param sorting (optional) Sorting object
|
|
122
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
123
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
124
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the returned cronjob objects
|
|
125
|
+
* @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)
|
|
126
|
+
*/
|
|
127
|
+
searchJobs<R extends boolean = false>({ orgName, spaceName, filters, sorting, limit, page, exposeNextExecution, }: SearchParams & {
|
|
128
|
+
orgName: string;
|
|
129
|
+
spaceName: string;
|
|
130
|
+
exposeNextExecution?: boolean;
|
|
131
|
+
}, raw?: {
|
|
132
|
+
raw: R;
|
|
133
|
+
}): Promise<MaybeRaw<R, PaginatedResponse<Job>>>;
|
|
134
|
+
/**
|
|
135
|
+
* Resolve a cron pattern along with a timezone to get the next executions in mili-seconds.
|
|
136
|
+
* @param expression The cron expression
|
|
137
|
+
* @param timezone The target IANA timezone
|
|
138
|
+
* @param amount The amount of returned execution-dates (limited between 1 and 10, default is 3)
|
|
139
|
+
* @returns Array of Unix timestamps
|
|
140
|
+
*/
|
|
141
|
+
resolveCronPatternWithTimezone<R extends boolean = false>(expression: string, timezone: string, amount?: number, raw?: {
|
|
142
|
+
raw: R;
|
|
143
|
+
}): Promise<MaybeRaw<R, number[]>>;
|
|
144
|
+
protected getEndpoint(endpoint: string): string;
|
|
145
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
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.High5Job = 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/job/log");
|
|
17
|
+
const log_2 = require("./log");
|
|
18
|
+
class High5Job extends Base_1.default {
|
|
19
|
+
get jobLog() {
|
|
20
|
+
if (this._jobLog === undefined) {
|
|
21
|
+
this._jobLog = new log_2.High5JobLog(this.options, this.axios);
|
|
22
|
+
}
|
|
23
|
+
return this._jobLog;
|
|
24
|
+
}
|
|
25
|
+
get jobLogInternal() {
|
|
26
|
+
if (this._jobLogInternal === undefined) {
|
|
27
|
+
this._jobLogInternal = new log_1.High5JobLogInternal(this.options, this.axios);
|
|
28
|
+
}
|
|
29
|
+
return this._jobLogInternal;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Retrieves a cronjob by it's ID.
|
|
33
|
+
* @param orgName Name of the organization
|
|
34
|
+
* @param spaceName Name of the High5 space
|
|
35
|
+
* @param jobId ID of the cronjob
|
|
36
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
37
|
+
* @returns The requested cronjob
|
|
38
|
+
*/
|
|
39
|
+
getJob(orgName_1, spaceName_1, jobId_1) {
|
|
40
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, jobId, exposeNextExecution = false, raw) {
|
|
41
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${jobId}?nextExecution=${exposeNextExecution}`));
|
|
42
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Retrieves the next n cronjob executions as Unix timestamps (in milliseconds).
|
|
47
|
+
* @param orgName Name of the organization
|
|
48
|
+
* @param spaceName Name of the space
|
|
49
|
+
* @param jobId ID of the cronjob
|
|
50
|
+
* @returns Array of Unix timestamps
|
|
51
|
+
*/
|
|
52
|
+
getNextCronjobExecutions(orgName, spaceName, jobId, raw) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${jobId}/next`));
|
|
55
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Creates a new cronjob in the specified High5 space.
|
|
60
|
+
* @param orgName Name of the organisation
|
|
61
|
+
* @param spaceName Name of the High5 space
|
|
62
|
+
* @param createJob Cronjob to be created
|
|
63
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
64
|
+
* @returns Created cronjob
|
|
65
|
+
*/
|
|
66
|
+
createJob(orgName_1, spaceName_1, createJob_1) {
|
|
67
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, createJob, exposeNextExecution = false, raw) {
|
|
68
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs?nextExecution=${exposeNextExecution}`), createJob);
|
|
69
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Updates an existing cronjob.
|
|
74
|
+
* @param orgName Name of the organization
|
|
75
|
+
* @param spaceName Name of the space
|
|
76
|
+
* @param jobId ID of the cronjob
|
|
77
|
+
* @param createJob Cronjob to be updated
|
|
78
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
79
|
+
* @returns Updated cronjob
|
|
80
|
+
*/
|
|
81
|
+
updateJob(orgName_1, spaceName_1, jobId_1, createJob_1) {
|
|
82
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, jobId, createJob, exposeNextExecution = false, raw) {
|
|
83
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${jobId}?nextExecution=${exposeNextExecution}`), createJob);
|
|
84
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Change the cron expression of an existing cronjob
|
|
89
|
+
* @param orgName Name of the organization
|
|
90
|
+
* @param spaceName Name of the space
|
|
91
|
+
* @param jobId ID of the cronjob
|
|
92
|
+
* @param expression New cron expression
|
|
93
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
94
|
+
* @returns The patched cronjob
|
|
95
|
+
*/
|
|
96
|
+
patchCronjobExpression(orgName_1, spaceName_1, jobId_1, expression_1) {
|
|
97
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, jobId, expression, exposeNextExecution = false, raw) {
|
|
98
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${jobId}/expression?nextExecution=${exposeNextExecution}`), { expression: expression });
|
|
99
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Change the enabled flag of an existing cronjob
|
|
104
|
+
* @param orgName Name of the organization
|
|
105
|
+
* @param spaceName Name of the space
|
|
106
|
+
* @param jobId ID of the cronjob
|
|
107
|
+
* @param enabled Boolean flag to set
|
|
108
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
109
|
+
* @returns The patched cronjob
|
|
110
|
+
*/
|
|
111
|
+
patchCronjobEnabled(orgName_1, spaceName_1, jobId_1, enabled_1) {
|
|
112
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, jobId, enabled, exposeNextExecution = false, raw) {
|
|
113
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${jobId}/enabled?nextExecution=${exposeNextExecution}`), { enabled });
|
|
114
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Enable a cronjob.
|
|
119
|
+
*
|
|
120
|
+
* This is a wrapper around patchCronjobEnabled.
|
|
121
|
+
*
|
|
122
|
+
* @param orgName Name of the organization
|
|
123
|
+
* @param spaceName Name of the space
|
|
124
|
+
* @param jobId ID of the cronjob
|
|
125
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the response object
|
|
126
|
+
* @returns The patched cronjob
|
|
127
|
+
*/
|
|
128
|
+
enableCronjob(orgName, spaceName, jobId, exposeNextExecution = false, raw) {
|
|
129
|
+
return this.patchCronjobEnabled(orgName, spaceName, jobId, true, exposeNextExecution, raw);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Disable a cronjob.
|
|
133
|
+
*
|
|
134
|
+
* This is a wrapper around patchCronjobEnabled.
|
|
135
|
+
*
|
|
136
|
+
* @param orgName Name of the organization
|
|
137
|
+
* @param spaceName Name of the space
|
|
138
|
+
* @param jobId ID of the cronjob
|
|
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
|
+
disableCronjob(orgName, spaceName, jobId, exposeNextExecution = false, raw) {
|
|
143
|
+
return this.patchCronjobEnabled(orgName, spaceName, jobId, false, exposeNextExecution, raw);
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Deletes a cronjob by its ID
|
|
147
|
+
* @param orgName Name of the organization
|
|
148
|
+
* @param spaceName Name of the space
|
|
149
|
+
* @param jobId ID of the cronjob
|
|
150
|
+
*/
|
|
151
|
+
deleteJob(orgName, spaceName, jobId, raw) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${jobId}`));
|
|
154
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Retrieves all cronjobs of a High5 space which match the provided search filter(s). Will return all cronjobs if no filter is provided.
|
|
159
|
+
* @param orgName Name of the organization
|
|
160
|
+
* @param spaceName Name of the space
|
|
161
|
+
* @param filters (optional) Array of search filters
|
|
162
|
+
* @param sorting (optional) Sorting object
|
|
163
|
+
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
164
|
+
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
165
|
+
* @param exposeNextExecution (optional) Show the next execution as a Unix timestamp (in milliseconds) in the returned cronjob objects
|
|
166
|
+
* @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)
|
|
167
|
+
*/
|
|
168
|
+
searchJobs(_a, raw_1) {
|
|
169
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, filters, sorting, limit = 25, page = 0, exposeNextExecution = false, }, raw) {
|
|
170
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
171
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
172
|
+
});
|
|
173
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/search?limit=${limit}&page=${page}&nextExecution=${exposeNextExecution}`), {
|
|
174
|
+
filters: filtersDTO,
|
|
175
|
+
sorting,
|
|
176
|
+
});
|
|
177
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Resolve a cron pattern along with a timezone to get the next executions in mili-seconds.
|
|
182
|
+
* @param expression The cron expression
|
|
183
|
+
* @param timezone The target IANA timezone
|
|
184
|
+
* @param amount The amount of returned execution-dates (limited between 1 and 10, default is 3)
|
|
185
|
+
* @returns Array of Unix timestamps
|
|
186
|
+
*/
|
|
187
|
+
resolveCronPatternWithTimezone(expression_1, timezone_1) {
|
|
188
|
+
return __awaiter(this, arguments, void 0, function* (expression, timezone, amount = 3, raw) {
|
|
189
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/cron/resolve`), {
|
|
190
|
+
expression: expression,
|
|
191
|
+
timezone: timezone,
|
|
192
|
+
amount: amount,
|
|
193
|
+
});
|
|
194
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
getEndpoint(endpoint) {
|
|
198
|
+
return `${this.options.server}/api/high5${endpoint}`;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
exports.High5Job = High5Job;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../../Base";
|
|
2
|
+
import { PaginatedResponse, SearchParams } from "../../../../../interfaces/global";
|
|
3
|
+
import { JobLogDto } from "../../../../../interfaces/high5/space/job/JobLog";
|
|
4
|
+
export declare class High5JobLog extends Base {
|
|
5
|
+
/**
|
|
6
|
+
* Retrieves all cronjobs of a High5 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 jobId 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
|
+
searchJobLogs<R extends boolean = false>({ orgName, spaceName, jobId, filters, sorting, limit, page }: SearchParams & {
|
|
17
|
+
orgName: string;
|
|
18
|
+
spaceName: string;
|
|
19
|
+
jobId: string;
|
|
20
|
+
}, raw?: {
|
|
21
|
+
raw: R;
|
|
22
|
+
}): Promise<MaybeRaw<R, PaginatedResponse<JobLogDto>>>;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves a cronjob log by it's ID
|
|
25
|
+
* @param orgName Name of the organization
|
|
26
|
+
* @param spaceName Name of the space
|
|
27
|
+
* @param jobId ID of the cronjob
|
|
28
|
+
* @param jobLogId ID of the cronjob log
|
|
29
|
+
* @returns the cronjob log
|
|
30
|
+
*/
|
|
31
|
+
getJobLog<R extends boolean = false>(orgName: string, spaceName: string, jobId: string, jobLogId: string, raw?: {
|
|
32
|
+
raw: R;
|
|
33
|
+
}): Promise<MaybeRaw<R, JobLogDto>>;
|
|
34
|
+
protected getEndpoint(endpoint: string): string;
|
|
35
|
+
}
|
|
@@ -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.High5JobLog = void 0;
|
|
13
|
+
const Base_1 = require("../../../../../Base");
|
|
14
|
+
const paginatedResponseHelper_1 = require("../../../../../helper/paginatedResponseHelper");
|
|
15
|
+
const searchFilter_1 = require("../../../../../helper/searchFilter");
|
|
16
|
+
class High5JobLog extends Base_1.default {
|
|
17
|
+
/**
|
|
18
|
+
* Retrieves all cronjobs of a High5 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 jobId 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
|
+
searchJobLogs(_a, raw_1) {
|
|
29
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, spaceName, jobId, filters, sorting, limit = 25, page = 0 }, raw) {
|
|
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/${jobId}/logs/search?page=${page}&limit=${limit}`), {
|
|
34
|
+
filters: filtersDTO,
|
|
35
|
+
sorting,
|
|
36
|
+
});
|
|
37
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (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 jobId ID of the cronjob
|
|
45
|
+
* @param jobLogId ID of the cronjob log
|
|
46
|
+
* @returns the cronjob log
|
|
47
|
+
*/
|
|
48
|
+
getJobLog(orgName, spaceName, jobId, jobLogId, raw) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/jobs/${jobId}/logs/${jobLogId}`));
|
|
51
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
getEndpoint(endpoint) {
|
|
55
|
+
return `${this.options.server}/api/high5${endpoint}`;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.High5JobLog = High5JobLog;
|