@salesforce/lds-adapters-platform-learning-content 1.247.0 → 1.248.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/dist/es/es2018/platform-learning-content.js +15 -1
- package/dist/es/es2018/types/src/generated/types/LearningItemRepresentation.d.ts +1 -0
- package/dist/es/es2018/types/src/main.d.ts +2 -0
- package/dist/es/es2018/types/src/sfdc.d.ts +3 -0
- package/package.json +3 -3
- package/sfdc/index.d.ts +1 -1
- package/sfdc/index.js +1742 -1723
- package/src/raml/luvio.raml +4 -0
package/sfdc/index.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
/* proxy-compat-disable */
|
|
15
15
|
import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
|
|
16
16
|
import { withDefaultLuvio } from 'force/ldsEngine';
|
|
17
|
-
import { serializeStructuredKey, ingestShape, deepFreeze,
|
|
17
|
+
import { serializeStructuredKey, ingestShape, deepFreeze, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$9, typeCheckConfig as typeCheckConfig$a, StoreKeyMap, createResourceParams as createResourceParams$a } from 'force/luvioEngine';
|
|
18
18
|
|
|
19
19
|
const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
|
|
20
20
|
const { keys: ObjectKeys$1, create: ObjectCreate$1 } = Object;
|
|
@@ -122,42 +122,38 @@ function createLink(ref) {
|
|
|
122
122
|
};
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
|
|
125
|
+
const TTL$6 = 15000;
|
|
126
|
+
const VERSION$e = "b489f9f2cbdc91a04dd15b4d467b6760";
|
|
127
|
+
function validate$f(obj, path = 'FeaturedItemRepresentation') {
|
|
126
128
|
const v_error = (() => {
|
|
127
129
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
128
130
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
129
131
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const obj_details_keys = ObjectKeys(obj_details);
|
|
137
|
-
for (let i = 0; i < obj_details_keys.length; i++) {
|
|
138
|
-
const key = obj_details_keys[i];
|
|
139
|
-
const obj_details_prop = obj_details[key];
|
|
140
|
-
const path_details_prop = path_details + '["' + key + '"]';
|
|
141
|
-
if (obj_details_prop === undefined) {
|
|
142
|
-
return new TypeError('Expected "defined" but received "' + typeof obj_details_prop + '" (at "' + path_details_prop + '")');
|
|
143
|
-
}
|
|
132
|
+
const obj_availablePointCount = obj.availablePointCount;
|
|
133
|
+
const path_availablePointCount = path + '.availablePointCount';
|
|
134
|
+
let obj_availablePointCount_union0 = null;
|
|
135
|
+
const obj_availablePointCount_union0_error = (() => {
|
|
136
|
+
if (typeof obj_availablePointCount !== 'number' || (typeof obj_availablePointCount === 'number' && Math.floor(obj_availablePointCount) !== obj_availablePointCount)) {
|
|
137
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_availablePointCount + '" (at "' + path_availablePointCount + '")');
|
|
144
138
|
}
|
|
139
|
+
})();
|
|
140
|
+
if (obj_availablePointCount_union0_error != null) {
|
|
141
|
+
obj_availablePointCount_union0 = obj_availablePointCount_union0_error.message;
|
|
145
142
|
}
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
let obj_availablePointCount_union1 = null;
|
|
144
|
+
const obj_availablePointCount_union1_error = (() => {
|
|
145
|
+
if (obj_availablePointCount !== null) {
|
|
146
|
+
return new TypeError('Expected "null" but received "' + typeof obj_availablePointCount + '" (at "' + path_availablePointCount + '")');
|
|
147
|
+
}
|
|
148
|
+
})();
|
|
149
|
+
if (obj_availablePointCount_union1_error != null) {
|
|
150
|
+
obj_availablePointCount_union1 = obj_availablePointCount_union1_error.message;
|
|
150
151
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const VERSION$e = "ef3b97b73983e10731031f11a195bba6";
|
|
157
|
-
function validate$e(obj, path = 'LearningItemProgressRepresentation') {
|
|
158
|
-
const v_error = (() => {
|
|
159
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
160
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
152
|
+
if (obj_availablePointCount_union0 && obj_availablePointCount_union1) {
|
|
153
|
+
let message = 'Object doesn\'t match union (at "' + path_availablePointCount + '")';
|
|
154
|
+
message += '\n' + obj_availablePointCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
155
|
+
message += '\n' + obj_availablePointCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
156
|
+
return new TypeError(message);
|
|
161
157
|
}
|
|
162
158
|
const obj_completedDate = obj.completedDate;
|
|
163
159
|
const path_completedDate = path + '.completedDate';
|
|
@@ -185,12 +181,38 @@ function validate$e(obj, path = 'LearningItemProgressRepresentation') {
|
|
|
185
181
|
message += '\n' + obj_completedDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
186
182
|
return new TypeError(message);
|
|
187
183
|
}
|
|
184
|
+
const obj_completedItemCount = obj.completedItemCount;
|
|
185
|
+
const path_completedItemCount = path + '.completedItemCount';
|
|
186
|
+
let obj_completedItemCount_union0 = null;
|
|
187
|
+
const obj_completedItemCount_union0_error = (() => {
|
|
188
|
+
if (typeof obj_completedItemCount !== 'number' || (typeof obj_completedItemCount === 'number' && Math.floor(obj_completedItemCount) !== obj_completedItemCount)) {
|
|
189
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_completedItemCount + '" (at "' + path_completedItemCount + '")');
|
|
190
|
+
}
|
|
191
|
+
})();
|
|
192
|
+
if (obj_completedItemCount_union0_error != null) {
|
|
193
|
+
obj_completedItemCount_union0 = obj_completedItemCount_union0_error.message;
|
|
194
|
+
}
|
|
195
|
+
let obj_completedItemCount_union1 = null;
|
|
196
|
+
const obj_completedItemCount_union1_error = (() => {
|
|
197
|
+
if (obj_completedItemCount !== null) {
|
|
198
|
+
return new TypeError('Expected "null" but received "' + typeof obj_completedItemCount + '" (at "' + path_completedItemCount + '")');
|
|
199
|
+
}
|
|
200
|
+
})();
|
|
201
|
+
if (obj_completedItemCount_union1_error != null) {
|
|
202
|
+
obj_completedItemCount_union1 = obj_completedItemCount_union1_error.message;
|
|
203
|
+
}
|
|
204
|
+
if (obj_completedItemCount_union0 && obj_completedItemCount_union1) {
|
|
205
|
+
let message = 'Object doesn\'t match union (at "' + path_completedItemCount + '")';
|
|
206
|
+
message += '\n' + obj_completedItemCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
207
|
+
message += '\n' + obj_completedItemCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
208
|
+
return new TypeError(message);
|
|
209
|
+
}
|
|
188
210
|
const obj_completedPercent = obj.completedPercent;
|
|
189
211
|
const path_completedPercent = path + '.completedPercent';
|
|
190
212
|
let obj_completedPercent_union0 = null;
|
|
191
213
|
const obj_completedPercent_union0_error = (() => {
|
|
192
|
-
if (typeof obj_completedPercent !== 'number') {
|
|
193
|
-
return new TypeError('Expected "
|
|
214
|
+
if (typeof obj_completedPercent !== 'number' || (typeof obj_completedPercent === 'number' && Math.floor(obj_completedPercent) !== obj_completedPercent)) {
|
|
215
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_completedPercent + '" (at "' + path_completedPercent + '")');
|
|
194
216
|
}
|
|
195
217
|
})();
|
|
196
218
|
if (obj_completedPercent_union0_error != null) {
|
|
@@ -211,337 +233,36 @@ function validate$e(obj, path = 'LearningItemProgressRepresentation') {
|
|
|
211
233
|
message += '\n' + obj_completedPercent_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
212
234
|
return new TypeError(message);
|
|
213
235
|
}
|
|
214
|
-
const
|
|
215
|
-
const
|
|
216
|
-
if (typeof
|
|
217
|
-
return new TypeError('Expected "
|
|
236
|
+
const obj_description = obj.description;
|
|
237
|
+
const path_description = path + '.description';
|
|
238
|
+
if (typeof obj_description !== 'string') {
|
|
239
|
+
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
218
240
|
}
|
|
219
|
-
const
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
|
|
241
|
+
const obj_dueDate = obj.dueDate;
|
|
242
|
+
const path_dueDate = path + '.dueDate';
|
|
243
|
+
let obj_dueDate_union0 = null;
|
|
244
|
+
const obj_dueDate_union0_error = (() => {
|
|
245
|
+
if (typeof obj_dueDate !== 'string') {
|
|
246
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dueDate + '" (at "' + path_dueDate + '")');
|
|
247
|
+
}
|
|
248
|
+
})();
|
|
249
|
+
if (obj_dueDate_union0_error != null) {
|
|
250
|
+
obj_dueDate_union0 = obj_dueDate_union0_error.message;
|
|
223
251
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
function keyBuilder$o(luvio, config) {
|
|
229
|
-
return keyPrefix + '::' + RepresentationType$b + ':' + config.learning_item_id;
|
|
230
|
-
}
|
|
231
|
-
function keyBuilderFromType$6(luvio, object) {
|
|
232
|
-
const keyParams = {
|
|
233
|
-
learning_item_id: object.learningItemId
|
|
234
|
-
};
|
|
235
|
-
return keyBuilder$o(luvio, keyParams);
|
|
236
|
-
}
|
|
237
|
-
function normalize$b(input, existing, path, luvio, store, timestamp) {
|
|
238
|
-
return input;
|
|
239
|
-
}
|
|
240
|
-
const select$o = function LearningItemProgressRepresentationSelect() {
|
|
241
|
-
return {
|
|
242
|
-
kind: 'Fragment',
|
|
243
|
-
version: VERSION$e,
|
|
244
|
-
private: [],
|
|
245
|
-
selections: [
|
|
246
|
-
{
|
|
247
|
-
name: 'completedDate',
|
|
248
|
-
kind: 'Scalar'
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
name: 'completedPercent',
|
|
252
|
-
kind: 'Scalar'
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
name: 'isCompleted',
|
|
256
|
-
kind: 'Scalar'
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
name: 'learningItemId',
|
|
260
|
-
kind: 'Scalar'
|
|
252
|
+
let obj_dueDate_union1 = null;
|
|
253
|
+
const obj_dueDate_union1_error = (() => {
|
|
254
|
+
if (obj_dueDate !== null) {
|
|
255
|
+
return new TypeError('Expected "null" but received "' + typeof obj_dueDate + '" (at "' + path_dueDate + '")');
|
|
261
256
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
function equals$e(existing, incoming) {
|
|
266
|
-
const existing_isCompleted = existing.isCompleted;
|
|
267
|
-
const incoming_isCompleted = incoming.isCompleted;
|
|
268
|
-
if (!(existing_isCompleted === incoming_isCompleted)) {
|
|
269
|
-
return false;
|
|
270
|
-
}
|
|
271
|
-
const existing_learningItemId = existing.learningItemId;
|
|
272
|
-
const incoming_learningItemId = incoming.learningItemId;
|
|
273
|
-
if (!(existing_learningItemId === incoming_learningItemId)) {
|
|
274
|
-
return false;
|
|
275
|
-
}
|
|
276
|
-
const existing_completedDate = existing.completedDate;
|
|
277
|
-
const incoming_completedDate = incoming.completedDate;
|
|
278
|
-
if (!(existing_completedDate === incoming_completedDate)) {
|
|
279
|
-
return false;
|
|
280
|
-
}
|
|
281
|
-
const existing_completedPercent = existing.completedPercent;
|
|
282
|
-
const incoming_completedPercent = incoming.completedPercent;
|
|
283
|
-
if (!(existing_completedPercent === incoming_completedPercent)) {
|
|
284
|
-
return false;
|
|
285
|
-
}
|
|
286
|
-
return true;
|
|
287
|
-
}
|
|
288
|
-
const ingest$b = function LearningItemProgressRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
289
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
290
|
-
const validateError = validate$e(input);
|
|
291
|
-
if (validateError !== null) {
|
|
292
|
-
throw validateError;
|
|
257
|
+
})();
|
|
258
|
+
if (obj_dueDate_union1_error != null) {
|
|
259
|
+
obj_dueDate_union1 = obj_dueDate_union1_error.message;
|
|
293
260
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
};
|
|
300
|
-
function getTypeCacheKeys$b(rootKeySet, luvio, input, fullPathFactory) {
|
|
301
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
302
|
-
const rootKey = keyBuilderFromType$6(luvio, input);
|
|
303
|
-
rootKeySet.set(rootKey, {
|
|
304
|
-
namespace: keyPrefix,
|
|
305
|
-
representationName: RepresentationType$b,
|
|
306
|
-
mergeable: false
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
function select$n(luvio, params) {
|
|
311
|
-
return select$o();
|
|
312
|
-
}
|
|
313
|
-
function getResponseCacheKeys$9(storeKeyMap, luvio, resourceParams, response) {
|
|
314
|
-
getTypeCacheKeys$b(storeKeyMap, luvio, response);
|
|
315
|
-
}
|
|
316
|
-
function ingestSuccess$9(luvio, resourceParams, response) {
|
|
317
|
-
const { body } = response;
|
|
318
|
-
const key = keyBuilderFromType$6(luvio, body);
|
|
319
|
-
luvio.storeIngest(key, ingest$b, body);
|
|
320
|
-
const snapshot = luvio.storeLookup({
|
|
321
|
-
recordId: key,
|
|
322
|
-
node: select$n(),
|
|
323
|
-
variables: {},
|
|
324
|
-
});
|
|
325
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
326
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
327
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
deepFreeze(snapshot.data);
|
|
331
|
-
return snapshot;
|
|
332
|
-
}
|
|
333
|
-
function createResourceRequest$9(config) {
|
|
334
|
-
const headers = {};
|
|
335
|
-
return {
|
|
336
|
-
baseUri: '/services/data/v60.0',
|
|
337
|
-
basePath: '/learning-content-platform/learning/evaluate',
|
|
338
|
-
method: 'post',
|
|
339
|
-
body: config.body,
|
|
340
|
-
urlParams: {},
|
|
341
|
-
queryParams: {},
|
|
342
|
-
headers,
|
|
343
|
-
priority: 'normal',
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
const adapterName$9 = 'evaluateLearningItem';
|
|
348
|
-
const evaluateLearningItem_ConfigPropertyMetadata = [
|
|
349
|
-
generateParamConfigMetadata('payload', true, 2 /* Body */, 4 /* Unsupported */),
|
|
350
|
-
];
|
|
351
|
-
const evaluateLearningItem_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$9, evaluateLearningItem_ConfigPropertyMetadata);
|
|
352
|
-
const createResourceParams$9 = /*#__PURE__*/ createResourceParams$a(evaluateLearningItem_ConfigPropertyMetadata);
|
|
353
|
-
function typeCheckConfig$9(untrustedConfig) {
|
|
354
|
-
const config = {};
|
|
355
|
-
const untrustedConfig_payload = untrustedConfig.payload;
|
|
356
|
-
const referenceEvaluateLearningItemInputRepresentationValidationError = validate$f(untrustedConfig_payload);
|
|
357
|
-
if (referenceEvaluateLearningItemInputRepresentationValidationError === null) {
|
|
358
|
-
config.payload = untrustedConfig_payload;
|
|
359
|
-
}
|
|
360
|
-
return config;
|
|
361
|
-
}
|
|
362
|
-
function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
|
|
363
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
364
|
-
return null;
|
|
365
|
-
}
|
|
366
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
367
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
368
|
-
}
|
|
369
|
-
const config = typeCheckConfig$9(untrustedConfig);
|
|
370
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
371
|
-
return null;
|
|
372
|
-
}
|
|
373
|
-
return config;
|
|
374
|
-
}
|
|
375
|
-
function buildNetworkSnapshot$9(luvio, config, options) {
|
|
376
|
-
const resourceParams = createResourceParams$9(config);
|
|
377
|
-
const request = createResourceRequest$9(resourceParams);
|
|
378
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
379
|
-
.then((response) => {
|
|
380
|
-
return luvio.handleSuccessResponse(() => {
|
|
381
|
-
const snapshot = ingestSuccess$9(luvio, resourceParams, response);
|
|
382
|
-
return luvio.storeBroadcast().then(() => snapshot);
|
|
383
|
-
}, () => {
|
|
384
|
-
const cache = new StoreKeyMap();
|
|
385
|
-
getResponseCacheKeys$9(cache, luvio, resourceParams, response.body);
|
|
386
|
-
return cache;
|
|
387
|
-
});
|
|
388
|
-
}, (response) => {
|
|
389
|
-
deepFreeze(response);
|
|
390
|
-
throw response;
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
const evaluateLearningItemAdapterFactory = (luvio) => {
|
|
394
|
-
return function evaluateLearningItem(untrustedConfig) {
|
|
395
|
-
const config = validateAdapterConfig$9(untrustedConfig, evaluateLearningItem_ConfigPropertyNames);
|
|
396
|
-
// Invalid or incomplete config
|
|
397
|
-
if (config === null) {
|
|
398
|
-
throw new Error('Invalid config for "evaluateLearningItem"');
|
|
399
|
-
}
|
|
400
|
-
return buildNetworkSnapshot$9(luvio, config);
|
|
401
|
-
};
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
const TTL$5 = 15000;
|
|
405
|
-
const VERSION$d = "b489f9f2cbdc91a04dd15b4d467b6760";
|
|
406
|
-
function validate$d(obj, path = 'FeaturedItemRepresentation') {
|
|
407
|
-
const v_error = (() => {
|
|
408
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
409
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
410
|
-
}
|
|
411
|
-
const obj_availablePointCount = obj.availablePointCount;
|
|
412
|
-
const path_availablePointCount = path + '.availablePointCount';
|
|
413
|
-
let obj_availablePointCount_union0 = null;
|
|
414
|
-
const obj_availablePointCount_union0_error = (() => {
|
|
415
|
-
if (typeof obj_availablePointCount !== 'number' || (typeof obj_availablePointCount === 'number' && Math.floor(obj_availablePointCount) !== obj_availablePointCount)) {
|
|
416
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_availablePointCount + '" (at "' + path_availablePointCount + '")');
|
|
417
|
-
}
|
|
418
|
-
})();
|
|
419
|
-
if (obj_availablePointCount_union0_error != null) {
|
|
420
|
-
obj_availablePointCount_union0 = obj_availablePointCount_union0_error.message;
|
|
421
|
-
}
|
|
422
|
-
let obj_availablePointCount_union1 = null;
|
|
423
|
-
const obj_availablePointCount_union1_error = (() => {
|
|
424
|
-
if (obj_availablePointCount !== null) {
|
|
425
|
-
return new TypeError('Expected "null" but received "' + typeof obj_availablePointCount + '" (at "' + path_availablePointCount + '")');
|
|
426
|
-
}
|
|
427
|
-
})();
|
|
428
|
-
if (obj_availablePointCount_union1_error != null) {
|
|
429
|
-
obj_availablePointCount_union1 = obj_availablePointCount_union1_error.message;
|
|
430
|
-
}
|
|
431
|
-
if (obj_availablePointCount_union0 && obj_availablePointCount_union1) {
|
|
432
|
-
let message = 'Object doesn\'t match union (at "' + path_availablePointCount + '")';
|
|
433
|
-
message += '\n' + obj_availablePointCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
434
|
-
message += '\n' + obj_availablePointCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
435
|
-
return new TypeError(message);
|
|
436
|
-
}
|
|
437
|
-
const obj_completedDate = obj.completedDate;
|
|
438
|
-
const path_completedDate = path + '.completedDate';
|
|
439
|
-
let obj_completedDate_union0 = null;
|
|
440
|
-
const obj_completedDate_union0_error = (() => {
|
|
441
|
-
if (typeof obj_completedDate !== 'string') {
|
|
442
|
-
return new TypeError('Expected "string" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
|
|
443
|
-
}
|
|
444
|
-
})();
|
|
445
|
-
if (obj_completedDate_union0_error != null) {
|
|
446
|
-
obj_completedDate_union0 = obj_completedDate_union0_error.message;
|
|
447
|
-
}
|
|
448
|
-
let obj_completedDate_union1 = null;
|
|
449
|
-
const obj_completedDate_union1_error = (() => {
|
|
450
|
-
if (obj_completedDate !== null) {
|
|
451
|
-
return new TypeError('Expected "null" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
|
|
452
|
-
}
|
|
453
|
-
})();
|
|
454
|
-
if (obj_completedDate_union1_error != null) {
|
|
455
|
-
obj_completedDate_union1 = obj_completedDate_union1_error.message;
|
|
456
|
-
}
|
|
457
|
-
if (obj_completedDate_union0 && obj_completedDate_union1) {
|
|
458
|
-
let message = 'Object doesn\'t match union (at "' + path_completedDate + '")';
|
|
459
|
-
message += '\n' + obj_completedDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
460
|
-
message += '\n' + obj_completedDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
461
|
-
return new TypeError(message);
|
|
462
|
-
}
|
|
463
|
-
const obj_completedItemCount = obj.completedItemCount;
|
|
464
|
-
const path_completedItemCount = path + '.completedItemCount';
|
|
465
|
-
let obj_completedItemCount_union0 = null;
|
|
466
|
-
const obj_completedItemCount_union0_error = (() => {
|
|
467
|
-
if (typeof obj_completedItemCount !== 'number' || (typeof obj_completedItemCount === 'number' && Math.floor(obj_completedItemCount) !== obj_completedItemCount)) {
|
|
468
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_completedItemCount + '" (at "' + path_completedItemCount + '")');
|
|
469
|
-
}
|
|
470
|
-
})();
|
|
471
|
-
if (obj_completedItemCount_union0_error != null) {
|
|
472
|
-
obj_completedItemCount_union0 = obj_completedItemCount_union0_error.message;
|
|
473
|
-
}
|
|
474
|
-
let obj_completedItemCount_union1 = null;
|
|
475
|
-
const obj_completedItemCount_union1_error = (() => {
|
|
476
|
-
if (obj_completedItemCount !== null) {
|
|
477
|
-
return new TypeError('Expected "null" but received "' + typeof obj_completedItemCount + '" (at "' + path_completedItemCount + '")');
|
|
478
|
-
}
|
|
479
|
-
})();
|
|
480
|
-
if (obj_completedItemCount_union1_error != null) {
|
|
481
|
-
obj_completedItemCount_union1 = obj_completedItemCount_union1_error.message;
|
|
482
|
-
}
|
|
483
|
-
if (obj_completedItemCount_union0 && obj_completedItemCount_union1) {
|
|
484
|
-
let message = 'Object doesn\'t match union (at "' + path_completedItemCount + '")';
|
|
485
|
-
message += '\n' + obj_completedItemCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
486
|
-
message += '\n' + obj_completedItemCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
487
|
-
return new TypeError(message);
|
|
488
|
-
}
|
|
489
|
-
const obj_completedPercent = obj.completedPercent;
|
|
490
|
-
const path_completedPercent = path + '.completedPercent';
|
|
491
|
-
let obj_completedPercent_union0 = null;
|
|
492
|
-
const obj_completedPercent_union0_error = (() => {
|
|
493
|
-
if (typeof obj_completedPercent !== 'number' || (typeof obj_completedPercent === 'number' && Math.floor(obj_completedPercent) !== obj_completedPercent)) {
|
|
494
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_completedPercent + '" (at "' + path_completedPercent + '")');
|
|
495
|
-
}
|
|
496
|
-
})();
|
|
497
|
-
if (obj_completedPercent_union0_error != null) {
|
|
498
|
-
obj_completedPercent_union0 = obj_completedPercent_union0_error.message;
|
|
499
|
-
}
|
|
500
|
-
let obj_completedPercent_union1 = null;
|
|
501
|
-
const obj_completedPercent_union1_error = (() => {
|
|
502
|
-
if (obj_completedPercent !== null) {
|
|
503
|
-
return new TypeError('Expected "null" but received "' + typeof obj_completedPercent + '" (at "' + path_completedPercent + '")');
|
|
504
|
-
}
|
|
505
|
-
})();
|
|
506
|
-
if (obj_completedPercent_union1_error != null) {
|
|
507
|
-
obj_completedPercent_union1 = obj_completedPercent_union1_error.message;
|
|
508
|
-
}
|
|
509
|
-
if (obj_completedPercent_union0 && obj_completedPercent_union1) {
|
|
510
|
-
let message = 'Object doesn\'t match union (at "' + path_completedPercent + '")';
|
|
511
|
-
message += '\n' + obj_completedPercent_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
512
|
-
message += '\n' + obj_completedPercent_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
513
|
-
return new TypeError(message);
|
|
514
|
-
}
|
|
515
|
-
const obj_description = obj.description;
|
|
516
|
-
const path_description = path + '.description';
|
|
517
|
-
if (typeof obj_description !== 'string') {
|
|
518
|
-
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
519
|
-
}
|
|
520
|
-
const obj_dueDate = obj.dueDate;
|
|
521
|
-
const path_dueDate = path + '.dueDate';
|
|
522
|
-
let obj_dueDate_union0 = null;
|
|
523
|
-
const obj_dueDate_union0_error = (() => {
|
|
524
|
-
if (typeof obj_dueDate !== 'string') {
|
|
525
|
-
return new TypeError('Expected "string" but received "' + typeof obj_dueDate + '" (at "' + path_dueDate + '")');
|
|
526
|
-
}
|
|
527
|
-
})();
|
|
528
|
-
if (obj_dueDate_union0_error != null) {
|
|
529
|
-
obj_dueDate_union0 = obj_dueDate_union0_error.message;
|
|
530
|
-
}
|
|
531
|
-
let obj_dueDate_union1 = null;
|
|
532
|
-
const obj_dueDate_union1_error = (() => {
|
|
533
|
-
if (obj_dueDate !== null) {
|
|
534
|
-
return new TypeError('Expected "null" but received "' + typeof obj_dueDate + '" (at "' + path_dueDate + '")');
|
|
535
|
-
}
|
|
536
|
-
})();
|
|
537
|
-
if (obj_dueDate_union1_error != null) {
|
|
538
|
-
obj_dueDate_union1 = obj_dueDate_union1_error.message;
|
|
539
|
-
}
|
|
540
|
-
if (obj_dueDate_union0 && obj_dueDate_union1) {
|
|
541
|
-
let message = 'Object doesn\'t match union (at "' + path_dueDate + '")';
|
|
542
|
-
message += '\n' + obj_dueDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
543
|
-
message += '\n' + obj_dueDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
544
|
-
return new TypeError(message);
|
|
261
|
+
if (obj_dueDate_union0 && obj_dueDate_union1) {
|
|
262
|
+
let message = 'Object doesn\'t match union (at "' + path_dueDate + '")';
|
|
263
|
+
message += '\n' + obj_dueDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
264
|
+
message += '\n' + obj_dueDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
265
|
+
return new TypeError(message);
|
|
545
266
|
}
|
|
546
267
|
const obj_earnedPointCount = obj.earnedPointCount;
|
|
547
268
|
const path_earnedPointCount = path + '.earnedPointCount';
|
|
@@ -800,23 +521,23 @@ function validate$d(obj, path = 'FeaturedItemRepresentation') {
|
|
|
800
521
|
})();
|
|
801
522
|
return v_error === undefined ? null : v_error;
|
|
802
523
|
}
|
|
803
|
-
const RepresentationType$
|
|
804
|
-
function keyBuilder$
|
|
805
|
-
return keyPrefix + '::' + RepresentationType$
|
|
524
|
+
const RepresentationType$b = 'FeaturedItemRepresentation';
|
|
525
|
+
function keyBuilder$o(luvio, config) {
|
|
526
|
+
return keyPrefix + '::' + RepresentationType$b + ':' + config.id;
|
|
806
527
|
}
|
|
807
|
-
function keyBuilderFromType$
|
|
528
|
+
function keyBuilderFromType$6(luvio, object) {
|
|
808
529
|
const keyParams = {
|
|
809
530
|
id: object.id
|
|
810
531
|
};
|
|
811
|
-
return keyBuilder$
|
|
532
|
+
return keyBuilder$o(luvio, keyParams);
|
|
812
533
|
}
|
|
813
|
-
function normalize$
|
|
534
|
+
function normalize$b(input, existing, path, luvio, store, timestamp) {
|
|
814
535
|
return input;
|
|
815
536
|
}
|
|
816
|
-
const select$
|
|
537
|
+
const select$o = function FeaturedItemRepresentationSelect() {
|
|
817
538
|
return {
|
|
818
539
|
kind: 'Fragment',
|
|
819
|
-
version: VERSION$
|
|
540
|
+
version: VERSION$e,
|
|
820
541
|
private: [],
|
|
821
542
|
selections: [
|
|
822
543
|
{
|
|
@@ -898,7 +619,7 @@ const select$m = function FeaturedItemRepresentationSelect() {
|
|
|
898
619
|
]
|
|
899
620
|
};
|
|
900
621
|
};
|
|
901
|
-
function equals$
|
|
622
|
+
function equals$e(existing, incoming) {
|
|
902
623
|
const existing_description = existing.description;
|
|
903
624
|
const incoming_description = incoming.description;
|
|
904
625
|
if (!(existing_description === incoming_description)) {
|
|
@@ -996,30 +717,30 @@ function equals$d(existing, incoming) {
|
|
|
996
717
|
}
|
|
997
718
|
return true;
|
|
998
719
|
}
|
|
999
|
-
const ingest$
|
|
720
|
+
const ingest$b = function FeaturedItemRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1000
721
|
if (process.env.NODE_ENV !== 'production') {
|
|
1001
|
-
const validateError = validate$
|
|
722
|
+
const validateError = validate$f(input);
|
|
1002
723
|
if (validateError !== null) {
|
|
1003
724
|
throw validateError;
|
|
1004
725
|
}
|
|
1005
726
|
}
|
|
1006
|
-
const key = keyBuilderFromType$
|
|
1007
|
-
const ttlToUse = TTL$
|
|
1008
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
727
|
+
const key = keyBuilderFromType$6(luvio, input);
|
|
728
|
+
const ttlToUse = TTL$6;
|
|
729
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$b, "LearningContentPlatform", VERSION$e, RepresentationType$b, equals$e);
|
|
1009
730
|
return createLink(key);
|
|
1010
731
|
};
|
|
1011
|
-
function getTypeCacheKeys$
|
|
732
|
+
function getTypeCacheKeys$b(rootKeySet, luvio, input, fullPathFactory) {
|
|
1012
733
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1013
|
-
const rootKey = keyBuilderFromType$
|
|
734
|
+
const rootKey = keyBuilderFromType$6(luvio, input);
|
|
1014
735
|
rootKeySet.set(rootKey, {
|
|
1015
736
|
namespace: keyPrefix,
|
|
1016
|
-
representationName: RepresentationType$
|
|
737
|
+
representationName: RepresentationType$b,
|
|
1017
738
|
mergeable: false
|
|
1018
739
|
});
|
|
1019
740
|
}
|
|
1020
741
|
|
|
1021
|
-
const VERSION$
|
|
1022
|
-
function validate$
|
|
742
|
+
const VERSION$d = "94c7194d9578589364c6efd021226634";
|
|
743
|
+
function validate$e(obj, path = 'FeaturedItemRecommendedListRepresentation') {
|
|
1023
744
|
const v_error = (() => {
|
|
1024
745
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1025
746
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1039,14 +760,14 @@ function validate$c(obj, path = 'FeaturedItemRecommendedListRepresentation') {
|
|
|
1039
760
|
})();
|
|
1040
761
|
return v_error === undefined ? null : v_error;
|
|
1041
762
|
}
|
|
1042
|
-
const RepresentationType$
|
|
1043
|
-
function normalize$
|
|
763
|
+
const RepresentationType$a = 'FeaturedItemRecommendedListRepresentation';
|
|
764
|
+
function normalize$a(input, existing, path, luvio, store, timestamp) {
|
|
1044
765
|
const input_recommendedList = input.recommendedList;
|
|
1045
766
|
const input_recommendedList_id = path.fullPath + '__recommendedList';
|
|
1046
767
|
for (let i = 0; i < input_recommendedList.length; i++) {
|
|
1047
768
|
const input_recommendedList_item = input_recommendedList[i];
|
|
1048
769
|
let input_recommendedList_item_id = input_recommendedList_id + '__' + i;
|
|
1049
|
-
input_recommendedList[i] = ingest$
|
|
770
|
+
input_recommendedList[i] = ingest$b(input_recommendedList_item, {
|
|
1050
771
|
fullPath: input_recommendedList_item_id,
|
|
1051
772
|
propertyName: i,
|
|
1052
773
|
parent: {
|
|
@@ -1059,22 +780,22 @@ function normalize$9(input, existing, path, luvio, store, timestamp) {
|
|
|
1059
780
|
}
|
|
1060
781
|
return input;
|
|
1061
782
|
}
|
|
1062
|
-
const select$
|
|
783
|
+
const select$n = function FeaturedItemRecommendedListRepresentationSelect() {
|
|
1063
784
|
return {
|
|
1064
785
|
kind: 'Fragment',
|
|
1065
|
-
version: VERSION$
|
|
786
|
+
version: VERSION$d,
|
|
1066
787
|
private: [],
|
|
1067
788
|
selections: [
|
|
1068
789
|
{
|
|
1069
790
|
name: 'recommendedList',
|
|
1070
791
|
kind: 'Link',
|
|
1071
792
|
plural: true,
|
|
1072
|
-
fragment: select$
|
|
793
|
+
fragment: select$o()
|
|
1073
794
|
}
|
|
1074
795
|
]
|
|
1075
796
|
};
|
|
1076
797
|
};
|
|
1077
|
-
function equals$
|
|
798
|
+
function equals$d(existing, incoming) {
|
|
1078
799
|
const existing_recommendedList = existing.recommendedList;
|
|
1079
800
|
const incoming_recommendedList = incoming.recommendedList;
|
|
1080
801
|
const equals_recommendedList_items = equalsArray(existing_recommendedList, incoming_recommendedList, (existing_recommendedList_item, incoming_recommendedList_item) => {
|
|
@@ -1087,48 +808,48 @@ function equals$c(existing, incoming) {
|
|
|
1087
808
|
}
|
|
1088
809
|
return true;
|
|
1089
810
|
}
|
|
1090
|
-
const ingest$
|
|
811
|
+
const ingest$a = function FeaturedItemRecommendedListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1091
812
|
if (process.env.NODE_ENV !== 'production') {
|
|
1092
|
-
const validateError = validate$
|
|
813
|
+
const validateError = validate$e(input);
|
|
1093
814
|
if (validateError !== null) {
|
|
1094
815
|
throw validateError;
|
|
1095
816
|
}
|
|
1096
817
|
}
|
|
1097
818
|
const key = path.fullPath;
|
|
1098
819
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
1099
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
820
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$a, "LearningContentPlatform", VERSION$d, RepresentationType$a, equals$d);
|
|
1100
821
|
return createLink(key);
|
|
1101
822
|
};
|
|
1102
|
-
function getTypeCacheKeys$
|
|
823
|
+
function getTypeCacheKeys$a(rootKeySet, luvio, input, fullPathFactory) {
|
|
1103
824
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1104
825
|
const rootKey = fullPathFactory();
|
|
1105
826
|
rootKeySet.set(rootKey, {
|
|
1106
827
|
namespace: keyPrefix,
|
|
1107
|
-
representationName: RepresentationType$
|
|
828
|
+
representationName: RepresentationType$a,
|
|
1108
829
|
mergeable: false
|
|
1109
830
|
});
|
|
1110
831
|
const input_recommendedList_length = input.recommendedList.length;
|
|
1111
832
|
for (let i = 0; i < input_recommendedList_length; i++) {
|
|
1112
|
-
getTypeCacheKeys$
|
|
833
|
+
getTypeCacheKeys$b(rootKeySet, luvio, input.recommendedList[i]);
|
|
1113
834
|
}
|
|
1114
835
|
}
|
|
1115
836
|
|
|
1116
|
-
function select$
|
|
1117
|
-
return select$
|
|
837
|
+
function select$m(luvio, params) {
|
|
838
|
+
return select$n();
|
|
1118
839
|
}
|
|
1119
|
-
function keyBuilder$
|
|
840
|
+
function keyBuilder$n(luvio, params) {
|
|
1120
841
|
return keyPrefix + '::FeaturedItemRecommendedListRepresentation:(' + 'appId:' + params.queryParams.appId + ',' + 'context:' + params.queryParams.context + ')';
|
|
1121
842
|
}
|
|
1122
|
-
function getResponseCacheKeys$
|
|
1123
|
-
getTypeCacheKeys$
|
|
843
|
+
function getResponseCacheKeys$9(storeKeyMap, luvio, resourceParams, response) {
|
|
844
|
+
getTypeCacheKeys$a(storeKeyMap, luvio, response, () => keyBuilder$n(luvio, resourceParams));
|
|
1124
845
|
}
|
|
1125
|
-
function ingestSuccess$
|
|
846
|
+
function ingestSuccess$9(luvio, resourceParams, response, snapshotRefresh) {
|
|
1126
847
|
const { body } = response;
|
|
1127
|
-
const key = keyBuilder$
|
|
1128
|
-
luvio.storeIngest(key, ingest$
|
|
848
|
+
const key = keyBuilder$n(luvio, resourceParams);
|
|
849
|
+
luvio.storeIngest(key, ingest$a, body);
|
|
1129
850
|
const snapshot = luvio.storeLookup({
|
|
1130
851
|
recordId: key,
|
|
1131
|
-
node: select$
|
|
852
|
+
node: select$m(),
|
|
1132
853
|
variables: {},
|
|
1133
854
|
}, snapshotRefresh);
|
|
1134
855
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1140,12 +861,12 @@ function ingestSuccess$8(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1140
861
|
return snapshot;
|
|
1141
862
|
}
|
|
1142
863
|
function ingestError$8(luvio, params, error, snapshotRefresh) {
|
|
1143
|
-
const key = keyBuilder$
|
|
864
|
+
const key = keyBuilder$n(luvio, params);
|
|
1144
865
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1145
866
|
luvio.storeIngestError(key, errorSnapshot);
|
|
1146
867
|
return errorSnapshot;
|
|
1147
868
|
}
|
|
1148
|
-
function createResourceRequest$
|
|
869
|
+
function createResourceRequest$9(config) {
|
|
1149
870
|
const headers = {};
|
|
1150
871
|
return {
|
|
1151
872
|
baseUri: '/services/data/v60.0',
|
|
@@ -1159,61 +880,61 @@ function createResourceRequest$8(config) {
|
|
|
1159
880
|
};
|
|
1160
881
|
}
|
|
1161
882
|
|
|
1162
|
-
const adapterName$
|
|
883
|
+
const adapterName$9 = 'getFeaturedItemsRecommendedList';
|
|
1163
884
|
const getFeaturedItemsRecommendedList_ConfigPropertyMetadata = [
|
|
1164
885
|
generateParamConfigMetadata('appId', true, 1 /* QueryParameter */, 0 /* String */),
|
|
1165
886
|
generateParamConfigMetadata('context', true, 1 /* QueryParameter */, 0 /* String */),
|
|
1166
887
|
];
|
|
1167
|
-
const getFeaturedItemsRecommendedList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1168
|
-
const createResourceParams$
|
|
1169
|
-
function keyBuilder$
|
|
1170
|
-
const resourceParams = createResourceParams$
|
|
1171
|
-
return keyBuilder$
|
|
888
|
+
const getFeaturedItemsRecommendedList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$9, getFeaturedItemsRecommendedList_ConfigPropertyMetadata);
|
|
889
|
+
const createResourceParams$9 = /*#__PURE__*/ createResourceParams$a(getFeaturedItemsRecommendedList_ConfigPropertyMetadata);
|
|
890
|
+
function keyBuilder$m(luvio, config) {
|
|
891
|
+
const resourceParams = createResourceParams$9(config);
|
|
892
|
+
return keyBuilder$n(luvio, resourceParams);
|
|
1172
893
|
}
|
|
1173
|
-
function typeCheckConfig$
|
|
894
|
+
function typeCheckConfig$9(untrustedConfig) {
|
|
1174
895
|
const config = {};
|
|
1175
896
|
typeCheckConfig$a(untrustedConfig, config, getFeaturedItemsRecommendedList_ConfigPropertyMetadata);
|
|
1176
897
|
return config;
|
|
1177
898
|
}
|
|
1178
|
-
function validateAdapterConfig$
|
|
899
|
+
function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
|
|
1179
900
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1180
901
|
return null;
|
|
1181
902
|
}
|
|
1182
903
|
if (process.env.NODE_ENV !== 'production') {
|
|
1183
904
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1184
905
|
}
|
|
1185
|
-
const config = typeCheckConfig$
|
|
906
|
+
const config = typeCheckConfig$9(untrustedConfig);
|
|
1186
907
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1187
908
|
return null;
|
|
1188
909
|
}
|
|
1189
910
|
return config;
|
|
1190
911
|
}
|
|
1191
912
|
function adapterFragment$8(luvio, config) {
|
|
1192
|
-
createResourceParams$
|
|
1193
|
-
return select$
|
|
913
|
+
createResourceParams$9(config);
|
|
914
|
+
return select$m();
|
|
1194
915
|
}
|
|
1195
916
|
function onFetchResponseSuccess$8(luvio, config, resourceParams, response) {
|
|
1196
|
-
const snapshot = ingestSuccess$
|
|
917
|
+
const snapshot = ingestSuccess$9(luvio, resourceParams, response, {
|
|
1197
918
|
config,
|
|
1198
|
-
resolve: () => buildNetworkSnapshot$
|
|
919
|
+
resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
|
|
1199
920
|
});
|
|
1200
921
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1201
922
|
}
|
|
1202
923
|
function onFetchResponseError$8(luvio, config, resourceParams, response) {
|
|
1203
924
|
const snapshot = ingestError$8(luvio, resourceParams, response, {
|
|
1204
925
|
config,
|
|
1205
|
-
resolve: () => buildNetworkSnapshot$
|
|
926
|
+
resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
|
|
1206
927
|
});
|
|
1207
928
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1208
929
|
}
|
|
1209
|
-
function buildNetworkSnapshot$
|
|
1210
|
-
const resourceParams = createResourceParams$
|
|
1211
|
-
const request = createResourceRequest$
|
|
930
|
+
function buildNetworkSnapshot$9(luvio, config, options) {
|
|
931
|
+
const resourceParams = createResourceParams$9(config);
|
|
932
|
+
const request = createResourceRequest$9(resourceParams);
|
|
1212
933
|
return luvio.dispatchResourceRequest(request, options)
|
|
1213
934
|
.then((response) => {
|
|
1214
935
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$8(luvio, config, resourceParams, response), () => {
|
|
1215
936
|
const cache = new StoreKeyMap();
|
|
1216
|
-
getResponseCacheKeys$
|
|
937
|
+
getResponseCacheKeys$9(cache, luvio, resourceParams, response.body);
|
|
1217
938
|
return cache;
|
|
1218
939
|
});
|
|
1219
940
|
}, (response) => {
|
|
@@ -1221,23 +942,23 @@ function buildNetworkSnapshot$8(luvio, config, options) {
|
|
|
1221
942
|
});
|
|
1222
943
|
}
|
|
1223
944
|
function buildNetworkSnapshotCachePolicy$8(context, coercedAdapterRequestContext) {
|
|
1224
|
-
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$
|
|
945
|
+
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$9, undefined, false);
|
|
1225
946
|
}
|
|
1226
947
|
function buildCachedSnapshotCachePolicy$8(context, storeLookup) {
|
|
1227
948
|
const { luvio, config } = context;
|
|
1228
949
|
const selector = {
|
|
1229
|
-
recordId: keyBuilder$
|
|
950
|
+
recordId: keyBuilder$m(luvio, config),
|
|
1230
951
|
node: adapterFragment$8(luvio, config),
|
|
1231
952
|
variables: {},
|
|
1232
953
|
};
|
|
1233
954
|
const cacheSnapshot = storeLookup(selector, {
|
|
1234
955
|
config,
|
|
1235
|
-
resolve: () => buildNetworkSnapshot$
|
|
956
|
+
resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
|
|
1236
957
|
});
|
|
1237
958
|
return cacheSnapshot;
|
|
1238
959
|
}
|
|
1239
960
|
const getFeaturedItemsRecommendedListAdapterFactory = (luvio) => function LearningContentPlatform__getFeaturedItemsRecommendedList(untrustedConfig, requestContext) {
|
|
1240
|
-
const config = validateAdapterConfig$
|
|
961
|
+
const config = validateAdapterConfig$9(untrustedConfig, getFeaturedItemsRecommendedList_ConfigPropertyNames);
|
|
1241
962
|
// Invalid or incomplete config
|
|
1242
963
|
if (config === null) {
|
|
1243
964
|
return null;
|
|
@@ -1246,8 +967,8 @@ const getFeaturedItemsRecommendedListAdapterFactory = (luvio) => function Learni
|
|
|
1246
967
|
buildCachedSnapshotCachePolicy$8, buildNetworkSnapshotCachePolicy$8);
|
|
1247
968
|
};
|
|
1248
969
|
|
|
1249
|
-
const VERSION$
|
|
1250
|
-
function validate$
|
|
970
|
+
const VERSION$c = "5d7adb55f43466f61c4837ebf27eab61";
|
|
971
|
+
function validate$d(obj, path = 'FeaturedItemRelatedListRepresentation') {
|
|
1251
972
|
const v_error = (() => {
|
|
1252
973
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1253
974
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1267,14 +988,14 @@ function validate$b(obj, path = 'FeaturedItemRelatedListRepresentation') {
|
|
|
1267
988
|
})();
|
|
1268
989
|
return v_error === undefined ? null : v_error;
|
|
1269
990
|
}
|
|
1270
|
-
const RepresentationType$
|
|
1271
|
-
function normalize$
|
|
991
|
+
const RepresentationType$9 = 'FeaturedItemRelatedListRepresentation';
|
|
992
|
+
function normalize$9(input, existing, path, luvio, store, timestamp) {
|
|
1272
993
|
const input_relatedList = input.relatedList;
|
|
1273
994
|
const input_relatedList_id = path.fullPath + '__relatedList';
|
|
1274
995
|
for (let i = 0; i < input_relatedList.length; i++) {
|
|
1275
996
|
const input_relatedList_item = input_relatedList[i];
|
|
1276
997
|
let input_relatedList_item_id = input_relatedList_id + '__' + i;
|
|
1277
|
-
input_relatedList[i] = ingest$
|
|
998
|
+
input_relatedList[i] = ingest$b(input_relatedList_item, {
|
|
1278
999
|
fullPath: input_relatedList_item_id,
|
|
1279
1000
|
propertyName: i,
|
|
1280
1001
|
parent: {
|
|
@@ -1287,22 +1008,22 @@ function normalize$8(input, existing, path, luvio, store, timestamp) {
|
|
|
1287
1008
|
}
|
|
1288
1009
|
return input;
|
|
1289
1010
|
}
|
|
1290
|
-
const select$
|
|
1011
|
+
const select$l = function FeaturedItemRelatedListRepresentationSelect() {
|
|
1291
1012
|
return {
|
|
1292
1013
|
kind: 'Fragment',
|
|
1293
|
-
version: VERSION$
|
|
1014
|
+
version: VERSION$c,
|
|
1294
1015
|
private: [],
|
|
1295
1016
|
selections: [
|
|
1296
1017
|
{
|
|
1297
1018
|
name: 'relatedList',
|
|
1298
1019
|
kind: 'Link',
|
|
1299
1020
|
plural: true,
|
|
1300
|
-
fragment: select$
|
|
1021
|
+
fragment: select$o()
|
|
1301
1022
|
}
|
|
1302
1023
|
]
|
|
1303
1024
|
};
|
|
1304
1025
|
};
|
|
1305
|
-
function equals$
|
|
1026
|
+
function equals$c(existing, incoming) {
|
|
1306
1027
|
const existing_relatedList = existing.relatedList;
|
|
1307
1028
|
const incoming_relatedList = incoming.relatedList;
|
|
1308
1029
|
const equals_relatedList_items = equalsArray(existing_relatedList, incoming_relatedList, (existing_relatedList_item, incoming_relatedList_item) => {
|
|
@@ -1315,48 +1036,48 @@ function equals$b(existing, incoming) {
|
|
|
1315
1036
|
}
|
|
1316
1037
|
return true;
|
|
1317
1038
|
}
|
|
1318
|
-
const ingest$
|
|
1039
|
+
const ingest$9 = function FeaturedItemRelatedListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1319
1040
|
if (process.env.NODE_ENV !== 'production') {
|
|
1320
|
-
const validateError = validate$
|
|
1041
|
+
const validateError = validate$d(input);
|
|
1321
1042
|
if (validateError !== null) {
|
|
1322
1043
|
throw validateError;
|
|
1323
1044
|
}
|
|
1324
1045
|
}
|
|
1325
1046
|
const key = path.fullPath;
|
|
1326
1047
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
1327
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1048
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$9, "LearningContentPlatform", VERSION$c, RepresentationType$9, equals$c);
|
|
1328
1049
|
return createLink(key);
|
|
1329
1050
|
};
|
|
1330
|
-
function getTypeCacheKeys$
|
|
1051
|
+
function getTypeCacheKeys$9(rootKeySet, luvio, input, fullPathFactory) {
|
|
1331
1052
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1332
1053
|
const rootKey = fullPathFactory();
|
|
1333
1054
|
rootKeySet.set(rootKey, {
|
|
1334
1055
|
namespace: keyPrefix,
|
|
1335
|
-
representationName: RepresentationType$
|
|
1056
|
+
representationName: RepresentationType$9,
|
|
1336
1057
|
mergeable: false
|
|
1337
1058
|
});
|
|
1338
1059
|
const input_relatedList_length = input.relatedList.length;
|
|
1339
1060
|
for (let i = 0; i < input_relatedList_length; i++) {
|
|
1340
|
-
getTypeCacheKeys$
|
|
1061
|
+
getTypeCacheKeys$b(rootKeySet, luvio, input.relatedList[i]);
|
|
1341
1062
|
}
|
|
1342
1063
|
}
|
|
1343
1064
|
|
|
1344
|
-
function select$
|
|
1345
|
-
return select$
|
|
1065
|
+
function select$k(luvio, params) {
|
|
1066
|
+
return select$l();
|
|
1346
1067
|
}
|
|
1347
|
-
function keyBuilder$
|
|
1068
|
+
function keyBuilder$l(luvio, params) {
|
|
1348
1069
|
return keyPrefix + '::FeaturedItemRelatedListRepresentation:(' + 'appId:' + params.queryParams.appId + ',' + 'pageRef:' + params.queryParams.pageRef + ')';
|
|
1349
1070
|
}
|
|
1350
|
-
function getResponseCacheKeys$
|
|
1351
|
-
getTypeCacheKeys$
|
|
1071
|
+
function getResponseCacheKeys$8(storeKeyMap, luvio, resourceParams, response) {
|
|
1072
|
+
getTypeCacheKeys$9(storeKeyMap, luvio, response, () => keyBuilder$l(luvio, resourceParams));
|
|
1352
1073
|
}
|
|
1353
|
-
function ingestSuccess$
|
|
1074
|
+
function ingestSuccess$8(luvio, resourceParams, response, snapshotRefresh) {
|
|
1354
1075
|
const { body } = response;
|
|
1355
|
-
const key = keyBuilder$
|
|
1356
|
-
luvio.storeIngest(key, ingest$
|
|
1076
|
+
const key = keyBuilder$l(luvio, resourceParams);
|
|
1077
|
+
luvio.storeIngest(key, ingest$9, body);
|
|
1357
1078
|
const snapshot = luvio.storeLookup({
|
|
1358
1079
|
recordId: key,
|
|
1359
|
-
node: select$
|
|
1080
|
+
node: select$k(),
|
|
1360
1081
|
variables: {},
|
|
1361
1082
|
}, snapshotRefresh);
|
|
1362
1083
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1368,12 +1089,12 @@ function ingestSuccess$7(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1368
1089
|
return snapshot;
|
|
1369
1090
|
}
|
|
1370
1091
|
function ingestError$7(luvio, params, error, snapshotRefresh) {
|
|
1371
|
-
const key = keyBuilder$
|
|
1092
|
+
const key = keyBuilder$l(luvio, params);
|
|
1372
1093
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1373
1094
|
luvio.storeIngestError(key, errorSnapshot);
|
|
1374
1095
|
return errorSnapshot;
|
|
1375
1096
|
}
|
|
1376
|
-
function createResourceRequest$
|
|
1097
|
+
function createResourceRequest$8(config) {
|
|
1377
1098
|
const headers = {};
|
|
1378
1099
|
return {
|
|
1379
1100
|
baseUri: '/services/data/v60.0',
|
|
@@ -1387,61 +1108,61 @@ function createResourceRequest$7(config) {
|
|
|
1387
1108
|
};
|
|
1388
1109
|
}
|
|
1389
1110
|
|
|
1390
|
-
const adapterName$
|
|
1111
|
+
const adapterName$8 = 'getFeaturedItemsRelatedList';
|
|
1391
1112
|
const getFeaturedItemsRelatedList_ConfigPropertyMetadata = [
|
|
1392
1113
|
generateParamConfigMetadata('appId', true, 1 /* QueryParameter */, 0 /* String */),
|
|
1393
1114
|
generateParamConfigMetadata('pageRef', true, 1 /* QueryParameter */, 0 /* String */),
|
|
1394
1115
|
];
|
|
1395
|
-
const getFeaturedItemsRelatedList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1396
|
-
const createResourceParams$
|
|
1397
|
-
function keyBuilder$
|
|
1398
|
-
const resourceParams = createResourceParams$
|
|
1399
|
-
return keyBuilder$
|
|
1116
|
+
const getFeaturedItemsRelatedList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$8, getFeaturedItemsRelatedList_ConfigPropertyMetadata);
|
|
1117
|
+
const createResourceParams$8 = /*#__PURE__*/ createResourceParams$a(getFeaturedItemsRelatedList_ConfigPropertyMetadata);
|
|
1118
|
+
function keyBuilder$k(luvio, config) {
|
|
1119
|
+
const resourceParams = createResourceParams$8(config);
|
|
1120
|
+
return keyBuilder$l(luvio, resourceParams);
|
|
1400
1121
|
}
|
|
1401
|
-
function typeCheckConfig$
|
|
1122
|
+
function typeCheckConfig$8(untrustedConfig) {
|
|
1402
1123
|
const config = {};
|
|
1403
1124
|
typeCheckConfig$a(untrustedConfig, config, getFeaturedItemsRelatedList_ConfigPropertyMetadata);
|
|
1404
1125
|
return config;
|
|
1405
1126
|
}
|
|
1406
|
-
function validateAdapterConfig$
|
|
1127
|
+
function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
|
|
1407
1128
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1408
1129
|
return null;
|
|
1409
1130
|
}
|
|
1410
1131
|
if (process.env.NODE_ENV !== 'production') {
|
|
1411
1132
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1412
1133
|
}
|
|
1413
|
-
const config = typeCheckConfig$
|
|
1134
|
+
const config = typeCheckConfig$8(untrustedConfig);
|
|
1414
1135
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1415
1136
|
return null;
|
|
1416
1137
|
}
|
|
1417
1138
|
return config;
|
|
1418
1139
|
}
|
|
1419
1140
|
function adapterFragment$7(luvio, config) {
|
|
1420
|
-
createResourceParams$
|
|
1421
|
-
return select$
|
|
1141
|
+
createResourceParams$8(config);
|
|
1142
|
+
return select$k();
|
|
1422
1143
|
}
|
|
1423
1144
|
function onFetchResponseSuccess$7(luvio, config, resourceParams, response) {
|
|
1424
|
-
const snapshot = ingestSuccess$
|
|
1145
|
+
const snapshot = ingestSuccess$8(luvio, resourceParams, response, {
|
|
1425
1146
|
config,
|
|
1426
|
-
resolve: () => buildNetworkSnapshot$
|
|
1147
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
1427
1148
|
});
|
|
1428
1149
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1429
1150
|
}
|
|
1430
1151
|
function onFetchResponseError$7(luvio, config, resourceParams, response) {
|
|
1431
1152
|
const snapshot = ingestError$7(luvio, resourceParams, response, {
|
|
1432
1153
|
config,
|
|
1433
|
-
resolve: () => buildNetworkSnapshot$
|
|
1154
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
1434
1155
|
});
|
|
1435
1156
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1436
1157
|
}
|
|
1437
|
-
function buildNetworkSnapshot$
|
|
1438
|
-
const resourceParams = createResourceParams$
|
|
1439
|
-
const request = createResourceRequest$
|
|
1158
|
+
function buildNetworkSnapshot$8(luvio, config, options) {
|
|
1159
|
+
const resourceParams = createResourceParams$8(config);
|
|
1160
|
+
const request = createResourceRequest$8(resourceParams);
|
|
1440
1161
|
return luvio.dispatchResourceRequest(request, options)
|
|
1441
1162
|
.then((response) => {
|
|
1442
1163
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$7(luvio, config, resourceParams, response), () => {
|
|
1443
1164
|
const cache = new StoreKeyMap();
|
|
1444
|
-
getResponseCacheKeys$
|
|
1165
|
+
getResponseCacheKeys$8(cache, luvio, resourceParams, response.body);
|
|
1445
1166
|
return cache;
|
|
1446
1167
|
});
|
|
1447
1168
|
}, (response) => {
|
|
@@ -1449,23 +1170,23 @@ function buildNetworkSnapshot$7(luvio, config, options) {
|
|
|
1449
1170
|
});
|
|
1450
1171
|
}
|
|
1451
1172
|
function buildNetworkSnapshotCachePolicy$7(context, coercedAdapterRequestContext) {
|
|
1452
|
-
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$
|
|
1173
|
+
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$8, undefined, false);
|
|
1453
1174
|
}
|
|
1454
1175
|
function buildCachedSnapshotCachePolicy$7(context, storeLookup) {
|
|
1455
1176
|
const { luvio, config } = context;
|
|
1456
1177
|
const selector = {
|
|
1457
|
-
recordId: keyBuilder$
|
|
1178
|
+
recordId: keyBuilder$k(luvio, config),
|
|
1458
1179
|
node: adapterFragment$7(luvio, config),
|
|
1459
1180
|
variables: {},
|
|
1460
1181
|
};
|
|
1461
1182
|
const cacheSnapshot = storeLookup(selector, {
|
|
1462
1183
|
config,
|
|
1463
|
-
resolve: () => buildNetworkSnapshot$
|
|
1184
|
+
resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
|
|
1464
1185
|
});
|
|
1465
1186
|
return cacheSnapshot;
|
|
1466
1187
|
}
|
|
1467
1188
|
const getFeaturedItemsRelatedListAdapterFactory = (luvio) => function LearningContentPlatform__getFeaturedItemsRelatedList(untrustedConfig, requestContext) {
|
|
1468
|
-
const config = validateAdapterConfig$
|
|
1189
|
+
const config = validateAdapterConfig$8(untrustedConfig, getFeaturedItemsRelatedList_ConfigPropertyNames);
|
|
1469
1190
|
// Invalid or incomplete config
|
|
1470
1191
|
if (config === null) {
|
|
1471
1192
|
return null;
|
|
@@ -1474,8 +1195,8 @@ const getFeaturedItemsRelatedListAdapterFactory = (luvio) => function LearningCo
|
|
|
1474
1195
|
buildCachedSnapshotCachePolicy$7, buildNetworkSnapshotCachePolicy$7);
|
|
1475
1196
|
};
|
|
1476
1197
|
|
|
1477
|
-
const VERSION$
|
|
1478
|
-
function validate$
|
|
1198
|
+
const VERSION$b = "8471031fcff953c83f350a0f66b60ddb";
|
|
1199
|
+
function validate$c(obj, path = 'LearningConfigRepresentation') {
|
|
1479
1200
|
const v_error = (() => {
|
|
1480
1201
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1481
1202
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1498,14 +1219,14 @@ function validate$a(obj, path = 'LearningConfigRepresentation') {
|
|
|
1498
1219
|
})();
|
|
1499
1220
|
return v_error === undefined ? null : v_error;
|
|
1500
1221
|
}
|
|
1501
|
-
const RepresentationType$
|
|
1502
|
-
function normalize$
|
|
1222
|
+
const RepresentationType$8 = 'LearningConfigRepresentation';
|
|
1223
|
+
function normalize$8(input, existing, path, luvio, store, timestamp) {
|
|
1503
1224
|
return input;
|
|
1504
1225
|
}
|
|
1505
|
-
const select$
|
|
1226
|
+
const select$j = function LearningConfigRepresentationSelect() {
|
|
1506
1227
|
return {
|
|
1507
1228
|
kind: 'Fragment',
|
|
1508
|
-
version: VERSION$
|
|
1229
|
+
version: VERSION$b,
|
|
1509
1230
|
private: [],
|
|
1510
1231
|
selections: [
|
|
1511
1232
|
{
|
|
@@ -1523,7 +1244,7 @@ const select$h = function LearningConfigRepresentationSelect() {
|
|
|
1523
1244
|
]
|
|
1524
1245
|
};
|
|
1525
1246
|
};
|
|
1526
|
-
function equals$
|
|
1247
|
+
function equals$b(existing, incoming) {
|
|
1527
1248
|
const existing_hasElevatedLearningAccess = existing.hasElevatedLearningAccess;
|
|
1528
1249
|
const incoming_hasElevatedLearningAccess = incoming.hasElevatedLearningAccess;
|
|
1529
1250
|
if (!(existing_hasElevatedLearningAccess === incoming_hasElevatedLearningAccess)) {
|
|
@@ -1541,44 +1262,44 @@ function equals$a(existing, incoming) {
|
|
|
1541
1262
|
}
|
|
1542
1263
|
return true;
|
|
1543
1264
|
}
|
|
1544
|
-
const ingest$
|
|
1265
|
+
const ingest$8 = function LearningConfigRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1545
1266
|
if (process.env.NODE_ENV !== 'production') {
|
|
1546
|
-
const validateError = validate$
|
|
1267
|
+
const validateError = validate$c(input);
|
|
1547
1268
|
if (validateError !== null) {
|
|
1548
1269
|
throw validateError;
|
|
1549
1270
|
}
|
|
1550
1271
|
}
|
|
1551
1272
|
const key = path.fullPath;
|
|
1552
1273
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
1553
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1274
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$8, "LearningContentPlatform", VERSION$b, RepresentationType$8, equals$b);
|
|
1554
1275
|
return createLink(key);
|
|
1555
1276
|
};
|
|
1556
|
-
function getTypeCacheKeys$
|
|
1277
|
+
function getTypeCacheKeys$8(rootKeySet, luvio, input, fullPathFactory) {
|
|
1557
1278
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1558
1279
|
const rootKey = fullPathFactory();
|
|
1559
1280
|
rootKeySet.set(rootKey, {
|
|
1560
1281
|
namespace: keyPrefix,
|
|
1561
|
-
representationName: RepresentationType$
|
|
1282
|
+
representationName: RepresentationType$8,
|
|
1562
1283
|
mergeable: false
|
|
1563
1284
|
});
|
|
1564
1285
|
}
|
|
1565
1286
|
|
|
1566
|
-
function select$
|
|
1567
|
-
return select$
|
|
1287
|
+
function select$i(luvio, params) {
|
|
1288
|
+
return select$j();
|
|
1568
1289
|
}
|
|
1569
|
-
function keyBuilder$
|
|
1290
|
+
function keyBuilder$j(luvio, params) {
|
|
1570
1291
|
return keyPrefix + '::LearningConfigRepresentation:(' + ')';
|
|
1571
1292
|
}
|
|
1572
|
-
function getResponseCacheKeys$
|
|
1573
|
-
getTypeCacheKeys$
|
|
1293
|
+
function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
|
|
1294
|
+
getTypeCacheKeys$8(storeKeyMap, luvio, response, () => keyBuilder$j());
|
|
1574
1295
|
}
|
|
1575
|
-
function ingestSuccess$
|
|
1296
|
+
function ingestSuccess$7(luvio, resourceParams, response, snapshotRefresh) {
|
|
1576
1297
|
const { body } = response;
|
|
1577
|
-
const key = keyBuilder$
|
|
1578
|
-
luvio.storeIngest(key, ingest$
|
|
1298
|
+
const key = keyBuilder$j();
|
|
1299
|
+
luvio.storeIngest(key, ingest$8, body);
|
|
1579
1300
|
const snapshot = luvio.storeLookup({
|
|
1580
1301
|
recordId: key,
|
|
1581
|
-
node: select$
|
|
1302
|
+
node: select$i(),
|
|
1582
1303
|
variables: {},
|
|
1583
1304
|
}, snapshotRefresh);
|
|
1584
1305
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1590,12 +1311,12 @@ function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1590
1311
|
return snapshot;
|
|
1591
1312
|
}
|
|
1592
1313
|
function ingestError$6(luvio, params, error, snapshotRefresh) {
|
|
1593
|
-
const key = keyBuilder$
|
|
1314
|
+
const key = keyBuilder$j();
|
|
1594
1315
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1595
1316
|
luvio.storeIngestError(key, errorSnapshot);
|
|
1596
1317
|
return errorSnapshot;
|
|
1597
1318
|
}
|
|
1598
|
-
function createResourceRequest$
|
|
1319
|
+
function createResourceRequest$7(config) {
|
|
1599
1320
|
const headers = {};
|
|
1600
1321
|
return {
|
|
1601
1322
|
baseUri: '/services/data/v60.0',
|
|
@@ -1609,57 +1330,57 @@ function createResourceRequest$6(config) {
|
|
|
1609
1330
|
};
|
|
1610
1331
|
}
|
|
1611
1332
|
|
|
1612
|
-
const adapterName$
|
|
1333
|
+
const adapterName$7 = 'getLearningConfig';
|
|
1613
1334
|
const getLearningConfig_ConfigPropertyMetadata = [];
|
|
1614
|
-
const getLearningConfig_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
1615
|
-
const createResourceParams$
|
|
1616
|
-
function keyBuilder$
|
|
1617
|
-
createResourceParams$
|
|
1618
|
-
return keyBuilder$
|
|
1335
|
+
const getLearningConfig_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, getLearningConfig_ConfigPropertyMetadata);
|
|
1336
|
+
const createResourceParams$7 = /*#__PURE__*/ createResourceParams$a(getLearningConfig_ConfigPropertyMetadata);
|
|
1337
|
+
function keyBuilder$i(luvio, config) {
|
|
1338
|
+
createResourceParams$7(config);
|
|
1339
|
+
return keyBuilder$j();
|
|
1619
1340
|
}
|
|
1620
|
-
function typeCheckConfig$
|
|
1341
|
+
function typeCheckConfig$7(untrustedConfig) {
|
|
1621
1342
|
const config = {};
|
|
1622
1343
|
return config;
|
|
1623
1344
|
}
|
|
1624
|
-
function validateAdapterConfig$
|
|
1345
|
+
function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
|
|
1625
1346
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1626
1347
|
return null;
|
|
1627
1348
|
}
|
|
1628
1349
|
if (process.env.NODE_ENV !== 'production') {
|
|
1629
1350
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1630
1351
|
}
|
|
1631
|
-
const config = typeCheckConfig$
|
|
1352
|
+
const config = typeCheckConfig$7();
|
|
1632
1353
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1633
1354
|
return null;
|
|
1634
1355
|
}
|
|
1635
1356
|
return config;
|
|
1636
1357
|
}
|
|
1637
1358
|
function adapterFragment$6(luvio, config) {
|
|
1638
|
-
createResourceParams$
|
|
1639
|
-
return select$
|
|
1359
|
+
createResourceParams$7(config);
|
|
1360
|
+
return select$i();
|
|
1640
1361
|
}
|
|
1641
1362
|
function onFetchResponseSuccess$6(luvio, config, resourceParams, response) {
|
|
1642
|
-
const snapshot = ingestSuccess$
|
|
1363
|
+
const snapshot = ingestSuccess$7(luvio, resourceParams, response, {
|
|
1643
1364
|
config,
|
|
1644
|
-
resolve: () => buildNetworkSnapshot$
|
|
1365
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
1645
1366
|
});
|
|
1646
1367
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1647
1368
|
}
|
|
1648
1369
|
function onFetchResponseError$6(luvio, config, resourceParams, response) {
|
|
1649
1370
|
const snapshot = ingestError$6(luvio, resourceParams, response, {
|
|
1650
1371
|
config,
|
|
1651
|
-
resolve: () => buildNetworkSnapshot$
|
|
1372
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
1652
1373
|
});
|
|
1653
1374
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1654
1375
|
}
|
|
1655
|
-
function buildNetworkSnapshot$
|
|
1656
|
-
const resourceParams = createResourceParams$
|
|
1657
|
-
const request = createResourceRequest$
|
|
1376
|
+
function buildNetworkSnapshot$7(luvio, config, options) {
|
|
1377
|
+
const resourceParams = createResourceParams$7(config);
|
|
1378
|
+
const request = createResourceRequest$7();
|
|
1658
1379
|
return luvio.dispatchResourceRequest(request, options)
|
|
1659
1380
|
.then((response) => {
|
|
1660
1381
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$6(luvio, config, resourceParams, response), () => {
|
|
1661
1382
|
const cache = new StoreKeyMap();
|
|
1662
|
-
getResponseCacheKeys$
|
|
1383
|
+
getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
|
|
1663
1384
|
return cache;
|
|
1664
1385
|
});
|
|
1665
1386
|
}, (response) => {
|
|
@@ -1667,23 +1388,23 @@ function buildNetworkSnapshot$6(luvio, config, options) {
|
|
|
1667
1388
|
});
|
|
1668
1389
|
}
|
|
1669
1390
|
function buildNetworkSnapshotCachePolicy$6(context, coercedAdapterRequestContext) {
|
|
1670
|
-
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$
|
|
1391
|
+
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$7, undefined, false);
|
|
1671
1392
|
}
|
|
1672
1393
|
function buildCachedSnapshotCachePolicy$6(context, storeLookup) {
|
|
1673
1394
|
const { luvio, config } = context;
|
|
1674
1395
|
const selector = {
|
|
1675
|
-
recordId: keyBuilder$
|
|
1396
|
+
recordId: keyBuilder$i(luvio, config),
|
|
1676
1397
|
node: adapterFragment$6(luvio, config),
|
|
1677
1398
|
variables: {},
|
|
1678
1399
|
};
|
|
1679
1400
|
const cacheSnapshot = storeLookup(selector, {
|
|
1680
1401
|
config,
|
|
1681
|
-
resolve: () => buildNetworkSnapshot$
|
|
1402
|
+
resolve: () => buildNetworkSnapshot$7(luvio, config, snapshotRefreshOptions)
|
|
1682
1403
|
});
|
|
1683
1404
|
return cacheSnapshot;
|
|
1684
1405
|
}
|
|
1685
1406
|
const getLearningConfigAdapterFactory = (luvio) => function LearningContentPlatform__getLearningConfig(untrustedConfig, requestContext) {
|
|
1686
|
-
const config = validateAdapterConfig$
|
|
1407
|
+
const config = validateAdapterConfig$7(untrustedConfig, getLearningConfig_ConfigPropertyNames);
|
|
1687
1408
|
// Invalid or incomplete config
|
|
1688
1409
|
if (config === null) {
|
|
1689
1410
|
return null;
|
|
@@ -1692,292 +1413,65 @@ const getLearningConfigAdapterFactory = (luvio) => function LearningContentPlatf
|
|
|
1692
1413
|
buildCachedSnapshotCachePolicy$6, buildNetworkSnapshotCachePolicy$6);
|
|
1693
1414
|
};
|
|
1694
1415
|
|
|
1695
|
-
const
|
|
1696
|
-
|
|
1416
|
+
const TTL$5 = 60000;
|
|
1417
|
+
const VERSION$a = "1832481a3fe10deeb9c5dddba933f3da";
|
|
1418
|
+
function validate$b(obj, path = 'LearningItemRepresentation') {
|
|
1697
1419
|
const v_error = (() => {
|
|
1698
1420
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1699
1421
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1700
1422
|
}
|
|
1701
|
-
|
|
1702
|
-
const
|
|
1703
|
-
|
|
1704
|
-
|
|
1423
|
+
obj.completionRate;
|
|
1424
|
+
const obj_contentType = obj.contentType;
|
|
1425
|
+
const path_contentType = path + '.contentType';
|
|
1426
|
+
let obj_contentType_union0 = null;
|
|
1427
|
+
const obj_contentType_union0_error = (() => {
|
|
1428
|
+
if (typeof obj_contentType !== 'string') {
|
|
1429
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contentType + '" (at "' + path_contentType + '")');
|
|
1430
|
+
}
|
|
1431
|
+
})();
|
|
1432
|
+
if (obj_contentType_union0_error != null) {
|
|
1433
|
+
obj_contentType_union0 = obj_contentType_union0_error.message;
|
|
1705
1434
|
}
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
return new TypeError('Expected "object" but received "' + typeof obj_list_item + '" (at "' + path_list_item + '")');
|
|
1435
|
+
let obj_contentType_union1 = null;
|
|
1436
|
+
const obj_contentType_union1_error = (() => {
|
|
1437
|
+
if (obj_contentType !== null) {
|
|
1438
|
+
return new TypeError('Expected "null" but received "' + typeof obj_contentType + '" (at "' + path_contentType + '")');
|
|
1711
1439
|
}
|
|
1440
|
+
})();
|
|
1441
|
+
if (obj_contentType_union1_error != null) {
|
|
1442
|
+
obj_contentType_union1 = obj_contentType_union1_error.message;
|
|
1712
1443
|
}
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
propertyName: i,
|
|
1726
|
-
parent: {
|
|
1727
|
-
data: input,
|
|
1728
|
-
key: path.fullPath,
|
|
1729
|
-
existing: existing,
|
|
1730
|
-
},
|
|
1731
|
-
ttl: path.ttl
|
|
1732
|
-
}, luvio, store, timestamp);
|
|
1733
|
-
}
|
|
1734
|
-
return input;
|
|
1735
|
-
}
|
|
1736
|
-
const select$f = function LearningItemProgressListRepresentationSelect() {
|
|
1737
|
-
return {
|
|
1738
|
-
kind: 'Fragment',
|
|
1739
|
-
version: VERSION$9,
|
|
1740
|
-
private: [],
|
|
1741
|
-
selections: [
|
|
1742
|
-
{
|
|
1743
|
-
name: 'list',
|
|
1744
|
-
kind: 'Link',
|
|
1745
|
-
plural: true,
|
|
1746
|
-
fragment: select$o()
|
|
1444
|
+
if (obj_contentType_union0 && obj_contentType_union1) {
|
|
1445
|
+
let message = 'Object doesn\'t match union (at "' + path_contentType + '")';
|
|
1446
|
+
message += '\n' + obj_contentType_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1447
|
+
message += '\n' + obj_contentType_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1448
|
+
return new TypeError(message);
|
|
1449
|
+
}
|
|
1450
|
+
const obj_createdBy = obj.createdBy;
|
|
1451
|
+
const path_createdBy = path + '.createdBy';
|
|
1452
|
+
let obj_createdBy_union0 = null;
|
|
1453
|
+
const obj_createdBy_union0_error = (() => {
|
|
1454
|
+
if (typeof obj_createdBy !== 'string') {
|
|
1455
|
+
return new TypeError('Expected "string" but received "' + typeof obj_createdBy + '" (at "' + path_createdBy + '")');
|
|
1747
1456
|
}
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
function equals$9(existing, incoming) {
|
|
1752
|
-
const existing_list = existing.list;
|
|
1753
|
-
const incoming_list = incoming.list;
|
|
1754
|
-
const equals_list_items = equalsArray(existing_list, incoming_list, (existing_list_item, incoming_list_item) => {
|
|
1755
|
-
if (!(existing_list_item.__ref === incoming_list_item.__ref)) {
|
|
1756
|
-
return false;
|
|
1457
|
+
})();
|
|
1458
|
+
if (obj_createdBy_union0_error != null) {
|
|
1459
|
+
obj_createdBy_union0 = obj_createdBy_union0_error.message;
|
|
1757
1460
|
}
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
}
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
const validateError = validate$9(input);
|
|
1767
|
-
if (validateError !== null) {
|
|
1768
|
-
throw validateError;
|
|
1461
|
+
let obj_createdBy_union1 = null;
|
|
1462
|
+
const obj_createdBy_union1_error = (() => {
|
|
1463
|
+
if (obj_createdBy !== null) {
|
|
1464
|
+
return new TypeError('Expected "null" but received "' + typeof obj_createdBy + '" (at "' + path_createdBy + '")');
|
|
1465
|
+
}
|
|
1466
|
+
})();
|
|
1467
|
+
if (obj_createdBy_union1_error != null) {
|
|
1468
|
+
obj_createdBy_union1 = obj_createdBy_union1_error.message;
|
|
1769
1469
|
}
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
};
|
|
1776
|
-
function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
|
|
1777
|
-
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1778
|
-
const rootKey = fullPathFactory();
|
|
1779
|
-
rootKeySet.set(rootKey, {
|
|
1780
|
-
namespace: keyPrefix,
|
|
1781
|
-
representationName: RepresentationType$6,
|
|
1782
|
-
mergeable: false
|
|
1783
|
-
});
|
|
1784
|
-
const input_list_length = input.list.length;
|
|
1785
|
-
for (let i = 0; i < input_list_length; i++) {
|
|
1786
|
-
getTypeCacheKeys$b(rootKeySet, luvio, input.list[i]);
|
|
1787
|
-
}
|
|
1788
|
-
}
|
|
1789
|
-
|
|
1790
|
-
function select$e(luvio, params) {
|
|
1791
|
-
return select$f();
|
|
1792
|
-
}
|
|
1793
|
-
function keyBuilder$g(luvio, params) {
|
|
1794
|
-
return keyPrefix + '::LearningItemProgressListRepresentation:(' + 'learningItemIds:' + params.queryParams.learningItemIds + ')';
|
|
1795
|
-
}
|
|
1796
|
-
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
1797
|
-
getTypeCacheKeys$6(storeKeyMap, luvio, response, () => keyBuilder$g(luvio, resourceParams));
|
|
1798
|
-
}
|
|
1799
|
-
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
1800
|
-
const { body } = response;
|
|
1801
|
-
const key = keyBuilder$g(luvio, resourceParams);
|
|
1802
|
-
luvio.storeIngest(key, ingest$6, body);
|
|
1803
|
-
const snapshot = luvio.storeLookup({
|
|
1804
|
-
recordId: key,
|
|
1805
|
-
node: select$e(),
|
|
1806
|
-
variables: {},
|
|
1807
|
-
}, snapshotRefresh);
|
|
1808
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1809
|
-
if (snapshot.state !== 'Fulfilled') {
|
|
1810
|
-
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1811
|
-
}
|
|
1812
|
-
}
|
|
1813
|
-
deepFreeze(snapshot.data);
|
|
1814
|
-
return snapshot;
|
|
1815
|
-
}
|
|
1816
|
-
function ingestError$5(luvio, params, error, snapshotRefresh) {
|
|
1817
|
-
const key = keyBuilder$g(luvio, params);
|
|
1818
|
-
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1819
|
-
luvio.storeIngestError(key, errorSnapshot);
|
|
1820
|
-
return errorSnapshot;
|
|
1821
|
-
}
|
|
1822
|
-
function createResourceRequest$5(config) {
|
|
1823
|
-
const headers = {};
|
|
1824
|
-
return {
|
|
1825
|
-
baseUri: '/services/data/v60.0',
|
|
1826
|
-
basePath: '/learning-content-platform/learning/item/progress',
|
|
1827
|
-
method: 'get',
|
|
1828
|
-
body: null,
|
|
1829
|
-
urlParams: {},
|
|
1830
|
-
queryParams: config.queryParams,
|
|
1831
|
-
headers,
|
|
1832
|
-
priority: 'normal',
|
|
1833
|
-
};
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
|
-
const adapterName$5 = 'getLearningItemProgress';
|
|
1837
|
-
const getLearningItemProgress_ConfigPropertyMetadata = [
|
|
1838
|
-
generateParamConfigMetadata('learningItemIds', false, 1 /* QueryParameter */, 0 /* String */, true),
|
|
1839
|
-
];
|
|
1840
|
-
const getLearningItemProgress_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getLearningItemProgress_ConfigPropertyMetadata);
|
|
1841
|
-
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$a(getLearningItemProgress_ConfigPropertyMetadata);
|
|
1842
|
-
function keyBuilder$f(luvio, config) {
|
|
1843
|
-
const resourceParams = createResourceParams$5(config);
|
|
1844
|
-
return keyBuilder$g(luvio, resourceParams);
|
|
1845
|
-
}
|
|
1846
|
-
function typeCheckConfig$5(untrustedConfig) {
|
|
1847
|
-
const config = {};
|
|
1848
|
-
typeCheckConfig$a(untrustedConfig, config, getLearningItemProgress_ConfigPropertyMetadata);
|
|
1849
|
-
return config;
|
|
1850
|
-
}
|
|
1851
|
-
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
1852
|
-
if (!untrustedIsObject(untrustedConfig)) {
|
|
1853
|
-
return null;
|
|
1854
|
-
}
|
|
1855
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
1856
|
-
validateConfig(untrustedConfig, configPropertyNames);
|
|
1857
|
-
}
|
|
1858
|
-
const config = typeCheckConfig$5(untrustedConfig);
|
|
1859
|
-
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1860
|
-
return null;
|
|
1861
|
-
}
|
|
1862
|
-
return config;
|
|
1863
|
-
}
|
|
1864
|
-
function adapterFragment$5(luvio, config) {
|
|
1865
|
-
createResourceParams$5(config);
|
|
1866
|
-
return select$e();
|
|
1867
|
-
}
|
|
1868
|
-
function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
|
|
1869
|
-
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
1870
|
-
config,
|
|
1871
|
-
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1872
|
-
});
|
|
1873
|
-
return luvio.storeBroadcast().then(() => snapshot);
|
|
1874
|
-
}
|
|
1875
|
-
function onFetchResponseError$5(luvio, config, resourceParams, response) {
|
|
1876
|
-
const snapshot = ingestError$5(luvio, resourceParams, response, {
|
|
1877
|
-
config,
|
|
1878
|
-
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1879
|
-
});
|
|
1880
|
-
return luvio.storeBroadcast().then(() => snapshot);
|
|
1881
|
-
}
|
|
1882
|
-
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
1883
|
-
const resourceParams = createResourceParams$5(config);
|
|
1884
|
-
const request = createResourceRequest$5(resourceParams);
|
|
1885
|
-
return luvio.dispatchResourceRequest(request, options)
|
|
1886
|
-
.then((response) => {
|
|
1887
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
|
|
1888
|
-
const cache = new StoreKeyMap();
|
|
1889
|
-
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
1890
|
-
return cache;
|
|
1891
|
-
});
|
|
1892
|
-
}, (response) => {
|
|
1893
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
|
|
1894
|
-
});
|
|
1895
|
-
}
|
|
1896
|
-
function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
|
|
1897
|
-
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
1898
|
-
}
|
|
1899
|
-
function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
|
|
1900
|
-
const { luvio, config } = context;
|
|
1901
|
-
const selector = {
|
|
1902
|
-
recordId: keyBuilder$f(luvio, config),
|
|
1903
|
-
node: adapterFragment$5(luvio, config),
|
|
1904
|
-
variables: {},
|
|
1905
|
-
};
|
|
1906
|
-
const cacheSnapshot = storeLookup(selector, {
|
|
1907
|
-
config,
|
|
1908
|
-
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
1909
|
-
});
|
|
1910
|
-
return cacheSnapshot;
|
|
1911
|
-
}
|
|
1912
|
-
const getLearningItemProgressAdapterFactory = (luvio) => function LearningContentPlatform__getLearningItemProgress(untrustedConfig, requestContext) {
|
|
1913
|
-
const config = validateAdapterConfig$5(untrustedConfig, getLearningItemProgress_ConfigPropertyNames);
|
|
1914
|
-
// Invalid or incomplete config
|
|
1915
|
-
if (config === null) {
|
|
1916
|
-
return null;
|
|
1917
|
-
}
|
|
1918
|
-
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1919
|
-
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
|
|
1920
|
-
};
|
|
1921
|
-
|
|
1922
|
-
const TTL$4 = 60000;
|
|
1923
|
-
const VERSION$8 = "1832481a3fe10deeb9c5dddba933f3da";
|
|
1924
|
-
function validate$8(obj, path = 'LearningItemRepresentation') {
|
|
1925
|
-
const v_error = (() => {
|
|
1926
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1927
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1928
|
-
}
|
|
1929
|
-
obj.completionRate;
|
|
1930
|
-
const obj_contentType = obj.contentType;
|
|
1931
|
-
const path_contentType = path + '.contentType';
|
|
1932
|
-
let obj_contentType_union0 = null;
|
|
1933
|
-
const obj_contentType_union0_error = (() => {
|
|
1934
|
-
if (typeof obj_contentType !== 'string') {
|
|
1935
|
-
return new TypeError('Expected "string" but received "' + typeof obj_contentType + '" (at "' + path_contentType + '")');
|
|
1936
|
-
}
|
|
1937
|
-
})();
|
|
1938
|
-
if (obj_contentType_union0_error != null) {
|
|
1939
|
-
obj_contentType_union0 = obj_contentType_union0_error.message;
|
|
1940
|
-
}
|
|
1941
|
-
let obj_contentType_union1 = null;
|
|
1942
|
-
const obj_contentType_union1_error = (() => {
|
|
1943
|
-
if (obj_contentType !== null) {
|
|
1944
|
-
return new TypeError('Expected "null" but received "' + typeof obj_contentType + '" (at "' + path_contentType + '")');
|
|
1945
|
-
}
|
|
1946
|
-
})();
|
|
1947
|
-
if (obj_contentType_union1_error != null) {
|
|
1948
|
-
obj_contentType_union1 = obj_contentType_union1_error.message;
|
|
1949
|
-
}
|
|
1950
|
-
if (obj_contentType_union0 && obj_contentType_union1) {
|
|
1951
|
-
let message = 'Object doesn\'t match union (at "' + path_contentType + '")';
|
|
1952
|
-
message += '\n' + obj_contentType_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1953
|
-
message += '\n' + obj_contentType_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1954
|
-
return new TypeError(message);
|
|
1955
|
-
}
|
|
1956
|
-
const obj_createdBy = obj.createdBy;
|
|
1957
|
-
const path_createdBy = path + '.createdBy';
|
|
1958
|
-
let obj_createdBy_union0 = null;
|
|
1959
|
-
const obj_createdBy_union0_error = (() => {
|
|
1960
|
-
if (typeof obj_createdBy !== 'string') {
|
|
1961
|
-
return new TypeError('Expected "string" but received "' + typeof obj_createdBy + '" (at "' + path_createdBy + '")');
|
|
1962
|
-
}
|
|
1963
|
-
})();
|
|
1964
|
-
if (obj_createdBy_union0_error != null) {
|
|
1965
|
-
obj_createdBy_union0 = obj_createdBy_union0_error.message;
|
|
1966
|
-
}
|
|
1967
|
-
let obj_createdBy_union1 = null;
|
|
1968
|
-
const obj_createdBy_union1_error = (() => {
|
|
1969
|
-
if (obj_createdBy !== null) {
|
|
1970
|
-
return new TypeError('Expected "null" but received "' + typeof obj_createdBy + '" (at "' + path_createdBy + '")');
|
|
1971
|
-
}
|
|
1972
|
-
})();
|
|
1973
|
-
if (obj_createdBy_union1_error != null) {
|
|
1974
|
-
obj_createdBy_union1 = obj_createdBy_union1_error.message;
|
|
1975
|
-
}
|
|
1976
|
-
if (obj_createdBy_union0 && obj_createdBy_union1) {
|
|
1977
|
-
let message = 'Object doesn\'t match union (at "' + path_createdBy + '")';
|
|
1978
|
-
message += '\n' + obj_createdBy_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1979
|
-
message += '\n' + obj_createdBy_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1980
|
-
return new TypeError(message);
|
|
1470
|
+
if (obj_createdBy_union0 && obj_createdBy_union1) {
|
|
1471
|
+
let message = 'Object doesn\'t match union (at "' + path_createdBy + '")';
|
|
1472
|
+
message += '\n' + obj_createdBy_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
1473
|
+
message += '\n' + obj_createdBy_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
1474
|
+
return new TypeError(message);
|
|
1981
1475
|
}
|
|
1982
1476
|
const obj_createdDate = obj.createdDate;
|
|
1983
1477
|
const path_createdDate = path + '.createdDate';
|
|
@@ -2216,23 +1710,23 @@ function validate$8(obj, path = 'LearningItemRepresentation') {
|
|
|
2216
1710
|
})();
|
|
2217
1711
|
return v_error === undefined ? null : v_error;
|
|
2218
1712
|
}
|
|
2219
|
-
const RepresentationType$
|
|
2220
|
-
function keyBuilder$
|
|
2221
|
-
return keyPrefix + '::' + RepresentationType$
|
|
1713
|
+
const RepresentationType$7 = 'LearningItemRepresentation';
|
|
1714
|
+
function keyBuilder$h(luvio, config) {
|
|
1715
|
+
return keyPrefix + '::' + RepresentationType$7 + ':' + (config.learning_item_id === null ? '' : config.learning_item_id);
|
|
2222
1716
|
}
|
|
2223
|
-
function keyBuilderFromType$
|
|
1717
|
+
function keyBuilderFromType$5(luvio, object) {
|
|
2224
1718
|
const keyParams = {
|
|
2225
1719
|
learning_item_id: object.id
|
|
2226
1720
|
};
|
|
2227
|
-
return keyBuilder$
|
|
1721
|
+
return keyBuilder$h(luvio, keyParams);
|
|
2228
1722
|
}
|
|
2229
|
-
function normalize$
|
|
1723
|
+
function normalize$7(input, existing, path, luvio, store, timestamp) {
|
|
2230
1724
|
return input;
|
|
2231
1725
|
}
|
|
2232
|
-
const select$
|
|
1726
|
+
const select$h = function LearningItemRepresentationSelect() {
|
|
2233
1727
|
return {
|
|
2234
1728
|
kind: 'Fragment',
|
|
2235
|
-
version: VERSION$
|
|
1729
|
+
version: VERSION$a,
|
|
2236
1730
|
private: [],
|
|
2237
1731
|
selections: [
|
|
2238
1732
|
{
|
|
@@ -2286,7 +1780,7 @@ const select$d = function LearningItemRepresentationSelect() {
|
|
|
2286
1780
|
]
|
|
2287
1781
|
};
|
|
2288
1782
|
};
|
|
2289
|
-
function equals$
|
|
1783
|
+
function equals$a(existing, incoming) {
|
|
2290
1784
|
const existing_completionRate = existing.completionRate;
|
|
2291
1785
|
const incoming_completionRate = incoming.completionRate;
|
|
2292
1786
|
if (!(existing_completionRate === incoming_completionRate)) {
|
|
@@ -2349,30 +1843,44 @@ function equals$8(existing, incoming) {
|
|
|
2349
1843
|
}
|
|
2350
1844
|
return true;
|
|
2351
1845
|
}
|
|
2352
|
-
const ingest$
|
|
1846
|
+
const ingest$7 = function LearningItemRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2353
1847
|
if (process.env.NODE_ENV !== 'production') {
|
|
2354
|
-
const validateError = validate$
|
|
1848
|
+
const validateError = validate$b(input);
|
|
2355
1849
|
if (validateError !== null) {
|
|
2356
1850
|
throw validateError;
|
|
2357
1851
|
}
|
|
2358
1852
|
}
|
|
2359
|
-
const key = keyBuilderFromType$
|
|
2360
|
-
const ttlToUse = TTL$
|
|
2361
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1853
|
+
const key = keyBuilderFromType$5(luvio, input);
|
|
1854
|
+
const ttlToUse = TTL$5;
|
|
1855
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "LearningContentPlatform", VERSION$a, RepresentationType$7, equals$a);
|
|
2362
1856
|
return createLink(key);
|
|
2363
1857
|
};
|
|
2364
|
-
function getTypeCacheKeys$
|
|
1858
|
+
function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
|
|
2365
1859
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2366
|
-
const rootKey = keyBuilderFromType$
|
|
1860
|
+
const rootKey = keyBuilderFromType$5(luvio, input);
|
|
2367
1861
|
rootKeySet.set(rootKey, {
|
|
2368
1862
|
namespace: keyPrefix,
|
|
2369
|
-
representationName: RepresentationType$
|
|
1863
|
+
representationName: RepresentationType$7,
|
|
2370
1864
|
mergeable: false
|
|
2371
1865
|
});
|
|
2372
1866
|
}
|
|
1867
|
+
const notifyUpdateAvailableFactory = (luvio) => {
|
|
1868
|
+
return function notifyLearningItemUpdateAvailable(configs) {
|
|
1869
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1870
|
+
const requiredKeyParams = ['learning_item_id'];
|
|
1871
|
+
configs.forEach(config => {
|
|
1872
|
+
if (false === requiredKeyParams.every(req => req in config)) {
|
|
1873
|
+
throw new Error(`one of the configs did not contain all required parameters: ${JSONStringify(ObjectKeys(config))}`);
|
|
1874
|
+
}
|
|
1875
|
+
});
|
|
1876
|
+
}
|
|
1877
|
+
const keys = configs.map(c => keyBuilder$h(luvio, c));
|
|
1878
|
+
return luvio.notifyStoreUpdateAvailable(keys);
|
|
1879
|
+
};
|
|
1880
|
+
};
|
|
2373
1881
|
|
|
2374
|
-
const VERSION$
|
|
2375
|
-
function validate$
|
|
1882
|
+
const VERSION$9 = "cd4c27f064c3139aef14a6ef22627c0f";
|
|
1883
|
+
function validate$a(obj, path = 'LearningItemListRepresentation') {
|
|
2376
1884
|
const v_error = (() => {
|
|
2377
1885
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2378
1886
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -2392,14 +1900,14 @@ function validate$7(obj, path = 'LearningItemListRepresentation') {
|
|
|
2392
1900
|
})();
|
|
2393
1901
|
return v_error === undefined ? null : v_error;
|
|
2394
1902
|
}
|
|
2395
|
-
const RepresentationType$
|
|
2396
|
-
function normalize$
|
|
1903
|
+
const RepresentationType$6 = 'LearningItemListRepresentation';
|
|
1904
|
+
function normalize$6(input, existing, path, luvio, store, timestamp) {
|
|
2397
1905
|
const input_list = input.list;
|
|
2398
1906
|
const input_list_id = path.fullPath + '__list';
|
|
2399
1907
|
for (let i = 0; i < input_list.length; i++) {
|
|
2400
1908
|
const input_list_item = input_list[i];
|
|
2401
1909
|
let input_list_item_id = input_list_id + '__' + i;
|
|
2402
|
-
input_list[i] = ingest$
|
|
1910
|
+
input_list[i] = ingest$7(input_list_item, {
|
|
2403
1911
|
fullPath: input_list_item_id,
|
|
2404
1912
|
propertyName: i,
|
|
2405
1913
|
parent: {
|
|
@@ -2412,22 +1920,22 @@ function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
|
2412
1920
|
}
|
|
2413
1921
|
return input;
|
|
2414
1922
|
}
|
|
2415
|
-
const select$
|
|
1923
|
+
const select$g = function LearningItemListRepresentationSelect() {
|
|
2416
1924
|
return {
|
|
2417
1925
|
kind: 'Fragment',
|
|
2418
|
-
version: VERSION$
|
|
1926
|
+
version: VERSION$9,
|
|
2419
1927
|
private: [],
|
|
2420
1928
|
selections: [
|
|
2421
1929
|
{
|
|
2422
1930
|
name: 'list',
|
|
2423
1931
|
kind: 'Link',
|
|
2424
1932
|
plural: true,
|
|
2425
|
-
fragment: select$
|
|
1933
|
+
fragment: select$h()
|
|
2426
1934
|
}
|
|
2427
1935
|
]
|
|
2428
1936
|
};
|
|
2429
1937
|
};
|
|
2430
|
-
function equals$
|
|
1938
|
+
function equals$9(existing, incoming) {
|
|
2431
1939
|
const existing_list = existing.list;
|
|
2432
1940
|
const incoming_list = incoming.list;
|
|
2433
1941
|
const equals_list_items = equalsArray(existing_list, incoming_list, (existing_list_item, incoming_list_item) => {
|
|
@@ -2440,48 +1948,48 @@ function equals$7(existing, incoming) {
|
|
|
2440
1948
|
}
|
|
2441
1949
|
return true;
|
|
2442
1950
|
}
|
|
2443
|
-
const ingest$
|
|
1951
|
+
const ingest$6 = function LearningItemListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2444
1952
|
if (process.env.NODE_ENV !== 'production') {
|
|
2445
|
-
const validateError = validate$
|
|
1953
|
+
const validateError = validate$a(input);
|
|
2446
1954
|
if (validateError !== null) {
|
|
2447
1955
|
throw validateError;
|
|
2448
1956
|
}
|
|
2449
1957
|
}
|
|
2450
1958
|
const key = path.fullPath;
|
|
2451
1959
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
2452
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$
|
|
1960
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "LearningContentPlatform", VERSION$9, RepresentationType$6, equals$9);
|
|
2453
1961
|
return createLink(key);
|
|
2454
1962
|
};
|
|
2455
|
-
function getTypeCacheKeys$
|
|
1963
|
+
function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
|
|
2456
1964
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2457
1965
|
const rootKey = fullPathFactory();
|
|
2458
1966
|
rootKeySet.set(rootKey, {
|
|
2459
1967
|
namespace: keyPrefix,
|
|
2460
|
-
representationName: RepresentationType$
|
|
1968
|
+
representationName: RepresentationType$6,
|
|
2461
1969
|
mergeable: false
|
|
2462
1970
|
});
|
|
2463
1971
|
const input_list_length = input.list.length;
|
|
2464
1972
|
for (let i = 0; i < input_list_length; i++) {
|
|
2465
|
-
getTypeCacheKeys$
|
|
1973
|
+
getTypeCacheKeys$7(rootKeySet, luvio, input.list[i]);
|
|
2466
1974
|
}
|
|
2467
1975
|
}
|
|
2468
1976
|
|
|
2469
|
-
function select$
|
|
2470
|
-
return select$
|
|
1977
|
+
function select$f(luvio, params) {
|
|
1978
|
+
return select$g();
|
|
2471
1979
|
}
|
|
2472
|
-
function keyBuilder$
|
|
1980
|
+
function keyBuilder$g(luvio, params) {
|
|
2473
1981
|
return keyPrefix + '::LearningItemListRepresentation:(' + 'learningItemIds:' + params.queryParams.learningItemIds + ')';
|
|
2474
1982
|
}
|
|
2475
|
-
function getResponseCacheKeys$
|
|
2476
|
-
getTypeCacheKeys$
|
|
1983
|
+
function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
|
|
1984
|
+
getTypeCacheKeys$6(storeKeyMap, luvio, response, () => keyBuilder$g(luvio, resourceParams));
|
|
2477
1985
|
}
|
|
2478
|
-
function ingestSuccess$
|
|
1986
|
+
function ingestSuccess$6(luvio, resourceParams, response, snapshotRefresh) {
|
|
2479
1987
|
const { body } = response;
|
|
2480
|
-
const key = keyBuilder$
|
|
2481
|
-
luvio.storeIngest(key, ingest$
|
|
1988
|
+
const key = keyBuilder$g(luvio, resourceParams);
|
|
1989
|
+
luvio.storeIngest(key, ingest$6, body);
|
|
2482
1990
|
const snapshot = luvio.storeLookup({
|
|
2483
1991
|
recordId: key,
|
|
2484
|
-
node: select$
|
|
1992
|
+
node: select$f(),
|
|
2485
1993
|
variables: {},
|
|
2486
1994
|
}, snapshotRefresh);
|
|
2487
1995
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2492,13 +2000,13 @@ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
2492
2000
|
deepFreeze(snapshot.data);
|
|
2493
2001
|
return snapshot;
|
|
2494
2002
|
}
|
|
2495
|
-
function ingestError$
|
|
2496
|
-
const key = keyBuilder$
|
|
2003
|
+
function ingestError$5(luvio, params, error, snapshotRefresh) {
|
|
2004
|
+
const key = keyBuilder$g(luvio, params);
|
|
2497
2005
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2498
2006
|
luvio.storeIngestError(key, errorSnapshot);
|
|
2499
2007
|
return errorSnapshot;
|
|
2500
2008
|
}
|
|
2501
|
-
function createResourceRequest$
|
|
2009
|
+
function createResourceRequest$6(config) {
|
|
2502
2010
|
const headers = {};
|
|
2503
2011
|
return {
|
|
2504
2012
|
baseUri: '/services/data/v60.0',
|
|
@@ -2512,260 +2020,131 @@ function createResourceRequest$4(config) {
|
|
|
2512
2020
|
};
|
|
2513
2021
|
}
|
|
2514
2022
|
|
|
2515
|
-
const adapterName$
|
|
2023
|
+
const adapterName$6 = 'getLearningItemsList';
|
|
2516
2024
|
const getLearningItemsList_ConfigPropertyMetadata = [
|
|
2517
2025
|
generateParamConfigMetadata('learningItemIds', false, 1 /* QueryParameter */, 0 /* String */, true),
|
|
2518
2026
|
];
|
|
2519
|
-
const getLearningItemsList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
2520
|
-
const createResourceParams$
|
|
2521
|
-
function keyBuilder$
|
|
2522
|
-
const resourceParams = createResourceParams$
|
|
2523
|
-
return keyBuilder$
|
|
2027
|
+
const getLearningItemsList_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, getLearningItemsList_ConfigPropertyMetadata);
|
|
2028
|
+
const createResourceParams$6 = /*#__PURE__*/ createResourceParams$a(getLearningItemsList_ConfigPropertyMetadata);
|
|
2029
|
+
function keyBuilder$f(luvio, config) {
|
|
2030
|
+
const resourceParams = createResourceParams$6(config);
|
|
2031
|
+
return keyBuilder$g(luvio, resourceParams);
|
|
2524
2032
|
}
|
|
2525
|
-
function typeCheckConfig$
|
|
2033
|
+
function typeCheckConfig$6(untrustedConfig) {
|
|
2526
2034
|
const config = {};
|
|
2527
2035
|
typeCheckConfig$a(untrustedConfig, config, getLearningItemsList_ConfigPropertyMetadata);
|
|
2528
2036
|
return config;
|
|
2529
2037
|
}
|
|
2530
|
-
function validateAdapterConfig$
|
|
2038
|
+
function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
|
|
2531
2039
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
2532
2040
|
return null;
|
|
2533
2041
|
}
|
|
2534
2042
|
if (process.env.NODE_ENV !== 'production') {
|
|
2535
2043
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
2536
2044
|
}
|
|
2537
|
-
const config = typeCheckConfig$
|
|
2045
|
+
const config = typeCheckConfig$6(untrustedConfig);
|
|
2538
2046
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2539
2047
|
return null;
|
|
2540
2048
|
}
|
|
2541
2049
|
return config;
|
|
2542
2050
|
}
|
|
2543
|
-
function adapterFragment$
|
|
2544
|
-
createResourceParams$
|
|
2545
|
-
return select$
|
|
2051
|
+
function adapterFragment$5(luvio, config) {
|
|
2052
|
+
createResourceParams$6(config);
|
|
2053
|
+
return select$f();
|
|
2546
2054
|
}
|
|
2547
|
-
function onFetchResponseSuccess$
|
|
2548
|
-
const snapshot = ingestSuccess$
|
|
2055
|
+
function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
|
|
2056
|
+
const snapshot = ingestSuccess$6(luvio, resourceParams, response, {
|
|
2549
2057
|
config,
|
|
2550
|
-
resolve: () => buildNetworkSnapshot$
|
|
2058
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
2551
2059
|
});
|
|
2552
2060
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
2553
2061
|
}
|
|
2554
|
-
function onFetchResponseError$
|
|
2555
|
-
const snapshot = ingestError$
|
|
2062
|
+
function onFetchResponseError$5(luvio, config, resourceParams, response) {
|
|
2063
|
+
const snapshot = ingestError$5(luvio, resourceParams, response, {
|
|
2556
2064
|
config,
|
|
2557
|
-
resolve: () => buildNetworkSnapshot$
|
|
2065
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
2558
2066
|
});
|
|
2559
2067
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
2560
2068
|
}
|
|
2561
|
-
function buildNetworkSnapshot$
|
|
2562
|
-
const resourceParams = createResourceParams$
|
|
2563
|
-
const request = createResourceRequest$
|
|
2069
|
+
function buildNetworkSnapshot$6(luvio, config, options) {
|
|
2070
|
+
const resourceParams = createResourceParams$6(config);
|
|
2071
|
+
const request = createResourceRequest$6(resourceParams);
|
|
2564
2072
|
return luvio.dispatchResourceRequest(request, options)
|
|
2565
2073
|
.then((response) => {
|
|
2566
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
2074
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => {
|
|
2567
2075
|
const cache = new StoreKeyMap();
|
|
2568
|
-
getResponseCacheKeys$
|
|
2076
|
+
getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
|
|
2569
2077
|
return cache;
|
|
2570
2078
|
});
|
|
2571
2079
|
}, (response) => {
|
|
2572
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
2080
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
|
|
2573
2081
|
});
|
|
2574
2082
|
}
|
|
2575
|
-
function buildNetworkSnapshotCachePolicy$
|
|
2576
|
-
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$
|
|
2083
|
+
function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
|
|
2084
|
+
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$6, undefined, false);
|
|
2577
2085
|
}
|
|
2578
|
-
function buildCachedSnapshotCachePolicy$
|
|
2086
|
+
function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
|
|
2579
2087
|
const { luvio, config } = context;
|
|
2580
2088
|
const selector = {
|
|
2581
|
-
recordId: keyBuilder$
|
|
2582
|
-
node: adapterFragment$
|
|
2089
|
+
recordId: keyBuilder$f(luvio, config),
|
|
2090
|
+
node: adapterFragment$5(luvio, config),
|
|
2583
2091
|
variables: {},
|
|
2584
2092
|
};
|
|
2585
2093
|
const cacheSnapshot = storeLookup(selector, {
|
|
2586
2094
|
config,
|
|
2587
|
-
resolve: () => buildNetworkSnapshot$
|
|
2095
|
+
resolve: () => buildNetworkSnapshot$6(luvio, config, snapshotRefreshOptions)
|
|
2588
2096
|
});
|
|
2589
2097
|
return cacheSnapshot;
|
|
2590
2098
|
}
|
|
2591
2099
|
const getLearningItemsListAdapterFactory = (luvio) => function LearningContentPlatform__getLearningItemsList(untrustedConfig, requestContext) {
|
|
2592
|
-
const config = validateAdapterConfig$
|
|
2100
|
+
const config = validateAdapterConfig$6(untrustedConfig, getLearningItemsList_ConfigPropertyNames);
|
|
2593
2101
|
// Invalid or incomplete config
|
|
2594
2102
|
if (config === null) {
|
|
2595
2103
|
return null;
|
|
2596
2104
|
}
|
|
2597
2105
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2598
|
-
buildCachedSnapshotCachePolicy$
|
|
2106
|
+
buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
|
|
2599
2107
|
};
|
|
2600
2108
|
|
|
2601
|
-
const
|
|
2602
|
-
|
|
2109
|
+
const TTL$4 = 15000;
|
|
2110
|
+
const VERSION$8 = "ef3b97b73983e10731031f11a195bba6";
|
|
2111
|
+
function validate$9(obj, path = 'LearningItemProgressRepresentation') {
|
|
2603
2112
|
const v_error = (() => {
|
|
2604
2113
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2605
2114
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2606
2115
|
}
|
|
2607
|
-
const
|
|
2608
|
-
const
|
|
2609
|
-
let
|
|
2610
|
-
const
|
|
2611
|
-
if (typeof
|
|
2612
|
-
return new TypeError('Expected "
|
|
2613
|
-
}
|
|
2614
|
-
})();
|
|
2615
|
-
if (obj_assignedCount_union0_error != null) {
|
|
2616
|
-
obj_assignedCount_union0 = obj_assignedCount_union0_error.message;
|
|
2617
|
-
}
|
|
2618
|
-
let obj_assignedCount_union1 = null;
|
|
2619
|
-
const obj_assignedCount_union1_error = (() => {
|
|
2620
|
-
if (obj_assignedCount !== null) {
|
|
2621
|
-
return new TypeError('Expected "null" but received "' + typeof obj_assignedCount + '" (at "' + path_assignedCount + '")');
|
|
2622
|
-
}
|
|
2623
|
-
})();
|
|
2624
|
-
if (obj_assignedCount_union1_error != null) {
|
|
2625
|
-
obj_assignedCount_union1 = obj_assignedCount_union1_error.message;
|
|
2626
|
-
}
|
|
2627
|
-
if (obj_assignedCount_union0 && obj_assignedCount_union1) {
|
|
2628
|
-
let message = 'Object doesn\'t match union (at "' + path_assignedCount + '")';
|
|
2629
|
-
message += '\n' + obj_assignedCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2630
|
-
message += '\n' + obj_assignedCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2631
|
-
return new TypeError(message);
|
|
2632
|
-
}
|
|
2633
|
-
const obj_assigneeId = obj.assigneeId;
|
|
2634
|
-
const path_assigneeId = path + '.assigneeId';
|
|
2635
|
-
let obj_assigneeId_union0 = null;
|
|
2636
|
-
const obj_assigneeId_union0_error = (() => {
|
|
2637
|
-
if (typeof obj_assigneeId !== 'string') {
|
|
2638
|
-
return new TypeError('Expected "string" but received "' + typeof obj_assigneeId + '" (at "' + path_assigneeId + '")');
|
|
2639
|
-
}
|
|
2640
|
-
})();
|
|
2641
|
-
if (obj_assigneeId_union0_error != null) {
|
|
2642
|
-
obj_assigneeId_union0 = obj_assigneeId_union0_error.message;
|
|
2643
|
-
}
|
|
2644
|
-
let obj_assigneeId_union1 = null;
|
|
2645
|
-
const obj_assigneeId_union1_error = (() => {
|
|
2646
|
-
if (obj_assigneeId !== null) {
|
|
2647
|
-
return new TypeError('Expected "null" but received "' + typeof obj_assigneeId + '" (at "' + path_assigneeId + '")');
|
|
2648
|
-
}
|
|
2649
|
-
})();
|
|
2650
|
-
if (obj_assigneeId_union1_error != null) {
|
|
2651
|
-
obj_assigneeId_union1 = obj_assigneeId_union1_error.message;
|
|
2652
|
-
}
|
|
2653
|
-
if (obj_assigneeId_union0 && obj_assigneeId_union1) {
|
|
2654
|
-
let message = 'Object doesn\'t match union (at "' + path_assigneeId + '")';
|
|
2655
|
-
message += '\n' + obj_assigneeId_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2656
|
-
message += '\n' + obj_assigneeId_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2657
|
-
return new TypeError(message);
|
|
2658
|
-
}
|
|
2659
|
-
const obj_assigneeName = obj.assigneeName;
|
|
2660
|
-
const path_assigneeName = path + '.assigneeName';
|
|
2661
|
-
let obj_assigneeName_union0 = null;
|
|
2662
|
-
const obj_assigneeName_union0_error = (() => {
|
|
2663
|
-
if (typeof obj_assigneeName !== 'string') {
|
|
2664
|
-
return new TypeError('Expected "string" but received "' + typeof obj_assigneeName + '" (at "' + path_assigneeName + '")');
|
|
2665
|
-
}
|
|
2666
|
-
})();
|
|
2667
|
-
if (obj_assigneeName_union0_error != null) {
|
|
2668
|
-
obj_assigneeName_union0 = obj_assigneeName_union0_error.message;
|
|
2669
|
-
}
|
|
2670
|
-
let obj_assigneeName_union1 = null;
|
|
2671
|
-
const obj_assigneeName_union1_error = (() => {
|
|
2672
|
-
if (obj_assigneeName !== null) {
|
|
2673
|
-
return new TypeError('Expected "null" but received "' + typeof obj_assigneeName + '" (at "' + path_assigneeName + '")');
|
|
2674
|
-
}
|
|
2675
|
-
})();
|
|
2676
|
-
if (obj_assigneeName_union1_error != null) {
|
|
2677
|
-
obj_assigneeName_union1 = obj_assigneeName_union1_error.message;
|
|
2678
|
-
}
|
|
2679
|
-
if (obj_assigneeName_union0 && obj_assigneeName_union1) {
|
|
2680
|
-
let message = 'Object doesn\'t match union (at "' + path_assigneeName + '")';
|
|
2681
|
-
message += '\n' + obj_assigneeName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2682
|
-
message += '\n' + obj_assigneeName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2683
|
-
return new TypeError(message);
|
|
2684
|
-
}
|
|
2685
|
-
const obj_assigneeType = obj.assigneeType;
|
|
2686
|
-
const path_assigneeType = path + '.assigneeType';
|
|
2687
|
-
let obj_assigneeType_union0 = null;
|
|
2688
|
-
const obj_assigneeType_union0_error = (() => {
|
|
2689
|
-
if (typeof obj_assigneeType !== 'string') {
|
|
2690
|
-
return new TypeError('Expected "string" but received "' + typeof obj_assigneeType + '" (at "' + path_assigneeType + '")');
|
|
2691
|
-
}
|
|
2692
|
-
})();
|
|
2693
|
-
if (obj_assigneeType_union0_error != null) {
|
|
2694
|
-
obj_assigneeType_union0 = obj_assigneeType_union0_error.message;
|
|
2695
|
-
}
|
|
2696
|
-
let obj_assigneeType_union1 = null;
|
|
2697
|
-
const obj_assigneeType_union1_error = (() => {
|
|
2698
|
-
if (obj_assigneeType !== null) {
|
|
2699
|
-
return new TypeError('Expected "null" but received "' + typeof obj_assigneeType + '" (at "' + path_assigneeType + '")');
|
|
2700
|
-
}
|
|
2701
|
-
})();
|
|
2702
|
-
if (obj_assigneeType_union1_error != null) {
|
|
2703
|
-
obj_assigneeType_union1 = obj_assigneeType_union1_error.message;
|
|
2704
|
-
}
|
|
2705
|
-
if (obj_assigneeType_union0 && obj_assigneeType_union1) {
|
|
2706
|
-
let message = 'Object doesn\'t match union (at "' + path_assigneeType + '")';
|
|
2707
|
-
message += '\n' + obj_assigneeType_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2708
|
-
message += '\n' + obj_assigneeType_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2709
|
-
return new TypeError(message);
|
|
2710
|
-
}
|
|
2711
|
-
const obj_assignmentDate = obj.assignmentDate;
|
|
2712
|
-
const path_assignmentDate = path + '.assignmentDate';
|
|
2713
|
-
let obj_assignmentDate_union0 = null;
|
|
2714
|
-
const obj_assignmentDate_union0_error = (() => {
|
|
2715
|
-
if (typeof obj_assignmentDate !== 'string') {
|
|
2716
|
-
return new TypeError('Expected "string" but received "' + typeof obj_assignmentDate + '" (at "' + path_assignmentDate + '")');
|
|
2717
|
-
}
|
|
2718
|
-
})();
|
|
2719
|
-
if (obj_assignmentDate_union0_error != null) {
|
|
2720
|
-
obj_assignmentDate_union0 = obj_assignmentDate_union0_error.message;
|
|
2721
|
-
}
|
|
2722
|
-
let obj_assignmentDate_union1 = null;
|
|
2723
|
-
const obj_assignmentDate_union1_error = (() => {
|
|
2724
|
-
if (obj_assignmentDate !== null) {
|
|
2725
|
-
return new TypeError('Expected "null" but received "' + typeof obj_assignmentDate + '" (at "' + path_assignmentDate + '")');
|
|
2726
|
-
}
|
|
2727
|
-
})();
|
|
2728
|
-
if (obj_assignmentDate_union1_error != null) {
|
|
2729
|
-
obj_assignmentDate_union1 = obj_assignmentDate_union1_error.message;
|
|
2730
|
-
}
|
|
2731
|
-
if (obj_assignmentDate_union0 && obj_assignmentDate_union1) {
|
|
2732
|
-
let message = 'Object doesn\'t match union (at "' + path_assignmentDate + '")';
|
|
2733
|
-
message += '\n' + obj_assignmentDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2734
|
-
message += '\n' + obj_assignmentDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2735
|
-
return new TypeError(message);
|
|
2736
|
-
}
|
|
2737
|
-
const obj_completedCount = obj.completedCount;
|
|
2738
|
-
const path_completedCount = path + '.completedCount';
|
|
2739
|
-
let obj_completedCount_union0 = null;
|
|
2740
|
-
const obj_completedCount_union0_error = (() => {
|
|
2741
|
-
if (typeof obj_completedCount !== 'number' || (typeof obj_completedCount === 'number' && Math.floor(obj_completedCount) !== obj_completedCount)) {
|
|
2742
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_completedCount + '" (at "' + path_completedCount + '")');
|
|
2116
|
+
const obj_completedDate = obj.completedDate;
|
|
2117
|
+
const path_completedDate = path + '.completedDate';
|
|
2118
|
+
let obj_completedDate_union0 = null;
|
|
2119
|
+
const obj_completedDate_union0_error = (() => {
|
|
2120
|
+
if (typeof obj_completedDate !== 'string') {
|
|
2121
|
+
return new TypeError('Expected "string" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
|
|
2743
2122
|
}
|
|
2744
2123
|
})();
|
|
2745
|
-
if (
|
|
2746
|
-
|
|
2124
|
+
if (obj_completedDate_union0_error != null) {
|
|
2125
|
+
obj_completedDate_union0 = obj_completedDate_union0_error.message;
|
|
2747
2126
|
}
|
|
2748
|
-
let
|
|
2749
|
-
const
|
|
2750
|
-
if (
|
|
2751
|
-
return new TypeError('Expected "null" but received "' + typeof
|
|
2127
|
+
let obj_completedDate_union1 = null;
|
|
2128
|
+
const obj_completedDate_union1_error = (() => {
|
|
2129
|
+
if (obj_completedDate !== null) {
|
|
2130
|
+
return new TypeError('Expected "null" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
|
|
2752
2131
|
}
|
|
2753
2132
|
})();
|
|
2754
|
-
if (
|
|
2755
|
-
|
|
2133
|
+
if (obj_completedDate_union1_error != null) {
|
|
2134
|
+
obj_completedDate_union1 = obj_completedDate_union1_error.message;
|
|
2756
2135
|
}
|
|
2757
|
-
if (
|
|
2758
|
-
let message = 'Object doesn\'t match union (at "' +
|
|
2759
|
-
message += '\n' +
|
|
2760
|
-
message += '\n' +
|
|
2136
|
+
if (obj_completedDate_union0 && obj_completedDate_union1) {
|
|
2137
|
+
let message = 'Object doesn\'t match union (at "' + path_completedDate + '")';
|
|
2138
|
+
message += '\n' + obj_completedDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2139
|
+
message += '\n' + obj_completedDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2761
2140
|
return new TypeError(message);
|
|
2762
2141
|
}
|
|
2763
2142
|
const obj_completedPercent = obj.completedPercent;
|
|
2764
2143
|
const path_completedPercent = path + '.completedPercent';
|
|
2765
2144
|
let obj_completedPercent_union0 = null;
|
|
2766
2145
|
const obj_completedPercent_union0_error = (() => {
|
|
2767
|
-
if (typeof obj_completedPercent !== 'number'
|
|
2768
|
-
return new TypeError('Expected "
|
|
2146
|
+
if (typeof obj_completedPercent !== 'number') {
|
|
2147
|
+
return new TypeError('Expected "number" but received "' + typeof obj_completedPercent + '" (at "' + path_completedPercent + '")');
|
|
2769
2148
|
}
|
|
2770
2149
|
})();
|
|
2771
2150
|
if (obj_completedPercent_union0_error != null) {
|
|
@@ -2786,62 +2165,10 @@ function validate$6(obj, path = 'LearningAssignmentRepresentation') {
|
|
|
2786
2165
|
message += '\n' + obj_completedPercent_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2787
2166
|
return new TypeError(message);
|
|
2788
2167
|
}
|
|
2789
|
-
const
|
|
2790
|
-
const
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
if (typeof obj_daysUntilDueDate !== 'number' || (typeof obj_daysUntilDueDate === 'number' && Math.floor(obj_daysUntilDueDate) !== obj_daysUntilDueDate)) {
|
|
2794
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_daysUntilDueDate + '" (at "' + path_daysUntilDueDate + '")');
|
|
2795
|
-
}
|
|
2796
|
-
})();
|
|
2797
|
-
if (obj_daysUntilDueDate_union0_error != null) {
|
|
2798
|
-
obj_daysUntilDueDate_union0 = obj_daysUntilDueDate_union0_error.message;
|
|
2799
|
-
}
|
|
2800
|
-
let obj_daysUntilDueDate_union1 = null;
|
|
2801
|
-
const obj_daysUntilDueDate_union1_error = (() => {
|
|
2802
|
-
if (obj_daysUntilDueDate !== null) {
|
|
2803
|
-
return new TypeError('Expected "null" but received "' + typeof obj_daysUntilDueDate + '" (at "' + path_daysUntilDueDate + '")');
|
|
2804
|
-
}
|
|
2805
|
-
})();
|
|
2806
|
-
if (obj_daysUntilDueDate_union1_error != null) {
|
|
2807
|
-
obj_daysUntilDueDate_union1 = obj_daysUntilDueDate_union1_error.message;
|
|
2808
|
-
}
|
|
2809
|
-
if (obj_daysUntilDueDate_union0 && obj_daysUntilDueDate_union1) {
|
|
2810
|
-
let message = 'Object doesn\'t match union (at "' + path_daysUntilDueDate + '")';
|
|
2811
|
-
message += '\n' + obj_daysUntilDueDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2812
|
-
message += '\n' + obj_daysUntilDueDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2813
|
-
return new TypeError(message);
|
|
2814
|
-
}
|
|
2815
|
-
const obj_dueDate = obj.dueDate;
|
|
2816
|
-
const path_dueDate = path + '.dueDate';
|
|
2817
|
-
let obj_dueDate_union0 = null;
|
|
2818
|
-
const obj_dueDate_union0_error = (() => {
|
|
2819
|
-
if (typeof obj_dueDate !== 'string') {
|
|
2820
|
-
return new TypeError('Expected "string" but received "' + typeof obj_dueDate + '" (at "' + path_dueDate + '")');
|
|
2821
|
-
}
|
|
2822
|
-
})();
|
|
2823
|
-
if (obj_dueDate_union0_error != null) {
|
|
2824
|
-
obj_dueDate_union0 = obj_dueDate_union0_error.message;
|
|
2825
|
-
}
|
|
2826
|
-
let obj_dueDate_union1 = null;
|
|
2827
|
-
const obj_dueDate_union1_error = (() => {
|
|
2828
|
-
if (obj_dueDate !== null) {
|
|
2829
|
-
return new TypeError('Expected "null" but received "' + typeof obj_dueDate + '" (at "' + path_dueDate + '")');
|
|
2830
|
-
}
|
|
2831
|
-
})();
|
|
2832
|
-
if (obj_dueDate_union1_error != null) {
|
|
2833
|
-
obj_dueDate_union1 = obj_dueDate_union1_error.message;
|
|
2834
|
-
}
|
|
2835
|
-
if (obj_dueDate_union0 && obj_dueDate_union1) {
|
|
2836
|
-
let message = 'Object doesn\'t match union (at "' + path_dueDate + '")';
|
|
2837
|
-
message += '\n' + obj_dueDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2838
|
-
message += '\n' + obj_dueDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2839
|
-
return new TypeError(message);
|
|
2840
|
-
}
|
|
2841
|
-
const obj_id = obj.id;
|
|
2842
|
-
const path_id = path + '.id';
|
|
2843
|
-
if (typeof obj_id !== 'string') {
|
|
2844
|
-
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
2168
|
+
const obj_isCompleted = obj.isCompleted;
|
|
2169
|
+
const path_isCompleted = path + '.isCompleted';
|
|
2170
|
+
if (typeof obj_isCompleted !== 'boolean') {
|
|
2171
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isCompleted + '" (at "' + path_isCompleted + '")');
|
|
2845
2172
|
}
|
|
2846
2173
|
const obj_learningItemId = obj.learningItemId;
|
|
2847
2174
|
const path_learningItemId = path + '.learningItemId';
|
|
@@ -2851,38 +2178,601 @@ function validate$6(obj, path = 'LearningAssignmentRepresentation') {
|
|
|
2851
2178
|
})();
|
|
2852
2179
|
return v_error === undefined ? null : v_error;
|
|
2853
2180
|
}
|
|
2854
|
-
const
|
|
2181
|
+
const RepresentationType$5 = 'LearningItemProgressRepresentation';
|
|
2182
|
+
function keyBuilder$e(luvio, config) {
|
|
2183
|
+
return keyPrefix + '::' + RepresentationType$5 + ':' + config.learning_item_id;
|
|
2184
|
+
}
|
|
2185
|
+
function keyBuilderFromType$4(luvio, object) {
|
|
2186
|
+
const keyParams = {
|
|
2187
|
+
learning_item_id: object.learningItemId
|
|
2188
|
+
};
|
|
2189
|
+
return keyBuilder$e(luvio, keyParams);
|
|
2190
|
+
}
|
|
2191
|
+
function normalize$5(input, existing, path, luvio, store, timestamp) {
|
|
2192
|
+
return input;
|
|
2193
|
+
}
|
|
2194
|
+
const select$e = function LearningItemProgressRepresentationSelect() {
|
|
2855
2195
|
return {
|
|
2856
2196
|
kind: 'Fragment',
|
|
2857
|
-
version: VERSION$
|
|
2197
|
+
version: VERSION$8,
|
|
2858
2198
|
private: [],
|
|
2859
2199
|
selections: [
|
|
2860
2200
|
{
|
|
2861
|
-
name: '
|
|
2862
|
-
kind: 'Scalar'
|
|
2863
|
-
},
|
|
2864
|
-
{
|
|
2865
|
-
name: 'assigneeId',
|
|
2866
|
-
kind: 'Scalar'
|
|
2867
|
-
},
|
|
2868
|
-
{
|
|
2869
|
-
name: 'assigneeName',
|
|
2870
|
-
kind: 'Scalar'
|
|
2871
|
-
},
|
|
2872
|
-
{
|
|
2873
|
-
name: 'assigneeType',
|
|
2201
|
+
name: 'completedDate',
|
|
2874
2202
|
kind: 'Scalar'
|
|
2875
2203
|
},
|
|
2876
2204
|
{
|
|
2877
|
-
name: '
|
|
2205
|
+
name: 'completedPercent',
|
|
2878
2206
|
kind: 'Scalar'
|
|
2879
2207
|
},
|
|
2880
2208
|
{
|
|
2881
|
-
name: '
|
|
2209
|
+
name: 'isCompleted',
|
|
2882
2210
|
kind: 'Scalar'
|
|
2883
2211
|
},
|
|
2884
2212
|
{
|
|
2885
|
-
name: '
|
|
2213
|
+
name: 'learningItemId',
|
|
2214
|
+
kind: 'Scalar'
|
|
2215
|
+
}
|
|
2216
|
+
]
|
|
2217
|
+
};
|
|
2218
|
+
};
|
|
2219
|
+
function equals$8(existing, incoming) {
|
|
2220
|
+
const existing_isCompleted = existing.isCompleted;
|
|
2221
|
+
const incoming_isCompleted = incoming.isCompleted;
|
|
2222
|
+
if (!(existing_isCompleted === incoming_isCompleted)) {
|
|
2223
|
+
return false;
|
|
2224
|
+
}
|
|
2225
|
+
const existing_learningItemId = existing.learningItemId;
|
|
2226
|
+
const incoming_learningItemId = incoming.learningItemId;
|
|
2227
|
+
if (!(existing_learningItemId === incoming_learningItemId)) {
|
|
2228
|
+
return false;
|
|
2229
|
+
}
|
|
2230
|
+
const existing_completedDate = existing.completedDate;
|
|
2231
|
+
const incoming_completedDate = incoming.completedDate;
|
|
2232
|
+
if (!(existing_completedDate === incoming_completedDate)) {
|
|
2233
|
+
return false;
|
|
2234
|
+
}
|
|
2235
|
+
const existing_completedPercent = existing.completedPercent;
|
|
2236
|
+
const incoming_completedPercent = incoming.completedPercent;
|
|
2237
|
+
if (!(existing_completedPercent === incoming_completedPercent)) {
|
|
2238
|
+
return false;
|
|
2239
|
+
}
|
|
2240
|
+
return true;
|
|
2241
|
+
}
|
|
2242
|
+
const ingest$5 = function LearningItemProgressRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2243
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2244
|
+
const validateError = validate$9(input);
|
|
2245
|
+
if (validateError !== null) {
|
|
2246
|
+
throw validateError;
|
|
2247
|
+
}
|
|
2248
|
+
}
|
|
2249
|
+
const key = keyBuilderFromType$4(luvio, input);
|
|
2250
|
+
const ttlToUse = TTL$4;
|
|
2251
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "LearningContentPlatform", VERSION$8, RepresentationType$5, equals$8);
|
|
2252
|
+
return createLink(key);
|
|
2253
|
+
};
|
|
2254
|
+
function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
|
|
2255
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2256
|
+
const rootKey = keyBuilderFromType$4(luvio, input);
|
|
2257
|
+
rootKeySet.set(rootKey, {
|
|
2258
|
+
namespace: keyPrefix,
|
|
2259
|
+
representationName: RepresentationType$5,
|
|
2260
|
+
mergeable: false
|
|
2261
|
+
});
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
const VERSION$7 = "1292f1a549c777c6586cca649e823737";
|
|
2265
|
+
function validate$8(obj, path = 'LearningItemProgressListRepresentation') {
|
|
2266
|
+
const v_error = (() => {
|
|
2267
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2268
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2269
|
+
}
|
|
2270
|
+
const obj_list = obj.list;
|
|
2271
|
+
const path_list = path + '.list';
|
|
2272
|
+
if (!ArrayIsArray(obj_list)) {
|
|
2273
|
+
return new TypeError('Expected "array" but received "' + typeof obj_list + '" (at "' + path_list + '")');
|
|
2274
|
+
}
|
|
2275
|
+
for (let i = 0; i < obj_list.length; i++) {
|
|
2276
|
+
const obj_list_item = obj_list[i];
|
|
2277
|
+
const path_list_item = path_list + '[' + i + ']';
|
|
2278
|
+
if (typeof obj_list_item !== 'object') {
|
|
2279
|
+
return new TypeError('Expected "object" but received "' + typeof obj_list_item + '" (at "' + path_list_item + '")');
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
})();
|
|
2283
|
+
return v_error === undefined ? null : v_error;
|
|
2284
|
+
}
|
|
2285
|
+
const RepresentationType$4 = 'LearningItemProgressListRepresentation';
|
|
2286
|
+
function normalize$4(input, existing, path, luvio, store, timestamp) {
|
|
2287
|
+
const input_list = input.list;
|
|
2288
|
+
const input_list_id = path.fullPath + '__list';
|
|
2289
|
+
for (let i = 0; i < input_list.length; i++) {
|
|
2290
|
+
const input_list_item = input_list[i];
|
|
2291
|
+
let input_list_item_id = input_list_id + '__' + i;
|
|
2292
|
+
input_list[i] = ingest$5(input_list_item, {
|
|
2293
|
+
fullPath: input_list_item_id,
|
|
2294
|
+
propertyName: i,
|
|
2295
|
+
parent: {
|
|
2296
|
+
data: input,
|
|
2297
|
+
key: path.fullPath,
|
|
2298
|
+
existing: existing,
|
|
2299
|
+
},
|
|
2300
|
+
ttl: path.ttl
|
|
2301
|
+
}, luvio, store, timestamp);
|
|
2302
|
+
}
|
|
2303
|
+
return input;
|
|
2304
|
+
}
|
|
2305
|
+
const select$d = function LearningItemProgressListRepresentationSelect() {
|
|
2306
|
+
return {
|
|
2307
|
+
kind: 'Fragment',
|
|
2308
|
+
version: VERSION$7,
|
|
2309
|
+
private: [],
|
|
2310
|
+
selections: [
|
|
2311
|
+
{
|
|
2312
|
+
name: 'list',
|
|
2313
|
+
kind: 'Link',
|
|
2314
|
+
plural: true,
|
|
2315
|
+
fragment: select$e()
|
|
2316
|
+
}
|
|
2317
|
+
]
|
|
2318
|
+
};
|
|
2319
|
+
};
|
|
2320
|
+
function equals$7(existing, incoming) {
|
|
2321
|
+
const existing_list = existing.list;
|
|
2322
|
+
const incoming_list = incoming.list;
|
|
2323
|
+
const equals_list_items = equalsArray(existing_list, incoming_list, (existing_list_item, incoming_list_item) => {
|
|
2324
|
+
if (!(existing_list_item.__ref === incoming_list_item.__ref)) {
|
|
2325
|
+
return false;
|
|
2326
|
+
}
|
|
2327
|
+
});
|
|
2328
|
+
if (equals_list_items === false) {
|
|
2329
|
+
return false;
|
|
2330
|
+
}
|
|
2331
|
+
return true;
|
|
2332
|
+
}
|
|
2333
|
+
const ingest$4 = function LearningItemProgressListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
2334
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2335
|
+
const validateError = validate$8(input);
|
|
2336
|
+
if (validateError !== null) {
|
|
2337
|
+
throw validateError;
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
const key = path.fullPath;
|
|
2341
|
+
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
2342
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "LearningContentPlatform", VERSION$7, RepresentationType$4, equals$7);
|
|
2343
|
+
return createLink(key);
|
|
2344
|
+
};
|
|
2345
|
+
function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
|
|
2346
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
2347
|
+
const rootKey = fullPathFactory();
|
|
2348
|
+
rootKeySet.set(rootKey, {
|
|
2349
|
+
namespace: keyPrefix,
|
|
2350
|
+
representationName: RepresentationType$4,
|
|
2351
|
+
mergeable: false
|
|
2352
|
+
});
|
|
2353
|
+
const input_list_length = input.list.length;
|
|
2354
|
+
for (let i = 0; i < input_list_length; i++) {
|
|
2355
|
+
getTypeCacheKeys$5(rootKeySet, luvio, input.list[i]);
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
function select$c(luvio, params) {
|
|
2360
|
+
return select$d();
|
|
2361
|
+
}
|
|
2362
|
+
function keyBuilder$d(luvio, params) {
|
|
2363
|
+
return keyPrefix + '::LearningItemProgressListRepresentation:(' + 'learningItemIds:' + params.queryParams.learningItemIds + ')';
|
|
2364
|
+
}
|
|
2365
|
+
function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
|
|
2366
|
+
getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$d(luvio, resourceParams));
|
|
2367
|
+
}
|
|
2368
|
+
function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
|
|
2369
|
+
const { body } = response;
|
|
2370
|
+
const key = keyBuilder$d(luvio, resourceParams);
|
|
2371
|
+
luvio.storeIngest(key, ingest$4, body);
|
|
2372
|
+
const snapshot = luvio.storeLookup({
|
|
2373
|
+
recordId: key,
|
|
2374
|
+
node: select$c(),
|
|
2375
|
+
variables: {},
|
|
2376
|
+
}, snapshotRefresh);
|
|
2377
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2378
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
2379
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
deepFreeze(snapshot.data);
|
|
2383
|
+
return snapshot;
|
|
2384
|
+
}
|
|
2385
|
+
function ingestError$4(luvio, params, error, snapshotRefresh) {
|
|
2386
|
+
const key = keyBuilder$d(luvio, params);
|
|
2387
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
2388
|
+
luvio.storeIngestError(key, errorSnapshot);
|
|
2389
|
+
return errorSnapshot;
|
|
2390
|
+
}
|
|
2391
|
+
function createResourceRequest$5(config) {
|
|
2392
|
+
const headers = {};
|
|
2393
|
+
return {
|
|
2394
|
+
baseUri: '/services/data/v60.0',
|
|
2395
|
+
basePath: '/learning-content-platform/learning/item/progress',
|
|
2396
|
+
method: 'get',
|
|
2397
|
+
body: null,
|
|
2398
|
+
urlParams: {},
|
|
2399
|
+
queryParams: config.queryParams,
|
|
2400
|
+
headers,
|
|
2401
|
+
priority: 'normal',
|
|
2402
|
+
};
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2405
|
+
const adapterName$5 = 'getLearningItemProgress';
|
|
2406
|
+
const getLearningItemProgress_ConfigPropertyMetadata = [
|
|
2407
|
+
generateParamConfigMetadata('learningItemIds', false, 1 /* QueryParameter */, 0 /* String */, true),
|
|
2408
|
+
];
|
|
2409
|
+
const getLearningItemProgress_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getLearningItemProgress_ConfigPropertyMetadata);
|
|
2410
|
+
const createResourceParams$5 = /*#__PURE__*/ createResourceParams$a(getLearningItemProgress_ConfigPropertyMetadata);
|
|
2411
|
+
function keyBuilder$c(luvio, config) {
|
|
2412
|
+
const resourceParams = createResourceParams$5(config);
|
|
2413
|
+
return keyBuilder$d(luvio, resourceParams);
|
|
2414
|
+
}
|
|
2415
|
+
function typeCheckConfig$5(untrustedConfig) {
|
|
2416
|
+
const config = {};
|
|
2417
|
+
typeCheckConfig$a(untrustedConfig, config, getLearningItemProgress_ConfigPropertyMetadata);
|
|
2418
|
+
return config;
|
|
2419
|
+
}
|
|
2420
|
+
function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
|
|
2421
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
2422
|
+
return null;
|
|
2423
|
+
}
|
|
2424
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2425
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
2426
|
+
}
|
|
2427
|
+
const config = typeCheckConfig$5(untrustedConfig);
|
|
2428
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
2429
|
+
return null;
|
|
2430
|
+
}
|
|
2431
|
+
return config;
|
|
2432
|
+
}
|
|
2433
|
+
function adapterFragment$4(luvio, config) {
|
|
2434
|
+
createResourceParams$5(config);
|
|
2435
|
+
return select$c();
|
|
2436
|
+
}
|
|
2437
|
+
function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
|
|
2438
|
+
const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
|
|
2439
|
+
config,
|
|
2440
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
2441
|
+
});
|
|
2442
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2443
|
+
}
|
|
2444
|
+
function onFetchResponseError$4(luvio, config, resourceParams, response) {
|
|
2445
|
+
const snapshot = ingestError$4(luvio, resourceParams, response, {
|
|
2446
|
+
config,
|
|
2447
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
2448
|
+
});
|
|
2449
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
2450
|
+
}
|
|
2451
|
+
function buildNetworkSnapshot$5(luvio, config, options) {
|
|
2452
|
+
const resourceParams = createResourceParams$5(config);
|
|
2453
|
+
const request = createResourceRequest$5(resourceParams);
|
|
2454
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
2455
|
+
.then((response) => {
|
|
2456
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => {
|
|
2457
|
+
const cache = new StoreKeyMap();
|
|
2458
|
+
getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
|
|
2459
|
+
return cache;
|
|
2460
|
+
});
|
|
2461
|
+
}, (response) => {
|
|
2462
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
|
|
2463
|
+
});
|
|
2464
|
+
}
|
|
2465
|
+
function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
|
|
2466
|
+
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
|
|
2467
|
+
}
|
|
2468
|
+
function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
|
|
2469
|
+
const { luvio, config } = context;
|
|
2470
|
+
const selector = {
|
|
2471
|
+
recordId: keyBuilder$c(luvio, config),
|
|
2472
|
+
node: adapterFragment$4(luvio, config),
|
|
2473
|
+
variables: {},
|
|
2474
|
+
};
|
|
2475
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
2476
|
+
config,
|
|
2477
|
+
resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
|
|
2478
|
+
});
|
|
2479
|
+
return cacheSnapshot;
|
|
2480
|
+
}
|
|
2481
|
+
const getLearningItemProgressAdapterFactory = (luvio) => function LearningContentPlatform__getLearningItemProgress(untrustedConfig, requestContext) {
|
|
2482
|
+
const config = validateAdapterConfig$5(untrustedConfig, getLearningItemProgress_ConfigPropertyNames);
|
|
2483
|
+
// Invalid or incomplete config
|
|
2484
|
+
if (config === null) {
|
|
2485
|
+
return null;
|
|
2486
|
+
}
|
|
2487
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
2488
|
+
buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
|
|
2489
|
+
};
|
|
2490
|
+
|
|
2491
|
+
const VERSION$6 = "5d4f9c65c714a3f1ef57de5a211599fb";
|
|
2492
|
+
function validate$7(obj, path = 'LearningAssignmentRepresentation') {
|
|
2493
|
+
const v_error = (() => {
|
|
2494
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2495
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
2496
|
+
}
|
|
2497
|
+
const obj_assignedCount = obj.assignedCount;
|
|
2498
|
+
const path_assignedCount = path + '.assignedCount';
|
|
2499
|
+
let obj_assignedCount_union0 = null;
|
|
2500
|
+
const obj_assignedCount_union0_error = (() => {
|
|
2501
|
+
if (typeof obj_assignedCount !== 'number' || (typeof obj_assignedCount === 'number' && Math.floor(obj_assignedCount) !== obj_assignedCount)) {
|
|
2502
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_assignedCount + '" (at "' + path_assignedCount + '")');
|
|
2503
|
+
}
|
|
2504
|
+
})();
|
|
2505
|
+
if (obj_assignedCount_union0_error != null) {
|
|
2506
|
+
obj_assignedCount_union0 = obj_assignedCount_union0_error.message;
|
|
2507
|
+
}
|
|
2508
|
+
let obj_assignedCount_union1 = null;
|
|
2509
|
+
const obj_assignedCount_union1_error = (() => {
|
|
2510
|
+
if (obj_assignedCount !== null) {
|
|
2511
|
+
return new TypeError('Expected "null" but received "' + typeof obj_assignedCount + '" (at "' + path_assignedCount + '")');
|
|
2512
|
+
}
|
|
2513
|
+
})();
|
|
2514
|
+
if (obj_assignedCount_union1_error != null) {
|
|
2515
|
+
obj_assignedCount_union1 = obj_assignedCount_union1_error.message;
|
|
2516
|
+
}
|
|
2517
|
+
if (obj_assignedCount_union0 && obj_assignedCount_union1) {
|
|
2518
|
+
let message = 'Object doesn\'t match union (at "' + path_assignedCount + '")';
|
|
2519
|
+
message += '\n' + obj_assignedCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2520
|
+
message += '\n' + obj_assignedCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2521
|
+
return new TypeError(message);
|
|
2522
|
+
}
|
|
2523
|
+
const obj_assigneeId = obj.assigneeId;
|
|
2524
|
+
const path_assigneeId = path + '.assigneeId';
|
|
2525
|
+
let obj_assigneeId_union0 = null;
|
|
2526
|
+
const obj_assigneeId_union0_error = (() => {
|
|
2527
|
+
if (typeof obj_assigneeId !== 'string') {
|
|
2528
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assigneeId + '" (at "' + path_assigneeId + '")');
|
|
2529
|
+
}
|
|
2530
|
+
})();
|
|
2531
|
+
if (obj_assigneeId_union0_error != null) {
|
|
2532
|
+
obj_assigneeId_union0 = obj_assigneeId_union0_error.message;
|
|
2533
|
+
}
|
|
2534
|
+
let obj_assigneeId_union1 = null;
|
|
2535
|
+
const obj_assigneeId_union1_error = (() => {
|
|
2536
|
+
if (obj_assigneeId !== null) {
|
|
2537
|
+
return new TypeError('Expected "null" but received "' + typeof obj_assigneeId + '" (at "' + path_assigneeId + '")');
|
|
2538
|
+
}
|
|
2539
|
+
})();
|
|
2540
|
+
if (obj_assigneeId_union1_error != null) {
|
|
2541
|
+
obj_assigneeId_union1 = obj_assigneeId_union1_error.message;
|
|
2542
|
+
}
|
|
2543
|
+
if (obj_assigneeId_union0 && obj_assigneeId_union1) {
|
|
2544
|
+
let message = 'Object doesn\'t match union (at "' + path_assigneeId + '")';
|
|
2545
|
+
message += '\n' + obj_assigneeId_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2546
|
+
message += '\n' + obj_assigneeId_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2547
|
+
return new TypeError(message);
|
|
2548
|
+
}
|
|
2549
|
+
const obj_assigneeName = obj.assigneeName;
|
|
2550
|
+
const path_assigneeName = path + '.assigneeName';
|
|
2551
|
+
let obj_assigneeName_union0 = null;
|
|
2552
|
+
const obj_assigneeName_union0_error = (() => {
|
|
2553
|
+
if (typeof obj_assigneeName !== 'string') {
|
|
2554
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assigneeName + '" (at "' + path_assigneeName + '")');
|
|
2555
|
+
}
|
|
2556
|
+
})();
|
|
2557
|
+
if (obj_assigneeName_union0_error != null) {
|
|
2558
|
+
obj_assigneeName_union0 = obj_assigneeName_union0_error.message;
|
|
2559
|
+
}
|
|
2560
|
+
let obj_assigneeName_union1 = null;
|
|
2561
|
+
const obj_assigneeName_union1_error = (() => {
|
|
2562
|
+
if (obj_assigneeName !== null) {
|
|
2563
|
+
return new TypeError('Expected "null" but received "' + typeof obj_assigneeName + '" (at "' + path_assigneeName + '")');
|
|
2564
|
+
}
|
|
2565
|
+
})();
|
|
2566
|
+
if (obj_assigneeName_union1_error != null) {
|
|
2567
|
+
obj_assigneeName_union1 = obj_assigneeName_union1_error.message;
|
|
2568
|
+
}
|
|
2569
|
+
if (obj_assigneeName_union0 && obj_assigneeName_union1) {
|
|
2570
|
+
let message = 'Object doesn\'t match union (at "' + path_assigneeName + '")';
|
|
2571
|
+
message += '\n' + obj_assigneeName_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2572
|
+
message += '\n' + obj_assigneeName_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2573
|
+
return new TypeError(message);
|
|
2574
|
+
}
|
|
2575
|
+
const obj_assigneeType = obj.assigneeType;
|
|
2576
|
+
const path_assigneeType = path + '.assigneeType';
|
|
2577
|
+
let obj_assigneeType_union0 = null;
|
|
2578
|
+
const obj_assigneeType_union0_error = (() => {
|
|
2579
|
+
if (typeof obj_assigneeType !== 'string') {
|
|
2580
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assigneeType + '" (at "' + path_assigneeType + '")');
|
|
2581
|
+
}
|
|
2582
|
+
})();
|
|
2583
|
+
if (obj_assigneeType_union0_error != null) {
|
|
2584
|
+
obj_assigneeType_union0 = obj_assigneeType_union0_error.message;
|
|
2585
|
+
}
|
|
2586
|
+
let obj_assigneeType_union1 = null;
|
|
2587
|
+
const obj_assigneeType_union1_error = (() => {
|
|
2588
|
+
if (obj_assigneeType !== null) {
|
|
2589
|
+
return new TypeError('Expected "null" but received "' + typeof obj_assigneeType + '" (at "' + path_assigneeType + '")');
|
|
2590
|
+
}
|
|
2591
|
+
})();
|
|
2592
|
+
if (obj_assigneeType_union1_error != null) {
|
|
2593
|
+
obj_assigneeType_union1 = obj_assigneeType_union1_error.message;
|
|
2594
|
+
}
|
|
2595
|
+
if (obj_assigneeType_union0 && obj_assigneeType_union1) {
|
|
2596
|
+
let message = 'Object doesn\'t match union (at "' + path_assigneeType + '")';
|
|
2597
|
+
message += '\n' + obj_assigneeType_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2598
|
+
message += '\n' + obj_assigneeType_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2599
|
+
return new TypeError(message);
|
|
2600
|
+
}
|
|
2601
|
+
const obj_assignmentDate = obj.assignmentDate;
|
|
2602
|
+
const path_assignmentDate = path + '.assignmentDate';
|
|
2603
|
+
let obj_assignmentDate_union0 = null;
|
|
2604
|
+
const obj_assignmentDate_union0_error = (() => {
|
|
2605
|
+
if (typeof obj_assignmentDate !== 'string') {
|
|
2606
|
+
return new TypeError('Expected "string" but received "' + typeof obj_assignmentDate + '" (at "' + path_assignmentDate + '")');
|
|
2607
|
+
}
|
|
2608
|
+
})();
|
|
2609
|
+
if (obj_assignmentDate_union0_error != null) {
|
|
2610
|
+
obj_assignmentDate_union0 = obj_assignmentDate_union0_error.message;
|
|
2611
|
+
}
|
|
2612
|
+
let obj_assignmentDate_union1 = null;
|
|
2613
|
+
const obj_assignmentDate_union1_error = (() => {
|
|
2614
|
+
if (obj_assignmentDate !== null) {
|
|
2615
|
+
return new TypeError('Expected "null" but received "' + typeof obj_assignmentDate + '" (at "' + path_assignmentDate + '")');
|
|
2616
|
+
}
|
|
2617
|
+
})();
|
|
2618
|
+
if (obj_assignmentDate_union1_error != null) {
|
|
2619
|
+
obj_assignmentDate_union1 = obj_assignmentDate_union1_error.message;
|
|
2620
|
+
}
|
|
2621
|
+
if (obj_assignmentDate_union0 && obj_assignmentDate_union1) {
|
|
2622
|
+
let message = 'Object doesn\'t match union (at "' + path_assignmentDate + '")';
|
|
2623
|
+
message += '\n' + obj_assignmentDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2624
|
+
message += '\n' + obj_assignmentDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2625
|
+
return new TypeError(message);
|
|
2626
|
+
}
|
|
2627
|
+
const obj_completedCount = obj.completedCount;
|
|
2628
|
+
const path_completedCount = path + '.completedCount';
|
|
2629
|
+
let obj_completedCount_union0 = null;
|
|
2630
|
+
const obj_completedCount_union0_error = (() => {
|
|
2631
|
+
if (typeof obj_completedCount !== 'number' || (typeof obj_completedCount === 'number' && Math.floor(obj_completedCount) !== obj_completedCount)) {
|
|
2632
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_completedCount + '" (at "' + path_completedCount + '")');
|
|
2633
|
+
}
|
|
2634
|
+
})();
|
|
2635
|
+
if (obj_completedCount_union0_error != null) {
|
|
2636
|
+
obj_completedCount_union0 = obj_completedCount_union0_error.message;
|
|
2637
|
+
}
|
|
2638
|
+
let obj_completedCount_union1 = null;
|
|
2639
|
+
const obj_completedCount_union1_error = (() => {
|
|
2640
|
+
if (obj_completedCount !== null) {
|
|
2641
|
+
return new TypeError('Expected "null" but received "' + typeof obj_completedCount + '" (at "' + path_completedCount + '")');
|
|
2642
|
+
}
|
|
2643
|
+
})();
|
|
2644
|
+
if (obj_completedCount_union1_error != null) {
|
|
2645
|
+
obj_completedCount_union1 = obj_completedCount_union1_error.message;
|
|
2646
|
+
}
|
|
2647
|
+
if (obj_completedCount_union0 && obj_completedCount_union1) {
|
|
2648
|
+
let message = 'Object doesn\'t match union (at "' + path_completedCount + '")';
|
|
2649
|
+
message += '\n' + obj_completedCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2650
|
+
message += '\n' + obj_completedCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2651
|
+
return new TypeError(message);
|
|
2652
|
+
}
|
|
2653
|
+
const obj_completedPercent = obj.completedPercent;
|
|
2654
|
+
const path_completedPercent = path + '.completedPercent';
|
|
2655
|
+
let obj_completedPercent_union0 = null;
|
|
2656
|
+
const obj_completedPercent_union0_error = (() => {
|
|
2657
|
+
if (typeof obj_completedPercent !== 'number' || (typeof obj_completedPercent === 'number' && Math.floor(obj_completedPercent) !== obj_completedPercent)) {
|
|
2658
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_completedPercent + '" (at "' + path_completedPercent + '")');
|
|
2659
|
+
}
|
|
2660
|
+
})();
|
|
2661
|
+
if (obj_completedPercent_union0_error != null) {
|
|
2662
|
+
obj_completedPercent_union0 = obj_completedPercent_union0_error.message;
|
|
2663
|
+
}
|
|
2664
|
+
let obj_completedPercent_union1 = null;
|
|
2665
|
+
const obj_completedPercent_union1_error = (() => {
|
|
2666
|
+
if (obj_completedPercent !== null) {
|
|
2667
|
+
return new TypeError('Expected "null" but received "' + typeof obj_completedPercent + '" (at "' + path_completedPercent + '")');
|
|
2668
|
+
}
|
|
2669
|
+
})();
|
|
2670
|
+
if (obj_completedPercent_union1_error != null) {
|
|
2671
|
+
obj_completedPercent_union1 = obj_completedPercent_union1_error.message;
|
|
2672
|
+
}
|
|
2673
|
+
if (obj_completedPercent_union0 && obj_completedPercent_union1) {
|
|
2674
|
+
let message = 'Object doesn\'t match union (at "' + path_completedPercent + '")';
|
|
2675
|
+
message += '\n' + obj_completedPercent_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2676
|
+
message += '\n' + obj_completedPercent_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2677
|
+
return new TypeError(message);
|
|
2678
|
+
}
|
|
2679
|
+
const obj_daysUntilDueDate = obj.daysUntilDueDate;
|
|
2680
|
+
const path_daysUntilDueDate = path + '.daysUntilDueDate';
|
|
2681
|
+
let obj_daysUntilDueDate_union0 = null;
|
|
2682
|
+
const obj_daysUntilDueDate_union0_error = (() => {
|
|
2683
|
+
if (typeof obj_daysUntilDueDate !== 'number' || (typeof obj_daysUntilDueDate === 'number' && Math.floor(obj_daysUntilDueDate) !== obj_daysUntilDueDate)) {
|
|
2684
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_daysUntilDueDate + '" (at "' + path_daysUntilDueDate + '")');
|
|
2685
|
+
}
|
|
2686
|
+
})();
|
|
2687
|
+
if (obj_daysUntilDueDate_union0_error != null) {
|
|
2688
|
+
obj_daysUntilDueDate_union0 = obj_daysUntilDueDate_union0_error.message;
|
|
2689
|
+
}
|
|
2690
|
+
let obj_daysUntilDueDate_union1 = null;
|
|
2691
|
+
const obj_daysUntilDueDate_union1_error = (() => {
|
|
2692
|
+
if (obj_daysUntilDueDate !== null) {
|
|
2693
|
+
return new TypeError('Expected "null" but received "' + typeof obj_daysUntilDueDate + '" (at "' + path_daysUntilDueDate + '")');
|
|
2694
|
+
}
|
|
2695
|
+
})();
|
|
2696
|
+
if (obj_daysUntilDueDate_union1_error != null) {
|
|
2697
|
+
obj_daysUntilDueDate_union1 = obj_daysUntilDueDate_union1_error.message;
|
|
2698
|
+
}
|
|
2699
|
+
if (obj_daysUntilDueDate_union0 && obj_daysUntilDueDate_union1) {
|
|
2700
|
+
let message = 'Object doesn\'t match union (at "' + path_daysUntilDueDate + '")';
|
|
2701
|
+
message += '\n' + obj_daysUntilDueDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2702
|
+
message += '\n' + obj_daysUntilDueDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2703
|
+
return new TypeError(message);
|
|
2704
|
+
}
|
|
2705
|
+
const obj_dueDate = obj.dueDate;
|
|
2706
|
+
const path_dueDate = path + '.dueDate';
|
|
2707
|
+
let obj_dueDate_union0 = null;
|
|
2708
|
+
const obj_dueDate_union0_error = (() => {
|
|
2709
|
+
if (typeof obj_dueDate !== 'string') {
|
|
2710
|
+
return new TypeError('Expected "string" but received "' + typeof obj_dueDate + '" (at "' + path_dueDate + '")');
|
|
2711
|
+
}
|
|
2712
|
+
})();
|
|
2713
|
+
if (obj_dueDate_union0_error != null) {
|
|
2714
|
+
obj_dueDate_union0 = obj_dueDate_union0_error.message;
|
|
2715
|
+
}
|
|
2716
|
+
let obj_dueDate_union1 = null;
|
|
2717
|
+
const obj_dueDate_union1_error = (() => {
|
|
2718
|
+
if (obj_dueDate !== null) {
|
|
2719
|
+
return new TypeError('Expected "null" but received "' + typeof obj_dueDate + '" (at "' + path_dueDate + '")');
|
|
2720
|
+
}
|
|
2721
|
+
})();
|
|
2722
|
+
if (obj_dueDate_union1_error != null) {
|
|
2723
|
+
obj_dueDate_union1 = obj_dueDate_union1_error.message;
|
|
2724
|
+
}
|
|
2725
|
+
if (obj_dueDate_union0 && obj_dueDate_union1) {
|
|
2726
|
+
let message = 'Object doesn\'t match union (at "' + path_dueDate + '")';
|
|
2727
|
+
message += '\n' + obj_dueDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
2728
|
+
message += '\n' + obj_dueDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
2729
|
+
return new TypeError(message);
|
|
2730
|
+
}
|
|
2731
|
+
const obj_id = obj.id;
|
|
2732
|
+
const path_id = path + '.id';
|
|
2733
|
+
if (typeof obj_id !== 'string') {
|
|
2734
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
2735
|
+
}
|
|
2736
|
+
const obj_learningItemId = obj.learningItemId;
|
|
2737
|
+
const path_learningItemId = path + '.learningItemId';
|
|
2738
|
+
if (typeof obj_learningItemId !== 'string') {
|
|
2739
|
+
return new TypeError('Expected "string" but received "' + typeof obj_learningItemId + '" (at "' + path_learningItemId + '")');
|
|
2740
|
+
}
|
|
2741
|
+
})();
|
|
2742
|
+
return v_error === undefined ? null : v_error;
|
|
2743
|
+
}
|
|
2744
|
+
const select$b = function LearningAssignmentRepresentationSelect() {
|
|
2745
|
+
return {
|
|
2746
|
+
kind: 'Fragment',
|
|
2747
|
+
version: VERSION$6,
|
|
2748
|
+
private: [],
|
|
2749
|
+
selections: [
|
|
2750
|
+
{
|
|
2751
|
+
name: 'assignedCount',
|
|
2752
|
+
kind: 'Scalar'
|
|
2753
|
+
},
|
|
2754
|
+
{
|
|
2755
|
+
name: 'assigneeId',
|
|
2756
|
+
kind: 'Scalar'
|
|
2757
|
+
},
|
|
2758
|
+
{
|
|
2759
|
+
name: 'assigneeName',
|
|
2760
|
+
kind: 'Scalar'
|
|
2761
|
+
},
|
|
2762
|
+
{
|
|
2763
|
+
name: 'assigneeType',
|
|
2764
|
+
kind: 'Scalar'
|
|
2765
|
+
},
|
|
2766
|
+
{
|
|
2767
|
+
name: 'assignmentDate',
|
|
2768
|
+
kind: 'Scalar'
|
|
2769
|
+
},
|
|
2770
|
+
{
|
|
2771
|
+
name: 'completedCount',
|
|
2772
|
+
kind: 'Scalar'
|
|
2773
|
+
},
|
|
2774
|
+
{
|
|
2775
|
+
name: 'completedPercent',
|
|
2886
2776
|
kind: 'Scalar'
|
|
2887
2777
|
},
|
|
2888
2778
|
{
|
|
@@ -2965,7 +2855,7 @@ function equals$6(existing, incoming) {
|
|
|
2965
2855
|
|
|
2966
2856
|
const TTL$3 = 15000;
|
|
2967
2857
|
const VERSION$5 = "3ae4e1d57057645da8f2613fbdc5e245";
|
|
2968
|
-
function validate$
|
|
2858
|
+
function validate$6(obj, path = 'LearningModelOutputRepresentation') {
|
|
2969
2859
|
const v_error = (() => {
|
|
2970
2860
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
2971
2861
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -3004,7 +2894,7 @@ function validate$5(obj, path = 'LearningModelOutputRepresentation') {
|
|
|
3004
2894
|
for (let i = 0; i < obj_assignments.length; i++) {
|
|
3005
2895
|
const obj_assignments_item = obj_assignments[i];
|
|
3006
2896
|
const path_assignments_item = path_assignments + '[' + i + ']';
|
|
3007
|
-
const referencepath_assignments_itemValidationError = validate$
|
|
2897
|
+
const referencepath_assignments_itemValidationError = validate$7(obj_assignments_item, path_assignments_item);
|
|
3008
2898
|
if (referencepath_assignments_itemValidationError !== null) {
|
|
3009
2899
|
let message = 'Object doesn\'t match LearningAssignmentRepresentation (at "' + path_assignments_item + '")\n';
|
|
3010
2900
|
message += referencepath_assignments_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
@@ -3240,8 +3130,8 @@ function keyBuilderFromType$3(luvio, object) {
|
|
|
3240
3130
|
function normalize$3(input, existing, path, luvio, store, timestamp) {
|
|
3241
3131
|
return input;
|
|
3242
3132
|
}
|
|
3243
|
-
const select$
|
|
3244
|
-
const { selections: LearningAssignmentRepresentation__selections, opaque: LearningAssignmentRepresentation__opaque, } = select$
|
|
3133
|
+
const select$a = function LearningModelOutputRepresentationSelect() {
|
|
3134
|
+
const { selections: LearningAssignmentRepresentation__selections, opaque: LearningAssignmentRepresentation__opaque, } = select$b();
|
|
3245
3135
|
return {
|
|
3246
3136
|
kind: 'Fragment',
|
|
3247
3137
|
version: VERSION$5,
|
|
@@ -3381,7 +3271,7 @@ function equals$5(existing, incoming) {
|
|
|
3381
3271
|
}
|
|
3382
3272
|
const ingest$3 = function LearningModelOutputRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3383
3273
|
if (process.env.NODE_ENV !== 'production') {
|
|
3384
|
-
const validateError = validate$
|
|
3274
|
+
const validateError = validate$6(input);
|
|
3385
3275
|
if (validateError !== null) {
|
|
3386
3276
|
throw validateError;
|
|
3387
3277
|
}
|
|
@@ -3401,24 +3291,24 @@ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
3401
3291
|
});
|
|
3402
3292
|
}
|
|
3403
3293
|
|
|
3404
|
-
function select$
|
|
3405
|
-
return select$
|
|
3294
|
+
function select$9(luvio, params) {
|
|
3295
|
+
return select$a();
|
|
3406
3296
|
}
|
|
3407
3297
|
function keyBuilder$a(luvio, params) {
|
|
3408
3298
|
return keyBuilder$b(luvio, {
|
|
3409
3299
|
learning_item_id: params.urlParams.learningItemId
|
|
3410
3300
|
});
|
|
3411
3301
|
}
|
|
3412
|
-
function getResponseCacheKeys$
|
|
3302
|
+
function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
|
|
3413
3303
|
getTypeCacheKeys$3(storeKeyMap, luvio, response);
|
|
3414
3304
|
}
|
|
3415
|
-
function ingestSuccess$
|
|
3305
|
+
function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
|
|
3416
3306
|
const { body } = response;
|
|
3417
3307
|
const key = keyBuilder$a(luvio, resourceParams);
|
|
3418
3308
|
luvio.storeIngest(key, ingest$3, body);
|
|
3419
3309
|
const snapshot = luvio.storeLookup({
|
|
3420
3310
|
recordId: key,
|
|
3421
|
-
node: select$
|
|
3311
|
+
node: select$9(),
|
|
3422
3312
|
variables: {},
|
|
3423
3313
|
}, snapshotRefresh);
|
|
3424
3314
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -3441,7 +3331,7 @@ function ingestError$3(luvio, params, error, snapshotRefresh) {
|
|
|
3441
3331
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
3442
3332
|
return errorSnapshot;
|
|
3443
3333
|
}
|
|
3444
|
-
function createResourceRequest$
|
|
3334
|
+
function createResourceRequest$4(config) {
|
|
3445
3335
|
const headers = {};
|
|
3446
3336
|
return {
|
|
3447
3337
|
baseUri: '/services/data/v60.0',
|
|
@@ -3455,60 +3345,60 @@ function createResourceRequest$3(config) {
|
|
|
3455
3345
|
};
|
|
3456
3346
|
}
|
|
3457
3347
|
|
|
3458
|
-
const adapterName$
|
|
3348
|
+
const adapterName$4 = 'getLearningModel';
|
|
3459
3349
|
const getLearningModel_ConfigPropertyMetadata = [
|
|
3460
3350
|
generateParamConfigMetadata('learningItemId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3461
3351
|
];
|
|
3462
|
-
const getLearningModel_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$
|
|
3463
|
-
const createResourceParams$
|
|
3352
|
+
const getLearningModel_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getLearningModel_ConfigPropertyMetadata);
|
|
3353
|
+
const createResourceParams$4 = /*#__PURE__*/ createResourceParams$a(getLearningModel_ConfigPropertyMetadata);
|
|
3464
3354
|
function keyBuilder$9(luvio, config) {
|
|
3465
|
-
const resourceParams = createResourceParams$
|
|
3355
|
+
const resourceParams = createResourceParams$4(config);
|
|
3466
3356
|
return keyBuilder$a(luvio, resourceParams);
|
|
3467
3357
|
}
|
|
3468
|
-
function typeCheckConfig$
|
|
3358
|
+
function typeCheckConfig$4(untrustedConfig) {
|
|
3469
3359
|
const config = {};
|
|
3470
3360
|
typeCheckConfig$a(untrustedConfig, config, getLearningModel_ConfigPropertyMetadata);
|
|
3471
3361
|
return config;
|
|
3472
3362
|
}
|
|
3473
|
-
function validateAdapterConfig$
|
|
3363
|
+
function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
|
|
3474
3364
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
3475
3365
|
return null;
|
|
3476
3366
|
}
|
|
3477
3367
|
if (process.env.NODE_ENV !== 'production') {
|
|
3478
3368
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
3479
3369
|
}
|
|
3480
|
-
const config = typeCheckConfig$
|
|
3370
|
+
const config = typeCheckConfig$4(untrustedConfig);
|
|
3481
3371
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3482
3372
|
return null;
|
|
3483
3373
|
}
|
|
3484
3374
|
return config;
|
|
3485
3375
|
}
|
|
3486
3376
|
function adapterFragment$3(luvio, config) {
|
|
3487
|
-
createResourceParams$
|
|
3488
|
-
return select$
|
|
3377
|
+
createResourceParams$4(config);
|
|
3378
|
+
return select$9();
|
|
3489
3379
|
}
|
|
3490
3380
|
function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
|
|
3491
|
-
const snapshot = ingestSuccess$
|
|
3381
|
+
const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
|
|
3492
3382
|
config,
|
|
3493
|
-
resolve: () => buildNetworkSnapshot$
|
|
3383
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
3494
3384
|
});
|
|
3495
3385
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
3496
3386
|
}
|
|
3497
3387
|
function onFetchResponseError$3(luvio, config, resourceParams, response) {
|
|
3498
3388
|
const snapshot = ingestError$3(luvio, resourceParams, response, {
|
|
3499
3389
|
config,
|
|
3500
|
-
resolve: () => buildNetworkSnapshot$
|
|
3390
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
3501
3391
|
});
|
|
3502
3392
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
3503
3393
|
}
|
|
3504
|
-
function buildNetworkSnapshot$
|
|
3505
|
-
const resourceParams = createResourceParams$
|
|
3506
|
-
const request = createResourceRequest$
|
|
3394
|
+
function buildNetworkSnapshot$4(luvio, config, options) {
|
|
3395
|
+
const resourceParams = createResourceParams$4(config);
|
|
3396
|
+
const request = createResourceRequest$4(resourceParams);
|
|
3507
3397
|
return luvio.dispatchResourceRequest(request, options)
|
|
3508
3398
|
.then((response) => {
|
|
3509
3399
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
|
|
3510
3400
|
const cache = new StoreKeyMap();
|
|
3511
|
-
getResponseCacheKeys$
|
|
3401
|
+
getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
|
|
3512
3402
|
return cache;
|
|
3513
3403
|
});
|
|
3514
3404
|
}, (response) => {
|
|
@@ -3516,7 +3406,7 @@ function buildNetworkSnapshot$3(luvio, config, options) {
|
|
|
3516
3406
|
});
|
|
3517
3407
|
}
|
|
3518
3408
|
function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
|
|
3519
|
-
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$
|
|
3409
|
+
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
|
|
3520
3410
|
}
|
|
3521
3411
|
function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
3522
3412
|
const { luvio, config } = context;
|
|
@@ -3527,12 +3417,12 @@ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
|
|
|
3527
3417
|
};
|
|
3528
3418
|
const cacheSnapshot = storeLookup(selector, {
|
|
3529
3419
|
config,
|
|
3530
|
-
resolve: () => buildNetworkSnapshot$
|
|
3420
|
+
resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
|
|
3531
3421
|
});
|
|
3532
3422
|
return cacheSnapshot;
|
|
3533
3423
|
}
|
|
3534
3424
|
const getLearningModelAdapterFactory = (luvio) => function LearningContentPlatform__getLearningModel(untrustedConfig, requestContext) {
|
|
3535
|
-
const config = validateAdapterConfig$
|
|
3425
|
+
const config = validateAdapterConfig$4(untrustedConfig, getLearningModel_ConfigPropertyNames);
|
|
3536
3426
|
// Invalid or incomplete config
|
|
3537
3427
|
if (config === null) {
|
|
3538
3428
|
return null;
|
|
@@ -3541,87 +3431,472 @@ const getLearningModelAdapterFactory = (luvio) => function LearningContentPlatfo
|
|
|
3541
3431
|
buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
|
|
3542
3432
|
};
|
|
3543
3433
|
|
|
3544
|
-
const
|
|
3545
|
-
|
|
3546
|
-
|
|
3434
|
+
const VERSION$4 = "19c9bcb401bf39a211caeff8b3cde304";
|
|
3435
|
+
function validate$5(obj, path = 'TrailheadModuleUnitRepresentation') {
|
|
3436
|
+
const v_error = (() => {
|
|
3437
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3438
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3439
|
+
}
|
|
3440
|
+
const obj_completedDate = obj.completedDate;
|
|
3441
|
+
const path_completedDate = path + '.completedDate';
|
|
3442
|
+
let obj_completedDate_union0 = null;
|
|
3443
|
+
const obj_completedDate_union0_error = (() => {
|
|
3444
|
+
if (typeof obj_completedDate !== 'string') {
|
|
3445
|
+
return new TypeError('Expected "string" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
|
|
3446
|
+
}
|
|
3447
|
+
})();
|
|
3448
|
+
if (obj_completedDate_union0_error != null) {
|
|
3449
|
+
obj_completedDate_union0 = obj_completedDate_union0_error.message;
|
|
3450
|
+
}
|
|
3451
|
+
let obj_completedDate_union1 = null;
|
|
3452
|
+
const obj_completedDate_union1_error = (() => {
|
|
3453
|
+
if (obj_completedDate !== null) {
|
|
3454
|
+
return new TypeError('Expected "null" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
|
|
3455
|
+
}
|
|
3456
|
+
})();
|
|
3457
|
+
if (obj_completedDate_union1_error != null) {
|
|
3458
|
+
obj_completedDate_union1 = obj_completedDate_union1_error.message;
|
|
3459
|
+
}
|
|
3460
|
+
if (obj_completedDate_union0 && obj_completedDate_union1) {
|
|
3461
|
+
let message = 'Object doesn\'t match union (at "' + path_completedDate + '")';
|
|
3462
|
+
message += '\n' + obj_completedDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
3463
|
+
message += '\n' + obj_completedDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
3464
|
+
return new TypeError(message);
|
|
3465
|
+
}
|
|
3466
|
+
const obj_contentUrl = obj.contentUrl;
|
|
3467
|
+
const path_contentUrl = path + '.contentUrl';
|
|
3468
|
+
if (typeof obj_contentUrl !== 'string') {
|
|
3469
|
+
return new TypeError('Expected "string" but received "' + typeof obj_contentUrl + '" (at "' + path_contentUrl + '")');
|
|
3470
|
+
}
|
|
3471
|
+
const obj_durationCount = obj.durationCount;
|
|
3472
|
+
const path_durationCount = path + '.durationCount';
|
|
3473
|
+
if (typeof obj_durationCount !== 'number' || (typeof obj_durationCount === 'number' && Math.floor(obj_durationCount) !== obj_durationCount)) {
|
|
3474
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_durationCount + '" (at "' + path_durationCount + '")');
|
|
3475
|
+
}
|
|
3476
|
+
const obj_earnedPointCount = obj.earnedPointCount;
|
|
3477
|
+
const path_earnedPointCount = path + '.earnedPointCount';
|
|
3478
|
+
let obj_earnedPointCount_union0 = null;
|
|
3479
|
+
const obj_earnedPointCount_union0_error = (() => {
|
|
3480
|
+
if (typeof obj_earnedPointCount !== 'number' || (typeof obj_earnedPointCount === 'number' && Math.floor(obj_earnedPointCount) !== obj_earnedPointCount)) {
|
|
3481
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_earnedPointCount + '" (at "' + path_earnedPointCount + '")');
|
|
3482
|
+
}
|
|
3483
|
+
})();
|
|
3484
|
+
if (obj_earnedPointCount_union0_error != null) {
|
|
3485
|
+
obj_earnedPointCount_union0 = obj_earnedPointCount_union0_error.message;
|
|
3486
|
+
}
|
|
3487
|
+
let obj_earnedPointCount_union1 = null;
|
|
3488
|
+
const obj_earnedPointCount_union1_error = (() => {
|
|
3489
|
+
if (obj_earnedPointCount !== null) {
|
|
3490
|
+
return new TypeError('Expected "null" but received "' + typeof obj_earnedPointCount + '" (at "' + path_earnedPointCount + '")');
|
|
3491
|
+
}
|
|
3492
|
+
})();
|
|
3493
|
+
if (obj_earnedPointCount_union1_error != null) {
|
|
3494
|
+
obj_earnedPointCount_union1 = obj_earnedPointCount_union1_error.message;
|
|
3495
|
+
}
|
|
3496
|
+
if (obj_earnedPointCount_union0 && obj_earnedPointCount_union1) {
|
|
3497
|
+
let message = 'Object doesn\'t match union (at "' + path_earnedPointCount + '")';
|
|
3498
|
+
message += '\n' + obj_earnedPointCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
3499
|
+
message += '\n' + obj_earnedPointCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
3500
|
+
return new TypeError(message);
|
|
3501
|
+
}
|
|
3502
|
+
const obj_id = obj.id;
|
|
3503
|
+
const path_id = path + '.id';
|
|
3504
|
+
if (typeof obj_id !== 'string') {
|
|
3505
|
+
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
3506
|
+
}
|
|
3507
|
+
const obj_title = obj.title;
|
|
3508
|
+
const path_title = path + '.title';
|
|
3509
|
+
if (typeof obj_title !== 'string') {
|
|
3510
|
+
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
3511
|
+
}
|
|
3512
|
+
const obj_trustedFrameOrigin = obj.trustedFrameOrigin;
|
|
3513
|
+
const path_trustedFrameOrigin = path + '.trustedFrameOrigin';
|
|
3514
|
+
if (typeof obj_trustedFrameOrigin !== 'string') {
|
|
3515
|
+
return new TypeError('Expected "string" but received "' + typeof obj_trustedFrameOrigin + '" (at "' + path_trustedFrameOrigin + '")');
|
|
3516
|
+
}
|
|
3517
|
+
})();
|
|
3518
|
+
return v_error === undefined ? null : v_error;
|
|
3519
|
+
}
|
|
3520
|
+
const select$8 = function TrailheadModuleUnitRepresentationSelect() {
|
|
3521
|
+
return {
|
|
3522
|
+
kind: 'Fragment',
|
|
3523
|
+
version: VERSION$4,
|
|
3524
|
+
private: [],
|
|
3525
|
+
selections: [
|
|
3526
|
+
{
|
|
3527
|
+
name: 'completedDate',
|
|
3528
|
+
kind: 'Scalar'
|
|
3529
|
+
},
|
|
3530
|
+
{
|
|
3531
|
+
name: 'contentUrl',
|
|
3532
|
+
kind: 'Scalar'
|
|
3533
|
+
},
|
|
3534
|
+
{
|
|
3535
|
+
name: 'durationCount',
|
|
3536
|
+
kind: 'Scalar'
|
|
3537
|
+
},
|
|
3538
|
+
{
|
|
3539
|
+
name: 'earnedPointCount',
|
|
3540
|
+
kind: 'Scalar'
|
|
3541
|
+
},
|
|
3542
|
+
{
|
|
3543
|
+
name: 'id',
|
|
3544
|
+
kind: 'Scalar'
|
|
3545
|
+
},
|
|
3546
|
+
{
|
|
3547
|
+
name: 'title',
|
|
3548
|
+
kind: 'Scalar'
|
|
3549
|
+
},
|
|
3550
|
+
{
|
|
3551
|
+
name: 'trustedFrameOrigin',
|
|
3552
|
+
kind: 'Scalar'
|
|
3553
|
+
}
|
|
3554
|
+
]
|
|
3555
|
+
};
|
|
3556
|
+
};
|
|
3557
|
+
function equals$4(existing, incoming) {
|
|
3558
|
+
const existing_durationCount = existing.durationCount;
|
|
3559
|
+
const incoming_durationCount = incoming.durationCount;
|
|
3560
|
+
if (!(existing_durationCount === incoming_durationCount)) {
|
|
3561
|
+
return false;
|
|
3562
|
+
}
|
|
3563
|
+
const existing_contentUrl = existing.contentUrl;
|
|
3564
|
+
const incoming_contentUrl = incoming.contentUrl;
|
|
3565
|
+
if (!(existing_contentUrl === incoming_contentUrl)) {
|
|
3566
|
+
return false;
|
|
3567
|
+
}
|
|
3568
|
+
const existing_id = existing.id;
|
|
3569
|
+
const incoming_id = incoming.id;
|
|
3570
|
+
if (!(existing_id === incoming_id)) {
|
|
3571
|
+
return false;
|
|
3572
|
+
}
|
|
3573
|
+
const existing_title = existing.title;
|
|
3574
|
+
const incoming_title = incoming.title;
|
|
3575
|
+
if (!(existing_title === incoming_title)) {
|
|
3576
|
+
return false;
|
|
3577
|
+
}
|
|
3578
|
+
const existing_trustedFrameOrigin = existing.trustedFrameOrigin;
|
|
3579
|
+
const incoming_trustedFrameOrigin = incoming.trustedFrameOrigin;
|
|
3580
|
+
if (!(existing_trustedFrameOrigin === incoming_trustedFrameOrigin)) {
|
|
3581
|
+
return false;
|
|
3582
|
+
}
|
|
3583
|
+
const existing_completedDate = existing.completedDate;
|
|
3584
|
+
const incoming_completedDate = incoming.completedDate;
|
|
3585
|
+
if (!(existing_completedDate === incoming_completedDate)) {
|
|
3586
|
+
return false;
|
|
3587
|
+
}
|
|
3588
|
+
const existing_earnedPointCount = existing.earnedPointCount;
|
|
3589
|
+
const incoming_earnedPointCount = incoming.earnedPointCount;
|
|
3590
|
+
if (!(existing_earnedPointCount === incoming_earnedPointCount)) {
|
|
3591
|
+
return false;
|
|
3592
|
+
}
|
|
3593
|
+
return true;
|
|
3594
|
+
}
|
|
3595
|
+
|
|
3596
|
+
const TTL$2 = 21600000;
|
|
3597
|
+
const VERSION$3 = "9bed4edb4c9f077a2f7ce902f94afa38";
|
|
3598
|
+
function validate$4(obj, path = 'TrailheadModuleRepresentation') {
|
|
3547
3599
|
const v_error = (() => {
|
|
3548
3600
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3549
3601
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3550
3602
|
}
|
|
3603
|
+
const obj_availablePointCount = obj.availablePointCount;
|
|
3604
|
+
const path_availablePointCount = path + '.availablePointCount';
|
|
3605
|
+
if (typeof obj_availablePointCount !== 'number' || (typeof obj_availablePointCount === 'number' && Math.floor(obj_availablePointCount) !== obj_availablePointCount)) {
|
|
3606
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_availablePointCount + '" (at "' + path_availablePointCount + '")');
|
|
3607
|
+
}
|
|
3608
|
+
const obj_completedDate = obj.completedDate;
|
|
3609
|
+
const path_completedDate = path + '.completedDate';
|
|
3610
|
+
let obj_completedDate_union0 = null;
|
|
3611
|
+
const obj_completedDate_union0_error = (() => {
|
|
3612
|
+
if (typeof obj_completedDate !== 'string') {
|
|
3613
|
+
return new TypeError('Expected "string" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
|
|
3614
|
+
}
|
|
3615
|
+
})();
|
|
3616
|
+
if (obj_completedDate_union0_error != null) {
|
|
3617
|
+
obj_completedDate_union0 = obj_completedDate_union0_error.message;
|
|
3618
|
+
}
|
|
3619
|
+
let obj_completedDate_union1 = null;
|
|
3620
|
+
const obj_completedDate_union1_error = (() => {
|
|
3621
|
+
if (obj_completedDate !== null) {
|
|
3622
|
+
return new TypeError('Expected "null" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
|
|
3623
|
+
}
|
|
3624
|
+
})();
|
|
3625
|
+
if (obj_completedDate_union1_error != null) {
|
|
3626
|
+
obj_completedDate_union1 = obj_completedDate_union1_error.message;
|
|
3627
|
+
}
|
|
3628
|
+
if (obj_completedDate_union0 && obj_completedDate_union1) {
|
|
3629
|
+
let message = 'Object doesn\'t match union (at "' + path_completedDate + '")';
|
|
3630
|
+
message += '\n' + obj_completedDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
3631
|
+
message += '\n' + obj_completedDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
3632
|
+
return new TypeError(message);
|
|
3633
|
+
}
|
|
3634
|
+
const obj_completedItemCount = obj.completedItemCount;
|
|
3635
|
+
const path_completedItemCount = path + '.completedItemCount';
|
|
3636
|
+
let obj_completedItemCount_union0 = null;
|
|
3637
|
+
const obj_completedItemCount_union0_error = (() => {
|
|
3638
|
+
if (typeof obj_completedItemCount !== 'number' || (typeof obj_completedItemCount === 'number' && Math.floor(obj_completedItemCount) !== obj_completedItemCount)) {
|
|
3639
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_completedItemCount + '" (at "' + path_completedItemCount + '")');
|
|
3640
|
+
}
|
|
3641
|
+
})();
|
|
3642
|
+
if (obj_completedItemCount_union0_error != null) {
|
|
3643
|
+
obj_completedItemCount_union0 = obj_completedItemCount_union0_error.message;
|
|
3644
|
+
}
|
|
3645
|
+
let obj_completedItemCount_union1 = null;
|
|
3646
|
+
const obj_completedItemCount_union1_error = (() => {
|
|
3647
|
+
if (obj_completedItemCount !== null) {
|
|
3648
|
+
return new TypeError('Expected "null" but received "' + typeof obj_completedItemCount + '" (at "' + path_completedItemCount + '")');
|
|
3649
|
+
}
|
|
3650
|
+
})();
|
|
3651
|
+
if (obj_completedItemCount_union1_error != null) {
|
|
3652
|
+
obj_completedItemCount_union1 = obj_completedItemCount_union1_error.message;
|
|
3653
|
+
}
|
|
3654
|
+
if (obj_completedItemCount_union0 && obj_completedItemCount_union1) {
|
|
3655
|
+
let message = 'Object doesn\'t match union (at "' + path_completedItemCount + '")';
|
|
3656
|
+
message += '\n' + obj_completedItemCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
3657
|
+
message += '\n' + obj_completedItemCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
3658
|
+
return new TypeError(message);
|
|
3659
|
+
}
|
|
3660
|
+
const obj_completedPercent = obj.completedPercent;
|
|
3661
|
+
const path_completedPercent = path + '.completedPercent';
|
|
3662
|
+
let obj_completedPercent_union0 = null;
|
|
3663
|
+
const obj_completedPercent_union0_error = (() => {
|
|
3664
|
+
if (typeof obj_completedPercent !== 'number' || (typeof obj_completedPercent === 'number' && Math.floor(obj_completedPercent) !== obj_completedPercent)) {
|
|
3665
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_completedPercent + '" (at "' + path_completedPercent + '")');
|
|
3666
|
+
}
|
|
3667
|
+
})();
|
|
3668
|
+
if (obj_completedPercent_union0_error != null) {
|
|
3669
|
+
obj_completedPercent_union0 = obj_completedPercent_union0_error.message;
|
|
3670
|
+
}
|
|
3671
|
+
let obj_completedPercent_union1 = null;
|
|
3672
|
+
const obj_completedPercent_union1_error = (() => {
|
|
3673
|
+
if (obj_completedPercent !== null) {
|
|
3674
|
+
return new TypeError('Expected "null" but received "' + typeof obj_completedPercent + '" (at "' + path_completedPercent + '")');
|
|
3675
|
+
}
|
|
3676
|
+
})();
|
|
3677
|
+
if (obj_completedPercent_union1_error != null) {
|
|
3678
|
+
obj_completedPercent_union1 = obj_completedPercent_union1_error.message;
|
|
3679
|
+
}
|
|
3680
|
+
if (obj_completedPercent_union0 && obj_completedPercent_union1) {
|
|
3681
|
+
let message = 'Object doesn\'t match union (at "' + path_completedPercent + '")';
|
|
3682
|
+
message += '\n' + obj_completedPercent_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
3683
|
+
message += '\n' + obj_completedPercent_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
3684
|
+
return new TypeError(message);
|
|
3685
|
+
}
|
|
3551
3686
|
const obj_description = obj.description;
|
|
3552
3687
|
const path_description = path + '.description';
|
|
3553
3688
|
if (typeof obj_description !== 'string') {
|
|
3554
3689
|
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
3555
3690
|
}
|
|
3556
|
-
const
|
|
3557
|
-
const
|
|
3558
|
-
if (typeof
|
|
3559
|
-
return new TypeError('Expected "
|
|
3691
|
+
const obj_durationCount = obj.durationCount;
|
|
3692
|
+
const path_durationCount = path + '.durationCount';
|
|
3693
|
+
if (typeof obj_durationCount !== 'number' || (typeof obj_durationCount === 'number' && Math.floor(obj_durationCount) !== obj_durationCount)) {
|
|
3694
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_durationCount + '" (at "' + path_durationCount + '")');
|
|
3560
3695
|
}
|
|
3561
|
-
const
|
|
3562
|
-
const
|
|
3563
|
-
|
|
3564
|
-
|
|
3696
|
+
const obj_earnedPointCount = obj.earnedPointCount;
|
|
3697
|
+
const path_earnedPointCount = path + '.earnedPointCount';
|
|
3698
|
+
let obj_earnedPointCount_union0 = null;
|
|
3699
|
+
const obj_earnedPointCount_union0_error = (() => {
|
|
3700
|
+
if (typeof obj_earnedPointCount !== 'number' || (typeof obj_earnedPointCount === 'number' && Math.floor(obj_earnedPointCount) !== obj_earnedPointCount)) {
|
|
3701
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_earnedPointCount + '" (at "' + path_earnedPointCount + '")');
|
|
3702
|
+
}
|
|
3703
|
+
})();
|
|
3704
|
+
if (obj_earnedPointCount_union0_error != null) {
|
|
3705
|
+
obj_earnedPointCount_union0 = obj_earnedPointCount_union0_error.message;
|
|
3565
3706
|
}
|
|
3566
|
-
|
|
3567
|
-
const
|
|
3568
|
-
|
|
3569
|
-
|
|
3707
|
+
let obj_earnedPointCount_union1 = null;
|
|
3708
|
+
const obj_earnedPointCount_union1_error = (() => {
|
|
3709
|
+
if (obj_earnedPointCount !== null) {
|
|
3710
|
+
return new TypeError('Expected "null" but received "' + typeof obj_earnedPointCount + '" (at "' + path_earnedPointCount + '")');
|
|
3711
|
+
}
|
|
3712
|
+
})();
|
|
3713
|
+
if (obj_earnedPointCount_union1_error != null) {
|
|
3714
|
+
obj_earnedPointCount_union1 = obj_earnedPointCount_union1_error.message;
|
|
3715
|
+
}
|
|
3716
|
+
if (obj_earnedPointCount_union0 && obj_earnedPointCount_union1) {
|
|
3717
|
+
let message = 'Object doesn\'t match union (at "' + path_earnedPointCount + '")';
|
|
3718
|
+
message += '\n' + obj_earnedPointCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
3719
|
+
message += '\n' + obj_earnedPointCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
3720
|
+
return new TypeError(message);
|
|
3721
|
+
}
|
|
3722
|
+
const obj_imageUrl = obj.imageUrl;
|
|
3723
|
+
const path_imageUrl = path + '.imageUrl';
|
|
3724
|
+
if (typeof obj_imageUrl !== 'string') {
|
|
3725
|
+
return new TypeError('Expected "string" but received "' + typeof obj_imageUrl + '" (at "' + path_imageUrl + '")');
|
|
3726
|
+
}
|
|
3727
|
+
const obj_isCompleted = obj.isCompleted;
|
|
3728
|
+
const path_isCompleted = path + '.isCompleted';
|
|
3729
|
+
if (typeof obj_isCompleted !== 'boolean') {
|
|
3730
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isCompleted + '" (at "' + path_isCompleted + '")');
|
|
3731
|
+
}
|
|
3732
|
+
const obj_isCuratedContent = obj.isCuratedContent;
|
|
3733
|
+
const path_isCuratedContent = path + '.isCuratedContent';
|
|
3734
|
+
if (typeof obj_isCuratedContent !== 'boolean') {
|
|
3735
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isCuratedContent + '" (at "' + path_isCuratedContent + '")');
|
|
3736
|
+
}
|
|
3737
|
+
const obj_itemCount = obj.itemCount;
|
|
3738
|
+
const path_itemCount = path + '.itemCount';
|
|
3739
|
+
let obj_itemCount_union0 = null;
|
|
3740
|
+
const obj_itemCount_union0_error = (() => {
|
|
3741
|
+
if (typeof obj_itemCount !== 'number' || (typeof obj_itemCount === 'number' && Math.floor(obj_itemCount) !== obj_itemCount)) {
|
|
3742
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_itemCount + '" (at "' + path_itemCount + '")');
|
|
3743
|
+
}
|
|
3744
|
+
})();
|
|
3745
|
+
if (obj_itemCount_union0_error != null) {
|
|
3746
|
+
obj_itemCount_union0 = obj_itemCount_union0_error.message;
|
|
3747
|
+
}
|
|
3748
|
+
let obj_itemCount_union1 = null;
|
|
3749
|
+
const obj_itemCount_union1_error = (() => {
|
|
3750
|
+
if (obj_itemCount !== null) {
|
|
3751
|
+
return new TypeError('Expected "null" but received "' + typeof obj_itemCount + '" (at "' + path_itemCount + '")');
|
|
3752
|
+
}
|
|
3753
|
+
})();
|
|
3754
|
+
if (obj_itemCount_union1_error != null) {
|
|
3755
|
+
obj_itemCount_union1 = obj_itemCount_union1_error.message;
|
|
3756
|
+
}
|
|
3757
|
+
if (obj_itemCount_union0 && obj_itemCount_union1) {
|
|
3758
|
+
let message = 'Object doesn\'t match union (at "' + path_itemCount + '")';
|
|
3759
|
+
message += '\n' + obj_itemCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
3760
|
+
message += '\n' + obj_itemCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
3761
|
+
return new TypeError(message);
|
|
3762
|
+
}
|
|
3763
|
+
const obj_moduleUnits = obj.moduleUnits;
|
|
3764
|
+
const path_moduleUnits = path + '.moduleUnits';
|
|
3765
|
+
if (!ArrayIsArray(obj_moduleUnits)) {
|
|
3766
|
+
return new TypeError('Expected "array" but received "' + typeof obj_moduleUnits + '" (at "' + path_moduleUnits + '")');
|
|
3767
|
+
}
|
|
3768
|
+
for (let i = 0; i < obj_moduleUnits.length; i++) {
|
|
3769
|
+
const obj_moduleUnits_item = obj_moduleUnits[i];
|
|
3770
|
+
const path_moduleUnits_item = path_moduleUnits + '[' + i + ']';
|
|
3771
|
+
const referencepath_moduleUnits_itemValidationError = validate$5(obj_moduleUnits_item, path_moduleUnits_item);
|
|
3772
|
+
if (referencepath_moduleUnits_itemValidationError !== null) {
|
|
3773
|
+
let message = 'Object doesn\'t match TrailheadModuleUnitRepresentation (at "' + path_moduleUnits_item + '")\n';
|
|
3774
|
+
message += referencepath_moduleUnits_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
3775
|
+
return new TypeError(message);
|
|
3776
|
+
}
|
|
3777
|
+
}
|
|
3778
|
+
const obj_relatedId = obj.relatedId;
|
|
3779
|
+
const path_relatedId = path + '.relatedId';
|
|
3780
|
+
if (typeof obj_relatedId !== 'string') {
|
|
3781
|
+
return new TypeError('Expected "string" but received "' + typeof obj_relatedId + '" (at "' + path_relatedId + '")');
|
|
3570
3782
|
}
|
|
3571
3783
|
const obj_title = obj.title;
|
|
3572
3784
|
const path_title = path + '.title';
|
|
3573
3785
|
if (typeof obj_title !== 'string') {
|
|
3574
3786
|
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
3575
3787
|
}
|
|
3788
|
+
const obj_type = obj.type;
|
|
3789
|
+
const path_type = path + '.type';
|
|
3790
|
+
if (typeof obj_type !== 'string') {
|
|
3791
|
+
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
3792
|
+
}
|
|
3576
3793
|
})();
|
|
3577
3794
|
return v_error === undefined ? null : v_error;
|
|
3578
3795
|
}
|
|
3579
|
-
const RepresentationType$2 = '
|
|
3796
|
+
const RepresentationType$2 = 'TrailheadModuleRepresentation';
|
|
3580
3797
|
function keyBuilder$8(luvio, config) {
|
|
3581
|
-
return keyPrefix + '::' + RepresentationType$2 + ':' + config.
|
|
3798
|
+
return keyPrefix + '::' + RepresentationType$2 + ':' + config.relatedId;
|
|
3582
3799
|
}
|
|
3583
3800
|
function keyBuilderFromType$2(luvio, object) {
|
|
3584
3801
|
const keyParams = {
|
|
3585
|
-
|
|
3802
|
+
relatedId: object.relatedId
|
|
3586
3803
|
};
|
|
3587
3804
|
return keyBuilder$8(luvio, keyParams);
|
|
3588
3805
|
}
|
|
3589
3806
|
function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
3590
3807
|
return input;
|
|
3591
3808
|
}
|
|
3592
|
-
const select$7 = function
|
|
3809
|
+
const select$7 = function TrailheadModuleRepresentationSelect() {
|
|
3810
|
+
const { selections: TrailheadModuleUnitRepresentation__selections, opaque: TrailheadModuleUnitRepresentation__opaque, } = select$8();
|
|
3593
3811
|
return {
|
|
3594
3812
|
kind: 'Fragment',
|
|
3595
|
-
version: VERSION$
|
|
3813
|
+
version: VERSION$3,
|
|
3596
3814
|
private: [],
|
|
3597
3815
|
selections: [
|
|
3816
|
+
{
|
|
3817
|
+
name: 'availablePointCount',
|
|
3818
|
+
kind: 'Scalar'
|
|
3819
|
+
},
|
|
3820
|
+
{
|
|
3821
|
+
name: 'completedDate',
|
|
3822
|
+
kind: 'Scalar'
|
|
3823
|
+
},
|
|
3824
|
+
{
|
|
3825
|
+
name: 'completedItemCount',
|
|
3826
|
+
kind: 'Scalar'
|
|
3827
|
+
},
|
|
3828
|
+
{
|
|
3829
|
+
name: 'completedPercent',
|
|
3830
|
+
kind: 'Scalar'
|
|
3831
|
+
},
|
|
3598
3832
|
{
|
|
3599
3833
|
name: 'description',
|
|
3600
3834
|
kind: 'Scalar'
|
|
3601
3835
|
},
|
|
3602
3836
|
{
|
|
3603
|
-
name: '
|
|
3837
|
+
name: 'durationCount',
|
|
3604
3838
|
kind: 'Scalar'
|
|
3605
3839
|
},
|
|
3606
3840
|
{
|
|
3607
|
-
name: '
|
|
3841
|
+
name: 'earnedPointCount',
|
|
3608
3842
|
kind: 'Scalar'
|
|
3609
3843
|
},
|
|
3610
3844
|
{
|
|
3611
|
-
name: '
|
|
3845
|
+
name: 'imageUrl',
|
|
3846
|
+
kind: 'Scalar'
|
|
3847
|
+
},
|
|
3848
|
+
{
|
|
3849
|
+
name: 'isCompleted',
|
|
3850
|
+
kind: 'Scalar'
|
|
3851
|
+
},
|
|
3852
|
+
{
|
|
3853
|
+
name: 'isCuratedContent',
|
|
3854
|
+
kind: 'Scalar'
|
|
3855
|
+
},
|
|
3856
|
+
{
|
|
3857
|
+
name: 'itemCount',
|
|
3858
|
+
kind: 'Scalar'
|
|
3859
|
+
},
|
|
3860
|
+
{
|
|
3861
|
+
name: 'moduleUnits',
|
|
3862
|
+
kind: 'Object',
|
|
3863
|
+
plural: true,
|
|
3864
|
+
selections: TrailheadModuleUnitRepresentation__selections
|
|
3865
|
+
},
|
|
3866
|
+
{
|
|
3867
|
+
name: 'relatedId',
|
|
3612
3868
|
kind: 'Scalar'
|
|
3613
3869
|
},
|
|
3614
3870
|
{
|
|
3615
3871
|
name: 'title',
|
|
3616
3872
|
kind: 'Scalar'
|
|
3873
|
+
},
|
|
3874
|
+
{
|
|
3875
|
+
name: 'type',
|
|
3876
|
+
kind: 'Scalar'
|
|
3617
3877
|
}
|
|
3618
3878
|
]
|
|
3619
3879
|
};
|
|
3620
3880
|
};
|
|
3621
|
-
function equals$
|
|
3622
|
-
const
|
|
3623
|
-
const
|
|
3624
|
-
if (!(
|
|
3881
|
+
function equals$3(existing, incoming) {
|
|
3882
|
+
const existing_isCompleted = existing.isCompleted;
|
|
3883
|
+
const incoming_isCompleted = incoming.isCompleted;
|
|
3884
|
+
if (!(existing_isCompleted === incoming_isCompleted)) {
|
|
3885
|
+
return false;
|
|
3886
|
+
}
|
|
3887
|
+
const existing_isCuratedContent = existing.isCuratedContent;
|
|
3888
|
+
const incoming_isCuratedContent = incoming.isCuratedContent;
|
|
3889
|
+
if (!(existing_isCuratedContent === incoming_isCuratedContent)) {
|
|
3890
|
+
return false;
|
|
3891
|
+
}
|
|
3892
|
+
const existing_availablePointCount = existing.availablePointCount;
|
|
3893
|
+
const incoming_availablePointCount = incoming.availablePointCount;
|
|
3894
|
+
if (!(existing_availablePointCount === incoming_availablePointCount)) {
|
|
3895
|
+
return false;
|
|
3896
|
+
}
|
|
3897
|
+
const existing_durationCount = existing.durationCount;
|
|
3898
|
+
const incoming_durationCount = incoming.durationCount;
|
|
3899
|
+
if (!(existing_durationCount === incoming_durationCount)) {
|
|
3625
3900
|
return false;
|
|
3626
3901
|
}
|
|
3627
3902
|
const existing_description = existing.description;
|
|
@@ -3629,24 +3904,64 @@ function equals$4(existing, incoming) {
|
|
|
3629
3904
|
if (!(existing_description === incoming_description)) {
|
|
3630
3905
|
return false;
|
|
3631
3906
|
}
|
|
3632
|
-
const
|
|
3633
|
-
const
|
|
3634
|
-
if (!(
|
|
3907
|
+
const existing_imageUrl = existing.imageUrl;
|
|
3908
|
+
const incoming_imageUrl = incoming.imageUrl;
|
|
3909
|
+
if (!(existing_imageUrl === incoming_imageUrl)) {
|
|
3635
3910
|
return false;
|
|
3636
3911
|
}
|
|
3637
|
-
const
|
|
3638
|
-
const
|
|
3639
|
-
if (!(
|
|
3912
|
+
const existing_relatedId = existing.relatedId;
|
|
3913
|
+
const incoming_relatedId = incoming.relatedId;
|
|
3914
|
+
if (!(existing_relatedId === incoming_relatedId)) {
|
|
3915
|
+
return false;
|
|
3916
|
+
}
|
|
3917
|
+
const existing_title = existing.title;
|
|
3918
|
+
const incoming_title = incoming.title;
|
|
3919
|
+
if (!(existing_title === incoming_title)) {
|
|
3920
|
+
return false;
|
|
3921
|
+
}
|
|
3922
|
+
const existing_type = existing.type;
|
|
3923
|
+
const incoming_type = incoming.type;
|
|
3924
|
+
if (!(existing_type === incoming_type)) {
|
|
3925
|
+
return false;
|
|
3926
|
+
}
|
|
3927
|
+
const existing_completedDate = existing.completedDate;
|
|
3928
|
+
const incoming_completedDate = incoming.completedDate;
|
|
3929
|
+
if (!(existing_completedDate === incoming_completedDate)) {
|
|
3930
|
+
return false;
|
|
3931
|
+
}
|
|
3932
|
+
const existing_completedItemCount = existing.completedItemCount;
|
|
3933
|
+
const incoming_completedItemCount = incoming.completedItemCount;
|
|
3934
|
+
if (!(existing_completedItemCount === incoming_completedItemCount)) {
|
|
3935
|
+
return false;
|
|
3936
|
+
}
|
|
3937
|
+
const existing_completedPercent = existing.completedPercent;
|
|
3938
|
+
const incoming_completedPercent = incoming.completedPercent;
|
|
3939
|
+
if (!(existing_completedPercent === incoming_completedPercent)) {
|
|
3940
|
+
return false;
|
|
3941
|
+
}
|
|
3942
|
+
const existing_earnedPointCount = existing.earnedPointCount;
|
|
3943
|
+
const incoming_earnedPointCount = incoming.earnedPointCount;
|
|
3944
|
+
if (!(existing_earnedPointCount === incoming_earnedPointCount)) {
|
|
3945
|
+
return false;
|
|
3946
|
+
}
|
|
3947
|
+
const existing_itemCount = existing.itemCount;
|
|
3948
|
+
const incoming_itemCount = incoming.itemCount;
|
|
3949
|
+
if (!(existing_itemCount === incoming_itemCount)) {
|
|
3640
3950
|
return false;
|
|
3641
3951
|
}
|
|
3642
|
-
const
|
|
3643
|
-
const
|
|
3644
|
-
|
|
3952
|
+
const existing_moduleUnits = existing.moduleUnits;
|
|
3953
|
+
const incoming_moduleUnits = incoming.moduleUnits;
|
|
3954
|
+
const equals_moduleUnits_items = equalsArray(existing_moduleUnits, incoming_moduleUnits, (existing_moduleUnits_item, incoming_moduleUnits_item) => {
|
|
3955
|
+
if (!(equals$4(existing_moduleUnits_item, incoming_moduleUnits_item))) {
|
|
3956
|
+
return false;
|
|
3957
|
+
}
|
|
3958
|
+
});
|
|
3959
|
+
if (equals_moduleUnits_items === false) {
|
|
3645
3960
|
return false;
|
|
3646
3961
|
}
|
|
3647
3962
|
return true;
|
|
3648
3963
|
}
|
|
3649
|
-
const ingest$2 = function
|
|
3964
|
+
const ingest$2 = function TrailheadModuleRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
3650
3965
|
if (process.env.NODE_ENV !== 'production') {
|
|
3651
3966
|
const validateError = validate$4(input);
|
|
3652
3967
|
if (validateError !== null) {
|
|
@@ -3655,7 +3970,7 @@ const ingest$2 = function LearningPracticeRepresentationIngest(input, path, luvi
|
|
|
3655
3970
|
}
|
|
3656
3971
|
const key = keyBuilderFromType$2(luvio, input);
|
|
3657
3972
|
const ttlToUse = TTL$2;
|
|
3658
|
-
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "LearningContentPlatform", VERSION$
|
|
3973
|
+
ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "LearningContentPlatform", VERSION$3, RepresentationType$2, equals$3);
|
|
3659
3974
|
return createLink(key);
|
|
3660
3975
|
};
|
|
3661
3976
|
function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
|
|
@@ -3673,13 +3988,13 @@ function select$6(luvio, params) {
|
|
|
3673
3988
|
}
|
|
3674
3989
|
function keyBuilder$7(luvio, params) {
|
|
3675
3990
|
return keyBuilder$8(luvio, {
|
|
3676
|
-
|
|
3991
|
+
relatedId: params.urlParams.moduleId
|
|
3677
3992
|
});
|
|
3678
3993
|
}
|
|
3679
|
-
function getResponseCacheKeys$
|
|
3994
|
+
function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
|
|
3680
3995
|
getTypeCacheKeys$2(storeKeyMap, luvio, response);
|
|
3681
3996
|
}
|
|
3682
|
-
function ingestSuccess$
|
|
3997
|
+
function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
|
|
3683
3998
|
const { body } = response;
|
|
3684
3999
|
const key = keyBuilder$7(luvio, resourceParams);
|
|
3685
4000
|
luvio.storeIngest(key, ingest$2, body);
|
|
@@ -3702,17 +4017,17 @@ function ingestError$2(luvio, params, error, snapshotRefresh) {
|
|
|
3702
4017
|
const storeMetadataParams = {
|
|
3703
4018
|
ttl: TTL$2,
|
|
3704
4019
|
namespace: keyPrefix,
|
|
3705
|
-
version: VERSION$
|
|
4020
|
+
version: VERSION$3,
|
|
3706
4021
|
representationName: RepresentationType$2
|
|
3707
4022
|
};
|
|
3708
4023
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
3709
4024
|
return errorSnapshot;
|
|
3710
4025
|
}
|
|
3711
|
-
function createResourceRequest$
|
|
4026
|
+
function createResourceRequest$3(config) {
|
|
3712
4027
|
const headers = {};
|
|
3713
4028
|
return {
|
|
3714
4029
|
baseUri: '/services/data/v60.0',
|
|
3715
|
-
basePath: '/learning-content-platform/learning/
|
|
4030
|
+
basePath: '/learning-content-platform/learning/module/' + config.urlParams.moduleId + '',
|
|
3716
4031
|
method: 'get',
|
|
3717
4032
|
body: null,
|
|
3718
4033
|
urlParams: config.urlParams,
|
|
@@ -3725,64 +4040,64 @@ function createResourceRequestFromRepresentation$2(representation) {
|
|
|
3725
4040
|
const config = {
|
|
3726
4041
|
urlParams: {},
|
|
3727
4042
|
};
|
|
3728
|
-
config.urlParams.
|
|
3729
|
-
return createResourceRequest$
|
|
4043
|
+
config.urlParams.moduleId = representation.relatedId;
|
|
4044
|
+
return createResourceRequest$3(config);
|
|
3730
4045
|
}
|
|
3731
4046
|
|
|
3732
|
-
const adapterName$
|
|
3733
|
-
const
|
|
3734
|
-
generateParamConfigMetadata('
|
|
4047
|
+
const adapterName$3 = 'getModule';
|
|
4048
|
+
const getModule_ConfigPropertyMetadata = [
|
|
4049
|
+
generateParamConfigMetadata('moduleId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
3735
4050
|
];
|
|
3736
|
-
const
|
|
3737
|
-
const createResourceParams$
|
|
4051
|
+
const getModule_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getModule_ConfigPropertyMetadata);
|
|
4052
|
+
const createResourceParams$3 = /*#__PURE__*/ createResourceParams$a(getModule_ConfigPropertyMetadata);
|
|
3738
4053
|
function keyBuilder$6(luvio, config) {
|
|
3739
|
-
const resourceParams = createResourceParams$
|
|
4054
|
+
const resourceParams = createResourceParams$3(config);
|
|
3740
4055
|
return keyBuilder$7(luvio, resourceParams);
|
|
3741
4056
|
}
|
|
3742
|
-
function typeCheckConfig$
|
|
4057
|
+
function typeCheckConfig$3(untrustedConfig) {
|
|
3743
4058
|
const config = {};
|
|
3744
|
-
typeCheckConfig$a(untrustedConfig, config,
|
|
4059
|
+
typeCheckConfig$a(untrustedConfig, config, getModule_ConfigPropertyMetadata);
|
|
3745
4060
|
return config;
|
|
3746
4061
|
}
|
|
3747
|
-
function validateAdapterConfig$
|
|
4062
|
+
function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
|
|
3748
4063
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
3749
4064
|
return null;
|
|
3750
4065
|
}
|
|
3751
4066
|
if (process.env.NODE_ENV !== 'production') {
|
|
3752
4067
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
3753
4068
|
}
|
|
3754
|
-
const config = typeCheckConfig$
|
|
4069
|
+
const config = typeCheckConfig$3(untrustedConfig);
|
|
3755
4070
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
3756
4071
|
return null;
|
|
3757
4072
|
}
|
|
3758
4073
|
return config;
|
|
3759
4074
|
}
|
|
3760
4075
|
function adapterFragment$2(luvio, config) {
|
|
3761
|
-
createResourceParams$
|
|
4076
|
+
createResourceParams$3(config);
|
|
3762
4077
|
return select$6();
|
|
3763
4078
|
}
|
|
3764
4079
|
function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
|
|
3765
|
-
const snapshot = ingestSuccess$
|
|
4080
|
+
const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
|
|
3766
4081
|
config,
|
|
3767
|
-
resolve: () => buildNetworkSnapshot$
|
|
4082
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
3768
4083
|
});
|
|
3769
4084
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
3770
4085
|
}
|
|
3771
4086
|
function onFetchResponseError$2(luvio, config, resourceParams, response) {
|
|
3772
4087
|
const snapshot = ingestError$2(luvio, resourceParams, response, {
|
|
3773
4088
|
config,
|
|
3774
|
-
resolve: () => buildNetworkSnapshot$
|
|
4089
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
3775
4090
|
});
|
|
3776
4091
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
3777
4092
|
}
|
|
3778
|
-
function buildNetworkSnapshot$
|
|
3779
|
-
const resourceParams = createResourceParams$
|
|
3780
|
-
const request = createResourceRequest$
|
|
4093
|
+
function buildNetworkSnapshot$3(luvio, config, options) {
|
|
4094
|
+
const resourceParams = createResourceParams$3(config);
|
|
4095
|
+
const request = createResourceRequest$3(resourceParams);
|
|
3781
4096
|
return luvio.dispatchResourceRequest(request, options)
|
|
3782
4097
|
.then((response) => {
|
|
3783
4098
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
|
|
3784
4099
|
const cache = new StoreKeyMap();
|
|
3785
|
-
getResponseCacheKeys$
|
|
4100
|
+
getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
|
|
3786
4101
|
return cache;
|
|
3787
4102
|
});
|
|
3788
4103
|
}, (response) => {
|
|
@@ -3790,7 +4105,7 @@ function buildNetworkSnapshot$2(luvio, config, options) {
|
|
|
3790
4105
|
});
|
|
3791
4106
|
}
|
|
3792
4107
|
function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
|
|
3793
|
-
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$
|
|
4108
|
+
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
|
|
3794
4109
|
}
|
|
3795
4110
|
function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
3796
4111
|
const { luvio, config } = context;
|
|
@@ -3801,12 +4116,12 @@ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
|
|
|
3801
4116
|
};
|
|
3802
4117
|
const cacheSnapshot = storeLookup(selector, {
|
|
3803
4118
|
config,
|
|
3804
|
-
resolve: () => buildNetworkSnapshot$
|
|
4119
|
+
resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
|
|
3805
4120
|
});
|
|
3806
4121
|
return cacheSnapshot;
|
|
3807
4122
|
}
|
|
3808
|
-
const
|
|
3809
|
-
const config = validateAdapterConfig$
|
|
4123
|
+
const getModuleAdapterFactory = (luvio) => function LearningContentPlatform__getModule(untrustedConfig, requestContext) {
|
|
4124
|
+
const config = validateAdapterConfig$3(untrustedConfig, getModule_ConfigPropertyNames);
|
|
3810
4125
|
// Invalid or incomplete config
|
|
3811
4126
|
if (config === null) {
|
|
3812
4127
|
return null;
|
|
@@ -3815,506 +4130,121 @@ const getLearningPracticeAdapterFactory = (luvio) => function LearningContentPla
|
|
|
3815
4130
|
buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
|
|
3816
4131
|
};
|
|
3817
4132
|
const notifyChangeFactory$2 = (luvio, options) => {
|
|
3818
|
-
return function
|
|
4133
|
+
return function getLearningContentPlatformLearningModuleByModuleIdNotifyChange(configs) {
|
|
3819
4134
|
const keys = configs.map(c => keyBuilder$8(luvio, c));
|
|
3820
4135
|
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
3821
|
-
for (let i = 0, len = entries.length; i < len; i++) {
|
|
3822
|
-
const { key, record: val } = entries[i];
|
|
3823
|
-
const refreshRequest = createResourceRequestFromRepresentation$2(val);
|
|
3824
|
-
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
3825
|
-
.then((response) => {
|
|
3826
|
-
return luvio.handleSuccessResponse(() => {
|
|
3827
|
-
const { body } = response;
|
|
3828
|
-
luvio.storeIngest(key, ingest$2, body);
|
|
3829
|
-
return luvio.storeBroadcast();
|
|
3830
|
-
}, () => {
|
|
3831
|
-
const cache = new StoreKeyMap();
|
|
3832
|
-
getTypeCacheKeys$2(cache, luvio, response.body);
|
|
3833
|
-
return cache;
|
|
3834
|
-
});
|
|
3835
|
-
}, (error) => {
|
|
3836
|
-
return luvio.handleErrorResponse(() => {
|
|
3837
|
-
const errorSnapshot = luvio.errorSnapshot(error);
|
|
3838
|
-
luvio.storeIngestError(key, errorSnapshot, {
|
|
3839
|
-
ttl: TTL$2,
|
|
3840
|
-
namespace: keyPrefix,
|
|
3841
|
-
version: VERSION$
|
|
3842
|
-
representationName: RepresentationType$2
|
|
3843
|
-
});
|
|
3844
|
-
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
3845
|
-
});
|
|
3846
|
-
});
|
|
3847
|
-
}
|
|
3848
|
-
});
|
|
3849
|
-
};
|
|
3850
|
-
};
|
|
3851
|
-
|
|
3852
|
-
const VERSION$3 = "19c9bcb401bf39a211caeff8b3cde304";
|
|
3853
|
-
function validate$3(obj, path = 'TrailheadModuleUnitRepresentation') {
|
|
3854
|
-
const v_error = (() => {
|
|
3855
|
-
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
3856
|
-
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
3857
|
-
}
|
|
3858
|
-
const obj_completedDate = obj.completedDate;
|
|
3859
|
-
const path_completedDate = path + '.completedDate';
|
|
3860
|
-
let obj_completedDate_union0 = null;
|
|
3861
|
-
const obj_completedDate_union0_error = (() => {
|
|
3862
|
-
if (typeof obj_completedDate !== 'string') {
|
|
3863
|
-
return new TypeError('Expected "string" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
|
|
3864
|
-
}
|
|
3865
|
-
})();
|
|
3866
|
-
if (obj_completedDate_union0_error != null) {
|
|
3867
|
-
obj_completedDate_union0 = obj_completedDate_union0_error.message;
|
|
3868
|
-
}
|
|
3869
|
-
let obj_completedDate_union1 = null;
|
|
3870
|
-
const obj_completedDate_union1_error = (() => {
|
|
3871
|
-
if (obj_completedDate !== null) {
|
|
3872
|
-
return new TypeError('Expected "null" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
|
|
3873
|
-
}
|
|
3874
|
-
})();
|
|
3875
|
-
if (obj_completedDate_union1_error != null) {
|
|
3876
|
-
obj_completedDate_union1 = obj_completedDate_union1_error.message;
|
|
3877
|
-
}
|
|
3878
|
-
if (obj_completedDate_union0 && obj_completedDate_union1) {
|
|
3879
|
-
let message = 'Object doesn\'t match union (at "' + path_completedDate + '")';
|
|
3880
|
-
message += '\n' + obj_completedDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
3881
|
-
message += '\n' + obj_completedDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
3882
|
-
return new TypeError(message);
|
|
3883
|
-
}
|
|
3884
|
-
const obj_contentUrl = obj.contentUrl;
|
|
3885
|
-
const path_contentUrl = path + '.contentUrl';
|
|
3886
|
-
if (typeof obj_contentUrl !== 'string') {
|
|
3887
|
-
return new TypeError('Expected "string" but received "' + typeof obj_contentUrl + '" (at "' + path_contentUrl + '")');
|
|
3888
|
-
}
|
|
3889
|
-
const obj_durationCount = obj.durationCount;
|
|
3890
|
-
const path_durationCount = path + '.durationCount';
|
|
3891
|
-
if (typeof obj_durationCount !== 'number' || (typeof obj_durationCount === 'number' && Math.floor(obj_durationCount) !== obj_durationCount)) {
|
|
3892
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_durationCount + '" (at "' + path_durationCount + '")');
|
|
3893
|
-
}
|
|
3894
|
-
const obj_earnedPointCount = obj.earnedPointCount;
|
|
3895
|
-
const path_earnedPointCount = path + '.earnedPointCount';
|
|
3896
|
-
let obj_earnedPointCount_union0 = null;
|
|
3897
|
-
const obj_earnedPointCount_union0_error = (() => {
|
|
3898
|
-
if (typeof obj_earnedPointCount !== 'number' || (typeof obj_earnedPointCount === 'number' && Math.floor(obj_earnedPointCount) !== obj_earnedPointCount)) {
|
|
3899
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_earnedPointCount + '" (at "' + path_earnedPointCount + '")');
|
|
3900
|
-
}
|
|
3901
|
-
})();
|
|
3902
|
-
if (obj_earnedPointCount_union0_error != null) {
|
|
3903
|
-
obj_earnedPointCount_union0 = obj_earnedPointCount_union0_error.message;
|
|
3904
|
-
}
|
|
3905
|
-
let obj_earnedPointCount_union1 = null;
|
|
3906
|
-
const obj_earnedPointCount_union1_error = (() => {
|
|
3907
|
-
if (obj_earnedPointCount !== null) {
|
|
3908
|
-
return new TypeError('Expected "null" but received "' + typeof obj_earnedPointCount + '" (at "' + path_earnedPointCount + '")');
|
|
3909
|
-
}
|
|
3910
|
-
})();
|
|
3911
|
-
if (obj_earnedPointCount_union1_error != null) {
|
|
3912
|
-
obj_earnedPointCount_union1 = obj_earnedPointCount_union1_error.message;
|
|
3913
|
-
}
|
|
3914
|
-
if (obj_earnedPointCount_union0 && obj_earnedPointCount_union1) {
|
|
3915
|
-
let message = 'Object doesn\'t match union (at "' + path_earnedPointCount + '")';
|
|
3916
|
-
message += '\n' + obj_earnedPointCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
3917
|
-
message += '\n' + obj_earnedPointCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
3918
|
-
return new TypeError(message);
|
|
3919
|
-
}
|
|
3920
|
-
const obj_id = obj.id;
|
|
3921
|
-
const path_id = path + '.id';
|
|
3922
|
-
if (typeof obj_id !== 'string') {
|
|
3923
|
-
return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
|
|
3924
|
-
}
|
|
3925
|
-
const obj_title = obj.title;
|
|
3926
|
-
const path_title = path + '.title';
|
|
3927
|
-
if (typeof obj_title !== 'string') {
|
|
3928
|
-
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
3929
|
-
}
|
|
3930
|
-
const obj_trustedFrameOrigin = obj.trustedFrameOrigin;
|
|
3931
|
-
const path_trustedFrameOrigin = path + '.trustedFrameOrigin';
|
|
3932
|
-
if (typeof obj_trustedFrameOrigin !== 'string') {
|
|
3933
|
-
return new TypeError('Expected "string" but received "' + typeof obj_trustedFrameOrigin + '" (at "' + path_trustedFrameOrigin + '")');
|
|
3934
|
-
}
|
|
3935
|
-
})();
|
|
3936
|
-
return v_error === undefined ? null : v_error;
|
|
3937
|
-
}
|
|
3938
|
-
const select$5 = function TrailheadModuleUnitRepresentationSelect() {
|
|
3939
|
-
return {
|
|
3940
|
-
kind: 'Fragment',
|
|
3941
|
-
version: VERSION$3,
|
|
3942
|
-
private: [],
|
|
3943
|
-
selections: [
|
|
3944
|
-
{
|
|
3945
|
-
name: 'completedDate',
|
|
3946
|
-
kind: 'Scalar'
|
|
3947
|
-
},
|
|
3948
|
-
{
|
|
3949
|
-
name: 'contentUrl',
|
|
3950
|
-
kind: 'Scalar'
|
|
3951
|
-
},
|
|
3952
|
-
{
|
|
3953
|
-
name: 'durationCount',
|
|
3954
|
-
kind: 'Scalar'
|
|
3955
|
-
},
|
|
3956
|
-
{
|
|
3957
|
-
name: 'earnedPointCount',
|
|
3958
|
-
kind: 'Scalar'
|
|
3959
|
-
},
|
|
3960
|
-
{
|
|
3961
|
-
name: 'id',
|
|
3962
|
-
kind: 'Scalar'
|
|
3963
|
-
},
|
|
3964
|
-
{
|
|
3965
|
-
name: 'title',
|
|
3966
|
-
kind: 'Scalar'
|
|
3967
|
-
},
|
|
3968
|
-
{
|
|
3969
|
-
name: 'trustedFrameOrigin',
|
|
3970
|
-
kind: 'Scalar'
|
|
3971
|
-
}
|
|
3972
|
-
]
|
|
3973
|
-
};
|
|
3974
|
-
};
|
|
3975
|
-
function equals$3(existing, incoming) {
|
|
3976
|
-
const existing_durationCount = existing.durationCount;
|
|
3977
|
-
const incoming_durationCount = incoming.durationCount;
|
|
3978
|
-
if (!(existing_durationCount === incoming_durationCount)) {
|
|
3979
|
-
return false;
|
|
3980
|
-
}
|
|
3981
|
-
const existing_contentUrl = existing.contentUrl;
|
|
3982
|
-
const incoming_contentUrl = incoming.contentUrl;
|
|
3983
|
-
if (!(existing_contentUrl === incoming_contentUrl)) {
|
|
3984
|
-
return false;
|
|
3985
|
-
}
|
|
3986
|
-
const existing_id = existing.id;
|
|
3987
|
-
const incoming_id = incoming.id;
|
|
3988
|
-
if (!(existing_id === incoming_id)) {
|
|
3989
|
-
return false;
|
|
3990
|
-
}
|
|
3991
|
-
const existing_title = existing.title;
|
|
3992
|
-
const incoming_title = incoming.title;
|
|
3993
|
-
if (!(existing_title === incoming_title)) {
|
|
3994
|
-
return false;
|
|
3995
|
-
}
|
|
3996
|
-
const existing_trustedFrameOrigin = existing.trustedFrameOrigin;
|
|
3997
|
-
const incoming_trustedFrameOrigin = incoming.trustedFrameOrigin;
|
|
3998
|
-
if (!(existing_trustedFrameOrigin === incoming_trustedFrameOrigin)) {
|
|
3999
|
-
return false;
|
|
4000
|
-
}
|
|
4001
|
-
const existing_completedDate = existing.completedDate;
|
|
4002
|
-
const incoming_completedDate = incoming.completedDate;
|
|
4003
|
-
if (!(existing_completedDate === incoming_completedDate)) {
|
|
4004
|
-
return false;
|
|
4005
|
-
}
|
|
4006
|
-
const existing_earnedPointCount = existing.earnedPointCount;
|
|
4007
|
-
const incoming_earnedPointCount = incoming.earnedPointCount;
|
|
4008
|
-
if (!(existing_earnedPointCount === incoming_earnedPointCount)) {
|
|
4009
|
-
return false;
|
|
4010
|
-
}
|
|
4011
|
-
return true;
|
|
4012
|
-
}
|
|
4136
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
4137
|
+
const { key, record: val } = entries[i];
|
|
4138
|
+
const refreshRequest = createResourceRequestFromRepresentation$2(val);
|
|
4139
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
4140
|
+
.then((response) => {
|
|
4141
|
+
return luvio.handleSuccessResponse(() => {
|
|
4142
|
+
const { body } = response;
|
|
4143
|
+
luvio.storeIngest(key, ingest$2, body);
|
|
4144
|
+
return luvio.storeBroadcast();
|
|
4145
|
+
}, () => {
|
|
4146
|
+
const cache = new StoreKeyMap();
|
|
4147
|
+
getTypeCacheKeys$2(cache, luvio, response.body);
|
|
4148
|
+
return cache;
|
|
4149
|
+
});
|
|
4150
|
+
}, (error) => {
|
|
4151
|
+
return luvio.handleErrorResponse(() => {
|
|
4152
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
4153
|
+
luvio.storeIngestError(key, errorSnapshot, {
|
|
4154
|
+
ttl: TTL$2,
|
|
4155
|
+
namespace: keyPrefix,
|
|
4156
|
+
version: VERSION$3,
|
|
4157
|
+
representationName: RepresentationType$2
|
|
4158
|
+
});
|
|
4159
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
4160
|
+
});
|
|
4161
|
+
});
|
|
4162
|
+
}
|
|
4163
|
+
});
|
|
4164
|
+
};
|
|
4165
|
+
};
|
|
4013
4166
|
|
|
4014
|
-
const TTL$1 =
|
|
4015
|
-
const VERSION$2 = "
|
|
4016
|
-
function validate$
|
|
4167
|
+
const TTL$1 = 60000;
|
|
4168
|
+
const VERSION$2 = "44b044bb4e3eff4d2c834cdb80b9a043";
|
|
4169
|
+
function validate$3(obj, path = 'LearningPracticeRepresentation') {
|
|
4017
4170
|
const v_error = (() => {
|
|
4018
4171
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4019
4172
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4020
4173
|
}
|
|
4021
|
-
const obj_availablePointCount = obj.availablePointCount;
|
|
4022
|
-
const path_availablePointCount = path + '.availablePointCount';
|
|
4023
|
-
if (typeof obj_availablePointCount !== 'number' || (typeof obj_availablePointCount === 'number' && Math.floor(obj_availablePointCount) !== obj_availablePointCount)) {
|
|
4024
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_availablePointCount + '" (at "' + path_availablePointCount + '")');
|
|
4025
|
-
}
|
|
4026
|
-
const obj_completedDate = obj.completedDate;
|
|
4027
|
-
const path_completedDate = path + '.completedDate';
|
|
4028
|
-
let obj_completedDate_union0 = null;
|
|
4029
|
-
const obj_completedDate_union0_error = (() => {
|
|
4030
|
-
if (typeof obj_completedDate !== 'string') {
|
|
4031
|
-
return new TypeError('Expected "string" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
|
|
4032
|
-
}
|
|
4033
|
-
})();
|
|
4034
|
-
if (obj_completedDate_union0_error != null) {
|
|
4035
|
-
obj_completedDate_union0 = obj_completedDate_union0_error.message;
|
|
4036
|
-
}
|
|
4037
|
-
let obj_completedDate_union1 = null;
|
|
4038
|
-
const obj_completedDate_union1_error = (() => {
|
|
4039
|
-
if (obj_completedDate !== null) {
|
|
4040
|
-
return new TypeError('Expected "null" but received "' + typeof obj_completedDate + '" (at "' + path_completedDate + '")');
|
|
4041
|
-
}
|
|
4042
|
-
})();
|
|
4043
|
-
if (obj_completedDate_union1_error != null) {
|
|
4044
|
-
obj_completedDate_union1 = obj_completedDate_union1_error.message;
|
|
4045
|
-
}
|
|
4046
|
-
if (obj_completedDate_union0 && obj_completedDate_union1) {
|
|
4047
|
-
let message = 'Object doesn\'t match union (at "' + path_completedDate + '")';
|
|
4048
|
-
message += '\n' + obj_completedDate_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
4049
|
-
message += '\n' + obj_completedDate_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
4050
|
-
return new TypeError(message);
|
|
4051
|
-
}
|
|
4052
|
-
const obj_completedItemCount = obj.completedItemCount;
|
|
4053
|
-
const path_completedItemCount = path + '.completedItemCount';
|
|
4054
|
-
let obj_completedItemCount_union0 = null;
|
|
4055
|
-
const obj_completedItemCount_union0_error = (() => {
|
|
4056
|
-
if (typeof obj_completedItemCount !== 'number' || (typeof obj_completedItemCount === 'number' && Math.floor(obj_completedItemCount) !== obj_completedItemCount)) {
|
|
4057
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_completedItemCount + '" (at "' + path_completedItemCount + '")');
|
|
4058
|
-
}
|
|
4059
|
-
})();
|
|
4060
|
-
if (obj_completedItemCount_union0_error != null) {
|
|
4061
|
-
obj_completedItemCount_union0 = obj_completedItemCount_union0_error.message;
|
|
4062
|
-
}
|
|
4063
|
-
let obj_completedItemCount_union1 = null;
|
|
4064
|
-
const obj_completedItemCount_union1_error = (() => {
|
|
4065
|
-
if (obj_completedItemCount !== null) {
|
|
4066
|
-
return new TypeError('Expected "null" but received "' + typeof obj_completedItemCount + '" (at "' + path_completedItemCount + '")');
|
|
4067
|
-
}
|
|
4068
|
-
})();
|
|
4069
|
-
if (obj_completedItemCount_union1_error != null) {
|
|
4070
|
-
obj_completedItemCount_union1 = obj_completedItemCount_union1_error.message;
|
|
4071
|
-
}
|
|
4072
|
-
if (obj_completedItemCount_union0 && obj_completedItemCount_union1) {
|
|
4073
|
-
let message = 'Object doesn\'t match union (at "' + path_completedItemCount + '")';
|
|
4074
|
-
message += '\n' + obj_completedItemCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
4075
|
-
message += '\n' + obj_completedItemCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
4076
|
-
return new TypeError(message);
|
|
4077
|
-
}
|
|
4078
|
-
const obj_completedPercent = obj.completedPercent;
|
|
4079
|
-
const path_completedPercent = path + '.completedPercent';
|
|
4080
|
-
let obj_completedPercent_union0 = null;
|
|
4081
|
-
const obj_completedPercent_union0_error = (() => {
|
|
4082
|
-
if (typeof obj_completedPercent !== 'number' || (typeof obj_completedPercent === 'number' && Math.floor(obj_completedPercent) !== obj_completedPercent)) {
|
|
4083
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_completedPercent + '" (at "' + path_completedPercent + '")');
|
|
4084
|
-
}
|
|
4085
|
-
})();
|
|
4086
|
-
if (obj_completedPercent_union0_error != null) {
|
|
4087
|
-
obj_completedPercent_union0 = obj_completedPercent_union0_error.message;
|
|
4088
|
-
}
|
|
4089
|
-
let obj_completedPercent_union1 = null;
|
|
4090
|
-
const obj_completedPercent_union1_error = (() => {
|
|
4091
|
-
if (obj_completedPercent !== null) {
|
|
4092
|
-
return new TypeError('Expected "null" but received "' + typeof obj_completedPercent + '" (at "' + path_completedPercent + '")');
|
|
4093
|
-
}
|
|
4094
|
-
})();
|
|
4095
|
-
if (obj_completedPercent_union1_error != null) {
|
|
4096
|
-
obj_completedPercent_union1 = obj_completedPercent_union1_error.message;
|
|
4097
|
-
}
|
|
4098
|
-
if (obj_completedPercent_union0 && obj_completedPercent_union1) {
|
|
4099
|
-
let message = 'Object doesn\'t match union (at "' + path_completedPercent + '")';
|
|
4100
|
-
message += '\n' + obj_completedPercent_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
4101
|
-
message += '\n' + obj_completedPercent_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
4102
|
-
return new TypeError(message);
|
|
4103
|
-
}
|
|
4104
4174
|
const obj_description = obj.description;
|
|
4105
4175
|
const path_description = path + '.description';
|
|
4106
4176
|
if (typeof obj_description !== 'string') {
|
|
4107
4177
|
return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
|
|
4108
4178
|
}
|
|
4109
|
-
const
|
|
4110
|
-
const
|
|
4111
|
-
if (typeof
|
|
4112
|
-
return new TypeError('Expected "
|
|
4113
|
-
}
|
|
4114
|
-
const obj_earnedPointCount = obj.earnedPointCount;
|
|
4115
|
-
const path_earnedPointCount = path + '.earnedPointCount';
|
|
4116
|
-
let obj_earnedPointCount_union0 = null;
|
|
4117
|
-
const obj_earnedPointCount_union0_error = (() => {
|
|
4118
|
-
if (typeof obj_earnedPointCount !== 'number' || (typeof obj_earnedPointCount === 'number' && Math.floor(obj_earnedPointCount) !== obj_earnedPointCount)) {
|
|
4119
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_earnedPointCount + '" (at "' + path_earnedPointCount + '")');
|
|
4120
|
-
}
|
|
4121
|
-
})();
|
|
4122
|
-
if (obj_earnedPointCount_union0_error != null) {
|
|
4123
|
-
obj_earnedPointCount_union0 = obj_earnedPointCount_union0_error.message;
|
|
4124
|
-
}
|
|
4125
|
-
let obj_earnedPointCount_union1 = null;
|
|
4126
|
-
const obj_earnedPointCount_union1_error = (() => {
|
|
4127
|
-
if (obj_earnedPointCount !== null) {
|
|
4128
|
-
return new TypeError('Expected "null" but received "' + typeof obj_earnedPointCount + '" (at "' + path_earnedPointCount + '")');
|
|
4129
|
-
}
|
|
4130
|
-
})();
|
|
4131
|
-
if (obj_earnedPointCount_union1_error != null) {
|
|
4132
|
-
obj_earnedPointCount_union1 = obj_earnedPointCount_union1_error.message;
|
|
4133
|
-
}
|
|
4134
|
-
if (obj_earnedPointCount_union0 && obj_earnedPointCount_union1) {
|
|
4135
|
-
let message = 'Object doesn\'t match union (at "' + path_earnedPointCount + '")';
|
|
4136
|
-
message += '\n' + obj_earnedPointCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
4137
|
-
message += '\n' + obj_earnedPointCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
4138
|
-
return new TypeError(message);
|
|
4139
|
-
}
|
|
4140
|
-
const obj_imageUrl = obj.imageUrl;
|
|
4141
|
-
const path_imageUrl = path + '.imageUrl';
|
|
4142
|
-
if (typeof obj_imageUrl !== 'string') {
|
|
4143
|
-
return new TypeError('Expected "string" but received "' + typeof obj_imageUrl + '" (at "' + path_imageUrl + '")');
|
|
4144
|
-
}
|
|
4145
|
-
const obj_isCompleted = obj.isCompleted;
|
|
4146
|
-
const path_isCompleted = path + '.isCompleted';
|
|
4147
|
-
if (typeof obj_isCompleted !== 'boolean') {
|
|
4148
|
-
return new TypeError('Expected "boolean" but received "' + typeof obj_isCompleted + '" (at "' + path_isCompleted + '")');
|
|
4149
|
-
}
|
|
4150
|
-
const obj_isCuratedContent = obj.isCuratedContent;
|
|
4151
|
-
const path_isCuratedContent = path + '.isCuratedContent';
|
|
4152
|
-
if (typeof obj_isCuratedContent !== 'boolean') {
|
|
4153
|
-
return new TypeError('Expected "boolean" but received "' + typeof obj_isCuratedContent + '" (at "' + path_isCuratedContent + '")');
|
|
4154
|
-
}
|
|
4155
|
-
const obj_itemCount = obj.itemCount;
|
|
4156
|
-
const path_itemCount = path + '.itemCount';
|
|
4157
|
-
let obj_itemCount_union0 = null;
|
|
4158
|
-
const obj_itemCount_union0_error = (() => {
|
|
4159
|
-
if (typeof obj_itemCount !== 'number' || (typeof obj_itemCount === 'number' && Math.floor(obj_itemCount) !== obj_itemCount)) {
|
|
4160
|
-
return new TypeError('Expected "integer" but received "' + typeof obj_itemCount + '" (at "' + path_itemCount + '")');
|
|
4161
|
-
}
|
|
4162
|
-
})();
|
|
4163
|
-
if (obj_itemCount_union0_error != null) {
|
|
4164
|
-
obj_itemCount_union0 = obj_itemCount_union0_error.message;
|
|
4165
|
-
}
|
|
4166
|
-
let obj_itemCount_union1 = null;
|
|
4167
|
-
const obj_itemCount_union1_error = (() => {
|
|
4168
|
-
if (obj_itemCount !== null) {
|
|
4169
|
-
return new TypeError('Expected "null" but received "' + typeof obj_itemCount + '" (at "' + path_itemCount + '")');
|
|
4170
|
-
}
|
|
4171
|
-
})();
|
|
4172
|
-
if (obj_itemCount_union1_error != null) {
|
|
4173
|
-
obj_itemCount_union1 = obj_itemCount_union1_error.message;
|
|
4174
|
-
}
|
|
4175
|
-
if (obj_itemCount_union0 && obj_itemCount_union1) {
|
|
4176
|
-
let message = 'Object doesn\'t match union (at "' + path_itemCount + '")';
|
|
4177
|
-
message += '\n' + obj_itemCount_union0.split('\n').map((line) => '\t' + line).join('\n');
|
|
4178
|
-
message += '\n' + obj_itemCount_union1.split('\n').map((line) => '\t' + line).join('\n');
|
|
4179
|
-
return new TypeError(message);
|
|
4180
|
-
}
|
|
4181
|
-
const obj_moduleUnits = obj.moduleUnits;
|
|
4182
|
-
const path_moduleUnits = path + '.moduleUnits';
|
|
4183
|
-
if (!ArrayIsArray(obj_moduleUnits)) {
|
|
4184
|
-
return new TypeError('Expected "array" but received "' + typeof obj_moduleUnits + '" (at "' + path_moduleUnits + '")');
|
|
4179
|
+
const obj_learningItemId = obj.learningItemId;
|
|
4180
|
+
const path_learningItemId = path + '.learningItemId';
|
|
4181
|
+
if (typeof obj_learningItemId !== 'string') {
|
|
4182
|
+
return new TypeError('Expected "string" but received "' + typeof obj_learningItemId + '" (at "' + path_learningItemId + '")');
|
|
4185
4183
|
}
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
if (referencepath_moduleUnits_itemValidationError !== null) {
|
|
4191
|
-
let message = 'Object doesn\'t match TrailheadModuleUnitRepresentation (at "' + path_moduleUnits_item + '")\n';
|
|
4192
|
-
message += referencepath_moduleUnits_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
4193
|
-
return new TypeError(message);
|
|
4194
|
-
}
|
|
4184
|
+
const obj_minimumInviteeQuantity = obj.minimumInviteeQuantity;
|
|
4185
|
+
const path_minimumInviteeQuantity = path + '.minimumInviteeQuantity';
|
|
4186
|
+
if (typeof obj_minimumInviteeQuantity !== 'number' || (typeof obj_minimumInviteeQuantity === 'number' && Math.floor(obj_minimumInviteeQuantity) !== obj_minimumInviteeQuantity)) {
|
|
4187
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_minimumInviteeQuantity + '" (at "' + path_minimumInviteeQuantity + '")');
|
|
4195
4188
|
}
|
|
4196
|
-
const
|
|
4197
|
-
const
|
|
4198
|
-
if (typeof
|
|
4199
|
-
return new TypeError('Expected "string" but received "' + typeof
|
|
4189
|
+
const obj_surveyId = obj.surveyId;
|
|
4190
|
+
const path_surveyId = path + '.surveyId';
|
|
4191
|
+
if (typeof obj_surveyId !== 'string') {
|
|
4192
|
+
return new TypeError('Expected "string" but received "' + typeof obj_surveyId + '" (at "' + path_surveyId + '")');
|
|
4200
4193
|
}
|
|
4201
4194
|
const obj_title = obj.title;
|
|
4202
4195
|
const path_title = path + '.title';
|
|
4203
4196
|
if (typeof obj_title !== 'string') {
|
|
4204
4197
|
return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
|
|
4205
4198
|
}
|
|
4206
|
-
const obj_type = obj.type;
|
|
4207
|
-
const path_type = path + '.type';
|
|
4208
|
-
if (typeof obj_type !== 'string') {
|
|
4209
|
-
return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
|
|
4210
|
-
}
|
|
4211
4199
|
})();
|
|
4212
4200
|
return v_error === undefined ? null : v_error;
|
|
4213
4201
|
}
|
|
4214
|
-
const RepresentationType$1 = '
|
|
4202
|
+
const RepresentationType$1 = 'LearningPracticeRepresentation';
|
|
4215
4203
|
function keyBuilder$5(luvio, config) {
|
|
4216
|
-
return keyPrefix + '::' + RepresentationType$1 + ':' + config.
|
|
4204
|
+
return keyPrefix + '::' + RepresentationType$1 + ':' + config.learning_item_id;
|
|
4217
4205
|
}
|
|
4218
4206
|
function keyBuilderFromType$1(luvio, object) {
|
|
4219
4207
|
const keyParams = {
|
|
4220
|
-
|
|
4208
|
+
learning_item_id: object.learningItemId
|
|
4221
4209
|
};
|
|
4222
4210
|
return keyBuilder$5(luvio, keyParams);
|
|
4223
4211
|
}
|
|
4224
4212
|
function normalize$1(input, existing, path, luvio, store, timestamp) {
|
|
4225
4213
|
return input;
|
|
4226
4214
|
}
|
|
4227
|
-
const select$
|
|
4228
|
-
const { selections: TrailheadModuleUnitRepresentation__selections, opaque: TrailheadModuleUnitRepresentation__opaque, } = select$5();
|
|
4215
|
+
const select$5 = function LearningPracticeRepresentationSelect() {
|
|
4229
4216
|
return {
|
|
4230
4217
|
kind: 'Fragment',
|
|
4231
4218
|
version: VERSION$2,
|
|
4232
4219
|
private: [],
|
|
4233
|
-
selections: [
|
|
4234
|
-
{
|
|
4235
|
-
name: 'availablePointCount',
|
|
4236
|
-
kind: 'Scalar'
|
|
4237
|
-
},
|
|
4238
|
-
{
|
|
4239
|
-
name: 'completedDate',
|
|
4240
|
-
kind: 'Scalar'
|
|
4241
|
-
},
|
|
4242
|
-
{
|
|
4243
|
-
name: 'completedItemCount',
|
|
4244
|
-
kind: 'Scalar'
|
|
4245
|
-
},
|
|
4246
|
-
{
|
|
4247
|
-
name: 'completedPercent',
|
|
4248
|
-
kind: 'Scalar'
|
|
4249
|
-
},
|
|
4250
|
-
{
|
|
4251
|
-
name: 'description',
|
|
4252
|
-
kind: 'Scalar'
|
|
4253
|
-
},
|
|
4254
|
-
{
|
|
4255
|
-
name: 'durationCount',
|
|
4256
|
-
kind: 'Scalar'
|
|
4257
|
-
},
|
|
4258
|
-
{
|
|
4259
|
-
name: 'earnedPointCount',
|
|
4260
|
-
kind: 'Scalar'
|
|
4261
|
-
},
|
|
4262
|
-
{
|
|
4263
|
-
name: 'imageUrl',
|
|
4264
|
-
kind: 'Scalar'
|
|
4265
|
-
},
|
|
4266
|
-
{
|
|
4267
|
-
name: 'isCompleted',
|
|
4268
|
-
kind: 'Scalar'
|
|
4269
|
-
},
|
|
4220
|
+
selections: [
|
|
4270
4221
|
{
|
|
4271
|
-
name: '
|
|
4222
|
+
name: 'description',
|
|
4272
4223
|
kind: 'Scalar'
|
|
4273
4224
|
},
|
|
4274
4225
|
{
|
|
4275
|
-
name: '
|
|
4226
|
+
name: 'learningItemId',
|
|
4276
4227
|
kind: 'Scalar'
|
|
4277
4228
|
},
|
|
4278
4229
|
{
|
|
4279
|
-
name: '
|
|
4280
|
-
kind: 'Object',
|
|
4281
|
-
plural: true,
|
|
4282
|
-
selections: TrailheadModuleUnitRepresentation__selections
|
|
4283
|
-
},
|
|
4284
|
-
{
|
|
4285
|
-
name: 'relatedId',
|
|
4230
|
+
name: 'minimumInviteeQuantity',
|
|
4286
4231
|
kind: 'Scalar'
|
|
4287
4232
|
},
|
|
4288
4233
|
{
|
|
4289
|
-
name: '
|
|
4234
|
+
name: 'surveyId',
|
|
4290
4235
|
kind: 'Scalar'
|
|
4291
4236
|
},
|
|
4292
4237
|
{
|
|
4293
|
-
name: '
|
|
4238
|
+
name: 'title',
|
|
4294
4239
|
kind: 'Scalar'
|
|
4295
4240
|
}
|
|
4296
4241
|
]
|
|
4297
4242
|
};
|
|
4298
4243
|
};
|
|
4299
4244
|
function equals$2(existing, incoming) {
|
|
4300
|
-
const
|
|
4301
|
-
const
|
|
4302
|
-
if (!(
|
|
4303
|
-
return false;
|
|
4304
|
-
}
|
|
4305
|
-
const existing_isCuratedContent = existing.isCuratedContent;
|
|
4306
|
-
const incoming_isCuratedContent = incoming.isCuratedContent;
|
|
4307
|
-
if (!(existing_isCuratedContent === incoming_isCuratedContent)) {
|
|
4308
|
-
return false;
|
|
4309
|
-
}
|
|
4310
|
-
const existing_availablePointCount = existing.availablePointCount;
|
|
4311
|
-
const incoming_availablePointCount = incoming.availablePointCount;
|
|
4312
|
-
if (!(existing_availablePointCount === incoming_availablePointCount)) {
|
|
4313
|
-
return false;
|
|
4314
|
-
}
|
|
4315
|
-
const existing_durationCount = existing.durationCount;
|
|
4316
|
-
const incoming_durationCount = incoming.durationCount;
|
|
4317
|
-
if (!(existing_durationCount === incoming_durationCount)) {
|
|
4245
|
+
const existing_minimumInviteeQuantity = existing.minimumInviteeQuantity;
|
|
4246
|
+
const incoming_minimumInviteeQuantity = incoming.minimumInviteeQuantity;
|
|
4247
|
+
if (!(existing_minimumInviteeQuantity === incoming_minimumInviteeQuantity)) {
|
|
4318
4248
|
return false;
|
|
4319
4249
|
}
|
|
4320
4250
|
const existing_description = existing.description;
|
|
@@ -4322,14 +4252,14 @@ function equals$2(existing, incoming) {
|
|
|
4322
4252
|
if (!(existing_description === incoming_description)) {
|
|
4323
4253
|
return false;
|
|
4324
4254
|
}
|
|
4325
|
-
const
|
|
4326
|
-
const
|
|
4327
|
-
if (!(
|
|
4255
|
+
const existing_learningItemId = existing.learningItemId;
|
|
4256
|
+
const incoming_learningItemId = incoming.learningItemId;
|
|
4257
|
+
if (!(existing_learningItemId === incoming_learningItemId)) {
|
|
4328
4258
|
return false;
|
|
4329
4259
|
}
|
|
4330
|
-
const
|
|
4331
|
-
const
|
|
4332
|
-
if (!(
|
|
4260
|
+
const existing_surveyId = existing.surveyId;
|
|
4261
|
+
const incoming_surveyId = incoming.surveyId;
|
|
4262
|
+
if (!(existing_surveyId === incoming_surveyId)) {
|
|
4333
4263
|
return false;
|
|
4334
4264
|
}
|
|
4335
4265
|
const existing_title = existing.title;
|
|
@@ -4337,51 +4267,11 @@ function equals$2(existing, incoming) {
|
|
|
4337
4267
|
if (!(existing_title === incoming_title)) {
|
|
4338
4268
|
return false;
|
|
4339
4269
|
}
|
|
4340
|
-
const existing_type = existing.type;
|
|
4341
|
-
const incoming_type = incoming.type;
|
|
4342
|
-
if (!(existing_type === incoming_type)) {
|
|
4343
|
-
return false;
|
|
4344
|
-
}
|
|
4345
|
-
const existing_completedDate = existing.completedDate;
|
|
4346
|
-
const incoming_completedDate = incoming.completedDate;
|
|
4347
|
-
if (!(existing_completedDate === incoming_completedDate)) {
|
|
4348
|
-
return false;
|
|
4349
|
-
}
|
|
4350
|
-
const existing_completedItemCount = existing.completedItemCount;
|
|
4351
|
-
const incoming_completedItemCount = incoming.completedItemCount;
|
|
4352
|
-
if (!(existing_completedItemCount === incoming_completedItemCount)) {
|
|
4353
|
-
return false;
|
|
4354
|
-
}
|
|
4355
|
-
const existing_completedPercent = existing.completedPercent;
|
|
4356
|
-
const incoming_completedPercent = incoming.completedPercent;
|
|
4357
|
-
if (!(existing_completedPercent === incoming_completedPercent)) {
|
|
4358
|
-
return false;
|
|
4359
|
-
}
|
|
4360
|
-
const existing_earnedPointCount = existing.earnedPointCount;
|
|
4361
|
-
const incoming_earnedPointCount = incoming.earnedPointCount;
|
|
4362
|
-
if (!(existing_earnedPointCount === incoming_earnedPointCount)) {
|
|
4363
|
-
return false;
|
|
4364
|
-
}
|
|
4365
|
-
const existing_itemCount = existing.itemCount;
|
|
4366
|
-
const incoming_itemCount = incoming.itemCount;
|
|
4367
|
-
if (!(existing_itemCount === incoming_itemCount)) {
|
|
4368
|
-
return false;
|
|
4369
|
-
}
|
|
4370
|
-
const existing_moduleUnits = existing.moduleUnits;
|
|
4371
|
-
const incoming_moduleUnits = incoming.moduleUnits;
|
|
4372
|
-
const equals_moduleUnits_items = equalsArray(existing_moduleUnits, incoming_moduleUnits, (existing_moduleUnits_item, incoming_moduleUnits_item) => {
|
|
4373
|
-
if (!(equals$3(existing_moduleUnits_item, incoming_moduleUnits_item))) {
|
|
4374
|
-
return false;
|
|
4375
|
-
}
|
|
4376
|
-
});
|
|
4377
|
-
if (equals_moduleUnits_items === false) {
|
|
4378
|
-
return false;
|
|
4379
|
-
}
|
|
4380
4270
|
return true;
|
|
4381
4271
|
}
|
|
4382
|
-
const ingest$1 = function
|
|
4272
|
+
const ingest$1 = function LearningPracticeRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
4383
4273
|
if (process.env.NODE_ENV !== 'production') {
|
|
4384
|
-
const validateError = validate$
|
|
4274
|
+
const validateError = validate$3(input);
|
|
4385
4275
|
if (validateError !== null) {
|
|
4386
4276
|
throw validateError;
|
|
4387
4277
|
}
|
|
@@ -4401,24 +4291,24 @@ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
|
|
|
4401
4291
|
});
|
|
4402
4292
|
}
|
|
4403
4293
|
|
|
4404
|
-
function select$
|
|
4405
|
-
return select$
|
|
4294
|
+
function select$4(luvio, params) {
|
|
4295
|
+
return select$5();
|
|
4406
4296
|
}
|
|
4407
4297
|
function keyBuilder$4(luvio, params) {
|
|
4408
4298
|
return keyBuilder$5(luvio, {
|
|
4409
|
-
|
|
4299
|
+
learning_item_id: params.urlParams.learningItemId
|
|
4410
4300
|
});
|
|
4411
4301
|
}
|
|
4412
|
-
function getResponseCacheKeys$
|
|
4302
|
+
function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
|
|
4413
4303
|
getTypeCacheKeys$1(storeKeyMap, luvio, response);
|
|
4414
4304
|
}
|
|
4415
|
-
function ingestSuccess$
|
|
4305
|
+
function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
|
|
4416
4306
|
const { body } = response;
|
|
4417
4307
|
const key = keyBuilder$4(luvio, resourceParams);
|
|
4418
4308
|
luvio.storeIngest(key, ingest$1, body);
|
|
4419
4309
|
const snapshot = luvio.storeLookup({
|
|
4420
4310
|
recordId: key,
|
|
4421
|
-
node: select$
|
|
4311
|
+
node: select$4(),
|
|
4422
4312
|
variables: {},
|
|
4423
4313
|
}, snapshotRefresh);
|
|
4424
4314
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -4441,11 +4331,11 @@ function ingestError$1(luvio, params, error, snapshotRefresh) {
|
|
|
4441
4331
|
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
4442
4332
|
return errorSnapshot;
|
|
4443
4333
|
}
|
|
4444
|
-
function createResourceRequest$
|
|
4334
|
+
function createResourceRequest$2(config) {
|
|
4445
4335
|
const headers = {};
|
|
4446
4336
|
return {
|
|
4447
4337
|
baseUri: '/services/data/v60.0',
|
|
4448
|
-
basePath: '/learning-content-platform/learning/
|
|
4338
|
+
basePath: '/learning-content-platform/learning/practice/' + config.urlParams.learningItemId + '',
|
|
4449
4339
|
method: 'get',
|
|
4450
4340
|
body: null,
|
|
4451
4341
|
urlParams: config.urlParams,
|
|
@@ -4458,64 +4348,64 @@ function createResourceRequestFromRepresentation$1(representation) {
|
|
|
4458
4348
|
const config = {
|
|
4459
4349
|
urlParams: {},
|
|
4460
4350
|
};
|
|
4461
|
-
config.urlParams.
|
|
4462
|
-
return createResourceRequest$
|
|
4351
|
+
config.urlParams.learningItemId = representation.learningItemId;
|
|
4352
|
+
return createResourceRequest$2(config);
|
|
4463
4353
|
}
|
|
4464
4354
|
|
|
4465
|
-
const adapterName$
|
|
4466
|
-
const
|
|
4467
|
-
generateParamConfigMetadata('
|
|
4355
|
+
const adapterName$2 = 'getLearningPractice';
|
|
4356
|
+
const getLearningPractice_ConfigPropertyMetadata = [
|
|
4357
|
+
generateParamConfigMetadata('learningItemId', true, 0 /* UrlParameter */, 0 /* String */),
|
|
4468
4358
|
];
|
|
4469
|
-
const
|
|
4470
|
-
const createResourceParams$
|
|
4359
|
+
const getLearningPractice_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getLearningPractice_ConfigPropertyMetadata);
|
|
4360
|
+
const createResourceParams$2 = /*#__PURE__*/ createResourceParams$a(getLearningPractice_ConfigPropertyMetadata);
|
|
4471
4361
|
function keyBuilder$3(luvio, config) {
|
|
4472
|
-
const resourceParams = createResourceParams$
|
|
4362
|
+
const resourceParams = createResourceParams$2(config);
|
|
4473
4363
|
return keyBuilder$4(luvio, resourceParams);
|
|
4474
4364
|
}
|
|
4475
|
-
function typeCheckConfig$
|
|
4365
|
+
function typeCheckConfig$2(untrustedConfig) {
|
|
4476
4366
|
const config = {};
|
|
4477
|
-
typeCheckConfig$a(untrustedConfig, config,
|
|
4367
|
+
typeCheckConfig$a(untrustedConfig, config, getLearningPractice_ConfigPropertyMetadata);
|
|
4478
4368
|
return config;
|
|
4479
4369
|
}
|
|
4480
|
-
function validateAdapterConfig$
|
|
4370
|
+
function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
|
|
4481
4371
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
4482
4372
|
return null;
|
|
4483
4373
|
}
|
|
4484
4374
|
if (process.env.NODE_ENV !== 'production') {
|
|
4485
4375
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
4486
4376
|
}
|
|
4487
|
-
const config = typeCheckConfig$
|
|
4377
|
+
const config = typeCheckConfig$2(untrustedConfig);
|
|
4488
4378
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
4489
4379
|
return null;
|
|
4490
4380
|
}
|
|
4491
4381
|
return config;
|
|
4492
4382
|
}
|
|
4493
4383
|
function adapterFragment$1(luvio, config) {
|
|
4494
|
-
createResourceParams$
|
|
4495
|
-
return select$
|
|
4384
|
+
createResourceParams$2(config);
|
|
4385
|
+
return select$4();
|
|
4496
4386
|
}
|
|
4497
4387
|
function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
|
|
4498
|
-
const snapshot = ingestSuccess$
|
|
4388
|
+
const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
|
|
4499
4389
|
config,
|
|
4500
|
-
resolve: () => buildNetworkSnapshot$
|
|
4390
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
4501
4391
|
});
|
|
4502
4392
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
4503
4393
|
}
|
|
4504
4394
|
function onFetchResponseError$1(luvio, config, resourceParams, response) {
|
|
4505
4395
|
const snapshot = ingestError$1(luvio, resourceParams, response, {
|
|
4506
4396
|
config,
|
|
4507
|
-
resolve: () => buildNetworkSnapshot$
|
|
4397
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
4508
4398
|
});
|
|
4509
4399
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
4510
4400
|
}
|
|
4511
|
-
function buildNetworkSnapshot$
|
|
4512
|
-
const resourceParams = createResourceParams$
|
|
4513
|
-
const request = createResourceRequest$
|
|
4401
|
+
function buildNetworkSnapshot$2(luvio, config, options) {
|
|
4402
|
+
const resourceParams = createResourceParams$2(config);
|
|
4403
|
+
const request = createResourceRequest$2(resourceParams);
|
|
4514
4404
|
return luvio.dispatchResourceRequest(request, options)
|
|
4515
4405
|
.then((response) => {
|
|
4516
4406
|
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
|
|
4517
4407
|
const cache = new StoreKeyMap();
|
|
4518
|
-
getResponseCacheKeys$
|
|
4408
|
+
getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
|
|
4519
4409
|
return cache;
|
|
4520
4410
|
});
|
|
4521
4411
|
}, (response) => {
|
|
@@ -4523,7 +4413,7 @@ function buildNetworkSnapshot$1(luvio, config, options) {
|
|
|
4523
4413
|
});
|
|
4524
4414
|
}
|
|
4525
4415
|
function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
|
|
4526
|
-
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$
|
|
4416
|
+
return buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
|
|
4527
4417
|
}
|
|
4528
4418
|
function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
4529
4419
|
const { luvio, config } = context;
|
|
@@ -4534,12 +4424,12 @@ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
|
|
|
4534
4424
|
};
|
|
4535
4425
|
const cacheSnapshot = storeLookup(selector, {
|
|
4536
4426
|
config,
|
|
4537
|
-
resolve: () => buildNetworkSnapshot$
|
|
4427
|
+
resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
|
|
4538
4428
|
});
|
|
4539
4429
|
return cacheSnapshot;
|
|
4540
4430
|
}
|
|
4541
|
-
const
|
|
4542
|
-
const config = validateAdapterConfig$
|
|
4431
|
+
const getLearningPracticeAdapterFactory = (luvio) => function LearningContentPlatform__getLearningPractice(untrustedConfig, requestContext) {
|
|
4432
|
+
const config = validateAdapterConfig$2(untrustedConfig, getLearningPractice_ConfigPropertyNames);
|
|
4543
4433
|
// Invalid or incomplete config
|
|
4544
4434
|
if (config === null) {
|
|
4545
4435
|
return null;
|
|
@@ -4548,7 +4438,7 @@ const getModuleAdapterFactory = (luvio) => function LearningContentPlatform__get
|
|
|
4548
4438
|
buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
|
|
4549
4439
|
};
|
|
4550
4440
|
const notifyChangeFactory$1 = (luvio, options) => {
|
|
4551
|
-
return function
|
|
4441
|
+
return function getLearningContentPlatformLearningPracticeByLearningItemIdNotifyChange(configs) {
|
|
4552
4442
|
const keys = configs.map(c => keyBuilder$5(luvio, c));
|
|
4553
4443
|
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
4554
4444
|
for (let i = 0, len = entries.length; i < len; i++) {
|
|
@@ -4582,6 +4472,130 @@ const notifyChangeFactory$1 = (luvio, options) => {
|
|
|
4582
4472
|
};
|
|
4583
4473
|
};
|
|
4584
4474
|
|
|
4475
|
+
function validate$2(obj, path = 'EvaluateLearningItemInputRepresentation') {
|
|
4476
|
+
const v_error = (() => {
|
|
4477
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
4478
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
4479
|
+
}
|
|
4480
|
+
if (obj.details !== undefined) {
|
|
4481
|
+
const obj_details = obj.details;
|
|
4482
|
+
const path_details = path + '.details';
|
|
4483
|
+
if (typeof obj_details !== 'object' || ArrayIsArray(obj_details) || obj_details === null) {
|
|
4484
|
+
return new TypeError('Expected "object" but received "' + typeof obj_details + '" (at "' + path_details + '")');
|
|
4485
|
+
}
|
|
4486
|
+
const obj_details_keys = ObjectKeys(obj_details);
|
|
4487
|
+
for (let i = 0; i < obj_details_keys.length; i++) {
|
|
4488
|
+
const key = obj_details_keys[i];
|
|
4489
|
+
const obj_details_prop = obj_details[key];
|
|
4490
|
+
const path_details_prop = path_details + '["' + key + '"]';
|
|
4491
|
+
if (obj_details_prop === undefined) {
|
|
4492
|
+
return new TypeError('Expected "defined" but received "' + typeof obj_details_prop + '" (at "' + path_details_prop + '")');
|
|
4493
|
+
}
|
|
4494
|
+
}
|
|
4495
|
+
}
|
|
4496
|
+
const obj_learningItemId = obj.learningItemId;
|
|
4497
|
+
const path_learningItemId = path + '.learningItemId';
|
|
4498
|
+
if (typeof obj_learningItemId !== 'string') {
|
|
4499
|
+
return new TypeError('Expected "string" but received "' + typeof obj_learningItemId + '" (at "' + path_learningItemId + '")');
|
|
4500
|
+
}
|
|
4501
|
+
})();
|
|
4502
|
+
return v_error === undefined ? null : v_error;
|
|
4503
|
+
}
|
|
4504
|
+
|
|
4505
|
+
function select$3(luvio, params) {
|
|
4506
|
+
return select$e();
|
|
4507
|
+
}
|
|
4508
|
+
function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
|
|
4509
|
+
getTypeCacheKeys$5(storeKeyMap, luvio, response);
|
|
4510
|
+
}
|
|
4511
|
+
function ingestSuccess$1(luvio, resourceParams, response) {
|
|
4512
|
+
const { body } = response;
|
|
4513
|
+
const key = keyBuilderFromType$4(luvio, body);
|
|
4514
|
+
luvio.storeIngest(key, ingest$5, body);
|
|
4515
|
+
const snapshot = luvio.storeLookup({
|
|
4516
|
+
recordId: key,
|
|
4517
|
+
node: select$3(),
|
|
4518
|
+
variables: {},
|
|
4519
|
+
});
|
|
4520
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4521
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
4522
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
4523
|
+
}
|
|
4524
|
+
}
|
|
4525
|
+
deepFreeze(snapshot.data);
|
|
4526
|
+
return snapshot;
|
|
4527
|
+
}
|
|
4528
|
+
function createResourceRequest$1(config) {
|
|
4529
|
+
const headers = {};
|
|
4530
|
+
return {
|
|
4531
|
+
baseUri: '/services/data/v60.0',
|
|
4532
|
+
basePath: '/learning-content-platform/learning/evaluate',
|
|
4533
|
+
method: 'post',
|
|
4534
|
+
body: config.body,
|
|
4535
|
+
urlParams: {},
|
|
4536
|
+
queryParams: {},
|
|
4537
|
+
headers,
|
|
4538
|
+
priority: 'normal',
|
|
4539
|
+
};
|
|
4540
|
+
}
|
|
4541
|
+
|
|
4542
|
+
const adapterName$1 = 'evaluateLearningItem';
|
|
4543
|
+
const evaluateLearningItem_ConfigPropertyMetadata = [
|
|
4544
|
+
generateParamConfigMetadata('payload', true, 2 /* Body */, 4 /* Unsupported */),
|
|
4545
|
+
];
|
|
4546
|
+
const evaluateLearningItem_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, evaluateLearningItem_ConfigPropertyMetadata);
|
|
4547
|
+
const createResourceParams$1 = /*#__PURE__*/ createResourceParams$a(evaluateLearningItem_ConfigPropertyMetadata);
|
|
4548
|
+
function typeCheckConfig$1(untrustedConfig) {
|
|
4549
|
+
const config = {};
|
|
4550
|
+
const untrustedConfig_payload = untrustedConfig.payload;
|
|
4551
|
+
const referenceEvaluateLearningItemInputRepresentationValidationError = validate$2(untrustedConfig_payload);
|
|
4552
|
+
if (referenceEvaluateLearningItemInputRepresentationValidationError === null) {
|
|
4553
|
+
config.payload = untrustedConfig_payload;
|
|
4554
|
+
}
|
|
4555
|
+
return config;
|
|
4556
|
+
}
|
|
4557
|
+
function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
|
|
4558
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
4559
|
+
return null;
|
|
4560
|
+
}
|
|
4561
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
4562
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
4563
|
+
}
|
|
4564
|
+
const config = typeCheckConfig$1(untrustedConfig);
|
|
4565
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
4566
|
+
return null;
|
|
4567
|
+
}
|
|
4568
|
+
return config;
|
|
4569
|
+
}
|
|
4570
|
+
function buildNetworkSnapshot$1(luvio, config, options) {
|
|
4571
|
+
const resourceParams = createResourceParams$1(config);
|
|
4572
|
+
const request = createResourceRequest$1(resourceParams);
|
|
4573
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
4574
|
+
.then((response) => {
|
|
4575
|
+
return luvio.handleSuccessResponse(() => {
|
|
4576
|
+
const snapshot = ingestSuccess$1(luvio, resourceParams, response);
|
|
4577
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
4578
|
+
}, () => {
|
|
4579
|
+
const cache = new StoreKeyMap();
|
|
4580
|
+
getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
|
|
4581
|
+
return cache;
|
|
4582
|
+
});
|
|
4583
|
+
}, (response) => {
|
|
4584
|
+
deepFreeze(response);
|
|
4585
|
+
throw response;
|
|
4586
|
+
});
|
|
4587
|
+
}
|
|
4588
|
+
const evaluateLearningItemAdapterFactory = (luvio) => {
|
|
4589
|
+
return function evaluateLearningItem(untrustedConfig) {
|
|
4590
|
+
const config = validateAdapterConfig$1(untrustedConfig, evaluateLearningItem_ConfigPropertyNames);
|
|
4591
|
+
// Invalid or incomplete config
|
|
4592
|
+
if (config === null) {
|
|
4593
|
+
throw new Error('Invalid config for "evaluateLearningItem"');
|
|
4594
|
+
}
|
|
4595
|
+
return buildNetworkSnapshot$1(luvio, config);
|
|
4596
|
+
};
|
|
4597
|
+
};
|
|
4598
|
+
|
|
4585
4599
|
const VERSION$1 = "1027d7eb6300967ad6dd208f73cbf68e";
|
|
4586
4600
|
function validate$1(obj, path = 'LearningTextLessonSectionRepresentation') {
|
|
4587
4601
|
const v_error = (() => {
|
|
@@ -5041,9 +5055,9 @@ function bindExportsTo(luvio) {
|
|
|
5041
5055
|
getLearningItemsList: createWireAdapterConstructor(luvio, getLearningItemsList_ldsAdapter, getLearningItemsListMetadata),
|
|
5042
5056
|
getLearningModel: createWireAdapterConstructor(luvio, getLearningModel_ldsAdapter, getLearningModelMetadata),
|
|
5043
5057
|
getLearningPractice: createWireAdapterConstructor(luvio, getLearningPractice_ldsAdapter, getLearningPracticeMetadata),
|
|
5044
|
-
getLearningPracticeNotifyChange: createLDSAdapter(luvio, 'getLearningPracticeNotifyChange', notifyChangeFactory$
|
|
5058
|
+
getLearningPracticeNotifyChange: createLDSAdapter(luvio, 'getLearningPracticeNotifyChange', notifyChangeFactory$1),
|
|
5045
5059
|
getModule: createWireAdapterConstructor(luvio, getModule_ldsAdapter, getModuleMetadata),
|
|
5046
|
-
getModuleNotifyChange: createLDSAdapter(luvio, 'getModuleNotifyChange', notifyChangeFactory$
|
|
5060
|
+
getModuleNotifyChange: createLDSAdapter(luvio, 'getModuleNotifyChange', notifyChangeFactory$2),
|
|
5047
5061
|
getTextLesson: createWireAdapterConstructor(luvio, getTextLesson_ldsAdapter, getTextLessonMetadata),
|
|
5048
5062
|
getTextLessonNotifyChange: createLDSAdapter(luvio, 'getTextLessonNotifyChange', notifyChangeFactory),
|
|
5049
5063
|
// Imperative GET Adapters
|
|
@@ -5085,5 +5099,10 @@ withDefaultLuvio((luvio) => {
|
|
|
5085
5099
|
} = bindExportsTo(luvio));
|
|
5086
5100
|
});
|
|
5087
5101
|
|
|
5088
|
-
|
|
5089
|
-
|
|
5102
|
+
let notifyLearningItemUpdateAvailable;
|
|
5103
|
+
withDefaultLuvio((luvio) => {
|
|
5104
|
+
notifyLearningItemUpdateAvailable = createLDSAdapter(luvio, 'notifyLearningItemUpdateAvailable', notifyUpdateAvailableFactory);
|
|
5105
|
+
});
|
|
5106
|
+
|
|
5107
|
+
export { evaluateLearningItem, getFeaturedItemsRecommendedList, getFeaturedItemsRecommendedList_imperative, getFeaturedItemsRelatedList, getFeaturedItemsRelatedList_imperative, getLearningConfig, getLearningConfig_imperative, getLearningItemProgress, getLearningItemProgress_imperative, getLearningItemsList, getLearningItemsList_imperative, getLearningModel, getLearningModel_imperative, getLearningPractice, getLearningPracticeNotifyChange, getLearningPractice_imperative, getModule, getModuleNotifyChange, getModule_imperative, getTextLesson, getTextLessonNotifyChange, getTextLesson_imperative, notifyLearningItemUpdateAvailable };
|
|
5108
|
+
// version: 1.248.0-0a41f7ec3
|