@salesforce/lds-adapters-industries-sales-excellence 0.1.0-dev1

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 (81) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/industries-sales-excellence.js +4825 -0
  3. package/dist/es/es2018/types/src/generated/adapters/actionableListAssignment.d.ts +17 -0
  4. package/dist/es/es2018/types/src/generated/adapters/actionableListMemberSearch.d.ts +16 -0
  5. package/dist/es/es2018/types/src/generated/adapters/actionableListMemberSearchById.d.ts +17 -0
  6. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
  7. package/dist/es/es2018/types/src/generated/adapters/createActionableListRecords.d.ts +16 -0
  8. package/dist/es/es2018/types/src/generated/adapters/createObjectsDataFromSelectedSegment.d.ts +16 -0
  9. package/dist/es/es2018/types/src/generated/adapters/generateActionableListKpiBarResults.d.ts +16 -0
  10. package/dist/es/es2018/types/src/generated/adapters/generateActionableListKpiMappingResults.d.ts +16 -0
  11. package/dist/es/es2018/types/src/generated/adapters/getALMQueues.d.ts +28 -0
  12. package/dist/es/es2018/types/src/generated/adapters/getActionableListMetadata.d.ts +30 -0
  13. package/dist/es/es2018/types/src/generated/adapters/getAssignedActionableLists.d.ts +26 -0
  14. package/dist/es/es2018/types/src/generated/adapters/getSegmentsDetails.d.ts +29 -0
  15. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +11 -0
  16. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +16 -0
  17. package/dist/es/es2018/types/src/generated/resources/getConnectSalesExcellenceActionableListMemberQueues.d.ts +16 -0
  18. package/dist/es/es2018/types/src/generated/resources/getConnectSalesExcellenceActionableLists.d.ts +12 -0
  19. package/dist/es/es2018/types/src/generated/resources/getConnectSalesExcellenceActionableListsMetadataByActionableListId.d.ts +20 -0
  20. package/dist/es/es2018/types/src/generated/resources/getConnectSalesExcellenceCustDataPfrmSegments.d.ts +17 -0
  21. package/dist/es/es2018/types/src/generated/resources/postConnectSalesExcellenceActionableListAssignmentByActionableListId.d.ts +16 -0
  22. package/dist/es/es2018/types/src/generated/resources/postConnectSalesExcellenceActionableListKeyPerformanceIndicatorsMappings.d.ts +13 -0
  23. package/dist/es/es2018/types/src/generated/resources/postConnectSalesExcellenceActionableListKpi.d.ts +13 -0
  24. package/dist/es/es2018/types/src/generated/resources/postConnectSalesExcellenceActionableListMembers.d.ts +13 -0
  25. package/dist/es/es2018/types/src/generated/resources/postConnectSalesExcellenceActionableListMembersByActionableListId.d.ts +16 -0
  26. package/dist/es/es2018/types/src/generated/resources/postConnectSalesExcellenceCustDataPfrmCreateRecords.d.ts +13 -0
  27. package/dist/es/es2018/types/src/generated/resources/postConnectSalesExcellenceCustDataPfrmSegmentPreview.d.ts +13 -0
  28. package/dist/es/es2018/types/src/generated/types/ALMStatusCountRepresentation.d.ts +37 -0
  29. package/dist/es/es2018/types/src/generated/types/ActionRepresentation.d.ts +40 -0
  30. package/dist/es/es2018/types/src/generated/types/ActionableListAvailableKpiRepresentation.d.ts +37 -0
  31. package/dist/es/es2018/types/src/generated/types/ActionableListFieldsInputRepresentation.d.ts +43 -0
  32. package/dist/es/es2018/types/src/generated/types/ActionableListKPIMappingInputRepresentation.d.ts +31 -0
  33. package/dist/es/es2018/types/src/generated/types/ActionableListKPIMappingListRepresentation.d.ts +34 -0
  34. package/dist/es/es2018/types/src/generated/types/ActionableListKPIMappingRepresentation.d.ts +42 -0
  35. package/dist/es/es2018/types/src/generated/types/ActionableListKpiBarWrapperInputRepresentation.d.ts +29 -0
  36. package/dist/es/es2018/types/src/generated/types/ActionableListKpiMappingWrapperInputRepresentation.d.ts +29 -0
  37. package/dist/es/es2018/types/src/generated/types/ActionableListMemberFieldsInputRepresentation.d.ts +28 -0
  38. package/dist/es/es2018/types/src/generated/types/ActionableListMemberQueueRepresentation.d.ts +31 -0
  39. package/dist/es/es2018/types/src/generated/types/ActionableListMemberQueuesRepresentation.d.ts +33 -0
  40. package/dist/es/es2018/types/src/generated/types/ActionableListMemberStatusInputRepresentation.d.ts +34 -0
  41. package/dist/es/es2018/types/src/generated/types/ActionableListMetadataRepresentation.d.ts +34 -0
  42. package/dist/es/es2018/types/src/generated/types/ActionableListSelectedKpiRepresentation.d.ts +28 -0
  43. package/dist/es/es2018/types/src/generated/types/ActionableListSelectedKpisRepresentation.d.ts +28 -0
  44. package/dist/es/es2018/types/src/generated/types/AdditionalContextRepresentation.d.ts +28 -0
  45. package/dist/es/es2018/types/src/generated/types/AssignActionableListInputRepresentation.d.ts +39 -0
  46. package/dist/es/es2018/types/src/generated/types/AssignActionableListRepresentation.d.ts +41 -0
  47. package/dist/es/es2018/types/src/generated/types/AssignActionableListWrapperInputRepresentation.d.ts +29 -0
  48. package/dist/es/es2018/types/src/generated/types/AssignedActionableListRepresentation.d.ts +43 -0
  49. package/dist/es/es2018/types/src/generated/types/AssignedActionableListsRepresentation.d.ts +30 -0
  50. package/dist/es/es2018/types/src/generated/types/AssigneeInputRepresentation.d.ts +31 -0
  51. package/dist/es/es2018/types/src/generated/types/AutoAssigneeInputRepresentation.d.ts +31 -0
  52. package/dist/es/es2018/types/src/generated/types/CdpSalesExcellenceStatusRepresentation.d.ts +31 -0
  53. package/dist/es/es2018/types/src/generated/types/CreateActionableListRecordsInputRepresentation.d.ts +67 -0
  54. package/dist/es/es2018/types/src/generated/types/CreateActionableListRecordsRepresentation.d.ts +38 -0
  55. package/dist/es/es2018/types/src/generated/types/CreateActionableListRecordsWrapperInputRepresentation.d.ts +28 -0
  56. package/dist/es/es2018/types/src/generated/types/FilterRepresentation.d.ts +37 -0
  57. package/dist/es/es2018/types/src/generated/types/FilterRepresentationList.d.ts +29 -0
  58. package/dist/es/es2018/types/src/generated/types/KpiBarInputRepresentation.d.ts +38 -0
  59. package/dist/es/es2018/types/src/generated/types/KpiBarMetricRepresentation.d.ts +53 -0
  60. package/dist/es/es2018/types/src/generated/types/KpiBarOutputRepresentation.d.ts +49 -0
  61. package/dist/es/es2018/types/src/generated/types/MetadataDetailRepresentation.d.ts +31 -0
  62. package/dist/es/es2018/types/src/generated/types/OrderByRepresentation.d.ts +34 -0
  63. package/dist/es/es2018/types/src/generated/types/OrderByRepresentationList.d.ts +29 -0
  64. package/dist/es/es2018/types/src/generated/types/QuickActionsMetadataRepresentation.d.ts +32 -0
  65. package/dist/es/es2018/types/src/generated/types/SalesExcellenceStatusRepresentation.d.ts +31 -0
  66. package/dist/es/es2018/types/src/generated/types/SearchActionableListMemberInputRepresentation.d.ts +45 -0
  67. package/dist/es/es2018/types/src/generated/types/SearchActionableListMemberRepresentation.d.ts +54 -0
  68. package/dist/es/es2018/types/src/generated/types/SearchActionableListMemberWrapperInputRepresentation.d.ts +29 -0
  69. package/dist/es/es2018/types/src/generated/types/SegmentDetailsListRepresentation.d.ts +33 -0
  70. package/dist/es/es2018/types/src/generated/types/SegmentDetailsRepresentation.d.ts +70 -0
  71. package/dist/es/es2018/types/src/generated/types/SegmentPreviewInputRepresentation.d.ts +43 -0
  72. package/dist/es/es2018/types/src/generated/types/SegmentPreviewListRepresentation.d.ts +48 -0
  73. package/dist/es/es2018/types/src/generated/types/SegmentPreviewRepresentation.d.ts +28 -0
  74. package/dist/es/es2018/types/src/generated/types/SegmentPreviewWrapperInputRepresentation.d.ts +28 -0
  75. package/dist/es/es2018/types/src/generated/types/StatusResponseRepresentation.d.ts +31 -0
  76. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  77. package/package.json +74 -0
  78. package/sfdc/index.d.ts +1 -0
  79. package/sfdc/index.js +4919 -0
  80. package/src/raml/api.raml +968 -0
  81. package/src/raml/luvio.raml +91 -0
@@ -0,0 +1,4825 @@
1
+ /**
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$b, typeCheckConfig as typeCheckConfig$b, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$4 } from '@luvio/engine';
8
+
9
+ const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
+ const { keys: ObjectKeys, create: ObjectCreate } = Object;
11
+ const { isArray: ArrayIsArray$1 } = Array;
12
+ /**
13
+ * Validates an adapter config is well-formed.
14
+ * @param config The config to validate.
15
+ * @param adapter The adapter validation configuration.
16
+ * @param oneOf The keys the config must contain at least one of.
17
+ * @throws A TypeError if config doesn't satisfy the adapter's config validation.
18
+ */
19
+ function validateConfig(config, adapter, oneOf) {
20
+ const { displayName } = adapter;
21
+ const { required, optional, unsupported } = adapter.parameters;
22
+ if (config === undefined ||
23
+ required.every(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
24
+ throw new TypeError(`adapter ${displayName} configuration must specify ${required.sort().join(', ')}`);
25
+ }
26
+ if (oneOf && oneOf.some(req => ObjectPrototypeHasOwnProperty.call(config, req)) === false) {
27
+ throw new TypeError(`adapter ${displayName} configuration must specify one of ${oneOf.sort().join(', ')}`);
28
+ }
29
+ if (unsupported !== undefined &&
30
+ unsupported.some(req => ObjectPrototypeHasOwnProperty.call(config, req))) {
31
+ throw new TypeError(`adapter ${displayName} does not yet support ${unsupported.sort().join(', ')}`);
32
+ }
33
+ const supported = required.concat(optional);
34
+ if (ObjectKeys(config).some(key => !supported.includes(key))) {
35
+ throw new TypeError(`adapter ${displayName} configuration supports only ${supported.sort().join(', ')}`);
36
+ }
37
+ }
38
+ function untrustedIsObject(untrusted) {
39
+ return typeof untrusted === 'object' && untrusted !== null && ArrayIsArray$1(untrusted) === false;
40
+ }
41
+ function areRequiredParametersPresent(config, configPropertyNames) {
42
+ return configPropertyNames.parameters.required.every(req => req in config);
43
+ }
44
+ const snapshotRefreshOptions = {
45
+ overrides: {
46
+ headers: {
47
+ 'Cache-Control': 'no-cache',
48
+ },
49
+ }
50
+ };
51
+ function generateParamConfigMetadata(name, required, resourceType, typeCheckShape, isArrayShape = false, coerceFn) {
52
+ return {
53
+ name,
54
+ required,
55
+ resourceType,
56
+ typeCheckShape,
57
+ isArrayShape,
58
+ coerceFn,
59
+ };
60
+ }
61
+ function buildAdapterValidationConfig(displayName, paramsMeta) {
62
+ const required = paramsMeta.filter(p => p.required).map(p => p.name);
63
+ const optional = paramsMeta.filter(p => !p.required).map(p => p.name);
64
+ return {
65
+ displayName,
66
+ parameters: {
67
+ required,
68
+ optional,
69
+ }
70
+ };
71
+ }
72
+ const keyPrefix = 'sales-excellence';
73
+
74
+ const { isArray: ArrayIsArray } = Array;
75
+ const { stringify: JSONStringify } = JSON;
76
+ function equalsArray(a, b, equalsItem) {
77
+ const aLength = a.length;
78
+ const bLength = b.length;
79
+ if (aLength !== bLength) {
80
+ return false;
81
+ }
82
+ for (let i = 0; i < aLength; i++) {
83
+ if (equalsItem(a[i], b[i]) === false) {
84
+ return false;
85
+ }
86
+ }
87
+ return true;
88
+ }
89
+ function createLink(ref) {
90
+ return {
91
+ __ref: serializeStructuredKey(ref),
92
+ };
93
+ }
94
+
95
+ const VERSION$m = "5bb77e8e38ab7a82cce880a970c7073b";
96
+ function validate$z(obj, path = 'FilterRepresentation') {
97
+ const v_error = (() => {
98
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
99
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
100
+ }
101
+ if (obj.dataType !== undefined) {
102
+ const obj_dataType = obj.dataType;
103
+ const path_dataType = path + '.dataType';
104
+ if (typeof obj_dataType !== 'string') {
105
+ return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
106
+ }
107
+ }
108
+ const obj_fieldName = obj.fieldName;
109
+ const path_fieldName = path + '.fieldName';
110
+ if (typeof obj_fieldName !== 'string') {
111
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
112
+ }
113
+ const obj_operator = obj.operator;
114
+ const path_operator = path + '.operator';
115
+ if (typeof obj_operator !== 'string') {
116
+ return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
117
+ }
118
+ const obj_value = obj.value;
119
+ const path_value = path + '.value';
120
+ if (typeof obj_value !== 'string') {
121
+ return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
122
+ }
123
+ })();
124
+ return v_error === undefined ? null : v_error;
125
+ }
126
+ const select$x = function FilterRepresentationSelect() {
127
+ return {
128
+ kind: 'Fragment',
129
+ version: VERSION$m,
130
+ private: [],
131
+ selections: [
132
+ {
133
+ name: 'dataType',
134
+ kind: 'Scalar',
135
+ required: false
136
+ },
137
+ {
138
+ name: 'fieldName',
139
+ kind: 'Scalar'
140
+ },
141
+ {
142
+ name: 'operator',
143
+ kind: 'Scalar'
144
+ },
145
+ {
146
+ name: 'value',
147
+ kind: 'Scalar'
148
+ }
149
+ ]
150
+ };
151
+ };
152
+ function equals$m(existing, incoming) {
153
+ const existing_dataType = existing.dataType;
154
+ const incoming_dataType = incoming.dataType;
155
+ // if at least one of these optionals is defined
156
+ if (existing_dataType !== undefined || incoming_dataType !== undefined) {
157
+ // if one of these is not defined we know the other is defined and therefore
158
+ // not equal
159
+ if (existing_dataType === undefined || incoming_dataType === undefined) {
160
+ return false;
161
+ }
162
+ if (!(existing_dataType === incoming_dataType)) {
163
+ return false;
164
+ }
165
+ }
166
+ const existing_fieldName = existing.fieldName;
167
+ const incoming_fieldName = incoming.fieldName;
168
+ if (!(existing_fieldName === incoming_fieldName)) {
169
+ return false;
170
+ }
171
+ const existing_operator = existing.operator;
172
+ const incoming_operator = incoming.operator;
173
+ if (!(existing_operator === incoming_operator)) {
174
+ return false;
175
+ }
176
+ const existing_value = existing.value;
177
+ const incoming_value = incoming.value;
178
+ if (!(existing_value === incoming_value)) {
179
+ return false;
180
+ }
181
+ return true;
182
+ }
183
+
184
+ function validate$y(obj, path = 'FilterRepresentationList') {
185
+ const v_error = (() => {
186
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
187
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
188
+ }
189
+ const obj_filterList = obj.filterList;
190
+ const path_filterList = path + '.filterList';
191
+ if (!ArrayIsArray(obj_filterList)) {
192
+ return new TypeError('Expected "array" but received "' + typeof obj_filterList + '" (at "' + path_filterList + '")');
193
+ }
194
+ for (let i = 0; i < obj_filterList.length; i++) {
195
+ const obj_filterList_item = obj_filterList[i];
196
+ const path_filterList_item = path_filterList + '[' + i + ']';
197
+ const referencepath_filterList_itemValidationError = validate$z(obj_filterList_item, path_filterList_item);
198
+ if (referencepath_filterList_itemValidationError !== null) {
199
+ let message = 'Object doesn\'t match FilterRepresentation (at "' + path_filterList_item + '")\n';
200
+ message += referencepath_filterList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
201
+ return new TypeError(message);
202
+ }
203
+ }
204
+ })();
205
+ return v_error === undefined ? null : v_error;
206
+ }
207
+
208
+ function validate$x(obj, path = 'OrderByRepresentation') {
209
+ const v_error = (() => {
210
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
211
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
212
+ }
213
+ const obj_fieldName = obj.fieldName;
214
+ const path_fieldName = path + '.fieldName';
215
+ if (typeof obj_fieldName !== 'string') {
216
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
217
+ }
218
+ const obj_nulls = obj.nulls;
219
+ const path_nulls = path + '.nulls';
220
+ if (typeof obj_nulls !== 'string') {
221
+ return new TypeError('Expected "string" but received "' + typeof obj_nulls + '" (at "' + path_nulls + '")');
222
+ }
223
+ const obj_operator = obj.operator;
224
+ const path_operator = path + '.operator';
225
+ if (typeof obj_operator !== 'string') {
226
+ return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
227
+ }
228
+ })();
229
+ return v_error === undefined ? null : v_error;
230
+ }
231
+
232
+ function validate$w(obj, path = 'OrderByRepresentationList') {
233
+ const v_error = (() => {
234
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
235
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
236
+ }
237
+ const obj_orderByList = obj.orderByList;
238
+ const path_orderByList = path + '.orderByList';
239
+ if (!ArrayIsArray(obj_orderByList)) {
240
+ return new TypeError('Expected "array" but received "' + typeof obj_orderByList + '" (at "' + path_orderByList + '")');
241
+ }
242
+ for (let i = 0; i < obj_orderByList.length; i++) {
243
+ const obj_orderByList_item = obj_orderByList[i];
244
+ const path_orderByList_item = path_orderByList + '[' + i + ']';
245
+ const referencepath_orderByList_itemValidationError = validate$x(obj_orderByList_item, path_orderByList_item);
246
+ if (referencepath_orderByList_itemValidationError !== null) {
247
+ let message = 'Object doesn\'t match OrderByRepresentation (at "' + path_orderByList_item + '")\n';
248
+ message += referencepath_orderByList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
249
+ return new TypeError(message);
250
+ }
251
+ }
252
+ })();
253
+ return v_error === undefined ? null : v_error;
254
+ }
255
+
256
+ function validate$v(obj, path = 'SearchActionableListMemberInputRepresentation') {
257
+ const v_error = (() => {
258
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
259
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
260
+ }
261
+ if (obj.after !== undefined) {
262
+ const obj_after = obj.after;
263
+ const path_after = path + '.after';
264
+ if (typeof obj_after !== 'string') {
265
+ return new TypeError('Expected "string" but received "' + typeof obj_after + '" (at "' + path_after + '")');
266
+ }
267
+ }
268
+ if (obj.filters !== undefined) {
269
+ const obj_filters = obj.filters;
270
+ const path_filters = path + '.filters';
271
+ const referencepath_filtersValidationError = validate$y(obj_filters, path_filters);
272
+ if (referencepath_filtersValidationError !== null) {
273
+ let message = 'Object doesn\'t match FilterRepresentationList (at "' + path_filters + '")\n';
274
+ message += referencepath_filtersValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
275
+ return new TypeError(message);
276
+ }
277
+ }
278
+ if (obj.orderBy !== undefined) {
279
+ const obj_orderBy = obj.orderBy;
280
+ const path_orderBy = path + '.orderBy';
281
+ const referencepath_orderByValidationError = validate$w(obj_orderBy, path_orderBy);
282
+ if (referencepath_orderByValidationError !== null) {
283
+ let message = 'Object doesn\'t match OrderByRepresentationList (at "' + path_orderBy + '")\n';
284
+ message += referencepath_orderByValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
285
+ return new TypeError(message);
286
+ }
287
+ }
288
+ if (obj.requireHeaders !== undefined) {
289
+ const obj_requireHeaders = obj.requireHeaders;
290
+ const path_requireHeaders = path + '.requireHeaders';
291
+ if (typeof obj_requireHeaders !== 'boolean') {
292
+ return new TypeError('Expected "boolean" but received "' + typeof obj_requireHeaders + '" (at "' + path_requireHeaders + '")');
293
+ }
294
+ }
295
+ const obj_scope = obj.scope;
296
+ const path_scope = path + '.scope';
297
+ if (typeof obj_scope !== 'string') {
298
+ return new TypeError('Expected "string" but received "' + typeof obj_scope + '" (at "' + path_scope + '")');
299
+ }
300
+ if (obj.searchTerm !== undefined) {
301
+ const obj_searchTerm = obj.searchTerm;
302
+ const path_searchTerm = path + '.searchTerm';
303
+ if (typeof obj_searchTerm !== 'string') {
304
+ return new TypeError('Expected "string" but received "' + typeof obj_searchTerm + '" (at "' + path_searchTerm + '")');
305
+ }
306
+ }
307
+ })();
308
+ return v_error === undefined ? null : v_error;
309
+ }
310
+
311
+ const VERSION$l = "e33654870510a9686b7f2dba827670b4";
312
+ function validate$u(obj, path = 'ActionRepresentation') {
313
+ const v_error = (() => {
314
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
315
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
316
+ }
317
+ if (obj.componentName !== undefined) {
318
+ const obj_componentName = obj.componentName;
319
+ const path_componentName = path + '.componentName';
320
+ if (typeof obj_componentName !== 'string') {
321
+ return new TypeError('Expected "string" but received "' + typeof obj_componentName + '" (at "' + path_componentName + '")');
322
+ }
323
+ }
324
+ if (obj.componentType !== undefined) {
325
+ const obj_componentType = obj.componentType;
326
+ const path_componentType = path + '.componentType';
327
+ if (typeof obj_componentType !== 'string') {
328
+ return new TypeError('Expected "string" but received "' + typeof obj_componentType + '" (at "' + path_componentType + '")');
329
+ }
330
+ }
331
+ if (obj.displayLabel !== undefined) {
332
+ const obj_displayLabel = obj.displayLabel;
333
+ const path_displayLabel = path + '.displayLabel';
334
+ if (typeof obj_displayLabel !== 'string') {
335
+ return new TypeError('Expected "string" but received "' + typeof obj_displayLabel + '" (at "' + path_displayLabel + '")');
336
+ }
337
+ }
338
+ if (obj.displayOrder !== undefined) {
339
+ const obj_displayOrder = obj.displayOrder;
340
+ const path_displayOrder = path + '.displayOrder';
341
+ if (typeof obj_displayOrder !== 'number' || (typeof obj_displayOrder === 'number' && Math.floor(obj_displayOrder) !== obj_displayOrder)) {
342
+ return new TypeError('Expected "integer" but received "' + typeof obj_displayOrder + '" (at "' + path_displayOrder + '")');
343
+ }
344
+ }
345
+ if (obj.isAlmAction !== undefined) {
346
+ const obj_isAlmAction = obj.isAlmAction;
347
+ const path_isAlmAction = path + '.isAlmAction';
348
+ if (typeof obj_isAlmAction !== 'boolean') {
349
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isAlmAction + '" (at "' + path_isAlmAction + '")');
350
+ }
351
+ }
352
+ })();
353
+ return v_error === undefined ? null : v_error;
354
+ }
355
+ const select$w = function ActionRepresentationSelect() {
356
+ return {
357
+ kind: 'Fragment',
358
+ version: VERSION$l,
359
+ private: [],
360
+ selections: [
361
+ {
362
+ name: 'componentName',
363
+ kind: 'Scalar',
364
+ required: false
365
+ },
366
+ {
367
+ name: 'componentType',
368
+ kind: 'Scalar',
369
+ required: false
370
+ },
371
+ {
372
+ name: 'displayLabel',
373
+ kind: 'Scalar',
374
+ required: false
375
+ },
376
+ {
377
+ name: 'displayOrder',
378
+ kind: 'Scalar',
379
+ required: false
380
+ },
381
+ {
382
+ name: 'isAlmAction',
383
+ kind: 'Scalar',
384
+ required: false
385
+ }
386
+ ]
387
+ };
388
+ };
389
+ function equals$l(existing, incoming) {
390
+ const existing_isAlmAction = existing.isAlmAction;
391
+ const incoming_isAlmAction = incoming.isAlmAction;
392
+ // if at least one of these optionals is defined
393
+ if (existing_isAlmAction !== undefined || incoming_isAlmAction !== undefined) {
394
+ // if one of these is not defined we know the other is defined and therefore
395
+ // not equal
396
+ if (existing_isAlmAction === undefined || incoming_isAlmAction === undefined) {
397
+ return false;
398
+ }
399
+ if (!(existing_isAlmAction === incoming_isAlmAction)) {
400
+ return false;
401
+ }
402
+ }
403
+ const existing_displayOrder = existing.displayOrder;
404
+ const incoming_displayOrder = incoming.displayOrder;
405
+ // if at least one of these optionals is defined
406
+ if (existing_displayOrder !== undefined || incoming_displayOrder !== undefined) {
407
+ // if one of these is not defined we know the other is defined and therefore
408
+ // not equal
409
+ if (existing_displayOrder === undefined || incoming_displayOrder === undefined) {
410
+ return false;
411
+ }
412
+ if (!(existing_displayOrder === incoming_displayOrder)) {
413
+ return false;
414
+ }
415
+ }
416
+ const existing_componentName = existing.componentName;
417
+ const incoming_componentName = incoming.componentName;
418
+ // if at least one of these optionals is defined
419
+ if (existing_componentName !== undefined || incoming_componentName !== undefined) {
420
+ // if one of these is not defined we know the other is defined and therefore
421
+ // not equal
422
+ if (existing_componentName === undefined || incoming_componentName === undefined) {
423
+ return false;
424
+ }
425
+ if (!(existing_componentName === incoming_componentName)) {
426
+ return false;
427
+ }
428
+ }
429
+ const existing_componentType = existing.componentType;
430
+ const incoming_componentType = incoming.componentType;
431
+ // if at least one of these optionals is defined
432
+ if (existing_componentType !== undefined || incoming_componentType !== undefined) {
433
+ // if one of these is not defined we know the other is defined and therefore
434
+ // not equal
435
+ if (existing_componentType === undefined || incoming_componentType === undefined) {
436
+ return false;
437
+ }
438
+ if (!(existing_componentType === incoming_componentType)) {
439
+ return false;
440
+ }
441
+ }
442
+ const existing_displayLabel = existing.displayLabel;
443
+ const incoming_displayLabel = incoming.displayLabel;
444
+ // if at least one of these optionals is defined
445
+ if (existing_displayLabel !== undefined || incoming_displayLabel !== undefined) {
446
+ // if one of these is not defined we know the other is defined and therefore
447
+ // not equal
448
+ if (existing_displayLabel === undefined || incoming_displayLabel === undefined) {
449
+ return false;
450
+ }
451
+ if (!(existing_displayLabel === incoming_displayLabel)) {
452
+ return false;
453
+ }
454
+ }
455
+ return true;
456
+ }
457
+
458
+ const TTL$9 = 300;
459
+ const VERSION$k = "6fe7d0482ad72b83c24e9eee06a9d065";
460
+ function validate$t(obj, path = 'SearchActionableListMemberRepresentation') {
461
+ const v_error = (() => {
462
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
463
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
464
+ }
465
+ if (obj.actions !== undefined) {
466
+ const obj_actions = obj.actions;
467
+ const path_actions = path + '.actions';
468
+ if (!ArrayIsArray(obj_actions)) {
469
+ return new TypeError('Expected "array" but received "' + typeof obj_actions + '" (at "' + path_actions + '")');
470
+ }
471
+ for (let i = 0; i < obj_actions.length; i++) {
472
+ const obj_actions_item = obj_actions[i];
473
+ const path_actions_item = path_actions + '[' + i + ']';
474
+ const referencepath_actions_itemValidationError = validate$u(obj_actions_item, path_actions_item);
475
+ if (referencepath_actions_itemValidationError !== null) {
476
+ let message = 'Object doesn\'t match ActionRepresentation (at "' + path_actions_item + '")\n';
477
+ message += referencepath_actions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
478
+ return new TypeError(message);
479
+ }
480
+ }
481
+ }
482
+ const obj_fields = obj.fields;
483
+ const path_fields = path + '.fields';
484
+ if (!ArrayIsArray(obj_fields)) {
485
+ return new TypeError('Expected "array" but received "' + typeof obj_fields + '" (at "' + path_fields + '")');
486
+ }
487
+ for (let i = 0; i < obj_fields.length; i++) {
488
+ const obj_fields_item = obj_fields[i];
489
+ const path_fields_item = path_fields + '[' + i + ']';
490
+ if (obj_fields_item === undefined) {
491
+ return new TypeError('Expected "defined" but received "' + typeof obj_fields_item + '" (at "' + path_fields_item + '")');
492
+ }
493
+ }
494
+ if (obj.isColumnsModalVisible !== undefined) {
495
+ const obj_isColumnsModalVisible = obj.isColumnsModalVisible;
496
+ const path_isColumnsModalVisible = path + '.isColumnsModalVisible';
497
+ if (typeof obj_isColumnsModalVisible !== 'boolean') {
498
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isColumnsModalVisible + '" (at "' + path_isColumnsModalVisible + '")');
499
+ }
500
+ }
501
+ const obj_nextPageToken = obj.nextPageToken;
502
+ const path_nextPageToken = path + '.nextPageToken';
503
+ if (typeof obj_nextPageToken !== 'string') {
504
+ return new TypeError('Expected "string" but received "' + typeof obj_nextPageToken + '" (at "' + path_nextPageToken + '")');
505
+ }
506
+ if (obj.objectName !== undefined) {
507
+ const obj_objectName = obj.objectName;
508
+ const path_objectName = path + '.objectName';
509
+ if (typeof obj_objectName !== 'string') {
510
+ return new TypeError('Expected "string" but received "' + typeof obj_objectName + '" (at "' + path_objectName + '")');
511
+ }
512
+ }
513
+ const obj_records = obj.records;
514
+ const path_records = path + '.records';
515
+ if (!ArrayIsArray(obj_records)) {
516
+ return new TypeError('Expected "array" but received "' + typeof obj_records + '" (at "' + path_records + '")');
517
+ }
518
+ for (let i = 0; i < obj_records.length; i++) {
519
+ const obj_records_item = obj_records[i];
520
+ const path_records_item = path_records + '[' + i + ']';
521
+ if (obj_records_item === undefined) {
522
+ return new TypeError('Expected "defined" but received "' + typeof obj_records_item + '" (at "' + path_records_item + '")');
523
+ }
524
+ }
525
+ })();
526
+ return v_error === undefined ? null : v_error;
527
+ }
528
+ const RepresentationType$9 = 'SearchActionableListMemberRepresentation';
529
+ function keyBuilder$d(luvio, config) {
530
+ return keyPrefix + '::' + RepresentationType$9 + ':' + config.nextPageToken;
531
+ }
532
+ function keyBuilderFromType$5(luvio, object) {
533
+ const keyParams = {
534
+ nextPageToken: object.nextPageToken
535
+ };
536
+ return keyBuilder$d(luvio, keyParams);
537
+ }
538
+ function normalize$9(input, existing, path, luvio, store, timestamp) {
539
+ return input;
540
+ }
541
+ const select$v = function SearchActionableListMemberRepresentationSelect() {
542
+ const { selections: ActionRepresentation__selections, opaque: ActionRepresentation__opaque, } = select$w();
543
+ return {
544
+ kind: 'Fragment',
545
+ version: VERSION$k,
546
+ private: [],
547
+ selections: [
548
+ {
549
+ name: 'actions',
550
+ kind: 'Object',
551
+ plural: true,
552
+ selections: ActionRepresentation__selections,
553
+ required: false
554
+ },
555
+ {
556
+ name: 'fields',
557
+ kind: 'Object',
558
+ // any
559
+ },
560
+ {
561
+ name: 'isColumnsModalVisible',
562
+ kind: 'Scalar',
563
+ required: false
564
+ },
565
+ {
566
+ name: 'nextPageToken',
567
+ kind: 'Scalar'
568
+ },
569
+ {
570
+ name: 'objectName',
571
+ kind: 'Scalar',
572
+ required: false
573
+ },
574
+ {
575
+ name: 'records',
576
+ kind: 'Object',
577
+ // any
578
+ }
579
+ ]
580
+ };
581
+ };
582
+ function equals$k(existing, incoming) {
583
+ const existing_isColumnsModalVisible = existing.isColumnsModalVisible;
584
+ const incoming_isColumnsModalVisible = incoming.isColumnsModalVisible;
585
+ // if at least one of these optionals is defined
586
+ if (existing_isColumnsModalVisible !== undefined || incoming_isColumnsModalVisible !== undefined) {
587
+ // if one of these is not defined we know the other is defined and therefore
588
+ // not equal
589
+ if (existing_isColumnsModalVisible === undefined || incoming_isColumnsModalVisible === undefined) {
590
+ return false;
591
+ }
592
+ if (!(existing_isColumnsModalVisible === incoming_isColumnsModalVisible)) {
593
+ return false;
594
+ }
595
+ }
596
+ const existing_nextPageToken = existing.nextPageToken;
597
+ const incoming_nextPageToken = incoming.nextPageToken;
598
+ if (!(existing_nextPageToken === incoming_nextPageToken)) {
599
+ return false;
600
+ }
601
+ const existing_objectName = existing.objectName;
602
+ const incoming_objectName = incoming.objectName;
603
+ // if at least one of these optionals is defined
604
+ if (existing_objectName !== undefined || incoming_objectName !== undefined) {
605
+ // if one of these is not defined we know the other is defined and therefore
606
+ // not equal
607
+ if (existing_objectName === undefined || incoming_objectName === undefined) {
608
+ return false;
609
+ }
610
+ if (!(existing_objectName === incoming_objectName)) {
611
+ return false;
612
+ }
613
+ }
614
+ const existing_actions = existing.actions;
615
+ const incoming_actions = incoming.actions;
616
+ // if at least one of these optionals is defined
617
+ if (existing_actions !== undefined || incoming_actions !== undefined) {
618
+ // if one of these is not defined we know the other is defined and therefore
619
+ // not equal
620
+ if (existing_actions === undefined || incoming_actions === undefined) {
621
+ return false;
622
+ }
623
+ const equals_actions_items = equalsArray(existing_actions, incoming_actions, (existing_actions_item, incoming_actions_item) => {
624
+ if (!(equals$l(existing_actions_item, incoming_actions_item))) {
625
+ return false;
626
+ }
627
+ });
628
+ if (equals_actions_items === false) {
629
+ return false;
630
+ }
631
+ }
632
+ const existing_fields = existing.fields;
633
+ const incoming_fields = incoming.fields;
634
+ const equals_fields_items = equalsArray(existing_fields, incoming_fields, (existing_fields_item, incoming_fields_item) => {
635
+ if (JSONStringify(incoming_fields_item) !== JSONStringify(existing_fields_item)) {
636
+ return false;
637
+ }
638
+ });
639
+ if (equals_fields_items === false) {
640
+ return false;
641
+ }
642
+ const existing_records = existing.records;
643
+ const incoming_records = incoming.records;
644
+ const equals_records_items = equalsArray(existing_records, incoming_records, (existing_records_item, incoming_records_item) => {
645
+ if (JSONStringify(incoming_records_item) !== JSONStringify(existing_records_item)) {
646
+ return false;
647
+ }
648
+ });
649
+ if (equals_records_items === false) {
650
+ return false;
651
+ }
652
+ return true;
653
+ }
654
+ const ingest$9 = function SearchActionableListMemberRepresentationIngest(input, path, luvio, store, timestamp) {
655
+ if (process.env.NODE_ENV !== 'production') {
656
+ const validateError = validate$t(input);
657
+ if (validateError !== null) {
658
+ throw validateError;
659
+ }
660
+ }
661
+ const key = keyBuilderFromType$5(luvio, input);
662
+ const ttlToUse = TTL$9;
663
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$9, "sales-excellence", VERSION$k, RepresentationType$9, equals$k);
664
+ return createLink(key);
665
+ };
666
+ function getTypeCacheKeys$9(rootKeySet, luvio, input, fullPathFactory) {
667
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
668
+ const rootKey = keyBuilderFromType$5(luvio, input);
669
+ rootKeySet.set(rootKey, {
670
+ namespace: keyPrefix,
671
+ representationName: RepresentationType$9,
672
+ mergeable: false
673
+ });
674
+ }
675
+
676
+ function select$u(luvio, params) {
677
+ return select$v();
678
+ }
679
+ function getResponseCacheKeys$a(storeKeyMap, luvio, resourceParams, response) {
680
+ getTypeCacheKeys$9(storeKeyMap, luvio, response);
681
+ }
682
+ function ingestSuccess$a(luvio, resourceParams, response) {
683
+ const { body } = response;
684
+ const key = keyBuilderFromType$5(luvio, body);
685
+ luvio.storeIngest(key, ingest$9, body);
686
+ const snapshot = luvio.storeLookup({
687
+ recordId: key,
688
+ node: select$u(),
689
+ variables: {},
690
+ });
691
+ if (process.env.NODE_ENV !== 'production') {
692
+ if (snapshot.state !== 'Fulfilled') {
693
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
694
+ }
695
+ }
696
+ deepFreeze(snapshot.data);
697
+ return snapshot;
698
+ }
699
+ function createResourceRequest$a(config) {
700
+ const headers = {};
701
+ return {
702
+ baseUri: '/services/data/v66.0',
703
+ basePath: '/connect/sales-excellence/actionable-list-members',
704
+ method: 'post',
705
+ body: config.body,
706
+ urlParams: {},
707
+ queryParams: {},
708
+ headers,
709
+ priority: 'normal',
710
+ };
711
+ }
712
+
713
+ const adapterName$a = 'actionableListMemberSearch';
714
+ const actionableListMemberSearch_ConfigPropertyMetadata = [
715
+ generateParamConfigMetadata('actionableListMemberSearchInput', true, 2 /* Body */, 4 /* Unsupported */),
716
+ ];
717
+ const actionableListMemberSearch_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$a, actionableListMemberSearch_ConfigPropertyMetadata);
718
+ const createResourceParams$a = /*#__PURE__*/ createResourceParams$b(actionableListMemberSearch_ConfigPropertyMetadata);
719
+ function typeCheckConfig$a(untrustedConfig) {
720
+ const config = {};
721
+ const untrustedConfig_actionableListMemberSearchInput = untrustedConfig.actionableListMemberSearchInput;
722
+ const referenceSearchActionableListMemberInputRepresentationValidationError = validate$v(untrustedConfig_actionableListMemberSearchInput);
723
+ if (referenceSearchActionableListMemberInputRepresentationValidationError === null) {
724
+ config.actionableListMemberSearchInput = untrustedConfig_actionableListMemberSearchInput;
725
+ }
726
+ return config;
727
+ }
728
+ function validateAdapterConfig$a(untrustedConfig, configPropertyNames) {
729
+ if (!untrustedIsObject(untrustedConfig)) {
730
+ return null;
731
+ }
732
+ if (process.env.NODE_ENV !== 'production') {
733
+ validateConfig(untrustedConfig, configPropertyNames);
734
+ }
735
+ const config = typeCheckConfig$a(untrustedConfig);
736
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
737
+ return null;
738
+ }
739
+ return config;
740
+ }
741
+ function buildNetworkSnapshot$a(luvio, config, options) {
742
+ const resourceParams = createResourceParams$a(config);
743
+ const request = createResourceRequest$a(resourceParams);
744
+ return luvio.dispatchResourceRequest(request, options)
745
+ .then((response) => {
746
+ return luvio.handleSuccessResponse(() => {
747
+ const snapshot = ingestSuccess$a(luvio, resourceParams, response);
748
+ return luvio.storeBroadcast().then(() => snapshot);
749
+ }, () => {
750
+ const cache = new StoreKeyMap();
751
+ getResponseCacheKeys$a(cache, luvio, resourceParams, response.body);
752
+ return cache;
753
+ });
754
+ }, (response) => {
755
+ deepFreeze(response);
756
+ throw response;
757
+ });
758
+ }
759
+ const actionableListMemberSearchAdapterFactory = (luvio) => {
760
+ return function actionableListMemberSearch(untrustedConfig) {
761
+ const config = validateAdapterConfig$a(untrustedConfig, actionableListMemberSearch_ConfigPropertyNames);
762
+ // Invalid or incomplete config
763
+ if (config === null) {
764
+ throw new Error('Invalid config for "actionableListMemberSearch"');
765
+ }
766
+ return buildNetworkSnapshot$a(luvio, config);
767
+ };
768
+ };
769
+
770
+ function select$t(luvio, params) {
771
+ return select$v();
772
+ }
773
+ function getResponseCacheKeys$9(storeKeyMap, luvio, resourceParams, response) {
774
+ getTypeCacheKeys$9(storeKeyMap, luvio, response);
775
+ }
776
+ function ingestSuccess$9(luvio, resourceParams, response) {
777
+ const { body } = response;
778
+ const key = keyBuilderFromType$5(luvio, body);
779
+ luvio.storeIngest(key, ingest$9, body);
780
+ const snapshot = luvio.storeLookup({
781
+ recordId: key,
782
+ node: select$t(),
783
+ variables: {},
784
+ });
785
+ if (process.env.NODE_ENV !== 'production') {
786
+ if (snapshot.state !== 'Fulfilled') {
787
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
788
+ }
789
+ }
790
+ deepFreeze(snapshot.data);
791
+ return snapshot;
792
+ }
793
+ function createResourceRequest$9(config) {
794
+ const headers = {};
795
+ return {
796
+ baseUri: '/services/data/v66.0',
797
+ basePath: '/connect/sales-excellence/actionable-list-members/' + config.urlParams.actionableListId + '',
798
+ method: 'post',
799
+ body: config.body,
800
+ urlParams: config.urlParams,
801
+ queryParams: {},
802
+ headers,
803
+ priority: 'normal',
804
+ };
805
+ }
806
+
807
+ const adapterName$9 = 'actionableListMemberSearchById';
808
+ const actionableListMemberSearchById_ConfigPropertyMetadata = [
809
+ generateParamConfigMetadata('actionableListId', true, 0 /* UrlParameter */, 0 /* String */),
810
+ generateParamConfigMetadata('actionableListMemberSearchInput', true, 2 /* Body */, 4 /* Unsupported */),
811
+ ];
812
+ const actionableListMemberSearchById_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$9, actionableListMemberSearchById_ConfigPropertyMetadata);
813
+ const createResourceParams$9 = /*#__PURE__*/ createResourceParams$b(actionableListMemberSearchById_ConfigPropertyMetadata);
814
+ function typeCheckConfig$9(untrustedConfig) {
815
+ const config = {};
816
+ typeCheckConfig$b(untrustedConfig, config, actionableListMemberSearchById_ConfigPropertyMetadata);
817
+ const untrustedConfig_actionableListMemberSearchInput = untrustedConfig.actionableListMemberSearchInput;
818
+ const referenceSearchActionableListMemberInputRepresentationValidationError = validate$v(untrustedConfig_actionableListMemberSearchInput);
819
+ if (referenceSearchActionableListMemberInputRepresentationValidationError === null) {
820
+ config.actionableListMemberSearchInput = untrustedConfig_actionableListMemberSearchInput;
821
+ }
822
+ return config;
823
+ }
824
+ function validateAdapterConfig$9(untrustedConfig, configPropertyNames) {
825
+ if (!untrustedIsObject(untrustedConfig)) {
826
+ return null;
827
+ }
828
+ if (process.env.NODE_ENV !== 'production') {
829
+ validateConfig(untrustedConfig, configPropertyNames);
830
+ }
831
+ const config = typeCheckConfig$9(untrustedConfig);
832
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
833
+ return null;
834
+ }
835
+ return config;
836
+ }
837
+ function buildNetworkSnapshot$9(luvio, config, options) {
838
+ const resourceParams = createResourceParams$9(config);
839
+ const request = createResourceRequest$9(resourceParams);
840
+ return luvio.dispatchResourceRequest(request, options)
841
+ .then((response) => {
842
+ return luvio.handleSuccessResponse(() => {
843
+ const snapshot = ingestSuccess$9(luvio, resourceParams, response);
844
+ return luvio.storeBroadcast().then(() => snapshot);
845
+ }, () => {
846
+ const cache = new StoreKeyMap();
847
+ getResponseCacheKeys$9(cache, luvio, resourceParams, response.body);
848
+ return cache;
849
+ });
850
+ }, (response) => {
851
+ deepFreeze(response);
852
+ throw response;
853
+ });
854
+ }
855
+ const actionableListMemberSearchByIdAdapterFactory = (luvio) => {
856
+ return function actionableListMemberSearchById(untrustedConfig) {
857
+ const config = validateAdapterConfig$9(untrustedConfig, actionableListMemberSearchById_ConfigPropertyNames);
858
+ // Invalid or incomplete config
859
+ if (config === null) {
860
+ throw new Error('Invalid config for "actionableListMemberSearchById"');
861
+ }
862
+ return buildNetworkSnapshot$9(luvio, config);
863
+ };
864
+ };
865
+
866
+ function validate$s(obj, path = 'ActionableListFieldsInputRepresentation') {
867
+ const v_error = (() => {
868
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
869
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
870
+ }
871
+ if (obj.endDate !== undefined) {
872
+ const obj_endDate = obj.endDate;
873
+ const path_endDate = path + '.endDate';
874
+ if (typeof obj_endDate !== 'string') {
875
+ return new TypeError('Expected "string" but received "' + typeof obj_endDate + '" (at "' + path_endDate + '")');
876
+ }
877
+ }
878
+ if (obj.isAutoAssignmentAllowed !== undefined) {
879
+ const obj_isAutoAssignmentAllowed = obj.isAutoAssignmentAllowed;
880
+ const path_isAutoAssignmentAllowed = path + '.isAutoAssignmentAllowed';
881
+ if (typeof obj_isAutoAssignmentAllowed !== 'boolean') {
882
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isAutoAssignmentAllowed + '" (at "' + path_isAutoAssignmentAllowed + '")');
883
+ }
884
+ }
885
+ if (obj.omniScriptKey !== undefined) {
886
+ const obj_omniScriptKey = obj.omniScriptKey;
887
+ const path_omniScriptKey = path + '.omniScriptKey';
888
+ if (typeof obj_omniScriptKey !== 'string') {
889
+ return new TypeError('Expected "string" but received "' + typeof obj_omniScriptKey + '" (at "' + path_omniScriptKey + '")');
890
+ }
891
+ }
892
+ const obj_priority = obj.priority;
893
+ const path_priority = path + '.priority';
894
+ if (typeof obj_priority !== 'string') {
895
+ return new TypeError('Expected "string" but received "' + typeof obj_priority + '" (at "' + path_priority + '")');
896
+ }
897
+ if (obj.sortField !== undefined) {
898
+ const obj_sortField = obj.sortField;
899
+ const path_sortField = path + '.sortField';
900
+ if (typeof obj_sortField !== 'string') {
901
+ return new TypeError('Expected "string" but received "' + typeof obj_sortField + '" (at "' + path_sortField + '")');
902
+ }
903
+ }
904
+ if (obj.sortOrder !== undefined) {
905
+ const obj_sortOrder = obj.sortOrder;
906
+ const path_sortOrder = path + '.sortOrder';
907
+ if (typeof obj_sortOrder !== 'string') {
908
+ return new TypeError('Expected "string" but received "' + typeof obj_sortOrder + '" (at "' + path_sortOrder + '")');
909
+ }
910
+ }
911
+ })();
912
+ return v_error === undefined ? null : v_error;
913
+ }
914
+
915
+ function validate$r(obj, path = 'AssigneeInputRepresentation') {
916
+ const v_error = (() => {
917
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
918
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
919
+ }
920
+ const obj_name = obj.name;
921
+ const path_name = path + '.name';
922
+ if (typeof obj_name !== 'string') {
923
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
924
+ }
925
+ const obj_type = obj.type;
926
+ const path_type = path + '.type';
927
+ if (typeof obj_type !== 'string') {
928
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
929
+ }
930
+ })();
931
+ return v_error === undefined ? null : v_error;
932
+ }
933
+
934
+ function validate$q(obj, path = 'ActionableListMemberFieldsInputRepresentation') {
935
+ const v_error = (() => {
936
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
937
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
938
+ }
939
+ const obj_assignee = obj.assignee;
940
+ const path_assignee = path + '.assignee';
941
+ const referencepath_assigneeValidationError = validate$r(obj_assignee, path_assignee);
942
+ if (referencepath_assigneeValidationError !== null) {
943
+ let message = 'Object doesn\'t match AssigneeInputRepresentation (at "' + path_assignee + '")\n';
944
+ message += referencepath_assigneeValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
945
+ return new TypeError(message);
946
+ }
947
+ })();
948
+ return v_error === undefined ? null : v_error;
949
+ }
950
+
951
+ function validate$p(obj, path = 'AssignActionableListInputRepresentation') {
952
+ const v_error = (() => {
953
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
954
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
955
+ }
956
+ const obj_actionableListFields = obj.actionableListFields;
957
+ const path_actionableListFields = path + '.actionableListFields';
958
+ const referencepath_actionableListFieldsValidationError = validate$s(obj_actionableListFields, path_actionableListFields);
959
+ if (referencepath_actionableListFieldsValidationError !== null) {
960
+ let message = 'Object doesn\'t match ActionableListFieldsInputRepresentation (at "' + path_actionableListFields + '")\n';
961
+ message += referencepath_actionableListFieldsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
962
+ return new TypeError(message);
963
+ }
964
+ const obj_actionableListMemberFields = obj.actionableListMemberFields;
965
+ const path_actionableListMemberFields = path + '.actionableListMemberFields';
966
+ const referencepath_actionableListMemberFieldsValidationError = validate$q(obj_actionableListMemberFields, path_actionableListMemberFields);
967
+ if (referencepath_actionableListMemberFieldsValidationError !== null) {
968
+ let message = 'Object doesn\'t match ActionableListMemberFieldsInputRepresentation (at "' + path_actionableListMemberFields + '")\n';
969
+ message += referencepath_actionableListMemberFieldsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
970
+ return new TypeError(message);
971
+ }
972
+ if (obj.actionableListMemberRecordIds !== undefined) {
973
+ const obj_actionableListMemberRecordIds = obj.actionableListMemberRecordIds;
974
+ const path_actionableListMemberRecordIds = path + '.actionableListMemberRecordIds';
975
+ if (!ArrayIsArray(obj_actionableListMemberRecordIds)) {
976
+ return new TypeError('Expected "array" but received "' + typeof obj_actionableListMemberRecordIds + '" (at "' + path_actionableListMemberRecordIds + '")');
977
+ }
978
+ for (let i = 0; i < obj_actionableListMemberRecordIds.length; i++) {
979
+ const obj_actionableListMemberRecordIds_item = obj_actionableListMemberRecordIds[i];
980
+ const path_actionableListMemberRecordIds_item = path_actionableListMemberRecordIds + '[' + i + ']';
981
+ if (typeof obj_actionableListMemberRecordIds_item !== 'string') {
982
+ return new TypeError('Expected "string" but received "' + typeof obj_actionableListMemberRecordIds_item + '" (at "' + path_actionableListMemberRecordIds_item + '")');
983
+ }
984
+ }
985
+ }
986
+ if (obj.autoAssignee !== undefined) {
987
+ const obj_autoAssignee = obj.autoAssignee;
988
+ const path_autoAssignee = path + '.autoAssignee';
989
+ if (typeof obj_autoAssignee !== 'object' || ArrayIsArray(obj_autoAssignee) || obj_autoAssignee === null) {
990
+ return new TypeError('Expected "object" but received "' + typeof obj_autoAssignee + '" (at "' + path_autoAssignee + '")');
991
+ }
992
+ }
993
+ })();
994
+ return v_error === undefined ? null : v_error;
995
+ }
996
+
997
+ const VERSION$j = "c9b9be79dac59b38a528222283da782d";
998
+ function validate$o(obj, path = 'SalesExcellenceStatusRepresentation') {
999
+ const v_error = (() => {
1000
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1001
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1002
+ }
1003
+ const obj_code = obj.code;
1004
+ const path_code = path + '.code';
1005
+ if (typeof obj_code !== 'number' || (typeof obj_code === 'number' && Math.floor(obj_code) !== obj_code)) {
1006
+ return new TypeError('Expected "integer" but received "' + typeof obj_code + '" (at "' + path_code + '")');
1007
+ }
1008
+ const obj_message = obj.message;
1009
+ const path_message = path + '.message';
1010
+ if (typeof obj_message !== 'string') {
1011
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
1012
+ }
1013
+ })();
1014
+ return v_error === undefined ? null : v_error;
1015
+ }
1016
+ const select$s = function SalesExcellenceStatusRepresentationSelect() {
1017
+ return {
1018
+ kind: 'Fragment',
1019
+ version: VERSION$j,
1020
+ private: [],
1021
+ selections: [
1022
+ {
1023
+ name: 'code',
1024
+ kind: 'Scalar'
1025
+ },
1026
+ {
1027
+ name: 'message',
1028
+ kind: 'Scalar'
1029
+ }
1030
+ ]
1031
+ };
1032
+ };
1033
+ function equals$j(existing, incoming) {
1034
+ const existing_code = existing.code;
1035
+ const incoming_code = incoming.code;
1036
+ if (!(existing_code === incoming_code)) {
1037
+ return false;
1038
+ }
1039
+ const existing_message = existing.message;
1040
+ const incoming_message = incoming.message;
1041
+ if (!(existing_message === incoming_message)) {
1042
+ return false;
1043
+ }
1044
+ return true;
1045
+ }
1046
+
1047
+ const TTL$8 = 300;
1048
+ const VERSION$i = "15d1cf786c4441e62012f571d16954c0";
1049
+ function validate$n(obj, path = 'AssignActionableListRepresentation') {
1050
+ const v_error = (() => {
1051
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1052
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1053
+ }
1054
+ const obj_actionableListId = obj.actionableListId;
1055
+ const path_actionableListId = path + '.actionableListId';
1056
+ if (typeof obj_actionableListId !== 'string') {
1057
+ return new TypeError('Expected "string" but received "' + typeof obj_actionableListId + '" (at "' + path_actionableListId + '")');
1058
+ }
1059
+ const obj_status = obj.status;
1060
+ const path_status = path + '.status';
1061
+ const referencepath_statusValidationError = validate$o(obj_status, path_status);
1062
+ if (referencepath_statusValidationError !== null) {
1063
+ let message = 'Object doesn\'t match SalesExcellenceStatusRepresentation (at "' + path_status + '")\n';
1064
+ message += referencepath_statusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1065
+ return new TypeError(message);
1066
+ }
1067
+ })();
1068
+ return v_error === undefined ? null : v_error;
1069
+ }
1070
+ const RepresentationType$8 = 'AssignActionableListRepresentation';
1071
+ function keyBuilder$c(luvio, config) {
1072
+ return keyPrefix + '::' + RepresentationType$8 + ':' + config.actionableListId;
1073
+ }
1074
+ function keyBuilderFromType$4(luvio, object) {
1075
+ const keyParams = {
1076
+ actionableListId: object.actionableListId
1077
+ };
1078
+ return keyBuilder$c(luvio, keyParams);
1079
+ }
1080
+ function normalize$8(input, existing, path, luvio, store, timestamp) {
1081
+ return input;
1082
+ }
1083
+ const select$r = function AssignActionableListRepresentationSelect() {
1084
+ const { selections: SalesExcellenceStatusRepresentation__selections, opaque: SalesExcellenceStatusRepresentation__opaque, } = select$s();
1085
+ return {
1086
+ kind: 'Fragment',
1087
+ version: VERSION$i,
1088
+ private: [],
1089
+ selections: [
1090
+ {
1091
+ name: 'actionableListId',
1092
+ kind: 'Scalar'
1093
+ },
1094
+ {
1095
+ name: 'status',
1096
+ kind: 'Object',
1097
+ selections: SalesExcellenceStatusRepresentation__selections
1098
+ }
1099
+ ]
1100
+ };
1101
+ };
1102
+ function equals$i(existing, incoming) {
1103
+ const existing_actionableListId = existing.actionableListId;
1104
+ const incoming_actionableListId = incoming.actionableListId;
1105
+ if (!(existing_actionableListId === incoming_actionableListId)) {
1106
+ return false;
1107
+ }
1108
+ const existing_status = existing.status;
1109
+ const incoming_status = incoming.status;
1110
+ if (!(equals$j(existing_status, incoming_status))) {
1111
+ return false;
1112
+ }
1113
+ return true;
1114
+ }
1115
+ const ingest$8 = function AssignActionableListRepresentationIngest(input, path, luvio, store, timestamp) {
1116
+ if (process.env.NODE_ENV !== 'production') {
1117
+ const validateError = validate$n(input);
1118
+ if (validateError !== null) {
1119
+ throw validateError;
1120
+ }
1121
+ }
1122
+ const key = keyBuilderFromType$4(luvio, input);
1123
+ const ttlToUse = TTL$8;
1124
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$8, "sales-excellence", VERSION$i, RepresentationType$8, equals$i);
1125
+ return createLink(key);
1126
+ };
1127
+ function getTypeCacheKeys$8(rootKeySet, luvio, input, fullPathFactory) {
1128
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1129
+ const rootKey = keyBuilderFromType$4(luvio, input);
1130
+ rootKeySet.set(rootKey, {
1131
+ namespace: keyPrefix,
1132
+ representationName: RepresentationType$8,
1133
+ mergeable: false
1134
+ });
1135
+ }
1136
+
1137
+ function select$q(luvio, params) {
1138
+ return select$r();
1139
+ }
1140
+ function getResponseCacheKeys$8(storeKeyMap, luvio, resourceParams, response) {
1141
+ getTypeCacheKeys$8(storeKeyMap, luvio, response);
1142
+ }
1143
+ function ingestSuccess$8(luvio, resourceParams, response) {
1144
+ const { body } = response;
1145
+ const key = keyBuilderFromType$4(luvio, body);
1146
+ luvio.storeIngest(key, ingest$8, body);
1147
+ const snapshot = luvio.storeLookup({
1148
+ recordId: key,
1149
+ node: select$q(),
1150
+ variables: {},
1151
+ });
1152
+ if (process.env.NODE_ENV !== 'production') {
1153
+ if (snapshot.state !== 'Fulfilled') {
1154
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1155
+ }
1156
+ }
1157
+ deepFreeze(snapshot.data);
1158
+ return snapshot;
1159
+ }
1160
+ function createResourceRequest$8(config) {
1161
+ const headers = {};
1162
+ return {
1163
+ baseUri: '/services/data/v66.0',
1164
+ basePath: '/connect/sales-excellence/actionable-list/assignment/' + config.urlParams.actionableListId + '',
1165
+ method: 'post',
1166
+ body: config.body,
1167
+ urlParams: config.urlParams,
1168
+ queryParams: {},
1169
+ headers,
1170
+ priority: 'normal',
1171
+ };
1172
+ }
1173
+
1174
+ const adapterName$8 = 'actionableListAssignment';
1175
+ const actionableListAssignment_ConfigPropertyMetadata = [
1176
+ generateParamConfigMetadata('actionableListId', true, 0 /* UrlParameter */, 0 /* String */),
1177
+ generateParamConfigMetadata('assignActionableList', true, 2 /* Body */, 4 /* Unsupported */),
1178
+ ];
1179
+ const actionableListAssignment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$8, actionableListAssignment_ConfigPropertyMetadata);
1180
+ const createResourceParams$8 = /*#__PURE__*/ createResourceParams$b(actionableListAssignment_ConfigPropertyMetadata);
1181
+ function typeCheckConfig$8(untrustedConfig) {
1182
+ const config = {};
1183
+ typeCheckConfig$b(untrustedConfig, config, actionableListAssignment_ConfigPropertyMetadata);
1184
+ const untrustedConfig_assignActionableList = untrustedConfig.assignActionableList;
1185
+ const referenceAssignActionableListInputRepresentationValidationError = validate$p(untrustedConfig_assignActionableList);
1186
+ if (referenceAssignActionableListInputRepresentationValidationError === null) {
1187
+ config.assignActionableList = untrustedConfig_assignActionableList;
1188
+ }
1189
+ return config;
1190
+ }
1191
+ function validateAdapterConfig$8(untrustedConfig, configPropertyNames) {
1192
+ if (!untrustedIsObject(untrustedConfig)) {
1193
+ return null;
1194
+ }
1195
+ if (process.env.NODE_ENV !== 'production') {
1196
+ validateConfig(untrustedConfig, configPropertyNames);
1197
+ }
1198
+ const config = typeCheckConfig$8(untrustedConfig);
1199
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1200
+ return null;
1201
+ }
1202
+ return config;
1203
+ }
1204
+ function buildNetworkSnapshot$8(luvio, config, options) {
1205
+ const resourceParams = createResourceParams$8(config);
1206
+ const request = createResourceRequest$8(resourceParams);
1207
+ return luvio.dispatchResourceRequest(request, options)
1208
+ .then((response) => {
1209
+ return luvio.handleSuccessResponse(() => {
1210
+ const snapshot = ingestSuccess$8(luvio, resourceParams, response);
1211
+ return luvio.storeBroadcast().then(() => snapshot);
1212
+ }, () => {
1213
+ const cache = new StoreKeyMap();
1214
+ getResponseCacheKeys$8(cache, luvio, resourceParams, response.body);
1215
+ return cache;
1216
+ });
1217
+ }, (response) => {
1218
+ deepFreeze(response);
1219
+ throw response;
1220
+ });
1221
+ }
1222
+ const actionableListAssignmentAdapterFactory = (luvio) => {
1223
+ return function actionableListAssignment(untrustedConfig) {
1224
+ const config = validateAdapterConfig$8(untrustedConfig, actionableListAssignment_ConfigPropertyNames);
1225
+ // Invalid or incomplete config
1226
+ if (config === null) {
1227
+ throw new Error('Invalid config for "actionableListAssignment"');
1228
+ }
1229
+ return buildNetworkSnapshot$8(luvio, config);
1230
+ };
1231
+ };
1232
+
1233
+ function validate$m(obj, path = 'ActionableListKPIMappingInputRepresentation') {
1234
+ const v_error = (() => {
1235
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1236
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1237
+ }
1238
+ const obj_actionableListId = obj.actionableListId;
1239
+ const path_actionableListId = path + '.actionableListId';
1240
+ if (typeof obj_actionableListId !== 'string') {
1241
+ return new TypeError('Expected "string" but received "' + typeof obj_actionableListId + '" (at "' + path_actionableListId + '")');
1242
+ }
1243
+ const obj_selectedKpis = obj.selectedKpis;
1244
+ const path_selectedKpis = path + '.selectedKpis';
1245
+ if (!ArrayIsArray(obj_selectedKpis)) {
1246
+ return new TypeError('Expected "array" but received "' + typeof obj_selectedKpis + '" (at "' + path_selectedKpis + '")');
1247
+ }
1248
+ for (let i = 0; i < obj_selectedKpis.length; i++) {
1249
+ const obj_selectedKpis_item = obj_selectedKpis[i];
1250
+ const path_selectedKpis_item = path_selectedKpis + '[' + i + ']';
1251
+ if (typeof obj_selectedKpis_item !== 'object' || ArrayIsArray(obj_selectedKpis_item) || obj_selectedKpis_item === null) {
1252
+ return new TypeError('Expected "object" but received "' + typeof obj_selectedKpis_item + '" (at "' + path_selectedKpis_item + '")');
1253
+ }
1254
+ }
1255
+ })();
1256
+ return v_error === undefined ? null : v_error;
1257
+ }
1258
+
1259
+ const VERSION$h = "664447b62c7867c12fe645c53773d8cd";
1260
+ function validate$l(obj, path = 'StatusResponseRepresentation') {
1261
+ const v_error = (() => {
1262
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1263
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1264
+ }
1265
+ const obj_code = obj.code;
1266
+ const path_code = path + '.code';
1267
+ if (typeof obj_code !== 'string') {
1268
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
1269
+ }
1270
+ const obj_message = obj.message;
1271
+ const path_message = path + '.message';
1272
+ if (typeof obj_message !== 'string') {
1273
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
1274
+ }
1275
+ })();
1276
+ return v_error === undefined ? null : v_error;
1277
+ }
1278
+ const select$p = function StatusResponseRepresentationSelect() {
1279
+ return {
1280
+ kind: 'Fragment',
1281
+ version: VERSION$h,
1282
+ private: [],
1283
+ selections: [
1284
+ {
1285
+ name: 'code',
1286
+ kind: 'Scalar'
1287
+ },
1288
+ {
1289
+ name: 'message',
1290
+ kind: 'Scalar'
1291
+ }
1292
+ ]
1293
+ };
1294
+ };
1295
+ function equals$h(existing, incoming) {
1296
+ const existing_code = existing.code;
1297
+ const incoming_code = incoming.code;
1298
+ if (!(existing_code === incoming_code)) {
1299
+ return false;
1300
+ }
1301
+ const existing_message = existing.message;
1302
+ const incoming_message = incoming.message;
1303
+ if (!(existing_message === incoming_message)) {
1304
+ return false;
1305
+ }
1306
+ return true;
1307
+ }
1308
+
1309
+ const TTL$7 = 1000;
1310
+ const VERSION$g = "7e8d28dea9e0cad583080eee5645985c";
1311
+ function validate$k(obj, path = 'ActionableListKPIMappingRepresentation') {
1312
+ const v_error = (() => {
1313
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1314
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1315
+ }
1316
+ const obj_actionableListId = obj.actionableListId;
1317
+ const path_actionableListId = path + '.actionableListId';
1318
+ if (typeof obj_actionableListId !== 'string') {
1319
+ return new TypeError('Expected "string" but received "' + typeof obj_actionableListId + '" (at "' + path_actionableListId + '")');
1320
+ }
1321
+ const obj_status = obj.status;
1322
+ const path_status = path + '.status';
1323
+ const referencepath_statusValidationError = validate$l(obj_status, path_status);
1324
+ if (referencepath_statusValidationError !== null) {
1325
+ let message = 'Object doesn\'t match StatusResponseRepresentation (at "' + path_status + '")\n';
1326
+ message += referencepath_statusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1327
+ return new TypeError(message);
1328
+ }
1329
+ })();
1330
+ return v_error === undefined ? null : v_error;
1331
+ }
1332
+ const RepresentationType$7 = 'ActionableListKPIMappingRepresentation';
1333
+ function keyBuilder$b(luvio, config) {
1334
+ return keyPrefix + '::' + RepresentationType$7 + ':' + config.message;
1335
+ }
1336
+ function keyBuilderFromType$3(luvio, object) {
1337
+ const keyParams = {
1338
+ message: object.status.message
1339
+ };
1340
+ return keyBuilder$b(luvio, keyParams);
1341
+ }
1342
+ function normalize$7(input, existing, path, luvio, store, timestamp) {
1343
+ return input;
1344
+ }
1345
+ const select$o = function ActionableListKPIMappingRepresentationSelect() {
1346
+ const { selections: StatusResponseRepresentation__selections, opaque: StatusResponseRepresentation__opaque, } = select$p();
1347
+ return {
1348
+ kind: 'Fragment',
1349
+ version: VERSION$g,
1350
+ private: [],
1351
+ selections: [
1352
+ {
1353
+ name: 'actionableListId',
1354
+ kind: 'Scalar'
1355
+ },
1356
+ {
1357
+ name: 'status',
1358
+ kind: 'Object',
1359
+ selections: StatusResponseRepresentation__selections
1360
+ }
1361
+ ]
1362
+ };
1363
+ };
1364
+ function equals$g(existing, incoming) {
1365
+ const existing_actionableListId = existing.actionableListId;
1366
+ const incoming_actionableListId = incoming.actionableListId;
1367
+ if (!(existing_actionableListId === incoming_actionableListId)) {
1368
+ return false;
1369
+ }
1370
+ const existing_status = existing.status;
1371
+ const incoming_status = incoming.status;
1372
+ if (!(equals$h(existing_status, incoming_status))) {
1373
+ return false;
1374
+ }
1375
+ return true;
1376
+ }
1377
+ const ingest$7 = function ActionableListKPIMappingRepresentationIngest(input, path, luvio, store, timestamp) {
1378
+ if (process.env.NODE_ENV !== 'production') {
1379
+ const validateError = validate$k(input);
1380
+ if (validateError !== null) {
1381
+ throw validateError;
1382
+ }
1383
+ }
1384
+ const key = keyBuilderFromType$3(luvio, input);
1385
+ const ttlToUse = TTL$7;
1386
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$7, "sales-excellence", VERSION$g, RepresentationType$7, equals$g);
1387
+ return createLink(key);
1388
+ };
1389
+ function getTypeCacheKeys$7(rootKeySet, luvio, input, fullPathFactory) {
1390
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1391
+ const rootKey = keyBuilderFromType$3(luvio, input);
1392
+ rootKeySet.set(rootKey, {
1393
+ namespace: keyPrefix,
1394
+ representationName: RepresentationType$7,
1395
+ mergeable: false
1396
+ });
1397
+ }
1398
+
1399
+ function select$n(luvio, params) {
1400
+ return select$o();
1401
+ }
1402
+ function getResponseCacheKeys$7(storeKeyMap, luvio, resourceParams, response) {
1403
+ getTypeCacheKeys$7(storeKeyMap, luvio, response);
1404
+ }
1405
+ function ingestSuccess$7(luvio, resourceParams, response) {
1406
+ const { body } = response;
1407
+ const key = keyBuilderFromType$3(luvio, body);
1408
+ luvio.storeIngest(key, ingest$7, body);
1409
+ const snapshot = luvio.storeLookup({
1410
+ recordId: key,
1411
+ node: select$n(),
1412
+ variables: {},
1413
+ });
1414
+ if (process.env.NODE_ENV !== 'production') {
1415
+ if (snapshot.state !== 'Fulfilled') {
1416
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1417
+ }
1418
+ }
1419
+ deepFreeze(snapshot.data);
1420
+ return snapshot;
1421
+ }
1422
+ function createResourceRequest$7(config) {
1423
+ const headers = {};
1424
+ return {
1425
+ baseUri: '/services/data/v66.0',
1426
+ basePath: '/connect/sales-excellence/actionable-list/key-performance-indicators/mappings',
1427
+ method: 'post',
1428
+ body: config.body,
1429
+ urlParams: {},
1430
+ queryParams: {},
1431
+ headers,
1432
+ priority: 'normal',
1433
+ };
1434
+ }
1435
+
1436
+ const adapterName$7 = 'generateActionableListKpiMappingResults';
1437
+ const generateActionableListKpiMappingResults_ConfigPropertyMetadata = [
1438
+ generateParamConfigMetadata('generateActionableListKpiMapping', true, 2 /* Body */, 4 /* Unsupported */),
1439
+ ];
1440
+ const generateActionableListKpiMappingResults_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$7, generateActionableListKpiMappingResults_ConfigPropertyMetadata);
1441
+ const createResourceParams$7 = /*#__PURE__*/ createResourceParams$b(generateActionableListKpiMappingResults_ConfigPropertyMetadata);
1442
+ function typeCheckConfig$7(untrustedConfig) {
1443
+ const config = {};
1444
+ const untrustedConfig_generateActionableListKpiMapping = untrustedConfig.generateActionableListKpiMapping;
1445
+ const referenceActionableListKPIMappingInputRepresentationValidationError = validate$m(untrustedConfig_generateActionableListKpiMapping);
1446
+ if (referenceActionableListKPIMappingInputRepresentationValidationError === null) {
1447
+ config.generateActionableListKpiMapping = untrustedConfig_generateActionableListKpiMapping;
1448
+ }
1449
+ return config;
1450
+ }
1451
+ function validateAdapterConfig$7(untrustedConfig, configPropertyNames) {
1452
+ if (!untrustedIsObject(untrustedConfig)) {
1453
+ return null;
1454
+ }
1455
+ if (process.env.NODE_ENV !== 'production') {
1456
+ validateConfig(untrustedConfig, configPropertyNames);
1457
+ }
1458
+ const config = typeCheckConfig$7(untrustedConfig);
1459
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1460
+ return null;
1461
+ }
1462
+ return config;
1463
+ }
1464
+ function buildNetworkSnapshot$7(luvio, config, options) {
1465
+ const resourceParams = createResourceParams$7(config);
1466
+ const request = createResourceRequest$7(resourceParams);
1467
+ return luvio.dispatchResourceRequest(request, options)
1468
+ .then((response) => {
1469
+ return luvio.handleSuccessResponse(() => {
1470
+ const snapshot = ingestSuccess$7(luvio, resourceParams, response);
1471
+ return luvio.storeBroadcast().then(() => snapshot);
1472
+ }, () => {
1473
+ const cache = new StoreKeyMap();
1474
+ getResponseCacheKeys$7(cache, luvio, resourceParams, response.body);
1475
+ return cache;
1476
+ });
1477
+ }, (response) => {
1478
+ deepFreeze(response);
1479
+ throw response;
1480
+ });
1481
+ }
1482
+ const generateActionableListKpiMappingResultsAdapterFactory = (luvio) => {
1483
+ return function generateActionableListKpiMappingResults(untrustedConfig) {
1484
+ const config = validateAdapterConfig$7(untrustedConfig, generateActionableListKpiMappingResults_ConfigPropertyNames);
1485
+ // Invalid or incomplete config
1486
+ if (config === null) {
1487
+ throw new Error('Invalid config for "generateActionableListKpiMappingResults"');
1488
+ }
1489
+ return buildNetworkSnapshot$7(luvio, config);
1490
+ };
1491
+ };
1492
+
1493
+ function validate$j(obj, path = 'KpiBarInputRepresentation') {
1494
+ const v_error = (() => {
1495
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1496
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1497
+ }
1498
+ const obj_actionableListId = obj.actionableListId;
1499
+ const path_actionableListId = path + '.actionableListId';
1500
+ if (typeof obj_actionableListId !== 'string') {
1501
+ return new TypeError('Expected "string" but received "' + typeof obj_actionableListId + '" (at "' + path_actionableListId + '")');
1502
+ }
1503
+ if (obj.filters !== undefined) {
1504
+ const obj_filters = obj.filters;
1505
+ const path_filters = path + '.filters';
1506
+ if (!ArrayIsArray(obj_filters)) {
1507
+ return new TypeError('Expected "array" but received "' + typeof obj_filters + '" (at "' + path_filters + '")');
1508
+ }
1509
+ for (let i = 0; i < obj_filters.length; i++) {
1510
+ const obj_filters_item = obj_filters[i];
1511
+ const path_filters_item = path_filters + '[' + i + ']';
1512
+ const referencepath_filters_itemValidationError = validate$z(obj_filters_item, path_filters_item);
1513
+ if (referencepath_filters_itemValidationError !== null) {
1514
+ let message = 'Object doesn\'t match FilterRepresentation (at "' + path_filters_item + '")\n';
1515
+ message += referencepath_filters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1516
+ return new TypeError(message);
1517
+ }
1518
+ }
1519
+ }
1520
+ if (obj.isFetchAvailableKpis !== undefined) {
1521
+ const obj_isFetchAvailableKpis = obj.isFetchAvailableKpis;
1522
+ const path_isFetchAvailableKpis = path + '.isFetchAvailableKpis';
1523
+ if (typeof obj_isFetchAvailableKpis !== 'boolean') {
1524
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isFetchAvailableKpis + '" (at "' + path_isFetchAvailableKpis + '")');
1525
+ }
1526
+ }
1527
+ if (obj.slotSize !== undefined) {
1528
+ const obj_slotSize = obj.slotSize;
1529
+ const path_slotSize = path + '.slotSize';
1530
+ if (typeof obj_slotSize !== 'number' || (typeof obj_slotSize === 'number' && Math.floor(obj_slotSize) !== obj_slotSize)) {
1531
+ return new TypeError('Expected "integer" but received "' + typeof obj_slotSize + '" (at "' + path_slotSize + '")');
1532
+ }
1533
+ }
1534
+ })();
1535
+ return v_error === undefined ? null : v_error;
1536
+ }
1537
+
1538
+ const VERSION$f = "0f0e85e3b9b83240d295d2754b6d38ef";
1539
+ function validate$i(obj, path = 'ActionableListAvailableKpiRepresentation') {
1540
+ const v_error = (() => {
1541
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1542
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1543
+ }
1544
+ if (obj.almsId !== undefined) {
1545
+ const obj_almsId = obj.almsId;
1546
+ const path_almsId = path + '.almsId';
1547
+ let obj_almsId_union0 = null;
1548
+ const obj_almsId_union0_error = (() => {
1549
+ if (typeof obj_almsId !== 'string') {
1550
+ return new TypeError('Expected "string" but received "' + typeof obj_almsId + '" (at "' + path_almsId + '")');
1551
+ }
1552
+ })();
1553
+ if (obj_almsId_union0_error != null) {
1554
+ obj_almsId_union0 = obj_almsId_union0_error.message;
1555
+ }
1556
+ let obj_almsId_union1 = null;
1557
+ const obj_almsId_union1_error = (() => {
1558
+ if (obj_almsId !== null) {
1559
+ return new TypeError('Expected "null" but received "' + typeof obj_almsId + '" (at "' + path_almsId + '")');
1560
+ }
1561
+ })();
1562
+ if (obj_almsId_union1_error != null) {
1563
+ obj_almsId_union1 = obj_almsId_union1_error.message;
1564
+ }
1565
+ if (obj_almsId_union0 && obj_almsId_union1) {
1566
+ let message = 'Object doesn\'t match union (at "' + path_almsId + '")';
1567
+ message += '\n' + obj_almsId_union0.split('\n').map((line) => '\t' + line).join('\n');
1568
+ message += '\n' + obj_almsId_union1.split('\n').map((line) => '\t' + line).join('\n');
1569
+ return new TypeError(message);
1570
+ }
1571
+ }
1572
+ if (obj.description !== undefined) {
1573
+ const obj_description = obj.description;
1574
+ const path_description = path + '.description';
1575
+ let obj_description_union0 = null;
1576
+ const obj_description_union0_error = (() => {
1577
+ if (typeof obj_description !== 'string') {
1578
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1579
+ }
1580
+ })();
1581
+ if (obj_description_union0_error != null) {
1582
+ obj_description_union0 = obj_description_union0_error.message;
1583
+ }
1584
+ let obj_description_union1 = null;
1585
+ const obj_description_union1_error = (() => {
1586
+ if (obj_description !== null) {
1587
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
1588
+ }
1589
+ })();
1590
+ if (obj_description_union1_error != null) {
1591
+ obj_description_union1 = obj_description_union1_error.message;
1592
+ }
1593
+ if (obj_description_union0 && obj_description_union1) {
1594
+ let message = 'Object doesn\'t match union (at "' + path_description + '")';
1595
+ message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
1596
+ message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
1597
+ return new TypeError(message);
1598
+ }
1599
+ }
1600
+ const obj_label = obj.label;
1601
+ const path_label = path + '.label';
1602
+ if (typeof obj_label !== 'string') {
1603
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
1604
+ }
1605
+ if (obj.metricId !== undefined) {
1606
+ const obj_metricId = obj.metricId;
1607
+ const path_metricId = path + '.metricId';
1608
+ let obj_metricId_union0 = null;
1609
+ const obj_metricId_union0_error = (() => {
1610
+ if (typeof obj_metricId !== 'string') {
1611
+ return new TypeError('Expected "string" but received "' + typeof obj_metricId + '" (at "' + path_metricId + '")');
1612
+ }
1613
+ })();
1614
+ if (obj_metricId_union0_error != null) {
1615
+ obj_metricId_union0 = obj_metricId_union0_error.message;
1616
+ }
1617
+ let obj_metricId_union1 = null;
1618
+ const obj_metricId_union1_error = (() => {
1619
+ if (obj_metricId !== null) {
1620
+ return new TypeError('Expected "null" but received "' + typeof obj_metricId + '" (at "' + path_metricId + '")');
1621
+ }
1622
+ })();
1623
+ if (obj_metricId_union1_error != null) {
1624
+ obj_metricId_union1 = obj_metricId_union1_error.message;
1625
+ }
1626
+ if (obj_metricId_union0 && obj_metricId_union1) {
1627
+ let message = 'Object doesn\'t match union (at "' + path_metricId + '")';
1628
+ message += '\n' + obj_metricId_union0.split('\n').map((line) => '\t' + line).join('\n');
1629
+ message += '\n' + obj_metricId_union1.split('\n').map((line) => '\t' + line).join('\n');
1630
+ return new TypeError(message);
1631
+ }
1632
+ }
1633
+ })();
1634
+ return v_error === undefined ? null : v_error;
1635
+ }
1636
+ const select$m = function ActionableListAvailableKpiRepresentationSelect() {
1637
+ return {
1638
+ kind: 'Fragment',
1639
+ version: VERSION$f,
1640
+ private: [],
1641
+ selections: [
1642
+ {
1643
+ name: 'almsId',
1644
+ kind: 'Scalar',
1645
+ required: false
1646
+ },
1647
+ {
1648
+ name: 'description',
1649
+ kind: 'Scalar',
1650
+ required: false
1651
+ },
1652
+ {
1653
+ name: 'label',
1654
+ kind: 'Scalar'
1655
+ },
1656
+ {
1657
+ name: 'metricId',
1658
+ kind: 'Scalar',
1659
+ required: false
1660
+ }
1661
+ ]
1662
+ };
1663
+ };
1664
+ function equals$f(existing, incoming) {
1665
+ const existing_label = existing.label;
1666
+ const incoming_label = incoming.label;
1667
+ if (!(existing_label === incoming_label)) {
1668
+ return false;
1669
+ }
1670
+ const existing_almsId = existing.almsId;
1671
+ const incoming_almsId = incoming.almsId;
1672
+ // if at least one of these optionals is defined
1673
+ if (existing_almsId !== undefined || incoming_almsId !== undefined) {
1674
+ // if one of these is not defined we know the other is defined and therefore
1675
+ // not equal
1676
+ if (existing_almsId === undefined || incoming_almsId === undefined) {
1677
+ return false;
1678
+ }
1679
+ if (!(existing_almsId === incoming_almsId)) {
1680
+ return false;
1681
+ }
1682
+ }
1683
+ const existing_description = existing.description;
1684
+ const incoming_description = incoming.description;
1685
+ // if at least one of these optionals is defined
1686
+ if (existing_description !== undefined || incoming_description !== undefined) {
1687
+ // if one of these is not defined we know the other is defined and therefore
1688
+ // not equal
1689
+ if (existing_description === undefined || incoming_description === undefined) {
1690
+ return false;
1691
+ }
1692
+ if (!(existing_description === incoming_description)) {
1693
+ return false;
1694
+ }
1695
+ }
1696
+ const existing_metricId = existing.metricId;
1697
+ const incoming_metricId = incoming.metricId;
1698
+ // if at least one of these optionals is defined
1699
+ if (existing_metricId !== undefined || incoming_metricId !== undefined) {
1700
+ // if one of these is not defined we know the other is defined and therefore
1701
+ // not equal
1702
+ if (existing_metricId === undefined || incoming_metricId === undefined) {
1703
+ return false;
1704
+ }
1705
+ if (!(existing_metricId === incoming_metricId)) {
1706
+ return false;
1707
+ }
1708
+ }
1709
+ return true;
1710
+ }
1711
+
1712
+ const VERSION$e = "0268ac7fdbd14f2565afaa7e65cae014";
1713
+ function validate$h(obj, path = 'KpiBarMetricRepresentation') {
1714
+ const v_error = (() => {
1715
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1716
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1717
+ }
1718
+ if (obj.almsId !== undefined) {
1719
+ const obj_almsId = obj.almsId;
1720
+ const path_almsId = path + '.almsId';
1721
+ let obj_almsId_union0 = null;
1722
+ const obj_almsId_union0_error = (() => {
1723
+ if (typeof obj_almsId !== 'string') {
1724
+ return new TypeError('Expected "string" but received "' + typeof obj_almsId + '" (at "' + path_almsId + '")');
1725
+ }
1726
+ })();
1727
+ if (obj_almsId_union0_error != null) {
1728
+ obj_almsId_union0 = obj_almsId_union0_error.message;
1729
+ }
1730
+ let obj_almsId_union1 = null;
1731
+ const obj_almsId_union1_error = (() => {
1732
+ if (obj_almsId !== null) {
1733
+ return new TypeError('Expected "null" but received "' + typeof obj_almsId + '" (at "' + path_almsId + '")');
1734
+ }
1735
+ })();
1736
+ if (obj_almsId_union1_error != null) {
1737
+ obj_almsId_union1 = obj_almsId_union1_error.message;
1738
+ }
1739
+ if (obj_almsId_union0 && obj_almsId_union1) {
1740
+ let message = 'Object doesn\'t match union (at "' + path_almsId + '")';
1741
+ message += '\n' + obj_almsId_union0.split('\n').map((line) => '\t' + line).join('\n');
1742
+ message += '\n' + obj_almsId_union1.split('\n').map((line) => '\t' + line).join('\n');
1743
+ return new TypeError(message);
1744
+ }
1745
+ }
1746
+ const obj_dataType = obj.dataType;
1747
+ const path_dataType = path + '.dataType';
1748
+ let obj_dataType_union0 = null;
1749
+ const obj_dataType_union0_error = (() => {
1750
+ if (typeof obj_dataType !== 'string') {
1751
+ return new TypeError('Expected "string" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
1752
+ }
1753
+ })();
1754
+ if (obj_dataType_union0_error != null) {
1755
+ obj_dataType_union0 = obj_dataType_union0_error.message;
1756
+ }
1757
+ let obj_dataType_union1 = null;
1758
+ const obj_dataType_union1_error = (() => {
1759
+ if (obj_dataType !== null) {
1760
+ return new TypeError('Expected "null" but received "' + typeof obj_dataType + '" (at "' + path_dataType + '")');
1761
+ }
1762
+ })();
1763
+ if (obj_dataType_union1_error != null) {
1764
+ obj_dataType_union1 = obj_dataType_union1_error.message;
1765
+ }
1766
+ if (obj_dataType_union0 && obj_dataType_union1) {
1767
+ let message = 'Object doesn\'t match union (at "' + path_dataType + '")';
1768
+ message += '\n' + obj_dataType_union0.split('\n').map((line) => '\t' + line).join('\n');
1769
+ message += '\n' + obj_dataType_union1.split('\n').map((line) => '\t' + line).join('\n');
1770
+ return new TypeError(message);
1771
+ }
1772
+ if (obj.displayOrder !== undefined) {
1773
+ const obj_displayOrder = obj.displayOrder;
1774
+ const path_displayOrder = path + '.displayOrder';
1775
+ if (typeof obj_displayOrder !== 'number' || (typeof obj_displayOrder === 'number' && Math.floor(obj_displayOrder) !== obj_displayOrder)) {
1776
+ return new TypeError('Expected "integer" but received "' + typeof obj_displayOrder + '" (at "' + path_displayOrder + '")');
1777
+ }
1778
+ }
1779
+ const obj_errorMessage = obj.errorMessage;
1780
+ const path_errorMessage = path + '.errorMessage';
1781
+ if (typeof obj_errorMessage !== 'string') {
1782
+ return new TypeError('Expected "string" but received "' + typeof obj_errorMessage + '" (at "' + path_errorMessage + '")');
1783
+ }
1784
+ const obj_filters = obj.filters;
1785
+ const path_filters = path + '.filters';
1786
+ if (!ArrayIsArray(obj_filters)) {
1787
+ return new TypeError('Expected "array" but received "' + typeof obj_filters + '" (at "' + path_filters + '")');
1788
+ }
1789
+ for (let i = 0; i < obj_filters.length; i++) {
1790
+ const obj_filters_item = obj_filters[i];
1791
+ const path_filters_item = path_filters + '[' + i + ']';
1792
+ const referencepath_filters_itemValidationError = validate$z(obj_filters_item, path_filters_item);
1793
+ if (referencepath_filters_itemValidationError !== null) {
1794
+ let message = 'Object doesn\'t match FilterRepresentation (at "' + path_filters_item + '")\n';
1795
+ message += referencepath_filters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1796
+ return new TypeError(message);
1797
+ }
1798
+ }
1799
+ const obj_isError = obj.isError;
1800
+ const path_isError = path + '.isError';
1801
+ if (typeof obj_isError !== 'boolean') {
1802
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isError + '" (at "' + path_isError + '")');
1803
+ }
1804
+ const obj_label = obj.label;
1805
+ const path_label = path + '.label';
1806
+ if (typeof obj_label !== 'string') {
1807
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
1808
+ }
1809
+ if (obj.metricId !== undefined) {
1810
+ const obj_metricId = obj.metricId;
1811
+ const path_metricId = path + '.metricId';
1812
+ let obj_metricId_union0 = null;
1813
+ const obj_metricId_union0_error = (() => {
1814
+ if (typeof obj_metricId !== 'string') {
1815
+ return new TypeError('Expected "string" but received "' + typeof obj_metricId + '" (at "' + path_metricId + '")');
1816
+ }
1817
+ })();
1818
+ if (obj_metricId_union0_error != null) {
1819
+ obj_metricId_union0 = obj_metricId_union0_error.message;
1820
+ }
1821
+ let obj_metricId_union1 = null;
1822
+ const obj_metricId_union1_error = (() => {
1823
+ if (obj_metricId !== null) {
1824
+ return new TypeError('Expected "null" but received "' + typeof obj_metricId + '" (at "' + path_metricId + '")');
1825
+ }
1826
+ })();
1827
+ if (obj_metricId_union1_error != null) {
1828
+ obj_metricId_union1 = obj_metricId_union1_error.message;
1829
+ }
1830
+ if (obj_metricId_union0 && obj_metricId_union1) {
1831
+ let message = 'Object doesn\'t match union (at "' + path_metricId + '")';
1832
+ message += '\n' + obj_metricId_union0.split('\n').map((line) => '\t' + line).join('\n');
1833
+ message += '\n' + obj_metricId_union1.split('\n').map((line) => '\t' + line).join('\n');
1834
+ return new TypeError(message);
1835
+ }
1836
+ }
1837
+ const obj_value = obj.value;
1838
+ const path_value = path + '.value';
1839
+ if (typeof obj_value !== 'string') {
1840
+ return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
1841
+ }
1842
+ })();
1843
+ return v_error === undefined ? null : v_error;
1844
+ }
1845
+ const select$l = function KpiBarMetricRepresentationSelect() {
1846
+ const { selections: FilterRepresentation__selections, opaque: FilterRepresentation__opaque, } = select$x();
1847
+ return {
1848
+ kind: 'Fragment',
1849
+ version: VERSION$e,
1850
+ private: [],
1851
+ selections: [
1852
+ {
1853
+ name: 'almsId',
1854
+ kind: 'Scalar',
1855
+ required: false
1856
+ },
1857
+ {
1858
+ name: 'dataType',
1859
+ kind: 'Scalar'
1860
+ },
1861
+ {
1862
+ name: 'displayOrder',
1863
+ kind: 'Scalar',
1864
+ required: false
1865
+ },
1866
+ {
1867
+ name: 'errorMessage',
1868
+ kind: 'Scalar'
1869
+ },
1870
+ {
1871
+ name: 'filters',
1872
+ kind: 'Object',
1873
+ plural: true,
1874
+ selections: FilterRepresentation__selections
1875
+ },
1876
+ {
1877
+ name: 'isError',
1878
+ kind: 'Scalar'
1879
+ },
1880
+ {
1881
+ name: 'label',
1882
+ kind: 'Scalar'
1883
+ },
1884
+ {
1885
+ name: 'metricId',
1886
+ kind: 'Scalar',
1887
+ required: false
1888
+ },
1889
+ {
1890
+ name: 'value',
1891
+ kind: 'Scalar'
1892
+ }
1893
+ ]
1894
+ };
1895
+ };
1896
+ function equals$e(existing, incoming) {
1897
+ const existing_isError = existing.isError;
1898
+ const incoming_isError = incoming.isError;
1899
+ if (!(existing_isError === incoming_isError)) {
1900
+ return false;
1901
+ }
1902
+ const existing_displayOrder = existing.displayOrder;
1903
+ const incoming_displayOrder = incoming.displayOrder;
1904
+ // if at least one of these optionals is defined
1905
+ if (existing_displayOrder !== undefined || incoming_displayOrder !== undefined) {
1906
+ // if one of these is not defined we know the other is defined and therefore
1907
+ // not equal
1908
+ if (existing_displayOrder === undefined || incoming_displayOrder === undefined) {
1909
+ return false;
1910
+ }
1911
+ if (!(existing_displayOrder === incoming_displayOrder)) {
1912
+ return false;
1913
+ }
1914
+ }
1915
+ const existing_errorMessage = existing.errorMessage;
1916
+ const incoming_errorMessage = incoming.errorMessage;
1917
+ if (!(existing_errorMessage === incoming_errorMessage)) {
1918
+ return false;
1919
+ }
1920
+ const existing_label = existing.label;
1921
+ const incoming_label = incoming.label;
1922
+ if (!(existing_label === incoming_label)) {
1923
+ return false;
1924
+ }
1925
+ const existing_value = existing.value;
1926
+ const incoming_value = incoming.value;
1927
+ if (!(existing_value === incoming_value)) {
1928
+ return false;
1929
+ }
1930
+ const existing_almsId = existing.almsId;
1931
+ const incoming_almsId = incoming.almsId;
1932
+ // if at least one of these optionals is defined
1933
+ if (existing_almsId !== undefined || incoming_almsId !== undefined) {
1934
+ // if one of these is not defined we know the other is defined and therefore
1935
+ // not equal
1936
+ if (existing_almsId === undefined || incoming_almsId === undefined) {
1937
+ return false;
1938
+ }
1939
+ if (!(existing_almsId === incoming_almsId)) {
1940
+ return false;
1941
+ }
1942
+ }
1943
+ const existing_dataType = existing.dataType;
1944
+ const incoming_dataType = incoming.dataType;
1945
+ if (!(existing_dataType === incoming_dataType)) {
1946
+ return false;
1947
+ }
1948
+ const existing_filters = existing.filters;
1949
+ const incoming_filters = incoming.filters;
1950
+ const equals_filters_items = equalsArray(existing_filters, incoming_filters, (existing_filters_item, incoming_filters_item) => {
1951
+ if (!(equals$m(existing_filters_item, incoming_filters_item))) {
1952
+ return false;
1953
+ }
1954
+ });
1955
+ if (equals_filters_items === false) {
1956
+ return false;
1957
+ }
1958
+ const existing_metricId = existing.metricId;
1959
+ const incoming_metricId = incoming.metricId;
1960
+ // if at least one of these optionals is defined
1961
+ if (existing_metricId !== undefined || incoming_metricId !== undefined) {
1962
+ // if one of these is not defined we know the other is defined and therefore
1963
+ // not equal
1964
+ if (existing_metricId === undefined || incoming_metricId === undefined) {
1965
+ return false;
1966
+ }
1967
+ if (!(existing_metricId === incoming_metricId)) {
1968
+ return false;
1969
+ }
1970
+ }
1971
+ return true;
1972
+ }
1973
+
1974
+ const TTL$6 = 1000;
1975
+ const VERSION$d = "18c17c9f4fee641329d32737fa497505";
1976
+ function validate$g(obj, path = 'KpiBarOutputRepresentation') {
1977
+ const v_error = (() => {
1978
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1979
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1980
+ }
1981
+ const obj_availableKpis = obj.availableKpis;
1982
+ const path_availableKpis = path + '.availableKpis';
1983
+ if (!ArrayIsArray(obj_availableKpis)) {
1984
+ return new TypeError('Expected "array" but received "' + typeof obj_availableKpis + '" (at "' + path_availableKpis + '")');
1985
+ }
1986
+ for (let i = 0; i < obj_availableKpis.length; i++) {
1987
+ const obj_availableKpis_item = obj_availableKpis[i];
1988
+ const path_availableKpis_item = path_availableKpis + '[' + i + ']';
1989
+ const referencepath_availableKpis_itemValidationError = validate$i(obj_availableKpis_item, path_availableKpis_item);
1990
+ if (referencepath_availableKpis_itemValidationError !== null) {
1991
+ let message = 'Object doesn\'t match ActionableListAvailableKpiRepresentation (at "' + path_availableKpis_item + '")\n';
1992
+ message += referencepath_availableKpis_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1993
+ return new TypeError(message);
1994
+ }
1995
+ }
1996
+ if (obj.isKpiConfigureAllowed !== undefined) {
1997
+ const obj_isKpiConfigureAllowed = obj.isKpiConfigureAllowed;
1998
+ const path_isKpiConfigureAllowed = path + '.isKpiConfigureAllowed';
1999
+ let obj_isKpiConfigureAllowed_union0 = null;
2000
+ const obj_isKpiConfigureAllowed_union0_error = (() => {
2001
+ if (typeof obj_isKpiConfigureAllowed !== 'boolean') {
2002
+ return new TypeError('Expected "boolean" but received "' + typeof obj_isKpiConfigureAllowed + '" (at "' + path_isKpiConfigureAllowed + '")');
2003
+ }
2004
+ })();
2005
+ if (obj_isKpiConfigureAllowed_union0_error != null) {
2006
+ obj_isKpiConfigureAllowed_union0 = obj_isKpiConfigureAllowed_union0_error.message;
2007
+ }
2008
+ let obj_isKpiConfigureAllowed_union1 = null;
2009
+ const obj_isKpiConfigureAllowed_union1_error = (() => {
2010
+ if (obj_isKpiConfigureAllowed !== null) {
2011
+ return new TypeError('Expected "null" but received "' + typeof obj_isKpiConfigureAllowed + '" (at "' + path_isKpiConfigureAllowed + '")');
2012
+ }
2013
+ })();
2014
+ if (obj_isKpiConfigureAllowed_union1_error != null) {
2015
+ obj_isKpiConfigureAllowed_union1 = obj_isKpiConfigureAllowed_union1_error.message;
2016
+ }
2017
+ if (obj_isKpiConfigureAllowed_union0 && obj_isKpiConfigureAllowed_union1) {
2018
+ let message = 'Object doesn\'t match union (at "' + path_isKpiConfigureAllowed + '")';
2019
+ message += '\n' + obj_isKpiConfigureAllowed_union0.split('\n').map((line) => '\t' + line).join('\n');
2020
+ message += '\n' + obj_isKpiConfigureAllowed_union1.split('\n').map((line) => '\t' + line).join('\n');
2021
+ return new TypeError(message);
2022
+ }
2023
+ }
2024
+ const obj_kpiMetrics = obj.kpiMetrics;
2025
+ const path_kpiMetrics = path + '.kpiMetrics';
2026
+ if (!ArrayIsArray(obj_kpiMetrics)) {
2027
+ return new TypeError('Expected "array" but received "' + typeof obj_kpiMetrics + '" (at "' + path_kpiMetrics + '")');
2028
+ }
2029
+ for (let i = 0; i < obj_kpiMetrics.length; i++) {
2030
+ const obj_kpiMetrics_item = obj_kpiMetrics[i];
2031
+ const path_kpiMetrics_item = path_kpiMetrics + '[' + i + ']';
2032
+ const referencepath_kpiMetrics_itemValidationError = validate$h(obj_kpiMetrics_item, path_kpiMetrics_item);
2033
+ if (referencepath_kpiMetrics_itemValidationError !== null) {
2034
+ let message = 'Object doesn\'t match KpiBarMetricRepresentation (at "' + path_kpiMetrics_item + '")\n';
2035
+ message += referencepath_kpiMetrics_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2036
+ return new TypeError(message);
2037
+ }
2038
+ }
2039
+ const obj_status = obj.status;
2040
+ const path_status = path + '.status';
2041
+ const referencepath_statusValidationError = validate$l(obj_status, path_status);
2042
+ if (referencepath_statusValidationError !== null) {
2043
+ let message = 'Object doesn\'t match StatusResponseRepresentation (at "' + path_status + '")\n';
2044
+ message += referencepath_statusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2045
+ return new TypeError(message);
2046
+ }
2047
+ })();
2048
+ return v_error === undefined ? null : v_error;
2049
+ }
2050
+ const RepresentationType$6 = 'KpiBarOutputRepresentation';
2051
+ function keyBuilder$a(luvio, config) {
2052
+ return keyPrefix + '::' + RepresentationType$6 + ':' + config.message;
2053
+ }
2054
+ function keyBuilderFromType$2(luvio, object) {
2055
+ const keyParams = {
2056
+ message: object.status.message
2057
+ };
2058
+ return keyBuilder$a(luvio, keyParams);
2059
+ }
2060
+ function normalize$6(input, existing, path, luvio, store, timestamp) {
2061
+ return input;
2062
+ }
2063
+ const select$k = function KpiBarOutputRepresentationSelect() {
2064
+ const { selections: ActionableListAvailableKpiRepresentation__selections, opaque: ActionableListAvailableKpiRepresentation__opaque, } = select$m();
2065
+ const { selections: KpiBarMetricRepresentation__selections, opaque: KpiBarMetricRepresentation__opaque, } = select$l();
2066
+ const { selections: StatusResponseRepresentation__selections, opaque: StatusResponseRepresentation__opaque, } = select$p();
2067
+ return {
2068
+ kind: 'Fragment',
2069
+ version: VERSION$d,
2070
+ private: [],
2071
+ selections: [
2072
+ {
2073
+ name: 'availableKpis',
2074
+ kind: 'Object',
2075
+ plural: true,
2076
+ selections: ActionableListAvailableKpiRepresentation__selections
2077
+ },
2078
+ {
2079
+ name: 'isKpiConfigureAllowed',
2080
+ kind: 'Scalar',
2081
+ required: false
2082
+ },
2083
+ {
2084
+ name: 'kpiMetrics',
2085
+ kind: 'Object',
2086
+ plural: true,
2087
+ selections: KpiBarMetricRepresentation__selections
2088
+ },
2089
+ {
2090
+ name: 'status',
2091
+ kind: 'Object',
2092
+ selections: StatusResponseRepresentation__selections
2093
+ }
2094
+ ]
2095
+ };
2096
+ };
2097
+ function equals$d(existing, incoming) {
2098
+ const existing_availableKpis = existing.availableKpis;
2099
+ const incoming_availableKpis = incoming.availableKpis;
2100
+ const equals_availableKpis_items = equalsArray(existing_availableKpis, incoming_availableKpis, (existing_availableKpis_item, incoming_availableKpis_item) => {
2101
+ if (!(equals$f(existing_availableKpis_item, incoming_availableKpis_item))) {
2102
+ return false;
2103
+ }
2104
+ });
2105
+ if (equals_availableKpis_items === false) {
2106
+ return false;
2107
+ }
2108
+ const existing_isKpiConfigureAllowed = existing.isKpiConfigureAllowed;
2109
+ const incoming_isKpiConfigureAllowed = incoming.isKpiConfigureAllowed;
2110
+ // if at least one of these optionals is defined
2111
+ if (existing_isKpiConfigureAllowed !== undefined || incoming_isKpiConfigureAllowed !== undefined) {
2112
+ // if one of these is not defined we know the other is defined and therefore
2113
+ // not equal
2114
+ if (existing_isKpiConfigureAllowed === undefined || incoming_isKpiConfigureAllowed === undefined) {
2115
+ return false;
2116
+ }
2117
+ if (!(existing_isKpiConfigureAllowed === incoming_isKpiConfigureAllowed)) {
2118
+ return false;
2119
+ }
2120
+ }
2121
+ const existing_kpiMetrics = existing.kpiMetrics;
2122
+ const incoming_kpiMetrics = incoming.kpiMetrics;
2123
+ const equals_kpiMetrics_items = equalsArray(existing_kpiMetrics, incoming_kpiMetrics, (existing_kpiMetrics_item, incoming_kpiMetrics_item) => {
2124
+ if (!(equals$e(existing_kpiMetrics_item, incoming_kpiMetrics_item))) {
2125
+ return false;
2126
+ }
2127
+ });
2128
+ if (equals_kpiMetrics_items === false) {
2129
+ return false;
2130
+ }
2131
+ const existing_status = existing.status;
2132
+ const incoming_status = incoming.status;
2133
+ if (!(equals$h(existing_status, incoming_status))) {
2134
+ return false;
2135
+ }
2136
+ return true;
2137
+ }
2138
+ const ingest$6 = function KpiBarOutputRepresentationIngest(input, path, luvio, store, timestamp) {
2139
+ if (process.env.NODE_ENV !== 'production') {
2140
+ const validateError = validate$g(input);
2141
+ if (validateError !== null) {
2142
+ throw validateError;
2143
+ }
2144
+ }
2145
+ const key = keyBuilderFromType$2(luvio, input);
2146
+ const ttlToUse = TTL$6;
2147
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$6, "sales-excellence", VERSION$d, RepresentationType$6, equals$d);
2148
+ return createLink(key);
2149
+ };
2150
+ function getTypeCacheKeys$6(rootKeySet, luvio, input, fullPathFactory) {
2151
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2152
+ const rootKey = keyBuilderFromType$2(luvio, input);
2153
+ rootKeySet.set(rootKey, {
2154
+ namespace: keyPrefix,
2155
+ representationName: RepresentationType$6,
2156
+ mergeable: false
2157
+ });
2158
+ }
2159
+
2160
+ function select$j(luvio, params) {
2161
+ return select$k();
2162
+ }
2163
+ function getResponseCacheKeys$6(storeKeyMap, luvio, resourceParams, response) {
2164
+ getTypeCacheKeys$6(storeKeyMap, luvio, response);
2165
+ }
2166
+ function ingestSuccess$6(luvio, resourceParams, response) {
2167
+ const { body } = response;
2168
+ const key = keyBuilderFromType$2(luvio, body);
2169
+ luvio.storeIngest(key, ingest$6, body);
2170
+ const snapshot = luvio.storeLookup({
2171
+ recordId: key,
2172
+ node: select$j(),
2173
+ variables: {},
2174
+ });
2175
+ if (process.env.NODE_ENV !== 'production') {
2176
+ if (snapshot.state !== 'Fulfilled') {
2177
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2178
+ }
2179
+ }
2180
+ deepFreeze(snapshot.data);
2181
+ return snapshot;
2182
+ }
2183
+ function createResourceRequest$6(config) {
2184
+ const headers = {};
2185
+ return {
2186
+ baseUri: '/services/data/v66.0',
2187
+ basePath: '/connect/sales-excellence/actionable-list/kpi',
2188
+ method: 'post',
2189
+ body: config.body,
2190
+ urlParams: {},
2191
+ queryParams: {},
2192
+ headers,
2193
+ priority: 'normal',
2194
+ };
2195
+ }
2196
+
2197
+ const adapterName$6 = 'generateActionableListKpiBarResults';
2198
+ const generateActionableListKpiBarResults_ConfigPropertyMetadata = [
2199
+ generateParamConfigMetadata('generateActionableListKpiBar', true, 2 /* Body */, 4 /* Unsupported */),
2200
+ ];
2201
+ const generateActionableListKpiBarResults_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$6, generateActionableListKpiBarResults_ConfigPropertyMetadata);
2202
+ const createResourceParams$6 = /*#__PURE__*/ createResourceParams$b(generateActionableListKpiBarResults_ConfigPropertyMetadata);
2203
+ function typeCheckConfig$6(untrustedConfig) {
2204
+ const config = {};
2205
+ const untrustedConfig_generateActionableListKpiBar = untrustedConfig.generateActionableListKpiBar;
2206
+ const referenceKpiBarInputRepresentationValidationError = validate$j(untrustedConfig_generateActionableListKpiBar);
2207
+ if (referenceKpiBarInputRepresentationValidationError === null) {
2208
+ config.generateActionableListKpiBar = untrustedConfig_generateActionableListKpiBar;
2209
+ }
2210
+ return config;
2211
+ }
2212
+ function validateAdapterConfig$6(untrustedConfig, configPropertyNames) {
2213
+ if (!untrustedIsObject(untrustedConfig)) {
2214
+ return null;
2215
+ }
2216
+ if (process.env.NODE_ENV !== 'production') {
2217
+ validateConfig(untrustedConfig, configPropertyNames);
2218
+ }
2219
+ const config = typeCheckConfig$6(untrustedConfig);
2220
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2221
+ return null;
2222
+ }
2223
+ return config;
2224
+ }
2225
+ function buildNetworkSnapshot$6(luvio, config, options) {
2226
+ const resourceParams = createResourceParams$6(config);
2227
+ const request = createResourceRequest$6(resourceParams);
2228
+ return luvio.dispatchResourceRequest(request, options)
2229
+ .then((response) => {
2230
+ return luvio.handleSuccessResponse(() => {
2231
+ const snapshot = ingestSuccess$6(luvio, resourceParams, response);
2232
+ return luvio.storeBroadcast().then(() => snapshot);
2233
+ }, () => {
2234
+ const cache = new StoreKeyMap();
2235
+ getResponseCacheKeys$6(cache, luvio, resourceParams, response.body);
2236
+ return cache;
2237
+ });
2238
+ }, (response) => {
2239
+ deepFreeze(response);
2240
+ throw response;
2241
+ });
2242
+ }
2243
+ const generateActionableListKpiBarResultsAdapterFactory = (luvio) => {
2244
+ return function generateActionableListKpiBarResults(untrustedConfig) {
2245
+ const config = validateAdapterConfig$6(untrustedConfig, generateActionableListKpiBarResults_ConfigPropertyNames);
2246
+ // Invalid or incomplete config
2247
+ if (config === null) {
2248
+ throw new Error('Invalid config for "generateActionableListKpiBarResults"');
2249
+ }
2250
+ return buildNetworkSnapshot$6(luvio, config);
2251
+ };
2252
+ };
2253
+
2254
+ const VERSION$c = "7c32234c44b8dc4571127a7b122f9de6";
2255
+ function validate$f(obj, path = 'AssignedActionableListRepresentation') {
2256
+ const v_error = (() => {
2257
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2258
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2259
+ }
2260
+ const obj_id = obj.id;
2261
+ const path_id = path + '.id';
2262
+ if (typeof obj_id !== 'string') {
2263
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
2264
+ }
2265
+ if (obj.memberSortBy !== undefined) {
2266
+ const obj_memberSortBy = obj.memberSortBy;
2267
+ const path_memberSortBy = path + '.memberSortBy';
2268
+ let obj_memberSortBy_union0 = null;
2269
+ const obj_memberSortBy_union0_error = (() => {
2270
+ if (typeof obj_memberSortBy !== 'string') {
2271
+ return new TypeError('Expected "string" but received "' + typeof obj_memberSortBy + '" (at "' + path_memberSortBy + '")');
2272
+ }
2273
+ })();
2274
+ if (obj_memberSortBy_union0_error != null) {
2275
+ obj_memberSortBy_union0 = obj_memberSortBy_union0_error.message;
2276
+ }
2277
+ let obj_memberSortBy_union1 = null;
2278
+ const obj_memberSortBy_union1_error = (() => {
2279
+ if (obj_memberSortBy !== null) {
2280
+ return new TypeError('Expected "null" but received "' + typeof obj_memberSortBy + '" (at "' + path_memberSortBy + '")');
2281
+ }
2282
+ })();
2283
+ if (obj_memberSortBy_union1_error != null) {
2284
+ obj_memberSortBy_union1 = obj_memberSortBy_union1_error.message;
2285
+ }
2286
+ if (obj_memberSortBy_union0 && obj_memberSortBy_union1) {
2287
+ let message = 'Object doesn\'t match union (at "' + path_memberSortBy + '")';
2288
+ message += '\n' + obj_memberSortBy_union0.split('\n').map((line) => '\t' + line).join('\n');
2289
+ message += '\n' + obj_memberSortBy_union1.split('\n').map((line) => '\t' + line).join('\n');
2290
+ return new TypeError(message);
2291
+ }
2292
+ }
2293
+ if (obj.memberSortOrder !== undefined) {
2294
+ const obj_memberSortOrder = obj.memberSortOrder;
2295
+ const path_memberSortOrder = path + '.memberSortOrder';
2296
+ let obj_memberSortOrder_union0 = null;
2297
+ const obj_memberSortOrder_union0_error = (() => {
2298
+ if (typeof obj_memberSortOrder !== 'string') {
2299
+ return new TypeError('Expected "string" but received "' + typeof obj_memberSortOrder + '" (at "' + path_memberSortOrder + '")');
2300
+ }
2301
+ })();
2302
+ if (obj_memberSortOrder_union0_error != null) {
2303
+ obj_memberSortOrder_union0 = obj_memberSortOrder_union0_error.message;
2304
+ }
2305
+ let obj_memberSortOrder_union1 = null;
2306
+ const obj_memberSortOrder_union1_error = (() => {
2307
+ if (obj_memberSortOrder !== null) {
2308
+ return new TypeError('Expected "null" but received "' + typeof obj_memberSortOrder + '" (at "' + path_memberSortOrder + '")');
2309
+ }
2310
+ })();
2311
+ if (obj_memberSortOrder_union1_error != null) {
2312
+ obj_memberSortOrder_union1 = obj_memberSortOrder_union1_error.message;
2313
+ }
2314
+ if (obj_memberSortOrder_union0 && obj_memberSortOrder_union1) {
2315
+ let message = 'Object doesn\'t match union (at "' + path_memberSortOrder + '")';
2316
+ message += '\n' + obj_memberSortOrder_union0.split('\n').map((line) => '\t' + line).join('\n');
2317
+ message += '\n' + obj_memberSortOrder_union1.split('\n').map((line) => '\t' + line).join('\n');
2318
+ return new TypeError(message);
2319
+ }
2320
+ }
2321
+ if (obj.name !== undefined) {
2322
+ const obj_name = obj.name;
2323
+ const path_name = path + '.name';
2324
+ let obj_name_union0 = null;
2325
+ const obj_name_union0_error = (() => {
2326
+ if (typeof obj_name !== 'string') {
2327
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
2328
+ }
2329
+ })();
2330
+ if (obj_name_union0_error != null) {
2331
+ obj_name_union0 = obj_name_union0_error.message;
2332
+ }
2333
+ let obj_name_union1 = null;
2334
+ const obj_name_union1_error = (() => {
2335
+ if (obj_name !== null) {
2336
+ return new TypeError('Expected "null" but received "' + typeof obj_name + '" (at "' + path_name + '")');
2337
+ }
2338
+ })();
2339
+ if (obj_name_union1_error != null) {
2340
+ obj_name_union1 = obj_name_union1_error.message;
2341
+ }
2342
+ if (obj_name_union0 && obj_name_union1) {
2343
+ let message = 'Object doesn\'t match union (at "' + path_name + '")';
2344
+ message += '\n' + obj_name_union0.split('\n').map((line) => '\t' + line).join('\n');
2345
+ message += '\n' + obj_name_union1.split('\n').map((line) => '\t' + line).join('\n');
2346
+ return new TypeError(message);
2347
+ }
2348
+ }
2349
+ if (obj.objectName !== undefined) {
2350
+ const obj_objectName = obj.objectName;
2351
+ const path_objectName = path + '.objectName';
2352
+ let obj_objectName_union0 = null;
2353
+ const obj_objectName_union0_error = (() => {
2354
+ if (typeof obj_objectName !== 'string') {
2355
+ return new TypeError('Expected "string" but received "' + typeof obj_objectName + '" (at "' + path_objectName + '")');
2356
+ }
2357
+ })();
2358
+ if (obj_objectName_union0_error != null) {
2359
+ obj_objectName_union0 = obj_objectName_union0_error.message;
2360
+ }
2361
+ let obj_objectName_union1 = null;
2362
+ const obj_objectName_union1_error = (() => {
2363
+ if (obj_objectName !== null) {
2364
+ return new TypeError('Expected "null" but received "' + typeof obj_objectName + '" (at "' + path_objectName + '")');
2365
+ }
2366
+ })();
2367
+ if (obj_objectName_union1_error != null) {
2368
+ obj_objectName_union1 = obj_objectName_union1_error.message;
2369
+ }
2370
+ if (obj_objectName_union0 && obj_objectName_union1) {
2371
+ let message = 'Object doesn\'t match union (at "' + path_objectName + '")';
2372
+ message += '\n' + obj_objectName_union0.split('\n').map((line) => '\t' + line).join('\n');
2373
+ message += '\n' + obj_objectName_union1.split('\n').map((line) => '\t' + line).join('\n');
2374
+ return new TypeError(message);
2375
+ }
2376
+ }
2377
+ if (obj.priority !== undefined) {
2378
+ const obj_priority = obj.priority;
2379
+ const path_priority = path + '.priority';
2380
+ let obj_priority_union0 = null;
2381
+ const obj_priority_union0_error = (() => {
2382
+ if (typeof obj_priority !== 'string') {
2383
+ return new TypeError('Expected "string" but received "' + typeof obj_priority + '" (at "' + path_priority + '")');
2384
+ }
2385
+ })();
2386
+ if (obj_priority_union0_error != null) {
2387
+ obj_priority_union0 = obj_priority_union0_error.message;
2388
+ }
2389
+ let obj_priority_union1 = null;
2390
+ const obj_priority_union1_error = (() => {
2391
+ if (obj_priority !== null) {
2392
+ return new TypeError('Expected "null" but received "' + typeof obj_priority + '" (at "' + path_priority + '")');
2393
+ }
2394
+ })();
2395
+ if (obj_priority_union1_error != null) {
2396
+ obj_priority_union1 = obj_priority_union1_error.message;
2397
+ }
2398
+ if (obj_priority_union0 && obj_priority_union1) {
2399
+ let message = 'Object doesn\'t match union (at "' + path_priority + '")';
2400
+ message += '\n' + obj_priority_union0.split('\n').map((line) => '\t' + line).join('\n');
2401
+ message += '\n' + obj_priority_union1.split('\n').map((line) => '\t' + line).join('\n');
2402
+ return new TypeError(message);
2403
+ }
2404
+ }
2405
+ })();
2406
+ return v_error === undefined ? null : v_error;
2407
+ }
2408
+ const select$i = function AssignedActionableListRepresentationSelect() {
2409
+ return {
2410
+ kind: 'Fragment',
2411
+ version: VERSION$c,
2412
+ private: [],
2413
+ selections: [
2414
+ {
2415
+ name: 'id',
2416
+ kind: 'Scalar'
2417
+ },
2418
+ {
2419
+ name: 'memberSortBy',
2420
+ kind: 'Scalar',
2421
+ required: false
2422
+ },
2423
+ {
2424
+ name: 'memberSortOrder',
2425
+ kind: 'Scalar',
2426
+ required: false
2427
+ },
2428
+ {
2429
+ name: 'name',
2430
+ kind: 'Scalar',
2431
+ required: false
2432
+ },
2433
+ {
2434
+ name: 'objectName',
2435
+ kind: 'Scalar',
2436
+ required: false
2437
+ },
2438
+ {
2439
+ name: 'priority',
2440
+ kind: 'Scalar',
2441
+ required: false
2442
+ }
2443
+ ]
2444
+ };
2445
+ };
2446
+ function equals$c(existing, incoming) {
2447
+ const existing_id = existing.id;
2448
+ const incoming_id = incoming.id;
2449
+ if (!(existing_id === incoming_id)) {
2450
+ return false;
2451
+ }
2452
+ const existing_memberSortBy = existing.memberSortBy;
2453
+ const incoming_memberSortBy = incoming.memberSortBy;
2454
+ // if at least one of these optionals is defined
2455
+ if (existing_memberSortBy !== undefined || incoming_memberSortBy !== undefined) {
2456
+ // if one of these is not defined we know the other is defined and therefore
2457
+ // not equal
2458
+ if (existing_memberSortBy === undefined || incoming_memberSortBy === undefined) {
2459
+ return false;
2460
+ }
2461
+ if (!(existing_memberSortBy === incoming_memberSortBy)) {
2462
+ return false;
2463
+ }
2464
+ }
2465
+ const existing_memberSortOrder = existing.memberSortOrder;
2466
+ const incoming_memberSortOrder = incoming.memberSortOrder;
2467
+ // if at least one of these optionals is defined
2468
+ if (existing_memberSortOrder !== undefined || incoming_memberSortOrder !== undefined) {
2469
+ // if one of these is not defined we know the other is defined and therefore
2470
+ // not equal
2471
+ if (existing_memberSortOrder === undefined || incoming_memberSortOrder === undefined) {
2472
+ return false;
2473
+ }
2474
+ if (!(existing_memberSortOrder === incoming_memberSortOrder)) {
2475
+ return false;
2476
+ }
2477
+ }
2478
+ const existing_name = existing.name;
2479
+ const incoming_name = incoming.name;
2480
+ // if at least one of these optionals is defined
2481
+ if (existing_name !== undefined || incoming_name !== undefined) {
2482
+ // if one of these is not defined we know the other is defined and therefore
2483
+ // not equal
2484
+ if (existing_name === undefined || incoming_name === undefined) {
2485
+ return false;
2486
+ }
2487
+ if (!(existing_name === incoming_name)) {
2488
+ return false;
2489
+ }
2490
+ }
2491
+ const existing_objectName = existing.objectName;
2492
+ const incoming_objectName = incoming.objectName;
2493
+ // if at least one of these optionals is defined
2494
+ if (existing_objectName !== undefined || incoming_objectName !== undefined) {
2495
+ // if one of these is not defined we know the other is defined and therefore
2496
+ // not equal
2497
+ if (existing_objectName === undefined || incoming_objectName === undefined) {
2498
+ return false;
2499
+ }
2500
+ if (!(existing_objectName === incoming_objectName)) {
2501
+ return false;
2502
+ }
2503
+ }
2504
+ const existing_priority = existing.priority;
2505
+ const incoming_priority = incoming.priority;
2506
+ // if at least one of these optionals is defined
2507
+ if (existing_priority !== undefined || incoming_priority !== undefined) {
2508
+ // if one of these is not defined we know the other is defined and therefore
2509
+ // not equal
2510
+ if (existing_priority === undefined || incoming_priority === undefined) {
2511
+ return false;
2512
+ }
2513
+ if (!(existing_priority === incoming_priority)) {
2514
+ return false;
2515
+ }
2516
+ }
2517
+ return true;
2518
+ }
2519
+
2520
+ const TTL$5 = 10000;
2521
+ const VERSION$b = "66ae54ce61279094c1126ca58d9359c8";
2522
+ function validate$e(obj, path = 'AssignedActionableListsRepresentation') {
2523
+ const v_error = (() => {
2524
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2525
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2526
+ }
2527
+ const obj_actionableLists = obj.actionableLists;
2528
+ const path_actionableLists = path + '.actionableLists';
2529
+ if (!ArrayIsArray(obj_actionableLists)) {
2530
+ return new TypeError('Expected "array" but received "' + typeof obj_actionableLists + '" (at "' + path_actionableLists + '")');
2531
+ }
2532
+ for (let i = 0; i < obj_actionableLists.length; i++) {
2533
+ const obj_actionableLists_item = obj_actionableLists[i];
2534
+ const path_actionableLists_item = path_actionableLists + '[' + i + ']';
2535
+ const referencepath_actionableLists_itemValidationError = validate$f(obj_actionableLists_item, path_actionableLists_item);
2536
+ if (referencepath_actionableLists_itemValidationError !== null) {
2537
+ let message = 'Object doesn\'t match AssignedActionableListRepresentation (at "' + path_actionableLists_item + '")\n';
2538
+ message += referencepath_actionableLists_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2539
+ return new TypeError(message);
2540
+ }
2541
+ }
2542
+ })();
2543
+ return v_error === undefined ? null : v_error;
2544
+ }
2545
+ const RepresentationType$5 = 'AssignedActionableListsRepresentation';
2546
+ function normalize$5(input, existing, path, luvio, store, timestamp) {
2547
+ return input;
2548
+ }
2549
+ const select$h = function AssignedActionableListsRepresentationSelect() {
2550
+ const { selections: AssignedActionableListRepresentation__selections, opaque: AssignedActionableListRepresentation__opaque, } = select$i();
2551
+ return {
2552
+ kind: 'Fragment',
2553
+ version: VERSION$b,
2554
+ private: [],
2555
+ selections: [
2556
+ {
2557
+ name: 'actionableLists',
2558
+ kind: 'Object',
2559
+ plural: true,
2560
+ selections: AssignedActionableListRepresentation__selections
2561
+ }
2562
+ ]
2563
+ };
2564
+ };
2565
+ function equals$b(existing, incoming) {
2566
+ const existing_actionableLists = existing.actionableLists;
2567
+ const incoming_actionableLists = incoming.actionableLists;
2568
+ const equals_actionableLists_items = equalsArray(existing_actionableLists, incoming_actionableLists, (existing_actionableLists_item, incoming_actionableLists_item) => {
2569
+ if (!(equals$c(existing_actionableLists_item, incoming_actionableLists_item))) {
2570
+ return false;
2571
+ }
2572
+ });
2573
+ if (equals_actionableLists_items === false) {
2574
+ return false;
2575
+ }
2576
+ return true;
2577
+ }
2578
+ const ingest$5 = function AssignedActionableListsRepresentationIngest(input, path, luvio, store, timestamp) {
2579
+ if (process.env.NODE_ENV !== 'production') {
2580
+ const validateError = validate$e(input);
2581
+ if (validateError !== null) {
2582
+ throw validateError;
2583
+ }
2584
+ }
2585
+ const key = path.fullPath;
2586
+ const ttlToUse = TTL$5;
2587
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$5, "sales-excellence", VERSION$b, RepresentationType$5, equals$b);
2588
+ return createLink(key);
2589
+ };
2590
+ function getTypeCacheKeys$5(rootKeySet, luvio, input, fullPathFactory) {
2591
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
2592
+ const rootKey = fullPathFactory();
2593
+ rootKeySet.set(rootKey, {
2594
+ namespace: keyPrefix,
2595
+ representationName: RepresentationType$5,
2596
+ mergeable: false
2597
+ });
2598
+ }
2599
+
2600
+ function select$g(luvio, params) {
2601
+ return select$h();
2602
+ }
2603
+ function keyBuilder$9(luvio, params) {
2604
+ return keyPrefix + '::AssignedActionableListsRepresentation:(' + ')';
2605
+ }
2606
+ function getResponseCacheKeys$5(storeKeyMap, luvio, resourceParams, response) {
2607
+ getTypeCacheKeys$5(storeKeyMap, luvio, response, () => keyBuilder$9());
2608
+ }
2609
+ function ingestSuccess$5(luvio, resourceParams, response, snapshotRefresh) {
2610
+ const { body } = response;
2611
+ const key = keyBuilder$9();
2612
+ luvio.storeIngest(key, ingest$5, body);
2613
+ const snapshot = luvio.storeLookup({
2614
+ recordId: key,
2615
+ node: select$g(),
2616
+ variables: {},
2617
+ }, snapshotRefresh);
2618
+ if (process.env.NODE_ENV !== 'production') {
2619
+ if (snapshot.state !== 'Fulfilled') {
2620
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2621
+ }
2622
+ }
2623
+ deepFreeze(snapshot.data);
2624
+ return snapshot;
2625
+ }
2626
+ function ingestError$3(luvio, params, error, snapshotRefresh) {
2627
+ const key = keyBuilder$9();
2628
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2629
+ const storeMetadataParams = {
2630
+ ttl: TTL$5,
2631
+ namespace: keyPrefix,
2632
+ version: VERSION$b,
2633
+ representationName: RepresentationType$5
2634
+ };
2635
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
2636
+ return errorSnapshot;
2637
+ }
2638
+ function createResourceRequest$5(config) {
2639
+ const headers = {};
2640
+ return {
2641
+ baseUri: '/services/data/v66.0',
2642
+ basePath: '/connect/sales-excellence/actionable-lists',
2643
+ method: 'get',
2644
+ body: null,
2645
+ urlParams: {},
2646
+ queryParams: {},
2647
+ headers,
2648
+ priority: 'normal',
2649
+ };
2650
+ }
2651
+
2652
+ const adapterName$5 = 'getAssignedActionableLists';
2653
+ const getAssignedActionableLists_ConfigPropertyMetadata = [];
2654
+ const getAssignedActionableLists_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$5, getAssignedActionableLists_ConfigPropertyMetadata);
2655
+ const createResourceParams$5 = /*#__PURE__*/ createResourceParams$b(getAssignedActionableLists_ConfigPropertyMetadata);
2656
+ function keyBuilder$8(luvio, config) {
2657
+ createResourceParams$5(config);
2658
+ return keyBuilder$9();
2659
+ }
2660
+ function typeCheckConfig$5(untrustedConfig) {
2661
+ const config = {};
2662
+ return config;
2663
+ }
2664
+ function validateAdapterConfig$5(untrustedConfig, configPropertyNames) {
2665
+ if (!untrustedIsObject(untrustedConfig)) {
2666
+ return null;
2667
+ }
2668
+ if (process.env.NODE_ENV !== 'production') {
2669
+ validateConfig(untrustedConfig, configPropertyNames);
2670
+ }
2671
+ const config = typeCheckConfig$5();
2672
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2673
+ return null;
2674
+ }
2675
+ return config;
2676
+ }
2677
+ function adapterFragment$3(luvio, config) {
2678
+ createResourceParams$5(config);
2679
+ return select$g();
2680
+ }
2681
+ function onFetchResponseSuccess$3(luvio, config, resourceParams, response) {
2682
+ const snapshot = ingestSuccess$5(luvio, resourceParams, response, {
2683
+ config,
2684
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
2685
+ });
2686
+ return luvio.storeBroadcast().then(() => snapshot);
2687
+ }
2688
+ function onFetchResponseError$3(luvio, config, resourceParams, response) {
2689
+ const snapshot = ingestError$3(luvio, resourceParams, response, {
2690
+ config,
2691
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
2692
+ });
2693
+ return luvio.storeBroadcast().then(() => snapshot);
2694
+ }
2695
+ function buildNetworkSnapshot$5(luvio, config, options) {
2696
+ const resourceParams = createResourceParams$5(config);
2697
+ const request = createResourceRequest$5();
2698
+ return luvio.dispatchResourceRequest(request, options)
2699
+ .then((response) => {
2700
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$3(luvio, config, resourceParams, response), () => {
2701
+ const cache = new StoreKeyMap();
2702
+ getResponseCacheKeys$5(cache, luvio, resourceParams, response.body);
2703
+ return cache;
2704
+ });
2705
+ }, (response) => {
2706
+ return luvio.handleErrorResponse(() => onFetchResponseError$3(luvio, config, resourceParams, response));
2707
+ });
2708
+ }
2709
+ function buildNetworkSnapshotCachePolicy$3(context, coercedAdapterRequestContext) {
2710
+ return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$5, undefined, false);
2711
+ }
2712
+ function buildCachedSnapshotCachePolicy$3(context, storeLookup) {
2713
+ const { luvio, config } = context;
2714
+ const selector = {
2715
+ recordId: keyBuilder$8(luvio, config),
2716
+ node: adapterFragment$3(luvio, config),
2717
+ variables: {},
2718
+ };
2719
+ const cacheSnapshot = storeLookup(selector, {
2720
+ config,
2721
+ resolve: () => buildNetworkSnapshot$5(luvio, config, snapshotRefreshOptions)
2722
+ });
2723
+ return cacheSnapshot;
2724
+ }
2725
+ const getAssignedActionableListsAdapterFactory = (luvio) => function salesExcellence__getAssignedActionableLists(untrustedConfig, requestContext) {
2726
+ const config = validateAdapterConfig$5(untrustedConfig, getAssignedActionableLists_ConfigPropertyNames);
2727
+ // Invalid or incomplete config
2728
+ if (config === null) {
2729
+ return null;
2730
+ }
2731
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2732
+ buildCachedSnapshotCachePolicy$3, buildNetworkSnapshotCachePolicy$3);
2733
+ };
2734
+
2735
+ const VERSION$a = "da1afe98a78064ccd0f6db2ad9fd2593";
2736
+ function validate$d(obj, path = 'MetadataDetailRepresentation') {
2737
+ const v_error = (() => {
2738
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2739
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2740
+ }
2741
+ if (obj.column !== undefined) {
2742
+ const obj_column = obj.column;
2743
+ const path_column = path + '.column';
2744
+ if (typeof obj_column !== 'string') {
2745
+ return new TypeError('Expected "string" but received "' + typeof obj_column + '" (at "' + path_column + '")');
2746
+ }
2747
+ }
2748
+ if (obj.label !== undefined) {
2749
+ const obj_label = obj.label;
2750
+ const path_label = path + '.label';
2751
+ if (typeof obj_label !== 'string') {
2752
+ return new TypeError('Expected "string" but received "' + typeof obj_label + '" (at "' + path_label + '")');
2753
+ }
2754
+ }
2755
+ })();
2756
+ return v_error === undefined ? null : v_error;
2757
+ }
2758
+ const select$f = function MetadataDetailRepresentationSelect() {
2759
+ return {
2760
+ kind: 'Fragment',
2761
+ version: VERSION$a,
2762
+ private: [],
2763
+ selections: [
2764
+ {
2765
+ name: 'column',
2766
+ kind: 'Scalar',
2767
+ required: false
2768
+ },
2769
+ {
2770
+ name: 'label',
2771
+ kind: 'Scalar',
2772
+ required: false
2773
+ }
2774
+ ]
2775
+ };
2776
+ };
2777
+ function equals$a(existing, incoming) {
2778
+ const existing_column = existing.column;
2779
+ const incoming_column = incoming.column;
2780
+ // if at least one of these optionals is defined
2781
+ if (existing_column !== undefined || incoming_column !== undefined) {
2782
+ // if one of these is not defined we know the other is defined and therefore
2783
+ // not equal
2784
+ if (existing_column === undefined || incoming_column === undefined) {
2785
+ return false;
2786
+ }
2787
+ if (!(existing_column === incoming_column)) {
2788
+ return false;
2789
+ }
2790
+ }
2791
+ const existing_label = existing.label;
2792
+ const incoming_label = incoming.label;
2793
+ // if at least one of these optionals is defined
2794
+ if (existing_label !== undefined || incoming_label !== undefined) {
2795
+ // if one of these is not defined we know the other is defined and therefore
2796
+ // not equal
2797
+ if (existing_label === undefined || incoming_label === undefined) {
2798
+ return false;
2799
+ }
2800
+ if (!(existing_label === incoming_label)) {
2801
+ return false;
2802
+ }
2803
+ }
2804
+ return true;
2805
+ }
2806
+
2807
+ const VERSION$9 = "28c3bee7344a89df450537785420f34d";
2808
+ function validate$c(obj, path = 'QuickActionsMetadataRepresentation') {
2809
+ const v_error = (() => {
2810
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2811
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2812
+ }
2813
+ const obj_metadataDetailRepresentation = obj.metadataDetailRepresentation;
2814
+ const path_metadataDetailRepresentation = path + '.metadataDetailRepresentation';
2815
+ if (!ArrayIsArray(obj_metadataDetailRepresentation)) {
2816
+ return new TypeError('Expected "array" but received "' + typeof obj_metadataDetailRepresentation + '" (at "' + path_metadataDetailRepresentation + '")');
2817
+ }
2818
+ for (let i = 0; i < obj_metadataDetailRepresentation.length; i++) {
2819
+ const obj_metadataDetailRepresentation_item = obj_metadataDetailRepresentation[i];
2820
+ const path_metadataDetailRepresentation_item = path_metadataDetailRepresentation + '[' + i + ']';
2821
+ const referencepath_metadataDetailRepresentation_itemValidationError = validate$d(obj_metadataDetailRepresentation_item, path_metadataDetailRepresentation_item);
2822
+ if (referencepath_metadataDetailRepresentation_itemValidationError !== null) {
2823
+ let message = 'Object doesn\'t match MetadataDetailRepresentation (at "' + path_metadataDetailRepresentation_item + '")\n';
2824
+ message += referencepath_metadataDetailRepresentation_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2825
+ return new TypeError(message);
2826
+ }
2827
+ }
2828
+ const obj_quickActionType = obj.quickActionType;
2829
+ const path_quickActionType = path + '.quickActionType';
2830
+ if (typeof obj_quickActionType !== 'string') {
2831
+ return new TypeError('Expected "string" but received "' + typeof obj_quickActionType + '" (at "' + path_quickActionType + '")');
2832
+ }
2833
+ })();
2834
+ return v_error === undefined ? null : v_error;
2835
+ }
2836
+ const select$e = function QuickActionsMetadataRepresentationSelect() {
2837
+ const { selections: MetadataDetailRepresentation__selections, opaque: MetadataDetailRepresentation__opaque, } = select$f();
2838
+ return {
2839
+ kind: 'Fragment',
2840
+ version: VERSION$9,
2841
+ private: [],
2842
+ selections: [
2843
+ {
2844
+ name: 'metadataDetailRepresentation',
2845
+ kind: 'Object',
2846
+ plural: true,
2847
+ selections: MetadataDetailRepresentation__selections
2848
+ },
2849
+ {
2850
+ name: 'quickActionType',
2851
+ kind: 'Scalar'
2852
+ }
2853
+ ]
2854
+ };
2855
+ };
2856
+ function equals$9(existing, incoming) {
2857
+ const existing_quickActionType = existing.quickActionType;
2858
+ const incoming_quickActionType = incoming.quickActionType;
2859
+ if (!(existing_quickActionType === incoming_quickActionType)) {
2860
+ return false;
2861
+ }
2862
+ const existing_metadataDetailRepresentation = existing.metadataDetailRepresentation;
2863
+ const incoming_metadataDetailRepresentation = incoming.metadataDetailRepresentation;
2864
+ const equals_metadataDetailRepresentation_items = equalsArray(existing_metadataDetailRepresentation, incoming_metadataDetailRepresentation, (existing_metadataDetailRepresentation_item, incoming_metadataDetailRepresentation_item) => {
2865
+ if (!(equals$a(existing_metadataDetailRepresentation_item, incoming_metadataDetailRepresentation_item))) {
2866
+ return false;
2867
+ }
2868
+ });
2869
+ if (equals_metadataDetailRepresentation_items === false) {
2870
+ return false;
2871
+ }
2872
+ return true;
2873
+ }
2874
+
2875
+ const VERSION$8 = "b8f02d6cfc3f16587ceaaf180b481f2f";
2876
+ function validate$b(obj, path = 'ALMStatusCountRepresentation') {
2877
+ const v_error = (() => {
2878
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2879
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2880
+ }
2881
+ if (obj.count !== undefined) {
2882
+ const obj_count = obj.count;
2883
+ const path_count = path + '.count';
2884
+ if (typeof obj_count !== 'number' || (typeof obj_count === 'number' && Math.floor(obj_count) !== obj_count)) {
2885
+ return new TypeError('Expected "integer" but received "' + typeof obj_count + '" (at "' + path_count + '")');
2886
+ }
2887
+ }
2888
+ if (obj.iconName !== undefined) {
2889
+ const obj_iconName = obj.iconName;
2890
+ const path_iconName = path + '.iconName';
2891
+ let obj_iconName_union0 = null;
2892
+ const obj_iconName_union0_error = (() => {
2893
+ if (typeof obj_iconName !== 'string') {
2894
+ return new TypeError('Expected "string" but received "' + typeof obj_iconName + '" (at "' + path_iconName + '")');
2895
+ }
2896
+ })();
2897
+ if (obj_iconName_union0_error != null) {
2898
+ obj_iconName_union0 = obj_iconName_union0_error.message;
2899
+ }
2900
+ let obj_iconName_union1 = null;
2901
+ const obj_iconName_union1_error = (() => {
2902
+ if (obj_iconName !== null) {
2903
+ return new TypeError('Expected "null" but received "' + typeof obj_iconName + '" (at "' + path_iconName + '")');
2904
+ }
2905
+ })();
2906
+ if (obj_iconName_union1_error != null) {
2907
+ obj_iconName_union1 = obj_iconName_union1_error.message;
2908
+ }
2909
+ if (obj_iconName_union0 && obj_iconName_union1) {
2910
+ let message = 'Object doesn\'t match union (at "' + path_iconName + '")';
2911
+ message += '\n' + obj_iconName_union0.split('\n').map((line) => '\t' + line).join('\n');
2912
+ message += '\n' + obj_iconName_union1.split('\n').map((line) => '\t' + line).join('\n');
2913
+ return new TypeError(message);
2914
+ }
2915
+ }
2916
+ const obj_id = obj.id;
2917
+ const path_id = path + '.id';
2918
+ let obj_id_union0 = null;
2919
+ const obj_id_union0_error = (() => {
2920
+ if (typeof obj_id !== 'string') {
2921
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
2922
+ }
2923
+ })();
2924
+ if (obj_id_union0_error != null) {
2925
+ obj_id_union0 = obj_id_union0_error.message;
2926
+ }
2927
+ let obj_id_union1 = null;
2928
+ const obj_id_union1_error = (() => {
2929
+ if (obj_id !== null) {
2930
+ return new TypeError('Expected "null" but received "' + typeof obj_id + '" (at "' + path_id + '")');
2931
+ }
2932
+ })();
2933
+ if (obj_id_union1_error != null) {
2934
+ obj_id_union1 = obj_id_union1_error.message;
2935
+ }
2936
+ if (obj_id_union0 && obj_id_union1) {
2937
+ let message = 'Object doesn\'t match union (at "' + path_id + '")';
2938
+ message += '\n' + obj_id_union0.split('\n').map((line) => '\t' + line).join('\n');
2939
+ message += '\n' + obj_id_union1.split('\n').map((line) => '\t' + line).join('\n');
2940
+ return new TypeError(message);
2941
+ }
2942
+ if (obj.status !== undefined) {
2943
+ const obj_status = obj.status;
2944
+ const path_status = path + '.status';
2945
+ let obj_status_union0 = null;
2946
+ const obj_status_union0_error = (() => {
2947
+ if (typeof obj_status !== 'string') {
2948
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
2949
+ }
2950
+ })();
2951
+ if (obj_status_union0_error != null) {
2952
+ obj_status_union0 = obj_status_union0_error.message;
2953
+ }
2954
+ let obj_status_union1 = null;
2955
+ const obj_status_union1_error = (() => {
2956
+ if (obj_status !== null) {
2957
+ return new TypeError('Expected "null" but received "' + typeof obj_status + '" (at "' + path_status + '")');
2958
+ }
2959
+ })();
2960
+ if (obj_status_union1_error != null) {
2961
+ obj_status_union1 = obj_status_union1_error.message;
2962
+ }
2963
+ if (obj_status_union0 && obj_status_union1) {
2964
+ let message = 'Object doesn\'t match union (at "' + path_status + '")';
2965
+ message += '\n' + obj_status_union0.split('\n').map((line) => '\t' + line).join('\n');
2966
+ message += '\n' + obj_status_union1.split('\n').map((line) => '\t' + line).join('\n');
2967
+ return new TypeError(message);
2968
+ }
2969
+ }
2970
+ })();
2971
+ return v_error === undefined ? null : v_error;
2972
+ }
2973
+ const select$d = function ALMStatusCountRepresentationSelect() {
2974
+ return {
2975
+ kind: 'Fragment',
2976
+ version: VERSION$8,
2977
+ private: [],
2978
+ selections: [
2979
+ {
2980
+ name: 'count',
2981
+ kind: 'Scalar',
2982
+ required: false
2983
+ },
2984
+ {
2985
+ name: 'iconName',
2986
+ kind: 'Scalar',
2987
+ required: false
2988
+ },
2989
+ {
2990
+ name: 'id',
2991
+ kind: 'Scalar'
2992
+ },
2993
+ {
2994
+ name: 'status',
2995
+ kind: 'Scalar',
2996
+ required: false
2997
+ }
2998
+ ]
2999
+ };
3000
+ };
3001
+ function equals$8(existing, incoming) {
3002
+ const existing_count = existing.count;
3003
+ const incoming_count = incoming.count;
3004
+ // if at least one of these optionals is defined
3005
+ if (existing_count !== undefined || incoming_count !== undefined) {
3006
+ // if one of these is not defined we know the other is defined and therefore
3007
+ // not equal
3008
+ if (existing_count === undefined || incoming_count === undefined) {
3009
+ return false;
3010
+ }
3011
+ if (!(existing_count === incoming_count)) {
3012
+ return false;
3013
+ }
3014
+ }
3015
+ const existing_iconName = existing.iconName;
3016
+ const incoming_iconName = incoming.iconName;
3017
+ // if at least one of these optionals is defined
3018
+ if (existing_iconName !== undefined || incoming_iconName !== undefined) {
3019
+ // if one of these is not defined we know the other is defined and therefore
3020
+ // not equal
3021
+ if (existing_iconName === undefined || incoming_iconName === undefined) {
3022
+ return false;
3023
+ }
3024
+ if (!(existing_iconName === incoming_iconName)) {
3025
+ return false;
3026
+ }
3027
+ }
3028
+ const existing_id = existing.id;
3029
+ const incoming_id = incoming.id;
3030
+ if (!(existing_id === incoming_id)) {
3031
+ return false;
3032
+ }
3033
+ const existing_status = existing.status;
3034
+ const incoming_status = incoming.status;
3035
+ // if at least one of these optionals is defined
3036
+ if (existing_status !== undefined || incoming_status !== undefined) {
3037
+ // if one of these is not defined we know the other is defined and therefore
3038
+ // not equal
3039
+ if (existing_status === undefined || incoming_status === undefined) {
3040
+ return false;
3041
+ }
3042
+ if (!(existing_status === incoming_status)) {
3043
+ return false;
3044
+ }
3045
+ }
3046
+ return true;
3047
+ }
3048
+
3049
+ const TTL$4 = 10000;
3050
+ const VERSION$7 = "55a4f9246a13af212e621c7d12a41eb2";
3051
+ function validate$a(obj, path = 'ActionableListMetadataRepresentation') {
3052
+ const v_error = (() => {
3053
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3054
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3055
+ }
3056
+ const obj_quickActionList = obj.quickActionList;
3057
+ const path_quickActionList = path + '.quickActionList';
3058
+ if (!ArrayIsArray(obj_quickActionList)) {
3059
+ return new TypeError('Expected "array" but received "' + typeof obj_quickActionList + '" (at "' + path_quickActionList + '")');
3060
+ }
3061
+ for (let i = 0; i < obj_quickActionList.length; i++) {
3062
+ const obj_quickActionList_item = obj_quickActionList[i];
3063
+ const path_quickActionList_item = path_quickActionList + '[' + i + ']';
3064
+ const referencepath_quickActionList_itemValidationError = validate$c(obj_quickActionList_item, path_quickActionList_item);
3065
+ if (referencepath_quickActionList_itemValidationError !== null) {
3066
+ let message = 'Object doesn\'t match QuickActionsMetadataRepresentation (at "' + path_quickActionList_item + '")\n';
3067
+ message += referencepath_quickActionList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3068
+ return new TypeError(message);
3069
+ }
3070
+ }
3071
+ const obj_statusCountList = obj.statusCountList;
3072
+ const path_statusCountList = path + '.statusCountList';
3073
+ if (!ArrayIsArray(obj_statusCountList)) {
3074
+ return new TypeError('Expected "array" but received "' + typeof obj_statusCountList + '" (at "' + path_statusCountList + '")');
3075
+ }
3076
+ for (let i = 0; i < obj_statusCountList.length; i++) {
3077
+ const obj_statusCountList_item = obj_statusCountList[i];
3078
+ const path_statusCountList_item = path_statusCountList + '[' + i + ']';
3079
+ const referencepath_statusCountList_itemValidationError = validate$b(obj_statusCountList_item, path_statusCountList_item);
3080
+ if (referencepath_statusCountList_itemValidationError !== null) {
3081
+ let message = 'Object doesn\'t match ALMStatusCountRepresentation (at "' + path_statusCountList_item + '")\n';
3082
+ message += referencepath_statusCountList_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3083
+ return new TypeError(message);
3084
+ }
3085
+ }
3086
+ })();
3087
+ return v_error === undefined ? null : v_error;
3088
+ }
3089
+ const RepresentationType$4 = 'ActionableListMetadataRepresentation';
3090
+ function normalize$4(input, existing, path, luvio, store, timestamp) {
3091
+ return input;
3092
+ }
3093
+ const select$c = function ActionableListMetadataRepresentationSelect() {
3094
+ const { selections: QuickActionsMetadataRepresentation__selections, opaque: QuickActionsMetadataRepresentation__opaque, } = select$e();
3095
+ const { selections: ALMStatusCountRepresentation__selections, opaque: ALMStatusCountRepresentation__opaque, } = select$d();
3096
+ return {
3097
+ kind: 'Fragment',
3098
+ version: VERSION$7,
3099
+ private: [],
3100
+ selections: [
3101
+ {
3102
+ name: 'quickActionList',
3103
+ kind: 'Object',
3104
+ plural: true,
3105
+ selections: QuickActionsMetadataRepresentation__selections
3106
+ },
3107
+ {
3108
+ name: 'statusCountList',
3109
+ kind: 'Object',
3110
+ plural: true,
3111
+ selections: ALMStatusCountRepresentation__selections
3112
+ }
3113
+ ]
3114
+ };
3115
+ };
3116
+ function equals$7(existing, incoming) {
3117
+ const existing_quickActionList = existing.quickActionList;
3118
+ const incoming_quickActionList = incoming.quickActionList;
3119
+ const equals_quickActionList_items = equalsArray(existing_quickActionList, incoming_quickActionList, (existing_quickActionList_item, incoming_quickActionList_item) => {
3120
+ if (!(equals$9(existing_quickActionList_item, incoming_quickActionList_item))) {
3121
+ return false;
3122
+ }
3123
+ });
3124
+ if (equals_quickActionList_items === false) {
3125
+ return false;
3126
+ }
3127
+ const existing_statusCountList = existing.statusCountList;
3128
+ const incoming_statusCountList = incoming.statusCountList;
3129
+ const equals_statusCountList_items = equalsArray(existing_statusCountList, incoming_statusCountList, (existing_statusCountList_item, incoming_statusCountList_item) => {
3130
+ if (!(equals$8(existing_statusCountList_item, incoming_statusCountList_item))) {
3131
+ return false;
3132
+ }
3133
+ });
3134
+ if (equals_statusCountList_items === false) {
3135
+ return false;
3136
+ }
3137
+ return true;
3138
+ }
3139
+ const ingest$4 = function ActionableListMetadataRepresentationIngest(input, path, luvio, store, timestamp) {
3140
+ if (process.env.NODE_ENV !== 'production') {
3141
+ const validateError = validate$a(input);
3142
+ if (validateError !== null) {
3143
+ throw validateError;
3144
+ }
3145
+ }
3146
+ const key = path.fullPath;
3147
+ const ttlToUse = TTL$4;
3148
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$4, "sales-excellence", VERSION$7, RepresentationType$4, equals$7);
3149
+ return createLink(key);
3150
+ };
3151
+ function getTypeCacheKeys$4(rootKeySet, luvio, input, fullPathFactory) {
3152
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3153
+ const rootKey = fullPathFactory();
3154
+ rootKeySet.set(rootKey, {
3155
+ namespace: keyPrefix,
3156
+ representationName: RepresentationType$4,
3157
+ mergeable: false
3158
+ });
3159
+ }
3160
+
3161
+ function select$b(luvio, params) {
3162
+ return select$c();
3163
+ }
3164
+ function keyBuilder$7(luvio, params) {
3165
+ return keyPrefix + '::ActionableListMetadataRepresentation:(' + 'hasMemberStatus:' + params.queryParams.hasMemberStatus + ',' + 'hasQuickActions:' + params.queryParams.hasQuickActions + ',' + 'searchTerm:' + params.queryParams.searchTerm + ',' + 'actionableListId:' + params.urlParams.actionableListId + ')';
3166
+ }
3167
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
3168
+ getTypeCacheKeys$4(storeKeyMap, luvio, response, () => keyBuilder$7(luvio, resourceParams));
3169
+ }
3170
+ function ingestSuccess$4(luvio, resourceParams, response, snapshotRefresh) {
3171
+ const { body } = response;
3172
+ const key = keyBuilder$7(luvio, resourceParams);
3173
+ luvio.storeIngest(key, ingest$4, body);
3174
+ const snapshot = luvio.storeLookup({
3175
+ recordId: key,
3176
+ node: select$b(),
3177
+ variables: {},
3178
+ }, snapshotRefresh);
3179
+ if (process.env.NODE_ENV !== 'production') {
3180
+ if (snapshot.state !== 'Fulfilled') {
3181
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3182
+ }
3183
+ }
3184
+ deepFreeze(snapshot.data);
3185
+ return snapshot;
3186
+ }
3187
+ function ingestError$2(luvio, params, error, snapshotRefresh) {
3188
+ const key = keyBuilder$7(luvio, params);
3189
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3190
+ const storeMetadataParams = {
3191
+ ttl: TTL$4,
3192
+ namespace: keyPrefix,
3193
+ version: VERSION$7,
3194
+ representationName: RepresentationType$4
3195
+ };
3196
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
3197
+ return errorSnapshot;
3198
+ }
3199
+ function createResourceRequest$4(config) {
3200
+ const headers = {};
3201
+ return {
3202
+ baseUri: '/services/data/v66.0',
3203
+ basePath: '/connect/sales-excellence/actionable-lists/metadata/' + config.urlParams.actionableListId + '',
3204
+ method: 'get',
3205
+ body: null,
3206
+ urlParams: config.urlParams,
3207
+ queryParams: config.queryParams,
3208
+ headers,
3209
+ priority: 'normal',
3210
+ };
3211
+ }
3212
+
3213
+ const adapterName$4 = 'getActionableListMetadata';
3214
+ const getActionableListMetadata_ConfigPropertyMetadata = [
3215
+ generateParamConfigMetadata('actionableListId', true, 0 /* UrlParameter */, 0 /* String */),
3216
+ generateParamConfigMetadata('hasMemberStatus', false, 1 /* QueryParameter */, 1 /* Boolean */),
3217
+ generateParamConfigMetadata('hasQuickActions', false, 1 /* QueryParameter */, 1 /* Boolean */),
3218
+ generateParamConfigMetadata('searchTerm', false, 1 /* QueryParameter */, 0 /* String */),
3219
+ ];
3220
+ const getActionableListMetadata_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, getActionableListMetadata_ConfigPropertyMetadata);
3221
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$b(getActionableListMetadata_ConfigPropertyMetadata);
3222
+ function keyBuilder$6(luvio, config) {
3223
+ const resourceParams = createResourceParams$4(config);
3224
+ return keyBuilder$7(luvio, resourceParams);
3225
+ }
3226
+ function typeCheckConfig$4(untrustedConfig) {
3227
+ const config = {};
3228
+ typeCheckConfig$b(untrustedConfig, config, getActionableListMetadata_ConfigPropertyMetadata);
3229
+ return config;
3230
+ }
3231
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
3232
+ if (!untrustedIsObject(untrustedConfig)) {
3233
+ return null;
3234
+ }
3235
+ if (process.env.NODE_ENV !== 'production') {
3236
+ validateConfig(untrustedConfig, configPropertyNames);
3237
+ }
3238
+ const config = typeCheckConfig$4(untrustedConfig);
3239
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3240
+ return null;
3241
+ }
3242
+ return config;
3243
+ }
3244
+ function adapterFragment$2(luvio, config) {
3245
+ createResourceParams$4(config);
3246
+ return select$b();
3247
+ }
3248
+ function onFetchResponseSuccess$2(luvio, config, resourceParams, response) {
3249
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response, {
3250
+ config,
3251
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
3252
+ });
3253
+ return luvio.storeBroadcast().then(() => snapshot);
3254
+ }
3255
+ function onFetchResponseError$2(luvio, config, resourceParams, response) {
3256
+ const snapshot = ingestError$2(luvio, resourceParams, response, {
3257
+ config,
3258
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
3259
+ });
3260
+ return luvio.storeBroadcast().then(() => snapshot);
3261
+ }
3262
+ function buildNetworkSnapshot$4(luvio, config, options) {
3263
+ const resourceParams = createResourceParams$4(config);
3264
+ const request = createResourceRequest$4(resourceParams);
3265
+ return luvio.dispatchResourceRequest(request, options)
3266
+ .then((response) => {
3267
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$2(luvio, config, resourceParams, response), () => {
3268
+ const cache = new StoreKeyMap();
3269
+ getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
3270
+ return cache;
3271
+ });
3272
+ }, (response) => {
3273
+ return luvio.handleErrorResponse(() => onFetchResponseError$2(luvio, config, resourceParams, response));
3274
+ });
3275
+ }
3276
+ function buildNetworkSnapshotCachePolicy$2(context, coercedAdapterRequestContext) {
3277
+ return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$4, undefined, false);
3278
+ }
3279
+ function buildCachedSnapshotCachePolicy$2(context, storeLookup) {
3280
+ const { luvio, config } = context;
3281
+ const selector = {
3282
+ recordId: keyBuilder$6(luvio, config),
3283
+ node: adapterFragment$2(luvio, config),
3284
+ variables: {},
3285
+ };
3286
+ const cacheSnapshot = storeLookup(selector, {
3287
+ config,
3288
+ resolve: () => buildNetworkSnapshot$4(luvio, config, snapshotRefreshOptions)
3289
+ });
3290
+ return cacheSnapshot;
3291
+ }
3292
+ const getActionableListMetadataAdapterFactory = (luvio) => function salesExcellence__getActionableListMetadata(untrustedConfig, requestContext) {
3293
+ const config = validateAdapterConfig$4(untrustedConfig, getActionableListMetadata_ConfigPropertyNames);
3294
+ // Invalid or incomplete config
3295
+ if (config === null) {
3296
+ return null;
3297
+ }
3298
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3299
+ buildCachedSnapshotCachePolicy$2, buildNetworkSnapshotCachePolicy$2);
3300
+ };
3301
+
3302
+ const VERSION$6 = "5ee06c03318dcee9ddf5f4f1e0918b9e";
3303
+ function validate$9(obj, path = 'ActionableListMemberQueueRepresentation') {
3304
+ const v_error = (() => {
3305
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3306
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3307
+ }
3308
+ const obj_id = obj.id;
3309
+ const path_id = path + '.id';
3310
+ if (typeof obj_id !== 'string') {
3311
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
3312
+ }
3313
+ const obj_name = obj.name;
3314
+ const path_name = path + '.name';
3315
+ if (typeof obj_name !== 'string') {
3316
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
3317
+ }
3318
+ })();
3319
+ return v_error === undefined ? null : v_error;
3320
+ }
3321
+ const select$a = function ActionableListMemberQueueRepresentationSelect() {
3322
+ return {
3323
+ kind: 'Fragment',
3324
+ version: VERSION$6,
3325
+ private: [],
3326
+ selections: [
3327
+ {
3328
+ name: 'id',
3329
+ kind: 'Scalar'
3330
+ },
3331
+ {
3332
+ name: 'name',
3333
+ kind: 'Scalar'
3334
+ }
3335
+ ]
3336
+ };
3337
+ };
3338
+ function equals$6(existing, incoming) {
3339
+ const existing_id = existing.id;
3340
+ const incoming_id = incoming.id;
3341
+ if (!(existing_id === incoming_id)) {
3342
+ return false;
3343
+ }
3344
+ const existing_name = existing.name;
3345
+ const incoming_name = incoming.name;
3346
+ if (!(existing_name === incoming_name)) {
3347
+ return false;
3348
+ }
3349
+ return true;
3350
+ }
3351
+
3352
+ const TTL$3 = 10000;
3353
+ const VERSION$5 = "a264fdd863285cc900f49a937c8bb486";
3354
+ function validate$8(obj, path = 'ActionableListMemberQueuesRepresentation') {
3355
+ const v_error = (() => {
3356
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3357
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3358
+ }
3359
+ if (obj.nextPageCursor !== undefined) {
3360
+ const obj_nextPageCursor = obj.nextPageCursor;
3361
+ const path_nextPageCursor = path + '.nextPageCursor';
3362
+ if (typeof obj_nextPageCursor !== 'string') {
3363
+ return new TypeError('Expected "string" but received "' + typeof obj_nextPageCursor + '" (at "' + path_nextPageCursor + '")');
3364
+ }
3365
+ }
3366
+ const obj_queues = obj.queues;
3367
+ const path_queues = path + '.queues';
3368
+ if (!ArrayIsArray(obj_queues)) {
3369
+ return new TypeError('Expected "array" but received "' + typeof obj_queues + '" (at "' + path_queues + '")');
3370
+ }
3371
+ for (let i = 0; i < obj_queues.length; i++) {
3372
+ const obj_queues_item = obj_queues[i];
3373
+ const path_queues_item = path_queues + '[' + i + ']';
3374
+ const referencepath_queues_itemValidationError = validate$9(obj_queues_item, path_queues_item);
3375
+ if (referencepath_queues_itemValidationError !== null) {
3376
+ let message = 'Object doesn\'t match ActionableListMemberQueueRepresentation (at "' + path_queues_item + '")\n';
3377
+ message += referencepath_queues_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3378
+ return new TypeError(message);
3379
+ }
3380
+ }
3381
+ })();
3382
+ return v_error === undefined ? null : v_error;
3383
+ }
3384
+ const RepresentationType$3 = 'ActionableListMemberQueuesRepresentation';
3385
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
3386
+ return input;
3387
+ }
3388
+ const select$9 = function ActionableListMemberQueuesRepresentationSelect() {
3389
+ const { selections: ActionableListMemberQueueRepresentation__selections, opaque: ActionableListMemberQueueRepresentation__opaque, } = select$a();
3390
+ return {
3391
+ kind: 'Fragment',
3392
+ version: VERSION$5,
3393
+ private: [],
3394
+ selections: [
3395
+ {
3396
+ name: 'nextPageCursor',
3397
+ kind: 'Scalar',
3398
+ required: false
3399
+ },
3400
+ {
3401
+ name: 'queues',
3402
+ kind: 'Object',
3403
+ plural: true,
3404
+ selections: ActionableListMemberQueueRepresentation__selections
3405
+ }
3406
+ ]
3407
+ };
3408
+ };
3409
+ function equals$5(existing, incoming) {
3410
+ const existing_nextPageCursor = existing.nextPageCursor;
3411
+ const incoming_nextPageCursor = incoming.nextPageCursor;
3412
+ // if at least one of these optionals is defined
3413
+ if (existing_nextPageCursor !== undefined || incoming_nextPageCursor !== undefined) {
3414
+ // if one of these is not defined we know the other is defined and therefore
3415
+ // not equal
3416
+ if (existing_nextPageCursor === undefined || incoming_nextPageCursor === undefined) {
3417
+ return false;
3418
+ }
3419
+ if (!(existing_nextPageCursor === incoming_nextPageCursor)) {
3420
+ return false;
3421
+ }
3422
+ }
3423
+ const existing_queues = existing.queues;
3424
+ const incoming_queues = incoming.queues;
3425
+ const equals_queues_items = equalsArray(existing_queues, incoming_queues, (existing_queues_item, incoming_queues_item) => {
3426
+ if (!(equals$6(existing_queues_item, incoming_queues_item))) {
3427
+ return false;
3428
+ }
3429
+ });
3430
+ if (equals_queues_items === false) {
3431
+ return false;
3432
+ }
3433
+ return true;
3434
+ }
3435
+ const ingest$3 = function ActionableListMemberQueuesRepresentationIngest(input, path, luvio, store, timestamp) {
3436
+ if (process.env.NODE_ENV !== 'production') {
3437
+ const validateError = validate$8(input);
3438
+ if (validateError !== null) {
3439
+ throw validateError;
3440
+ }
3441
+ }
3442
+ const key = path.fullPath;
3443
+ const ttlToUse = TTL$3;
3444
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "sales-excellence", VERSION$5, RepresentationType$3, equals$5);
3445
+ return createLink(key);
3446
+ };
3447
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
3448
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3449
+ const rootKey = fullPathFactory();
3450
+ rootKeySet.set(rootKey, {
3451
+ namespace: keyPrefix,
3452
+ representationName: RepresentationType$3,
3453
+ mergeable: false
3454
+ });
3455
+ }
3456
+
3457
+ function select$8(luvio, params) {
3458
+ return select$9();
3459
+ }
3460
+ function keyBuilder$5(luvio, params) {
3461
+ return keyPrefix + '::ActionableListMemberQueuesRepresentation:(' + 'nextPageCursor:' + params.queryParams.nextPageCursor + ',' + 'searchTerm:' + params.queryParams.searchTerm + ')';
3462
+ }
3463
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
3464
+ getTypeCacheKeys$3(storeKeyMap, luvio, response, () => keyBuilder$5(luvio, resourceParams));
3465
+ }
3466
+ function ingestSuccess$3(luvio, resourceParams, response, snapshotRefresh) {
3467
+ const { body } = response;
3468
+ const key = keyBuilder$5(luvio, resourceParams);
3469
+ luvio.storeIngest(key, ingest$3, body);
3470
+ const snapshot = luvio.storeLookup({
3471
+ recordId: key,
3472
+ node: select$8(),
3473
+ variables: {},
3474
+ }, snapshotRefresh);
3475
+ if (process.env.NODE_ENV !== 'production') {
3476
+ if (snapshot.state !== 'Fulfilled') {
3477
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3478
+ }
3479
+ }
3480
+ deepFreeze(snapshot.data);
3481
+ return snapshot;
3482
+ }
3483
+ function ingestError$1(luvio, params, error, snapshotRefresh) {
3484
+ const key = keyBuilder$5(luvio, params);
3485
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3486
+ const storeMetadataParams = {
3487
+ ttl: TTL$3,
3488
+ namespace: keyPrefix,
3489
+ version: VERSION$5,
3490
+ representationName: RepresentationType$3
3491
+ };
3492
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
3493
+ return errorSnapshot;
3494
+ }
3495
+ function createResourceRequest$3(config) {
3496
+ const headers = {};
3497
+ return {
3498
+ baseUri: '/services/data/v66.0',
3499
+ basePath: '/connect/sales-excellence/actionable-list-member/queues',
3500
+ method: 'get',
3501
+ body: null,
3502
+ urlParams: {},
3503
+ queryParams: config.queryParams,
3504
+ headers,
3505
+ priority: 'normal',
3506
+ };
3507
+ }
3508
+
3509
+ const adapterName$3 = 'getALMQueues';
3510
+ const getALMQueues_ConfigPropertyMetadata = [
3511
+ generateParamConfigMetadata('nextPageCursor', false, 1 /* QueryParameter */, 0 /* String */),
3512
+ generateParamConfigMetadata('searchTerm', false, 1 /* QueryParameter */, 0 /* String */),
3513
+ ];
3514
+ const getALMQueues_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getALMQueues_ConfigPropertyMetadata);
3515
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$b(getALMQueues_ConfigPropertyMetadata);
3516
+ function keyBuilder$4(luvio, config) {
3517
+ const resourceParams = createResourceParams$3(config);
3518
+ return keyBuilder$5(luvio, resourceParams);
3519
+ }
3520
+ function typeCheckConfig$3(untrustedConfig) {
3521
+ const config = {};
3522
+ typeCheckConfig$b(untrustedConfig, config, getALMQueues_ConfigPropertyMetadata);
3523
+ return config;
3524
+ }
3525
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
3526
+ if (!untrustedIsObject(untrustedConfig)) {
3527
+ return null;
3528
+ }
3529
+ if (process.env.NODE_ENV !== 'production') {
3530
+ validateConfig(untrustedConfig, configPropertyNames);
3531
+ }
3532
+ const config = typeCheckConfig$3(untrustedConfig);
3533
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3534
+ return null;
3535
+ }
3536
+ return config;
3537
+ }
3538
+ function adapterFragment$1(luvio, config) {
3539
+ createResourceParams$3(config);
3540
+ return select$8();
3541
+ }
3542
+ function onFetchResponseSuccess$1(luvio, config, resourceParams, response) {
3543
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response, {
3544
+ config,
3545
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
3546
+ });
3547
+ return luvio.storeBroadcast().then(() => snapshot);
3548
+ }
3549
+ function onFetchResponseError$1(luvio, config, resourceParams, response) {
3550
+ const snapshot = ingestError$1(luvio, resourceParams, response, {
3551
+ config,
3552
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
3553
+ });
3554
+ return luvio.storeBroadcast().then(() => snapshot);
3555
+ }
3556
+ function buildNetworkSnapshot$3(luvio, config, options) {
3557
+ const resourceParams = createResourceParams$3(config);
3558
+ const request = createResourceRequest$3(resourceParams);
3559
+ return luvio.dispatchResourceRequest(request, options)
3560
+ .then((response) => {
3561
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess$1(luvio, config, resourceParams, response), () => {
3562
+ const cache = new StoreKeyMap();
3563
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
3564
+ return cache;
3565
+ });
3566
+ }, (response) => {
3567
+ return luvio.handleErrorResponse(() => onFetchResponseError$1(luvio, config, resourceParams, response));
3568
+ });
3569
+ }
3570
+ function buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext) {
3571
+ return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$3, undefined, false);
3572
+ }
3573
+ function buildCachedSnapshotCachePolicy$1(context, storeLookup) {
3574
+ const { luvio, config } = context;
3575
+ const selector = {
3576
+ recordId: keyBuilder$4(luvio, config),
3577
+ node: adapterFragment$1(luvio, config),
3578
+ variables: {},
3579
+ };
3580
+ const cacheSnapshot = storeLookup(selector, {
3581
+ config,
3582
+ resolve: () => buildNetworkSnapshot$3(luvio, config, snapshotRefreshOptions)
3583
+ });
3584
+ return cacheSnapshot;
3585
+ }
3586
+ const getALMQueuesAdapterFactory = (luvio) => function salesExcellence__getALMQueues(untrustedConfig, requestContext) {
3587
+ const config = validateAdapterConfig$3(untrustedConfig, getALMQueues_ConfigPropertyNames);
3588
+ // Invalid or incomplete config
3589
+ if (config === null) {
3590
+ return null;
3591
+ }
3592
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3593
+ buildCachedSnapshotCachePolicy$1, buildNetworkSnapshotCachePolicy$1);
3594
+ };
3595
+
3596
+ const VERSION$4 = "5045452cc02f9152f2d789e3cf756fc3";
3597
+ function validate$7(obj, path = 'SegmentDetailsRepresentation') {
3598
+ const v_error = (() => {
3599
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3600
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3601
+ }
3602
+ const obj_createdDate = obj.createdDate;
3603
+ const path_createdDate = path + '.createdDate';
3604
+ if (typeof obj_createdDate !== 'string') {
3605
+ return new TypeError('Expected "string" but received "' + typeof obj_createdDate + '" (at "' + path_createdDate + '")');
3606
+ }
3607
+ const obj_dataSpaceDevName = obj.dataSpaceDevName;
3608
+ const path_dataSpaceDevName = path + '.dataSpaceDevName';
3609
+ let obj_dataSpaceDevName_union0 = null;
3610
+ const obj_dataSpaceDevName_union0_error = (() => {
3611
+ if (typeof obj_dataSpaceDevName !== 'string') {
3612
+ return new TypeError('Expected "string" but received "' + typeof obj_dataSpaceDevName + '" (at "' + path_dataSpaceDevName + '")');
3613
+ }
3614
+ })();
3615
+ if (obj_dataSpaceDevName_union0_error != null) {
3616
+ obj_dataSpaceDevName_union0 = obj_dataSpaceDevName_union0_error.message;
3617
+ }
3618
+ let obj_dataSpaceDevName_union1 = null;
3619
+ const obj_dataSpaceDevName_union1_error = (() => {
3620
+ if (obj_dataSpaceDevName !== null) {
3621
+ return new TypeError('Expected "null" but received "' + typeof obj_dataSpaceDevName + '" (at "' + path_dataSpaceDevName + '")');
3622
+ }
3623
+ })();
3624
+ if (obj_dataSpaceDevName_union1_error != null) {
3625
+ obj_dataSpaceDevName_union1 = obj_dataSpaceDevName_union1_error.message;
3626
+ }
3627
+ if (obj_dataSpaceDevName_union0 && obj_dataSpaceDevName_union1) {
3628
+ let message = 'Object doesn\'t match union (at "' + path_dataSpaceDevName + '")';
3629
+ message += '\n' + obj_dataSpaceDevName_union0.split('\n').map((line) => '\t' + line).join('\n');
3630
+ message += '\n' + obj_dataSpaceDevName_union1.split('\n').map((line) => '\t' + line).join('\n');
3631
+ return new TypeError(message);
3632
+ }
3633
+ const obj_dataSpaceName = obj.dataSpaceName;
3634
+ const path_dataSpaceName = path + '.dataSpaceName';
3635
+ let obj_dataSpaceName_union0 = null;
3636
+ const obj_dataSpaceName_union0_error = (() => {
3637
+ if (typeof obj_dataSpaceName !== 'string') {
3638
+ return new TypeError('Expected "string" but received "' + typeof obj_dataSpaceName + '" (at "' + path_dataSpaceName + '")');
3639
+ }
3640
+ })();
3641
+ if (obj_dataSpaceName_union0_error != null) {
3642
+ obj_dataSpaceName_union0 = obj_dataSpaceName_union0_error.message;
3643
+ }
3644
+ let obj_dataSpaceName_union1 = null;
3645
+ const obj_dataSpaceName_union1_error = (() => {
3646
+ if (obj_dataSpaceName !== null) {
3647
+ return new TypeError('Expected "null" but received "' + typeof obj_dataSpaceName + '" (at "' + path_dataSpaceName + '")');
3648
+ }
3649
+ })();
3650
+ if (obj_dataSpaceName_union1_error != null) {
3651
+ obj_dataSpaceName_union1 = obj_dataSpaceName_union1_error.message;
3652
+ }
3653
+ if (obj_dataSpaceName_union0 && obj_dataSpaceName_union1) {
3654
+ let message = 'Object doesn\'t match union (at "' + path_dataSpaceName + '")';
3655
+ message += '\n' + obj_dataSpaceName_union0.split('\n').map((line) => '\t' + line).join('\n');
3656
+ message += '\n' + obj_dataSpaceName_union1.split('\n').map((line) => '\t' + line).join('\n');
3657
+ return new TypeError(message);
3658
+ }
3659
+ const obj_description = obj.description;
3660
+ const path_description = path + '.description';
3661
+ let obj_description_union0 = null;
3662
+ const obj_description_union0_error = (() => {
3663
+ if (typeof obj_description !== 'string') {
3664
+ return new TypeError('Expected "string" but received "' + typeof obj_description + '" (at "' + path_description + '")');
3665
+ }
3666
+ })();
3667
+ if (obj_description_union0_error != null) {
3668
+ obj_description_union0 = obj_description_union0_error.message;
3669
+ }
3670
+ let obj_description_union1 = null;
3671
+ const obj_description_union1_error = (() => {
3672
+ if (obj_description !== null) {
3673
+ return new TypeError('Expected "null" but received "' + typeof obj_description + '" (at "' + path_description + '")');
3674
+ }
3675
+ })();
3676
+ if (obj_description_union1_error != null) {
3677
+ obj_description_union1 = obj_description_union1_error.message;
3678
+ }
3679
+ if (obj_description_union0 && obj_description_union1) {
3680
+ let message = 'Object doesn\'t match union (at "' + path_description + '")';
3681
+ message += '\n' + obj_description_union0.split('\n').map((line) => '\t' + line).join('\n');
3682
+ message += '\n' + obj_description_union1.split('\n').map((line) => '\t' + line).join('\n');
3683
+ return new TypeError(message);
3684
+ }
3685
+ const obj_id = obj.id;
3686
+ const path_id = path + '.id';
3687
+ if (typeof obj_id !== 'string') {
3688
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
3689
+ }
3690
+ const obj_lastPublishedEndDateTime = obj.lastPublishedEndDateTime;
3691
+ const path_lastPublishedEndDateTime = path + '.lastPublishedEndDateTime';
3692
+ let obj_lastPublishedEndDateTime_union0 = null;
3693
+ const obj_lastPublishedEndDateTime_union0_error = (() => {
3694
+ if (typeof obj_lastPublishedEndDateTime !== 'string') {
3695
+ return new TypeError('Expected "string" but received "' + typeof obj_lastPublishedEndDateTime + '" (at "' + path_lastPublishedEndDateTime + '")');
3696
+ }
3697
+ })();
3698
+ if (obj_lastPublishedEndDateTime_union0_error != null) {
3699
+ obj_lastPublishedEndDateTime_union0 = obj_lastPublishedEndDateTime_union0_error.message;
3700
+ }
3701
+ let obj_lastPublishedEndDateTime_union1 = null;
3702
+ const obj_lastPublishedEndDateTime_union1_error = (() => {
3703
+ if (obj_lastPublishedEndDateTime !== null) {
3704
+ return new TypeError('Expected "null" but received "' + typeof obj_lastPublishedEndDateTime + '" (at "' + path_lastPublishedEndDateTime + '")');
3705
+ }
3706
+ })();
3707
+ if (obj_lastPublishedEndDateTime_union1_error != null) {
3708
+ obj_lastPublishedEndDateTime_union1 = obj_lastPublishedEndDateTime_union1_error.message;
3709
+ }
3710
+ if (obj_lastPublishedEndDateTime_union0 && obj_lastPublishedEndDateTime_union1) {
3711
+ let message = 'Object doesn\'t match union (at "' + path_lastPublishedEndDateTime + '")';
3712
+ message += '\n' + obj_lastPublishedEndDateTime_union0.split('\n').map((line) => '\t' + line).join('\n');
3713
+ message += '\n' + obj_lastPublishedEndDateTime_union1.split('\n').map((line) => '\t' + line).join('\n');
3714
+ return new TypeError(message);
3715
+ }
3716
+ const obj_lastSegmentMemberCount = obj.lastSegmentMemberCount;
3717
+ const path_lastSegmentMemberCount = path + '.lastSegmentMemberCount';
3718
+ let obj_lastSegmentMemberCount_union0 = null;
3719
+ const obj_lastSegmentMemberCount_union0_error = (() => {
3720
+ if (typeof obj_lastSegmentMemberCount !== 'string') {
3721
+ return new TypeError('Expected "string" but received "' + typeof obj_lastSegmentMemberCount + '" (at "' + path_lastSegmentMemberCount + '")');
3722
+ }
3723
+ })();
3724
+ if (obj_lastSegmentMemberCount_union0_error != null) {
3725
+ obj_lastSegmentMemberCount_union0 = obj_lastSegmentMemberCount_union0_error.message;
3726
+ }
3727
+ let obj_lastSegmentMemberCount_union1 = null;
3728
+ const obj_lastSegmentMemberCount_union1_error = (() => {
3729
+ if (obj_lastSegmentMemberCount !== null) {
3730
+ return new TypeError('Expected "null" but received "' + typeof obj_lastSegmentMemberCount + '" (at "' + path_lastSegmentMemberCount + '")');
3731
+ }
3732
+ })();
3733
+ if (obj_lastSegmentMemberCount_union1_error != null) {
3734
+ obj_lastSegmentMemberCount_union1 = obj_lastSegmentMemberCount_union1_error.message;
3735
+ }
3736
+ if (obj_lastSegmentMemberCount_union0 && obj_lastSegmentMemberCount_union1) {
3737
+ let message = 'Object doesn\'t match union (at "' + path_lastSegmentMemberCount + '")';
3738
+ message += '\n' + obj_lastSegmentMemberCount_union0.split('\n').map((line) => '\t' + line).join('\n');
3739
+ message += '\n' + obj_lastSegmentMemberCount_union1.split('\n').map((line) => '\t' + line).join('\n');
3740
+ return new TypeError(message);
3741
+ }
3742
+ const obj_mktDataModelObjectId = obj.mktDataModelObjectId;
3743
+ const path_mktDataModelObjectId = path + '.mktDataModelObjectId';
3744
+ if (typeof obj_mktDataModelObjectId !== 'string') {
3745
+ return new TypeError('Expected "string" but received "' + typeof obj_mktDataModelObjectId + '" (at "' + path_mktDataModelObjectId + '")');
3746
+ }
3747
+ const obj_mktDataModelObjectNameSpacePrefix = obj.mktDataModelObjectNameSpacePrefix;
3748
+ const path_mktDataModelObjectNameSpacePrefix = path + '.mktDataModelObjectNameSpacePrefix';
3749
+ let obj_mktDataModelObjectNameSpacePrefix_union0 = null;
3750
+ const obj_mktDataModelObjectNameSpacePrefix_union0_error = (() => {
3751
+ if (typeof obj_mktDataModelObjectNameSpacePrefix !== 'string') {
3752
+ return new TypeError('Expected "string" but received "' + typeof obj_mktDataModelObjectNameSpacePrefix + '" (at "' + path_mktDataModelObjectNameSpacePrefix + '")');
3753
+ }
3754
+ })();
3755
+ if (obj_mktDataModelObjectNameSpacePrefix_union0_error != null) {
3756
+ obj_mktDataModelObjectNameSpacePrefix_union0 = obj_mktDataModelObjectNameSpacePrefix_union0_error.message;
3757
+ }
3758
+ let obj_mktDataModelObjectNameSpacePrefix_union1 = null;
3759
+ const obj_mktDataModelObjectNameSpacePrefix_union1_error = (() => {
3760
+ if (obj_mktDataModelObjectNameSpacePrefix !== null) {
3761
+ return new TypeError('Expected "null" but received "' + typeof obj_mktDataModelObjectNameSpacePrefix + '" (at "' + path_mktDataModelObjectNameSpacePrefix + '")');
3762
+ }
3763
+ })();
3764
+ if (obj_mktDataModelObjectNameSpacePrefix_union1_error != null) {
3765
+ obj_mktDataModelObjectNameSpacePrefix_union1 = obj_mktDataModelObjectNameSpacePrefix_union1_error.message;
3766
+ }
3767
+ if (obj_mktDataModelObjectNameSpacePrefix_union0 && obj_mktDataModelObjectNameSpacePrefix_union1) {
3768
+ let message = 'Object doesn\'t match union (at "' + path_mktDataModelObjectNameSpacePrefix + '")';
3769
+ message += '\n' + obj_mktDataModelObjectNameSpacePrefix_union0.split('\n').map((line) => '\t' + line).join('\n');
3770
+ message += '\n' + obj_mktDataModelObjectNameSpacePrefix_union1.split('\n').map((line) => '\t' + line).join('\n');
3771
+ return new TypeError(message);
3772
+ }
3773
+ const obj_name = obj.name;
3774
+ const path_name = path + '.name';
3775
+ if (typeof obj_name !== 'string') {
3776
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
3777
+ }
3778
+ const obj_publishScheduleInterval = obj.publishScheduleInterval;
3779
+ const path_publishScheduleInterval = path + '.publishScheduleInterval';
3780
+ if (typeof obj_publishScheduleInterval !== 'string') {
3781
+ return new TypeError('Expected "string" but received "' + typeof obj_publishScheduleInterval + '" (at "' + path_publishScheduleInterval + '")');
3782
+ }
3783
+ const obj_publishScheduleStartDateTime = obj.publishScheduleStartDateTime;
3784
+ const path_publishScheduleStartDateTime = path + '.publishScheduleStartDateTime';
3785
+ let obj_publishScheduleStartDateTime_union0 = null;
3786
+ const obj_publishScheduleStartDateTime_union0_error = (() => {
3787
+ if (typeof obj_publishScheduleStartDateTime !== 'string') {
3788
+ return new TypeError('Expected "string" but received "' + typeof obj_publishScheduleStartDateTime + '" (at "' + path_publishScheduleStartDateTime + '")');
3789
+ }
3790
+ })();
3791
+ if (obj_publishScheduleStartDateTime_union0_error != null) {
3792
+ obj_publishScheduleStartDateTime_union0 = obj_publishScheduleStartDateTime_union0_error.message;
3793
+ }
3794
+ let obj_publishScheduleStartDateTime_union1 = null;
3795
+ const obj_publishScheduleStartDateTime_union1_error = (() => {
3796
+ if (obj_publishScheduleStartDateTime !== null) {
3797
+ return new TypeError('Expected "null" but received "' + typeof obj_publishScheduleStartDateTime + '" (at "' + path_publishScheduleStartDateTime + '")');
3798
+ }
3799
+ })();
3800
+ if (obj_publishScheduleStartDateTime_union1_error != null) {
3801
+ obj_publishScheduleStartDateTime_union1 = obj_publishScheduleStartDateTime_union1_error.message;
3802
+ }
3803
+ if (obj_publishScheduleStartDateTime_union0 && obj_publishScheduleStartDateTime_union1) {
3804
+ let message = 'Object doesn\'t match union (at "' + path_publishScheduleStartDateTime + '")';
3805
+ message += '\n' + obj_publishScheduleStartDateTime_union0.split('\n').map((line) => '\t' + line).join('\n');
3806
+ message += '\n' + obj_publishScheduleStartDateTime_union1.split('\n').map((line) => '\t' + line).join('\n');
3807
+ return new TypeError(message);
3808
+ }
3809
+ const obj_publishStatus = obj.publishStatus;
3810
+ const path_publishStatus = path + '.publishStatus';
3811
+ let obj_publishStatus_union0 = null;
3812
+ const obj_publishStatus_union0_error = (() => {
3813
+ if (typeof obj_publishStatus !== 'string') {
3814
+ return new TypeError('Expected "string" but received "' + typeof obj_publishStatus + '" (at "' + path_publishStatus + '")');
3815
+ }
3816
+ })();
3817
+ if (obj_publishStatus_union0_error != null) {
3818
+ obj_publishStatus_union0 = obj_publishStatus_union0_error.message;
3819
+ }
3820
+ let obj_publishStatus_union1 = null;
3821
+ const obj_publishStatus_union1_error = (() => {
3822
+ if (obj_publishStatus !== null) {
3823
+ return new TypeError('Expected "null" but received "' + typeof obj_publishStatus + '" (at "' + path_publishStatus + '")');
3824
+ }
3825
+ })();
3826
+ if (obj_publishStatus_union1_error != null) {
3827
+ obj_publishStatus_union1 = obj_publishStatus_union1_error.message;
3828
+ }
3829
+ if (obj_publishStatus_union0 && obj_publishStatus_union1) {
3830
+ let message = 'Object doesn\'t match union (at "' + path_publishStatus + '")';
3831
+ message += '\n' + obj_publishStatus_union0.split('\n').map((line) => '\t' + line).join('\n');
3832
+ message += '\n' + obj_publishStatus_union1.split('\n').map((line) => '\t' + line).join('\n');
3833
+ return new TypeError(message);
3834
+ }
3835
+ const obj_segmentMembershipTable = obj.segmentMembershipTable;
3836
+ const path_segmentMembershipTable = path + '.segmentMembershipTable';
3837
+ let obj_segmentMembershipTable_union0 = null;
3838
+ const obj_segmentMembershipTable_union0_error = (() => {
3839
+ if (typeof obj_segmentMembershipTable !== 'string') {
3840
+ return new TypeError('Expected "string" but received "' + typeof obj_segmentMembershipTable + '" (at "' + path_segmentMembershipTable + '")');
3841
+ }
3842
+ })();
3843
+ if (obj_segmentMembershipTable_union0_error != null) {
3844
+ obj_segmentMembershipTable_union0 = obj_segmentMembershipTable_union0_error.message;
3845
+ }
3846
+ let obj_segmentMembershipTable_union1 = null;
3847
+ const obj_segmentMembershipTable_union1_error = (() => {
3848
+ if (obj_segmentMembershipTable !== null) {
3849
+ return new TypeError('Expected "null" but received "' + typeof obj_segmentMembershipTable + '" (at "' + path_segmentMembershipTable + '")');
3850
+ }
3851
+ })();
3852
+ if (obj_segmentMembershipTable_union1_error != null) {
3853
+ obj_segmentMembershipTable_union1 = obj_segmentMembershipTable_union1_error.message;
3854
+ }
3855
+ if (obj_segmentMembershipTable_union0 && obj_segmentMembershipTable_union1) {
3856
+ let message = 'Object doesn\'t match union (at "' + path_segmentMembershipTable + '")';
3857
+ message += '\n' + obj_segmentMembershipTable_union0.split('\n').map((line) => '\t' + line).join('\n');
3858
+ message += '\n' + obj_segmentMembershipTable_union1.split('\n').map((line) => '\t' + line).join('\n');
3859
+ return new TypeError(message);
3860
+ }
3861
+ const obj_segmentOn = obj.segmentOn;
3862
+ const path_segmentOn = path + '.segmentOn';
3863
+ if (typeof obj_segmentOn !== 'string') {
3864
+ return new TypeError('Expected "string" but received "' + typeof obj_segmentOn + '" (at "' + path_segmentOn + '")');
3865
+ }
3866
+ })();
3867
+ return v_error === undefined ? null : v_error;
3868
+ }
3869
+ const select$7 = function SegmentDetailsRepresentationSelect() {
3870
+ return {
3871
+ kind: 'Fragment',
3872
+ version: VERSION$4,
3873
+ private: [],
3874
+ selections: [
3875
+ {
3876
+ name: 'createdDate',
3877
+ kind: 'Scalar'
3878
+ },
3879
+ {
3880
+ name: 'dataSpaceDevName',
3881
+ kind: 'Scalar'
3882
+ },
3883
+ {
3884
+ name: 'dataSpaceName',
3885
+ kind: 'Scalar'
3886
+ },
3887
+ {
3888
+ name: 'description',
3889
+ kind: 'Scalar'
3890
+ },
3891
+ {
3892
+ name: 'id',
3893
+ kind: 'Scalar'
3894
+ },
3895
+ {
3896
+ name: 'lastPublishedEndDateTime',
3897
+ kind: 'Scalar'
3898
+ },
3899
+ {
3900
+ name: 'lastSegmentMemberCount',
3901
+ kind: 'Scalar'
3902
+ },
3903
+ {
3904
+ name: 'mktDataModelObjectId',
3905
+ kind: 'Scalar'
3906
+ },
3907
+ {
3908
+ name: 'mktDataModelObjectNameSpacePrefix',
3909
+ kind: 'Scalar'
3910
+ },
3911
+ {
3912
+ name: 'name',
3913
+ kind: 'Scalar'
3914
+ },
3915
+ {
3916
+ name: 'publishScheduleInterval',
3917
+ kind: 'Scalar'
3918
+ },
3919
+ {
3920
+ name: 'publishScheduleStartDateTime',
3921
+ kind: 'Scalar'
3922
+ },
3923
+ {
3924
+ name: 'publishStatus',
3925
+ kind: 'Scalar'
3926
+ },
3927
+ {
3928
+ name: 'segmentMembershipTable',
3929
+ kind: 'Scalar'
3930
+ },
3931
+ {
3932
+ name: 'segmentOn',
3933
+ kind: 'Scalar'
3934
+ }
3935
+ ]
3936
+ };
3937
+ };
3938
+ function equals$4(existing, incoming) {
3939
+ const existing_createdDate = existing.createdDate;
3940
+ const incoming_createdDate = incoming.createdDate;
3941
+ if (!(existing_createdDate === incoming_createdDate)) {
3942
+ return false;
3943
+ }
3944
+ const existing_id = existing.id;
3945
+ const incoming_id = incoming.id;
3946
+ if (!(existing_id === incoming_id)) {
3947
+ return false;
3948
+ }
3949
+ const existing_mktDataModelObjectId = existing.mktDataModelObjectId;
3950
+ const incoming_mktDataModelObjectId = incoming.mktDataModelObjectId;
3951
+ if (!(existing_mktDataModelObjectId === incoming_mktDataModelObjectId)) {
3952
+ return false;
3953
+ }
3954
+ const existing_name = existing.name;
3955
+ const incoming_name = incoming.name;
3956
+ if (!(existing_name === incoming_name)) {
3957
+ return false;
3958
+ }
3959
+ const existing_publishScheduleInterval = existing.publishScheduleInterval;
3960
+ const incoming_publishScheduleInterval = incoming.publishScheduleInterval;
3961
+ if (!(existing_publishScheduleInterval === incoming_publishScheduleInterval)) {
3962
+ return false;
3963
+ }
3964
+ const existing_segmentOn = existing.segmentOn;
3965
+ const incoming_segmentOn = incoming.segmentOn;
3966
+ if (!(existing_segmentOn === incoming_segmentOn)) {
3967
+ return false;
3968
+ }
3969
+ const existing_dataSpaceDevName = existing.dataSpaceDevName;
3970
+ const incoming_dataSpaceDevName = incoming.dataSpaceDevName;
3971
+ if (!(existing_dataSpaceDevName === incoming_dataSpaceDevName)) {
3972
+ return false;
3973
+ }
3974
+ const existing_dataSpaceName = existing.dataSpaceName;
3975
+ const incoming_dataSpaceName = incoming.dataSpaceName;
3976
+ if (!(existing_dataSpaceName === incoming_dataSpaceName)) {
3977
+ return false;
3978
+ }
3979
+ const existing_description = existing.description;
3980
+ const incoming_description = incoming.description;
3981
+ if (!(existing_description === incoming_description)) {
3982
+ return false;
3983
+ }
3984
+ const existing_lastPublishedEndDateTime = existing.lastPublishedEndDateTime;
3985
+ const incoming_lastPublishedEndDateTime = incoming.lastPublishedEndDateTime;
3986
+ if (!(existing_lastPublishedEndDateTime === incoming_lastPublishedEndDateTime)) {
3987
+ return false;
3988
+ }
3989
+ const existing_lastSegmentMemberCount = existing.lastSegmentMemberCount;
3990
+ const incoming_lastSegmentMemberCount = incoming.lastSegmentMemberCount;
3991
+ if (!(existing_lastSegmentMemberCount === incoming_lastSegmentMemberCount)) {
3992
+ return false;
3993
+ }
3994
+ const existing_mktDataModelObjectNameSpacePrefix = existing.mktDataModelObjectNameSpacePrefix;
3995
+ const incoming_mktDataModelObjectNameSpacePrefix = incoming.mktDataModelObjectNameSpacePrefix;
3996
+ if (!(existing_mktDataModelObjectNameSpacePrefix === incoming_mktDataModelObjectNameSpacePrefix)) {
3997
+ return false;
3998
+ }
3999
+ const existing_publishScheduleStartDateTime = existing.publishScheduleStartDateTime;
4000
+ const incoming_publishScheduleStartDateTime = incoming.publishScheduleStartDateTime;
4001
+ if (!(existing_publishScheduleStartDateTime === incoming_publishScheduleStartDateTime)) {
4002
+ return false;
4003
+ }
4004
+ const existing_publishStatus = existing.publishStatus;
4005
+ const incoming_publishStatus = incoming.publishStatus;
4006
+ if (!(existing_publishStatus === incoming_publishStatus)) {
4007
+ return false;
4008
+ }
4009
+ const existing_segmentMembershipTable = existing.segmentMembershipTable;
4010
+ const incoming_segmentMembershipTable = incoming.segmentMembershipTable;
4011
+ if (!(existing_segmentMembershipTable === incoming_segmentMembershipTable)) {
4012
+ return false;
4013
+ }
4014
+ return true;
4015
+ }
4016
+
4017
+ const VERSION$3 = "ed92311d86160c94e94404efc98c991a";
4018
+ function validate$6(obj, path = 'CdpSalesExcellenceStatusRepresentation') {
4019
+ const v_error = (() => {
4020
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4021
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4022
+ }
4023
+ const obj_code = obj.code;
4024
+ const path_code = path + '.code';
4025
+ if (typeof obj_code !== 'number' || (typeof obj_code === 'number' && Math.floor(obj_code) !== obj_code)) {
4026
+ return new TypeError('Expected "integer" but received "' + typeof obj_code + '" (at "' + path_code + '")');
4027
+ }
4028
+ const obj_message = obj.message;
4029
+ const path_message = path + '.message';
4030
+ if (typeof obj_message !== 'string') {
4031
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
4032
+ }
4033
+ })();
4034
+ return v_error === undefined ? null : v_error;
4035
+ }
4036
+ const select$6 = function CdpSalesExcellenceStatusRepresentationSelect() {
4037
+ return {
4038
+ kind: 'Fragment',
4039
+ version: VERSION$3,
4040
+ private: [],
4041
+ selections: [
4042
+ {
4043
+ name: 'code',
4044
+ kind: 'Scalar'
4045
+ },
4046
+ {
4047
+ name: 'message',
4048
+ kind: 'Scalar'
4049
+ }
4050
+ ]
4051
+ };
4052
+ };
4053
+ function equals$3(existing, incoming) {
4054
+ const existing_code = existing.code;
4055
+ const incoming_code = incoming.code;
4056
+ if (!(existing_code === incoming_code)) {
4057
+ return false;
4058
+ }
4059
+ const existing_message = existing.message;
4060
+ const incoming_message = incoming.message;
4061
+ if (!(existing_message === incoming_message)) {
4062
+ return false;
4063
+ }
4064
+ return true;
4065
+ }
4066
+
4067
+ const TTL$2 = 10000;
4068
+ const VERSION$2 = "91167712ea078dfdfb085884a9725e71";
4069
+ function validate$5(obj, path = 'SegmentDetailsListRepresentation') {
4070
+ const v_error = (() => {
4071
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4072
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4073
+ }
4074
+ const obj_segmentData = obj.segmentData;
4075
+ const path_segmentData = path + '.segmentData';
4076
+ if (!ArrayIsArray(obj_segmentData)) {
4077
+ return new TypeError('Expected "array" but received "' + typeof obj_segmentData + '" (at "' + path_segmentData + '")');
4078
+ }
4079
+ for (let i = 0; i < obj_segmentData.length; i++) {
4080
+ const obj_segmentData_item = obj_segmentData[i];
4081
+ const path_segmentData_item = path_segmentData + '[' + i + ']';
4082
+ const referencepath_segmentData_itemValidationError = validate$7(obj_segmentData_item, path_segmentData_item);
4083
+ if (referencepath_segmentData_itemValidationError !== null) {
4084
+ let message = 'Object doesn\'t match SegmentDetailsRepresentation (at "' + path_segmentData_item + '")\n';
4085
+ message += referencepath_segmentData_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
4086
+ return new TypeError(message);
4087
+ }
4088
+ }
4089
+ const obj_status = obj.status;
4090
+ const path_status = path + '.status';
4091
+ const referencepath_statusValidationError = validate$6(obj_status, path_status);
4092
+ if (referencepath_statusValidationError !== null) {
4093
+ let message = 'Object doesn\'t match CdpSalesExcellenceStatusRepresentation (at "' + path_status + '")\n';
4094
+ message += referencepath_statusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
4095
+ return new TypeError(message);
4096
+ }
4097
+ })();
4098
+ return v_error === undefined ? null : v_error;
4099
+ }
4100
+ const RepresentationType$2 = 'SegmentDetailsListRepresentation';
4101
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
4102
+ return input;
4103
+ }
4104
+ const select$5 = function SegmentDetailsListRepresentationSelect() {
4105
+ const { selections: SegmentDetailsRepresentation__selections, opaque: SegmentDetailsRepresentation__opaque, } = select$7();
4106
+ const { selections: CdpSalesExcellenceStatusRepresentation__selections, opaque: CdpSalesExcellenceStatusRepresentation__opaque, } = select$6();
4107
+ return {
4108
+ kind: 'Fragment',
4109
+ version: VERSION$2,
4110
+ private: [],
4111
+ selections: [
4112
+ {
4113
+ name: 'segmentData',
4114
+ kind: 'Object',
4115
+ plural: true,
4116
+ selections: SegmentDetailsRepresentation__selections
4117
+ },
4118
+ {
4119
+ name: 'status',
4120
+ kind: 'Object',
4121
+ selections: CdpSalesExcellenceStatusRepresentation__selections
4122
+ }
4123
+ ]
4124
+ };
4125
+ };
4126
+ function equals$2(existing, incoming) {
4127
+ const existing_segmentData = existing.segmentData;
4128
+ const incoming_segmentData = incoming.segmentData;
4129
+ const equals_segmentData_items = equalsArray(existing_segmentData, incoming_segmentData, (existing_segmentData_item, incoming_segmentData_item) => {
4130
+ if (!(equals$4(existing_segmentData_item, incoming_segmentData_item))) {
4131
+ return false;
4132
+ }
4133
+ });
4134
+ if (equals_segmentData_items === false) {
4135
+ return false;
4136
+ }
4137
+ const existing_status = existing.status;
4138
+ const incoming_status = incoming.status;
4139
+ if (!(equals$3(existing_status, incoming_status))) {
4140
+ return false;
4141
+ }
4142
+ return true;
4143
+ }
4144
+ const ingest$2 = function SegmentDetailsListRepresentationIngest(input, path, luvio, store, timestamp) {
4145
+ if (process.env.NODE_ENV !== 'production') {
4146
+ const validateError = validate$5(input);
4147
+ if (validateError !== null) {
4148
+ throw validateError;
4149
+ }
4150
+ }
4151
+ const key = path.fullPath;
4152
+ const ttlToUse = TTL$2;
4153
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "sales-excellence", VERSION$2, RepresentationType$2, equals$2);
4154
+ return createLink(key);
4155
+ };
4156
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
4157
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
4158
+ const rootKey = fullPathFactory();
4159
+ rootKeySet.set(rootKey, {
4160
+ namespace: keyPrefix,
4161
+ representationName: RepresentationType$2,
4162
+ mergeable: false
4163
+ });
4164
+ }
4165
+
4166
+ function select$4(luvio, params) {
4167
+ return select$5();
4168
+ }
4169
+ function keyBuilder$3(luvio, params) {
4170
+ return keyPrefix + '::SegmentDetailsListRepresentation:(' + 'dataSpaceId:' + params.queryParams.dataSpaceId + ',' + 'dataSpacePrefix:' + params.queryParams.dataSpacePrefix + ',' + 'searchTerm:' + params.queryParams.searchTerm + ')';
4171
+ }
4172
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
4173
+ getTypeCacheKeys$2(storeKeyMap, luvio, response, () => keyBuilder$3(luvio, resourceParams));
4174
+ }
4175
+ function ingestSuccess$2(luvio, resourceParams, response, snapshotRefresh) {
4176
+ const { body } = response;
4177
+ const key = keyBuilder$3(luvio, resourceParams);
4178
+ luvio.storeIngest(key, ingest$2, body);
4179
+ const snapshot = luvio.storeLookup({
4180
+ recordId: key,
4181
+ node: select$4(),
4182
+ variables: {},
4183
+ }, snapshotRefresh);
4184
+ if (process.env.NODE_ENV !== 'production') {
4185
+ if (snapshot.state !== 'Fulfilled') {
4186
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4187
+ }
4188
+ }
4189
+ deepFreeze(snapshot.data);
4190
+ return snapshot;
4191
+ }
4192
+ function ingestError(luvio, params, error, snapshotRefresh) {
4193
+ const key = keyBuilder$3(luvio, params);
4194
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
4195
+ const storeMetadataParams = {
4196
+ ttl: TTL$2,
4197
+ namespace: keyPrefix,
4198
+ version: VERSION$2,
4199
+ representationName: RepresentationType$2
4200
+ };
4201
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
4202
+ return errorSnapshot;
4203
+ }
4204
+ function createResourceRequest$2(config) {
4205
+ const headers = {};
4206
+ return {
4207
+ baseUri: '/services/data/v66.0',
4208
+ basePath: '/connect/sales-excellence/cust-data-pfrm/segments',
4209
+ method: 'get',
4210
+ body: null,
4211
+ urlParams: {},
4212
+ queryParams: config.queryParams,
4213
+ headers,
4214
+ priority: 'normal',
4215
+ };
4216
+ }
4217
+
4218
+ const adapterName$2 = 'getSegmentsDetails';
4219
+ const getSegmentsDetails_ConfigPropertyMetadata = [
4220
+ generateParamConfigMetadata('dataSpaceId', false, 1 /* QueryParameter */, 0 /* String */),
4221
+ generateParamConfigMetadata('dataSpacePrefix', false, 1 /* QueryParameter */, 0 /* String */),
4222
+ generateParamConfigMetadata('searchTerm', false, 1 /* QueryParameter */, 0 /* String */),
4223
+ ];
4224
+ const getSegmentsDetails_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getSegmentsDetails_ConfigPropertyMetadata);
4225
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$b(getSegmentsDetails_ConfigPropertyMetadata);
4226
+ function keyBuilder$2(luvio, config) {
4227
+ const resourceParams = createResourceParams$2(config);
4228
+ return keyBuilder$3(luvio, resourceParams);
4229
+ }
4230
+ function typeCheckConfig$2(untrustedConfig) {
4231
+ const config = {};
4232
+ typeCheckConfig$b(untrustedConfig, config, getSegmentsDetails_ConfigPropertyMetadata);
4233
+ return config;
4234
+ }
4235
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
4236
+ if (!untrustedIsObject(untrustedConfig)) {
4237
+ return null;
4238
+ }
4239
+ if (process.env.NODE_ENV !== 'production') {
4240
+ validateConfig(untrustedConfig, configPropertyNames);
4241
+ }
4242
+ const config = typeCheckConfig$2(untrustedConfig);
4243
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4244
+ return null;
4245
+ }
4246
+ return config;
4247
+ }
4248
+ function adapterFragment(luvio, config) {
4249
+ createResourceParams$2(config);
4250
+ return select$4();
4251
+ }
4252
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
4253
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response, {
4254
+ config,
4255
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
4256
+ });
4257
+ return luvio.storeBroadcast().then(() => snapshot);
4258
+ }
4259
+ function onFetchResponseError(luvio, config, resourceParams, response) {
4260
+ const snapshot = ingestError(luvio, resourceParams, response, {
4261
+ config,
4262
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
4263
+ });
4264
+ return luvio.storeBroadcast().then(() => snapshot);
4265
+ }
4266
+ function buildNetworkSnapshot$2(luvio, config, options) {
4267
+ const resourceParams = createResourceParams$2(config);
4268
+ const request = createResourceRequest$2(resourceParams);
4269
+ return luvio.dispatchResourceRequest(request, options)
4270
+ .then((response) => {
4271
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
4272
+ const cache = new StoreKeyMap();
4273
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
4274
+ return cache;
4275
+ });
4276
+ }, (response) => {
4277
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
4278
+ });
4279
+ }
4280
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
4281
+ return buildNetworkSnapshotCachePolicy$4(context, coercedAdapterRequestContext, buildNetworkSnapshot$2, undefined, false);
4282
+ }
4283
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
4284
+ const { luvio, config } = context;
4285
+ const selector = {
4286
+ recordId: keyBuilder$2(luvio, config),
4287
+ node: adapterFragment(luvio, config),
4288
+ variables: {},
4289
+ };
4290
+ const cacheSnapshot = storeLookup(selector, {
4291
+ config,
4292
+ resolve: () => buildNetworkSnapshot$2(luvio, config, snapshotRefreshOptions)
4293
+ });
4294
+ return cacheSnapshot;
4295
+ }
4296
+ const getSegmentsDetailsAdapterFactory = (luvio) => function salesExcellence__getSegmentsDetails(untrustedConfig, requestContext) {
4297
+ const config = validateAdapterConfig$2(untrustedConfig, getSegmentsDetails_ConfigPropertyNames);
4298
+ // Invalid or incomplete config
4299
+ if (config === null) {
4300
+ return null;
4301
+ }
4302
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
4303
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
4304
+ };
4305
+
4306
+ function validate$4(obj, path = 'CreateActionableListRecordsInputRepresentation') {
4307
+ const v_error = (() => {
4308
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4309
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4310
+ }
4311
+ if (obj.actionableListDataSetColumns !== undefined) {
4312
+ const obj_actionableListDataSetColumns = obj.actionableListDataSetColumns;
4313
+ const path_actionableListDataSetColumns = path + '.actionableListDataSetColumns';
4314
+ if (!ArrayIsArray(obj_actionableListDataSetColumns)) {
4315
+ return new TypeError('Expected "array" but received "' + typeof obj_actionableListDataSetColumns + '" (at "' + path_actionableListDataSetColumns + '")');
4316
+ }
4317
+ for (let i = 0; i < obj_actionableListDataSetColumns.length; i++) {
4318
+ const obj_actionableListDataSetColumns_item = obj_actionableListDataSetColumns[i];
4319
+ const path_actionableListDataSetColumns_item = path_actionableListDataSetColumns + '[' + i + ']';
4320
+ if (typeof obj_actionableListDataSetColumns_item !== 'string') {
4321
+ return new TypeError('Expected "string" but received "' + typeof obj_actionableListDataSetColumns_item + '" (at "' + path_actionableListDataSetColumns_item + '")');
4322
+ }
4323
+ }
4324
+ }
4325
+ if (obj.actionableListDescription !== undefined) {
4326
+ const obj_actionableListDescription = obj.actionableListDescription;
4327
+ const path_actionableListDescription = path + '.actionableListDescription';
4328
+ if (typeof obj_actionableListDescription !== 'string') {
4329
+ return new TypeError('Expected "string" but received "' + typeof obj_actionableListDescription + '" (at "' + path_actionableListDescription + '")');
4330
+ }
4331
+ }
4332
+ const obj_actionableListMemberStatuses = obj.actionableListMemberStatuses;
4333
+ const path_actionableListMemberStatuses = path + '.actionableListMemberStatuses';
4334
+ if (!ArrayIsArray(obj_actionableListMemberStatuses)) {
4335
+ return new TypeError('Expected "array" but received "' + typeof obj_actionableListMemberStatuses + '" (at "' + path_actionableListMemberStatuses + '")');
4336
+ }
4337
+ for (let i = 0; i < obj_actionableListMemberStatuses.length; i++) {
4338
+ const obj_actionableListMemberStatuses_item = obj_actionableListMemberStatuses[i];
4339
+ const path_actionableListMemberStatuses_item = path_actionableListMemberStatuses + '[' + i + ']';
4340
+ if (typeof obj_actionableListMemberStatuses_item !== 'object' || ArrayIsArray(obj_actionableListMemberStatuses_item) || obj_actionableListMemberStatuses_item === null) {
4341
+ return new TypeError('Expected "object" but received "' + typeof obj_actionableListMemberStatuses_item + '" (at "' + path_actionableListMemberStatuses_item + '")');
4342
+ }
4343
+ }
4344
+ const obj_actionableListName = obj.actionableListName;
4345
+ const path_actionableListName = path + '.actionableListName';
4346
+ if (typeof obj_actionableListName !== 'string') {
4347
+ return new TypeError('Expected "string" but received "' + typeof obj_actionableListName + '" (at "' + path_actionableListName + '")');
4348
+ }
4349
+ if (obj.additionalContext !== undefined) {
4350
+ const obj_additionalContext = obj.additionalContext;
4351
+ const path_additionalContext = path + '.additionalContext';
4352
+ if (typeof obj_additionalContext !== 'object' || ArrayIsArray(obj_additionalContext) || obj_additionalContext === null) {
4353
+ return new TypeError('Expected "object" but received "' + typeof obj_additionalContext + '" (at "' + path_additionalContext + '")');
4354
+ }
4355
+ }
4356
+ const obj_dataSpaceDevName = obj.dataSpaceDevName;
4357
+ const path_dataSpaceDevName = path + '.dataSpaceDevName';
4358
+ if (typeof obj_dataSpaceDevName !== 'string') {
4359
+ return new TypeError('Expected "string" but received "' + typeof obj_dataSpaceDevName + '" (at "' + path_dataSpaceDevName + '")');
4360
+ }
4361
+ const obj_mktDataModelObjectName = obj.mktDataModelObjectName;
4362
+ const path_mktDataModelObjectName = path + '.mktDataModelObjectName';
4363
+ if (typeof obj_mktDataModelObjectName !== 'string') {
4364
+ return new TypeError('Expected "string" but received "' + typeof obj_mktDataModelObjectName + '" (at "' + path_mktDataModelObjectName + '")');
4365
+ }
4366
+ const obj_mktDataModelObjectNameSpacePrefix = obj.mktDataModelObjectNameSpacePrefix;
4367
+ const path_mktDataModelObjectNameSpacePrefix = path + '.mktDataModelObjectNameSpacePrefix';
4368
+ if (typeof obj_mktDataModelObjectNameSpacePrefix !== 'string') {
4369
+ return new TypeError('Expected "string" but received "' + typeof obj_mktDataModelObjectNameSpacePrefix + '" (at "' + path_mktDataModelObjectNameSpacePrefix + '")');
4370
+ }
4371
+ const obj_segmentId = obj.segmentId;
4372
+ const path_segmentId = path + '.segmentId';
4373
+ if (typeof obj_segmentId !== 'string') {
4374
+ return new TypeError('Expected "string" but received "' + typeof obj_segmentId + '" (at "' + path_segmentId + '")');
4375
+ }
4376
+ const obj_segmentOn = obj.segmentOn;
4377
+ const path_segmentOn = path + '.segmentOn';
4378
+ if (typeof obj_segmentOn !== 'string') {
4379
+ return new TypeError('Expected "string" but received "' + typeof obj_segmentOn + '" (at "' + path_segmentOn + '")');
4380
+ }
4381
+ const obj_smhTableName = obj.smhTableName;
4382
+ const path_smhTableName = path + '.smhTableName';
4383
+ if (typeof obj_smhTableName !== 'string') {
4384
+ return new TypeError('Expected "string" but received "' + typeof obj_smhTableName + '" (at "' + path_smhTableName + '")');
4385
+ }
4386
+ const obj_synchronizationAllowed = obj.synchronizationAllowed;
4387
+ const path_synchronizationAllowed = path + '.synchronizationAllowed';
4388
+ if (typeof obj_synchronizationAllowed !== 'boolean') {
4389
+ return new TypeError('Expected "boolean" but received "' + typeof obj_synchronizationAllowed + '" (at "' + path_synchronizationAllowed + '")');
4390
+ }
4391
+ const obj_timestamp = obj.timestamp;
4392
+ const path_timestamp = path + '.timestamp';
4393
+ if (typeof obj_timestamp !== 'string') {
4394
+ return new TypeError('Expected "string" but received "' + typeof obj_timestamp + '" (at "' + path_timestamp + '")');
4395
+ }
4396
+ if (obj.type !== undefined) {
4397
+ const obj_type = obj.type;
4398
+ const path_type = path + '.type';
4399
+ if (typeof obj_type !== 'string') {
4400
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
4401
+ }
4402
+ }
4403
+ })();
4404
+ return v_error === undefined ? null : v_error;
4405
+ }
4406
+
4407
+ const TTL$1 = 300;
4408
+ const VERSION$1 = "cee6e7242fdafbd2299d70fdb93ed60c";
4409
+ function validate$3(obj, path = 'CreateActionableListRecordsRepresentation') {
4410
+ const v_error = (() => {
4411
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4412
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4413
+ }
4414
+ const obj_actionableListId = obj.actionableListId;
4415
+ const path_actionableListId = path + '.actionableListId';
4416
+ let obj_actionableListId_union0 = null;
4417
+ const obj_actionableListId_union0_error = (() => {
4418
+ if (typeof obj_actionableListId !== 'string') {
4419
+ return new TypeError('Expected "string" but received "' + typeof obj_actionableListId + '" (at "' + path_actionableListId + '")');
4420
+ }
4421
+ })();
4422
+ if (obj_actionableListId_union0_error != null) {
4423
+ obj_actionableListId_union0 = obj_actionableListId_union0_error.message;
4424
+ }
4425
+ let obj_actionableListId_union1 = null;
4426
+ const obj_actionableListId_union1_error = (() => {
4427
+ if (obj_actionableListId !== null) {
4428
+ return new TypeError('Expected "null" but received "' + typeof obj_actionableListId + '" (at "' + path_actionableListId + '")');
4429
+ }
4430
+ })();
4431
+ if (obj_actionableListId_union1_error != null) {
4432
+ obj_actionableListId_union1 = obj_actionableListId_union1_error.message;
4433
+ }
4434
+ if (obj_actionableListId_union0 && obj_actionableListId_union1) {
4435
+ let message = 'Object doesn\'t match union (at "' + path_actionableListId + '")';
4436
+ message += '\n' + obj_actionableListId_union0.split('\n').map((line) => '\t' + line).join('\n');
4437
+ message += '\n' + obj_actionableListId_union1.split('\n').map((line) => '\t' + line).join('\n');
4438
+ return new TypeError(message);
4439
+ }
4440
+ })();
4441
+ return v_error === undefined ? null : v_error;
4442
+ }
4443
+ const RepresentationType$1 = 'CreateActionableListRecordsRepresentation';
4444
+ function keyBuilder$1(luvio, config) {
4445
+ return keyPrefix + '::' + RepresentationType$1 + ':' + (config.actionableListId === null ? '' : config.actionableListId);
4446
+ }
4447
+ function keyBuilderFromType$1(luvio, object) {
4448
+ const keyParams = {
4449
+ actionableListId: object.actionableListId
4450
+ };
4451
+ return keyBuilder$1(luvio, keyParams);
4452
+ }
4453
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
4454
+ return input;
4455
+ }
4456
+ const select$3 = function CreateActionableListRecordsRepresentationSelect() {
4457
+ return {
4458
+ kind: 'Fragment',
4459
+ version: VERSION$1,
4460
+ private: [],
4461
+ opaque: true
4462
+ };
4463
+ };
4464
+ function equals$1(existing, incoming) {
4465
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
4466
+ return false;
4467
+ }
4468
+ return true;
4469
+ }
4470
+ const ingest$1 = function CreateActionableListRecordsRepresentationIngest(input, path, luvio, store, timestamp) {
4471
+ if (process.env.NODE_ENV !== 'production') {
4472
+ const validateError = validate$3(input);
4473
+ if (validateError !== null) {
4474
+ throw validateError;
4475
+ }
4476
+ }
4477
+ const key = keyBuilderFromType$1(luvio, input);
4478
+ const ttlToUse = TTL$1;
4479
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "sales-excellence", VERSION$1, RepresentationType$1, equals$1);
4480
+ return createLink(key);
4481
+ };
4482
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
4483
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
4484
+ const rootKey = keyBuilderFromType$1(luvio, input);
4485
+ rootKeySet.set(rootKey, {
4486
+ namespace: keyPrefix,
4487
+ representationName: RepresentationType$1,
4488
+ mergeable: false
4489
+ });
4490
+ }
4491
+
4492
+ function select$2(luvio, params) {
4493
+ return select$3();
4494
+ }
4495
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
4496
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
4497
+ }
4498
+ function ingestSuccess$1(luvio, resourceParams, response) {
4499
+ const { body } = response;
4500
+ const key = keyBuilderFromType$1(luvio, body);
4501
+ luvio.storeIngest(key, ingest$1, body);
4502
+ const snapshot = luvio.storeLookup({
4503
+ recordId: key,
4504
+ node: select$2(),
4505
+ variables: {},
4506
+ });
4507
+ if (process.env.NODE_ENV !== 'production') {
4508
+ if (snapshot.state !== 'Fulfilled') {
4509
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4510
+ }
4511
+ }
4512
+ deepFreeze(snapshot.data);
4513
+ return snapshot;
4514
+ }
4515
+ function createResourceRequest$1(config) {
4516
+ const headers = {};
4517
+ return {
4518
+ baseUri: '/services/data/v66.0',
4519
+ basePath: '/connect/sales-excellence/cust-data-pfrm/create-records',
4520
+ method: 'post',
4521
+ body: config.body,
4522
+ urlParams: {},
4523
+ queryParams: {},
4524
+ headers,
4525
+ priority: 'normal',
4526
+ };
4527
+ }
4528
+
4529
+ const adapterName$1 = 'createActionableListRecords';
4530
+ const createActionableListRecords_ConfigPropertyMetadata = [
4531
+ generateParamConfigMetadata('createActionableListRecordsInputRepresentation', true, 2 /* Body */, 4 /* Unsupported */),
4532
+ ];
4533
+ const createActionableListRecords_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, createActionableListRecords_ConfigPropertyMetadata);
4534
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$b(createActionableListRecords_ConfigPropertyMetadata);
4535
+ function typeCheckConfig$1(untrustedConfig) {
4536
+ const config = {};
4537
+ const untrustedConfig_createActionableListRecordsInputRepresentation = untrustedConfig.createActionableListRecordsInputRepresentation;
4538
+ const referenceCreateActionableListRecordsInputRepresentationValidationError = validate$4(untrustedConfig_createActionableListRecordsInputRepresentation);
4539
+ if (referenceCreateActionableListRecordsInputRepresentationValidationError === null) {
4540
+ config.createActionableListRecordsInputRepresentation = untrustedConfig_createActionableListRecordsInputRepresentation;
4541
+ }
4542
+ return config;
4543
+ }
4544
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
4545
+ if (!untrustedIsObject(untrustedConfig)) {
4546
+ return null;
4547
+ }
4548
+ if (process.env.NODE_ENV !== 'production') {
4549
+ validateConfig(untrustedConfig, configPropertyNames);
4550
+ }
4551
+ const config = typeCheckConfig$1(untrustedConfig);
4552
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4553
+ return null;
4554
+ }
4555
+ return config;
4556
+ }
4557
+ function buildNetworkSnapshot$1(luvio, config, options) {
4558
+ const resourceParams = createResourceParams$1(config);
4559
+ const request = createResourceRequest$1(resourceParams);
4560
+ return luvio.dispatchResourceRequest(request, options)
4561
+ .then((response) => {
4562
+ return luvio.handleSuccessResponse(() => {
4563
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
4564
+ return luvio.storeBroadcast().then(() => snapshot);
4565
+ }, () => {
4566
+ const cache = new StoreKeyMap();
4567
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
4568
+ return cache;
4569
+ });
4570
+ }, (response) => {
4571
+ deepFreeze(response);
4572
+ throw response;
4573
+ });
4574
+ }
4575
+ const createActionableListRecordsAdapterFactory = (luvio) => {
4576
+ return function createActionableListRecords(untrustedConfig) {
4577
+ const config = validateAdapterConfig$1(untrustedConfig, createActionableListRecords_ConfigPropertyNames);
4578
+ // Invalid or incomplete config
4579
+ if (config === null) {
4580
+ throw new Error('Invalid config for "createActionableListRecords"');
4581
+ }
4582
+ return buildNetworkSnapshot$1(luvio, config);
4583
+ };
4584
+ };
4585
+
4586
+ function validate$2(obj, path = 'SegmentPreviewInputRepresentation') {
4587
+ const v_error = (() => {
4588
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4589
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4590
+ }
4591
+ const obj_dataSpaceDevName = obj.dataSpaceDevName;
4592
+ const path_dataSpaceDevName = path + '.dataSpaceDevName';
4593
+ if (typeof obj_dataSpaceDevName !== 'string') {
4594
+ return new TypeError('Expected "string" but received "' + typeof obj_dataSpaceDevName + '" (at "' + path_dataSpaceDevName + '")');
4595
+ }
4596
+ const obj_mktDataModelObjectId = obj.mktDataModelObjectId;
4597
+ const path_mktDataModelObjectId = path + '.mktDataModelObjectId';
4598
+ if (typeof obj_mktDataModelObjectId !== 'string') {
4599
+ return new TypeError('Expected "string" but received "' + typeof obj_mktDataModelObjectId + '" (at "' + path_mktDataModelObjectId + '")');
4600
+ }
4601
+ const obj_mktDataModelObjectNameSpacePrefix = obj.mktDataModelObjectNameSpacePrefix;
4602
+ const path_mktDataModelObjectNameSpacePrefix = path + '.mktDataModelObjectNameSpacePrefix';
4603
+ if (typeof obj_mktDataModelObjectNameSpacePrefix !== 'string') {
4604
+ return new TypeError('Expected "string" but received "' + typeof obj_mktDataModelObjectNameSpacePrefix + '" (at "' + path_mktDataModelObjectNameSpacePrefix + '")');
4605
+ }
4606
+ const obj_objectName = obj.objectName;
4607
+ const path_objectName = path + '.objectName';
4608
+ if (typeof obj_objectName !== 'string') {
4609
+ return new TypeError('Expected "string" but received "' + typeof obj_objectName + '" (at "' + path_objectName + '")');
4610
+ }
4611
+ const obj_segmentId = obj.segmentId;
4612
+ const path_segmentId = path + '.segmentId';
4613
+ if (typeof obj_segmentId !== 'string') {
4614
+ return new TypeError('Expected "string" but received "' + typeof obj_segmentId + '" (at "' + path_segmentId + '")');
4615
+ }
4616
+ const obj_smhTableName = obj.smhTableName;
4617
+ const path_smhTableName = path + '.smhTableName';
4618
+ if (typeof obj_smhTableName !== 'string') {
4619
+ return new TypeError('Expected "string" but received "' + typeof obj_smhTableName + '" (at "' + path_smhTableName + '")');
4620
+ }
4621
+ })();
4622
+ return v_error === undefined ? null : v_error;
4623
+ }
4624
+
4625
+ function validate$1(obj, path = 'SegmentPreviewRepresentation') {
4626
+ const v_error = (() => {
4627
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4628
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4629
+ }
4630
+ const obj_objectId = obj.objectId;
4631
+ const path_objectId = path + '.objectId';
4632
+ if (typeof obj_objectId !== 'string') {
4633
+ return new TypeError('Expected "string" but received "' + typeof obj_objectId + '" (at "' + path_objectId + '")');
4634
+ }
4635
+ })();
4636
+ return v_error === undefined ? null : v_error;
4637
+ }
4638
+
4639
+ const TTL = 100;
4640
+ const VERSION = "3a6ae5777e9613951476cd8c8d8c6230";
4641
+ function validate(obj, path = 'SegmentPreviewListRepresentation') {
4642
+ const v_error = (() => {
4643
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
4644
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
4645
+ }
4646
+ const obj_mktDataModelObjectName = obj.mktDataModelObjectName;
4647
+ const path_mktDataModelObjectName = path + '.mktDataModelObjectName';
4648
+ if (typeof obj_mktDataModelObjectName !== 'string') {
4649
+ return new TypeError('Expected "string" but received "' + typeof obj_mktDataModelObjectName + '" (at "' + path_mktDataModelObjectName + '")');
4650
+ }
4651
+ const obj_segmentData = obj.segmentData;
4652
+ const path_segmentData = path + '.segmentData';
4653
+ if (!ArrayIsArray(obj_segmentData)) {
4654
+ return new TypeError('Expected "array" but received "' + typeof obj_segmentData + '" (at "' + path_segmentData + '")');
4655
+ }
4656
+ for (let i = 0; i < obj_segmentData.length; i++) {
4657
+ const obj_segmentData_item = obj_segmentData[i];
4658
+ const path_segmentData_item = path_segmentData + '[' + i + ']';
4659
+ const referencepath_segmentData_itemValidationError = validate$1(obj_segmentData_item, path_segmentData_item);
4660
+ if (referencepath_segmentData_itemValidationError !== null) {
4661
+ let message = 'Object doesn\'t match SegmentPreviewRepresentation (at "' + path_segmentData_item + '")\n';
4662
+ message += referencepath_segmentData_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
4663
+ return new TypeError(message);
4664
+ }
4665
+ }
4666
+ const obj_segmentLatestTimeStamp = obj.segmentLatestTimeStamp;
4667
+ const path_segmentLatestTimeStamp = path + '.segmentLatestTimeStamp';
4668
+ if (typeof obj_segmentLatestTimeStamp !== 'string') {
4669
+ return new TypeError('Expected "string" but received "' + typeof obj_segmentLatestTimeStamp + '" (at "' + path_segmentLatestTimeStamp + '")');
4670
+ }
4671
+ const obj_status = obj.status;
4672
+ const path_status = path + '.status';
4673
+ const referencepath_statusValidationError = validate$6(obj_status, path_status);
4674
+ if (referencepath_statusValidationError !== null) {
4675
+ let message = 'Object doesn\'t match CdpSalesExcellenceStatusRepresentation (at "' + path_status + '")\n';
4676
+ message += referencepath_statusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
4677
+ return new TypeError(message);
4678
+ }
4679
+ })();
4680
+ return v_error === undefined ? null : v_error;
4681
+ }
4682
+ const RepresentationType = 'SegmentPreviewListRepresentation';
4683
+ function keyBuilder(luvio, config) {
4684
+ return keyPrefix + '::' + RepresentationType + ':' + config.message;
4685
+ }
4686
+ function keyBuilderFromType(luvio, object) {
4687
+ const keyParams = {
4688
+ message: object.status.message
4689
+ };
4690
+ return keyBuilder(luvio, keyParams);
4691
+ }
4692
+ function normalize(input, existing, path, luvio, store, timestamp) {
4693
+ return input;
4694
+ }
4695
+ const select$1 = function SegmentPreviewListRepresentationSelect() {
4696
+ return {
4697
+ kind: 'Fragment',
4698
+ version: VERSION,
4699
+ private: [],
4700
+ opaque: true
4701
+ };
4702
+ };
4703
+ function equals(existing, incoming) {
4704
+ if (JSONStringify(incoming) !== JSONStringify(existing)) {
4705
+ return false;
4706
+ }
4707
+ return true;
4708
+ }
4709
+ const ingest = function SegmentPreviewListRepresentationIngest(input, path, luvio, store, timestamp) {
4710
+ if (process.env.NODE_ENV !== 'production') {
4711
+ const validateError = validate(input);
4712
+ if (validateError !== null) {
4713
+ throw validateError;
4714
+ }
4715
+ }
4716
+ const key = keyBuilderFromType(luvio, input);
4717
+ const ttlToUse = TTL;
4718
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "sales-excellence", VERSION, RepresentationType, equals);
4719
+ return createLink(key);
4720
+ };
4721
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
4722
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
4723
+ const rootKey = keyBuilderFromType(luvio, input);
4724
+ rootKeySet.set(rootKey, {
4725
+ namespace: keyPrefix,
4726
+ representationName: RepresentationType,
4727
+ mergeable: false
4728
+ });
4729
+ }
4730
+
4731
+ function select(luvio, params) {
4732
+ return select$1();
4733
+ }
4734
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
4735
+ getTypeCacheKeys(storeKeyMap, luvio, response);
4736
+ }
4737
+ function ingestSuccess(luvio, resourceParams, response) {
4738
+ const { body } = response;
4739
+ const key = keyBuilderFromType(luvio, body);
4740
+ luvio.storeIngest(key, ingest, body);
4741
+ const snapshot = luvio.storeLookup({
4742
+ recordId: key,
4743
+ node: select(),
4744
+ variables: {},
4745
+ });
4746
+ if (process.env.NODE_ENV !== 'production') {
4747
+ if (snapshot.state !== 'Fulfilled') {
4748
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
4749
+ }
4750
+ }
4751
+ deepFreeze(snapshot.data);
4752
+ return snapshot;
4753
+ }
4754
+ function createResourceRequest(config) {
4755
+ const headers = {};
4756
+ return {
4757
+ baseUri: '/services/data/v66.0',
4758
+ basePath: '/connect/sales-excellence/cust-data-pfrm/segment-preview',
4759
+ method: 'post',
4760
+ body: config.body,
4761
+ urlParams: {},
4762
+ queryParams: {},
4763
+ headers,
4764
+ priority: 'normal',
4765
+ };
4766
+ }
4767
+
4768
+ const adapterName = 'createObjectsDataFromSelectedSegment';
4769
+ const createObjectsDataFromSelectedSegment_ConfigPropertyMetadata = [
4770
+ generateParamConfigMetadata('segmentPreviewInput', true, 2 /* Body */, 4 /* Unsupported */),
4771
+ ];
4772
+ const createObjectsDataFromSelectedSegment_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, createObjectsDataFromSelectedSegment_ConfigPropertyMetadata);
4773
+ const createResourceParams = /*#__PURE__*/ createResourceParams$b(createObjectsDataFromSelectedSegment_ConfigPropertyMetadata);
4774
+ function typeCheckConfig(untrustedConfig) {
4775
+ const config = {};
4776
+ const untrustedConfig_segmentPreviewInput = untrustedConfig.segmentPreviewInput;
4777
+ const referenceSegmentPreviewInputRepresentationValidationError = validate$2(untrustedConfig_segmentPreviewInput);
4778
+ if (referenceSegmentPreviewInputRepresentationValidationError === null) {
4779
+ config.segmentPreviewInput = untrustedConfig_segmentPreviewInput;
4780
+ }
4781
+ return config;
4782
+ }
4783
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
4784
+ if (!untrustedIsObject(untrustedConfig)) {
4785
+ return null;
4786
+ }
4787
+ if (process.env.NODE_ENV !== 'production') {
4788
+ validateConfig(untrustedConfig, configPropertyNames);
4789
+ }
4790
+ const config = typeCheckConfig(untrustedConfig);
4791
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
4792
+ return null;
4793
+ }
4794
+ return config;
4795
+ }
4796
+ function buildNetworkSnapshot(luvio, config, options) {
4797
+ const resourceParams = createResourceParams(config);
4798
+ const request = createResourceRequest(resourceParams);
4799
+ return luvio.dispatchResourceRequest(request, options)
4800
+ .then((response) => {
4801
+ return luvio.handleSuccessResponse(() => {
4802
+ const snapshot = ingestSuccess(luvio, resourceParams, response);
4803
+ return luvio.storeBroadcast().then(() => snapshot);
4804
+ }, () => {
4805
+ const cache = new StoreKeyMap();
4806
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
4807
+ return cache;
4808
+ });
4809
+ }, (response) => {
4810
+ deepFreeze(response);
4811
+ throw response;
4812
+ });
4813
+ }
4814
+ const createObjectsDataFromSelectedSegmentAdapterFactory = (luvio) => {
4815
+ return function createObjectsDataFromSelectedSegment(untrustedConfig) {
4816
+ const config = validateAdapterConfig(untrustedConfig, createObjectsDataFromSelectedSegment_ConfigPropertyNames);
4817
+ // Invalid or incomplete config
4818
+ if (config === null) {
4819
+ throw new Error('Invalid config for "createObjectsDataFromSelectedSegment"');
4820
+ }
4821
+ return buildNetworkSnapshot(luvio, config);
4822
+ };
4823
+ };
4824
+
4825
+ export { actionableListAssignmentAdapterFactory, actionableListMemberSearchAdapterFactory, actionableListMemberSearchByIdAdapterFactory, createActionableListRecordsAdapterFactory, createObjectsDataFromSelectedSegmentAdapterFactory, generateActionableListKpiBarResultsAdapterFactory, generateActionableListKpiMappingResultsAdapterFactory, getALMQueuesAdapterFactory, getActionableListMetadataAdapterFactory, getAssignedActionableListsAdapterFactory, getSegmentsDetailsAdapterFactory };