@easyedu/js-lsm-api 1.80.0 → 1.82.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 +14 -0
- package/README.md +12 -2
- package/dist/apis/RichTextApi.d.ts +83 -0
- package/dist/apis/RichTextApi.js +201 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/RichTextApi.d.ts +83 -0
- package/dist/esm/apis/RichTextApi.js +197 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/GetQuestion.d.ts +7 -6
- package/dist/esm/models/GetQuestion.js +5 -4
- package/dist/esm/models/GetQuestionAnswerChoicesInner.d.ts +3 -2
- package/dist/esm/models/GetQuestionAnswerChoicesInner.js +3 -2
- package/dist/esm/models/GetRichTextAssetUpload.d.ts +50 -0
- package/dist/esm/models/GetRichTextAssetUpload.js +55 -0
- package/dist/esm/models/PostQuestion.d.ts +7 -6
- package/dist/esm/models/PostQuestion.js +5 -4
- package/dist/esm/models/PostQuestionAnswerChoicesInner.d.ts +3 -2
- package/dist/esm/models/PostQuestionAnswerChoicesInner.js +3 -2
- package/dist/esm/models/PostRichTextAssetComplete.d.ts +44 -0
- package/dist/esm/models/PostRichTextAssetComplete.js +47 -0
- package/dist/esm/models/PostRichTextAssetUpload.d.ts +69 -0
- package/dist/esm/models/PostRichTextAssetUpload.js +65 -0
- package/dist/esm/models/PutQuestion.d.ts +7 -6
- package/dist/esm/models/PutQuestion.js +5 -4
- package/dist/esm/models/PutQuestionAnswerChoicesInner.d.ts +3 -2
- package/dist/esm/models/PutQuestionAnswerChoicesInner.js +3 -2
- package/dist/esm/models/RichTextAsset.d.ts +62 -0
- package/dist/esm/models/RichTextAsset.js +59 -0
- package/dist/esm/models/RichTextDocument.d.ts +60 -0
- package/dist/esm/models/RichTextDocument.js +62 -0
- package/dist/esm/models/RichTextInput.d.ts +47 -0
- package/dist/esm/models/RichTextInput.js +53 -0
- package/dist/esm/models/index.d.ts +6 -0
- package/dist/esm/models/index.js +6 -0
- package/dist/models/GetQuestion.d.ts +7 -6
- package/dist/models/GetQuestion.js +5 -4
- package/dist/models/GetQuestionAnswerChoicesInner.d.ts +3 -2
- package/dist/models/GetQuestionAnswerChoicesInner.js +3 -2
- package/dist/models/GetRichTextAssetUpload.d.ts +50 -0
- package/dist/models/GetRichTextAssetUpload.js +62 -0
- package/dist/models/PostQuestion.d.ts +7 -6
- package/dist/models/PostQuestion.js +5 -4
- package/dist/models/PostQuestionAnswerChoicesInner.d.ts +3 -2
- package/dist/models/PostQuestionAnswerChoicesInner.js +3 -2
- package/dist/models/PostRichTextAssetComplete.d.ts +44 -0
- package/dist/models/PostRichTextAssetComplete.js +54 -0
- package/dist/models/PostRichTextAssetUpload.d.ts +69 -0
- package/dist/models/PostRichTextAssetUpload.js +73 -0
- package/dist/models/PutQuestion.d.ts +7 -6
- package/dist/models/PutQuestion.js +5 -4
- package/dist/models/PutQuestionAnswerChoicesInner.d.ts +3 -2
- package/dist/models/PutQuestionAnswerChoicesInner.js +3 -2
- package/dist/models/RichTextAsset.d.ts +62 -0
- package/dist/models/RichTextAsset.js +66 -0
- package/dist/models/RichTextDocument.d.ts +60 -0
- package/dist/models/RichTextDocument.js +70 -0
- package/dist/models/RichTextInput.d.ts +47 -0
- package/dist/models/RichTextInput.js +61 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +6 -0
- package/docs/GetQuestion.md +2 -2
- package/docs/GetQuestionAnswerChoicesInner.md +1 -1
- package/docs/GetRichTextAssetUpload.md +40 -0
- package/docs/PostQuestion.md +2 -2
- package/docs/PostQuestionAnswerChoicesInner.md +1 -1
- package/docs/PostRichTextAssetComplete.md +38 -0
- package/docs/PostRichTextAssetUpload.md +44 -0
- package/docs/PutQuestion.md +2 -2
- package/docs/PutQuestionAnswerChoicesInner.md +1 -1
- package/docs/RichTextApi.md +285 -0
- package/docs/RichTextAsset.md +44 -0
- package/docs/RichTextDocument.md +40 -0
- package/docs/RichTextInput.md +36 -0
- package/package.json +1 -1
- package/src/apis/RichTextApi.ts +260 -0
- package/src/apis/index.ts +1 -0
- package/src/models/GetQuestion.ts +17 -10
- package/src/models/GetQuestionAnswerChoicesInner.ts +12 -4
- package/src/models/GetRichTextAssetUpload.ts +93 -0
- package/src/models/PostQuestion.ts +17 -10
- package/src/models/PostQuestionAnswerChoicesInner.ts +12 -4
- package/src/models/PostRichTextAssetComplete.ts +82 -0
- package/src/models/PostRichTextAssetUpload.ts +119 -0
- package/src/models/PutQuestion.ts +17 -10
- package/src/models/PutQuestionAnswerChoicesInner.ts +12 -4
- package/src/models/RichTextAsset.ts +109 -0
- package/src/models/RichTextDocument.ts +111 -0
- package/src/models/RichTextInput.ts +85 -0
- package/src/models/index.ts +6 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
# RichTextApi
|
|
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
|
+
| [**getRichTextAsset**](RichTextApi.md#getrichtextasset) | **GET** /rich-text/assets/{assetId} | Redirect to a signed rich text asset URL |
|
|
8
|
+
| [**postRichTextAssetComplete**](RichTextApi.md#postrichtextassetcomplete) | **POST** /rich-text/assets/{assetId}/complete | Complete a pending rich text asset upload |
|
|
9
|
+
| [**postRichTextAssetUpload**](RichTextApi.md#postrichtextassetupload) | **POST** /rich-text/assets/uploads | Create a pending rich text asset upload |
|
|
10
|
+
| [**putRichTextAssetFile**](RichTextApi.md#putrichtextassetfile) | **PUT** /rich-text/assets/{assetId}/file | Upload a pending rich text asset file through the API |
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## getRichTextAsset
|
|
15
|
+
|
|
16
|
+
> getRichTextAsset(assetId)
|
|
17
|
+
|
|
18
|
+
Redirect to a signed rich text asset URL
|
|
19
|
+
|
|
20
|
+
### Example
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import {
|
|
24
|
+
Configuration,
|
|
25
|
+
RichTextApi,
|
|
26
|
+
} from '@easyedu/js-lsm-api';
|
|
27
|
+
import type { GetRichTextAssetRequest } from '@easyedu/js-lsm-api';
|
|
28
|
+
|
|
29
|
+
async function example() {
|
|
30
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
31
|
+
const api = new RichTextApi();
|
|
32
|
+
|
|
33
|
+
const body = {
|
|
34
|
+
// string
|
|
35
|
+
assetId: assetId_example,
|
|
36
|
+
} satisfies GetRichTextAssetRequest;
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
const data = await api.getRichTextAsset(body);
|
|
40
|
+
console.log(data);
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.error(error);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Run the test
|
|
47
|
+
example().catch(console.error);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Parameters
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
| Name | Type | Description | Notes |
|
|
54
|
+
|------------- | ------------- | ------------- | -------------|
|
|
55
|
+
| **assetId** | `string` | | [Defaults to `undefined`] |
|
|
56
|
+
|
|
57
|
+
### Return type
|
|
58
|
+
|
|
59
|
+
`void` (Empty response body)
|
|
60
|
+
|
|
61
|
+
### Authorization
|
|
62
|
+
|
|
63
|
+
No authorization required
|
|
64
|
+
|
|
65
|
+
### HTTP request headers
|
|
66
|
+
|
|
67
|
+
- **Content-Type**: Not defined
|
|
68
|
+
- **Accept**: Not defined
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### HTTP response details
|
|
72
|
+
| Status code | Description | Response headers |
|
|
73
|
+
|-------------|-------------|------------------|
|
|
74
|
+
| **302** | redirect to signed asset URL | - |
|
|
75
|
+
| **404** | rich text asset not found | - |
|
|
76
|
+
|
|
77
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
## postRichTextAssetComplete
|
|
81
|
+
|
|
82
|
+
> RichTextAsset postRichTextAssetComplete(assetId, postRichTextAssetComplete)
|
|
83
|
+
|
|
84
|
+
Complete a pending rich text asset upload
|
|
85
|
+
|
|
86
|
+
### Example
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import {
|
|
90
|
+
Configuration,
|
|
91
|
+
RichTextApi,
|
|
92
|
+
} from '@easyedu/js-lsm-api';
|
|
93
|
+
import type { PostRichTextAssetCompleteRequest } from '@easyedu/js-lsm-api';
|
|
94
|
+
|
|
95
|
+
async function example() {
|
|
96
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
97
|
+
const api = new RichTextApi();
|
|
98
|
+
|
|
99
|
+
const body = {
|
|
100
|
+
// string
|
|
101
|
+
assetId: assetId_example,
|
|
102
|
+
// PostRichTextAssetComplete
|
|
103
|
+
postRichTextAssetComplete: ...,
|
|
104
|
+
} satisfies PostRichTextAssetCompleteRequest;
|
|
105
|
+
|
|
106
|
+
try {
|
|
107
|
+
const data = await api.postRichTextAssetComplete(body);
|
|
108
|
+
console.log(data);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
console.error(error);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Run the test
|
|
115
|
+
example().catch(console.error);
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Parameters
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
| Name | Type | Description | Notes |
|
|
122
|
+
|------------- | ------------- | ------------- | -------------|
|
|
123
|
+
| **assetId** | `string` | | [Defaults to `undefined`] |
|
|
124
|
+
| **postRichTextAssetComplete** | [PostRichTextAssetComplete](PostRichTextAssetComplete.md) | | |
|
|
125
|
+
|
|
126
|
+
### Return type
|
|
127
|
+
|
|
128
|
+
[**RichTextAsset**](RichTextAsset.md)
|
|
129
|
+
|
|
130
|
+
### Authorization
|
|
131
|
+
|
|
132
|
+
No authorization required
|
|
133
|
+
|
|
134
|
+
### HTTP request headers
|
|
135
|
+
|
|
136
|
+
- **Content-Type**: `application/json`
|
|
137
|
+
- **Accept**: `application/json`
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### HTTP response details
|
|
141
|
+
| Status code | Description | Response headers |
|
|
142
|
+
|-------------|-------------|------------------|
|
|
143
|
+
| **200** | rich text asset completed | - |
|
|
144
|
+
| **404** | rich text asset not found | - |
|
|
145
|
+
|
|
146
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
## postRichTextAssetUpload
|
|
150
|
+
|
|
151
|
+
> GetRichTextAssetUpload postRichTextAssetUpload(postRichTextAssetUpload)
|
|
152
|
+
|
|
153
|
+
Create a pending rich text asset upload
|
|
154
|
+
|
|
155
|
+
### Example
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
import {
|
|
159
|
+
Configuration,
|
|
160
|
+
RichTextApi,
|
|
161
|
+
} from '@easyedu/js-lsm-api';
|
|
162
|
+
import type { PostRichTextAssetUploadRequest } from '@easyedu/js-lsm-api';
|
|
163
|
+
|
|
164
|
+
async function example() {
|
|
165
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
166
|
+
const api = new RichTextApi();
|
|
167
|
+
|
|
168
|
+
const body = {
|
|
169
|
+
// PostRichTextAssetUpload
|
|
170
|
+
postRichTextAssetUpload: ...,
|
|
171
|
+
} satisfies PostRichTextAssetUploadRequest;
|
|
172
|
+
|
|
173
|
+
try {
|
|
174
|
+
const data = await api.postRichTextAssetUpload(body);
|
|
175
|
+
console.log(data);
|
|
176
|
+
} catch (error) {
|
|
177
|
+
console.error(error);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Run the test
|
|
182
|
+
example().catch(console.error);
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### Parameters
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
| Name | Type | Description | Notes |
|
|
189
|
+
|------------- | ------------- | ------------- | -------------|
|
|
190
|
+
| **postRichTextAssetUpload** | [PostRichTextAssetUpload](PostRichTextAssetUpload.md) | | |
|
|
191
|
+
|
|
192
|
+
### Return type
|
|
193
|
+
|
|
194
|
+
[**GetRichTextAssetUpload**](GetRichTextAssetUpload.md)
|
|
195
|
+
|
|
196
|
+
### Authorization
|
|
197
|
+
|
|
198
|
+
No authorization required
|
|
199
|
+
|
|
200
|
+
### HTTP request headers
|
|
201
|
+
|
|
202
|
+
- **Content-Type**: `application/json`
|
|
203
|
+
- **Accept**: `application/json`
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
### HTTP response details
|
|
207
|
+
| Status code | Description | Response headers |
|
|
208
|
+
|-------------|-------------|------------------|
|
|
209
|
+
| **200** | rich text asset upload created | - |
|
|
210
|
+
| **400** | invalid asset upload request | - |
|
|
211
|
+
|
|
212
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
## putRichTextAssetFile
|
|
216
|
+
|
|
217
|
+
> putRichTextAssetFile(assetId, body)
|
|
218
|
+
|
|
219
|
+
Upload a pending rich text asset file through the API
|
|
220
|
+
|
|
221
|
+
### Example
|
|
222
|
+
|
|
223
|
+
```ts
|
|
224
|
+
import {
|
|
225
|
+
Configuration,
|
|
226
|
+
RichTextApi,
|
|
227
|
+
} from '@easyedu/js-lsm-api';
|
|
228
|
+
import type { PutRichTextAssetFileRequest } from '@easyedu/js-lsm-api';
|
|
229
|
+
|
|
230
|
+
async function example() {
|
|
231
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
232
|
+
const api = new RichTextApi();
|
|
233
|
+
|
|
234
|
+
const body = {
|
|
235
|
+
// string
|
|
236
|
+
assetId: assetId_example,
|
|
237
|
+
// Blob
|
|
238
|
+
body: BINARY_DATA_HERE,
|
|
239
|
+
} satisfies PutRichTextAssetFileRequest;
|
|
240
|
+
|
|
241
|
+
try {
|
|
242
|
+
const data = await api.putRichTextAssetFile(body);
|
|
243
|
+
console.log(data);
|
|
244
|
+
} catch (error) {
|
|
245
|
+
console.error(error);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Run the test
|
|
250
|
+
example().catch(console.error);
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Parameters
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
| Name | Type | Description | Notes |
|
|
257
|
+
|------------- | ------------- | ------------- | -------------|
|
|
258
|
+
| **assetId** | `string` | | [Defaults to `undefined`] |
|
|
259
|
+
| **body** | `Blob` | | |
|
|
260
|
+
|
|
261
|
+
### Return type
|
|
262
|
+
|
|
263
|
+
`void` (Empty response body)
|
|
264
|
+
|
|
265
|
+
### Authorization
|
|
266
|
+
|
|
267
|
+
No authorization required
|
|
268
|
+
|
|
269
|
+
### HTTP request headers
|
|
270
|
+
|
|
271
|
+
- **Content-Type**: `image/png`, `image/jpeg`, `image/webp`, `image/gif`, `application/octet-stream`
|
|
272
|
+
- **Accept**: Not defined
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
### HTTP response details
|
|
276
|
+
| Status code | Description | Response headers |
|
|
277
|
+
|-------------|-------------|------------------|
|
|
278
|
+
| **204** | rich text asset file uploaded | - |
|
|
279
|
+
| **400** | invalid upload | - |
|
|
280
|
+
| **403** | forbidden | - |
|
|
281
|
+
| **404** | rich text asset not found | - |
|
|
282
|
+
| **413** | file too large | - |
|
|
283
|
+
|
|
284
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
285
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
# RichTextAsset
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`id` | string
|
|
10
|
+
`mimeType` | string
|
|
11
|
+
`byteSize` | number
|
|
12
|
+
`width` | number
|
|
13
|
+
`height` | number
|
|
14
|
+
`renderUrl` | string
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import type { RichTextAsset } from '@easyedu/js-lsm-api'
|
|
20
|
+
|
|
21
|
+
// TODO: Update the object below with actual values
|
|
22
|
+
const example = {
|
|
23
|
+
"id": null,
|
|
24
|
+
"mimeType": null,
|
|
25
|
+
"byteSize": null,
|
|
26
|
+
"width": null,
|
|
27
|
+
"height": null,
|
|
28
|
+
"renderUrl": null,
|
|
29
|
+
} satisfies RichTextAsset
|
|
30
|
+
|
|
31
|
+
console.log(example)
|
|
32
|
+
|
|
33
|
+
// Convert the instance to a JSON string
|
|
34
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
35
|
+
console.log(exampleJSON)
|
|
36
|
+
|
|
37
|
+
// Parse the JSON string back to an object
|
|
38
|
+
const exampleParsed = JSON.parse(exampleJSON) as RichTextAsset
|
|
39
|
+
console.log(exampleParsed)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
43
|
+
|
|
44
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
# RichTextDocument
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`format` | string
|
|
10
|
+
`document` | { [key: string]: any; }
|
|
11
|
+
`plainText` | string
|
|
12
|
+
`assets` | [Array<RichTextAsset>](RichTextAsset.md)
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { RichTextDocument } from '@easyedu/js-lsm-api'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"format": null,
|
|
22
|
+
"document": null,
|
|
23
|
+
"plainText": null,
|
|
24
|
+
"assets": null,
|
|
25
|
+
} satisfies RichTextDocument
|
|
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 RichTextDocument
|
|
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,36 @@
|
|
|
1
|
+
|
|
2
|
+
# RichTextInput
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`format` | string
|
|
10
|
+
`document` | { [key: string]: any; }
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { RichTextInput } from '@easyedu/js-lsm-api'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"format": null,
|
|
20
|
+
"document": null,
|
|
21
|
+
} satisfies RichTextInput
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as RichTextInput
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
35
|
+
|
|
36
|
+
|
package/package.json
CHANGED
|
@@ -0,0 +1,260 @@
|
|
|
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 * as runtime from '../runtime';
|
|
16
|
+
import {
|
|
17
|
+
type GetRichTextAssetUpload,
|
|
18
|
+
GetRichTextAssetUploadFromJSON,
|
|
19
|
+
GetRichTextAssetUploadToJSON,
|
|
20
|
+
} from '../models/GetRichTextAssetUpload';
|
|
21
|
+
import {
|
|
22
|
+
type PostRichTextAssetComplete,
|
|
23
|
+
PostRichTextAssetCompleteFromJSON,
|
|
24
|
+
PostRichTextAssetCompleteToJSON,
|
|
25
|
+
} from '../models/PostRichTextAssetComplete';
|
|
26
|
+
import {
|
|
27
|
+
type PostRichTextAssetUpload,
|
|
28
|
+
PostRichTextAssetUploadFromJSON,
|
|
29
|
+
PostRichTextAssetUploadToJSON,
|
|
30
|
+
} from '../models/PostRichTextAssetUpload';
|
|
31
|
+
import {
|
|
32
|
+
type RichTextAsset,
|
|
33
|
+
RichTextAssetFromJSON,
|
|
34
|
+
RichTextAssetToJSON,
|
|
35
|
+
} from '../models/RichTextAsset';
|
|
36
|
+
|
|
37
|
+
export interface GetRichTextAssetRequest {
|
|
38
|
+
assetId: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface PostRichTextAssetCompleteRequest {
|
|
42
|
+
assetId: string;
|
|
43
|
+
postRichTextAssetComplete: PostRichTextAssetComplete;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface PostRichTextAssetUploadRequest {
|
|
47
|
+
postRichTextAssetUpload: PostRichTextAssetUpload;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface PutRichTextAssetFileRequest {
|
|
51
|
+
assetId: string;
|
|
52
|
+
body: Blob;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
export class RichTextApi extends runtime.BaseAPI {
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Creates request options for getRichTextAsset without sending the request
|
|
62
|
+
*/
|
|
63
|
+
async getRichTextAssetRequestOpts(requestParameters: GetRichTextAssetRequest): Promise<runtime.RequestOpts> {
|
|
64
|
+
if (requestParameters['assetId'] == null) {
|
|
65
|
+
throw new runtime.RequiredError(
|
|
66
|
+
'assetId',
|
|
67
|
+
'Required parameter "assetId" was null or undefined when calling getRichTextAsset().'
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const queryParameters: any = {};
|
|
72
|
+
|
|
73
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
let urlPath = `/rich-text/assets/{assetId}`;
|
|
77
|
+
urlPath = urlPath.replace('{assetId}', encodeURIComponent(String(requestParameters['assetId'])));
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
path: urlPath,
|
|
81
|
+
method: 'GET',
|
|
82
|
+
headers: headerParameters,
|
|
83
|
+
query: queryParameters,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Redirect to a signed rich text asset URL
|
|
89
|
+
*/
|
|
90
|
+
async getRichTextAssetRaw(requestParameters: GetRichTextAssetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
91
|
+
const requestOptions = await this.getRichTextAssetRequestOpts(requestParameters);
|
|
92
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
93
|
+
|
|
94
|
+
return new runtime.VoidApiResponse(response);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Redirect to a signed rich text asset URL
|
|
99
|
+
*/
|
|
100
|
+
async getRichTextAsset(requestParameters: GetRichTextAssetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
101
|
+
await this.getRichTextAssetRaw(requestParameters, initOverrides);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Creates request options for postRichTextAssetComplete without sending the request
|
|
106
|
+
*/
|
|
107
|
+
async postRichTextAssetCompleteRequestOpts(requestParameters: PostRichTextAssetCompleteRequest): Promise<runtime.RequestOpts> {
|
|
108
|
+
if (requestParameters['assetId'] == null) {
|
|
109
|
+
throw new runtime.RequiredError(
|
|
110
|
+
'assetId',
|
|
111
|
+
'Required parameter "assetId" was null or undefined when calling postRichTextAssetComplete().'
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (requestParameters['postRichTextAssetComplete'] == null) {
|
|
116
|
+
throw new runtime.RequiredError(
|
|
117
|
+
'postRichTextAssetComplete',
|
|
118
|
+
'Required parameter "postRichTextAssetComplete" was null or undefined when calling postRichTextAssetComplete().'
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const queryParameters: any = {};
|
|
123
|
+
|
|
124
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
125
|
+
|
|
126
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
let urlPath = `/rich-text/assets/{assetId}/complete`;
|
|
130
|
+
urlPath = urlPath.replace('{assetId}', encodeURIComponent(String(requestParameters['assetId'])));
|
|
131
|
+
|
|
132
|
+
return {
|
|
133
|
+
path: urlPath,
|
|
134
|
+
method: 'POST',
|
|
135
|
+
headers: headerParameters,
|
|
136
|
+
query: queryParameters,
|
|
137
|
+
body: PostRichTextAssetCompleteToJSON(requestParameters['postRichTextAssetComplete']),
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Complete a pending rich text asset upload
|
|
143
|
+
*/
|
|
144
|
+
async postRichTextAssetCompleteRaw(requestParameters: PostRichTextAssetCompleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RichTextAsset>> {
|
|
145
|
+
const requestOptions = await this.postRichTextAssetCompleteRequestOpts(requestParameters);
|
|
146
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
147
|
+
|
|
148
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => RichTextAssetFromJSON(jsonValue));
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Complete a pending rich text asset upload
|
|
153
|
+
*/
|
|
154
|
+
async postRichTextAssetComplete(requestParameters: PostRichTextAssetCompleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RichTextAsset> {
|
|
155
|
+
const response = await this.postRichTextAssetCompleteRaw(requestParameters, initOverrides);
|
|
156
|
+
return await response.value();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Creates request options for postRichTextAssetUpload without sending the request
|
|
161
|
+
*/
|
|
162
|
+
async postRichTextAssetUploadRequestOpts(requestParameters: PostRichTextAssetUploadRequest): Promise<runtime.RequestOpts> {
|
|
163
|
+
if (requestParameters['postRichTextAssetUpload'] == null) {
|
|
164
|
+
throw new runtime.RequiredError(
|
|
165
|
+
'postRichTextAssetUpload',
|
|
166
|
+
'Required parameter "postRichTextAssetUpload" was null or undefined when calling postRichTextAssetUpload().'
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const queryParameters: any = {};
|
|
171
|
+
|
|
172
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
173
|
+
|
|
174
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
let urlPath = `/rich-text/assets/uploads`;
|
|
178
|
+
|
|
179
|
+
return {
|
|
180
|
+
path: urlPath,
|
|
181
|
+
method: 'POST',
|
|
182
|
+
headers: headerParameters,
|
|
183
|
+
query: queryParameters,
|
|
184
|
+
body: PostRichTextAssetUploadToJSON(requestParameters['postRichTextAssetUpload']),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Create a pending rich text asset upload
|
|
190
|
+
*/
|
|
191
|
+
async postRichTextAssetUploadRaw(requestParameters: PostRichTextAssetUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetRichTextAssetUpload>> {
|
|
192
|
+
const requestOptions = await this.postRichTextAssetUploadRequestOpts(requestParameters);
|
|
193
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
194
|
+
|
|
195
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetRichTextAssetUploadFromJSON(jsonValue));
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Create a pending rich text asset upload
|
|
200
|
+
*/
|
|
201
|
+
async postRichTextAssetUpload(requestParameters: PostRichTextAssetUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetRichTextAssetUpload> {
|
|
202
|
+
const response = await this.postRichTextAssetUploadRaw(requestParameters, initOverrides);
|
|
203
|
+
return await response.value();
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Creates request options for putRichTextAssetFile without sending the request
|
|
208
|
+
*/
|
|
209
|
+
async putRichTextAssetFileRequestOpts(requestParameters: PutRichTextAssetFileRequest): Promise<runtime.RequestOpts> {
|
|
210
|
+
if (requestParameters['assetId'] == null) {
|
|
211
|
+
throw new runtime.RequiredError(
|
|
212
|
+
'assetId',
|
|
213
|
+
'Required parameter "assetId" was null or undefined when calling putRichTextAssetFile().'
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (requestParameters['body'] == null) {
|
|
218
|
+
throw new runtime.RequiredError(
|
|
219
|
+
'body',
|
|
220
|
+
'Required parameter "body" was null or undefined when calling putRichTextAssetFile().'
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
const queryParameters: any = {};
|
|
225
|
+
|
|
226
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
227
|
+
|
|
228
|
+
headerParameters['Content-Type'] = 'image/png';
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
let urlPath = `/rich-text/assets/{assetId}/file`;
|
|
232
|
+
urlPath = urlPath.replace('{assetId}', encodeURIComponent(String(requestParameters['assetId'])));
|
|
233
|
+
|
|
234
|
+
return {
|
|
235
|
+
path: urlPath,
|
|
236
|
+
method: 'PUT',
|
|
237
|
+
headers: headerParameters,
|
|
238
|
+
query: queryParameters,
|
|
239
|
+
body: requestParameters['body'] as any,
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Upload a pending rich text asset file through the API
|
|
245
|
+
*/
|
|
246
|
+
async putRichTextAssetFileRaw(requestParameters: PutRichTextAssetFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
247
|
+
const requestOptions = await this.putRichTextAssetFileRequestOpts(requestParameters);
|
|
248
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
249
|
+
|
|
250
|
+
return new runtime.VoidApiResponse(response);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Upload a pending rich text asset file through the API
|
|
255
|
+
*/
|
|
256
|
+
async putRichTextAssetFile(requestParameters: PutRichTextAssetFileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
257
|
+
await this.putRichTextAssetFileRaw(requestParameters, initOverrides);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
}
|
package/src/apis/index.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './PortalSublicenseApi';
|
|
|
15
15
|
export * from './QuestionApi';
|
|
16
16
|
export * from './QuizApi';
|
|
17
17
|
export * from './ReportingApi';
|
|
18
|
+
export * from './RichTextApi';
|
|
18
19
|
export * from './RoleApi';
|
|
19
20
|
export * from './SupportTicketApi';
|
|
20
21
|
export * from './SystemApi';
|