hcloud-sdk 18.0.0 → 19.1.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 +17 -184
- package/lib/Hcloud.d.ts +18 -3
- package/lib/Hcloud.js +113 -21
- package/lib/helper/ErrorHelper.js +5 -2
- package/lib/helper/ValidationHelper.d.ts +6 -4
- package/lib/helper/ValidationHelper.js +30 -18
- package/lib/interfaces/agent/index.d.ts +1 -0
- package/lib/interfaces/agent/logging/cloudwatch.d.ts +23 -0
- package/lib/interfaces/agent/logging/index.d.ts +2 -0
- package/lib/interfaces/{fuse → agent/logging}/index.js +2 -3
- package/lib/interfaces/agent/logging/log-collector.d.ts +35 -0
- package/lib/interfaces/agent/logging/log-collector.js +2 -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 +0 -1
- package/lib/interfaces/auditor/index.js +0 -1
- package/lib/interfaces/axios/index.d.ts +5 -0
- package/lib/interfaces/cosmo/asset/index.d.ts +45 -9
- package/lib/interfaces/cosmo/asset/index.js +9 -1
- package/lib/interfaces/cosmo/comment/index.d.ts +18 -1
- package/lib/interfaces/cosmo/comment/index.js +13 -1
- package/lib/interfaces/cosmo/event/index.d.ts +34 -5
- package/lib/interfaces/cosmo/event/index.js +16 -2
- package/lib/interfaces/cosmo/share/index.d.ts +100 -8
- package/lib/interfaces/cosmo/share/index.js +21 -0
- package/lib/interfaces/cosmo/space/index.d.ts +6 -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 +3 -1
- package/lib/interfaces/global/Products.d.ts +0 -1
- package/lib/interfaces/global/Products.js +0 -1
- package/lib/interfaces/global/Views.d.ts +0 -1
- package/lib/interfaces/global/Views.js +0 -1
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +1 -0
- package/lib/interfaces/high5/space/event/stream/node/index.d.ts +1 -0
- package/lib/interfaces/high5/space/execution/index.d.ts +5 -1
- package/lib/interfaces/high5/space/job/JobLog.d.ts +10 -6
- package/lib/interfaces/high5/space/job/index.d.ts +65 -20
- package/lib/interfaces/high5/space/job/index.js +9 -6
- 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/high5/wave/index.d.ts +9 -0
- package/lib/interfaces/high5/wave/index.js +4 -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 +17 -4
- package/lib/interfaces/idp/organization/index.d.ts +1 -0
- package/lib/interfaces/idp/organization/index.js +1 -0
- package/lib/interfaces/idp/organization/settings/oauthApp/index.d.ts +4 -0
- package/lib/interfaces/idp/user/Message.d.ts +1 -0
- package/lib/interfaces/idp/user/Scopes.d.ts +1 -9
- package/lib/interfaces/idp/user/Scopes.js +0 -12
- package/lib/interfaces/idp/user/index.d.ts +3 -0
- package/lib/interfaces/mailer/index.d.ts +20 -1
- package/lib/interfaces/mailer/index.js +14 -2
- package/lib/interfaces/nats/index.d.ts +30 -32
- package/lib/interfaces/nats/index.js +103 -117
- package/lib/interfaces/shorts/index.d.ts +7 -0
- package/lib/interfaces/shorts/index.js +6 -0
- package/lib/service/agent/bundle/dev/index.js +4 -1
- package/lib/service/agent/bundle/index.js +4 -1
- package/lib/service/agent/context/index.js +4 -1
- 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.js +4 -1
- package/lib/service/auditor/internal/index.js +4 -1
- package/lib/service/bouncer/features/index.js +4 -1
- package/lib/service/bouncer/index.js +5 -2
- package/lib/service/cosmo/asset/index.d.ts +49 -3
- package/lib/service/cosmo/asset/index.js +111 -5
- package/lib/service/cosmo/comment/index.d.ts +10 -37
- package/lib/service/cosmo/comment/index.js +20 -43
- package/lib/service/cosmo/event/index.js +4 -1
- package/lib/service/cosmo/folder/index.js +4 -1
- package/lib/service/cosmo/index.d.ts +3 -0
- package/lib/service/cosmo/index.js +11 -1
- package/lib/service/cosmo/internal/index.js +4 -1
- package/lib/service/cosmo/internal/space/index.js +4 -1
- package/lib/service/cosmo/location/index.js +4 -1
- package/lib/service/cosmo/namespace/index.d.ts +15 -1
- package/lib/service/cosmo/namespace/index.js +21 -1
- package/lib/service/cosmo/organization/index.js +4 -1
- package/lib/service/cosmo/permissions/index.js +4 -1
- package/lib/service/cosmo/production/index.js +4 -1
- package/lib/service/cosmo/share/index.d.ts +55 -29
- package/lib/service/cosmo/share/index.js +71 -35
- package/lib/service/cosmo/space/index.d.ts +28 -1
- package/lib/service/cosmo/space/index.js +45 -1
- 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 +13 -0
- package/lib/service/cosmo/tag/index.js +22 -1
- package/lib/service/dali/DaliAvatar.d.ts +0 -6
- package/lib/service/dali/DaliAvatar.js +4 -11
- package/lib/service/dali/avatar/DaliCosmoSpace.js +4 -1
- package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +2 -1
- package/lib/service/dali/avatar/DaliHigh5Pool.js +5 -2
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +2 -1
- package/lib/service/dali/avatar/DaliHigh5Space.js +5 -2
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +2 -1
- package/lib/service/dali/avatar/DaliOAuthApp.js +5 -2
- package/lib/service/dali/avatar/DaliOrganization.d.ts +2 -1
- package/lib/service/dali/avatar/DaliOrganization.js +5 -2
- package/lib/service/dali/avatar/DaliServiceAccount.d.ts +1 -1
- package/lib/service/dali/avatar/DaliServiceAccount.js +6 -3
- package/lib/service/dali/avatar/DaliTeam.d.ts +2 -1
- package/lib/service/dali/avatar/DaliTeam.js +5 -2
- package/lib/service/dali/avatar/DaliUser.d.ts +2 -1
- package/lib/service/dali/avatar/DaliUser.js +5 -2
- package/lib/service/dali/index.js +4 -1
- package/lib/service/high5/execution/index.js +4 -1
- package/lib/service/high5/execution/log/index.js +4 -1
- package/lib/service/high5/execution/status/index.js +4 -1
- package/lib/service/high5/index.js +4 -1
- package/lib/service/high5/internal/index.js +4 -1
- package/lib/service/high5/internal/space/index.js +4 -1
- package/lib/service/high5/internal/space/job/index.js +4 -1
- package/lib/service/high5/internal/space/job/log/index.js +4 -1
- package/lib/service/high5/joinToken/index.js +4 -1
- package/lib/service/high5/space/database/document/array/index.js +4 -1
- package/lib/service/high5/space/database/document/index.js +4 -1
- package/lib/service/high5/space/database/document/number/index.js +4 -1
- package/lib/service/high5/space/database/index.js +4 -1
- package/lib/service/high5/space/event/index.js +4 -1
- package/lib/service/high5/space/event/stream/design/DesignOperations.js +4 -1
- package/lib/service/high5/space/event/stream/design/index.js +6 -3
- package/lib/service/high5/space/event/stream/design/snapshot/index.js +4 -1
- package/lib/service/high5/space/event/stream/index.js +4 -1
- package/lib/service/high5/space/execution/index.d.ts +2 -1
- package/lib/service/high5/space/execution/index.js +7 -3
- package/lib/service/high5/space/execution/log/index.js +4 -1
- package/lib/service/high5/space/execution/status/index.js +4 -1
- package/lib/service/high5/space/index.d.ts +10 -0
- package/lib/service/high5/space/index.js +25 -5
- package/lib/service/high5/space/job/index.js +4 -1
- package/lib/service/high5/space/job/log/index.js +4 -1
- package/lib/service/high5/space/node/index.js +4 -1
- package/lib/service/high5/space/pool/index.d.ts +11 -0
- package/lib/service/high5/space/pool/index.js +22 -1
- package/lib/service/high5/space/secret/index.js +4 -1
- package/lib/service/high5/space/stat/index.js +4 -1
- package/lib/service/high5/space/wave/index.js +4 -1
- package/lib/service/high5/space/webhook/index.js +4 -1
- package/lib/service/high5/space/webhook/log/index.js +4 -1
- package/lib/service/high5/stat/index.js +4 -1
- package/lib/service/high5/wave/index.js +4 -1
- package/lib/service/high5/wave/s3/index.js +5 -2
- package/lib/service/idp/guest/index.js +4 -1
- package/lib/service/idp/index.js +4 -1
- package/lib/service/idp/internal/index.js +4 -1
- 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 +3 -0
- package/lib/service/idp/oauth/index.js +11 -1
- package/lib/service/idp/organization/index.d.ts +9 -0
- package/lib/service/idp/organization/index.js +22 -3
- package/lib/service/idp/organization/license/index.js +4 -1
- package/lib/service/idp/organization/member/index.js +5 -2
- package/lib/service/idp/organization/member/invitations/index.d.ts +19 -0
- package/lib/service/idp/organization/member/invitations/index.js +23 -1
- package/lib/service/idp/organization/service-accounts/index.d.ts +11 -1
- package/lib/service/idp/organization/service-accounts/index.js +22 -2
- package/lib/service/idp/organization/settings/domain/index.js +4 -1
- package/lib/service/idp/organization/settings/domain/saml/index.js +4 -1
- package/lib/service/idp/organization/settings/index.js +4 -1
- package/lib/service/idp/organization/settings/oauth/index.d.ts +10 -0
- package/lib/service/idp/organization/settings/oauth/index.js +21 -1
- package/lib/service/idp/organization/stat/index.js +4 -1
- package/lib/service/idp/organization/team/index.d.ts +10 -0
- package/lib/service/idp/organization/team/index.js +21 -1
- package/lib/service/idp/registration/index.js +4 -1
- package/lib/service/idp/user/index.d.ts +8 -0
- package/lib/service/idp/user/index.js +20 -3
- package/lib/service/idp/user/license/index.js +4 -1
- package/lib/service/idp/user/message/index.d.ts +1 -0
- package/lib/service/idp/user/message/index.js +4 -1
- package/lib/service/idp/user/password/index.js +4 -1
- package/lib/service/idp/user/settings/connections/index.js +4 -1
- package/lib/service/idp/user/settings/general/index.js +4 -1
- package/lib/service/idp/user/settings/index.js +4 -1
- package/lib/service/idp/user/settings/notifications/index.js +4 -1
- package/lib/service/idp/user/settings/oauthApps/index.js +4 -1
- package/lib/service/idp/user/settings/pats/index.js +4 -1
- package/lib/service/idp/user/settings/twoFactor/index.js +4 -1
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +4 -1
- package/lib/service/mailer/index.js +5 -2
- package/lib/service/mailer/internal/index.d.ts +2 -2
- package/lib/service/mailer/internal/index.js +5 -2
- package/lib/service/mothership/index.js +4 -1
- package/lib/service/nats/index.d.ts +7 -0
- package/lib/service/nats/index.js +19 -1
- package/lib/service/shorts/index.js +4 -1
- package/lib/service/shorts/internal/index.d.ts +6 -3
- package/lib/service/shorts/internal/index.js +20 -6
- package/lib/utils/bouncer/features/Provider.js +0 -1
- package/package.json +2 -2
- package/lib/interfaces/fuse/index.d.ts +0 -3
- 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/cronjob/CronjobLog.d.ts +0 -16
- 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 -32
- package/lib/service/dali/avatar/DaliFuseSpace.js +0 -59
- package/lib/service/fuse/index.d.ts +0 -20
- package/lib/service/fuse/index.js +0 -48
- package/lib/service/fuse/internal/index.d.ts +0 -10
- package/lib/service/fuse/internal/index.js +0 -32
- 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 -17
- package/lib/service/fuse/internal/space/cronjob/log/index.js +0 -34
- package/lib/service/fuse/internal/space/index.d.ts +0 -26
- package/lib/service/fuse/internal/space/index.js +0 -51
- package/lib/service/fuse/space/cronjob/index.d.ts +0 -145
- package/lib/service/fuse/space/cronjob/index.js +0 -201
- package/lib/service/fuse/space/cronjob/log/index.d.ts +0 -35
- package/lib/service/fuse/space/cronjob/log/index.js +0 -58
- package/lib/service/fuse/space/index.d.ts +0 -97
- package/lib/service/fuse/space/index.js +0 -153
- /package/lib/interfaces/{fuse/space/cronjob/CronjobLog.js → agent/logging/cloudwatch.js} +0 -0
|
@@ -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.CosmoEvent = void 0;
|
|
13
|
-
const Base_1 = require("../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
14
17
|
/**
|
|
15
18
|
* @class Event
|
|
16
19
|
* @extends Base
|
|
@@ -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.CosmoFolder = void 0;
|
|
13
|
-
const Base_1 = require("../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
14
17
|
/**
|
|
15
18
|
* @class Folder
|
|
16
19
|
* @extends Base
|
|
@@ -12,6 +12,7 @@ import { CosmoPermissions } from "./permissions";
|
|
|
12
12
|
import { CosmoProduction } from "./production";
|
|
13
13
|
import { CosmoShare } from "./share";
|
|
14
14
|
import { CosmoSpace } from "./space";
|
|
15
|
+
import { CosmoStats } from "./stats";
|
|
15
16
|
import { CosmoTag } from "./tag";
|
|
16
17
|
export default class CosmoService extends Base {
|
|
17
18
|
get cosmoAsset(): CosmoAsset;
|
|
@@ -40,6 +41,8 @@ export default class CosmoService extends Base {
|
|
|
40
41
|
private _cosmoTag?;
|
|
41
42
|
get cosmoPermissions(): CosmoPermissions;
|
|
42
43
|
private _cosmoPermissions?;
|
|
44
|
+
get cosmoStats(): CosmoStats;
|
|
45
|
+
private _cosmoStats?;
|
|
43
46
|
/**
|
|
44
47
|
* Requests the endpoint version
|
|
45
48
|
* @returns Version object
|
|
@@ -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 asset_1 = require("./asset");
|
|
14
17
|
const comment_1 = require("./comment");
|
|
15
18
|
const event_1 = require("./event");
|
|
@@ -22,6 +25,7 @@ const permissions_1 = require("./permissions");
|
|
|
22
25
|
const production_1 = require("./production");
|
|
23
26
|
const share_1 = require("./share");
|
|
24
27
|
const space_2 = require("./space");
|
|
28
|
+
const stats_1 = require("./stats");
|
|
25
29
|
const tag_1 = require("./tag");
|
|
26
30
|
class CosmoService extends Base_1.default {
|
|
27
31
|
get cosmoAsset() {
|
|
@@ -102,6 +106,12 @@ class CosmoService extends Base_1.default {
|
|
|
102
106
|
}
|
|
103
107
|
return this._cosmoPermissions;
|
|
104
108
|
}
|
|
109
|
+
get cosmoStats() {
|
|
110
|
+
if (this._cosmoStats === undefined) {
|
|
111
|
+
this._cosmoStats = new stats_1.CosmoStats(this.options, this.axios);
|
|
112
|
+
}
|
|
113
|
+
return this._cosmoStats;
|
|
114
|
+
}
|
|
105
115
|
/**
|
|
106
116
|
* Requests the endpoint version
|
|
107
117
|
* @returns Version object
|
|
@@ -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
6
|
exports.CosmoInternal = void 0;
|
|
4
|
-
const Base_1 = require("../../../Base");
|
|
7
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
5
8
|
const space_1 = require("./space");
|
|
6
9
|
class CosmoInternal extends Base_1.default {
|
|
7
10
|
get space() {
|
|
@@ -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.CosmoSpaceInternal = void 0;
|
|
13
|
-
const Base_1 = require("../../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../../Base"));
|
|
14
17
|
class CosmoSpaceInternal extends Base_1.default {
|
|
15
18
|
constructor(options, axios) {
|
|
16
19
|
super(options, axios);
|
|
@@ -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.CosmoLocation = void 0;
|
|
13
|
-
const Base_1 = require("../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
14
17
|
/**
|
|
15
18
|
* @class Location
|
|
16
19
|
* @extends Base
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
-
import { Asset, NamespaceRushStatus } from "../../../interfaces/cosmo/asset";
|
|
2
|
+
import { Asset, NamespaceMetadata, NamespaceRushStatus } from "../../../interfaces/cosmo/asset";
|
|
3
3
|
import { Namespace } from "../../../interfaces/cosmo/namespace";
|
|
4
4
|
/**
|
|
5
5
|
* @class Namespace
|
|
@@ -39,4 +39,18 @@ export declare class CosmoNamespace extends Base {
|
|
|
39
39
|
changeStatus<R extends boolean = false>(orgName: string, spaceName: string, refId: string, namespaceName: string, status: NamespaceRushStatus, raw?: {
|
|
40
40
|
raw: R;
|
|
41
41
|
}): Promise<MaybeRaw<R, Asset>>;
|
|
42
|
+
/**
|
|
43
|
+
* Update the metadata of a reference (e.g. Asset)
|
|
44
|
+
* @remarks
|
|
45
|
+
* ** Under development, breaking changes possible**
|
|
46
|
+
* @param orgName Name of the Organization
|
|
47
|
+
* @param spaceName Name of the Space
|
|
48
|
+
* @param namespaceName Name of the Namespace
|
|
49
|
+
* @param refId ID of the reference to change status
|
|
50
|
+
* @param metadata New metadata to set
|
|
51
|
+
* @returns The updated Reference
|
|
52
|
+
*/
|
|
53
|
+
updateMetadata<R extends boolean = false>(orgName: string, spaceName: string, refId: string, namespaceName: string, metadata: NamespaceMetadata, raw?: {
|
|
54
|
+
raw: R;
|
|
55
|
+
}): Promise<MaybeRaw<R, Asset>>;
|
|
42
56
|
}
|
|
@@ -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.CosmoNamespace = void 0;
|
|
13
|
-
const Base_1 = require("../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
14
17
|
/**
|
|
15
18
|
* @class Namespace
|
|
16
19
|
* @extends Base
|
|
@@ -61,5 +64,22 @@ class CosmoNamespace extends Base_1.default {
|
|
|
61
64
|
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
62
65
|
});
|
|
63
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Update the metadata of a reference (e.g. Asset)
|
|
69
|
+
* @remarks
|
|
70
|
+
* ** Under development, breaking changes possible**
|
|
71
|
+
* @param orgName Name of the Organization
|
|
72
|
+
* @param spaceName Name of the Space
|
|
73
|
+
* @param namespaceName Name of the Namespace
|
|
74
|
+
* @param refId ID of the reference to change status
|
|
75
|
+
* @param metadata New metadata to set
|
|
76
|
+
* @returns The updated Reference
|
|
77
|
+
*/
|
|
78
|
+
updateMetadata(orgName, spaceName, refId, namespaceName, metadata, raw) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/ref/${refId}/metadata`), metadata);
|
|
81
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
82
|
+
});
|
|
83
|
+
}
|
|
64
84
|
}
|
|
65
85
|
exports.CosmoNamespace = CosmoNamespace;
|
|
@@ -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.CosmoOrganization = void 0;
|
|
13
|
-
const Base_1 = require("../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
14
17
|
/**
|
|
15
18
|
* @class Organization
|
|
16
19
|
* @extends Base
|
|
@@ -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.CosmoPermissions = void 0;
|
|
13
|
-
const Base_1 = require("../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
14
17
|
class CosmoPermissions extends Base_1.default {
|
|
15
18
|
/**
|
|
16
19
|
* Fetches a list of all available permissions that can be assigned to roles.
|
|
@@ -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.CosmoProduction = void 0;
|
|
13
|
-
const Base_1 = require("../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
14
17
|
/**
|
|
15
18
|
* @class Production
|
|
16
19
|
* @extends Base
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
-
import { Asset } from "../../../interfaces/cosmo/asset";
|
|
3
2
|
import { Share, ShareCreate, SharePatch, ShareWithUsers } from "../../../interfaces/cosmo/share";
|
|
4
3
|
import { SearchFilter, Sorting } from "../../../interfaces/global";
|
|
5
4
|
/**
|
|
@@ -39,22 +38,6 @@ export declare class CosmoShare extends Base {
|
|
|
39
38
|
linkShare<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, password?: string, shareIdHMAC?: string, raw?: {
|
|
40
39
|
raw: R;
|
|
41
40
|
}): Promise<MaybeRaw<R, Share>>;
|
|
42
|
-
/**
|
|
43
|
-
* Fetch shared Assets.
|
|
44
|
-
* @remarks
|
|
45
|
-
* ** Under development, breaking changes possible**
|
|
46
|
-
* @param orgName Name of the Organization
|
|
47
|
-
* @param spaceName Name of the Space
|
|
48
|
-
* @param shareId The ID of the Share to link
|
|
49
|
-
* @param limit The number of assets to return
|
|
50
|
-
* @param page The page number to return
|
|
51
|
-
* @param namespace The namespace to filter by
|
|
52
|
-
*
|
|
53
|
-
* @returns The created Share
|
|
54
|
-
*/
|
|
55
|
-
fetchSharedAssets<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, limit: number, page: number, namespace: string, raw?: {
|
|
56
|
-
raw: R;
|
|
57
|
-
}): Promise<MaybeRaw<R, Asset[]>>;
|
|
58
41
|
/**
|
|
59
42
|
* Delete Shares by ID.
|
|
60
43
|
* @remarks
|
|
@@ -132,18 +115,6 @@ export declare class CosmoShare extends Base {
|
|
|
132
115
|
unlinkOther<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, userId: string, raw?: {
|
|
133
116
|
raw: R;
|
|
134
117
|
}): Promise<MaybeRaw<R, void>>;
|
|
135
|
-
/**
|
|
136
|
-
* Links one or more users (by email) to a specific share in a space.
|
|
137
|
-
*
|
|
138
|
-
* @param {string} orgName - The name of the organization.
|
|
139
|
-
* @param {string} spaceName - The name of the space.
|
|
140
|
-
* @param {string} shareId - The ID of the share to link to.
|
|
141
|
-
* @param {string[]} emails - An array of email addresses to link to the share.
|
|
142
|
-
* @returns {Promise<Share>} A promise that resolves to the updated share object.
|
|
143
|
-
*/
|
|
144
|
-
linkOther<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, emails: string[], raw?: {
|
|
145
|
-
raw: R;
|
|
146
|
-
}): Promise<MaybeRaw<R, Share>>;
|
|
147
118
|
/**
|
|
148
119
|
* Patch a Share in the specified Organization and Space.
|
|
149
120
|
* @remarks
|
|
@@ -158,4 +129,59 @@ export declare class CosmoShare extends Base {
|
|
|
158
129
|
patchShare<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, patchObject: SharePatch, raw?: {
|
|
159
130
|
raw: R;
|
|
160
131
|
}): Promise<MaybeRaw<R, Share>>;
|
|
132
|
+
/**
|
|
133
|
+
* Resends share emails to **all recipients** associated with a share.
|
|
134
|
+
*
|
|
135
|
+
* This will trigger the backend to re-send the share notification email
|
|
136
|
+
* to every email address that has previously been invited to the share.
|
|
137
|
+
*
|
|
138
|
+
* @typeParam R - When `true`, the raw Axios response is returned instead of `undefined`
|
|
139
|
+
*
|
|
140
|
+
* @param orgName - The organization identifier
|
|
141
|
+
* @param spaceName - The space identifier within the organization
|
|
142
|
+
* @param shareId - The share ID whose emails should be resent
|
|
143
|
+
* @param raw - Optional flag to return the raw Axios response
|
|
144
|
+
*
|
|
145
|
+
* @returns `undefined` by default, or the raw Axios response when `raw.raw` is `true`
|
|
146
|
+
*/
|
|
147
|
+
resendAllEmails<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, raw?: {
|
|
148
|
+
raw: R;
|
|
149
|
+
}): Promise<MaybeRaw<R, undefined>>;
|
|
150
|
+
/**
|
|
151
|
+
* Resends share emails to **specific recipients** for a share.
|
|
152
|
+
*
|
|
153
|
+
* Only the provided email addresses will receive a new share notification.
|
|
154
|
+
* At least one email address must be provided.
|
|
155
|
+
*
|
|
156
|
+
* @typeParam R - When `true`, the raw Axios response is returned instead of `undefined`
|
|
157
|
+
*
|
|
158
|
+
* @param orgName - The organization identifier
|
|
159
|
+
* @param spaceName - The space identifier within the organization
|
|
160
|
+
* @param shareId - The share ID whose emails should be resent
|
|
161
|
+
* @param emails - A non-empty list of email addresses to resend the share to
|
|
162
|
+
* @param raw - Optional flag to return the raw Axios response
|
|
163
|
+
*
|
|
164
|
+
* @returns `undefined` by default, or the raw Axios response when `raw.raw` is `true`
|
|
165
|
+
*/
|
|
166
|
+
resendEmails<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, emails: [string, ...string[]], raw?: {
|
|
167
|
+
raw: R;
|
|
168
|
+
}): Promise<MaybeRaw<R, undefined>>;
|
|
169
|
+
/**
|
|
170
|
+
* Sends a share email to a **specific recipient** after he clicks a public link.
|
|
171
|
+
*
|
|
172
|
+
*
|
|
173
|
+
* @typeParam R - When `true`, the raw Axios response is returned instead of `undefined`
|
|
174
|
+
*
|
|
175
|
+
* @param orgName - The organization identifier
|
|
176
|
+
* @param spaceName - The space identifier within the organization
|
|
177
|
+
* @param shareId - The share ID whose emails should be resent
|
|
178
|
+
* @param email - The email address of the recipient
|
|
179
|
+
* @param shareIdHMAC - The HMAC of the share ID
|
|
180
|
+
* @param raw - Optional flag to return the raw Axios response
|
|
181
|
+
*
|
|
182
|
+
* @returns `undefined` by default, or the raw Axios response when `raw.raw` is `true`
|
|
183
|
+
*/
|
|
184
|
+
sendShareEmailAfterPublicLinkClick<R extends boolean = false>(orgName: string, spaceName: string, shareId: string, email: string, shareIdHMAC: string, raw?: {
|
|
185
|
+
raw: R;
|
|
186
|
+
}): Promise<MaybeRaw<R, undefined>>;
|
|
161
187
|
}
|
|
@@ -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.CosmoShare = void 0;
|
|
13
|
-
const Base_1 = require("../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
14
17
|
/**
|
|
15
18
|
* @class Share
|
|
16
19
|
* @extends Base
|
|
@@ -59,25 +62,6 @@ class CosmoShare extends Base_1.default {
|
|
|
59
62
|
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Fetch shared Assets.
|
|
64
|
-
* @remarks
|
|
65
|
-
* ** Under development, breaking changes possible**
|
|
66
|
-
* @param orgName Name of the Organization
|
|
67
|
-
* @param spaceName Name of the Space
|
|
68
|
-
* @param shareId The ID of the Share to link
|
|
69
|
-
* @param limit The number of assets to return
|
|
70
|
-
* @param page The page number to return
|
|
71
|
-
* @param namespace The namespace to filter by
|
|
72
|
-
*
|
|
73
|
-
* @returns The created Share
|
|
74
|
-
*/
|
|
75
|
-
fetchSharedAssets(orgName, spaceName, shareId, limit, page, namespace, raw) {
|
|
76
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/shares/${shareId}/assets?limit=${limit}&page=${page}&namespace=${namespace}`));
|
|
78
|
-
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
65
|
/**
|
|
82
66
|
* Delete Shares by ID.
|
|
83
67
|
* @remarks
|
|
@@ -179,21 +163,6 @@ class CosmoShare extends Base_1.default {
|
|
|
179
163
|
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
180
164
|
});
|
|
181
165
|
}
|
|
182
|
-
/**
|
|
183
|
-
* Links one or more users (by email) to a specific share in a space.
|
|
184
|
-
*
|
|
185
|
-
* @param {string} orgName - The name of the organization.
|
|
186
|
-
* @param {string} spaceName - The name of the space.
|
|
187
|
-
* @param {string} shareId - The ID of the share to link to.
|
|
188
|
-
* @param {string[]} emails - An array of email addresses to link to the share.
|
|
189
|
-
* @returns {Promise<Share>} A promise that resolves to the updated share object.
|
|
190
|
-
*/
|
|
191
|
-
linkOther(orgName, spaceName, shareId, emails, raw) {
|
|
192
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
-
const res = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/shares/${shareId}/user`), { users: emails });
|
|
194
|
-
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
166
|
/**
|
|
198
167
|
* Patch a Share in the specified Organization and Space.
|
|
199
168
|
* @remarks
|
|
@@ -211,5 +180,72 @@ class CosmoShare extends Base_1.default {
|
|
|
211
180
|
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
212
181
|
});
|
|
213
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Resends share emails to **all recipients** associated with a share.
|
|
185
|
+
*
|
|
186
|
+
* This will trigger the backend to re-send the share notification email
|
|
187
|
+
* to every email address that has previously been invited to the share.
|
|
188
|
+
*
|
|
189
|
+
* @typeParam R - When `true`, the raw Axios response is returned instead of `undefined`
|
|
190
|
+
*
|
|
191
|
+
* @param orgName - The organization identifier
|
|
192
|
+
* @param spaceName - The space identifier within the organization
|
|
193
|
+
* @param shareId - The share ID whose emails should be resent
|
|
194
|
+
* @param raw - Optional flag to return the raw Axios response
|
|
195
|
+
*
|
|
196
|
+
* @returns `undefined` by default, or the raw Axios response when `raw.raw` is `true`
|
|
197
|
+
*/
|
|
198
|
+
resendAllEmails(orgName, spaceName, shareId, raw) {
|
|
199
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
200
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/shares/${shareId}/email/all`));
|
|
201
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Resends share emails to **specific recipients** for a share.
|
|
206
|
+
*
|
|
207
|
+
* Only the provided email addresses will receive a new share notification.
|
|
208
|
+
* At least one email address must be provided.
|
|
209
|
+
*
|
|
210
|
+
* @typeParam R - When `true`, the raw Axios response is returned instead of `undefined`
|
|
211
|
+
*
|
|
212
|
+
* @param orgName - The organization identifier
|
|
213
|
+
* @param spaceName - The space identifier within the organization
|
|
214
|
+
* @param shareId - The share ID whose emails should be resent
|
|
215
|
+
* @param emails - A non-empty list of email addresses to resend the share to
|
|
216
|
+
* @param raw - Optional flag to return the raw Axios response
|
|
217
|
+
*
|
|
218
|
+
* @returns `undefined` by default, or the raw Axios response when `raw.raw` is `true`
|
|
219
|
+
*/
|
|
220
|
+
resendEmails(orgName, spaceName, shareId, emails, raw) {
|
|
221
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
222
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/shares/${shareId}/email`), { emails });
|
|
223
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Sends a share email to a **specific recipient** after he clicks a public link.
|
|
228
|
+
*
|
|
229
|
+
*
|
|
230
|
+
* @typeParam R - When `true`, the raw Axios response is returned instead of `undefined`
|
|
231
|
+
*
|
|
232
|
+
* @param orgName - The organization identifier
|
|
233
|
+
* @param spaceName - The space identifier within the organization
|
|
234
|
+
* @param shareId - The share ID whose emails should be resent
|
|
235
|
+
* @param email - The email address of the recipient
|
|
236
|
+
* @param shareIdHMAC - The HMAC of the share ID
|
|
237
|
+
* @param raw - Optional flag to return the raw Axios response
|
|
238
|
+
*
|
|
239
|
+
* @returns `undefined` by default, or the raw Axios response when `raw.raw` is `true`
|
|
240
|
+
*/
|
|
241
|
+
sendShareEmailAfterPublicLinkClick(orgName, spaceName, shareId, email, shareIdHMAC, raw) {
|
|
242
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
243
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/shares/${shareId}/email/publicLink`), {
|
|
244
|
+
email,
|
|
245
|
+
shareIdHMAC,
|
|
246
|
+
});
|
|
247
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
248
|
+
});
|
|
249
|
+
}
|
|
214
250
|
}
|
|
215
251
|
exports.CosmoShare = CosmoShare;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
-
import { High5SpaceInfo, CosmoSpace as ICosmoSpace, SpaceUser } from "../../../interfaces/cosmo/space";
|
|
2
|
+
import { High5SpaceInfo, CosmoSpace as ICosmoSpace, SpaceUser, TrashPolicy } from "../../../interfaces/cosmo/space";
|
|
3
3
|
/**
|
|
4
4
|
* @class Space
|
|
5
5
|
* @extends Base
|
|
@@ -101,4 +101,31 @@ export declare class CosmoSpace extends Base {
|
|
|
101
101
|
listSpaceUsers<R extends boolean = false>(orgName: string, spaceName: string, raw?: {
|
|
102
102
|
raw: R;
|
|
103
103
|
}): Promise<MaybeRaw<R, SpaceUser[]>>;
|
|
104
|
+
/**
|
|
105
|
+
* Updates the avatar of the specified Cosmo space
|
|
106
|
+
* @param orgName Name of the organization
|
|
107
|
+
* @param spaceName Name of the space
|
|
108
|
+
* @param file Image as Javascript File
|
|
109
|
+
* @returns Space details with updated avatar
|
|
110
|
+
*/
|
|
111
|
+
updateAvatar<R extends boolean = false>(orgName: string, spaceName: string, file: File, raw?: {
|
|
112
|
+
raw: R;
|
|
113
|
+
}): Promise<MaybeRaw<R, ICosmoSpace>>;
|
|
114
|
+
/**
|
|
115
|
+
* Permanently deletes all items in the trash of the specified Cosmo space
|
|
116
|
+
* @param orgName Name of the organization
|
|
117
|
+
* @param spaceName Name of the space
|
|
118
|
+
* @returns 204 No Content on success
|
|
119
|
+
*/
|
|
120
|
+
emptyTrash(orgName: string, spaceName: string): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Updates the trashbin auto-delete policy for the specified Cosmo space.
|
|
123
|
+
* @param orgName Name of the organization
|
|
124
|
+
* @param spaceName Name of the space
|
|
125
|
+
* @param policy Trash policy to apply. When `enabled` is `true`, `ttlDays` (1–365) must be provided. When `enabled` is `false`, `ttlDays` must be omitted.
|
|
126
|
+
* @returns The updated Space
|
|
127
|
+
*/
|
|
128
|
+
updateTrashbinPolicy<R extends boolean = false>(orgName: string, spaceName: string, policy: TrashPolicy, raw?: {
|
|
129
|
+
raw: R;
|
|
130
|
+
}): Promise<MaybeRaw<R, ICosmoSpace>>;
|
|
104
131
|
}
|
|
@@ -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.CosmoSpace = void 0;
|
|
13
|
-
const Base_1 = require("../../../Base");
|
|
16
|
+
const Base_1 = __importDefault(require("../../../Base"));
|
|
14
17
|
/**
|
|
15
18
|
* @class Space
|
|
16
19
|
* @extends Base
|
|
@@ -142,5 +145,46 @@ class CosmoSpace extends Base_1.default {
|
|
|
142
145
|
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
143
146
|
});
|
|
144
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* Updates the avatar of the specified Cosmo space
|
|
150
|
+
* @param orgName Name of the organization
|
|
151
|
+
* @param spaceName Name of the space
|
|
152
|
+
* @param file Image as Javascript File
|
|
153
|
+
* @returns Space details with updated avatar
|
|
154
|
+
*/
|
|
155
|
+
updateAvatar(orgName, spaceName, file, raw) {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
const data = new FormData();
|
|
158
|
+
data.append("avatar", file);
|
|
159
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/avatar`), data, {
|
|
160
|
+
headers: { "Content-Type": "multipart/form-data" },
|
|
161
|
+
});
|
|
162
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Permanently deletes all items in the trash of the specified Cosmo space
|
|
167
|
+
* @param orgName Name of the organization
|
|
168
|
+
* @param spaceName Name of the space
|
|
169
|
+
* @returns 204 No Content on success
|
|
170
|
+
*/
|
|
171
|
+
emptyTrash(orgName, spaceName) {
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/trash`));
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Updates the trashbin auto-delete policy for the specified Cosmo space.
|
|
178
|
+
* @param orgName Name of the organization
|
|
179
|
+
* @param spaceName Name of the space
|
|
180
|
+
* @param policy Trash policy to apply. When `enabled` is `true`, `ttlDays` (1–365) must be provided. When `enabled` is `false`, `ttlDays` must be omitted.
|
|
181
|
+
* @returns The updated Space
|
|
182
|
+
*/
|
|
183
|
+
updateTrashbinPolicy(orgName, spaceName, policy, raw) {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/trash/policy`), policy);
|
|
186
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
145
189
|
}
|
|
146
190
|
exports.CosmoSpace = CosmoSpace;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
+
import { ICosmoStats } from "../../../interfaces/cosmo/stats";
|
|
3
|
+
/**
|
|
4
|
+
* @class Space
|
|
5
|
+
* @extends Base
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* **Under development, breaking changes possible**
|
|
9
|
+
*
|
|
10
|
+
* Represents a Stats resource in Cosmo, providing get methods to retrieve statistics with the Stats API.
|
|
11
|
+
*/
|
|
12
|
+
export declare class CosmoStats extends Base {
|
|
13
|
+
protected getEndpoint(endpoint: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Fetch org related stats
|
|
16
|
+
* @remarks
|
|
17
|
+
* ** Under development, breaking changes possible**
|
|
18
|
+
* @param orgName Name of the Organization
|
|
19
|
+
* @returns The requested org stats
|
|
20
|
+
*/
|
|
21
|
+
getOrgStats<R extends boolean = false>(orgName: string, raw?: {
|
|
22
|
+
raw: R;
|
|
23
|
+
}): Promise<MaybeRaw<R, ICosmoStats>>;
|
|
24
|
+
/**
|
|
25
|
+
* Fetch space related stats
|
|
26
|
+
* @remarks
|
|
27
|
+
* ** Under development, breaking changes possible**
|
|
28
|
+
* @param orgName Name of the Organization
|
|
29
|
+
* @param spaceName Name of the Space
|
|
30
|
+
* @returns The requested space stats
|
|
31
|
+
*/
|
|
32
|
+
getSpaceStats<R extends boolean = false>(orgName: string, spaceName: string, raw?: {
|
|
33
|
+
raw: R;
|
|
34
|
+
}): Promise<MaybeRaw<R, ICosmoStats>>;
|
|
35
|
+
}
|