@easyedu/js-lsm-api 1.34.0 → 1.35.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/README.md +3 -2
- package/dist/apis/UserApi.d.ts +14 -0
- package/dist/apis/UserApi.js +37 -0
- package/dist/esm/apis/UserApi.d.ts +14 -0
- package/dist/esm/apis/UserApi.js +37 -0
- package/docs/UserApi.md +61 -0
- package/package.json +1 -1
- package/src/apis/UserApi.ts +39 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @easyedu/js-lsm-api@1.
|
|
1
|
+
# @easyedu/js-lsm-api@1.35.0
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the sbzw93t49b.execute-api.us-east-2.amazonaws.com API.
|
|
4
4
|
|
|
@@ -146,6 +146,7 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
146
146
|
*RoleApi* | [**updateRole**](docs/RoleApi.md#updaterole) | **PUT** /roles/{roleId} | Update a custom role name and description
|
|
147
147
|
*RoleApi* | [**updateRolePermissions**](docs/RoleApi.md#updaterolepermissions) | **PUT** /roles/{roleId}/permissions | Replace all permissions for a custom role
|
|
148
148
|
*UserApi* | [**getAuthCheck**](docs/UserApi.md#getauthcheck) | **GET** /auth/check | Check if a user is logged in
|
|
149
|
+
*UserApi* | [**getCurrentUserPermissions**](docs/UserApi.md#getcurrentuserpermissions) | **GET** /users/current/permissions | Get the current user\'s permissions
|
|
149
150
|
*UserApi* | [**getUser**](docs/UserApi.md#getuser) | **GET** /users/{userId} | Get a user by id
|
|
150
151
|
*UserApi* | [**postLogin**](docs/UserApi.md#postlogin) | **POST** /auth/login | Post a new login
|
|
151
152
|
*UserApi* | [**postLogout**](docs/UserApi.md#postlogout) | **POST** /auth/logout | Logout a user
|
|
@@ -369,7 +370,7 @@ and is automatically generated by the
|
|
|
369
370
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
370
371
|
|
|
371
372
|
- API version: `1.0.0`
|
|
372
|
-
- Package version: `1.
|
|
373
|
+
- Package version: `1.35.0`
|
|
373
374
|
- Generator version: `7.21.0`
|
|
374
375
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
375
376
|
|
package/dist/apis/UserApi.d.ts
CHANGED
|
@@ -43,6 +43,20 @@ export declare class UserApi extends runtime.BaseAPI {
|
|
|
43
43
|
* Check if a user is logged in
|
|
44
44
|
*/
|
|
45
45
|
getAuthCheck(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Creates request options for getCurrentUserPermissions without sending the request
|
|
48
|
+
*/
|
|
49
|
+
getCurrentUserPermissionsRequestOpts(): Promise<runtime.RequestOpts>;
|
|
50
|
+
/**
|
|
51
|
+
* Returns an array of permission key strings for the authenticated user\'s current portal
|
|
52
|
+
* Get the current user\'s permissions
|
|
53
|
+
*/
|
|
54
|
+
getCurrentUserPermissionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<string>>>;
|
|
55
|
+
/**
|
|
56
|
+
* Returns an array of permission key strings for the authenticated user\'s current portal
|
|
57
|
+
* Get the current user\'s permissions
|
|
58
|
+
*/
|
|
59
|
+
getCurrentUserPermissions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<string>>;
|
|
46
60
|
/**
|
|
47
61
|
* Creates request options for getUser without sending the request
|
|
48
62
|
*/
|
package/dist/apis/UserApi.js
CHANGED
|
@@ -63,6 +63,43 @@ class UserApi extends runtime.BaseAPI {
|
|
|
63
63
|
yield this.getAuthCheckRaw(initOverrides);
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Creates request options for getCurrentUserPermissions without sending the request
|
|
68
|
+
*/
|
|
69
|
+
getCurrentUserPermissionsRequestOpts() {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const queryParameters = {};
|
|
72
|
+
const headerParameters = {};
|
|
73
|
+
let urlPath = `/users/current/permissions`;
|
|
74
|
+
return {
|
|
75
|
+
path: urlPath,
|
|
76
|
+
method: 'GET',
|
|
77
|
+
headers: headerParameters,
|
|
78
|
+
query: queryParameters,
|
|
79
|
+
};
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Returns an array of permission key strings for the authenticated user\'s current portal
|
|
84
|
+
* Get the current user\'s permissions
|
|
85
|
+
*/
|
|
86
|
+
getCurrentUserPermissionsRaw(initOverrides) {
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
const requestOptions = yield this.getCurrentUserPermissionsRequestOpts();
|
|
89
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
90
|
+
return new runtime.JSONApiResponse(response);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Returns an array of permission key strings for the authenticated user\'s current portal
|
|
95
|
+
* Get the current user\'s permissions
|
|
96
|
+
*/
|
|
97
|
+
getCurrentUserPermissions(initOverrides) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
const response = yield this.getCurrentUserPermissionsRaw(initOverrides);
|
|
100
|
+
return yield response.value();
|
|
101
|
+
});
|
|
102
|
+
}
|
|
66
103
|
/**
|
|
67
104
|
* Creates request options for getUser without sending the request
|
|
68
105
|
*/
|
|
@@ -43,6 +43,20 @@ export declare class UserApi extends runtime.BaseAPI {
|
|
|
43
43
|
* Check if a user is logged in
|
|
44
44
|
*/
|
|
45
45
|
getAuthCheck(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
46
|
+
/**
|
|
47
|
+
* Creates request options for getCurrentUserPermissions without sending the request
|
|
48
|
+
*/
|
|
49
|
+
getCurrentUserPermissionsRequestOpts(): Promise<runtime.RequestOpts>;
|
|
50
|
+
/**
|
|
51
|
+
* Returns an array of permission key strings for the authenticated user\'s current portal
|
|
52
|
+
* Get the current user\'s permissions
|
|
53
|
+
*/
|
|
54
|
+
getCurrentUserPermissionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<string>>>;
|
|
55
|
+
/**
|
|
56
|
+
* Returns an array of permission key strings for the authenticated user\'s current portal
|
|
57
|
+
* Get the current user\'s permissions
|
|
58
|
+
*/
|
|
59
|
+
getCurrentUserPermissions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<string>>;
|
|
46
60
|
/**
|
|
47
61
|
* Creates request options for getUser without sending the request
|
|
48
62
|
*/
|
package/dist/esm/apis/UserApi.js
CHANGED
|
@@ -60,6 +60,43 @@ export class UserApi extends runtime.BaseAPI {
|
|
|
60
60
|
yield this.getAuthCheckRaw(initOverrides);
|
|
61
61
|
});
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Creates request options for getCurrentUserPermissions without sending the request
|
|
65
|
+
*/
|
|
66
|
+
getCurrentUserPermissionsRequestOpts() {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
const queryParameters = {};
|
|
69
|
+
const headerParameters = {};
|
|
70
|
+
let urlPath = `/users/current/permissions`;
|
|
71
|
+
return {
|
|
72
|
+
path: urlPath,
|
|
73
|
+
method: 'GET',
|
|
74
|
+
headers: headerParameters,
|
|
75
|
+
query: queryParameters,
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Returns an array of permission key strings for the authenticated user\'s current portal
|
|
81
|
+
* Get the current user\'s permissions
|
|
82
|
+
*/
|
|
83
|
+
getCurrentUserPermissionsRaw(initOverrides) {
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const requestOptions = yield this.getCurrentUserPermissionsRequestOpts();
|
|
86
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
87
|
+
return new runtime.JSONApiResponse(response);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns an array of permission key strings for the authenticated user\'s current portal
|
|
92
|
+
* Get the current user\'s permissions
|
|
93
|
+
*/
|
|
94
|
+
getCurrentUserPermissions(initOverrides) {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
+
const response = yield this.getCurrentUserPermissionsRaw(initOverrides);
|
|
97
|
+
return yield response.value();
|
|
98
|
+
});
|
|
99
|
+
}
|
|
63
100
|
/**
|
|
64
101
|
* Creates request options for getUser without sending the request
|
|
65
102
|
*/
|
package/docs/UserApi.md
CHANGED
|
@@ -5,6 +5,7 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
7
|
| [**getAuthCheck**](UserApi.md#getauthcheck) | **GET** /auth/check | Check if a user is logged in |
|
|
8
|
+
| [**getCurrentUserPermissions**](UserApi.md#getcurrentuserpermissions) | **GET** /users/current/permissions | Get the current user\'s permissions |
|
|
8
9
|
| [**getUser**](UserApi.md#getuser) | **GET** /users/{userId} | Get a user by id |
|
|
9
10
|
| [**postLogin**](UserApi.md#postlogin) | **POST** /auth/login | Post a new login |
|
|
10
11
|
| [**postLogout**](UserApi.md#postlogout) | **POST** /auth/logout | Logout a user |
|
|
@@ -72,6 +73,66 @@ No authorization required
|
|
|
72
73
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
73
74
|
|
|
74
75
|
|
|
76
|
+
## getCurrentUserPermissions
|
|
77
|
+
|
|
78
|
+
> Array<string> getCurrentUserPermissions()
|
|
79
|
+
|
|
80
|
+
Get the current user\'s permissions
|
|
81
|
+
|
|
82
|
+
Returns an array of permission key strings for the authenticated user\'s current portal
|
|
83
|
+
|
|
84
|
+
### Example
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
import {
|
|
88
|
+
Configuration,
|
|
89
|
+
UserApi,
|
|
90
|
+
} from '@easyedu/js-lsm-api';
|
|
91
|
+
import type { GetCurrentUserPermissionsRequest } from '@easyedu/js-lsm-api';
|
|
92
|
+
|
|
93
|
+
async function example() {
|
|
94
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
95
|
+
const api = new UserApi();
|
|
96
|
+
|
|
97
|
+
try {
|
|
98
|
+
const data = await api.getCurrentUserPermissions();
|
|
99
|
+
console.log(data);
|
|
100
|
+
} catch (error) {
|
|
101
|
+
console.error(error);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Run the test
|
|
106
|
+
example().catch(console.error);
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Parameters
|
|
110
|
+
|
|
111
|
+
This endpoint does not need any parameter.
|
|
112
|
+
|
|
113
|
+
### Return type
|
|
114
|
+
|
|
115
|
+
**Array<string>**
|
|
116
|
+
|
|
117
|
+
### Authorization
|
|
118
|
+
|
|
119
|
+
No authorization required
|
|
120
|
+
|
|
121
|
+
### HTTP request headers
|
|
122
|
+
|
|
123
|
+
- **Content-Type**: Not defined
|
|
124
|
+
- **Accept**: `application/json`
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### HTTP response details
|
|
128
|
+
| Status code | Description | Response headers |
|
|
129
|
+
|-------------|-------------|------------------|
|
|
130
|
+
| **200** | List of permission keys | - |
|
|
131
|
+
| **401** | Unauthorized | - |
|
|
132
|
+
|
|
133
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
134
|
+
|
|
135
|
+
|
|
75
136
|
## getUser
|
|
76
137
|
|
|
77
138
|
> GetUser getUser(userId)
|
package/package.json
CHANGED
package/src/apis/UserApi.ts
CHANGED
|
@@ -99,6 +99,45 @@ export class UserApi extends runtime.BaseAPI {
|
|
|
99
99
|
await this.getAuthCheckRaw(initOverrides);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Creates request options for getCurrentUserPermissions without sending the request
|
|
104
|
+
*/
|
|
105
|
+
async getCurrentUserPermissionsRequestOpts(): Promise<runtime.RequestOpts> {
|
|
106
|
+
const queryParameters: any = {};
|
|
107
|
+
|
|
108
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
let urlPath = `/users/current/permissions`;
|
|
112
|
+
|
|
113
|
+
return {
|
|
114
|
+
path: urlPath,
|
|
115
|
+
method: 'GET',
|
|
116
|
+
headers: headerParameters,
|
|
117
|
+
query: queryParameters,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Returns an array of permission key strings for the authenticated user\'s current portal
|
|
123
|
+
* Get the current user\'s permissions
|
|
124
|
+
*/
|
|
125
|
+
async getCurrentUserPermissionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<string>>> {
|
|
126
|
+
const requestOptions = await this.getCurrentUserPermissionsRequestOpts();
|
|
127
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
128
|
+
|
|
129
|
+
return new runtime.JSONApiResponse<any>(response);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Returns an array of permission key strings for the authenticated user\'s current portal
|
|
134
|
+
* Get the current user\'s permissions
|
|
135
|
+
*/
|
|
136
|
+
async getCurrentUserPermissions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<string>> {
|
|
137
|
+
const response = await this.getCurrentUserPermissionsRaw(initOverrides);
|
|
138
|
+
return await response.value();
|
|
139
|
+
}
|
|
140
|
+
|
|
102
141
|
/**
|
|
103
142
|
* Creates request options for getUser without sending the request
|
|
104
143
|
*/
|