@salesforce/lds-adapters-platform-learning-content 1.149.0 → 1.150.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.
@@ -91,9 +91,9 @@ function createLink(ref) {
91
91
  };
92
92
  }
93
93
 
94
- const TTL$8 = 15000;
95
- const VERSION$h = "b489f9f2cbdc91a04dd15b4d467b6760";
96
- function validate$i(obj, path = 'FeaturedItemRepresentation') {
94
+ const TTL$6 = 15000;
95
+ const VERSION$e = "b489f9f2cbdc91a04dd15b4d467b6760";
96
+ function validate$f(obj, path = 'FeaturedItemRepresentation') {
97
97
  const v_error = (() => {
98
98
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
99
99
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -490,23 +490,23 @@ function validate$i(obj, path = 'FeaturedItemRepresentation') {
490
490
  })();
491
491
  return v_error === undefined ? null : v_error;
492
492
  }
493
- const RepresentationType$e = 'FeaturedItemRepresentation';
494
- function keyBuilder$u(luvio, config) {
495
- return keyPrefix + '::' + RepresentationType$e + ':' + config.id;
493
+ const RepresentationType$b = 'FeaturedItemRepresentation';
494
+ function keyBuilder$o(luvio, config) {
495
+ return keyPrefix + '::' + RepresentationType$b + ':' + config.id;
496
496
  }
497
- function keyBuilderFromType$8(luvio, object) {
497
+ function keyBuilderFromType$6(luvio, object) {
498
498
  const keyParams = {
499
499
  id: object.id
500
500
  };
501
- return keyBuilder$u(luvio, keyParams);
501
+ return keyBuilder$o(luvio, keyParams);
502
502
  }
503
- function normalize$e(input, existing, path, luvio, store, timestamp) {
503
+ function normalize$b(input, existing, path, luvio, store, timestamp) {
504
504
  return input;
505
505
  }
506
- const select$t = function FeaturedItemRepresentationSelect() {
506
+ const select$o = function FeaturedItemRepresentationSelect() {
507
507
  return {
508
508
  kind: 'Fragment',
509
- version: VERSION$h,
509
+ version: VERSION$e,
510
510
  private: [],
511
511
  selections: [
512
512
  {
@@ -588,7 +588,7 @@ const select$t = function FeaturedItemRepresentationSelect() {
588
588
  ]
589
589
  };
590
590
  };
591
- function equals$h(existing, incoming) {
591
+ function equals$e(existing, incoming) {
592
592
  const existing_description = existing.description;
593
593
  const incoming_description = incoming.description;
594
594
  if (!(existing_description === incoming_description)) {
@@ -686,50 +686,50 @@ function equals$h(existing, incoming) {
686
686
  }
687
687
  return true;
688
688
  }
689
- const ingest$e = function FeaturedItemRepresentationIngest(input, path, luvio, store, timestamp) {
689
+ const ingest$b = function FeaturedItemRepresentationIngest(input, path, luvio, store, timestamp) {
690
690
  if (process.env.NODE_ENV !== 'production') {
691
- const validateError = validate$i(input);
691
+ const validateError = validate$f(input);
692
692
  if (validateError !== null) {
693
693
  throw validateError;
694
694
  }
695
695
  }
696
- const key = keyBuilderFromType$8(luvio, input);
696
+ const key = keyBuilderFromType$6(luvio, input);
697
697
  const existingRecord = store.readEntry(key);
698
- const ttlToUse = TTL$8;
699
- let incomingRecord = normalize$e(input, store.readEntry(key), {
698
+ const ttlToUse = TTL$6;
699
+ let incomingRecord = normalize$b(input, store.readEntry(key), {
700
700
  fullPath: key,
701
701
  parent: path.parent,
702
702
  propertyName: path.propertyName,
703
703
  ttl: ttlToUse
704
704
  });
705
- if (existingRecord === undefined || equals$h(existingRecord, incomingRecord) === false) {
705
+ if (existingRecord === undefined || equals$e(existingRecord, incomingRecord) === false) {
706
706
  luvio.storePublish(key, incomingRecord);
707
707
  }
708
708
  {
709
709
  const storeMetadataParams = {
710
710
  ttl: ttlToUse,
711
711
  namespace: "LearningContentPlatform",
712
- version: VERSION$h,
713
- representationName: RepresentationType$e,
712
+ version: VERSION$e,
713
+ representationName: RepresentationType$b,
714
714
  };
715
715
  luvio.publishStoreMetadata(key, storeMetadataParams);
716
716
  }
717
717
  return createLink(key);
718
718
  };
719
- function getTypeCacheKeys$e(luvio, input, fullPathFactory) {
719
+ function getTypeCacheKeys$b(luvio, input, fullPathFactory) {
720
720
  const rootKeySet = new StoreKeyMap();
721
721
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
722
- const rootKey = keyBuilderFromType$8(luvio, input);
722
+ const rootKey = keyBuilderFromType$6(luvio, input);
723
723
  rootKeySet.set(rootKey, {
724
724
  namespace: keyPrefix,
725
- representationName: RepresentationType$e,
725
+ representationName: RepresentationType$b,
726
726
  mergeable: false
727
727
  });
728
728
  return rootKeySet;
729
729
  }
730
730
 
731
- const VERSION$g = "94c7194d9578589364c6efd021226634";
732
- function validate$h(obj, path = 'FeaturedItemRecommendedListRepresentation') {
731
+ const VERSION$d = "94c7194d9578589364c6efd021226634";
732
+ function validate$e(obj, path = 'FeaturedItemRecommendedListRepresentation') {
733
733
  const v_error = (() => {
734
734
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
735
735
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -749,14 +749,14 @@ function validate$h(obj, path = 'FeaturedItemRecommendedListRepresentation') {
749
749
  })();
750
750
  return v_error === undefined ? null : v_error;
751
751
  }
752
- const RepresentationType$d = 'FeaturedItemRecommendedListRepresentation';
753
- function normalize$d(input, existing, path, luvio, store, timestamp) {
752
+ const RepresentationType$a = 'FeaturedItemRecommendedListRepresentation';
753
+ function normalize$a(input, existing, path, luvio, store, timestamp) {
754
754
  const input_recommendedList = input.recommendedList;
755
755
  const input_recommendedList_id = path.fullPath + '__recommendedList';
756
756
  for (let i = 0; i < input_recommendedList.length; i++) {
757
757
  const input_recommendedList_item = input_recommendedList[i];
758
758
  let input_recommendedList_item_id = input_recommendedList_id + '__' + i;
759
- input_recommendedList[i] = ingest$e(input_recommendedList_item, {
759
+ input_recommendedList[i] = ingest$b(input_recommendedList_item, {
760
760
  fullPath: input_recommendedList_item_id,
761
761
  propertyName: i,
762
762
  parent: {
@@ -769,22 +769,22 @@ function normalize$d(input, existing, path, luvio, store, timestamp) {
769
769
  }
770
770
  return input;
771
771
  }
772
- const select$s = function FeaturedItemRecommendedListRepresentationSelect() {
772
+ const select$n = function FeaturedItemRecommendedListRepresentationSelect() {
773
773
  return {
774
774
  kind: 'Fragment',
775
- version: VERSION$g,
775
+ version: VERSION$d,
776
776
  private: [],
777
777
  selections: [
778
778
  {
779
779
  name: 'recommendedList',
780
780
  kind: 'Link',
781
781
  plural: true,
782
- fragment: select$t()
782
+ fragment: select$o()
783
783
  }
784
784
  ]
785
785
  };
786
786
  };
787
- function equals$g(existing, incoming) {
787
+ function equals$d(existing, incoming) {
788
788
  const existing_recommendedList = existing.recommendedList;
789
789
  const incoming_recommendedList = incoming.recommendedList;
790
790
  const equals_recommendedList_items = equalsArray(existing_recommendedList, incoming_recommendedList, (existing_recommendedList_item, incoming_recommendedList_item) => {
@@ -797,9 +797,9 @@ function equals$g(existing, incoming) {
797
797
  }
798
798
  return true;
799
799
  }
800
- const ingest$d = function FeaturedItemRecommendedListRepresentationIngest(input, path, luvio, store, timestamp) {
800
+ const ingest$a = function FeaturedItemRecommendedListRepresentationIngest(input, path, luvio, store, timestamp) {
801
801
  if (process.env.NODE_ENV !== 'production') {
802
- const validateError = validate$h(input);
802
+ const validateError = validate$e(input);
803
803
  if (validateError !== null) {
804
804
  throw validateError;
805
805
  }
@@ -807,58 +807,58 @@ const ingest$d = function FeaturedItemRecommendedListRepresentationIngest(input,
807
807
  const key = path.fullPath;
808
808
  const existingRecord = store.readEntry(key);
809
809
  const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
810
- let incomingRecord = normalize$d(input, store.readEntry(key), {
810
+ let incomingRecord = normalize$a(input, store.readEntry(key), {
811
811
  fullPath: key,
812
812
  parent: path.parent,
813
813
  propertyName: path.propertyName,
814
814
  ttl: ttlToUse
815
815
  }, luvio, store);
816
- if (existingRecord === undefined || equals$g(existingRecord, incomingRecord) === false) {
816
+ if (existingRecord === undefined || equals$d(existingRecord, incomingRecord) === false) {
817
817
  luvio.storePublish(key, incomingRecord);
818
818
  }
819
819
  if (ttlToUse !== undefined) {
820
820
  const storeMetadataParams = {
821
821
  ttl: ttlToUse,
822
822
  namespace: "LearningContentPlatform",
823
- version: VERSION$g,
824
- representationName: RepresentationType$d,
823
+ version: VERSION$d,
824
+ representationName: RepresentationType$a,
825
825
  };
826
826
  luvio.publishStoreMetadata(key, storeMetadataParams);
827
827
  }
828
828
  return createLink(key);
829
829
  };
830
- function getTypeCacheKeys$d(luvio, input, fullPathFactory) {
830
+ function getTypeCacheKeys$a(luvio, input, fullPathFactory) {
831
831
  const rootKeySet = new StoreKeyMap();
832
832
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
833
833
  const rootKey = fullPathFactory();
834
834
  rootKeySet.set(rootKey, {
835
835
  namespace: keyPrefix,
836
- representationName: RepresentationType$d,
836
+ representationName: RepresentationType$a,
837
837
  mergeable: false
838
838
  });
839
839
  const input_recommendedList_length = input.recommendedList.length;
840
840
  for (let i = 0; i < input_recommendedList_length; i++) {
841
- rootKeySet.merge(getTypeCacheKeys$e(luvio, input.recommendedList[i]));
841
+ rootKeySet.merge(getTypeCacheKeys$b(luvio, input.recommendedList[i]));
842
842
  }
843
843
  return rootKeySet;
844
844
  }
845
845
 
846
- function select$r(luvio, params) {
847
- return select$s();
846
+ function select$m(luvio, params) {
847
+ return select$n();
848
848
  }
849
- function keyBuilder$t(luvio, params) {
849
+ function keyBuilder$n(luvio, params) {
850
850
  return keyPrefix + '::FeaturedItemRecommendedListRepresentation:(' + 'appId:' + params.queryParams.appId + ',' + 'context:' + params.queryParams.context + ')';
851
851
  }
852
- function getResponseCacheKeys$b(luvio, resourceParams, response) {
853
- return getTypeCacheKeys$d(luvio, response, () => keyBuilder$t(luvio, resourceParams));
852
+ function getResponseCacheKeys$9(luvio, resourceParams, response) {
853
+ return getTypeCacheKeys$a(luvio, response, () => keyBuilder$n(luvio, resourceParams));
854
854
  }
855
- function ingestSuccess$b(luvio, resourceParams, response, snapshotRefresh) {
855
+ function ingestSuccess$9(luvio, resourceParams, response, snapshotRefresh) {
856
856
  const { body } = response;
857
- const key = keyBuilder$t(luvio, resourceParams);
858
- luvio.storeIngest(key, ingest$d, body);
857
+ const key = keyBuilder$n(luvio, resourceParams);
858
+ luvio.storeIngest(key, ingest$a, body);
859
859
  const snapshot = luvio.storeLookup({
860
860
  recordId: key,
861
- node: select$r(),
861
+ node: select$m(),
862
862
  variables: {},
863
863
  }, snapshotRefresh);
864
864
  if (process.env.NODE_ENV !== 'production') {
@@ -869,13 +869,13 @@ function ingestSuccess$b(luvio, resourceParams, response, snapshotRefresh) {
869
869
  deepFreeze(snapshot.data);
870
870
  return snapshot;
871
871
  }
872
- function ingestError$a(luvio, params, error, snapshotRefresh) {
873
- const key = keyBuilder$t(luvio, params);
872
+ function ingestError$8(luvio, params, error, snapshotRefresh) {
873
+ const key = keyBuilder$n(luvio, params);
874
874
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
875
875
  luvio.storeIngestError(key, errorSnapshot);
876
876
  return errorSnapshot;
877
877
  }
878
- function createResourceRequest$b(config) {
878
+ function createResourceRequest$9(config) {
879
879
  const headers = {};
880
880
  return {
881
881
  baseUri: '/services/data/v59.0',
@@ -896,7 +896,7 @@ const getFeaturedItemsRecommendedList_ConfigPropertyNames = {
896
896
  optional: []
897
897
  }
898
898
  };
899
- function createResourceParams$b(config) {
899
+ function createResourceParams$9(config) {
900
900
  const resourceParams = {
901
901
  queryParams: {
902
902
  appId: config.appId, context: config.context
@@ -904,11 +904,11 @@ function createResourceParams$b(config) {
904
904
  };
905
905
  return resourceParams;
906
906
  }
907
- function keyBuilder$s(luvio, config) {
908
- const resourceParams = createResourceParams$b(config);
909
- return keyBuilder$t(luvio, resourceParams);
907
+ function keyBuilder$m(luvio, config) {
908
+ const resourceParams = createResourceParams$9(config);
909
+ return keyBuilder$n(luvio, resourceParams);
910
910
  }
911
- function typeCheckConfig$b(untrustedConfig) {
911
+ function typeCheckConfig$9(untrustedConfig) {
912
912
  const config = {};
913
913
  const untrustedConfig_appId = untrustedConfig.appId;
914
914
  if (typeof untrustedConfig_appId === 'string') {
@@ -920,48 +920,48 @@ function typeCheckConfig$b(untrustedConfig) {
920
920
  }
921
921
  return config;
922
922
  }
923
- function validateAdapterConfig$b(untrustedConfig, configPropertyNames) {
923
+ function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
924
924
  if (!untrustedIsObject(untrustedConfig)) {
925
925
  return null;
926
926
  }
927
927
  if (process.env.NODE_ENV !== 'production') {
928
928
  validateConfig(untrustedConfig, configPropertyNames);
929
929
  }
930
- const config = typeCheckConfig$b(untrustedConfig);
930
+ const config = typeCheckConfig$9(untrustedConfig);
931
931
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
932
932
  return null;
933
933
  }
934
934
  return config;
935
935
  }
936
- function adapterFragment$a(luvio, config) {
937
- createResourceParams$b(config);
938
- return select$r();
936
+ function adapterFragment$8(luvio, config) {
937
+ createResourceParams$9(config);
938
+ return select$m();
939
939
  }
940
- function onFetchResponseSuccess$a(luvio, config, resourceParams, response) {
941
- const snapshot = ingestSuccess$b(luvio, resourceParams, response, {
940
+ function onFetchResponseSuccess$8(luvio, config, resourceParams, response) {
941
+ const snapshot = ingestSuccess$9(luvio, resourceParams, response, {
942
942
  config,
943
- resolve: () => buildNetworkSnapshot$b(luvio, config, snapshotRefreshOptions)
943
+ resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
944
944
  });
945
945
  return luvio.storeBroadcast().then(() => snapshot);
946
946
  }
947
- function onFetchResponseError$a(luvio, config, resourceParams, response) {
948
- const snapshot = ingestError$a(luvio, resourceParams, response, {
947
+ function onFetchResponseError$8(luvio, config, resourceParams, response) {
948
+ const snapshot = ingestError$8(luvio, resourceParams, response, {
949
949
  config,
950
- resolve: () => buildNetworkSnapshot$b(luvio, config, snapshotRefreshOptions)
950
+ resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
951
951
  });
952
952
  return luvio.storeBroadcast().then(() => snapshot);
953
953
  }
954
- function buildNetworkSnapshot$b(luvio, config, options) {
955
- const resourceParams = createResourceParams$b(config);
956
- const request = createResourceRequest$b(resourceParams);
954
+ function buildNetworkSnapshot$9(luvio, config, options) {
955
+ const resourceParams = createResourceParams$9(config);
956
+ const request = createResourceRequest$9(resourceParams);
957
957
  return luvio.dispatchResourceRequest(request, options)
958
958
  .then((response) => {
959
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$a(luvio, config, resourceParams, response), () => getResponseCacheKeys$b(luvio, resourceParams, response.body));
959
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$8(luvio, config, resourceParams, response), () => getResponseCacheKeys$9(luvio, resourceParams, response.body));
960
960
  }, (response) => {
961
- return luvio.handleErrorResponse(() => onFetchResponseError$a(luvio, config, resourceParams, response));
961
+ return luvio.handleErrorResponse(() => onFetchResponseError$8(luvio, config, resourceParams, response));
962
962
  });
963
963
  }
964
- function buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext) {
964
+ function buildNetworkSnapshotCachePolicy$8(context, coercedAdapterRequestContext) {
965
965
  const { luvio, config } = context;
966
966
  const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
967
967
  const dispatchOptions = {
@@ -976,33 +976,33 @@ function buildNetworkSnapshotCachePolicy$a(context, coercedAdapterRequestContext
976
976
  priority: networkPriority
977
977
  };
978
978
  }
979
- return buildNetworkSnapshot$b(luvio, config, dispatchOptions);
979
+ return buildNetworkSnapshot$9(luvio, config, dispatchOptions);
980
980
  }
981
- function buildCachedSnapshotCachePolicy$a(context, storeLookup) {
981
+ function buildCachedSnapshotCachePolicy$8(context, storeLookup) {
982
982
  const { luvio, config } = context;
983
983
  const selector = {
984
- recordId: keyBuilder$s(luvio, config),
985
- node: adapterFragment$a(luvio, config),
984
+ recordId: keyBuilder$m(luvio, config),
985
+ node: adapterFragment$8(luvio, config),
986
986
  variables: {},
987
987
  };
988
988
  const cacheSnapshot = storeLookup(selector, {
989
989
  config,
990
- resolve: () => buildNetworkSnapshot$b(luvio, config, snapshotRefreshOptions)
990
+ resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
991
991
  });
992
992
  return cacheSnapshot;
993
993
  }
994
994
  const getFeaturedItemsRecommendedListAdapterFactory = (luvio) => function LearningContentPlatform__getFeaturedItemsRecommendedList(untrustedConfig, requestContext) {
995
- const config = validateAdapterConfig$b(untrustedConfig, getFeaturedItemsRecommendedList_ConfigPropertyNames);
995
+ const config = validateAdapterConfig$9(untrustedConfig, getFeaturedItemsRecommendedList_ConfigPropertyNames);
996
996
  // Invalid or incomplete config
997
997
  if (config === null) {
998
998
  return null;
999
999
  }
1000
1000
  return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1001
- buildCachedSnapshotCachePolicy$a, buildNetworkSnapshotCachePolicy$a);
1001
+ buildCachedSnapshotCachePolicy$8, buildNetworkSnapshotCachePolicy$8);
1002
1002
  };
1003
1003
 
1004
- const VERSION$f = "5d7adb55f43466f61c4837ebf27eab61";
1005
- function validate$g(obj, path = 'FeaturedItemRelatedListRepresentation') {
1004
+ const VERSION$c = "5d7adb55f43466f61c4837ebf27eab61";
1005
+ function validate$d(obj, path = 'FeaturedItemRelatedListRepresentation') {
1006
1006
  const v_error = (() => {
1007
1007
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1008
1008
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -1022,14 +1022,14 @@ function validate$g(obj, path = 'FeaturedItemRelatedListRepresentation') {
1022
1022
  })();
1023
1023
  return v_error === undefined ? null : v_error;
1024
1024
  }
1025
- const RepresentationType$c = 'FeaturedItemRelatedListRepresentation';
1026
- function normalize$c(input, existing, path, luvio, store, timestamp) {
1025
+ const RepresentationType$9 = 'FeaturedItemRelatedListRepresentation';
1026
+ function normalize$9(input, existing, path, luvio, store, timestamp) {
1027
1027
  const input_relatedList = input.relatedList;
1028
1028
  const input_relatedList_id = path.fullPath + '__relatedList';
1029
1029
  for (let i = 0; i < input_relatedList.length; i++) {
1030
1030
  const input_relatedList_item = input_relatedList[i];
1031
1031
  let input_relatedList_item_id = input_relatedList_id + '__' + i;
1032
- input_relatedList[i] = ingest$e(input_relatedList_item, {
1032
+ input_relatedList[i] = ingest$b(input_relatedList_item, {
1033
1033
  fullPath: input_relatedList_item_id,
1034
1034
  propertyName: i,
1035
1035
  parent: {
@@ -1042,22 +1042,22 @@ function normalize$c(input, existing, path, luvio, store, timestamp) {
1042
1042
  }
1043
1043
  return input;
1044
1044
  }
1045
- const select$q = function FeaturedItemRelatedListRepresentationSelect() {
1045
+ const select$l = function FeaturedItemRelatedListRepresentationSelect() {
1046
1046
  return {
1047
1047
  kind: 'Fragment',
1048
- version: VERSION$f,
1048
+ version: VERSION$c,
1049
1049
  private: [],
1050
1050
  selections: [
1051
1051
  {
1052
1052
  name: 'relatedList',
1053
1053
  kind: 'Link',
1054
1054
  plural: true,
1055
- fragment: select$t()
1055
+ fragment: select$o()
1056
1056
  }
1057
1057
  ]
1058
1058
  };
1059
1059
  };
1060
- function equals$f(existing, incoming) {
1060
+ function equals$c(existing, incoming) {
1061
1061
  const existing_relatedList = existing.relatedList;
1062
1062
  const incoming_relatedList = incoming.relatedList;
1063
1063
  const equals_relatedList_items = equalsArray(existing_relatedList, incoming_relatedList, (existing_relatedList_item, incoming_relatedList_item) => {
@@ -1070,9 +1070,9 @@ function equals$f(existing, incoming) {
1070
1070
  }
1071
1071
  return true;
1072
1072
  }
1073
- const ingest$c = function FeaturedItemRelatedListRepresentationIngest(input, path, luvio, store, timestamp) {
1073
+ const ingest$9 = function FeaturedItemRelatedListRepresentationIngest(input, path, luvio, store, timestamp) {
1074
1074
  if (process.env.NODE_ENV !== 'production') {
1075
- const validateError = validate$g(input);
1075
+ const validateError = validate$d(input);
1076
1076
  if (validateError !== null) {
1077
1077
  throw validateError;
1078
1078
  }
@@ -1080,58 +1080,58 @@ const ingest$c = function FeaturedItemRelatedListRepresentationIngest(input, pat
1080
1080
  const key = path.fullPath;
1081
1081
  const existingRecord = store.readEntry(key);
1082
1082
  const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
1083
- let incomingRecord = normalize$c(input, store.readEntry(key), {
1083
+ let incomingRecord = normalize$9(input, store.readEntry(key), {
1084
1084
  fullPath: key,
1085
1085
  parent: path.parent,
1086
1086
  propertyName: path.propertyName,
1087
1087
  ttl: ttlToUse
1088
1088
  }, luvio, store);
1089
- if (existingRecord === undefined || equals$f(existingRecord, incomingRecord) === false) {
1089
+ if (existingRecord === undefined || equals$c(existingRecord, incomingRecord) === false) {
1090
1090
  luvio.storePublish(key, incomingRecord);
1091
1091
  }
1092
1092
  if (ttlToUse !== undefined) {
1093
1093
  const storeMetadataParams = {
1094
1094
  ttl: ttlToUse,
1095
1095
  namespace: "LearningContentPlatform",
1096
- version: VERSION$f,
1097
- representationName: RepresentationType$c,
1096
+ version: VERSION$c,
1097
+ representationName: RepresentationType$9,
1098
1098
  };
1099
1099
  luvio.publishStoreMetadata(key, storeMetadataParams);
1100
1100
  }
1101
1101
  return createLink(key);
1102
1102
  };
1103
- function getTypeCacheKeys$c(luvio, input, fullPathFactory) {
1103
+ function getTypeCacheKeys$9(luvio, input, fullPathFactory) {
1104
1104
  const rootKeySet = new StoreKeyMap();
1105
1105
  // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1106
1106
  const rootKey = fullPathFactory();
1107
1107
  rootKeySet.set(rootKey, {
1108
1108
  namespace: keyPrefix,
1109
- representationName: RepresentationType$c,
1109
+ representationName: RepresentationType$9,
1110
1110
  mergeable: false
1111
1111
  });
1112
1112
  const input_relatedList_length = input.relatedList.length;
1113
1113
  for (let i = 0; i < input_relatedList_length; i++) {
1114
- rootKeySet.merge(getTypeCacheKeys$e(luvio, input.relatedList[i]));
1114
+ rootKeySet.merge(getTypeCacheKeys$b(luvio, input.relatedList[i]));
1115
1115
  }
1116
1116
  return rootKeySet;
1117
1117
  }
1118
1118
 
1119
- function select$p(luvio, params) {
1120
- return select$q();
1119
+ function select$k(luvio, params) {
1120
+ return select$l();
1121
1121
  }
1122
- function keyBuilder$r(luvio, params) {
1122
+ function keyBuilder$l(luvio, params) {
1123
1123
  return keyPrefix + '::FeaturedItemRelatedListRepresentation:(' + 'appId:' + params.queryParams.appId + ',' + 'pageRef:' + params.queryParams.pageRef + ')';
1124
1124
  }
1125
- function getResponseCacheKeys$a(luvio, resourceParams, response) {
1126
- return getTypeCacheKeys$c(luvio, response, () => keyBuilder$r(luvio, resourceParams));
1125
+ function getResponseCacheKeys$8(luvio, resourceParams, response) {
1126
+ return getTypeCacheKeys$9(luvio, response, () => keyBuilder$l(luvio, resourceParams));
1127
1127
  }
1128
- function ingestSuccess$a(luvio, resourceParams, response, snapshotRefresh) {
1128
+ function ingestSuccess$8(luvio, resourceParams, response, snapshotRefresh) {
1129
1129
  const { body } = response;
1130
- const key = keyBuilder$r(luvio, resourceParams);
1131
- luvio.storeIngest(key, ingest$c, body);
1130
+ const key = keyBuilder$l(luvio, resourceParams);
1131
+ luvio.storeIngest(key, ingest$9, body);
1132
1132
  const snapshot = luvio.storeLookup({
1133
1133
  recordId: key,
1134
- node: select$p(),
1134
+ node: select$k(),
1135
1135
  variables: {},
1136
1136
  }, snapshotRefresh);
1137
1137
  if (process.env.NODE_ENV !== 'production') {
@@ -1142,13 +1142,13 @@ function ingestSuccess$a(luvio, resourceParams, response, snapshotRefresh) {
1142
1142
  deepFreeze(snapshot.data);
1143
1143
  return snapshot;
1144
1144
  }
1145
- function ingestError$9(luvio, params, error, snapshotRefresh) {
1146
- const key = keyBuilder$r(luvio, params);
1145
+ function ingestError$7(luvio, params, error, snapshotRefresh) {
1146
+ const key = keyBuilder$l(luvio, params);
1147
1147
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1148
1148
  luvio.storeIngestError(key, errorSnapshot);
1149
1149
  return errorSnapshot;
1150
1150
  }
1151
- function createResourceRequest$a(config) {
1151
+ function createResourceRequest$8(config) {
1152
1152
  const headers = {};
1153
1153
  return {
1154
1154
  baseUri: '/services/data/v59.0',
@@ -1169,7 +1169,7 @@ const getFeaturedItemsRelatedList_ConfigPropertyNames = {
1169
1169
  optional: []
1170
1170
  }
1171
1171
  };
1172
- function createResourceParams$a(config) {
1172
+ function createResourceParams$8(config) {
1173
1173
  const resourceParams = {
1174
1174
  queryParams: {
1175
1175
  appId: config.appId, pageRef: config.pageRef
@@ -1177,11 +1177,11 @@ function createResourceParams$a(config) {
1177
1177
  };
1178
1178
  return resourceParams;
1179
1179
  }
1180
- function keyBuilder$q(luvio, config) {
1181
- const resourceParams = createResourceParams$a(config);
1182
- return keyBuilder$r(luvio, resourceParams);
1180
+ function keyBuilder$k(luvio, config) {
1181
+ const resourceParams = createResourceParams$8(config);
1182
+ return keyBuilder$l(luvio, resourceParams);
1183
1183
  }
1184
- function typeCheckConfig$a(untrustedConfig) {
1184
+ function typeCheckConfig$8(untrustedConfig) {
1185
1185
  const config = {};
1186
1186
  const untrustedConfig_appId = untrustedConfig.appId;
1187
1187
  if (typeof untrustedConfig_appId === 'string') {
@@ -1193,48 +1193,48 @@ function typeCheckConfig$a(untrustedConfig) {
1193
1193
  }
1194
1194
  return config;
1195
1195
  }
1196
- function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
1196
+ function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
1197
1197
  if (!untrustedIsObject(untrustedConfig)) {
1198
1198
  return null;
1199
1199
  }
1200
1200
  if (process.env.NODE_ENV !== 'production') {
1201
1201
  validateConfig(untrustedConfig, configPropertyNames);
1202
1202
  }
1203
- const config = typeCheckConfig$a(untrustedConfig);
1203
+ const config = typeCheckConfig$8(untrustedConfig);
1204
1204
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1205
1205
  return null;
1206
1206
  }
1207
1207
  return config;
1208
1208
  }
1209
- function adapterFragment$9(luvio, config) {
1210
- createResourceParams$a(config);
1211
- return select$p();
1209
+ function adapterFragment$7(luvio, config) {
1210
+ createResourceParams$8(config);
1211
+ return select$k();
1212
1212
  }
1213
- function onFetchResponseSuccess$9(luvio, config, resourceParams, response) {
1214
- const snapshot = ingestSuccess$a(luvio, resourceParams, response, {
1213
+ function onFetchResponseSuccess$7(luvio, config, resourceParams, response) {
1214
+ const snapshot = ingestSuccess$8(luvio, resourceParams, response, {
1215
1215
  config,
1216
- resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
1216
+ resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
1217
1217
  });
1218
1218
  return luvio.storeBroadcast().then(() => snapshot);
1219
1219
  }
1220
- function onFetchResponseError$9(luvio, config, resourceParams, response) {
1221
- const snapshot = ingestError$9(luvio, resourceParams, response, {
1220
+ function onFetchResponseError$7(luvio, config, resourceParams, response) {
1221
+ const snapshot = ingestError$7(luvio, resourceParams, response, {
1222
1222
  config,
1223
- resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
1223
+ resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
1224
1224
  });
1225
1225
  return luvio.storeBroadcast().then(() => snapshot);
1226
1226
  }
1227
- function buildNetworkSnapshot$a(luvio, config, options) {
1228
- const resourceParams = createResourceParams$a(config);
1229
- const request = createResourceRequest$a(resourceParams);
1227
+ function buildNetworkSnapshot$8(luvio, config, options) {
1228
+ const resourceParams = createResourceParams$8(config);
1229
+ const request = createResourceRequest$8(resourceParams);
1230
1230
  return luvio.dispatchResourceRequest(request, options)
1231
1231
  .then((response) => {
1232
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$9(luvio, config, resourceParams, response), () => getResponseCacheKeys$a(luvio, resourceParams, response.body));
1232
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$7(luvio, config, resourceParams, response), () => getResponseCacheKeys$8(luvio, resourceParams, response.body));
1233
1233
  }, (response) => {
1234
- return luvio.handleErrorResponse(() => onFetchResponseError$9(luvio, config, resourceParams, response));
1234
+ return luvio.handleErrorResponse(() => onFetchResponseError$7(luvio, config, resourceParams, response));
1235
1235
  });
1236
1236
  }
1237
- function buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext) {
1237
+ function buildNetworkSnapshotCachePolicy$7(context, coercedAdapterRequestContext) {
1238
1238
  const { luvio, config } = context;
1239
1239
  const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1240
1240
  const dispatchOptions = {
@@ -1249,713 +1249,23 @@ function buildNetworkSnapshotCachePolicy$9(context, coercedAdapterRequestContext
1249
1249
  priority: networkPriority
1250
1250
  };
1251
1251
  }
1252
- return buildNetworkSnapshot$a(luvio, config, dispatchOptions);
1252
+ return buildNetworkSnapshot$8(luvio, config, dispatchOptions);
1253
1253
  }
1254
- function buildCachedSnapshotCachePolicy$9(context, storeLookup) {
1254
+ function buildCachedSnapshotCachePolicy$7(context, storeLookup) {
1255
1255
  const { luvio, config } = context;
1256
1256
  const selector = {
1257
- recordId: keyBuilder$q(luvio, config),
1258
- node: adapterFragment$9(luvio, config),
1257
+ recordId: keyBuilder$k(luvio, config),
1258
+ node: adapterFragment$7(luvio, config),
1259
1259
  variables: {},
1260
1260
  };
1261
1261
  const cacheSnapshot = storeLookup(selector, {
1262
1262
  config,
1263
- resolve: () => buildNetworkSnapshot$a(luvio, config, snapshotRefreshOptions)
1263
+ resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
1264
1264
  });
1265
1265
  return cacheSnapshot;
1266
1266
  }
1267
1267
  const getFeaturedItemsRelatedListAdapterFactory = (luvio) => function LearningContentPlatform__getFeaturedItemsRelatedList(untrustedConfig, requestContext) {
1268
- const config = validateAdapterConfig$a(untrustedConfig, getFeaturedItemsRelatedList_ConfigPropertyNames);
1269
- // Invalid or incomplete config
1270
- if (config === null) {
1271
- return null;
1272
- }
1273
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1274
- buildCachedSnapshotCachePolicy$9, buildNetworkSnapshotCachePolicy$9);
1275
- };
1276
-
1277
- const TTL$7 = 21600000;
1278
- const VERSION$e = "c365cdb9357c26a64f8a92d93a07daea";
1279
- function validate$f(obj, path = 'LearningSearchDescribeContentRepresentation') {
1280
- const v_error = (() => {
1281
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1282
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1283
- }
1284
- const obj_title = obj.title;
1285
- const path_title = path + '.title';
1286
- if (typeof obj_title !== 'string') {
1287
- return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1288
- }
1289
- const obj_type = obj.type;
1290
- const path_type = path + '.type';
1291
- if (typeof obj_type !== 'string') {
1292
- return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
1293
- }
1294
- })();
1295
- return v_error === undefined ? null : v_error;
1296
- }
1297
- const RepresentationType$b = 'LearningSearchDescribeContentRepresentation';
1298
- function keyBuilder$p(luvio, config) {
1299
- return keyPrefix + '::' + RepresentationType$b + ':' + config.type;
1300
- }
1301
- function keyBuilderFromType$7(luvio, object) {
1302
- const keyParams = {
1303
- type: object.type
1304
- };
1305
- return keyBuilder$p(luvio, keyParams);
1306
- }
1307
- function normalize$b(input, existing, path, luvio, store, timestamp) {
1308
- return input;
1309
- }
1310
- const select$o = function LearningSearchDescribeContentRepresentationSelect() {
1311
- return {
1312
- kind: 'Fragment',
1313
- version: VERSION$e,
1314
- private: [],
1315
- selections: [
1316
- {
1317
- name: 'title',
1318
- kind: 'Scalar'
1319
- },
1320
- {
1321
- name: 'type',
1322
- kind: 'Scalar'
1323
- }
1324
- ]
1325
- };
1326
- };
1327
- function equals$e(existing, incoming) {
1328
- const existing_title = existing.title;
1329
- const incoming_title = incoming.title;
1330
- if (!(existing_title === incoming_title)) {
1331
- return false;
1332
- }
1333
- const existing_type = existing.type;
1334
- const incoming_type = incoming.type;
1335
- if (!(existing_type === incoming_type)) {
1336
- return false;
1337
- }
1338
- return true;
1339
- }
1340
- const ingest$b = function LearningSearchDescribeContentRepresentationIngest(input, path, luvio, store, timestamp) {
1341
- if (process.env.NODE_ENV !== 'production') {
1342
- const validateError = validate$f(input);
1343
- if (validateError !== null) {
1344
- throw validateError;
1345
- }
1346
- }
1347
- const key = keyBuilderFromType$7(luvio, input);
1348
- const existingRecord = store.readEntry(key);
1349
- const ttlToUse = TTL$7;
1350
- let incomingRecord = normalize$b(input, store.readEntry(key), {
1351
- fullPath: key,
1352
- parent: path.parent,
1353
- propertyName: path.propertyName,
1354
- ttl: ttlToUse
1355
- });
1356
- if (existingRecord === undefined || equals$e(existingRecord, incomingRecord) === false) {
1357
- luvio.storePublish(key, incomingRecord);
1358
- }
1359
- {
1360
- const storeMetadataParams = {
1361
- ttl: ttlToUse,
1362
- namespace: "LearningContentPlatform",
1363
- version: VERSION$e,
1364
- representationName: RepresentationType$b,
1365
- };
1366
- luvio.publishStoreMetadata(key, storeMetadataParams);
1367
- }
1368
- return createLink(key);
1369
- };
1370
- function getTypeCacheKeys$b(luvio, input, fullPathFactory) {
1371
- const rootKeySet = new StoreKeyMap();
1372
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1373
- const rootKey = keyBuilderFromType$7(luvio, input);
1374
- rootKeySet.set(rootKey, {
1375
- namespace: keyPrefix,
1376
- representationName: RepresentationType$b,
1377
- mergeable: false
1378
- });
1379
- return rootKeySet;
1380
- }
1381
-
1382
- const VERSION$d = "efe7f2c47826ec8055be54360b646e19";
1383
- function validate$e(obj, path = 'LearningSearchDescribeRepresentation') {
1384
- const v_error = (() => {
1385
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1386
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1387
- }
1388
- const obj_contentTypes = obj.contentTypes;
1389
- const path_contentTypes = path + '.contentTypes';
1390
- if (!ArrayIsArray(obj_contentTypes)) {
1391
- return new TypeError('Expected "array" but received "' + typeof obj_contentTypes + '" (at "' + path_contentTypes + '")');
1392
- }
1393
- for (let i = 0; i < obj_contentTypes.length; i++) {
1394
- const obj_contentTypes_item = obj_contentTypes[i];
1395
- const path_contentTypes_item = path_contentTypes + '[' + i + ']';
1396
- if (typeof obj_contentTypes_item !== 'object') {
1397
- return new TypeError('Expected "object" but received "' + typeof obj_contentTypes_item + '" (at "' + path_contentTypes_item + '")');
1398
- }
1399
- }
1400
- })();
1401
- return v_error === undefined ? null : v_error;
1402
- }
1403
- const RepresentationType$a = 'LearningSearchDescribeRepresentation';
1404
- function normalize$a(input, existing, path, luvio, store, timestamp) {
1405
- const input_contentTypes = input.contentTypes;
1406
- const input_contentTypes_id = path.fullPath + '__contentTypes';
1407
- for (let i = 0; i < input_contentTypes.length; i++) {
1408
- const input_contentTypes_item = input_contentTypes[i];
1409
- let input_contentTypes_item_id = input_contentTypes_id + '__' + i;
1410
- input_contentTypes[i] = ingest$b(input_contentTypes_item, {
1411
- fullPath: input_contentTypes_item_id,
1412
- propertyName: i,
1413
- parent: {
1414
- data: input,
1415
- key: path.fullPath,
1416
- existing: existing,
1417
- },
1418
- ttl: path.ttl
1419
- }, luvio, store);
1420
- }
1421
- return input;
1422
- }
1423
- const select$n = function LearningSearchDescribeRepresentationSelect() {
1424
- return {
1425
- kind: 'Fragment',
1426
- version: VERSION$d,
1427
- private: [],
1428
- selections: [
1429
- {
1430
- name: 'contentTypes',
1431
- kind: 'Link',
1432
- plural: true,
1433
- fragment: select$o()
1434
- }
1435
- ]
1436
- };
1437
- };
1438
- function equals$d(existing, incoming) {
1439
- const existing_contentTypes = existing.contentTypes;
1440
- const incoming_contentTypes = incoming.contentTypes;
1441
- const equals_contentTypes_items = equalsArray(existing_contentTypes, incoming_contentTypes, (existing_contentTypes_item, incoming_contentTypes_item) => {
1442
- if (!(existing_contentTypes_item.__ref === incoming_contentTypes_item.__ref)) {
1443
- return false;
1444
- }
1445
- });
1446
- if (equals_contentTypes_items === false) {
1447
- return false;
1448
- }
1449
- return true;
1450
- }
1451
- const ingest$a = function LearningSearchDescribeRepresentationIngest(input, path, luvio, store, timestamp) {
1452
- if (process.env.NODE_ENV !== 'production') {
1453
- const validateError = validate$e(input);
1454
- if (validateError !== null) {
1455
- throw validateError;
1456
- }
1457
- }
1458
- const key = path.fullPath;
1459
- const existingRecord = store.readEntry(key);
1460
- const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
1461
- let incomingRecord = normalize$a(input, store.readEntry(key), {
1462
- fullPath: key,
1463
- parent: path.parent,
1464
- propertyName: path.propertyName,
1465
- ttl: ttlToUse
1466
- }, luvio, store);
1467
- if (existingRecord === undefined || equals$d(existingRecord, incomingRecord) === false) {
1468
- luvio.storePublish(key, incomingRecord);
1469
- }
1470
- if (ttlToUse !== undefined) {
1471
- const storeMetadataParams = {
1472
- ttl: ttlToUse,
1473
- namespace: "LearningContentPlatform",
1474
- version: VERSION$d,
1475
- representationName: RepresentationType$a,
1476
- };
1477
- luvio.publishStoreMetadata(key, storeMetadataParams);
1478
- }
1479
- return createLink(key);
1480
- };
1481
- function getTypeCacheKeys$a(luvio, input, fullPathFactory) {
1482
- const rootKeySet = new StoreKeyMap();
1483
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1484
- const rootKey = fullPathFactory();
1485
- rootKeySet.set(rootKey, {
1486
- namespace: keyPrefix,
1487
- representationName: RepresentationType$a,
1488
- mergeable: false
1489
- });
1490
- const input_contentTypes_length = input.contentTypes.length;
1491
- for (let i = 0; i < input_contentTypes_length; i++) {
1492
- rootKeySet.merge(getTypeCacheKeys$b(luvio, input.contentTypes[i]));
1493
- }
1494
- return rootKeySet;
1495
- }
1496
-
1497
- function select$m(luvio, params) {
1498
- return select$n();
1499
- }
1500
- function keyBuilder$o(luvio, params) {
1501
- return keyPrefix + '::LearningSearchDescribeRepresentation:(' + ')';
1502
- }
1503
- function getResponseCacheKeys$9(luvio, resourceParams, response) {
1504
- return getTypeCacheKeys$a(luvio, response, () => keyBuilder$o());
1505
- }
1506
- function ingestSuccess$9(luvio, resourceParams, response, snapshotRefresh) {
1507
- const { body } = response;
1508
- const key = keyBuilder$o();
1509
- luvio.storeIngest(key, ingest$a, body);
1510
- const snapshot = luvio.storeLookup({
1511
- recordId: key,
1512
- node: select$m(),
1513
- variables: {},
1514
- }, snapshotRefresh);
1515
- if (process.env.NODE_ENV !== 'production') {
1516
- if (snapshot.state !== 'Fulfilled') {
1517
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1518
- }
1519
- }
1520
- deepFreeze(snapshot.data);
1521
- return snapshot;
1522
- }
1523
- function ingestError$8(luvio, params, error, snapshotRefresh) {
1524
- const key = keyBuilder$o();
1525
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1526
- luvio.storeIngestError(key, errorSnapshot);
1527
- return errorSnapshot;
1528
- }
1529
- function createResourceRequest$9(config) {
1530
- const headers = {};
1531
- return {
1532
- baseUri: '/services/data/v59.0',
1533
- basePath: '/learning-content-platform/learning/search/describe',
1534
- method: 'get',
1535
- body: null,
1536
- urlParams: {},
1537
- queryParams: {},
1538
- headers,
1539
- priority: 'normal',
1540
- };
1541
- }
1542
-
1543
- const getLearningSearchDescribe_ConfigPropertyNames = {
1544
- displayName: 'getLearningSearchDescribe',
1545
- parameters: {
1546
- required: [],
1547
- optional: []
1548
- }
1549
- };
1550
- function createResourceParams$9(config) {
1551
- const resourceParams = {};
1552
- return resourceParams;
1553
- }
1554
- function keyBuilder$n(luvio, config) {
1555
- return keyBuilder$o();
1556
- }
1557
- function typeCheckConfig$9(untrustedConfig) {
1558
- const config = {};
1559
- return config;
1560
- }
1561
- function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
1562
- if (!untrustedIsObject(untrustedConfig)) {
1563
- return null;
1564
- }
1565
- if (process.env.NODE_ENV !== 'production') {
1566
- validateConfig(untrustedConfig, configPropertyNames);
1567
- }
1568
- const config = typeCheckConfig$9();
1569
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
1570
- return null;
1571
- }
1572
- return config;
1573
- }
1574
- function adapterFragment$8(luvio, config) {
1575
- return select$m();
1576
- }
1577
- function onFetchResponseSuccess$8(luvio, config, resourceParams, response) {
1578
- const snapshot = ingestSuccess$9(luvio, resourceParams, response, {
1579
- config,
1580
- resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
1581
- });
1582
- return luvio.storeBroadcast().then(() => snapshot);
1583
- }
1584
- function onFetchResponseError$8(luvio, config, resourceParams, response) {
1585
- const snapshot = ingestError$8(luvio, resourceParams, response, {
1586
- config,
1587
- resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
1588
- });
1589
- return luvio.storeBroadcast().then(() => snapshot);
1590
- }
1591
- function buildNetworkSnapshot$9(luvio, config, options) {
1592
- const resourceParams = createResourceParams$9();
1593
- const request = createResourceRequest$9();
1594
- return luvio.dispatchResourceRequest(request, options)
1595
- .then((response) => {
1596
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$8(luvio, config, resourceParams, response), () => getResponseCacheKeys$9(luvio, resourceParams, response.body));
1597
- }, (response) => {
1598
- return luvio.handleErrorResponse(() => onFetchResponseError$8(luvio, config, resourceParams, response));
1599
- });
1600
- }
1601
- function buildNetworkSnapshotCachePolicy$8(context, coercedAdapterRequestContext) {
1602
- const { luvio, config } = context;
1603
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1604
- const dispatchOptions = {
1605
- resourceRequestContext: {
1606
- requestCorrelator,
1607
- luvioRequestMethod: undefined,
1608
- },
1609
- eventObservers
1610
- };
1611
- if (networkPriority !== 'normal') {
1612
- dispatchOptions.overrides = {
1613
- priority: networkPriority
1614
- };
1615
- }
1616
- return buildNetworkSnapshot$9(luvio, config, dispatchOptions);
1617
- }
1618
- function buildCachedSnapshotCachePolicy$8(context, storeLookup) {
1619
- const { luvio, config } = context;
1620
- const selector = {
1621
- recordId: keyBuilder$n(),
1622
- node: adapterFragment$8(),
1623
- variables: {},
1624
- };
1625
- const cacheSnapshot = storeLookup(selector, {
1626
- config,
1627
- resolve: () => buildNetworkSnapshot$9(luvio, config, snapshotRefreshOptions)
1628
- });
1629
- return cacheSnapshot;
1630
- }
1631
- const getLearningSearchDescribeAdapterFactory = (luvio) => function LearningContentPlatform__getLearningSearchDescribe(untrustedConfig, requestContext) {
1632
- const config = validateAdapterConfig$9(untrustedConfig, getLearningSearchDescribe_ConfigPropertyNames);
1633
- // Invalid or incomplete config
1634
- if (config === null) {
1635
- return null;
1636
- }
1637
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1638
- buildCachedSnapshotCachePolicy$8, buildNetworkSnapshotCachePolicy$8);
1639
- };
1640
-
1641
- const TTL$6 = 21600000;
1642
- const VERSION$c = "6f068b7b81d41fa29feab5d1ac9f9cb8";
1643
- function validate$d(obj, path = 'LearningSearchResultsRepresentation') {
1644
- const v_error = (() => {
1645
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1646
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1647
- }
1648
- const obj_results = obj.results;
1649
- const path_results = path + '.results';
1650
- if (!ArrayIsArray(obj_results)) {
1651
- return new TypeError('Expected "array" but received "' + typeof obj_results + '" (at "' + path_results + '")');
1652
- }
1653
- for (let i = 0; i < obj_results.length; i++) {
1654
- const obj_results_item = obj_results[i];
1655
- const path_results_item = path_results + '[' + i + ']';
1656
- if (typeof obj_results_item !== 'object') {
1657
- return new TypeError('Expected "object" but received "' + typeof obj_results_item + '" (at "' + path_results_item + '")');
1658
- }
1659
- }
1660
- const obj_totalResults = obj.totalResults;
1661
- const path_totalResults = path + '.totalResults';
1662
- if (typeof obj_totalResults !== 'number' || (typeof obj_totalResults === 'number' && Math.floor(obj_totalResults) !== obj_totalResults)) {
1663
- return new TypeError('Expected "integer" but received "' + typeof obj_totalResults + '" (at "' + path_totalResults + '")');
1664
- }
1665
- const obj_type = obj.type;
1666
- const path_type = path + '.type';
1667
- if (typeof obj_type !== 'string') {
1668
- return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
1669
- }
1670
- })();
1671
- return v_error === undefined ? null : v_error;
1672
- }
1673
- const RepresentationType$9 = 'LearningSearchResultsRepresentation';
1674
- function keyBuilder$m(luvio, config) {
1675
- return keyPrefix + '::' + RepresentationType$9 + ':' + config.type;
1676
- }
1677
- function keyBuilderFromType$6(luvio, object) {
1678
- const keyParams = {
1679
- type: object.type
1680
- };
1681
- return keyBuilder$m(luvio, keyParams);
1682
- }
1683
- function normalize$9(input, existing, path, luvio, store, timestamp) {
1684
- const input_results = input.results;
1685
- const input_results_id = path.fullPath + '__results';
1686
- for (let i = 0; i < input_results.length; i++) {
1687
- const input_results_item = input_results[i];
1688
- let input_results_item_id = input_results_id + '__' + i;
1689
- input_results[i] = ingest$e(input_results_item, {
1690
- fullPath: input_results_item_id,
1691
- propertyName: i,
1692
- parent: {
1693
- data: input,
1694
- key: path.fullPath,
1695
- existing: existing,
1696
- },
1697
- ttl: path.ttl
1698
- }, luvio, store);
1699
- }
1700
- return input;
1701
- }
1702
- const select$l = function LearningSearchResultsRepresentationSelect() {
1703
- return {
1704
- kind: 'Fragment',
1705
- version: VERSION$c,
1706
- private: [],
1707
- selections: [
1708
- {
1709
- name: 'results',
1710
- kind: 'Link',
1711
- plural: true,
1712
- fragment: select$t()
1713
- },
1714
- {
1715
- name: 'totalResults',
1716
- kind: 'Scalar'
1717
- },
1718
- {
1719
- name: 'type',
1720
- kind: 'Scalar'
1721
- }
1722
- ]
1723
- };
1724
- };
1725
- function equals$c(existing, incoming) {
1726
- const existing_totalResults = existing.totalResults;
1727
- const incoming_totalResults = incoming.totalResults;
1728
- if (!(existing_totalResults === incoming_totalResults)) {
1729
- return false;
1730
- }
1731
- const existing_type = existing.type;
1732
- const incoming_type = incoming.type;
1733
- if (!(existing_type === incoming_type)) {
1734
- return false;
1735
- }
1736
- const existing_results = existing.results;
1737
- const incoming_results = incoming.results;
1738
- const equals_results_items = equalsArray(existing_results, incoming_results, (existing_results_item, incoming_results_item) => {
1739
- if (!(existing_results_item.__ref === incoming_results_item.__ref)) {
1740
- return false;
1741
- }
1742
- });
1743
- if (equals_results_items === false) {
1744
- return false;
1745
- }
1746
- return true;
1747
- }
1748
- const ingest$9 = function LearningSearchResultsRepresentationIngest(input, path, luvio, store, timestamp) {
1749
- if (process.env.NODE_ENV !== 'production') {
1750
- const validateError = validate$d(input);
1751
- if (validateError !== null) {
1752
- throw validateError;
1753
- }
1754
- }
1755
- const key = keyBuilderFromType$6(luvio, input);
1756
- const existingRecord = store.readEntry(key);
1757
- const ttlToUse = TTL$6;
1758
- let incomingRecord = normalize$9(input, store.readEntry(key), {
1759
- fullPath: key,
1760
- parent: path.parent,
1761
- propertyName: path.propertyName,
1762
- ttl: ttlToUse
1763
- }, luvio, store);
1764
- if (existingRecord === undefined || equals$c(existingRecord, incomingRecord) === false) {
1765
- luvio.storePublish(key, incomingRecord);
1766
- }
1767
- {
1768
- const storeMetadataParams = {
1769
- ttl: ttlToUse,
1770
- namespace: "LearningContentPlatform",
1771
- version: VERSION$c,
1772
- representationName: RepresentationType$9,
1773
- };
1774
- luvio.publishStoreMetadata(key, storeMetadataParams);
1775
- }
1776
- return createLink(key);
1777
- };
1778
- function getTypeCacheKeys$9(luvio, input, fullPathFactory) {
1779
- const rootKeySet = new StoreKeyMap();
1780
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1781
- const rootKey = keyBuilderFromType$6(luvio, input);
1782
- rootKeySet.set(rootKey, {
1783
- namespace: keyPrefix,
1784
- representationName: RepresentationType$9,
1785
- mergeable: false
1786
- });
1787
- const input_results_length = input.results.length;
1788
- for (let i = 0; i < input_results_length; i++) {
1789
- rootKeySet.merge(getTypeCacheKeys$e(luvio, input.results[i]));
1790
- }
1791
- return rootKeySet;
1792
- }
1793
-
1794
- function select$k(luvio, params) {
1795
- return select$l();
1796
- }
1797
- function keyBuilder$l(luvio, params) {
1798
- return keyBuilder$m(luvio, {
1799
- type: params.urlParams.contentType
1800
- });
1801
- }
1802
- function getResponseCacheKeys$8(luvio, resourceParams, response) {
1803
- return getTypeCacheKeys$9(luvio, response);
1804
- }
1805
- function ingestSuccess$8(luvio, resourceParams, response, snapshotRefresh) {
1806
- const { body } = response;
1807
- const key = keyBuilder$l(luvio, resourceParams);
1808
- luvio.storeIngest(key, ingest$9, body);
1809
- const snapshot = luvio.storeLookup({
1810
- recordId: key,
1811
- node: select$k(),
1812
- variables: {},
1813
- }, snapshotRefresh);
1814
- if (process.env.NODE_ENV !== 'production') {
1815
- if (snapshot.state !== 'Fulfilled') {
1816
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1817
- }
1818
- }
1819
- deepFreeze(snapshot.data);
1820
- return snapshot;
1821
- }
1822
- function ingestError$7(luvio, params, error, snapshotRefresh) {
1823
- const key = keyBuilder$l(luvio, params);
1824
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1825
- const storeMetadataParams = {
1826
- ttl: TTL$6,
1827
- namespace: keyPrefix,
1828
- version: VERSION$c,
1829
- representationName: RepresentationType$9
1830
- };
1831
- luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1832
- return errorSnapshot;
1833
- }
1834
- function createResourceRequest$8(config) {
1835
- const headers = {};
1836
- return {
1837
- baseUri: '/services/data/v59.0',
1838
- basePath: '/learning-content-platform/learning/search/type/' + config.urlParams.contentType + '',
1839
- method: 'get',
1840
- body: null,
1841
- urlParams: config.urlParams,
1842
- queryParams: config.queryParams,
1843
- headers,
1844
- priority: 'normal',
1845
- };
1846
- }
1847
-
1848
- const getLearningSearchResults_ConfigPropertyNames = {
1849
- displayName: 'getLearningSearchResults',
1850
- parameters: {
1851
- required: ['contentType', 'limit', 'q'],
1852
- optional: []
1853
- }
1854
- };
1855
- function createResourceParams$8(config) {
1856
- const resourceParams = {
1857
- urlParams: {
1858
- contentType: config.contentType
1859
- },
1860
- queryParams: {
1861
- limit: config.limit, q: config.q
1862
- }
1863
- };
1864
- return resourceParams;
1865
- }
1866
- function keyBuilder$k(luvio, config) {
1867
- const resourceParams = createResourceParams$8(config);
1868
- return keyBuilder$l(luvio, resourceParams);
1869
- }
1870
- function typeCheckConfig$8(untrustedConfig) {
1871
- const config = {};
1872
- const untrustedConfig_contentType = untrustedConfig.contentType;
1873
- if (typeof untrustedConfig_contentType === 'string') {
1874
- config.contentType = untrustedConfig_contentType;
1875
- }
1876
- const untrustedConfig_limit = untrustedConfig.limit;
1877
- if (typeof untrustedConfig_limit === 'number' && Math.floor(untrustedConfig_limit) === untrustedConfig_limit) {
1878
- config.limit = untrustedConfig_limit;
1879
- }
1880
- const untrustedConfig_q = untrustedConfig.q;
1881
- if (typeof untrustedConfig_q === 'string') {
1882
- config.q = untrustedConfig_q;
1883
- }
1884
- return config;
1885
- }
1886
- function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
1887
- if (!untrustedIsObject(untrustedConfig)) {
1888
- return null;
1889
- }
1890
- if (process.env.NODE_ENV !== 'production') {
1891
- validateConfig(untrustedConfig, configPropertyNames);
1892
- }
1893
- const config = typeCheckConfig$8(untrustedConfig);
1894
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
1895
- return null;
1896
- }
1897
- return config;
1898
- }
1899
- function adapterFragment$7(luvio, config) {
1900
- createResourceParams$8(config);
1901
- return select$k();
1902
- }
1903
- function onFetchResponseSuccess$7(luvio, config, resourceParams, response) {
1904
- const snapshot = ingestSuccess$8(luvio, resourceParams, response, {
1905
- config,
1906
- resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
1907
- });
1908
- return luvio.storeBroadcast().then(() => snapshot);
1909
- }
1910
- function onFetchResponseError$7(luvio, config, resourceParams, response) {
1911
- const snapshot = ingestError$7(luvio, resourceParams, response, {
1912
- config,
1913
- resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
1914
- });
1915
- return luvio.storeBroadcast().then(() => snapshot);
1916
- }
1917
- function buildNetworkSnapshot$8(luvio, config, options) {
1918
- const resourceParams = createResourceParams$8(config);
1919
- const request = createResourceRequest$8(resourceParams);
1920
- return luvio.dispatchResourceRequest(request, options)
1921
- .then((response) => {
1922
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess$7(luvio, config, resourceParams, response), () => getResponseCacheKeys$8(luvio, resourceParams, response.body));
1923
- }, (response) => {
1924
- return luvio.handleErrorResponse(() => onFetchResponseError$7(luvio, config, resourceParams, response));
1925
- });
1926
- }
1927
- function buildNetworkSnapshotCachePolicy$7(context, coercedAdapterRequestContext) {
1928
- const { luvio, config } = context;
1929
- const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1930
- const dispatchOptions = {
1931
- resourceRequestContext: {
1932
- requestCorrelator,
1933
- luvioRequestMethod: undefined,
1934
- },
1935
- eventObservers
1936
- };
1937
- if (networkPriority !== 'normal') {
1938
- dispatchOptions.overrides = {
1939
- priority: networkPriority
1940
- };
1941
- }
1942
- return buildNetworkSnapshot$8(luvio, config, dispatchOptions);
1943
- }
1944
- function buildCachedSnapshotCachePolicy$7(context, storeLookup) {
1945
- const { luvio, config } = context;
1946
- const selector = {
1947
- recordId: keyBuilder$k(luvio, config),
1948
- node: adapterFragment$7(luvio, config),
1949
- variables: {},
1950
- };
1951
- const cacheSnapshot = storeLookup(selector, {
1952
- config,
1953
- resolve: () => buildNetworkSnapshot$8(luvio, config, snapshotRefreshOptions)
1954
- });
1955
- return cacheSnapshot;
1956
- }
1957
- const getLearningSearchResultsAdapterFactory = (luvio) => function LearningContentPlatform__getLearningSearchResults(untrustedConfig, requestContext) {
1958
- const config = validateAdapterConfig$8(untrustedConfig, getLearningSearchResults_ConfigPropertyNames);
1268
+ const config = validateAdapterConfig$8(untrustedConfig, getFeaturedItemsRelatedList_ConfigPropertyNames);
1959
1269
  // Invalid or incomplete config
1960
1270
  if (config === null) {
1961
1271
  return null;
@@ -5977,4 +5287,4 @@ const getTextLessonAdapterFactory = (luvio) => function LearningContentPlatform_
5977
5287
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
5978
5288
  };
5979
5289
 
5980
- export { evaluateLearningItemAdapterFactory, getFeaturedItemsRecommendedListAdapterFactory, getFeaturedItemsRelatedListAdapterFactory, getLearningConfigAdapterFactory, getLearningItemProgressAdapterFactory, getLearningItemsListAdapterFactory, getLearningModelAdapterFactory, getLearningPracticeAdapterFactory, getLearningSearchDescribeAdapterFactory, getLearningSearchResultsAdapterFactory, getModuleAdapterFactory, getTextLessonAdapterFactory };
5290
+ export { evaluateLearningItemAdapterFactory, getFeaturedItemsRecommendedListAdapterFactory, getFeaturedItemsRelatedListAdapterFactory, getLearningConfigAdapterFactory, getLearningItemProgressAdapterFactory, getLearningItemsListAdapterFactory, getLearningModelAdapterFactory, getLearningPracticeAdapterFactory, getModuleAdapterFactory, getTextLessonAdapterFactory };