@salesforce/lds-adapters-platform-learning-content 1.131.5 → 1.133.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 +589 -123
- package/dist/es/es2018/types/src/generated/adapters/getFeedbackResult.d.ts +27 -0
- package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +1 -0
- package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +4 -1
- package/dist/es/es2018/types/src/generated/resources/getLearningContentPlatformLearningFeedbackresultByLearningItemId.d.ts +16 -0
- package/dist/es/es2018/types/src/generated/types/FeedbackResultRepresentation.d.ts +52 -0
- package/dist/es/es2018/types/src/generated/types/SurveyQuestionResponseRepresetation.d.ts +51 -0
- package/package.json +1 -1
- package/sfdc/index.js +686 -172
- package/src/raml/api.raml +69 -0
- package/src/raml/luvio.raml +10 -0
package/sfdc/index.js
CHANGED
|
@@ -119,7 +119,7 @@ function createLink(ref) {
|
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
function validate$
|
|
122
|
+
function validate$k(obj, path = 'EvaluateLearningItemInputRepresentation') {
|
|
123
123
|
const v_error = (() => {
|
|
124
124
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
125
125
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -149,9 +149,9 @@ function validate$i(obj, path = 'EvaluateLearningItemInputRepresentation') {
|
|
|
149
149
|
return v_error === undefined ? null : v_error;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
const TTL$
|
|
153
|
-
const VERSION$
|
|
154
|
-
function validate$
|
|
152
|
+
const TTL$9 = 15000;
|
|
153
|
+
const VERSION$j = "ef3b97b73983e10731031f11a195bba6";
|
|
154
|
+
function validate$j(obj, path = 'LearningItemProgressRepresentation') {
|
|
155
155
|
const v_error = (() => {
|
|
156
156
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
157
157
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -221,23 +221,23 @@ function validate$h(obj, path = 'LearningItemProgressRepresentation') {
|
|
|
221
221
|
})();
|
|
222
222
|
return v_error === undefined ? null : v_error;
|
|
223
223
|
}
|
|
224
|
-
const RepresentationType$
|
|
225
|
-
function keyBuilder$
|
|
226
|
-
return keyPrefix + '::' + RepresentationType$
|
|
224
|
+
const RepresentationType$f = 'LearningItemProgressRepresentation';
|
|
225
|
+
function keyBuilder$x(luvio, config) {
|
|
226
|
+
return keyPrefix + '::' + RepresentationType$f + ':' + config.learning_item_id;
|
|
227
227
|
}
|
|
228
|
-
function keyBuilderFromType$
|
|
228
|
+
function keyBuilderFromType$9(luvio, object) {
|
|
229
229
|
const keyParams = {
|
|
230
230
|
learning_item_id: object.learningItemId
|
|
231
231
|
};
|
|
232
|
-
return keyBuilder$
|
|
232
|
+
return keyBuilder$x(luvio, keyParams);
|
|
233
233
|
}
|
|
234
|
-
function normalize$
|
|
234
|
+
function normalize$f(input, existing, path, luvio, store, timestamp) {
|
|
235
235
|
return input;
|
|
236
236
|
}
|
|
237
|
-
const select$
|
|
237
|
+
const select$w = function LearningItemProgressRepresentationSelect() {
|
|
238
238
|
return {
|
|
239
239
|
kind: 'Fragment',
|
|
240
|
-
version: VERSION$
|
|
240
|
+
version: VERSION$j,
|
|
241
241
|
private: [],
|
|
242
242
|
selections: [
|
|
243
243
|
{
|
|
@@ -259,7 +259,7 @@ const select$t = function LearningItemProgressRepresentationSelect() {
|
|
|
259
259
|
]
|
|
260
260
|
};
|
|
261
261
|
};
|
|
262
|
-
function equals$
|
|
262
|
+
function equals$j(existing, incoming) {
|
|
263
263
|
const existing_isCompleted = existing.isCompleted;
|
|
264
264
|
const incoming_isCompleted = incoming.isCompleted;
|
|
265
265
|
if (!(existing_isCompleted === incoming_isCompleted)) {
|
|
@@ -282,61 +282,61 @@ function equals$h(existing, incoming) {
|
|
|
282
282
|
}
|
|
283
283
|
return true;
|
|
284
284
|
}
|
|
285
|
-
const ingest$
|
|
285
|
+
const ingest$f = function LearningItemProgressRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
286
286
|
if (process.env.NODE_ENV !== 'production') {
|
|
287
|
-
const validateError = validate$
|
|
287
|
+
const validateError = validate$j(input);
|
|
288
288
|
if (validateError !== null) {
|
|
289
289
|
throw validateError;
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
|
-
const key = keyBuilderFromType$
|
|
292
|
+
const key = keyBuilderFromType$9(luvio, input);
|
|
293
293
|
const existingRecord = store.readEntry(key);
|
|
294
|
-
const ttlToUse = TTL$
|
|
295
|
-
let incomingRecord = normalize$
|
|
294
|
+
const ttlToUse = TTL$9;
|
|
295
|
+
let incomingRecord = normalize$f(input, store.readEntry(key), {
|
|
296
296
|
fullPath: key,
|
|
297
297
|
parent: path.parent,
|
|
298
298
|
propertyName: path.propertyName,
|
|
299
299
|
ttl: ttlToUse
|
|
300
300
|
});
|
|
301
|
-
if (existingRecord === undefined || equals$
|
|
301
|
+
if (existingRecord === undefined || equals$j(existingRecord, incomingRecord) === false) {
|
|
302
302
|
luvio.storePublish(key, incomingRecord);
|
|
303
303
|
}
|
|
304
304
|
{
|
|
305
305
|
const storeMetadataParams = {
|
|
306
306
|
ttl: ttlToUse,
|
|
307
307
|
namespace: "LearningContentPlatform",
|
|
308
|
-
version: VERSION$
|
|
309
|
-
representationName: RepresentationType$
|
|
308
|
+
version: VERSION$j,
|
|
309
|
+
representationName: RepresentationType$f,
|
|
310
310
|
};
|
|
311
311
|
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
312
312
|
}
|
|
313
313
|
return createLink(key);
|
|
314
314
|
};
|
|
315
|
-
function getTypeCacheKeys$
|
|
315
|
+
function getTypeCacheKeys$f(luvio, input, fullPathFactory) {
|
|
316
316
|
const rootKeySet = new StoreKeyMap();
|
|
317
317
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
318
|
-
const rootKey = keyBuilderFromType$
|
|
318
|
+
const rootKey = keyBuilderFromType$9(luvio, input);
|
|
319
319
|
rootKeySet.set(rootKey, {
|
|
320
320
|
namespace: keyPrefix,
|
|
321
|
-
representationName: RepresentationType$
|
|
321
|
+
representationName: RepresentationType$f,
|
|
322
322
|
mergeable: false
|
|
323
323
|
});
|
|
324
324
|
return rootKeySet;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
function select$
|
|
328
|
-
return select$
|
|
327
|
+
function select$v(luvio, params) {
|
|
328
|
+
return select$w();
|
|
329
329
|
}
|
|
330
|
-
function getResponseCacheKeys$
|
|
331
|
-
return getTypeCacheKeys$
|
|
330
|
+
function getResponseCacheKeys$c(luvio, resourceParams, response) {
|
|
331
|
+
return getTypeCacheKeys$f(luvio, response);
|
|
332
332
|
}
|
|
333
|
-
function ingestSuccess$
|
|
333
|
+
function ingestSuccess$c(luvio, resourceParams, response) {
|
|
334
334
|
const { body } = response;
|
|
335
|
-
const key = keyBuilderFromType$
|
|
336
|
-
luvio.storeIngest(key, ingest$
|
|
335
|
+
const key = keyBuilderFromType$9(luvio, body);
|
|
336
|
+
luvio.storeIngest(key, ingest$f, body);
|
|
337
337
|
const snapshot = luvio.storeLookup({
|
|
338
338
|
recordId: key,
|
|
339
|
-
node: select$
|
|
339
|
+
node: select$v(),
|
|
340
340
|
variables: {},
|
|
341
341
|
});
|
|
342
342
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -346,7 +346,7 @@ function ingestSuccess$b(luvio, resourceParams, response) {
|
|
|
346
346
|
}
|
|
347
347
|
return snapshot;
|
|
348
348
|
}
|
|
349
|
-
function createResourceRequest$
|
|
349
|
+
function createResourceRequest$c(config) {
|
|
350
350
|
const headers = {};
|
|
351
351
|
return {
|
|
352
352
|
baseUri: '/services/data/v58.0',
|
|
@@ -367,7 +367,7 @@ const evaluateLearningItem_ConfigPropertyNames = {
|
|
|
367
367
|
optional: []
|
|
368
368
|
}
|
|
369
369
|
};
|
|
370
|
-
function createResourceParams$
|
|
370
|
+
function createResourceParams$c(config) {
|
|
371
371
|
const resourceParams = {
|
|
372
372
|
body: {
|
|
373
373
|
payload: config.payload
|
|
@@ -375,37 +375,37 @@ function createResourceParams$b(config) {
|
|
|
375
375
|
};
|
|
376
376
|
return resourceParams;
|
|
377
377
|
}
|
|
378
|
-
function typeCheckConfig$
|
|
378
|
+
function typeCheckConfig$c(untrustedConfig) {
|
|
379
379
|
const config = {};
|
|
380
380
|
const untrustedConfig_payload = untrustedConfig.payload;
|
|
381
|
-
const referenceEvaluateLearningItemInputRepresentationValidationError = validate$
|
|
381
|
+
const referenceEvaluateLearningItemInputRepresentationValidationError = validate$k(untrustedConfig_payload);
|
|
382
382
|
if (referenceEvaluateLearningItemInputRepresentationValidationError === null) {
|
|
383
383
|
config.payload = untrustedConfig_payload;
|
|
384
384
|
}
|
|
385
385
|
return config;
|
|
386
386
|
}
|
|
387
|
-
function validateAdapterConfig$
|
|
387
|
+
function validateAdapterConfig$c(untrustedConfig, configPropertyNames) {
|
|
388
388
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
389
389
|
return null;
|
|
390
390
|
}
|
|
391
391
|
if (process.env.NODE_ENV !== 'production') {
|
|
392
392
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
393
393
|
}
|
|
394
|
-
const config = typeCheckConfig$
|
|
394
|
+
const config = typeCheckConfig$c(untrustedConfig);
|
|
395
395
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
396
396
|
return null;
|
|
397
397
|
}
|
|
398
398
|
return config;
|
|
399
399
|
}
|
|
400
|
-
function buildNetworkSnapshot$
|
|
401
|
-
const resourceParams = createResourceParams$
|
|
402
|
-
const request = createResourceRequest$
|
|
400
|
+
function buildNetworkSnapshot$c(luvio, config, options) {
|
|
401
|
+
const resourceParams = createResourceParams$c(config);
|
|
402
|
+
const request = createResourceRequest$c(resourceParams);
|
|
403
403
|
return luvio.dispatchResourceRequest(request, options)
|
|
404
404
|
.then((response) => {
|
|
405
405
|
return luvio.handleSuccessResponse(() => {
|
|
406
|
-
const snapshot = ingestSuccess$
|
|
406
|
+
const snapshot = ingestSuccess$c(luvio, resourceParams, response);
|
|
407
407
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
408
|
-
}, () => getResponseCacheKeys$
|
|
408
|
+
}, () => getResponseCacheKeys$c(luvio, resourceParams, response.body));
|
|
409
409
|
}, (response) => {
|
|
410
410
|
deepFreeze(response);
|
|
411
411
|
throw response;
|
|
@@ -413,18 +413,18 @@ function buildNetworkSnapshot$b(luvio, config, options) {
|
|
|
413
413
|
}
|
|
414
414
|
const evaluateLearningItemAdapterFactory = (luvio) => {
|
|
415
415
|
return function evaluateLearningItem(untrustedConfig) {
|
|
416
|
-
const config = validateAdapterConfig$
|
|
416
|
+
const config = validateAdapterConfig$c(untrustedConfig, evaluateLearningItem_ConfigPropertyNames);
|
|
417
417
|
// Invalid or incomplete config
|
|
418
418
|
if (config === null) {
|
|
419
419
|
throw new Error('Invalid config for "evaluateLearningItem"');
|
|
420
420
|
}
|
|
421
|
-
return buildNetworkSnapshot$
|
|
421
|
+
return buildNetworkSnapshot$c(luvio, config);
|
|
422
422
|
};
|
|
423
423
|
};
|
|
424
424
|
|
|
425
|
-
const TTL$
|
|
426
|
-
const VERSION$
|
|
427
|
-
function validate$
|
|
425
|
+
const TTL$8 = 15000;
|
|
426
|
+
const VERSION$i = "b489f9f2cbdc91a04dd15b4d467b6760";
|
|
427
|
+
function validate$i(obj, path = 'FeaturedItemRepresentation') {
|
|
428
428
|
const v_error = (() => {
|
|
429
429
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
430
430
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -821,23 +821,23 @@ function validate$g(obj, path = 'FeaturedItemRepresentation') {
|
|
|
821
821
|
})();
|
|
822
822
|
return v_error === undefined ? null : v_error;
|
|
823
823
|
}
|
|
824
|
-
const RepresentationType$
|
|
825
|
-
function keyBuilder$
|
|
826
|
-
return keyPrefix + '::' + RepresentationType$
|
|
824
|
+
const RepresentationType$e = 'FeaturedItemRepresentation';
|
|
825
|
+
function keyBuilder$w(luvio, config) {
|
|
826
|
+
return keyPrefix + '::' + RepresentationType$e + ':' + config.id;
|
|
827
827
|
}
|
|
828
|
-
function keyBuilderFromType$
|
|
828
|
+
function keyBuilderFromType$8(luvio, object) {
|
|
829
829
|
const keyParams = {
|
|
830
830
|
id: object.id
|
|
831
831
|
};
|
|
832
|
-
return keyBuilder$
|
|
832
|
+
return keyBuilder$w(luvio, keyParams);
|
|
833
833
|
}
|
|
834
|
-
function normalize$
|
|
834
|
+
function normalize$e(input, existing, path, luvio, store, timestamp) {
|
|
835
835
|
return input;
|
|
836
836
|
}
|
|
837
|
-
const select$
|
|
837
|
+
const select$u = function FeaturedItemRepresentationSelect() {
|
|
838
838
|
return {
|
|
839
839
|
kind: 'Fragment',
|
|
840
|
-
version: VERSION$
|
|
840
|
+
version: VERSION$i,
|
|
841
841
|
private: [],
|
|
842
842
|
selections: [
|
|
843
843
|
{
|
|
@@ -919,7 +919,7 @@ const select$r = function FeaturedItemRepresentationSelect() {
|
|
|
919
919
|
]
|
|
920
920
|
};
|
|
921
921
|
};
|
|
922
|
-
function equals$
|
|
922
|
+
function equals$i(existing, incoming) {
|
|
923
923
|
const existing_description = existing.description;
|
|
924
924
|
const incoming_description = incoming.description;
|
|
925
925
|
if (!(existing_description === incoming_description)) {
|
|
@@ -1017,50 +1017,50 @@ function equals$g(existing, incoming) {
|
|
|
1017
1017
|
}
|
|
1018
1018
|
return true;
|
|
1019
1019
|
}
|
|
1020
|
-
const ingest$
|
|
1020
|
+
const ingest$e = function FeaturedItemRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1021
1021
|
if (process.env.NODE_ENV !== 'production') {
|
|
1022
|
-
const validateError = validate$
|
|
1022
|
+
const validateError = validate$i(input);
|
|
1023
1023
|
if (validateError !== null) {
|
|
1024
1024
|
throw validateError;
|
|
1025
1025
|
}
|
|
1026
1026
|
}
|
|
1027
|
-
const key = keyBuilderFromType$
|
|
1027
|
+
const key = keyBuilderFromType$8(luvio, input);
|
|
1028
1028
|
const existingRecord = store.readEntry(key);
|
|
1029
|
-
const ttlToUse = TTL$
|
|
1030
|
-
let incomingRecord = normalize$
|
|
1029
|
+
const ttlToUse = TTL$8;
|
|
1030
|
+
let incomingRecord = normalize$e(input, store.readEntry(key), {
|
|
1031
1031
|
fullPath: key,
|
|
1032
1032
|
parent: path.parent,
|
|
1033
1033
|
propertyName: path.propertyName,
|
|
1034
1034
|
ttl: ttlToUse
|
|
1035
1035
|
});
|
|
1036
|
-
if (existingRecord === undefined || equals$
|
|
1036
|
+
if (existingRecord === undefined || equals$i(existingRecord, incomingRecord) === false) {
|
|
1037
1037
|
luvio.storePublish(key, incomingRecord);
|
|
1038
1038
|
}
|
|
1039
1039
|
{
|
|
1040
1040
|
const storeMetadataParams = {
|
|
1041
1041
|
ttl: ttlToUse,
|
|
1042
1042
|
namespace: "LearningContentPlatform",
|
|
1043
|
-
version: VERSION$
|
|
1044
|
-
representationName: RepresentationType$
|
|
1043
|
+
version: VERSION$i,
|
|
1044
|
+
representationName: RepresentationType$e,
|
|
1045
1045
|
};
|
|
1046
1046
|
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1047
1047
|
}
|
|
1048
1048
|
return createLink(key);
|
|
1049
1049
|
};
|
|
1050
|
-
function getTypeCacheKeys$
|
|
1050
|
+
function getTypeCacheKeys$e(luvio, input, fullPathFactory) {
|
|
1051
1051
|
const rootKeySet = new StoreKeyMap();
|
|
1052
1052
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1053
|
-
const rootKey = keyBuilderFromType$
|
|
1053
|
+
const rootKey = keyBuilderFromType$8(luvio, input);
|
|
1054
1054
|
rootKeySet.set(rootKey, {
|
|
1055
1055
|
namespace: keyPrefix,
|
|
1056
|
-
representationName: RepresentationType$
|
|
1056
|
+
representationName: RepresentationType$e,
|
|
1057
1057
|
mergeable: false
|
|
1058
1058
|
});
|
|
1059
1059
|
return rootKeySet;
|
|
1060
1060
|
}
|
|
1061
1061
|
|
|
1062
|
-
const VERSION$
|
|
1063
|
-
function validate$
|
|
1062
|
+
const VERSION$h = "94c7194d9578589364c6efd021226634";
|
|
1063
|
+
function validate$h(obj, path = 'FeaturedItemRecommendedListRepresentation') {
|
|
1064
1064
|
const v_error = (() => {
|
|
1065
1065
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1066
1066
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1080,14 +1080,14 @@ function validate$f(obj, path = 'FeaturedItemRecommendedListRepresentation') {
|
|
|
1080
1080
|
})();
|
|
1081
1081
|
return v_error === undefined ? null : v_error;
|
|
1082
1082
|
}
|
|
1083
|
-
const RepresentationType$
|
|
1084
|
-
function normalize$
|
|
1083
|
+
const RepresentationType$d = 'FeaturedItemRecommendedListRepresentation';
|
|
1084
|
+
function normalize$d(input, existing, path, luvio, store, timestamp) {
|
|
1085
1085
|
const input_recommendedList = input.recommendedList;
|
|
1086
1086
|
const input_recommendedList_id = path.fullPath + '__recommendedList';
|
|
1087
1087
|
for (let i = 0; i < input_recommendedList.length; i++) {
|
|
1088
1088
|
const input_recommendedList_item = input_recommendedList[i];
|
|
1089
1089
|
let input_recommendedList_item_id = input_recommendedList_id + '__' + i;
|
|
1090
|
-
input_recommendedList[i] = ingest$
|
|
1090
|
+
input_recommendedList[i] = ingest$e(input_recommendedList_item, {
|
|
1091
1091
|
fullPath: input_recommendedList_item_id,
|
|
1092
1092
|
propertyName: i,
|
|
1093
1093
|
parent: {
|
|
@@ -1100,22 +1100,22 @@ function normalize$c(input, existing, path, luvio, store, timestamp) {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
return input;
|
|
1102
1102
|
}
|
|
1103
|
-
const select$
|
|
1103
|
+
const select$t = function FeaturedItemRecommendedListRepresentationSelect() {
|
|
1104
1104
|
return {
|
|
1105
1105
|
kind: 'Fragment',
|
|
1106
|
-
version: VERSION$
|
|
1106
|
+
version: VERSION$h,
|
|
1107
1107
|
private: [],
|
|
1108
1108
|
selections: [
|
|
1109
1109
|
{
|
|
1110
1110
|
name: 'recommendedList',
|
|
1111
1111
|
kind: 'Link',
|
|
1112
1112
|
plural: true,
|
|
1113
|
-
fragment: select$
|
|
1113
|
+
fragment: select$u()
|
|
1114
1114
|
}
|
|
1115
1115
|
]
|
|
1116
1116
|
};
|
|
1117
1117
|
};
|
|
1118
|
-
function equals$
|
|
1118
|
+
function equals$h(existing, incoming) {
|
|
1119
1119
|
const existing_recommendedList = existing.recommendedList;
|
|
1120
1120
|
const incoming_recommendedList = incoming.recommendedList;
|
|
1121
1121
|
const equals_recommendedList_items = equalsArray(existing_recommendedList, incoming_recommendedList, (existing_recommendedList_item, incoming_recommendedList_item) => {
|
|
@@ -1128,9 +1128,9 @@ function equals$f(existing, incoming) {
|
|
|
1128
1128
|
}
|
|
1129
1129
|
return true;
|
|
1130
1130
|
}
|
|
1131
|
-
const ingest$
|
|
1131
|
+
const ingest$d = function FeaturedItemRecommendedListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1132
1132
|
if (process.env.NODE_ENV !== 'production') {
|
|
1133
|
-
const validateError = validate$
|
|
1133
|
+
const validateError = validate$h(input);
|
|
1134
1134
|
if (validateError !== null) {
|
|
1135
1135
|
throw validateError;
|
|
1136
1136
|
}
|
|
@@ -1138,58 +1138,58 @@ const ingest$c = function FeaturedItemRecommendedListRepresentationIngest(input,
|
|
|
1138
1138
|
const key = path.fullPath;
|
|
1139
1139
|
const existingRecord = store.readEntry(key);
|
|
1140
1140
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
1141
|
-
let incomingRecord = normalize$
|
|
1141
|
+
let incomingRecord = normalize$d(input, store.readEntry(key), {
|
|
1142
1142
|
fullPath: key,
|
|
1143
1143
|
parent: path.parent,
|
|
1144
1144
|
propertyName: path.propertyName,
|
|
1145
1145
|
ttl: ttlToUse
|
|
1146
1146
|
}, luvio, store);
|
|
1147
|
-
if (existingRecord === undefined || equals$
|
|
1147
|
+
if (existingRecord === undefined || equals$h(existingRecord, incomingRecord) === false) {
|
|
1148
1148
|
luvio.storePublish(key, incomingRecord);
|
|
1149
1149
|
}
|
|
1150
1150
|
if (ttlToUse !== undefined) {
|
|
1151
1151
|
const storeMetadataParams = {
|
|
1152
1152
|
ttl: ttlToUse,
|
|
1153
1153
|
namespace: "LearningContentPlatform",
|
|
1154
|
-
version: VERSION$
|
|
1155
|
-
representationName: RepresentationType$
|
|
1154
|
+
version: VERSION$h,
|
|
1155
|
+
representationName: RepresentationType$d,
|
|
1156
1156
|
};
|
|
1157
1157
|
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1158
1158
|
}
|
|
1159
1159
|
return createLink(key);
|
|
1160
1160
|
};
|
|
1161
|
-
function getTypeCacheKeys$
|
|
1161
|
+
function getTypeCacheKeys$d(luvio, input, fullPathFactory) {
|
|
1162
1162
|
const rootKeySet = new StoreKeyMap();
|
|
1163
1163
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1164
1164
|
const rootKey = fullPathFactory();
|
|
1165
1165
|
rootKeySet.set(rootKey, {
|
|
1166
1166
|
namespace: keyPrefix,
|
|
1167
|
-
representationName: RepresentationType$
|
|
1167
|
+
representationName: RepresentationType$d,
|
|
1168
1168
|
mergeable: false
|
|
1169
1169
|
});
|
|
1170
1170
|
const input_recommendedList_length = input.recommendedList.length;
|
|
1171
1171
|
for (let i = 0; i < input_recommendedList_length; i++) {
|
|
1172
|
-
rootKeySet.merge(getTypeCacheKeys$
|
|
1172
|
+
rootKeySet.merge(getTypeCacheKeys$e(luvio, input.recommendedList[i]));
|
|
1173
1173
|
}
|
|
1174
1174
|
return rootKeySet;
|
|
1175
1175
|
}
|
|
1176
1176
|
|
|
1177
|
-
function select$
|
|
1178
|
-
return select$
|
|
1177
|
+
function select$s(luvio, params) {
|
|
1178
|
+
return select$t();
|
|
1179
1179
|
}
|
|
1180
|
-
function keyBuilder$
|
|
1180
|
+
function keyBuilder$v(luvio, params) {
|
|
1181
1181
|
return keyPrefix + '::FeaturedItemRecommendedListRepresentation:(' + 'appId:' + params.queryParams.appId + ',' + 'context:' + params.queryParams.context + ')';
|
|
1182
1182
|
}
|
|
1183
|
-
function getResponseCacheKeys$
|
|
1184
|
-
return getTypeCacheKeys$
|
|
1183
|
+
function getResponseCacheKeys$b(luvio, resourceParams, response) {
|
|
1184
|
+
return getTypeCacheKeys$d(luvio, response, () => keyBuilder$v(luvio, resourceParams));
|
|
1185
1185
|
}
|
|
1186
|
-
function ingestSuccess$
|
|
1186
|
+
function ingestSuccess$b(luvio, resourceParams, response, snapshotRefresh) {
|
|
1187
1187
|
const { body } = response;
|
|
1188
|
-
const key = keyBuilder$
|
|
1189
|
-
luvio.storeIngest(key, ingest$
|
|
1188
|
+
const key = keyBuilder$v(luvio, resourceParams);
|
|
1189
|
+
luvio.storeIngest(key, ingest$d, body);
|
|
1190
1190
|
const snapshot = luvio.storeLookup({
|
|
1191
1191
|
recordId: key,
|
|
1192
|
-
node: select$
|
|
1192
|
+
node: select$s(),
|
|
1193
1193
|
variables: {},
|
|
1194
1194
|
}, snapshotRefresh);
|
|
1195
1195
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1199,13 +1199,13 @@ function ingestSuccess$a(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1199
1199
|
}
|
|
1200
1200
|
return snapshot;
|
|
1201
1201
|
}
|
|
1202
|
-
function ingestError$
|
|
1203
|
-
const key = keyBuilder$
|
|
1202
|
+
function ingestError$b(luvio, params, error, snapshotRefresh) {
|
|
1203
|
+
const key = keyBuilder$v(luvio, params);
|
|
1204
1204
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1205
1205
|
luvio.storeIngestError(key, errorSnapshot);
|
|
1206
1206
|
return errorSnapshot;
|
|
1207
1207
|
}
|
|
1208
|
-
function createResourceRequest$
|
|
1208
|
+
function createResourceRequest$b(config) {
|
|
1209
1209
|
const headers = {};
|
|
1210
1210
|
return {
|
|
1211
1211
|
baseUri: '/services/data/v58.0',
|
|
@@ -1226,7 +1226,7 @@ const getFeaturedItemsRecommendedList_ConfigPropertyNames = {
|
|
|
1226
1226
|
optional: []
|
|
1227
1227
|
}
|
|
1228
1228
|
};
|
|
1229
|
-
function createResourceParams$
|
|
1229
|
+
function createResourceParams$b(config) {
|
|
1230
1230
|
const resourceParams = {
|
|
1231
1231
|
queryParams: {
|
|
1232
1232
|
appId: config.appId, context: config.context
|
|
@@ -1234,11 +1234,11 @@ function createResourceParams$a(config) {
|
|
|
1234
1234
|
};
|
|
1235
1235
|
return resourceParams;
|
|
1236
1236
|
}
|
|
1237
|
-
function keyBuilder$
|
|
1238
|
-
const resourceParams = createResourceParams$
|
|
1239
|
-
return keyBuilder$
|
|
1237
|
+
function keyBuilder$u(luvio, config) {
|
|
1238
|
+
const resourceParams = createResourceParams$b(config);
|
|
1239
|
+
return keyBuilder$v(luvio, resourceParams);
|
|
1240
1240
|
}
|
|
1241
|
-
function typeCheckConfig$
|
|
1241
|
+
function typeCheckConfig$b(untrustedConfig) {
|
|
1242
1242
|
const config = {};
|
|
1243
1243
|
const untrustedConfig_appId = untrustedConfig.appId;
|
|
1244
1244
|
if (typeof untrustedConfig_appId === 'string') {
|
|
@@ -1250,48 +1250,48 @@ function typeCheckConfig$a(untrustedConfig) {
|
|
|
1250
1250
|
}
|
|
1251
1251
|
return config;
|
|
1252
1252
|
}
|
|
1253
|
-
function validateAdapterConfig$
|
|
1253
|
+
function validateAdapterConfig$b(untrustedConfig, configPropertyNames) {
|
|
1254
1254
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1255
1255
|
return null;
|
|
1256
1256
|
}
|
|
1257
1257
|
if (process.env.NODE_ENV !== 'production') {
|
|
1258
1258
|
validateConfig(untrustedConfig, configPropertyNames);
|
|
1259
1259
|
}
|
|
1260
|
-
const config = typeCheckConfig$
|
|
1260
|
+
const config = typeCheckConfig$b(untrustedConfig);
|
|
1261
1261
|
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1262
1262
|
return null;
|
|
1263
1263
|
}
|
|
1264
1264
|
return config;
|
|
1265
1265
|
}
|
|
1266
|
-
function adapterFragment$
|
|
1267
|
-
createResourceParams$
|
|
1268
|
-
return select$
|
|
1266
|
+
function adapterFragment$b(luvio, config) {
|
|
1267
|
+
createResourceParams$b(config);
|
|
1268
|
+
return select$s();
|
|
1269
1269
|
}
|
|
1270
|
-
function onFetchResponseSuccess$
|
|
1271
|
-
const snapshot = ingestSuccess$
|
|
1270
|
+
function onFetchResponseSuccess$b(luvio, config, resourceParams, response) {
|
|
1271
|
+
const snapshot = ingestSuccess$b(luvio, resourceParams, response, {
|
|
1272
1272
|
config,
|
|
1273
|
-
resolve: () => buildNetworkSnapshot$
|
|
1273
|
+
resolve: () => buildNetworkSnapshot$b(luvio, config, snapshotRefreshOptions)
|
|
1274
1274
|
});
|
|
1275
1275
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1276
1276
|
}
|
|
1277
|
-
function onFetchResponseError$
|
|
1278
|
-
const snapshot = ingestError$
|
|
1277
|
+
function onFetchResponseError$b(luvio, config, resourceParams, response) {
|
|
1278
|
+
const snapshot = ingestError$b(luvio, resourceParams, response, {
|
|
1279
1279
|
config,
|
|
1280
|
-
resolve: () => buildNetworkSnapshot$
|
|
1280
|
+
resolve: () => buildNetworkSnapshot$b(luvio, config, snapshotRefreshOptions)
|
|
1281
1281
|
});
|
|
1282
1282
|
return luvio.storeBroadcast().then(() => snapshot);
|
|
1283
1283
|
}
|
|
1284
|
-
function buildNetworkSnapshot$
|
|
1285
|
-
const resourceParams = createResourceParams$
|
|
1286
|
-
const request = createResourceRequest$
|
|
1284
|
+
function buildNetworkSnapshot$b(luvio, config, options) {
|
|
1285
|
+
const resourceParams = createResourceParams$b(config);
|
|
1286
|
+
const request = createResourceRequest$b(resourceParams);
|
|
1287
1287
|
return luvio.dispatchResourceRequest(request, options)
|
|
1288
1288
|
.then((response) => {
|
|
1289
|
-
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$
|
|
1289
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$b(luvio, config, resourceParams, response), () => getResponseCacheKeys$b(luvio, resourceParams, response.body));
|
|
1290
1290
|
}, (response) => {
|
|
1291
|
-
return luvio.handleErrorResponse(() => onFetchResponseError$
|
|
1291
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$b(luvio, config, resourceParams, response));
|
|
1292
1292
|
});
|
|
1293
1293
|
}
|
|
1294
|
-
function buildNetworkSnapshotCachePolicy$
|
|
1294
|
+
function buildNetworkSnapshotCachePolicy$b(context, coercedAdapterRequestContext) {
|
|
1295
1295
|
const { luvio, config } = context;
|
|
1296
1296
|
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
1297
1297
|
const dispatchOptions = {
|
|
@@ -1306,33 +1306,33 @@ function buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext
|
|
|
1306
1306
|
priority: networkPriority
|
|
1307
1307
|
};
|
|
1308
1308
|
}
|
|
1309
|
-
return buildNetworkSnapshot$
|
|
1309
|
+
return buildNetworkSnapshot$b(luvio, config, dispatchOptions);
|
|
1310
1310
|
}
|
|
1311
|
-
function buildCachedSnapshotCachePolicy$
|
|
1311
|
+
function buildCachedSnapshotCachePolicy$b(context, storeLookup) {
|
|
1312
1312
|
const { luvio, config } = context;
|
|
1313
1313
|
const selector = {
|
|
1314
|
-
recordId: keyBuilder$
|
|
1315
|
-
node: adapterFragment$
|
|
1314
|
+
recordId: keyBuilder$u(luvio, config),
|
|
1315
|
+
node: adapterFragment$b(luvio, config),
|
|
1316
1316
|
variables: {},
|
|
1317
1317
|
};
|
|
1318
1318
|
const cacheSnapshot = storeLookup(selector, {
|
|
1319
1319
|
config,
|
|
1320
|
-
resolve: () => buildNetworkSnapshot$
|
|
1320
|
+
resolve: () => buildNetworkSnapshot$b(luvio, config, snapshotRefreshOptions)
|
|
1321
1321
|
});
|
|
1322
1322
|
return cacheSnapshot;
|
|
1323
1323
|
}
|
|
1324
1324
|
const getFeaturedItemsRecommendedListAdapterFactory = (luvio) => function LearningContentPlatform__getFeaturedItemsRecommendedList(untrustedConfig, requestContext) {
|
|
1325
|
-
const config = validateAdapterConfig$
|
|
1325
|
+
const config = validateAdapterConfig$b(untrustedConfig, getFeaturedItemsRecommendedList_ConfigPropertyNames);
|
|
1326
1326
|
// Invalid or incomplete config
|
|
1327
1327
|
if (config === null) {
|
|
1328
1328
|
return null;
|
|
1329
1329
|
}
|
|
1330
1330
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1331
|
-
buildCachedSnapshotCachePolicy$
|
|
1331
|
+
buildCachedSnapshotCachePolicy$b, buildNetworkSnapshotCachePolicy$b);
|
|
1332
1332
|
};
|
|
1333
1333
|
|
|
1334
|
-
const VERSION$
|
|
1335
|
-
function validate$
|
|
1334
|
+
const VERSION$g = "5d7adb55f43466f61c4837ebf27eab61";
|
|
1335
|
+
function validate$g(obj, path = 'FeaturedItemRelatedListRepresentation') {
|
|
1336
1336
|
const v_error = (() => {
|
|
1337
1337
|
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1338
1338
|
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
@@ -1352,14 +1352,14 @@ function validate$e(obj, path = 'FeaturedItemRelatedListRepresentation') {
|
|
|
1352
1352
|
})();
|
|
1353
1353
|
return v_error === undefined ? null : v_error;
|
|
1354
1354
|
}
|
|
1355
|
-
const RepresentationType$
|
|
1356
|
-
function normalize$
|
|
1355
|
+
const RepresentationType$c = 'FeaturedItemRelatedListRepresentation';
|
|
1356
|
+
function normalize$c(input, existing, path, luvio, store, timestamp) {
|
|
1357
1357
|
const input_relatedList = input.relatedList;
|
|
1358
1358
|
const input_relatedList_id = path.fullPath + '__relatedList';
|
|
1359
1359
|
for (let i = 0; i < input_relatedList.length; i++) {
|
|
1360
1360
|
const input_relatedList_item = input_relatedList[i];
|
|
1361
1361
|
let input_relatedList_item_id = input_relatedList_id + '__' + i;
|
|
1362
|
-
input_relatedList[i] = ingest$
|
|
1362
|
+
input_relatedList[i] = ingest$e(input_relatedList_item, {
|
|
1363
1363
|
fullPath: input_relatedList_item_id,
|
|
1364
1364
|
propertyName: i,
|
|
1365
1365
|
parent: {
|
|
@@ -1372,22 +1372,22 @@ function normalize$b(input, existing, path, luvio, store, timestamp) {
|
|
|
1372
1372
|
}
|
|
1373
1373
|
return input;
|
|
1374
1374
|
}
|
|
1375
|
-
const select$
|
|
1375
|
+
const select$r = function FeaturedItemRelatedListRepresentationSelect() {
|
|
1376
1376
|
return {
|
|
1377
1377
|
kind: 'Fragment',
|
|
1378
|
-
version: VERSION$
|
|
1378
|
+
version: VERSION$g,
|
|
1379
1379
|
private: [],
|
|
1380
1380
|
selections: [
|
|
1381
1381
|
{
|
|
1382
1382
|
name: 'relatedList',
|
|
1383
1383
|
kind: 'Link',
|
|
1384
1384
|
plural: true,
|
|
1385
|
-
fragment: select$
|
|
1385
|
+
fragment: select$u()
|
|
1386
1386
|
}
|
|
1387
1387
|
]
|
|
1388
1388
|
};
|
|
1389
1389
|
};
|
|
1390
|
-
function equals$
|
|
1390
|
+
function equals$g(existing, incoming) {
|
|
1391
1391
|
const existing_relatedList = existing.relatedList;
|
|
1392
1392
|
const incoming_relatedList = incoming.relatedList;
|
|
1393
1393
|
const equals_relatedList_items = equalsArray(existing_relatedList, incoming_relatedList, (existing_relatedList_item, incoming_relatedList_item) => {
|
|
@@ -1400,9 +1400,9 @@ function equals$e(existing, incoming) {
|
|
|
1400
1400
|
}
|
|
1401
1401
|
return true;
|
|
1402
1402
|
}
|
|
1403
|
-
const ingest$
|
|
1403
|
+
const ingest$c = function FeaturedItemRelatedListRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1404
1404
|
if (process.env.NODE_ENV !== 'production') {
|
|
1405
|
-
const validateError = validate$
|
|
1405
|
+
const validateError = validate$g(input);
|
|
1406
1406
|
if (validateError !== null) {
|
|
1407
1407
|
throw validateError;
|
|
1408
1408
|
}
|
|
@@ -1410,58 +1410,58 @@ const ingest$b = function FeaturedItemRelatedListRepresentationIngest(input, pat
|
|
|
1410
1410
|
const key = path.fullPath;
|
|
1411
1411
|
const existingRecord = store.readEntry(key);
|
|
1412
1412
|
const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
|
|
1413
|
-
let incomingRecord = normalize$
|
|
1413
|
+
let incomingRecord = normalize$c(input, store.readEntry(key), {
|
|
1414
1414
|
fullPath: key,
|
|
1415
1415
|
parent: path.parent,
|
|
1416
1416
|
propertyName: path.propertyName,
|
|
1417
1417
|
ttl: ttlToUse
|
|
1418
1418
|
}, luvio, store);
|
|
1419
|
-
if (existingRecord === undefined || equals$
|
|
1419
|
+
if (existingRecord === undefined || equals$g(existingRecord, incomingRecord) === false) {
|
|
1420
1420
|
luvio.storePublish(key, incomingRecord);
|
|
1421
1421
|
}
|
|
1422
1422
|
if (ttlToUse !== undefined) {
|
|
1423
1423
|
const storeMetadataParams = {
|
|
1424
1424
|
ttl: ttlToUse,
|
|
1425
1425
|
namespace: "LearningContentPlatform",
|
|
1426
|
-
version: VERSION$
|
|
1427
|
-
representationName: RepresentationType$
|
|
1426
|
+
version: VERSION$g,
|
|
1427
|
+
representationName: RepresentationType$c,
|
|
1428
1428
|
};
|
|
1429
1429
|
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1430
1430
|
}
|
|
1431
1431
|
return createLink(key);
|
|
1432
1432
|
};
|
|
1433
|
-
function getTypeCacheKeys$
|
|
1433
|
+
function getTypeCacheKeys$c(luvio, input, fullPathFactory) {
|
|
1434
1434
|
const rootKeySet = new StoreKeyMap();
|
|
1435
1435
|
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1436
1436
|
const rootKey = fullPathFactory();
|
|
1437
1437
|
rootKeySet.set(rootKey, {
|
|
1438
1438
|
namespace: keyPrefix,
|
|
1439
|
-
representationName: RepresentationType$
|
|
1439
|
+
representationName: RepresentationType$c,
|
|
1440
1440
|
mergeable: false
|
|
1441
1441
|
});
|
|
1442
1442
|
const input_relatedList_length = input.relatedList.length;
|
|
1443
1443
|
for (let i = 0; i < input_relatedList_length; i++) {
|
|
1444
|
-
rootKeySet.merge(getTypeCacheKeys$
|
|
1444
|
+
rootKeySet.merge(getTypeCacheKeys$e(luvio, input.relatedList[i]));
|
|
1445
1445
|
}
|
|
1446
1446
|
return rootKeySet;
|
|
1447
1447
|
}
|
|
1448
1448
|
|
|
1449
|
-
function select$
|
|
1450
|
-
return select$
|
|
1449
|
+
function select$q(luvio, params) {
|
|
1450
|
+
return select$r();
|
|
1451
1451
|
}
|
|
1452
|
-
function keyBuilder$
|
|
1452
|
+
function keyBuilder$t(luvio, params) {
|
|
1453
1453
|
return keyPrefix + '::FeaturedItemRelatedListRepresentation:(' + 'appId:' + params.queryParams.appId + ',' + 'pageRef:' + params.queryParams.pageRef + ')';
|
|
1454
1454
|
}
|
|
1455
|
-
function getResponseCacheKeys$
|
|
1456
|
-
return getTypeCacheKeys$
|
|
1455
|
+
function getResponseCacheKeys$a(luvio, resourceParams, response) {
|
|
1456
|
+
return getTypeCacheKeys$c(luvio, response, () => keyBuilder$t(luvio, resourceParams));
|
|
1457
1457
|
}
|
|
1458
|
-
function ingestSuccess$
|
|
1458
|
+
function ingestSuccess$a(luvio, resourceParams, response, snapshotRefresh) {
|
|
1459
1459
|
const { body } = response;
|
|
1460
|
-
const key = keyBuilder$
|
|
1461
|
-
luvio.storeIngest(key, ingest$
|
|
1460
|
+
const key = keyBuilder$t(luvio, resourceParams);
|
|
1461
|
+
luvio.storeIngest(key, ingest$c, body);
|
|
1462
1462
|
const snapshot = luvio.storeLookup({
|
|
1463
1463
|
recordId: key,
|
|
1464
|
-
node: select$
|
|
1464
|
+
node: select$q(),
|
|
1465
1465
|
variables: {},
|
|
1466
1466
|
}, snapshotRefresh);
|
|
1467
1467
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1471,13 +1471,13 @@ function ingestSuccess$9(luvio, resourceParams, response, snapshotRefresh) {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
return snapshot;
|
|
1473
1473
|
}
|
|
1474
|
-
function ingestError$
|
|
1475
|
-
const key = keyBuilder$
|
|
1474
|
+
function ingestError$a(luvio, params, error, snapshotRefresh) {
|
|
1475
|
+
const key = keyBuilder$t(luvio, params);
|
|
1476
1476
|
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1477
1477
|
luvio.storeIngestError(key, errorSnapshot);
|
|
1478
1478
|
return errorSnapshot;
|
|
1479
1479
|
}
|
|
1480
|
-
function createResourceRequest$
|
|
1480
|
+
function createResourceRequest$a(config) {
|
|
1481
1481
|
const headers = {};
|
|
1482
1482
|
return {
|
|
1483
1483
|
baseUri: '/services/data/v58.0',
|
|
@@ -1498,7 +1498,7 @@ const getFeaturedItemsRelatedList_ConfigPropertyNames = {
|
|
|
1498
1498
|
optional: []
|
|
1499
1499
|
}
|
|
1500
1500
|
};
|
|
1501
|
-
function createResourceParams$
|
|
1501
|
+
function createResourceParams$a(config) {
|
|
1502
1502
|
const resourceParams = {
|
|
1503
1503
|
queryParams: {
|
|
1504
1504
|
appId: config.appId, pageRef: config.pageRef
|
|
@@ -1506,11 +1506,11 @@ function createResourceParams$9(config) {
|
|
|
1506
1506
|
};
|
|
1507
1507
|
return resourceParams;
|
|
1508
1508
|
}
|
|
1509
|
-
function keyBuilder$
|
|
1510
|
-
const resourceParams = createResourceParams$
|
|
1511
|
-
return keyBuilder$
|
|
1509
|
+
function keyBuilder$s(luvio, config) {
|
|
1510
|
+
const resourceParams = createResourceParams$a(config);
|
|
1511
|
+
return keyBuilder$t(luvio, resourceParams);
|
|
1512
1512
|
}
|
|
1513
|
-
function typeCheckConfig$
|
|
1513
|
+
function typeCheckConfig$a(untrustedConfig) {
|
|
1514
1514
|
const config = {};
|
|
1515
1515
|
const untrustedConfig_appId = untrustedConfig.appId;
|
|
1516
1516
|
if (typeof untrustedConfig_appId === 'string') {
|
|
@@ -1522,6 +1522,479 @@ function typeCheckConfig$9(untrustedConfig) {
|
|
|
1522
1522
|
}
|
|
1523
1523
|
return config;
|
|
1524
1524
|
}
|
|
1525
|
+
function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
|
|
1526
|
+
if (!untrustedIsObject(untrustedConfig)) {
|
|
1527
|
+
return null;
|
|
1528
|
+
}
|
|
1529
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1530
|
+
validateConfig(untrustedConfig, configPropertyNames);
|
|
1531
|
+
}
|
|
1532
|
+
const config = typeCheckConfig$a(untrustedConfig);
|
|
1533
|
+
if (!areRequiredParametersPresent(config, configPropertyNames)) {
|
|
1534
|
+
return null;
|
|
1535
|
+
}
|
|
1536
|
+
return config;
|
|
1537
|
+
}
|
|
1538
|
+
function adapterFragment$a(luvio, config) {
|
|
1539
|
+
createResourceParams$a(config);
|
|
1540
|
+
return select$q();
|
|
1541
|
+
}
|
|
1542
|
+
function onFetchResponseSuccess$a(luvio, config, resourceParams, response) {
|
|
1543
|
+
const snapshot = ingestSuccess$a(luvio, resourceParams, response, {
|
|
1544
|
+
config,
|
|
1545
|
+
resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
|
|
1546
|
+
});
|
|
1547
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1548
|
+
}
|
|
1549
|
+
function onFetchResponseError$a(luvio, config, resourceParams, response) {
|
|
1550
|
+
const snapshot = ingestError$a(luvio, resourceParams, response, {
|
|
1551
|
+
config,
|
|
1552
|
+
resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
|
|
1553
|
+
});
|
|
1554
|
+
return luvio.storeBroadcast().then(() => snapshot);
|
|
1555
|
+
}
|
|
1556
|
+
function buildNetworkSnapshot$a(luvio, config, options) {
|
|
1557
|
+
const resourceParams = createResourceParams$a(config);
|
|
1558
|
+
const request = createResourceRequest$a(resourceParams);
|
|
1559
|
+
return luvio.dispatchResourceRequest(request, options)
|
|
1560
|
+
.then((response) => {
|
|
1561
|
+
return luvio.handleSuccessResponse(() => onFetchResponseSuccess$a(luvio, config, resourceParams, response), () => getResponseCacheKeys$a(luvio, resourceParams, response.body));
|
|
1562
|
+
}, (response) => {
|
|
1563
|
+
return luvio.handleErrorResponse(() => onFetchResponseError$a(luvio, config, resourceParams, response));
|
|
1564
|
+
});
|
|
1565
|
+
}
|
|
1566
|
+
function buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext) {
|
|
1567
|
+
const { luvio, config } = context;
|
|
1568
|
+
const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
|
|
1569
|
+
const dispatchOptions = {
|
|
1570
|
+
resourceRequestContext: {
|
|
1571
|
+
requestCorrelator,
|
|
1572
|
+
luvioRequestMethod: undefined,
|
|
1573
|
+
},
|
|
1574
|
+
eventObservers
|
|
1575
|
+
};
|
|
1576
|
+
if (networkPriority !== 'normal') {
|
|
1577
|
+
dispatchOptions.overrides = {
|
|
1578
|
+
priority: networkPriority
|
|
1579
|
+
};
|
|
1580
|
+
}
|
|
1581
|
+
return buildNetworkSnapshot$a(luvio, config, dispatchOptions);
|
|
1582
|
+
}
|
|
1583
|
+
function buildCachedSnapshotCachePolicy$a(context, storeLookup) {
|
|
1584
|
+
const { luvio, config } = context;
|
|
1585
|
+
const selector = {
|
|
1586
|
+
recordId: keyBuilder$s(luvio, config),
|
|
1587
|
+
node: adapterFragment$a(luvio, config),
|
|
1588
|
+
variables: {},
|
|
1589
|
+
};
|
|
1590
|
+
const cacheSnapshot = storeLookup(selector, {
|
|
1591
|
+
config,
|
|
1592
|
+
resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
|
|
1593
|
+
});
|
|
1594
|
+
return cacheSnapshot;
|
|
1595
|
+
}
|
|
1596
|
+
const getFeaturedItemsRelatedListAdapterFactory = (luvio) => function LearningContentPlatform__getFeaturedItemsRelatedList(untrustedConfig, requestContext) {
|
|
1597
|
+
const config = validateAdapterConfig$a(untrustedConfig, getFeaturedItemsRelatedList_ConfigPropertyNames);
|
|
1598
|
+
// Invalid or incomplete config
|
|
1599
|
+
if (config === null) {
|
|
1600
|
+
return null;
|
|
1601
|
+
}
|
|
1602
|
+
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1603
|
+
buildCachedSnapshotCachePolicy$a, buildNetworkSnapshotCachePolicy$a);
|
|
1604
|
+
};
|
|
1605
|
+
|
|
1606
|
+
const VERSION$f = "a415abdc6f1eb9f80ab2e7981189f769";
|
|
1607
|
+
function validate$f(obj, path = 'SurveyQuestionResponseRepresetation') {
|
|
1608
|
+
const v_error = (() => {
|
|
1609
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1610
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1611
|
+
}
|
|
1612
|
+
obj.avgScore;
|
|
1613
|
+
const obj_isRatingResponse = obj.isRatingResponse;
|
|
1614
|
+
const path_isRatingResponse = path + '.isRatingResponse';
|
|
1615
|
+
if (typeof obj_isRatingResponse !== 'boolean') {
|
|
1616
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isRatingResponse + '" (at "' + path_isRatingResponse + '")');
|
|
1617
|
+
}
|
|
1618
|
+
const obj_questionDescription = obj.questionDescription;
|
|
1619
|
+
const path_questionDescription = path + '.questionDescription';
|
|
1620
|
+
if (typeof obj_questionDescription !== 'string') {
|
|
1621
|
+
return new TypeError('Expected "string" but received "' + typeof obj_questionDescription + '" (at "' + path_questionDescription + '")');
|
|
1622
|
+
}
|
|
1623
|
+
const obj_questionId = obj.questionId;
|
|
1624
|
+
const path_questionId = path + '.questionId';
|
|
1625
|
+
if (typeof obj_questionId !== 'string') {
|
|
1626
|
+
return new TypeError('Expected "string" but received "' + typeof obj_questionId + '" (at "' + path_questionId + '")');
|
|
1627
|
+
}
|
|
1628
|
+
const obj_questionName = obj.questionName;
|
|
1629
|
+
const path_questionName = path + '.questionName';
|
|
1630
|
+
if (typeof obj_questionName !== 'string') {
|
|
1631
|
+
return new TypeError('Expected "string" but received "' + typeof obj_questionName + '" (at "' + path_questionName + '")');
|
|
1632
|
+
}
|
|
1633
|
+
const obj_ratingValues = obj.ratingValues;
|
|
1634
|
+
const path_ratingValues = path + '.ratingValues';
|
|
1635
|
+
if (!ArrayIsArray(obj_ratingValues)) {
|
|
1636
|
+
return new TypeError('Expected "array" but received "' + typeof obj_ratingValues + '" (at "' + path_ratingValues + '")');
|
|
1637
|
+
}
|
|
1638
|
+
for (let i = 0; i < obj_ratingValues.length; i++) {
|
|
1639
|
+
const obj_ratingValues_item = obj_ratingValues[i];
|
|
1640
|
+
const path_ratingValues_item = path_ratingValues + '[' + i + ']';
|
|
1641
|
+
if (typeof obj_ratingValues_item !== 'number' || (typeof obj_ratingValues_item === 'number' && Math.floor(obj_ratingValues_item) !== obj_ratingValues_item)) {
|
|
1642
|
+
return new TypeError('Expected "integer" but received "' + typeof obj_ratingValues_item + '" (at "' + path_ratingValues_item + '")');
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
const obj_textValues = obj.textValues;
|
|
1646
|
+
const path_textValues = path + '.textValues';
|
|
1647
|
+
if (typeof obj_textValues !== 'object' || ArrayIsArray(obj_textValues) || obj_textValues === null) {
|
|
1648
|
+
return new TypeError('Expected "object" but received "' + typeof obj_textValues + '" (at "' + path_textValues + '")');
|
|
1649
|
+
}
|
|
1650
|
+
const obj_textValues_keys = ObjectKeys(obj_textValues);
|
|
1651
|
+
for (let i = 0; i < obj_textValues_keys.length; i++) {
|
|
1652
|
+
const key = obj_textValues_keys[i];
|
|
1653
|
+
const obj_textValues_prop = obj_textValues[key];
|
|
1654
|
+
const path_textValues_prop = path_textValues + '["' + key + '"]';
|
|
1655
|
+
if (typeof obj_textValues_prop !== 'string') {
|
|
1656
|
+
return new TypeError('Expected "string" but received "' + typeof obj_textValues_prop + '" (at "' + path_textValues_prop + '")');
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
})();
|
|
1660
|
+
return v_error === undefined ? null : v_error;
|
|
1661
|
+
}
|
|
1662
|
+
const select$p = function SurveyQuestionResponseRepresetationSelect() {
|
|
1663
|
+
return {
|
|
1664
|
+
kind: 'Fragment',
|
|
1665
|
+
version: VERSION$f,
|
|
1666
|
+
private: [],
|
|
1667
|
+
selections: [
|
|
1668
|
+
{
|
|
1669
|
+
name: 'avgScore',
|
|
1670
|
+
kind: 'Scalar'
|
|
1671
|
+
},
|
|
1672
|
+
{
|
|
1673
|
+
name: 'isRatingResponse',
|
|
1674
|
+
kind: 'Scalar'
|
|
1675
|
+
},
|
|
1676
|
+
{
|
|
1677
|
+
name: 'questionDescription',
|
|
1678
|
+
kind: 'Scalar'
|
|
1679
|
+
},
|
|
1680
|
+
{
|
|
1681
|
+
name: 'questionId',
|
|
1682
|
+
kind: 'Scalar'
|
|
1683
|
+
},
|
|
1684
|
+
{
|
|
1685
|
+
name: 'questionName',
|
|
1686
|
+
kind: 'Scalar'
|
|
1687
|
+
},
|
|
1688
|
+
{
|
|
1689
|
+
name: 'ratingValues',
|
|
1690
|
+
kind: 'Scalar',
|
|
1691
|
+
plural: true
|
|
1692
|
+
},
|
|
1693
|
+
{
|
|
1694
|
+
name: 'textValues',
|
|
1695
|
+
kind: 'Scalar',
|
|
1696
|
+
map: true
|
|
1697
|
+
}
|
|
1698
|
+
]
|
|
1699
|
+
};
|
|
1700
|
+
};
|
|
1701
|
+
function equals$f(existing, incoming) {
|
|
1702
|
+
const existing_isRatingResponse = existing.isRatingResponse;
|
|
1703
|
+
const incoming_isRatingResponse = incoming.isRatingResponse;
|
|
1704
|
+
if (!(existing_isRatingResponse === incoming_isRatingResponse)) {
|
|
1705
|
+
return false;
|
|
1706
|
+
}
|
|
1707
|
+
const existing_questionDescription = existing.questionDescription;
|
|
1708
|
+
const incoming_questionDescription = incoming.questionDescription;
|
|
1709
|
+
if (!(existing_questionDescription === incoming_questionDescription)) {
|
|
1710
|
+
return false;
|
|
1711
|
+
}
|
|
1712
|
+
const existing_questionId = existing.questionId;
|
|
1713
|
+
const incoming_questionId = incoming.questionId;
|
|
1714
|
+
if (!(existing_questionId === incoming_questionId)) {
|
|
1715
|
+
return false;
|
|
1716
|
+
}
|
|
1717
|
+
const existing_questionName = existing.questionName;
|
|
1718
|
+
const incoming_questionName = incoming.questionName;
|
|
1719
|
+
if (!(existing_questionName === incoming_questionName)) {
|
|
1720
|
+
return false;
|
|
1721
|
+
}
|
|
1722
|
+
const existing_avgScore = existing.avgScore;
|
|
1723
|
+
const incoming_avgScore = incoming.avgScore;
|
|
1724
|
+
if (!(existing_avgScore === incoming_avgScore)) {
|
|
1725
|
+
return false;
|
|
1726
|
+
}
|
|
1727
|
+
const existing_ratingValues = existing.ratingValues;
|
|
1728
|
+
const incoming_ratingValues = incoming.ratingValues;
|
|
1729
|
+
const equals_ratingValues_items = equalsArray(existing_ratingValues, incoming_ratingValues, (existing_ratingValues_item, incoming_ratingValues_item) => {
|
|
1730
|
+
if (!(existing_ratingValues_item === incoming_ratingValues_item)) {
|
|
1731
|
+
return false;
|
|
1732
|
+
}
|
|
1733
|
+
});
|
|
1734
|
+
if (equals_ratingValues_items === false) {
|
|
1735
|
+
return false;
|
|
1736
|
+
}
|
|
1737
|
+
const existing_textValues = existing.textValues;
|
|
1738
|
+
const incoming_textValues = incoming.textValues;
|
|
1739
|
+
const equals_textValues_props = equalsObject(existing_textValues, incoming_textValues, (existing_textValues_prop, incoming_textValues_prop) => {
|
|
1740
|
+
if (!(existing_textValues_prop === incoming_textValues_prop)) {
|
|
1741
|
+
return false;
|
|
1742
|
+
}
|
|
1743
|
+
});
|
|
1744
|
+
if (equals_textValues_props === false) {
|
|
1745
|
+
return false;
|
|
1746
|
+
}
|
|
1747
|
+
return true;
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1750
|
+
const TTL$7 = 15000;
|
|
1751
|
+
const VERSION$e = "49558b95e59b76b07748b6f259ebe54d";
|
|
1752
|
+
function validate$e(obj, path = 'FeedbackResultRepresentation') {
|
|
1753
|
+
const v_error = (() => {
|
|
1754
|
+
if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
|
|
1755
|
+
return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
|
|
1756
|
+
}
|
|
1757
|
+
const obj_isFeedbackRequestSubmitted = obj.isFeedbackRequestSubmitted;
|
|
1758
|
+
const path_isFeedbackRequestSubmitted = path + '.isFeedbackRequestSubmitted';
|
|
1759
|
+
if (typeof obj_isFeedbackRequestSubmitted !== 'boolean') {
|
|
1760
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isFeedbackRequestSubmitted + '" (at "' + path_isFeedbackRequestSubmitted + '")');
|
|
1761
|
+
}
|
|
1762
|
+
const obj_isFeedbackResultReturned = obj.isFeedbackResultReturned;
|
|
1763
|
+
const path_isFeedbackResultReturned = path + '.isFeedbackResultReturned';
|
|
1764
|
+
if (typeof obj_isFeedbackResultReturned !== 'boolean') {
|
|
1765
|
+
return new TypeError('Expected "boolean" but received "' + typeof obj_isFeedbackResultReturned + '" (at "' + path_isFeedbackResultReturned + '")');
|
|
1766
|
+
}
|
|
1767
|
+
const obj_learningItemId = obj.learningItemId;
|
|
1768
|
+
const path_learningItemId = path + '.learningItemId';
|
|
1769
|
+
if (typeof obj_learningItemId !== 'string') {
|
|
1770
|
+
return new TypeError('Expected "string" but received "' + typeof obj_learningItemId + '" (at "' + path_learningItemId + '")');
|
|
1771
|
+
}
|
|
1772
|
+
const obj_surveyQuestionResponseRepresetationList = obj.surveyQuestionResponseRepresetationList;
|
|
1773
|
+
const path_surveyQuestionResponseRepresetationList = path + '.surveyQuestionResponseRepresetationList';
|
|
1774
|
+
if (!ArrayIsArray(obj_surveyQuestionResponseRepresetationList)) {
|
|
1775
|
+
return new TypeError('Expected "array" but received "' + typeof obj_surveyQuestionResponseRepresetationList + '" (at "' + path_surveyQuestionResponseRepresetationList + '")');
|
|
1776
|
+
}
|
|
1777
|
+
for (let i = 0; i < obj_surveyQuestionResponseRepresetationList.length; i++) {
|
|
1778
|
+
const obj_surveyQuestionResponseRepresetationList_item = obj_surveyQuestionResponseRepresetationList[i];
|
|
1779
|
+
const path_surveyQuestionResponseRepresetationList_item = path_surveyQuestionResponseRepresetationList + '[' + i + ']';
|
|
1780
|
+
const referencepath_surveyQuestionResponseRepresetationList_itemValidationError = validate$f(obj_surveyQuestionResponseRepresetationList_item, path_surveyQuestionResponseRepresetationList_item);
|
|
1781
|
+
if (referencepath_surveyQuestionResponseRepresetationList_itemValidationError !== null) {
|
|
1782
|
+
let message = 'Object doesn\'t match SurveyQuestionResponseRepresetation (at "' + path_surveyQuestionResponseRepresetationList_item + '")\n';
|
|
1783
|
+
message += referencepath_surveyQuestionResponseRepresetationList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
|
|
1784
|
+
return new TypeError(message);
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
obj.totalAvgScore;
|
|
1788
|
+
})();
|
|
1789
|
+
return v_error === undefined ? null : v_error;
|
|
1790
|
+
}
|
|
1791
|
+
const RepresentationType$b = 'FeedbackResultRepresentation';
|
|
1792
|
+
function keyBuilder$r(luvio, config) {
|
|
1793
|
+
return keyPrefix + '::' + RepresentationType$b + ':' + config.learning_item_id;
|
|
1794
|
+
}
|
|
1795
|
+
function keyBuilderFromType$7(luvio, object) {
|
|
1796
|
+
const keyParams = {
|
|
1797
|
+
learning_item_id: object.learningItemId
|
|
1798
|
+
};
|
|
1799
|
+
return keyBuilder$r(luvio, keyParams);
|
|
1800
|
+
}
|
|
1801
|
+
function normalize$b(input, existing, path, luvio, store, timestamp) {
|
|
1802
|
+
return input;
|
|
1803
|
+
}
|
|
1804
|
+
const select$o = function FeedbackResultRepresentationSelect() {
|
|
1805
|
+
const { selections: SurveyQuestionResponseRepresetation__selections, opaque: SurveyQuestionResponseRepresetation__opaque, } = select$p();
|
|
1806
|
+
return {
|
|
1807
|
+
kind: 'Fragment',
|
|
1808
|
+
version: VERSION$e,
|
|
1809
|
+
private: [],
|
|
1810
|
+
selections: [
|
|
1811
|
+
{
|
|
1812
|
+
name: 'isFeedbackRequestSubmitted',
|
|
1813
|
+
kind: 'Scalar'
|
|
1814
|
+
},
|
|
1815
|
+
{
|
|
1816
|
+
name: 'isFeedbackResultReturned',
|
|
1817
|
+
kind: 'Scalar'
|
|
1818
|
+
},
|
|
1819
|
+
{
|
|
1820
|
+
name: 'learningItemId',
|
|
1821
|
+
kind: 'Scalar'
|
|
1822
|
+
},
|
|
1823
|
+
{
|
|
1824
|
+
name: 'surveyQuestionResponseRepresetationList',
|
|
1825
|
+
kind: 'Object',
|
|
1826
|
+
plural: true,
|
|
1827
|
+
selections: SurveyQuestionResponseRepresetation__selections
|
|
1828
|
+
},
|
|
1829
|
+
{
|
|
1830
|
+
name: 'totalAvgScore',
|
|
1831
|
+
kind: 'Scalar'
|
|
1832
|
+
}
|
|
1833
|
+
]
|
|
1834
|
+
};
|
|
1835
|
+
};
|
|
1836
|
+
function equals$e(existing, incoming) {
|
|
1837
|
+
const existing_isFeedbackRequestSubmitted = existing.isFeedbackRequestSubmitted;
|
|
1838
|
+
const incoming_isFeedbackRequestSubmitted = incoming.isFeedbackRequestSubmitted;
|
|
1839
|
+
if (!(existing_isFeedbackRequestSubmitted === incoming_isFeedbackRequestSubmitted)) {
|
|
1840
|
+
return false;
|
|
1841
|
+
}
|
|
1842
|
+
const existing_isFeedbackResultReturned = existing.isFeedbackResultReturned;
|
|
1843
|
+
const incoming_isFeedbackResultReturned = incoming.isFeedbackResultReturned;
|
|
1844
|
+
if (!(existing_isFeedbackResultReturned === incoming_isFeedbackResultReturned)) {
|
|
1845
|
+
return false;
|
|
1846
|
+
}
|
|
1847
|
+
const existing_learningItemId = existing.learningItemId;
|
|
1848
|
+
const incoming_learningItemId = incoming.learningItemId;
|
|
1849
|
+
if (!(existing_learningItemId === incoming_learningItemId)) {
|
|
1850
|
+
return false;
|
|
1851
|
+
}
|
|
1852
|
+
const existing_totalAvgScore = existing.totalAvgScore;
|
|
1853
|
+
const incoming_totalAvgScore = incoming.totalAvgScore;
|
|
1854
|
+
if (!(existing_totalAvgScore === incoming_totalAvgScore)) {
|
|
1855
|
+
return false;
|
|
1856
|
+
}
|
|
1857
|
+
const existing_surveyQuestionResponseRepresetationList = existing.surveyQuestionResponseRepresetationList;
|
|
1858
|
+
const incoming_surveyQuestionResponseRepresetationList = incoming.surveyQuestionResponseRepresetationList;
|
|
1859
|
+
const equals_surveyQuestionResponseRepresetationList_items = equalsArray(existing_surveyQuestionResponseRepresetationList, incoming_surveyQuestionResponseRepresetationList, (existing_surveyQuestionResponseRepresetationList_item, incoming_surveyQuestionResponseRepresetationList_item) => {
|
|
1860
|
+
if (!(equals$f(existing_surveyQuestionResponseRepresetationList_item, incoming_surveyQuestionResponseRepresetationList_item))) {
|
|
1861
|
+
return false;
|
|
1862
|
+
}
|
|
1863
|
+
});
|
|
1864
|
+
if (equals_surveyQuestionResponseRepresetationList_items === false) {
|
|
1865
|
+
return false;
|
|
1866
|
+
}
|
|
1867
|
+
return true;
|
|
1868
|
+
}
|
|
1869
|
+
const ingest$b = function FeedbackResultRepresentationIngest(input, path, luvio, store, timestamp) {
|
|
1870
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1871
|
+
const validateError = validate$e(input);
|
|
1872
|
+
if (validateError !== null) {
|
|
1873
|
+
throw validateError;
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
const key = keyBuilderFromType$7(luvio, input);
|
|
1877
|
+
const existingRecord = store.readEntry(key);
|
|
1878
|
+
const ttlToUse = TTL$7;
|
|
1879
|
+
let incomingRecord = normalize$b(input, store.readEntry(key), {
|
|
1880
|
+
fullPath: key,
|
|
1881
|
+
parent: path.parent,
|
|
1882
|
+
propertyName: path.propertyName,
|
|
1883
|
+
ttl: ttlToUse
|
|
1884
|
+
});
|
|
1885
|
+
if (existingRecord === undefined || equals$e(existingRecord, incomingRecord) === false) {
|
|
1886
|
+
luvio.storePublish(key, incomingRecord);
|
|
1887
|
+
}
|
|
1888
|
+
{
|
|
1889
|
+
const storeMetadataParams = {
|
|
1890
|
+
ttl: ttlToUse,
|
|
1891
|
+
namespace: "LearningContentPlatform",
|
|
1892
|
+
version: VERSION$e,
|
|
1893
|
+
representationName: RepresentationType$b,
|
|
1894
|
+
};
|
|
1895
|
+
luvio.publishStoreMetadata(key, storeMetadataParams);
|
|
1896
|
+
}
|
|
1897
|
+
return createLink(key);
|
|
1898
|
+
};
|
|
1899
|
+
function getTypeCacheKeys$b(luvio, input, fullPathFactory) {
|
|
1900
|
+
const rootKeySet = new StoreKeyMap();
|
|
1901
|
+
// root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
|
|
1902
|
+
const rootKey = keyBuilderFromType$7(luvio, input);
|
|
1903
|
+
rootKeySet.set(rootKey, {
|
|
1904
|
+
namespace: keyPrefix,
|
|
1905
|
+
representationName: RepresentationType$b,
|
|
1906
|
+
mergeable: false
|
|
1907
|
+
});
|
|
1908
|
+
return rootKeySet;
|
|
1909
|
+
}
|
|
1910
|
+
|
|
1911
|
+
function select$n(luvio, params) {
|
|
1912
|
+
return select$o();
|
|
1913
|
+
}
|
|
1914
|
+
function keyBuilder$q(luvio, params) {
|
|
1915
|
+
return keyBuilder$r(luvio, {
|
|
1916
|
+
learning_item_id: params.urlParams.learningItemId
|
|
1917
|
+
});
|
|
1918
|
+
}
|
|
1919
|
+
function getResponseCacheKeys$9(luvio, resourceParams, response) {
|
|
1920
|
+
return getTypeCacheKeys$b(luvio, response);
|
|
1921
|
+
}
|
|
1922
|
+
function ingestSuccess$9(luvio, resourceParams, response, snapshotRefresh) {
|
|
1923
|
+
const { body } = response;
|
|
1924
|
+
const key = keyBuilder$q(luvio, resourceParams);
|
|
1925
|
+
luvio.storeIngest(key, ingest$b, body);
|
|
1926
|
+
const snapshot = luvio.storeLookup({
|
|
1927
|
+
recordId: key,
|
|
1928
|
+
node: select$n(),
|
|
1929
|
+
variables: {},
|
|
1930
|
+
}, snapshotRefresh);
|
|
1931
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
1932
|
+
if (snapshot.state !== 'Fulfilled') {
|
|
1933
|
+
throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
return snapshot;
|
|
1937
|
+
}
|
|
1938
|
+
function ingestError$9(luvio, params, error, snapshotRefresh) {
|
|
1939
|
+
const key = keyBuilder$q(luvio, params);
|
|
1940
|
+
const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
|
|
1941
|
+
const storeMetadataParams = {
|
|
1942
|
+
ttl: TTL$7,
|
|
1943
|
+
namespace: keyPrefix,
|
|
1944
|
+
version: VERSION$e,
|
|
1945
|
+
representationName: RepresentationType$b
|
|
1946
|
+
};
|
|
1947
|
+
luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
|
|
1948
|
+
return errorSnapshot;
|
|
1949
|
+
}
|
|
1950
|
+
function createResourceRequest$9(config) {
|
|
1951
|
+
const headers = {};
|
|
1952
|
+
return {
|
|
1953
|
+
baseUri: '/services/data/v58.0',
|
|
1954
|
+
basePath: '/learning-content-platform/learning/feedbackresult/' + config.urlParams.learningItemId + '',
|
|
1955
|
+
method: 'get',
|
|
1956
|
+
body: null,
|
|
1957
|
+
urlParams: config.urlParams,
|
|
1958
|
+
queryParams: {},
|
|
1959
|
+
headers,
|
|
1960
|
+
priority: 'normal',
|
|
1961
|
+
};
|
|
1962
|
+
}
|
|
1963
|
+
function createResourceRequestFromRepresentation$4(representation) {
|
|
1964
|
+
const config = {
|
|
1965
|
+
urlParams: {},
|
|
1966
|
+
};
|
|
1967
|
+
config.urlParams.learningItemId = representation.learningItemId;
|
|
1968
|
+
return createResourceRequest$9(config);
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
const getFeedbackResult_ConfigPropertyNames = {
|
|
1972
|
+
displayName: 'getFeedbackResult',
|
|
1973
|
+
parameters: {
|
|
1974
|
+
required: ['learningItemId'],
|
|
1975
|
+
optional: []
|
|
1976
|
+
}
|
|
1977
|
+
};
|
|
1978
|
+
function createResourceParams$9(config) {
|
|
1979
|
+
const resourceParams = {
|
|
1980
|
+
urlParams: {
|
|
1981
|
+
learningItemId: config.learningItemId
|
|
1982
|
+
}
|
|
1983
|
+
};
|
|
1984
|
+
return resourceParams;
|
|
1985
|
+
}
|
|
1986
|
+
function keyBuilder$p(luvio, config) {
|
|
1987
|
+
const resourceParams = createResourceParams$9(config);
|
|
1988
|
+
return keyBuilder$q(luvio, resourceParams);
|
|
1989
|
+
}
|
|
1990
|
+
function typeCheckConfig$9(untrustedConfig) {
|
|
1991
|
+
const config = {};
|
|
1992
|
+
const untrustedConfig_learningItemId = untrustedConfig.learningItemId;
|
|
1993
|
+
if (typeof untrustedConfig_learningItemId === 'string') {
|
|
1994
|
+
config.learningItemId = untrustedConfig_learningItemId;
|
|
1995
|
+
}
|
|
1996
|
+
return config;
|
|
1997
|
+
}
|
|
1525
1998
|
function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
|
|
1526
1999
|
if (!untrustedIsObject(untrustedConfig)) {
|
|
1527
2000
|
return null;
|
|
@@ -1593,8 +2066,8 @@ function buildCachedSnapshotCachePolicy$9(context, storeLookup) {
|
|
|
1593
2066
|
});
|
|
1594
2067
|
return cacheSnapshot;
|
|
1595
2068
|
}
|
|
1596
|
-
const
|
|
1597
|
-
const config = validateAdapterConfig$9(untrustedConfig,
|
|
2069
|
+
const getFeedbackResultAdapterFactory = (luvio) => function LearningContentPlatform__getFeedbackResult(untrustedConfig, requestContext) {
|
|
2070
|
+
const config = validateAdapterConfig$9(untrustedConfig, getFeedbackResult_ConfigPropertyNames);
|
|
1598
2071
|
// Invalid or incomplete config
|
|
1599
2072
|
if (config === null) {
|
|
1600
2073
|
return null;
|
|
@@ -1602,6 +2075,36 @@ const getFeaturedItemsRelatedListAdapterFactory = (luvio) => function LearningCo
|
|
|
1602
2075
|
return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
|
|
1603
2076
|
buildCachedSnapshotCachePolicy$9, buildNetworkSnapshotCachePolicy$9);
|
|
1604
2077
|
};
|
|
2078
|
+
const notifyChangeFactory$4 = (luvio, options) => {
|
|
2079
|
+
return function getLearningContentPlatformLearningFeedbackresultByLearningItemIdNotifyChange(configs) {
|
|
2080
|
+
const keys = configs.map(c => keyBuilder$r(luvio, c));
|
|
2081
|
+
luvio.getNotifyChangeStoreEntries(keys).then(entries => {
|
|
2082
|
+
for (let i = 0, len = entries.length; i < len; i++) {
|
|
2083
|
+
const { key, record: val } = entries[i];
|
|
2084
|
+
const refreshRequest = createResourceRequestFromRepresentation$4(val);
|
|
2085
|
+
luvio.dispatchResourceRequest(refreshRequest, options)
|
|
2086
|
+
.then((response) => {
|
|
2087
|
+
return luvio.handleSuccessResponse(() => {
|
|
2088
|
+
const { body } = response;
|
|
2089
|
+
luvio.storeIngest(key, ingest$b, body);
|
|
2090
|
+
return luvio.storeBroadcast();
|
|
2091
|
+
}, () => getTypeCacheKeys$b(luvio, response.body));
|
|
2092
|
+
}, (error) => {
|
|
2093
|
+
return luvio.handleErrorResponse(() => {
|
|
2094
|
+
const errorSnapshot = luvio.errorSnapshot(error);
|
|
2095
|
+
luvio.storeIngestError(key, errorSnapshot, {
|
|
2096
|
+
ttl: TTL$7,
|
|
2097
|
+
namespace: keyPrefix,
|
|
2098
|
+
version: VERSION$e,
|
|
2099
|
+
representationName: RepresentationType$b
|
|
2100
|
+
});
|
|
2101
|
+
return luvio.storeBroadcast().then(() => errorSnapshot);
|
|
2102
|
+
});
|
|
2103
|
+
});
|
|
2104
|
+
}
|
|
2105
|
+
});
|
|
2106
|
+
};
|
|
2107
|
+
};
|
|
1605
2108
|
|
|
1606
2109
|
const VERSION$d = "8471031fcff953c83f350a0f66b60ddb";
|
|
1607
2110
|
function validate$d(obj, path = 'LearningConfigRepresentation') {
|
|
@@ -1883,7 +2386,7 @@ function normalize$9(input, existing, path, luvio, store, timestamp) {
|
|
|
1883
2386
|
for (let i = 0; i < input_list.length; i++) {
|
|
1884
2387
|
const input_list_item = input_list[i];
|
|
1885
2388
|
let input_list_item_id = input_list_id + '__' + i;
|
|
1886
|
-
input_list[i] = ingest$
|
|
2389
|
+
input_list[i] = ingest$f(input_list_item, {
|
|
1887
2390
|
fullPath: input_list_item_id,
|
|
1888
2391
|
propertyName: i,
|
|
1889
2392
|
parent: {
|
|
@@ -1906,7 +2409,7 @@ const select$k = function LearningItemProgressListRepresentationSelect() {
|
|
|
1906
2409
|
name: 'list',
|
|
1907
2410
|
kind: 'Link',
|
|
1908
2411
|
plural: true,
|
|
1909
|
-
fragment: select$
|
|
2412
|
+
fragment: select$w()
|
|
1910
2413
|
}
|
|
1911
2414
|
]
|
|
1912
2415
|
};
|
|
@@ -1965,7 +2468,7 @@ function getTypeCacheKeys$9(luvio, input, fullPathFactory) {
|
|
|
1965
2468
|
});
|
|
1966
2469
|
const input_list_length = input.list.length;
|
|
1967
2470
|
for (let i = 0; i < input_list_length; i++) {
|
|
1968
|
-
rootKeySet.merge(getTypeCacheKeys$
|
|
2471
|
+
rootKeySet.merge(getTypeCacheKeys$f(luvio, input.list[i]));
|
|
1969
2472
|
}
|
|
1970
2473
|
return rootKeySet;
|
|
1971
2474
|
}
|
|
@@ -4617,7 +5120,7 @@ function normalize$2(input, existing, path, luvio, store, timestamp) {
|
|
|
4617
5120
|
for (let i = 0; i < input_results.length; i++) {
|
|
4618
5121
|
const input_results_item = input_results[i];
|
|
4619
5122
|
let input_results_item_id = input_results_id + '__' + i;
|
|
4620
|
-
input_results[i] = ingest$
|
|
5123
|
+
input_results[i] = ingest$e(input_results_item, {
|
|
4621
5124
|
fullPath: input_results_item_id,
|
|
4622
5125
|
propertyName: i,
|
|
4623
5126
|
parent: {
|
|
@@ -4640,7 +5143,7 @@ const select$7 = function LearningSearchResultsRepresentationSelect() {
|
|
|
4640
5143
|
name: 'results',
|
|
4641
5144
|
kind: 'Link',
|
|
4642
5145
|
plural: true,
|
|
4643
|
-
fragment: select$
|
|
5146
|
+
fragment: select$u()
|
|
4644
5147
|
},
|
|
4645
5148
|
{
|
|
4646
5149
|
name: 'totalResults',
|
|
@@ -4717,7 +5220,7 @@ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
|
|
|
4717
5220
|
});
|
|
4718
5221
|
const input_results_length = input.results.length;
|
|
4719
5222
|
for (let i = 0; i < input_results_length; i++) {
|
|
4720
|
-
rootKeySet.merge(getTypeCacheKeys$
|
|
5223
|
+
rootKeySet.merge(getTypeCacheKeys$e(luvio, input.results[i]));
|
|
4721
5224
|
}
|
|
4722
5225
|
return rootKeySet;
|
|
4723
5226
|
}
|
|
@@ -6145,6 +6648,8 @@ const notifyChangeFactory = (luvio, options) => {
|
|
|
6145
6648
|
let evaluateLearningItem;
|
|
6146
6649
|
let getFeaturedItemsRecommendedList;
|
|
6147
6650
|
let getFeaturedItemsRelatedList;
|
|
6651
|
+
let getFeedbackResult;
|
|
6652
|
+
let getFeedbackResultNotifyChange;
|
|
6148
6653
|
let getLearningConfig;
|
|
6149
6654
|
let getLearningItemProgress;
|
|
6150
6655
|
let getLearningItemsList;
|
|
@@ -6161,6 +6666,7 @@ let getTextLessonNotifyChange;
|
|
|
6161
6666
|
// Imperative GET Adapters
|
|
6162
6667
|
let getFeaturedItemsRecommendedList_imperative;
|
|
6163
6668
|
let getFeaturedItemsRelatedList_imperative;
|
|
6669
|
+
let getFeedbackResult_imperative;
|
|
6164
6670
|
let getLearningConfig_imperative;
|
|
6165
6671
|
let getLearningItemProgress_imperative;
|
|
6166
6672
|
let getLearningItemsList_imperative;
|
|
@@ -6172,6 +6678,7 @@ let getModule_imperative;
|
|
|
6172
6678
|
let getTextLesson_imperative;
|
|
6173
6679
|
const getFeaturedItemsRecommendedListMetadata = { apiFamily: 'LearningContentPlatform', name: 'getFeaturedItemsRecommendedList' };
|
|
6174
6680
|
const getFeaturedItemsRelatedListMetadata = { apiFamily: 'LearningContentPlatform', name: 'getFeaturedItemsRelatedList' };
|
|
6681
|
+
const getFeedbackResultMetadata = { apiFamily: 'LearningContentPlatform', name: 'getFeedbackResult', ttl: 15000 };
|
|
6175
6682
|
const getLearningConfigMetadata = { apiFamily: 'LearningContentPlatform', name: 'getLearningConfig' };
|
|
6176
6683
|
const getLearningItemProgressMetadata = { apiFamily: 'LearningContentPlatform', name: 'getLearningItemProgress' };
|
|
6177
6684
|
const getLearningItemsListMetadata = { apiFamily: 'LearningContentPlatform', name: 'getLearningItemsList' };
|
|
@@ -6185,6 +6692,7 @@ function bindExportsTo(luvio) {
|
|
|
6185
6692
|
// LDS Adapters
|
|
6186
6693
|
const getFeaturedItemsRecommendedList_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getFeaturedItemsRecommendedList', getFeaturedItemsRecommendedListAdapterFactory), getFeaturedItemsRecommendedListMetadata);
|
|
6187
6694
|
const getFeaturedItemsRelatedList_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getFeaturedItemsRelatedList', getFeaturedItemsRelatedListAdapterFactory), getFeaturedItemsRelatedListMetadata);
|
|
6695
|
+
const getFeedbackResult_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getFeedbackResult', getFeedbackResultAdapterFactory), getFeedbackResultMetadata);
|
|
6188
6696
|
const getLearningConfig_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getLearningConfig', getLearningConfigAdapterFactory), getLearningConfigMetadata);
|
|
6189
6697
|
const getLearningItemProgress_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getLearningItemProgress', getLearningItemProgressAdapterFactory), getLearningItemProgressMetadata);
|
|
6190
6698
|
const getLearningItemsList_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getLearningItemsList', getLearningItemsListAdapterFactory), getLearningItemsListMetadata);
|
|
@@ -6202,6 +6710,8 @@ function bindExportsTo(luvio) {
|
|
|
6202
6710
|
evaluateLearningItem: unwrapSnapshotData(evaluateLearningItemAdapterFactory),
|
|
6203
6711
|
getFeaturedItemsRecommendedList: createWireAdapterConstructor(luvio, getFeaturedItemsRecommendedList_ldsAdapter, getFeaturedItemsRecommendedListMetadata),
|
|
6204
6712
|
getFeaturedItemsRelatedList: createWireAdapterConstructor(luvio, getFeaturedItemsRelatedList_ldsAdapter, getFeaturedItemsRelatedListMetadata),
|
|
6713
|
+
getFeedbackResult: createWireAdapterConstructor(luvio, getFeedbackResult_ldsAdapter, getFeedbackResultMetadata),
|
|
6714
|
+
getFeedbackResultNotifyChange: createLDSAdapter(luvio, 'getFeedbackResultNotifyChange', notifyChangeFactory$4),
|
|
6205
6715
|
getLearningConfig: createWireAdapterConstructor(luvio, getLearningConfig_ldsAdapter, getLearningConfigMetadata),
|
|
6206
6716
|
getLearningItemProgress: createWireAdapterConstructor(luvio, getLearningItemProgress_ldsAdapter, getLearningItemProgressMetadata),
|
|
6207
6717
|
getLearningItemsList: createWireAdapterConstructor(luvio, getLearningItemsList_ldsAdapter, getLearningItemsListMetadata),
|
|
@@ -6218,6 +6728,7 @@ function bindExportsTo(luvio) {
|
|
|
6218
6728
|
// Imperative GET Adapters
|
|
6219
6729
|
getFeaturedItemsRecommendedList_imperative: createImperativeAdapter(luvio, getFeaturedItemsRecommendedList_ldsAdapter, getFeaturedItemsRecommendedListMetadata),
|
|
6220
6730
|
getFeaturedItemsRelatedList_imperative: createImperativeAdapter(luvio, getFeaturedItemsRelatedList_ldsAdapter, getFeaturedItemsRelatedListMetadata),
|
|
6731
|
+
getFeedbackResult_imperative: createImperativeAdapter(luvio, getFeedbackResult_ldsAdapter, getFeedbackResultMetadata),
|
|
6221
6732
|
getLearningConfig_imperative: createImperativeAdapter(luvio, getLearningConfig_ldsAdapter, getLearningConfigMetadata),
|
|
6222
6733
|
getLearningItemProgress_imperative: createImperativeAdapter(luvio, getLearningItemProgress_ldsAdapter, getLearningItemProgressMetadata),
|
|
6223
6734
|
getLearningItemsList_imperative: createImperativeAdapter(luvio, getLearningItemsList_ldsAdapter, getLearningItemsListMetadata),
|
|
@@ -6234,6 +6745,8 @@ withDefaultLuvio((luvio) => {
|
|
|
6234
6745
|
evaluateLearningItem,
|
|
6235
6746
|
getFeaturedItemsRecommendedList,
|
|
6236
6747
|
getFeaturedItemsRelatedList,
|
|
6748
|
+
getFeedbackResult,
|
|
6749
|
+
getFeedbackResultNotifyChange,
|
|
6237
6750
|
getLearningConfig,
|
|
6238
6751
|
getLearningItemProgress,
|
|
6239
6752
|
getLearningItemsList,
|
|
@@ -6249,6 +6762,7 @@ withDefaultLuvio((luvio) => {
|
|
|
6249
6762
|
getTextLessonNotifyChange,
|
|
6250
6763
|
getFeaturedItemsRecommendedList_imperative,
|
|
6251
6764
|
getFeaturedItemsRelatedList_imperative,
|
|
6765
|
+
getFeedbackResult_imperative,
|
|
6252
6766
|
getLearningConfig_imperative,
|
|
6253
6767
|
getLearningItemProgress_imperative,
|
|
6254
6768
|
getLearningItemsList_imperative,
|
|
@@ -6261,5 +6775,5 @@ withDefaultLuvio((luvio) => {
|
|
|
6261
6775
|
} = bindExportsTo(luvio));
|
|
6262
6776
|
});
|
|
6263
6777
|
|
|
6264
|
-
export { evaluateLearningItem, getFeaturedItemsRecommendedList, getFeaturedItemsRecommendedList_imperative, getFeaturedItemsRelatedList, getFeaturedItemsRelatedList_imperative, getLearningConfig, getLearningConfig_imperative, getLearningItemProgress, getLearningItemProgress_imperative, getLearningItemsList, getLearningItemsList_imperative, getLearningModel, getLearningModel_imperative, getLearningPractice, getLearningPracticeNotifyChange, getLearningPractice_imperative, getLearningSearchDescribe, getLearningSearchDescribe_imperative, getLearningSearchResults, getLearningSearchResultsNotifyChange, getLearningSearchResults_imperative, getModule, getModuleNotifyChange, getModule_imperative, getTextLesson, getTextLessonNotifyChange, getTextLesson_imperative };
|
|
6265
|
-
// version: 1.
|
|
6778
|
+
export { evaluateLearningItem, getFeaturedItemsRecommendedList, getFeaturedItemsRecommendedList_imperative, getFeaturedItemsRelatedList, getFeaturedItemsRelatedList_imperative, getFeedbackResult, getFeedbackResultNotifyChange, getFeedbackResult_imperative, getLearningConfig, getLearningConfig_imperative, getLearningItemProgress, getLearningItemProgress_imperative, getLearningItemsList, getLearningItemsList_imperative, getLearningModel, getLearningModel_imperative, getLearningPractice, getLearningPracticeNotifyChange, getLearningPractice_imperative, getLearningSearchDescribe, getLearningSearchDescribe_imperative, getLearningSearchResults, getLearningSearchResultsNotifyChange, getLearningSearchResults_imperative, getModule, getModuleNotifyChange, getModule_imperative, getTextLesson, getTextLessonNotifyChange, getTextLesson_imperative };
|
|
6779
|
+
// version: 1.133.0-64529055b
|