@easyedu/js-lsm-api 1.39.0 → 1.41.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 +18 -0
- package/README.md +24 -9
- package/dist/apis/ChatApi.d.ts +95 -0
- package/dist/apis/ChatApi.js +235 -0
- package/dist/apis/PortalApi.d.ts +32 -1
- package/dist/apis/PortalApi.js +99 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/ChatApi.d.ts +95 -0
- package/dist/esm/apis/ChatApi.js +231 -0
- package/dist/esm/apis/PortalApi.d.ts +32 -1
- package/dist/esm/apis/PortalApi.js +100 -1
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/GetChatMessage.d.ts +44 -0
- package/dist/esm/models/GetChatMessage.js +51 -0
- package/dist/esm/models/GetConversation.d.ts +50 -0
- package/dist/esm/models/GetConversation.js +53 -0
- package/dist/esm/models/GetConversationList.d.ts +57 -0
- package/dist/esm/models/GetConversationList.js +60 -0
- package/dist/esm/models/GetPortal.d.ts +1 -1
- package/dist/esm/models/GetPortal.js +1 -3
- package/dist/esm/models/GetPortalLogoUpload.d.ts +32 -0
- package/dist/esm/models/GetPortalLogoUpload.js +43 -0
- package/dist/esm/models/PostConversation.d.ts +32 -0
- package/dist/esm/models/PostConversation.js +43 -0
- package/dist/esm/models/PostConversationResponse.d.ts +44 -0
- package/dist/esm/models/PostConversationResponse.js +51 -0
- package/dist/esm/models/PostMessage.d.ts +32 -0
- package/dist/esm/models/PostMessage.js +43 -0
- package/dist/esm/models/PostMessageResponse.d.ts +38 -0
- package/dist/esm/models/PostMessageResponse.js +47 -0
- package/dist/esm/models/index.d.ts +8 -0
- package/dist/esm/models/index.js +8 -0
- package/dist/models/GetChatMessage.d.ts +44 -0
- package/dist/models/GetChatMessage.js +58 -0
- package/dist/models/GetConversation.d.ts +50 -0
- package/dist/models/GetConversation.js +60 -0
- package/dist/models/GetConversationList.d.ts +57 -0
- package/dist/models/GetConversationList.js +67 -0
- package/dist/models/GetPortal.d.ts +1 -1
- package/dist/models/GetPortal.js +1 -3
- package/dist/models/GetPortalLogoUpload.d.ts +32 -0
- package/dist/models/GetPortalLogoUpload.js +50 -0
- package/dist/models/PostConversation.d.ts +32 -0
- package/dist/models/PostConversation.js +50 -0
- package/dist/models/PostConversationResponse.d.ts +44 -0
- package/dist/models/PostConversationResponse.js +58 -0
- package/dist/models/PostMessage.d.ts +32 -0
- package/dist/models/PostMessage.js +50 -0
- package/dist/models/PostMessageResponse.d.ts +38 -0
- package/dist/models/PostMessageResponse.js +54 -0
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.js +8 -0
- package/docs/ChatApi.md +357 -0
- package/docs/GetChatMessage.md +38 -0
- package/docs/GetConversation.md +40 -0
- package/docs/GetConversationList.md +42 -0
- package/docs/GetPortalLogoUpload.md +34 -0
- package/docs/PortalApi.md +138 -0
- package/docs/PostConversation.md +34 -0
- package/docs/PostConversationResponse.md +38 -0
- package/docs/PostMessage.md +34 -0
- package/docs/PostMessageResponse.md +36 -0
- package/package.json +1 -1
- package/src/apis/ChatApi.ts +303 -0
- package/src/apis/PortalApi.ts +129 -0
- package/src/apis/index.ts +1 -0
- package/src/models/GetChatMessage.ts +84 -0
- package/src/models/GetConversation.ts +92 -0
- package/src/models/GetConversationList.ts +110 -0
- package/src/models/GetPortal.ts +2 -3
- package/src/models/GetPortalLogoUpload.ts +66 -0
- package/src/models/PostConversation.ts +66 -0
- package/src/models/PostConversationResponse.ts +84 -0
- package/src/models/PostMessage.ts +66 -0
- package/src/models/PostMessageResponse.ts +75 -0
- package/src/models/index.ts +8 -0
package/docs/ChatApi.md
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
# ChatApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com/stage1*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**deleteConversation**](ChatApi.md#deleteconversation) | **DELETE** /chat/conversations/{conversationId} | Delete a conversation |
|
|
8
|
+
| [**getConversationMessages**](ChatApi.md#getconversationmessages) | **GET** /chat/conversations/{conversationId}/messages | Get all messages in a conversation |
|
|
9
|
+
| [**getConversations**](ChatApi.md#getconversations) | **GET** /chat/conversations | List conversations for the current user |
|
|
10
|
+
| [**postConversation**](ChatApi.md#postconversation) | **POST** /chat/conversations | Create a new conversation |
|
|
11
|
+
| [**postMessage**](ChatApi.md#postmessage) | **POST** /chat/conversations/{conversationId}/messages | Send a message to a conversation |
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## deleteConversation
|
|
16
|
+
|
|
17
|
+
> deleteConversation(conversationId)
|
|
18
|
+
|
|
19
|
+
Delete a conversation
|
|
20
|
+
|
|
21
|
+
### Example
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import {
|
|
25
|
+
Configuration,
|
|
26
|
+
ChatApi,
|
|
27
|
+
} from '@easyedu/js-lsm-api';
|
|
28
|
+
import type { DeleteConversationRequest } from '@easyedu/js-lsm-api';
|
|
29
|
+
|
|
30
|
+
async function example() {
|
|
31
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
32
|
+
const api = new ChatApi();
|
|
33
|
+
|
|
34
|
+
const body = {
|
|
35
|
+
// string
|
|
36
|
+
conversationId: conversationId_example,
|
|
37
|
+
} satisfies DeleteConversationRequest;
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
const data = await api.deleteConversation(body);
|
|
41
|
+
console.log(data);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.error(error);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Run the test
|
|
48
|
+
example().catch(console.error);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Parameters
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
| Name | Type | Description | Notes |
|
|
55
|
+
|------------- | ------------- | ------------- | -------------|
|
|
56
|
+
| **conversationId** | `string` | | [Defaults to `undefined`] |
|
|
57
|
+
|
|
58
|
+
### Return type
|
|
59
|
+
|
|
60
|
+
`void` (Empty response body)
|
|
61
|
+
|
|
62
|
+
### Authorization
|
|
63
|
+
|
|
64
|
+
No authorization required
|
|
65
|
+
|
|
66
|
+
### HTTP request headers
|
|
67
|
+
|
|
68
|
+
- **Content-Type**: Not defined
|
|
69
|
+
- **Accept**: Not defined
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
### HTTP response details
|
|
73
|
+
| Status code | Description | Response headers |
|
|
74
|
+
|-------------|-------------|------------------|
|
|
75
|
+
| **204** | Conversation deleted | - |
|
|
76
|
+
| **401** | Unauthorized | - |
|
|
77
|
+
| **403** | Forbidden | - |
|
|
78
|
+
| **404** | Conversation not found | - |
|
|
79
|
+
|
|
80
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## getConversationMessages
|
|
84
|
+
|
|
85
|
+
> Array<GetChatMessage> getConversationMessages(conversationId)
|
|
86
|
+
|
|
87
|
+
Get all messages in a conversation
|
|
88
|
+
|
|
89
|
+
### Example
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
import {
|
|
93
|
+
Configuration,
|
|
94
|
+
ChatApi,
|
|
95
|
+
} from '@easyedu/js-lsm-api';
|
|
96
|
+
import type { GetConversationMessagesRequest } from '@easyedu/js-lsm-api';
|
|
97
|
+
|
|
98
|
+
async function example() {
|
|
99
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
100
|
+
const api = new ChatApi();
|
|
101
|
+
|
|
102
|
+
const body = {
|
|
103
|
+
// string
|
|
104
|
+
conversationId: conversationId_example,
|
|
105
|
+
} satisfies GetConversationMessagesRequest;
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
const data = await api.getConversationMessages(body);
|
|
109
|
+
console.log(data);
|
|
110
|
+
} catch (error) {
|
|
111
|
+
console.error(error);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Run the test
|
|
116
|
+
example().catch(console.error);
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Parameters
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
| Name | Type | Description | Notes |
|
|
123
|
+
|------------- | ------------- | ------------- | -------------|
|
|
124
|
+
| **conversationId** | `string` | | [Defaults to `undefined`] |
|
|
125
|
+
|
|
126
|
+
### Return type
|
|
127
|
+
|
|
128
|
+
[**Array<GetChatMessage>**](GetChatMessage.md)
|
|
129
|
+
|
|
130
|
+
### Authorization
|
|
131
|
+
|
|
132
|
+
No authorization required
|
|
133
|
+
|
|
134
|
+
### HTTP request headers
|
|
135
|
+
|
|
136
|
+
- **Content-Type**: Not defined
|
|
137
|
+
- **Accept**: `application/json`
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### HTTP response details
|
|
141
|
+
| Status code | Description | Response headers |
|
|
142
|
+
|-------------|-------------|------------------|
|
|
143
|
+
| **200** | List of messages in the conversation | - |
|
|
144
|
+
| **401** | Unauthorized | - |
|
|
145
|
+
| **403** | Forbidden | - |
|
|
146
|
+
| **404** | Conversation not found | - |
|
|
147
|
+
|
|
148
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
## getConversations
|
|
152
|
+
|
|
153
|
+
> GetConversationList getConversations(page, pageSize)
|
|
154
|
+
|
|
155
|
+
List conversations for the current user
|
|
156
|
+
|
|
157
|
+
### Example
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
import {
|
|
161
|
+
Configuration,
|
|
162
|
+
ChatApi,
|
|
163
|
+
} from '@easyedu/js-lsm-api';
|
|
164
|
+
import type { GetConversationsRequest } from '@easyedu/js-lsm-api';
|
|
165
|
+
|
|
166
|
+
async function example() {
|
|
167
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
168
|
+
const api = new ChatApi();
|
|
169
|
+
|
|
170
|
+
const body = {
|
|
171
|
+
// number | Page number for pagination (optional)
|
|
172
|
+
page: 56,
|
|
173
|
+
// number | Number of items per page (optional)
|
|
174
|
+
pageSize: 56,
|
|
175
|
+
} satisfies GetConversationsRequest;
|
|
176
|
+
|
|
177
|
+
try {
|
|
178
|
+
const data = await api.getConversations(body);
|
|
179
|
+
console.log(data);
|
|
180
|
+
} catch (error) {
|
|
181
|
+
console.error(error);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Run the test
|
|
186
|
+
example().catch(console.error);
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Parameters
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
| Name | Type | Description | Notes |
|
|
193
|
+
|------------- | ------------- | ------------- | -------------|
|
|
194
|
+
| **page** | `number` | Page number for pagination | [Optional] [Defaults to `1`] |
|
|
195
|
+
| **pageSize** | `number` | Number of items per page | [Optional] [Defaults to `20`] |
|
|
196
|
+
|
|
197
|
+
### Return type
|
|
198
|
+
|
|
199
|
+
[**GetConversationList**](GetConversationList.md)
|
|
200
|
+
|
|
201
|
+
### Authorization
|
|
202
|
+
|
|
203
|
+
No authorization required
|
|
204
|
+
|
|
205
|
+
### HTTP request headers
|
|
206
|
+
|
|
207
|
+
- **Content-Type**: Not defined
|
|
208
|
+
- **Accept**: `application/json`
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
### HTTP response details
|
|
212
|
+
| Status code | Description | Response headers |
|
|
213
|
+
|-------------|-------------|------------------|
|
|
214
|
+
| **200** | Paginated list of conversations | - |
|
|
215
|
+
| **401** | Unauthorized | - |
|
|
216
|
+
| **403** | Forbidden | - |
|
|
217
|
+
|
|
218
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
## postConversation
|
|
222
|
+
|
|
223
|
+
> PostConversationResponse postConversation(postConversation)
|
|
224
|
+
|
|
225
|
+
Create a new conversation
|
|
226
|
+
|
|
227
|
+
### Example
|
|
228
|
+
|
|
229
|
+
```ts
|
|
230
|
+
import {
|
|
231
|
+
Configuration,
|
|
232
|
+
ChatApi,
|
|
233
|
+
} from '@easyedu/js-lsm-api';
|
|
234
|
+
import type { PostConversationRequest } from '@easyedu/js-lsm-api';
|
|
235
|
+
|
|
236
|
+
async function example() {
|
|
237
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
238
|
+
const api = new ChatApi();
|
|
239
|
+
|
|
240
|
+
const body = {
|
|
241
|
+
// PostConversation | Initial message to start the conversation
|
|
242
|
+
postConversation: ...,
|
|
243
|
+
} satisfies PostConversationRequest;
|
|
244
|
+
|
|
245
|
+
try {
|
|
246
|
+
const data = await api.postConversation(body);
|
|
247
|
+
console.log(data);
|
|
248
|
+
} catch (error) {
|
|
249
|
+
console.error(error);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Run the test
|
|
254
|
+
example().catch(console.error);
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Parameters
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
| Name | Type | Description | Notes |
|
|
261
|
+
|------------- | ------------- | ------------- | -------------|
|
|
262
|
+
| **postConversation** | [PostConversation](PostConversation.md) | Initial message to start the conversation | |
|
|
263
|
+
|
|
264
|
+
### Return type
|
|
265
|
+
|
|
266
|
+
[**PostConversationResponse**](PostConversationResponse.md)
|
|
267
|
+
|
|
268
|
+
### Authorization
|
|
269
|
+
|
|
270
|
+
No authorization required
|
|
271
|
+
|
|
272
|
+
### HTTP request headers
|
|
273
|
+
|
|
274
|
+
- **Content-Type**: `application/json`
|
|
275
|
+
- **Accept**: `application/json`
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
### HTTP response details
|
|
279
|
+
| Status code | Description | Response headers |
|
|
280
|
+
|-------------|-------------|------------------|
|
|
281
|
+
| **201** | Conversation created with LLM response | - |
|
|
282
|
+
| **401** | Unauthorized | - |
|
|
283
|
+
| **403** | Forbidden | - |
|
|
284
|
+
|
|
285
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
## postMessage
|
|
289
|
+
|
|
290
|
+
> PostMessageResponse postMessage(conversationId, postMessage)
|
|
291
|
+
|
|
292
|
+
Send a message to a conversation
|
|
293
|
+
|
|
294
|
+
### Example
|
|
295
|
+
|
|
296
|
+
```ts
|
|
297
|
+
import {
|
|
298
|
+
Configuration,
|
|
299
|
+
ChatApi,
|
|
300
|
+
} from '@easyedu/js-lsm-api';
|
|
301
|
+
import type { PostMessageRequest } from '@easyedu/js-lsm-api';
|
|
302
|
+
|
|
303
|
+
async function example() {
|
|
304
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
305
|
+
const api = new ChatApi();
|
|
306
|
+
|
|
307
|
+
const body = {
|
|
308
|
+
// string
|
|
309
|
+
conversationId: conversationId_example,
|
|
310
|
+
// PostMessage | Message to send
|
|
311
|
+
postMessage: ...,
|
|
312
|
+
} satisfies PostMessageRequest;
|
|
313
|
+
|
|
314
|
+
try {
|
|
315
|
+
const data = await api.postMessage(body);
|
|
316
|
+
console.log(data);
|
|
317
|
+
} catch (error) {
|
|
318
|
+
console.error(error);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// Run the test
|
|
323
|
+
example().catch(console.error);
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
### Parameters
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
| Name | Type | Description | Notes |
|
|
330
|
+
|------------- | ------------- | ------------- | -------------|
|
|
331
|
+
| **conversationId** | `string` | | [Defaults to `undefined`] |
|
|
332
|
+
| **postMessage** | [PostMessage](PostMessage.md) | Message to send | |
|
|
333
|
+
|
|
334
|
+
### Return type
|
|
335
|
+
|
|
336
|
+
[**PostMessageResponse**](PostMessageResponse.md)
|
|
337
|
+
|
|
338
|
+
### Authorization
|
|
339
|
+
|
|
340
|
+
No authorization required
|
|
341
|
+
|
|
342
|
+
### HTTP request headers
|
|
343
|
+
|
|
344
|
+
- **Content-Type**: `application/json`
|
|
345
|
+
- **Accept**: `application/json`
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
### HTTP response details
|
|
349
|
+
| Status code | Description | Response headers |
|
|
350
|
+
|-------------|-------------|------------------|
|
|
351
|
+
| **200** | LLM response to the message | - |
|
|
352
|
+
| **401** | Unauthorized | - |
|
|
353
|
+
| **403** | Forbidden | - |
|
|
354
|
+
| **404** | Conversation not found | - |
|
|
355
|
+
|
|
356
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
357
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
|
|
2
|
+
# GetChatMessage
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`role` | string
|
|
10
|
+
`content` | string
|
|
11
|
+
`createdAt` | number
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import type { GetChatMessage } from '@easyedu/js-lsm-api'
|
|
17
|
+
|
|
18
|
+
// TODO: Update the object below with actual values
|
|
19
|
+
const example = {
|
|
20
|
+
"role": null,
|
|
21
|
+
"content": null,
|
|
22
|
+
"createdAt": null,
|
|
23
|
+
} satisfies GetChatMessage
|
|
24
|
+
|
|
25
|
+
console.log(example)
|
|
26
|
+
|
|
27
|
+
// Convert the instance to a JSON string
|
|
28
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
29
|
+
console.log(exampleJSON)
|
|
30
|
+
|
|
31
|
+
// Parse the JSON string back to an object
|
|
32
|
+
const exampleParsed = JSON.parse(exampleJSON) as GetChatMessage
|
|
33
|
+
console.log(exampleParsed)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
# GetConversation
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`id` | string
|
|
10
|
+
`title` | string
|
|
11
|
+
`createdAt` | number
|
|
12
|
+
`updatedAt` | number
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { GetConversation } from '@easyedu/js-lsm-api'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"id": null,
|
|
22
|
+
"title": null,
|
|
23
|
+
"createdAt": null,
|
|
24
|
+
"updatedAt": null,
|
|
25
|
+
} satisfies GetConversation
|
|
26
|
+
|
|
27
|
+
console.log(example)
|
|
28
|
+
|
|
29
|
+
// Convert the instance to a JSON string
|
|
30
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
31
|
+
console.log(exampleJSON)
|
|
32
|
+
|
|
33
|
+
// Parse the JSON string back to an object
|
|
34
|
+
const exampleParsed = JSON.parse(exampleJSON) as GetConversation
|
|
35
|
+
console.log(exampleParsed)
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
39
|
+
|
|
40
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
|
|
2
|
+
# GetConversationList
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`page` | number
|
|
10
|
+
`pageSize` | number
|
|
11
|
+
`totalPages` | number
|
|
12
|
+
`totalItems` | number
|
|
13
|
+
`items` | [Array<GetConversation>](GetConversation.md)
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import type { GetConversationList } from '@easyedu/js-lsm-api'
|
|
19
|
+
|
|
20
|
+
// TODO: Update the object below with actual values
|
|
21
|
+
const example = {
|
|
22
|
+
"page": null,
|
|
23
|
+
"pageSize": null,
|
|
24
|
+
"totalPages": null,
|
|
25
|
+
"totalItems": null,
|
|
26
|
+
"items": null,
|
|
27
|
+
} satisfies GetConversationList
|
|
28
|
+
|
|
29
|
+
console.log(example)
|
|
30
|
+
|
|
31
|
+
// Convert the instance to a JSON string
|
|
32
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
33
|
+
console.log(exampleJSON)
|
|
34
|
+
|
|
35
|
+
// Parse the JSON string back to an object
|
|
36
|
+
const exampleParsed = JSON.parse(exampleJSON) as GetConversationList
|
|
37
|
+
console.log(exampleParsed)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
41
|
+
|
|
42
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# GetPortalLogoUpload
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`logoUrl` | string
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { GetPortalLogoUpload } from '@easyedu/js-lsm-api'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"logoUrl": null,
|
|
19
|
+
} satisfies GetPortalLogoUpload
|
|
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 GetPortalLogoUpload
|
|
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,16 +4,84 @@ 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
|
+
| [**deletePortalLogo**](PortalApi.md#deleteportallogo) | **DELETE** /portals/{portalId}/branding/logo | Remove the portal logo |
|
|
7
8
|
| [**getPortalById**](PortalApi.md#getportalbyid) | **GET** /portals/{portalId} | Get a portal by id (can use \'current\' to get the current users selected portal) |
|
|
8
9
|
| [**getPortalList**](PortalApi.md#getportallist) | **GET** /portals | Get all portals a user has access to |
|
|
9
10
|
| [**getPortalUsers**](PortalApi.md#getportalusers) | **GET** /portals/{portalId}/users | Get all users for a portal with optional role filtering |
|
|
10
11
|
| [**inviteUserToPortal**](PortalApi.md#inviteusertoportal) | **POST** /portals/{portalId}/invite | Invite a new user to a portal |
|
|
11
12
|
| [**postPortal**](PortalApi.md#postportal) | **POST** /portals | Create a new portal as a child of the current selected portal |
|
|
13
|
+
| [**postPortalLogoUpload**](PortalApi.md#postportallogoupload) | **POST** /portals/{portalId}/branding/logo | Upload a logo image for portal branding |
|
|
12
14
|
| [**putPortalBranding**](PortalApi.md#putportalbranding) | **PUT** /portals/{portalId} | Update portal branding (name, background color, text color) |
|
|
13
15
|
| [**updateSelectedPortal**](PortalApi.md#updateselectedportal) | **PUT** /portals/{portalId}/selected | Update the users current selected portal. Returns new JWT with updated roles. |
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
|
|
19
|
+
## deletePortalLogo
|
|
20
|
+
|
|
21
|
+
> deletePortalLogo(portalId)
|
|
22
|
+
|
|
23
|
+
Remove the portal logo
|
|
24
|
+
|
|
25
|
+
### Example
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import {
|
|
29
|
+
Configuration,
|
|
30
|
+
PortalApi,
|
|
31
|
+
} from '@easyedu/js-lsm-api';
|
|
32
|
+
import type { DeletePortalLogoRequest } from '@easyedu/js-lsm-api';
|
|
33
|
+
|
|
34
|
+
async function example() {
|
|
35
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
36
|
+
const api = new PortalApi();
|
|
37
|
+
|
|
38
|
+
const body = {
|
|
39
|
+
// string
|
|
40
|
+
portalId: portalId_example,
|
|
41
|
+
} satisfies DeletePortalLogoRequest;
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
const data = await api.deletePortalLogo(body);
|
|
45
|
+
console.log(data);
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error(error);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Run the test
|
|
52
|
+
example().catch(console.error);
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Parameters
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
| Name | Type | Description | Notes |
|
|
59
|
+
|------------- | ------------- | ------------- | -------------|
|
|
60
|
+
| **portalId** | `string` | | [Defaults to `undefined`] |
|
|
61
|
+
|
|
62
|
+
### Return type
|
|
63
|
+
|
|
64
|
+
`void` (Empty response body)
|
|
65
|
+
|
|
66
|
+
### Authorization
|
|
67
|
+
|
|
68
|
+
No authorization required
|
|
69
|
+
|
|
70
|
+
### HTTP request headers
|
|
71
|
+
|
|
72
|
+
- **Content-Type**: Not defined
|
|
73
|
+
- **Accept**: Not defined
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### HTTP response details
|
|
77
|
+
| Status code | Description | Response headers |
|
|
78
|
+
|-------------|-------------|------------------|
|
|
79
|
+
| **204** | Logo removed successfully | - |
|
|
80
|
+
| **404** | Portal not found | - |
|
|
81
|
+
|
|
82
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
83
|
+
|
|
84
|
+
|
|
17
85
|
## getPortalById
|
|
18
86
|
|
|
19
87
|
> GetPortal getPortalById(portalId)
|
|
@@ -353,6 +421,76 @@ No authorization required
|
|
|
353
421
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
354
422
|
|
|
355
423
|
|
|
424
|
+
## postPortalLogoUpload
|
|
425
|
+
|
|
426
|
+
> GetPortalLogoUpload postPortalLogoUpload(portalId, file)
|
|
427
|
+
|
|
428
|
+
Upload a logo image for portal branding
|
|
429
|
+
|
|
430
|
+
### Example
|
|
431
|
+
|
|
432
|
+
```ts
|
|
433
|
+
import {
|
|
434
|
+
Configuration,
|
|
435
|
+
PortalApi,
|
|
436
|
+
} from '@easyedu/js-lsm-api';
|
|
437
|
+
import type { PostPortalLogoUploadRequest } from '@easyedu/js-lsm-api';
|
|
438
|
+
|
|
439
|
+
async function example() {
|
|
440
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
441
|
+
const api = new PortalApi();
|
|
442
|
+
|
|
443
|
+
const body = {
|
|
444
|
+
// string
|
|
445
|
+
portalId: portalId_example,
|
|
446
|
+
// Blob | Logo image file (PNG, JPEG, or SVG). Max 5MB.
|
|
447
|
+
file: BINARY_DATA_HERE,
|
|
448
|
+
} satisfies PostPortalLogoUploadRequest;
|
|
449
|
+
|
|
450
|
+
try {
|
|
451
|
+
const data = await api.postPortalLogoUpload(body);
|
|
452
|
+
console.log(data);
|
|
453
|
+
} catch (error) {
|
|
454
|
+
console.error(error);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
// Run the test
|
|
459
|
+
example().catch(console.error);
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### Parameters
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
| Name | Type | Description | Notes |
|
|
466
|
+
|------------- | ------------- | ------------- | -------------|
|
|
467
|
+
| **portalId** | `string` | | [Defaults to `undefined`] |
|
|
468
|
+
| **file** | `Blob` | Logo image file (PNG, JPEG, or SVG). Max 5MB. | [Defaults to `undefined`] |
|
|
469
|
+
|
|
470
|
+
### Return type
|
|
471
|
+
|
|
472
|
+
[**GetPortalLogoUpload**](GetPortalLogoUpload.md)
|
|
473
|
+
|
|
474
|
+
### Authorization
|
|
475
|
+
|
|
476
|
+
No authorization required
|
|
477
|
+
|
|
478
|
+
### HTTP request headers
|
|
479
|
+
|
|
480
|
+
- **Content-Type**: `multipart/form-data`
|
|
481
|
+
- **Accept**: `application/json`
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
### HTTP response details
|
|
485
|
+
| Status code | Description | Response headers |
|
|
486
|
+
|-------------|-------------|------------------|
|
|
487
|
+
| **200** | Logo uploaded successfully | - |
|
|
488
|
+
| **400** | Invalid file type or file too large | - |
|
|
489
|
+
| **404** | Portal not found | - |
|
|
490
|
+
|
|
491
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
492
|
+
|
|
493
|
+
|
|
356
494
|
## putPortalBranding
|
|
357
495
|
|
|
358
496
|
> GetPortal putPortalBranding(portalId, putPortalBranding)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# PostConversation
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`message` | string
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { PostConversation } from '@easyedu/js-lsm-api'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"message": null,
|
|
19
|
+
} satisfies PostConversation
|
|
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 PostConversation
|
|
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
|
+
|