@salesforce/lds-adapters-cms-delivery 0.131.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/cms-delivery.js +2501 -0
  3. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +66 -0
  4. package/dist/es/es2018/types/src/generated/adapters/getCollectionItemsForChannel.d.ts +28 -0
  5. package/dist/es/es2018/types/src/generated/adapters/getCollectionItemsForSite.d.ts +28 -0
  6. package/dist/es/es2018/types/src/generated/adapters/getCollectionMetadataForChannel.d.ts +29 -0
  7. package/dist/es/es2018/types/src/generated/adapters/getCollectionMetadataForSite.d.ts +29 -0
  8. package/dist/es/es2018/types/src/generated/adapters/listContent.d.ts +34 -0
  9. package/dist/es/es2018/types/src/generated/adapters/listContentInternal.d.ts +36 -0
  10. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +6 -0
  11. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +13 -0
  12. package/dist/es/es2018/types/src/generated/resources/deleteConnectCmsContentJobsByJobId.d.ts +11 -0
  13. package/dist/es/es2018/types/src/generated/resources/deleteConnectManagedContentContentSpacesContentsByContentSpaceIdAndManagedContentId.d.ts +10 -0
  14. package/dist/es/es2018/types/src/generated/resources/deleteConnectManagedContentContentSpacesMembersByContentSpaceIdAndMemberIdOrMe.d.ts +10 -0
  15. package/dist/es/es2018/types/src/generated/resources/getConnectCmsChannelsSearchableContentTypesByChannelId.d.ts +19 -0
  16. package/dist/es/es2018/types/src/generated/resources/getConnectCmsContent.d.ts +16 -0
  17. package/dist/es/es2018/types/src/generated/resources/getConnectCmsContentJobsByJobId.d.ts +15 -0
  18. package/dist/es/es2018/types/src/generated/resources/getConnectCmsContentVersionByManagedContentVersionId.d.ts +19 -0
  19. package/dist/es/es2018/types/src/generated/resources/getConnectCmsDeliveryChannelsCollectionsByChannelIdAndCollectionKeyOrId.d.ts +19 -0
  20. package/dist/es/es2018/types/src/generated/resources/getConnectCmsDeliveryChannelsCollectionsMetadataByChannelIdAndCollectionKeyOrId.d.ts +20 -0
  21. package/dist/es/es2018/types/src/generated/resources/getConnectCmsDeliveryChannelsContentsQueryByChannelId.d.ts +27 -0
  22. package/dist/es/es2018/types/src/generated/resources/getConnectCmsDeliveryChannelsContentsSearchByChannelId.d.ts +21 -0
  23. package/dist/es/es2018/types/src/generated/resources/getConnectCmsDeliveryChannelsMediaContentByChannelIdAndMediaGuid.d.ts +16 -0
  24. package/dist/es/es2018/types/src/generated/resources/getConnectCmsDeliveryRecordsContentsByRecordId.d.ts +22 -0
  25. package/dist/es/es2018/types/src/generated/resources/getConnectCmsFoldersByFolderId.d.ts +15 -0
  26. package/dist/es/es2018/types/src/generated/resources/getConnectCmsFoldersItemsByFolderId.d.ts +25 -0
  27. package/dist/es/es2018/types/src/generated/resources/getConnectCmsSpacesByContentSpaceId.d.ts +15 -0
  28. package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesManagedContentDeliveryByCommunityId.d.ts +25 -0
  29. package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesManagedContentDeliveryContentsByCommunityId.d.ts +27 -0
  30. package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesManagedContentDeliveryContentsByCommunityIdAndManagedContentId.d.ts +16 -0
  31. package/dist/es/es2018/types/src/generated/resources/getConnectCommunitiesManagedContentDeliveryContentsSearchByCommunityId.d.ts +21 -0
  32. package/dist/es/es2018/types/src/generated/resources/getConnectManagedContentContentSpacesContentVersionsByContentSpaceIdAndManagedContentVersionId.d.ts +19 -0
  33. package/dist/es/es2018/types/src/generated/resources/getConnectManagedContentContentSpacesMembersByContentSpaceId.d.ts +15 -0
  34. package/dist/es/es2018/types/src/generated/resources/getConnectManagedContentContentSpacesMembersPermissionsByContentSpaceIdAndMemberIdOrMe.d.ts +16 -0
  35. package/dist/es/es2018/types/src/generated/resources/getConnectManagedContentDeliveryContentsByManagedContentId.d.ts +15 -0
  36. package/dist/es/es2018/types/src/generated/resources/getConnectManagedContentRoles.d.ts +15 -0
  37. package/dist/es/es2018/types/src/generated/resources/getConnectSitesCmsDeliveryCollectionsByCollectionKeyOrIdAndSiteId.d.ts +19 -0
  38. package/dist/es/es2018/types/src/generated/resources/getConnectSitesCmsDeliveryCollectionsMetadataByCollectionKeyOrIdAndSiteId.d.ts +20 -0
  39. package/dist/es/es2018/types/src/generated/resources/patchConnectCmsChannelsSearchableContentTypesByChannelId.d.ts +13 -0
  40. package/dist/es/es2018/types/src/generated/resources/patchConnectCmsContentVersionByManagedContentVersionId.d.ts +21 -0
  41. package/dist/es/es2018/types/src/generated/resources/patchConnectCmsFoldersItemsByFolderId.d.ts +13 -0
  42. package/dist/es/es2018/types/src/generated/resources/patchConnectManagedContentContentSpacesContentVersionsByContentSpaceIdAndManagedContentVersionId.d.ts +21 -0
  43. package/dist/es/es2018/types/src/generated/resources/patchConnectManagedContentContentSpacesContentsByContentSpaceIdAndManagedContentId.d.ts +13 -0
  44. package/dist/es/es2018/types/src/generated/resources/patchConnectManagedContentContentSpacesMembersByContentSpaceIdAndMemberIdOrMe.d.ts +14 -0
  45. package/dist/es/es2018/types/src/generated/resources/postConnectCmsContentJobsImport.d.ts +14 -0
  46. package/dist/es/es2018/types/src/generated/resources/postConnectCmsContentVariant.d.ts +18 -0
  47. package/dist/es/es2018/types/src/generated/resources/postConnectCmsContentVersion.d.ts +21 -0
  48. package/dist/es/es2018/types/src/generated/resources/postConnectCmsContentVersions.d.ts +12 -0
  49. package/dist/es/es2018/types/src/generated/resources/postConnectManagedContentContentSpacesContentVersionsByContentSpaceId.d.ts +23 -0
  50. package/dist/es/es2018/types/src/generated/resources/postConnectManagedContentContentSpacesMembersByContentSpaceId.d.ts +16 -0
  51. package/dist/es/es2018/types/src/generated/resources/postConnectManagedContentTranslation.d.ts +15 -0
  52. package/dist/es/es2018/types/src/generated/resources/putConnectCmsContentVersionByManagedContentVersionId.d.ts +21 -0
  53. package/dist/es/es2018/types/src/generated/types/AbstractMCSFolderRepresentation.d.ts +41 -0
  54. package/dist/es/es2018/types/src/generated/types/ManagedContentAssociationsInputRep.d.ts +33 -0
  55. package/dist/es/es2018/types/src/generated/types/ManagedContentAssociationsRepresentation.d.ts +30 -0
  56. package/dist/es/es2018/types/src/generated/types/ManagedContentBodyInputRep.d.ts +33 -0
  57. package/dist/es/es2018/types/src/generated/types/ManagedContentChannelSummaryRepresentation.d.ts +38 -0
  58. package/dist/es/es2018/types/src/generated/types/ManagedContentChannelTargetSummaryRepresentation.d.ts +29 -0
  59. package/dist/es/es2018/types/src/generated/types/ManagedContentCollectionItemRepresentation.d.ts +42 -0
  60. package/dist/es/es2018/types/src/generated/types/ManagedContentCollectionItemTypeSummaryRepresentation.d.ts +32 -0
  61. package/dist/es/es2018/types/src/generated/types/ManagedContentCollectionItemsRepresentation.d.ts +59 -0
  62. package/dist/es/es2018/types/src/generated/types/ManagedContentCollectionMetadataRepresentation.d.ts +66 -0
  63. package/dist/es/es2018/types/src/generated/types/ManagedContentCollectionRepresentation.d.ts +30 -0
  64. package/dist/es/es2018/types/src/generated/types/ManagedContentDateAndTimeNodeValueRepresentation.d.ts +34 -0
  65. package/dist/es/es2018/types/src/generated/types/ManagedContentDateNodeValueRepresentation.d.ts +31 -0
  66. package/dist/es/es2018/types/src/generated/types/ManagedContentDetailCollectionRepresentation.d.ts +33 -0
  67. package/dist/es/es2018/types/src/generated/types/ManagedContentDetailRepresentation.d.ts +38 -0
  68. package/dist/es/es2018/types/src/generated/types/ManagedContentInputRep.d.ts +29 -0
  69. package/dist/es/es2018/types/src/generated/types/ManagedContentJobRepresentation.d.ts +65 -0
  70. package/dist/es/es2018/types/src/generated/types/ManagedContentJobRequestInputRepresentation.d.ts +35 -0
  71. package/dist/es/es2018/types/src/generated/types/ManagedContentMediaNodeValueRepresentation.d.ts +57 -0
  72. package/dist/es/es2018/types/src/generated/types/ManagedContentMediaSourceNodeValueRepresentation.d.ts +51 -0
  73. package/dist/es/es2018/types/src/generated/types/ManagedContentNodeTypeRepresentation.d.ts +35 -0
  74. package/dist/es/es2018/types/src/generated/types/ManagedContentNodeValueRepresentation.d.ts +35 -0
  75. package/dist/es/es2018/types/src/generated/types/ManagedContentRepresentation.d.ts +35 -0
  76. package/dist/es/es2018/types/src/generated/types/ManagedContentSearchResultCollectionRepresentation.d.ts +39 -0
  77. package/dist/es/es2018/types/src/generated/types/ManagedContentSearchResultContentTypeRepresentation.d.ts +32 -0
  78. package/dist/es/es2018/types/src/generated/types/ManagedContentSearchResultRepresentation.d.ts +45 -0
  79. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceFolderDetailRepresentation.d.ts +44 -0
  80. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceFolderItemCollectionInputRep.d.ts +32 -0
  81. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceFolderItemCollectionRepresentation.d.ts +36 -0
  82. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceFolderItemRepresentation.d.ts +62 -0
  83. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceFolderRepresentation.d.ts +27 -0
  84. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceMemberCollectionRepresentation.d.ts +30 -0
  85. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceMemberInputRepresentation.d.ts +32 -0
  86. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceMemberPermissionsRepresentation.d.ts +38 -0
  87. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceMemberRepresentation.d.ts +35 -0
  88. package/dist/es/es2018/types/src/generated/types/ManagedContentSpacePermissionRepresentation.d.ts +47 -0
  89. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceRepresentation.d.ts +56 -0
  90. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceRoleCollectionRepresentation.d.ts +30 -0
  91. package/dist/es/es2018/types/src/generated/types/ManagedContentSpaceRoleRepresentation.d.ts +35 -0
  92. package/dist/es/es2018/types/src/generated/types/ManagedContentTextNodeValueRepresentation.d.ts +31 -0
  93. package/dist/es/es2018/types/src/generated/types/ManagedContentTranslationRepresentation.d.ts +65 -0
  94. package/dist/es/es2018/types/src/generated/types/ManagedContentTranslationRequestInputRep.d.ts +38 -0
  95. package/dist/es/es2018/types/src/generated/types/ManagedContentTypeRepresentation.d.ts +40 -0
  96. package/dist/es/es2018/types/src/generated/types/ManagedContentTypeSearchableCollectionRepresentation.d.ts +39 -0
  97. package/dist/es/es2018/types/src/generated/types/ManagedContentTypeSearchableInputRepresentation.d.ts +32 -0
  98. package/dist/es/es2018/types/src/generated/types/ManagedContentTypeSearchableRepresentation.d.ts +38 -0
  99. package/dist/es/es2018/types/src/generated/types/ManagedContentTypeSummaryRepresentation.d.ts +32 -0
  100. package/dist/es/es2018/types/src/generated/types/ManagedContentVariantInputRep.d.ts +47 -0
  101. package/dist/es/es2018/types/src/generated/types/ManagedContentVariantRepresentation.d.ts +50 -0
  102. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionCollectionRepresentation.d.ts +51 -0
  103. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionInputRep.d.ts +51 -0
  104. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionInternalCollectionRepresentation.d.ts +42 -0
  105. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionInternalRepresentation.d.ts +82 -0
  106. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionRepresentation.d.ts +67 -0
  107. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionV2CollectionInputRepresentation.d.ts +29 -0
  108. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionV2CollectionRepresentation.d.ts +33 -0
  109. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionV2InputRepresentation.d.ts +54 -0
  110. package/dist/es/es2018/types/src/generated/types/ManagedContentVersionV2Representation.d.ts +72 -0
  111. package/dist/es/es2018/types/src/generated/types/ReferenceRepresentation.d.ts +32 -0
  112. package/dist/es/es2018/types/src/generated/types/StreamedRepresentation.d.ts +26 -0
  113. package/dist/es/es2018/types/src/generated/types/TopicSummaryRepresentation.d.ts +32 -0
  114. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +39 -0
  115. package/dist/es/es2018/types/src/raml-artifacts/adapters/getCollectionItemsForChannel/onFetchResponseSuccess.d.ts +5 -0
  116. package/dist/es/es2018/types/src/raml-artifacts/adapters/getCollectionItemsForSite/onFetchResponseSuccess.d.ts +5 -0
  117. package/dist/es/es2018/types/src/raml-artifacts/adapters/getCollectionMetadataForChannel/onFetchResponseSuccess.d.ts +5 -0
  118. package/dist/es/es2018/types/src/raml-artifacts/adapters/getCollectionMetadataForSite/onFetchResponseSuccess.d.ts +5 -0
  119. package/package.json +54 -0
  120. package/sfdc/index.d.ts +1 -0
  121. package/sfdc/index.js +2573 -0
  122. package/src/raml/api.raml +2091 -0
  123. package/src/raml/luvio.raml +47 -0
package/sfdc/index.js ADDED
@@ -0,0 +1,2573 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ /* *******************************************************************************************
8
+ * ATTENTION!
9
+ * THIS IS A GENERATED FILE FROM https://github.com/salesforce-experience-platform-emu/lds-lightning-platform
10
+ * If you would like to contribute to LDS, please follow the steps outlined in the git repo.
11
+ * Any changes made to this file in p4 will be automatically overwritten.
12
+ * *******************************************************************************************
13
+ */
14
+ /* proxy-compat-disable */
15
+ import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
16
+ import { withDefaultLuvio } from 'force/ldsEngine';
17
+ import { serializeStructuredKey, StoreKeyMap } from 'force/luvioEngine';
18
+
19
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
+ const { keys: ObjectKeys$1, freeze: ObjectFreeze$1, create: ObjectCreate$1 } = Object;
21
+ const { isArray: ArrayIsArray$1 } = Array;
22
+ /**
23
+ * Validates an adapter config is well-formed.
24
+ * @param config The config to validate.
25
+ * @param adapter The adapter validation configuration.
26
+ * @param oneOf The keys the config must contain at least one of.
27
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
28
+ */
29
+ function validateConfig(config, adapter, oneOf) {
30
+ const { displayName } = adapter;
31
+ const { required, optional, unsupported } = adapter.parameters;
32
+ if (config === undefined ||
33
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
34
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
35
+ }
36
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
37
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
38
+ }
39
+ if (unsupported !== undefined &&
40
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
41
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
42
+ }
43
+ const supported = required.concat(optional);
44
+ if (ObjectKeys$1(config).some(key => !supported.includes(key))) {
45
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
46
+ }
47
+ }
48
+ function untrustedIsObject(untrusted) {
49
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
50
+ }
51
+ function areRequiredParametersPresent(config, configPropertyNames) {
52
+ return configPropertyNames.parameters.required.every(req => req in config);
53
+ }
54
+ const snapshotRefreshOptions = {
55
+ overrides: {
56
+ headers: {
57
+ 'Cache-Control': 'no-cache',
58
+ },
59
+ }
60
+ };
61
+ const keyPrefix = 'CMS';
62
+
63
+ const { freeze: ObjectFreeze, keys: ObjectKeys, create: ObjectCreate, assign: ObjectAssign } = Object;
64
+ const { isArray: ArrayIsArray } = Array;
65
+ const { stringify: JSONStringify } = JSON;
66
+ function equalsArray(a, b, equalsItem) {
67
+ const aLength = a.length;
68
+ const bLength = b.length;
69
+ if (aLength !== bLength) {
70
+ return false;
71
+ }
72
+ for (let i = 0; i < aLength; i++) {
73
+ if (equalsItem(a[i], b[i]) === false) {
74
+ return false;
75
+ }
76
+ }
77
+ return true;
78
+ }
79
+ function deepFreeze$g(value) {
80
+ // No need to freeze primitives
81
+ if (typeof value !== 'object' || value === null) {
82
+ return;
83
+ }
84
+ if (ArrayIsArray(value)) {
85
+ for (let i = 0, len = value.length; i < len; i += 1) {
86
+ deepFreeze$g(value[i]);
87
+ }
88
+ }
89
+ else {
90
+ const keys = ObjectKeys(value);
91
+ for (let i = 0, len = keys.length; i < len; i += 1) {
92
+ deepFreeze$g(value[keys[i]]);
93
+ }
94
+ }
95
+ ObjectFreeze(value);
96
+ }
97
+ function createLink(ref) {
98
+ return {
99
+ __ref: serializeStructuredKey(ref),
100
+ };
101
+ }
102
+
103
+ function validate$g(obj, path = 'ManagedContentChannelTargetSummaryRepresentation') {
104
+ const v_error = (() => {
105
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
106
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
107
+ }
108
+ const obj_id = obj.id;
109
+ const path_id = path + '.id';
110
+ if (typeof obj_id !== 'string') {
111
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
112
+ }
113
+ })();
114
+ return v_error === undefined ? null : v_error;
115
+ }
116
+ function deepFreeze$f(input) {
117
+ ObjectFreeze(input);
118
+ }
119
+
120
+ function validate$f(obj, path = 'ManagedContentChannelSummaryRepresentation') {
121
+ const v_error = (() => {
122
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
123
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
124
+ }
125
+ if (obj.domainUrl !== undefined) {
126
+ const obj_domainUrl = obj.domainUrl;
127
+ const path_domainUrl = path + '.domainUrl';
128
+ if (typeof obj_domainUrl !== 'string') {
129
+ return new TypeError('Expected "string" but received "' + typeof obj_domainUrl + '" (at "' + path_domainUrl + '")');
130
+ }
131
+ }
132
+ const obj_name = obj.name;
133
+ const path_name = path + '.name';
134
+ if (typeof obj_name !== 'string') {
135
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
136
+ }
137
+ const obj_resourceUrl = obj.resourceUrl;
138
+ const path_resourceUrl = path + '.resourceUrl';
139
+ if (typeof obj_resourceUrl !== 'string') {
140
+ return new TypeError('Expected "string" but received "' + typeof obj_resourceUrl + '" (at "' + path_resourceUrl + '")');
141
+ }
142
+ if (obj.targetSummary !== undefined) {
143
+ const obj_targetSummary = obj.targetSummary;
144
+ const path_targetSummary = path + '.targetSummary';
145
+ const referencepath_targetSummaryValidationError = validate$g(obj_targetSummary, path_targetSummary);
146
+ if (referencepath_targetSummaryValidationError !== null) {
147
+ let message = 'Object doesn\'t match ManagedContentChannelTargetSummaryRepresentation (at "' + path_targetSummary + '")\n';
148
+ message += referencepath_targetSummaryValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
149
+ return new TypeError(message);
150
+ }
151
+ }
152
+ })();
153
+ return v_error === undefined ? null : v_error;
154
+ }
155
+ function deepFreeze$e(input) {
156
+ const input_targetSummary = input.targetSummary;
157
+ if (input_targetSummary !== undefined) {
158
+ deepFreeze$f(input_targetSummary);
159
+ }
160
+ ObjectFreeze(input);
161
+ }
162
+
163
+ function validate$e(obj, path = 'ManagedContentTypeSummaryRepresentation') {
164
+ const v_error = (() => {
165
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
166
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
167
+ }
168
+ const obj_fullyQualifiedName = obj.fullyQualifiedName;
169
+ const path_fullyQualifiedName = path + '.fullyQualifiedName';
170
+ if (typeof obj_fullyQualifiedName !== 'string') {
171
+ return new TypeError('Expected "string" but received "' + typeof obj_fullyQualifiedName + '" (at "' + path_fullyQualifiedName + '")');
172
+ }
173
+ if (obj.name !== undefined) {
174
+ const obj_name = obj.name;
175
+ const path_name = path + '.name';
176
+ if (typeof obj_name !== 'string') {
177
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
178
+ }
179
+ }
180
+ })();
181
+ return v_error === undefined ? null : v_error;
182
+ }
183
+ function deepFreeze$d(input) {
184
+ ObjectFreeze(input);
185
+ }
186
+
187
+ function validate$d(obj, path = 'ManagedContentCollectionItemTypeSummaryRepresentation') {
188
+ const v_error = (() => {
189
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
190
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
191
+ }
192
+ const obj_fullyQualifiedName = obj.fullyQualifiedName;
193
+ const path_fullyQualifiedName = path + '.fullyQualifiedName';
194
+ if (typeof obj_fullyQualifiedName !== 'string') {
195
+ return new TypeError('Expected "string" but received "' + typeof obj_fullyQualifiedName + '" (at "' + path_fullyQualifiedName + '")');
196
+ }
197
+ const obj_name = obj.name;
198
+ const path_name = path + '.name';
199
+ if (typeof obj_name !== 'string') {
200
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
201
+ }
202
+ })();
203
+ return v_error === undefined ? null : v_error;
204
+ }
205
+ function deepFreeze$c(input) {
206
+ ObjectFreeze(input);
207
+ }
208
+
209
+ function validate$c(obj, path = 'ManagedContentCollectionItemRepresentation') {
210
+ const v_error = (() => {
211
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
212
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
213
+ }
214
+ const obj_body = obj.body;
215
+ const path_body = path + '.body';
216
+ if (typeof obj_body !== 'object' || ArrayIsArray(obj_body) || obj_body === null) {
217
+ return new TypeError('Expected "object" but received "' + typeof obj_body + '" (at "' + path_body + '")');
218
+ }
219
+ const obj_body_keys = ObjectKeys(obj_body);
220
+ for (let i = 0; i < obj_body_keys.length; i++) {
221
+ const key = obj_body_keys[i];
222
+ const obj_body_prop = obj_body[key];
223
+ const path_body_prop = path_body + '["' + key + '"]';
224
+ if (obj_body_prop === undefined) {
225
+ return new TypeError('Expected "defined" but received "' + typeof obj_body_prop + '" (at "' + path_body_prop + '")');
226
+ }
227
+ }
228
+ const obj_contentType = obj.contentType;
229
+ const path_contentType = path + '.contentType';
230
+ const referencepath_contentTypeValidationError = validate$d(obj_contentType, path_contentType);
231
+ if (referencepath_contentTypeValidationError !== null) {
232
+ let message = 'Object doesn\'t match ManagedContentCollectionItemTypeSummaryRepresentation (at "' + path_contentType + '")\n';
233
+ message += referencepath_contentTypeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
234
+ return new TypeError(message);
235
+ }
236
+ const obj_id = obj.id;
237
+ const path_id = path + '.id';
238
+ if (typeof obj_id !== 'string') {
239
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
240
+ }
241
+ const obj_name = obj.name;
242
+ const path_name = path + '.name';
243
+ if (typeof obj_name !== 'string') {
244
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
245
+ }
246
+ })();
247
+ return v_error === undefined ? null : v_error;
248
+ }
249
+ function deepFreeze$b(input) {
250
+ const input_body = input.body;
251
+ const input_body_keys = Object.keys(input_body);
252
+ const input_body_length = input_body_keys.length;
253
+ for (let i = 0; i < input_body_length; i++) {
254
+ const key = input_body_keys[i];
255
+ const input_body_prop = input_body[key];
256
+ deepFreeze$g(input_body_prop);
257
+ }
258
+ ObjectFreeze(input_body);
259
+ const input_contentType = input.contentType;
260
+ deepFreeze$c(input_contentType);
261
+ ObjectFreeze(input);
262
+ }
263
+
264
+ const TTL$3 = 3600000;
265
+ const VERSION$4 = "f8aeed959e28f0d935539e65aa3e5211";
266
+ function validate$b(obj, path = 'ManagedContentCollectionItemsRepresentation') {
267
+ const v_error = (() => {
268
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
269
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
270
+ }
271
+ const obj_channelInfo = obj.channelInfo;
272
+ const path_channelInfo = path + '.channelInfo';
273
+ const referencepath_channelInfoValidationError = validate$f(obj_channelInfo, path_channelInfo);
274
+ if (referencepath_channelInfoValidationError !== null) {
275
+ let message = 'Object doesn\'t match ManagedContentChannelSummaryRepresentation (at "' + path_channelInfo + '")\n';
276
+ message += referencepath_channelInfoValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
277
+ return new TypeError(message);
278
+ }
279
+ const obj_collectionKey = obj.collectionKey;
280
+ const path_collectionKey = path + '.collectionKey';
281
+ if (typeof obj_collectionKey !== 'string') {
282
+ return new TypeError('Expected "string" but received "' + typeof obj_collectionKey + '" (at "' + path_collectionKey + '")');
283
+ }
284
+ const obj_collectionType = obj.collectionType;
285
+ const path_collectionType = path + '.collectionType';
286
+ const referencepath_collectionTypeValidationError = validate$e(obj_collectionType, path_collectionType);
287
+ if (referencepath_collectionTypeValidationError !== null) {
288
+ let message = 'Object doesn\'t match ManagedContentTypeSummaryRepresentation (at "' + path_collectionType + '")\n';
289
+ message += referencepath_collectionTypeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
290
+ return new TypeError(message);
291
+ }
292
+ const obj_id = obj.id;
293
+ const path_id = path + '.id';
294
+ if (typeof obj_id !== 'string') {
295
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
296
+ }
297
+ const obj_items = obj.items;
298
+ const path_items = path + '.items';
299
+ if (!ArrayIsArray(obj_items)) {
300
+ return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
301
+ }
302
+ for (let i = 0; i < obj_items.length; i++) {
303
+ const obj_items_item = obj_items[i];
304
+ const path_items_item = path_items + '[' + i + ']';
305
+ const referencepath_items_itemValidationError = validate$c(obj_items_item, path_items_item);
306
+ if (referencepath_items_itemValidationError !== null) {
307
+ let message = 'Object doesn\'t match ManagedContentCollectionItemRepresentation (at "' + path_items_item + '")\n';
308
+ message += referencepath_items_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
309
+ return new TypeError(message);
310
+ }
311
+ }
312
+ const obj_language = obj.language;
313
+ const path_language = path + '.language';
314
+ if (typeof obj_language !== 'string') {
315
+ return new TypeError('Expected "string" but received "' + typeof obj_language + '" (at "' + path_language + '")');
316
+ }
317
+ const obj_publishedDate = obj.publishedDate;
318
+ const path_publishedDate = path + '.publishedDate';
319
+ if (typeof obj_publishedDate !== 'string') {
320
+ return new TypeError('Expected "string" but received "' + typeof obj_publishedDate + '" (at "' + path_publishedDate + '")');
321
+ }
322
+ const obj_title = obj.title;
323
+ const path_title = path + '.title';
324
+ if (typeof obj_title !== 'string') {
325
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
326
+ }
327
+ const obj_total = obj.total;
328
+ const path_total = path + '.total';
329
+ if (typeof obj_total !== 'number' || (typeof obj_total === 'number' && Math.floor(obj_total) !== obj_total)) {
330
+ return new TypeError('Expected "integer" but received "' + typeof obj_total + '" (at "' + path_total + '")');
331
+ }
332
+ const obj_urlName = obj.urlName;
333
+ const path_urlName = path + '.urlName';
334
+ if (typeof obj_urlName !== 'string') {
335
+ return new TypeError('Expected "string" but received "' + typeof obj_urlName + '" (at "' + path_urlName + '")');
336
+ }
337
+ })();
338
+ return v_error === undefined ? null : v_error;
339
+ }
340
+ const RepresentationType$4 = 'ManagedContentCollectionItemsRepresentation';
341
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
342
+ return input;
343
+ }
344
+ const select$a = function ManagedContentCollectionItemsRepresentationSelect() {
345
+ return {
346
+ kind: 'Fragment',
347
+ version: VERSION$4,
348
+ private: [],
349
+ opaque: true
350
+ };
351
+ };
352
+ function equals$4(existing, incoming) {
353
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
354
+ return false;
355
+ }
356
+ return true;
357
+ }
358
+ function deepFreeze$a(input) {
359
+ const input_channelInfo = input.channelInfo;
360
+ deepFreeze$e(input_channelInfo);
361
+ const input_collectionType = input.collectionType;
362
+ deepFreeze$d(input_collectionType);
363
+ const input_items = input.items;
364
+ for (let i = 0; i < input_items.length; i++) {
365
+ const input_items_item = input_items[i];
366
+ deepFreeze$b(input_items_item);
367
+ }
368
+ ObjectFreeze(input_items);
369
+ ObjectFreeze(input);
370
+ }
371
+ const ingest$4 = function ManagedContentCollectionItemsRepresentationIngest(input, path, luvio, store, timestamp) {
372
+ if (process.env.NODE_ENV !== 'production') {
373
+ const validateError = validate$b(input);
374
+ if (validateError !== null) {
375
+ throw validateError;
376
+ }
377
+ }
378
+ const key = path.fullPath;
379
+ const existingRecord = store.readEntry(key);
380
+ const ttlToUse = TTL$3;
381
+ let incomingRecord = normalize$4(input, store.readEntry(key), {
382
+ fullPath: key,
383
+ parent: path.parent,
384
+ propertyName: path.propertyName,
385
+ ttl: ttlToUse
386
+ });
387
+ deepFreeze$a(input);
388
+ if (existingRecord === undefined || equals$4(existingRecord, incomingRecord) === false) {
389
+ luvio.storePublish(key, incomingRecord);
390
+ }
391
+ {
392
+ const storeMetadataParams = {
393
+ ttl: ttlToUse,
394
+ namespace: "CMS",
395
+ version: VERSION$4,
396
+ representationName: RepresentationType$4,
397
+ };
398
+ luvio.publishStoreMetadata(key, storeMetadataParams);
399
+ }
400
+ return createLink(key);
401
+ };
402
+ function getTypeCacheKeys$4(luvio, input, fullPathFactory) {
403
+ const rootKeySet = new StoreKeyMap();
404
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
405
+ const rootKey = fullPathFactory();
406
+ rootKeySet.set(rootKey, {
407
+ namespace: keyPrefix,
408
+ representationName: RepresentationType$4,
409
+ mergeable: false
410
+ });
411
+ return rootKeySet;
412
+ }
413
+
414
+ function select$9(luvio, params) {
415
+ return select$a();
416
+ }
417
+ function keyBuilder$b(luvio, params) {
418
+ return keyPrefix + '::ManagedContentCollectionItemsRepresentation:(' + 'language:' + params.queryParams.language + ',' + 'channelId:' + params.urlParams.channelId + ',' + 'collectionKeyOrId:' + params.urlParams.collectionKeyOrId + ')';
419
+ }
420
+ function getResponseCacheKeys$5(luvio, resourceParams, response) {
421
+ return getTypeCacheKeys$4(luvio, response, () => keyBuilder$b(luvio, resourceParams));
422
+ }
423
+ function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
424
+ const { body } = response;
425
+ const key = keyBuilder$b(luvio, resourceParams);
426
+ luvio.storeIngest(key, ingest$4, body);
427
+ const snapshot = luvio.storeLookup({
428
+ recordId: key,
429
+ node: select$9(),
430
+ variables: {},
431
+ }, snapshotRefresh);
432
+ if (process.env.NODE_ENV !== 'production') {
433
+ if (snapshot.state !== 'Fulfilled') {
434
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
435
+ }
436
+ }
437
+ return snapshot;
438
+ }
439
+ function ingestError$5(luvio, params, error, snapshotRefresh) {
440
+ const key = keyBuilder$b(luvio, params);
441
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
442
+ const storeMetadataParams = {
443
+ ttl: TTL$3,
444
+ namespace: keyPrefix,
445
+ version: VERSION$4,
446
+ representationName: RepresentationType$4
447
+ };
448
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
449
+ return errorSnapshot;
450
+ }
451
+ function createResourceRequest$5(config) {
452
+ const headers = {};
453
+ return {
454
+ baseUri: '/services/data/v58.0',
455
+ basePath: '/connect/cms/delivery/channels/' + config.urlParams.channelId + '/collections/' + config.urlParams.collectionKeyOrId + '',
456
+ method: 'get',
457
+ body: null,
458
+ urlParams: config.urlParams,
459
+ queryParams: config.queryParams,
460
+ headers,
461
+ priority: 'normal',
462
+ };
463
+ }
464
+
465
+ function onFetchResponseSuccess$9(luvio, config, resourceParams, response) {
466
+ let updatedResourceParams = resourceParams;
467
+ // If language is not provided in request resource params, use language from the response
468
+ // and update the response params. As this resource params will be used to build a cache key.
469
+ if (updatedResourceParams.queryParams.language === undefined) {
470
+ updatedResourceParams.queryParams.language = response.body.language;
471
+ }
472
+ return onFetchResponseSuccess$8(luvio, config, updatedResourceParams, response);
473
+ }
474
+
475
+ const getCollectionItemsForChannel_ConfigPropertyNames = {
476
+ displayName: 'getCollectionItemsForChannel',
477
+ parameters: {
478
+ required: ['channelId', 'collectionKeyOrId'],
479
+ optional: ['language']
480
+ }
481
+ };
482
+ function createResourceParams$5(config) {
483
+ const resourceParams = {
484
+ urlParams: {
485
+ channelId: config.channelId, collectionKeyOrId: config.collectionKeyOrId
486
+ },
487
+ queryParams: {
488
+ language: config.language
489
+ }
490
+ };
491
+ return resourceParams;
492
+ }
493
+ function keyBuilder$a(luvio, config) {
494
+ const resourceParams = createResourceParams$5(config);
495
+ return keyBuilder$b(luvio, resourceParams);
496
+ }
497
+ function typeCheckConfig$5(untrustedConfig) {
498
+ const config = {};
499
+ const untrustedConfig_channelId = untrustedConfig.channelId;
500
+ if (typeof untrustedConfig_channelId === 'string') {
501
+ config.channelId = untrustedConfig_channelId;
502
+ }
503
+ const untrustedConfig_collectionKeyOrId = untrustedConfig.collectionKeyOrId;
504
+ if (typeof untrustedConfig_collectionKeyOrId === 'string') {
505
+ config.collectionKeyOrId = untrustedConfig_collectionKeyOrId;
506
+ }
507
+ const untrustedConfig_language = untrustedConfig.language;
508
+ if (typeof untrustedConfig_language === 'string') {
509
+ config.language = untrustedConfig_language;
510
+ }
511
+ return config;
512
+ }
513
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
514
+ if (!untrustedIsObject(untrustedConfig)) {
515
+ return null;
516
+ }
517
+ if (process.env.NODE_ENV !== 'production') {
518
+ validateConfig(untrustedConfig, configPropertyNames);
519
+ }
520
+ const config = typeCheckConfig$5(untrustedConfig);
521
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
522
+ return null;
523
+ }
524
+ return config;
525
+ }
526
+ function adapterFragment$5(luvio, config) {
527
+ createResourceParams$5(config);
528
+ return select$9();
529
+ }
530
+ function onFetchResponseSuccess$8(luvio, config, resourceParams, response) {
531
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
532
+ config,
533
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
534
+ });
535
+ return luvio.storeBroadcast().then(() => snapshot);
536
+ }
537
+ function onFetchResponseError$5(luvio, config, resourceParams, response) {
538
+ const snapshot = ingestError$5(luvio, resourceParams, response, {
539
+ config,
540
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
541
+ });
542
+ return luvio.storeBroadcast().then(() => snapshot);
543
+ }
544
+ function buildNetworkSnapshot$5(luvio, config, options) {
545
+ const resourceParams = createResourceParams$5(config);
546
+ const request = createResourceRequest$5(resourceParams);
547
+ return luvio.dispatchResourceRequest(request, options)
548
+ .then((response) => {
549
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$9(luvio, config, resourceParams, response), () => getResponseCacheKeys$5(luvio, resourceParams, response.body));
550
+ }, (response) => {
551
+ return luvio.handleErrorResponse(() => onFetchResponseError$5(luvio, config, resourceParams, response));
552
+ });
553
+ }
554
+ function buildNetworkSnapshotCachePolicy$5(context, coercedAdapterRequestContext) {
555
+ const { luvio, config } = context;
556
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
557
+ const dispatchOptions = {
558
+ resourceRequestContext: {
559
+ requestCorrelator,
560
+ luvioRequestMethod: undefined,
561
+ },
562
+ eventObservers
563
+ };
564
+ if (networkPriority !== 'normal') {
565
+ dispatchOptions.overrides = {
566
+ priority: networkPriority
567
+ };
568
+ }
569
+ return buildNetworkSnapshot$5(luvio, config, dispatchOptions);
570
+ }
571
+ function buildCachedSnapshotCachePolicy$5(context, storeLookup) {
572
+ const { luvio, config } = context;
573
+ const selector = {
574
+ recordId: keyBuilder$a(luvio, config),
575
+ node: adapterFragment$5(luvio, config),
576
+ variables: {},
577
+ };
578
+ const cacheSnapshot = storeLookup(selector, {
579
+ config,
580
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
581
+ });
582
+ return cacheSnapshot;
583
+ }
584
+ const getCollectionItemsForChannelAdapterFactory = (luvio) => function CMS__getCollectionItemsForChannel(untrustedConfig, requestContext) {
585
+ const config = validateAdapterConfig$5(untrustedConfig, getCollectionItemsForChannel_ConfigPropertyNames);
586
+ // Invalid or incomplete config
587
+ if (config === null) {
588
+ return null;
589
+ }
590
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
591
+ buildCachedSnapshotCachePolicy$5, buildNetworkSnapshotCachePolicy$5);
592
+ };
593
+
594
+ function select$8(luvio, params) {
595
+ return select$a();
596
+ }
597
+ function keyBuilder$9(luvio, params) {
598
+ return keyPrefix + '::ManagedContentCollectionItemsRepresentation:(' + 'language:' + params.queryParams.language + ',' + 'collectionKeyOrId:' + params.urlParams.collectionKeyOrId + ',' + 'siteId:' + params.urlParams.siteId + ')';
599
+ }
600
+ function getResponseCacheKeys$4(luvio, resourceParams, response) {
601
+ return getTypeCacheKeys$4(luvio, response, () => keyBuilder$9(luvio, resourceParams));
602
+ }
603
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
604
+ const { body } = response;
605
+ const key = keyBuilder$9(luvio, resourceParams);
606
+ luvio.storeIngest(key, ingest$4, body);
607
+ const snapshot = luvio.storeLookup({
608
+ recordId: key,
609
+ node: select$8(),
610
+ variables: {},
611
+ }, snapshotRefresh);
612
+ if (process.env.NODE_ENV !== 'production') {
613
+ if (snapshot.state !== 'Fulfilled') {
614
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
615
+ }
616
+ }
617
+ return snapshot;
618
+ }
619
+ function ingestError$4(luvio, params, error, snapshotRefresh) {
620
+ const key = keyBuilder$9(luvio, params);
621
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
622
+ const storeMetadataParams = {
623
+ ttl: TTL$3,
624
+ namespace: keyPrefix,
625
+ version: VERSION$4,
626
+ representationName: RepresentationType$4
627
+ };
628
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
629
+ return errorSnapshot;
630
+ }
631
+ function createResourceRequest$4(config) {
632
+ const headers = {};
633
+ return {
634
+ baseUri: '/services/data/v58.0',
635
+ basePath: '/connect/sites/' + config.urlParams.siteId + '/cms/delivery/collections/' + config.urlParams.collectionKeyOrId + '',
636
+ method: 'get',
637
+ body: null,
638
+ urlParams: config.urlParams,
639
+ queryParams: config.queryParams,
640
+ headers,
641
+ priority: 'normal',
642
+ };
643
+ }
644
+
645
+ function onFetchResponseSuccess$7(luvio, config, resourceParams, response) {
646
+ let updatedResourceParams = resourceParams;
647
+ // If language is not provided in request resource params, use language from the response
648
+ // and update the response params. As this resource params will be used to build a cache key.
649
+ if (updatedResourceParams.queryParams.language === undefined) {
650
+ updatedResourceParams.queryParams.language = response.body.language;
651
+ }
652
+ return onFetchResponseSuccess$6(luvio, config, updatedResourceParams, response);
653
+ }
654
+
655
+ const getCollectionItemsForSite_ConfigPropertyNames = {
656
+ displayName: 'getCollectionItemsForSite',
657
+ parameters: {
658
+ required: ['collectionKeyOrId', 'siteId'],
659
+ optional: ['language']
660
+ }
661
+ };
662
+ function createResourceParams$4(config) {
663
+ const resourceParams = {
664
+ urlParams: {
665
+ collectionKeyOrId: config.collectionKeyOrId, siteId: config.siteId
666
+ },
667
+ queryParams: {
668
+ language: config.language
669
+ }
670
+ };
671
+ return resourceParams;
672
+ }
673
+ function keyBuilder$8(luvio, config) {
674
+ const resourceParams = createResourceParams$4(config);
675
+ return keyBuilder$9(luvio, resourceParams);
676
+ }
677
+ function typeCheckConfig$4(untrustedConfig) {
678
+ const config = {};
679
+ const untrustedConfig_collectionKeyOrId = untrustedConfig.collectionKeyOrId;
680
+ if (typeof untrustedConfig_collectionKeyOrId === 'string') {
681
+ config.collectionKeyOrId = untrustedConfig_collectionKeyOrId;
682
+ }
683
+ const untrustedConfig_siteId = untrustedConfig.siteId;
684
+ if (typeof untrustedConfig_siteId === 'string') {
685
+ config.siteId = untrustedConfig_siteId;
686
+ }
687
+ const untrustedConfig_language = untrustedConfig.language;
688
+ if (typeof untrustedConfig_language === 'string') {
689
+ config.language = untrustedConfig_language;
690
+ }
691
+ return config;
692
+ }
693
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
694
+ if (!untrustedIsObject(untrustedConfig)) {
695
+ return null;
696
+ }
697
+ if (process.env.NODE_ENV !== 'production') {
698
+ validateConfig(untrustedConfig, configPropertyNames);
699
+ }
700
+ const config = typeCheckConfig$4(untrustedConfig);
701
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
702
+ return null;
703
+ }
704
+ return config;
705
+ }
706
+ function adapterFragment$4(luvio, config) {
707
+ createResourceParams$4(config);
708
+ return select$8();
709
+ }
710
+ function onFetchResponseSuccess$6(luvio, config, resourceParams, response) {
711
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
712
+ config,
713
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
714
+ });
715
+ return luvio.storeBroadcast().then(() => snapshot);
716
+ }
717
+ function onFetchResponseError$4(luvio, config, resourceParams, response) {
718
+ const snapshot = ingestError$4(luvio, resourceParams, response, {
719
+ config,
720
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
721
+ });
722
+ return luvio.storeBroadcast().then(() => snapshot);
723
+ }
724
+ function buildNetworkSnapshot$4(luvio, config, options) {
725
+ const resourceParams = createResourceParams$4(config);
726
+ const request = createResourceRequest$4(resourceParams);
727
+ return luvio.dispatchResourceRequest(request, options)
728
+ .then((response) => {
729
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$7(luvio, config, resourceParams, response), () => getResponseCacheKeys$4(luvio, resourceParams, response.body));
730
+ }, (response) => {
731
+ return luvio.handleErrorResponse(() => onFetchResponseError$4(luvio, config, resourceParams, response));
732
+ });
733
+ }
734
+ function buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext) {
735
+ const { luvio, config } = context;
736
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
737
+ const dispatchOptions = {
738
+ resourceRequestContext: {
739
+ requestCorrelator,
740
+ luvioRequestMethod: undefined,
741
+ },
742
+ eventObservers
743
+ };
744
+ if (networkPriority !== 'normal') {
745
+ dispatchOptions.overrides = {
746
+ priority: networkPriority
747
+ };
748
+ }
749
+ return buildNetworkSnapshot$4(luvio, config, dispatchOptions);
750
+ }
751
+ function buildCachedSnapshotCachePolicy$4(context, storeLookup) {
752
+ const { luvio, config } = context;
753
+ const selector = {
754
+ recordId: keyBuilder$8(luvio, config),
755
+ node: adapterFragment$4(luvio, config),
756
+ variables: {},
757
+ };
758
+ const cacheSnapshot = storeLookup(selector, {
759
+ config,
760
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
761
+ });
762
+ return cacheSnapshot;
763
+ }
764
+ const getCollectionItemsForSiteAdapterFactory = (luvio) => function CMS__getCollectionItemsForSite(untrustedConfig, requestContext) {
765
+ const config = validateAdapterConfig$4(untrustedConfig, getCollectionItemsForSite_ConfigPropertyNames);
766
+ // Invalid or incomplete config
767
+ if (config === null) {
768
+ return null;
769
+ }
770
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
771
+ buildCachedSnapshotCachePolicy$4, buildNetworkSnapshotCachePolicy$4);
772
+ };
773
+
774
+ const TTL$2 = 3600000;
775
+ const VERSION$3 = "181754fe91f1eab67546c9f961cedb5f";
776
+ function validate$a(obj, path = 'ManagedContentCollectionMetadataRepresentation') {
777
+ const v_error = (() => {
778
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
779
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
780
+ }
781
+ const obj_channelInfo = obj.channelInfo;
782
+ const path_channelInfo = path + '.channelInfo';
783
+ const referencepath_channelInfoValidationError = validate$f(obj_channelInfo, path_channelInfo);
784
+ if (referencepath_channelInfoValidationError !== null) {
785
+ let message = 'Object doesn\'t match ManagedContentChannelSummaryRepresentation (at "' + path_channelInfo + '")\n';
786
+ message += referencepath_channelInfoValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
787
+ return new TypeError(message);
788
+ }
789
+ const obj_collectionKey = obj.collectionKey;
790
+ const path_collectionKey = path + '.collectionKey';
791
+ if (typeof obj_collectionKey !== 'string') {
792
+ return new TypeError('Expected "string" but received "' + typeof obj_collectionKey + '" (at "' + path_collectionKey + '")');
793
+ }
794
+ const obj_collectionMetadata = obj.collectionMetadata;
795
+ const path_collectionMetadata = path + '.collectionMetadata';
796
+ if (typeof obj_collectionMetadata !== 'object' || ArrayIsArray(obj_collectionMetadata) || obj_collectionMetadata === null) {
797
+ return new TypeError('Expected "object" but received "' + typeof obj_collectionMetadata + '" (at "' + path_collectionMetadata + '")');
798
+ }
799
+ const obj_collectionMetadata_keys = ObjectKeys(obj_collectionMetadata);
800
+ for (let i = 0; i < obj_collectionMetadata_keys.length; i++) {
801
+ const key = obj_collectionMetadata_keys[i];
802
+ const obj_collectionMetadata_prop = obj_collectionMetadata[key];
803
+ const path_collectionMetadata_prop = path_collectionMetadata + '["' + key + '"]';
804
+ if (obj_collectionMetadata_prop === undefined) {
805
+ return new TypeError('Expected "defined" but received "' + typeof obj_collectionMetadata_prop + '" (at "' + path_collectionMetadata_prop + '")');
806
+ }
807
+ }
808
+ const obj_collectionType = obj.collectionType;
809
+ const path_collectionType = path + '.collectionType';
810
+ const referencepath_collectionTypeValidationError = validate$e(obj_collectionType, path_collectionType);
811
+ if (referencepath_collectionTypeValidationError !== null) {
812
+ let message = 'Object doesn\'t match ManagedContentTypeSummaryRepresentation (at "' + path_collectionType + '")\n';
813
+ message += referencepath_collectionTypeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
814
+ return new TypeError(message);
815
+ }
816
+ const obj_id = obj.id;
817
+ const path_id = path + '.id';
818
+ if (typeof obj_id !== 'string') {
819
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
820
+ }
821
+ const obj_language = obj.language;
822
+ const path_language = path + '.language';
823
+ if (typeof obj_language !== 'string') {
824
+ return new TypeError('Expected "string" but received "' + typeof obj_language + '" (at "' + path_language + '")');
825
+ }
826
+ const obj_publishedDate = obj.publishedDate;
827
+ const path_publishedDate = path + '.publishedDate';
828
+ if (typeof obj_publishedDate !== 'string') {
829
+ return new TypeError('Expected "string" but received "' + typeof obj_publishedDate + '" (at "' + path_publishedDate + '")');
830
+ }
831
+ const obj_schema = obj.schema;
832
+ const path_schema = path + '.schema';
833
+ if (typeof obj_schema !== 'object' || ArrayIsArray(obj_schema) || obj_schema === null) {
834
+ return new TypeError('Expected "object" but received "' + typeof obj_schema + '" (at "' + path_schema + '")');
835
+ }
836
+ const obj_schema_keys = ObjectKeys(obj_schema);
837
+ for (let i = 0; i < obj_schema_keys.length; i++) {
838
+ const key = obj_schema_keys[i];
839
+ const obj_schema_prop = obj_schema[key];
840
+ const path_schema_prop = path_schema + '["' + key + '"]';
841
+ if (obj_schema_prop === undefined) {
842
+ return new TypeError('Expected "defined" but received "' + typeof obj_schema_prop + '" (at "' + path_schema_prop + '")');
843
+ }
844
+ }
845
+ const obj_title = obj.title;
846
+ const path_title = path + '.title';
847
+ if (typeof obj_title !== 'string') {
848
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
849
+ }
850
+ const obj_urlName = obj.urlName;
851
+ const path_urlName = path + '.urlName';
852
+ if (typeof obj_urlName !== 'string') {
853
+ return new TypeError('Expected "string" but received "' + typeof obj_urlName + '" (at "' + path_urlName + '")');
854
+ }
855
+ })();
856
+ return v_error === undefined ? null : v_error;
857
+ }
858
+ const RepresentationType$3 = 'ManagedContentCollectionMetadataRepresentation';
859
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
860
+ return input;
861
+ }
862
+ const select$7 = function ManagedContentCollectionMetadataRepresentationSelect() {
863
+ return {
864
+ kind: 'Fragment',
865
+ version: VERSION$3,
866
+ private: [],
867
+ opaque: true
868
+ };
869
+ };
870
+ function equals$3(existing, incoming) {
871
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
872
+ return false;
873
+ }
874
+ return true;
875
+ }
876
+ function deepFreeze$9(input) {
877
+ const input_channelInfo = input.channelInfo;
878
+ deepFreeze$e(input_channelInfo);
879
+ const input_collectionMetadata = input.collectionMetadata;
880
+ const input_collectionMetadata_keys = Object.keys(input_collectionMetadata);
881
+ const input_collectionMetadata_length = input_collectionMetadata_keys.length;
882
+ for (let i = 0; i < input_collectionMetadata_length; i++) {
883
+ const key = input_collectionMetadata_keys[i];
884
+ const input_collectionMetadata_prop = input_collectionMetadata[key];
885
+ deepFreeze$g(input_collectionMetadata_prop);
886
+ }
887
+ ObjectFreeze(input_collectionMetadata);
888
+ const input_collectionType = input.collectionType;
889
+ deepFreeze$d(input_collectionType);
890
+ const input_schema = input.schema;
891
+ const input_schema_keys = Object.keys(input_schema);
892
+ const input_schema_length = input_schema_keys.length;
893
+ for (let i = 0; i < input_schema_length; i++) {
894
+ const key = input_schema_keys[i];
895
+ const input_schema_prop = input_schema[key];
896
+ deepFreeze$g(input_schema_prop);
897
+ }
898
+ ObjectFreeze(input_schema);
899
+ ObjectFreeze(input);
900
+ }
901
+ const ingest$3 = function ManagedContentCollectionMetadataRepresentationIngest(input, path, luvio, store, timestamp) {
902
+ if (process.env.NODE_ENV !== 'production') {
903
+ const validateError = validate$a(input);
904
+ if (validateError !== null) {
905
+ throw validateError;
906
+ }
907
+ }
908
+ const key = path.fullPath;
909
+ const existingRecord = store.readEntry(key);
910
+ const ttlToUse = TTL$2;
911
+ let incomingRecord = normalize$3(input, store.readEntry(key), {
912
+ fullPath: key,
913
+ parent: path.parent,
914
+ propertyName: path.propertyName,
915
+ ttl: ttlToUse
916
+ });
917
+ deepFreeze$9(input);
918
+ if (existingRecord === undefined || equals$3(existingRecord, incomingRecord) === false) {
919
+ luvio.storePublish(key, incomingRecord);
920
+ }
921
+ {
922
+ const storeMetadataParams = {
923
+ ttl: ttlToUse,
924
+ namespace: "CMS",
925
+ version: VERSION$3,
926
+ representationName: RepresentationType$3,
927
+ };
928
+ luvio.publishStoreMetadata(key, storeMetadataParams);
929
+ }
930
+ return createLink(key);
931
+ };
932
+ function getTypeCacheKeys$3(luvio, input, fullPathFactory) {
933
+ const rootKeySet = new StoreKeyMap();
934
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
935
+ const rootKey = fullPathFactory();
936
+ rootKeySet.set(rootKey, {
937
+ namespace: keyPrefix,
938
+ representationName: RepresentationType$3,
939
+ mergeable: false
940
+ });
941
+ return rootKeySet;
942
+ }
943
+
944
+ function select$6(luvio, params) {
945
+ return select$7();
946
+ }
947
+ function keyBuilder$7(luvio, params) {
948
+ return keyPrefix + '::ManagedContentCollectionMetadataRepresentation:(' + 'expandMetadata:' + params.queryParams.expandMetadata + ',' + 'language:' + params.queryParams.language + ',' + 'channelId:' + params.urlParams.channelId + ',' + 'collectionKeyOrId:' + params.urlParams.collectionKeyOrId + ')';
949
+ }
950
+ function getResponseCacheKeys$3(luvio, resourceParams, response) {
951
+ return getTypeCacheKeys$3(luvio, response, () => keyBuilder$7(luvio, resourceParams));
952
+ }
953
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
954
+ const { body } = response;
955
+ const key = keyBuilder$7(luvio, resourceParams);
956
+ luvio.storeIngest(key, ingest$3, body);
957
+ const snapshot = luvio.storeLookup({
958
+ recordId: key,
959
+ node: select$6(),
960
+ variables: {},
961
+ }, snapshotRefresh);
962
+ if (process.env.NODE_ENV !== 'production') {
963
+ if (snapshot.state !== 'Fulfilled') {
964
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
965
+ }
966
+ }
967
+ return snapshot;
968
+ }
969
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
970
+ const key = keyBuilder$7(luvio, params);
971
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
972
+ const storeMetadataParams = {
973
+ ttl: TTL$2,
974
+ namespace: keyPrefix,
975
+ version: VERSION$3,
976
+ representationName: RepresentationType$3
977
+ };
978
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
979
+ return errorSnapshot;
980
+ }
981
+ function createResourceRequest$3(config) {
982
+ const headers = {};
983
+ return {
984
+ baseUri: '/services/data/v58.0',
985
+ basePath: '/connect/cms/delivery/channels/' + config.urlParams.channelId + '/collections/' + config.urlParams.collectionKeyOrId + '/metadata',
986
+ method: 'get',
987
+ body: null,
988
+ urlParams: config.urlParams,
989
+ queryParams: config.queryParams,
990
+ headers,
991
+ priority: 'normal',
992
+ };
993
+ }
994
+
995
+ function onFetchResponseSuccess$5(luvio, config, resourceParams, response) {
996
+ let updatedResourceParams = resourceParams;
997
+ // If language is not provided in request resource params, use language from the response
998
+ // and update the response params. As this resource params will be used to build a cache key.
999
+ if (updatedResourceParams.queryParams.language === undefined) {
1000
+ updatedResourceParams.queryParams.language = response.body.language;
1001
+ }
1002
+ return onFetchResponseSuccess$4(luvio, config, updatedResourceParams, response);
1003
+ }
1004
+
1005
+ const getCollectionMetadataForChannel_ConfigPropertyNames = {
1006
+ displayName: 'getCollectionMetadataForChannel',
1007
+ parameters: {
1008
+ required: ['channelId', 'collectionKeyOrId'],
1009
+ optional: ['expandMetadata', 'language']
1010
+ }
1011
+ };
1012
+ function createResourceParams$3(config) {
1013
+ const resourceParams = {
1014
+ urlParams: {
1015
+ channelId: config.channelId, collectionKeyOrId: config.collectionKeyOrId
1016
+ },
1017
+ queryParams: {
1018
+ expandMetadata: config.expandMetadata, language: config.language
1019
+ }
1020
+ };
1021
+ return resourceParams;
1022
+ }
1023
+ function keyBuilder$6(luvio, config) {
1024
+ const resourceParams = createResourceParams$3(config);
1025
+ return keyBuilder$7(luvio, resourceParams);
1026
+ }
1027
+ function typeCheckConfig$3(untrustedConfig) {
1028
+ const config = {};
1029
+ const untrustedConfig_channelId = untrustedConfig.channelId;
1030
+ if (typeof untrustedConfig_channelId === 'string') {
1031
+ config.channelId = untrustedConfig_channelId;
1032
+ }
1033
+ const untrustedConfig_collectionKeyOrId = untrustedConfig.collectionKeyOrId;
1034
+ if (typeof untrustedConfig_collectionKeyOrId === 'string') {
1035
+ config.collectionKeyOrId = untrustedConfig_collectionKeyOrId;
1036
+ }
1037
+ const untrustedConfig_expandMetadata = untrustedConfig.expandMetadata;
1038
+ if (typeof untrustedConfig_expandMetadata === 'boolean') {
1039
+ config.expandMetadata = untrustedConfig_expandMetadata;
1040
+ }
1041
+ const untrustedConfig_language = untrustedConfig.language;
1042
+ if (typeof untrustedConfig_language === 'string') {
1043
+ config.language = untrustedConfig_language;
1044
+ }
1045
+ return config;
1046
+ }
1047
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1048
+ if (!untrustedIsObject(untrustedConfig)) {
1049
+ return null;
1050
+ }
1051
+ if (process.env.NODE_ENV !== 'production') {
1052
+ validateConfig(untrustedConfig, configPropertyNames);
1053
+ }
1054
+ const config = typeCheckConfig$3(untrustedConfig);
1055
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1056
+ return null;
1057
+ }
1058
+ return config;
1059
+ }
1060
+ function adapterFragment$3(luvio, config) {
1061
+ createResourceParams$3(config);
1062
+ return select$6();
1063
+ }
1064
+ function onFetchResponseSuccess$4(luvio, config, resourceParams, response) {
1065
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
1066
+ config,
1067
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1068
+ });
1069
+ return luvio.storeBroadcast().then(() => snapshot);
1070
+ }
1071
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
1072
+ const snapshot = ingestError$3(luvio, resourceParams, response, {
1073
+ config,
1074
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1075
+ });
1076
+ return luvio.storeBroadcast().then(() => snapshot);
1077
+ }
1078
+ function buildNetworkSnapshot$3(luvio, config, options) {
1079
+ const resourceParams = createResourceParams$3(config);
1080
+ const request = createResourceRequest$3(resourceParams);
1081
+ return luvio.dispatchResourceRequest(request, options)
1082
+ .then((response) => {
1083
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$5(luvio, config, resourceParams, response), () => getResponseCacheKeys$3(luvio, resourceParams, response.body));
1084
+ }, (response) => {
1085
+ return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
1086
+ });
1087
+ }
1088
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
1089
+ const { luvio, config } = context;
1090
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1091
+ const dispatchOptions = {
1092
+ resourceRequestContext: {
1093
+ requestCorrelator,
1094
+ luvioRequestMethod: undefined,
1095
+ },
1096
+ eventObservers
1097
+ };
1098
+ if (networkPriority !== 'normal') {
1099
+ dispatchOptions.overrides = {
1100
+ priority: networkPriority
1101
+ };
1102
+ }
1103
+ return buildNetworkSnapshot$3(luvio, config, dispatchOptions);
1104
+ }
1105
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
1106
+ const { luvio, config } = context;
1107
+ const selector = {
1108
+ recordId: keyBuilder$6(luvio, config),
1109
+ node: adapterFragment$3(luvio, config),
1110
+ variables: {},
1111
+ };
1112
+ const cacheSnapshot = storeLookup(selector, {
1113
+ config,
1114
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
1115
+ });
1116
+ return cacheSnapshot;
1117
+ }
1118
+ const getCollectionMetadataForChannelAdapterFactory = (luvio) => function CMS__getCollectionMetadataForChannel(untrustedConfig, requestContext) {
1119
+ const config = validateAdapterConfig$3(untrustedConfig, getCollectionMetadataForChannel_ConfigPropertyNames);
1120
+ // Invalid or incomplete config
1121
+ if (config === null) {
1122
+ return null;
1123
+ }
1124
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1125
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
1126
+ };
1127
+
1128
+ function select$5(luvio, params) {
1129
+ return select$7();
1130
+ }
1131
+ function keyBuilder$5(luvio, params) {
1132
+ return keyPrefix + '::ManagedContentCollectionMetadataRepresentation:(' + 'expandMetadata:' + params.queryParams.expandMetadata + ',' + 'language:' + params.queryParams.language + ',' + 'collectionKeyOrId:' + params.urlParams.collectionKeyOrId + ',' + 'siteId:' + params.urlParams.siteId + ')';
1133
+ }
1134
+ function getResponseCacheKeys$2(luvio, resourceParams, response) {
1135
+ return getTypeCacheKeys$3(luvio, response, () => keyBuilder$5(luvio, resourceParams));
1136
+ }
1137
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
1138
+ const { body } = response;
1139
+ const key = keyBuilder$5(luvio, resourceParams);
1140
+ luvio.storeIngest(key, ingest$3, body);
1141
+ const snapshot = luvio.storeLookup({
1142
+ recordId: key,
1143
+ node: select$5(),
1144
+ variables: {},
1145
+ }, snapshotRefresh);
1146
+ if (process.env.NODE_ENV !== 'production') {
1147
+ if (snapshot.state !== 'Fulfilled') {
1148
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1149
+ }
1150
+ }
1151
+ return snapshot;
1152
+ }
1153
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
1154
+ const key = keyBuilder$5(luvio, params);
1155
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1156
+ const storeMetadataParams = {
1157
+ ttl: TTL$2,
1158
+ namespace: keyPrefix,
1159
+ version: VERSION$3,
1160
+ representationName: RepresentationType$3
1161
+ };
1162
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1163
+ return errorSnapshot;
1164
+ }
1165
+ function createResourceRequest$2(config) {
1166
+ const headers = {};
1167
+ return {
1168
+ baseUri: '/services/data/v58.0',
1169
+ basePath: '/connect/sites/' + config.urlParams.siteId + '/cms/delivery/collections/' + config.urlParams.collectionKeyOrId + '/metadata',
1170
+ method: 'get',
1171
+ body: null,
1172
+ urlParams: config.urlParams,
1173
+ queryParams: config.queryParams,
1174
+ headers,
1175
+ priority: 'normal',
1176
+ };
1177
+ }
1178
+
1179
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
1180
+ let updatedResourceParams = resourceParams;
1181
+ // If language is not provided in request resource params, use language from the response
1182
+ // and update the response params. As this resource params will be used to build a cache key.
1183
+ if (updatedResourceParams.queryParams.language === undefined) {
1184
+ updatedResourceParams.queryParams.language = response.body.language;
1185
+ }
1186
+ return onFetchResponseSuccess$2(luvio, config, updatedResourceParams, response);
1187
+ }
1188
+
1189
+ const getCollectionMetadataForSite_ConfigPropertyNames = {
1190
+ displayName: 'getCollectionMetadataForSite',
1191
+ parameters: {
1192
+ required: ['collectionKeyOrId', 'siteId'],
1193
+ optional: ['expandMetadata', 'language']
1194
+ }
1195
+ };
1196
+ function createResourceParams$2(config) {
1197
+ const resourceParams = {
1198
+ urlParams: {
1199
+ collectionKeyOrId: config.collectionKeyOrId, siteId: config.siteId
1200
+ },
1201
+ queryParams: {
1202
+ expandMetadata: config.expandMetadata, language: config.language
1203
+ }
1204
+ };
1205
+ return resourceParams;
1206
+ }
1207
+ function keyBuilder$4(luvio, config) {
1208
+ const resourceParams = createResourceParams$2(config);
1209
+ return keyBuilder$5(luvio, resourceParams);
1210
+ }
1211
+ function typeCheckConfig$2(untrustedConfig) {
1212
+ const config = {};
1213
+ const untrustedConfig_collectionKeyOrId = untrustedConfig.collectionKeyOrId;
1214
+ if (typeof untrustedConfig_collectionKeyOrId === 'string') {
1215
+ config.collectionKeyOrId = untrustedConfig_collectionKeyOrId;
1216
+ }
1217
+ const untrustedConfig_siteId = untrustedConfig.siteId;
1218
+ if (typeof untrustedConfig_siteId === 'string') {
1219
+ config.siteId = untrustedConfig_siteId;
1220
+ }
1221
+ const untrustedConfig_expandMetadata = untrustedConfig.expandMetadata;
1222
+ if (typeof untrustedConfig_expandMetadata === 'boolean') {
1223
+ config.expandMetadata = untrustedConfig_expandMetadata;
1224
+ }
1225
+ const untrustedConfig_language = untrustedConfig.language;
1226
+ if (typeof untrustedConfig_language === 'string') {
1227
+ config.language = untrustedConfig_language;
1228
+ }
1229
+ return config;
1230
+ }
1231
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1232
+ if (!untrustedIsObject(untrustedConfig)) {
1233
+ return null;
1234
+ }
1235
+ if (process.env.NODE_ENV !== 'production') {
1236
+ validateConfig(untrustedConfig, configPropertyNames);
1237
+ }
1238
+ const config = typeCheckConfig$2(untrustedConfig);
1239
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1240
+ return null;
1241
+ }
1242
+ return config;
1243
+ }
1244
+ function adapterFragment$2(luvio, config) {
1245
+ createResourceParams$2(config);
1246
+ return select$5();
1247
+ }
1248
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
1249
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
1250
+ config,
1251
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1252
+ });
1253
+ return luvio.storeBroadcast().then(() => snapshot);
1254
+ }
1255
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
1256
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
1257
+ config,
1258
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1259
+ });
1260
+ return luvio.storeBroadcast().then(() => snapshot);
1261
+ }
1262
+ function buildNetworkSnapshot$2(luvio, config, options) {
1263
+ const resourceParams = createResourceParams$2(config);
1264
+ const request = createResourceRequest$2(resourceParams);
1265
+ return luvio.dispatchResourceRequest(request, options)
1266
+ .then((response) => {
1267
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => getResponseCacheKeys$2(luvio, resourceParams, response.body));
1268
+ }, (response) => {
1269
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
1270
+ });
1271
+ }
1272
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
1273
+ const { luvio, config } = context;
1274
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1275
+ const dispatchOptions = {
1276
+ resourceRequestContext: {
1277
+ requestCorrelator,
1278
+ luvioRequestMethod: undefined,
1279
+ },
1280
+ eventObservers
1281
+ };
1282
+ if (networkPriority !== 'normal') {
1283
+ dispatchOptions.overrides = {
1284
+ priority: networkPriority
1285
+ };
1286
+ }
1287
+ return buildNetworkSnapshot$2(luvio, config, dispatchOptions);
1288
+ }
1289
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
1290
+ const { luvio, config } = context;
1291
+ const selector = {
1292
+ recordId: keyBuilder$4(luvio, config),
1293
+ node: adapterFragment$2(luvio, config),
1294
+ variables: {},
1295
+ };
1296
+ const cacheSnapshot = storeLookup(selector, {
1297
+ config,
1298
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
1299
+ });
1300
+ return cacheSnapshot;
1301
+ }
1302
+ const getCollectionMetadataForSiteAdapterFactory = (luvio) => function CMS__getCollectionMetadataForSite(untrustedConfig, requestContext) {
1303
+ const config = validateAdapterConfig$2(untrustedConfig, getCollectionMetadataForSite_ConfigPropertyNames);
1304
+ // Invalid or incomplete config
1305
+ if (config === null) {
1306
+ return null;
1307
+ }
1308
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1309
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
1310
+ };
1311
+
1312
+ function validate$9(obj, path = 'TopicSummaryRepresentation') {
1313
+ const v_error = (() => {
1314
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1315
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1316
+ }
1317
+ const obj_id = obj.id;
1318
+ const path_id = path + '.id';
1319
+ if (typeof obj_id !== 'string') {
1320
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1321
+ }
1322
+ const obj_name = obj.name;
1323
+ const path_name = path + '.name';
1324
+ if (typeof obj_name !== 'string') {
1325
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1326
+ }
1327
+ })();
1328
+ return v_error === undefined ? null : v_error;
1329
+ }
1330
+ function deepFreeze$8(input) {
1331
+ ObjectFreeze(input);
1332
+ }
1333
+
1334
+ function validate$8(obj, path = 'ManagedContentAssociationsRepresentation') {
1335
+ const v_error = (() => {
1336
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1337
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1338
+ }
1339
+ const obj_topics = obj.topics;
1340
+ const path_topics = path + '.topics';
1341
+ if (!ArrayIsArray(obj_topics)) {
1342
+ return new TypeError('Expected "array" but received "' + typeof obj_topics + '" (at "' + path_topics + '")');
1343
+ }
1344
+ for (let i = 0; i < obj_topics.length; i++) {
1345
+ const obj_topics_item = obj_topics[i];
1346
+ const path_topics_item = path_topics + '[' + i + ']';
1347
+ const referencepath_topics_itemValidationError = validate$9(obj_topics_item, path_topics_item);
1348
+ if (referencepath_topics_itemValidationError !== null) {
1349
+ let message = 'Object doesn\'t match TopicSummaryRepresentation (at "' + path_topics_item + '")\n';
1350
+ message += referencepath_topics_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1351
+ return new TypeError(message);
1352
+ }
1353
+ }
1354
+ })();
1355
+ return v_error === undefined ? null : v_error;
1356
+ }
1357
+ function deepFreeze$7(input) {
1358
+ const input_topics = input.topics;
1359
+ for (let i = 0; i < input_topics.length; i++) {
1360
+ const input_topics_item = input_topics[i];
1361
+ deepFreeze$8(input_topics_item);
1362
+ }
1363
+ ObjectFreeze(input_topics);
1364
+ ObjectFreeze(input);
1365
+ }
1366
+
1367
+ var DiscriminatorValues;
1368
+ (function (DiscriminatorValues) {
1369
+ DiscriminatorValues["Date"] = "Date";
1370
+ DiscriminatorValues["Text"] = "Text";
1371
+ })(DiscriminatorValues || (DiscriminatorValues = {}));
1372
+ function validate$7(obj, path = 'ManagedContentNodeValueRepresentation') {
1373
+ const v_error = (() => {
1374
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1375
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1376
+ }
1377
+ const obj_nodeType = obj.nodeType;
1378
+ const path_nodeType = path + '.nodeType';
1379
+ if (typeof obj_nodeType !== 'string') {
1380
+ return new TypeError('Expected "string" but received "' + typeof obj_nodeType + '" (at "' + path_nodeType + '")');
1381
+ }
1382
+ })();
1383
+ return v_error === undefined ? null : v_error;
1384
+ }
1385
+ function deepFreeze$6(input) {
1386
+ ObjectFreeze(input);
1387
+ }
1388
+
1389
+ function validate$6(obj, path = 'ManagedContentVersionRepresentation') {
1390
+ const v_error = (() => {
1391
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1392
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1393
+ }
1394
+ if (obj.associations !== undefined) {
1395
+ const obj_associations = obj.associations;
1396
+ const path_associations = path + '.associations';
1397
+ const referencepath_associationsValidationError = validate$8(obj_associations, path_associations);
1398
+ if (referencepath_associationsValidationError !== null) {
1399
+ let message = 'Object doesn\'t match ManagedContentAssociationsRepresentation (at "' + path_associations + '")\n';
1400
+ message += referencepath_associationsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1401
+ return new TypeError(message);
1402
+ }
1403
+ }
1404
+ const obj_contentKey = obj.contentKey;
1405
+ const path_contentKey = path + '.contentKey';
1406
+ if (typeof obj_contentKey !== 'string') {
1407
+ return new TypeError('Expected "string" but received "' + typeof obj_contentKey + '" (at "' + path_contentKey + '")');
1408
+ }
1409
+ const obj_contentNodes = obj.contentNodes;
1410
+ const path_contentNodes = path + '.contentNodes';
1411
+ if (typeof obj_contentNodes !== 'object' || ArrayIsArray(obj_contentNodes) || obj_contentNodes === null) {
1412
+ return new TypeError('Expected "object" but received "' + typeof obj_contentNodes + '" (at "' + path_contentNodes + '")');
1413
+ }
1414
+ const obj_contentNodes_keys = ObjectKeys(obj_contentNodes);
1415
+ for (let i = 0; i < obj_contentNodes_keys.length; i++) {
1416
+ const key = obj_contentNodes_keys[i];
1417
+ const obj_contentNodes_prop = obj_contentNodes[key];
1418
+ const path_contentNodes_prop = path_contentNodes + '["' + key + '"]';
1419
+ const referencepath_contentNodes_propValidationError = validate$7(obj_contentNodes_prop, path_contentNodes_prop);
1420
+ if (referencepath_contentNodes_propValidationError !== null) {
1421
+ let message = 'Object doesn\'t match ManagedContentNodeValueRepresentation (at "' + path_contentNodes_prop + '")\n';
1422
+ message += referencepath_contentNodes_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1423
+ return new TypeError(message);
1424
+ }
1425
+ }
1426
+ const obj_contentUrlName = obj.contentUrlName;
1427
+ const path_contentUrlName = path + '.contentUrlName';
1428
+ if (typeof obj_contentUrlName !== 'string') {
1429
+ return new TypeError('Expected "string" but received "' + typeof obj_contentUrlName + '" (at "' + path_contentUrlName + '")');
1430
+ }
1431
+ const obj_language = obj.language;
1432
+ const path_language = path + '.language';
1433
+ if (typeof obj_language !== 'string') {
1434
+ return new TypeError('Expected "string" but received "' + typeof obj_language + '" (at "' + path_language + '")');
1435
+ }
1436
+ const obj_managedContentId = obj.managedContentId;
1437
+ const path_managedContentId = path + '.managedContentId';
1438
+ if (typeof obj_managedContentId !== 'string') {
1439
+ return new TypeError('Expected "string" but received "' + typeof obj_managedContentId + '" (at "' + path_managedContentId + '")');
1440
+ }
1441
+ const obj_publishedDate = obj.publishedDate;
1442
+ const path_publishedDate = path + '.publishedDate';
1443
+ if (typeof obj_publishedDate !== 'string') {
1444
+ return new TypeError('Expected "string" but received "' + typeof obj_publishedDate + '" (at "' + path_publishedDate + '")');
1445
+ }
1446
+ const obj_title = obj.title;
1447
+ const path_title = path + '.title';
1448
+ if (typeof obj_title !== 'string') {
1449
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
1450
+ }
1451
+ const obj_type = obj.type;
1452
+ const path_type = path + '.type';
1453
+ if (typeof obj_type !== 'string') {
1454
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
1455
+ }
1456
+ const obj_typeLabel = obj.typeLabel;
1457
+ const path_typeLabel = path + '.typeLabel';
1458
+ if (typeof obj_typeLabel !== 'string') {
1459
+ return new TypeError('Expected "string" but received "' + typeof obj_typeLabel + '" (at "' + path_typeLabel + '")');
1460
+ }
1461
+ const obj_unauthenticatedUrl = obj.unauthenticatedUrl;
1462
+ const path_unauthenticatedUrl = path + '.unauthenticatedUrl';
1463
+ let obj_unauthenticatedUrl_union0 = null;
1464
+ const obj_unauthenticatedUrl_union0_error = (() => {
1465
+ if (typeof obj_unauthenticatedUrl !== 'string') {
1466
+ return new TypeError('Expected "string" but received "' + typeof obj_unauthenticatedUrl + '" (at "' + path_unauthenticatedUrl + '")');
1467
+ }
1468
+ })();
1469
+ if (obj_unauthenticatedUrl_union0_error != null) {
1470
+ obj_unauthenticatedUrl_union0 = obj_unauthenticatedUrl_union0_error.message;
1471
+ }
1472
+ let obj_unauthenticatedUrl_union1 = null;
1473
+ const obj_unauthenticatedUrl_union1_error = (() => {
1474
+ if (obj_unauthenticatedUrl !== null) {
1475
+ return new TypeError('Expected "null" but received "' + typeof obj_unauthenticatedUrl + '" (at "' + path_unauthenticatedUrl + '")');
1476
+ }
1477
+ })();
1478
+ if (obj_unauthenticatedUrl_union1_error != null) {
1479
+ obj_unauthenticatedUrl_union1 = obj_unauthenticatedUrl_union1_error.message;
1480
+ }
1481
+ if (obj_unauthenticatedUrl_union0 && obj_unauthenticatedUrl_union1) {
1482
+ let message = 'Object doesn\'t match union (at "' + path_unauthenticatedUrl + '")';
1483
+ message += '\n' + obj_unauthenticatedUrl_union0.split('\n').map((line) => '\t' + line).join('\n');
1484
+ message += '\n' + obj_unauthenticatedUrl_union1.split('\n').map((line) => '\t' + line).join('\n');
1485
+ return new TypeError(message);
1486
+ }
1487
+ })();
1488
+ return v_error === undefined ? null : v_error;
1489
+ }
1490
+ function deepFreeze$5(input) {
1491
+ const input_associations = input.associations;
1492
+ if (input_associations !== undefined) {
1493
+ deepFreeze$7(input_associations);
1494
+ }
1495
+ const input_contentNodes = input.contentNodes;
1496
+ const input_contentNodes_keys = Object.keys(input_contentNodes);
1497
+ const input_contentNodes_length = input_contentNodes_keys.length;
1498
+ for (let i = 0; i < input_contentNodes_length; i++) {
1499
+ const key = input_contentNodes_keys[i];
1500
+ const input_contentNodes_prop = input_contentNodes[key];
1501
+ deepFreeze$6(input_contentNodes_prop);
1502
+ }
1503
+ ObjectFreeze(input_contentNodes);
1504
+ ObjectFreeze(input);
1505
+ }
1506
+
1507
+ function validate$5(obj, path = 'ManagedContentNodeTypeRepresentation') {
1508
+ const v_error = (() => {
1509
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1510
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1511
+ }
1512
+ const obj_label = obj.label;
1513
+ const path_label = path + '.label';
1514
+ if (typeof obj_label !== 'string') {
1515
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
1516
+ }
1517
+ const obj_name = obj.name;
1518
+ const path_name = path + '.name';
1519
+ if (typeof obj_name !== 'string') {
1520
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1521
+ }
1522
+ const obj_nodeType = obj.nodeType;
1523
+ const path_nodeType = path + '.nodeType';
1524
+ if (typeof obj_nodeType !== 'string') {
1525
+ return new TypeError('Expected "string" but received "' + typeof obj_nodeType + '" (at "' + path_nodeType + '")');
1526
+ }
1527
+ })();
1528
+ return v_error === undefined ? null : v_error;
1529
+ }
1530
+ function deepFreeze$4(input) {
1531
+ ObjectFreeze(input);
1532
+ }
1533
+
1534
+ function validate$4(obj, path = 'ManagedContentTypeRepresentation') {
1535
+ const v_error = (() => {
1536
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1537
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1538
+ }
1539
+ const obj_label = obj.label;
1540
+ const path_label = path + '.label';
1541
+ if (typeof obj_label !== 'string') {
1542
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
1543
+ }
1544
+ const obj_name = obj.name;
1545
+ const path_name = path + '.name';
1546
+ if (typeof obj_name !== 'string') {
1547
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
1548
+ }
1549
+ const obj_nodeTypes = obj.nodeTypes;
1550
+ const path_nodeTypes = path + '.nodeTypes';
1551
+ if (typeof obj_nodeTypes !== 'object' || ArrayIsArray(obj_nodeTypes) || obj_nodeTypes === null) {
1552
+ return new TypeError('Expected "object" but received "' + typeof obj_nodeTypes + '" (at "' + path_nodeTypes + '")');
1553
+ }
1554
+ const obj_nodeTypes_keys = ObjectKeys(obj_nodeTypes);
1555
+ for (let i = 0; i < obj_nodeTypes_keys.length; i++) {
1556
+ const key = obj_nodeTypes_keys[i];
1557
+ const obj_nodeTypes_prop = obj_nodeTypes[key];
1558
+ const path_nodeTypes_prop = path_nodeTypes + '["' + key + '"]';
1559
+ const referencepath_nodeTypes_propValidationError = validate$5(obj_nodeTypes_prop, path_nodeTypes_prop);
1560
+ if (referencepath_nodeTypes_propValidationError !== null) {
1561
+ let message = 'Object doesn\'t match ManagedContentNodeTypeRepresentation (at "' + path_nodeTypes_prop + '")\n';
1562
+ message += referencepath_nodeTypes_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1563
+ return new TypeError(message);
1564
+ }
1565
+ }
1566
+ })();
1567
+ return v_error === undefined ? null : v_error;
1568
+ }
1569
+ function deepFreeze$3(input) {
1570
+ const input_nodeTypes = input.nodeTypes;
1571
+ const input_nodeTypes_keys = Object.keys(input_nodeTypes);
1572
+ const input_nodeTypes_length = input_nodeTypes_keys.length;
1573
+ for (let i = 0; i < input_nodeTypes_length; i++) {
1574
+ const key = input_nodeTypes_keys[i];
1575
+ const input_nodeTypes_prop = input_nodeTypes[key];
1576
+ deepFreeze$4(input_nodeTypes_prop);
1577
+ }
1578
+ ObjectFreeze(input_nodeTypes);
1579
+ ObjectFreeze(input);
1580
+ }
1581
+
1582
+ const TTL$1 = 3600000;
1583
+ const VERSION$2 = "5ee006120d0880559392ef3c5fdc2a52";
1584
+ function validate$3(obj, path = 'ManagedContentVersionCollectionRepresentation') {
1585
+ const v_error = (() => {
1586
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1587
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1588
+ }
1589
+ const obj_currentPageUrl = obj.currentPageUrl;
1590
+ const path_currentPageUrl = path + '.currentPageUrl';
1591
+ if (typeof obj_currentPageUrl !== 'string') {
1592
+ return new TypeError('Expected "string" but received "' + typeof obj_currentPageUrl + '" (at "' + path_currentPageUrl + '")');
1593
+ }
1594
+ const obj_items = obj.items;
1595
+ const path_items = path + '.items';
1596
+ if (!ArrayIsArray(obj_items)) {
1597
+ return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
1598
+ }
1599
+ for (let i = 0; i < obj_items.length; i++) {
1600
+ const obj_items_item = obj_items[i];
1601
+ const path_items_item = path_items + '[' + i + ']';
1602
+ const referencepath_items_itemValidationError = validate$6(obj_items_item, path_items_item);
1603
+ if (referencepath_items_itemValidationError !== null) {
1604
+ let message = 'Object doesn\'t match ManagedContentVersionRepresentation (at "' + path_items_item + '")\n';
1605
+ message += referencepath_items_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1606
+ return new TypeError(message);
1607
+ }
1608
+ }
1609
+ if (obj.managedContentTypes !== undefined) {
1610
+ const obj_managedContentTypes = obj.managedContentTypes;
1611
+ const path_managedContentTypes = path + '.managedContentTypes';
1612
+ if (typeof obj_managedContentTypes !== 'object' || ArrayIsArray(obj_managedContentTypes) || obj_managedContentTypes === null) {
1613
+ return new TypeError('Expected "object" but received "' + typeof obj_managedContentTypes + '" (at "' + path_managedContentTypes + '")');
1614
+ }
1615
+ const obj_managedContentTypes_keys = ObjectKeys(obj_managedContentTypes);
1616
+ for (let i = 0; i < obj_managedContentTypes_keys.length; i++) {
1617
+ const key = obj_managedContentTypes_keys[i];
1618
+ const obj_managedContentTypes_prop = obj_managedContentTypes[key];
1619
+ const path_managedContentTypes_prop = path_managedContentTypes + '["' + key + '"]';
1620
+ const referencepath_managedContentTypes_propValidationError = validate$4(obj_managedContentTypes_prop, path_managedContentTypes_prop);
1621
+ if (referencepath_managedContentTypes_propValidationError !== null) {
1622
+ let message = 'Object doesn\'t match ManagedContentTypeRepresentation (at "' + path_managedContentTypes_prop + '")\n';
1623
+ message += referencepath_managedContentTypes_propValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1624
+ return new TypeError(message);
1625
+ }
1626
+ }
1627
+ }
1628
+ if (obj.nextPageUrl !== undefined) {
1629
+ const obj_nextPageUrl = obj.nextPageUrl;
1630
+ const path_nextPageUrl = path + '.nextPageUrl';
1631
+ if (typeof obj_nextPageUrl !== 'string') {
1632
+ return new TypeError('Expected "string" but received "' + typeof obj_nextPageUrl + '" (at "' + path_nextPageUrl + '")');
1633
+ }
1634
+ }
1635
+ const obj_total = obj.total;
1636
+ const path_total = path + '.total';
1637
+ if (typeof obj_total !== 'number' || (typeof obj_total === 'number' && Math.floor(obj_total) !== obj_total)) {
1638
+ return new TypeError('Expected "integer" but received "' + typeof obj_total + '" (at "' + path_total + '")');
1639
+ }
1640
+ const obj_totalTypes = obj.totalTypes;
1641
+ const path_totalTypes = path + '.totalTypes';
1642
+ if (typeof obj_totalTypes !== 'number' || (typeof obj_totalTypes === 'number' && Math.floor(obj_totalTypes) !== obj_totalTypes)) {
1643
+ return new TypeError('Expected "integer" but received "' + typeof obj_totalTypes + '" (at "' + path_totalTypes + '")');
1644
+ }
1645
+ })();
1646
+ return v_error === undefined ? null : v_error;
1647
+ }
1648
+ const RepresentationType$2 = 'ManagedContentVersionCollectionRepresentation';
1649
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
1650
+ return input;
1651
+ }
1652
+ const select$4 = function ManagedContentVersionCollectionRepresentationSelect() {
1653
+ return {
1654
+ kind: 'Fragment',
1655
+ version: VERSION$2,
1656
+ private: [],
1657
+ opaque: true
1658
+ };
1659
+ };
1660
+ function equals$2(existing, incoming) {
1661
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
1662
+ return false;
1663
+ }
1664
+ return true;
1665
+ }
1666
+ function deepFreeze$2(input) {
1667
+ const input_items = input.items;
1668
+ for (let i = 0; i < input_items.length; i++) {
1669
+ const input_items_item = input_items[i];
1670
+ deepFreeze$5(input_items_item);
1671
+ }
1672
+ ObjectFreeze(input_items);
1673
+ const input_managedContentTypes = input.managedContentTypes;
1674
+ if (input_managedContentTypes !== undefined) {
1675
+ const input_managedContentTypes_keys = Object.keys(input_managedContentTypes);
1676
+ const input_managedContentTypes_length = input_managedContentTypes_keys.length;
1677
+ for (let i = 0; i < input_managedContentTypes_length; i++) {
1678
+ const key = input_managedContentTypes_keys[i];
1679
+ const input_managedContentTypes_prop = input_managedContentTypes[key];
1680
+ deepFreeze$3(input_managedContentTypes_prop);
1681
+ }
1682
+ ObjectFreeze(input_managedContentTypes);
1683
+ }
1684
+ ObjectFreeze(input);
1685
+ }
1686
+ const ingest$2 = function ManagedContentVersionCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
1687
+ if (process.env.NODE_ENV !== 'production') {
1688
+ const validateError = validate$3(input);
1689
+ if (validateError !== null) {
1690
+ throw validateError;
1691
+ }
1692
+ }
1693
+ const key = path.fullPath;
1694
+ const existingRecord = store.readEntry(key);
1695
+ const ttlToUse = TTL$1;
1696
+ let incomingRecord = normalize$2(input, store.readEntry(key), {
1697
+ fullPath: key,
1698
+ parent: path.parent,
1699
+ propertyName: path.propertyName,
1700
+ ttl: ttlToUse
1701
+ });
1702
+ deepFreeze$2(input);
1703
+ if (existingRecord === undefined || equals$2(existingRecord, incomingRecord) === false) {
1704
+ luvio.storePublish(key, incomingRecord);
1705
+ }
1706
+ {
1707
+ const storeMetadataParams = {
1708
+ ttl: ttlToUse,
1709
+ namespace: "CMS",
1710
+ version: VERSION$2,
1711
+ representationName: RepresentationType$2,
1712
+ };
1713
+ luvio.publishStoreMetadata(key, storeMetadataParams);
1714
+ }
1715
+ return createLink(key);
1716
+ };
1717
+ function getTypeCacheKeys$2(luvio, input, fullPathFactory) {
1718
+ const rootKeySet = new StoreKeyMap();
1719
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1720
+ const rootKey = fullPathFactory();
1721
+ rootKeySet.set(rootKey, {
1722
+ namespace: keyPrefix,
1723
+ representationName: RepresentationType$2,
1724
+ mergeable: false
1725
+ });
1726
+ return rootKeySet;
1727
+ }
1728
+
1729
+ function select$3(luvio, params) {
1730
+ return select$4();
1731
+ }
1732
+ function keyBuilder$3(luvio, params) {
1733
+ return keyPrefix + '::ManagedContentVersionCollectionRepresentation:(' + 'contentKeys:' + params.queryParams.contentKeys + ',' + 'language:' + params.queryParams.language + ',' + 'managedContentIds:' + params.queryParams.managedContentIds + ',' + 'managedContentType:' + params.queryParams.managedContentType + ',' + 'page:' + params.queryParams.page + ',' + 'pageSize:' + params.queryParams.pageSize + ',' + 'showAbsoluteUrl:' + params.queryParams.showAbsoluteUrl + ',' + 'topics:' + params.queryParams.topics + ',' + 'communityId:' + params.urlParams.communityId + ')';
1734
+ }
1735
+ function getResponseCacheKeys$1(luvio, resourceParams, response) {
1736
+ return getTypeCacheKeys$2(luvio, response, () => keyBuilder$3(luvio, resourceParams));
1737
+ }
1738
+ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1739
+ const { body } = response;
1740
+ const key = keyBuilder$3(luvio, resourceParams);
1741
+ luvio.storeIngest(key, ingest$2, body);
1742
+ const snapshot = luvio.storeLookup({
1743
+ recordId: key,
1744
+ node: select$3(),
1745
+ variables: {},
1746
+ }, snapshotRefresh);
1747
+ if (process.env.NODE_ENV !== 'production') {
1748
+ if (snapshot.state !== 'Fulfilled') {
1749
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1750
+ }
1751
+ }
1752
+ return snapshot;
1753
+ }
1754
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
1755
+ const key = keyBuilder$3(luvio, params);
1756
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1757
+ const storeMetadataParams = {
1758
+ ttl: TTL$1,
1759
+ namespace: keyPrefix,
1760
+ version: VERSION$2,
1761
+ representationName: RepresentationType$2
1762
+ };
1763
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
1764
+ return errorSnapshot;
1765
+ }
1766
+ function createResourceRequest$1(config) {
1767
+ const headers = {};
1768
+ return {
1769
+ baseUri: '/services/data/v58.0',
1770
+ basePath: '/connect/communities/' + config.urlParams.communityId + '/managed-content/delivery',
1771
+ method: 'get',
1772
+ body: null,
1773
+ urlParams: config.urlParams,
1774
+ queryParams: config.queryParams,
1775
+ headers,
1776
+ priority: 'normal',
1777
+ };
1778
+ }
1779
+
1780
+ const listContent_ConfigPropertyNames = {
1781
+ displayName: 'listContent',
1782
+ parameters: {
1783
+ required: ['communityId'],
1784
+ optional: ['contentKeys', 'language', 'managedContentIds', 'managedContentType', 'page', 'pageSize', 'showAbsoluteUrl', 'topics']
1785
+ }
1786
+ };
1787
+ function createResourceParams$1(config) {
1788
+ const resourceParams = {
1789
+ urlParams: {
1790
+ communityId: config.communityId
1791
+ },
1792
+ queryParams: {
1793
+ contentKeys: config.contentKeys, language: config.language, managedContentIds: config.managedContentIds, managedContentType: config.managedContentType, page: config.page, pageSize: config.pageSize, showAbsoluteUrl: config.showAbsoluteUrl, topics: config.topics
1794
+ }
1795
+ };
1796
+ return resourceParams;
1797
+ }
1798
+ function keyBuilder$2(luvio, config) {
1799
+ const resourceParams = createResourceParams$1(config);
1800
+ return keyBuilder$3(luvio, resourceParams);
1801
+ }
1802
+ function typeCheckConfig$1(untrustedConfig) {
1803
+ const config = {};
1804
+ const untrustedConfig_communityId = untrustedConfig.communityId;
1805
+ if (typeof untrustedConfig_communityId === 'string') {
1806
+ config.communityId = untrustedConfig_communityId;
1807
+ }
1808
+ const untrustedConfig_contentKeys = untrustedConfig.contentKeys;
1809
+ if (ArrayIsArray$1(untrustedConfig_contentKeys)) {
1810
+ const untrustedConfig_contentKeys_array = [];
1811
+ for (let i = 0, arrayLength = untrustedConfig_contentKeys.length; i < arrayLength; i++) {
1812
+ const untrustedConfig_contentKeys_item = untrustedConfig_contentKeys[i];
1813
+ if (typeof untrustedConfig_contentKeys_item === 'string') {
1814
+ untrustedConfig_contentKeys_array.push(untrustedConfig_contentKeys_item);
1815
+ }
1816
+ }
1817
+ config.contentKeys = untrustedConfig_contentKeys_array;
1818
+ }
1819
+ const untrustedConfig_language = untrustedConfig.language;
1820
+ if (typeof untrustedConfig_language === 'string') {
1821
+ config.language = untrustedConfig_language;
1822
+ }
1823
+ const untrustedConfig_managedContentIds = untrustedConfig.managedContentIds;
1824
+ if (ArrayIsArray$1(untrustedConfig_managedContentIds)) {
1825
+ const untrustedConfig_managedContentIds_array = [];
1826
+ for (let i = 0, arrayLength = untrustedConfig_managedContentIds.length; i < arrayLength; i++) {
1827
+ const untrustedConfig_managedContentIds_item = untrustedConfig_managedContentIds[i];
1828
+ if (typeof untrustedConfig_managedContentIds_item === 'string') {
1829
+ untrustedConfig_managedContentIds_array.push(untrustedConfig_managedContentIds_item);
1830
+ }
1831
+ }
1832
+ config.managedContentIds = untrustedConfig_managedContentIds_array;
1833
+ }
1834
+ const untrustedConfig_managedContentType = untrustedConfig.managedContentType;
1835
+ if (typeof untrustedConfig_managedContentType === 'string') {
1836
+ config.managedContentType = untrustedConfig_managedContentType;
1837
+ }
1838
+ const untrustedConfig_page = untrustedConfig.page;
1839
+ if (typeof untrustedConfig_page === 'number' && Math.floor(untrustedConfig_page) === untrustedConfig_page) {
1840
+ config.page = untrustedConfig_page;
1841
+ }
1842
+ const untrustedConfig_pageSize = untrustedConfig.pageSize;
1843
+ if (typeof untrustedConfig_pageSize === 'number' && Math.floor(untrustedConfig_pageSize) === untrustedConfig_pageSize) {
1844
+ config.pageSize = untrustedConfig_pageSize;
1845
+ }
1846
+ const untrustedConfig_showAbsoluteUrl = untrustedConfig.showAbsoluteUrl;
1847
+ if (typeof untrustedConfig_showAbsoluteUrl === 'boolean') {
1848
+ config.showAbsoluteUrl = untrustedConfig_showAbsoluteUrl;
1849
+ }
1850
+ const untrustedConfig_topics = untrustedConfig.topics;
1851
+ if (ArrayIsArray$1(untrustedConfig_topics)) {
1852
+ const untrustedConfig_topics_array = [];
1853
+ for (let i = 0, arrayLength = untrustedConfig_topics.length; i < arrayLength; i++) {
1854
+ const untrustedConfig_topics_item = untrustedConfig_topics[i];
1855
+ if (typeof untrustedConfig_topics_item === 'string') {
1856
+ untrustedConfig_topics_array.push(untrustedConfig_topics_item);
1857
+ }
1858
+ }
1859
+ config.topics = untrustedConfig_topics_array;
1860
+ }
1861
+ return config;
1862
+ }
1863
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1864
+ if (!untrustedIsObject(untrustedConfig)) {
1865
+ return null;
1866
+ }
1867
+ if (process.env.NODE_ENV !== 'production') {
1868
+ validateConfig(untrustedConfig, configPropertyNames);
1869
+ }
1870
+ const config = typeCheckConfig$1(untrustedConfig);
1871
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1872
+ return null;
1873
+ }
1874
+ return config;
1875
+ }
1876
+ function adapterFragment$1(luvio, config) {
1877
+ createResourceParams$1(config);
1878
+ return select$3();
1879
+ }
1880
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
1881
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
1882
+ config,
1883
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1884
+ });
1885
+ return luvio.storeBroadcast().then(() => snapshot);
1886
+ }
1887
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
1888
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
1889
+ config,
1890
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1891
+ });
1892
+ return luvio.storeBroadcast().then(() => snapshot);
1893
+ }
1894
+ function buildNetworkSnapshot$1(luvio, config, options) {
1895
+ const resourceParams = createResourceParams$1(config);
1896
+ const request = createResourceRequest$1(resourceParams);
1897
+ return luvio.dispatchResourceRequest(request, options)
1898
+ .then((response) => {
1899
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => getResponseCacheKeys$1(luvio, resourceParams, response.body));
1900
+ }, (response) => {
1901
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
1902
+ });
1903
+ }
1904
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
1905
+ const { luvio, config } = context;
1906
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
1907
+ const dispatchOptions = {
1908
+ resourceRequestContext: {
1909
+ requestCorrelator,
1910
+ luvioRequestMethod: undefined,
1911
+ },
1912
+ eventObservers
1913
+ };
1914
+ if (networkPriority !== 'normal') {
1915
+ dispatchOptions.overrides = {
1916
+ priority: networkPriority
1917
+ };
1918
+ }
1919
+ return buildNetworkSnapshot$1(luvio, config, dispatchOptions);
1920
+ }
1921
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
1922
+ const { luvio, config } = context;
1923
+ const selector = {
1924
+ recordId: keyBuilder$2(luvio, config),
1925
+ node: adapterFragment$1(luvio, config),
1926
+ variables: {},
1927
+ };
1928
+ const cacheSnapshot = storeLookup(selector, {
1929
+ config,
1930
+ resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
1931
+ });
1932
+ return cacheSnapshot;
1933
+ }
1934
+ const listContentAdapterFactory = (luvio) => function CMS__listContent(untrustedConfig, requestContext) {
1935
+ const config = validateAdapterConfig$1(untrustedConfig, listContent_ConfigPropertyNames);
1936
+ // Invalid or incomplete config
1937
+ if (config === null) {
1938
+ return null;
1939
+ }
1940
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
1941
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
1942
+ };
1943
+
1944
+ function validate$2(obj, path = 'ReferenceRepresentation') {
1945
+ const v_error = (() => {
1946
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1947
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1948
+ }
1949
+ const obj_id = obj.id;
1950
+ const path_id = path + '.id';
1951
+ if (typeof obj_id !== 'string') {
1952
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1953
+ }
1954
+ const obj_url = obj.url;
1955
+ const path_url = path + '.url';
1956
+ if (typeof obj_url !== 'string') {
1957
+ return new TypeError('Expected "string" but received "' + typeof obj_url + '" (at "' + path_url + '")');
1958
+ }
1959
+ })();
1960
+ return v_error === undefined ? null : v_error;
1961
+ }
1962
+ function deepFreeze$1(input) {
1963
+ ObjectFreeze(input);
1964
+ }
1965
+
1966
+ const TTL = 3600000;
1967
+ const VERSION$1 = "ce50e14585c86e6b3e7d029adbe702cc";
1968
+ function validate$1(obj, path = 'ManagedContentVersionInternalRepresentation') {
1969
+ const v_error = (() => {
1970
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1971
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1972
+ }
1973
+ const obj_associations = obj.associations;
1974
+ const path_associations = path + '.associations';
1975
+ const referencepath_associationsValidationError = validate$8(obj_associations, path_associations);
1976
+ if (referencepath_associationsValidationError !== null) {
1977
+ let message = 'Object doesn\'t match ManagedContentAssociationsRepresentation (at "' + path_associations + '")\n';
1978
+ message += referencepath_associationsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1979
+ return new TypeError(message);
1980
+ }
1981
+ const obj_authoredManagedContentId = obj.authoredManagedContentId;
1982
+ const path_authoredManagedContentId = path + '.authoredManagedContentId';
1983
+ if (typeof obj_authoredManagedContentId !== 'string') {
1984
+ return new TypeError('Expected "string" but received "' + typeof obj_authoredManagedContentId + '" (at "' + path_authoredManagedContentId + '")');
1985
+ }
1986
+ const obj_body = obj.body;
1987
+ const path_body = path + '.body';
1988
+ if (typeof obj_body !== 'object' || ArrayIsArray(obj_body) || obj_body === null) {
1989
+ return new TypeError('Expected "object" but received "' + typeof obj_body + '" (at "' + path_body + '")');
1990
+ }
1991
+ const obj_body_keys = ObjectKeys(obj_body);
1992
+ for (let i = 0; i < obj_body_keys.length; i++) {
1993
+ const key = obj_body_keys[i];
1994
+ const obj_body_prop = obj_body[key];
1995
+ const path_body_prop = path_body + '["' + key + '"]';
1996
+ if (obj_body_prop === undefined) {
1997
+ return new TypeError('Expected "defined" but received "' + typeof obj_body_prop + '" (at "' + path_body_prop + '")');
1998
+ }
1999
+ }
2000
+ const obj_contentKey = obj.contentKey;
2001
+ const path_contentKey = path + '.contentKey';
2002
+ if (typeof obj_contentKey !== 'string') {
2003
+ return new TypeError('Expected "string" but received "' + typeof obj_contentKey + '" (at "' + path_contentKey + '")');
2004
+ }
2005
+ const obj_createdByReference = obj.createdByReference;
2006
+ const path_createdByReference = path + '.createdByReference';
2007
+ const referencepath_createdByReferenceValidationError = validate$2(obj_createdByReference, path_createdByReference);
2008
+ if (referencepath_createdByReferenceValidationError !== null) {
2009
+ let message = 'Object doesn\'t match ReferenceRepresentation (at "' + path_createdByReference + '")\n';
2010
+ message += referencepath_createdByReferenceValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2011
+ return new TypeError(message);
2012
+ }
2013
+ const obj_createdDate = obj.createdDate;
2014
+ const path_createdDate = path + '.createdDate';
2015
+ if (typeof obj_createdDate !== 'string') {
2016
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
2017
+ }
2018
+ const obj_id = obj.id;
2019
+ const path_id = path + '.id';
2020
+ if (typeof obj_id !== 'string') {
2021
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
2022
+ }
2023
+ const obj_lastUpdatedByReference = obj.lastUpdatedByReference;
2024
+ const path_lastUpdatedByReference = path + '.lastUpdatedByReference';
2025
+ const referencepath_lastUpdatedByReferenceValidationError = validate$2(obj_lastUpdatedByReference, path_lastUpdatedByReference);
2026
+ if (referencepath_lastUpdatedByReferenceValidationError !== null) {
2027
+ let message = 'Object doesn\'t match ReferenceRepresentation (at "' + path_lastUpdatedByReference + '")\n';
2028
+ message += referencepath_lastUpdatedByReferenceValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2029
+ return new TypeError(message);
2030
+ }
2031
+ const obj_managedContentId = obj.managedContentId;
2032
+ const path_managedContentId = path + '.managedContentId';
2033
+ if (typeof obj_managedContentId !== 'string') {
2034
+ return new TypeError('Expected "string" but received "' + typeof obj_managedContentId + '" (at "' + path_managedContentId + '")');
2035
+ }
2036
+ const obj_masterLanguage = obj.masterLanguage;
2037
+ const path_masterLanguage = path + '.masterLanguage';
2038
+ if (typeof obj_masterLanguage !== 'string') {
2039
+ return new TypeError('Expected "string" but received "' + typeof obj_masterLanguage + '" (at "' + path_masterLanguage + '")');
2040
+ }
2041
+ const obj_publishDate = obj.publishDate;
2042
+ const path_publishDate = path + '.publishDate';
2043
+ if (typeof obj_publishDate !== 'string') {
2044
+ return new TypeError('Expected "string" but received "' + typeof obj_publishDate + '" (at "' + path_publishDate + '")');
2045
+ }
2046
+ const obj_status = obj.status;
2047
+ const path_status = path + '.status';
2048
+ if (typeof obj_status !== 'string') {
2049
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
2050
+ }
2051
+ const obj_title = obj.title;
2052
+ const path_title = path + '.title';
2053
+ if (typeof obj_title !== 'string') {
2054
+ return new TypeError('Expected "string" but received "' + typeof obj_title + '" (at "' + path_title + '")');
2055
+ }
2056
+ const obj_type = obj.type;
2057
+ const path_type = path + '.type';
2058
+ if (typeof obj_type !== 'string') {
2059
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
2060
+ }
2061
+ const obj_typeLabel = obj.typeLabel;
2062
+ const path_typeLabel = path + '.typeLabel';
2063
+ if (typeof obj_typeLabel !== 'string') {
2064
+ return new TypeError('Expected "string" but received "' + typeof obj_typeLabel + '" (at "' + path_typeLabel + '")');
2065
+ }
2066
+ const obj_updatedDate = obj.updatedDate;
2067
+ const path_updatedDate = path + '.updatedDate';
2068
+ if (typeof obj_updatedDate !== 'string') {
2069
+ return new TypeError('Expected "string" but received "' + typeof obj_updatedDate + '" (at "' + path_updatedDate + '")');
2070
+ }
2071
+ const obj_urlName = obj.urlName;
2072
+ const path_urlName = path + '.urlName';
2073
+ if (typeof obj_urlName !== 'string') {
2074
+ return new TypeError('Expected "string" but received "' + typeof obj_urlName + '" (at "' + path_urlName + '")');
2075
+ }
2076
+ })();
2077
+ return v_error === undefined ? null : v_error;
2078
+ }
2079
+ const RepresentationType$1 = 'ManagedContentVersionInternalRepresentation';
2080
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
2081
+ return input;
2082
+ }
2083
+ const select$2 = function ManagedContentVersionInternalRepresentationSelect() {
2084
+ return {
2085
+ kind: 'Fragment',
2086
+ version: VERSION$1,
2087
+ private: [],
2088
+ opaque: true
2089
+ };
2090
+ };
2091
+ function equals$1(existing, incoming) {
2092
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
2093
+ return false;
2094
+ }
2095
+ return true;
2096
+ }
2097
+ function deepFreeze(input) {
2098
+ const input_associations = input.associations;
2099
+ deepFreeze$7(input_associations);
2100
+ const input_body = input.body;
2101
+ const input_body_keys = Object.keys(input_body);
2102
+ const input_body_length = input_body_keys.length;
2103
+ for (let i = 0; i < input_body_length; i++) {
2104
+ const key = input_body_keys[i];
2105
+ const input_body_prop = input_body[key];
2106
+ deepFreeze$g(input_body_prop);
2107
+ }
2108
+ ObjectFreeze(input_body);
2109
+ const input_createdByReference = input.createdByReference;
2110
+ deepFreeze$1(input_createdByReference);
2111
+ const input_lastUpdatedByReference = input.lastUpdatedByReference;
2112
+ deepFreeze$1(input_lastUpdatedByReference);
2113
+ ObjectFreeze(input);
2114
+ }
2115
+ const ingest$1 = function ManagedContentVersionInternalRepresentationIngest(input, path, luvio, store, timestamp) {
2116
+ if (process.env.NODE_ENV !== 'production') {
2117
+ const validateError = validate$1(input);
2118
+ if (validateError !== null) {
2119
+ throw validateError;
2120
+ }
2121
+ }
2122
+ const key = path.fullPath;
2123
+ const existingRecord = store.readEntry(key);
2124
+ const ttlToUse = TTL;
2125
+ let incomingRecord = normalize$1(input, store.readEntry(key), {
2126
+ fullPath: key,
2127
+ parent: path.parent,
2128
+ propertyName: path.propertyName,
2129
+ ttl: ttlToUse
2130
+ });
2131
+ deepFreeze(input);
2132
+ if (existingRecord === undefined || equals$1(existingRecord, incomingRecord) === false) {
2133
+ luvio.storePublish(key, incomingRecord);
2134
+ }
2135
+ {
2136
+ const storeMetadataParams = {
2137
+ ttl: ttlToUse,
2138
+ namespace: "CMS",
2139
+ version: VERSION$1,
2140
+ representationName: RepresentationType$1,
2141
+ };
2142
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2143
+ }
2144
+ return createLink(key);
2145
+ };
2146
+ function getTypeCacheKeys$1(luvio, input, fullPathFactory) {
2147
+ const rootKeySet = new StoreKeyMap();
2148
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2149
+ const rootKey = fullPathFactory();
2150
+ rootKeySet.set(rootKey, {
2151
+ namespace: keyPrefix,
2152
+ representationName: RepresentationType$1,
2153
+ mergeable: false
2154
+ });
2155
+ return rootKeySet;
2156
+ }
2157
+
2158
+ const VERSION = "a524ce828168211d9e25771a19aa2d0c";
2159
+ function validate(obj, path = 'ManagedContentVersionInternalCollectionRepresentation') {
2160
+ const v_error = (() => {
2161
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2162
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2163
+ }
2164
+ const obj_items = obj.items;
2165
+ const path_items = path + '.items';
2166
+ if (!ArrayIsArray(obj_items)) {
2167
+ return new TypeError('Expected "array" but received "' + typeof obj_items + '" (at "' + path_items + '")');
2168
+ }
2169
+ for (let i = 0; i < obj_items.length; i++) {
2170
+ const obj_items_item = obj_items[i];
2171
+ const path_items_item = path_items + '[' + i + ']';
2172
+ if (typeof obj_items_item !== 'object') {
2173
+ return new TypeError('Expected "object" but received "' + typeof obj_items_item + '" (at "' + path_items_item + '")');
2174
+ }
2175
+ }
2176
+ const obj_total = obj.total;
2177
+ const path_total = path + '.total';
2178
+ if (typeof obj_total !== 'number' || (typeof obj_total === 'number' && Math.floor(obj_total) !== obj_total)) {
2179
+ return new TypeError('Expected "integer" but received "' + typeof obj_total + '" (at "' + path_total + '")');
2180
+ }
2181
+ })();
2182
+ return v_error === undefined ? null : v_error;
2183
+ }
2184
+ const RepresentationType = 'ManagedContentVersionInternalCollectionRepresentation';
2185
+ function normalize(input, existing, path, luvio, store, timestamp) {
2186
+ const input_items = input.items;
2187
+ const input_items_id = path.fullPath + '__items';
2188
+ for (let i = 0; i < input_items.length; i++) {
2189
+ const input_items_item = input_items[i];
2190
+ let input_items_item_id = input_items_id + '__' + i;
2191
+ input_items[i] = ingest$1(input_items_item, {
2192
+ fullPath: input_items_item_id,
2193
+ propertyName: i,
2194
+ parent: {
2195
+ data: input,
2196
+ key: path.fullPath,
2197
+ existing: existing,
2198
+ },
2199
+ ttl: path.ttl
2200
+ }, luvio, store);
2201
+ }
2202
+ return input;
2203
+ }
2204
+ const select$1 = function ManagedContentVersionInternalCollectionRepresentationSelect() {
2205
+ return {
2206
+ kind: 'Fragment',
2207
+ version: VERSION,
2208
+ private: [],
2209
+ selections: [
2210
+ {
2211
+ name: 'items',
2212
+ kind: 'Link',
2213
+ plural: true,
2214
+ fragment: select$2()
2215
+ },
2216
+ {
2217
+ name: 'total',
2218
+ kind: 'Scalar'
2219
+ }
2220
+ ]
2221
+ };
2222
+ };
2223
+ function equals(existing, incoming) {
2224
+ const existing_total = existing.total;
2225
+ const incoming_total = incoming.total;
2226
+ if (!(existing_total === incoming_total)) {
2227
+ return false;
2228
+ }
2229
+ const existing_items = existing.items;
2230
+ const incoming_items = incoming.items;
2231
+ const equals_items_items = equalsArray(existing_items, incoming_items, (existing_items_item, incoming_items_item) => {
2232
+ if (!(existing_items_item.__ref === incoming_items_item.__ref)) {
2233
+ return false;
2234
+ }
2235
+ });
2236
+ if (equals_items_items === false) {
2237
+ return false;
2238
+ }
2239
+ return true;
2240
+ }
2241
+ const ingest = function ManagedContentVersionInternalCollectionRepresentationIngest(input, path, luvio, store, timestamp) {
2242
+ if (process.env.NODE_ENV !== 'production') {
2243
+ const validateError = validate(input);
2244
+ if (validateError !== null) {
2245
+ throw validateError;
2246
+ }
2247
+ }
2248
+ const key = path.fullPath;
2249
+ const existingRecord = store.readEntry(key);
2250
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 2592000000;
2251
+ let incomingRecord = normalize(input, store.readEntry(key), {
2252
+ fullPath: key,
2253
+ parent: path.parent,
2254
+ propertyName: path.propertyName,
2255
+ ttl: ttlToUse
2256
+ }, luvio, store);
2257
+ if (existingRecord === undefined || equals(existingRecord, incomingRecord) === false) {
2258
+ luvio.storePublish(key, incomingRecord);
2259
+ }
2260
+ if (ttlToUse !== undefined) {
2261
+ const storeMetadataParams = {
2262
+ ttl: ttlToUse,
2263
+ namespace: "CMS",
2264
+ version: VERSION,
2265
+ representationName: RepresentationType,
2266
+ };
2267
+ luvio.publishStoreMetadata(key, storeMetadataParams);
2268
+ }
2269
+ return createLink(key);
2270
+ };
2271
+ function getTypeCacheKeys(luvio, input, fullPathFactory) {
2272
+ const rootKeySet = new StoreKeyMap();
2273
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2274
+ const rootKey = fullPathFactory();
2275
+ rootKeySet.set(rootKey, {
2276
+ namespace: keyPrefix,
2277
+ representationName: RepresentationType,
2278
+ mergeable: false
2279
+ });
2280
+ const input_items_length = input.items.length;
2281
+ for (let i = 0; i < input_items_length; i++) {
2282
+ rootKeySet.merge(getTypeCacheKeys$1(luvio, input.items[i], () => ''));
2283
+ }
2284
+ return rootKeySet;
2285
+ }
2286
+
2287
+ function select(luvio, params) {
2288
+ return select$1();
2289
+ }
2290
+ function keyBuilder$1(luvio, params) {
2291
+ return keyPrefix + '::ManagedContentVersionInternalCollectionRepresentation:(' + 'collectionName:' + params.queryParams.collectionName + ',' + 'contentKeys:' + params.queryParams.contentKeys + ',' + 'language:' + params.queryParams.language + ',' + 'managedContentIds:' + params.queryParams.managedContentIds + ',' + 'managedContentType:' + params.queryParams.managedContentType + ',' + 'page:' + params.queryParams.page + ',' + 'pageSize:' + params.queryParams.pageSize + ',' + 'queryTerm:' + params.queryParams.queryTerm + ',' + 'topics:' + params.queryParams.topics + ',' + 'urlNameInList:' + params.queryParams.urlNameInList + ',' + 'communityId:' + params.urlParams.communityId + ')';
2292
+ }
2293
+ function getResponseCacheKeys(luvio, resourceParams, response) {
2294
+ return getTypeCacheKeys(luvio, response, () => keyBuilder$1(luvio, resourceParams));
2295
+ }
2296
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
2297
+ const { body } = response;
2298
+ const key = keyBuilder$1(luvio, resourceParams);
2299
+ luvio.storeIngest(key, ingest, body);
2300
+ const snapshot = luvio.storeLookup({
2301
+ recordId: key,
2302
+ node: select(),
2303
+ variables: {},
2304
+ }, snapshotRefresh);
2305
+ if (process.env.NODE_ENV !== 'production') {
2306
+ if (snapshot.state !== 'Fulfilled') {
2307
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2308
+ }
2309
+ }
2310
+ return snapshot;
2311
+ }
2312
+ function ingestError(luvio, params, error, snapshotRefresh) {
2313
+ const key = keyBuilder$1(luvio, params);
2314
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2315
+ luvio.storeIngestError(key, errorSnapshot);
2316
+ return errorSnapshot;
2317
+ }
2318
+ function createResourceRequest(config) {
2319
+ const headers = {};
2320
+ return {
2321
+ baseUri: '/services/data/v58.0',
2322
+ basePath: '/connect/communities/' + config.urlParams.communityId + '/managed-content/delivery/contents',
2323
+ method: 'get',
2324
+ body: null,
2325
+ urlParams: config.urlParams,
2326
+ queryParams: config.queryParams,
2327
+ headers,
2328
+ priority: 'normal',
2329
+ };
2330
+ }
2331
+
2332
+ const listContentInternal_ConfigPropertyNames = {
2333
+ displayName: 'listContentInternal',
2334
+ parameters: {
2335
+ required: ['communityId'],
2336
+ optional: ['collectionName', 'contentKeys', 'language', 'managedContentIds', 'managedContentType', 'page', 'pageSize', 'queryTerm', 'topics', 'urlNameInList']
2337
+ }
2338
+ };
2339
+ function createResourceParams(config) {
2340
+ const resourceParams = {
2341
+ urlParams: {
2342
+ communityId: config.communityId
2343
+ },
2344
+ queryParams: {
2345
+ collectionName: config.collectionName, contentKeys: config.contentKeys, language: config.language, managedContentIds: config.managedContentIds, managedContentType: config.managedContentType, page: config.page, pageSize: config.pageSize, queryTerm: config.queryTerm, topics: config.topics, urlNameInList: config.urlNameInList
2346
+ }
2347
+ };
2348
+ return resourceParams;
2349
+ }
2350
+ function keyBuilder(luvio, config) {
2351
+ const resourceParams = createResourceParams(config);
2352
+ return keyBuilder$1(luvio, resourceParams);
2353
+ }
2354
+ function typeCheckConfig(untrustedConfig) {
2355
+ const config = {};
2356
+ const untrustedConfig_communityId = untrustedConfig.communityId;
2357
+ if (typeof untrustedConfig_communityId === 'string') {
2358
+ config.communityId = untrustedConfig_communityId;
2359
+ }
2360
+ const untrustedConfig_collectionName = untrustedConfig.collectionName;
2361
+ if (typeof untrustedConfig_collectionName === 'string') {
2362
+ config.collectionName = untrustedConfig_collectionName;
2363
+ }
2364
+ const untrustedConfig_contentKeys = untrustedConfig.contentKeys;
2365
+ if (ArrayIsArray$1(untrustedConfig_contentKeys)) {
2366
+ const untrustedConfig_contentKeys_array = [];
2367
+ for (let i = 0, arrayLength = untrustedConfig_contentKeys.length; i < arrayLength; i++) {
2368
+ const untrustedConfig_contentKeys_item = untrustedConfig_contentKeys[i];
2369
+ if (typeof untrustedConfig_contentKeys_item === 'string') {
2370
+ untrustedConfig_contentKeys_array.push(untrustedConfig_contentKeys_item);
2371
+ }
2372
+ }
2373
+ config.contentKeys = untrustedConfig_contentKeys_array;
2374
+ }
2375
+ const untrustedConfig_language = untrustedConfig.language;
2376
+ if (typeof untrustedConfig_language === 'string') {
2377
+ config.language = untrustedConfig_language;
2378
+ }
2379
+ const untrustedConfig_managedContentIds = untrustedConfig.managedContentIds;
2380
+ if (ArrayIsArray$1(untrustedConfig_managedContentIds)) {
2381
+ const untrustedConfig_managedContentIds_array = [];
2382
+ for (let i = 0, arrayLength = untrustedConfig_managedContentIds.length; i < arrayLength; i++) {
2383
+ const untrustedConfig_managedContentIds_item = untrustedConfig_managedContentIds[i];
2384
+ if (typeof untrustedConfig_managedContentIds_item === 'string') {
2385
+ untrustedConfig_managedContentIds_array.push(untrustedConfig_managedContentIds_item);
2386
+ }
2387
+ }
2388
+ config.managedContentIds = untrustedConfig_managedContentIds_array;
2389
+ }
2390
+ const untrustedConfig_managedContentType = untrustedConfig.managedContentType;
2391
+ if (typeof untrustedConfig_managedContentType === 'string') {
2392
+ config.managedContentType = untrustedConfig_managedContentType;
2393
+ }
2394
+ const untrustedConfig_page = untrustedConfig.page;
2395
+ if (typeof untrustedConfig_page === 'number' && Math.floor(untrustedConfig_page) === untrustedConfig_page) {
2396
+ config.page = untrustedConfig_page;
2397
+ }
2398
+ const untrustedConfig_pageSize = untrustedConfig.pageSize;
2399
+ if (typeof untrustedConfig_pageSize === 'number' && Math.floor(untrustedConfig_pageSize) === untrustedConfig_pageSize) {
2400
+ config.pageSize = untrustedConfig_pageSize;
2401
+ }
2402
+ const untrustedConfig_queryTerm = untrustedConfig.queryTerm;
2403
+ if (typeof untrustedConfig_queryTerm === 'string') {
2404
+ config.queryTerm = untrustedConfig_queryTerm;
2405
+ }
2406
+ const untrustedConfig_topics = untrustedConfig.topics;
2407
+ if (ArrayIsArray$1(untrustedConfig_topics)) {
2408
+ const untrustedConfig_topics_array = [];
2409
+ for (let i = 0, arrayLength = untrustedConfig_topics.length; i < arrayLength; i++) {
2410
+ const untrustedConfig_topics_item = untrustedConfig_topics[i];
2411
+ if (typeof untrustedConfig_topics_item === 'string') {
2412
+ untrustedConfig_topics_array.push(untrustedConfig_topics_item);
2413
+ }
2414
+ }
2415
+ config.topics = untrustedConfig_topics_array;
2416
+ }
2417
+ const untrustedConfig_urlNameInList = untrustedConfig.urlNameInList;
2418
+ if (ArrayIsArray$1(untrustedConfig_urlNameInList)) {
2419
+ const untrustedConfig_urlNameInList_array = [];
2420
+ for (let i = 0, arrayLength = untrustedConfig_urlNameInList.length; i < arrayLength; i++) {
2421
+ const untrustedConfig_urlNameInList_item = untrustedConfig_urlNameInList[i];
2422
+ if (typeof untrustedConfig_urlNameInList_item === 'string') {
2423
+ untrustedConfig_urlNameInList_array.push(untrustedConfig_urlNameInList_item);
2424
+ }
2425
+ }
2426
+ config.urlNameInList = untrustedConfig_urlNameInList_array;
2427
+ }
2428
+ return config;
2429
+ }
2430
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
2431
+ if (!untrustedIsObject(untrustedConfig)) {
2432
+ return null;
2433
+ }
2434
+ if (process.env.NODE_ENV !== 'production') {
2435
+ validateConfig(untrustedConfig, configPropertyNames);
2436
+ }
2437
+ const config = typeCheckConfig(untrustedConfig);
2438
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2439
+ return null;
2440
+ }
2441
+ return config;
2442
+ }
2443
+ function adapterFragment(luvio, config) {
2444
+ createResourceParams(config);
2445
+ return select();
2446
+ }
2447
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
2448
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
2449
+ config,
2450
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
2451
+ });
2452
+ return luvio.storeBroadcast().then(() => snapshot);
2453
+ }
2454
+ function onFetchResponseError(luvio, config, resourceParams, response) {
2455
+ const snapshot = ingestError(luvio, resourceParams, response, {
2456
+ config,
2457
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
2458
+ });
2459
+ return luvio.storeBroadcast().then(() => snapshot);
2460
+ }
2461
+ function buildNetworkSnapshot(luvio, config, options) {
2462
+ const resourceParams = createResourceParams(config);
2463
+ const request = createResourceRequest(resourceParams);
2464
+ return luvio.dispatchResourceRequest(request, options)
2465
+ .then((response) => {
2466
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => getResponseCacheKeys(luvio, resourceParams, response.body));
2467
+ }, (response) => {
2468
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
2469
+ });
2470
+ }
2471
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
2472
+ const { luvio, config } = context;
2473
+ const { networkPriority, requestCorrelator, eventObservers } = coercedAdapterRequestContext;
2474
+ const dispatchOptions = {
2475
+ resourceRequestContext: {
2476
+ requestCorrelator,
2477
+ luvioRequestMethod: undefined,
2478
+ },
2479
+ eventObservers
2480
+ };
2481
+ if (networkPriority !== 'normal') {
2482
+ dispatchOptions.overrides = {
2483
+ priority: networkPriority
2484
+ };
2485
+ }
2486
+ return buildNetworkSnapshot(luvio, config, dispatchOptions);
2487
+ }
2488
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
2489
+ const { luvio, config } = context;
2490
+ const selector = {
2491
+ recordId: keyBuilder(luvio, config),
2492
+ node: adapterFragment(luvio, config),
2493
+ variables: {},
2494
+ };
2495
+ const cacheSnapshot = storeLookup(selector, {
2496
+ config,
2497
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
2498
+ });
2499
+ return cacheSnapshot;
2500
+ }
2501
+ const listContentInternalAdapterFactory = (luvio) => function CMS__listContentInternal(untrustedConfig, requestContext) {
2502
+ const config = validateAdapterConfig(untrustedConfig, listContentInternal_ConfigPropertyNames);
2503
+ // Invalid or incomplete config
2504
+ if (config === null) {
2505
+ return null;
2506
+ }
2507
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2508
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
2509
+ };
2510
+
2511
+ let getCollectionItemsForChannel;
2512
+ let getCollectionItemsForSite;
2513
+ let getCollectionMetadataForChannel;
2514
+ let getCollectionMetadataForSite;
2515
+ let listContent;
2516
+ let listContentInternal;
2517
+ // Imperative GET Adapters
2518
+ let getCollectionItemsForChannel_imperative;
2519
+ let getCollectionItemsForSite_imperative;
2520
+ let getCollectionMetadataForChannel_imperative;
2521
+ let getCollectionMetadataForSite_imperative;
2522
+ let listContent_imperative;
2523
+ let listContentInternal_imperative;
2524
+ // Adapter Metadata
2525
+ const getCollectionItemsForChannelMetadata = { apiFamily: 'CMS', name: 'getCollectionItemsForChannel', ttl: 3600000 };
2526
+ const getCollectionItemsForSiteMetadata = { apiFamily: 'CMS', name: 'getCollectionItemsForSite', ttl: 3600000 };
2527
+ const getCollectionMetadataForChannelMetadata = { apiFamily: 'CMS', name: 'getCollectionMetadataForChannel', ttl: 3600000 };
2528
+ const getCollectionMetadataForSiteMetadata = { apiFamily: 'CMS', name: 'getCollectionMetadataForSite', ttl: 3600000 };
2529
+ const listContentMetadata = { apiFamily: 'CMS', name: 'listContent', ttl: 3600000 };
2530
+ const listContentInternalMetadata = { apiFamily: 'CMS', name: 'listContentInternal' };
2531
+ function bindExportsTo(luvio) {
2532
+ // LDS Adapters
2533
+ const getCollectionItemsForChannel_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getCollectionItemsForChannel', getCollectionItemsForChannelAdapterFactory), getCollectionItemsForChannelMetadata);
2534
+ const getCollectionItemsForSite_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getCollectionItemsForSite', getCollectionItemsForSiteAdapterFactory), getCollectionItemsForSiteMetadata);
2535
+ const getCollectionMetadataForChannel_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getCollectionMetadataForChannel', getCollectionMetadataForChannelAdapterFactory), getCollectionMetadataForChannelMetadata);
2536
+ const getCollectionMetadataForSite_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'getCollectionMetadataForSite', getCollectionMetadataForSiteAdapterFactory), getCollectionMetadataForSiteMetadata);
2537
+ const listContent_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'listContent', listContentAdapterFactory), listContentMetadata);
2538
+ const listContentInternal_ldsAdapter = createInstrumentedAdapter(createLDSAdapter(luvio, 'listContentInternal', listContentInternalAdapterFactory), listContentInternalMetadata);
2539
+ return {
2540
+ getCollectionItemsForChannel: createWireAdapterConstructor(luvio, getCollectionItemsForChannel_ldsAdapter, getCollectionItemsForChannelMetadata),
2541
+ getCollectionItemsForSite: createWireAdapterConstructor(luvio, getCollectionItemsForSite_ldsAdapter, getCollectionItemsForSiteMetadata),
2542
+ getCollectionMetadataForChannel: createWireAdapterConstructor(luvio, getCollectionMetadataForChannel_ldsAdapter, getCollectionMetadataForChannelMetadata),
2543
+ getCollectionMetadataForSite: createWireAdapterConstructor(luvio, getCollectionMetadataForSite_ldsAdapter, getCollectionMetadataForSiteMetadata),
2544
+ listContent: createWireAdapterConstructor(luvio, listContent_ldsAdapter, listContentMetadata),
2545
+ listContentInternal: createWireAdapterConstructor(luvio, listContentInternal_ldsAdapter, listContentInternalMetadata),
2546
+ // Imperative GET Adapters
2547
+ getCollectionItemsForChannel_imperative: createImperativeAdapter(luvio, getCollectionItemsForChannel_ldsAdapter, getCollectionItemsForChannelMetadata),
2548
+ getCollectionItemsForSite_imperative: createImperativeAdapter(luvio, getCollectionItemsForSite_ldsAdapter, getCollectionItemsForSiteMetadata),
2549
+ getCollectionMetadataForChannel_imperative: createImperativeAdapter(luvio, getCollectionMetadataForChannel_ldsAdapter, getCollectionMetadataForChannelMetadata),
2550
+ getCollectionMetadataForSite_imperative: createImperativeAdapter(luvio, getCollectionMetadataForSite_ldsAdapter, getCollectionMetadataForSiteMetadata),
2551
+ listContent_imperative: createImperativeAdapter(luvio, listContent_ldsAdapter, listContentMetadata),
2552
+ listContentInternal_imperative: createImperativeAdapter(luvio, listContentInternal_ldsAdapter, listContentInternalMetadata)
2553
+ };
2554
+ }
2555
+ withDefaultLuvio((luvio) => {
2556
+ ({
2557
+ getCollectionItemsForChannel,
2558
+ getCollectionItemsForSite,
2559
+ getCollectionMetadataForChannel,
2560
+ getCollectionMetadataForSite,
2561
+ listContent,
2562
+ listContentInternal,
2563
+ getCollectionItemsForChannel_imperative,
2564
+ getCollectionItemsForSite_imperative,
2565
+ getCollectionMetadataForChannel_imperative,
2566
+ getCollectionMetadataForSite_imperative,
2567
+ listContent_imperative,
2568
+ listContentInternal_imperative
2569
+ } = bindExportsTo(luvio));
2570
+ });
2571
+
2572
+ export { getCollectionItemsForChannel, getCollectionItemsForChannel_imperative, getCollectionItemsForSite, getCollectionItemsForSite_imperative, getCollectionMetadataForChannel, getCollectionMetadataForChannel_imperative, getCollectionMetadataForSite, getCollectionMetadataForSite_imperative, listContent, listContentInternal, listContentInternal_imperative, listContent_imperative };
2573
+ // version: 0.131.0-c1ec5b7de