@easyedu/js-lsm-api 1.130.0 → 1.131.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 +22 -0
- package/README.md +16 -2
- package/dist/apis/ReportingApi.d.ts +52 -0
- package/dist/apis/ReportingApi.js +131 -0
- package/dist/esm/apis/ReportingApi.d.ts +52 -0
- package/dist/esm/apis/ReportingApi.js +131 -0
- package/dist/esm/models/GetReportCatalog.d.ts +40 -0
- package/dist/esm/models/GetReportCatalog.js +49 -0
- package/dist/esm/models/GetReportQueryResult.d.ts +84 -0
- package/dist/esm/models/GetReportQueryResult.js +77 -0
- package/dist/esm/models/PostReportExport.d.ts +54 -0
- package/dist/esm/models/PostReportExport.js +56 -0
- package/dist/esm/models/PostReportQuery.d.ts +52 -0
- package/dist/esm/models/PostReportQuery.js +49 -0
- package/dist/esm/models/ReportCategory.d.ts +50 -0
- package/dist/esm/models/ReportCategory.js +58 -0
- package/dist/esm/models/ReportColumn.d.ts +59 -0
- package/dist/esm/models/ReportColumn.js +64 -0
- package/dist/esm/models/ReportDefinition.d.ts +89 -0
- package/dist/esm/models/ReportDefinition.js +85 -0
- package/dist/esm/models/ReportFilterDefinition.d.ts +94 -0
- package/dist/esm/models/ReportFilterDefinition.js +91 -0
- package/dist/esm/models/ReportFilterOption.d.ts +38 -0
- package/dist/esm/models/ReportFilterOption.js +47 -0
- package/dist/esm/models/ReportFilters.d.ts +105 -0
- package/dist/esm/models/ReportFilters.js +65 -0
- package/dist/esm/models/ReportSort.d.ts +46 -0
- package/dist/esm/models/ReportSort.js +54 -0
- package/dist/esm/models/index.d.ts +11 -0
- package/dist/esm/models/index.js +11 -0
- package/dist/models/GetReportCatalog.d.ts +40 -0
- package/dist/models/GetReportCatalog.js +56 -0
- package/dist/models/GetReportQueryResult.d.ts +84 -0
- package/dist/models/GetReportQueryResult.js +84 -0
- package/dist/models/PostReportExport.d.ts +54 -0
- package/dist/models/PostReportExport.js +64 -0
- package/dist/models/PostReportQuery.d.ts +52 -0
- package/dist/models/PostReportQuery.js +56 -0
- package/dist/models/ReportCategory.d.ts +50 -0
- package/dist/models/ReportCategory.js +66 -0
- package/dist/models/ReportColumn.d.ts +59 -0
- package/dist/models/ReportColumn.js +72 -0
- package/dist/models/ReportDefinition.d.ts +89 -0
- package/dist/models/ReportDefinition.js +93 -0
- package/dist/models/ReportFilterDefinition.d.ts +94 -0
- package/dist/models/ReportFilterDefinition.js +99 -0
- package/dist/models/ReportFilterOption.d.ts +38 -0
- package/dist/models/ReportFilterOption.js +54 -0
- package/dist/models/ReportFilters.d.ts +105 -0
- package/dist/models/ReportFilters.js +72 -0
- package/dist/models/ReportSort.d.ts +46 -0
- package/dist/models/ReportSort.js +62 -0
- package/dist/models/index.d.ts +11 -0
- package/dist/models/index.js +11 -0
- package/docs/GetReportCatalog.md +37 -0
- package/docs/GetReportQueryResult.md +50 -0
- package/docs/PostReportExport.md +38 -0
- package/docs/PostReportQuery.md +40 -0
- package/docs/ReportCategory.md +36 -0
- package/docs/ReportColumn.md +39 -0
- package/docs/ReportDefinition.md +48 -0
- package/docs/ReportFilterDefinition.md +45 -0
- package/docs/ReportFilterOption.md +36 -0
- package/docs/ReportFilters.md +59 -0
- package/docs/ReportSort.md +36 -0
- package/docs/ReportingApi.md +207 -0
- package/package.json +1 -1
- package/src/apis/ReportingApi.ts +181 -0
- package/src/models/GetReportCatalog.ts +90 -0
- package/src/models/GetReportQueryResult.ts +153 -0
- package/src/models/PostReportExport.ts +108 -0
- package/src/models/PostReportQuery.ts +104 -0
- package/src/models/ReportCategory.ts +90 -0
- package/src/models/ReportColumn.ts +102 -0
- package/src/models/ReportDefinition.ts +166 -0
- package/src/models/ReportFilterDefinition.ts +154 -0
- package/src/models/ReportFilterOption.ts +75 -0
- package/src/models/ReportFilters.ts +162 -0
- package/src/models/ReportSort.ts +86 -0
- package/src/models/index.ts +11 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# ReportFilterOption
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`value` | string
|
|
10
|
+
`label` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { ReportFilterOption } from '@easyedu/js-lsm-api'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"value": null,
|
|
20
|
+
"label": null,
|
|
21
|
+
} satisfies ReportFilterOption
|
|
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 ReportFilterOption
|
|
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
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
|
|
2
|
+
# ReportFilters
|
|
3
|
+
|
|
4
|
+
Report filters. Only filters listed in the report definition may be supplied; any other non-null filter is rejected with HTTP 400.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`search` | string
|
|
11
|
+
`userType` | string
|
|
12
|
+
`company` | string
|
|
13
|
+
`status` | string
|
|
14
|
+
`teamPortalId` | string
|
|
15
|
+
`courseId` | string
|
|
16
|
+
`tagId` | string
|
|
17
|
+
`managerId` | string
|
|
18
|
+
`dateFrom` | Date
|
|
19
|
+
`dateTo` | Date
|
|
20
|
+
`inactiveDays` | number
|
|
21
|
+
`expiresWithinDays` | number
|
|
22
|
+
`firstCourseStarted` | string
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import type { ReportFilters } from '@easyedu/js-lsm-api'
|
|
28
|
+
|
|
29
|
+
// TODO: Update the object below with actual values
|
|
30
|
+
const example = {
|
|
31
|
+
"search": null,
|
|
32
|
+
"userType": null,
|
|
33
|
+
"company": null,
|
|
34
|
+
"status": null,
|
|
35
|
+
"teamPortalId": null,
|
|
36
|
+
"courseId": null,
|
|
37
|
+
"tagId": null,
|
|
38
|
+
"managerId": null,
|
|
39
|
+
"dateFrom": null,
|
|
40
|
+
"dateTo": null,
|
|
41
|
+
"inactiveDays": null,
|
|
42
|
+
"expiresWithinDays": null,
|
|
43
|
+
"firstCourseStarted": null,
|
|
44
|
+
} satisfies ReportFilters
|
|
45
|
+
|
|
46
|
+
console.log(example)
|
|
47
|
+
|
|
48
|
+
// Convert the instance to a JSON string
|
|
49
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
50
|
+
console.log(exampleJSON)
|
|
51
|
+
|
|
52
|
+
// Parse the JSON string back to an object
|
|
53
|
+
const exampleParsed = JSON.parse(exampleJSON) as ReportFilters
|
|
54
|
+
console.log(exampleParsed)
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
58
|
+
|
|
59
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# ReportSort
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`column` | string
|
|
10
|
+
`direction` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { ReportSort } from '@easyedu/js-lsm-api'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"column": null,
|
|
20
|
+
"direction": null,
|
|
21
|
+
} satisfies ReportSort
|
|
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 ReportSort
|
|
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/docs/ReportingApi.md
CHANGED
|
@@ -4,12 +4,87 @@ 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
|
+
| [**exportReport**](ReportingApi.md#exportreport) | **POST** /reporting/reports/{reportKey}/export | Export all rows of a report as CSV or XLSX |
|
|
7
8
|
| [**getCourseVersionReporting**](ReportingApi.md#getcourseversionreporting) | **GET** /courses/{courseId}/versions/{courseVersionId}/reporting | Get instructor reporting for one explicit course version |
|
|
8
9
|
| [**getCourseVersionSectionReporting**](ReportingApi.md#getcourseversionsectionreporting) | **GET** /courses/{courseId}/versions/{courseVersionId}/sections/{sectionId}/reporting | Get instructor reporting for one section and its descendants in an explicit course version |
|
|
9
10
|
| [**getPortalManagementDashboard**](ReportingApi.md#getportalmanagementdashboard) | **GET** /reporting/portal/dashboard | Get the selected portal\'s management dashboard reporting |
|
|
11
|
+
| [**getReportCatalog**](ReportingApi.md#getreportcatalog) | **GET** /reporting/reports | List the reports the caller can run in the selected portal |
|
|
12
|
+
| [**queryReport**](ReportingApi.md#queryreport) | **POST** /reporting/reports/{reportKey}/query | Run a report and return one page of rows |
|
|
10
13
|
|
|
11
14
|
|
|
12
15
|
|
|
16
|
+
## exportReport
|
|
17
|
+
|
|
18
|
+
> Blob exportReport(reportKey, postReportExport)
|
|
19
|
+
|
|
20
|
+
Export all rows of a report as CSV or XLSX
|
|
21
|
+
|
|
22
|
+
### Example
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import {
|
|
26
|
+
Configuration,
|
|
27
|
+
ReportingApi,
|
|
28
|
+
} from '@easyedu/js-lsm-api';
|
|
29
|
+
import type { ExportReportRequest } from '@easyedu/js-lsm-api';
|
|
30
|
+
|
|
31
|
+
async function example() {
|
|
32
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
33
|
+
const api = new ReportingApi();
|
|
34
|
+
|
|
35
|
+
const body = {
|
|
36
|
+
// string
|
|
37
|
+
reportKey: reportKey_example,
|
|
38
|
+
// PostReportExport
|
|
39
|
+
postReportExport: ...,
|
|
40
|
+
} satisfies ExportReportRequest;
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
const data = await api.exportReport(body);
|
|
44
|
+
console.log(data);
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.error(error);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Run the test
|
|
51
|
+
example().catch(console.error);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Parameters
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
| Name | Type | Description | Notes |
|
|
58
|
+
|------------- | ------------- | ------------- | -------------|
|
|
59
|
+
| **reportKey** | `string` | | [Defaults to `undefined`] |
|
|
60
|
+
| **postReportExport** | [PostReportExport](PostReportExport.md) | | |
|
|
61
|
+
|
|
62
|
+
### Return type
|
|
63
|
+
|
|
64
|
+
**Blob**
|
|
65
|
+
|
|
66
|
+
### Authorization
|
|
67
|
+
|
|
68
|
+
No authorization required
|
|
69
|
+
|
|
70
|
+
### HTTP request headers
|
|
71
|
+
|
|
72
|
+
- **Content-Type**: `application/json`
|
|
73
|
+
- **Accept**: `text/csv`, `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### HTTP response details
|
|
77
|
+
| Status code | Description | Response headers |
|
|
78
|
+
|-------------|-------------|------------------|
|
|
79
|
+
| **200** | Report file | - |
|
|
80
|
+
| **400** | Unsupported filter, invalid filter value, or unknown sort column | - |
|
|
81
|
+
| **403** | Missing the report\'s permission | - |
|
|
82
|
+
| **404** | Unknown report | - |
|
|
83
|
+
| **422** | The export exceeds the maximum row count; narrow the filters | - |
|
|
84
|
+
|
|
85
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
86
|
+
|
|
87
|
+
|
|
13
88
|
## getCourseVersionReporting
|
|
14
89
|
|
|
15
90
|
> GetCourseVersionReporting getCourseVersionReporting(courseId, courseVersionId)
|
|
@@ -216,3 +291,135 @@ No authorization required
|
|
|
216
291
|
|
|
217
292
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
218
293
|
|
|
294
|
+
|
|
295
|
+
## getReportCatalog
|
|
296
|
+
|
|
297
|
+
> GetReportCatalog getReportCatalog()
|
|
298
|
+
|
|
299
|
+
List the reports the caller can run in the selected portal
|
|
300
|
+
|
|
301
|
+
Returns report definitions with columns, supported filters, select options resolved for the selected portal, and default sort. Reports whose permission the caller lacks are omitted.
|
|
302
|
+
|
|
303
|
+
### Example
|
|
304
|
+
|
|
305
|
+
```ts
|
|
306
|
+
import {
|
|
307
|
+
Configuration,
|
|
308
|
+
ReportingApi,
|
|
309
|
+
} from '@easyedu/js-lsm-api';
|
|
310
|
+
import type { GetReportCatalogRequest } from '@easyedu/js-lsm-api';
|
|
311
|
+
|
|
312
|
+
async function example() {
|
|
313
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
314
|
+
const api = new ReportingApi();
|
|
315
|
+
|
|
316
|
+
try {
|
|
317
|
+
const data = await api.getReportCatalog();
|
|
318
|
+
console.log(data);
|
|
319
|
+
} catch (error) {
|
|
320
|
+
console.error(error);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
// Run the test
|
|
325
|
+
example().catch(console.error);
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Parameters
|
|
329
|
+
|
|
330
|
+
This endpoint does not need any parameter.
|
|
331
|
+
|
|
332
|
+
### Return type
|
|
333
|
+
|
|
334
|
+
[**GetReportCatalog**](GetReportCatalog.md)
|
|
335
|
+
|
|
336
|
+
### Authorization
|
|
337
|
+
|
|
338
|
+
No authorization required
|
|
339
|
+
|
|
340
|
+
### HTTP request headers
|
|
341
|
+
|
|
342
|
+
- **Content-Type**: Not defined
|
|
343
|
+
- **Accept**: `application/json`
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
### HTTP response details
|
|
347
|
+
| Status code | Description | Response headers |
|
|
348
|
+
|-------------|-------------|------------------|
|
|
349
|
+
| **200** | Report catalog | - |
|
|
350
|
+
|
|
351
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
## queryReport
|
|
355
|
+
|
|
356
|
+
> GetReportQueryResult queryReport(reportKey, postReportQuery)
|
|
357
|
+
|
|
358
|
+
Run a report and return one page of rows
|
|
359
|
+
|
|
360
|
+
Read-only. POST is used because filters vary per report. Results are scoped to the selected portal and its team portals.
|
|
361
|
+
|
|
362
|
+
### Example
|
|
363
|
+
|
|
364
|
+
```ts
|
|
365
|
+
import {
|
|
366
|
+
Configuration,
|
|
367
|
+
ReportingApi,
|
|
368
|
+
} from '@easyedu/js-lsm-api';
|
|
369
|
+
import type { QueryReportRequest } from '@easyedu/js-lsm-api';
|
|
370
|
+
|
|
371
|
+
async function example() {
|
|
372
|
+
console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
|
|
373
|
+
const api = new ReportingApi();
|
|
374
|
+
|
|
375
|
+
const body = {
|
|
376
|
+
// string
|
|
377
|
+
reportKey: reportKey_example,
|
|
378
|
+
// PostReportQuery
|
|
379
|
+
postReportQuery: ...,
|
|
380
|
+
} satisfies QueryReportRequest;
|
|
381
|
+
|
|
382
|
+
try {
|
|
383
|
+
const data = await api.queryReport(body);
|
|
384
|
+
console.log(data);
|
|
385
|
+
} catch (error) {
|
|
386
|
+
console.error(error);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// Run the test
|
|
391
|
+
example().catch(console.error);
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### Parameters
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
| Name | Type | Description | Notes |
|
|
398
|
+
|------------- | ------------- | ------------- | -------------|
|
|
399
|
+
| **reportKey** | `string` | | [Defaults to `undefined`] |
|
|
400
|
+
| **postReportQuery** | [PostReportQuery](PostReportQuery.md) | | |
|
|
401
|
+
|
|
402
|
+
### Return type
|
|
403
|
+
|
|
404
|
+
[**GetReportQueryResult**](GetReportQueryResult.md)
|
|
405
|
+
|
|
406
|
+
### Authorization
|
|
407
|
+
|
|
408
|
+
No authorization required
|
|
409
|
+
|
|
410
|
+
### HTTP request headers
|
|
411
|
+
|
|
412
|
+
- **Content-Type**: `application/json`
|
|
413
|
+
- **Accept**: `application/json`
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
### HTTP response details
|
|
417
|
+
| Status code | Description | Response headers |
|
|
418
|
+
|-------------|-------------|------------------|
|
|
419
|
+
| **200** | One page of report rows | - |
|
|
420
|
+
| **400** | Unsupported filter, invalid filter value, or unknown sort column | - |
|
|
421
|
+
| **403** | Missing the report\'s permission | - |
|
|
422
|
+
| **404** | Unknown report | - |
|
|
423
|
+
|
|
424
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
425
|
+
|
package/package.json
CHANGED
package/src/apis/ReportingApi.ts
CHANGED
|
@@ -28,6 +28,31 @@ import {
|
|
|
28
28
|
GetPortalManagementDashboardFromJSON,
|
|
29
29
|
GetPortalManagementDashboardToJSON,
|
|
30
30
|
} from '../models/GetPortalManagementDashboard';
|
|
31
|
+
import {
|
|
32
|
+
type GetReportCatalog,
|
|
33
|
+
GetReportCatalogFromJSON,
|
|
34
|
+
GetReportCatalogToJSON,
|
|
35
|
+
} from '../models/GetReportCatalog';
|
|
36
|
+
import {
|
|
37
|
+
type GetReportQueryResult,
|
|
38
|
+
GetReportQueryResultFromJSON,
|
|
39
|
+
GetReportQueryResultToJSON,
|
|
40
|
+
} from '../models/GetReportQueryResult';
|
|
41
|
+
import {
|
|
42
|
+
type PostReportExport,
|
|
43
|
+
PostReportExportFromJSON,
|
|
44
|
+
PostReportExportToJSON,
|
|
45
|
+
} from '../models/PostReportExport';
|
|
46
|
+
import {
|
|
47
|
+
type PostReportQuery,
|
|
48
|
+
PostReportQueryFromJSON,
|
|
49
|
+
PostReportQueryToJSON,
|
|
50
|
+
} from '../models/PostReportQuery';
|
|
51
|
+
|
|
52
|
+
export interface ExportReportRequest {
|
|
53
|
+
reportKey: string;
|
|
54
|
+
postReportExport: PostReportExport;
|
|
55
|
+
}
|
|
31
56
|
|
|
32
57
|
export interface GetCourseVersionReportingRequest {
|
|
33
58
|
courseId: string;
|
|
@@ -44,11 +69,71 @@ export interface GetPortalManagementDashboardRequest {
|
|
|
44
69
|
days?: number;
|
|
45
70
|
}
|
|
46
71
|
|
|
72
|
+
export interface QueryReportRequest {
|
|
73
|
+
reportKey: string;
|
|
74
|
+
postReportQuery: PostReportQuery;
|
|
75
|
+
}
|
|
76
|
+
|
|
47
77
|
/**
|
|
48
78
|
*
|
|
49
79
|
*/
|
|
50
80
|
export class ReportingApi extends runtime.BaseAPI {
|
|
51
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Creates request options for exportReport without sending the request
|
|
84
|
+
*/
|
|
85
|
+
async exportReportRequestOpts(requestParameters: ExportReportRequest): Promise<runtime.RequestOpts> {
|
|
86
|
+
if (requestParameters['reportKey'] == null) {
|
|
87
|
+
throw new runtime.RequiredError(
|
|
88
|
+
'reportKey',
|
|
89
|
+
'Required parameter "reportKey" was null or undefined when calling exportReport().'
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (requestParameters['postReportExport'] == null) {
|
|
94
|
+
throw new runtime.RequiredError(
|
|
95
|
+
'postReportExport',
|
|
96
|
+
'Required parameter "postReportExport" was null or undefined when calling exportReport().'
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const queryParameters: any = {};
|
|
101
|
+
|
|
102
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
103
|
+
|
|
104
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
let urlPath = `/reporting/reports/{reportKey}/export`;
|
|
108
|
+
urlPath = urlPath.replace('{reportKey}', encodeURIComponent(String(requestParameters['reportKey'])));
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
path: urlPath,
|
|
112
|
+
method: 'POST',
|
|
113
|
+
headers: headerParameters,
|
|
114
|
+
query: queryParameters,
|
|
115
|
+
body: PostReportExportToJSON(requestParameters['postReportExport']),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Export all rows of a report as CSV or XLSX
|
|
121
|
+
*/
|
|
122
|
+
async exportReportRaw(requestParameters: ExportReportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {
|
|
123
|
+
const requestOptions = await this.exportReportRequestOpts(requestParameters);
|
|
124
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
125
|
+
|
|
126
|
+
return new runtime.BlobApiResponse(response);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Export all rows of a report as CSV or XLSX
|
|
131
|
+
*/
|
|
132
|
+
async exportReport(requestParameters: ExportReportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {
|
|
133
|
+
const response = await this.exportReportRaw(requestParameters, initOverrides);
|
|
134
|
+
return await response.value();
|
|
135
|
+
}
|
|
136
|
+
|
|
52
137
|
/**
|
|
53
138
|
* Creates request options for getCourseVersionReporting without sending the request
|
|
54
139
|
*/
|
|
@@ -204,4 +289,100 @@ export class ReportingApi extends runtime.BaseAPI {
|
|
|
204
289
|
return await response.value();
|
|
205
290
|
}
|
|
206
291
|
|
|
292
|
+
/**
|
|
293
|
+
* Creates request options for getReportCatalog without sending the request
|
|
294
|
+
*/
|
|
295
|
+
async getReportCatalogRequestOpts(): Promise<runtime.RequestOpts> {
|
|
296
|
+
const queryParameters: any = {};
|
|
297
|
+
|
|
298
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
let urlPath = `/reporting/reports`;
|
|
302
|
+
|
|
303
|
+
return {
|
|
304
|
+
path: urlPath,
|
|
305
|
+
method: 'GET',
|
|
306
|
+
headers: headerParameters,
|
|
307
|
+
query: queryParameters,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Returns report definitions with columns, supported filters, select options resolved for the selected portal, and default sort. Reports whose permission the caller lacks are omitted.
|
|
313
|
+
* List the reports the caller can run in the selected portal
|
|
314
|
+
*/
|
|
315
|
+
async getReportCatalogRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetReportCatalog>> {
|
|
316
|
+
const requestOptions = await this.getReportCatalogRequestOpts();
|
|
317
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
318
|
+
|
|
319
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetReportCatalogFromJSON(jsonValue));
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* Returns report definitions with columns, supported filters, select options resolved for the selected portal, and default sort. Reports whose permission the caller lacks are omitted.
|
|
324
|
+
* List the reports the caller can run in the selected portal
|
|
325
|
+
*/
|
|
326
|
+
async getReportCatalog(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetReportCatalog> {
|
|
327
|
+
const response = await this.getReportCatalogRaw(initOverrides);
|
|
328
|
+
return await response.value();
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Creates request options for queryReport without sending the request
|
|
333
|
+
*/
|
|
334
|
+
async queryReportRequestOpts(requestParameters: QueryReportRequest): Promise<runtime.RequestOpts> {
|
|
335
|
+
if (requestParameters['reportKey'] == null) {
|
|
336
|
+
throw new runtime.RequiredError(
|
|
337
|
+
'reportKey',
|
|
338
|
+
'Required parameter "reportKey" was null or undefined when calling queryReport().'
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (requestParameters['postReportQuery'] == null) {
|
|
343
|
+
throw new runtime.RequiredError(
|
|
344
|
+
'postReportQuery',
|
|
345
|
+
'Required parameter "postReportQuery" was null or undefined when calling queryReport().'
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const queryParameters: any = {};
|
|
350
|
+
|
|
351
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
352
|
+
|
|
353
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
let urlPath = `/reporting/reports/{reportKey}/query`;
|
|
357
|
+
urlPath = urlPath.replace('{reportKey}', encodeURIComponent(String(requestParameters['reportKey'])));
|
|
358
|
+
|
|
359
|
+
return {
|
|
360
|
+
path: urlPath,
|
|
361
|
+
method: 'POST',
|
|
362
|
+
headers: headerParameters,
|
|
363
|
+
query: queryParameters,
|
|
364
|
+
body: PostReportQueryToJSON(requestParameters['postReportQuery']),
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Read-only. POST is used because filters vary per report. Results are scoped to the selected portal and its team portals.
|
|
370
|
+
* Run a report and return one page of rows
|
|
371
|
+
*/
|
|
372
|
+
async queryReportRaw(requestParameters: QueryReportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetReportQueryResult>> {
|
|
373
|
+
const requestOptions = await this.queryReportRequestOpts(requestParameters);
|
|
374
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
375
|
+
|
|
376
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetReportQueryResultFromJSON(jsonValue));
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Read-only. POST is used because filters vary per report. Results are scoped to the selected portal and its team portals.
|
|
381
|
+
* Run a report and return one page of rows
|
|
382
|
+
*/
|
|
383
|
+
async queryReport(requestParameters: QueryReportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetReportQueryResult> {
|
|
384
|
+
const response = await this.queryReportRaw(requestParameters, initOverrides);
|
|
385
|
+
return await response.value();
|
|
386
|
+
}
|
|
387
|
+
|
|
207
388
|
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* LMS API
|
|
5
|
+
* LMS API
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { ReportCategory } from './ReportCategory';
|
|
17
|
+
import {
|
|
18
|
+
ReportCategoryFromJSON,
|
|
19
|
+
ReportCategoryFromJSONTyped,
|
|
20
|
+
ReportCategoryToJSON,
|
|
21
|
+
ReportCategoryToJSONTyped,
|
|
22
|
+
} from './ReportCategory';
|
|
23
|
+
import type { ReportDefinition } from './ReportDefinition';
|
|
24
|
+
import {
|
|
25
|
+
ReportDefinitionFromJSON,
|
|
26
|
+
ReportDefinitionFromJSONTyped,
|
|
27
|
+
ReportDefinitionToJSON,
|
|
28
|
+
ReportDefinitionToJSONTyped,
|
|
29
|
+
} from './ReportDefinition';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Reports the caller may run in the selected portal.
|
|
33
|
+
* @export
|
|
34
|
+
* @interface GetReportCatalog
|
|
35
|
+
*/
|
|
36
|
+
export interface GetReportCatalog {
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {Array<ReportCategory>}
|
|
40
|
+
* @memberof GetReportCatalog
|
|
41
|
+
*/
|
|
42
|
+
categories: Array<ReportCategory>;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {Array<ReportDefinition>}
|
|
46
|
+
* @memberof GetReportCatalog
|
|
47
|
+
*/
|
|
48
|
+
reports: Array<ReportDefinition>;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Check if a given object implements the GetReportCatalog interface.
|
|
53
|
+
*/
|
|
54
|
+
export function instanceOfGetReportCatalog(value: object): value is GetReportCatalog {
|
|
55
|
+
if (!('categories' in value) || value['categories'] === undefined) return false;
|
|
56
|
+
if (!('reports' in value) || value['reports'] === undefined) return false;
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function GetReportCatalogFromJSON(json: any): GetReportCatalog {
|
|
61
|
+
return GetReportCatalogFromJSONTyped(json, false);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function GetReportCatalogFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetReportCatalog {
|
|
65
|
+
if (json == null) {
|
|
66
|
+
return json;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
|
|
70
|
+
'categories': ((json['categories'] as Array<any>).map(ReportCategoryFromJSON)),
|
|
71
|
+
'reports': ((json['reports'] as Array<any>).map(ReportDefinitionFromJSON)),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function GetReportCatalogToJSON(json: any): GetReportCatalog {
|
|
76
|
+
return GetReportCatalogToJSONTyped(json, false);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function GetReportCatalogToJSONTyped(value?: GetReportCatalog | null, ignoreDiscriminator: boolean = false): any {
|
|
80
|
+
if (value == null) {
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return {
|
|
85
|
+
|
|
86
|
+
'categories': ((value['categories'] as Array<any>).map(ReportCategoryToJSON)),
|
|
87
|
+
'reports': ((value['reports'] as Array<any>).map(ReportDefinitionToJSON)),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|