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
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import Base from "../../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../Base";
|
|
2
2
|
import { PaginatedResponse, SearchFilter, Sorting } from "../../../interfaces/global";
|
|
3
3
|
import { Organization, OrganizationQueryOptions } from "../../../interfaces/idp/organization";
|
|
4
4
|
import { OrganizationMemberInvitation } from "../../../interfaces/idp/organization/member/invitations";
|
|
5
5
|
import { User, UserPatch } from "../../../interfaces/idp/user";
|
|
6
6
|
import { IdpUserLicense } from "./license";
|
|
7
|
+
import { IdpMessage } from "./message";
|
|
7
8
|
import UserPasswordService from "./password";
|
|
8
9
|
import { IdpSettings } from "./settings";
|
|
9
10
|
export declare class IdpUser extends Base {
|
|
@@ -22,17 +23,26 @@ export declare class IdpUser extends Base {
|
|
|
22
23
|
*/
|
|
23
24
|
get license(): IdpUserLicense;
|
|
24
25
|
private _license?;
|
|
26
|
+
/**
|
|
27
|
+
* Handles everything around a user's messages
|
|
28
|
+
*/
|
|
29
|
+
get message(): IdpMessage;
|
|
30
|
+
private _message?;
|
|
25
31
|
/**
|
|
26
32
|
* Retrieves the User database entry for the requesting user.
|
|
27
33
|
* @returns User object
|
|
28
34
|
*/
|
|
29
|
-
getUser(
|
|
35
|
+
getUser<R extends boolean = false>(raw?: {
|
|
36
|
+
raw: R;
|
|
37
|
+
}): Promise<MaybeRaw<R, User>>;
|
|
30
38
|
/**
|
|
31
39
|
* Updates the User database entry of the requesting user.
|
|
32
40
|
* @param user UserPatch object holding the new User values
|
|
33
41
|
* @returns User object
|
|
34
42
|
*/
|
|
35
|
-
patchUser(user: UserPatch
|
|
43
|
+
patchUser<R extends boolean = false>(user: UserPatch, raw?: {
|
|
44
|
+
raw: R;
|
|
45
|
+
}): Promise<MaybeRaw<R, User>>;
|
|
36
46
|
/**
|
|
37
47
|
* Updates the Password of the requesting user.
|
|
38
48
|
* @param oldPassword String object holding the old password
|
|
@@ -40,15 +50,21 @@ export declare class IdpUser extends Base {
|
|
|
40
50
|
* @param token String (optional) object holding the current TOTP token
|
|
41
51
|
* @returns User object
|
|
42
52
|
*/
|
|
43
|
-
patchUserPassword(oldPassword: string, newPassword: string, totp?: string
|
|
53
|
+
patchUserPassword<R extends boolean = false>(oldPassword: string, newPassword: string, totp?: string, raw?: {
|
|
54
|
+
raw: R;
|
|
55
|
+
}): Promise<MaybeRaw<R, User>>;
|
|
44
56
|
/**
|
|
45
57
|
* Deletes user session and logs him out of HCloud on all devices.
|
|
46
58
|
*/
|
|
47
|
-
deleteUserSession(
|
|
59
|
+
deleteUserSession<R extends boolean = false>(raw?: {
|
|
60
|
+
raw: R;
|
|
61
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
48
62
|
/**
|
|
49
63
|
* Deletes the requesting user.
|
|
50
64
|
*/
|
|
51
|
-
deleteUser(
|
|
65
|
+
deleteUser<R extends boolean = false>(raw?: {
|
|
66
|
+
raw: R;
|
|
67
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
52
68
|
/**
|
|
53
69
|
* Retrieves all Organizations of a user that match the provided search filter(s). Returns all Organizations of the user if no search filter is provided.
|
|
54
70
|
* @param filters (optional) Array of search filters
|
|
@@ -58,13 +74,15 @@ export declare class IdpUser extends Base {
|
|
|
58
74
|
* @param options (optional) Defines query options to retrieve additional properties for the returned Organization objects.
|
|
59
75
|
* @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
|
|
60
76
|
*/
|
|
61
|
-
searchOrganizations(params: {
|
|
77
|
+
searchOrganizations<R extends boolean = false>(params: {
|
|
62
78
|
filters: SearchFilter[];
|
|
63
79
|
sorting?: Sorting;
|
|
64
80
|
limit?: number;
|
|
65
81
|
page?: number;
|
|
66
82
|
options?: OrganizationQueryOptions;
|
|
67
|
-
}
|
|
83
|
+
}, raw?: {
|
|
84
|
+
raw: R;
|
|
85
|
+
}): Promise<MaybeRaw<R, PaginatedResponse<Organization>>>;
|
|
68
86
|
/**
|
|
69
87
|
* Retrieves all organization invitations of a user that match the provided search filter(s). Returns all invitations of the user if no search filter is provided.
|
|
70
88
|
* @param filters (optional) Array of search filters
|
|
@@ -73,15 +91,19 @@ export declare class IdpUser extends Base {
|
|
|
73
91
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
74
92
|
* @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
|
|
75
93
|
*/
|
|
76
|
-
searchInvitations(params: {
|
|
94
|
+
searchInvitations<R extends boolean = false>(params: {
|
|
77
95
|
filters: SearchFilter[];
|
|
78
96
|
sorting?: Sorting;
|
|
79
97
|
limit?: number;
|
|
80
98
|
page?: number;
|
|
81
|
-
}
|
|
99
|
+
}, raw?: {
|
|
100
|
+
raw: R;
|
|
101
|
+
}): Promise<MaybeRaw<R, PaginatedResponse<OrganizationMemberInvitation>>>;
|
|
82
102
|
/**
|
|
83
103
|
* Maintains a user's online status
|
|
84
104
|
*/
|
|
85
|
-
ping(
|
|
105
|
+
ping<R extends boolean = false>(raw?: {
|
|
106
|
+
raw: R;
|
|
107
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
86
108
|
protected getEndpoint(endpoint: string): string;
|
|
87
109
|
}
|
|
@@ -14,6 +14,7 @@ const Base_1 = require("../../../Base");
|
|
|
14
14
|
const paginatedResponseHelper_1 = require("../../../helper/paginatedResponseHelper");
|
|
15
15
|
const searchFilter_1 = require("../../../helper/searchFilter");
|
|
16
16
|
const license_1 = require("./license");
|
|
17
|
+
const message_1 = require("./message");
|
|
17
18
|
const password_1 = require("./password");
|
|
18
19
|
const settings_1 = require("./settings");
|
|
19
20
|
class IdpUser extends Base_1.default {
|
|
@@ -44,14 +45,23 @@ class IdpUser extends Base_1.default {
|
|
|
44
45
|
}
|
|
45
46
|
return this._license;
|
|
46
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Handles everything around a user's messages
|
|
50
|
+
*/
|
|
51
|
+
get message() {
|
|
52
|
+
if (this._message === undefined) {
|
|
53
|
+
this._message = new message_1.IdpMessage(this.options, this.axios);
|
|
54
|
+
}
|
|
55
|
+
return this._message;
|
|
56
|
+
}
|
|
47
57
|
/**
|
|
48
58
|
* Retrieves the User database entry for the requesting user.
|
|
49
59
|
* @returns User object
|
|
50
60
|
*/
|
|
51
|
-
getUser() {
|
|
61
|
+
getUser(raw) {
|
|
52
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
63
|
const resp = yield this.axios.get(this.getEndpoint("/v1/user"));
|
|
54
|
-
return resp.data;
|
|
64
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
55
65
|
});
|
|
56
66
|
}
|
|
57
67
|
/**
|
|
@@ -59,10 +69,10 @@ class IdpUser extends Base_1.default {
|
|
|
59
69
|
* @param user UserPatch object holding the new User values
|
|
60
70
|
* @returns User object
|
|
61
71
|
*/
|
|
62
|
-
patchUser(user) {
|
|
72
|
+
patchUser(user, raw) {
|
|
63
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
64
74
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/user`), user);
|
|
65
|
-
return resp.data;
|
|
75
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
66
76
|
});
|
|
67
77
|
}
|
|
68
78
|
/**
|
|
@@ -72,7 +82,7 @@ class IdpUser extends Base_1.default {
|
|
|
72
82
|
* @param token String (optional) object holding the current TOTP token
|
|
73
83
|
* @returns User object
|
|
74
84
|
*/
|
|
75
|
-
patchUserPassword(oldPassword, newPassword, totp) {
|
|
85
|
+
patchUserPassword(oldPassword, newPassword, totp, raw) {
|
|
76
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
87
|
const t = {
|
|
78
88
|
old: oldPassword,
|
|
@@ -83,23 +93,25 @@ class IdpUser extends Base_1.default {
|
|
|
83
93
|
delete t.token;
|
|
84
94
|
}
|
|
85
95
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/password`), t);
|
|
86
|
-
return resp.data;
|
|
96
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
87
97
|
});
|
|
88
98
|
}
|
|
89
99
|
/**
|
|
90
100
|
* Deletes user session and logs him out of HCloud on all devices.
|
|
91
101
|
*/
|
|
92
|
-
deleteUserSession() {
|
|
102
|
+
deleteUserSession(raw) {
|
|
93
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
yield this.axios.delete(this.getEndpoint(`/v1/user/sessions`));
|
|
104
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/user/sessions`));
|
|
105
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
95
106
|
});
|
|
96
107
|
}
|
|
97
108
|
/**
|
|
98
109
|
* Deletes the requesting user.
|
|
99
110
|
*/
|
|
100
|
-
deleteUser() {
|
|
111
|
+
deleteUser(raw) {
|
|
101
112
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
-
yield this.axios.delete(this.getEndpoint(`/v1/user`));
|
|
113
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/user`));
|
|
114
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
103
115
|
});
|
|
104
116
|
}
|
|
105
117
|
/**
|
|
@@ -112,7 +124,7 @@ class IdpUser extends Base_1.default {
|
|
|
112
124
|
* @returns Object containing an array of Organizations and the total number of results found in the database (independent of limit and page)
|
|
113
125
|
*/
|
|
114
126
|
// eslint-disable-next-line complexity
|
|
115
|
-
searchOrganizations(params) {
|
|
127
|
+
searchOrganizations(params, raw) {
|
|
116
128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
129
|
var _a, _b, _c;
|
|
118
130
|
const limit = params.limit || 25;
|
|
@@ -128,7 +140,7 @@ class IdpUser extends Base_1.default {
|
|
|
128
140
|
filters: filtersDTO,
|
|
129
141
|
sorting: params.sorting,
|
|
130
142
|
});
|
|
131
|
-
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
143
|
+
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));
|
|
132
144
|
});
|
|
133
145
|
}
|
|
134
146
|
/**
|
|
@@ -139,7 +151,7 @@ class IdpUser extends Base_1.default {
|
|
|
139
151
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
140
152
|
* @returns Object containing an array of invitations and the total number of results found in the database (independent of limit and page)
|
|
141
153
|
*/
|
|
142
|
-
searchInvitations(params) {
|
|
154
|
+
searchInvitations(params, raw) {
|
|
143
155
|
return __awaiter(this, void 0, void 0, function* () {
|
|
144
156
|
const limit = params.limit || 25;
|
|
145
157
|
const page = params.page || 0;
|
|
@@ -151,15 +163,16 @@ class IdpUser extends Base_1.default {
|
|
|
151
163
|
filters: filtersDTO,
|
|
152
164
|
sorting: params.sorting,
|
|
153
165
|
});
|
|
154
|
-
return (0, paginatedResponseHelper_1.createPaginatedResponse)(resp);
|
|
166
|
+
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));
|
|
155
167
|
});
|
|
156
168
|
}
|
|
157
169
|
/**
|
|
158
170
|
* Maintains a user's online status
|
|
159
171
|
*/
|
|
160
|
-
ping() {
|
|
172
|
+
ping(raw) {
|
|
161
173
|
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
-
yield this.axios.get(this.getEndpoint("/v1/user/ping"));
|
|
174
|
+
const resp = yield this.axios.get(this.getEndpoint("/v1/user/ping"));
|
|
175
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
163
176
|
});
|
|
164
177
|
}
|
|
165
178
|
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 IdpUserLicense extends Base {
|
|
4
|
-
getLicense(
|
|
5
|
-
|
|
4
|
+
getLicense<R extends boolean = false>(raw?: {
|
|
5
|
+
raw: R;
|
|
6
|
+
}): Promise<MaybeRaw<R, License>>;
|
|
7
|
+
updateLicense<R extends boolean = false>(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.IdpUserLicense = void 0;
|
|
13
13
|
const Base_1 = require("../../../../Base");
|
|
14
14
|
class IdpUserLicense extends Base_1.default {
|
|
15
|
-
getLicense() {
|
|
15
|
+
getLicense(raw) {
|
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17
17
|
const res = yield this.axios.get(this.getEndpoint(`/user/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(token) {
|
|
21
|
+
updateLicense(token, raw) {
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
23
|
const res = yield this.axios.put(this.getEndpoint(`/user/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) {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../Base";
|
|
2
|
+
import { PaginatedResponse, SearchParams } from "../../../../interfaces/global";
|
|
3
|
+
import { Message, RecipientType } from "../../../../interfaces/idp/user/Message";
|
|
4
|
+
export declare class IdpMessage extends Base {
|
|
5
|
+
/**
|
|
6
|
+
* Search all messages of the requesting user.
|
|
7
|
+
* @returns Paginated response of Message objects
|
|
8
|
+
*/
|
|
9
|
+
searchMessages<R extends boolean = false>({ filters, sorting, limit, page }: SearchParams, raw?: {
|
|
10
|
+
raw: R;
|
|
11
|
+
}): Promise<MaybeRaw<R, PaginatedResponse<Message>>>;
|
|
12
|
+
/**
|
|
13
|
+
* Retrieves a single message by ID.
|
|
14
|
+
* @param messageId ID of the message
|
|
15
|
+
* @returns The requested Message object
|
|
16
|
+
*/
|
|
17
|
+
getMessage<R extends boolean = false>(messageId: string, raw?: {
|
|
18
|
+
raw: R;
|
|
19
|
+
}): Promise<MaybeRaw<R, Message>>;
|
|
20
|
+
/**
|
|
21
|
+
* Mark message as read or unread.
|
|
22
|
+
*
|
|
23
|
+
* @param messageId ID of the Message object
|
|
24
|
+
* @returns the updated Message object
|
|
25
|
+
*/
|
|
26
|
+
updateMessage<R extends boolean = false>(messageId: string, read: boolean, raw?: {
|
|
27
|
+
raw: R;
|
|
28
|
+
}): Promise<MaybeRaw<R, Message>>;
|
|
29
|
+
/**
|
|
30
|
+
* Deletes a message of the requesting User.
|
|
31
|
+
* @param messageId Id of the Message
|
|
32
|
+
*/
|
|
33
|
+
deleteMessage<R extends boolean = false>(messageId: string, raw?: {
|
|
34
|
+
raw: R;
|
|
35
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
36
|
+
/**
|
|
37
|
+
* Send message to single user or all users of organization or team.
|
|
38
|
+
*
|
|
39
|
+
* This is an internal endpoint.
|
|
40
|
+
*
|
|
41
|
+
* @param msg Message to send
|
|
42
|
+
* - to - should be email, orgName or teamName
|
|
43
|
+
* - recipient - enum type USER, ORGANIZATION or TEAM (by default is USER)
|
|
44
|
+
* - orgName - should be only specified if recipient===TEAM
|
|
45
|
+
* - title - title of the message (max 255 characters)
|
|
46
|
+
* - subject - subject of the message (max 255 characters)
|
|
47
|
+
* - message - content of the message (max 5000 characters)
|
|
48
|
+
* @returns the Message object
|
|
49
|
+
*/
|
|
50
|
+
sendMessage<R extends boolean = false>(msg: {
|
|
51
|
+
to: string;
|
|
52
|
+
recipient?: RecipientType;
|
|
53
|
+
orgName?: string;
|
|
54
|
+
title?: string;
|
|
55
|
+
subject?: string;
|
|
56
|
+
message: string;
|
|
57
|
+
}, raw?: {
|
|
58
|
+
raw: R;
|
|
59
|
+
}): Promise<MaybeRaw<R, Message>>;
|
|
60
|
+
protected getEndpoint(endpoint: string): string;
|
|
61
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
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.IdpMessage = void 0;
|
|
13
|
+
const Base_1 = require("../../../../Base");
|
|
14
|
+
const paginatedResponseHelper_1 = require("../../../../helper/paginatedResponseHelper");
|
|
15
|
+
const searchFilter_1 = require("../../../../helper/searchFilter");
|
|
16
|
+
class IdpMessage extends Base_1.default {
|
|
17
|
+
/**
|
|
18
|
+
* Search all messages of the requesting user.
|
|
19
|
+
* @returns Paginated response of Message objects
|
|
20
|
+
*/
|
|
21
|
+
searchMessages(_a, raw_1) {
|
|
22
|
+
return __awaiter(this, arguments, void 0, function* ({ filters, sorting, limit = 100, page = 0 }, raw) {
|
|
23
|
+
const filtersDTO = filters === null || filters === void 0 ? void 0 : filters.map((f) => {
|
|
24
|
+
return new searchFilter_1.SearchFilterDTO(f);
|
|
25
|
+
});
|
|
26
|
+
const resp = yield this.axios.post(this.getEndpoint(`/v1/messages/search`), {
|
|
27
|
+
filters: filtersDTO,
|
|
28
|
+
sorting,
|
|
29
|
+
}, {
|
|
30
|
+
params: { limit, page },
|
|
31
|
+
});
|
|
32
|
+
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));
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Retrieves a single message by ID.
|
|
37
|
+
* @param messageId ID of the message
|
|
38
|
+
* @returns The requested Message object
|
|
39
|
+
*/
|
|
40
|
+
getMessage(messageId, raw) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const resp = yield this.axios.get(this.getEndpoint(`/v1/messages/${messageId}`));
|
|
43
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Mark message as read or unread.
|
|
48
|
+
*
|
|
49
|
+
* @param messageId ID of the Message object
|
|
50
|
+
* @returns the updated Message object
|
|
51
|
+
*/
|
|
52
|
+
updateMessage(messageId, read, raw) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const resp = yield this.axios.patch(this.getEndpoint(`/v1/messages/${messageId}/read`), { read });
|
|
55
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Deletes a message of the requesting User.
|
|
60
|
+
* @param messageId Id of the Message
|
|
61
|
+
*/
|
|
62
|
+
deleteMessage(messageId, raw) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
const resp = yield this.axios.delete(this.getEndpoint(`/v1/messages/${messageId}`));
|
|
65
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : undefined);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Send message to single user or all users of organization or team.
|
|
70
|
+
*
|
|
71
|
+
* This is an internal endpoint.
|
|
72
|
+
*
|
|
73
|
+
* @param msg Message to send
|
|
74
|
+
* - to - should be email, orgName or teamName
|
|
75
|
+
* - recipient - enum type USER, ORGANIZATION or TEAM (by default is USER)
|
|
76
|
+
* - orgName - should be only specified if recipient===TEAM
|
|
77
|
+
* - title - title of the message (max 255 characters)
|
|
78
|
+
* - subject - subject of the message (max 255 characters)
|
|
79
|
+
* - message - content of the message (max 5000 characters)
|
|
80
|
+
* @returns the Message object
|
|
81
|
+
*/
|
|
82
|
+
sendMessage(msg, raw) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
const res = yield this.axios.post(this.getEndpoint(`/internal/v1/messages`), msg);
|
|
85
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
getEndpoint(endpoint) {
|
|
89
|
+
return `${this.options.server}/api/account${endpoint}`;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.IdpMessage = IdpMessage;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Base from "../../../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../Base";
|
|
2
2
|
import { User } from "../../../../interfaces/idp";
|
|
3
3
|
export default class UserPasswordService extends Base {
|
|
4
4
|
/**
|
|
@@ -9,7 +9,9 @@ export default class UserPasswordService extends Base {
|
|
|
9
9
|
* @param totpToken (Optional) TOTP token in case the user had 2FA enabled
|
|
10
10
|
* @returns User object
|
|
11
11
|
*/
|
|
12
|
-
resetPassword(email: string, nonce: string, newPassword: string, totpToken?: string
|
|
12
|
+
resetPassword<R extends boolean = false>(email: string, nonce: string, newPassword: string, totpToken?: string, raw?: {
|
|
13
|
+
raw: R;
|
|
14
|
+
}): Promise<MaybeRaw<R, User>>;
|
|
13
15
|
parseResetPasswordToken(token: string): {
|
|
14
16
|
email: string;
|
|
15
17
|
nonce: string;
|
|
@@ -19,7 +19,7 @@ class UserPasswordService extends Base_1.default {
|
|
|
19
19
|
* @param totpToken (Optional) TOTP token in case the user had 2FA enabled
|
|
20
20
|
* @returns User object
|
|
21
21
|
*/
|
|
22
|
-
resetPassword(email, nonce, newPassword, totpToken) {
|
|
22
|
+
resetPassword(email, nonce, newPassword, totpToken, raw) {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
24
|
const res = yield this.axios.post(this.getEndpoint("/v1/user/password/reset"), {
|
|
25
25
|
email,
|
|
@@ -27,7 +27,7 @@ class UserPasswordService extends Base_1.default {
|
|
|
27
27
|
newPassword,
|
|
28
28
|
totpToken,
|
|
29
29
|
});
|
|
30
|
-
return res.data;
|
|
30
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
parseResetPasswordToken(token) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Base from "../../../../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../../Base";
|
|
2
2
|
import { ConnectionSettings } from "../../../../../interfaces/idp/user/ConnectionSettings";
|
|
3
3
|
export declare class IdpConnections extends Base {
|
|
4
4
|
/**
|
|
@@ -8,6 +8,8 @@ export declare class IdpConnections extends Base {
|
|
|
8
8
|
*
|
|
9
9
|
* @returns connection settings for each organization
|
|
10
10
|
*/
|
|
11
|
-
get(
|
|
11
|
+
get<R extends boolean = false>(raw?: {
|
|
12
|
+
raw: R;
|
|
13
|
+
}): Promise<MaybeRaw<R, ConnectionSettings>>;
|
|
12
14
|
protected getEndpoint(): string;
|
|
13
15
|
}
|
|
@@ -19,10 +19,10 @@ class IdpConnections extends Base_1.default {
|
|
|
19
19
|
*
|
|
20
20
|
* @returns connection settings for each organization
|
|
21
21
|
*/
|
|
22
|
-
get() {
|
|
22
|
+
get(raw) {
|
|
23
23
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
24
|
const res = yield this.axios.get(this.getEndpoint());
|
|
25
|
-
return res.data;
|
|
25
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? res : res.data);
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
getEndpoint() {
|
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import Base from "../../../../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../../Base";
|
|
2
2
|
import { GeneralSettings, GeneralSettingsLastVisitPatch, GeneralSettingsPatch } from "../../../../../interfaces/idp/user/GeneralSettings";
|
|
3
3
|
export declare class IdpGeneral extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* Retrieves the current active user settings.
|
|
6
6
|
* @returns the current active user settings
|
|
7
7
|
*/
|
|
8
|
-
getGeneralSettings(
|
|
8
|
+
getGeneralSettings<R extends boolean = false>(raw?: {
|
|
9
|
+
raw: R;
|
|
10
|
+
}): Promise<MaybeRaw<R, GeneralSettings>>;
|
|
9
11
|
/**
|
|
10
12
|
* Changes the user settings.
|
|
11
13
|
* @param generalSettingsPatch Object containing the new user settings
|
|
12
14
|
* @returns the updated user settings
|
|
13
15
|
*/
|
|
14
|
-
patchGeneralSettings(generalSettingsPatch: GeneralSettingsPatch
|
|
16
|
+
patchGeneralSettings<R extends boolean = false>(generalSettingsPatch: GeneralSettingsPatch, raw?: {
|
|
17
|
+
raw: R;
|
|
18
|
+
}): Promise<MaybeRaw<R, GeneralSettings>>;
|
|
15
19
|
/**
|
|
16
20
|
* Changes the user last visit settings.
|
|
17
21
|
* @param generalSettingsLastVisitPatch Object containing the new user settings in case of lastView and lastURL
|
|
18
22
|
* @returns the updated user settings
|
|
19
23
|
*/
|
|
20
|
-
patchGeneralSettingsLastVisit(generalSettingsLastVisitPatch: GeneralSettingsLastVisitPatch
|
|
24
|
+
patchGeneralSettingsLastVisit<R extends boolean = false>(generalSettingsLastVisitPatch: GeneralSettingsLastVisitPatch, raw?: {
|
|
25
|
+
raw: R;
|
|
26
|
+
}): Promise<MaybeRaw<R, GeneralSettings>>;
|
|
21
27
|
protected getEndpoint(endpoint: string): string;
|
|
22
28
|
}
|
|
@@ -16,10 +16,10 @@ class IdpGeneral extends Base_1.default {
|
|
|
16
16
|
* Retrieves the current active user settings.
|
|
17
17
|
* @returns the current active user settings
|
|
18
18
|
*/
|
|
19
|
-
getGeneralSettings() {
|
|
19
|
+
getGeneralSettings(raw) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
21
|
const resp = yield this.axios.get(this.getEndpoint(`/v1/user/settings/general`));
|
|
22
|
-
return resp.data;
|
|
22
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -27,10 +27,10 @@ class IdpGeneral extends Base_1.default {
|
|
|
27
27
|
* @param generalSettingsPatch Object containing the new user settings
|
|
28
28
|
* @returns the updated user settings
|
|
29
29
|
*/
|
|
30
|
-
patchGeneralSettings(generalSettingsPatch) {
|
|
30
|
+
patchGeneralSettings(generalSettingsPatch, raw) {
|
|
31
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
32
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/general`), generalSettingsPatch);
|
|
33
|
-
return resp.data;
|
|
33
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
@@ -38,10 +38,10 @@ class IdpGeneral extends Base_1.default {
|
|
|
38
38
|
* @param generalSettingsLastVisitPatch Object containing the new user settings in case of lastView and lastURL
|
|
39
39
|
* @returns the updated user settings
|
|
40
40
|
*/
|
|
41
|
-
patchGeneralSettingsLastVisit(generalSettingsLastVisitPatch) {
|
|
41
|
+
patchGeneralSettingsLastVisit(generalSettingsLastVisitPatch, raw) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/general/lastVisit`), generalSettingsLastVisitPatch);
|
|
44
|
-
return resp.data;
|
|
44
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
getEndpoint(endpoint) {
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import Base from "../../../../../Base";
|
|
1
|
+
import Base, { MaybeRaw } from "../../../../../Base";
|
|
2
2
|
import { NotificationSettings, NotificationSettingsPatch } from "../../../../../interfaces/idp/user/NotificationSettings";
|
|
3
3
|
export declare class IdpNotifications extends Base {
|
|
4
4
|
/**
|
|
5
5
|
* Retrieves the notification settings of the requesting user.
|
|
6
6
|
* @returns general settings of requesting user
|
|
7
7
|
*/
|
|
8
|
-
getNotificationSettingsOfUser(
|
|
8
|
+
getNotificationSettingsOfUser<R extends boolean = false>(raw?: {
|
|
9
|
+
raw: R;
|
|
10
|
+
}): Promise<MaybeRaw<R, NotificationSettings>>;
|
|
9
11
|
/**
|
|
10
12
|
* Updates the notification settings of the requesting user.
|
|
11
13
|
* @param notificationSettingsPatch Object containing the new notification settings
|
|
12
14
|
* @returns the updated notification settings
|
|
13
15
|
*/
|
|
14
|
-
patchNotificationSettings(notificationSettingsPatch: NotificationSettingsPatch
|
|
16
|
+
patchNotificationSettings<R extends boolean = false>(notificationSettingsPatch: NotificationSettingsPatch, raw?: {
|
|
17
|
+
raw: R;
|
|
18
|
+
}): Promise<MaybeRaw<R, NotificationSettings>>;
|
|
15
19
|
protected getEndpoint(endpoint: string): string;
|
|
16
20
|
}
|
|
@@ -16,10 +16,10 @@ class IdpNotifications extends Base_1.default {
|
|
|
16
16
|
* Retrieves the notification settings of the requesting user.
|
|
17
17
|
* @returns general settings of requesting user
|
|
18
18
|
*/
|
|
19
|
-
getNotificationSettingsOfUser() {
|
|
19
|
+
getNotificationSettingsOfUser(raw) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
21
|
const resp = yield this.axios.get(this.getEndpoint(`/v1/user/settings/notifications`));
|
|
22
|
-
return resp.data;
|
|
22
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
@@ -27,10 +27,10 @@ class IdpNotifications extends Base_1.default {
|
|
|
27
27
|
* @param notificationSettingsPatch Object containing the new notification settings
|
|
28
28
|
* @returns the updated notification settings
|
|
29
29
|
*/
|
|
30
|
-
patchNotificationSettings(notificationSettingsPatch) {
|
|
30
|
+
patchNotificationSettings(notificationSettingsPatch, raw) {
|
|
31
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
32
|
const resp = yield this.axios.patch(this.getEndpoint(`/v1/user/settings/notifications`), notificationSettingsPatch);
|
|
33
|
-
return resp.data;
|
|
33
|
+
return ((raw === null || raw === void 0 ? void 0 : raw.raw) ? resp : resp.data);
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
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 { OAuthAppWithConsent } from "../../../../../interfaces/idp/organization/settings/oauthApp";
|
|
4
4
|
export declare class IdpOAuthApps extends Base {
|
|
@@ -10,11 +10,15 @@ export declare class IdpOAuthApps extends Base {
|
|
|
10
10
|
* @param page (optional) Page number: Skip the first (page * limit) results (defaults to 0)
|
|
11
11
|
* @returns Object containing an array of OAuth apps and the total number of results found in the database (independent of limit and page)
|
|
12
12
|
*/
|
|
13
|
-
searchOAuthApps({ filters, sorting, limit, page }: SearchParams
|
|
13
|
+
searchOAuthApps<R extends boolean = false>({ filters, sorting, limit, page }: SearchParams, raw?: {
|
|
14
|
+
raw: R;
|
|
15
|
+
}): Promise<MaybeRaw<R, PaginatedResponse<OAuthAppWithConsent>>>;
|
|
14
16
|
/**
|
|
15
17
|
* Revokes user access from the provided OAuth app.
|
|
16
18
|
* @param oAuthAppId ID of the OAuth app
|
|
17
19
|
*/
|
|
18
|
-
revokeOAuthAppAccess(oAuthAppId: string
|
|
20
|
+
revokeOAuthAppAccess<R extends boolean = false>(oAuthAppId: string, raw?: {
|
|
21
|
+
raw: R;
|
|
22
|
+
}): Promise<MaybeRaw<R, void>>;
|
|
19
23
|
protected getEndpoint(endpoint: string): string;
|
|
20
24
|
}
|