@sfxcode/nuxt-mongocamp-server 1.0.3 → 1.0.5
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/dist/module.cjs +5 -0
- package/dist/module.d.ts +9 -0
- package/dist/module.json +8 -0
- package/dist/module.mjs +555 -0
- package/dist/runtime/api/apis/AdminApi.d.ts +181 -0
- package/dist/runtime/api/apis/AdminApi.mjs +509 -0
- package/dist/runtime/api/apis/ApplicationApi.d.ts +65 -0
- package/dist/runtime/api/apis/ApplicationApi.mjs +164 -0
- package/dist/runtime/api/apis/AuthApi.d.ts +104 -0
- package/dist/runtime/api/apis/AuthApi.mjs +296 -0
- package/dist/runtime/api/apis/BucketApi.d.ts +67 -0
- package/dist/runtime/api/apis/BucketApi.mjs +160 -0
- package/dist/runtime/api/apis/CollectionApi.d.ts +161 -0
- package/dist/runtime/api/apis/CollectionApi.mjs +435 -0
- package/dist/runtime/api/apis/DatabaseApi.d.ts +77 -0
- package/dist/runtime/api/apis/DatabaseApi.mjs +196 -0
- package/dist/runtime/api/apis/DocumentApi.d.ts +188 -0
- package/dist/runtime/api/apis/DocumentApi.mjs +465 -0
- package/dist/runtime/api/apis/FileApi.d.ts +125 -0
- package/dist/runtime/api/apis/FileApi.mjs +355 -0
- package/dist/runtime/api/apis/IndexApi.d.ts +137 -0
- package/dist/runtime/api/apis/IndexApi.mjs +367 -0
- package/dist/runtime/api/apis/InformationApi.d.ts +28 -0
- package/dist/runtime/api/apis/InformationApi.mjs +29 -0
- package/dist/runtime/api/apis/JobsApi.d.ts +94 -0
- package/dist/runtime/api/apis/JobsApi.mjs +252 -0
- package/dist/runtime/api/apis/index.d.ts +11 -0
- package/dist/runtime/api/apis/index.mjs +11 -0
- package/dist/runtime/api/index.d.ts +3 -0
- package/dist/runtime/api/index.mjs +3 -0
- package/dist/runtime/api/models/BucketInformation.d.ts +49 -0
- package/dist/runtime/api/models/BucketInformation.mjs +36 -0
- package/dist/runtime/api/models/CollectionStatus.d.ts +107 -0
- package/dist/runtime/api/models/CollectionStatus.mjs +63 -0
- package/dist/runtime/api/models/DatabaseInfo.d.ts +57 -0
- package/dist/runtime/api/models/DatabaseInfo.mjs +39 -0
- package/dist/runtime/api/models/DeleteResponse.d.ts +37 -0
- package/dist/runtime/api/models/DeleteResponse.mjs +30 -0
- package/dist/runtime/api/models/ErrorDescription.d.ts +43 -0
- package/dist/runtime/api/models/ErrorDescription.mjs +33 -0
- package/dist/runtime/api/models/FileInformation.d.ts +63 -0
- package/dist/runtime/api/models/FileInformation.mjs +42 -0
- package/dist/runtime/api/models/Grant.d.ts +55 -0
- package/dist/runtime/api/models/Grant.mjs +39 -0
- package/dist/runtime/api/models/IndexCreateRequest.d.ts +40 -0
- package/dist/runtime/api/models/IndexCreateRequest.mjs +34 -0
- package/dist/runtime/api/models/IndexCreateResponse.d.ts +31 -0
- package/dist/runtime/api/models/IndexCreateResponse.mjs +27 -0
- package/dist/runtime/api/models/IndexDropResponse.d.ts +31 -0
- package/dist/runtime/api/models/IndexDropResponse.mjs +27 -0
- package/dist/runtime/api/models/IndexOptionsRequest.d.ts +73 -0
- package/dist/runtime/api/models/IndexOptionsRequest.mjs +41 -0
- package/dist/runtime/api/models/InsertResponse.d.ts +37 -0
- package/dist/runtime/api/models/InsertResponse.mjs +30 -0
- package/dist/runtime/api/models/JobConfig.d.ts +61 -0
- package/dist/runtime/api/models/JobConfig.mjs +42 -0
- package/dist/runtime/api/models/JobInformation.d.ts +79 -0
- package/dist/runtime/api/models/JobInformation.mjs +49 -0
- package/dist/runtime/api/models/JsonResultBoolean.d.ts +27 -0
- package/dist/runtime/api/models/JsonResultBoolean.mjs +22 -0
- package/dist/runtime/api/models/JsonResultString.d.ts +27 -0
- package/dist/runtime/api/models/JsonResultString.mjs +22 -0
- package/dist/runtime/api/models/JsonSchema.d.ts +46 -0
- package/dist/runtime/api/models/JsonSchema.mjs +38 -0
- package/dist/runtime/api/models/JsonSchemaDefinition.d.ts +59 -0
- package/dist/runtime/api/models/JsonSchemaDefinition.mjs +39 -0
- package/dist/runtime/api/models/JsonValueAny.d.ts +31 -0
- package/dist/runtime/api/models/JsonValueAny.mjs +27 -0
- package/dist/runtime/api/models/JsonValueBoolean.d.ts +31 -0
- package/dist/runtime/api/models/JsonValueBoolean.mjs +27 -0
- package/dist/runtime/api/models/JsonValueString.d.ts +31 -0
- package/dist/runtime/api/models/JsonValueString.mjs +27 -0
- package/dist/runtime/api/models/Login.d.ts +37 -0
- package/dist/runtime/api/models/Login.mjs +30 -0
- package/dist/runtime/api/models/LoginResult.d.ts +44 -0
- package/dist/runtime/api/models/LoginResult.mjs +37 -0
- package/dist/runtime/api/models/Measurement.d.ts +33 -0
- package/dist/runtime/api/models/Measurement.mjs +24 -0
- package/dist/runtime/api/models/Metric.d.ts +52 -0
- package/dist/runtime/api/models/Metric.mjs +35 -0
- package/dist/runtime/api/models/MongoAggregateRequest.d.ts +38 -0
- package/dist/runtime/api/models/MongoAggregateRequest.mjs +34 -0
- package/dist/runtime/api/models/MongoCampConfiguration.d.ts +55 -0
- package/dist/runtime/api/models/MongoCampConfiguration.mjs +39 -0
- package/dist/runtime/api/models/MongoFindRequest.d.ts +49 -0
- package/dist/runtime/api/models/MongoFindRequest.mjs +33 -0
- package/dist/runtime/api/models/MongoIndex.d.ts +103 -0
- package/dist/runtime/api/models/MongoIndex.mjs +60 -0
- package/dist/runtime/api/models/PasswordUpdateRequest.d.ts +31 -0
- package/dist/runtime/api/models/PasswordUpdateRequest.mjs +27 -0
- package/dist/runtime/api/models/PipelineStage.d.ts +37 -0
- package/dist/runtime/api/models/PipelineStage.mjs +30 -0
- package/dist/runtime/api/models/Role.d.ts +44 -0
- package/dist/runtime/api/models/Role.mjs +37 -0
- package/dist/runtime/api/models/SchemaAnalysis.d.ts +50 -0
- package/dist/runtime/api/models/SchemaAnalysis.mjs +40 -0
- package/dist/runtime/api/models/SchemaAnalysisField.d.ts +62 -0
- package/dist/runtime/api/models/SchemaAnalysisField.mjs +45 -0
- package/dist/runtime/api/models/SchemaAnalysisFieldType.d.ts +43 -0
- package/dist/runtime/api/models/SchemaAnalysisFieldType.mjs +33 -0
- package/dist/runtime/api/models/SettingsResponse.d.ts +51 -0
- package/dist/runtime/api/models/SettingsResponse.mjs +34 -0
- package/dist/runtime/api/models/UpdateFileInformationRequest.d.ts +39 -0
- package/dist/runtime/api/models/UpdateFileInformationRequest.mjs +29 -0
- package/dist/runtime/api/models/UpdateRequest.d.ts +41 -0
- package/dist/runtime/api/models/UpdateRequest.mjs +30 -0
- package/dist/runtime/api/models/UpdateResponse.d.ts +49 -0
- package/dist/runtime/api/models/UpdateResponse.mjs +36 -0
- package/dist/runtime/api/models/UpdateRoleRequest.d.ts +38 -0
- package/dist/runtime/api/models/UpdateRoleRequest.mjs +34 -0
- package/dist/runtime/api/models/UserInformation.d.ts +49 -0
- package/dist/runtime/api/models/UserInformation.mjs +35 -0
- package/dist/runtime/api/models/UserProfile.d.ts +56 -0
- package/dist/runtime/api/models/UserProfile.mjs +41 -0
- package/dist/runtime/api/models/Version.d.ts +43 -0
- package/dist/runtime/api/models/Version.mjs +33 -0
- package/dist/runtime/api/models/index.d.ts +39 -0
- package/dist/runtime/api/models/index.mjs +39 -0
- package/dist/runtime/api/runtime.d.ts +182 -0
- package/dist/runtime/api/runtime.mjs +281 -0
- package/dist/runtime/composables/mongocampApi.d.ts +14 -0
- package/dist/runtime/composables/mongocampApi.mjs +45 -0
- package/dist/runtime/composables/mongocampAuth.d.ts +8 -0
- package/dist/runtime/composables/mongocampAuth.mjs +28 -0
- package/dist/runtime/composables/mongocampSearch.d.ts +11 -0
- package/dist/runtime/composables/mongocampSearch.mjs +20 -0
- package/dist/runtime/composables/mongocampStorage.d.ts +0 -0
- package/dist/runtime/composables/mongocampStorage.mjs +5 -0
- package/dist/runtime/composables/mongocampUrl.d.ts +1 -0
- package/dist/runtime/composables/mongocampUrl.mjs +5 -0
- package/dist/runtime/composables/mongocampUser.d.ts +3 -0
- package/dist/runtime/composables/mongocampUser.mjs +4 -0
- package/dist/types.d.ts +15 -0
- package/package.json +5 -4
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mongocamp-server
|
|
3
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.4.2
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { JsonValueBoolean, JsonValueString, PasswordUpdateRequest, Role, UpdateRoleRequest, UserInformation, UserProfile } from '../models';
|
|
14
|
+
export interface AddRoleRequest {
|
|
15
|
+
role: Role;
|
|
16
|
+
}
|
|
17
|
+
export interface AddUserRequest {
|
|
18
|
+
userInformation: UserInformation;
|
|
19
|
+
}
|
|
20
|
+
export interface DeleteRoleRequest {
|
|
21
|
+
roleName: string;
|
|
22
|
+
}
|
|
23
|
+
export interface DeleteUserRequest {
|
|
24
|
+
userId: string;
|
|
25
|
+
}
|
|
26
|
+
export interface GetRoleRequest {
|
|
27
|
+
roleName: string;
|
|
28
|
+
}
|
|
29
|
+
export interface GetUserRequest {
|
|
30
|
+
userId: string;
|
|
31
|
+
}
|
|
32
|
+
export interface GnerateNewApiKeyForUserRequest {
|
|
33
|
+
userId: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ListRolesRequest {
|
|
36
|
+
filter?: string;
|
|
37
|
+
rowsPerPage?: number;
|
|
38
|
+
page?: number;
|
|
39
|
+
}
|
|
40
|
+
export interface ListUsersRequest {
|
|
41
|
+
filter?: string;
|
|
42
|
+
rowsPerPage?: number;
|
|
43
|
+
page?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface UpdatePasswordForUserRequest {
|
|
46
|
+
userId: string;
|
|
47
|
+
passwordUpdateRequest: PasswordUpdateRequest;
|
|
48
|
+
}
|
|
49
|
+
export interface UpdateRoleOperationRequest {
|
|
50
|
+
roleName: string;
|
|
51
|
+
updateRoleRequest: UpdateRoleRequest;
|
|
52
|
+
}
|
|
53
|
+
export interface UpdateRolesForUserRequest {
|
|
54
|
+
userId: string;
|
|
55
|
+
requestBody?: Array<string>;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
export declare class AdminApi extends runtime.BaseAPI {
|
|
61
|
+
/**
|
|
62
|
+
* Add a new Role
|
|
63
|
+
* Add Role
|
|
64
|
+
*/
|
|
65
|
+
addRoleRaw(requestParameters: AddRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Role>>;
|
|
66
|
+
/**
|
|
67
|
+
* Add a new Role
|
|
68
|
+
* Add Role
|
|
69
|
+
*/
|
|
70
|
+
addRole(requestParameters: AddRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Role>;
|
|
71
|
+
/**
|
|
72
|
+
* Add a new User
|
|
73
|
+
* Add User
|
|
74
|
+
*/
|
|
75
|
+
addUserRaw(requestParameters: AddUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserProfile>>;
|
|
76
|
+
/**
|
|
77
|
+
* Add a new User
|
|
78
|
+
* Add User
|
|
79
|
+
*/
|
|
80
|
+
addUser(requestParameters: AddUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserProfile>;
|
|
81
|
+
/**
|
|
82
|
+
* Delete Role
|
|
83
|
+
* Delete Role
|
|
84
|
+
*/
|
|
85
|
+
deleteRoleRaw(requestParameters: DeleteRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JsonValueBoolean>>;
|
|
86
|
+
/**
|
|
87
|
+
* Delete Role
|
|
88
|
+
* Delete Role
|
|
89
|
+
*/
|
|
90
|
+
deleteRole(requestParameters: DeleteRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JsonValueBoolean>;
|
|
91
|
+
/**
|
|
92
|
+
* Delete User
|
|
93
|
+
* Delete User
|
|
94
|
+
*/
|
|
95
|
+
deleteUserRaw(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JsonValueBoolean>>;
|
|
96
|
+
/**
|
|
97
|
+
* Delete User
|
|
98
|
+
* Delete User
|
|
99
|
+
*/
|
|
100
|
+
deleteUser(requestParameters: DeleteUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JsonValueBoolean>;
|
|
101
|
+
/**
|
|
102
|
+
* Get Role by RoleKey
|
|
103
|
+
* Get Role
|
|
104
|
+
*/
|
|
105
|
+
getRoleRaw(requestParameters: GetRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Role>>;
|
|
106
|
+
/**
|
|
107
|
+
* Get Role by RoleKey
|
|
108
|
+
* Get Role
|
|
109
|
+
*/
|
|
110
|
+
getRole(requestParameters: GetRoleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Role>;
|
|
111
|
+
/**
|
|
112
|
+
* Get UserProfile for user
|
|
113
|
+
* UserProfile for userId
|
|
114
|
+
*/
|
|
115
|
+
getUserRaw(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserProfile>>;
|
|
116
|
+
/**
|
|
117
|
+
* Get UserProfile for user
|
|
118
|
+
* UserProfile for userId
|
|
119
|
+
*/
|
|
120
|
+
getUser(requestParameters: GetUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserProfile>;
|
|
121
|
+
/**
|
|
122
|
+
* Generate an new APIkey for the user
|
|
123
|
+
* Update ApiKey
|
|
124
|
+
*/
|
|
125
|
+
gnerateNewApiKeyForUserRaw(requestParameters: GnerateNewApiKeyForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JsonValueString>>;
|
|
126
|
+
/**
|
|
127
|
+
* Generate an new APIkey for the user
|
|
128
|
+
* Update ApiKey
|
|
129
|
+
*/
|
|
130
|
+
gnerateNewApiKeyForUser(requestParameters: GnerateNewApiKeyForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JsonValueString>;
|
|
131
|
+
/**
|
|
132
|
+
* List all Roles or filtered
|
|
133
|
+
* List Roles
|
|
134
|
+
*/
|
|
135
|
+
listRolesRaw(requestParameters: ListRolesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Role>>>;
|
|
136
|
+
/**
|
|
137
|
+
* List all Roles or filtered
|
|
138
|
+
* List Roles
|
|
139
|
+
*/
|
|
140
|
+
listRoles(requestParameters?: ListRolesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Role>>;
|
|
141
|
+
/**
|
|
142
|
+
* List all Users or filtered
|
|
143
|
+
* List Users
|
|
144
|
+
*/
|
|
145
|
+
listUsersRaw(requestParameters: ListUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<UserProfile>>>;
|
|
146
|
+
/**
|
|
147
|
+
* List all Users or filtered
|
|
148
|
+
* List Users
|
|
149
|
+
*/
|
|
150
|
+
listUsers(requestParameters?: ListUsersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<UserProfile>>;
|
|
151
|
+
/**
|
|
152
|
+
* Change Password of User
|
|
153
|
+
* Update Password
|
|
154
|
+
*/
|
|
155
|
+
updatePasswordForUserRaw(requestParameters: UpdatePasswordForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<JsonValueBoolean>>;
|
|
156
|
+
/**
|
|
157
|
+
* Change Password of User
|
|
158
|
+
* Update Password
|
|
159
|
+
*/
|
|
160
|
+
updatePasswordForUser(requestParameters: UpdatePasswordForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<JsonValueBoolean>;
|
|
161
|
+
/**
|
|
162
|
+
* Update Role
|
|
163
|
+
* Update Role
|
|
164
|
+
*/
|
|
165
|
+
updateRoleRaw(requestParameters: UpdateRoleOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Role>>;
|
|
166
|
+
/**
|
|
167
|
+
* Update Role
|
|
168
|
+
* Update Role
|
|
169
|
+
*/
|
|
170
|
+
updateRole(requestParameters: UpdateRoleOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Role>;
|
|
171
|
+
/**
|
|
172
|
+
* Update Roles of User
|
|
173
|
+
* Update User Roles
|
|
174
|
+
*/
|
|
175
|
+
updateRolesForUserRaw(requestParameters: UpdateRolesForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UserProfile>>;
|
|
176
|
+
/**
|
|
177
|
+
* Update Roles of User
|
|
178
|
+
* Update User Roles
|
|
179
|
+
*/
|
|
180
|
+
updateRolesForUser(requestParameters: UpdateRolesForUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UserProfile>;
|
|
181
|
+
}
|
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
import * as runtime from "../runtime.mjs";
|
|
2
|
+
import {
|
|
3
|
+
JsonValueBooleanFromJSON,
|
|
4
|
+
JsonValueStringFromJSON,
|
|
5
|
+
PasswordUpdateRequestToJSON,
|
|
6
|
+
RoleFromJSON,
|
|
7
|
+
RoleToJSON,
|
|
8
|
+
UpdateRoleRequestToJSON,
|
|
9
|
+
UserInformationToJSON,
|
|
10
|
+
UserProfileFromJSON
|
|
11
|
+
} from "../models/index.mjs";
|
|
12
|
+
export class AdminApi extends runtime.BaseAPI {
|
|
13
|
+
/**
|
|
14
|
+
* Add a new Role
|
|
15
|
+
* Add Role
|
|
16
|
+
*/
|
|
17
|
+
async addRoleRaw(requestParameters, initOverrides) {
|
|
18
|
+
if (requestParameters.role === null || requestParameters.role === void 0) {
|
|
19
|
+
throw new runtime.RequiredError("role", "Required parameter requestParameters.role was null or undefined when calling addRole.");
|
|
20
|
+
}
|
|
21
|
+
const queryParameters = {};
|
|
22
|
+
const headerParameters = {};
|
|
23
|
+
headerParameters["Content-Type"] = "application/json";
|
|
24
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
25
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
26
|
+
}
|
|
27
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
28
|
+
const token = this.configuration.accessToken;
|
|
29
|
+
const tokenString = await token("httpAuth", []);
|
|
30
|
+
if (tokenString) {
|
|
31
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
35
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
36
|
+
}
|
|
37
|
+
const response = await this.request({
|
|
38
|
+
path: `/admin/roles`,
|
|
39
|
+
method: "PUT",
|
|
40
|
+
headers: headerParameters,
|
|
41
|
+
query: queryParameters,
|
|
42
|
+
body: RoleToJSON(requestParameters.role)
|
|
43
|
+
}, initOverrides);
|
|
44
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RoleFromJSON(jsonValue));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Add a new Role
|
|
48
|
+
* Add Role
|
|
49
|
+
*/
|
|
50
|
+
async addRole(requestParameters, initOverrides) {
|
|
51
|
+
const response = await this.addRoleRaw(requestParameters, initOverrides);
|
|
52
|
+
return await response.value();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Add a new User
|
|
56
|
+
* Add User
|
|
57
|
+
*/
|
|
58
|
+
async addUserRaw(requestParameters, initOverrides) {
|
|
59
|
+
if (requestParameters.userInformation === null || requestParameters.userInformation === void 0) {
|
|
60
|
+
throw new runtime.RequiredError("userInformation", "Required parameter requestParameters.userInformation was null or undefined when calling addUser.");
|
|
61
|
+
}
|
|
62
|
+
const queryParameters = {};
|
|
63
|
+
const headerParameters = {};
|
|
64
|
+
headerParameters["Content-Type"] = "application/json";
|
|
65
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
66
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
67
|
+
}
|
|
68
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
69
|
+
const token = this.configuration.accessToken;
|
|
70
|
+
const tokenString = await token("httpAuth", []);
|
|
71
|
+
if (tokenString) {
|
|
72
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
76
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
77
|
+
}
|
|
78
|
+
const response = await this.request({
|
|
79
|
+
path: `/admin/users`,
|
|
80
|
+
method: "PUT",
|
|
81
|
+
headers: headerParameters,
|
|
82
|
+
query: queryParameters,
|
|
83
|
+
body: UserInformationToJSON(requestParameters.userInformation)
|
|
84
|
+
}, initOverrides);
|
|
85
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UserProfileFromJSON(jsonValue));
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Add a new User
|
|
89
|
+
* Add User
|
|
90
|
+
*/
|
|
91
|
+
async addUser(requestParameters, initOverrides) {
|
|
92
|
+
const response = await this.addUserRaw(requestParameters, initOverrides);
|
|
93
|
+
return await response.value();
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Delete Role
|
|
97
|
+
* Delete Role
|
|
98
|
+
*/
|
|
99
|
+
async deleteRoleRaw(requestParameters, initOverrides) {
|
|
100
|
+
if (requestParameters.roleName === null || requestParameters.roleName === void 0) {
|
|
101
|
+
throw new runtime.RequiredError("roleName", "Required parameter requestParameters.roleName was null or undefined when calling deleteRole.");
|
|
102
|
+
}
|
|
103
|
+
const queryParameters = {};
|
|
104
|
+
const headerParameters = {};
|
|
105
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
106
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
107
|
+
}
|
|
108
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
109
|
+
const token = this.configuration.accessToken;
|
|
110
|
+
const tokenString = await token("httpAuth", []);
|
|
111
|
+
if (tokenString) {
|
|
112
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
116
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
117
|
+
}
|
|
118
|
+
const response = await this.request({
|
|
119
|
+
path: `/admin/roles/{roleName}`.replace(`{${"roleName"}}`, encodeURIComponent(String(requestParameters.roleName))),
|
|
120
|
+
method: "DELETE",
|
|
121
|
+
headers: headerParameters,
|
|
122
|
+
query: queryParameters
|
|
123
|
+
}, initOverrides);
|
|
124
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JsonValueBooleanFromJSON(jsonValue));
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Delete Role
|
|
128
|
+
* Delete Role
|
|
129
|
+
*/
|
|
130
|
+
async deleteRole(requestParameters, initOverrides) {
|
|
131
|
+
const response = await this.deleteRoleRaw(requestParameters, initOverrides);
|
|
132
|
+
return await response.value();
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Delete User
|
|
136
|
+
* Delete User
|
|
137
|
+
*/
|
|
138
|
+
async deleteUserRaw(requestParameters, initOverrides) {
|
|
139
|
+
if (requestParameters.userId === null || requestParameters.userId === void 0) {
|
|
140
|
+
throw new runtime.RequiredError("userId", "Required parameter requestParameters.userId was null or undefined when calling deleteUser.");
|
|
141
|
+
}
|
|
142
|
+
const queryParameters = {};
|
|
143
|
+
const headerParameters = {};
|
|
144
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
145
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
146
|
+
}
|
|
147
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
148
|
+
const token = this.configuration.accessToken;
|
|
149
|
+
const tokenString = await token("httpAuth", []);
|
|
150
|
+
if (tokenString) {
|
|
151
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
155
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
156
|
+
}
|
|
157
|
+
const response = await this.request({
|
|
158
|
+
path: `/admin/users/{userId}`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
|
|
159
|
+
method: "DELETE",
|
|
160
|
+
headers: headerParameters,
|
|
161
|
+
query: queryParameters
|
|
162
|
+
}, initOverrides);
|
|
163
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JsonValueBooleanFromJSON(jsonValue));
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Delete User
|
|
167
|
+
* Delete User
|
|
168
|
+
*/
|
|
169
|
+
async deleteUser(requestParameters, initOverrides) {
|
|
170
|
+
const response = await this.deleteUserRaw(requestParameters, initOverrides);
|
|
171
|
+
return await response.value();
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Get Role by RoleKey
|
|
175
|
+
* Get Role
|
|
176
|
+
*/
|
|
177
|
+
async getRoleRaw(requestParameters, initOverrides) {
|
|
178
|
+
if (requestParameters.roleName === null || requestParameters.roleName === void 0) {
|
|
179
|
+
throw new runtime.RequiredError("roleName", "Required parameter requestParameters.roleName was null or undefined when calling getRole.");
|
|
180
|
+
}
|
|
181
|
+
const queryParameters = {};
|
|
182
|
+
const headerParameters = {};
|
|
183
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
184
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
185
|
+
}
|
|
186
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
187
|
+
const token = this.configuration.accessToken;
|
|
188
|
+
const tokenString = await token("httpAuth", []);
|
|
189
|
+
if (tokenString) {
|
|
190
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
194
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
195
|
+
}
|
|
196
|
+
const response = await this.request({
|
|
197
|
+
path: `/admin/roles/{roleName}`.replace(`{${"roleName"}}`, encodeURIComponent(String(requestParameters.roleName))),
|
|
198
|
+
method: "GET",
|
|
199
|
+
headers: headerParameters,
|
|
200
|
+
query: queryParameters
|
|
201
|
+
}, initOverrides);
|
|
202
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RoleFromJSON(jsonValue));
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Get Role by RoleKey
|
|
206
|
+
* Get Role
|
|
207
|
+
*/
|
|
208
|
+
async getRole(requestParameters, initOverrides) {
|
|
209
|
+
const response = await this.getRoleRaw(requestParameters, initOverrides);
|
|
210
|
+
return await response.value();
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Get UserProfile for user
|
|
214
|
+
* UserProfile for userId
|
|
215
|
+
*/
|
|
216
|
+
async getUserRaw(requestParameters, initOverrides) {
|
|
217
|
+
if (requestParameters.userId === null || requestParameters.userId === void 0) {
|
|
218
|
+
throw new runtime.RequiredError("userId", "Required parameter requestParameters.userId was null or undefined when calling getUser.");
|
|
219
|
+
}
|
|
220
|
+
const queryParameters = {};
|
|
221
|
+
const headerParameters = {};
|
|
222
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
223
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
224
|
+
}
|
|
225
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
226
|
+
const token = this.configuration.accessToken;
|
|
227
|
+
const tokenString = await token("httpAuth", []);
|
|
228
|
+
if (tokenString) {
|
|
229
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
233
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
234
|
+
}
|
|
235
|
+
const response = await this.request({
|
|
236
|
+
path: `/admin/users/{userId}`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
|
|
237
|
+
method: "GET",
|
|
238
|
+
headers: headerParameters,
|
|
239
|
+
query: queryParameters
|
|
240
|
+
}, initOverrides);
|
|
241
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UserProfileFromJSON(jsonValue));
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Get UserProfile for user
|
|
245
|
+
* UserProfile for userId
|
|
246
|
+
*/
|
|
247
|
+
async getUser(requestParameters, initOverrides) {
|
|
248
|
+
const response = await this.getUserRaw(requestParameters, initOverrides);
|
|
249
|
+
return await response.value();
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Generate an new APIkey for the user
|
|
253
|
+
* Update ApiKey
|
|
254
|
+
*/
|
|
255
|
+
async gnerateNewApiKeyForUserRaw(requestParameters, initOverrides) {
|
|
256
|
+
if (requestParameters.userId === null || requestParameters.userId === void 0) {
|
|
257
|
+
throw new runtime.RequiredError("userId", "Required parameter requestParameters.userId was null or undefined when calling gnerateNewApiKeyForUser.");
|
|
258
|
+
}
|
|
259
|
+
const queryParameters = {};
|
|
260
|
+
const headerParameters = {};
|
|
261
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
262
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
263
|
+
}
|
|
264
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
265
|
+
const token = this.configuration.accessToken;
|
|
266
|
+
const tokenString = await token("httpAuth", []);
|
|
267
|
+
if (tokenString) {
|
|
268
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
272
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
273
|
+
}
|
|
274
|
+
const response = await this.request({
|
|
275
|
+
path: `/admin/users/{userId}/apikey`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
|
|
276
|
+
method: "PATCH",
|
|
277
|
+
headers: headerParameters,
|
|
278
|
+
query: queryParameters
|
|
279
|
+
}, initOverrides);
|
|
280
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JsonValueStringFromJSON(jsonValue));
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Generate an new APIkey for the user
|
|
284
|
+
* Update ApiKey
|
|
285
|
+
*/
|
|
286
|
+
async gnerateNewApiKeyForUser(requestParameters, initOverrides) {
|
|
287
|
+
const response = await this.gnerateNewApiKeyForUserRaw(requestParameters, initOverrides);
|
|
288
|
+
return await response.value();
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* List all Roles or filtered
|
|
292
|
+
* List Roles
|
|
293
|
+
*/
|
|
294
|
+
async listRolesRaw(requestParameters, initOverrides) {
|
|
295
|
+
const queryParameters = {};
|
|
296
|
+
if (requestParameters.filter !== void 0) {
|
|
297
|
+
queryParameters["filter"] = requestParameters.filter;
|
|
298
|
+
}
|
|
299
|
+
if (requestParameters.rowsPerPage !== void 0) {
|
|
300
|
+
queryParameters["rowsPerPage"] = requestParameters.rowsPerPage;
|
|
301
|
+
}
|
|
302
|
+
if (requestParameters.page !== void 0) {
|
|
303
|
+
queryParameters["page"] = requestParameters.page;
|
|
304
|
+
}
|
|
305
|
+
const headerParameters = {};
|
|
306
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
307
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
308
|
+
}
|
|
309
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
310
|
+
const token = this.configuration.accessToken;
|
|
311
|
+
const tokenString = await token("httpAuth", []);
|
|
312
|
+
if (tokenString) {
|
|
313
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
317
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
318
|
+
}
|
|
319
|
+
const response = await this.request({
|
|
320
|
+
path: `/admin/roles`,
|
|
321
|
+
method: "GET",
|
|
322
|
+
headers: headerParameters,
|
|
323
|
+
query: queryParameters
|
|
324
|
+
}, initOverrides);
|
|
325
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(RoleFromJSON));
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* List all Roles or filtered
|
|
329
|
+
* List Roles
|
|
330
|
+
*/
|
|
331
|
+
async listRoles(requestParameters = {}, initOverrides) {
|
|
332
|
+
const response = await this.listRolesRaw(requestParameters, initOverrides);
|
|
333
|
+
return await response.value();
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* List all Users or filtered
|
|
337
|
+
* List Users
|
|
338
|
+
*/
|
|
339
|
+
async listUsersRaw(requestParameters, initOverrides) {
|
|
340
|
+
const queryParameters = {};
|
|
341
|
+
if (requestParameters.filter !== void 0) {
|
|
342
|
+
queryParameters["filter"] = requestParameters.filter;
|
|
343
|
+
}
|
|
344
|
+
if (requestParameters.rowsPerPage !== void 0) {
|
|
345
|
+
queryParameters["rowsPerPage"] = requestParameters.rowsPerPage;
|
|
346
|
+
}
|
|
347
|
+
if (requestParameters.page !== void 0) {
|
|
348
|
+
queryParameters["page"] = requestParameters.page;
|
|
349
|
+
}
|
|
350
|
+
const headerParameters = {};
|
|
351
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
352
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
353
|
+
}
|
|
354
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
355
|
+
const token = this.configuration.accessToken;
|
|
356
|
+
const tokenString = await token("httpAuth", []);
|
|
357
|
+
if (tokenString) {
|
|
358
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
362
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
363
|
+
}
|
|
364
|
+
const response = await this.request({
|
|
365
|
+
path: `/admin/users`,
|
|
366
|
+
method: "GET",
|
|
367
|
+
headers: headerParameters,
|
|
368
|
+
query: queryParameters
|
|
369
|
+
}, initOverrides);
|
|
370
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(UserProfileFromJSON));
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* List all Users or filtered
|
|
374
|
+
* List Users
|
|
375
|
+
*/
|
|
376
|
+
async listUsers(requestParameters = {}, initOverrides) {
|
|
377
|
+
const response = await this.listUsersRaw(requestParameters, initOverrides);
|
|
378
|
+
return await response.value();
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Change Password of User
|
|
382
|
+
* Update Password
|
|
383
|
+
*/
|
|
384
|
+
async updatePasswordForUserRaw(requestParameters, initOverrides) {
|
|
385
|
+
if (requestParameters.userId === null || requestParameters.userId === void 0) {
|
|
386
|
+
throw new runtime.RequiredError("userId", "Required parameter requestParameters.userId was null or undefined when calling updatePasswordForUser.");
|
|
387
|
+
}
|
|
388
|
+
if (requestParameters.passwordUpdateRequest === null || requestParameters.passwordUpdateRequest === void 0) {
|
|
389
|
+
throw new runtime.RequiredError("passwordUpdateRequest", "Required parameter requestParameters.passwordUpdateRequest was null or undefined when calling updatePasswordForUser.");
|
|
390
|
+
}
|
|
391
|
+
const queryParameters = {};
|
|
392
|
+
const headerParameters = {};
|
|
393
|
+
headerParameters["Content-Type"] = "application/json";
|
|
394
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
395
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
396
|
+
}
|
|
397
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
398
|
+
const token = this.configuration.accessToken;
|
|
399
|
+
const tokenString = await token("httpAuth", []);
|
|
400
|
+
if (tokenString) {
|
|
401
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
405
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
406
|
+
}
|
|
407
|
+
const response = await this.request({
|
|
408
|
+
path: `/admin/users/{userId}/password`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
|
|
409
|
+
method: "PATCH",
|
|
410
|
+
headers: headerParameters,
|
|
411
|
+
query: queryParameters,
|
|
412
|
+
body: PasswordUpdateRequestToJSON(requestParameters.passwordUpdateRequest)
|
|
413
|
+
}, initOverrides);
|
|
414
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => JsonValueBooleanFromJSON(jsonValue));
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Change Password of User
|
|
418
|
+
* Update Password
|
|
419
|
+
*/
|
|
420
|
+
async updatePasswordForUser(requestParameters, initOverrides) {
|
|
421
|
+
const response = await this.updatePasswordForUserRaw(requestParameters, initOverrides);
|
|
422
|
+
return await response.value();
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Update Role
|
|
426
|
+
* Update Role
|
|
427
|
+
*/
|
|
428
|
+
async updateRoleRaw(requestParameters, initOverrides) {
|
|
429
|
+
if (requestParameters.roleName === null || requestParameters.roleName === void 0) {
|
|
430
|
+
throw new runtime.RequiredError("roleName", "Required parameter requestParameters.roleName was null or undefined when calling updateRole.");
|
|
431
|
+
}
|
|
432
|
+
if (requestParameters.updateRoleRequest === null || requestParameters.updateRoleRequest === void 0) {
|
|
433
|
+
throw new runtime.RequiredError("updateRoleRequest", "Required parameter requestParameters.updateRoleRequest was null or undefined when calling updateRole.");
|
|
434
|
+
}
|
|
435
|
+
const queryParameters = {};
|
|
436
|
+
const headerParameters = {};
|
|
437
|
+
headerParameters["Content-Type"] = "application/json";
|
|
438
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
439
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
440
|
+
}
|
|
441
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
442
|
+
const token = this.configuration.accessToken;
|
|
443
|
+
const tokenString = await token("httpAuth", []);
|
|
444
|
+
if (tokenString) {
|
|
445
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
449
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
450
|
+
}
|
|
451
|
+
const response = await this.request({
|
|
452
|
+
path: `/admin/roles/{roleName}`.replace(`{${"roleName"}}`, encodeURIComponent(String(requestParameters.roleName))),
|
|
453
|
+
method: "PATCH",
|
|
454
|
+
headers: headerParameters,
|
|
455
|
+
query: queryParameters,
|
|
456
|
+
body: UpdateRoleRequestToJSON(requestParameters.updateRoleRequest)
|
|
457
|
+
}, initOverrides);
|
|
458
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RoleFromJSON(jsonValue));
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Update Role
|
|
462
|
+
* Update Role
|
|
463
|
+
*/
|
|
464
|
+
async updateRole(requestParameters, initOverrides) {
|
|
465
|
+
const response = await this.updateRoleRaw(requestParameters, initOverrides);
|
|
466
|
+
return await response.value();
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Update Roles of User
|
|
470
|
+
* Update User Roles
|
|
471
|
+
*/
|
|
472
|
+
async updateRolesForUserRaw(requestParameters, initOverrides) {
|
|
473
|
+
if (requestParameters.userId === null || requestParameters.userId === void 0) {
|
|
474
|
+
throw new runtime.RequiredError("userId", "Required parameter requestParameters.userId was null or undefined when calling updateRolesForUser.");
|
|
475
|
+
}
|
|
476
|
+
const queryParameters = {};
|
|
477
|
+
const headerParameters = {};
|
|
478
|
+
headerParameters["Content-Type"] = "application/json";
|
|
479
|
+
if (this.configuration && (this.configuration.username !== void 0 || this.configuration.password !== void 0)) {
|
|
480
|
+
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
|
|
481
|
+
}
|
|
482
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
483
|
+
const token = this.configuration.accessToken;
|
|
484
|
+
const tokenString = await token("httpAuth", []);
|
|
485
|
+
if (tokenString) {
|
|
486
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
490
|
+
headerParameters["X-AUTH-APIKEY"] = this.configuration.apiKey("X-AUTH-APIKEY");
|
|
491
|
+
}
|
|
492
|
+
const response = await this.request({
|
|
493
|
+
path: `/admin/users/{userId}/roles`.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters.userId))),
|
|
494
|
+
method: "PATCH",
|
|
495
|
+
headers: headerParameters,
|
|
496
|
+
query: queryParameters,
|
|
497
|
+
body: requestParameters.requestBody
|
|
498
|
+
}, initOverrides);
|
|
499
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => UserProfileFromJSON(jsonValue));
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Update Roles of User
|
|
503
|
+
* Update User Roles
|
|
504
|
+
*/
|
|
505
|
+
async updateRolesForUser(requestParameters, initOverrides) {
|
|
506
|
+
const response = await this.updateRolesForUserRaw(requestParameters, initOverrides);
|
|
507
|
+
return await response.value();
|
|
508
|
+
}
|
|
509
|
+
}
|