@easyedu/js-lsm-api 1.56.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 +4 -0
- package/README.md +8 -2
- package/dist/apis/PortalApi.d.ts +32 -1
- package/dist/apis/PortalApi.js +99 -0
- package/dist/apis/UserApi.d.ts +32 -1
- package/dist/apis/UserApi.js +99 -0
- package/dist/esm/apis/PortalApi.d.ts +32 -1
- package/dist/esm/apis/PortalApi.js +100 -1
- package/dist/esm/apis/UserApi.d.ts +32 -1
- package/dist/esm/apis/UserApi.js +100 -1
- package/dist/esm/models/GetPortal.d.ts +6 -0
- package/dist/esm/models/GetPortal.js +2 -0
- package/dist/esm/models/GetPortalFaviconUpload.d.ts +32 -0
- package/dist/esm/models/GetPortalFaviconUpload.js +43 -0
- 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 +2 -0
- package/dist/esm/models/index.js +2 -0
- package/dist/models/GetPortal.d.ts +6 -0
- package/dist/models/GetPortal.js +2 -0
- package/dist/models/GetPortalFaviconUpload.d.ts +32 -0
- package/dist/models/GetPortalFaviconUpload.js +50 -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 +2 -0
- package/dist/models/index.js +2 -0
- package/docs/GetPortal.md +2 -0
- package/docs/GetPortalFaviconUpload.md +34 -0
- package/docs/GetUser.md +2 -0
- package/docs/GetUserAvatarUpload.md +34 -0
- package/docs/PortalApi.md +138 -0
- package/docs/UserApi.md +138 -0
- package/package.json +1 -1
- package/src/apis/PortalApi.ts +129 -0
- package/src/apis/UserApi.ts +129 -0
- package/src/models/GetPortal.ts +8 -0
- package/src/models/GetPortalFaviconUpload.ts +66 -0
- package/src/models/GetUser.ts +8 -0
- package/src/models/GetUserAvatarUpload.ts +66 -0
- package/src/models/index.ts +2 -0
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/GetPortal.ts
CHANGED
|
@@ -43,6 +43,12 @@ export interface GetPortal {
|
|
|
43
43
|
* @memberof GetPortal
|
|
44
44
|
*/
|
|
45
45
|
logoUrl?: string | null;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof GetPortal
|
|
50
|
+
*/
|
|
51
|
+
faviconUrl?: string | null;
|
|
46
52
|
/**
|
|
47
53
|
*
|
|
48
54
|
* @type {string}
|
|
@@ -104,6 +110,7 @@ export function GetPortalFromJSONTyped(json: any, ignoreDiscriminator: boolean):
|
|
|
104
110
|
'name': json['name'],
|
|
105
111
|
'parentPortalId': json['parent_portal_id'] == null ? undefined : json['parent_portal_id'],
|
|
106
112
|
'logoUrl': json['logo_url'] == null ? undefined : json['logo_url'],
|
|
113
|
+
'faviconUrl': json['favicon_url'] == null ? undefined : json['favicon_url'],
|
|
107
114
|
'headerBackgroundColor': json['header_background_color'],
|
|
108
115
|
'headerTextColor': json['header_text_color'],
|
|
109
116
|
'baseType': json['base_type'] == null ? undefined : json['base_type'],
|
|
@@ -125,6 +132,7 @@ export function GetPortalToJSONTyped(value?: GetPortal | null, ignoreDiscriminat
|
|
|
125
132
|
'name': value['name'],
|
|
126
133
|
'parent_portal_id': value['parentPortalId'],
|
|
127
134
|
'logo_url': value['logoUrl'],
|
|
135
|
+
'favicon_url': value['faviconUrl'],
|
|
128
136
|
'header_background_color': value['headerBackgroundColor'],
|
|
129
137
|
'header_text_color': value['headerTextColor'],
|
|
130
138
|
'base_type': value['baseType'],
|
|
@@ -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 GetPortalFaviconUpload
|
|
20
|
+
*/
|
|
21
|
+
export interface GetPortalFaviconUpload {
|
|
22
|
+
/**
|
|
23
|
+
* Presigned URL for the uploaded favicon image
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof GetPortalFaviconUpload
|
|
26
|
+
*/
|
|
27
|
+
faviconUrl: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the GetPortalFaviconUpload interface.
|
|
32
|
+
*/
|
|
33
|
+
export function instanceOfGetPortalFaviconUpload(value: object): value is GetPortalFaviconUpload {
|
|
34
|
+
if (!('faviconUrl' in value) || value['faviconUrl'] === undefined) return false;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function GetPortalFaviconUploadFromJSON(json: any): GetPortalFaviconUpload {
|
|
39
|
+
return GetPortalFaviconUploadFromJSONTyped(json, false);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function GetPortalFaviconUploadFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetPortalFaviconUpload {
|
|
43
|
+
if (json == null) {
|
|
44
|
+
return json;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
|
|
48
|
+
'faviconUrl': json['favicon_url'],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function GetPortalFaviconUploadToJSON(json: any): GetPortalFaviconUpload {
|
|
53
|
+
return GetPortalFaviconUploadToJSONTyped(json, false);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function GetPortalFaviconUploadToJSONTyped(value?: GetPortalFaviconUpload | null, ignoreDiscriminator: boolean = false): any {
|
|
57
|
+
if (value == null) {
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
'favicon_url': value['faviconUrl'],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
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
|
@@ -72,6 +72,7 @@ export * from './GetPortal';
|
|
|
72
72
|
export * from './GetPortalBasicReporting';
|
|
73
73
|
export * from './GetPortalBasicReportingCertificates';
|
|
74
74
|
export * from './GetPortalBasicReportingPortalInfo';
|
|
75
|
+
export * from './GetPortalFaviconUpload';
|
|
75
76
|
export * from './GetPortalList';
|
|
76
77
|
export * from './GetPortalLogoUpload';
|
|
77
78
|
export * from './GetPortalStudentReporting';
|
|
@@ -141,6 +142,7 @@ export * from './GetSupportTicketAttachment';
|
|
|
141
142
|
export * from './GetSupportTicketComment';
|
|
142
143
|
export * from './GetSupportTicketList';
|
|
143
144
|
export * from './GetUser';
|
|
145
|
+
export * from './GetUserAvatarUpload';
|
|
144
146
|
export * from './GetUserQuizAttempts';
|
|
145
147
|
export * from './GetUserQuizAttemptsAllOfAttempts';
|
|
146
148
|
export * from './GetUserQuizAttemptsAllOfFilters';
|