@easyedu/js-lsm-api 1.26.0 → 1.27.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 (53) hide show
  1. package/.openapi-generator/FILES +8 -0
  2. package/README.md +2 -2
  3. package/dist/apis/ContentApi.d.ts +64 -1
  4. package/dist/apis/ContentApi.js +155 -0
  5. package/dist/esm/apis/ContentApi.d.ts +64 -1
  6. package/dist/esm/apis/ContentApi.js +156 -1
  7. package/dist/esm/models/GetContentVersion.d.ts +76 -0
  8. package/dist/esm/models/GetContentVersion.js +71 -0
  9. package/dist/esm/models/GetContentVersionList.d.ts +57 -0
  10. package/dist/esm/models/GetContentVersionList.js +60 -0
  11. package/dist/esm/models/GetContentVersionListItemsInner.d.ts +56 -0
  12. package/dist/esm/models/GetContentVersionListItemsInner.js +59 -0
  13. package/dist/esm/models/GetContentVersionSandbox.d.ts +32 -0
  14. package/dist/esm/models/GetContentVersionSandbox.js +43 -0
  15. package/dist/esm/models/GetContentVersionScormData.d.ts +32 -0
  16. package/dist/esm/models/GetContentVersionScormData.js +43 -0
  17. package/dist/esm/models/GetScormPackage.d.ts +39 -0
  18. package/dist/esm/models/GetScormPackage.js +48 -0
  19. package/dist/esm/models/GetScormPackagePackageInfo.d.ts +104 -0
  20. package/dist/esm/models/GetScormPackagePackageInfo.js +81 -0
  21. package/dist/esm/models/PutContentVersion.d.ts +32 -0
  22. package/dist/esm/models/PutContentVersion.js +43 -0
  23. package/dist/esm/models/index.d.ts +8 -0
  24. package/dist/esm/models/index.js +8 -0
  25. package/dist/models/GetContentVersion.d.ts +76 -0
  26. package/dist/models/GetContentVersion.js +78 -0
  27. package/dist/models/GetContentVersionList.d.ts +57 -0
  28. package/dist/models/GetContentVersionList.js +67 -0
  29. package/dist/models/GetContentVersionListItemsInner.d.ts +56 -0
  30. package/dist/models/GetContentVersionListItemsInner.js +66 -0
  31. package/dist/models/GetContentVersionSandbox.d.ts +32 -0
  32. package/dist/models/GetContentVersionSandbox.js +50 -0
  33. package/dist/models/GetContentVersionScormData.d.ts +32 -0
  34. package/dist/models/GetContentVersionScormData.js +50 -0
  35. package/dist/models/GetScormPackage.d.ts +39 -0
  36. package/dist/models/GetScormPackage.js +55 -0
  37. package/dist/models/GetScormPackagePackageInfo.d.ts +104 -0
  38. package/dist/models/GetScormPackagePackageInfo.js +88 -0
  39. package/dist/models/PutContentVersion.d.ts +32 -0
  40. package/dist/models/PutContentVersion.js +50 -0
  41. package/dist/models/index.d.ts +8 -0
  42. package/dist/models/index.js +8 -0
  43. package/package.json +1 -1
  44. package/src/apis/ContentApi.ts +253 -0
  45. package/src/models/GetContentVersion.ts +143 -0
  46. package/src/models/GetContentVersionList.ts +110 -0
  47. package/src/models/GetContentVersionListItemsInner.ts +102 -0
  48. package/src/models/GetContentVersionSandbox.ts +66 -0
  49. package/src/models/GetContentVersionScormData.ts +66 -0
  50. package/src/models/GetScormPackage.ts +83 -0
  51. package/src/models/GetScormPackagePackageInfo.ts +169 -0
  52. package/src/models/PutContentVersion.ts +66 -0
  53. package/src/models/index.ts +8 -0
@@ -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
  }
@@ -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
+
@@ -0,0 +1,102 @@
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
+ /**
17
+ *
18
+ * @export
19
+ * @interface GetContentVersionListItemsInner
20
+ */
21
+ export interface GetContentVersionListItemsInner {
22
+ /**
23
+ * The external_id (UUID) for this version
24
+ * @type {string}
25
+ * @memberof GetContentVersionListItemsInner
26
+ */
27
+ id: string;
28
+ /**
29
+ * Version number
30
+ * @type {number}
31
+ * @memberof GetContentVersionListItemsInner
32
+ */
33
+ version: number;
34
+ /**
35
+ * Whether this is the currently active version
36
+ * @type {boolean}
37
+ * @memberof GetContentVersionListItemsInner
38
+ */
39
+ isActive: boolean;
40
+ /**
41
+ * When this version was created
42
+ * @type {Date}
43
+ * @memberof GetContentVersionListItemsInner
44
+ */
45
+ createdAt: Date;
46
+ /**
47
+ * When this version was last updated
48
+ * @type {Date}
49
+ * @memberof GetContentVersionListItemsInner
50
+ */
51
+ updatedAt: Date;
52
+ }
53
+
54
+ /**
55
+ * Check if a given object implements the GetContentVersionListItemsInner interface.
56
+ */
57
+ export function instanceOfGetContentVersionListItemsInner(value: object): value is GetContentVersionListItemsInner {
58
+ if (!('id' in value) || value['id'] === undefined) return false;
59
+ if (!('version' in value) || value['version'] === undefined) return false;
60
+ if (!('isActive' in value) || value['isActive'] === undefined) return false;
61
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
62
+ if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
63
+ return true;
64
+ }
65
+
66
+ export function GetContentVersionListItemsInnerFromJSON(json: any): GetContentVersionListItemsInner {
67
+ return GetContentVersionListItemsInnerFromJSONTyped(json, false);
68
+ }
69
+
70
+ export function GetContentVersionListItemsInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetContentVersionListItemsInner {
71
+ if (json == null) {
72
+ return json;
73
+ }
74
+ return {
75
+
76
+ 'id': json['id'],
77
+ 'version': json['version'],
78
+ 'isActive': json['is_active'],
79
+ 'createdAt': (new Date(json['created_at'])),
80
+ 'updatedAt': (new Date(json['updated_at'])),
81
+ };
82
+ }
83
+
84
+ export function GetContentVersionListItemsInnerToJSON(json: any): GetContentVersionListItemsInner {
85
+ return GetContentVersionListItemsInnerToJSONTyped(json, false);
86
+ }
87
+
88
+ export function GetContentVersionListItemsInnerToJSONTyped(value?: GetContentVersionListItemsInner | null, ignoreDiscriminator: boolean = false): any {
89
+ if (value == null) {
90
+ return value;
91
+ }
92
+
93
+ return {
94
+
95
+ 'id': value['id'],
96
+ 'version': value['version'],
97
+ 'is_active': value['isActive'],
98
+ 'created_at': ((value['createdAt']).toISOString()),
99
+ 'updated_at': ((value['updatedAt']).toISOString()),
100
+ };
101
+ }
102
+