@salesforce/lds-adapters-experience-model 0.131.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/experience-model.js +2234 -0
  3. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +66 -0
  4. package/dist/es/es2018/types/src/generated/adapters/getBlockType.d.ts +30 -0
  5. package/dist/es/es2018/types/src/generated/adapters/getBlockTypes.d.ts +34 -0
  6. package/dist/es/es2018/types/src/generated/adapters/getContentType.d.ts +30 -0
  7. package/dist/es/es2018/types/src/generated/adapters/getContentTypes.d.ts +34 -0
  8. package/dist/es/es2018/types/src/generated/adapters/getPropertyType.d.ts +30 -0
  9. package/dist/es/es2018/types/src/generated/adapters/getPropertyTypes.d.ts +31 -0
  10. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +6 -0
  11. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +13 -0
  12. package/dist/es/es2018/types/src/generated/resources/deleteCmsDeploymentsByDeploymentId.d.ts +9 -0
  13. package/dist/es/es2018/types/src/generated/resources/deleteCmsSiteAuthorContentByContentKey.d.ts +14 -0
  14. package/dist/es/es2018/types/src/generated/resources/deleteConnectCmsContentJobsByJobId.d.ts +11 -0
  15. package/dist/es/es2018/types/src/generated/resources/deleteConnectCmsFoldersByFolderId.d.ts +11 -0
  16. package/dist/es/es2018/types/src/generated/resources/deleteConnectManagedContentContentSpacesContentsByContentSpaceIdAndManagedContentId.d.ts +10 -0
  17. package/dist/es/es2018/types/src/generated/resources/deleteConnectManagedContentContentSpacesMembersByContentSpaceIdAndMemberIdOrMe.d.ts +10 -0
  18. package/dist/es/es2018/types/src/generated/resources/getCmsContentsByContentKeyOrId.d.ts +18 -0
  19. package/dist/es/es2018/types/src/generated/resources/getCmsDeliveryCollectionByCollectionNameOrContentKeyAndTargetId.d.ts +21 -0
  20. package/dist/es/es2018/types/src/generated/resources/getCmsDeliveryCollectionMetadataByCollectionNameOrContentKeyAndTargetId.d.ts +19 -0
  21. package/dist/es/es2018/types/src/generated/resources/getCmsDeployments.d.ts +21 -0
  22. package/dist/es/es2018/types/src/generated/resources/getCmsSiteAuthorContentByContentKey.d.ts +18 -0
  23. package/dist/es/es2018/types/src/generated/resources/getCmsSiteAuthorContentContentKeys.d.ts +17 -0
  24. package/dist/es/es2018/types/src/generated/resources/getCmsSiteAuthorContentNodeByContentKeyAndContentNode.d.ts +16 -0
  25. package/dist/es/es2018/types/src/generated/resources/getCmsSiteAuthorContentNodesByContentKey.d.ts +18 -0
  26. package/dist/es/es2018/types/src/generated/resources/getCmsSpacesByContentSpaceId.d.ts +15 -0
  27. package/dist/es/es2018/types/src/generated/resources/getConnectCmsChannelsSearchableContentTypesByChannelId.d.ts +19 -0
  28. package/dist/es/es2018/types/src/generated/resources/getConnectCmsContent.d.ts +16 -0
  29. package/dist/es/es2018/types/src/generated/resources/getConnectCmsContentJobsByJobId.d.ts +15 -0
  30. package/dist/es/es2018/types/src/generated/resources/getConnectCmsContentTypesByContentTypeFQN.d.ts +20 -0
  31. package/dist/es/es2018/types/src/generated/resources/getConnectCmsContentVersionByManagedContentVersionId.d.ts +19 -0
  32. package/dist/es/es2018/types/src/generated/resources/getConnectCmsContentsVariantsByVariantId.d.ts +15 -0
  33. package/dist/es/es2018/types/src/generated/resources/getConnectCmsDeliveryChannels.d.ts +16 -0
  34. package/dist/es/es2018/types/src/generated/resources/getConnectCmsDeliveryChannelsContentsQueryByChannelId.d.ts +27 -0
  35. package/dist/es/es2018/types/src/generated/resources/getConnectCmsDeliveryChannelsContentsSearchByChannelId.d.ts +21 -0
  36. package/dist/es/es2018/types/src/generated/resources/getConnectCmsDeliveryChannelsMediaContentByChannelIdAndMediaGuid.d.ts +16 -0
  37. package/dist/es/es2018/types/src/generated/resources/getConnectCmsDeliveryRecordsContentsByRecordId.d.ts +22 -0
  38. package/dist/es/es2018/types/src/generated/resources/getConnectCmsFoldersByFolderId.d.ts +15 -0
  39. package/dist/es/es2018/types/src/generated/resources/getConnectCmsFoldersItemsByFolderId.d.ts +25 -0
  40. package/dist/es/es2018/types/src/generated/resources/getConnectCmsManagementChannels.d.ts +16 -0
  41. package/dist/es/es2018/types/src/generated/resources/getConnectCmsManagementChannelsByChannelId.d.ts +15 -0
  42. package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesManagedContentDeliveryByCommunityId.d.ts +25 -0
  43. package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesManagedContentDeliveryContentsByCommunityId.d.ts +27 -0
  44. package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesManagedContentDeliveryContentsSearchByCommunityId.d.ts +21 -0
  45. package/dist/es/es2018/types/src/generated/resources/getConnectExperienceModelBlockTypes.d.ts +23 -0
  46. package/dist/es/es2018/types/src/generated/resources/getConnectExperienceModelBlockTypesByFullyQualifiedName.d.ts +21 -0
  47. package/dist/es/es2018/types/src/generated/resources/getConnectExperienceModelContentTypes.d.ts +23 -0
  48. package/dist/es/es2018/types/src/generated/resources/getConnectExperienceModelContentTypesByFullyQualifiedName.d.ts +21 -0
  49. package/dist/es/es2018/types/src/generated/resources/getConnectExperienceModelPropertyTypes.d.ts +20 -0
  50. package/dist/es/es2018/types/src/generated/resources/getConnectExperienceModelPropertyTypesByFullyQualifiedName.d.ts +21 -0
  51. package/dist/es/es2018/types/src/generated/resources/getConnectManagedContentContentSpacesContentVersionsByContentSpaceIdAndManagedContentVersionId.d.ts +19 -0
  52. package/dist/es/es2018/types/src/generated/resources/getConnectManagedContentContentSpacesMembersByContentSpaceId.d.ts +15 -0
  53. package/dist/es/es2018/types/src/generated/resources/getConnectManagedContentContentSpacesMembersPermissionsByContentSpaceIdAndMemberIdOrMe.d.ts +16 -0
  54. package/dist/es/es2018/types/src/generated/resources/getConnectManagedContentRoles.d.ts +15 -0
  55. package/dist/es/es2018/types/src/generated/resources/patchCmsDeploymentsByDeploymentId.d.ts +9 -0
  56. package/dist/es/es2018/types/src/generated/resources/patchConnectCmsChannelsSearchableContentTypesByChannelId.d.ts +13 -0
  57. package/dist/es/es2018/types/src/generated/resources/patchConnectCmsContentVersionByManagedContentVersionId.d.ts +21 -0
  58. package/dist/es/es2018/types/src/generated/resources/patchConnectCmsFoldersByFolderId.d.ts +13 -0
  59. package/dist/es/es2018/types/src/generated/resources/patchConnectCmsFoldersItemsByFolderId.d.ts +13 -0
  60. package/dist/es/es2018/types/src/generated/resources/patchConnectCmsManagementChannelsByChannelId.d.ts +17 -0
  61. package/dist/es/es2018/types/src/generated/resources/patchConnectCmsSchedulesByDeploymentId.d.ts +13 -0
  62. package/dist/es/es2018/types/src/generated/resources/patchConnectManagedContentContentSpacesContentVersionsByContentSpaceIdAndManagedContentVersionId.d.ts +21 -0
  63. package/dist/es/es2018/types/src/generated/resources/patchConnectManagedContentContentSpacesContentsByContentSpaceIdAndManagedContentId.d.ts +14 -0
  64. package/dist/es/es2018/types/src/generated/resources/patchConnectManagedContentContentSpacesMembersByContentSpaceIdAndMemberIdOrMe.d.ts +14 -0
  65. package/dist/es/es2018/types/src/generated/resources/postCmsContents.d.ts +18 -0
  66. package/dist/es/es2018/types/src/generated/resources/postCmsDeliveryChannelsVariantsByChannelId.d.ts +16 -0
  67. package/dist/es/es2018/types/src/generated/resources/postCmsDeployments.d.ts +17 -0
  68. package/dist/es/es2018/types/src/generated/resources/postCmsSiteDeliveryContentsContentKeysByChannelId.d.ts +16 -0
  69. package/dist/es/es2018/types/src/generated/resources/postCmsSiteDeliveryContentsContentTypesByChannelId.d.ts +15 -0
  70. package/dist/es/es2018/types/src/generated/resources/postCmsSiteDeliveryContentsNodeIdsByChannelId.d.ts +16 -0
  71. package/dist/es/es2018/types/src/generated/resources/postConnectCmsContentJobsExport.d.ts +17 -0
  72. package/dist/es/es2018/types/src/generated/resources/postConnectCmsContentJobsImport.d.ts +16 -0
  73. package/dist/es/es2018/types/src/generated/resources/postConnectCmsContentSpacesVersionByContentSpaceId.d.ts +24 -0
  74. package/dist/es/es2018/types/src/generated/resources/postConnectCmsContentSpacesVersionsByContentSpaceId.d.ts +15 -0
  75. package/dist/es/es2018/types/src/generated/resources/postConnectCmsContentVariant.d.ts +18 -0
  76. package/dist/es/es2018/types/src/generated/resources/postConnectCmsFolders.d.ts +13 -0
  77. package/dist/es/es2018/types/src/generated/resources/postConnectCmsManagementChannels.d.ts +17 -0
  78. package/dist/es/es2018/types/src/generated/resources/postConnectCmsSchedules.d.ts +18 -0
  79. package/dist/es/es2018/types/src/generated/resources/postConnectManagedContentContentSpacesContentVersionsByContentSpaceId.d.ts +23 -0
  80. package/dist/es/es2018/types/src/generated/resources/postConnectManagedContentContentSpacesMembersByContentSpaceId.d.ts +16 -0
  81. package/dist/es/es2018/types/src/generated/resources/postConnectManagedContentTranslation.d.ts +15 -0
  82. package/dist/es/es2018/types/src/generated/resources/putConnectCmsContentVersionByManagedContentVersionId.d.ts +21 -0
  83. package/dist/es/es2018/types/src/generated/resources/putConnectCmsContentsVariantsByVariantId.d.ts +16 -0
  84. package/dist/es/es2018/types/src/generated/types/AbstractMCSFolderRepresentation.d.ts +35 -0
  85. package/dist/es/es2018/types/src/generated/types/AbstractMContentRepresentation.d.ts +50 -0
  86. package/dist/es/es2018/types/src/generated/types/ExperienceModelBlockTypeCollectionRepresentation.d.ts +43 -0
  87. package/dist/es/es2018/types/src/generated/types/ExperienceModelBlockTypeDetailRepresentation.d.ts +63 -0
  88. package/dist/es/es2018/types/src/generated/types/ExperienceModelBlockTypeSummaryRepresentation.d.ts +52 -0
  89. package/dist/es/es2018/types/src/generated/types/ExperienceModelContentTypeCollectionRepresentation.d.ts +43 -0
  90. package/dist/es/es2018/types/src/generated/types/ExperienceModelContentTypeDetailRepresentation.d.ts +55 -0
  91. package/dist/es/es2018/types/src/generated/types/ExperienceModelContentTypeSummaryRepresentation.d.ts +45 -0
  92. package/dist/es/es2018/types/src/generated/types/ExperienceModelPropertyTypeCollectionRepresentation.d.ts +43 -0
  93. package/dist/es/es2018/types/src/generated/types/ExperienceModelPropertyTypeDetailRepresentation.d.ts +55 -0
  94. package/dist/es/es2018/types/src/generated/types/ExperienceModelPropertyTypeSummaryRepresentation.d.ts +45 -0
  95. package/dist/es/es2018/types/src/generated/types/MCDeliveryV2VariantCollectionRepresentation.d.ts +30 -0
  96. package/dist/es/es2018/types/src/generated/types/MCDeliveryV2VariantInputRepresentation.d.ts +32 -0
  97. package/dist/es/es2018/types/src/generated/types/MCDeliveryV2VariantRepresentation.d.ts +53 -0
  98. package/dist/es/es2018/types/src/generated/types/MCSiteContentCollectionRepresentation.d.ts +30 -0
  99. package/dist/es/es2018/types/src/generated/types/MCSiteContentRepresentation.d.ts +46 -0
  100. package/dist/es/es2018/types/src/generated/types/MCSiteDeliveryByContentKeysInputRepresentation.d.ts +32 -0
  101. package/dist/es/es2018/types/src/generated/types/MCSiteDeliveryByContentTypesInputRepresentation.d.ts +29 -0
  102. package/dist/es/es2018/types/src/generated/types/MCSiteDeliveryByNodesInputRepresentation.d.ts +32 -0
  103. package/dist/es/es2018/types/src/generated/types/MCSiteNodeCollectionRepresentation.d.ts +30 -0
  104. package/dist/es/es2018/types/src/generated/types/MCSiteNodeRepresentation.d.ts +45 -0
  105. package/dist/es/es2018/types/src/generated/types/MCSiteVariantRepresentation.d.ts +47 -0
  106. package/dist/es/es2018/types/src/generated/types/MContentBodyRepresentation.d.ts +33 -0
  107. package/dist/es/es2018/types/src/generated/types/MContentCollectionMetadataRepresentation.d.ts +39 -0
  108. package/dist/es/es2018/types/src/generated/types/MContentCollectionRepresentation.d.ts +51 -0
  109. package/dist/es/es2018/types/src/generated/types/MContentDetailRepresentation.d.ts +31 -0
  110. package/dist/es/es2018/types/src/generated/types/MContentSummaryRepresentation.d.ts +27 -0
  111. package/dist/es/es2018/types/src/generated/types/ManagedContentAssociationsInputRep.d.ts +33 -0
  112. package/dist/es/es2018/types/src/generated/types/ManagedContentAssociationsRepresentation.d.ts +30 -0
  113. package/dist/es/es2018/types/src/generated/types/ManagedContentBodyInputRep.d.ts +33 -0
  114. package/dist/es/es2018/types/src/generated/types/ManagedContentChannelCollectionRepresentation.d.ts +42 -0
  115. package/dist/es/es2018/types/src/generated/types/ManagedContentChannelInputRepresentation.d.ts +44 -0
  116. package/dist/es/es2018/types/src/generated/types/ManagedContentChannelRepresentation.d.ts +47 -0
  117. package/dist/es/es2018/types/src/generated/types/ManagedContentChildRepresentation.d.ts +35 -0
  118. package/dist/es/es2018/types/src/generated/types/ManagedContentCollectionRepresentation.d.ts +30 -0
  119. package/dist/es/es2018/types/src/generated/types/ManagedContentDateAndTimeNodeValueRepresentation.d.ts +34 -0
  120. package/dist/es/es2018/types/src/generated/types/ManagedContentDateNodeValueRepresentation.d.ts +30 -0
  121. package/dist/es/es2018/types/src/generated/types/ManagedContentDeploymentCollectionRepresentation.d.ts +39 -0
  122. package/dist/es/es2018/types/src/generated/types/ManagedContentDeploymentInputRepresentation.d.ts +44 -0
  123. package/dist/es/es2018/types/src/generated/types/ManagedContentDeploymentItemRepresentation.d.ts +41 -0
  124. package/dist/es/es2018/types/src/generated/types/ManagedContentDeploymentRepresentation.d.ts +51 -0
  125. package/dist/es/es2018/types/src/generated/types/ManagedContentDetailCollectionRepresentation.d.ts +33 -0
  126. package/dist/es/es2018/types/src/generated/types/ManagedContentDetailRepresentation.d.ts +38 -0
  127. package/dist/es/es2018/types/src/generated/types/ManagedContentDocumentRepresentation.d.ts +74 -0
  128. package/dist/es/es2018/types/src/generated/types/ManagedContentExportContentJobRequestInputRepresentation.d.ts +44 -0
  129. package/dist/es/es2018/types/src/generated/types/ManagedContentExportJobItemIdsInputList.d.ts +29 -0
  130. package/dist/es/es2018/types/src/generated/types/ManagedContentFolderSummaryRepresentation.d.ts +32 -0
  131. package/dist/es/es2018/types/src/generated/types/ManagedContentInputRep.d.ts +32 -0
  132. package/dist/es/es2018/types/src/generated/types/ManagedContentInputRepresentation.d.ts +45 -0
  133. package/dist/es/es2018/types/src/generated/types/ManagedContentJobRepresentation.d.ts +65 -0
  134. package/dist/es/es2018/types/src/generated/types/ManagedContentJobRequestInputRepresentation.d.ts +41 -0
  135. package/dist/es/es2018/types/src/generated/types/ManagedContentMediaNodeValueRepresentation.d.ts +57 -0
  136. package/dist/es/es2018/types/src/generated/types/ManagedContentMediaSourceNodeValueRepresentation.d.ts +51 -0
  137. package/dist/es/es2018/types/src/generated/types/ManagedContentNodeTypeRepresentation.d.ts +35 -0
  138. package/dist/es/es2018/types/src/generated/types/ManagedContentNodeValueRepresentation.d.ts +34 -0
  139. package/dist/es/es2018/types/src/generated/types/ManagedContentRepresentation.d.ts +32 -0
  140. package/dist/es/es2018/types/src/generated/types/ManagedContentScheduleInputRepresentation.d.ts +47 -0
  141. package/dist/es/es2018/types/src/generated/types/ManagedContentSearchResultCollectionRepresentation.d.ts +39 -0
  142. package/dist/es/es2018/types/src/generated/types/ManagedContentSearchResultContentTypeRepresentation.d.ts +32 -0
  143. package/dist/es/es2018/types/src/generated/types/ManagedContentSearchResultRepresentation.d.ts +45 -0
  144. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceFolderDetailRepresentation.d.ts +43 -0
  145. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceFolderInputRep.d.ts +32 -0
  146. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceFolderItemCollectionInputRep.d.ts +32 -0
  147. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceFolderItemCollectionRepresentation.d.ts +36 -0
  148. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceFolderItemRepresentation.d.ts +65 -0
  149. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceFolderRepresentation.d.ts +27 -0
  150. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceMemberCollectionRepresentation.d.ts +30 -0
  151. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceMemberInputRepresentation.d.ts +32 -0
  152. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceMemberPermissionsRepresentation.d.ts +38 -0
  153. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceMemberRepresentation.d.ts +35 -0
  154. package/dist/es/es2018/types/src/generated/types/ManagedContentSpacePermissionRepresentation.d.ts +50 -0
  155. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceRepresentation.d.ts +56 -0
  156. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceRoleCollectionRepresentation.d.ts +30 -0
  157. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceRoleRepresentation.d.ts +35 -0
  158. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceSummaryRepresentation.d.ts +32 -0
  159. package/dist/es/es2018/types/src/generated/types/ManagedContentTextNodeValueRepresentation.d.ts +30 -0
  160. package/dist/es/es2018/types/src/generated/types/ManagedContentTranslationRepresentation.d.ts +65 -0
  161. package/dist/es/es2018/types/src/generated/types/ManagedContentTranslationRequestInputRep.d.ts +38 -0
  162. package/dist/es/es2018/types/src/generated/types/ManagedContentTypeRepresentation.d.ts +40 -0
  163. package/dist/es/es2018/types/src/generated/types/ManagedContentTypeSchemaRepresentation.d.ts +49 -0
  164. package/dist/es/es2018/types/src/generated/types/ManagedContentTypeSearchableCollectionRepresentation.d.ts +39 -0
  165. package/dist/es/es2018/types/src/generated/types/ManagedContentTypeSearchableInputRepresentation.d.ts +32 -0
  166. package/dist/es/es2018/types/src/generated/types/ManagedContentTypeSearchableRepresentation.d.ts +38 -0
  167. package/dist/es/es2018/types/src/generated/types/ManagedContentTypeSummaryRepresentation.d.ts +32 -0
  168. package/dist/es/es2018/types/src/generated/types/ManagedContentTypeViewRepresentation.d.ts +39 -0
  169. package/dist/es/es2018/types/src/generated/types/ManagedContentUserSummaryRepresentation.d.ts +32 -0
  170. package/dist/es/es2018/types/src/generated/types/ManagedContentVariantRepresentation.d.ts +79 -0
  171. package/dist/es/es2018/types/src/generated/types/ManagedContentVariantUpdateInputRepresentation.d.ts +39 -0
  172. package/dist/es/es2018/types/src/generated/types/ManagedContentVariantV1InputRep.d.ts +47 -0
  173. package/dist/es/es2018/types/src/generated/types/ManagedContentVariantV1Representation.d.ts +50 -0
  174. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionCollectionRepresentation.d.ts +50 -0
  175. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionInputRep.d.ts +51 -0
  176. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionInternalCollectionRepresentation.d.ts +33 -0
  177. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionInternalRepresentation.d.ts +81 -0
  178. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionRepresentation.d.ts +66 -0
  179. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionSiteNodeCollectionRepresentation.d.ts +30 -0
  180. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionSiteNodeRepresentation.d.ts +41 -0
  181. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionV2CollectionInputRepresentation.d.ts +29 -0
  182. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionV2CollectionRepresentation.d.ts +33 -0
  183. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionV2InputRepresentation.d.ts +54 -0
  184. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionV2Representation.d.ts +75 -0
  185. package/dist/es/es2018/types/src/generated/types/ReferenceRepresentation.d.ts +32 -0
  186. package/dist/es/es2018/types/src/generated/types/StreamedRepresentation.d.ts +26 -0
  187. package/dist/es/es2018/types/src/generated/types/TopicSummaryRepresentation.d.ts +32 -0
  188. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +39 -0
  189. package/package.json +68 -0
  190. package/sfdc/index.d.ts +1 -0
  191. package/sfdc/index.js +2306 -0
  192. package/src/raml/api.raml +3820 -0
  193. package/src/raml/luvio.raml +129 -0
package/sfdc/index.js ADDED
@@ -0,0 +1,2306 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /* *******************************************************************************************
8
+ * ATTENTION!
9
+ * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
10
+ * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
11
+ * Any changes made to this file in p4 will be automatically overwritten.
12
+ * *******************************************************************************************
13
+ */
14
+ /* proxy-compat-disable */
15
+ import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
16
+ import { withDefaultLuvio } from 'force/ldsEngine';
17
+ import { serializeStructuredKey, StoreKeyMap } from 'force/luvioEngine';
18
+
19
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
+ const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
21
+ const { isArray: ArrayIsArray$1 } = Array;
22
+ /**
23
+ * Validates an adapter config is well-formed.
24
+ * @param config The config to validate.
25
+ * @param adapter The adapter validation configuration.
26
+ * @param oneOf The keys the config must contain at least one of.
27
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
28
+ */
29
+ function validateConfig(config, adapter, oneOf) {
30
+ const { displayName } = adapter;
31
+ const { required, optional, unsupported } = adapter.parameters;
32
+ if (config === undefined ||
33
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
34
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
35
+ }
36
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
37
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
38
+ }
39
+ if (unsupported !== undefined &&
40
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
41
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
42
+ }
43
+ const supported = required.concat(optional);
44
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
45
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
46
+ }
47
+ }
48
+ function untrustedIsObject(untrusted) {
49
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
50
+ }
51
+ function areRequiredParametersPresent(config, configPropertyNames) {
52
+ return configPropertyNames.parameters.required.every(req => req in config);
53
+ }
54
+ const snapshotRefreshOptions = {
55
+ overrides: {
56
+ headers: {
57
+ 'Cache-Control': 'no-cache',
58
+ },
59
+ }
60
+ };
61
+ const keyPrefix = 'ExperienceType';
62
+
63
+ const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
64
+ const { isArray: ArrayIsArray } = Array;
65
+ const { stringify: JSONStringify } = JSON;
66
+ function deepFreeze$9(value) {
67
+ // No need to freeze primitives
68
+ if (typeof value !== 'object' || value === null) {
69
+ return;
70
+ }
71
+ if (ArrayIsArray(value)) {
72
+ for (let i = 0, len = value.length; i < len; i += 1) {
73
+ deepFreeze$9(value[i]);
74
+ }
75
+ }
76
+ else {
77
+ const keys = ObjectKeys(value);
78
+ for (let i = 0, len = keys.length; i < len; i += 1) {
79
+ deepFreeze$9(value[keys[i]]);
80
+ }
81
+ }
82
+ ObjectFreeze(value);
83
+ }
84
+ function createLink(ref) {
85
+ return {
86
+ __ref: serializeStructuredKey(ref),
87
+ };
88
+ }
89
+
90
+ const TTL$5 = 3600000;
91
+ const VERSION$5 = "5a3f5e1d42d8f0aa089e888ddac06972";
92
+ function validate$8(obj, path = 'ExperienceModelBlockTypeDetailRepresentation') {
93
+ const v_error = (() => {
94
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
95
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
96
+ }
97
+ if (obj.description !== undefined) {
98
+ const obj_description = obj.description;
99
+ const path_description = path + '.description';
100
+ if (typeof obj_description !== 'string') {
101
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
102
+ }
103
+ }
104
+ if (obj.designConfig !== undefined) {
105
+ const obj_designConfig = obj.designConfig;
106
+ const path_designConfig = path + '.designConfig';
107
+ if (typeof obj_designConfig !== 'object' || ArrayIsArray(obj_designConfig) || obj_designConfig === null) {
108
+ return new TypeError('Expected "object" but received "' + typeof obj_designConfig + '" (at "' + path_designConfig + '")');
109
+ }
110
+ const obj_designConfig_keys = ObjectKeys(obj_designConfig);
111
+ for (let i = 0; i < obj_designConfig_keys.length; i++) {
112
+ const key = obj_designConfig_keys[i];
113
+ const obj_designConfig_prop = obj_designConfig[key];
114
+ const path_designConfig_prop = path_designConfig + '["' + key + '"]';
115
+ if (obj_designConfig_prop === undefined) {
116
+ return new TypeError('Expected "defined" but received "' + typeof obj_designConfig_prop + '" (at "' + path_designConfig_prop + '")');
117
+ }
118
+ }
119
+ }
120
+ const obj_developerName = obj.developerName;
121
+ const path_developerName = path + '.developerName';
122
+ if (typeof obj_developerName !== 'string') {
123
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
124
+ }
125
+ if (obj.id !== undefined) {
126
+ const obj_id = obj.id;
127
+ const path_id = path + '.id';
128
+ if (typeof obj_id !== 'string') {
129
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
130
+ }
131
+ }
132
+ const obj_namespacePrefix = obj.namespacePrefix;
133
+ const path_namespacePrefix = path + '.namespacePrefix';
134
+ if (typeof obj_namespacePrefix !== 'string') {
135
+ return new TypeError('Expected "string" but received "' + typeof obj_namespacePrefix + '" (at "' + path_namespacePrefix + '")');
136
+ }
137
+ if (obj.renditionConfig !== undefined) {
138
+ const obj_renditionConfig = obj.renditionConfig;
139
+ const path_renditionConfig = path + '.renditionConfig';
140
+ if (typeof obj_renditionConfig !== 'object' || ArrayIsArray(obj_renditionConfig) || obj_renditionConfig === null) {
141
+ return new TypeError('Expected "object" but received "' + typeof obj_renditionConfig + '" (at "' + path_renditionConfig + '")');
142
+ }
143
+ const obj_renditionConfig_keys = ObjectKeys(obj_renditionConfig);
144
+ for (let i = 0; i < obj_renditionConfig_keys.length; i++) {
145
+ const key = obj_renditionConfig_keys[i];
146
+ const obj_renditionConfig_prop = obj_renditionConfig[key];
147
+ const path_renditionConfig_prop = path_renditionConfig + '["' + key + '"]';
148
+ if (obj_renditionConfig_prop === undefined) {
149
+ return new TypeError('Expected "defined" but received "' + typeof obj_renditionConfig_prop + '" (at "' + path_renditionConfig_prop + '")');
150
+ }
151
+ }
152
+ }
153
+ const obj_schema = obj.schema;
154
+ const path_schema = path + '.schema';
155
+ if (typeof obj_schema !== 'object' || ArrayIsArray(obj_schema) || obj_schema === null) {
156
+ return new TypeError('Expected "object" but received "' + typeof obj_schema + '" (at "' + path_schema + '")');
157
+ }
158
+ const obj_schema_keys = ObjectKeys(obj_schema);
159
+ for (let i = 0; i < obj_schema_keys.length; i++) {
160
+ const key = obj_schema_keys[i];
161
+ const obj_schema_prop = obj_schema[key];
162
+ const path_schema_prop = path_schema + '["' + key + '"]';
163
+ if (obj_schema_prop === undefined) {
164
+ return new TypeError('Expected "defined" but received "' + typeof obj_schema_prop + '" (at "' + path_schema_prop + '")');
165
+ }
166
+ }
167
+ if (obj.title !== undefined) {
168
+ const obj_title = obj.title;
169
+ const path_title = path + '.title';
170
+ if (typeof obj_title !== 'string') {
171
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
172
+ }
173
+ }
174
+ })();
175
+ return v_error === undefined ? null : v_error;
176
+ }
177
+ const RepresentationType$5 = 'ExperienceModelBlockTypeDetailRepresentation';
178
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
179
+ return input;
180
+ }
181
+ const select$b = function ExperienceModelBlockTypeDetailRepresentationSelect() {
182
+ return {
183
+ kind: 'Fragment',
184
+ version: VERSION$5,
185
+ private: [],
186
+ opaque: true
187
+ };
188
+ };
189
+ function equals$5(existing, incoming) {
190
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
191
+ return false;
192
+ }
193
+ return true;
194
+ }
195
+ function deepFreeze$8(input) {
196
+ const input_designConfig = input.designConfig;
197
+ if (input_designConfig !== undefined) {
198
+ const input_designConfig_keys = Object.keys(input_designConfig);
199
+ const input_designConfig_length = input_designConfig_keys.length;
200
+ for (let i = 0; i < input_designConfig_length; i++) {
201
+ const key = input_designConfig_keys[i];
202
+ const input_designConfig_prop = input_designConfig[key];
203
+ deepFreeze$9(input_designConfig_prop);
204
+ }
205
+ ObjectFreeze(input_designConfig);
206
+ }
207
+ const input_renditionConfig = input.renditionConfig;
208
+ if (input_renditionConfig !== undefined) {
209
+ const input_renditionConfig_keys = Object.keys(input_renditionConfig);
210
+ const input_renditionConfig_length = input_renditionConfig_keys.length;
211
+ for (let i = 0; i < input_renditionConfig_length; i++) {
212
+ const key = input_renditionConfig_keys[i];
213
+ const input_renditionConfig_prop = input_renditionConfig[key];
214
+ deepFreeze$9(input_renditionConfig_prop);
215
+ }
216
+ ObjectFreeze(input_renditionConfig);
217
+ }
218
+ const input_schema = input.schema;
219
+ const input_schema_keys = Object.keys(input_schema);
220
+ const input_schema_length = input_schema_keys.length;
221
+ for (let i = 0; i < input_schema_length; i++) {
222
+ const key = input_schema_keys[i];
223
+ const input_schema_prop = input_schema[key];
224
+ deepFreeze$9(input_schema_prop);
225
+ }
226
+ ObjectFreeze(input_schema);
227
+ ObjectFreeze(input);
228
+ }
229
+ const ingest$5 = function ExperienceModelBlockTypeDetailRepresentationIngest(input, path, luvio, store, timestamp) {
230
+ if (process.env.NODE_ENV !== 'production') {
231
+ const validateError = validate$8(input);
232
+ if (validateError !== null) {
233
+ throw validateError;
234
+ }
235
+ }
236
+ const key = path.fullPath;
237
+ const existingRecord = store.readEntry(key);
238
+ const ttlToUse = TTL$5;
239
+ let incomingRecord = normalize$5(input, store.readEntry(key), {
240
+ fullPath: key,
241
+ parent: path.parent,
242
+ propertyName: path.propertyName,
243
+ ttl: ttlToUse
244
+ });
245
+ deepFreeze$8(input);
246
+ if (existingRecord === undefined || equals$5(existingRecord, incomingRecord) === false) {
247
+ luvio.storePublish(key, incomingRecord);
248
+ }
249
+ {
250
+ const storeMetadataParams = {
251
+ ttl: ttlToUse,
252
+ namespace: "ExperienceType",
253
+ version: VERSION$5,
254
+ representationName: RepresentationType$5,
255
+ };
256
+ luvio.publishStoreMetadata(key, storeMetadataParams);
257
+ }
258
+ return createLink(key);
259
+ };
260
+ function getTypeCacheKeys$5(luvio, input, fullPathFactory) {
261
+ const rootKeySet = new StoreKeyMap();
262
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
263
+ const rootKey = fullPathFactory();
264
+ rootKeySet.set(rootKey, {
265
+ namespace: keyPrefix,
266
+ representationName: RepresentationType$5,
267
+ mergeable: false
268
+ });
269
+ return rootKeySet;
270
+ }
271
+
272
+ function select$a(luvio, params) {
273
+ return select$b();
274
+ }
275
+ function keyBuilder$b(luvio, params) {
276
+ return keyPrefix + '::ExperienceModelBlockTypeDetailRepresentation:(' + 'designConfigTarget:' + params.queryParams.designConfigTarget + ',' + 'includeSubSchemaDefinitions:' + params.queryParams.includeSubSchemaDefinitions + ',' + 'language:' + params.queryParams.language + ',' + 'renditionConfigTarget:' + params.queryParams.renditionConfigTarget + ',' + 'fullyQualifiedName:' + params.urlParams.fullyQualifiedName + ')';
277
+ }
278
+ function getResponseCacheKeys$5(luvio, resourceParams, response) {
279
+ return getTypeCacheKeys$5(luvio, response, () => keyBuilder$b(luvio, resourceParams));
280
+ }
281
+ function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
282
+ const { body } = response;
283
+ const key = keyBuilder$b(luvio, resourceParams);
284
+ luvio.storeIngest(key, ingest$5, body);
285
+ const snapshot = luvio.storeLookup({
286
+ recordId: key,
287
+ node: select$a(),
288
+ variables: {},
289
+ }, snapshotRefresh);
290
+ if (process.env.NODE_ENV !== 'production') {
291
+ if (snapshot.state !== 'Fulfilled') {
292
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
293
+ }
294
+ }
295
+ return snapshot;
296
+ }
297
+ function ingestError$5(luvio, params, error, snapshotRefresh) {
298
+ const key = keyBuilder$b(luvio, params);
299
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
300
+ const storeMetadataParams = {
301
+ ttl: TTL$5,
302
+ namespace: keyPrefix,
303
+ version: VERSION$5,
304
+ representationName: RepresentationType$5
305
+ };
306
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
307
+ return errorSnapshot;
308
+ }
309
+ function createResourceRequest$5(config) {
310
+ const headers = {};
311
+ return {
312
+ baseUri: '/services/data/v58.0',
313
+ basePath: '/connect/experience-model/block-types/' + config.urlParams.fullyQualifiedName + '',
314
+ method: 'get',
315
+ body: null,
316
+ urlParams: config.urlParams,
317
+ queryParams: config.queryParams,
318
+ headers,
319
+ priority: 'normal',
320
+ };
321
+ }
322
+
323
+ const getBlockType_ConfigPropertyNames = {
324
+ displayName: 'getBlockType',
325
+ parameters: {
326
+ required: ['fullyQualifiedName'],
327
+ optional: ['designConfigTarget', 'includeSubSchemaDefinitions', 'language', 'renditionConfigTarget']
328
+ }
329
+ };
330
+ function createResourceParams$5(config) {
331
+ const resourceParams = {
332
+ urlParams: {
333
+ fullyQualifiedName: config.fullyQualifiedName
334
+ },
335
+ queryParams: {
336
+ designConfigTarget: config.designConfigTarget, includeSubSchemaDefinitions: config.includeSubSchemaDefinitions, language: config.language, renditionConfigTarget: config.renditionConfigTarget
337
+ }
338
+ };
339
+ return resourceParams;
340
+ }
341
+ function keyBuilder$a(luvio, config) {
342
+ const resourceParams = createResourceParams$5(config);
343
+ return keyBuilder$b(luvio, resourceParams);
344
+ }
345
+ function typeCheckConfig$5(untrustedConfig) {
346
+ const config = {};
347
+ const untrustedConfig_fullyQualifiedName = untrustedConfig.fullyQualifiedName;
348
+ if (typeof untrustedConfig_fullyQualifiedName === 'string') {
349
+ config.fullyQualifiedName = untrustedConfig_fullyQualifiedName;
350
+ }
351
+ const untrustedConfig_designConfigTarget = untrustedConfig.designConfigTarget;
352
+ if (typeof untrustedConfig_designConfigTarget === 'string') {
353
+ config.designConfigTarget = untrustedConfig_designConfigTarget;
354
+ }
355
+ const untrustedConfig_includeSubSchemaDefinitions = untrustedConfig.includeSubSchemaDefinitions;
356
+ if (typeof untrustedConfig_includeSubSchemaDefinitions === 'boolean') {
357
+ config.includeSubSchemaDefinitions = untrustedConfig_includeSubSchemaDefinitions;
358
+ }
359
+ const untrustedConfig_language = untrustedConfig.language;
360
+ if (typeof untrustedConfig_language === 'string') {
361
+ config.language = untrustedConfig_language;
362
+ }
363
+ const untrustedConfig_renditionConfigTarget = untrustedConfig.renditionConfigTarget;
364
+ if (typeof untrustedConfig_renditionConfigTarget === 'string') {
365
+ config.renditionConfigTarget = untrustedConfig_renditionConfigTarget;
366
+ }
367
+ return config;
368
+ }
369
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
370
+ if (!untrustedIsObject(untrustedConfig)) {
371
+ return null;
372
+ }
373
+ if (process.env.NODE_ENV !== 'production') {
374
+ validateConfig(untrustedConfig, configPropertyNames);
375
+ }
376
+ const config = typeCheckConfig$5(untrustedConfig);
377
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
378
+ return null;
379
+ }
380
+ return config;
381
+ }
382
+ function adapterFragment$5(luvio, config) {
383
+ createResourceParams$5(config);
384
+ return select$a();
385
+ }
386
+ function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
387
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
388
+ config,
389
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
390
+ });
391
+ return luvio.storeBroadcast().then(() => snapshot);
392
+ }
393
+ function onFetchResponseError$5(luvio, config, resourceParams, response) {
394
+ const snapshot = ingestError$5(luvio, resourceParams, response, {
395
+ config,
396
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
397
+ });
398
+ return luvio.storeBroadcast().then(() => snapshot);
399
+ }
400
+ function buildNetworkSnapshot$5(luvio, config, options) {
401
+ const resourceParams = createResourceParams$5(config);
402
+ const request = createResourceRequest$5(resourceParams);
403
+ return luvio.dispatchResourceRequest(request, options)
404
+ .then((response) => {
405
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => getResponseCacheKeys$5(luvio, resourceParams, response.body));
406
+ }, (response) => {
407
+ return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
408
+ });
409
+ }
410
+ function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
411
+ const { luvio, config } = context;
412
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
413
+ const dispatchOptions = {
414
+ resourceRequestContext: {
415
+ requestCorrelator,
416
+ luvioRequestMethod: undefined,
417
+ },
418
+ eventObservers
419
+ };
420
+ if (networkPriority !== 'normal') {
421
+ dispatchOptions.overrides = {
422
+ priority: networkPriority
423
+ };
424
+ }
425
+ return buildNetworkSnapshot$5(luvio, config, dispatchOptions);
426
+ }
427
+ function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
428
+ const { luvio, config } = context;
429
+ const selector = {
430
+ recordId: keyBuilder$a(luvio, config),
431
+ node: adapterFragment$5(luvio, config),
432
+ variables: {},
433
+ };
434
+ const cacheSnapshot = storeLookup(selector, {
435
+ config,
436
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
437
+ });
438
+ return cacheSnapshot;
439
+ }
440
+ const getBlockTypeAdapterFactory = (luvio) => function ExperienceType__getBlockType(untrustedConfig, requestContext) {
441
+ const config = validateAdapterConfig$5(untrustedConfig, getBlockType_ConfigPropertyNames);
442
+ // Invalid or incomplete config
443
+ if (config === null) {
444
+ return null;
445
+ }
446
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
447
+ buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
448
+ };
449
+
450
+ function validate$7(obj, path = 'ExperienceModelBlockTypeSummaryRepresentation') {
451
+ const v_error = (() => {
452
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
453
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
454
+ }
455
+ if (obj.description !== undefined) {
456
+ const obj_description = obj.description;
457
+ const path_description = path + '.description';
458
+ if (typeof obj_description !== 'string') {
459
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
460
+ }
461
+ }
462
+ const obj_detailUrl = obj.detailUrl;
463
+ const path_detailUrl = path + '.detailUrl';
464
+ if (typeof obj_detailUrl !== 'string') {
465
+ return new TypeError('Expected "string" but received "' + typeof obj_detailUrl + '" (at "' + path_detailUrl + '")');
466
+ }
467
+ const obj_developerName = obj.developerName;
468
+ const path_developerName = path + '.developerName';
469
+ if (typeof obj_developerName !== 'string') {
470
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
471
+ }
472
+ const obj_icon = obj.icon;
473
+ const path_icon = path + '.icon';
474
+ if (typeof obj_icon !== 'object' || ArrayIsArray(obj_icon) || obj_icon === null) {
475
+ return new TypeError('Expected "object" but received "' + typeof obj_icon + '" (at "' + path_icon + '")');
476
+ }
477
+ const obj_icon_keys = ObjectKeys(obj_icon);
478
+ for (let i = 0; i < obj_icon_keys.length; i++) {
479
+ const key = obj_icon_keys[i];
480
+ const obj_icon_prop = obj_icon[key];
481
+ const path_icon_prop = path_icon + '["' + key + '"]';
482
+ if (typeof obj_icon_prop !== 'string') {
483
+ return new TypeError('Expected "string" but received "' + typeof obj_icon_prop + '" (at "' + path_icon_prop + '")');
484
+ }
485
+ }
486
+ if (obj.id !== undefined) {
487
+ const obj_id = obj.id;
488
+ const path_id = path + '.id';
489
+ if (typeof obj_id !== 'string') {
490
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
491
+ }
492
+ }
493
+ const obj_namespacePrefix = obj.namespacePrefix;
494
+ const path_namespacePrefix = path + '.namespacePrefix';
495
+ if (typeof obj_namespacePrefix !== 'string') {
496
+ return new TypeError('Expected "string" but received "' + typeof obj_namespacePrefix + '" (at "' + path_namespacePrefix + '")');
497
+ }
498
+ const obj_title = obj.title;
499
+ const path_title = path + '.title';
500
+ if (typeof obj_title !== 'string') {
501
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
502
+ }
503
+ })();
504
+ return v_error === undefined ? null : v_error;
505
+ }
506
+ function deepFreeze$7(input) {
507
+ const input_icon = input.icon;
508
+ const input_icon_keys = Object.keys(input_icon);
509
+ const input_icon_length = input_icon_keys.length;
510
+ for (let i = 0; i < input_icon_length; i++) {
511
+ input_icon_keys[i];
512
+ }
513
+ ObjectFreeze(input_icon);
514
+ ObjectFreeze(input);
515
+ }
516
+
517
+ const TTL$4 = 3600000;
518
+ const VERSION$4 = "c4cd880e972cdf9faaa6db963fe35b31";
519
+ function validate$6(obj, path = 'ExperienceModelBlockTypeCollectionRepresentation') {
520
+ const v_error = (() => {
521
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
522
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
523
+ }
524
+ const obj_blockTypes = obj.blockTypes;
525
+ const path_blockTypes = path + '.blockTypes';
526
+ if (!ArrayIsArray(obj_blockTypes)) {
527
+ return new TypeError('Expected "array" but received "' + typeof obj_blockTypes + '" (at "' + path_blockTypes + '")');
528
+ }
529
+ for (let i = 0; i < obj_blockTypes.length; i++) {
530
+ const obj_blockTypes_item = obj_blockTypes[i];
531
+ const path_blockTypes_item = path_blockTypes + '[' + i + ']';
532
+ const referencepath_blockTypes_itemValidationError = validate$7(obj_blockTypes_item, path_blockTypes_item);
533
+ if (referencepath_blockTypes_itemValidationError !== null) {
534
+ let message = 'Object doesn\'t match ExperienceModelBlockTypeSummaryRepresentation (at "' + path_blockTypes_item + '")\n';
535
+ message += referencepath_blockTypes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
536
+ return new TypeError(message);
537
+ }
538
+ }
539
+ const obj_count = obj.count;
540
+ const path_count = path + '.count';
541
+ if (typeof obj_count !== 'number' || (typeof obj_count === 'number' && Math.floor(obj_count) !== obj_count)) {
542
+ return new TypeError('Expected "integer" but received "' + typeof obj_count + '" (at "' + path_count + '")');
543
+ }
544
+ const obj_currentPageUrl = obj.currentPageUrl;
545
+ const path_currentPageUrl = path + '.currentPageUrl';
546
+ if (typeof obj_currentPageUrl !== 'string') {
547
+ return new TypeError('Expected "string" but received "' + typeof obj_currentPageUrl + '" (at "' + path_currentPageUrl + '")');
548
+ }
549
+ if (obj.nextPageUrl !== undefined) {
550
+ const obj_nextPageUrl = obj.nextPageUrl;
551
+ const path_nextPageUrl = path + '.nextPageUrl';
552
+ if (typeof obj_nextPageUrl !== 'string') {
553
+ return new TypeError('Expected "string" but received "' + typeof obj_nextPageUrl + '" (at "' + path_nextPageUrl + '")');
554
+ }
555
+ }
556
+ if (obj.previousPageUrl !== undefined) {
557
+ const obj_previousPageUrl = obj.previousPageUrl;
558
+ const path_previousPageUrl = path + '.previousPageUrl';
559
+ if (typeof obj_previousPageUrl !== 'string') {
560
+ return new TypeError('Expected "string" but received "' + typeof obj_previousPageUrl + '" (at "' + path_previousPageUrl + '")');
561
+ }
562
+ }
563
+ })();
564
+ return v_error === undefined ? null : v_error;
565
+ }
566
+ const RepresentationType$4 = 'ExperienceModelBlockTypeCollectionRepresentation';
567
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
568
+ return input;
569
+ }
570
+ const select$9 = function ExperienceModelBlockTypeCollectionRepresentationSelect() {
571
+ return {
572
+ kind: 'Fragment',
573
+ version: VERSION$4,
574
+ private: [],
575
+ opaque: true
576
+ };
577
+ };
578
+ function equals$4(existing, incoming) {
579
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
580
+ return false;
581
+ }
582
+ return true;
583
+ }
584
+ function deepFreeze$6(input) {
585
+ const input_blockTypes = input.blockTypes;
586
+ for (let i = 0; i < input_blockTypes.length; i++) {
587
+ const input_blockTypes_item = input_blockTypes[i];
588
+ deepFreeze$7(input_blockTypes_item);
589
+ }
590
+ ObjectFreeze(input_blockTypes);
591
+ ObjectFreeze(input);
592
+ }
593
+ const ingest$4 = function ExperienceModelBlockTypeCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
594
+ if (process.env.NODE_ENV !== 'production') {
595
+ const validateError = validate$6(input);
596
+ if (validateError !== null) {
597
+ throw validateError;
598
+ }
599
+ }
600
+ const key = path.fullPath;
601
+ const existingRecord = store.readEntry(key);
602
+ const ttlToUse = TTL$4;
603
+ let incomingRecord = normalize$4(input, store.readEntry(key), {
604
+ fullPath: key,
605
+ parent: path.parent,
606
+ propertyName: path.propertyName,
607
+ ttl: ttlToUse
608
+ });
609
+ deepFreeze$6(input);
610
+ if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
611
+ luvio.storePublish(key, incomingRecord);
612
+ }
613
+ {
614
+ const storeMetadataParams = {
615
+ ttl: ttlToUse,
616
+ namespace: "ExperienceType",
617
+ version: VERSION$4,
618
+ representationName: RepresentationType$4,
619
+ };
620
+ luvio.publishStoreMetadata(key, storeMetadataParams);
621
+ }
622
+ return createLink(key);
623
+ };
624
+ function getTypeCacheKeys$4(luvio, input, fullPathFactory) {
625
+ const rootKeySet = new StoreKeyMap();
626
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
627
+ const rootKey = fullPathFactory();
628
+ rootKeySet.set(rootKey, {
629
+ namespace: keyPrefix,
630
+ representationName: RepresentationType$4,
631
+ mergeable: false
632
+ });
633
+ return rootKeySet;
634
+ }
635
+
636
+ function select$8(luvio, params) {
637
+ return select$9();
638
+ }
639
+ function keyBuilder$9(luvio, params) {
640
+ return keyPrefix + '::ExperienceModelBlockTypeCollectionRepresentation:(' + 'contentTypeFullyQualifiedName:' + params.queryParams.contentTypeFullyQualifiedName + ',' + 'designConfigTarget:' + params.queryParams.designConfigTarget + ',' + 'fullyQualifiedNames:' + params.queryParams.fullyQualifiedNames + ',' + 'language:' + params.queryParams.language + ',' + 'mixinTypeFullyQualifiedNames:' + params.queryParams.mixinTypeFullyQualifiedNames + ',' + 'page:' + params.queryParams.page + ',' + 'pageSize:' + params.queryParams.pageSize + ',' + 'renditionConfigTarget:' + params.queryParams.renditionConfigTarget + ',' + 'typeClassFullyQualifiedNames:' + params.queryParams.typeClassFullyQualifiedNames + ')';
641
+ }
642
+ function getResponseCacheKeys$4(luvio, resourceParams, response) {
643
+ return getTypeCacheKeys$4(luvio, response, () => keyBuilder$9(luvio, resourceParams));
644
+ }
645
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
646
+ const { body } = response;
647
+ const key = keyBuilder$9(luvio, resourceParams);
648
+ luvio.storeIngest(key, ingest$4, body);
649
+ const snapshot = luvio.storeLookup({
650
+ recordId: key,
651
+ node: select$8(),
652
+ variables: {},
653
+ }, snapshotRefresh);
654
+ if (process.env.NODE_ENV !== 'production') {
655
+ if (snapshot.state !== 'Fulfilled') {
656
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
657
+ }
658
+ }
659
+ return snapshot;
660
+ }
661
+ function ingestError$4(luvio, params, error, snapshotRefresh) {
662
+ const key = keyBuilder$9(luvio, params);
663
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
664
+ const storeMetadataParams = {
665
+ ttl: TTL$4,
666
+ namespace: keyPrefix,
667
+ version: VERSION$4,
668
+ representationName: RepresentationType$4
669
+ };
670
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
671
+ return errorSnapshot;
672
+ }
673
+ function createResourceRequest$4(config) {
674
+ const headers = {};
675
+ return {
676
+ baseUri: '/services/data/v58.0',
677
+ basePath: '/connect/experience-model/block-types',
678
+ method: 'get',
679
+ body: null,
680
+ urlParams: {},
681
+ queryParams: config.queryParams,
682
+ headers,
683
+ priority: 'normal',
684
+ };
685
+ }
686
+
687
+ const getBlockTypes_ConfigPropertyNames = {
688
+ displayName: 'getBlockTypes',
689
+ parameters: {
690
+ required: [],
691
+ optional: ['contentTypeFullyQualifiedName', 'designConfigTarget', 'fullyQualifiedNames', 'language', 'mixinTypeFullyQualifiedNames', 'page', 'pageSize', 'renditionConfigTarget', 'typeClassFullyQualifiedNames']
692
+ }
693
+ };
694
+ function createResourceParams$4(config) {
695
+ const resourceParams = {
696
+ queryParams: {
697
+ contentTypeFullyQualifiedName: config.contentTypeFullyQualifiedName, designConfigTarget: config.designConfigTarget, fullyQualifiedNames: config.fullyQualifiedNames, language: config.language, mixinTypeFullyQualifiedNames: config.mixinTypeFullyQualifiedNames, page: config.page, pageSize: config.pageSize, renditionConfigTarget: config.renditionConfigTarget, typeClassFullyQualifiedNames: config.typeClassFullyQualifiedNames
698
+ }
699
+ };
700
+ return resourceParams;
701
+ }
702
+ function keyBuilder$8(luvio, config) {
703
+ const resourceParams = createResourceParams$4(config);
704
+ return keyBuilder$9(luvio, resourceParams);
705
+ }
706
+ function typeCheckConfig$4(untrustedConfig) {
707
+ const config = {};
708
+ const untrustedConfig_contentTypeFullyQualifiedName = untrustedConfig.contentTypeFullyQualifiedName;
709
+ if (typeof untrustedConfig_contentTypeFullyQualifiedName === 'string') {
710
+ config.contentTypeFullyQualifiedName = untrustedConfig_contentTypeFullyQualifiedName;
711
+ }
712
+ const untrustedConfig_designConfigTarget = untrustedConfig.designConfigTarget;
713
+ if (typeof untrustedConfig_designConfigTarget === 'string') {
714
+ config.designConfigTarget = untrustedConfig_designConfigTarget;
715
+ }
716
+ const untrustedConfig_fullyQualifiedNames = untrustedConfig.fullyQualifiedNames;
717
+ if (ArrayIsArray$1(untrustedConfig_fullyQualifiedNames)) {
718
+ const untrustedConfig_fullyQualifiedNames_array = [];
719
+ for (let i = 0, arrayLength = untrustedConfig_fullyQualifiedNames.length; i < arrayLength; i++) {
720
+ const untrustedConfig_fullyQualifiedNames_item = untrustedConfig_fullyQualifiedNames[i];
721
+ if (typeof untrustedConfig_fullyQualifiedNames_item === 'string') {
722
+ untrustedConfig_fullyQualifiedNames_array.push(untrustedConfig_fullyQualifiedNames_item);
723
+ }
724
+ }
725
+ config.fullyQualifiedNames = untrustedConfig_fullyQualifiedNames_array;
726
+ }
727
+ const untrustedConfig_language = untrustedConfig.language;
728
+ if (typeof untrustedConfig_language === 'string') {
729
+ config.language = untrustedConfig_language;
730
+ }
731
+ const untrustedConfig_mixinTypeFullyQualifiedNames = untrustedConfig.mixinTypeFullyQualifiedNames;
732
+ if (ArrayIsArray$1(untrustedConfig_mixinTypeFullyQualifiedNames)) {
733
+ const untrustedConfig_mixinTypeFullyQualifiedNames_array = [];
734
+ for (let i = 0, arrayLength = untrustedConfig_mixinTypeFullyQualifiedNames.length; i < arrayLength; i++) {
735
+ const untrustedConfig_mixinTypeFullyQualifiedNames_item = untrustedConfig_mixinTypeFullyQualifiedNames[i];
736
+ if (typeof untrustedConfig_mixinTypeFullyQualifiedNames_item === 'string') {
737
+ untrustedConfig_mixinTypeFullyQualifiedNames_array.push(untrustedConfig_mixinTypeFullyQualifiedNames_item);
738
+ }
739
+ }
740
+ config.mixinTypeFullyQualifiedNames = untrustedConfig_mixinTypeFullyQualifiedNames_array;
741
+ }
742
+ const untrustedConfig_page = untrustedConfig.page;
743
+ if (typeof untrustedConfig_page === 'number' && Math.floor(untrustedConfig_page) === untrustedConfig_page) {
744
+ config.page = untrustedConfig_page;
745
+ }
746
+ const untrustedConfig_pageSize = untrustedConfig.pageSize;
747
+ if (typeof untrustedConfig_pageSize === 'number' && Math.floor(untrustedConfig_pageSize) === untrustedConfig_pageSize) {
748
+ config.pageSize = untrustedConfig_pageSize;
749
+ }
750
+ const untrustedConfig_renditionConfigTarget = untrustedConfig.renditionConfigTarget;
751
+ if (typeof untrustedConfig_renditionConfigTarget === 'string') {
752
+ config.renditionConfigTarget = untrustedConfig_renditionConfigTarget;
753
+ }
754
+ const untrustedConfig_typeClassFullyQualifiedNames = untrustedConfig.typeClassFullyQualifiedNames;
755
+ if (ArrayIsArray$1(untrustedConfig_typeClassFullyQualifiedNames)) {
756
+ const untrustedConfig_typeClassFullyQualifiedNames_array = [];
757
+ for (let i = 0, arrayLength = untrustedConfig_typeClassFullyQualifiedNames.length; i < arrayLength; i++) {
758
+ const untrustedConfig_typeClassFullyQualifiedNames_item = untrustedConfig_typeClassFullyQualifiedNames[i];
759
+ if (typeof untrustedConfig_typeClassFullyQualifiedNames_item === 'string') {
760
+ untrustedConfig_typeClassFullyQualifiedNames_array.push(untrustedConfig_typeClassFullyQualifiedNames_item);
761
+ }
762
+ }
763
+ config.typeClassFullyQualifiedNames = untrustedConfig_typeClassFullyQualifiedNames_array;
764
+ }
765
+ return config;
766
+ }
767
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
768
+ if (!untrustedIsObject(untrustedConfig)) {
769
+ return null;
770
+ }
771
+ if (process.env.NODE_ENV !== 'production') {
772
+ validateConfig(untrustedConfig, configPropertyNames);
773
+ }
774
+ const config = typeCheckConfig$4(untrustedConfig);
775
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
776
+ return null;
777
+ }
778
+ return config;
779
+ }
780
+ function adapterFragment$4(luvio, config) {
781
+ createResourceParams$4(config);
782
+ return select$8();
783
+ }
784
+ function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
785
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
786
+ config,
787
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
788
+ });
789
+ return luvio.storeBroadcast().then(() => snapshot);
790
+ }
791
+ function onFetchResponseError$4(luvio, config, resourceParams, response) {
792
+ const snapshot = ingestError$4(luvio, resourceParams, response, {
793
+ config,
794
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
795
+ });
796
+ return luvio.storeBroadcast().then(() => snapshot);
797
+ }
798
+ function buildNetworkSnapshot$4(luvio, config, options) {
799
+ const resourceParams = createResourceParams$4(config);
800
+ const request = createResourceRequest$4(resourceParams);
801
+ return luvio.dispatchResourceRequest(request, options)
802
+ .then((response) => {
803
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$4(luvio, config, resourceParams, response), () => getResponseCacheKeys$4(luvio, resourceParams, response.body));
804
+ }, (response) => {
805
+ return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
806
+ });
807
+ }
808
+ function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
809
+ const { luvio, config } = context;
810
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
811
+ const dispatchOptions = {
812
+ resourceRequestContext: {
813
+ requestCorrelator,
814
+ luvioRequestMethod: undefined,
815
+ },
816
+ eventObservers
817
+ };
818
+ if (networkPriority !== 'normal') {
819
+ dispatchOptions.overrides = {
820
+ priority: networkPriority
821
+ };
822
+ }
823
+ return buildNetworkSnapshot$4(luvio, config, dispatchOptions);
824
+ }
825
+ function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
826
+ const { luvio, config } = context;
827
+ const selector = {
828
+ recordId: keyBuilder$8(luvio, config),
829
+ node: adapterFragment$4(luvio, config),
830
+ variables: {},
831
+ };
832
+ const cacheSnapshot = storeLookup(selector, {
833
+ config,
834
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
835
+ });
836
+ return cacheSnapshot;
837
+ }
838
+ const getBlockTypesAdapterFactory = (luvio) => function ExperienceType__getBlockTypes(untrustedConfig, requestContext) {
839
+ const config = validateAdapterConfig$4(untrustedConfig, getBlockTypes_ConfigPropertyNames);
840
+ // Invalid or incomplete config
841
+ if (config === null) {
842
+ return null;
843
+ }
844
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
845
+ buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
846
+ };
847
+
848
+ const TTL$3 = 3600000;
849
+ const VERSION$3 = "fb0265f1d37480d0821fd97a29a0f9c2";
850
+ function validate$5(obj, path = 'ExperienceModelContentTypeDetailRepresentation') {
851
+ const v_error = (() => {
852
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
853
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
854
+ }
855
+ if (obj.description !== undefined) {
856
+ const obj_description = obj.description;
857
+ const path_description = path + '.description';
858
+ if (typeof obj_description !== 'string') {
859
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
860
+ }
861
+ }
862
+ if (obj.designConfig !== undefined) {
863
+ const obj_designConfig = obj.designConfig;
864
+ const path_designConfig = path + '.designConfig';
865
+ if (obj_designConfig === undefined) {
866
+ return new TypeError('Expected "defined" but received "' + typeof obj_designConfig + '" (at "' + path_designConfig + '")');
867
+ }
868
+ }
869
+ const obj_developerName = obj.developerName;
870
+ const path_developerName = path + '.developerName';
871
+ if (typeof obj_developerName !== 'string') {
872
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
873
+ }
874
+ if (obj.id !== undefined) {
875
+ const obj_id = obj.id;
876
+ const path_id = path + '.id';
877
+ if (typeof obj_id !== 'string') {
878
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
879
+ }
880
+ }
881
+ if (obj.namespacePrefix !== undefined) {
882
+ const obj_namespacePrefix = obj.namespacePrefix;
883
+ const path_namespacePrefix = path + '.namespacePrefix';
884
+ if (typeof obj_namespacePrefix !== 'string') {
885
+ return new TypeError('Expected "string" but received "' + typeof obj_namespacePrefix + '" (at "' + path_namespacePrefix + '")');
886
+ }
887
+ }
888
+ if (obj.renditionConfig !== undefined) {
889
+ const obj_renditionConfig = obj.renditionConfig;
890
+ const path_renditionConfig = path + '.renditionConfig';
891
+ if (obj_renditionConfig === undefined) {
892
+ return new TypeError('Expected "defined" but received "' + typeof obj_renditionConfig + '" (at "' + path_renditionConfig + '")');
893
+ }
894
+ }
895
+ const obj_schema = obj.schema;
896
+ const path_schema = path + '.schema';
897
+ if (typeof obj_schema !== 'object' || ArrayIsArray(obj_schema) || obj_schema === null) {
898
+ return new TypeError('Expected "object" but received "' + typeof obj_schema + '" (at "' + path_schema + '")');
899
+ }
900
+ const obj_schema_keys = ObjectKeys(obj_schema);
901
+ for (let i = 0; i < obj_schema_keys.length; i++) {
902
+ const key = obj_schema_keys[i];
903
+ const obj_schema_prop = obj_schema[key];
904
+ const path_schema_prop = path_schema + '["' + key + '"]';
905
+ if (obj_schema_prop === undefined) {
906
+ return new TypeError('Expected "defined" but received "' + typeof obj_schema_prop + '" (at "' + path_schema_prop + '")');
907
+ }
908
+ }
909
+ if (obj.title !== undefined) {
910
+ const obj_title = obj.title;
911
+ const path_title = path + '.title';
912
+ if (typeof obj_title !== 'string') {
913
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
914
+ }
915
+ }
916
+ })();
917
+ return v_error === undefined ? null : v_error;
918
+ }
919
+ const RepresentationType$3 = 'ExperienceModelContentTypeDetailRepresentation';
920
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
921
+ return input;
922
+ }
923
+ const select$7 = function ExperienceModelContentTypeDetailRepresentationSelect() {
924
+ return {
925
+ kind: 'Fragment',
926
+ version: VERSION$3,
927
+ private: [],
928
+ opaque: true
929
+ };
930
+ };
931
+ function equals$3(existing, incoming) {
932
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
933
+ return false;
934
+ }
935
+ return true;
936
+ }
937
+ function deepFreeze$5(input) {
938
+ const input_designConfig = input.designConfig;
939
+ if (input_designConfig !== undefined) {
940
+ deepFreeze$9(input_designConfig);
941
+ }
942
+ const input_renditionConfig = input.renditionConfig;
943
+ if (input_renditionConfig !== undefined) {
944
+ deepFreeze$9(input_renditionConfig);
945
+ }
946
+ const input_schema = input.schema;
947
+ const input_schema_keys = Object.keys(input_schema);
948
+ const input_schema_length = input_schema_keys.length;
949
+ for (let i = 0; i < input_schema_length; i++) {
950
+ const key = input_schema_keys[i];
951
+ const input_schema_prop = input_schema[key];
952
+ deepFreeze$9(input_schema_prop);
953
+ }
954
+ ObjectFreeze(input_schema);
955
+ ObjectFreeze(input);
956
+ }
957
+ const ingest$3 = function ExperienceModelContentTypeDetailRepresentationIngest(input, path, luvio, store, timestamp) {
958
+ if (process.env.NODE_ENV !== 'production') {
959
+ const validateError = validate$5(input);
960
+ if (validateError !== null) {
961
+ throw validateError;
962
+ }
963
+ }
964
+ const key = path.fullPath;
965
+ const existingRecord = store.readEntry(key);
966
+ const ttlToUse = TTL$3;
967
+ let incomingRecord = normalize$3(input, store.readEntry(key), {
968
+ fullPath: key,
969
+ parent: path.parent,
970
+ propertyName: path.propertyName,
971
+ ttl: ttlToUse
972
+ });
973
+ deepFreeze$5(input);
974
+ if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
975
+ luvio.storePublish(key, incomingRecord);
976
+ }
977
+ {
978
+ const storeMetadataParams = {
979
+ ttl: ttlToUse,
980
+ namespace: "ExperienceType",
981
+ version: VERSION$3,
982
+ representationName: RepresentationType$3,
983
+ };
984
+ luvio.publishStoreMetadata(key, storeMetadataParams);
985
+ }
986
+ return createLink(key);
987
+ };
988
+ function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
989
+ const rootKeySet = new StoreKeyMap();
990
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
991
+ const rootKey = fullPathFactory();
992
+ rootKeySet.set(rootKey, {
993
+ namespace: keyPrefix,
994
+ representationName: RepresentationType$3,
995
+ mergeable: false
996
+ });
997
+ return rootKeySet;
998
+ }
999
+
1000
+ function select$6(luvio, params) {
1001
+ return select$7();
1002
+ }
1003
+ function keyBuilder$7(luvio, params) {
1004
+ return keyPrefix + '::ExperienceModelContentTypeDetailRepresentation:(' + 'designConfigTarget:' + params.queryParams.designConfigTarget + ',' + 'includeSubSchemaDefinitions:' + params.queryParams.includeSubSchemaDefinitions + ',' + 'language:' + params.queryParams.language + ',' + 'renditionConfigTarget:' + params.queryParams.renditionConfigTarget + ',' + 'fullyQualifiedName:' + params.urlParams.fullyQualifiedName + ')';
1005
+ }
1006
+ function getResponseCacheKeys$3(luvio, resourceParams, response) {
1007
+ return getTypeCacheKeys$3(luvio, response, () => keyBuilder$7(luvio, resourceParams));
1008
+ }
1009
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
1010
+ const { body } = response;
1011
+ const key = keyBuilder$7(luvio, resourceParams);
1012
+ luvio.storeIngest(key, ingest$3, body);
1013
+ const snapshot = luvio.storeLookup({
1014
+ recordId: key,
1015
+ node: select$6(),
1016
+ variables: {},
1017
+ }, snapshotRefresh);
1018
+ if (process.env.NODE_ENV !== 'production') {
1019
+ if (snapshot.state !== 'Fulfilled') {
1020
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1021
+ }
1022
+ }
1023
+ return snapshot;
1024
+ }
1025
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
1026
+ const key = keyBuilder$7(luvio, params);
1027
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1028
+ const storeMetadataParams = {
1029
+ ttl: TTL$3,
1030
+ namespace: keyPrefix,
1031
+ version: VERSION$3,
1032
+ representationName: RepresentationType$3
1033
+ };
1034
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1035
+ return errorSnapshot;
1036
+ }
1037
+ function createResourceRequest$3(config) {
1038
+ const headers = {};
1039
+ return {
1040
+ baseUri: '/services/data/v58.0',
1041
+ basePath: '/connect/experience-model/content-types/' + config.urlParams.fullyQualifiedName + '',
1042
+ method: 'get',
1043
+ body: null,
1044
+ urlParams: config.urlParams,
1045
+ queryParams: config.queryParams,
1046
+ headers,
1047
+ priority: 'normal',
1048
+ };
1049
+ }
1050
+
1051
+ const getContentType_ConfigPropertyNames = {
1052
+ displayName: 'getContentType',
1053
+ parameters: {
1054
+ required: ['fullyQualifiedName'],
1055
+ optional: ['designConfigTarget', 'includeSubSchemaDefinitions', 'language', 'renditionConfigTarget']
1056
+ }
1057
+ };
1058
+ function createResourceParams$3(config) {
1059
+ const resourceParams = {
1060
+ urlParams: {
1061
+ fullyQualifiedName: config.fullyQualifiedName
1062
+ },
1063
+ queryParams: {
1064
+ designConfigTarget: config.designConfigTarget, includeSubSchemaDefinitions: config.includeSubSchemaDefinitions, language: config.language, renditionConfigTarget: config.renditionConfigTarget
1065
+ }
1066
+ };
1067
+ return resourceParams;
1068
+ }
1069
+ function keyBuilder$6(luvio, config) {
1070
+ const resourceParams = createResourceParams$3(config);
1071
+ return keyBuilder$7(luvio, resourceParams);
1072
+ }
1073
+ function typeCheckConfig$3(untrustedConfig) {
1074
+ const config = {};
1075
+ const untrustedConfig_fullyQualifiedName = untrustedConfig.fullyQualifiedName;
1076
+ if (typeof untrustedConfig_fullyQualifiedName === 'string') {
1077
+ config.fullyQualifiedName = untrustedConfig_fullyQualifiedName;
1078
+ }
1079
+ const untrustedConfig_designConfigTarget = untrustedConfig.designConfigTarget;
1080
+ if (typeof untrustedConfig_designConfigTarget === 'string') {
1081
+ config.designConfigTarget = untrustedConfig_designConfigTarget;
1082
+ }
1083
+ const untrustedConfig_includeSubSchemaDefinitions = untrustedConfig.includeSubSchemaDefinitions;
1084
+ if (typeof untrustedConfig_includeSubSchemaDefinitions === 'boolean') {
1085
+ config.includeSubSchemaDefinitions = untrustedConfig_includeSubSchemaDefinitions;
1086
+ }
1087
+ const untrustedConfig_language = untrustedConfig.language;
1088
+ if (typeof untrustedConfig_language === 'string') {
1089
+ config.language = untrustedConfig_language;
1090
+ }
1091
+ const untrustedConfig_renditionConfigTarget = untrustedConfig.renditionConfigTarget;
1092
+ if (typeof untrustedConfig_renditionConfigTarget === 'string') {
1093
+ config.renditionConfigTarget = untrustedConfig_renditionConfigTarget;
1094
+ }
1095
+ return config;
1096
+ }
1097
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1098
+ if (!untrustedIsObject(untrustedConfig)) {
1099
+ return null;
1100
+ }
1101
+ if (process.env.NODE_ENV !== 'production') {
1102
+ validateConfig(untrustedConfig, configPropertyNames);
1103
+ }
1104
+ const config = typeCheckConfig$3(untrustedConfig);
1105
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1106
+ return null;
1107
+ }
1108
+ return config;
1109
+ }
1110
+ function adapterFragment$3(luvio, config) {
1111
+ createResourceParams$3(config);
1112
+ return select$6();
1113
+ }
1114
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
1115
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
1116
+ config,
1117
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1118
+ });
1119
+ return luvio.storeBroadcast().then(() => snapshot);
1120
+ }
1121
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
1122
+ const snapshot = ingestError$3(luvio, resourceParams, response, {
1123
+ config,
1124
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1125
+ });
1126
+ return luvio.storeBroadcast().then(() => snapshot);
1127
+ }
1128
+ function buildNetworkSnapshot$3(luvio, config, options) {
1129
+ const resourceParams = createResourceParams$3(config);
1130
+ const request = createResourceRequest$3(resourceParams);
1131
+ return luvio.dispatchResourceRequest(request, options)
1132
+ .then((response) => {
1133
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
1134
+ }, (response) => {
1135
+ return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
1136
+ });
1137
+ }
1138
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
1139
+ const { luvio, config } = context;
1140
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1141
+ const dispatchOptions = {
1142
+ resourceRequestContext: {
1143
+ requestCorrelator,
1144
+ luvioRequestMethod: undefined,
1145
+ },
1146
+ eventObservers
1147
+ };
1148
+ if (networkPriority !== 'normal') {
1149
+ dispatchOptions.overrides = {
1150
+ priority: networkPriority
1151
+ };
1152
+ }
1153
+ return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
1154
+ }
1155
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
1156
+ const { luvio, config } = context;
1157
+ const selector = {
1158
+ recordId: keyBuilder$6(luvio, config),
1159
+ node: adapterFragment$3(luvio, config),
1160
+ variables: {},
1161
+ };
1162
+ const cacheSnapshot = storeLookup(selector, {
1163
+ config,
1164
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1165
+ });
1166
+ return cacheSnapshot;
1167
+ }
1168
+ const getContentTypeAdapterFactory = (luvio) => function ExperienceType__getContentType(untrustedConfig, requestContext) {
1169
+ const config = validateAdapterConfig$3(untrustedConfig, getContentType_ConfigPropertyNames);
1170
+ // Invalid or incomplete config
1171
+ if (config === null) {
1172
+ return null;
1173
+ }
1174
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1175
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
1176
+ };
1177
+
1178
+ function validate$4(obj, path = 'ExperienceModelContentTypeSummaryRepresentation') {
1179
+ const v_error = (() => {
1180
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1181
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1182
+ }
1183
+ if (obj.description !== undefined) {
1184
+ const obj_description = obj.description;
1185
+ const path_description = path + '.description';
1186
+ if (typeof obj_description !== 'string') {
1187
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1188
+ }
1189
+ }
1190
+ const obj_detailUrl = obj.detailUrl;
1191
+ const path_detailUrl = path + '.detailUrl';
1192
+ if (typeof obj_detailUrl !== 'string') {
1193
+ return new TypeError('Expected "string" but received "' + typeof obj_detailUrl + '" (at "' + path_detailUrl + '")');
1194
+ }
1195
+ const obj_developerName = obj.developerName;
1196
+ const path_developerName = path + '.developerName';
1197
+ if (typeof obj_developerName !== 'string') {
1198
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
1199
+ }
1200
+ if (obj.id !== undefined) {
1201
+ const obj_id = obj.id;
1202
+ const path_id = path + '.id';
1203
+ if (typeof obj_id !== 'string') {
1204
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1205
+ }
1206
+ }
1207
+ if (obj.namespacePrefix !== undefined) {
1208
+ const obj_namespacePrefix = obj.namespacePrefix;
1209
+ const path_namespacePrefix = path + '.namespacePrefix';
1210
+ if (typeof obj_namespacePrefix !== 'string') {
1211
+ return new TypeError('Expected "string" but received "' + typeof obj_namespacePrefix + '" (at "' + path_namespacePrefix + '")');
1212
+ }
1213
+ }
1214
+ if (obj.title !== undefined) {
1215
+ const obj_title = obj.title;
1216
+ const path_title = path + '.title';
1217
+ if (typeof obj_title !== 'string') {
1218
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1219
+ }
1220
+ }
1221
+ })();
1222
+ return v_error === undefined ? null : v_error;
1223
+ }
1224
+ function deepFreeze$4(input) {
1225
+ ObjectFreeze(input);
1226
+ }
1227
+
1228
+ const TTL$2 = 3600000;
1229
+ const VERSION$2 = "30f1f19149230f10ac9197e0d9769c88";
1230
+ function validate$3(obj, path = 'ExperienceModelContentTypeCollectionRepresentation') {
1231
+ const v_error = (() => {
1232
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1233
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1234
+ }
1235
+ const obj_contentTypes = obj.contentTypes;
1236
+ const path_contentTypes = path + '.contentTypes';
1237
+ if (!ArrayIsArray(obj_contentTypes)) {
1238
+ return new TypeError('Expected "array" but received "' + typeof obj_contentTypes + '" (at "' + path_contentTypes + '")');
1239
+ }
1240
+ for (let i = 0; i < obj_contentTypes.length; i++) {
1241
+ const obj_contentTypes_item = obj_contentTypes[i];
1242
+ const path_contentTypes_item = path_contentTypes + '[' + i + ']';
1243
+ const referencepath_contentTypes_itemValidationError = validate$4(obj_contentTypes_item, path_contentTypes_item);
1244
+ if (referencepath_contentTypes_itemValidationError !== null) {
1245
+ let message = 'Object doesn\'t match ExperienceModelContentTypeSummaryRepresentation (at "' + path_contentTypes_item + '")\n';
1246
+ message += referencepath_contentTypes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1247
+ return new TypeError(message);
1248
+ }
1249
+ }
1250
+ const obj_count = obj.count;
1251
+ const path_count = path + '.count';
1252
+ if (typeof obj_count !== 'number' || (typeof obj_count === 'number' && Math.floor(obj_count) !== obj_count)) {
1253
+ return new TypeError('Expected "integer" but received "' + typeof obj_count + '" (at "' + path_count + '")');
1254
+ }
1255
+ if (obj.currentPageUrl !== undefined) {
1256
+ const obj_currentPageUrl = obj.currentPageUrl;
1257
+ const path_currentPageUrl = path + '.currentPageUrl';
1258
+ if (typeof obj_currentPageUrl !== 'string') {
1259
+ return new TypeError('Expected "string" but received "' + typeof obj_currentPageUrl + '" (at "' + path_currentPageUrl + '")');
1260
+ }
1261
+ }
1262
+ if (obj.nextPageUrl !== undefined) {
1263
+ const obj_nextPageUrl = obj.nextPageUrl;
1264
+ const path_nextPageUrl = path + '.nextPageUrl';
1265
+ if (typeof obj_nextPageUrl !== 'string') {
1266
+ return new TypeError('Expected "string" but received "' + typeof obj_nextPageUrl + '" (at "' + path_nextPageUrl + '")');
1267
+ }
1268
+ }
1269
+ if (obj.previousPageUrl !== undefined) {
1270
+ const obj_previousPageUrl = obj.previousPageUrl;
1271
+ const path_previousPageUrl = path + '.previousPageUrl';
1272
+ if (typeof obj_previousPageUrl !== 'string') {
1273
+ return new TypeError('Expected "string" but received "' + typeof obj_previousPageUrl + '" (at "' + path_previousPageUrl + '")');
1274
+ }
1275
+ }
1276
+ })();
1277
+ return v_error === undefined ? null : v_error;
1278
+ }
1279
+ const RepresentationType$2 = 'ExperienceModelContentTypeCollectionRepresentation';
1280
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
1281
+ return input;
1282
+ }
1283
+ const select$5 = function ExperienceModelContentTypeCollectionRepresentationSelect() {
1284
+ return {
1285
+ kind: 'Fragment',
1286
+ version: VERSION$2,
1287
+ private: [],
1288
+ opaque: true
1289
+ };
1290
+ };
1291
+ function equals$2(existing, incoming) {
1292
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1293
+ return false;
1294
+ }
1295
+ return true;
1296
+ }
1297
+ function deepFreeze$3(input) {
1298
+ const input_contentTypes = input.contentTypes;
1299
+ for (let i = 0; i < input_contentTypes.length; i++) {
1300
+ const input_contentTypes_item = input_contentTypes[i];
1301
+ deepFreeze$4(input_contentTypes_item);
1302
+ }
1303
+ ObjectFreeze(input_contentTypes);
1304
+ ObjectFreeze(input);
1305
+ }
1306
+ const ingest$2 = function ExperienceModelContentTypeCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
1307
+ if (process.env.NODE_ENV !== 'production') {
1308
+ const validateError = validate$3(input);
1309
+ if (validateError !== null) {
1310
+ throw validateError;
1311
+ }
1312
+ }
1313
+ const key = path.fullPath;
1314
+ const existingRecord = store.readEntry(key);
1315
+ const ttlToUse = TTL$2;
1316
+ let incomingRecord = normalize$2(input, store.readEntry(key), {
1317
+ fullPath: key,
1318
+ parent: path.parent,
1319
+ propertyName: path.propertyName,
1320
+ ttl: ttlToUse
1321
+ });
1322
+ deepFreeze$3(input);
1323
+ if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
1324
+ luvio.storePublish(key, incomingRecord);
1325
+ }
1326
+ {
1327
+ const storeMetadataParams = {
1328
+ ttl: ttlToUse,
1329
+ namespace: "ExperienceType",
1330
+ version: VERSION$2,
1331
+ representationName: RepresentationType$2,
1332
+ };
1333
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1334
+ }
1335
+ return createLink(key);
1336
+ };
1337
+ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
1338
+ const rootKeySet = new StoreKeyMap();
1339
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1340
+ const rootKey = fullPathFactory();
1341
+ rootKeySet.set(rootKey, {
1342
+ namespace: keyPrefix,
1343
+ representationName: RepresentationType$2,
1344
+ mergeable: false
1345
+ });
1346
+ return rootKeySet;
1347
+ }
1348
+
1349
+ function select$4(luvio, params) {
1350
+ return select$5();
1351
+ }
1352
+ function keyBuilder$5(luvio, params) {
1353
+ return keyPrefix + '::ExperienceModelContentTypeCollectionRepresentation:(' + 'contextRecordId:' + params.queryParams.contextRecordId + ',' + 'designConfigTarget:' + params.queryParams.designConfigTarget + ',' + 'fullyQualifiedNames:' + params.queryParams.fullyQualifiedNames + ',' + 'language:' + params.queryParams.language + ',' + 'mixinTypeFullyQualifiedNames:' + params.queryParams.mixinTypeFullyQualifiedNames + ',' + 'page:' + params.queryParams.page + ',' + 'pageSize:' + params.queryParams.pageSize + ',' + 'renditionConfigTarget:' + params.queryParams.renditionConfigTarget + ',' + 'typeClassFullyQualifiedNames:' + params.queryParams.typeClassFullyQualifiedNames + ')';
1354
+ }
1355
+ function getResponseCacheKeys$2(luvio, resourceParams, response) {
1356
+ return getTypeCacheKeys$2(luvio, response, () => keyBuilder$5(luvio, resourceParams));
1357
+ }
1358
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
1359
+ const { body } = response;
1360
+ const key = keyBuilder$5(luvio, resourceParams);
1361
+ luvio.storeIngest(key, ingest$2, body);
1362
+ const snapshot = luvio.storeLookup({
1363
+ recordId: key,
1364
+ node: select$4(),
1365
+ variables: {},
1366
+ }, snapshotRefresh);
1367
+ if (process.env.NODE_ENV !== 'production') {
1368
+ if (snapshot.state !== 'Fulfilled') {
1369
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1370
+ }
1371
+ }
1372
+ return snapshot;
1373
+ }
1374
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
1375
+ const key = keyBuilder$5(luvio, params);
1376
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1377
+ const storeMetadataParams = {
1378
+ ttl: TTL$2,
1379
+ namespace: keyPrefix,
1380
+ version: VERSION$2,
1381
+ representationName: RepresentationType$2
1382
+ };
1383
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1384
+ return errorSnapshot;
1385
+ }
1386
+ function createResourceRequest$2(config) {
1387
+ const headers = {};
1388
+ return {
1389
+ baseUri: '/services/data/v58.0',
1390
+ basePath: '/connect/experience-model/content-types',
1391
+ method: 'get',
1392
+ body: null,
1393
+ urlParams: {},
1394
+ queryParams: config.queryParams,
1395
+ headers,
1396
+ priority: 'normal',
1397
+ };
1398
+ }
1399
+
1400
+ const getContentTypes_ConfigPropertyNames = {
1401
+ displayName: 'getContentTypes',
1402
+ parameters: {
1403
+ required: [],
1404
+ optional: ['contextRecordId', 'designConfigTarget', 'fullyQualifiedNames', 'language', 'mixinTypeFullyQualifiedNames', 'page', 'pageSize', 'renditionConfigTarget', 'typeClassFullyQualifiedNames']
1405
+ }
1406
+ };
1407
+ function createResourceParams$2(config) {
1408
+ const resourceParams = {
1409
+ queryParams: {
1410
+ contextRecordId: config.contextRecordId, designConfigTarget: config.designConfigTarget, fullyQualifiedNames: config.fullyQualifiedNames, language: config.language, mixinTypeFullyQualifiedNames: config.mixinTypeFullyQualifiedNames, page: config.page, pageSize: config.pageSize, renditionConfigTarget: config.renditionConfigTarget, typeClassFullyQualifiedNames: config.typeClassFullyQualifiedNames
1411
+ }
1412
+ };
1413
+ return resourceParams;
1414
+ }
1415
+ function keyBuilder$4(luvio, config) {
1416
+ const resourceParams = createResourceParams$2(config);
1417
+ return keyBuilder$5(luvio, resourceParams);
1418
+ }
1419
+ function typeCheckConfig$2(untrustedConfig) {
1420
+ const config = {};
1421
+ const untrustedConfig_contextRecordId = untrustedConfig.contextRecordId;
1422
+ if (typeof untrustedConfig_contextRecordId === 'string') {
1423
+ config.contextRecordId = untrustedConfig_contextRecordId;
1424
+ }
1425
+ const untrustedConfig_designConfigTarget = untrustedConfig.designConfigTarget;
1426
+ if (typeof untrustedConfig_designConfigTarget === 'string') {
1427
+ config.designConfigTarget = untrustedConfig_designConfigTarget;
1428
+ }
1429
+ const untrustedConfig_fullyQualifiedNames = untrustedConfig.fullyQualifiedNames;
1430
+ if (ArrayIsArray$1(untrustedConfig_fullyQualifiedNames)) {
1431
+ const untrustedConfig_fullyQualifiedNames_array = [];
1432
+ for (let i = 0, arrayLength = untrustedConfig_fullyQualifiedNames.length; i < arrayLength; i++) {
1433
+ const untrustedConfig_fullyQualifiedNames_item = untrustedConfig_fullyQualifiedNames[i];
1434
+ if (typeof untrustedConfig_fullyQualifiedNames_item === 'string') {
1435
+ untrustedConfig_fullyQualifiedNames_array.push(untrustedConfig_fullyQualifiedNames_item);
1436
+ }
1437
+ }
1438
+ config.fullyQualifiedNames = untrustedConfig_fullyQualifiedNames_array;
1439
+ }
1440
+ const untrustedConfig_language = untrustedConfig.language;
1441
+ if (typeof untrustedConfig_language === 'string') {
1442
+ config.language = untrustedConfig_language;
1443
+ }
1444
+ const untrustedConfig_mixinTypeFullyQualifiedNames = untrustedConfig.mixinTypeFullyQualifiedNames;
1445
+ if (ArrayIsArray$1(untrustedConfig_mixinTypeFullyQualifiedNames)) {
1446
+ const untrustedConfig_mixinTypeFullyQualifiedNames_array = [];
1447
+ for (let i = 0, arrayLength = untrustedConfig_mixinTypeFullyQualifiedNames.length; i < arrayLength; i++) {
1448
+ const untrustedConfig_mixinTypeFullyQualifiedNames_item = untrustedConfig_mixinTypeFullyQualifiedNames[i];
1449
+ if (typeof untrustedConfig_mixinTypeFullyQualifiedNames_item === 'string') {
1450
+ untrustedConfig_mixinTypeFullyQualifiedNames_array.push(untrustedConfig_mixinTypeFullyQualifiedNames_item);
1451
+ }
1452
+ }
1453
+ config.mixinTypeFullyQualifiedNames = untrustedConfig_mixinTypeFullyQualifiedNames_array;
1454
+ }
1455
+ const untrustedConfig_page = untrustedConfig.page;
1456
+ if (typeof untrustedConfig_page === 'number' && Math.floor(untrustedConfig_page) === untrustedConfig_page) {
1457
+ config.page = untrustedConfig_page;
1458
+ }
1459
+ const untrustedConfig_pageSize = untrustedConfig.pageSize;
1460
+ if (typeof untrustedConfig_pageSize === 'number' && Math.floor(untrustedConfig_pageSize) === untrustedConfig_pageSize) {
1461
+ config.pageSize = untrustedConfig_pageSize;
1462
+ }
1463
+ const untrustedConfig_renditionConfigTarget = untrustedConfig.renditionConfigTarget;
1464
+ if (typeof untrustedConfig_renditionConfigTarget === 'string') {
1465
+ config.renditionConfigTarget = untrustedConfig_renditionConfigTarget;
1466
+ }
1467
+ const untrustedConfig_typeClassFullyQualifiedNames = untrustedConfig.typeClassFullyQualifiedNames;
1468
+ if (ArrayIsArray$1(untrustedConfig_typeClassFullyQualifiedNames)) {
1469
+ const untrustedConfig_typeClassFullyQualifiedNames_array = [];
1470
+ for (let i = 0, arrayLength = untrustedConfig_typeClassFullyQualifiedNames.length; i < arrayLength; i++) {
1471
+ const untrustedConfig_typeClassFullyQualifiedNames_item = untrustedConfig_typeClassFullyQualifiedNames[i];
1472
+ if (typeof untrustedConfig_typeClassFullyQualifiedNames_item === 'string') {
1473
+ untrustedConfig_typeClassFullyQualifiedNames_array.push(untrustedConfig_typeClassFullyQualifiedNames_item);
1474
+ }
1475
+ }
1476
+ config.typeClassFullyQualifiedNames = untrustedConfig_typeClassFullyQualifiedNames_array;
1477
+ }
1478
+ return config;
1479
+ }
1480
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1481
+ if (!untrustedIsObject(untrustedConfig)) {
1482
+ return null;
1483
+ }
1484
+ if (process.env.NODE_ENV !== 'production') {
1485
+ validateConfig(untrustedConfig, configPropertyNames);
1486
+ }
1487
+ const config = typeCheckConfig$2(untrustedConfig);
1488
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1489
+ return null;
1490
+ }
1491
+ return config;
1492
+ }
1493
+ function adapterFragment$2(luvio, config) {
1494
+ createResourceParams$2(config);
1495
+ return select$4();
1496
+ }
1497
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
1498
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
1499
+ config,
1500
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1501
+ });
1502
+ return luvio.storeBroadcast().then(() => snapshot);
1503
+ }
1504
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
1505
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
1506
+ config,
1507
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1508
+ });
1509
+ return luvio.storeBroadcast().then(() => snapshot);
1510
+ }
1511
+ function buildNetworkSnapshot$2(luvio, config, options) {
1512
+ const resourceParams = createResourceParams$2(config);
1513
+ const request = createResourceRequest$2(resourceParams);
1514
+ return luvio.dispatchResourceRequest(request, options)
1515
+ .then((response) => {
1516
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
1517
+ }, (response) => {
1518
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
1519
+ });
1520
+ }
1521
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
1522
+ const { luvio, config } = context;
1523
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1524
+ const dispatchOptions = {
1525
+ resourceRequestContext: {
1526
+ requestCorrelator,
1527
+ luvioRequestMethod: undefined,
1528
+ },
1529
+ eventObservers
1530
+ };
1531
+ if (networkPriority !== 'normal') {
1532
+ dispatchOptions.overrides = {
1533
+ priority: networkPriority
1534
+ };
1535
+ }
1536
+ return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
1537
+ }
1538
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
1539
+ const { luvio, config } = context;
1540
+ const selector = {
1541
+ recordId: keyBuilder$4(luvio, config),
1542
+ node: adapterFragment$2(luvio, config),
1543
+ variables: {},
1544
+ };
1545
+ const cacheSnapshot = storeLookup(selector, {
1546
+ config,
1547
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1548
+ });
1549
+ return cacheSnapshot;
1550
+ }
1551
+ const getContentTypesAdapterFactory = (luvio) => function ExperienceType__getContentTypes(untrustedConfig, requestContext) {
1552
+ const config = validateAdapterConfig$2(untrustedConfig, getContentTypes_ConfigPropertyNames);
1553
+ // Invalid or incomplete config
1554
+ if (config === null) {
1555
+ return null;
1556
+ }
1557
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1558
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
1559
+ };
1560
+
1561
+ const TTL$1 = 3600000;
1562
+ const VERSION$1 = "56f77a37a5711b32738bafbcb3eed520";
1563
+ function validate$2(obj, path = 'ExperienceModelPropertyTypeDetailRepresentation') {
1564
+ const v_error = (() => {
1565
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1566
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1567
+ }
1568
+ if (obj.description !== undefined) {
1569
+ const obj_description = obj.description;
1570
+ const path_description = path + '.description';
1571
+ if (typeof obj_description !== 'string') {
1572
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1573
+ }
1574
+ }
1575
+ if (obj.designConfig !== undefined) {
1576
+ const obj_designConfig = obj.designConfig;
1577
+ const path_designConfig = path + '.designConfig';
1578
+ if (obj_designConfig === undefined) {
1579
+ return new TypeError('Expected "defined" but received "' + typeof obj_designConfig + '" (at "' + path_designConfig + '")');
1580
+ }
1581
+ }
1582
+ const obj_developerName = obj.developerName;
1583
+ const path_developerName = path + '.developerName';
1584
+ if (typeof obj_developerName !== 'string') {
1585
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
1586
+ }
1587
+ if (obj.id !== undefined) {
1588
+ const obj_id = obj.id;
1589
+ const path_id = path + '.id';
1590
+ if (typeof obj_id !== 'string') {
1591
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1592
+ }
1593
+ }
1594
+ const obj_namespacePrefix = obj.namespacePrefix;
1595
+ const path_namespacePrefix = path + '.namespacePrefix';
1596
+ if (typeof obj_namespacePrefix !== 'string') {
1597
+ return new TypeError('Expected "string" but received "' + typeof obj_namespacePrefix + '" (at "' + path_namespacePrefix + '")');
1598
+ }
1599
+ if (obj.renditionConfig !== undefined) {
1600
+ const obj_renditionConfig = obj.renditionConfig;
1601
+ const path_renditionConfig = path + '.renditionConfig';
1602
+ if (obj_renditionConfig === undefined) {
1603
+ return new TypeError('Expected "defined" but received "' + typeof obj_renditionConfig + '" (at "' + path_renditionConfig + '")');
1604
+ }
1605
+ }
1606
+ const obj_schema = obj.schema;
1607
+ const path_schema = path + '.schema';
1608
+ if (typeof obj_schema !== 'object' || ArrayIsArray(obj_schema) || obj_schema === null) {
1609
+ return new TypeError('Expected "object" but received "' + typeof obj_schema + '" (at "' + path_schema + '")');
1610
+ }
1611
+ const obj_schema_keys = ObjectKeys(obj_schema);
1612
+ for (let i = 0; i < obj_schema_keys.length; i++) {
1613
+ const key = obj_schema_keys[i];
1614
+ const obj_schema_prop = obj_schema[key];
1615
+ const path_schema_prop = path_schema + '["' + key + '"]';
1616
+ if (obj_schema_prop === undefined) {
1617
+ return new TypeError('Expected "defined" but received "' + typeof obj_schema_prop + '" (at "' + path_schema_prop + '")');
1618
+ }
1619
+ }
1620
+ if (obj.title !== undefined) {
1621
+ const obj_title = obj.title;
1622
+ const path_title = path + '.title';
1623
+ if (typeof obj_title !== 'string') {
1624
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1625
+ }
1626
+ }
1627
+ })();
1628
+ return v_error === undefined ? null : v_error;
1629
+ }
1630
+ const RepresentationType$1 = 'ExperienceModelPropertyTypeDetailRepresentation';
1631
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
1632
+ return input;
1633
+ }
1634
+ const select$3 = function ExperienceModelPropertyTypeDetailRepresentationSelect() {
1635
+ return {
1636
+ kind: 'Fragment',
1637
+ version: VERSION$1,
1638
+ private: [],
1639
+ opaque: true
1640
+ };
1641
+ };
1642
+ function equals$1(existing, incoming) {
1643
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1644
+ return false;
1645
+ }
1646
+ return true;
1647
+ }
1648
+ function deepFreeze$2(input) {
1649
+ const input_designConfig = input.designConfig;
1650
+ if (input_designConfig !== undefined) {
1651
+ deepFreeze$9(input_designConfig);
1652
+ }
1653
+ const input_renditionConfig = input.renditionConfig;
1654
+ if (input_renditionConfig !== undefined) {
1655
+ deepFreeze$9(input_renditionConfig);
1656
+ }
1657
+ const input_schema = input.schema;
1658
+ const input_schema_keys = Object.keys(input_schema);
1659
+ const input_schema_length = input_schema_keys.length;
1660
+ for (let i = 0; i < input_schema_length; i++) {
1661
+ const key = input_schema_keys[i];
1662
+ const input_schema_prop = input_schema[key];
1663
+ deepFreeze$9(input_schema_prop);
1664
+ }
1665
+ ObjectFreeze(input_schema);
1666
+ ObjectFreeze(input);
1667
+ }
1668
+ const ingest$1 = function ExperienceModelPropertyTypeDetailRepresentationIngest(input, path, luvio, store, timestamp) {
1669
+ if (process.env.NODE_ENV !== 'production') {
1670
+ const validateError = validate$2(input);
1671
+ if (validateError !== null) {
1672
+ throw validateError;
1673
+ }
1674
+ }
1675
+ const key = path.fullPath;
1676
+ const existingRecord = store.readEntry(key);
1677
+ const ttlToUse = TTL$1;
1678
+ let incomingRecord = normalize$1(input, store.readEntry(key), {
1679
+ fullPath: key,
1680
+ parent: path.parent,
1681
+ propertyName: path.propertyName,
1682
+ ttl: ttlToUse
1683
+ });
1684
+ deepFreeze$2(input);
1685
+ if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
1686
+ luvio.storePublish(key, incomingRecord);
1687
+ }
1688
+ {
1689
+ const storeMetadataParams = {
1690
+ ttl: ttlToUse,
1691
+ namespace: "ExperienceType",
1692
+ version: VERSION$1,
1693
+ representationName: RepresentationType$1,
1694
+ };
1695
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1696
+ }
1697
+ return createLink(key);
1698
+ };
1699
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
1700
+ const rootKeySet = new StoreKeyMap();
1701
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1702
+ const rootKey = fullPathFactory();
1703
+ rootKeySet.set(rootKey, {
1704
+ namespace: keyPrefix,
1705
+ representationName: RepresentationType$1,
1706
+ mergeable: false
1707
+ });
1708
+ return rootKeySet;
1709
+ }
1710
+
1711
+ function select$2(luvio, params) {
1712
+ return select$3();
1713
+ }
1714
+ function keyBuilder$3(luvio, params) {
1715
+ return keyPrefix + '::ExperienceModelPropertyTypeDetailRepresentation:(' + 'designConfigTarget:' + params.queryParams.designConfigTarget + ',' + 'includeSubSchemaDefinitions:' + params.queryParams.includeSubSchemaDefinitions + ',' + 'language:' + params.queryParams.language + ',' + 'renditionConfigTarget:' + params.queryParams.renditionConfigTarget + ',' + 'fullyQualifiedName:' + params.urlParams.fullyQualifiedName + ')';
1716
+ }
1717
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
1718
+ return getTypeCacheKeys$1(luvio, response, () => keyBuilder$3(luvio, resourceParams));
1719
+ }
1720
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1721
+ const { body } = response;
1722
+ const key = keyBuilder$3(luvio, resourceParams);
1723
+ luvio.storeIngest(key, ingest$1, body);
1724
+ const snapshot = luvio.storeLookup({
1725
+ recordId: key,
1726
+ node: select$2(),
1727
+ variables: {},
1728
+ }, snapshotRefresh);
1729
+ if (process.env.NODE_ENV !== 'production') {
1730
+ if (snapshot.state !== 'Fulfilled') {
1731
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1732
+ }
1733
+ }
1734
+ return snapshot;
1735
+ }
1736
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
1737
+ const key = keyBuilder$3(luvio, params);
1738
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1739
+ const storeMetadataParams = {
1740
+ ttl: TTL$1,
1741
+ namespace: keyPrefix,
1742
+ version: VERSION$1,
1743
+ representationName: RepresentationType$1
1744
+ };
1745
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1746
+ return errorSnapshot;
1747
+ }
1748
+ function createResourceRequest$1(config) {
1749
+ const headers = {};
1750
+ return {
1751
+ baseUri: '/services/data/v58.0',
1752
+ basePath: '/connect/experience-model/property-types/' + config.urlParams.fullyQualifiedName + '',
1753
+ method: 'get',
1754
+ body: null,
1755
+ urlParams: config.urlParams,
1756
+ queryParams: config.queryParams,
1757
+ headers,
1758
+ priority: 'normal',
1759
+ };
1760
+ }
1761
+
1762
+ const getPropertyType_ConfigPropertyNames = {
1763
+ displayName: 'getPropertyType',
1764
+ parameters: {
1765
+ required: ['fullyQualifiedName'],
1766
+ optional: ['designConfigTarget', 'includeSubSchemaDefinitions', 'language', 'renditionConfigTarget']
1767
+ }
1768
+ };
1769
+ function createResourceParams$1(config) {
1770
+ const resourceParams = {
1771
+ urlParams: {
1772
+ fullyQualifiedName: config.fullyQualifiedName
1773
+ },
1774
+ queryParams: {
1775
+ designConfigTarget: config.designConfigTarget, includeSubSchemaDefinitions: config.includeSubSchemaDefinitions, language: config.language, renditionConfigTarget: config.renditionConfigTarget
1776
+ }
1777
+ };
1778
+ return resourceParams;
1779
+ }
1780
+ function keyBuilder$2(luvio, config) {
1781
+ const resourceParams = createResourceParams$1(config);
1782
+ return keyBuilder$3(luvio, resourceParams);
1783
+ }
1784
+ function typeCheckConfig$1(untrustedConfig) {
1785
+ const config = {};
1786
+ const untrustedConfig_fullyQualifiedName = untrustedConfig.fullyQualifiedName;
1787
+ if (typeof untrustedConfig_fullyQualifiedName === 'string') {
1788
+ config.fullyQualifiedName = untrustedConfig_fullyQualifiedName;
1789
+ }
1790
+ const untrustedConfig_designConfigTarget = untrustedConfig.designConfigTarget;
1791
+ if (typeof untrustedConfig_designConfigTarget === 'string') {
1792
+ config.designConfigTarget = untrustedConfig_designConfigTarget;
1793
+ }
1794
+ const untrustedConfig_includeSubSchemaDefinitions = untrustedConfig.includeSubSchemaDefinitions;
1795
+ if (typeof untrustedConfig_includeSubSchemaDefinitions === 'boolean') {
1796
+ config.includeSubSchemaDefinitions = untrustedConfig_includeSubSchemaDefinitions;
1797
+ }
1798
+ const untrustedConfig_language = untrustedConfig.language;
1799
+ if (typeof untrustedConfig_language === 'string') {
1800
+ config.language = untrustedConfig_language;
1801
+ }
1802
+ const untrustedConfig_renditionConfigTarget = untrustedConfig.renditionConfigTarget;
1803
+ if (typeof untrustedConfig_renditionConfigTarget === 'string') {
1804
+ config.renditionConfigTarget = untrustedConfig_renditionConfigTarget;
1805
+ }
1806
+ return config;
1807
+ }
1808
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1809
+ if (!untrustedIsObject(untrustedConfig)) {
1810
+ return null;
1811
+ }
1812
+ if (process.env.NODE_ENV !== 'production') {
1813
+ validateConfig(untrustedConfig, configPropertyNames);
1814
+ }
1815
+ const config = typeCheckConfig$1(untrustedConfig);
1816
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1817
+ return null;
1818
+ }
1819
+ return config;
1820
+ }
1821
+ function adapterFragment$1(luvio, config) {
1822
+ createResourceParams$1(config);
1823
+ return select$2();
1824
+ }
1825
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
1826
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
1827
+ config,
1828
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1829
+ });
1830
+ return luvio.storeBroadcast().then(() => snapshot);
1831
+ }
1832
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
1833
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
1834
+ config,
1835
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1836
+ });
1837
+ return luvio.storeBroadcast().then(() => snapshot);
1838
+ }
1839
+ function buildNetworkSnapshot$1(luvio, config, options) {
1840
+ const resourceParams = createResourceParams$1(config);
1841
+ const request = createResourceRequest$1(resourceParams);
1842
+ return luvio.dispatchResourceRequest(request, options)
1843
+ .then((response) => {
1844
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
1845
+ }, (response) => {
1846
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
1847
+ });
1848
+ }
1849
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1850
+ const { luvio, config } = context;
1851
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1852
+ const dispatchOptions = {
1853
+ resourceRequestContext: {
1854
+ requestCorrelator,
1855
+ luvioRequestMethod: undefined,
1856
+ },
1857
+ eventObservers
1858
+ };
1859
+ if (networkPriority !== 'normal') {
1860
+ dispatchOptions.overrides = {
1861
+ priority: networkPriority
1862
+ };
1863
+ }
1864
+ return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
1865
+ }
1866
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1867
+ const { luvio, config } = context;
1868
+ const selector = {
1869
+ recordId: keyBuilder$2(luvio, config),
1870
+ node: adapterFragment$1(luvio, config),
1871
+ variables: {},
1872
+ };
1873
+ const cacheSnapshot = storeLookup(selector, {
1874
+ config,
1875
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1876
+ });
1877
+ return cacheSnapshot;
1878
+ }
1879
+ const getPropertyTypeAdapterFactory = (luvio) => function ExperienceType__getPropertyType(untrustedConfig, requestContext) {
1880
+ const config = validateAdapterConfig$1(untrustedConfig, getPropertyType_ConfigPropertyNames);
1881
+ // Invalid or incomplete config
1882
+ if (config === null) {
1883
+ return null;
1884
+ }
1885
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1886
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
1887
+ };
1888
+
1889
+ function validate$1(obj, path = 'ExperienceModelPropertyTypeSummaryRepresentation') {
1890
+ const v_error = (() => {
1891
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1892
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1893
+ }
1894
+ if (obj.description !== undefined) {
1895
+ const obj_description = obj.description;
1896
+ const path_description = path + '.description';
1897
+ if (typeof obj_description !== 'string') {
1898
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1899
+ }
1900
+ }
1901
+ const obj_detailUrl = obj.detailUrl;
1902
+ const path_detailUrl = path + '.detailUrl';
1903
+ if (typeof obj_detailUrl !== 'string') {
1904
+ return new TypeError('Expected "string" but received "' + typeof obj_detailUrl + '" (at "' + path_detailUrl + '")');
1905
+ }
1906
+ const obj_developerName = obj.developerName;
1907
+ const path_developerName = path + '.developerName';
1908
+ if (typeof obj_developerName !== 'string') {
1909
+ return new TypeError('Expected "string" but received "' + typeof obj_developerName + '" (at "' + path_developerName + '")');
1910
+ }
1911
+ if (obj.id !== undefined) {
1912
+ const obj_id = obj.id;
1913
+ const path_id = path + '.id';
1914
+ if (typeof obj_id !== 'string') {
1915
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1916
+ }
1917
+ }
1918
+ const obj_namespacePrefix = obj.namespacePrefix;
1919
+ const path_namespacePrefix = path + '.namespacePrefix';
1920
+ if (typeof obj_namespacePrefix !== 'string') {
1921
+ return new TypeError('Expected "string" but received "' + typeof obj_namespacePrefix + '" (at "' + path_namespacePrefix + '")');
1922
+ }
1923
+ if (obj.title !== undefined) {
1924
+ const obj_title = obj.title;
1925
+ const path_title = path + '.title';
1926
+ if (typeof obj_title !== 'string') {
1927
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1928
+ }
1929
+ }
1930
+ })();
1931
+ return v_error === undefined ? null : v_error;
1932
+ }
1933
+ function deepFreeze$1(input) {
1934
+ ObjectFreeze(input);
1935
+ }
1936
+
1937
+ const TTL = 3600000;
1938
+ const VERSION = "172e544645942d550fc1f07812bb85b6";
1939
+ function validate(obj, path = 'ExperienceModelPropertyTypeCollectionRepresentation') {
1940
+ const v_error = (() => {
1941
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1942
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1943
+ }
1944
+ const obj_count = obj.count;
1945
+ const path_count = path + '.count';
1946
+ if (typeof obj_count !== 'number' || (typeof obj_count === 'number' && Math.floor(obj_count) !== obj_count)) {
1947
+ return new TypeError('Expected "integer" but received "' + typeof obj_count + '" (at "' + path_count + '")');
1948
+ }
1949
+ if (obj.currentPageUrl !== undefined) {
1950
+ const obj_currentPageUrl = obj.currentPageUrl;
1951
+ const path_currentPageUrl = path + '.currentPageUrl';
1952
+ if (typeof obj_currentPageUrl !== 'string') {
1953
+ return new TypeError('Expected "string" but received "' + typeof obj_currentPageUrl + '" (at "' + path_currentPageUrl + '")');
1954
+ }
1955
+ }
1956
+ if (obj.nextPageUrl !== undefined) {
1957
+ const obj_nextPageUrl = obj.nextPageUrl;
1958
+ const path_nextPageUrl = path + '.nextPageUrl';
1959
+ if (typeof obj_nextPageUrl !== 'string') {
1960
+ return new TypeError('Expected "string" but received "' + typeof obj_nextPageUrl + '" (at "' + path_nextPageUrl + '")');
1961
+ }
1962
+ }
1963
+ if (obj.previousPageUrl !== undefined) {
1964
+ const obj_previousPageUrl = obj.previousPageUrl;
1965
+ const path_previousPageUrl = path + '.previousPageUrl';
1966
+ if (typeof obj_previousPageUrl !== 'string') {
1967
+ return new TypeError('Expected "string" but received "' + typeof obj_previousPageUrl + '" (at "' + path_previousPageUrl + '")');
1968
+ }
1969
+ }
1970
+ const obj_propertyTypes = obj.propertyTypes;
1971
+ const path_propertyTypes = path + '.propertyTypes';
1972
+ if (!ArrayIsArray(obj_propertyTypes)) {
1973
+ return new TypeError('Expected "array" but received "' + typeof obj_propertyTypes + '" (at "' + path_propertyTypes + '")');
1974
+ }
1975
+ for (let i = 0; i < obj_propertyTypes.length; i++) {
1976
+ const obj_propertyTypes_item = obj_propertyTypes[i];
1977
+ const path_propertyTypes_item = path_propertyTypes + '[' + i + ']';
1978
+ const referencepath_propertyTypes_itemValidationError = validate$1(obj_propertyTypes_item, path_propertyTypes_item);
1979
+ if (referencepath_propertyTypes_itemValidationError !== null) {
1980
+ let message = 'Object doesn\'t match ExperienceModelPropertyTypeSummaryRepresentation (at "' + path_propertyTypes_item + '")\n';
1981
+ message += referencepath_propertyTypes_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1982
+ return new TypeError(message);
1983
+ }
1984
+ }
1985
+ })();
1986
+ return v_error === undefined ? null : v_error;
1987
+ }
1988
+ const RepresentationType = 'ExperienceModelPropertyTypeCollectionRepresentation';
1989
+ function normalize(input, existing, path, luvio, store, timestamp) {
1990
+ return input;
1991
+ }
1992
+ const select$1 = function ExperienceModelPropertyTypeCollectionRepresentationSelect() {
1993
+ return {
1994
+ kind: 'Fragment',
1995
+ version: VERSION,
1996
+ private: [],
1997
+ opaque: true
1998
+ };
1999
+ };
2000
+ function equals(existing, incoming) {
2001
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
2002
+ return false;
2003
+ }
2004
+ return true;
2005
+ }
2006
+ function deepFreeze(input) {
2007
+ const input_propertyTypes = input.propertyTypes;
2008
+ for (let i = 0; i < input_propertyTypes.length; i++) {
2009
+ const input_propertyTypes_item = input_propertyTypes[i];
2010
+ deepFreeze$1(input_propertyTypes_item);
2011
+ }
2012
+ ObjectFreeze(input_propertyTypes);
2013
+ ObjectFreeze(input);
2014
+ }
2015
+ const ingest = function ExperienceModelPropertyTypeCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
2016
+ if (process.env.NODE_ENV !== 'production') {
2017
+ const validateError = validate(input);
2018
+ if (validateError !== null) {
2019
+ throw validateError;
2020
+ }
2021
+ }
2022
+ const key = path.fullPath;
2023
+ const existingRecord = store.readEntry(key);
2024
+ const ttlToUse = TTL;
2025
+ let incomingRecord = normalize(input, store.readEntry(key), {
2026
+ fullPath: key,
2027
+ parent: path.parent,
2028
+ propertyName: path.propertyName,
2029
+ ttl: ttlToUse
2030
+ });
2031
+ deepFreeze(input);
2032
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
2033
+ luvio.storePublish(key, incomingRecord);
2034
+ }
2035
+ {
2036
+ const storeMetadataParams = {
2037
+ ttl: ttlToUse,
2038
+ namespace: "ExperienceType",
2039
+ version: VERSION,
2040
+ representationName: RepresentationType,
2041
+ };
2042
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2043
+ }
2044
+ return createLink(key);
2045
+ };
2046
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
2047
+ const rootKeySet = new StoreKeyMap();
2048
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2049
+ const rootKey = fullPathFactory();
2050
+ rootKeySet.set(rootKey, {
2051
+ namespace: keyPrefix,
2052
+ representationName: RepresentationType,
2053
+ mergeable: false
2054
+ });
2055
+ return rootKeySet;
2056
+ }
2057
+
2058
+ function select(luvio, params) {
2059
+ return select$1();
2060
+ }
2061
+ function keyBuilder$1(luvio, params) {
2062
+ return keyPrefix + '::ExperienceModelPropertyTypeCollectionRepresentation:(' + 'designConfigTarget:' + params.queryParams.designConfigTarget + ',' + 'fullyQualifiedNames:' + params.queryParams.fullyQualifiedNames + ',' + 'language:' + params.queryParams.language + ',' + 'page:' + params.queryParams.page + ',' + 'pageSize:' + params.queryParams.pageSize + ',' + 'renditionConfigTarget:' + params.queryParams.renditionConfigTarget + ')';
2063
+ }
2064
+ function getResponseCacheKeys(luvio, resourceParams, response) {
2065
+ return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
2066
+ }
2067
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
2068
+ const { body } = response;
2069
+ const key = keyBuilder$1(luvio, resourceParams);
2070
+ luvio.storeIngest(key, ingest, body);
2071
+ const snapshot = luvio.storeLookup({
2072
+ recordId: key,
2073
+ node: select(),
2074
+ variables: {},
2075
+ }, snapshotRefresh);
2076
+ if (process.env.NODE_ENV !== 'production') {
2077
+ if (snapshot.state !== 'Fulfilled') {
2078
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2079
+ }
2080
+ }
2081
+ return snapshot;
2082
+ }
2083
+ function ingestError(luvio, params, error, snapshotRefresh) {
2084
+ const key = keyBuilder$1(luvio, params);
2085
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2086
+ const storeMetadataParams = {
2087
+ ttl: TTL,
2088
+ namespace: keyPrefix,
2089
+ version: VERSION,
2090
+ representationName: RepresentationType
2091
+ };
2092
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
2093
+ return errorSnapshot;
2094
+ }
2095
+ function createResourceRequest(config) {
2096
+ const headers = {};
2097
+ return {
2098
+ baseUri: '/services/data/v58.0',
2099
+ basePath: '/connect/experience-model/property-types',
2100
+ method: 'get',
2101
+ body: null,
2102
+ urlParams: {},
2103
+ queryParams: config.queryParams,
2104
+ headers,
2105
+ priority: 'normal',
2106
+ };
2107
+ }
2108
+
2109
+ const getPropertyTypes_ConfigPropertyNames = {
2110
+ displayName: 'getPropertyTypes',
2111
+ parameters: {
2112
+ required: [],
2113
+ optional: ['designConfigTarget', 'fullyQualifiedNames', 'language', 'page', 'pageSize', 'renditionConfigTarget']
2114
+ }
2115
+ };
2116
+ function createResourceParams(config) {
2117
+ const resourceParams = {
2118
+ queryParams: {
2119
+ designConfigTarget: config.designConfigTarget, fullyQualifiedNames: config.fullyQualifiedNames, language: config.language, page: config.page, pageSize: config.pageSize, renditionConfigTarget: config.renditionConfigTarget
2120
+ }
2121
+ };
2122
+ return resourceParams;
2123
+ }
2124
+ function keyBuilder(luvio, config) {
2125
+ const resourceParams = createResourceParams(config);
2126
+ return keyBuilder$1(luvio, resourceParams);
2127
+ }
2128
+ function typeCheckConfig(untrustedConfig) {
2129
+ const config = {};
2130
+ const untrustedConfig_designConfigTarget = untrustedConfig.designConfigTarget;
2131
+ if (typeof untrustedConfig_designConfigTarget === 'string') {
2132
+ config.designConfigTarget = untrustedConfig_designConfigTarget;
2133
+ }
2134
+ const untrustedConfig_fullyQualifiedNames = untrustedConfig.fullyQualifiedNames;
2135
+ if (ArrayIsArray$1(untrustedConfig_fullyQualifiedNames)) {
2136
+ const untrustedConfig_fullyQualifiedNames_array = [];
2137
+ for (let i = 0, arrayLength = untrustedConfig_fullyQualifiedNames.length; i < arrayLength; i++) {
2138
+ const untrustedConfig_fullyQualifiedNames_item = untrustedConfig_fullyQualifiedNames[i];
2139
+ if (typeof untrustedConfig_fullyQualifiedNames_item === 'string') {
2140
+ untrustedConfig_fullyQualifiedNames_array.push(untrustedConfig_fullyQualifiedNames_item);
2141
+ }
2142
+ }
2143
+ config.fullyQualifiedNames = untrustedConfig_fullyQualifiedNames_array;
2144
+ }
2145
+ const untrustedConfig_language = untrustedConfig.language;
2146
+ if (typeof untrustedConfig_language === 'string') {
2147
+ config.language = untrustedConfig_language;
2148
+ }
2149
+ const untrustedConfig_page = untrustedConfig.page;
2150
+ if (typeof untrustedConfig_page === 'number' && Math.floor(untrustedConfig_page) === untrustedConfig_page) {
2151
+ config.page = untrustedConfig_page;
2152
+ }
2153
+ const untrustedConfig_pageSize = untrustedConfig.pageSize;
2154
+ if (typeof untrustedConfig_pageSize === 'number' && Math.floor(untrustedConfig_pageSize) === untrustedConfig_pageSize) {
2155
+ config.pageSize = untrustedConfig_pageSize;
2156
+ }
2157
+ const untrustedConfig_renditionConfigTarget = untrustedConfig.renditionConfigTarget;
2158
+ if (typeof untrustedConfig_renditionConfigTarget === 'string') {
2159
+ config.renditionConfigTarget = untrustedConfig_renditionConfigTarget;
2160
+ }
2161
+ return config;
2162
+ }
2163
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
2164
+ if (!untrustedIsObject(untrustedConfig)) {
2165
+ return null;
2166
+ }
2167
+ if (process.env.NODE_ENV !== 'production') {
2168
+ validateConfig(untrustedConfig, configPropertyNames);
2169
+ }
2170
+ const config = typeCheckConfig(untrustedConfig);
2171
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2172
+ return null;
2173
+ }
2174
+ return config;
2175
+ }
2176
+ function adapterFragment(luvio, config) {
2177
+ createResourceParams(config);
2178
+ return select();
2179
+ }
2180
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
2181
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
2182
+ config,
2183
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
2184
+ });
2185
+ return luvio.storeBroadcast().then(() => snapshot);
2186
+ }
2187
+ function onFetchResponseError(luvio, config, resourceParams, response) {
2188
+ const snapshot = ingestError(luvio, resourceParams, response, {
2189
+ config,
2190
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
2191
+ });
2192
+ return luvio.storeBroadcast().then(() => snapshot);
2193
+ }
2194
+ function buildNetworkSnapshot(luvio, config, options) {
2195
+ const resourceParams = createResourceParams(config);
2196
+ const request = createResourceRequest(resourceParams);
2197
+ return luvio.dispatchResourceRequest(request, options)
2198
+ .then((response) => {
2199
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
2200
+ }, (response) => {
2201
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
2202
+ });
2203
+ }
2204
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
2205
+ const { luvio, config } = context;
2206
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
2207
+ const dispatchOptions = {
2208
+ resourceRequestContext: {
2209
+ requestCorrelator,
2210
+ luvioRequestMethod: undefined,
2211
+ },
2212
+ eventObservers
2213
+ };
2214
+ if (networkPriority !== 'normal') {
2215
+ dispatchOptions.overrides = {
2216
+ priority: networkPriority
2217
+ };
2218
+ }
2219
+ return buildNetworkSnapshot(luvio, config, dispatchOptions);
2220
+ }
2221
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
2222
+ const { luvio, config } = context;
2223
+ const selector = {
2224
+ recordId: keyBuilder(luvio, config),
2225
+ node: adapterFragment(luvio, config),
2226
+ variables: {},
2227
+ };
2228
+ const cacheSnapshot = storeLookup(selector, {
2229
+ config,
2230
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
2231
+ });
2232
+ return cacheSnapshot;
2233
+ }
2234
+ const getPropertyTypesAdapterFactory = (luvio) => function ExperienceType__getPropertyTypes(untrustedConfig, requestContext) {
2235
+ const config = validateAdapterConfig(untrustedConfig, getPropertyTypes_ConfigPropertyNames);
2236
+ // Invalid or incomplete config
2237
+ if (config === null) {
2238
+ return null;
2239
+ }
2240
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2241
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
2242
+ };
2243
+
2244
+ let getBlockType;
2245
+ let getBlockTypes;
2246
+ let getContentType;
2247
+ let getContentTypes;
2248
+ let getPropertyType;
2249
+ let getPropertyTypes;
2250
+ // Imperative GET Adapters
2251
+ let getBlockType_imperative;
2252
+ let getBlockTypes_imperative;
2253
+ let getContentType_imperative;
2254
+ let getContentTypes_imperative;
2255
+ let getPropertyType_imperative;
2256
+ let getPropertyTypes_imperative;
2257
+ // Adapter Metadata
2258
+ const getBlockTypeMetadata = { apiFamily: 'ExperienceType', name: 'getBlockType', ttl: 3600000 };
2259
+ const getBlockTypesMetadata = { apiFamily: 'ExperienceType', name: 'getBlockTypes', ttl: 3600000 };
2260
+ const getContentTypeMetadata = { apiFamily: 'ExperienceType', name: 'getContentType', ttl: 3600000 };
2261
+ const getContentTypesMetadata = { apiFamily: 'ExperienceType', name: 'getContentTypes', ttl: 3600000 };
2262
+ const getPropertyTypeMetadata = { apiFamily: 'ExperienceType', name: 'getPropertyType', ttl: 3600000 };
2263
+ const getPropertyTypesMetadata = { apiFamily: 'ExperienceType', name: 'getPropertyTypes', ttl: 3600000 };
2264
+ function bindExportsTo(luvio) {
2265
+ // LDS Adapters
2266
+ const getBlockType_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getBlockType', getBlockTypeAdapterFactory), getBlockTypeMetadata);
2267
+ const getBlockTypes_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getBlockTypes', getBlockTypesAdapterFactory), getBlockTypesMetadata);
2268
+ const getContentType_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getContentType', getContentTypeAdapterFactory), getContentTypeMetadata);
2269
+ const getContentTypes_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getContentTypes', getContentTypesAdapterFactory), getContentTypesMetadata);
2270
+ const getPropertyType_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getPropertyType', getPropertyTypeAdapterFactory), getPropertyTypeMetadata);
2271
+ const getPropertyTypes_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getPropertyTypes', getPropertyTypesAdapterFactory), getPropertyTypesMetadata);
2272
+ return {
2273
+ getBlockType: createWireAdapterConstructor(luvio, getBlockType_ldsAdapter, getBlockTypeMetadata),
2274
+ getBlockTypes: createWireAdapterConstructor(luvio, getBlockTypes_ldsAdapter, getBlockTypesMetadata),
2275
+ getContentType: createWireAdapterConstructor(luvio, getContentType_ldsAdapter, getContentTypeMetadata),
2276
+ getContentTypes: createWireAdapterConstructor(luvio, getContentTypes_ldsAdapter, getContentTypesMetadata),
2277
+ getPropertyType: createWireAdapterConstructor(luvio, getPropertyType_ldsAdapter, getPropertyTypeMetadata),
2278
+ getPropertyTypes: createWireAdapterConstructor(luvio, getPropertyTypes_ldsAdapter, getPropertyTypesMetadata),
2279
+ // Imperative GET Adapters
2280
+ getBlockType_imperative: createImperativeAdapter(luvio, getBlockType_ldsAdapter, getBlockTypeMetadata),
2281
+ getBlockTypes_imperative: createImperativeAdapter(luvio, getBlockTypes_ldsAdapter, getBlockTypesMetadata),
2282
+ getContentType_imperative: createImperativeAdapter(luvio, getContentType_ldsAdapter, getContentTypeMetadata),
2283
+ getContentTypes_imperative: createImperativeAdapter(luvio, getContentTypes_ldsAdapter, getContentTypesMetadata),
2284
+ getPropertyType_imperative: createImperativeAdapter(luvio, getPropertyType_ldsAdapter, getPropertyTypeMetadata),
2285
+ getPropertyTypes_imperative: createImperativeAdapter(luvio, getPropertyTypes_ldsAdapter, getPropertyTypesMetadata)
2286
+ };
2287
+ }
2288
+ withDefaultLuvio((luvio) => {
2289
+ ({
2290
+ getBlockType,
2291
+ getBlockTypes,
2292
+ getContentType,
2293
+ getContentTypes,
2294
+ getPropertyType,
2295
+ getPropertyTypes,
2296
+ getBlockType_imperative,
2297
+ getBlockTypes_imperative,
2298
+ getContentType_imperative,
2299
+ getContentTypes_imperative,
2300
+ getPropertyType_imperative,
2301
+ getPropertyTypes_imperative
2302
+ } = bindExportsTo(luvio));
2303
+ });
2304
+
2305
+ export { getBlockType, getBlockType_imperative, getBlockTypes, getBlockTypes_imperative, getContentType, getContentType_imperative, getContentTypes, getContentTypes_imperative, getPropertyType, getPropertyType_imperative, getPropertyTypes, getPropertyTypes_imperative };
2306
+ // version: 0.131.0-c1ec5b7de