@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/dist/models/index.js
CHANGED
|
@@ -88,6 +88,7 @@ __exportStar(require("./GetPortal"), exports);
|
|
|
88
88
|
__exportStar(require("./GetPortalBasicReporting"), exports);
|
|
89
89
|
__exportStar(require("./GetPortalBasicReportingCertificates"), exports);
|
|
90
90
|
__exportStar(require("./GetPortalBasicReportingPortalInfo"), exports);
|
|
91
|
+
__exportStar(require("./GetPortalFaviconUpload"), exports);
|
|
91
92
|
__exportStar(require("./GetPortalList"), exports);
|
|
92
93
|
__exportStar(require("./GetPortalLogoUpload"), exports);
|
|
93
94
|
__exportStar(require("./GetPortalStudentReporting"), exports);
|
|
@@ -157,6 +158,7 @@ __exportStar(require("./GetSupportTicketAttachment"), exports);
|
|
|
157
158
|
__exportStar(require("./GetSupportTicketComment"), exports);
|
|
158
159
|
__exportStar(require("./GetSupportTicketList"), exports);
|
|
159
160
|
__exportStar(require("./GetUser"), exports);
|
|
161
|
+
__exportStar(require("./GetUserAvatarUpload"), exports);
|
|
160
162
|
__exportStar(require("./GetUserQuizAttempts"), exports);
|
|
161
163
|
__exportStar(require("./GetUserQuizAttemptsAllOfAttempts"), exports);
|
|
162
164
|
__exportStar(require("./GetUserQuizAttemptsAllOfFilters"), exports);
|
package/docs/GetPortal.md
CHANGED
|
@@ -10,6 +10,7 @@ Name | Type
|
|
|
10
10
|
`name` | string
|
|
11
11
|
`parentPortalId` | string
|
|
12
12
|
`logoUrl` | string
|
|
13
|
+
`faviconUrl` | string
|
|
13
14
|
`headerBackgroundColor` | string
|
|
14
15
|
`headerTextColor` | string
|
|
15
16
|
`baseType` | string
|
|
@@ -25,6 +26,7 @@ const example = {
|
|
|
25
26
|
"name": null,
|
|
26
27
|
"parentPortalId": null,
|
|
27
28
|
"logoUrl": null,
|
|
29
|
+
"faviconUrl": null,
|
|
28
30
|
"headerBackgroundColor": null,
|
|
29
31
|
"headerTextColor": null,
|
|
30
32
|
"baseType": null,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# GetPortalFaviconUpload
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`faviconUrl` | string
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { GetPortalFaviconUpload } from '@easyedu/js-lsm-api'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"faviconUrl": null,
|
|
19
|
+
} satisfies GetPortalFaviconUpload
|
|
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 GetPortalFaviconUpload
|
|
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/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/PortalApi.md
CHANGED
|
@@ -4,18 +4,86 @@ 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
|
+
| [**deletePortalFavicon**](PortalApi.md#deleteportalfavicon) | **DELETE** /portals/{portalId}/branding/favicon | Remove the portal favicon |
|
|
7
8
|
| [**deletePortalLogo**](PortalApi.md#deleteportallogo) | **DELETE** /portals/{portalId}/branding/logo | Remove the portal logo |
|
|
8
9
|
| [**getPortalById**](PortalApi.md#getportalbyid) | **GET** /portals/{portalId} | Get a portal by id (can use \'current\' to get the current users selected portal) |
|
|
9
10
|
| [**getPortalList**](PortalApi.md#getportallist) | **GET** /portals | Get all portals a user has access to |
|
|
10
11
|
| [**getPortalUsers**](PortalApi.md#getportalusers) | **GET** /portals/{portalId}/users | Get all users for a portal with optional role filtering |
|
|
11
12
|
| [**inviteUserToPortal**](PortalApi.md#inviteusertoportal) | **POST** /portals/{portalId}/invite | Invite a new user to a portal |
|
|
12
13
|
| [**postPortal**](PortalApi.md#postportal) | **POST** /portals | Create a new portal as a child of the current selected portal |
|
|
14
|
+
| [**postPortalFaviconUpload**](PortalApi.md#postportalfaviconupload) | **POST** /portals/{portalId}/branding/favicon | Upload a favicon image for portal branding |
|
|
13
15
|
| [**postPortalLogoUpload**](PortalApi.md#postportallogoupload) | **POST** /portals/{portalId}/branding/logo | Upload a logo image for portal branding |
|
|
14
16
|
| [**putPortalBranding**](PortalApi.md#putportalbranding) | **PUT** /portals/{portalId} | Update portal branding (name, background color, text color) |
|
|
15
17
|
| [**updateSelectedPortal**](PortalApi.md#updateselectedportal) | **PUT** /portals/{portalId}/selected | Update the users current selected portal. Returns new JWT with updated roles. |
|
|
16
18
|
|
|
17
19
|
|
|
18
20
|
|
|
21
|
+
## deletePortalFavicon
|
|
22
|
+
|
|
23
|
+
> deletePortalFavicon(portalId)
|
|
24
|
+
|
|
25
|
+
Remove the portal favicon
|
|
26
|
+
|
|
27
|
+
### Example
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
import {
|
|
31
|
+
Configuration,
|
|
32
|
+
PortalApi,
|
|
33
|
+
} from '@easyedu/js-lsm-api';
|
|
34
|
+
import type { DeletePortalFaviconRequest } from '@easyedu/js-lsm-api';
|
|
35
|
+
|
|
36
|
+
async function example() {
|
|
37
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
38
|
+
const api = new PortalApi();
|
|
39
|
+
|
|
40
|
+
const body = {
|
|
41
|
+
// string
|
|
42
|
+
portalId: portalId_example,
|
|
43
|
+
} satisfies DeletePortalFaviconRequest;
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
const data = await api.deletePortalFavicon(body);
|
|
47
|
+
console.log(data);
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error(error);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Run the test
|
|
54
|
+
example().catch(console.error);
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Parameters
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
| Name | Type | Description | Notes |
|
|
61
|
+
|------------- | ------------- | ------------- | -------------|
|
|
62
|
+
| **portalId** | `string` | | [Defaults to `undefined`] |
|
|
63
|
+
|
|
64
|
+
### Return type
|
|
65
|
+
|
|
66
|
+
`void` (Empty response body)
|
|
67
|
+
|
|
68
|
+
### Authorization
|
|
69
|
+
|
|
70
|
+
No authorization required
|
|
71
|
+
|
|
72
|
+
### HTTP request headers
|
|
73
|
+
|
|
74
|
+
- **Content-Type**: Not defined
|
|
75
|
+
- **Accept**: Not defined
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### HTTP response details
|
|
79
|
+
| Status code | Description | Response headers |
|
|
80
|
+
|-------------|-------------|------------------|
|
|
81
|
+
| **204** | Favicon removed successfully | - |
|
|
82
|
+
| **404** | Portal not found | - |
|
|
83
|
+
|
|
84
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
85
|
+
|
|
86
|
+
|
|
19
87
|
## deletePortalLogo
|
|
20
88
|
|
|
21
89
|
> deletePortalLogo(portalId)
|
|
@@ -421,6 +489,76 @@ No authorization required
|
|
|
421
489
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
422
490
|
|
|
423
491
|
|
|
492
|
+
## postPortalFaviconUpload
|
|
493
|
+
|
|
494
|
+
> GetPortalFaviconUpload postPortalFaviconUpload(portalId, file)
|
|
495
|
+
|
|
496
|
+
Upload a favicon image for portal branding
|
|
497
|
+
|
|
498
|
+
### Example
|
|
499
|
+
|
|
500
|
+
```ts
|
|
501
|
+
import {
|
|
502
|
+
Configuration,
|
|
503
|
+
PortalApi,
|
|
504
|
+
} from '@easyedu/js-lsm-api';
|
|
505
|
+
import type { PostPortalFaviconUploadRequest } from '@easyedu/js-lsm-api';
|
|
506
|
+
|
|
507
|
+
async function example() {
|
|
508
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
509
|
+
const api = new PortalApi();
|
|
510
|
+
|
|
511
|
+
const body = {
|
|
512
|
+
// string
|
|
513
|
+
portalId: portalId_example,
|
|
514
|
+
// Blob | Favicon image file (PNG, ICO, or SVG). Max 1MB.
|
|
515
|
+
file: BINARY_DATA_HERE,
|
|
516
|
+
} satisfies PostPortalFaviconUploadRequest;
|
|
517
|
+
|
|
518
|
+
try {
|
|
519
|
+
const data = await api.postPortalFaviconUpload(body);
|
|
520
|
+
console.log(data);
|
|
521
|
+
} catch (error) {
|
|
522
|
+
console.error(error);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
// Run the test
|
|
527
|
+
example().catch(console.error);
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
### Parameters
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
| Name | Type | Description | Notes |
|
|
534
|
+
|------------- | ------------- | ------------- | -------------|
|
|
535
|
+
| **portalId** | `string` | | [Defaults to `undefined`] |
|
|
536
|
+
| **file** | `Blob` | Favicon image file (PNG, ICO, or SVG). Max 1MB. | [Defaults to `undefined`] |
|
|
537
|
+
|
|
538
|
+
### Return type
|
|
539
|
+
|
|
540
|
+
[**GetPortalFaviconUpload**](GetPortalFaviconUpload.md)
|
|
541
|
+
|
|
542
|
+
### Authorization
|
|
543
|
+
|
|
544
|
+
No authorization required
|
|
545
|
+
|
|
546
|
+
### HTTP request headers
|
|
547
|
+
|
|
548
|
+
- **Content-Type**: `multipart/form-data`
|
|
549
|
+
- **Accept**: `application/json`
|
|
550
|
+
|
|
551
|
+
|
|
552
|
+
### HTTP response details
|
|
553
|
+
| Status code | Description | Response headers |
|
|
554
|
+
|-------------|-------------|------------------|
|
|
555
|
+
| **200** | Favicon uploaded successfully | - |
|
|
556
|
+
| **400** | Invalid file type or file too large | - |
|
|
557
|
+
| **404** | Portal not found | - |
|
|
558
|
+
|
|
559
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
560
|
+
|
|
561
|
+
|
|
424
562
|
## postPortalLogoUpload
|
|
425
563
|
|
|
426
564
|
> GetPortalLogoUpload postPortalLogoUpload(portalId, file)
|
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/PortalApi.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
GetPortal,
|
|
19
|
+
GetPortalFaviconUpload,
|
|
19
20
|
GetPortalList,
|
|
20
21
|
GetPortalLogoUpload,
|
|
21
22
|
GetPortalUserList,
|
|
@@ -26,6 +27,8 @@ import type {
|
|
|
26
27
|
import {
|
|
27
28
|
GetPortalFromJSON,
|
|
28
29
|
GetPortalToJSON,
|
|
30
|
+
GetPortalFaviconUploadFromJSON,
|
|
31
|
+
GetPortalFaviconUploadToJSON,
|
|
29
32
|
GetPortalListFromJSON,
|
|
30
33
|
GetPortalListToJSON,
|
|
31
34
|
GetPortalLogoUploadFromJSON,
|
|
@@ -40,6 +43,10 @@ import {
|
|
|
40
43
|
PutPortalBrandingToJSON,
|
|
41
44
|
} from '../models/index';
|
|
42
45
|
|
|
46
|
+
export interface DeletePortalFaviconRequest {
|
|
47
|
+
portalId: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
43
50
|
export interface DeletePortalLogoRequest {
|
|
44
51
|
portalId: string;
|
|
45
52
|
}
|
|
@@ -66,6 +73,11 @@ export interface PostPortalRequest {
|
|
|
66
73
|
postPortal: PostPortal;
|
|
67
74
|
}
|
|
68
75
|
|
|
76
|
+
export interface PostPortalFaviconUploadRequest {
|
|
77
|
+
portalId: string;
|
|
78
|
+
file: Blob;
|
|
79
|
+
}
|
|
80
|
+
|
|
69
81
|
export interface PostPortalLogoUploadRequest {
|
|
70
82
|
portalId: string;
|
|
71
83
|
file: Blob;
|
|
@@ -85,6 +97,50 @@ export interface UpdateSelectedPortalRequest {
|
|
|
85
97
|
*/
|
|
86
98
|
export class PortalApi extends runtime.BaseAPI {
|
|
87
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Creates request options for deletePortalFavicon without sending the request
|
|
102
|
+
*/
|
|
103
|
+
async deletePortalFaviconRequestOpts(requestParameters: DeletePortalFaviconRequest): Promise<runtime.RequestOpts> {
|
|
104
|
+
if (requestParameters['portalId'] == null) {
|
|
105
|
+
throw new runtime.RequiredError(
|
|
106
|
+
'portalId',
|
|
107
|
+
'Required parameter "portalId" was null or undefined when calling deletePortalFavicon().'
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const queryParameters: any = {};
|
|
112
|
+
|
|
113
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
let urlPath = `/portals/{portalId}/branding/favicon`;
|
|
117
|
+
urlPath = urlPath.replace(`{${"portalId"}}`, encodeURIComponent(String(requestParameters['portalId'])));
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
path: urlPath,
|
|
121
|
+
method: 'DELETE',
|
|
122
|
+
headers: headerParameters,
|
|
123
|
+
query: queryParameters,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Remove the portal favicon
|
|
129
|
+
*/
|
|
130
|
+
async deletePortalFaviconRaw(requestParameters: DeletePortalFaviconRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
131
|
+
const requestOptions = await this.deletePortalFaviconRequestOpts(requestParameters);
|
|
132
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
133
|
+
|
|
134
|
+
return new runtime.VoidApiResponse(response);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Remove the portal favicon
|
|
139
|
+
*/
|
|
140
|
+
async deletePortalFavicon(requestParameters: DeletePortalFaviconRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
141
|
+
await this.deletePortalFaviconRaw(requestParameters, initOverrides);
|
|
142
|
+
}
|
|
143
|
+
|
|
88
144
|
/**
|
|
89
145
|
* Creates request options for deletePortalLogo without sending the request
|
|
90
146
|
*/
|
|
@@ -377,6 +433,79 @@ export class PortalApi extends runtime.BaseAPI {
|
|
|
377
433
|
return await response.value();
|
|
378
434
|
}
|
|
379
435
|
|
|
436
|
+
/**
|
|
437
|
+
* Creates request options for postPortalFaviconUpload without sending the request
|
|
438
|
+
*/
|
|
439
|
+
async postPortalFaviconUploadRequestOpts(requestParameters: PostPortalFaviconUploadRequest): Promise<runtime.RequestOpts> {
|
|
440
|
+
if (requestParameters['portalId'] == null) {
|
|
441
|
+
throw new runtime.RequiredError(
|
|
442
|
+
'portalId',
|
|
443
|
+
'Required parameter "portalId" was null or undefined when calling postPortalFaviconUpload().'
|
|
444
|
+
);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
if (requestParameters['file'] == null) {
|
|
448
|
+
throw new runtime.RequiredError(
|
|
449
|
+
'file',
|
|
450
|
+
'Required parameter "file" was null or undefined when calling postPortalFaviconUpload().'
|
|
451
|
+
);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
const queryParameters: any = {};
|
|
455
|
+
|
|
456
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
457
|
+
|
|
458
|
+
const consumes: runtime.Consume[] = [
|
|
459
|
+
{ contentType: 'multipart/form-data' },
|
|
460
|
+
];
|
|
461
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
462
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
463
|
+
|
|
464
|
+
let formParams: { append(param: string, value: any): any };
|
|
465
|
+
let useForm = false;
|
|
466
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
467
|
+
useForm = canConsumeForm;
|
|
468
|
+
if (useForm) {
|
|
469
|
+
formParams = new FormData();
|
|
470
|
+
} else {
|
|
471
|
+
formParams = new URLSearchParams();
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
if (requestParameters['file'] != null) {
|
|
475
|
+
formParams.append('file', requestParameters['file'] as any);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
let urlPath = `/portals/{portalId}/branding/favicon`;
|
|
480
|
+
urlPath = urlPath.replace(`{${"portalId"}}`, encodeURIComponent(String(requestParameters['portalId'])));
|
|
481
|
+
|
|
482
|
+
return {
|
|
483
|
+
path: urlPath,
|
|
484
|
+
method: 'POST',
|
|
485
|
+
headers: headerParameters,
|
|
486
|
+
query: queryParameters,
|
|
487
|
+
body: formParams,
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Upload a favicon image for portal branding
|
|
493
|
+
*/
|
|
494
|
+
async postPortalFaviconUploadRaw(requestParameters: PostPortalFaviconUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetPortalFaviconUpload>> {
|
|
495
|
+
const requestOptions = await this.postPortalFaviconUploadRequestOpts(requestParameters);
|
|
496
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
497
|
+
|
|
498
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetPortalFaviconUploadFromJSON(jsonValue));
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Upload a favicon image for portal branding
|
|
503
|
+
*/
|
|
504
|
+
async postPortalFaviconUpload(requestParameters: PostPortalFaviconUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetPortalFaviconUpload> {
|
|
505
|
+
const response = await this.postPortalFaviconUploadRaw(requestParameters, initOverrides);
|
|
506
|
+
return await response.value();
|
|
507
|
+
}
|
|
508
|
+
|
|
380
509
|
/**
|
|
381
510
|
* Creates request options for postPortalLogoUpload without sending the request
|
|
382
511
|
*/
|