@salesforce/lds-adapters-experience-model 1.100.2

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