hcloud-sdk 16.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 +178 -51
- package/lib/Base.d.ts +2 -1
- package/lib/Hcloud.d.ts +6 -0
- package/lib/Hcloud.js +18 -0
- package/lib/helper/ValidationHelper.d.ts +74 -0
- package/lib/helper/ValidationHelper.js +360 -0
- package/lib/interfaces/auditor/index.d.ts +17 -2
- package/lib/interfaces/auditor/index.js +12 -0
- 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/location/index.js +2 -0
- package/lib/interfaces/cosmo/namespace/index.d.ts +9 -0
- package/lib/interfaces/cosmo/namespace/index.js +9 -0
- package/lib/interfaces/cosmo/permissions.d.ts +96 -0
- package/lib/interfaces/cosmo/permissions.js +58 -0
- package/lib/interfaces/cosmo/share/index.d.ts +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/frontend/config/index.d.ts +1 -0
- package/lib/interfaces/fuse/space/index.d.ts +1 -0
- package/lib/interfaces/global/Products.d.ts +3 -1
- package/lib/interfaces/global/Products.js +2 -0
- package/lib/interfaces/global/Views.d.ts +2 -1
- package/lib/interfaces/global/Views.js +1 -0
- package/lib/interfaces/high5/execution/index.d.ts +23 -2
- package/lib/interfaces/high5/execution/index.js +2 -0
- package/lib/interfaces/high5/index.d.ts +7 -7
- package/lib/interfaces/high5/index.js +7 -7
- package/lib/interfaces/high5/space/database/document/index.d.ts +34 -0
- package/lib/interfaces/high5/space/database/document/index.js +14 -0
- package/lib/interfaces/high5/space/database/index.d.ts +12 -0
- 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/event/stream/node/index.d.ts +10 -2
- package/lib/interfaces/high5/space/event/stream/node/index.js +6 -1
- package/lib/interfaces/high5/space/execution/index.d.ts +56 -2
- package/lib/interfaces/high5/space/execution/index.js +8 -0
- package/lib/interfaces/high5/space/index.d.ts +2 -0
- 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/space/pool/index.d.ts +5 -7
- package/lib/interfaces/high5/space/pool/index.js +0 -7
- package/lib/interfaces/high5/space/webhook/index.d.ts +3 -1
- package/lib/interfaces/high5/stats.d.ts +21 -0
- package/lib/interfaces/high5/stats.js +2 -0
- package/lib/interfaces/high5/wave/index.d.ts +8 -3
- package/lib/interfaces/idp/index.d.ts +1 -0
- package/lib/interfaces/idp/index.js +1 -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 -0
- package/lib/interfaces/idp/organization/member/index.d.ts +2 -0
- package/lib/interfaces/idp/organization/service-accounts.d.ts +8 -0
- package/lib/interfaces/idp/organization/service-accounts.js +2 -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/GeneralSettings.d.ts +1 -0
- package/lib/interfaces/idp/user/GeneralSettings.js +1 -0
- 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 +8 -2
- package/lib/interfaces/idp/user/Scopes.js +9 -0
- 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 +98 -9
- package/lib/interfaces/nats/index.js +136 -19
- 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 +26 -7
- package/lib/service/agent/context/index.js +27 -12
- 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/DaliAvatar.d.ts +12 -0
- package/lib/service/dali/DaliAvatar.js +20 -0
- package/lib/service/dali/avatar/DaliCosmoSpace.d.ts +32 -0
- package/lib/service/dali/avatar/DaliCosmoSpace.js +59 -0
- 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 +32 -0
- package/lib/service/dali/avatar/DaliServiceAccount.js +59 -0
- 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/high5/space/database/document/index.d.ts +74 -0
- package/lib/service/high5/space/database/document/index.js +112 -0
- 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/high5/space/database/index.d.ts +65 -0
- package/lib/service/high5/space/database/index.js +102 -0
- 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 +5 -3
- 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 +22 -7
- package/lib/service/high5/space/execution/index.js +23 -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 +18 -7
- package/lib/service/high5/space/execution/status/index.js +20 -8
- package/lib/service/high5/space/index.d.ts +56 -18
- package/lib/service/high5/space/index.js +65 -27
- 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 +52 -24
- 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 +25 -5
- package/lib/service/idp/organization/index.js +29 -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 +21 -8
- package/lib/service/idp/organization/member/index.js +16 -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 +76 -0
- package/lib/service/idp/organization/service-accounts/index.js +109 -0
- 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 +30 -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 +3 -3
- 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 -18
- package/lib/service/nats/index.js +58 -44
- package/lib/service/shorts/index.d.ts +18 -0
- package/lib/service/shorts/index.js +38 -0
- package/lib/service/shorts/internal/index.d.ts +72 -0
- package/lib/service/shorts/internal/index.js +104 -0
- package/lib/utils/bouncer/features/Provider.js +0 -3
- package/package.json +22 -24
package/lib/service/idp/index.js
CHANGED
|
@@ -10,6 +10,7 @@ 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 guest_1 = require("./guest");
|
|
13
14
|
const internal_1 = require("./internal");
|
|
14
15
|
const oauth_1 = require("./oauth");
|
|
15
16
|
const organization_1 = require("./organization");
|
|
@@ -52,6 +53,15 @@ class Idp extends Base_1.default {
|
|
|
52
53
|
}
|
|
53
54
|
return this._user;
|
|
54
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Handles everything around a guest
|
|
58
|
+
*/
|
|
59
|
+
get guest() {
|
|
60
|
+
if (this._guest === undefined) {
|
|
61
|
+
this._guest = new guest_1.IdpGuest(this.options, this.axios);
|
|
62
|
+
}
|
|
63
|
+
return this._guest;
|
|
64
|
+
}
|
|
55
65
|
/**
|
|
56
66
|
* Handles everything around idp's internal endpoints
|
|
57
67
|
*/
|
|
@@ -65,10 +75,10 @@ class Idp extends Base_1.default {
|
|
|
65
75
|
* Requests the endpoint version
|
|
66
76
|
* @returns Version object
|
|
67
77
|
*/
|
|
68
|
-
version() {
|
|
78
|
+
version(raw) {
|
|
69
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
80
|
const resp = yield this.axios.get(this.getEndpoint("/v1/version"));
|
|
71
|
-
return resp.data;
|
|
81
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
72
82
|
});
|
|
73
83
|
}
|
|
74
84
|
/**
|
|
@@ -78,7 +88,7 @@ class Idp extends Base_1.default {
|
|
|
78
88
|
* @param token (optional) token if 2FA-TOTP is enabled
|
|
79
89
|
* @returns SuccessfulAuth object holding the token and the user
|
|
80
90
|
*/
|
|
81
|
-
login(email, password, token) {
|
|
91
|
+
login(email, password, token, raw) {
|
|
82
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
83
93
|
var _a;
|
|
84
94
|
let body = { email: email, password: password };
|
|
@@ -90,7 +100,7 @@ class Idp extends Base_1.default {
|
|
|
90
100
|
token: ((_a = resp.headers["authorization"]) === null || _a === void 0 ? void 0 : _a.toString()) || "",
|
|
91
101
|
user: resp.data,
|
|
92
102
|
};
|
|
93
|
-
return authed;
|
|
103
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? Object.assign(Object.assign({}, resp), { data: authed }) : authed);
|
|
94
104
|
});
|
|
95
105
|
}
|
|
96
106
|
/**
|
|
@@ -101,7 +111,7 @@ class Idp extends Base_1.default {
|
|
|
101
111
|
* @param hint Valid email address of the user that wants to login. Hint must be defined when provider is not.
|
|
102
112
|
* @returns URL that must be accessed via a browser to continue the login process.
|
|
103
113
|
*/
|
|
104
|
-
loginWithOIDC(origin, oidcProvider, hint) {
|
|
114
|
+
loginWithOIDC(origin, oidcProvider, hint, raw) {
|
|
105
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
106
116
|
const resp = yield this.axios.get(this.getEndpoint("/v1/login/oidc"), {
|
|
107
117
|
params: {
|
|
@@ -118,7 +128,7 @@ class Idp extends Base_1.default {
|
|
|
118
128
|
if (!location) {
|
|
119
129
|
throw new Error("Location header is undefined.");
|
|
120
130
|
}
|
|
121
|
-
return location;
|
|
131
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : location);
|
|
122
132
|
});
|
|
123
133
|
}
|
|
124
134
|
/**
|
|
@@ -127,7 +137,7 @@ class Idp extends Base_1.default {
|
|
|
127
137
|
* @param email Email of the user. The email domain will be used to determine the appropriate SAML 2.0 provider to use going forward.
|
|
128
138
|
* @returns URL that must be accessed via a browser to continue the login process.
|
|
129
139
|
*/
|
|
130
|
-
loginWithSAML(origin, email) {
|
|
140
|
+
loginWithSAML(origin, email, raw) {
|
|
131
141
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
142
|
const resp = yield this.axios.get(this.getEndpoint("/v1/login/saml"), {
|
|
133
143
|
params: {
|
|
@@ -143,7 +153,7 @@ class Idp extends Base_1.default {
|
|
|
143
153
|
if (!location) {
|
|
144
154
|
throw new Error("Location header is undefined.");
|
|
145
155
|
}
|
|
146
|
-
return location;
|
|
156
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : location);
|
|
147
157
|
});
|
|
148
158
|
}
|
|
149
159
|
/**
|
|
@@ -155,7 +165,7 @@ class Idp extends Base_1.default {
|
|
|
155
165
|
* @returns object that dictates if: the user needs to REGISTER; the user needs to VERIFY_EMAIL; the user can LOGIN using this email;
|
|
156
166
|
* or the authentication process should continue via an EXTERNAL provider that can be found via the location property.
|
|
157
167
|
*/
|
|
158
|
-
preLogin(email, origin) {
|
|
168
|
+
preLogin(email, origin, raw) {
|
|
159
169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
160
170
|
const resp = yield this.axios.get(this.getEndpoint("/v1/login/pre"), {
|
|
161
171
|
params: {
|
|
@@ -163,7 +173,7 @@ class Idp extends Base_1.default {
|
|
|
163
173
|
email,
|
|
164
174
|
},
|
|
165
175
|
});
|
|
166
|
-
return resp.data;
|
|
176
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
167
177
|
});
|
|
168
178
|
}
|
|
169
179
|
/**
|
|
@@ -173,9 +183,10 @@ class Idp extends Base_1.default {
|
|
|
173
183
|
* @param captcha Valid google reCAPTCHAV2
|
|
174
184
|
* @param targetUrl Optional url the link in the mail will point to
|
|
175
185
|
*/
|
|
176
|
-
resetPassword(email, captcha, targetUrl) {
|
|
186
|
+
resetPassword(email, captcha, targetUrl, raw) {
|
|
177
187
|
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
-
yield this.axios.post(this.getEndpoint("/v1/login/forgot_password"), { email, captcha, targetUrl });
|
|
188
|
+
const resp = yield this.axios.post(this.getEndpoint("/v1/login/forgot_password"), { email, captcha, targetUrl });
|
|
189
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
179
190
|
});
|
|
180
191
|
}
|
|
181
192
|
getEndpoint(endpoint) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Base from "../../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
2
|
import { User } from "../../../interfaces/idp/user";
|
|
3
3
|
export declare class IdpInternal extends Base {
|
|
4
4
|
/**
|
|
@@ -9,9 +9,11 @@ export declare class IdpInternal extends Base {
|
|
|
9
9
|
* @param orgName Name of the organization
|
|
10
10
|
* @returns the created user and a pat token
|
|
11
11
|
*/
|
|
12
|
-
createAgentUser(orgName: string
|
|
12
|
+
createAgentUser<R extends boolean = false>(orgName: string, raw?: {
|
|
13
|
+
raw: R;
|
|
14
|
+
}): Promise<MaybeRaw<R, {
|
|
13
15
|
user: User;
|
|
14
16
|
pat: string;
|
|
15
|
-
}
|
|
17
|
+
}>>;
|
|
16
18
|
protected getEndpoint(endpoint: string): string;
|
|
17
19
|
}
|
|
@@ -20,10 +20,12 @@ class IdpInternal extends Base_1.default {
|
|
|
20
20
|
* @param orgName Name of the organization
|
|
21
21
|
* @returns the created user and a pat token
|
|
22
22
|
*/
|
|
23
|
-
createAgentUser(orgName) {
|
|
23
|
+
createAgentUser(orgName, raw) {
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
var _a, _b;
|
|
26
|
+
const resp = yield this.axios.post(this.getEndpoint(`/internal/v1/org/${orgName}/agent`));
|
|
27
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw)
|
|
28
|
+
? Object.assign(Object.assign({}, resp), { data: { user: resp.data, pat: (_a = resp.headers["x-pat-token"]) !== null && _a !== void 0 ? _a : "" } }) : { user: resp.data, pat: (_b = resp.headers["x-pat-token"]) !== null && _b !== void 0 ? _b : "" });
|
|
27
29
|
});
|
|
28
30
|
}
|
|
29
31
|
getEndpoint(endpoint) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Base from "../../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
2
|
import { OAuthToken, OAuthTokenRequest } from "../../../interfaces/idp/oauth";
|
|
3
3
|
import { OAuthAppPublicInfo } from "../../../interfaces/idp/organization/settings/oauthApp";
|
|
4
4
|
export declare class IdpOAuth extends Base {
|
|
@@ -10,7 +10,9 @@ export declare class IdpOAuth extends Base {
|
|
|
10
10
|
* redirect_uri, scopes and optionally state.
|
|
11
11
|
* @returns the entire redirect uri including the authorization code if successful
|
|
12
12
|
*/
|
|
13
|
-
getAuthorizationCodeInsideRedirectUrl(queryString: string, doNotRedirect?: boolean
|
|
13
|
+
getAuthorizationCodeInsideRedirectUrl<R extends boolean = false>(queryString: string, doNotRedirect?: boolean, raw?: {
|
|
14
|
+
raw: R;
|
|
15
|
+
}): Promise<MaybeRaw<R, string>>;
|
|
14
16
|
/**
|
|
15
17
|
* Check if the user has consented to specified scopes. If the user has already consented this request
|
|
16
18
|
* will return the redirect URL, otherwise, it will be a consent.not.given error.
|
|
@@ -23,7 +25,9 @@ export declare class IdpOAuth extends Base {
|
|
|
23
25
|
* @returns A string with the redirect URL if the user already consented to the specificied scope. Otherwise, an OAuthApp
|
|
24
26
|
* @see OAuthApp
|
|
25
27
|
*/
|
|
26
|
-
getInfoOrAuthorizationCodeInsideRedirectUrl(queryString: string, doNotRedirect?: boolean
|
|
28
|
+
getInfoOrAuthorizationCodeInsideRedirectUrl<R extends boolean = false>(queryString: string, doNotRedirect?: boolean, raw?: {
|
|
29
|
+
raw: R;
|
|
30
|
+
}): Promise<MaybeRaw<R, string>>;
|
|
27
31
|
/**
|
|
28
32
|
* createScopesAndGetAuthorizationCodeInsideRedirectUrl throws for an invalid request (query params do not match OAuthApp).
|
|
29
33
|
* It returns the redirect URL with the code, which is used to redirect to the client application,
|
|
@@ -32,18 +36,24 @@ export declare class IdpOAuth extends Base {
|
|
|
32
36
|
* redirect_uri, scopes and optionally state.
|
|
33
37
|
* @returns the entire redirect uri including the authorization code if successful
|
|
34
38
|
*/
|
|
35
|
-
createScopesAndGetAuthorizationCodeInsideRedirectUrl(queryString: string, doNotRedirect?: boolean
|
|
39
|
+
createScopesAndGetAuthorizationCodeInsideRedirectUrl<R extends boolean = false>(queryString: string, doNotRedirect?: boolean, raw?: {
|
|
40
|
+
raw: R;
|
|
41
|
+
}): Promise<MaybeRaw<R, string>>;
|
|
36
42
|
/**
|
|
37
43
|
* A valid code can be used to request a new API token.
|
|
38
44
|
* @param tokenRequest contains the code, client_id, client_secret and redirect_uri
|
|
39
45
|
*/
|
|
40
|
-
exchangeCodeForToken(tokenRequest: OAuthTokenRequest
|
|
46
|
+
exchangeCodeForToken<R extends boolean = false>(tokenRequest: OAuthTokenRequest, raw?: {
|
|
47
|
+
raw: R;
|
|
48
|
+
}): Promise<MaybeRaw<R, OAuthToken>>;
|
|
41
49
|
/**
|
|
42
50
|
* Get OAuth app public information via client ID
|
|
43
51
|
*
|
|
44
52
|
* @param clientId {string} - Client ID of the OAuth app
|
|
45
53
|
* @returns Public OAuth app information
|
|
46
54
|
*/
|
|
47
|
-
getOAuthAppInfo(clientId: string
|
|
55
|
+
getOAuthAppInfo<R extends boolean = false>(clientId: string, raw?: {
|
|
56
|
+
raw: R;
|
|
57
|
+
}): Promise<MaybeRaw<R, OAuthAppPublicInfo>>;
|
|
48
58
|
protected getEndpoint(endpoint: string): string;
|
|
49
59
|
}
|
|
@@ -20,7 +20,7 @@ class IdpOAuth extends Base_1.default {
|
|
|
20
20
|
* redirect_uri, scopes and optionally state.
|
|
21
21
|
* @returns the entire redirect uri including the authorization code if successful
|
|
22
22
|
*/
|
|
23
|
-
getAuthorizationCodeInsideRedirectUrl(queryString, doNotRedirect) {
|
|
23
|
+
getAuthorizationCodeInsideRedirectUrl(queryString, doNotRedirect, raw) {
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
25
|
if (!queryString.startsWith("?")) {
|
|
26
26
|
queryString = `?${queryString}`;
|
|
@@ -28,11 +28,11 @@ class IdpOAuth extends Base_1.default {
|
|
|
28
28
|
if (doNotRedirect) {
|
|
29
29
|
queryString += "&no_redirect=true";
|
|
30
30
|
}
|
|
31
|
-
const
|
|
31
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/login/oauth/authorize${queryString}`), { maxRedirects: 0 });
|
|
32
32
|
if (doNotRedirect) {
|
|
33
|
-
return
|
|
33
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data.redirectUrl);
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.headers.location);
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
@@ -47,7 +47,7 @@ class IdpOAuth extends Base_1.default {
|
|
|
47
47
|
* @returns A string with the redirect URL if the user already consented to the specificied scope. Otherwise, an OAuthApp
|
|
48
48
|
* @see OAuthApp
|
|
49
49
|
*/
|
|
50
|
-
getInfoOrAuthorizationCodeInsideRedirectUrl(queryString, doNotRedirect) {
|
|
50
|
+
getInfoOrAuthorizationCodeInsideRedirectUrl(queryString, doNotRedirect, raw) {
|
|
51
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
52
|
if (!queryString.startsWith("?")) {
|
|
53
53
|
queryString = `?${queryString}`;
|
|
@@ -59,9 +59,9 @@ class IdpOAuth extends Base_1.default {
|
|
|
59
59
|
maxRedirects: 0,
|
|
60
60
|
});
|
|
61
61
|
if (response.status < 300) {
|
|
62
|
-
return response.data.redirectUrl;
|
|
62
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? response : response.data.redirectUrl);
|
|
63
63
|
}
|
|
64
|
-
return response.headers.location;
|
|
64
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? response : response.headers.location);
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
@@ -72,7 +72,7 @@ class IdpOAuth extends Base_1.default {
|
|
|
72
72
|
* redirect_uri, scopes and optionally state.
|
|
73
73
|
* @returns the entire redirect uri including the authorization code if successful
|
|
74
74
|
*/
|
|
75
|
-
createScopesAndGetAuthorizationCodeInsideRedirectUrl(queryString, doNotRedirect) {
|
|
75
|
+
createScopesAndGetAuthorizationCodeInsideRedirectUrl(queryString, doNotRedirect, raw) {
|
|
76
76
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
77
|
if (!queryString.startsWith("?")) {
|
|
78
78
|
queryString = `?${queryString}`;
|
|
@@ -80,21 +80,21 @@ class IdpOAuth extends Base_1.default {
|
|
|
80
80
|
if (doNotRedirect) {
|
|
81
81
|
queryString += "&no_redirect=true";
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/login/oauth/authorize${queryString}`));
|
|
84
84
|
if (doNotRedirect) {
|
|
85
|
-
return
|
|
85
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data.redirectUrl);
|
|
86
86
|
}
|
|
87
|
-
return
|
|
87
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
91
91
|
* A valid code can be used to request a new API token.
|
|
92
92
|
* @param tokenRequest contains the code, client_id, client_secret and redirect_uri
|
|
93
93
|
*/
|
|
94
|
-
exchangeCodeForToken(tokenRequest) {
|
|
94
|
+
exchangeCodeForToken(tokenRequest, raw) {
|
|
95
95
|
return __awaiter(this, void 0, void 0, function* () {
|
|
96
96
|
const response = yield this.axios.post(this.getEndpoint(`/v1/login/oauth/access_token`), tokenRequest);
|
|
97
|
-
return response.data;
|
|
97
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? response : response.data);
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
@@ -103,10 +103,10 @@ class IdpOAuth extends Base_1.default {
|
|
|
103
103
|
* @param clientId {string} - Client ID of the OAuth app
|
|
104
104
|
* @returns Public OAuth app information
|
|
105
105
|
*/
|
|
106
|
-
getOAuthAppInfo(clientId) {
|
|
106
|
+
getOAuthAppInfo(clientId, raw) {
|
|
107
107
|
return __awaiter(this, void 0, void 0, function* () {
|
|
108
108
|
const response = yield this.axios.get(this.getEndpoint(`/v1/login/oauth/app/${clientId}`));
|
|
109
|
-
return response.data;
|
|
109
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? response : response.data);
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
getEndpoint(endpoint) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import Base from "../../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
2
|
import { Organization, OrganizationQueryOptions } from "../../../interfaces/idp/organization";
|
|
3
3
|
import { IdpOrganizationLicense } from "./license";
|
|
4
4
|
import { IdpOrganizationMember } from "./member";
|
|
5
|
+
import IdpOrganizationServiceAccounts from "./service-accounts";
|
|
5
6
|
import IdpOrganizationSettings from "./settings";
|
|
7
|
+
import { IdpOrganizationStat } from "./stat";
|
|
6
8
|
import { IdpOrganizationTeams } from "./team";
|
|
7
9
|
export declare class IdpOrganization extends Base {
|
|
8
10
|
/**
|
|
@@ -25,6 +27,16 @@ export declare class IdpOrganization extends Base {
|
|
|
25
27
|
*/
|
|
26
28
|
get license(): IdpOrganizationLicense;
|
|
27
29
|
private _license?;
|
|
30
|
+
/**
|
|
31
|
+
* Handles everything around organization service accounts
|
|
32
|
+
*/
|
|
33
|
+
get serviceAccounts(): IdpOrganizationServiceAccounts;
|
|
34
|
+
private _serviceAccounts?;
|
|
35
|
+
/**
|
|
36
|
+
* Handles everything around organization statistics.
|
|
37
|
+
*/
|
|
38
|
+
get stat(): IdpOrganizationStat;
|
|
39
|
+
private _stat?;
|
|
28
40
|
/**
|
|
29
41
|
* Updates an Organization.
|
|
30
42
|
* @param orgName Current name of the Organization
|
|
@@ -32,25 +44,33 @@ export declare class IdpOrganization extends Base {
|
|
|
32
44
|
* @param company (optional) New company name
|
|
33
45
|
* @returns The updated Organization
|
|
34
46
|
*/
|
|
35
|
-
updateOrganization(orgName: string, newName: string, company?: string
|
|
47
|
+
updateOrganization<R extends boolean = false>(orgName: string, newName: string, company?: string, raw?: {
|
|
48
|
+
raw: R;
|
|
49
|
+
}): Promise<MaybeRaw<R, Organization>>;
|
|
36
50
|
/**
|
|
37
51
|
* Creates a new Organization.
|
|
38
52
|
* @param name Name of the new Organization
|
|
39
53
|
* @param company (optional) Company name for the new Organization
|
|
40
54
|
* @returns The created Organization
|
|
41
55
|
*/
|
|
42
|
-
createOrganization(name: string, company?: string
|
|
56
|
+
createOrganization<R extends boolean = false>(name: string, company?: string, raw?: {
|
|
57
|
+
raw: R;
|
|
58
|
+
}): Promise<MaybeRaw<R, Organization>>;
|
|
43
59
|
/**
|
|
44
60
|
* Retrieves an Organization by its name.
|
|
45
61
|
* @param orgName Name of the Organization
|
|
46
62
|
* @param options Defines query options to retrieve additional properties in the response
|
|
47
63
|
* @returns The requested Organization
|
|
48
64
|
*/
|
|
49
|
-
getOrganization(orgName: string, options?: OrganizationQueryOptions
|
|
65
|
+
getOrganization<R extends boolean = false>(orgName: string, options?: OrganizationQueryOptions, raw?: {
|
|
66
|
+
raw: R;
|
|
67
|
+
}): Promise<MaybeRaw<R, Organization>>;
|
|
50
68
|
/**
|
|
51
69
|
* Deletes an Organization. This will also delete all dependencies that the Organization has (Teams, Spaces, apps, ...).
|
|
52
70
|
* @param orgName Name of the Organization to be deleted
|
|
53
71
|
*/
|
|
54
|
-
deleteOrganization(orgName: string
|
|
72
|
+
deleteOrganization<R extends boolean = false>(orgName: string, raw?: {
|
|
73
|
+
raw: R;
|
|
74
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
55
75
|
protected getEndpoint(endpoint: string): string;
|
|
56
76
|
}
|
|
@@ -13,7 +13,9 @@ exports.IdpOrganization = void 0;
|
|
|
13
13
|
const Base_1 = require("../../../Base");
|
|
14
14
|
const license_1 = require("./license");
|
|
15
15
|
const member_1 = require("./member");
|
|
16
|
+
const service_accounts_1 = require("./service-accounts");
|
|
16
17
|
const settings_1 = require("./settings");
|
|
18
|
+
const stat_1 = require("./stat");
|
|
17
19
|
const team_1 = require("./team");
|
|
18
20
|
class IdpOrganization extends Base_1.default {
|
|
19
21
|
/**
|
|
@@ -52,6 +54,24 @@ class IdpOrganization extends Base_1.default {
|
|
|
52
54
|
}
|
|
53
55
|
return this._license;
|
|
54
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Handles everything around organization service accounts
|
|
59
|
+
*/
|
|
60
|
+
get serviceAccounts() {
|
|
61
|
+
if (this._serviceAccounts === undefined) {
|
|
62
|
+
this._serviceAccounts = new service_accounts_1.default(this.options, this.axios);
|
|
63
|
+
}
|
|
64
|
+
return this._serviceAccounts;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Handles everything around organization statistics.
|
|
68
|
+
*/
|
|
69
|
+
get stat() {
|
|
70
|
+
if (this._stat === undefined) {
|
|
71
|
+
this._stat = new stat_1.IdpOrganizationStat(this.options, this.axios);
|
|
72
|
+
}
|
|
73
|
+
return this._stat;
|
|
74
|
+
}
|
|
55
75
|
/**
|
|
56
76
|
* Updates an Organization.
|
|
57
77
|
* @param orgName Current name of the Organization
|
|
@@ -59,11 +79,11 @@ class IdpOrganization extends Base_1.default {
|
|
|
59
79
|
* @param company (optional) New company name
|
|
60
80
|
* @returns The updated Organization
|
|
61
81
|
*/
|
|
62
|
-
updateOrganization(orgName, newName, company) {
|
|
82
|
+
updateOrganization(orgName, newName, company, raw) {
|
|
63
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64
84
|
const organization = { name: newName, company: company };
|
|
65
85
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/org/${orgName}`), organization);
|
|
66
|
-
return resp.data;
|
|
86
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
67
87
|
});
|
|
68
88
|
}
|
|
69
89
|
/**
|
|
@@ -72,11 +92,11 @@ class IdpOrganization extends Base_1.default {
|
|
|
72
92
|
* @param company (optional) Company name for the new Organization
|
|
73
93
|
* @returns The created Organization
|
|
74
94
|
*/
|
|
75
|
-
createOrganization(name, company) {
|
|
95
|
+
createOrganization(name, company, raw) {
|
|
76
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
97
|
const organization = { name: name, company: company };
|
|
78
98
|
const resp = yield this.axios.post(this.getEndpoint(`/v1/org`), organization);
|
|
79
|
-
return resp.data;
|
|
99
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
80
100
|
});
|
|
81
101
|
}
|
|
82
102
|
/**
|
|
@@ -85,7 +105,7 @@ class IdpOrganization extends Base_1.default {
|
|
|
85
105
|
* @param options Defines query options to retrieve additional properties in the response
|
|
86
106
|
* @returns The requested Organization
|
|
87
107
|
*/
|
|
88
|
-
getOrganization(orgName, options) {
|
|
108
|
+
getOrganization(orgName, options, raw) {
|
|
89
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
110
|
const resp = yield this.axios.get(this.getEndpoint(`/v1/org/${orgName}`), {
|
|
91
111
|
params: {
|
|
@@ -95,16 +115,17 @@ class IdpOrganization extends Base_1.default {
|
|
|
95
115
|
license: options === null || options === void 0 ? void 0 : options.getLicense,
|
|
96
116
|
},
|
|
97
117
|
});
|
|
98
|
-
return resp.data;
|
|
118
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
99
119
|
});
|
|
100
120
|
}
|
|
101
121
|
/**
|
|
102
122
|
* Deletes an Organization. This will also delete all dependencies that the Organization has (Teams, Spaces, apps, ...).
|
|
103
123
|
* @param orgName Name of the Organization to be deleted
|
|
104
124
|
*/
|
|
105
|
-
deleteOrganization(orgName) {
|
|
125
|
+
deleteOrganization(orgName, raw) {
|
|
106
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
-
yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}`));
|
|
127
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/org/${orgName}`));
|
|
128
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
108
129
|
});
|
|
109
130
|
}
|
|
110
131
|
getEndpoint(endpoint) {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import Base from "../../../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../Base";
|
|
2
2
|
import { License } from "../../../../interfaces/idp/organization/license";
|
|
3
3
|
export declare class IdpOrganizationLicense extends Base {
|
|
4
|
-
getLicense(orgName: string
|
|
5
|
-
|
|
4
|
+
getLicense<R extends boolean = false>(orgName: string, raw?: {
|
|
5
|
+
raw: R;
|
|
6
|
+
}): Promise<MaybeRaw<R, License>>;
|
|
7
|
+
updateLicense<R extends boolean = false>(orgName: string, token: string, raw?: {
|
|
8
|
+
raw: R;
|
|
9
|
+
}): Promise<MaybeRaw<R, License>>;
|
|
6
10
|
protected getEndpoint(endpoint: string): string;
|
|
7
11
|
}
|
|
@@ -12,16 +12,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.IdpOrganizationLicense = void 0;
|
|
13
13
|
const Base_1 = require("../../../../Base");
|
|
14
14
|
class IdpOrganizationLicense extends Base_1.default {
|
|
15
|
-
getLicense(orgName) {
|
|
15
|
+
getLicense(orgName, raw) {
|
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
17
|
const res = yield this.axios.get(this.getEndpoint(`/org/${orgName}/license`));
|
|
18
|
-
return res.data;
|
|
18
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
updateLicense(orgName, token) {
|
|
21
|
+
updateLicense(orgName, token, raw) {
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
23
|
const res = yield this.axios.put(this.getEndpoint(`/org/${orgName}/license`), { identifier: token });
|
|
24
|
-
return res.data;
|
|
24
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
getEndpoint(endpoint) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Base from "../../../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../Base";
|
|
2
2
|
import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
|
|
3
3
|
import { OrganizationMember, OrgMemberPatch } from "../../../../interfaces/idp/organization/member";
|
|
4
4
|
import IdpOrganizationMemberInvitations from "./invitations";
|
|
@@ -15,17 +15,22 @@ export declare class IdpOrganizationMember extends Base {
|
|
|
15
15
|
* @param page (optional) Page number to skip the first (page * limit) results (defaults to 0)
|
|
16
16
|
* @returns Object containing an array of Organization Members and the total number of results found in the database (independent of limit and page)
|
|
17
17
|
*/
|
|
18
|
-
searchOrganizationMembers({ orgName, filters, excludeTeamByName, sorting, limit, page, }: SearchParams & {
|
|
18
|
+
searchOrganizationMembers<R extends boolean = false>({ orgName, filters, excludeTeamByName, excludeServiceAccounts, sorting, limit, page, }: SearchParams & {
|
|
19
19
|
orgName: string;
|
|
20
20
|
excludeTeamByName?: string;
|
|
21
|
-
|
|
21
|
+
excludeServiceAccounts?: boolean;
|
|
22
|
+
}, raw?: {
|
|
23
|
+
raw: R;
|
|
24
|
+
}): Promise<MaybeRaw<R, PaginatedResponse<OrganizationMember>>>;
|
|
22
25
|
/**
|
|
23
26
|
* Retrieves an organization member by its user ID.
|
|
24
27
|
* @param orgName Name of the organization
|
|
25
28
|
* @param userId ID of the user
|
|
26
29
|
* @returns The requested Organization Member
|
|
27
30
|
*/
|
|
28
|
-
getOrganizationMember(orgName: string, userId: string
|
|
31
|
+
getOrganizationMember<R extends boolean = false>(orgName: string, userId: string, raw?: {
|
|
32
|
+
raw: R;
|
|
33
|
+
}): Promise<MaybeRaw<R, OrganizationMember>>;
|
|
29
34
|
/**
|
|
30
35
|
* Updates the role of a User in the specified Organization.
|
|
31
36
|
* @param orgName Name of the Organization
|
|
@@ -33,7 +38,9 @@ export declare class IdpOrganizationMember extends Base {
|
|
|
33
38
|
* @param orgMemberPatch New role
|
|
34
39
|
* @returns The updated OrganizationMember
|
|
35
40
|
*/
|
|
36
|
-
patchOrganizationMemberRole(orgName: string, userId: string, orgMemberPatch: OrgMemberPatch
|
|
41
|
+
patchOrganizationMemberRole<R extends boolean = false>(orgName: string, userId: string, orgMemberPatch: OrgMemberPatch, raw?: {
|
|
42
|
+
raw: R;
|
|
43
|
+
}): Promise<MaybeRaw<R, OrganizationMember>>;
|
|
37
44
|
/**
|
|
38
45
|
* Updates the executionTarget flag of a User in the specified Organization.
|
|
39
46
|
* @param orgName Name of the Organization
|
|
@@ -41,17 +48,23 @@ export declare class IdpOrganizationMember extends Base {
|
|
|
41
48
|
* @param executionTarget Boolean value to set
|
|
42
49
|
* @returns The updated OrganizationMember
|
|
43
50
|
*/
|
|
44
|
-
patchOrganizationExecutionTarget(orgName: string, userId: string, executionTarget: boolean
|
|
51
|
+
patchOrganizationExecutionTarget<R extends boolean = false>(orgName: string, userId: string, executionTarget: boolean, raw?: {
|
|
52
|
+
raw: R;
|
|
53
|
+
}): Promise<MaybeRaw<R, OrganizationMember>>;
|
|
45
54
|
/**
|
|
46
55
|
* Removes a Member from an Organization.
|
|
47
56
|
* @param orgName Name of the Organization
|
|
48
57
|
* @param userId ID of the User
|
|
49
58
|
*/
|
|
50
|
-
removeOrganizationMember(orgName: string, userId: string
|
|
59
|
+
removeOrganizationMember<R extends boolean = false>(orgName: string, userId: string, raw?: {
|
|
60
|
+
raw: R;
|
|
61
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
51
62
|
/**
|
|
52
63
|
* Member leaves the organization independently.
|
|
53
64
|
* @param orgName Name of the Organization
|
|
54
65
|
*/
|
|
55
|
-
leaveOrganization(orgName: string
|
|
66
|
+
leaveOrganization<R extends boolean = false>(orgName: string, raw?: {
|
|
67
|
+
raw: R;
|
|
68
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
56
69
|
protected getEndpoint(endpoint: string): string;
|
|
57
70
|
}
|
|
@@ -31,8 +31,8 @@ class IdpOrganizationMember extends Base_1.default {
|
|
|
31
31
|
* @param page (optional) Page number to skip the first (page * limit) results (defaults to 0)
|
|
32
32
|
* @returns Object containing an array of Organization Members and the total number of results found in the database (independent of limit and page)
|
|
33
33
|
*/
|
|
34
|
-
searchOrganizationMembers(_a) {
|
|
35
|
-
return __awaiter(this, arguments, void 0, function* ({ orgName, filters, excludeTeamByName, sorting, limit = 25, page = 0, }) {
|
|
34
|
+
searchOrganizationMembers(_a, raw_1) {
|
|
35
|
+
return __awaiter(this, arguments, void 0, function* ({ orgName, filters, excludeTeamByName, excludeServiceAccounts, sorting, limit = 25, page = 0, }, raw) {
|
|
36
36
|
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
37
37
|
return new searchFilter_1.SearchFilterDTO(f);
|
|
38
38
|
});
|
|
@@ -40,8 +40,9 @@ class IdpOrganizationMember extends Base_1.default {
|
|
|
40
40
|
filters: filtersDTO,
|
|
41
41
|
sorting,
|
|
42
42
|
excludeTeamByName,
|
|
43
|
+
excludeServiceAccounts,
|
|
43
44
|
});
|
|
44
|
-
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
45
|
+
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));
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
/**
|
|
@@ -50,10 +51,10 @@ class IdpOrganizationMember extends Base_1.default {
|
|
|
50
51
|
* @param userId ID of the user
|
|
51
52
|
* @returns The requested Organization Member
|
|
52
53
|
*/
|
|
53
|
-
getOrganizationMember(orgName, userId) {
|
|
54
|
+
getOrganizationMember(orgName, userId, raw) {
|
|
54
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
56
|
const resp = yield this.axios.get(this.getEndpoint(`/${orgName}/members/${userId}`));
|
|
56
|
-
return resp.data;
|
|
57
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
60
|
/**
|
|
@@ -63,10 +64,10 @@ class IdpOrganizationMember extends Base_1.default {
|
|
|
63
64
|
* @param orgMemberPatch New role
|
|
64
65
|
* @returns The updated OrganizationMember
|
|
65
66
|
*/
|
|
66
|
-
patchOrganizationMemberRole(orgName, userId, orgMemberPatch) {
|
|
67
|
+
patchOrganizationMemberRole(orgName, userId, orgMemberPatch, raw) {
|
|
67
68
|
return __awaiter(this, void 0, void 0, function* () {
|
|
68
69
|
const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/members/${userId}/role`), orgMemberPatch);
|
|
69
|
-
return resp.data;
|
|
70
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
70
71
|
});
|
|
71
72
|
}
|
|
72
73
|
/**
|
|
@@ -76,12 +77,12 @@ class IdpOrganizationMember extends Base_1.default {
|
|
|
76
77
|
* @param executionTarget Boolean value to set
|
|
77
78
|
* @returns The updated OrganizationMember
|
|
78
79
|
*/
|
|
79
|
-
patchOrganizationExecutionTarget(orgName, userId, executionTarget) {
|
|
80
|
+
patchOrganizationExecutionTarget(orgName, userId, executionTarget, raw) {
|
|
80
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
81
82
|
const resp = yield this.axios.patch(this.getEndpoint(`/${orgName}/members/${userId}/executionTarget`), {
|
|
82
83
|
executionTarget,
|
|
83
84
|
});
|
|
84
|
-
return resp.data;
|
|
85
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
88
|
/**
|
|
@@ -89,18 +90,20 @@ class IdpOrganizationMember extends Base_1.default {
|
|
|
89
90
|
* @param orgName Name of the Organization
|
|
90
91
|
* @param userId ID of the User
|
|
91
92
|
*/
|
|
92
|
-
removeOrganizationMember(orgName, userId) {
|
|
93
|
+
removeOrganizationMember(orgName, userId, raw) {
|
|
93
94
|
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
yield this.axios.delete(this.getEndpoint(`/${orgName}/members/${userId}`));
|
|
95
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/${orgName}/members/${userId}`));
|
|
96
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
95
97
|
});
|
|
96
98
|
}
|
|
97
99
|
/**
|
|
98
100
|
* Member leaves the organization independently.
|
|
99
101
|
* @param orgName Name of the Organization
|
|
100
102
|
*/
|
|
101
|
-
leaveOrganization(orgName) {
|
|
103
|
+
leaveOrganization(orgName, raw) {
|
|
102
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
-
yield this.axios.delete(this.getEndpoint(`/${orgName}/members`));
|
|
105
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/${orgName}/members`));
|
|
106
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
104
107
|
});
|
|
105
108
|
}
|
|
106
109
|
getEndpoint(endpoint) {
|