hcloud-sdk 17.0.0 → 19.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 +87 -76
- package/lib/Base.d.ts +2 -1
- package/lib/Hcloud.d.ts +24 -6
- package/lib/Hcloud.js +127 -24
- package/lib/helper/ErrorHelper.js +5 -2
- package/lib/helper/ValidationHelper.d.ts +14 -4
- package/lib/helper/ValidationHelper.js +71 -11
- package/lib/interfaces/agent/logging/cloudwatch.d.ts +23 -0
- package/lib/interfaces/agent/logging/index.d.ts +2 -0
- package/lib/interfaces/{friday → agent/logging}/index.js +2 -3
- package/lib/interfaces/agent/logging/log-collector.d.ts +35 -0
- package/lib/interfaces/agent/module/index.d.ts +7 -0
- package/lib/interfaces/agent/module/index.js +2 -0
- package/lib/interfaces/auditor/index.d.ts +13 -3
- package/lib/interfaces/auditor/index.js +9 -2
- package/lib/interfaces/axios/index.d.ts +5 -0
- package/lib/interfaces/cosmo/asset/index.d.ts +216 -0
- package/lib/interfaces/cosmo/asset/index.js +90 -0
- package/lib/interfaces/cosmo/comment/index.d.ts +41 -0
- package/lib/interfaces/cosmo/comment/index.js +8 -0
- package/lib/interfaces/cosmo/event/index.d.ts +60 -0
- package/lib/interfaces/cosmo/event/index.js +31 -0
- package/lib/interfaces/cosmo/location/index.d.ts +4 -0
- package/lib/interfaces/cosmo/location/index.js +2 -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 +110 -0
- package/lib/interfaces/cosmo/share/index.js +23 -0
- package/lib/interfaces/cosmo/space/index.d.ts +31 -0
- package/lib/interfaces/cosmo/space/index.js +2 -0
- package/lib/interfaces/cosmo/stats/index.d.ts +11 -0
- package/lib/interfaces/cosmo/stats/index.js +2 -0
- package/lib/interfaces/cosmo/tag/tag.d.ts +13 -0
- package/lib/interfaces/cosmo/tag/tag.js +2 -0
- package/lib/interfaces/global/Products.d.ts +2 -3
- package/lib/interfaces/global/Products.js +1 -2
- package/lib/interfaces/global/Views.d.ts +0 -1
- package/lib/interfaces/global/Views.js +0 -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 +10 -2
- package/lib/interfaces/high5/space/event/stream/node/index.d.ts +1 -0
- package/lib/interfaces/high5/space/execution/index.d.ts +3 -1
- package/lib/interfaces/{fuse/space/cronjob/CronjobLog.d.ts → high5/space/job/JobLog.d.ts} +3 -3
- package/lib/interfaces/high5/space/job/JobLog.js +2 -0
- package/lib/interfaces/high5/space/job/index.d.ts +83 -0
- package/lib/interfaces/high5/space/job/index.js +11 -0
- package/lib/interfaces/high5/stats.d.ts +21 -0
- package/lib/interfaces/high5/stats.js +2 -0
- package/lib/interfaces/high5/wave/dependentInputs.d.ts +42 -0
- package/lib/interfaces/high5/wave/dependentInputs.js +144 -0
- package/lib/interfaces/high5/wave/dependentInputsValidation.d.ts +22 -0
- package/lib/interfaces/high5/wave/dependentInputsValidation.js +220 -0
- package/lib/interfaces/idp/index.d.ts +3 -3
- package/lib/interfaces/idp/index.js +3 -3
- package/lib/interfaces/idp/oauth/device.d.ts +18 -0
- package/lib/interfaces/idp/oauth/device.js +2 -0
- package/lib/interfaces/idp/oauth/index.d.ts +19 -5
- package/lib/interfaces/idp/organization/index.d.ts +2 -0
- package/lib/interfaces/idp/organization/index.js +2 -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/settings/oauthApp/index.d.ts +4 -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 +22 -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 -15
- package/lib/interfaces/idp/user/Scopes.js +0 -21
- package/lib/interfaces/idp/user/index.d.ts +5 -1
- package/lib/interfaces/mailer/index.d.ts +50 -2
- package/lib/interfaces/mailer/index.js +100 -2
- 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 +79 -51
- package/lib/interfaces/nats/index.js +140 -125
- package/lib/interfaces/shorts/index.d.ts +17 -0
- package/lib/interfaces/shorts/index.js +8 -0
- package/lib/service/agent/bundle/dev/index.d.ts +16 -6
- package/lib/service/agent/bundle/dev/index.js +16 -11
- package/lib/service/agent/bundle/index.d.ts +10 -4
- package/lib/service/agent/bundle/index.js +10 -7
- package/lib/service/agent/context/index.d.ts +22 -8
- package/lib/service/agent/context/index.js +19 -15
- package/lib/service/agent/index.d.ts +6 -0
- package/lib/service/agent/index.js +18 -1
- package/lib/service/agent/installer/index.js +4 -1
- package/lib/service/agent/logging/index.d.ts +69 -0
- package/lib/service/agent/logging/index.js +117 -0
- package/lib/service/agent/module/index.d.ts +36 -0
- package/lib/service/agent/module/index.js +65 -0
- package/lib/service/auditor/index.d.ts +8 -4
- package/lib/service/auditor/index.js +9 -6
- package/lib/service/auditor/internal/index.d.ts +27 -3
- package/lib/service/auditor/internal/index.js +38 -6
- package/lib/service/bouncer/features/index.d.ts +4 -2
- package/lib/service/bouncer/features/index.js +6 -3
- package/lib/service/bouncer/index.js +5 -2
- package/lib/service/cosmo/asset/index.d.ts +265 -0
- package/lib/service/cosmo/asset/index.js +420 -0
- package/lib/service/cosmo/comment/index.d.ts +93 -0
- package/lib/service/cosmo/comment/index.js +136 -0
- package/lib/service/cosmo/event/index.d.ts +23 -0
- package/lib/service/cosmo/event/index.js +43 -0
- package/lib/service/cosmo/folder/index.d.ts +27 -0
- package/lib/service/cosmo/folder/index.js +50 -0
- package/lib/service/cosmo/index.d.ts +52 -0
- package/lib/service/cosmo/index.js +129 -0
- package/lib/service/cosmo/internal/index.d.ts +7 -0
- package/lib/service/cosmo/internal/index.js +20 -0
- package/lib/service/cosmo/internal/space/index.d.ts +15 -0
- package/lib/service/cosmo/internal/space/index.js +37 -0
- package/lib/service/cosmo/location/index.d.ts +40 -0
- package/lib/service/cosmo/location/index.js +66 -0
- package/lib/service/cosmo/namespace/index.d.ts +56 -0
- package/lib/service/cosmo/namespace/index.js +85 -0
- package/lib/service/cosmo/organization/index.d.ts +47 -0
- package/lib/service/cosmo/organization/index.js +67 -0
- package/lib/service/cosmo/permissions/index.d.ts +131 -0
- package/lib/service/cosmo/permissions/index.js +184 -0
- package/lib/service/cosmo/production/index.d.ts +26 -0
- package/lib/service/cosmo/production/index.js +48 -0
- package/lib/service/cosmo/share/index.d.ts +169 -0
- package/lib/service/cosmo/share/index.js +227 -0
- package/lib/service/cosmo/space/index.d.ts +131 -0
- package/lib/service/cosmo/space/index.js +190 -0
- package/lib/service/cosmo/stats/index.d.ts +35 -0
- package/lib/service/cosmo/stats/index.js +58 -0
- package/lib/service/cosmo/tag/index.d.ts +67 -0
- package/lib/service/cosmo/tag/index.js +96 -0
- package/lib/service/dali/DaliAvatar.d.ts +0 -6
- package/lib/service/dali/DaliAvatar.js +4 -11
- package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +10 -4
- package/lib/service/dali/avatar/DaliCosmoSpace.js +12 -8
- package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +11 -4
- package/lib/service/dali/avatar/DaliHigh5Pool.js +12 -8
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +11 -4
- package/lib/service/dali/avatar/DaliHigh5Space.js +12 -8
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +11 -4
- package/lib/service/dali/avatar/DaliOAuthApp.js +12 -8
- package/lib/service/dali/avatar/DaliOrganization.d.ts +11 -4
- package/lib/service/dali/avatar/DaliOrganization.js +12 -8
- package/lib/service/dali/avatar/DaliServiceAccount.d.ts +10 -4
- package/lib/service/dali/avatar/DaliServiceAccount.js +12 -8
- package/lib/service/dali/avatar/DaliTeam.d.ts +11 -4
- package/lib/service/dali/avatar/DaliTeam.js +12 -8
- package/lib/service/dali/avatar/DaliUser.d.ts +11 -4
- package/lib/service/dali/avatar/DaliUser.js +12 -8
- package/lib/service/dali/index.d.ts +4 -5
- package/lib/service/dali/index.js +6 -6
- package/lib/service/high5/execution/index.d.ts +4 -2
- package/lib/service/high5/execution/index.js +7 -3
- package/lib/service/high5/execution/log/index.js +4 -1
- package/lib/service/high5/execution/status/index.d.ts +5 -3
- package/lib/service/high5/execution/status/index.js +7 -4
- package/lib/service/high5/index.d.ts +7 -2
- package/lib/service/high5/index.js +13 -3
- package/lib/service/high5/internal/index.d.ts +4 -2
- package/lib/service/high5/internal/index.js +7 -3
- package/lib/service/high5/internal/space/index.d.ts +10 -3
- package/lib/service/high5/internal/space/index.js +17 -5
- package/lib/service/high5/internal/space/job/index.d.ts +7 -0
- package/lib/service/high5/internal/space/job/index.js +20 -0
- package/lib/service/high5/internal/space/job/log/index.d.ts +17 -0
- package/lib/service/{fuse/internal/space/cronjob → high5/internal/space/job}/log/index.js +13 -10
- package/lib/service/high5/joinToken/index.d.ts +14 -6
- package/lib/service/high5/joinToken/index.js +14 -10
- package/lib/service/high5/space/database/document/array/index.d.ts +73 -0
- package/lib/service/high5/space/database/document/array/index.js +105 -0
- package/lib/service/{friday → high5}/space/database/document/index.d.ts +26 -10
- package/lib/service/{friday → high5}/space/database/document/index.js +35 -17
- package/lib/service/high5/space/database/document/number/index.d.ts +51 -0
- package/lib/service/high5/space/database/document/number/index.js +80 -0
- package/lib/service/{friday → high5}/space/database/index.d.ts +22 -12
- package/lib/service/{friday → high5}/space/database/index.js +22 -18
- package/lib/service/high5/space/event/index.d.ts +17 -7
- package/lib/service/high5/space/event/index.js +16 -12
- package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +4 -2
- package/lib/service/high5/space/event/stream/design/DesignOperations.js +6 -3
- package/lib/service/high5/space/event/stream/design/index.d.ts +10 -4
- package/lib/service/high5/space/event/stream/design/index.js +13 -9
- 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 +16 -11
- package/lib/service/high5/space/event/stream/index.d.ts +32 -12
- package/lib/service/high5/space/event/stream/index.js +26 -22
- package/lib/service/high5/space/execution/index.d.ts +19 -7
- package/lib/service/high5/space/execution/index.js +21 -13
- package/lib/service/high5/space/execution/log/index.d.ts +8 -4
- package/lib/service/high5/space/execution/log/index.js +9 -6
- package/lib/service/high5/space/execution/status/index.d.ts +7 -3
- package/lib/service/high5/space/execution/status/index.js +8 -5
- package/lib/service/high5/space/index.d.ts +53 -14
- package/lib/service/high5/space/index.js +70 -28
- package/lib/service/{fuse/space/cronjob → high5/space/job}/index.d.ts +57 -35
- package/lib/service/{fuse/space/cronjob → high5/space/job}/index.js +88 -87
- package/lib/service/{fuse/space/cronjob → high5/space/job}/log/index.d.ts +15 -11
- package/lib/service/{fuse/space/cronjob → high5/space/job}/log/index.js +19 -16
- package/lib/service/high5/space/node/index.d.ts +20 -8
- package/lib/service/high5/space/node/index.js +18 -14
- package/lib/service/high5/space/pool/index.d.ts +38 -11
- package/lib/service/high5/space/pool/index.js +41 -19
- package/lib/service/high5/space/secret/index.d.ts +17 -7
- package/lib/service/high5/space/secret/index.js +16 -12
- package/lib/service/high5/space/stat/index.d.ts +12 -0
- package/lib/service/high5/space/stat/index.js +34 -0
- package/lib/service/high5/space/wave/index.d.ts +16 -6
- package/lib/service/high5/space/wave/index.js +15 -11
- package/lib/service/high5/space/webhook/index.d.ts +32 -12
- package/lib/service/high5/space/webhook/index.js +29 -22
- package/lib/service/high5/space/webhook/log/index.d.ts +4 -2
- package/lib/service/high5/space/webhook/log/index.js +6 -3
- package/lib/service/high5/stat/index.d.ts +11 -0
- package/lib/service/{fuse/internal → high5/stat}/index.js +16 -14
- package/lib/service/high5/wave/index.js +4 -1
- package/lib/service/high5/wave/s3/index.d.ts +31 -8
- package/lib/service/high5/wave/s3/index.js +47 -23
- package/lib/service/idp/guest/index.d.ts +42 -0
- package/lib/service/idp/guest/index.js +69 -0
- package/lib/service/idp/index.d.ts +25 -7
- package/lib/service/idp/index.js +27 -13
- package/lib/service/idp/internal/index.d.ts +5 -3
- package/lib/service/idp/internal/index.js +9 -4
- package/lib/service/idp/oauth/device.d.ts +131 -0
- package/lib/service/idp/oauth/device.js +177 -0
- package/lib/service/idp/oauth/index.d.ts +19 -6
- package/lib/service/idp/oauth/index.js +26 -16
- package/lib/service/idp/organization/index.d.ts +28 -5
- package/lib/service/idp/organization/index.js +41 -11
- package/lib/service/idp/organization/license/index.d.ts +7 -3
- package/lib/service/idp/organization/license/index.js +8 -5
- package/lib/service/idp/organization/member/index.d.ts +20 -8
- package/lib/service/idp/organization/member/index.js +20 -15
- package/lib/service/idp/organization/member/invitations/index.d.ts +42 -9
- package/lib/service/idp/organization/member/invitations/index.js +94 -59
- package/lib/service/idp/organization/service-accounts/index.d.ts +31 -9
- package/lib/service/idp/organization/service-accounts/index.js +35 -14
- package/lib/service/idp/organization/settings/domain/index.d.ts +13 -5
- package/lib/service/idp/organization/settings/domain/index.js +13 -9
- package/lib/service/idp/organization/settings/domain/saml/index.d.ts +16 -6
- package/lib/service/idp/organization/settings/domain/saml/index.js +23 -19
- package/lib/service/idp/organization/settings/index.js +4 -1
- package/lib/service/idp/organization/settings/oauth/index.d.ts +33 -9
- package/lib/service/idp/organization/settings/oauth/index.js +37 -16
- package/lib/service/idp/organization/stat/index.d.ts +11 -0
- package/lib/service/idp/organization/stat/index.js +33 -0
- package/lib/service/idp/organization/team/index.d.ts +32 -10
- package/lib/service/idp/organization/team/index.js +35 -14
- package/lib/service/idp/registration/index.d.ts +10 -4
- package/lib/service/idp/registration/index.js +19 -10
- package/lib/service/idp/user/index.d.ts +41 -11
- package/lib/service/idp/user/index.js +49 -19
- package/lib/service/idp/user/license/index.d.ts +7 -3
- package/lib/service/idp/user/license/index.js +8 -5
- package/lib/service/idp/user/message/index.d.ts +62 -0
- package/lib/service/idp/user/message/index.js +95 -0
- package/lib/service/idp/user/password/index.d.ts +4 -2
- package/lib/service/idp/user/password/index.js +6 -3
- package/lib/service/idp/user/settings/connections/index.d.ts +4 -2
- package/lib/service/idp/user/settings/connections/index.js +6 -3
- package/lib/service/idp/user/settings/general/index.d.ts +10 -4
- package/lib/service/idp/user/settings/general/index.js +10 -7
- package/lib/service/idp/user/settings/index.js +4 -1
- package/lib/service/idp/user/settings/notifications/index.d.ts +7 -3
- package/lib/service/idp/user/settings/notifications/index.js +8 -5
- package/lib/service/idp/user/settings/oauthApps/index.d.ts +7 -3
- package/lib/service/idp/user/settings/oauthApps/index.js +10 -6
- package/lib/service/idp/user/settings/pats/index.d.ts +22 -8
- package/lib/service/idp/user/settings/pats/index.js +21 -16
- package/lib/service/idp/user/settings/twoFactor/index.js +4 -1
- package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +16 -6
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +17 -11
- package/lib/service/mailer/index.d.ts +4 -2
- package/lib/service/mailer/index.js +7 -4
- package/lib/service/mailer/internal/index.d.ts +14 -6
- package/lib/service/mailer/internal/index.js +12 -9
- package/lib/service/mothership/index.d.ts +35 -13
- package/lib/service/mothership/index.js +36 -18
- package/lib/service/nats/index.d.ts +7 -0
- package/lib/service/nats/index.js +77 -44
- package/lib/service/shorts/index.d.ts +18 -0
- package/lib/service/{friday → shorts}/index.js +17 -11
- package/lib/service/shorts/internal/index.d.ts +75 -0
- package/lib/service/shorts/internal/index.js +118 -0
- package/lib/utils/bouncer/features/Provider.js +0 -1
- package/package.json +2 -2
- package/lib/interfaces/friday/index.d.ts +0 -3
- package/lib/interfaces/friday/space/index.d.ts +0 -21
- package/lib/interfaces/friday/space/index.js +0 -11
- package/lib/interfaces/fuse/index.d.ts +0 -3
- package/lib/interfaces/fuse/index.js +0 -19
- package/lib/interfaces/fuse/space/cronjob/Cronjob.d.ts +0 -38
- package/lib/interfaces/fuse/space/cronjob/Cronjob.js +0 -8
- package/lib/interfaces/fuse/space/index.d.ts +0 -22
- package/lib/interfaces/fuse/space/index.js +0 -11
- package/lib/service/dali/avatar/DaliFuseSpace.d.ts +0 -26
- package/lib/service/dali/avatar/DaliFuseSpace.js +0 -58
- 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/service/fuse/index.d.ts +0 -18
- package/lib/service/fuse/index.js +0 -48
- package/lib/service/fuse/internal/index.d.ts +0 -8
- package/lib/service/fuse/internal/space/cronjob/index.d.ts +0 -7
- package/lib/service/fuse/internal/space/cronjob/index.js +0 -17
- package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +0 -15
- package/lib/service/fuse/internal/space/index.d.ts +0 -22
- package/lib/service/fuse/internal/space/index.js +0 -49
- package/lib/service/fuse/space/index.d.ts +0 -81
- package/lib/service/fuse/space/index.js +0 -152
- /package/lib/interfaces/{friday/space/database/index.js → agent/logging/cloudwatch.js} +0 -0
- /package/lib/interfaces/{fuse/space/cronjob/CronjobLog.js → agent/logging/log-collector.js} +0 -0
- /package/lib/interfaces/{friday → high5}/space/database/index.d.ts +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.AgentModule = void 0;
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
17
|
+
class AgentModule extends Base_1.default {
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves a list of all loaded modules available in the agent.
|
|
20
|
+
* @returns A list of modules metadata
|
|
21
|
+
*/
|
|
22
|
+
listModules(raw) {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/management/modules`));
|
|
25
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Creates a new module template based on the received metadata.
|
|
30
|
+
* @param module - Metadata for the new module template
|
|
31
|
+
* @returns Newly created module data
|
|
32
|
+
*/
|
|
33
|
+
addModule(module, raw) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/management/modules`), module);
|
|
36
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves detailed information about a specific module by its name.
|
|
41
|
+
* @param modName - Unique name identifier of the module
|
|
42
|
+
* @returns Requested module details
|
|
43
|
+
*/
|
|
44
|
+
getModule(modName, raw) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/management/modules/${modName}`));
|
|
47
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Removes the module from the agent by its name.
|
|
52
|
+
* @param modName - Unique name identifier of the module to be deleted
|
|
53
|
+
* @returns void (or raw response)
|
|
54
|
+
*/
|
|
55
|
+
deleteModule(modName, raw) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/management/modules/${modName}`));
|
|
58
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
getEndpoint(endpoint) {
|
|
62
|
+
return `${this.options.server}/api/agent${endpoint}`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.AgentModule = AgentModule;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Base from "../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../Base";
|
|
2
2
|
import { AuditLog } from "../../interfaces/auditor";
|
|
3
3
|
import { PaginatedResponse, SearchParams, Version } from "../../interfaces/global";
|
|
4
4
|
import { AuditorInternal } from "./internal";
|
|
@@ -8,7 +8,9 @@ export default class Auditor extends Base {
|
|
|
8
8
|
/**
|
|
9
9
|
* @returns An object containing the endpoint version as a string
|
|
10
10
|
*/
|
|
11
|
-
version(
|
|
11
|
+
version<R extends boolean = false>(raw?: {
|
|
12
|
+
raw: R;
|
|
13
|
+
}): Promise<MaybeRaw<R, Version>>;
|
|
12
14
|
/**
|
|
13
15
|
* Returns all audit logs for an organization which match the search filter
|
|
14
16
|
* @param organizationName Name of the organization
|
|
@@ -18,8 +20,10 @@ export default class Auditor extends Base {
|
|
|
18
20
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
19
21
|
* @returns Object containing an array of audit logs and the total number of results found in the database (independent of limit and page)
|
|
20
22
|
*/
|
|
21
|
-
searchAuditLogs({ organizationName, filters, sorting, limit, page
|
|
23
|
+
searchAuditLogs<R extends boolean = false>({ organizationName, filters, sorting, limit, page }: SearchParams & {
|
|
22
24
|
organizationName: string;
|
|
23
|
-
}
|
|
25
|
+
}, raw?: {
|
|
26
|
+
raw: R;
|
|
27
|
+
}): Promise<MaybeRaw<R, PaginatedResponse<AuditLog>>>;
|
|
24
28
|
protected getEndpoint(endpoint: string): string;
|
|
25
29
|
}
|
|
@@ -8,8 +8,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const Base_1 = require("../../Base");
|
|
15
|
+
const Base_1 = __importDefault(require("../../Base"));
|
|
13
16
|
const paginatedResponseHelper_1 = require("../../helper/paginatedResponseHelper");
|
|
14
17
|
const searchFilter_1 = require("../../helper/searchFilter");
|
|
15
18
|
const internal_1 = require("./internal");
|
|
@@ -23,10 +26,10 @@ class Auditor extends Base_1.default {
|
|
|
23
26
|
/**
|
|
24
27
|
* @returns An object containing the endpoint version as a string
|
|
25
28
|
*/
|
|
26
|
-
version() {
|
|
29
|
+
version(raw) {
|
|
27
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
31
|
const resp = yield this.axios.get(this.getEndpoint("/v1/version"), {});
|
|
29
|
-
return resp.data;
|
|
32
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
30
33
|
});
|
|
31
34
|
}
|
|
32
35
|
/**
|
|
@@ -38,14 +41,14 @@ class Auditor extends Base_1.default {
|
|
|
38
41
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
39
42
|
* @returns Object containing an array of audit logs and the total number of results found in the database (independent of limit and page)
|
|
40
43
|
*/
|
|
41
|
-
searchAuditLogs(_a) {
|
|
42
|
-
return __awaiter(this, arguments, void 0, function* ({ organizationName, filters, sorting, limit = 25, page = 0,
|
|
44
|
+
searchAuditLogs(_a, raw_1) {
|
|
45
|
+
return __awaiter(this, arguments, void 0, function* ({ organizationName, filters, sorting, limit = 25, page = 0 }, raw) {
|
|
43
46
|
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => new searchFilter_1.SearchFilterDTO(f));
|
|
44
47
|
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${organizationName}/logs/search?page=${page}&limit=${limit}`), {
|
|
45
48
|
filters: filtersDTO,
|
|
46
49
|
sorting: sorting,
|
|
47
50
|
});
|
|
48
|
-
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
51
|
+
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));
|
|
49
52
|
});
|
|
50
53
|
}
|
|
51
54
|
getEndpoint(endpoint) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Base from "../../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
2
|
import { AuditLogCreate } from "../../../interfaces/auditor";
|
|
3
3
|
export declare class AuditorInternal extends Base {
|
|
4
4
|
private queueExecutionInterval;
|
|
5
5
|
private logQueue;
|
|
6
|
-
private
|
|
6
|
+
private logQueueInterval;
|
|
7
7
|
/**
|
|
8
8
|
* Adds log entries to a queue that will be processed periodically.
|
|
9
9
|
*
|
|
@@ -22,6 +22,30 @@ export declare class AuditorInternal extends Base {
|
|
|
22
22
|
* @param orgId the organizations's ID
|
|
23
23
|
* @returns void
|
|
24
24
|
*/
|
|
25
|
-
deleteAllAuditLogsOfOrganization(orgId: string
|
|
25
|
+
deleteAllAuditLogsOfOrganization<R extends boolean = false>(orgId: string, raw?: {
|
|
26
|
+
raw: R;
|
|
27
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
28
|
+
/**
|
|
29
|
+
* Deletes all audit logs of an Asset by space
|
|
30
|
+
*
|
|
31
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
32
|
+
* @param orgId the organizations's ID
|
|
33
|
+
* @param spaceName the Space's name
|
|
34
|
+
* @returns void
|
|
35
|
+
*/
|
|
36
|
+
deleteAllAuditLogsOfSpace<R extends boolean = false>(orgId: string, spaceName: string, raw?: {
|
|
37
|
+
raw: R;
|
|
38
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
39
|
+
/**
|
|
40
|
+
* Deletes all audit logs of an Asset
|
|
41
|
+
*
|
|
42
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
43
|
+
* @param orgId the organizations's ID
|
|
44
|
+
* @param assetId the Asset's ID
|
|
45
|
+
* @returns void
|
|
46
|
+
*/
|
|
47
|
+
deleteAllAuditLogsOfAsset<R extends boolean = false>(orgId: string, assetId: string, raw?: {
|
|
48
|
+
raw: R;
|
|
49
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
26
50
|
protected getEndpoint(endpoint: string): string;
|
|
27
51
|
}
|
|
@@ -8,9 +8,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.AuditorInternal = void 0;
|
|
13
|
-
const Base_1 = require("../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
14
17
|
class AuditorInternal extends Base_1.default {
|
|
15
18
|
constructor() {
|
|
16
19
|
var _a, _b;
|
|
@@ -29,15 +32,15 @@ class AuditorInternal extends Base_1.default {
|
|
|
29
32
|
*/
|
|
30
33
|
queueAuditLogs(logs) {
|
|
31
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
if (!this.
|
|
35
|
+
if (!this.logQueueInterval) {
|
|
33
36
|
this.startQueue();
|
|
34
37
|
}
|
|
35
38
|
this.logQueue = this.logQueue.concat(logs);
|
|
36
39
|
});
|
|
37
40
|
}
|
|
38
41
|
startQueue() {
|
|
39
|
-
if (!this.
|
|
40
|
-
this.
|
|
42
|
+
if (!this.logQueueInterval) {
|
|
43
|
+
this.logQueueInterval = setInterval(() => {
|
|
41
44
|
if (this.logQueue.length > 0) {
|
|
42
45
|
// DO NOT REMOVE THE IGNORE CATCH AS IT WOULD LEAD TO UNHANDLED PROMISE REJECTION IN OTHER ENDPOINTS AND THEIR CRASH
|
|
43
46
|
this.axios.post(this.getEndpoint("/v1/logs"), this.logQueue).catch(ignored => ignored);
|
|
@@ -53,9 +56,38 @@ class AuditorInternal extends Base_1.default {
|
|
|
53
56
|
* @param orgId the organizations's ID
|
|
54
57
|
* @returns void
|
|
55
58
|
*/
|
|
56
|
-
deleteAllAuditLogsOfOrganization(orgId) {
|
|
59
|
+
deleteAllAuditLogsOfOrganization(orgId, raw) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgId}/logs`));
|
|
62
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Deletes all audit logs of an Asset by space
|
|
67
|
+
*
|
|
68
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
69
|
+
* @param orgId the organizations's ID
|
|
70
|
+
* @param spaceName the Space's name
|
|
71
|
+
* @returns void
|
|
72
|
+
*/
|
|
73
|
+
deleteAllAuditLogsOfSpace(orgId, spaceName, raw) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgId}/spaces/${spaceName}/logs`));
|
|
76
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Deletes all audit logs of an Asset
|
|
81
|
+
*
|
|
82
|
+
* THIS IS AN INTERNAL ENDPOINT AND CAN ONLY BE USED FROM BACKENDS WITHIN THE HCLOUD DEPLOYMENT
|
|
83
|
+
* @param orgId the organizations's ID
|
|
84
|
+
* @param assetId the Asset's ID
|
|
85
|
+
* @returns void
|
|
86
|
+
*/
|
|
87
|
+
deleteAllAuditLogsOfAsset(orgId, assetId, raw) {
|
|
57
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgId}/logs`));
|
|
89
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgId}/assets/${assetId}/logs`));
|
|
90
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
59
91
|
});
|
|
60
92
|
}
|
|
61
93
|
getEndpoint(endpoint) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
|
-
import Base, { Options } from "../../../Base";
|
|
2
|
+
import Base, { MaybeRaw, Options } from "../../../Base";
|
|
3
3
|
import { HcloudFeature } from "../../../interfaces/bouncer";
|
|
4
4
|
export default class BouncerFeatures extends Base {
|
|
5
5
|
constructor(options: Options, axios: AxiosInstance);
|
|
6
|
-
getHcloudFeatures(
|
|
6
|
+
getHcloudFeatures<R extends boolean = false>(raw?: {
|
|
7
|
+
raw: R;
|
|
8
|
+
}): Promise<MaybeRaw<R, HcloudFeature[]>>;
|
|
7
9
|
protected getEndpoint(endpoint: string): string;
|
|
8
10
|
}
|
|
@@ -8,16 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const Base_1 = require("../../../Base");
|
|
15
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
13
16
|
class BouncerFeatures extends Base_1.default {
|
|
14
17
|
constructor(options, axios) {
|
|
15
18
|
super(options, axios);
|
|
16
19
|
}
|
|
17
|
-
getHcloudFeatures() {
|
|
20
|
+
getHcloudFeatures(raw) {
|
|
18
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
22
|
const resp = yield this.axios.get(this.getEndpoint("/default.json"), {});
|
|
20
|
-
return resp.data;
|
|
23
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
21
24
|
});
|
|
22
25
|
}
|
|
23
26
|
getEndpoint(endpoint) {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const Base_1 = require("../../Base");
|
|
4
|
-
const features_1 = require("./features");
|
|
6
|
+
const Base_1 = __importDefault(require("../../Base"));
|
|
7
|
+
const features_1 = __importDefault(require("./features"));
|
|
5
8
|
class Bouncer extends Base_1.default {
|
|
6
9
|
get features() {
|
|
7
10
|
if (this._features === undefined) {
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
+
import { AuditLog } from "../../../interfaces/auditor";
|
|
3
|
+
import { Asset, AssetPermission, CreateAsset, Mentionable, PatchAsset, Resolution, SubscriptionFilter, Upload, VTTThumbnail } from "../../../interfaces/cosmo/asset";
|
|
4
|
+
/**
|
|
5
|
+
* @class Asset
|
|
6
|
+
* @extends Base
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* **Under development, breaking changes possible**
|
|
10
|
+
*
|
|
11
|
+
* Represents an Asset resource in Cosmo, providing methods to interact with the Asset API.
|
|
12
|
+
*/
|
|
13
|
+
export declare class CosmoAsset extends Base {
|
|
14
|
+
protected getEndpoint(endpoint: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Create a new Asset in Cosmo inside the specified Organization and Space.
|
|
17
|
+
* @remarks
|
|
18
|
+
* ** Under development, breaking changes possible**
|
|
19
|
+
* @param orgName Name of the Organization
|
|
20
|
+
* @param spaceName Name of the Space
|
|
21
|
+
* @param createAsset The Asset to be created
|
|
22
|
+
* @returns The created asset
|
|
23
|
+
*/
|
|
24
|
+
createAsset<R extends boolean = false>(orgName: string, spaceName: string, createAsset: CreateAsset, raw?: {
|
|
25
|
+
raw: R;
|
|
26
|
+
}): Promise<MaybeRaw<R, Asset & {
|
|
27
|
+
upload: Upload;
|
|
28
|
+
}>>;
|
|
29
|
+
/**
|
|
30
|
+
* Bulk move or copy multiple assets to a new parent.
|
|
31
|
+
* @remarks
|
|
32
|
+
* ** Under development, breaking changes possible**
|
|
33
|
+
* @param orgName Name of the Organization
|
|
34
|
+
* @param spaceName Name of the Space
|
|
35
|
+
* @param newParentId (optional) ID of the new parent Asset to which the assets will be moved. Assets will be moved to the root if not provided.
|
|
36
|
+
* @param assetIdList List of Asset IDs to be moved to trash
|
|
37
|
+
* @param copy Whether to copy (true) or move (false) the assets
|
|
38
|
+
* @returns The moved assets
|
|
39
|
+
*/
|
|
40
|
+
bulkMove<R extends boolean = false>(orgName: string, spaceName: string, assetIdList: string[], newParentId?: string, copy?: boolean, raw?: {
|
|
41
|
+
raw: R;
|
|
42
|
+
}): Promise<MaybeRaw<R, Asset[]>>;
|
|
43
|
+
/**
|
|
44
|
+
* Attach an asset to a location.
|
|
45
|
+
* @remarks
|
|
46
|
+
* ** Under development, breaking changes possible**
|
|
47
|
+
* @param orgName Name of the Organization
|
|
48
|
+
* @param spaceName Name of the Space
|
|
49
|
+
* @param assetId ID of the Asset to be attached
|
|
50
|
+
* @param locationId ID of the Location to which the Asset will be attached to
|
|
51
|
+
* @returns 204 No Content if successful
|
|
52
|
+
*/
|
|
53
|
+
attachAssetToLocation<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, locationId: string, raw?: {
|
|
54
|
+
raw: R;
|
|
55
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
56
|
+
/**
|
|
57
|
+
* Patch an asset.
|
|
58
|
+
* @remarks
|
|
59
|
+
* ** Under development, breaking changes possible**
|
|
60
|
+
* @param orgName Name of the Organization
|
|
61
|
+
* @param spaceName Name of the Space
|
|
62
|
+
* @param assetId ID of the Asset to be attached
|
|
63
|
+
* @param patchAsset The Asset to be patched
|
|
64
|
+
* @returns The patched asset
|
|
65
|
+
*/
|
|
66
|
+
patchAsset<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, patchAsset: PatchAsset, raw?: {
|
|
67
|
+
raw: R;
|
|
68
|
+
}): Promise<MaybeRaw<R, Asset>>;
|
|
69
|
+
/**
|
|
70
|
+
* Get an asset by its ID.
|
|
71
|
+
* @remarks
|
|
72
|
+
* ** Under development, breaking changes possible**
|
|
73
|
+
* @param orgName Name of the Organization
|
|
74
|
+
* @param spaceName Name of the Space
|
|
75
|
+
* @param assetId ID of the Asset to be attached
|
|
76
|
+
* @param namespace Optional Namespaces of which information should be included in the returned object
|
|
77
|
+
* @param includePermissions Whether to include permissions in the result or not
|
|
78
|
+
* @returns The requested asset
|
|
79
|
+
*/
|
|
80
|
+
getAsset<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, namespace?: string | string[], includePermissions?: boolean, raw?: {
|
|
81
|
+
raw: R;
|
|
82
|
+
}): Promise<MaybeRaw<R, Asset>>;
|
|
83
|
+
/**
|
|
84
|
+
* Delete multiple assets permanently by their IDs.
|
|
85
|
+
* @remarks
|
|
86
|
+
* ** Under development, breaking changes possible**
|
|
87
|
+
* @param orgName Name of the Organization
|
|
88
|
+
* @param spaceName Name of the Space
|
|
89
|
+
* @param assetIds IDs of the Assets to delete
|
|
90
|
+
* @param force If asset is folder and force is set to false, it will only succeed if the folder is empty. If set to true, it will always succeed, but delete all children in the process
|
|
91
|
+
* @returns 204 No Content if successful
|
|
92
|
+
*/
|
|
93
|
+
deleteAssets<R extends boolean = false>(orgName: string, spaceName: string, assetIds: string[], force?: boolean, raw?: {
|
|
94
|
+
raw: R;
|
|
95
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
96
|
+
/**
|
|
97
|
+
* Request download URLs for multiple assets.
|
|
98
|
+
* @remarks
|
|
99
|
+
* ** Under development, breaking changes possible**
|
|
100
|
+
* @param orgName Name of the Organization
|
|
101
|
+
* @param spaceName Name of the Space
|
|
102
|
+
* @param assetIdList List of Asset IDs for which download URLs are requested
|
|
103
|
+
* @param resolution The desired resolution for the download URLs
|
|
104
|
+
* @returns A map of Asset IDs to their download URLs
|
|
105
|
+
*/
|
|
106
|
+
requestDownloadUrls<R extends boolean = false>(orgName: string, spaceName: string, assetIdList: string[], resolution: Resolution, raw?: {
|
|
107
|
+
raw: R;
|
|
108
|
+
}): Promise<MaybeRaw<R, Record<string, string>>>;
|
|
109
|
+
/**
|
|
110
|
+
* Upload an asset.
|
|
111
|
+
* @remarks
|
|
112
|
+
* ** Under development, breaking changes possible**
|
|
113
|
+
* ** Check this endpoint for currency as it looks outdated.**
|
|
114
|
+
* @param token An upload token for the asset
|
|
115
|
+
* @returns The uploaded asset
|
|
116
|
+
*/
|
|
117
|
+
uploadAsset<R extends boolean = false>(token: string, raw?: {
|
|
118
|
+
raw: R;
|
|
119
|
+
}): Promise<MaybeRaw<R, Asset>>;
|
|
120
|
+
/**
|
|
121
|
+
* Move assets to the trash bin.
|
|
122
|
+
* @remarks
|
|
123
|
+
* ** Under development, breaking changes possible**
|
|
124
|
+
* @param orgName Name of the Organization
|
|
125
|
+
* @param spaceName Name of the Space
|
|
126
|
+
* @param assetIdList List of Asset IDs to be moved to trash
|
|
127
|
+
* @returns The moved assets
|
|
128
|
+
*/
|
|
129
|
+
moveAssetsToTrash<R extends boolean = false>(orgName: string, spaceName: string, assetIdList: string[], raw?: {
|
|
130
|
+
raw: R;
|
|
131
|
+
}): Promise<MaybeRaw<R, Asset[]>>;
|
|
132
|
+
/**
|
|
133
|
+
* Fetch permissions for a group of assets.
|
|
134
|
+
* @remarks
|
|
135
|
+
* ** Under development, breaking changes possible**
|
|
136
|
+
* @param orgName Name of the Organization
|
|
137
|
+
* @param spaceName Name of the Space
|
|
138
|
+
* @param assetIdList List of Asset IDs to be moved to trash
|
|
139
|
+
* @returns A map of Asset IDs to their permissions
|
|
140
|
+
*/
|
|
141
|
+
fetchAssetPermissions<R extends boolean = false>(orgName: string, spaceName: string, assetIdList: string[], raw?: {
|
|
142
|
+
raw: R;
|
|
143
|
+
}): Promise<MaybeRaw<R, Record<string, AssetPermission[]>>>;
|
|
144
|
+
/**
|
|
145
|
+
* Fetches the activity log for a specific asset within a given organization and space.
|
|
146
|
+
*
|
|
147
|
+
* @param {string} orgName - The name of the organization that owns the space.
|
|
148
|
+
* @param {string} spaceName - The name of the space containing the asset.
|
|
149
|
+
* @param {string} assetId - The unique identifier of the asset whose activity is being fetched.
|
|
150
|
+
* @param {number} limit - The maximum number of audit log entries to retrieve per page.
|
|
151
|
+
* @param {number} page - The page number to retrieve (for pagination).
|
|
152
|
+
* @returns {Promise<AuditLog[]>} A promise that resolves to an array of `AuditLog` objects representing the asset’s activity history.
|
|
153
|
+
*/
|
|
154
|
+
fetchAssetActivity<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, limit: number, page: number, raw?: {
|
|
155
|
+
raw: R;
|
|
156
|
+
}): Promise<MaybeRaw<R, AuditLog[]>>;
|
|
157
|
+
/**
|
|
158
|
+
* Fetches an assets VTT file and parses it to return an array of VTTThumbnail objects.
|
|
159
|
+
*
|
|
160
|
+
* @param {string} url - The URL of the VTT file to fetch and parse.
|
|
161
|
+
* @returns {Promise<VTTThumbnail[]>} A promise that resolves to an array of `VTTThumbnail` objects representing the asset’s thumbnails.
|
|
162
|
+
*/
|
|
163
|
+
fetchAndParseAssetVTT<R extends boolean = false>(url: string, raw?: {
|
|
164
|
+
raw: R;
|
|
165
|
+
}): Promise<MaybeRaw<R, VTTThumbnail[]>>;
|
|
166
|
+
/**
|
|
167
|
+
* Rename an asset.
|
|
168
|
+
* @remarks
|
|
169
|
+
* ** Under development, breaking changes possible**
|
|
170
|
+
* @param orgName Name of the Organization
|
|
171
|
+
* @param spaceName Name of the Space
|
|
172
|
+
* @param assetId ID of the Asset to be renamed
|
|
173
|
+
* @returns The renamed asset
|
|
174
|
+
*/
|
|
175
|
+
renameAsset<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, newName: string, raw?: {
|
|
176
|
+
raw: R;
|
|
177
|
+
}): Promise<MaybeRaw<R, Asset>>;
|
|
178
|
+
/**
|
|
179
|
+
* Move assets out of trash and therewith recover them.
|
|
180
|
+
* @remarks
|
|
181
|
+
* ** Under development, breaking changes possible**
|
|
182
|
+
* @param orgName Name of the Organization
|
|
183
|
+
* @param spaceName Name of the Space
|
|
184
|
+
* @param assetIdList List of Asset IDs to be moved out of trash
|
|
185
|
+
* @returns The moved assets
|
|
186
|
+
*/
|
|
187
|
+
moveAssetsOutOfTrash<R extends boolean = false>(orgName: string, spaceName: string, assetIdList: string[], raw?: {
|
|
188
|
+
raw: R;
|
|
189
|
+
}): Promise<MaybeRaw<R, Asset[]>>;
|
|
190
|
+
/**
|
|
191
|
+
* Attach a tag to an asset or replace an existing one.
|
|
192
|
+
* @remarks
|
|
193
|
+
* ** Under development, breaking changes possible**
|
|
194
|
+
* @param orgName Name of the Organization
|
|
195
|
+
* @param spaceName Name of the Space
|
|
196
|
+
* @param namespaceName Name of the namespace
|
|
197
|
+
* @param assetId ID of the Asset to be attached
|
|
198
|
+
* @param tagName Name of the tag
|
|
199
|
+
* @returns The updated asset
|
|
200
|
+
*/
|
|
201
|
+
attachTagToAsset<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, assetId: string, tagName: string, raw?: {
|
|
202
|
+
raw: R;
|
|
203
|
+
}): Promise<MaybeRaw<R, Asset>>;
|
|
204
|
+
/**
|
|
205
|
+
* Remove a tag from an asset.
|
|
206
|
+
* @remarks
|
|
207
|
+
* ** Under development, breaking changes possible**
|
|
208
|
+
* @param orgName Name of the Organization
|
|
209
|
+
* @param spaceName Name of the Space
|
|
210
|
+
* @param namespaceName Name of the Namespace
|
|
211
|
+
* @param assetId ID of the Asset to be attached
|
|
212
|
+
* @returns The updated asset
|
|
213
|
+
*/
|
|
214
|
+
removeTagFromAsset<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, assetId: string, raw?: {
|
|
215
|
+
raw: R;
|
|
216
|
+
}): Promise<MaybeRaw<R, Asset>>;
|
|
217
|
+
/**
|
|
218
|
+
* List users allowed to be mentioned in a comment of an asset.
|
|
219
|
+
* @param assetId ID of the Asset
|
|
220
|
+
* @param limit Maximum number of users to return
|
|
221
|
+
* @param page Page number for pagination
|
|
222
|
+
* @returns A list of users allowed to be mentioned in a comment of the asset
|
|
223
|
+
*/
|
|
224
|
+
listUsersAllowedToMention<R extends boolean = false>(orgName: string, spaceName: string, assetId: string, limit?: number, page?: number, raw?: {
|
|
225
|
+
raw: R;
|
|
226
|
+
}): Promise<MaybeRaw<R, Mentionable[]>>;
|
|
227
|
+
/**
|
|
228
|
+
* Clone one or more assets within a space.
|
|
229
|
+
*
|
|
230
|
+
* This operation creates copies of the specified assets in the same organization and space.
|
|
231
|
+
*
|
|
232
|
+
* @param orgName Name of the Organization
|
|
233
|
+
* @param spaceName Name of the Space
|
|
234
|
+
* @param assetIds List of Asset IDs to be cloned. If folder IDs are specified, they will be recursively cloned.
|
|
235
|
+
* @param parentId (optional) Id of parent asset of the newly cloned asset. If undefined will default to space as parent.
|
|
236
|
+
* @returns The cloned assets
|
|
237
|
+
*/
|
|
238
|
+
cloneAsset<R extends boolean = false>(orgName: string, spaceName: string, assetIds: string[], parentId?: string, raw?: {
|
|
239
|
+
raw: R;
|
|
240
|
+
}): Promise<MaybeRaw<R, Asset[]>>;
|
|
241
|
+
/**
|
|
242
|
+
* Subscribe to notifications for a specific asset or all assets in a space.
|
|
243
|
+
*
|
|
244
|
+
* @param orgName Name of the Organization
|
|
245
|
+
* @param spaceName Name of the Space
|
|
246
|
+
* @param assetId (optional) ID of the Asset to subscribe to. If not provided, subscribes to the space.
|
|
247
|
+
* @param filters (optional) Subscription configuration. If 'filters' is omitted or empty, all notification types will be sent.
|
|
248
|
+
* @param raw
|
|
249
|
+
* @returns 204 No Content if successful
|
|
250
|
+
*/
|
|
251
|
+
subscribe<R extends boolean = false>(orgName: string, spaceName: string, assetId?: string, filters?: SubscriptionFilter[], raw?: {
|
|
252
|
+
raw: R;
|
|
253
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
254
|
+
/**
|
|
255
|
+
* Unsubscribe from notifications for a specific asset or all assets in a space.
|
|
256
|
+
*
|
|
257
|
+
* @param orgName Name of the Organization
|
|
258
|
+
* @param spaceName Name of the Space
|
|
259
|
+
* @param assetId (optional) ID of the Asset to unsubscribe from. If not provided, unsubscribes from the space.
|
|
260
|
+
* @returns 204 No Content if successful
|
|
261
|
+
*/
|
|
262
|
+
unsubscribe<R extends boolean = false>(orgName: string, spaceName: string, assetId?: string, raw?: {
|
|
263
|
+
raw: R;
|
|
264
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
265
|
+
}
|