@easyedu/js-lsm-api 1.55.0 → 1.57.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.
Files changed (77) hide show
  1. package/.openapi-generator/FILES +8 -0
  2. package/README.md +11 -2
  3. package/dist/apis/ContentApi.d.ts +21 -1
  4. package/dist/apis/ContentApi.js +51 -0
  5. package/dist/apis/CourseApi.d.ts +23 -1
  6. package/dist/apis/CourseApi.js +55 -0
  7. package/dist/apis/ModuleApi.d.ts +20 -1
  8. package/dist/apis/ModuleApi.js +47 -0
  9. package/dist/apis/PortalApi.d.ts +32 -1
  10. package/dist/apis/PortalApi.js +99 -0
  11. package/dist/esm/apis/ContentApi.d.ts +21 -1
  12. package/dist/esm/apis/ContentApi.js +52 -1
  13. package/dist/esm/apis/CourseApi.d.ts +23 -1
  14. package/dist/esm/apis/CourseApi.js +56 -1
  15. package/dist/esm/apis/ModuleApi.d.ts +20 -1
  16. package/dist/esm/apis/ModuleApi.js +48 -1
  17. package/dist/esm/apis/PortalApi.d.ts +32 -1
  18. package/dist/esm/apis/PortalApi.js +100 -1
  19. package/dist/esm/models/GetCourseEnrollment.d.ts +15 -1
  20. package/dist/esm/models/GetCourseEnrollment.js +6 -1
  21. package/dist/esm/models/GetCourseEnrollmentListItem.d.ts +5 -0
  22. package/dist/esm/models/GetCourseEnrollmentListItem.js +6 -1
  23. package/dist/esm/models/GetPortal.d.ts +6 -0
  24. package/dist/esm/models/GetPortal.js +2 -0
  25. package/dist/esm/models/GetPortalFaviconUpload.d.ts +32 -0
  26. package/dist/esm/models/GetPortalFaviconUpload.js +43 -0
  27. package/dist/esm/models/PostDuplicate.d.ts +32 -0
  28. package/dist/esm/models/PostDuplicate.js +41 -0
  29. package/dist/esm/models/PostDuplicate1.d.ts +32 -0
  30. package/dist/esm/models/PostDuplicate1.js +41 -0
  31. package/dist/esm/models/PostDuplicate2.d.ts +32 -0
  32. package/dist/esm/models/PostDuplicate2.js +41 -0
  33. package/dist/esm/models/PutCourseEnrollment.d.ts +7 -1
  34. package/dist/esm/models/PutCourseEnrollment.js +4 -1
  35. package/dist/esm/models/index.d.ts +4 -0
  36. package/dist/esm/models/index.js +4 -0
  37. package/dist/models/GetCourseEnrollment.d.ts +15 -1
  38. package/dist/models/GetCourseEnrollment.js +6 -1
  39. package/dist/models/GetCourseEnrollmentListItem.d.ts +5 -0
  40. package/dist/models/GetCourseEnrollmentListItem.js +6 -1
  41. package/dist/models/GetPortal.d.ts +6 -0
  42. package/dist/models/GetPortal.js +2 -0
  43. package/dist/models/GetPortalFaviconUpload.d.ts +32 -0
  44. package/dist/models/GetPortalFaviconUpload.js +50 -0
  45. package/dist/models/PostDuplicate.d.ts +32 -0
  46. package/dist/models/PostDuplicate.js +48 -0
  47. package/dist/models/PostDuplicate1.d.ts +32 -0
  48. package/dist/models/PostDuplicate1.js +48 -0
  49. package/dist/models/PostDuplicate2.d.ts +32 -0
  50. package/dist/models/PostDuplicate2.js +48 -0
  51. package/dist/models/PutCourseEnrollment.d.ts +7 -1
  52. package/dist/models/PutCourseEnrollment.js +4 -1
  53. package/dist/models/index.d.ts +4 -0
  54. package/dist/models/index.js +4 -0
  55. package/docs/ContentApi.md +78 -0
  56. package/docs/CourseApi.md +86 -2
  57. package/docs/GetPortal.md +2 -0
  58. package/docs/GetPortalFaviconUpload.md +34 -0
  59. package/docs/ModuleApi.md +75 -0
  60. package/docs/PortalApi.md +138 -0
  61. package/docs/PostDuplicate.md +35 -0
  62. package/docs/PostDuplicate1.md +35 -0
  63. package/docs/PostDuplicate2.md +35 -0
  64. package/package.json +1 -1
  65. package/src/apis/ContentApi.ts +76 -0
  66. package/src/apis/CourseApi.ts +78 -0
  67. package/src/apis/ModuleApi.ts +67 -0
  68. package/src/apis/PortalApi.ts +129 -0
  69. package/src/models/GetCourseEnrollment.ts +16 -2
  70. package/src/models/GetCourseEnrollmentListItem.ts +6 -1
  71. package/src/models/GetPortal.ts +8 -0
  72. package/src/models/GetPortalFaviconUpload.ts +66 -0
  73. package/src/models/PostDuplicate.ts +65 -0
  74. package/src/models/PostDuplicate1.ts +65 -0
  75. package/src/models/PostDuplicate2.ts +65 -0
  76. package/src/models/PutCourseEnrollment.ts +8 -2
  77. package/src/models/index.ts +4 -0
package/docs/PortalApi.md CHANGED
@@ -4,18 +4,86 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  |------------- | ------------- | -------------|
7
+ | [**deletePortalFavicon**](PortalApi.md#deleteportalfavicon) | **DELETE** /portals/{portalId}/branding/favicon | Remove the portal favicon |
7
8
  | [**deletePortalLogo**](PortalApi.md#deleteportallogo) | **DELETE** /portals/{portalId}/branding/logo | Remove the portal logo |
8
9
  | [**getPortalById**](PortalApi.md#getportalbyid) | **GET** /portals/{portalId} | Get a portal by id (can use \'current\' to get the current users selected portal) |
9
10
  | [**getPortalList**](PortalApi.md#getportallist) | **GET** /portals | Get all portals a user has access to |
10
11
  | [**getPortalUsers**](PortalApi.md#getportalusers) | **GET** /portals/{portalId}/users | Get all users for a portal with optional role filtering |
11
12
  | [**inviteUserToPortal**](PortalApi.md#inviteusertoportal) | **POST** /portals/{portalId}/invite | Invite a new user to a portal |
12
13
  | [**postPortal**](PortalApi.md#postportal) | **POST** /portals | Create a new portal as a child of the current selected portal |
14
+ | [**postPortalFaviconUpload**](PortalApi.md#postportalfaviconupload) | **POST** /portals/{portalId}/branding/favicon | Upload a favicon image for portal branding |
13
15
  | [**postPortalLogoUpload**](PortalApi.md#postportallogoupload) | **POST** /portals/{portalId}/branding/logo | Upload a logo image for portal branding |
14
16
  | [**putPortalBranding**](PortalApi.md#putportalbranding) | **PUT** /portals/{portalId} | Update portal branding (name, background color, text color) |
15
17
  | [**updateSelectedPortal**](PortalApi.md#updateselectedportal) | **PUT** /portals/{portalId}/selected | Update the users current selected portal. Returns new JWT with updated roles. |
16
18
 
17
19
 
18
20
 
21
+ ## deletePortalFavicon
22
+
23
+ > deletePortalFavicon(portalId)
24
+
25
+ Remove the portal favicon
26
+
27
+ ### Example
28
+
29
+ ```ts
30
+ import {
31
+ Configuration,
32
+ PortalApi,
33
+ } from '@easyedu/js-lsm-api';
34
+ import type { DeletePortalFaviconRequest } from '@easyedu/js-lsm-api';
35
+
36
+ async function example() {
37
+ console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
38
+ const api = new PortalApi();
39
+
40
+ const body = {
41
+ // string
42
+ portalId: portalId_example,
43
+ } satisfies DeletePortalFaviconRequest;
44
+
45
+ try {
46
+ const data = await api.deletePortalFavicon(body);
47
+ console.log(data);
48
+ } catch (error) {
49
+ console.error(error);
50
+ }
51
+ }
52
+
53
+ // Run the test
54
+ example().catch(console.error);
55
+ ```
56
+
57
+ ### Parameters
58
+
59
+
60
+ | Name | Type | Description | Notes |
61
+ |------------- | ------------- | ------------- | -------------|
62
+ | **portalId** | `string` | | [Defaults to `undefined`] |
63
+
64
+ ### Return type
65
+
66
+ `void` (Empty response body)
67
+
68
+ ### Authorization
69
+
70
+ No authorization required
71
+
72
+ ### HTTP request headers
73
+
74
+ - **Content-Type**: Not defined
75
+ - **Accept**: Not defined
76
+
77
+
78
+ ### HTTP response details
79
+ | Status code | Description | Response headers |
80
+ |-------------|-------------|------------------|
81
+ | **204** | Favicon removed successfully | - |
82
+ | **404** | Portal not found | - |
83
+
84
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
85
+
86
+
19
87
  ## deletePortalLogo
20
88
 
21
89
  > deletePortalLogo(portalId)
@@ -421,6 +489,76 @@ No authorization required
421
489
  [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
422
490
 
423
491
 
492
+ ## postPortalFaviconUpload
493
+
494
+ > GetPortalFaviconUpload postPortalFaviconUpload(portalId, file)
495
+
496
+ Upload a favicon image for portal branding
497
+
498
+ ### Example
499
+
500
+ ```ts
501
+ import {
502
+ Configuration,
503
+ PortalApi,
504
+ } from '@easyedu/js-lsm-api';
505
+ import type { PostPortalFaviconUploadRequest } from '@easyedu/js-lsm-api';
506
+
507
+ async function example() {
508
+ console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
509
+ const api = new PortalApi();
510
+
511
+ const body = {
512
+ // string
513
+ portalId: portalId_example,
514
+ // Blob | Favicon image file (PNG, ICO, or SVG). Max 1MB.
515
+ file: BINARY_DATA_HERE,
516
+ } satisfies PostPortalFaviconUploadRequest;
517
+
518
+ try {
519
+ const data = await api.postPortalFaviconUpload(body);
520
+ console.log(data);
521
+ } catch (error) {
522
+ console.error(error);
523
+ }
524
+ }
525
+
526
+ // Run the test
527
+ example().catch(console.error);
528
+ ```
529
+
530
+ ### Parameters
531
+
532
+
533
+ | Name | Type | Description | Notes |
534
+ |------------- | ------------- | ------------- | -------------|
535
+ | **portalId** | `string` | | [Defaults to `undefined`] |
536
+ | **file** | `Blob` | Favicon image file (PNG, ICO, or SVG). Max 1MB. | [Defaults to `undefined`] |
537
+
538
+ ### Return type
539
+
540
+ [**GetPortalFaviconUpload**](GetPortalFaviconUpload.md)
541
+
542
+ ### Authorization
543
+
544
+ No authorization required
545
+
546
+ ### HTTP request headers
547
+
548
+ - **Content-Type**: `multipart/form-data`
549
+ - **Accept**: `application/json`
550
+
551
+
552
+ ### HTTP response details
553
+ | Status code | Description | Response headers |
554
+ |-------------|-------------|------------------|
555
+ | **200** | Favicon uploaded successfully | - |
556
+ | **400** | Invalid file type or file too large | - |
557
+ | **404** | Portal not found | - |
558
+
559
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
560
+
561
+
424
562
  ## postPortalLogoUpload
425
563
 
426
564
  > GetPortalLogoUpload postPortalLogoUpload(portalId, file)
@@ -0,0 +1,35 @@
1
+
2
+ # PostDuplicate
3
+
4
+ Optional body for duplicating a course
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `name` | string
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { PostDuplicate } from '@easyedu/js-lsm-api'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "name": null,
20
+ } satisfies PostDuplicate
21
+
22
+ console.log(example)
23
+
24
+ // Convert the instance to a JSON string
25
+ const exampleJSON: string = JSON.stringify(example)
26
+ console.log(exampleJSON)
27
+
28
+ // Parse the JSON string back to an object
29
+ const exampleParsed = JSON.parse(exampleJSON) as PostDuplicate
30
+ console.log(exampleParsed)
31
+ ```
32
+
33
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
34
+
35
+
@@ -0,0 +1,35 @@
1
+
2
+ # PostDuplicate1
3
+
4
+ Optional body for duplicating a module
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `name` | string
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { PostDuplicate1 } from '@easyedu/js-lsm-api'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "name": null,
20
+ } satisfies PostDuplicate1
21
+
22
+ console.log(example)
23
+
24
+ // Convert the instance to a JSON string
25
+ const exampleJSON: string = JSON.stringify(example)
26
+ console.log(exampleJSON)
27
+
28
+ // Parse the JSON string back to an object
29
+ const exampleParsed = JSON.parse(exampleJSON) as PostDuplicate1
30
+ console.log(exampleParsed)
31
+ ```
32
+
33
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
34
+
35
+
@@ -0,0 +1,35 @@
1
+
2
+ # PostDuplicate2
3
+
4
+ Optional body for duplicating a content item
5
+
6
+ ## Properties
7
+
8
+ Name | Type
9
+ ------------ | -------------
10
+ `name` | string
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { PostDuplicate2 } from '@easyedu/js-lsm-api'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "name": null,
20
+ } satisfies PostDuplicate2
21
+
22
+ console.log(example)
23
+
24
+ // Convert the instance to a JSON string
25
+ const exampleJSON: string = JSON.stringify(example)
26
+ console.log(exampleJSON)
27
+
28
+ // Parse the JSON string back to an object
29
+ const exampleParsed = JSON.parse(exampleJSON) as PostDuplicate2
30
+ console.log(exampleParsed)
31
+ ```
32
+
33
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
34
+
35
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easyedu/js-lsm-api",
3
- "version": "1.55.0",
3
+ "version": "1.57.0",
4
4
  "description": "OpenAPI client for @easyedu/js-lsm-api",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -29,6 +29,7 @@ import type {
29
29
  PostContentQuiz,
30
30
  PostContentSession,
31
31
  PostContentUpload,
32
+ PostDuplicate2,
32
33
  PostVerifyManifest,
33
34
  PutContent,
34
35
  PutContentReorder,
@@ -66,6 +67,8 @@ import {
66
67
  PostContentSessionToJSON,
67
68
  PostContentUploadFromJSON,
68
69
  PostContentUploadToJSON,
70
+ PostDuplicate2FromJSON,
71
+ PostDuplicate2ToJSON,
69
72
  PostVerifyManifestFromJSON,
70
73
  PostVerifyManifestToJSON,
71
74
  PutContentFromJSON,
@@ -158,6 +161,13 @@ export interface ListContentSessionsRequest {
158
161
  pageSize?: number;
159
162
  }
160
163
 
164
+ export interface PostContentDuplicateRequest {
165
+ courseId: string;
166
+ moduleId: string;
167
+ contentId: string;
168
+ postDuplicate2?: PostDuplicate2;
169
+ }
170
+
161
171
  export interface PostContentProcessRequest {
162
172
  moduleId: string;
163
173
  courseId: string;
@@ -988,6 +998,72 @@ export class ContentApi extends runtime.BaseAPI {
988
998
  return await response.value();
989
999
  }
990
1000
 
1001
+ /**
1002
+ * Creates request options for postContentDuplicate without sending the request
1003
+ */
1004
+ async postContentDuplicateRequestOpts(requestParameters: PostContentDuplicateRequest): Promise<runtime.RequestOpts> {
1005
+ if (requestParameters['courseId'] == null) {
1006
+ throw new runtime.RequiredError(
1007
+ 'courseId',
1008
+ 'Required parameter "courseId" was null or undefined when calling postContentDuplicate().'
1009
+ );
1010
+ }
1011
+
1012
+ if (requestParameters['moduleId'] == null) {
1013
+ throw new runtime.RequiredError(
1014
+ 'moduleId',
1015
+ 'Required parameter "moduleId" was null or undefined when calling postContentDuplicate().'
1016
+ );
1017
+ }
1018
+
1019
+ if (requestParameters['contentId'] == null) {
1020
+ throw new runtime.RequiredError(
1021
+ 'contentId',
1022
+ 'Required parameter "contentId" was null or undefined when calling postContentDuplicate().'
1023
+ );
1024
+ }
1025
+
1026
+ const queryParameters: any = {};
1027
+
1028
+ const headerParameters: runtime.HTTPHeaders = {};
1029
+
1030
+ headerParameters['Content-Type'] = 'application/json';
1031
+
1032
+
1033
+ let urlPath = `/courses/{courseId}/modules/{moduleId}/contents/{contentId}/duplicate`;
1034
+ urlPath = urlPath.replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId'])));
1035
+ urlPath = urlPath.replace(`{${"moduleId"}}`, encodeURIComponent(String(requestParameters['moduleId'])));
1036
+ urlPath = urlPath.replace(`{${"contentId"}}`, encodeURIComponent(String(requestParameters['contentId'])));
1037
+
1038
+ return {
1039
+ path: urlPath,
1040
+ method: 'POST',
1041
+ headers: headerParameters,
1042
+ query: queryParameters,
1043
+ body: PostDuplicate2ToJSON(requestParameters['postDuplicate2']),
1044
+ };
1045
+ }
1046
+
1047
+ /**
1048
+ * Deep-clones a content item including version records, SCORM hierarchy, and quiz configuration within the same module.
1049
+ * Duplicate a content item
1050
+ */
1051
+ async postContentDuplicateRaw(requestParameters: PostContentDuplicateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetContent>> {
1052
+ const requestOptions = await this.postContentDuplicateRequestOpts(requestParameters);
1053
+ const response = await this.request(requestOptions, initOverrides);
1054
+
1055
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetContentFromJSON(jsonValue));
1056
+ }
1057
+
1058
+ /**
1059
+ * Deep-clones a content item including version records, SCORM hierarchy, and quiz configuration within the same module.
1060
+ * Duplicate a content item
1061
+ */
1062
+ async postContentDuplicate(requestParameters: PostContentDuplicateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetContent> {
1063
+ const response = await this.postContentDuplicateRaw(requestParameters, initOverrides);
1064
+ return await response.value();
1065
+ }
1066
+
991
1067
  /**
992
1068
  * Creates request options for postContentProcess without sending the request
993
1069
  */
@@ -26,6 +26,7 @@ import type {
26
26
  PostCourse,
27
27
  PostCourseEnrollment,
28
28
  PostCourseExport,
29
+ PostDuplicate,
29
30
  PutCourse,
30
31
  PutCourseEnrollment,
31
32
  } from '../models/index';
@@ -52,6 +53,8 @@ import {
52
53
  PostCourseEnrollmentToJSON,
53
54
  PostCourseExportFromJSON,
54
55
  PostCourseExportToJSON,
56
+ PostDuplicateFromJSON,
57
+ PostDuplicateToJSON,
55
58
  PutCourseFromJSON,
56
59
  PutCourseToJSON,
57
60
  PutCourseEnrollmentFromJSON,
@@ -74,6 +77,7 @@ export interface GetCourseEnrollmentRequest {
74
77
  export interface GetCourseEnrollmentsRequest {
75
78
  courseId: string;
76
79
  type?: GetCourseEnrollmentsTypeEnum;
80
+ status?: string;
77
81
  page?: number;
78
82
  pageSize?: number;
79
83
  }
@@ -90,7 +94,10 @@ export interface GetCourseExportsRequest {
90
94
  }
91
95
 
92
96
  export interface GetCourseListRequest {
97
+ page?: number;
98
+ pageSize?: number;
93
99
  enrolled?: boolean;
100
+ search?: string;
94
101
  }
95
102
 
96
103
  export interface GetCourseReportingBasicRequest {
@@ -101,6 +108,11 @@ export interface PostCourseRequest {
101
108
  postCourse: PostCourse;
102
109
  }
103
110
 
111
+ export interface PostCourseDuplicateRequest {
112
+ courseId: string;
113
+ postDuplicate?: PostDuplicate;
114
+ }
115
+
104
116
  export interface PostCourseEnrollmentRequest {
105
117
  courseId: string;
106
118
  postCourseEnrollment: PostCourseEnrollment;
@@ -291,6 +303,10 @@ export class CourseApi extends runtime.BaseAPI {
291
303
  queryParameters['type'] = requestParameters['type'];
292
304
  }
293
305
 
306
+ if (requestParameters['status'] != null) {
307
+ queryParameters['status'] = requestParameters['status'];
308
+ }
309
+
294
310
  if (requestParameters['page'] != null) {
295
311
  queryParameters['page'] = requestParameters['page'];
296
312
  }
@@ -443,10 +459,22 @@ export class CourseApi extends runtime.BaseAPI {
443
459
  async getCourseListRequestOpts(requestParameters: GetCourseListRequest): Promise<runtime.RequestOpts> {
444
460
  const queryParameters: any = {};
445
461
 
462
+ if (requestParameters['page'] != null) {
463
+ queryParameters['page'] = requestParameters['page'];
464
+ }
465
+
466
+ if (requestParameters['pageSize'] != null) {
467
+ queryParameters['pageSize'] = requestParameters['pageSize'];
468
+ }
469
+
446
470
  if (requestParameters['enrolled'] != null) {
447
471
  queryParameters['enrolled'] = requestParameters['enrolled'];
448
472
  }
449
473
 
474
+ if (requestParameters['search'] != null) {
475
+ queryParameters['search'] = requestParameters['search'];
476
+ }
477
+
450
478
  const headerParameters: runtime.HTTPHeaders = {};
451
479
 
452
480
 
@@ -570,6 +598,56 @@ export class CourseApi extends runtime.BaseAPI {
570
598
  return await response.value();
571
599
  }
572
600
 
601
+ /**
602
+ * Creates request options for postCourseDuplicate without sending the request
603
+ */
604
+ async postCourseDuplicateRequestOpts(requestParameters: PostCourseDuplicateRequest): Promise<runtime.RequestOpts> {
605
+ if (requestParameters['courseId'] == null) {
606
+ throw new runtime.RequiredError(
607
+ 'courseId',
608
+ 'Required parameter "courseId" was null or undefined when calling postCourseDuplicate().'
609
+ );
610
+ }
611
+
612
+ const queryParameters: any = {};
613
+
614
+ const headerParameters: runtime.HTTPHeaders = {};
615
+
616
+ headerParameters['Content-Type'] = 'application/json';
617
+
618
+
619
+ let urlPath = `/courses/{courseId}/duplicate`;
620
+ urlPath = urlPath.replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId'])));
621
+
622
+ return {
623
+ path: urlPath,
624
+ method: 'POST',
625
+ headers: headerParameters,
626
+ query: queryParameters,
627
+ body: PostDuplicateToJSON(requestParameters['postDuplicate']),
628
+ };
629
+ }
630
+
631
+ /**
632
+ * Deep-clones a course including all modules, content, versions, SCORM hierarchy, and quiz configuration within the caller\'s portal.
633
+ * Duplicate a course
634
+ */
635
+ async postCourseDuplicateRaw(requestParameters: PostCourseDuplicateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetCourse>> {
636
+ const requestOptions = await this.postCourseDuplicateRequestOpts(requestParameters);
637
+ const response = await this.request(requestOptions, initOverrides);
638
+
639
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetCourseFromJSON(jsonValue));
640
+ }
641
+
642
+ /**
643
+ * Deep-clones a course including all modules, content, versions, SCORM hierarchy, and quiz configuration within the caller\'s portal.
644
+ * Duplicate a course
645
+ */
646
+ async postCourseDuplicate(requestParameters: PostCourseDuplicateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetCourse> {
647
+ const response = await this.postCourseDuplicateRaw(requestParameters, initOverrides);
648
+ return await response.value();
649
+ }
650
+
573
651
  /**
574
652
  * Creates request options for postCourseEnrollment without sending the request
575
653
  */
@@ -17,6 +17,7 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  GetModule,
19
19
  GetModuleList,
20
+ PostDuplicate1,
20
21
  PostModule,
21
22
  PutModule,
22
23
  PutModuleReorder,
@@ -26,6 +27,8 @@ import {
26
27
  GetModuleToJSON,
27
28
  GetModuleListFromJSON,
28
29
  GetModuleListToJSON,
30
+ PostDuplicate1FromJSON,
31
+ PostDuplicate1ToJSON,
29
32
  PostModuleFromJSON,
30
33
  PostModuleToJSON,
31
34
  PutModuleFromJSON,
@@ -48,6 +51,12 @@ export interface PostModuleRequest {
48
51
  postModule: PostModule;
49
52
  }
50
53
 
54
+ export interface PostModuleDuplicateRequest {
55
+ courseId: string;
56
+ moduleId: string;
57
+ postDuplicate1?: PostDuplicate1;
58
+ }
59
+
51
60
  export interface PutModuleRequest {
52
61
  moduleId: string;
53
62
  courseId: string;
@@ -217,6 +226,64 @@ export class ModuleApi extends runtime.BaseAPI {
217
226
  return await response.value();
218
227
  }
219
228
 
229
+ /**
230
+ * Creates request options for postModuleDuplicate without sending the request
231
+ */
232
+ async postModuleDuplicateRequestOpts(requestParameters: PostModuleDuplicateRequest): Promise<runtime.RequestOpts> {
233
+ if (requestParameters['courseId'] == null) {
234
+ throw new runtime.RequiredError(
235
+ 'courseId',
236
+ 'Required parameter "courseId" was null or undefined when calling postModuleDuplicate().'
237
+ );
238
+ }
239
+
240
+ if (requestParameters['moduleId'] == null) {
241
+ throw new runtime.RequiredError(
242
+ 'moduleId',
243
+ 'Required parameter "moduleId" was null or undefined when calling postModuleDuplicate().'
244
+ );
245
+ }
246
+
247
+ const queryParameters: any = {};
248
+
249
+ const headerParameters: runtime.HTTPHeaders = {};
250
+
251
+ headerParameters['Content-Type'] = 'application/json';
252
+
253
+
254
+ let urlPath = `/courses/{courseId}/modules/{moduleId}/duplicate`;
255
+ urlPath = urlPath.replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId'])));
256
+ urlPath = urlPath.replace(`{${"moduleId"}}`, encodeURIComponent(String(requestParameters['moduleId'])));
257
+
258
+ return {
259
+ path: urlPath,
260
+ method: 'POST',
261
+ headers: headerParameters,
262
+ query: queryParameters,
263
+ body: PostDuplicate1ToJSON(requestParameters['postDuplicate1']),
264
+ };
265
+ }
266
+
267
+ /**
268
+ * Deep-clones a module including all content, versions, SCORM hierarchy, and quiz configuration within the same course.
269
+ * Duplicate a module
270
+ */
271
+ async postModuleDuplicateRaw(requestParameters: PostModuleDuplicateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetModule>> {
272
+ const requestOptions = await this.postModuleDuplicateRequestOpts(requestParameters);
273
+ const response = await this.request(requestOptions, initOverrides);
274
+
275
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetModuleFromJSON(jsonValue));
276
+ }
277
+
278
+ /**
279
+ * Deep-clones a module including all content, versions, SCORM hierarchy, and quiz configuration within the same course.
280
+ * Duplicate a module
281
+ */
282
+ async postModuleDuplicate(requestParameters: PostModuleDuplicateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetModule> {
283
+ const response = await this.postModuleDuplicateRaw(requestParameters, initOverrides);
284
+ return await response.value();
285
+ }
286
+
220
287
  /**
221
288
  * Creates request options for putModule without sending the request
222
289
  */