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
|
@@ -17,10 +17,10 @@ class MothershipService extends Base_1.default {
|
|
|
17
17
|
* Requests the endpoint version
|
|
18
18
|
* @returns Version object
|
|
19
19
|
*/
|
|
20
|
-
version() {
|
|
20
|
+
version(raw) {
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
22
|
const resp = yield this.axios.get(this.getEndpoint("/v1/version"));
|
|
23
|
-
return resp.data;
|
|
23
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
@@ -31,14 +31,15 @@ class MothershipService extends Base_1.default {
|
|
|
31
31
|
* @param info Information about the agent's uuid, hardware and nickname
|
|
32
32
|
* @return an Agent object
|
|
33
33
|
*/
|
|
34
|
-
hello(uuid, uuidSignature, info) {
|
|
34
|
+
hello(uuid, uuidSignature, info, raw) {
|
|
35
35
|
return __awaiter(this, void 0, void 0, function* () {
|
|
36
36
|
const resp = yield this.axios.post(this.getEndpoint("/v1/hello"), info, {
|
|
37
37
|
headers: {
|
|
38
38
|
Authorization: `Bearer ${uuid}.${uuidSignature}`,
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
|
-
return
|
|
41
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw)
|
|
42
|
+
? Object.assign(Object.assign({}, resp), { data: { agent: resp.data, token: resp.headers.authorization } }) : { agent: resp.data, token: resp.headers.authorization });
|
|
42
43
|
});
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
@@ -51,10 +52,10 @@ class MothershipService extends Base_1.default {
|
|
|
51
52
|
* @param info Information about the agent's system resources.
|
|
52
53
|
* @return an Agent object
|
|
53
54
|
*/
|
|
54
|
-
helloAgain(info) {
|
|
55
|
+
helloAgain(info, raw) {
|
|
55
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
57
|
const resp = yield this.axios.patch(this.getEndpoint("/v1/hello/again"), info);
|
|
57
|
-
return resp.data;
|
|
58
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
58
59
|
});
|
|
59
60
|
}
|
|
60
61
|
/**
|
|
@@ -67,13 +68,13 @@ class MothershipService extends Base_1.default {
|
|
|
67
68
|
* @param publicKey the public key of the agent that will be used for cryptography. The agent should remember its private key.
|
|
68
69
|
* @return an object holding a secret encrypted with the public key. The agent must decrypt it using its private key in order to use the /hello endpoint.
|
|
69
70
|
*/
|
|
70
|
-
register(uuid, info, publicKey) {
|
|
71
|
+
register(uuid, info, publicKey, raw) {
|
|
71
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
73
|
if (typeof publicKey !== "string") {
|
|
73
74
|
publicKey = publicKey.toString("hex");
|
|
74
75
|
}
|
|
75
76
|
const resp = yield this.axios.post(this.getEndpoint("/v1/register"), Object.assign({ uuid, publicKey }, info));
|
|
76
|
-
return resp.data;
|
|
77
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
77
78
|
});
|
|
78
79
|
}
|
|
79
80
|
/**
|
|
@@ -87,9 +88,10 @@ class MothershipService extends Base_1.default {
|
|
|
87
88
|
* @param memberToken JWT assigned to a member of the organization
|
|
88
89
|
* @param email Email of the user owner of the JWT
|
|
89
90
|
*/
|
|
90
|
-
connect(orgName, memberToken, email) {
|
|
91
|
+
connect(orgName, memberToken, email, raw) {
|
|
91
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
-
yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/connect`), { memberToken, email });
|
|
93
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/org/${orgName}/connect`), { memberToken, email });
|
|
94
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
93
95
|
});
|
|
94
96
|
}
|
|
95
97
|
/**
|
|
@@ -102,9 +104,10 @@ class MothershipService extends Base_1.default {
|
|
|
102
104
|
* @param orgName Name of the organization
|
|
103
105
|
* @param email Email of the user
|
|
104
106
|
*/
|
|
105
|
-
disconnect(orgName, email) {
|
|
107
|
+
disconnect(orgName, email, raw) {
|
|
106
108
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
-
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/connect/${email}`));
|
|
109
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}/connect/${email}`));
|
|
110
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
108
111
|
});
|
|
109
112
|
}
|
|
110
113
|
/**
|
|
@@ -116,9 +119,10 @@ class MothershipService extends Base_1.default {
|
|
|
116
119
|
*
|
|
117
120
|
* @param email Email of the target
|
|
118
121
|
*/
|
|
119
|
-
disconnectTarget(email) {
|
|
122
|
+
disconnectTarget(email, raw) {
|
|
120
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
-
yield this.axios.delete(this.getEndpoint(`/v1/connect/${email}`));
|
|
124
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/connect/${email}`));
|
|
125
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
122
126
|
});
|
|
123
127
|
}
|
|
124
128
|
/**
|
|
@@ -127,8 +131,8 @@ class MothershipService extends Base_1.default {
|
|
|
127
131
|
* @param orgName Name of the organization
|
|
128
132
|
* @returns Object containing an array of retrieved agents and the total number of available found in the database (independent of limit and page)
|
|
129
133
|
*/
|
|
130
|
-
searchAvailableTargets(_a) {
|
|
131
|
-
return __awaiter(this, arguments, void 0, function* ({ orgName, filters, sorting, limit = 25, page = 0,
|
|
134
|
+
searchAvailableTargets(_a, raw_1) {
|
|
135
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, filters, sorting, limit = 25, page = 0 }, raw) {
|
|
132
136
|
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
133
137
|
return new searchFilter_1.SearchFilterDTO(f);
|
|
134
138
|
});
|
|
@@ -138,7 +142,18 @@ class MothershipService extends Base_1.default {
|
|
|
138
142
|
}, {
|
|
139
143
|
params: { limit, page },
|
|
140
144
|
});
|
|
141
|
-
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
145
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: (0, paginatedResponseHelper_1.createPaginatedResponse)(resp) }) : (0, paginatedResponseHelper_1.createPaginatedResponse)(resp));
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Retrieves usage statistics for a specific organization.
|
|
150
|
+
* @param orgName Name of the organization
|
|
151
|
+
* @returns Statistics information
|
|
152
|
+
*/
|
|
153
|
+
getStats(orgName) {
|
|
154
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}/stats`));
|
|
156
|
+
return resp.data;
|
|
142
157
|
});
|
|
143
158
|
}
|
|
144
159
|
getEndpoint(endpoint) {
|
|
@@ -24,6 +24,12 @@ class Nats extends Base_1.default {
|
|
|
24
24
|
}
|
|
25
25
|
connect(params) {
|
|
26
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
let previousSubs = [];
|
|
28
|
+
if (this.natsConnection && !this.natsConnection.isClosed()) {
|
|
29
|
+
previousSubs = [...this.subMap];
|
|
30
|
+
yield this.natsConnection.close();
|
|
31
|
+
this.subMap = [];
|
|
32
|
+
}
|
|
27
33
|
if (params.forceWebsocket) {
|
|
28
34
|
this.connection = nats_ws_1.connect;
|
|
29
35
|
}
|
|
@@ -46,55 +52,64 @@ class Nats extends Base_1.default {
|
|
|
46
52
|
user: params.email !== undefined ? params.email : params.username,
|
|
47
53
|
pass: params.jwt !== undefined ? params.jwt : params.password,
|
|
48
54
|
});
|
|
55
|
+
for (const entry of previousSubs) {
|
|
56
|
+
yield this.sub(entry.subject, (err, data, msg) => {
|
|
57
|
+
var _a, _b;
|
|
58
|
+
(_b = (_a = entry.sub).callback) === null || _b === void 0 ? void 0 : _b.call(_a, err, msg ? msg : {});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
49
61
|
return this.natsConnection;
|
|
50
62
|
});
|
|
51
63
|
}
|
|
52
64
|
sub(subject, callback, options) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const delay = 500;
|
|
67
|
+
const trySubscribe = () => __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
const conn = this.getConnection();
|
|
69
|
+
// if connection not ready, retry after delay
|
|
70
|
+
if (!conn || conn.isClosed()) {
|
|
71
|
+
yield new Promise(res => setTimeout(res, delay));
|
|
72
|
+
return trySubscribe();
|
|
73
|
+
}
|
|
74
|
+
try {
|
|
75
|
+
const newOptions = Object.assign(Object.assign({}, options), { callback: (err, msg) => {
|
|
76
|
+
if (err) {
|
|
77
|
+
try {
|
|
78
|
+
callback(err);
|
|
79
|
+
}
|
|
80
|
+
catch (_a) {
|
|
81
|
+
// ignore callback errors
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
let parsedData;
|
|
86
|
+
try {
|
|
87
|
+
const data = new TextDecoder("utf-8").decode(msg.data);
|
|
88
|
+
parsedData = JSON.parse(data);
|
|
89
|
+
}
|
|
90
|
+
catch (e) {
|
|
91
|
+
callback(e);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
callback(null, parsedData, msg);
|
|
96
|
+
}
|
|
97
|
+
catch (_b) {
|
|
98
|
+
// ignore callback errors
|
|
99
|
+
}
|
|
100
|
+
} });
|
|
101
|
+
const sub = conn.subscribe(subject, newOptions);
|
|
102
|
+
this.subMap.push({ subject, sub });
|
|
103
|
+
return sub;
|
|
90
104
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
105
|
+
catch (err) {
|
|
106
|
+
err;
|
|
107
|
+
// if subscription fails, retry after delay
|
|
108
|
+
yield new Promise(res => setTimeout(res, delay));
|
|
109
|
+
return trySubscribe();
|
|
95
110
|
}
|
|
96
|
-
|
|
97
|
-
|
|
111
|
+
});
|
|
112
|
+
return trySubscribe();
|
|
98
113
|
});
|
|
99
114
|
}
|
|
100
115
|
unsub(subject) {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../Base";
|
|
2
|
+
import { Version } from "../../interfaces/global";
|
|
3
|
+
import { ShortsInternal } from "./internal";
|
|
4
|
+
export default class Shorts extends Base {
|
|
5
|
+
/**
|
|
6
|
+
* Handles everything around internal endpoints
|
|
7
|
+
*/
|
|
8
|
+
get internal(): ShortsInternal;
|
|
9
|
+
private _internal?;
|
|
10
|
+
/**
|
|
11
|
+
* Requests the endpoint version
|
|
12
|
+
* @returns Version object
|
|
13
|
+
*/
|
|
14
|
+
version<R extends boolean = false>(raw?: {
|
|
15
|
+
raw: R;
|
|
16
|
+
}): Promise<MaybeRaw<R, Version>>;
|
|
17
|
+
protected getEndpoint(endpoint: string): string;
|
|
18
|
+
}
|
|
@@ -10,26 +10,29 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const Base_1 = require("../../Base");
|
|
13
|
-
const
|
|
14
|
-
class
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
const internal_1 = require("./internal");
|
|
14
|
+
class Shorts extends Base_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Handles everything around internal endpoints
|
|
17
|
+
*/
|
|
18
|
+
get internal() {
|
|
19
|
+
if (this._internal === undefined) {
|
|
20
|
+
this._internal = new internal_1.ShortsInternal(this.options, this.axios);
|
|
18
21
|
}
|
|
19
|
-
return this.
|
|
22
|
+
return this._internal;
|
|
20
23
|
}
|
|
21
24
|
/**
|
|
22
25
|
* Requests the endpoint version
|
|
23
26
|
* @returns Version object
|
|
24
27
|
*/
|
|
25
|
-
version() {
|
|
28
|
+
version(raw) {
|
|
26
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
27
30
|
const resp = yield this.axios.get(this.getEndpoint("/v1/version"));
|
|
28
|
-
return resp.data;
|
|
31
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
34
|
getEndpoint(endpoint) {
|
|
32
|
-
return `${this.options.server}/api/
|
|
35
|
+
return `${this.options.server}/api/shorts${endpoint}`;
|
|
33
36
|
}
|
|
34
37
|
}
|
|
35
|
-
exports.default =
|
|
38
|
+
exports.default = Shorts;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
|
+
import { Short } from "../../../interfaces/shorts";
|
|
3
|
+
export declare class ShortsInternal extends Base {
|
|
4
|
+
/**
|
|
5
|
+
* Generates a shortened alias for the provided long URL and sets a maximum number of allowed visits.
|
|
6
|
+
*
|
|
7
|
+
* This is an internal endpoint and can only be used from backends within the hcloud deployment.
|
|
8
|
+
*
|
|
9
|
+
* @param organizationId ID of the organization
|
|
10
|
+
* @param spaceId ID of the space
|
|
11
|
+
* @param url Original long URL that needs to be shortened
|
|
12
|
+
* @param visitsLimit Maximum number of times the shortened link can be accessed
|
|
13
|
+
* @returns the created short url
|
|
14
|
+
*/
|
|
15
|
+
createShort<R extends boolean = false>(organizationId: string, spaceId: string, url: string, visitsLimit: number, raw?: {
|
|
16
|
+
raw: R;
|
|
17
|
+
}): Promise<MaybeRaw<R, Short>>;
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves the full data associated with a shortened URL slug, including the original long URL, the current number of visits, and the maximum allowed visit limit.
|
|
20
|
+
*
|
|
21
|
+
* This is an internal endpoint and can only be used from backends within the hcloud deployment.
|
|
22
|
+
*
|
|
23
|
+
* @param slug Unique identifier or alias representing the shortened version of a URL
|
|
24
|
+
* @returns detailed information about this short url slug
|
|
25
|
+
*/
|
|
26
|
+
getShort<R extends boolean = false>(slug: string, raw?: {
|
|
27
|
+
raw: R;
|
|
28
|
+
}): Promise<MaybeRaw<R, Short>>;
|
|
29
|
+
/**
|
|
30
|
+
* Updates the maximum allowed visit limit for a shortened URL identified by its slug.
|
|
31
|
+
*
|
|
32
|
+
* This is an internal endpoint and can only be used from backends within the hcloud deployment.
|
|
33
|
+
*
|
|
34
|
+
* @param slug Unique identifier representing the shortened version of a URL
|
|
35
|
+
* @param visitsLimit New maximum number of allowed visits for this shortened URL
|
|
36
|
+
* @returns The updated Short object with the new visit limit
|
|
37
|
+
*/
|
|
38
|
+
updateVisitsLimit<R extends boolean = false>(slug: string, visitsLimit: number, raw?: {
|
|
39
|
+
raw: R;
|
|
40
|
+
}): Promise<MaybeRaw<R, Short>>;
|
|
41
|
+
/**
|
|
42
|
+
* Deletes the shortened URL associated with the given slug.
|
|
43
|
+
*
|
|
44
|
+
* This is an internal endpoint and can only be used from backends within the hcloud deployment.
|
|
45
|
+
*
|
|
46
|
+
* @param slug Unique identifier representing the shortened version of a URL
|
|
47
|
+
*/
|
|
48
|
+
deleteShort<R extends boolean = false>(slug: string, raw?: {
|
|
49
|
+
raw: R;
|
|
50
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
51
|
+
/**
|
|
52
|
+
* Deletes all shortened URLs associated with the given space ID.
|
|
53
|
+
*
|
|
54
|
+
* This is an internal endpoint and can only be used from backends within the hcloud deployment.
|
|
55
|
+
*
|
|
56
|
+
* @param spaceId ID of the space whose shortened URLs should be deleted
|
|
57
|
+
*/
|
|
58
|
+
deleteSpaceShorts<R extends boolean = false>(spaceId: string, raw?: {
|
|
59
|
+
raw: R;
|
|
60
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
61
|
+
/**
|
|
62
|
+
* Deletes all shortened URLs associated with the given organization ID.
|
|
63
|
+
*
|
|
64
|
+
* This is an internal endpoint and can only be used from backends within the hcloud deployment.
|
|
65
|
+
*
|
|
66
|
+
* @param orgId ID of the organization whose shortened URLs should be deleted
|
|
67
|
+
*/
|
|
68
|
+
deleteOrganizationShorts<R extends boolean = false>(orgId: string, raw?: {
|
|
69
|
+
raw: R;
|
|
70
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
71
|
+
protected getEndpoint(endpoint: string): string;
|
|
72
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
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.ShortsInternal = void 0;
|
|
13
|
+
const Base_1 = require("../../../Base");
|
|
14
|
+
class ShortsInternal extends Base_1.default {
|
|
15
|
+
/**
|
|
16
|
+
* Generates a shortened alias for the provided long URL and sets a maximum number of allowed visits.
|
|
17
|
+
*
|
|
18
|
+
* This is an internal endpoint and can only be used from backends within the hcloud deployment.
|
|
19
|
+
*
|
|
20
|
+
* @param organizationId ID of the organization
|
|
21
|
+
* @param spaceId ID of the space
|
|
22
|
+
* @param url Original long URL that needs to be shortened
|
|
23
|
+
* @param visitsLimit Maximum number of times the shortened link can be accessed
|
|
24
|
+
* @returns the created short url
|
|
25
|
+
*/
|
|
26
|
+
createShort(organizationId, spaceId, url, visitsLimit, raw) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const res = yield this.axios.post(this.getEndpoint(`/internal/v1/short`), { url, visitsLimit, organizationId, spaceId });
|
|
29
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves the full data associated with a shortened URL slug, including the original long URL, the current number of visits, and the maximum allowed visit limit.
|
|
34
|
+
*
|
|
35
|
+
* This is an internal endpoint and can only be used from backends within the hcloud deployment.
|
|
36
|
+
*
|
|
37
|
+
* @param slug Unique identifier or alias representing the shortened version of a URL
|
|
38
|
+
* @returns detailed information about this short url slug
|
|
39
|
+
*/
|
|
40
|
+
getShort(slug, raw) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const res = yield this.axios.get(this.getEndpoint(`/internal/v1/short/${slug}`));
|
|
43
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Updates the maximum allowed visit limit for a shortened URL identified by its slug.
|
|
48
|
+
*
|
|
49
|
+
* This is an internal endpoint and can only be used from backends within the hcloud deployment.
|
|
50
|
+
*
|
|
51
|
+
* @param slug Unique identifier representing the shortened version of a URL
|
|
52
|
+
* @param visitsLimit New maximum number of allowed visits for this shortened URL
|
|
53
|
+
* @returns The updated Short object with the new visit limit
|
|
54
|
+
*/
|
|
55
|
+
updateVisitsLimit(slug, visitsLimit, raw) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/internal/v1/short/${slug}/limit`), { visitsLimit });
|
|
58
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Deletes the shortened URL associated with the given slug.
|
|
63
|
+
*
|
|
64
|
+
* This is an internal endpoint and can only be used from backends within the hcloud deployment.
|
|
65
|
+
*
|
|
66
|
+
* @param slug Unique identifier representing the shortened version of a URL
|
|
67
|
+
*/
|
|
68
|
+
deleteShort(slug, raw) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/internal/v1/short/${slug}`));
|
|
71
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Deletes all shortened URLs associated with the given space ID.
|
|
76
|
+
*
|
|
77
|
+
* This is an internal endpoint and can only be used from backends within the hcloud deployment.
|
|
78
|
+
*
|
|
79
|
+
* @param spaceId ID of the space whose shortened URLs should be deleted
|
|
80
|
+
*/
|
|
81
|
+
deleteSpaceShorts(spaceId, raw) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/internal/v1/short/space/${spaceId}`));
|
|
84
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Deletes all shortened URLs associated with the given organization ID.
|
|
89
|
+
*
|
|
90
|
+
* This is an internal endpoint and can only be used from backends within the hcloud deployment.
|
|
91
|
+
*
|
|
92
|
+
* @param orgId ID of the organization whose shortened URLs should be deleted
|
|
93
|
+
*/
|
|
94
|
+
deleteOrganizationShorts(orgId, raw) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/internal/v1/short/org/${orgId}`));
|
|
97
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
getEndpoint(endpoint) {
|
|
101
|
+
return `${this.options.server}/api/account${endpoint}`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.ShortsInternal = ShortsInternal;
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./space"), exports);
|
|
18
|
-
__exportStar(require("./space/database"), exports);
|
|
19
|
-
__exportStar(require("./space/database/document"), exports);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ReducedSpace, Space, SpaceEntity } from "../../global";
|
|
2
|
-
import { ReducedOrganization } from "../../idp";
|
|
3
|
-
export interface FridaySpace extends Space {
|
|
4
|
-
highestPermissionOfUser: FridaySpacePermission;
|
|
5
|
-
}
|
|
6
|
-
export interface FridaySpaceEntityPermission {
|
|
7
|
-
organization: ReducedOrganization;
|
|
8
|
-
space: ReducedSpace;
|
|
9
|
-
entityId: string;
|
|
10
|
-
entityName: string;
|
|
11
|
-
type: SpaceEntity;
|
|
12
|
-
permission: FridaySpacePermission;
|
|
13
|
-
avatarUrl: string;
|
|
14
|
-
}
|
|
15
|
-
export declare enum FridaySpacePermission {
|
|
16
|
-
NONE = "NONE",
|
|
17
|
-
READ = "READ",
|
|
18
|
-
WRITE = "WRITE",
|
|
19
|
-
MANAGE = "MANAGE",
|
|
20
|
-
OWNER = "OWNER"
|
|
21
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.FridaySpacePermission = void 0;
|
|
4
|
-
var FridaySpacePermission;
|
|
5
|
-
(function (FridaySpacePermission) {
|
|
6
|
-
FridaySpacePermission["NONE"] = "NONE";
|
|
7
|
-
FridaySpacePermission["READ"] = "READ";
|
|
8
|
-
FridaySpacePermission["WRITE"] = "WRITE";
|
|
9
|
-
FridaySpacePermission["MANAGE"] = "MANAGE";
|
|
10
|
-
FridaySpacePermission["OWNER"] = "OWNER";
|
|
11
|
-
})(FridaySpacePermission || (exports.FridaySpacePermission = FridaySpacePermission = {}));
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Base from "../../Base";
|
|
2
|
-
import { Version } from "../../interfaces/global";
|
|
3
|
-
import { FridaySpace } from "./space";
|
|
4
|
-
export default class Friday extends Base {
|
|
5
|
-
get space(): FridaySpace;
|
|
6
|
-
private _space?;
|
|
7
|
-
/**
|
|
8
|
-
* Requests the endpoint version
|
|
9
|
-
* @returns Version object
|
|
10
|
-
*/
|
|
11
|
-
version(): Promise<Version>;
|
|
12
|
-
protected getEndpoint(endpoint: string): string;
|
|
13
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import Base from "../../../Base";
|
|
2
|
-
import { FridaySpace as Space, FridaySpaceEntityPermission as SpaceEntityPermission, FridaySpacePermission as SpacePermission } from "../../../interfaces/friday/space";
|
|
3
|
-
import { PaginatedResponse, SearchParams } from "../../../interfaces/global";
|
|
4
|
-
import { FridayDatabase } from "./database";
|
|
5
|
-
export declare class FridaySpace extends Base {
|
|
6
|
-
get database(): FridayDatabase;
|
|
7
|
-
private _database?;
|
|
8
|
-
/**
|
|
9
|
-
* Retrieves all Friday Spaces of the specified Organization matching the search filter(s). Will return all Spaces if no search filter is provided.
|
|
10
|
-
* @param orgName Name of the organization
|
|
11
|
-
* @param filters (optional) Array of search filters
|
|
12
|
-
* @param sorting (optional) Sorting object
|
|
13
|
-
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
14
|
-
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
15
|
-
* @returns Object containing an array of Friday Spaces and the total number of results found in the database (independent of limit and page)
|
|
16
|
-
*/
|
|
17
|
-
searchSpaces({ orgName, filters, sorting, limit, page }: SearchParams & {
|
|
18
|
-
orgName: string;
|
|
19
|
-
}): Promise<PaginatedResponse<Space>>;
|
|
20
|
-
/**
|
|
21
|
-
* Retrieves a Friday Space by its name.
|
|
22
|
-
* @param orgName Name of the Organization
|
|
23
|
-
* @param spaceName Name of the Friday Space
|
|
24
|
-
* @returns The requested Space
|
|
25
|
-
*/
|
|
26
|
-
getSpace(orgName: string, spaceName: string): Promise<Space>;
|
|
27
|
-
/**
|
|
28
|
-
* Creates a new Friday Space in the specified Organization.
|
|
29
|
-
* @param orgName Name of the Organization
|
|
30
|
-
* @param name Name for the new Space
|
|
31
|
-
* @returns The created Space
|
|
32
|
-
*/
|
|
33
|
-
createSpace(orgName: string, name: string): Promise<Space>;
|
|
34
|
-
/**
|
|
35
|
-
* Delete a space by its name.
|
|
36
|
-
* @param orgName Name of the Organization
|
|
37
|
-
* @param spaceName Name of the Space
|
|
38
|
-
*/
|
|
39
|
-
deleteSpace(orgName: string, spaceName: string): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Updates the name of a space.
|
|
42
|
-
* @param orgName Name of the organization
|
|
43
|
-
* @param spaceName Current name of the space
|
|
44
|
-
* @param newSpaceName New name for the space
|
|
45
|
-
* @returns The updated space
|
|
46
|
-
*/
|
|
47
|
-
renameSpace(orgName: string, spaceName: string, newSpaceName: string): Promise<Space>;
|
|
48
|
-
/**
|
|
49
|
-
* Retrieves permissions of a space matching the search filter(s). Will return all permissions of the space if no search filter is provided.
|
|
50
|
-
* @param orgName Name of the organization
|
|
51
|
-
* @param spaceName Name of the space
|
|
52
|
-
* @param filters (optional) Array of search filters
|
|
53
|
-
* @param sorting (optional) Sorting object
|
|
54
|
-
* @param limit (optional) Max number of results (1-100; defaults to 25)
|
|
55
|
-
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
56
|
-
* @returns Object containing an array of Friday Space Permissions and the total number of results found in the database (independent of limit and page)
|
|
57
|
-
*/
|
|
58
|
-
searchSpacePermissions({ orgName, spaceName, filters, sorting, limit, page, }: SearchParams & {
|
|
59
|
-
orgName: string;
|
|
60
|
-
spaceName: string;
|
|
61
|
-
}): Promise<PaginatedResponse<SpaceEntityPermission>>;
|
|
62
|
-
/**
|
|
63
|
-
* Adds/Updates/Removes the permission a user has in the specified space.
|
|
64
|
-
* @param orgName Name of the Organization
|
|
65
|
-
* @param spaceName Name of the Space
|
|
66
|
-
* @param userId ID of the User
|
|
67
|
-
* @param permission New permission
|
|
68
|
-
* @returns The Space with updated permissions
|
|
69
|
-
*/
|
|
70
|
-
updateUserSpacePermission(orgName: string, spaceName: string, userId: string, permission: SpacePermission): Promise<SpaceEntityPermission>;
|
|
71
|
-
/**
|
|
72
|
-
* Adds/Updates/Removes the permission a team has in the specified space. Note: A team cannot be an owner of a Space.
|
|
73
|
-
* @param orgName Name of the Organization
|
|
74
|
-
* @param spaceName Name of the Space
|
|
75
|
-
* @param teamName Name of the Team
|
|
76
|
-
* @param permission New permission
|
|
77
|
-
* @returns The Space with updated permissions
|
|
78
|
-
*/
|
|
79
|
-
updateTeamSpacePermission(orgName: string, spaceName: string, teamName: string, permission: SpacePermission): Promise<SpaceEntityPermission>;
|
|
80
|
-
protected getEndpoint(endpoint: string): string;
|
|
81
|
-
}
|