@easyedu/js-lsm-api 1.57.0 → 1.58.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/.openapi-generator/FILES +2 -0
- package/README.md +5 -2
- package/dist/apis/UserApi.d.ts +32 -1
- package/dist/apis/UserApi.js +99 -0
- package/dist/esm/apis/UserApi.d.ts +32 -1
- package/dist/esm/apis/UserApi.js +100 -1
- package/dist/esm/models/GetUser.d.ts +6 -0
- package/dist/esm/models/GetUser.js +2 -0
- package/dist/esm/models/GetUserAvatarUpload.d.ts +32 -0
- package/dist/esm/models/GetUserAvatarUpload.js +43 -0
- package/dist/esm/models/index.d.ts +1 -0
- package/dist/esm/models/index.js +1 -0
- package/dist/models/GetUser.d.ts +6 -0
- package/dist/models/GetUser.js +2 -0
- package/dist/models/GetUserAvatarUpload.d.ts +32 -0
- package/dist/models/GetUserAvatarUpload.js +50 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/docs/GetUser.md +2 -0
- package/docs/GetUserAvatarUpload.md +34 -0
- package/docs/UserApi.md +138 -0
- package/package.json +1 -1
- package/src/apis/UserApi.ts +129 -0
- package/src/models/GetUser.ts +8 -0
- package/src/models/GetUserAvatarUpload.ts +66 -0
- package/src/models/index.ts +1 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -150,6 +150,7 @@ docs/GetSupportTicketAttachment.md
|
|
|
150
150
|
docs/GetSupportTicketComment.md
|
|
151
151
|
docs/GetSupportTicketList.md
|
|
152
152
|
docs/GetUser.md
|
|
153
|
+
docs/GetUserAvatarUpload.md
|
|
153
154
|
docs/GetUserQuizAttempts.md
|
|
154
155
|
docs/GetUserQuizAttemptsAllOfAttempts.md
|
|
155
156
|
docs/GetUserQuizAttemptsAllOfFilters.md
|
|
@@ -433,6 +434,7 @@ src/models/GetSupportTicketAttachment.ts
|
|
|
433
434
|
src/models/GetSupportTicketComment.ts
|
|
434
435
|
src/models/GetSupportTicketList.ts
|
|
435
436
|
src/models/GetUser.ts
|
|
437
|
+
src/models/GetUserAvatarUpload.ts
|
|
436
438
|
src/models/GetUserQuizAttempts.ts
|
|
437
439
|
src/models/GetUserQuizAttemptsAllOfAttempts.ts
|
|
438
440
|
src/models/GetUserQuizAttemptsAllOfFilters.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @easyedu/js-lsm-api@1.
|
|
1
|
+
# @easyedu/js-lsm-api@1.58.0
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the sbzw93t49b.execute-api.us-east-2.amazonaws.com API.
|
|
4
4
|
|
|
@@ -202,11 +202,13 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
202
202
|
*SupportTicketApi* | [**postSupportTicketAttachment**](docs/SupportTicketApi.md#postsupportticketattachment) | **POST** /support/tickets/{ticketId}/attachments | Upload an attachment to a ticket
|
|
203
203
|
*SupportTicketApi* | [**postSupportTicketComment**](docs/SupportTicketApi.md#postsupportticketcomment) | **POST** /support/tickets/{ticketId}/comments | Add a comment to a ticket
|
|
204
204
|
*SupportTicketApi* | [**putSupportTicket**](docs/SupportTicketApi.md#putsupportticket) | **PUT** /support/tickets/{ticketId} | Update a support ticket
|
|
205
|
+
*UserApi* | [**deleteUserAvatar**](docs/UserApi.md#deleteuseravatar) | **DELETE** /users/{userId}/avatar | Remove the current user\'s profile photo
|
|
205
206
|
*UserApi* | [**getAuthCheck**](docs/UserApi.md#getauthcheck) | **GET** /auth/check | Check if a user is logged in
|
|
206
207
|
*UserApi* | [**getCurrentUserPermissions**](docs/UserApi.md#getcurrentuserpermissions) | **GET** /users/current/permissions | Get the current user\'s permissions
|
|
207
208
|
*UserApi* | [**getUser**](docs/UserApi.md#getuser) | **GET** /users/{userId} | Get a user by id
|
|
208
209
|
*UserApi* | [**postLogin**](docs/UserApi.md#postlogin) | **POST** /auth/login | Post a new login
|
|
209
210
|
*UserApi* | [**postLogout**](docs/UserApi.md#postlogout) | **POST** /auth/logout | Logout a user
|
|
211
|
+
*UserApi* | [**postUserAvatarUpload**](docs/UserApi.md#postuseravatarupload) | **POST** /users/{userId}/avatar | Upload a profile photo for the current user
|
|
210
212
|
*UserApi* | [**putUser**](docs/UserApi.md#putuser) | **PUT** /users/{userId} | Update a user by id
|
|
211
213
|
*UserApi* | [**resetPassword**](docs/UserApi.md#resetpassword) | **POST** /auth/reset-password | Reset a users password
|
|
212
214
|
*UserApi* | [**sendResetPassword**](docs/UserApi.md#sendresetpassword) | **POST** /auth/send-reset-password | Send a reset password email
|
|
@@ -356,6 +358,7 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
356
358
|
- [GetSupportTicketComment](docs/GetSupportTicketComment.md)
|
|
357
359
|
- [GetSupportTicketList](docs/GetSupportTicketList.md)
|
|
358
360
|
- [GetUser](docs/GetUser.md)
|
|
361
|
+
- [GetUserAvatarUpload](docs/GetUserAvatarUpload.md)
|
|
359
362
|
- [GetUserQuizAttempts](docs/GetUserQuizAttempts.md)
|
|
360
363
|
- [GetUserQuizAttemptsAllOfAttempts](docs/GetUserQuizAttemptsAllOfAttempts.md)
|
|
361
364
|
- [GetUserQuizAttemptsAllOfFilters](docs/GetUserQuizAttemptsAllOfFilters.md)
|
|
@@ -481,7 +484,7 @@ and is automatically generated by the
|
|
|
481
484
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
482
485
|
|
|
483
486
|
- API version: `1.0.0`
|
|
484
|
-
- Package version: `1.
|
|
487
|
+
- Package version: `1.58.0`
|
|
485
488
|
- Generator version: `7.21.0`
|
|
486
489
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
487
490
|
|
package/dist/apis/UserApi.d.ts
CHANGED
|
@@ -10,13 +10,20 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { GetUser, LoginRes, PostLogin, PostResetPassword, PostSendResetPassword, PutUser } from '../models/index';
|
|
13
|
+
import type { GetUser, GetUserAvatarUpload, LoginRes, PostLogin, PostResetPassword, PostSendResetPassword, PutUser } from '../models/index';
|
|
14
|
+
export interface DeleteUserAvatarRequest {
|
|
15
|
+
userId: string;
|
|
16
|
+
}
|
|
14
17
|
export interface GetUserRequest {
|
|
15
18
|
userId: string;
|
|
16
19
|
}
|
|
17
20
|
export interface PostLoginRequest {
|
|
18
21
|
postLogin: PostLogin;
|
|
19
22
|
}
|
|
23
|
+
export interface PostUserAvatarUploadRequest {
|
|
24
|
+
userId: string;
|
|
25
|
+
file: Blob;
|
|
26
|
+
}
|
|
20
27
|
export interface PutUserRequest {
|
|
21
28
|
userId: string;
|
|
22
29
|
putUser: Omit<PutUser, 'id' | 'last_updated'>;
|
|
@@ -31,6 +38,18 @@ export interface SendResetPasswordRequest {
|
|
|
31
38
|
*
|
|
32
39
|
*/
|
|
33
40
|
export declare class UserApi extends runtime.BaseAPI {
|
|
41
|
+
/**
|
|
42
|
+
* Creates request options for deleteUserAvatar without sending the request
|
|
43
|
+
*/
|
|
44
|
+
deleteUserAvatarRequestOpts(requestParameters: DeleteUserAvatarRequest): Promise<runtime.RequestOpts>;
|
|
45
|
+
/**
|
|
46
|
+
* Remove the current user\'s profile photo
|
|
47
|
+
*/
|
|
48
|
+
deleteUserAvatarRaw(requestParameters: DeleteUserAvatarRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
49
|
+
/**
|
|
50
|
+
* Remove the current user\'s profile photo
|
|
51
|
+
*/
|
|
52
|
+
deleteUserAvatar(requestParameters: DeleteUserAvatarRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
34
53
|
/**
|
|
35
54
|
* Creates request options for getAuthCheck without sending the request
|
|
36
55
|
*/
|
|
@@ -93,6 +112,18 @@ export declare class UserApi extends runtime.BaseAPI {
|
|
|
93
112
|
* Logout a user
|
|
94
113
|
*/
|
|
95
114
|
postLogout(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Creates request options for postUserAvatarUpload without sending the request
|
|
117
|
+
*/
|
|
118
|
+
postUserAvatarUploadRequestOpts(requestParameters: PostUserAvatarUploadRequest): Promise<runtime.RequestOpts>;
|
|
119
|
+
/**
|
|
120
|
+
* Upload a profile photo for the current user
|
|
121
|
+
*/
|
|
122
|
+
postUserAvatarUploadRaw(requestParameters: PostUserAvatarUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetUserAvatarUpload>>;
|
|
123
|
+
/**
|
|
124
|
+
* Upload a profile photo for the current user
|
|
125
|
+
*/
|
|
126
|
+
postUserAvatarUpload(requestParameters: PostUserAvatarUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetUserAvatarUpload>;
|
|
96
127
|
/**
|
|
97
128
|
* Creates request options for putUser without sending the request
|
|
98
129
|
*/
|
package/dist/apis/UserApi.js
CHANGED
|
@@ -29,6 +29,44 @@ const index_1 = require("../models/index");
|
|
|
29
29
|
*
|
|
30
30
|
*/
|
|
31
31
|
class UserApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Creates request options for deleteUserAvatar without sending the request
|
|
34
|
+
*/
|
|
35
|
+
deleteUserAvatarRequestOpts(requestParameters) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
if (requestParameters['userId'] == null) {
|
|
38
|
+
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling deleteUserAvatar().');
|
|
39
|
+
}
|
|
40
|
+
const queryParameters = {};
|
|
41
|
+
const headerParameters = {};
|
|
42
|
+
let urlPath = `/users/{userId}/avatar`;
|
|
43
|
+
urlPath = urlPath.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
|
|
44
|
+
return {
|
|
45
|
+
path: urlPath,
|
|
46
|
+
method: 'DELETE',
|
|
47
|
+
headers: headerParameters,
|
|
48
|
+
query: queryParameters,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Remove the current user\'s profile photo
|
|
54
|
+
*/
|
|
55
|
+
deleteUserAvatarRaw(requestParameters, initOverrides) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const requestOptions = yield this.deleteUserAvatarRequestOpts(requestParameters);
|
|
58
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
59
|
+
return new runtime.VoidApiResponse(response);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Remove the current user\'s profile photo
|
|
64
|
+
*/
|
|
65
|
+
deleteUserAvatar(requestParameters, initOverrides) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
yield this.deleteUserAvatarRaw(requestParameters, initOverrides);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
32
70
|
/**
|
|
33
71
|
* Creates request options for getAuthCheck without sending the request
|
|
34
72
|
*/
|
|
@@ -213,6 +251,67 @@ class UserApi extends runtime.BaseAPI {
|
|
|
213
251
|
yield this.postLogoutRaw(initOverrides);
|
|
214
252
|
});
|
|
215
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Creates request options for postUserAvatarUpload without sending the request
|
|
256
|
+
*/
|
|
257
|
+
postUserAvatarUploadRequestOpts(requestParameters) {
|
|
258
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
259
|
+
if (requestParameters['userId'] == null) {
|
|
260
|
+
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling postUserAvatarUpload().');
|
|
261
|
+
}
|
|
262
|
+
if (requestParameters['file'] == null) {
|
|
263
|
+
throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling postUserAvatarUpload().');
|
|
264
|
+
}
|
|
265
|
+
const queryParameters = {};
|
|
266
|
+
const headerParameters = {};
|
|
267
|
+
const consumes = [
|
|
268
|
+
{ contentType: 'multipart/form-data' },
|
|
269
|
+
];
|
|
270
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
271
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
272
|
+
let formParams;
|
|
273
|
+
let useForm = false;
|
|
274
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
275
|
+
useForm = canConsumeForm;
|
|
276
|
+
if (useForm) {
|
|
277
|
+
formParams = new FormData();
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
formParams = new URLSearchParams();
|
|
281
|
+
}
|
|
282
|
+
if (requestParameters['file'] != null) {
|
|
283
|
+
formParams.append('file', requestParameters['file']);
|
|
284
|
+
}
|
|
285
|
+
let urlPath = `/users/{userId}/avatar`;
|
|
286
|
+
urlPath = urlPath.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
|
|
287
|
+
return {
|
|
288
|
+
path: urlPath,
|
|
289
|
+
method: 'POST',
|
|
290
|
+
headers: headerParameters,
|
|
291
|
+
query: queryParameters,
|
|
292
|
+
body: formParams,
|
|
293
|
+
};
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Upload a profile photo for the current user
|
|
298
|
+
*/
|
|
299
|
+
postUserAvatarUploadRaw(requestParameters, initOverrides) {
|
|
300
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
301
|
+
const requestOptions = yield this.postUserAvatarUploadRequestOpts(requestParameters);
|
|
302
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
303
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GetUserAvatarUploadFromJSON)(jsonValue));
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Upload a profile photo for the current user
|
|
308
|
+
*/
|
|
309
|
+
postUserAvatarUpload(requestParameters, initOverrides) {
|
|
310
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
311
|
+
const response = yield this.postUserAvatarUploadRaw(requestParameters, initOverrides);
|
|
312
|
+
return yield response.value();
|
|
313
|
+
});
|
|
314
|
+
}
|
|
216
315
|
/**
|
|
217
316
|
* Creates request options for putUser without sending the request
|
|
218
317
|
*/
|
|
@@ -10,13 +10,20 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { GetUser, LoginRes, PostLogin, PostResetPassword, PostSendResetPassword, PutUser } from '../models/index';
|
|
13
|
+
import type { GetUser, GetUserAvatarUpload, LoginRes, PostLogin, PostResetPassword, PostSendResetPassword, PutUser } from '../models/index';
|
|
14
|
+
export interface DeleteUserAvatarRequest {
|
|
15
|
+
userId: string;
|
|
16
|
+
}
|
|
14
17
|
export interface GetUserRequest {
|
|
15
18
|
userId: string;
|
|
16
19
|
}
|
|
17
20
|
export interface PostLoginRequest {
|
|
18
21
|
postLogin: PostLogin;
|
|
19
22
|
}
|
|
23
|
+
export interface PostUserAvatarUploadRequest {
|
|
24
|
+
userId: string;
|
|
25
|
+
file: Blob;
|
|
26
|
+
}
|
|
20
27
|
export interface PutUserRequest {
|
|
21
28
|
userId: string;
|
|
22
29
|
putUser: Omit<PutUser, 'id' | 'last_updated'>;
|
|
@@ -31,6 +38,18 @@ export interface SendResetPasswordRequest {
|
|
|
31
38
|
*
|
|
32
39
|
*/
|
|
33
40
|
export declare class UserApi extends runtime.BaseAPI {
|
|
41
|
+
/**
|
|
42
|
+
* Creates request options for deleteUserAvatar without sending the request
|
|
43
|
+
*/
|
|
44
|
+
deleteUserAvatarRequestOpts(requestParameters: DeleteUserAvatarRequest): Promise<runtime.RequestOpts>;
|
|
45
|
+
/**
|
|
46
|
+
* Remove the current user\'s profile photo
|
|
47
|
+
*/
|
|
48
|
+
deleteUserAvatarRaw(requestParameters: DeleteUserAvatarRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
49
|
+
/**
|
|
50
|
+
* Remove the current user\'s profile photo
|
|
51
|
+
*/
|
|
52
|
+
deleteUserAvatar(requestParameters: DeleteUserAvatarRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
34
53
|
/**
|
|
35
54
|
* Creates request options for getAuthCheck without sending the request
|
|
36
55
|
*/
|
|
@@ -93,6 +112,18 @@ export declare class UserApi extends runtime.BaseAPI {
|
|
|
93
112
|
* Logout a user
|
|
94
113
|
*/
|
|
95
114
|
postLogout(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
115
|
+
/**
|
|
116
|
+
* Creates request options for postUserAvatarUpload without sending the request
|
|
117
|
+
*/
|
|
118
|
+
postUserAvatarUploadRequestOpts(requestParameters: PostUserAvatarUploadRequest): Promise<runtime.RequestOpts>;
|
|
119
|
+
/**
|
|
120
|
+
* Upload a profile photo for the current user
|
|
121
|
+
*/
|
|
122
|
+
postUserAvatarUploadRaw(requestParameters: PostUserAvatarUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetUserAvatarUpload>>;
|
|
123
|
+
/**
|
|
124
|
+
* Upload a profile photo for the current user
|
|
125
|
+
*/
|
|
126
|
+
postUserAvatarUpload(requestParameters: PostUserAvatarUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetUserAvatarUpload>;
|
|
96
127
|
/**
|
|
97
128
|
* Creates request options for putUser without sending the request
|
|
98
129
|
*/
|
package/dist/esm/apis/UserApi.js
CHANGED
|
@@ -21,11 +21,49 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
import * as runtime from '../runtime';
|
|
24
|
-
import { GetUserFromJSON, LoginResFromJSON, PostLoginToJSON, PostResetPasswordToJSON, PostSendResetPasswordToJSON, PutUserToJSON, } from '../models/index';
|
|
24
|
+
import { GetUserFromJSON, GetUserAvatarUploadFromJSON, LoginResFromJSON, PostLoginToJSON, PostResetPasswordToJSON, PostSendResetPasswordToJSON, PutUserToJSON, } from '../models/index';
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
28
28
|
export class UserApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Creates request options for deleteUserAvatar without sending the request
|
|
31
|
+
*/
|
|
32
|
+
deleteUserAvatarRequestOpts(requestParameters) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (requestParameters['userId'] == null) {
|
|
35
|
+
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling deleteUserAvatar().');
|
|
36
|
+
}
|
|
37
|
+
const queryParameters = {};
|
|
38
|
+
const headerParameters = {};
|
|
39
|
+
let urlPath = `/users/{userId}/avatar`;
|
|
40
|
+
urlPath = urlPath.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
|
|
41
|
+
return {
|
|
42
|
+
path: urlPath,
|
|
43
|
+
method: 'DELETE',
|
|
44
|
+
headers: headerParameters,
|
|
45
|
+
query: queryParameters,
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Remove the current user\'s profile photo
|
|
51
|
+
*/
|
|
52
|
+
deleteUserAvatarRaw(requestParameters, initOverrides) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const requestOptions = yield this.deleteUserAvatarRequestOpts(requestParameters);
|
|
55
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
56
|
+
return new runtime.VoidApiResponse(response);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Remove the current user\'s profile photo
|
|
61
|
+
*/
|
|
62
|
+
deleteUserAvatar(requestParameters, initOverrides) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
yield this.deleteUserAvatarRaw(requestParameters, initOverrides);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
29
67
|
/**
|
|
30
68
|
* Creates request options for getAuthCheck without sending the request
|
|
31
69
|
*/
|
|
@@ -210,6 +248,67 @@ export class UserApi extends runtime.BaseAPI {
|
|
|
210
248
|
yield this.postLogoutRaw(initOverrides);
|
|
211
249
|
});
|
|
212
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* Creates request options for postUserAvatarUpload without sending the request
|
|
253
|
+
*/
|
|
254
|
+
postUserAvatarUploadRequestOpts(requestParameters) {
|
|
255
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
256
|
+
if (requestParameters['userId'] == null) {
|
|
257
|
+
throw new runtime.RequiredError('userId', 'Required parameter "userId" was null or undefined when calling postUserAvatarUpload().');
|
|
258
|
+
}
|
|
259
|
+
if (requestParameters['file'] == null) {
|
|
260
|
+
throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling postUserAvatarUpload().');
|
|
261
|
+
}
|
|
262
|
+
const queryParameters = {};
|
|
263
|
+
const headerParameters = {};
|
|
264
|
+
const consumes = [
|
|
265
|
+
{ contentType: 'multipart/form-data' },
|
|
266
|
+
];
|
|
267
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
268
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
269
|
+
let formParams;
|
|
270
|
+
let useForm = false;
|
|
271
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
272
|
+
useForm = canConsumeForm;
|
|
273
|
+
if (useForm) {
|
|
274
|
+
formParams = new FormData();
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
formParams = new URLSearchParams();
|
|
278
|
+
}
|
|
279
|
+
if (requestParameters['file'] != null) {
|
|
280
|
+
formParams.append('file', requestParameters['file']);
|
|
281
|
+
}
|
|
282
|
+
let urlPath = `/users/{userId}/avatar`;
|
|
283
|
+
urlPath = urlPath.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
|
|
284
|
+
return {
|
|
285
|
+
path: urlPath,
|
|
286
|
+
method: 'POST',
|
|
287
|
+
headers: headerParameters,
|
|
288
|
+
query: queryParameters,
|
|
289
|
+
body: formParams,
|
|
290
|
+
};
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Upload a profile photo for the current user
|
|
295
|
+
*/
|
|
296
|
+
postUserAvatarUploadRaw(requestParameters, initOverrides) {
|
|
297
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
298
|
+
const requestOptions = yield this.postUserAvatarUploadRequestOpts(requestParameters);
|
|
299
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
300
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetUserAvatarUploadFromJSON(jsonValue));
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Upload a profile photo for the current user
|
|
305
|
+
*/
|
|
306
|
+
postUserAvatarUpload(requestParameters, initOverrides) {
|
|
307
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
308
|
+
const response = yield this.postUserAvatarUploadRaw(requestParameters, initOverrides);
|
|
309
|
+
return yield response.value();
|
|
310
|
+
});
|
|
311
|
+
}
|
|
213
312
|
/**
|
|
214
313
|
* Creates request options for putUser without sending the request
|
|
215
314
|
*/
|
|
@@ -39,6 +39,12 @@ export interface GetUser {
|
|
|
39
39
|
* @memberof GetUser
|
|
40
40
|
*/
|
|
41
41
|
email: string;
|
|
42
|
+
/**
|
|
43
|
+
* Presigned URL for the user's profile photo, or null if none set
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof GetUser
|
|
46
|
+
*/
|
|
47
|
+
avatarUrl?: string | null;
|
|
42
48
|
/**
|
|
43
49
|
* Unix timestamp in seconds
|
|
44
50
|
* @type {number}
|
|
@@ -39,6 +39,7 @@ export function GetUserFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
39
39
|
'firstName': json['first_name'],
|
|
40
40
|
'lastName': json['last_name'],
|
|
41
41
|
'email': json['email'],
|
|
42
|
+
'avatarUrl': json['avatar_url'] == null ? undefined : json['avatar_url'],
|
|
42
43
|
'lastUpdated': json['last_updated'],
|
|
43
44
|
};
|
|
44
45
|
}
|
|
@@ -53,6 +54,7 @@ export function GetUserToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
53
54
|
'first_name': value['firstName'],
|
|
54
55
|
'last_name': value['lastName'],
|
|
55
56
|
'email': value['email'],
|
|
57
|
+
'avatar_url': value['avatarUrl'],
|
|
56
58
|
'last_updated': value['lastUpdated'],
|
|
57
59
|
};
|
|
58
60
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LMS API
|
|
3
|
+
* LMS API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
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
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface GetUserAvatarUpload
|
|
16
|
+
*/
|
|
17
|
+
export interface GetUserAvatarUpload {
|
|
18
|
+
/**
|
|
19
|
+
* Presigned URL for the uploaded avatar image
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof GetUserAvatarUpload
|
|
22
|
+
*/
|
|
23
|
+
avatarUrl: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if a given object implements the GetUserAvatarUpload interface.
|
|
27
|
+
*/
|
|
28
|
+
export declare function instanceOfGetUserAvatarUpload(value: object): value is GetUserAvatarUpload;
|
|
29
|
+
export declare function GetUserAvatarUploadFromJSON(json: any): GetUserAvatarUpload;
|
|
30
|
+
export declare function GetUserAvatarUploadFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetUserAvatarUpload;
|
|
31
|
+
export declare function GetUserAvatarUploadToJSON(json: any): GetUserAvatarUpload;
|
|
32
|
+
export declare function GetUserAvatarUploadToJSONTyped(value?: GetUserAvatarUpload | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* LMS API
|
|
5
|
+
* LMS API
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Check if a given object implements the GetUserAvatarUpload interface.
|
|
16
|
+
*/
|
|
17
|
+
export function instanceOfGetUserAvatarUpload(value) {
|
|
18
|
+
if (!('avatarUrl' in value) || value['avatarUrl'] === undefined)
|
|
19
|
+
return false;
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
export function GetUserAvatarUploadFromJSON(json) {
|
|
23
|
+
return GetUserAvatarUploadFromJSONTyped(json, false);
|
|
24
|
+
}
|
|
25
|
+
export function GetUserAvatarUploadFromJSONTyped(json, ignoreDiscriminator) {
|
|
26
|
+
if (json == null) {
|
|
27
|
+
return json;
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
'avatarUrl': json['avatar_url'],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function GetUserAvatarUploadToJSON(json) {
|
|
34
|
+
return GetUserAvatarUploadToJSONTyped(json, false);
|
|
35
|
+
}
|
|
36
|
+
export function GetUserAvatarUploadToJSONTyped(value, ignoreDiscriminator = false) {
|
|
37
|
+
if (value == null) {
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
'avatar_url': value['avatarUrl'],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -140,6 +140,7 @@ export * from './GetSupportTicketAttachment';
|
|
|
140
140
|
export * from './GetSupportTicketComment';
|
|
141
141
|
export * from './GetSupportTicketList';
|
|
142
142
|
export * from './GetUser';
|
|
143
|
+
export * from './GetUserAvatarUpload';
|
|
143
144
|
export * from './GetUserQuizAttempts';
|
|
144
145
|
export * from './GetUserQuizAttemptsAllOfAttempts';
|
|
145
146
|
export * from './GetUserQuizAttemptsAllOfFilters';
|
package/dist/esm/models/index.js
CHANGED
|
@@ -142,6 +142,7 @@ export * from './GetSupportTicketAttachment';
|
|
|
142
142
|
export * from './GetSupportTicketComment';
|
|
143
143
|
export * from './GetSupportTicketList';
|
|
144
144
|
export * from './GetUser';
|
|
145
|
+
export * from './GetUserAvatarUpload';
|
|
145
146
|
export * from './GetUserQuizAttempts';
|
|
146
147
|
export * from './GetUserQuizAttemptsAllOfAttempts';
|
|
147
148
|
export * from './GetUserQuizAttemptsAllOfFilters';
|
package/dist/models/GetUser.d.ts
CHANGED
|
@@ -39,6 +39,12 @@ export interface GetUser {
|
|
|
39
39
|
* @memberof GetUser
|
|
40
40
|
*/
|
|
41
41
|
email: string;
|
|
42
|
+
/**
|
|
43
|
+
* Presigned URL for the user's profile photo, or null if none set
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @memberof GetUser
|
|
46
|
+
*/
|
|
47
|
+
avatarUrl?: string | null;
|
|
42
48
|
/**
|
|
43
49
|
* Unix timestamp in seconds
|
|
44
50
|
* @type {number}
|
package/dist/models/GetUser.js
CHANGED
|
@@ -46,6 +46,7 @@ function GetUserFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
46
46
|
'firstName': json['first_name'],
|
|
47
47
|
'lastName': json['last_name'],
|
|
48
48
|
'email': json['email'],
|
|
49
|
+
'avatarUrl': json['avatar_url'] == null ? undefined : json['avatar_url'],
|
|
49
50
|
'lastUpdated': json['last_updated'],
|
|
50
51
|
};
|
|
51
52
|
}
|
|
@@ -60,6 +61,7 @@ function GetUserToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
60
61
|
'first_name': value['firstName'],
|
|
61
62
|
'last_name': value['lastName'],
|
|
62
63
|
'email': value['email'],
|
|
64
|
+
'avatar_url': value['avatarUrl'],
|
|
63
65
|
'last_updated': value['lastUpdated'],
|
|
64
66
|
};
|
|
65
67
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LMS API
|
|
3
|
+
* LMS API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
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
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface GetUserAvatarUpload
|
|
16
|
+
*/
|
|
17
|
+
export interface GetUserAvatarUpload {
|
|
18
|
+
/**
|
|
19
|
+
* Presigned URL for the uploaded avatar image
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @memberof GetUserAvatarUpload
|
|
22
|
+
*/
|
|
23
|
+
avatarUrl: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if a given object implements the GetUserAvatarUpload interface.
|
|
27
|
+
*/
|
|
28
|
+
export declare function instanceOfGetUserAvatarUpload(value: object): value is GetUserAvatarUpload;
|
|
29
|
+
export declare function GetUserAvatarUploadFromJSON(json: any): GetUserAvatarUpload;
|
|
30
|
+
export declare function GetUserAvatarUploadFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetUserAvatarUpload;
|
|
31
|
+
export declare function GetUserAvatarUploadToJSON(json: any): GetUserAvatarUpload;
|
|
32
|
+
export declare function GetUserAvatarUploadToJSONTyped(value?: GetUserAvatarUpload | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* LMS API
|
|
6
|
+
* LMS API
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfGetUserAvatarUpload = instanceOfGetUserAvatarUpload;
|
|
17
|
+
exports.GetUserAvatarUploadFromJSON = GetUserAvatarUploadFromJSON;
|
|
18
|
+
exports.GetUserAvatarUploadFromJSONTyped = GetUserAvatarUploadFromJSONTyped;
|
|
19
|
+
exports.GetUserAvatarUploadToJSON = GetUserAvatarUploadToJSON;
|
|
20
|
+
exports.GetUserAvatarUploadToJSONTyped = GetUserAvatarUploadToJSONTyped;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the GetUserAvatarUpload interface.
|
|
23
|
+
*/
|
|
24
|
+
function instanceOfGetUserAvatarUpload(value) {
|
|
25
|
+
if (!('avatarUrl' in value) || value['avatarUrl'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
function GetUserAvatarUploadFromJSON(json) {
|
|
30
|
+
return GetUserAvatarUploadFromJSONTyped(json, false);
|
|
31
|
+
}
|
|
32
|
+
function GetUserAvatarUploadFromJSONTyped(json, ignoreDiscriminator) {
|
|
33
|
+
if (json == null) {
|
|
34
|
+
return json;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
'avatarUrl': json['avatar_url'],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function GetUserAvatarUploadToJSON(json) {
|
|
41
|
+
return GetUserAvatarUploadToJSONTyped(json, false);
|
|
42
|
+
}
|
|
43
|
+
function GetUserAvatarUploadToJSONTyped(value, ignoreDiscriminator = false) {
|
|
44
|
+
if (value == null) {
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
'avatar_url': value['avatarUrl'],
|
|
49
|
+
};
|
|
50
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -140,6 +140,7 @@ export * from './GetSupportTicketAttachment';
|
|
|
140
140
|
export * from './GetSupportTicketComment';
|
|
141
141
|
export * from './GetSupportTicketList';
|
|
142
142
|
export * from './GetUser';
|
|
143
|
+
export * from './GetUserAvatarUpload';
|
|
143
144
|
export * from './GetUserQuizAttempts';
|
|
144
145
|
export * from './GetUserQuizAttemptsAllOfAttempts';
|
|
145
146
|
export * from './GetUserQuizAttemptsAllOfFilters';
|
package/dist/models/index.js
CHANGED
|
@@ -158,6 +158,7 @@ __exportStar(require("./GetSupportTicketAttachment"), exports);
|
|
|
158
158
|
__exportStar(require("./GetSupportTicketComment"), exports);
|
|
159
159
|
__exportStar(require("./GetSupportTicketList"), exports);
|
|
160
160
|
__exportStar(require("./GetUser"), exports);
|
|
161
|
+
__exportStar(require("./GetUserAvatarUpload"), exports);
|
|
161
162
|
__exportStar(require("./GetUserQuizAttempts"), exports);
|
|
162
163
|
__exportStar(require("./GetUserQuizAttemptsAllOfAttempts"), exports);
|
|
163
164
|
__exportStar(require("./GetUserQuizAttemptsAllOfFilters"), exports);
|
package/docs/GetUser.md
CHANGED
|
@@ -10,6 +10,7 @@ Name | Type
|
|
|
10
10
|
`firstName` | string
|
|
11
11
|
`lastName` | string
|
|
12
12
|
`email` | string
|
|
13
|
+
`avatarUrl` | string
|
|
13
14
|
`lastUpdated` | number
|
|
14
15
|
|
|
15
16
|
## Example
|
|
@@ -23,6 +24,7 @@ const example = {
|
|
|
23
24
|
"firstName": null,
|
|
24
25
|
"lastName": null,
|
|
25
26
|
"email": null,
|
|
27
|
+
"avatarUrl": null,
|
|
26
28
|
"lastUpdated": null,
|
|
27
29
|
} satisfies GetUser
|
|
28
30
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# GetUserAvatarUpload
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`avatarUrl` | string
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { GetUserAvatarUpload } from '@easyedu/js-lsm-api'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"avatarUrl": null,
|
|
19
|
+
} satisfies GetUserAvatarUpload
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as GetUserAvatarUpload
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
package/docs/UserApi.md
CHANGED
|
@@ -4,17 +4,85 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
|
+
| [**deleteUserAvatar**](UserApi.md#deleteuseravatar) | **DELETE** /users/{userId}/avatar | Remove the current user\'s profile photo |
|
|
7
8
|
| [**getAuthCheck**](UserApi.md#getauthcheck) | **GET** /auth/check | Check if a user is logged in |
|
|
8
9
|
| [**getCurrentUserPermissions**](UserApi.md#getcurrentuserpermissions) | **GET** /users/current/permissions | Get the current user\'s permissions |
|
|
9
10
|
| [**getUser**](UserApi.md#getuser) | **GET** /users/{userId} | Get a user by id |
|
|
10
11
|
| [**postLogin**](UserApi.md#postlogin) | **POST** /auth/login | Post a new login |
|
|
11
12
|
| [**postLogout**](UserApi.md#postlogout) | **POST** /auth/logout | Logout a user |
|
|
13
|
+
| [**postUserAvatarUpload**](UserApi.md#postuseravatarupload) | **POST** /users/{userId}/avatar | Upload a profile photo for the current user |
|
|
12
14
|
| [**putUser**](UserApi.md#putuser) | **PUT** /users/{userId} | Update a user by id |
|
|
13
15
|
| [**resetPassword**](UserApi.md#resetpassword) | **POST** /auth/reset-password | Reset a users password |
|
|
14
16
|
| [**sendResetPassword**](UserApi.md#sendresetpassword) | **POST** /auth/send-reset-password | Send a reset password email |
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
|
|
20
|
+
## deleteUserAvatar
|
|
21
|
+
|
|
22
|
+
> deleteUserAvatar(userId)
|
|
23
|
+
|
|
24
|
+
Remove the current user\'s profile photo
|
|
25
|
+
|
|
26
|
+
### Example
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import {
|
|
30
|
+
Configuration,
|
|
31
|
+
UserApi,
|
|
32
|
+
} from '@easyedu/js-lsm-api';
|
|
33
|
+
import type { DeleteUserAvatarRequest } from '@easyedu/js-lsm-api';
|
|
34
|
+
|
|
35
|
+
async function example() {
|
|
36
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
37
|
+
const api = new UserApi();
|
|
38
|
+
|
|
39
|
+
const body = {
|
|
40
|
+
// string
|
|
41
|
+
userId: userId_example,
|
|
42
|
+
} satisfies DeleteUserAvatarRequest;
|
|
43
|
+
|
|
44
|
+
try {
|
|
45
|
+
const data = await api.deleteUserAvatar(body);
|
|
46
|
+
console.log(data);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error(error);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Run the test
|
|
53
|
+
example().catch(console.error);
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Parameters
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
| Name | Type | Description | Notes |
|
|
60
|
+
|------------- | ------------- | ------------- | -------------|
|
|
61
|
+
| **userId** | `string` | | [Defaults to `undefined`] |
|
|
62
|
+
|
|
63
|
+
### Return type
|
|
64
|
+
|
|
65
|
+
`void` (Empty response body)
|
|
66
|
+
|
|
67
|
+
### Authorization
|
|
68
|
+
|
|
69
|
+
No authorization required
|
|
70
|
+
|
|
71
|
+
### HTTP request headers
|
|
72
|
+
|
|
73
|
+
- **Content-Type**: Not defined
|
|
74
|
+
- **Accept**: Not defined
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
### HTTP response details
|
|
78
|
+
| Status code | Description | Response headers |
|
|
79
|
+
|-------------|-------------|------------------|
|
|
80
|
+
| **204** | Avatar removed successfully | - |
|
|
81
|
+
| **404** | User not found | - |
|
|
82
|
+
|
|
83
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
84
|
+
|
|
85
|
+
|
|
18
86
|
## getAuthCheck
|
|
19
87
|
|
|
20
88
|
> getAuthCheck()
|
|
@@ -320,6 +388,76 @@ No authorization required
|
|
|
320
388
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
321
389
|
|
|
322
390
|
|
|
391
|
+
## postUserAvatarUpload
|
|
392
|
+
|
|
393
|
+
> GetUserAvatarUpload postUserAvatarUpload(userId, file)
|
|
394
|
+
|
|
395
|
+
Upload a profile photo for the current user
|
|
396
|
+
|
|
397
|
+
### Example
|
|
398
|
+
|
|
399
|
+
```ts
|
|
400
|
+
import {
|
|
401
|
+
Configuration,
|
|
402
|
+
UserApi,
|
|
403
|
+
} from '@easyedu/js-lsm-api';
|
|
404
|
+
import type { PostUserAvatarUploadRequest } from '@easyedu/js-lsm-api';
|
|
405
|
+
|
|
406
|
+
async function example() {
|
|
407
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
408
|
+
const api = new UserApi();
|
|
409
|
+
|
|
410
|
+
const body = {
|
|
411
|
+
// string
|
|
412
|
+
userId: userId_example,
|
|
413
|
+
// Blob | Avatar image file (PNG, JPEG, or SVG). Max 2MB.
|
|
414
|
+
file: BINARY_DATA_HERE,
|
|
415
|
+
} satisfies PostUserAvatarUploadRequest;
|
|
416
|
+
|
|
417
|
+
try {
|
|
418
|
+
const data = await api.postUserAvatarUpload(body);
|
|
419
|
+
console.log(data);
|
|
420
|
+
} catch (error) {
|
|
421
|
+
console.error(error);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
// Run the test
|
|
426
|
+
example().catch(console.error);
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
### Parameters
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
| Name | Type | Description | Notes |
|
|
433
|
+
|------------- | ------------- | ------------- | -------------|
|
|
434
|
+
| **userId** | `string` | | [Defaults to `undefined`] |
|
|
435
|
+
| **file** | `Blob` | Avatar image file (PNG, JPEG, or SVG). Max 2MB. | [Defaults to `undefined`] |
|
|
436
|
+
|
|
437
|
+
### Return type
|
|
438
|
+
|
|
439
|
+
[**GetUserAvatarUpload**](GetUserAvatarUpload.md)
|
|
440
|
+
|
|
441
|
+
### Authorization
|
|
442
|
+
|
|
443
|
+
No authorization required
|
|
444
|
+
|
|
445
|
+
### HTTP request headers
|
|
446
|
+
|
|
447
|
+
- **Content-Type**: `multipart/form-data`
|
|
448
|
+
- **Accept**: `application/json`
|
|
449
|
+
|
|
450
|
+
|
|
451
|
+
### HTTP response details
|
|
452
|
+
| Status code | Description | Response headers |
|
|
453
|
+
|-------------|-------------|------------------|
|
|
454
|
+
| **200** | Avatar uploaded successfully | - |
|
|
455
|
+
| **400** | Invalid file type or file too large | - |
|
|
456
|
+
| **404** | User not found | - |
|
|
457
|
+
|
|
458
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
459
|
+
|
|
460
|
+
|
|
323
461
|
## putUser
|
|
324
462
|
|
|
325
463
|
> GetUser putUser(userId, putUser)
|
package/package.json
CHANGED
package/src/apis/UserApi.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
GetUser,
|
|
19
|
+
GetUserAvatarUpload,
|
|
19
20
|
LoginRes,
|
|
20
21
|
PostLogin,
|
|
21
22
|
PostResetPassword,
|
|
@@ -25,6 +26,8 @@ import type {
|
|
|
25
26
|
import {
|
|
26
27
|
GetUserFromJSON,
|
|
27
28
|
GetUserToJSON,
|
|
29
|
+
GetUserAvatarUploadFromJSON,
|
|
30
|
+
GetUserAvatarUploadToJSON,
|
|
28
31
|
LoginResFromJSON,
|
|
29
32
|
LoginResToJSON,
|
|
30
33
|
PostLoginFromJSON,
|
|
@@ -37,6 +40,10 @@ import {
|
|
|
37
40
|
PutUserToJSON,
|
|
38
41
|
} from '../models/index';
|
|
39
42
|
|
|
43
|
+
export interface DeleteUserAvatarRequest {
|
|
44
|
+
userId: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
40
47
|
export interface GetUserRequest {
|
|
41
48
|
userId: string;
|
|
42
49
|
}
|
|
@@ -45,6 +52,11 @@ export interface PostLoginRequest {
|
|
|
45
52
|
postLogin: PostLogin;
|
|
46
53
|
}
|
|
47
54
|
|
|
55
|
+
export interface PostUserAvatarUploadRequest {
|
|
56
|
+
userId: string;
|
|
57
|
+
file: Blob;
|
|
58
|
+
}
|
|
59
|
+
|
|
48
60
|
export interface PutUserRequest {
|
|
49
61
|
userId: string;
|
|
50
62
|
putUser: Omit<PutUser, 'id'|'last_updated'>;
|
|
@@ -63,6 +75,50 @@ export interface SendResetPasswordRequest {
|
|
|
63
75
|
*/
|
|
64
76
|
export class UserApi extends runtime.BaseAPI {
|
|
65
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Creates request options for deleteUserAvatar without sending the request
|
|
80
|
+
*/
|
|
81
|
+
async deleteUserAvatarRequestOpts(requestParameters: DeleteUserAvatarRequest): Promise<runtime.RequestOpts> {
|
|
82
|
+
if (requestParameters['userId'] == null) {
|
|
83
|
+
throw new runtime.RequiredError(
|
|
84
|
+
'userId',
|
|
85
|
+
'Required parameter "userId" was null or undefined when calling deleteUserAvatar().'
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const queryParameters: any = {};
|
|
90
|
+
|
|
91
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
let urlPath = `/users/{userId}/avatar`;
|
|
95
|
+
urlPath = urlPath.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
path: urlPath,
|
|
99
|
+
method: 'DELETE',
|
|
100
|
+
headers: headerParameters,
|
|
101
|
+
query: queryParameters,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Remove the current user\'s profile photo
|
|
107
|
+
*/
|
|
108
|
+
async deleteUserAvatarRaw(requestParameters: DeleteUserAvatarRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
109
|
+
const requestOptions = await this.deleteUserAvatarRequestOpts(requestParameters);
|
|
110
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
111
|
+
|
|
112
|
+
return new runtime.VoidApiResponse(response);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Remove the current user\'s profile photo
|
|
117
|
+
*/
|
|
118
|
+
async deleteUserAvatar(requestParameters: DeleteUserAvatarRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
119
|
+
await this.deleteUserAvatarRaw(requestParameters, initOverrides);
|
|
120
|
+
}
|
|
121
|
+
|
|
66
122
|
/**
|
|
67
123
|
* Creates request options for getAuthCheck without sending the request
|
|
68
124
|
*/
|
|
@@ -266,6 +322,79 @@ export class UserApi extends runtime.BaseAPI {
|
|
|
266
322
|
await this.postLogoutRaw(initOverrides);
|
|
267
323
|
}
|
|
268
324
|
|
|
325
|
+
/**
|
|
326
|
+
* Creates request options for postUserAvatarUpload without sending the request
|
|
327
|
+
*/
|
|
328
|
+
async postUserAvatarUploadRequestOpts(requestParameters: PostUserAvatarUploadRequest): Promise<runtime.RequestOpts> {
|
|
329
|
+
if (requestParameters['userId'] == null) {
|
|
330
|
+
throw new runtime.RequiredError(
|
|
331
|
+
'userId',
|
|
332
|
+
'Required parameter "userId" was null or undefined when calling postUserAvatarUpload().'
|
|
333
|
+
);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
if (requestParameters['file'] == null) {
|
|
337
|
+
throw new runtime.RequiredError(
|
|
338
|
+
'file',
|
|
339
|
+
'Required parameter "file" was null or undefined when calling postUserAvatarUpload().'
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
const queryParameters: any = {};
|
|
344
|
+
|
|
345
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
346
|
+
|
|
347
|
+
const consumes: runtime.Consume[] = [
|
|
348
|
+
{ contentType: 'multipart/form-data' },
|
|
349
|
+
];
|
|
350
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
351
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
352
|
+
|
|
353
|
+
let formParams: { append(param: string, value: any): any };
|
|
354
|
+
let useForm = false;
|
|
355
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
356
|
+
useForm = canConsumeForm;
|
|
357
|
+
if (useForm) {
|
|
358
|
+
formParams = new FormData();
|
|
359
|
+
} else {
|
|
360
|
+
formParams = new URLSearchParams();
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if (requestParameters['file'] != null) {
|
|
364
|
+
formParams.append('file', requestParameters['file'] as any);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
let urlPath = `/users/{userId}/avatar`;
|
|
369
|
+
urlPath = urlPath.replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters['userId'])));
|
|
370
|
+
|
|
371
|
+
return {
|
|
372
|
+
path: urlPath,
|
|
373
|
+
method: 'POST',
|
|
374
|
+
headers: headerParameters,
|
|
375
|
+
query: queryParameters,
|
|
376
|
+
body: formParams,
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Upload a profile photo for the current user
|
|
382
|
+
*/
|
|
383
|
+
async postUserAvatarUploadRaw(requestParameters: PostUserAvatarUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetUserAvatarUpload>> {
|
|
384
|
+
const requestOptions = await this.postUserAvatarUploadRequestOpts(requestParameters);
|
|
385
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
386
|
+
|
|
387
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetUserAvatarUploadFromJSON(jsonValue));
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Upload a profile photo for the current user
|
|
392
|
+
*/
|
|
393
|
+
async postUserAvatarUpload(requestParameters: PostUserAvatarUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetUserAvatarUpload> {
|
|
394
|
+
const response = await this.postUserAvatarUploadRaw(requestParameters, initOverrides);
|
|
395
|
+
return await response.value();
|
|
396
|
+
}
|
|
397
|
+
|
|
269
398
|
/**
|
|
270
399
|
* Creates request options for putUser without sending the request
|
|
271
400
|
*/
|
package/src/models/GetUser.ts
CHANGED
|
@@ -43,6 +43,12 @@ export interface GetUser {
|
|
|
43
43
|
* @memberof GetUser
|
|
44
44
|
*/
|
|
45
45
|
email: string;
|
|
46
|
+
/**
|
|
47
|
+
* Presigned URL for the user's profile photo, or null if none set
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof GetUser
|
|
50
|
+
*/
|
|
51
|
+
avatarUrl?: string | null;
|
|
46
52
|
/**
|
|
47
53
|
* Unix timestamp in seconds
|
|
48
54
|
* @type {number}
|
|
@@ -77,6 +83,7 @@ export function GetUserFromJSONTyped(json: any, ignoreDiscriminator: boolean): G
|
|
|
77
83
|
'firstName': json['first_name'],
|
|
78
84
|
'lastName': json['last_name'],
|
|
79
85
|
'email': json['email'],
|
|
86
|
+
'avatarUrl': json['avatar_url'] == null ? undefined : json['avatar_url'],
|
|
80
87
|
'lastUpdated': json['last_updated'],
|
|
81
88
|
};
|
|
82
89
|
}
|
|
@@ -95,6 +102,7 @@ export function GetUserToJSONTyped(value?: Omit<GetUser, 'id'> | null, ignoreDis
|
|
|
95
102
|
'first_name': value['firstName'],
|
|
96
103
|
'last_name': value['lastName'],
|
|
97
104
|
'email': value['email'],
|
|
105
|
+
'avatar_url': value['avatarUrl'],
|
|
98
106
|
'last_updated': value['lastUpdated'],
|
|
99
107
|
};
|
|
100
108
|
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* LMS API
|
|
5
|
+
* LMS API
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface GetUserAvatarUpload
|
|
20
|
+
*/
|
|
21
|
+
export interface GetUserAvatarUpload {
|
|
22
|
+
/**
|
|
23
|
+
* Presigned URL for the uploaded avatar image
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof GetUserAvatarUpload
|
|
26
|
+
*/
|
|
27
|
+
avatarUrl: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the GetUserAvatarUpload interface.
|
|
32
|
+
*/
|
|
33
|
+
export function instanceOfGetUserAvatarUpload(value: object): value is GetUserAvatarUpload {
|
|
34
|
+
if (!('avatarUrl' in value) || value['avatarUrl'] === undefined) return false;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function GetUserAvatarUploadFromJSON(json: any): GetUserAvatarUpload {
|
|
39
|
+
return GetUserAvatarUploadFromJSONTyped(json, false);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function GetUserAvatarUploadFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetUserAvatarUpload {
|
|
43
|
+
if (json == null) {
|
|
44
|
+
return json;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
|
|
48
|
+
'avatarUrl': json['avatar_url'],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function GetUserAvatarUploadToJSON(json: any): GetUserAvatarUpload {
|
|
53
|
+
return GetUserAvatarUploadToJSONTyped(json, false);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function GetUserAvatarUploadToJSONTyped(value?: GetUserAvatarUpload | null, ignoreDiscriminator: boolean = false): any {
|
|
57
|
+
if (value == null) {
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
'avatar_url': value['avatarUrl'],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -142,6 +142,7 @@ export * from './GetSupportTicketAttachment';
|
|
|
142
142
|
export * from './GetSupportTicketComment';
|
|
143
143
|
export * from './GetSupportTicketList';
|
|
144
144
|
export * from './GetUser';
|
|
145
|
+
export * from './GetUserAvatarUpload';
|
|
145
146
|
export * from './GetUserQuizAttempts';
|
|
146
147
|
export * from './GetUserQuizAttemptsAllOfAttempts';
|
|
147
148
|
export * from './GetUserQuizAttemptsAllOfFilters';
|