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