@easyedu/js-lsm-api 1.98.0 → 1.99.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 (63) hide show
  1. package/.openapi-generator/FILES +10 -0
  2. package/README.md +10 -2
  3. package/dist/apis/PlayerApi.d.ts +57 -0
  4. package/dist/apis/PlayerApi.js +148 -0
  5. package/dist/esm/apis/PlayerApi.d.ts +57 -0
  6. package/dist/esm/apis/PlayerApi.js +148 -0
  7. package/dist/esm/models/GetCourseVersionItemSession.d.ts +6 -0
  8. package/dist/esm/models/GetCourseVersionItemSession.js +4 -0
  9. package/dist/esm/models/GetLibraryQuizSession.d.ts +6 -0
  10. package/dist/esm/models/GetLibraryQuizSession.js +4 -0
  11. package/dist/esm/models/GetResourceSession.d.ts +6 -0
  12. package/dist/esm/models/GetResourceSession.js +4 -0
  13. package/dist/esm/models/GetResourceSessionActivity.d.ts +125 -0
  14. package/dist/esm/models/GetResourceSessionActivity.js +97 -0
  15. package/dist/esm/models/GetResourceSessionActivityEvent.d.ts +62 -0
  16. package/dist/esm/models/GetResourceSessionActivityEvent.js +61 -0
  17. package/dist/esm/models/GetResourceSessionActivityEventList.d.ts +33 -0
  18. package/dist/esm/models/GetResourceSessionActivityEventList.js +44 -0
  19. package/dist/esm/models/GetResourceSessionActivityList.d.ts +33 -0
  20. package/dist/esm/models/GetResourceSessionActivityList.js +44 -0
  21. package/dist/esm/models/PostResourceSessionActivityEvent.d.ts +62 -0
  22. package/dist/esm/models/PostResourceSessionActivityEvent.js +66 -0
  23. package/dist/esm/models/index.d.ts +5 -0
  24. package/dist/esm/models/index.js +5 -0
  25. package/dist/models/GetCourseVersionItemSession.d.ts +6 -0
  26. package/dist/models/GetCourseVersionItemSession.js +4 -0
  27. package/dist/models/GetLibraryQuizSession.d.ts +6 -0
  28. package/dist/models/GetLibraryQuizSession.js +4 -0
  29. package/dist/models/GetResourceSession.d.ts +6 -0
  30. package/dist/models/GetResourceSession.js +4 -0
  31. package/dist/models/GetResourceSessionActivity.d.ts +125 -0
  32. package/dist/models/GetResourceSessionActivity.js +105 -0
  33. package/dist/models/GetResourceSessionActivityEvent.d.ts +62 -0
  34. package/dist/models/GetResourceSessionActivityEvent.js +68 -0
  35. package/dist/models/GetResourceSessionActivityEventList.d.ts +33 -0
  36. package/dist/models/GetResourceSessionActivityEventList.js +51 -0
  37. package/dist/models/GetResourceSessionActivityList.d.ts +33 -0
  38. package/dist/models/GetResourceSessionActivityList.js +51 -0
  39. package/dist/models/PostResourceSessionActivityEvent.d.ts +62 -0
  40. package/dist/models/PostResourceSessionActivityEvent.js +74 -0
  41. package/dist/models/index.d.ts +5 -0
  42. package/dist/models/index.js +5 -0
  43. package/docs/ContentLibraryQuizApi.md +2 -2
  44. package/docs/GetCourseVersionItemSession.md +2 -0
  45. package/docs/GetLibraryQuizSession.md +2 -0
  46. package/docs/GetResourceSession.md +2 -0
  47. package/docs/GetResourceSessionActivity.md +63 -0
  48. package/docs/GetResourceSessionActivityEvent.md +45 -0
  49. package/docs/GetResourceSessionActivityEventList.md +35 -0
  50. package/docs/GetResourceSessionActivityList.md +35 -0
  51. package/docs/PlayerApi.md +231 -6
  52. package/docs/PostResourceSessionActivityEvent.md +39 -0
  53. package/package.json +1 -1
  54. package/src/apis/PlayerApi.ts +217 -0
  55. package/src/models/GetCourseVersionItemSession.ts +9 -0
  56. package/src/models/GetLibraryQuizSession.ts +9 -0
  57. package/src/models/GetResourceSession.ts +9 -0
  58. package/src/models/GetResourceSessionActivity.ts +199 -0
  59. package/src/models/GetResourceSessionActivityEvent.ts +110 -0
  60. package/src/models/GetResourceSessionActivityEventList.ts +74 -0
  61. package/src/models/GetResourceSessionActivityList.ts +74 -0
  62. package/src/models/PostResourceSessionActivityEvent.ts +104 -0
  63. package/src/models/index.ts +5 -0
@@ -18,6 +18,21 @@ import {
18
18
  GetResourceSessionFromJSON,
19
19
  GetResourceSessionToJSON,
20
20
  } from '../models/GetResourceSession';
21
+ import {
22
+ type GetResourceSessionActivity,
23
+ GetResourceSessionActivityFromJSON,
24
+ GetResourceSessionActivityToJSON,
25
+ } from '../models/GetResourceSessionActivity';
26
+ import {
27
+ type GetResourceSessionActivityEventList,
28
+ GetResourceSessionActivityEventListFromJSON,
29
+ GetResourceSessionActivityEventListToJSON,
30
+ } from '../models/GetResourceSessionActivityEventList';
31
+ import {
32
+ type GetResourceSessionActivityList,
33
+ GetResourceSessionActivityListFromJSON,
34
+ GetResourceSessionActivityListToJSON,
35
+ } from '../models/GetResourceSessionActivityList';
21
36
  import {
22
37
  type GetResourceSessionDiagnostics,
23
38
  GetResourceSessionDiagnosticsFromJSON,
@@ -38,6 +53,11 @@ import {
38
53
  GetResourceSessionScormDataFromJSON,
39
54
  GetResourceSessionScormDataToJSON,
40
55
  } from '../models/GetResourceSessionScormData';
56
+ import {
57
+ type PostResourceSessionActivityEvent,
58
+ PostResourceSessionActivityEventFromJSON,
59
+ PostResourceSessionActivityEventToJSON,
60
+ } from '../models/PostResourceSessionActivityEvent';
41
61
  import {
42
62
  type ResourceSessionEnvironment,
43
63
  ResourceSessionEnvironmentFromJSON,
@@ -66,6 +86,7 @@ import {
66
86
 
67
87
  export interface CommitResourceScormSessionRequest {
68
88
  sessionId: string;
89
+ activityId?: string;
69
90
  }
70
91
 
71
92
  export interface GetCourseVersionResourceAssetRequest {
@@ -81,12 +102,21 @@ export interface GetLibraryQuizSessionPlayerRequest {
81
102
  export interface GetResourceScormValueRequest {
82
103
  sessionId: string;
83
104
  key: string;
105
+ activityId?: string;
84
106
  }
85
107
 
86
108
  export interface GetResourceSessionRequest {
87
109
  sessionId: string;
88
110
  }
89
111
 
112
+ export interface GetResourceSessionActivitiesRequest {
113
+ sessionId: string;
114
+ }
115
+
116
+ export interface GetResourceSessionActivityEventsRequest {
117
+ sessionId: string;
118
+ }
119
+
90
120
  export interface GetResourceSessionAssetRequest {
91
121
  sessionId: string;
92
122
  assetPath: string;
@@ -135,10 +165,18 @@ export interface GetResourceSessionScormApiLogsRequest {
135
165
 
136
166
  export interface GetResourceSessionScormDataRequest {
137
167
  sessionId: string;
168
+ activityId?: string;
138
169
  }
139
170
 
140
171
  export interface InitializeResourceScormSessionRequest {
141
172
  sessionId: string;
173
+ activityId?: string;
174
+ }
175
+
176
+ export interface PostResourceSessionActivityEventRequest {
177
+ sessionId: string;
178
+ activityId: string;
179
+ postResourceSessionActivityEvent: PostResourceSessionActivityEvent;
142
180
  }
143
181
 
144
182
  export interface PostResourceSessionCompleteRequest {
@@ -148,10 +186,12 @@ export interface PostResourceSessionCompleteRequest {
148
186
  export interface SetResourceScormValueRequest {
149
187
  sessionId: string;
150
188
  scormSetValueRequest: ScormSetValueRequest;
189
+ activityId?: string;
151
190
  }
152
191
 
153
192
  export interface TerminateResourceScormSessionRequest {
154
193
  sessionId: string;
194
+ activityId?: string;
155
195
  }
156
196
 
157
197
  /**
@@ -172,6 +212,10 @@ export class PlayerApi extends runtime.BaseAPI {
172
212
 
173
213
  const queryParameters: any = {};
174
214
 
215
+ if (requestParameters['activityId'] != null) {
216
+ queryParameters['activity_id'] = requestParameters['activityId'];
217
+ }
218
+
175
219
  const headerParameters: runtime.HTTPHeaders = {};
176
220
 
177
221
 
@@ -337,6 +381,10 @@ export class PlayerApi extends runtime.BaseAPI {
337
381
  queryParameters['key'] = requestParameters['key'];
338
382
  }
339
383
 
384
+ if (requestParameters['activityId'] != null) {
385
+ queryParameters['activity_id'] = requestParameters['activityId'];
386
+ }
387
+
340
388
  const headerParameters: runtime.HTTPHeaders = {};
341
389
 
342
390
 
@@ -414,6 +462,96 @@ export class PlayerApi extends runtime.BaseAPI {
414
462
  return await response.value();
415
463
  }
416
464
 
465
+ /**
466
+ * Creates request options for getResourceSessionActivities without sending the request
467
+ */
468
+ async getResourceSessionActivitiesRequestOpts(requestParameters: GetResourceSessionActivitiesRequest): Promise<runtime.RequestOpts> {
469
+ if (requestParameters['sessionId'] == null) {
470
+ throw new runtime.RequiredError(
471
+ 'sessionId',
472
+ 'Required parameter "sessionId" was null or undefined when calling getResourceSessionActivities().'
473
+ );
474
+ }
475
+
476
+ const queryParameters: any = {};
477
+
478
+ const headerParameters: runtime.HTTPHeaders = {};
479
+
480
+
481
+ let urlPath = `/resource/sessions/{sessionId}/activities`;
482
+ urlPath = urlPath.replace('{sessionId}', encodeURIComponent(String(requestParameters['sessionId'])));
483
+
484
+ return {
485
+ path: urlPath,
486
+ method: 'GET',
487
+ headers: headerParameters,
488
+ query: queryParameters,
489
+ };
490
+ }
491
+
492
+ /**
493
+ * List tracked activities for a resource session
494
+ */
495
+ async getResourceSessionActivitiesRaw(requestParameters: GetResourceSessionActivitiesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetResourceSessionActivityList>> {
496
+ const requestOptions = await this.getResourceSessionActivitiesRequestOpts(requestParameters);
497
+ const response = await this.request(requestOptions, initOverrides);
498
+
499
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetResourceSessionActivityListFromJSON(jsonValue));
500
+ }
501
+
502
+ /**
503
+ * List tracked activities for a resource session
504
+ */
505
+ async getResourceSessionActivities(requestParameters: GetResourceSessionActivitiesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetResourceSessionActivityList> {
506
+ const response = await this.getResourceSessionActivitiesRaw(requestParameters, initOverrides);
507
+ return await response.value();
508
+ }
509
+
510
+ /**
511
+ * Creates request options for getResourceSessionActivityEvents without sending the request
512
+ */
513
+ async getResourceSessionActivityEventsRequestOpts(requestParameters: GetResourceSessionActivityEventsRequest): Promise<runtime.RequestOpts> {
514
+ if (requestParameters['sessionId'] == null) {
515
+ throw new runtime.RequiredError(
516
+ 'sessionId',
517
+ 'Required parameter "sessionId" was null or undefined when calling getResourceSessionActivityEvents().'
518
+ );
519
+ }
520
+
521
+ const queryParameters: any = {};
522
+
523
+ const headerParameters: runtime.HTTPHeaders = {};
524
+
525
+
526
+ let urlPath = `/resource/sessions/{sessionId}/activity-events`;
527
+ urlPath = urlPath.replace('{sessionId}', encodeURIComponent(String(requestParameters['sessionId'])));
528
+
529
+ return {
530
+ path: urlPath,
531
+ method: 'GET',
532
+ headers: headerParameters,
533
+ query: queryParameters,
534
+ };
535
+ }
536
+
537
+ /**
538
+ * List recorded learner activity events for a resource session
539
+ */
540
+ async getResourceSessionActivityEventsRaw(requestParameters: GetResourceSessionActivityEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetResourceSessionActivityEventList>> {
541
+ const requestOptions = await this.getResourceSessionActivityEventsRequestOpts(requestParameters);
542
+ const response = await this.request(requestOptions, initOverrides);
543
+
544
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetResourceSessionActivityEventListFromJSON(jsonValue));
545
+ }
546
+
547
+ /**
548
+ * List recorded learner activity events for a resource session
549
+ */
550
+ async getResourceSessionActivityEvents(requestParameters: GetResourceSessionActivityEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetResourceSessionActivityEventList> {
551
+ const response = await this.getResourceSessionActivityEventsRaw(requestParameters, initOverrides);
552
+ return await response.value();
553
+ }
554
+
417
555
  /**
418
556
  * Creates request options for getResourceSessionAsset without sending the request
419
557
  */
@@ -760,6 +898,10 @@ export class PlayerApi extends runtime.BaseAPI {
760
898
 
761
899
  const queryParameters: any = {};
762
900
 
901
+ if (requestParameters['activityId'] != null) {
902
+ queryParameters['activity_id'] = requestParameters['activityId'];
903
+ }
904
+
763
905
  const headerParameters: runtime.HTTPHeaders = {};
764
906
 
765
907
 
@@ -805,6 +947,10 @@ export class PlayerApi extends runtime.BaseAPI {
805
947
 
806
948
  const queryParameters: any = {};
807
949
 
950
+ if (requestParameters['activityId'] != null) {
951
+ queryParameters['activity_id'] = requestParameters['activityId'];
952
+ }
953
+
808
954
  const headerParameters: runtime.HTTPHeaders = {};
809
955
 
810
956
 
@@ -836,6 +982,69 @@ export class PlayerApi extends runtime.BaseAPI {
836
982
  await this.initializeResourceScormSessionRaw(requestParameters, initOverrides);
837
983
  }
838
984
 
985
+ /**
986
+ * Creates request options for postResourceSessionActivityEvent without sending the request
987
+ */
988
+ async postResourceSessionActivityEventRequestOpts(requestParameters: PostResourceSessionActivityEventRequest): Promise<runtime.RequestOpts> {
989
+ if (requestParameters['sessionId'] == null) {
990
+ throw new runtime.RequiredError(
991
+ 'sessionId',
992
+ 'Required parameter "sessionId" was null or undefined when calling postResourceSessionActivityEvent().'
993
+ );
994
+ }
995
+
996
+ if (requestParameters['activityId'] == null) {
997
+ throw new runtime.RequiredError(
998
+ 'activityId',
999
+ 'Required parameter "activityId" was null or undefined when calling postResourceSessionActivityEvent().'
1000
+ );
1001
+ }
1002
+
1003
+ if (requestParameters['postResourceSessionActivityEvent'] == null) {
1004
+ throw new runtime.RequiredError(
1005
+ 'postResourceSessionActivityEvent',
1006
+ 'Required parameter "postResourceSessionActivityEvent" was null or undefined when calling postResourceSessionActivityEvent().'
1007
+ );
1008
+ }
1009
+
1010
+ const queryParameters: any = {};
1011
+
1012
+ const headerParameters: runtime.HTTPHeaders = {};
1013
+
1014
+ headerParameters['Content-Type'] = 'application/json';
1015
+
1016
+
1017
+ let urlPath = `/resource/sessions/{sessionId}/activities/{activityId}/events`;
1018
+ urlPath = urlPath.replace('{sessionId}', encodeURIComponent(String(requestParameters['sessionId'])));
1019
+ urlPath = urlPath.replace('{activityId}', encodeURIComponent(String(requestParameters['activityId'])));
1020
+
1021
+ return {
1022
+ path: urlPath,
1023
+ method: 'POST',
1024
+ headers: headerParameters,
1025
+ query: queryParameters,
1026
+ body: PostResourceSessionActivityEventToJSON(requestParameters['postResourceSessionActivityEvent']),
1027
+ };
1028
+ }
1029
+
1030
+ /**
1031
+ * Record learner activity and update active time
1032
+ */
1033
+ async postResourceSessionActivityEventRaw(requestParameters: PostResourceSessionActivityEventRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetResourceSessionActivity>> {
1034
+ const requestOptions = await this.postResourceSessionActivityEventRequestOpts(requestParameters);
1035
+ const response = await this.request(requestOptions, initOverrides);
1036
+
1037
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetResourceSessionActivityFromJSON(jsonValue));
1038
+ }
1039
+
1040
+ /**
1041
+ * Record learner activity and update active time
1042
+ */
1043
+ async postResourceSessionActivityEvent(requestParameters: PostResourceSessionActivityEventRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetResourceSessionActivity> {
1044
+ const response = await this.postResourceSessionActivityEventRaw(requestParameters, initOverrides);
1045
+ return await response.value();
1046
+ }
1047
+
839
1048
  /**
840
1049
  * Creates request options for postResourceSessionComplete without sending the request
841
1050
  */
@@ -901,6 +1110,10 @@ export class PlayerApi extends runtime.BaseAPI {
901
1110
 
902
1111
  const queryParameters: any = {};
903
1112
 
1113
+ if (requestParameters['activityId'] != null) {
1114
+ queryParameters['activity_id'] = requestParameters['activityId'];
1115
+ }
1116
+
904
1117
  const headerParameters: runtime.HTTPHeaders = {};
905
1118
 
906
1119
  headerParameters['Content-Type'] = 'application/json';
@@ -949,6 +1162,10 @@ export class PlayerApi extends runtime.BaseAPI {
949
1162
 
950
1163
  const queryParameters: any = {};
951
1164
 
1165
+ if (requestParameters['activityId'] != null) {
1166
+ queryParameters['activity_id'] = requestParameters['activityId'];
1167
+ }
1168
+
952
1169
  const headerParameters: runtime.HTTPHeaders = {};
953
1170
 
954
1171
 
@@ -125,6 +125,12 @@ export interface GetCourseVersionItemSession {
125
125
  * @memberof GetCourseVersionItemSession
126
126
  */
127
127
  scoreRaw?: number | null;
128
+ /**
129
+ * Accumulated active learner time across this session's activities.
130
+ * @type {number}
131
+ * @memberof GetCourseVersionItemSession
132
+ */
133
+ durationSeconds: number;
128
134
  /**
129
135
  *
130
136
  * @type {number}
@@ -164,6 +170,7 @@ export function instanceOfGetCourseVersionItemSession(value: object): value is G
164
170
  if (!('isCurrent' in value) || value['isCurrent'] === undefined) return false;
165
171
  if (!('completionStatus' in value) || value['completionStatus'] === undefined) return false;
166
172
  if (!('gradeStatus' in value) || value['gradeStatus'] === undefined) return false;
173
+ if (!('durationSeconds' in value) || value['durationSeconds'] === undefined) return false;
167
174
  if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
168
175
  if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
169
176
  return true;
@@ -193,6 +200,7 @@ export function GetCourseVersionItemSessionFromJSONTyped(json: any, ignoreDiscri
193
200
  'completionStatus': json['completion_status'],
194
201
  'gradeStatus': json['grade_status'],
195
202
  'scoreRaw': json['score_raw'] == null ? undefined : json['score_raw'],
203
+ 'durationSeconds': json['duration_seconds'],
196
204
  'createdAt': json['created_at'],
197
205
  'updatedAt': json['updated_at'],
198
206
  'completedAt': json['completed_at'] == null ? undefined : json['completed_at'],
@@ -224,6 +232,7 @@ export function GetCourseVersionItemSessionToJSONTyped(value?: GetCourseVersionI
224
232
  'completion_status': value['completionStatus'],
225
233
  'grade_status': value['gradeStatus'],
226
234
  'score_raw': value['scoreRaw'],
235
+ 'duration_seconds': value['durationSeconds'],
227
236
  'created_at': value['createdAt'],
228
237
  'updated_at': value['updatedAt'],
229
238
  'completed_at': value['completedAt'],
@@ -172,6 +172,12 @@ export interface GetLibraryQuizSession {
172
172
  * @memberof GetLibraryQuizSession
173
173
  */
174
174
  completedAt?: number | null;
175
+ /**
176
+ * Elapsed attempt time from start through completion, submission, or the latest saved activity.
177
+ * @type {number}
178
+ * @memberof GetLibraryQuizSession
179
+ */
180
+ durationSeconds: number;
175
181
  }
176
182
 
177
183
 
@@ -208,6 +214,7 @@ export function instanceOfGetLibraryQuizSession(value: object): value is GetLibr
208
214
  if (!('questions' in value) || value['questions'] === undefined) return false;
209
215
  if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
210
216
  if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
217
+ if (!('durationSeconds' in value) || value['durationSeconds'] === undefined) return false;
211
218
  return true;
212
219
  }
213
220
 
@@ -244,6 +251,7 @@ export function GetLibraryQuizSessionFromJSONTyped(json: any, ignoreDiscriminato
244
251
  'createdAt': json['created_at'],
245
252
  'updatedAt': json['updated_at'],
246
253
  'completedAt': json['completed_at'] == null ? undefined : json['completed_at'],
254
+ 'durationSeconds': json['duration_seconds'],
247
255
  };
248
256
  }
249
257
 
@@ -281,6 +289,7 @@ export function GetLibraryQuizSessionToJSONTyped(value?: GetLibraryQuizSession |
281
289
  'created_at': value['createdAt'],
282
290
  'updated_at': value['updatedAt'],
283
291
  'completed_at': value['completedAt'],
292
+ 'duration_seconds': value['durationSeconds'],
284
293
  };
285
294
  }
286
295
 
@@ -173,6 +173,12 @@ export interface GetResourceSession {
173
173
  * @memberof GetResourceSession
174
174
  */
175
175
  scoreRaw?: number | null;
176
+ /**
177
+ * Accumulated active learner time across this session's activities.
178
+ * @type {number}
179
+ * @memberof GetResourceSession
180
+ */
181
+ durationSeconds: number;
176
182
  /**
177
183
  *
178
184
  * @type {number}
@@ -225,6 +231,7 @@ export function instanceOfGetResourceSession(value: object): value is GetResourc
225
231
  if (!('isCurrent' in value) || value['isCurrent'] === undefined) return false;
226
232
  if (!('completionStatus' in value) || value['completionStatus'] === undefined) return false;
227
233
  if (!('gradeStatus' in value) || value['gradeStatus'] === undefined) return false;
234
+ if (!('durationSeconds' in value) || value['durationSeconds'] === undefined) return false;
228
235
  if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
229
236
  if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
230
237
  return true;
@@ -262,6 +269,7 @@ export function GetResourceSessionFromJSONTyped(json: any, ignoreDiscriminator:
262
269
  'completionStatus': json['completion_status'],
263
270
  'gradeStatus': json['grade_status'],
264
271
  'scoreRaw': json['score_raw'] == null ? undefined : json['score_raw'],
272
+ 'durationSeconds': json['duration_seconds'],
265
273
  'initializedAt': json['initialized_at'] == null ? undefined : json['initialized_at'],
266
274
  'terminatedAt': json['terminated_at'] == null ? undefined : json['terminated_at'],
267
275
  'createdAt': json['created_at'],
@@ -303,6 +311,7 @@ export function GetResourceSessionToJSONTyped(value?: GetResourceSession | null,
303
311
  'completion_status': value['completionStatus'],
304
312
  'grade_status': value['gradeStatus'],
305
313
  'score_raw': value['scoreRaw'],
314
+ 'duration_seconds': value['durationSeconds'],
306
315
  'initialized_at': value['initializedAt'],
307
316
  'terminated_at': value['terminatedAt'],
308
317
  'created_at': value['createdAt'],
@@ -0,0 +1,199 @@
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
+ * Per-activity learner state within a resource-session attempt.
18
+ * @export
19
+ * @interface GetResourceSessionActivity
20
+ */
21
+ export interface GetResourceSessionActivity {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof GetResourceSessionActivity
26
+ */
27
+ id: string;
28
+ /**
29
+ * Stable source identifier, such as a SCORM activity identifier or resource.
30
+ * @type {string}
31
+ * @memberof GetResourceSessionActivity
32
+ */
33
+ identifier: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof GetResourceSessionActivity
38
+ */
39
+ title: string;
40
+ /**
41
+ *
42
+ * @type {GetResourceSessionActivityActivityTypeEnum}
43
+ * @memberof GetResourceSessionActivity
44
+ */
45
+ activityType: GetResourceSessionActivityActivityTypeEnum;
46
+ /**
47
+ *
48
+ * @type {string}
49
+ * @memberof GetResourceSessionActivity
50
+ */
51
+ completionStatus: string;
52
+ /**
53
+ *
54
+ * @type {string}
55
+ * @memberof GetResourceSessionActivity
56
+ */
57
+ gradeStatus: string;
58
+ /**
59
+ *
60
+ * @type {number}
61
+ * @memberof GetResourceSessionActivity
62
+ */
63
+ scoreRaw?: number | null;
64
+ /**
65
+ *
66
+ * @type {number}
67
+ * @memberof GetResourceSessionActivity
68
+ */
69
+ durationSeconds: number;
70
+ /**
71
+ *
72
+ * @type {boolean}
73
+ * @memberof GetResourceSessionActivity
74
+ */
75
+ isActive: boolean;
76
+ /**
77
+ *
78
+ * @type {number}
79
+ * @memberof GetResourceSessionActivity
80
+ */
81
+ initializedAt?: number | null;
82
+ /**
83
+ *
84
+ * @type {number}
85
+ * @memberof GetResourceSessionActivity
86
+ */
87
+ terminatedAt?: number | null;
88
+ /**
89
+ *
90
+ * @type {number}
91
+ * @memberof GetResourceSessionActivity
92
+ */
93
+ completedAt?: number | null;
94
+ /**
95
+ *
96
+ * @type {number}
97
+ * @memberof GetResourceSessionActivity
98
+ */
99
+ lastSeenAt?: number | null;
100
+ /**
101
+ *
102
+ * @type {number}
103
+ * @memberof GetResourceSessionActivity
104
+ */
105
+ createdAt: number;
106
+ /**
107
+ *
108
+ * @type {number}
109
+ * @memberof GetResourceSessionActivity
110
+ */
111
+ updatedAt: number;
112
+ }
113
+
114
+
115
+ /**
116
+ * @export
117
+ */
118
+ export const GetResourceSessionActivityActivityTypeEnum = {
119
+ Resource: 'resource',
120
+ Sco: 'sco',
121
+ Asset: 'asset'
122
+ } as const;
123
+ export type GetResourceSessionActivityActivityTypeEnum = typeof GetResourceSessionActivityActivityTypeEnum[keyof typeof GetResourceSessionActivityActivityTypeEnum];
124
+
125
+
126
+ /**
127
+ * Check if a given object implements the GetResourceSessionActivity interface.
128
+ */
129
+ export function instanceOfGetResourceSessionActivity(value: object): value is GetResourceSessionActivity {
130
+ if (!('id' in value) || value['id'] === undefined) return false;
131
+ if (!('identifier' in value) || value['identifier'] === undefined) return false;
132
+ if (!('title' in value) || value['title'] === undefined) return false;
133
+ if (!('activityType' in value) || value['activityType'] === undefined) return false;
134
+ if (!('completionStatus' in value) || value['completionStatus'] === undefined) return false;
135
+ if (!('gradeStatus' in value) || value['gradeStatus'] === undefined) return false;
136
+ if (!('durationSeconds' in value) || value['durationSeconds'] === undefined) return false;
137
+ if (!('isActive' in value) || value['isActive'] === undefined) return false;
138
+ if (!('createdAt' in value) || value['createdAt'] === undefined) return false;
139
+ if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false;
140
+ return true;
141
+ }
142
+
143
+ export function GetResourceSessionActivityFromJSON(json: any): GetResourceSessionActivity {
144
+ return GetResourceSessionActivityFromJSONTyped(json, false);
145
+ }
146
+
147
+ export function GetResourceSessionActivityFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetResourceSessionActivity {
148
+ if (json == null) {
149
+ return json;
150
+ }
151
+ return {
152
+
153
+ 'id': json['id'],
154
+ 'identifier': json['identifier'],
155
+ 'title': json['title'],
156
+ 'activityType': json['activity_type'],
157
+ 'completionStatus': json['completion_status'],
158
+ 'gradeStatus': json['grade_status'],
159
+ 'scoreRaw': json['score_raw'] == null ? undefined : json['score_raw'],
160
+ 'durationSeconds': json['duration_seconds'],
161
+ 'isActive': json['is_active'],
162
+ 'initializedAt': json['initialized_at'] == null ? undefined : json['initialized_at'],
163
+ 'terminatedAt': json['terminated_at'] == null ? undefined : json['terminated_at'],
164
+ 'completedAt': json['completed_at'] == null ? undefined : json['completed_at'],
165
+ 'lastSeenAt': json['last_seen_at'] == null ? undefined : json['last_seen_at'],
166
+ 'createdAt': json['created_at'],
167
+ 'updatedAt': json['updated_at'],
168
+ };
169
+ }
170
+
171
+ export function GetResourceSessionActivityToJSON(json: any): GetResourceSessionActivity {
172
+ return GetResourceSessionActivityToJSONTyped(json, false);
173
+ }
174
+
175
+ export function GetResourceSessionActivityToJSONTyped(value?: GetResourceSessionActivity | null, ignoreDiscriminator: boolean = false): any {
176
+ if (value == null) {
177
+ return value;
178
+ }
179
+
180
+ return {
181
+
182
+ 'id': value['id'],
183
+ 'identifier': value['identifier'],
184
+ 'title': value['title'],
185
+ 'activity_type': value['activityType'],
186
+ 'completion_status': value['completionStatus'],
187
+ 'grade_status': value['gradeStatus'],
188
+ 'score_raw': value['scoreRaw'],
189
+ 'duration_seconds': value['durationSeconds'],
190
+ 'is_active': value['isActive'],
191
+ 'initialized_at': value['initializedAt'],
192
+ 'terminated_at': value['terminatedAt'],
193
+ 'completed_at': value['completedAt'],
194
+ 'last_seen_at': value['lastSeenAt'],
195
+ 'created_at': value['createdAt'],
196
+ 'updated_at': value['updatedAt'],
197
+ };
198
+ }
199
+