@easyedu/js-lsm-api 1.26.0 → 1.28.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 +8 -0
- package/README.md +2 -2
- package/dist/apis/ContentApi.d.ts +64 -1
- package/dist/apis/ContentApi.js +155 -0
- package/dist/esm/apis/ContentApi.d.ts +64 -1
- package/dist/esm/apis/ContentApi.js +156 -1
- package/dist/esm/models/GetContent.d.ts +19 -1
- package/dist/esm/models/GetContent.js +3 -0
- package/dist/esm/models/GetContentVersion.d.ts +76 -0
- package/dist/esm/models/GetContentVersion.js +71 -0
- package/dist/esm/models/GetContentVersionList.d.ts +57 -0
- package/dist/esm/models/GetContentVersionList.js +60 -0
- package/dist/esm/models/GetContentVersionListItemsInner.d.ts +56 -0
- package/dist/esm/models/GetContentVersionListItemsInner.js +59 -0
- package/dist/esm/models/GetContentVersionSandbox.d.ts +32 -0
- package/dist/esm/models/GetContentVersionSandbox.js +43 -0
- package/dist/esm/models/GetContentVersionScormData.d.ts +32 -0
- package/dist/esm/models/GetContentVersionScormData.js +43 -0
- package/dist/esm/models/GetScormPackage.d.ts +39 -0
- package/dist/esm/models/GetScormPackage.js +48 -0
- package/dist/esm/models/GetScormPackagePackageInfo.d.ts +104 -0
- package/dist/esm/models/GetScormPackagePackageInfo.js +81 -0
- package/dist/esm/models/PutContentVersion.d.ts +32 -0
- package/dist/esm/models/PutContentVersion.js +43 -0
- package/dist/esm/models/index.d.ts +8 -0
- package/dist/esm/models/index.js +8 -0
- package/dist/models/GetContent.d.ts +19 -1
- package/dist/models/GetContent.js +3 -0
- package/dist/models/GetContentVersion.d.ts +76 -0
- package/dist/models/GetContentVersion.js +78 -0
- package/dist/models/GetContentVersionList.d.ts +57 -0
- package/dist/models/GetContentVersionList.js +67 -0
- package/dist/models/GetContentVersionListItemsInner.d.ts +56 -0
- package/dist/models/GetContentVersionListItemsInner.js +66 -0
- package/dist/models/GetContentVersionSandbox.d.ts +32 -0
- package/dist/models/GetContentVersionSandbox.js +50 -0
- package/dist/models/GetContentVersionScormData.d.ts +32 -0
- package/dist/models/GetContentVersionScormData.js +50 -0
- package/dist/models/GetScormPackage.d.ts +39 -0
- package/dist/models/GetScormPackage.js +55 -0
- package/dist/models/GetScormPackagePackageInfo.d.ts +104 -0
- package/dist/models/GetScormPackagePackageInfo.js +88 -0
- package/dist/models/PutContentVersion.d.ts +32 -0
- package/dist/models/PutContentVersion.js +50 -0
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.js +8 -0
- package/package.json +1 -1
- package/src/apis/ContentApi.ts +253 -0
- package/src/models/GetContent.ts +22 -1
- package/src/models/GetContentVersion.ts +143 -0
- package/src/models/GetContentVersionList.ts +110 -0
- package/src/models/GetContentVersionListItemsInner.ts +102 -0
- package/src/models/GetContentVersionSandbox.ts +66 -0
- package/src/models/GetContentVersionScormData.ts +66 -0
- package/src/models/GetScormPackage.ts +83 -0
- package/src/models/GetScormPackagePackageInfo.ts +169 -0
- package/src/models/PutContentVersion.ts +66 -0
- package/src/models/index.ts +8 -0
package/dist/models/index.d.ts
CHANGED
|
@@ -16,6 +16,11 @@ export * from './GetContentInstructorBasicReportingPerformance';
|
|
|
16
16
|
export * from './GetContentList';
|
|
17
17
|
export * from './GetContentSession';
|
|
18
18
|
export * from './GetContentUpload';
|
|
19
|
+
export * from './GetContentVersion';
|
|
20
|
+
export * from './GetContentVersionList';
|
|
21
|
+
export * from './GetContentVersionListItemsInner';
|
|
22
|
+
export * from './GetContentVersionSandbox';
|
|
23
|
+
export * from './GetContentVersionScormData';
|
|
19
24
|
export * from './GetCourse';
|
|
20
25
|
export * from './GetCourseEnrollment';
|
|
21
26
|
export * from './GetCourseEnrollmentList';
|
|
@@ -98,6 +103,8 @@ export * from './GetQuizResultsQuestionsInnerStudentAnswer';
|
|
|
98
103
|
export * from './GetQuizResultsScore';
|
|
99
104
|
export * from './GetQuizResultsTiming';
|
|
100
105
|
export * from './GetQuizStatistics';
|
|
106
|
+
export * from './GetScormPackage';
|
|
107
|
+
export * from './GetScormPackagePackageInfo';
|
|
101
108
|
export * from './GetUser';
|
|
102
109
|
export * from './GetUserQuizAttempts';
|
|
103
110
|
export * from './GetUserQuizAttemptsAllOfAttempts';
|
|
@@ -146,6 +153,7 @@ export * from './PostQuizSettings';
|
|
|
146
153
|
export * from './PostResetPassword';
|
|
147
154
|
export * from './PostSendResetPassword';
|
|
148
155
|
export * from './PutContent';
|
|
156
|
+
export * from './PutContentVersion';
|
|
149
157
|
export * from './PutCourse';
|
|
150
158
|
export * from './PutCourseEnrollment';
|
|
151
159
|
export * from './PutModule';
|
package/dist/models/index.js
CHANGED
|
@@ -34,6 +34,11 @@ __exportStar(require("./GetContentInstructorBasicReportingPerformance"), exports
|
|
|
34
34
|
__exportStar(require("./GetContentList"), exports);
|
|
35
35
|
__exportStar(require("./GetContentSession"), exports);
|
|
36
36
|
__exportStar(require("./GetContentUpload"), exports);
|
|
37
|
+
__exportStar(require("./GetContentVersion"), exports);
|
|
38
|
+
__exportStar(require("./GetContentVersionList"), exports);
|
|
39
|
+
__exportStar(require("./GetContentVersionListItemsInner"), exports);
|
|
40
|
+
__exportStar(require("./GetContentVersionSandbox"), exports);
|
|
41
|
+
__exportStar(require("./GetContentVersionScormData"), exports);
|
|
37
42
|
__exportStar(require("./GetCourse"), exports);
|
|
38
43
|
__exportStar(require("./GetCourseEnrollment"), exports);
|
|
39
44
|
__exportStar(require("./GetCourseEnrollmentList"), exports);
|
|
@@ -116,6 +121,8 @@ __exportStar(require("./GetQuizResultsQuestionsInnerStudentAnswer"), exports);
|
|
|
116
121
|
__exportStar(require("./GetQuizResultsScore"), exports);
|
|
117
122
|
__exportStar(require("./GetQuizResultsTiming"), exports);
|
|
118
123
|
__exportStar(require("./GetQuizStatistics"), exports);
|
|
124
|
+
__exportStar(require("./GetScormPackage"), exports);
|
|
125
|
+
__exportStar(require("./GetScormPackagePackageInfo"), exports);
|
|
119
126
|
__exportStar(require("./GetUser"), exports);
|
|
120
127
|
__exportStar(require("./GetUserQuizAttempts"), exports);
|
|
121
128
|
__exportStar(require("./GetUserQuizAttemptsAllOfAttempts"), exports);
|
|
@@ -164,6 +171,7 @@ __exportStar(require("./PostQuizSettings"), exports);
|
|
|
164
171
|
__exportStar(require("./PostResetPassword"), exports);
|
|
165
172
|
__exportStar(require("./PostSendResetPassword"), exports);
|
|
166
173
|
__exportStar(require("./PutContent"), exports);
|
|
174
|
+
__exportStar(require("./PutContentVersion"), exports);
|
|
167
175
|
__exportStar(require("./PutCourse"), exports);
|
|
168
176
|
__exportStar(require("./PutCourseEnrollment"), exports);
|
|
169
177
|
__exportStar(require("./PutModule"), exports);
|
package/package.json
CHANGED
package/src/apis/ContentApi.ts
CHANGED
|
@@ -19,10 +19,14 @@ import type {
|
|
|
19
19
|
GetContentList,
|
|
20
20
|
GetContentSession,
|
|
21
21
|
GetContentUpload,
|
|
22
|
+
GetContentVersion,
|
|
23
|
+
GetContentVersionList,
|
|
24
|
+
GetScormPackage,
|
|
22
25
|
PostContentQuiz,
|
|
23
26
|
PostContentSession,
|
|
24
27
|
PostContentUpload,
|
|
25
28
|
PutContent,
|
|
29
|
+
PutContentVersion,
|
|
26
30
|
} from '../models/index';
|
|
27
31
|
import {
|
|
28
32
|
GetContentFromJSON,
|
|
@@ -33,6 +37,12 @@ import {
|
|
|
33
37
|
GetContentSessionToJSON,
|
|
34
38
|
GetContentUploadFromJSON,
|
|
35
39
|
GetContentUploadToJSON,
|
|
40
|
+
GetContentVersionFromJSON,
|
|
41
|
+
GetContentVersionToJSON,
|
|
42
|
+
GetContentVersionListFromJSON,
|
|
43
|
+
GetContentVersionListToJSON,
|
|
44
|
+
GetScormPackageFromJSON,
|
|
45
|
+
GetScormPackageToJSON,
|
|
36
46
|
PostContentQuizFromJSON,
|
|
37
47
|
PostContentQuizToJSON,
|
|
38
48
|
PostContentSessionFromJSON,
|
|
@@ -41,6 +51,8 @@ import {
|
|
|
41
51
|
PostContentUploadToJSON,
|
|
42
52
|
PutContentFromJSON,
|
|
43
53
|
PutContentToJSON,
|
|
54
|
+
PutContentVersionFromJSON,
|
|
55
|
+
PutContentVersionToJSON,
|
|
44
56
|
} from '../models/index';
|
|
45
57
|
|
|
46
58
|
export interface GetContentRequest {
|
|
@@ -60,6 +72,25 @@ export interface GetContentSessionRequest {
|
|
|
60
72
|
courseId: string;
|
|
61
73
|
}
|
|
62
74
|
|
|
75
|
+
export interface GetContentVersionRequest {
|
|
76
|
+
contentId: string;
|
|
77
|
+
moduleId: string;
|
|
78
|
+
courseId: string;
|
|
79
|
+
versionId: string;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface GetContentVersionListRequest {
|
|
83
|
+
contentId: string;
|
|
84
|
+
moduleId: string;
|
|
85
|
+
courseId: string;
|
|
86
|
+
page?: number;
|
|
87
|
+
pageSize?: number;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export interface GetScormPackageRequest {
|
|
91
|
+
packageId: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
63
94
|
export interface PostContentProcessRequest {
|
|
64
95
|
moduleId: string;
|
|
65
96
|
courseId: string;
|
|
@@ -91,6 +122,14 @@ export interface PutContentRequest {
|
|
|
91
122
|
putContent: PutContent;
|
|
92
123
|
}
|
|
93
124
|
|
|
125
|
+
export interface PutContentVersionRequest {
|
|
126
|
+
contentId: string;
|
|
127
|
+
moduleId: string;
|
|
128
|
+
courseId: string;
|
|
129
|
+
versionId: string;
|
|
130
|
+
putContentVersion: PutContentVersion;
|
|
131
|
+
}
|
|
132
|
+
|
|
94
133
|
/**
|
|
95
134
|
*
|
|
96
135
|
*/
|
|
@@ -230,6 +269,154 @@ export class ContentApi extends runtime.BaseAPI {
|
|
|
230
269
|
return await response.value();
|
|
231
270
|
}
|
|
232
271
|
|
|
272
|
+
/**
|
|
273
|
+
* Returns detailed information about a specific version of the content, including sandbox launch URL and SCORM-specific data (package info and table of contents) if applicable.
|
|
274
|
+
* Get details of a specific content version
|
|
275
|
+
*/
|
|
276
|
+
async getContentVersionRaw(requestParameters: GetContentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetContentVersion>> {
|
|
277
|
+
if (requestParameters['contentId'] == null) {
|
|
278
|
+
throw new runtime.RequiredError(
|
|
279
|
+
'contentId',
|
|
280
|
+
'Required parameter "contentId" was null or undefined when calling getContentVersion().'
|
|
281
|
+
);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (requestParameters['moduleId'] == null) {
|
|
285
|
+
throw new runtime.RequiredError(
|
|
286
|
+
'moduleId',
|
|
287
|
+
'Required parameter "moduleId" was null or undefined when calling getContentVersion().'
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if (requestParameters['courseId'] == null) {
|
|
292
|
+
throw new runtime.RequiredError(
|
|
293
|
+
'courseId',
|
|
294
|
+
'Required parameter "courseId" was null or undefined when calling getContentVersion().'
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
if (requestParameters['versionId'] == null) {
|
|
299
|
+
throw new runtime.RequiredError(
|
|
300
|
+
'versionId',
|
|
301
|
+
'Required parameter "versionId" was null or undefined when calling getContentVersion().'
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const queryParameters: any = {};
|
|
306
|
+
|
|
307
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
308
|
+
|
|
309
|
+
const response = await this.request({
|
|
310
|
+
path: `/courses/{courseId}/modules/{moduleId}/contents/{contentId}/versions/{versionId}`.replace(`{${"contentId"}}`, encodeURIComponent(String(requestParameters['contentId']))).replace(`{${"moduleId"}}`, encodeURIComponent(String(requestParameters['moduleId']))).replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId']))).replace(`{${"versionId"}}`, encodeURIComponent(String(requestParameters['versionId']))),
|
|
311
|
+
method: 'GET',
|
|
312
|
+
headers: headerParameters,
|
|
313
|
+
query: queryParameters,
|
|
314
|
+
}, initOverrides);
|
|
315
|
+
|
|
316
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetContentVersionFromJSON(jsonValue));
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Returns detailed information about a specific version of the content, including sandbox launch URL and SCORM-specific data (package info and table of contents) if applicable.
|
|
321
|
+
* Get details of a specific content version
|
|
322
|
+
*/
|
|
323
|
+
async getContentVersion(requestParameters: GetContentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetContentVersion> {
|
|
324
|
+
const response = await this.getContentVersionRaw(requestParameters, initOverrides);
|
|
325
|
+
return await response.value();
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Returns a paginated list of all versions for the specified content. Returns an empty array if the content has no versions.
|
|
330
|
+
* Get all versions of a content
|
|
331
|
+
*/
|
|
332
|
+
async getContentVersionListRaw(requestParameters: GetContentVersionListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetContentVersionList>> {
|
|
333
|
+
if (requestParameters['contentId'] == null) {
|
|
334
|
+
throw new runtime.RequiredError(
|
|
335
|
+
'contentId',
|
|
336
|
+
'Required parameter "contentId" was null or undefined when calling getContentVersionList().'
|
|
337
|
+
);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
if (requestParameters['moduleId'] == null) {
|
|
341
|
+
throw new runtime.RequiredError(
|
|
342
|
+
'moduleId',
|
|
343
|
+
'Required parameter "moduleId" was null or undefined when calling getContentVersionList().'
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (requestParameters['courseId'] == null) {
|
|
348
|
+
throw new runtime.RequiredError(
|
|
349
|
+
'courseId',
|
|
350
|
+
'Required parameter "courseId" was null or undefined when calling getContentVersionList().'
|
|
351
|
+
);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const queryParameters: any = {};
|
|
355
|
+
|
|
356
|
+
if (requestParameters['page'] != null) {
|
|
357
|
+
queryParameters['page'] = requestParameters['page'];
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (requestParameters['pageSize'] != null) {
|
|
361
|
+
queryParameters['page_size'] = requestParameters['pageSize'];
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
365
|
+
|
|
366
|
+
const response = await this.request({
|
|
367
|
+
path: `/courses/{courseId}/modules/{moduleId}/contents/{contentId}/versions`.replace(`{${"contentId"}}`, encodeURIComponent(String(requestParameters['contentId']))).replace(`{${"moduleId"}}`, encodeURIComponent(String(requestParameters['moduleId']))).replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId']))),
|
|
368
|
+
method: 'GET',
|
|
369
|
+
headers: headerParameters,
|
|
370
|
+
query: queryParameters,
|
|
371
|
+
}, initOverrides);
|
|
372
|
+
|
|
373
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetContentVersionListFromJSON(jsonValue));
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* Returns a paginated list of all versions for the specified content. Returns an empty array if the content has no versions.
|
|
378
|
+
* Get all versions of a content
|
|
379
|
+
*/
|
|
380
|
+
async getContentVersionList(requestParameters: GetContentVersionListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetContentVersionList> {
|
|
381
|
+
const response = await this.getContentVersionListRaw(requestParameters, initOverrides);
|
|
382
|
+
return await response.value();
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Returns package information and table of contents for a SCORM package
|
|
387
|
+
* Get details of a SCORM package
|
|
388
|
+
*/
|
|
389
|
+
async getScormPackageRaw(requestParameters: GetScormPackageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetScormPackage>> {
|
|
390
|
+
if (requestParameters['packageId'] == null) {
|
|
391
|
+
throw new runtime.RequiredError(
|
|
392
|
+
'packageId',
|
|
393
|
+
'Required parameter "packageId" was null or undefined when calling getScormPackage().'
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
const queryParameters: any = {};
|
|
398
|
+
|
|
399
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
400
|
+
|
|
401
|
+
const response = await this.request({
|
|
402
|
+
path: `/scorm/packages/{packageId}`.replace(`{${"packageId"}}`, encodeURIComponent(String(requestParameters['packageId']))),
|
|
403
|
+
method: 'GET',
|
|
404
|
+
headers: headerParameters,
|
|
405
|
+
query: queryParameters,
|
|
406
|
+
}, initOverrides);
|
|
407
|
+
|
|
408
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetScormPackageFromJSON(jsonValue));
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Returns package information and table of contents for a SCORM package
|
|
413
|
+
* Get details of a SCORM package
|
|
414
|
+
*/
|
|
415
|
+
async getScormPackage(requestParameters: GetScormPackageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetScormPackage> {
|
|
416
|
+
const response = await this.getScormPackageRaw(requestParameters, initOverrides);
|
|
417
|
+
return await response.value();
|
|
418
|
+
}
|
|
419
|
+
|
|
233
420
|
/**
|
|
234
421
|
* Post a new content process
|
|
235
422
|
*/
|
|
@@ -483,4 +670,70 @@ export class ContentApi extends runtime.BaseAPI {
|
|
|
483
670
|
return await response.value();
|
|
484
671
|
}
|
|
485
672
|
|
|
673
|
+
/**
|
|
674
|
+
* Activates this version by setting is_active to true. Automatically deactivates all other versions of the same content. Only setting is_active to true is allowed.
|
|
675
|
+
* Update a content version
|
|
676
|
+
*/
|
|
677
|
+
async putContentVersionRaw(requestParameters: PutContentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetContentVersion>> {
|
|
678
|
+
if (requestParameters['contentId'] == null) {
|
|
679
|
+
throw new runtime.RequiredError(
|
|
680
|
+
'contentId',
|
|
681
|
+
'Required parameter "contentId" was null or undefined when calling putContentVersion().'
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
if (requestParameters['moduleId'] == null) {
|
|
686
|
+
throw new runtime.RequiredError(
|
|
687
|
+
'moduleId',
|
|
688
|
+
'Required parameter "moduleId" was null or undefined when calling putContentVersion().'
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
if (requestParameters['courseId'] == null) {
|
|
693
|
+
throw new runtime.RequiredError(
|
|
694
|
+
'courseId',
|
|
695
|
+
'Required parameter "courseId" was null or undefined when calling putContentVersion().'
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
if (requestParameters['versionId'] == null) {
|
|
700
|
+
throw new runtime.RequiredError(
|
|
701
|
+
'versionId',
|
|
702
|
+
'Required parameter "versionId" was null or undefined when calling putContentVersion().'
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
if (requestParameters['putContentVersion'] == null) {
|
|
707
|
+
throw new runtime.RequiredError(
|
|
708
|
+
'putContentVersion',
|
|
709
|
+
'Required parameter "putContentVersion" was null or undefined when calling putContentVersion().'
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
const queryParameters: any = {};
|
|
714
|
+
|
|
715
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
716
|
+
|
|
717
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
718
|
+
|
|
719
|
+
const response = await this.request({
|
|
720
|
+
path: `/courses/{courseId}/modules/{moduleId}/contents/{contentId}/versions/{versionId}`.replace(`{${"contentId"}}`, encodeURIComponent(String(requestParameters['contentId']))).replace(`{${"moduleId"}}`, encodeURIComponent(String(requestParameters['moduleId']))).replace(`{${"courseId"}}`, encodeURIComponent(String(requestParameters['courseId']))).replace(`{${"versionId"}}`, encodeURIComponent(String(requestParameters['versionId']))),
|
|
721
|
+
method: 'PUT',
|
|
722
|
+
headers: headerParameters,
|
|
723
|
+
query: queryParameters,
|
|
724
|
+
body: PutContentVersionToJSON(requestParameters['putContentVersion']),
|
|
725
|
+
}, initOverrides);
|
|
726
|
+
|
|
727
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetContentVersionFromJSON(jsonValue));
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
/**
|
|
731
|
+
* Activates this version by setting is_active to true. Automatically deactivates all other versions of the same content. Only setting is_active to true is allowed.
|
|
732
|
+
* Update a content version
|
|
733
|
+
*/
|
|
734
|
+
async putContentVersion(requestParameters: PutContentVersionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetContentVersion> {
|
|
735
|
+
const response = await this.putContentVersionRaw(requestParameters, initOverrides);
|
|
736
|
+
return await response.value();
|
|
737
|
+
}
|
|
738
|
+
|
|
486
739
|
}
|
package/src/models/GetContent.ts
CHANGED
|
@@ -87,6 +87,24 @@ export interface GetContent {
|
|
|
87
87
|
* @memberof GetContent
|
|
88
88
|
*/
|
|
89
89
|
readonly updatedDate?: Date;
|
|
90
|
+
/**
|
|
91
|
+
* Active version number for versioned content types (SCORM, Video, PDF, File)
|
|
92
|
+
* @type {number}
|
|
93
|
+
* @memberof GetContent
|
|
94
|
+
*/
|
|
95
|
+
readonly activeVersionNumber?: number;
|
|
96
|
+
/**
|
|
97
|
+
* Active version ID for versioned content types
|
|
98
|
+
* @type {string}
|
|
99
|
+
* @memberof GetContent
|
|
100
|
+
*/
|
|
101
|
+
readonly activeVersionId?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Whether this content has multiple versions
|
|
104
|
+
* @type {boolean}
|
|
105
|
+
* @memberof GetContent
|
|
106
|
+
*/
|
|
107
|
+
readonly hasMultipleVersions?: boolean;
|
|
90
108
|
}
|
|
91
109
|
|
|
92
110
|
|
|
@@ -138,6 +156,9 @@ export function GetContentFromJSONTyped(json: any, ignoreDiscriminator: boolean)
|
|
|
138
156
|
'published': json['published'],
|
|
139
157
|
'createdDate': json['created_date'] == null ? undefined : (new Date(json['created_date'])),
|
|
140
158
|
'updatedDate': json['updated_date'] == null ? undefined : (new Date(json['updated_date'])),
|
|
159
|
+
'activeVersionNumber': json['active_version_number'] == null ? undefined : json['active_version_number'],
|
|
160
|
+
'activeVersionId': json['active_version_id'] == null ? undefined : json['active_version_id'],
|
|
161
|
+
'hasMultipleVersions': json['has_multiple_versions'] == null ? undefined : json['has_multiple_versions'],
|
|
141
162
|
};
|
|
142
163
|
}
|
|
143
164
|
|
|
@@ -145,7 +166,7 @@ export function GetContentToJSON(json: any): GetContent {
|
|
|
145
166
|
return GetContentToJSONTyped(json, false);
|
|
146
167
|
}
|
|
147
168
|
|
|
148
|
-
export function GetContentToJSONTyped(value?: Omit<GetContent, 'id'|'created_date'|'updated_date'> | null, ignoreDiscriminator: boolean = false): any {
|
|
169
|
+
export function GetContentToJSONTyped(value?: Omit<GetContent, 'id'|'created_date'|'updated_date'|'active_version_number'|'active_version_id'|'has_multiple_versions'> | null, ignoreDiscriminator: boolean = false): any {
|
|
149
170
|
if (value == null) {
|
|
150
171
|
return value;
|
|
151
172
|
}
|
|
@@ -0,0 +1,143 @@
|
|
|
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 { GetContentVersionSandbox } from './GetContentVersionSandbox';
|
|
17
|
+
import {
|
|
18
|
+
GetContentVersionSandboxFromJSON,
|
|
19
|
+
GetContentVersionSandboxFromJSONTyped,
|
|
20
|
+
GetContentVersionSandboxToJSON,
|
|
21
|
+
GetContentVersionSandboxToJSONTyped,
|
|
22
|
+
} from './GetContentVersionSandbox';
|
|
23
|
+
import type { GetContentVersionScormData } from './GetContentVersionScormData';
|
|
24
|
+
import {
|
|
25
|
+
GetContentVersionScormDataFromJSON,
|
|
26
|
+
GetContentVersionScormDataFromJSONTyped,
|
|
27
|
+
GetContentVersionScormDataToJSON,
|
|
28
|
+
GetContentVersionScormDataToJSONTyped,
|
|
29
|
+
} from './GetContentVersionScormData';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Details of a specific content version
|
|
33
|
+
* @export
|
|
34
|
+
* @interface GetContentVersion
|
|
35
|
+
*/
|
|
36
|
+
export interface GetContentVersion {
|
|
37
|
+
/**
|
|
38
|
+
* The external_id (UUID) for this version
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @memberof GetContentVersion
|
|
41
|
+
*/
|
|
42
|
+
id: string;
|
|
43
|
+
/**
|
|
44
|
+
* The content's external_id that this version belongs to
|
|
45
|
+
* @type {string}
|
|
46
|
+
* @memberof GetContentVersion
|
|
47
|
+
*/
|
|
48
|
+
contentId: string;
|
|
49
|
+
/**
|
|
50
|
+
* Version number
|
|
51
|
+
* @type {number}
|
|
52
|
+
* @memberof GetContentVersion
|
|
53
|
+
*/
|
|
54
|
+
version: number;
|
|
55
|
+
/**
|
|
56
|
+
* Whether this is the currently active version
|
|
57
|
+
* @type {boolean}
|
|
58
|
+
* @memberof GetContentVersion
|
|
59
|
+
*/
|
|
60
|
+
isActive: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* When this version was created
|
|
63
|
+
* @type {Date}
|
|
64
|
+
* @memberof GetContentVersion
|
|
65
|
+
*/
|
|
66
|
+
createdAt: Date;
|
|
67
|
+
/**
|
|
68
|
+
* When this version was last updated
|
|
69
|
+
* @type {Date}
|
|
70
|
+
* @memberof GetContentVersion
|
|
71
|
+
*/
|
|
72
|
+
updatedAt: Date;
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @type {GetContentVersionSandbox}
|
|
76
|
+
* @memberof GetContentVersion
|
|
77
|
+
*/
|
|
78
|
+
sandbox: GetContentVersionSandbox;
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @type {GetContentVersionScormData}
|
|
82
|
+
* @memberof GetContentVersion
|
|
83
|
+
*/
|
|
84
|
+
scormData?: GetContentVersionScormData | null;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Check if a given object implements the GetContentVersion interface.
|
|
89
|
+
*/
|
|
90
|
+
export function instanceOfGetContentVersion(value: object): value is GetContentVersion {
|
|
91
|
+
if (!('id' in value) || value['id'] === undefined) return false;
|
|
92
|
+
if (!('contentId' in value) || value['contentId'] === undefined) return false;
|
|
93
|
+
if (!('version' in value) || value['version'] === undefined) return false;
|
|
94
|
+
if (!('isActive' in value) || value['isActive'] === undefined) return false;
|
|
95
|
+
if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
|
|
96
|
+
if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
|
|
97
|
+
if (!('sandbox' in value) || value['sandbox'] === undefined) return false;
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function GetContentVersionFromJSON(json: any): GetContentVersion {
|
|
102
|
+
return GetContentVersionFromJSONTyped(json, false);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function GetContentVersionFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetContentVersion {
|
|
106
|
+
if (json == null) {
|
|
107
|
+
return json;
|
|
108
|
+
}
|
|
109
|
+
return {
|
|
110
|
+
|
|
111
|
+
'id': json['id'],
|
|
112
|
+
'contentId': json['content_id'],
|
|
113
|
+
'version': json['version'],
|
|
114
|
+
'isActive': json['is_active'],
|
|
115
|
+
'createdAt': (new Date(json['created_at'])),
|
|
116
|
+
'updatedAt': (new Date(json['updated_at'])),
|
|
117
|
+
'sandbox': GetContentVersionSandboxFromJSON(json['sandbox']),
|
|
118
|
+
'scormData': json['scorm_data'] == null ? undefined : GetContentVersionScormDataFromJSON(json['scorm_data']),
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function GetContentVersionToJSON(json: any): GetContentVersion {
|
|
123
|
+
return GetContentVersionToJSONTyped(json, false);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function GetContentVersionToJSONTyped(value?: GetContentVersion | null, ignoreDiscriminator: boolean = false): any {
|
|
127
|
+
if (value == null) {
|
|
128
|
+
return value;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
|
|
133
|
+
'id': value['id'],
|
|
134
|
+
'content_id': value['contentId'],
|
|
135
|
+
'version': value['version'],
|
|
136
|
+
'is_active': value['isActive'],
|
|
137
|
+
'created_at': ((value['createdAt']).toISOString()),
|
|
138
|
+
'updated_at': ((value['updatedAt']).toISOString()),
|
|
139
|
+
'sandbox': GetContentVersionSandboxToJSON(value['sandbox']),
|
|
140
|
+
'scorm_data': GetContentVersionScormDataToJSON(value['scormData']),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
@@ -0,0 +1,110 @@
|
|
|
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 { GetContentVersionListItemsInner } from './GetContentVersionListItemsInner';
|
|
17
|
+
import {
|
|
18
|
+
GetContentVersionListItemsInnerFromJSON,
|
|
19
|
+
GetContentVersionListItemsInnerFromJSONTyped,
|
|
20
|
+
GetContentVersionListItemsInnerToJSON,
|
|
21
|
+
GetContentVersionListItemsInnerToJSONTyped,
|
|
22
|
+
} from './GetContentVersionListItemsInner';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A paginated list of content versions
|
|
26
|
+
* @export
|
|
27
|
+
* @interface GetContentVersionList
|
|
28
|
+
*/
|
|
29
|
+
export interface GetContentVersionList {
|
|
30
|
+
/**
|
|
31
|
+
* The current page number
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof GetContentVersionList
|
|
34
|
+
*/
|
|
35
|
+
page: number;
|
|
36
|
+
/**
|
|
37
|
+
* The number of items per page
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof GetContentVersionList
|
|
40
|
+
*/
|
|
41
|
+
pageSize: number;
|
|
42
|
+
/**
|
|
43
|
+
* The total number of pages
|
|
44
|
+
* @type {number}
|
|
45
|
+
* @memberof GetContentVersionList
|
|
46
|
+
*/
|
|
47
|
+
totalPages: number;
|
|
48
|
+
/**
|
|
49
|
+
* The total number of versions
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof GetContentVersionList
|
|
52
|
+
*/
|
|
53
|
+
totalItems: number;
|
|
54
|
+
/**
|
|
55
|
+
* List of content versions
|
|
56
|
+
* @type {Array<GetContentVersionListItemsInner>}
|
|
57
|
+
* @memberof GetContentVersionList
|
|
58
|
+
*/
|
|
59
|
+
items: Array<GetContentVersionListItemsInner>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Check if a given object implements the GetContentVersionList interface.
|
|
64
|
+
*/
|
|
65
|
+
export function instanceOfGetContentVersionList(value: object): value is GetContentVersionList {
|
|
66
|
+
if (!('page' in value) || value['page'] === undefined) return false;
|
|
67
|
+
if (!('pageSize' in value) || value['pageSize'] === undefined) return false;
|
|
68
|
+
if (!('totalPages' in value) || value['totalPages'] === undefined) return false;
|
|
69
|
+
if (!('totalItems' in value) || value['totalItems'] === undefined) return false;
|
|
70
|
+
if (!('items' in value) || value['items'] === undefined) return false;
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function GetContentVersionListFromJSON(json: any): GetContentVersionList {
|
|
75
|
+
return GetContentVersionListFromJSONTyped(json, false);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function GetContentVersionListFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetContentVersionList {
|
|
79
|
+
if (json == null) {
|
|
80
|
+
return json;
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
|
|
84
|
+
'page': json['page'],
|
|
85
|
+
'pageSize': json['page_size'],
|
|
86
|
+
'totalPages': json['total_pages'],
|
|
87
|
+
'totalItems': json['total_items'],
|
|
88
|
+
'items': ((json['items'] as Array<any>).map(GetContentVersionListItemsInnerFromJSON)),
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function GetContentVersionListToJSON(json: any): GetContentVersionList {
|
|
93
|
+
return GetContentVersionListToJSONTyped(json, false);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function GetContentVersionListToJSONTyped(value?: GetContentVersionList | null, ignoreDiscriminator: boolean = false): any {
|
|
97
|
+
if (value == null) {
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
|
|
103
|
+
'page': value['page'],
|
|
104
|
+
'page_size': value['pageSize'],
|
|
105
|
+
'total_pages': value['totalPages'],
|
|
106
|
+
'total_items': value['totalItems'],
|
|
107
|
+
'items': ((value['items'] as Array<any>).map(GetContentVersionListItemsInnerToJSON)),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|