hcloud-sdk 17.0.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changelog.md +176 -76
- package/lib/Base.d.ts +2 -1
- package/lib/Hcloud.d.ts +6 -3
- package/lib/Hcloud.js +16 -5
- package/lib/helper/ValidationHelper.d.ts +10 -2
- package/lib/helper/ValidationHelper.js +55 -7
- package/lib/interfaces/auditor/index.d.ts +13 -2
- package/lib/interfaces/auditor/index.js +9 -1
- package/lib/interfaces/cosmo/asset/index.d.ts +185 -0
- package/lib/interfaces/cosmo/asset/index.js +82 -0
- package/lib/interfaces/cosmo/comment/index.d.ts +38 -0
- package/lib/interfaces/cosmo/comment/index.js +8 -0
- package/lib/interfaces/cosmo/event/index.d.ts +31 -0
- package/lib/interfaces/cosmo/event/index.js +17 -0
- package/lib/interfaces/cosmo/location/index.d.ts +4 -0
- package/lib/interfaces/cosmo/namespace/index.d.ts +9 -0
- package/lib/interfaces/cosmo/namespace/index.js +9 -0
- package/lib/interfaces/cosmo/permissions.d.ts +96 -0
- package/lib/interfaces/cosmo/permissions.js +58 -0
- package/lib/interfaces/cosmo/share/index.d.ts +28 -0
- package/lib/interfaces/cosmo/share/index.js +2 -0
- package/lib/interfaces/cosmo/space/index.d.ts +25 -0
- package/lib/interfaces/cosmo/space/index.js +2 -0
- package/lib/interfaces/cosmo/tag/tag.d.ts +12 -0
- package/lib/interfaces/cosmo/tag/tag.js +2 -0
- package/lib/interfaces/global/Products.d.ts +2 -2
- package/lib/interfaces/global/Products.js +1 -1
- package/lib/interfaces/high5/index.d.ts +7 -7
- package/lib/interfaces/high5/index.js +7 -7
- package/lib/interfaces/{friday → high5}/space/database/document/index.d.ts +1 -1
- package/lib/interfaces/{friday → high5}/space/database/document/index.js +2 -1
- package/lib/interfaces/high5/space/database/index.js +2 -0
- package/lib/interfaces/high5/space/event/stream/design/StreamDesign.d.ts +9 -2
- package/lib/interfaces/high5/space/execution/index.d.ts +2 -1
- package/lib/interfaces/high5/space/job/JobLog.d.ts +16 -0
- package/lib/interfaces/high5/space/job/JobLog.js +2 -0
- package/lib/interfaces/high5/space/job/index.d.ts +38 -0
- package/lib/interfaces/high5/space/job/index.js +8 -0
- package/lib/interfaces/high5/stats.d.ts +21 -0
- package/lib/interfaces/high5/stats.js +2 -0
- package/lib/interfaces/idp/oauth/index.d.ts +4 -3
- package/lib/interfaces/idp/organization/index.d.ts +1 -0
- package/lib/interfaces/idp/organization/index.js +1 -0
- package/lib/interfaces/idp/organization/license/index.d.ts +13 -11
- package/lib/interfaces/idp/organization/member/index.d.ts +1 -0
- package/lib/interfaces/idp/organization/stats.d.ts +7 -0
- package/lib/interfaces/idp/organization/stats.js +2 -0
- package/lib/interfaces/idp/organization/team/index.d.ts +0 -1
- package/lib/interfaces/idp/user/Message.d.ts +21 -0
- package/lib/interfaces/idp/user/Message.js +14 -0
- package/lib/interfaces/idp/user/NotificationSettings.d.ts +1 -0
- package/lib/interfaces/idp/user/Scopes.d.ts +1 -7
- package/lib/interfaces/idp/user/Scopes.js +0 -9
- package/lib/interfaces/idp/user/index.d.ts +2 -1
- package/lib/interfaces/mailer/index.d.ts +30 -1
- package/lib/interfaces/mailer/index.js +87 -1
- package/lib/interfaces/mothership/index.d.ts +3 -1
- package/lib/interfaces/mothership/index.js +15 -0
- package/lib/interfaces/mothership/stats.d.ts +4 -0
- package/lib/interfaces/mothership/stats.js +2 -0
- package/lib/interfaces/nats/index.d.ts +54 -24
- package/lib/interfaces/nats/index.js +87 -58
- package/lib/interfaces/shorts/index.d.ts +10 -0
- package/lib/interfaces/shorts/index.js +2 -0
- package/lib/service/agent/bundle/dev/index.d.ts +16 -6
- package/lib/service/agent/bundle/dev/index.js +12 -10
- package/lib/service/agent/bundle/index.d.ts +10 -4
- package/lib/service/agent/bundle/index.js +6 -6
- package/lib/service/agent/context/index.d.ts +22 -8
- package/lib/service/agent/context/index.js +15 -14
- package/lib/service/auditor/index.d.ts +8 -4
- package/lib/service/auditor/index.js +5 -5
- package/lib/service/auditor/internal/index.d.ts +27 -3
- package/lib/service/auditor/internal/index.js +34 -5
- package/lib/service/bouncer/features/index.d.ts +4 -2
- package/lib/service/bouncer/features/index.js +2 -2
- package/lib/service/cosmo/asset/index.d.ts +219 -0
- package/lib/service/cosmo/asset/index.js +314 -0
- package/lib/service/cosmo/comment/index.d.ts +122 -0
- package/lib/service/cosmo/comment/index.js +161 -0
- package/lib/service/cosmo/event/index.d.ts +23 -0
- package/lib/service/cosmo/event/index.js +40 -0
- package/lib/service/cosmo/folder/index.d.ts +27 -0
- package/lib/service/cosmo/folder/index.js +47 -0
- package/lib/service/cosmo/index.d.ts +49 -0
- package/lib/service/cosmo/index.js +119 -0
- package/lib/service/cosmo/internal/index.d.ts +7 -0
- package/lib/service/cosmo/internal/index.js +17 -0
- package/lib/service/cosmo/internal/space/index.d.ts +15 -0
- package/lib/service/cosmo/internal/space/index.js +34 -0
- package/lib/service/cosmo/location/index.d.ts +40 -0
- package/lib/service/cosmo/location/index.js +63 -0
- package/lib/service/cosmo/namespace/index.d.ts +42 -0
- package/lib/service/cosmo/namespace/index.js +65 -0
- package/lib/service/cosmo/organization/index.d.ts +47 -0
- package/lib/service/cosmo/organization/index.js +64 -0
- package/lib/service/cosmo/permissions/index.d.ts +131 -0
- package/lib/service/cosmo/permissions/index.js +181 -0
- package/lib/service/cosmo/production/index.d.ts +26 -0
- package/lib/service/cosmo/production/index.js +45 -0
- package/lib/service/cosmo/share/index.d.ts +161 -0
- package/lib/service/cosmo/share/index.js +215 -0
- package/lib/service/cosmo/space/index.d.ts +104 -0
- package/lib/service/cosmo/space/index.js +146 -0
- package/lib/service/cosmo/tag/index.d.ts +67 -0
- package/lib/service/cosmo/tag/index.js +93 -0
- package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +10 -4
- package/lib/service/dali/avatar/DaliCosmoSpace.js +8 -7
- package/lib/service/dali/avatar/DaliFuseSpace.d.ts +10 -4
- package/lib/service/dali/avatar/DaliFuseSpace.js +7 -6
- package/lib/service/dali/avatar/DaliHigh5Pool.d.ts +10 -4
- package/lib/service/dali/avatar/DaliHigh5Pool.js +7 -6
- package/lib/service/dali/avatar/DaliHigh5Space.d.ts +10 -4
- package/lib/service/dali/avatar/DaliHigh5Space.js +7 -6
- package/lib/service/dali/avatar/DaliOAuthApp.d.ts +10 -4
- package/lib/service/dali/avatar/DaliOAuthApp.js +7 -6
- package/lib/service/dali/avatar/DaliOrganization.d.ts +10 -4
- package/lib/service/dali/avatar/DaliOrganization.js +7 -6
- package/lib/service/dali/avatar/DaliServiceAccount.d.ts +10 -4
- package/lib/service/dali/avatar/DaliServiceAccount.js +7 -6
- package/lib/service/dali/avatar/DaliTeam.d.ts +10 -4
- package/lib/service/dali/avatar/DaliTeam.js +7 -6
- package/lib/service/dali/avatar/DaliUser.d.ts +10 -4
- package/lib/service/dali/avatar/DaliUser.js +7 -6
- package/lib/service/dali/index.d.ts +4 -5
- package/lib/service/dali/index.js +2 -5
- package/lib/service/fuse/index.d.ts +4 -2
- package/lib/service/fuse/index.js +2 -2
- package/lib/service/fuse/internal/index.d.ts +4 -2
- package/lib/service/fuse/internal/index.js +3 -2
- package/lib/service/fuse/internal/space/cronjob/log/index.d.ts +4 -2
- package/lib/service/fuse/internal/space/cronjob/log/index.js +2 -2
- package/lib/service/fuse/internal/space/index.d.ts +7 -3
- package/lib/service/fuse/internal/space/index.js +6 -4
- package/lib/service/fuse/space/cronjob/index.d.ts +35 -13
- package/lib/service/fuse/space/cronjob/index.js +48 -50
- package/lib/service/fuse/space/cronjob/log/index.d.ts +8 -4
- package/lib/service/fuse/space/cronjob/log/index.js +5 -5
- package/lib/service/fuse/space/index.d.ts +27 -11
- package/lib/service/fuse/space/index.js +19 -18
- package/lib/service/high5/execution/index.d.ts +4 -2
- package/lib/service/high5/execution/index.js +3 -2
- package/lib/service/high5/execution/status/index.d.ts +5 -3
- package/lib/service/high5/execution/status/index.js +3 -3
- package/lib/service/high5/index.d.ts +7 -2
- package/lib/service/high5/index.js +9 -2
- package/lib/service/high5/internal/index.d.ts +4 -2
- package/lib/service/high5/internal/index.js +3 -2
- package/lib/service/high5/internal/space/index.d.ts +10 -3
- package/lib/service/high5/internal/space/index.js +13 -4
- package/lib/service/high5/internal/space/job/index.d.ts +7 -0
- package/lib/service/high5/internal/space/job/index.js +17 -0
- package/lib/service/high5/internal/space/job/log/index.d.ts +17 -0
- package/lib/service/high5/internal/space/job/log/index.js +34 -0
- package/lib/service/high5/joinToken/index.d.ts +14 -6
- package/lib/service/high5/joinToken/index.js +10 -9
- package/lib/service/high5/space/database/document/array/index.d.ts +73 -0
- package/lib/service/high5/space/database/document/array/index.js +102 -0
- package/lib/service/{friday → high5}/space/database/document/index.d.ts +26 -10
- package/lib/service/{friday → high5}/space/database/document/index.js +31 -16
- package/lib/service/high5/space/database/document/number/index.d.ts +51 -0
- package/lib/service/high5/space/database/document/number/index.js +77 -0
- package/lib/service/{friday → high5}/space/database/index.d.ts +22 -12
- package/lib/service/{friday → high5}/space/database/index.js +18 -17
- package/lib/service/high5/space/event/index.d.ts +17 -7
- package/lib/service/high5/space/event/index.js +12 -11
- package/lib/service/high5/space/event/stream/design/DesignOperations.d.ts +4 -2
- package/lib/service/high5/space/event/stream/design/DesignOperations.js +2 -2
- package/lib/service/high5/space/event/stream/design/index.d.ts +10 -4
- package/lib/service/high5/space/event/stream/design/index.js +7 -6
- package/lib/service/high5/space/event/stream/design/snapshot/index.d.ts +16 -6
- package/lib/service/high5/space/event/stream/design/snapshot/index.js +12 -10
- package/lib/service/high5/space/event/stream/index.d.ts +32 -12
- package/lib/service/high5/space/event/stream/index.js +22 -21
- package/lib/service/high5/space/execution/index.d.ts +19 -7
- package/lib/service/high5/space/execution/index.js +17 -12
- package/lib/service/high5/space/execution/log/index.d.ts +8 -4
- package/lib/service/high5/space/execution/log/index.js +5 -5
- package/lib/service/high5/space/execution/status/index.d.ts +7 -3
- package/lib/service/high5/space/execution/status/index.js +4 -4
- package/lib/service/high5/space/index.d.ts +43 -14
- package/lib/service/high5/space/index.js +45 -23
- package/lib/service/high5/space/job/index.d.ts +145 -0
- package/lib/service/high5/space/job/index.js +201 -0
- package/lib/service/high5/space/job/log/index.d.ts +35 -0
- package/lib/service/high5/space/job/log/index.js +58 -0
- package/lib/service/high5/space/node/index.d.ts +20 -8
- package/lib/service/high5/space/node/index.js +14 -13
- package/lib/service/high5/space/pool/index.d.ts +27 -11
- package/lib/service/high5/space/pool/index.js +19 -18
- package/lib/service/high5/space/secret/index.d.ts +17 -7
- package/lib/service/high5/space/secret/index.js +12 -11
- package/lib/service/high5/space/stat/index.d.ts +12 -0
- package/lib/service/high5/space/stat/index.js +31 -0
- package/lib/service/high5/space/wave/index.d.ts +16 -6
- package/lib/service/high5/space/wave/index.js +11 -10
- package/lib/service/high5/space/webhook/index.d.ts +32 -12
- package/lib/service/high5/space/webhook/index.js +25 -21
- package/lib/service/high5/space/webhook/log/index.d.ts +4 -2
- package/lib/service/high5/space/webhook/log/index.js +2 -2
- package/lib/service/high5/stat/index.d.ts +11 -0
- package/lib/service/high5/stat/index.js +30 -0
- package/lib/service/high5/wave/s3/index.d.ts +31 -8
- package/lib/service/high5/wave/s3/index.js +42 -21
- package/lib/service/idp/guest/index.d.ts +42 -0
- package/lib/service/idp/guest/index.js +66 -0
- package/lib/service/idp/index.d.ts +25 -7
- package/lib/service/idp/index.js +23 -12
- package/lib/service/idp/internal/index.d.ts +5 -3
- package/lib/service/idp/internal/index.js +5 -3
- package/lib/service/idp/oauth/index.d.ts +16 -6
- package/lib/service/idp/oauth/index.js +15 -15
- package/lib/service/idp/organization/index.d.ts +19 -5
- package/lib/service/idp/organization/index.js +19 -8
- package/lib/service/idp/organization/license/index.d.ts +7 -3
- package/lib/service/idp/organization/license/index.js +4 -4
- package/lib/service/idp/organization/member/index.d.ts +20 -8
- package/lib/service/idp/organization/member/index.js +15 -13
- package/lib/service/idp/organization/member/invitations/index.d.ts +23 -9
- package/lib/service/idp/organization/member/invitations/index.js +72 -59
- package/lib/service/idp/organization/service-accounts/index.d.ts +20 -8
- package/lib/service/idp/organization/service-accounts/index.js +13 -12
- package/lib/service/idp/organization/settings/domain/index.d.ts +13 -5
- package/lib/service/idp/organization/settings/domain/index.js +9 -8
- package/lib/service/idp/organization/settings/domain/saml/index.d.ts +16 -6
- package/lib/service/idp/organization/settings/domain/saml/index.js +19 -18
- package/lib/service/idp/organization/settings/oauth/index.d.ts +23 -9
- package/lib/service/idp/organization/settings/oauth/index.js +16 -15
- package/lib/service/idp/organization/stat/index.d.ts +11 -0
- package/lib/service/idp/organization/stat/index.js +30 -0
- package/lib/service/idp/organization/team/index.d.ts +22 -10
- package/lib/service/idp/organization/team/index.js +14 -13
- package/lib/service/idp/registration/index.d.ts +10 -4
- package/lib/service/idp/registration/index.js +15 -9
- package/lib/service/idp/user/index.d.ts +33 -11
- package/lib/service/idp/user/index.js +29 -16
- package/lib/service/idp/user/license/index.d.ts +7 -3
- package/lib/service/idp/user/license/index.js +4 -4
- package/lib/service/idp/user/message/index.d.ts +61 -0
- package/lib/service/idp/user/message/index.js +92 -0
- package/lib/service/idp/user/password/index.d.ts +4 -2
- package/lib/service/idp/user/password/index.js +2 -2
- package/lib/service/idp/user/settings/connections/index.d.ts +4 -2
- package/lib/service/idp/user/settings/connections/index.js +2 -2
- package/lib/service/idp/user/settings/general/index.d.ts +10 -4
- package/lib/service/idp/user/settings/general/index.js +6 -6
- package/lib/service/idp/user/settings/notifications/index.d.ts +7 -3
- package/lib/service/idp/user/settings/notifications/index.js +4 -4
- package/lib/service/idp/user/settings/oauthApps/index.d.ts +7 -3
- package/lib/service/idp/user/settings/oauthApps/index.js +6 -5
- package/lib/service/idp/user/settings/pats/index.d.ts +22 -8
- package/lib/service/idp/user/settings/pats/index.js +17 -15
- package/lib/service/idp/user/settings/twoFactor/totp/index.d.ts +16 -6
- package/lib/service/idp/user/settings/twoFactor/totp/index.js +13 -10
- package/lib/service/mailer/index.d.ts +4 -2
- package/lib/service/mailer/index.js +2 -2
- package/lib/service/mailer/internal/index.d.ts +13 -5
- package/lib/service/mailer/internal/index.js +8 -8
- package/lib/service/mothership/index.d.ts +35 -13
- package/lib/service/mothership/index.js +32 -17
- package/lib/service/nats/index.js +58 -43
- package/lib/service/shorts/index.d.ts +18 -0
- package/lib/service/{friday → shorts}/index.js +13 -10
- package/lib/service/shorts/internal/index.d.ts +72 -0
- package/lib/service/shorts/internal/index.js +104 -0
- package/package.json +1 -1
- package/lib/interfaces/friday/index.d.ts +0 -3
- package/lib/interfaces/friday/index.js +0 -19
- package/lib/interfaces/friday/space/index.d.ts +0 -21
- package/lib/interfaces/friday/space/index.js +0 -11
- package/lib/service/friday/index.d.ts +0 -13
- package/lib/service/friday/space/index.d.ts +0 -81
- package/lib/service/friday/space/index.js +0 -150
- /package/lib/interfaces/{friday/space/database → cosmo/location}/index.js +0 -0
- /package/lib/interfaces/{friday → high5}/space/database/index.d.ts +0 -0
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CosmoAsset = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
/**
|
|
15
|
+
* @class Asset
|
|
16
|
+
* @extends Base
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* **Under development, breaking changes possible**
|
|
20
|
+
*
|
|
21
|
+
* Represents an Asset resource in Cosmo, providing methods to interact with the Asset API.
|
|
22
|
+
*/
|
|
23
|
+
class CosmoAsset extends Base_1.default {
|
|
24
|
+
getEndpoint(endpoint) {
|
|
25
|
+
return `${this.options.server}/api/cosmo${endpoint}`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a new Asset in Cosmo inside the specified Organization and Space.
|
|
29
|
+
* @remarks
|
|
30
|
+
* ** Under development, breaking changes possible**
|
|
31
|
+
* @param orgName Name of the Organization
|
|
32
|
+
* @param spaceName Name of the Space
|
|
33
|
+
* @param createAsset The Asset to be created
|
|
34
|
+
* @returns The created asset
|
|
35
|
+
*/
|
|
36
|
+
createAsset(orgName, spaceName, createAsset, raw) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets`), createAsset);
|
|
39
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Bulk move or copy multiple assets to a new parent.
|
|
44
|
+
* @remarks
|
|
45
|
+
* ** Under development, breaking changes possible**
|
|
46
|
+
* @param orgName Name of the Organization
|
|
47
|
+
* @param spaceName Name of the Space
|
|
48
|
+
* @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.
|
|
49
|
+
* @param assetIdList List of Asset IDs to be moved to trash
|
|
50
|
+
* @param copy Whether to copy (true) or move (false) the assets
|
|
51
|
+
* @returns The moved assets
|
|
52
|
+
*/
|
|
53
|
+
bulkMove(orgName_1, spaceName_1, assetIdList_1, newParentId_1) {
|
|
54
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, assetIdList, newParentId, copy = false, raw) {
|
|
55
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/bulk-move-copy`), {
|
|
56
|
+
assetIds: assetIdList,
|
|
57
|
+
parentId: newParentId,
|
|
58
|
+
copy: copy,
|
|
59
|
+
});
|
|
60
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Attach an asset to a location.
|
|
65
|
+
* @remarks
|
|
66
|
+
* ** Under development, breaking changes possible**
|
|
67
|
+
* @param orgName Name of the Organization
|
|
68
|
+
* @param spaceName Name of the Space
|
|
69
|
+
* @param assetId ID of the Asset to be attached
|
|
70
|
+
* @param locationId ID of the Location to which the Asset will be attached to
|
|
71
|
+
* @returns 204 No Content if successful
|
|
72
|
+
*/
|
|
73
|
+
attachAssetToLocation(orgName, spaceName, assetId, locationId, raw) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/location`), {
|
|
76
|
+
locationId: locationId,
|
|
77
|
+
});
|
|
78
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Patch an asset.
|
|
83
|
+
* @remarks
|
|
84
|
+
* ** Under development, breaking changes possible**
|
|
85
|
+
* @param orgName Name of the Organization
|
|
86
|
+
* @param spaceName Name of the Space
|
|
87
|
+
* @param assetId ID of the Asset to be attached
|
|
88
|
+
* @param patchAsset The Asset to be patched
|
|
89
|
+
* @returns The patched asset
|
|
90
|
+
*/
|
|
91
|
+
patchAsset(orgName, spaceName, assetId, patchAsset, raw) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}`), patchAsset);
|
|
94
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get an asset by its ID.
|
|
99
|
+
* @remarks
|
|
100
|
+
* ** Under development, breaking changes possible**
|
|
101
|
+
* @param orgName Name of the Organization
|
|
102
|
+
* @param spaceName Name of the Space
|
|
103
|
+
* @param assetId ID of the Asset to be attached
|
|
104
|
+
* @param namespace Optional Namespaces of which information should be included in the returned object
|
|
105
|
+
* @param includePermissions Whether to include permissions in the result or not
|
|
106
|
+
* @returns The requested asset
|
|
107
|
+
*/
|
|
108
|
+
getAsset(orgName_1, spaceName_1, assetId_1, namespace_1) {
|
|
109
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, assetId, namespace, includePermissions = false, raw) {
|
|
110
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}`), {
|
|
111
|
+
params: {
|
|
112
|
+
namespace,
|
|
113
|
+
permissions: includePermissions ? "true" : "false",
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Delete multiple assets permanently by their IDs.
|
|
121
|
+
* @remarks
|
|
122
|
+
* ** Under development, breaking changes possible**
|
|
123
|
+
* @param orgName Name of the Organization
|
|
124
|
+
* @param spaceName Name of the Space
|
|
125
|
+
* @param assetIds IDs of the Assets to delete
|
|
126
|
+
* @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
|
|
127
|
+
* @returns 204 No Content if successful
|
|
128
|
+
*/
|
|
129
|
+
deleteAssets(orgName, spaceName, assetIds, force, raw) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets`), {
|
|
132
|
+
data: { assetIds },
|
|
133
|
+
params: { force },
|
|
134
|
+
});
|
|
135
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Request download URLs for multiple assets.
|
|
140
|
+
* @remarks
|
|
141
|
+
* ** Under development, breaking changes possible**
|
|
142
|
+
* @param orgName Name of the Organization
|
|
143
|
+
* @param spaceName Name of the Space
|
|
144
|
+
* @param assetIdList List of Asset IDs for which download URLs are requested
|
|
145
|
+
* @param resolution The desired resolution for the download URLs
|
|
146
|
+
* @returns A map of Asset IDs to their download URLs
|
|
147
|
+
*/
|
|
148
|
+
requestDownloadUrls(orgName, spaceName, assetIdList, resolution, raw) {
|
|
149
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
150
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/downloadUrls`), {
|
|
151
|
+
assetIds: assetIdList,
|
|
152
|
+
resolution: resolution,
|
|
153
|
+
});
|
|
154
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Upload an asset.
|
|
159
|
+
* @remarks
|
|
160
|
+
* ** Under development, breaking changes possible**
|
|
161
|
+
* ** Check this endpoint for currency as it looks outdated.**
|
|
162
|
+
* @param token An upload token for the asset
|
|
163
|
+
* @returns The uploaded asset
|
|
164
|
+
*/
|
|
165
|
+
uploadAsset(token, raw) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/assets/upload?${token}`));
|
|
168
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Move assets to the trash bin.
|
|
173
|
+
* @remarks
|
|
174
|
+
* ** Under development, breaking changes possible**
|
|
175
|
+
* @param orgName Name of the Organization
|
|
176
|
+
* @param spaceName Name of the Space
|
|
177
|
+
* @param assetIdList List of Asset IDs to be moved to trash
|
|
178
|
+
* @returns The moved assets
|
|
179
|
+
*/
|
|
180
|
+
moveAssetsToTrash(orgName, spaceName, assetIdList, raw) {
|
|
181
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
182
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/trash`), {
|
|
183
|
+
assetIds: assetIdList,
|
|
184
|
+
});
|
|
185
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Fetch permissions for a group of assets.
|
|
190
|
+
* @remarks
|
|
191
|
+
* ** Under development, breaking changes possible**
|
|
192
|
+
* @param orgName Name of the Organization
|
|
193
|
+
* @param spaceName Name of the Space
|
|
194
|
+
* @param assetIdList List of Asset IDs to be moved to trash
|
|
195
|
+
* @returns A map of Asset IDs to their permissions
|
|
196
|
+
*/
|
|
197
|
+
fetchAssetPermissions(orgName, spaceName, assetIdList, raw) {
|
|
198
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
199
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/permissions`), {
|
|
200
|
+
assetIds: assetIdList,
|
|
201
|
+
});
|
|
202
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Fetches the activity log for a specific asset within a given organization and space.
|
|
207
|
+
*
|
|
208
|
+
* @param {string} orgName - The name of the organization that owns the space.
|
|
209
|
+
* @param {string} spaceName - The name of the space containing the asset.
|
|
210
|
+
* @param {string} assetId - The unique identifier of the asset whose activity is being fetched.
|
|
211
|
+
* @param {number} limit - The maximum number of audit log entries to retrieve per page.
|
|
212
|
+
* @param {number} page - The page number to retrieve (for pagination).
|
|
213
|
+
* @returns {Promise<AuditLog[]>} A promise that resolves to an array of `AuditLog` objects representing the asset’s activity history.
|
|
214
|
+
*/
|
|
215
|
+
fetchAssetActivity(orgName, spaceName, assetId, limit, page, raw) {
|
|
216
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/activity`), {
|
|
218
|
+
params: {
|
|
219
|
+
limit,
|
|
220
|
+
page,
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Rename an asset.
|
|
228
|
+
* @remarks
|
|
229
|
+
* ** Under development, breaking changes possible**
|
|
230
|
+
* @param orgName Name of the Organization
|
|
231
|
+
* @param spaceName Name of the Space
|
|
232
|
+
* @param assetId ID of the Asset to be renamed
|
|
233
|
+
* @returns The renamed asset
|
|
234
|
+
*/
|
|
235
|
+
renameAsset(orgName, spaceName, assetId, newName, raw) {
|
|
236
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/name`), {
|
|
238
|
+
name: newName,
|
|
239
|
+
});
|
|
240
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Move assets out of trash and therewith recover them.
|
|
245
|
+
* @remarks
|
|
246
|
+
* ** Under development, breaking changes possible**
|
|
247
|
+
* @param orgName Name of the Organization
|
|
248
|
+
* @param spaceName Name of the Space
|
|
249
|
+
* @param assetIdList List of Asset IDs to be moved out of trash
|
|
250
|
+
* @returns The moved assets
|
|
251
|
+
*/
|
|
252
|
+
moveAssetsOutOfTrash(orgName, spaceName, assetIdList, raw) {
|
|
253
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
254
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/trash`), {
|
|
255
|
+
data: {
|
|
256
|
+
assetIds: assetIdList,
|
|
257
|
+
},
|
|
258
|
+
});
|
|
259
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Attach a tag to an asset or replace an existing one.
|
|
264
|
+
* @remarks
|
|
265
|
+
* ** Under development, breaking changes possible**
|
|
266
|
+
* @param orgName Name of the Organization
|
|
267
|
+
* @param spaceName Name of the Space
|
|
268
|
+
* @param namespaceName Name of the namespace
|
|
269
|
+
* @param assetId ID of the Asset to be attached
|
|
270
|
+
* @param tagName Name of the tag
|
|
271
|
+
* @returns The updated asset
|
|
272
|
+
*/
|
|
273
|
+
attachTagToAsset(orgName, spaceName, namespaceName, assetId, tagName, raw) {
|
|
274
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
275
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/assets/${assetId}/tags/${tagName}`));
|
|
276
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Remove a tag from an asset.
|
|
281
|
+
* @remarks
|
|
282
|
+
* ** Under development, breaking changes possible**
|
|
283
|
+
* @param orgName Name of the Organization
|
|
284
|
+
* @param spaceName Name of the Space
|
|
285
|
+
* @param namespaceName Name of the Namespace
|
|
286
|
+
* @param assetId ID of the Asset to be attached
|
|
287
|
+
* @returns The updated asset
|
|
288
|
+
*/
|
|
289
|
+
removeTagFromAsset(orgName, spaceName, namespaceName, assetId, raw) {
|
|
290
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
291
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/assets/${assetId}/tags`));
|
|
292
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* List users allowed to be mentioned in a comment of an asset.
|
|
297
|
+
* @param assetId ID of the Asset
|
|
298
|
+
* @param limit Maximum number of users to return
|
|
299
|
+
* @param page Page number for pagination
|
|
300
|
+
* @returns A list of users allowed to be mentioned in a comment of the asset
|
|
301
|
+
*/
|
|
302
|
+
listUsersAllowedToMention(orgName, spaceName, assetId, limit, page, raw) {
|
|
303
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
304
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/assets/${assetId}/users`), {
|
|
305
|
+
params: {
|
|
306
|
+
limit,
|
|
307
|
+
page,
|
|
308
|
+
},
|
|
309
|
+
});
|
|
310
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
exports.CosmoAsset = CosmoAsset;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
+
import { Comment, CreateComment, EditComment, Reply } from "../../../interfaces/cosmo/comment";
|
|
3
|
+
/**
|
|
4
|
+
* @class Comment
|
|
5
|
+
* @extends Base
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* **Under development, breaking changes possible**
|
|
9
|
+
*
|
|
10
|
+
* Represents a Comment resource in Cosmo, providing methods to interact with the Comment API.
|
|
11
|
+
*/
|
|
12
|
+
export declare class CosmoComment extends Base {
|
|
13
|
+
protected getEndpoint(endpoint: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new Comment in the specified Organization, Space and Namespace for a specific Asset Reference.
|
|
16
|
+
* @remarks
|
|
17
|
+
* ** Under development, breaking changes possible**
|
|
18
|
+
* @param orgName Name of the Organization
|
|
19
|
+
* @param spaceName Name of the Space
|
|
20
|
+
* @param namespaceName Name of the Namespace
|
|
21
|
+
* @param comment Content of the Comment to create
|
|
22
|
+
* @param annotation Whether to include annotations in the response
|
|
23
|
+
* @returns The created Comment
|
|
24
|
+
*/
|
|
25
|
+
createComment<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, comment: CreateComment, annotation?: boolean, raw?: {
|
|
26
|
+
raw: R;
|
|
27
|
+
}): Promise<MaybeRaw<R, Comment | Reply>>;
|
|
28
|
+
/**
|
|
29
|
+
* List Comments
|
|
30
|
+
* @remarks
|
|
31
|
+
* ** Under development, breaking changes possible**
|
|
32
|
+
* @param orgName Name of the Organization
|
|
33
|
+
* @param spaceName Name of the Space
|
|
34
|
+
* @param namespaceName Name of the Namespace
|
|
35
|
+
* @param limit Maximum number of comments to return
|
|
36
|
+
* @param page Page number for pagination
|
|
37
|
+
* @param annotation Whether to include annotations in the response
|
|
38
|
+
* @param replySample Amount of replies to load
|
|
39
|
+
*
|
|
40
|
+
* @returns A list of Comments
|
|
41
|
+
*/
|
|
42
|
+
listComments<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, refId: string, limit?: number, page?: number, annotation?: boolean, replySample?: number, raw?: {
|
|
43
|
+
raw: R;
|
|
44
|
+
}): Promise<MaybeRaw<R, Comment[]>>;
|
|
45
|
+
/**
|
|
46
|
+
* Edit a Comment
|
|
47
|
+
* @remarks
|
|
48
|
+
* ** Under development, breaking changes possible**
|
|
49
|
+
* @param orgName Name of the Organization
|
|
50
|
+
* @param spaceName Name of the Space
|
|
51
|
+
* @param namespaceName Name of the Namespace
|
|
52
|
+
* @param commentId ID of the Comment to edit
|
|
53
|
+
* @param editComment Content of the Comment to edit
|
|
54
|
+
* @param annotation Whether to include annotations in the response
|
|
55
|
+
*
|
|
56
|
+
* @returns The edited Comment
|
|
57
|
+
*/
|
|
58
|
+
editComment<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, commentId: string, editComment: EditComment, annotation?: boolean, raw?: {
|
|
59
|
+
raw: R;
|
|
60
|
+
}): Promise<MaybeRaw<R, Comment | Reply>>;
|
|
61
|
+
/**
|
|
62
|
+
* Get a single Comment by ID
|
|
63
|
+
* @remarks
|
|
64
|
+
* ** Under development, breaking changes possible**
|
|
65
|
+
* @param orgName Name of the Organization
|
|
66
|
+
* @param spaceName Name of the Space
|
|
67
|
+
* @param namespaceName Name of the Namespace
|
|
68
|
+
* @param commentId ID of the Comment to edit
|
|
69
|
+
* @param annotation Whether to include annotations in the response
|
|
70
|
+
*
|
|
71
|
+
* @returns The requested Comment
|
|
72
|
+
*/
|
|
73
|
+
getComment<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, commentId: string, annotation?: boolean, raw?: {
|
|
74
|
+
raw: R;
|
|
75
|
+
}): Promise<MaybeRaw<R, Comment | Reply>>;
|
|
76
|
+
/**
|
|
77
|
+
* Delete Comments by ID
|
|
78
|
+
* @remarks
|
|
79
|
+
* ** Under development, breaking changes possible**
|
|
80
|
+
* @param orgName Name of the Organization
|
|
81
|
+
* @param spaceName Name of the Space
|
|
82
|
+
* @param namespaceName Name of the Namespace
|
|
83
|
+
* @param commentIds IDs of the Comments to delete
|
|
84
|
+
*
|
|
85
|
+
* @returns 204 No Content on success
|
|
86
|
+
*/
|
|
87
|
+
deleteComment<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, commentIds: string[], raw?: {
|
|
88
|
+
raw: R;
|
|
89
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
90
|
+
/**
|
|
91
|
+
* Edit a Comments text
|
|
92
|
+
* @remarks
|
|
93
|
+
* ** Under development, breaking changes possible**
|
|
94
|
+
* @param orgName Name of the Organization
|
|
95
|
+
* @param spaceName Name of the Space
|
|
96
|
+
* @param namespaceName Name of the Namespace
|
|
97
|
+
* @param commentId ID of the Comment to edit
|
|
98
|
+
* @param text New text for the Comment
|
|
99
|
+
* @param annotation Whether to include annotations in the response
|
|
100
|
+
*
|
|
101
|
+
* @returns The edited Comment
|
|
102
|
+
*/
|
|
103
|
+
editCommentText<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, commentId: string, text: string, annotation?: boolean, raw?: {
|
|
104
|
+
raw: R;
|
|
105
|
+
}): Promise<MaybeRaw<R, Comment | Reply>>;
|
|
106
|
+
/**
|
|
107
|
+
* Edit a Comments annotation
|
|
108
|
+
* @remarks
|
|
109
|
+
* ** Under development, breaking changes possible**
|
|
110
|
+
* @param orgName Name of the Organization
|
|
111
|
+
* @param spaceName Name of the Space
|
|
112
|
+
* @param namespaceName Name of the Namespace
|
|
113
|
+
* @param commentId ID of the Comment to edit
|
|
114
|
+
* @param newAnnotationContent New annotation for the Comment
|
|
115
|
+
* @param annotation Whether to include annotations in the response
|
|
116
|
+
*
|
|
117
|
+
* @returns The edited Comment
|
|
118
|
+
*/
|
|
119
|
+
editCommentAnnotation<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, commentId: string, newAnnotationContent: string, annotation?: boolean, raw?: {
|
|
120
|
+
raw: R;
|
|
121
|
+
}): Promise<MaybeRaw<R, Comment | Reply>>;
|
|
122
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CosmoComment = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
/**
|
|
15
|
+
* @class Comment
|
|
16
|
+
* @extends Base
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* **Under development, breaking changes possible**
|
|
20
|
+
*
|
|
21
|
+
* Represents a Comment resource in Cosmo, providing methods to interact with the Comment API.
|
|
22
|
+
*/
|
|
23
|
+
class CosmoComment extends Base_1.default {
|
|
24
|
+
getEndpoint(endpoint) {
|
|
25
|
+
return `${this.options.server}/api/cosmo${endpoint}`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a new Comment in the specified Organization, Space and Namespace for a specific Asset Reference.
|
|
29
|
+
* @remarks
|
|
30
|
+
* ** Under development, breaking changes possible**
|
|
31
|
+
* @param orgName Name of the Organization
|
|
32
|
+
* @param spaceName Name of the Space
|
|
33
|
+
* @param namespaceName Name of the Namespace
|
|
34
|
+
* @param comment Content of the Comment to create
|
|
35
|
+
* @param annotation Whether to include annotations in the response
|
|
36
|
+
* @returns The created Comment
|
|
37
|
+
*/
|
|
38
|
+
createComment(orgName_1, spaceName_1, namespaceName_1, comment_1) {
|
|
39
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, comment, annotation = false, raw) {
|
|
40
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments?annotation=${annotation}`), comment);
|
|
41
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* List Comments
|
|
46
|
+
* @remarks
|
|
47
|
+
* ** Under development, breaking changes possible**
|
|
48
|
+
* @param orgName Name of the Organization
|
|
49
|
+
* @param spaceName Name of the Space
|
|
50
|
+
* @param namespaceName Name of the Namespace
|
|
51
|
+
* @param limit Maximum number of comments to return
|
|
52
|
+
* @param page Page number for pagination
|
|
53
|
+
* @param annotation Whether to include annotations in the response
|
|
54
|
+
* @param replySample Amount of replies to load
|
|
55
|
+
*
|
|
56
|
+
* @returns A list of Comments
|
|
57
|
+
*/
|
|
58
|
+
listComments(orgName_1, spaceName_1, namespaceName_1, refId_1, limit_1, page_1) {
|
|
59
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, refId, limit, page, annotation = false, replySample = 0, raw) {
|
|
60
|
+
limit = limit !== null && limit !== void 0 ? limit : 100;
|
|
61
|
+
page = page !== null && page !== void 0 ? page : 0;
|
|
62
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments?limit=${limit}&page=${page}&annotation=${annotation}&refId=${refId}&replySample=${replySample}`));
|
|
63
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Edit a Comment
|
|
68
|
+
* @remarks
|
|
69
|
+
* ** Under development, breaking changes possible**
|
|
70
|
+
* @param orgName Name of the Organization
|
|
71
|
+
* @param spaceName Name of the Space
|
|
72
|
+
* @param namespaceName Name of the Namespace
|
|
73
|
+
* @param commentId ID of the Comment to edit
|
|
74
|
+
* @param editComment Content of the Comment to edit
|
|
75
|
+
* @param annotation Whether to include annotations in the response
|
|
76
|
+
*
|
|
77
|
+
* @returns The edited Comment
|
|
78
|
+
*/
|
|
79
|
+
editComment(orgName_1, spaceName_1, namespaceName_1, commentId_1, editComment_1) {
|
|
80
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, commentId, editComment, annotation = false, raw) {
|
|
81
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments/${commentId}?annotation=${annotation}`), editComment);
|
|
82
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get a single Comment by ID
|
|
87
|
+
* @remarks
|
|
88
|
+
* ** Under development, breaking changes possible**
|
|
89
|
+
* @param orgName Name of the Organization
|
|
90
|
+
* @param spaceName Name of the Space
|
|
91
|
+
* @param namespaceName Name of the Namespace
|
|
92
|
+
* @param commentId ID of the Comment to edit
|
|
93
|
+
* @param annotation Whether to include annotations in the response
|
|
94
|
+
*
|
|
95
|
+
* @returns The requested Comment
|
|
96
|
+
*/
|
|
97
|
+
getComment(orgName_1, spaceName_1, namespaceName_1, commentId_1) {
|
|
98
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, commentId, annotation = false, raw) {
|
|
99
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments/${commentId}?annotation=${annotation}`));
|
|
100
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Delete Comments by ID
|
|
105
|
+
* @remarks
|
|
106
|
+
* ** Under development, breaking changes possible**
|
|
107
|
+
* @param orgName Name of the Organization
|
|
108
|
+
* @param spaceName Name of the Space
|
|
109
|
+
* @param namespaceName Name of the Namespace
|
|
110
|
+
* @param commentIds IDs of the Comments to delete
|
|
111
|
+
*
|
|
112
|
+
* @returns 204 No Content on success
|
|
113
|
+
*/
|
|
114
|
+
deleteComment(orgName, spaceName, namespaceName, commentIds, raw) {
|
|
115
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments`), {
|
|
117
|
+
data: { commentIds },
|
|
118
|
+
});
|
|
119
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Edit a Comments text
|
|
124
|
+
* @remarks
|
|
125
|
+
* ** Under development, breaking changes possible**
|
|
126
|
+
* @param orgName Name of the Organization
|
|
127
|
+
* @param spaceName Name of the Space
|
|
128
|
+
* @param namespaceName Name of the Namespace
|
|
129
|
+
* @param commentId ID of the Comment to edit
|
|
130
|
+
* @param text New text for the Comment
|
|
131
|
+
* @param annotation Whether to include annotations in the response
|
|
132
|
+
*
|
|
133
|
+
* @returns The edited Comment
|
|
134
|
+
*/
|
|
135
|
+
editCommentText(orgName_1, spaceName_1, namespaceName_1, commentId_1, text_1) {
|
|
136
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, commentId, text, annotation = false, raw) {
|
|
137
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments/${commentId}?annotation=${annotation}`), { text: text });
|
|
138
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Edit a Comments annotation
|
|
143
|
+
* @remarks
|
|
144
|
+
* ** Under development, breaking changes possible**
|
|
145
|
+
* @param orgName Name of the Organization
|
|
146
|
+
* @param spaceName Name of the Space
|
|
147
|
+
* @param namespaceName Name of the Namespace
|
|
148
|
+
* @param commentId ID of the Comment to edit
|
|
149
|
+
* @param newAnnotationContent New annotation for the Comment
|
|
150
|
+
* @param annotation Whether to include annotations in the response
|
|
151
|
+
*
|
|
152
|
+
* @returns The edited Comment
|
|
153
|
+
*/
|
|
154
|
+
editCommentAnnotation(orgName_1, spaceName_1, namespaceName_1, commentId_1, newAnnotationContent_1) {
|
|
155
|
+
return __awaiter(this, arguments, void 0, function* (orgName, spaceName, namespaceName, commentId, newAnnotationContent, annotation = false, raw) {
|
|
156
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/comments/${commentId}?annotation=${annotation}`), { annotation: newAnnotationContent });
|
|
157
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.CosmoComment = CosmoComment;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
+
import { CosmoEvents as ICosmoEvents } from "../../../interfaces/cosmo/event";
|
|
3
|
+
/**
|
|
4
|
+
* @class Event
|
|
5
|
+
* @extends Base
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* **Under development, breaking changes possible**
|
|
9
|
+
*
|
|
10
|
+
* Represents a Event resource in Cosmo, providing methods to interact with the Event API.
|
|
11
|
+
*/
|
|
12
|
+
export declare class CosmoEvent extends Base {
|
|
13
|
+
protected getEndpoint(endpoint: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Get a list of Events available in Cosmo
|
|
16
|
+
* @remarks
|
|
17
|
+
* ** Under development, breaking changes possible**
|
|
18
|
+
* @returns An Object holding all cosmo events sorted
|
|
19
|
+
*/
|
|
20
|
+
getCosmoEvents<R extends boolean = false>(raw?: {
|
|
21
|
+
raw: R;
|
|
22
|
+
}): Promise<MaybeRaw<R, ICosmoEvents>>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CosmoEvent = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
/**
|
|
15
|
+
* @class Event
|
|
16
|
+
* @extends Base
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* **Under development, breaking changes possible**
|
|
20
|
+
*
|
|
21
|
+
* Represents a Event resource in Cosmo, providing methods to interact with the Event API.
|
|
22
|
+
*/
|
|
23
|
+
class CosmoEvent extends Base_1.default {
|
|
24
|
+
getEndpoint(endpoint) {
|
|
25
|
+
return `${this.options.server}/api/cosmo${endpoint}`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get a list of Events available in Cosmo
|
|
29
|
+
* @remarks
|
|
30
|
+
* ** Under development, breaking changes possible**
|
|
31
|
+
* @returns An Object holding all cosmo events sorted
|
|
32
|
+
*/
|
|
33
|
+
getCosmoEvents(raw) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/events`));
|
|
36
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.CosmoEvent = CosmoEvent;
|