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,215 @@
|
|
|
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.CosmoShare = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
/**
|
|
15
|
+
* @class Share
|
|
16
|
+
* @extends Base
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* **Under development, breaking changes possible**
|
|
20
|
+
*
|
|
21
|
+
* Represents a Share resource in Cosmo, providing methods to interact with the Share API.
|
|
22
|
+
*/
|
|
23
|
+
class CosmoShare extends Base_1.default {
|
|
24
|
+
getEndpoint(endpoint) {
|
|
25
|
+
return `${this.options.server}/api/cosmo${endpoint}`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a new Share in 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 createShare The Share object to create
|
|
34
|
+
*
|
|
35
|
+
* @returns The created Share
|
|
36
|
+
*/
|
|
37
|
+
createShare(orgName, spaceName, createShare, raw) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/shares`), createShare);
|
|
40
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Links the user to a Share, making the assets shared available to the user
|
|
45
|
+
* @remarks
|
|
46
|
+
* ** Under development, breaking changes possible**
|
|
47
|
+
* @param orgName Name of the Organization
|
|
48
|
+
* @param spaceName Name of the Space
|
|
49
|
+
* @param shareId The ID of the Share to link
|
|
50
|
+
*
|
|
51
|
+
* @returns The created Share
|
|
52
|
+
*/
|
|
53
|
+
linkShare(orgName, spaceName, shareId, password, shareIdHMAC, raw) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const resp = yield this.axios.put(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/shares/${shareId}`), {
|
|
56
|
+
password,
|
|
57
|
+
shareIdHMAC,
|
|
58
|
+
});
|
|
59
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
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
|
+
/**
|
|
82
|
+
* Delete Shares by ID.
|
|
83
|
+
* @remarks
|
|
84
|
+
* ** Under development, breaking changes possible**
|
|
85
|
+
* @param orgName Name of the Organization
|
|
86
|
+
* @param spaceName Name of the Space
|
|
87
|
+
* @param shareIds The IDs of the Shares to delete
|
|
88
|
+
*
|
|
89
|
+
* @returns 204 No Content if successful
|
|
90
|
+
*/
|
|
91
|
+
deleteShare(orgName, spaceName, shareIds, raw) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/shares`), {
|
|
94
|
+
data: { shareIds },
|
|
95
|
+
});
|
|
96
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Fetch a Share.
|
|
101
|
+
* @param orgName Name of the Organization
|
|
102
|
+
* @param spaceName Name of the Space
|
|
103
|
+
* @param shareId The ID of the Share to link
|
|
104
|
+
*
|
|
105
|
+
* @returns Detailed Share object
|
|
106
|
+
*/
|
|
107
|
+
fetchShare(orgName, spaceName, shareId, raw) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
const res = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/shares/${shareId}`));
|
|
110
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Searches for shares within a specific space in an organization.
|
|
115
|
+
*
|
|
116
|
+
* @param {string} orgName - The name of the organization.
|
|
117
|
+
* @param {string} spaceName - The name of the space.
|
|
118
|
+
* @param {{ sorting?: Sorting, filters?: SearchFilter[] }} search - Search criteria including optional sorting and filters.
|
|
119
|
+
* @param {number} limit - Maximum number of results per page.
|
|
120
|
+
* @param {number} page - The page number to retrieve.
|
|
121
|
+
* @returns {Promise<ShareWithUsers[]>} A promise that resolves to a list of shares with their associated users.
|
|
122
|
+
*/
|
|
123
|
+
searchSharesOfSpace(orgName, spaceName, search, limit, page, raw) {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/shares/search`), search, {
|
|
126
|
+
params: {
|
|
127
|
+
limit,
|
|
128
|
+
page,
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Searches for shares the current user is linked to.
|
|
136
|
+
*
|
|
137
|
+
* @param {{ sorting?: Sorting, filters?: SearchFilter[] }} search - Search criteria including optional sorting and filters.
|
|
138
|
+
* @param {number} limit - Maximum number of results per page.
|
|
139
|
+
* @param {number} page - The page number to retrieve.
|
|
140
|
+
* @returns {Promise<Share[]>} A promise that resolves to a list of shares the current user is linked to.
|
|
141
|
+
*/
|
|
142
|
+
searchSharesOfUser(search, limit, page, raw) {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/user/shares/search`), search, {
|
|
145
|
+
params: {
|
|
146
|
+
limit,
|
|
147
|
+
page,
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Unlinks the current user from a specific share in a space.
|
|
155
|
+
*
|
|
156
|
+
* @param {string} orgName - The name of the organization.
|
|
157
|
+
* @param {string} spaceName - The name of the space.
|
|
158
|
+
* @param {string} shareId - The ID of the share to unlink from.
|
|
159
|
+
* @returns {Promise<void>} A promise that resolves when the unlinking is complete.
|
|
160
|
+
*/
|
|
161
|
+
unlinkSelf(orgName, spaceName, shareId, raw) {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/shares/${shareId}/link`));
|
|
164
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Unlinks another user from a specific share in a space.
|
|
169
|
+
*
|
|
170
|
+
* @param {string} orgName - The name of the organization.
|
|
171
|
+
* @param {string} spaceName - The name of the space.
|
|
172
|
+
* @param {string} shareId - The ID of the share to unlink from.
|
|
173
|
+
* @param {string} userId - The ID of the user to unlink.
|
|
174
|
+
* @returns {Promise<void>} A promise that resolves when the unlinking is complete.
|
|
175
|
+
*/
|
|
176
|
+
unlinkOther(orgName, spaceName, shareId, userId, raw) {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/shares/${shareId}/user/${userId}`));
|
|
179
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
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
|
+
/**
|
|
198
|
+
* Patch a Share in the specified Organization and Space.
|
|
199
|
+
* @remarks
|
|
200
|
+
* ** Under development, breaking changes possible**
|
|
201
|
+
* @param orgName Name of the Organization
|
|
202
|
+
* @param spaceName Name of the Space
|
|
203
|
+
* @param shareId ID of the Share
|
|
204
|
+
* @param patchObject An object whose properties will be used to replace the existing Share ones
|
|
205
|
+
*
|
|
206
|
+
* @returns The patched Share
|
|
207
|
+
*/
|
|
208
|
+
patchShare(orgName, spaceName, shareId, patchObject, raw) {
|
|
209
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
210
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/shares/${shareId}`), patchObject);
|
|
211
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
exports.CosmoShare = CosmoShare;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
+
import { High5SpaceInfo, CosmoSpace as ICosmoSpace, SpaceUser } from "../../../interfaces/cosmo/space";
|
|
3
|
+
/**
|
|
4
|
+
* @class Space
|
|
5
|
+
* @extends Base
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* **Under development, breaking changes possible**
|
|
9
|
+
*
|
|
10
|
+
* Represents a Space resource in Cosmo, providing methods to interact with the Space API.
|
|
11
|
+
*/
|
|
12
|
+
export declare class CosmoSpace extends Base {
|
|
13
|
+
protected getEndpoint(endpoint: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new Space in the specified Organization.
|
|
16
|
+
* @remarks
|
|
17
|
+
* ** Under development, breaking changes possible**
|
|
18
|
+
* @param orgName Name of the Organization
|
|
19
|
+
* @param noAvatar Optional flag to create the Space without an avatar
|
|
20
|
+
* @returns The created Space
|
|
21
|
+
*/
|
|
22
|
+
createSpace<R extends boolean = false>(orgName: string, spaceName: string, noAvatar?: boolean, raw?: {
|
|
23
|
+
raw: R;
|
|
24
|
+
}): Promise<MaybeRaw<R, ICosmoSpace>>;
|
|
25
|
+
/**
|
|
26
|
+
* List spaces of an Organization.
|
|
27
|
+
* @remarks
|
|
28
|
+
* ** Under development, breaking changes possible**
|
|
29
|
+
* @param orgName Name of the Organization
|
|
30
|
+
* @param limit Maximum number of Spaces to return
|
|
31
|
+
* @param page Page number for pagination
|
|
32
|
+
* @returns A list of Spaces in the Organization
|
|
33
|
+
*/
|
|
34
|
+
listSpaces<R extends boolean = false>(orgName: string, limit: number, page: number, raw?: {
|
|
35
|
+
raw: R;
|
|
36
|
+
}): Promise<MaybeRaw<R, ICosmoSpace[]>>;
|
|
37
|
+
/**
|
|
38
|
+
* Fetch a single space by its Name.
|
|
39
|
+
* @remarks
|
|
40
|
+
* ** Under development, breaking changes possible**
|
|
41
|
+
* @param orgName Name of the Organization
|
|
42
|
+
* @param spaceName Name of the Space to fetch
|
|
43
|
+
* @returns The requested Space
|
|
44
|
+
*/
|
|
45
|
+
getSpace<R extends boolean = false>(orgName: string, spaceName: string, raw?: {
|
|
46
|
+
raw: R;
|
|
47
|
+
}): Promise<MaybeRaw<R, ICosmoSpace>>;
|
|
48
|
+
/**
|
|
49
|
+
* Delete a Space by it's Name.
|
|
50
|
+
* @remarks
|
|
51
|
+
* ** Under development, breaking changes possible**
|
|
52
|
+
* @param orgName Name of the Organization
|
|
53
|
+
* @param spaceName Name of the Space to delete
|
|
54
|
+
* @returns 204 No Content on success
|
|
55
|
+
*/
|
|
56
|
+
deleteSpace<R extends boolean = false>(orgName: string, spaceName: string, raw?: {
|
|
57
|
+
raw: R;
|
|
58
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
59
|
+
/**
|
|
60
|
+
* Rename a Space.
|
|
61
|
+
* @remarks
|
|
62
|
+
* ** Under development, breaking changes possible**
|
|
63
|
+
* @param orgName Name of the Organization
|
|
64
|
+
* @param spaceName Name of the Space
|
|
65
|
+
* @param newName New name for the Space
|
|
66
|
+
* @returns The updated Space
|
|
67
|
+
*/
|
|
68
|
+
renameSpace<R extends boolean = false>(orgName: string, spaceName: string, newName: string, raw?: {
|
|
69
|
+
raw: R;
|
|
70
|
+
}): Promise<MaybeRaw<R, ICosmoSpace>>;
|
|
71
|
+
/**
|
|
72
|
+
* Link a high5 space to a cosmo space.
|
|
73
|
+
* @remarks
|
|
74
|
+
* ** Under development, breaking changes possible**
|
|
75
|
+
* @param orgName Name of the Organization
|
|
76
|
+
* @param spaceName Name of the Cosmo Space
|
|
77
|
+
* @param high5SpaceInfo Information about the high5 space
|
|
78
|
+
* @returns The updated Cosmo Space
|
|
79
|
+
*/
|
|
80
|
+
linkSpace<R extends boolean = false>(orgName: string, spaceName: string, high5SpaceInfo: High5SpaceInfo, raw?: {
|
|
81
|
+
raw: R;
|
|
82
|
+
}): Promise<MaybeRaw<R, ICosmoSpace>>;
|
|
83
|
+
/**
|
|
84
|
+
* Link a high5 space to a cosmo space.
|
|
85
|
+
* @remarks
|
|
86
|
+
* ** Under development, breaking changes possible**
|
|
87
|
+
* @param orgName Name of the Organization
|
|
88
|
+
* @param spaceName Name of the Cosmo Space
|
|
89
|
+
* @param high5SpaceInfo Information about the high5 space
|
|
90
|
+
* @returns The updated Cosmo Space
|
|
91
|
+
*/
|
|
92
|
+
unlinkSpace<R extends boolean = false>(orgName: string, spaceName: string, raw?: {
|
|
93
|
+
raw: R;
|
|
94
|
+
}): Promise<MaybeRaw<R, ICosmoSpace>>;
|
|
95
|
+
/**
|
|
96
|
+
* List all users with access to the given Space.
|
|
97
|
+
* @param orgName Name of the Organization
|
|
98
|
+
* @param spaceName Name of the Cosmo Space
|
|
99
|
+
* @returns The SpaceUser array
|
|
100
|
+
*/
|
|
101
|
+
listSpaceUsers<R extends boolean = false>(orgName: string, spaceName: string, raw?: {
|
|
102
|
+
raw: R;
|
|
103
|
+
}): Promise<MaybeRaw<R, SpaceUser[]>>;
|
|
104
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
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.CosmoSpace = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
/**
|
|
15
|
+
* @class Space
|
|
16
|
+
* @extends Base
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* **Under development, breaking changes possible**
|
|
20
|
+
*
|
|
21
|
+
* Represents a Space resource in Cosmo, providing methods to interact with the Space API.
|
|
22
|
+
*/
|
|
23
|
+
class CosmoSpace extends Base_1.default {
|
|
24
|
+
getEndpoint(endpoint) {
|
|
25
|
+
return `${this.options.server}/api/cosmo${endpoint}`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a new Space in the specified Organization.
|
|
29
|
+
* @remarks
|
|
30
|
+
* ** Under development, breaking changes possible**
|
|
31
|
+
* @param orgName Name of the Organization
|
|
32
|
+
* @param noAvatar Optional flag to create the Space without an avatar
|
|
33
|
+
* @returns The created Space
|
|
34
|
+
*/
|
|
35
|
+
createSpace(orgName, spaceName, noAvatar, raw) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces?noAvatar=${noAvatar ? "true" : "false"}`), {
|
|
38
|
+
name: spaceName,
|
|
39
|
+
});
|
|
40
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* List spaces of an Organization.
|
|
45
|
+
* @remarks
|
|
46
|
+
* ** Under development, breaking changes possible**
|
|
47
|
+
* @param orgName Name of the Organization
|
|
48
|
+
* @param limit Maximum number of Spaces to return
|
|
49
|
+
* @param page Page number for pagination
|
|
50
|
+
* @returns A list of Spaces in the Organization
|
|
51
|
+
*/
|
|
52
|
+
listSpaces(orgName, limit, page, raw) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces?limit=${limit}&page=${page}`));
|
|
55
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Fetch a single space by its Name.
|
|
60
|
+
* @remarks
|
|
61
|
+
* ** Under development, breaking changes possible**
|
|
62
|
+
* @param orgName Name of the Organization
|
|
63
|
+
* @param spaceName Name of the Space to fetch
|
|
64
|
+
* @returns The requested Space
|
|
65
|
+
*/
|
|
66
|
+
getSpace(orgName, spaceName, raw) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}`));
|
|
69
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Delete a Space by it's Name.
|
|
74
|
+
* @remarks
|
|
75
|
+
* ** Under development, breaking changes possible**
|
|
76
|
+
* @param orgName Name of the Organization
|
|
77
|
+
* @param spaceName Name of the Space to delete
|
|
78
|
+
* @returns 204 No Content on success
|
|
79
|
+
*/
|
|
80
|
+
deleteSpace(orgName, spaceName, raw) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}`));
|
|
83
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Rename a Space.
|
|
88
|
+
* @remarks
|
|
89
|
+
* ** Under development, breaking changes possible**
|
|
90
|
+
* @param orgName Name of the Organization
|
|
91
|
+
* @param spaceName Name of the Space
|
|
92
|
+
* @param newName New name for the Space
|
|
93
|
+
* @returns The updated Space
|
|
94
|
+
*/
|
|
95
|
+
renameSpace(orgName, spaceName, newName, raw) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/name`), {
|
|
98
|
+
name: newName,
|
|
99
|
+
});
|
|
100
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Link a high5 space to a cosmo space.
|
|
105
|
+
* @remarks
|
|
106
|
+
* ** Under development, breaking changes possible**
|
|
107
|
+
* @param orgName Name of the Organization
|
|
108
|
+
* @param spaceName Name of the Cosmo Space
|
|
109
|
+
* @param high5SpaceInfo Information about the high5 space
|
|
110
|
+
* @returns The updated Cosmo Space
|
|
111
|
+
*/
|
|
112
|
+
linkSpace(orgName, spaceName, high5SpaceInfo, raw) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/high5/link/space`), high5SpaceInfo);
|
|
115
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Link a high5 space to a cosmo space.
|
|
120
|
+
* @remarks
|
|
121
|
+
* ** Under development, breaking changes possible**
|
|
122
|
+
* @param orgName Name of the Organization
|
|
123
|
+
* @param spaceName Name of the Cosmo Space
|
|
124
|
+
* @param high5SpaceInfo Information about the high5 space
|
|
125
|
+
* @returns The updated Cosmo Space
|
|
126
|
+
*/
|
|
127
|
+
unlinkSpace(orgName, spaceName, raw) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/high5/unlink/space`));
|
|
130
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* List all users with access to the given Space.
|
|
135
|
+
* @param orgName Name of the Organization
|
|
136
|
+
* @param spaceName Name of the Cosmo Space
|
|
137
|
+
* @returns The SpaceUser array
|
|
138
|
+
*/
|
|
139
|
+
listSpaceUsers(orgName, spaceName, raw) {
|
|
140
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/users`));
|
|
142
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
exports.CosmoSpace = CosmoSpace;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
+
import { CreateTag, PatchTag, Tag } from "../../../interfaces/cosmo/tag/tag";
|
|
3
|
+
/**
|
|
4
|
+
* @class Tag
|
|
5
|
+
* @extends Base
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* **Under development, breaking changes possible**
|
|
9
|
+
*
|
|
10
|
+
* Represents an Asset resource in Cosmo, providing methods to interact with the Asset API.
|
|
11
|
+
*/
|
|
12
|
+
export declare class CosmoTag extends Base {
|
|
13
|
+
protected getEndpoint(endpoint: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Create a new Tag in Cosmo inside the specified Organization, Space and Namespace.
|
|
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 createTag The Tag to be created
|
|
22
|
+
* @returns The created tag
|
|
23
|
+
*/
|
|
24
|
+
createTag<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, createTag: CreateTag, raw?: {
|
|
25
|
+
raw: R;
|
|
26
|
+
}): Promise<MaybeRaw<R, Tag>>;
|
|
27
|
+
/**
|
|
28
|
+
* Get a list of all Tags in Cosmo inside the specified Organization, Space and Namespace.
|
|
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 createTag The Tag to be created
|
|
35
|
+
* @returns The created tag
|
|
36
|
+
*/
|
|
37
|
+
getTags<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, raw?: {
|
|
38
|
+
raw: R;
|
|
39
|
+
}): Promise<MaybeRaw<R, Tag[]>>;
|
|
40
|
+
/**
|
|
41
|
+
* Update a Tag in Cosmo inside the specified Organization, Space and Namespace.
|
|
42
|
+
* @remarks
|
|
43
|
+
* ** Under development, breaking changes possible**
|
|
44
|
+
* @param orgName Name of the Organization
|
|
45
|
+
* @param spaceName Name of the Space
|
|
46
|
+
* @param namespaceName Name of the Namespace
|
|
47
|
+
* @param tagName Name of the Tag to be updated
|
|
48
|
+
* @param patchTag The Tag data to be updated
|
|
49
|
+
* @returns The updated tag
|
|
50
|
+
*/
|
|
51
|
+
updateTag<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, tagName: string, patchTag: PatchTag, raw?: {
|
|
52
|
+
raw: R;
|
|
53
|
+
}): Promise<MaybeRaw<R, Tag>>;
|
|
54
|
+
/**
|
|
55
|
+
* Delete a Tag in Cosmo inside the specified Organization, Space and Namespace.
|
|
56
|
+
* @remarks
|
|
57
|
+
* ** Under development, breaking changes possible**
|
|
58
|
+
* @param orgName Name of the Organization
|
|
59
|
+
* @param spaceName Name of the Space
|
|
60
|
+
* @param namespaceName Name of the Namespace
|
|
61
|
+
* @param tagName Name of the Tag to be deleted
|
|
62
|
+
* @returns 204 No Content if successful
|
|
63
|
+
*/
|
|
64
|
+
deleteTag<R extends boolean = false>(orgName: string, spaceName: string, namespaceName: string, tagName: string, raw?: {
|
|
65
|
+
raw: R;
|
|
66
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
67
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
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.CosmoTag = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
/**
|
|
15
|
+
* @class Tag
|
|
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 CosmoTag extends Base_1.default {
|
|
24
|
+
getEndpoint(endpoint) {
|
|
25
|
+
return `${this.options.server}/api/cosmo${endpoint}`;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create a new Tag in Cosmo inside the specified Organization, Space and Namespace.
|
|
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 createTag The Tag to be created
|
|
35
|
+
* @returns The created tag
|
|
36
|
+
*/
|
|
37
|
+
createTag(orgName, spaceName, namespaceName, createTag, raw) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/tags`), createTag);
|
|
40
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get a list of all Tags in Cosmo inside the specified Organization, Space and Namespace.
|
|
45
|
+
* @remarks
|
|
46
|
+
* ** Under development, breaking changes possible**
|
|
47
|
+
* @param orgName Name of the Organization
|
|
48
|
+
* @param spaceName Name of the Space
|
|
49
|
+
* @param namespaceName Name of the Namespace
|
|
50
|
+
* @param createTag The Tag to be created
|
|
51
|
+
* @returns The created tag
|
|
52
|
+
*/
|
|
53
|
+
getTags(orgName, spaceName, namespaceName, raw) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/tags`));
|
|
56
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Update a Tag in Cosmo inside the specified Organization, Space and Namespace.
|
|
61
|
+
* @remarks
|
|
62
|
+
* ** Under development, breaking changes possible**
|
|
63
|
+
* @param orgName Name of the Organization
|
|
64
|
+
* @param spaceName Name of the Space
|
|
65
|
+
* @param namespaceName Name of the Namespace
|
|
66
|
+
* @param tagName Name of the Tag to be updated
|
|
67
|
+
* @param patchTag The Tag data to be updated
|
|
68
|
+
* @returns The updated tag
|
|
69
|
+
*/
|
|
70
|
+
updateTag(orgName, spaceName, namespaceName, tagName, patchTag, raw) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/tags/${tagName}`), patchTag);
|
|
73
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Delete a Tag in Cosmo inside the specified Organization, Space and Namespace.
|
|
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 tagName Name of the Tag to be deleted
|
|
84
|
+
* @returns 204 No Content if successful
|
|
85
|
+
*/
|
|
86
|
+
deleteTag(orgName, spaceName, namespaceName, tagName, raw) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/spaces/${spaceName}/namespaces/${namespaceName}/tags/${tagName}`));
|
|
89
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.CosmoTag = CosmoTag;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Base from "../../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
2
|
import { AvatarCreated } from "../../../interfaces/dali";
|
|
3
3
|
export declare class DaliCosmoSpace extends Base {
|
|
4
4
|
/**
|
|
@@ -7,13 +7,17 @@ export declare class DaliCosmoSpace extends Base {
|
|
|
7
7
|
* @param spaceName Name of the space
|
|
8
8
|
* @returns Public URL of the created avatar
|
|
9
9
|
*/
|
|
10
|
-
createAvatar(orgName: string, spaceName: string
|
|
10
|
+
createAvatar<R extends boolean = false>(orgName: string, spaceName: string, raw?: {
|
|
11
|
+
raw: R;
|
|
12
|
+
}): Promise<MaybeRaw<R, AvatarCreated>>;
|
|
11
13
|
/**
|
|
12
14
|
* Deletes the avatar of the Cosmo space from cloud storage. If you want to update it instead, use updateAvatar().
|
|
13
15
|
* @param orgName Name of the organization
|
|
14
16
|
* @param spaceName Name of the space
|
|
15
17
|
*/
|
|
16
|
-
deleteAvatar(orgName: string, spaceName: string
|
|
18
|
+
deleteAvatar<R extends boolean = false>(orgName: string, spaceName: string, raw?: {
|
|
19
|
+
raw: R;
|
|
20
|
+
}): Promise<MaybeRaw<R, string>>;
|
|
17
21
|
/**
|
|
18
22
|
* Updates the avatar of the specified Cosmo space
|
|
19
23
|
* @param orgName Name of the organization
|
|
@@ -21,6 +25,8 @@ export declare class DaliCosmoSpace extends Base {
|
|
|
21
25
|
* @param file Image as Javascript File
|
|
22
26
|
* @returns Public URL of the new avatar
|
|
23
27
|
*/
|
|
24
|
-
updateAvatar(orgName: string, spaceName: string, file: File
|
|
28
|
+
updateAvatar<R extends boolean = false>(orgName: string, spaceName: string, file: File, raw?: {
|
|
29
|
+
raw: R;
|
|
30
|
+
}): Promise<MaybeRaw<R, AvatarCreated>>;
|
|
25
31
|
protected getEndpoint(endpoint: string): string;
|
|
26
32
|
}
|