@salesforce/lds-adapters-sfap-analytics-insights 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 (73) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/es/es2018/sfap-analytics-insights.js +3750 -0
  3. package/dist/es/es2018/types/src/generated/adapters/adapter-utils.d.ts +62 -0
  4. package/dist/es/es2018/types/src/generated/adapters/createInsightsBatch.d.ts +20 -0
  5. package/dist/es/es2018/types/src/generated/adapters/generateInsights.d.ts +22 -0
  6. package/dist/es/es2018/types/src/generated/adapters/generateInsightsBasic.d.ts +22 -0
  7. package/dist/es/es2018/types/src/generated/adapters/getInsightsBatch.d.ts +30 -0
  8. package/dist/es/es2018/types/src/generated/adapters/getMetricFilterValues.d.ts +27 -0
  9. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +5 -0
  10. package/dist/es/es2018/types/src/generated/artifacts/sfdc.d.ts +8 -0
  11. package/dist/es/es2018/types/src/generated/resources/getAnalyticsInsightsV1BatchesByBatchId.d.ts +20 -0
  12. package/dist/es/es2018/types/src/generated/resources/postAnalyticsInsightsV1BasicGenerateBundle.d.ts +21 -0
  13. package/dist/es/es2018/types/src/generated/resources/postAnalyticsInsightsV1Batches.d.ts +19 -0
  14. package/dist/es/es2018/types/src/generated/resources/postAnalyticsInsightsV1FilterValues.d.ts +26 -0
  15. package/dist/es/es2018/types/src/generated/resources/postAnalyticsInsightsV1GenerateBundle.d.ts +21 -0
  16. package/dist/es/es2018/types/src/generated/types/BatchInput.d.ts +31 -0
  17. package/dist/es/es2018/types/src/generated/types/BatchOptions.d.ts +36 -0
  18. package/dist/es/es2018/types/src/generated/types/CategoricalFilterOptions.d.ts +32 -0
  19. package/dist/es/es2018/types/src/generated/types/CompareConfig.d.ts +27 -0
  20. package/dist/es/es2018/types/src/generated/types/Error.d.ts +29 -0
  21. package/dist/es/es2018/types/src/generated/types/ExtensionOptions.d.ts +29 -0
  22. package/dist/es/es2018/types/src/generated/types/FieldId.d.ts +31 -0
  23. package/dist/es/es2018/types/src/generated/types/Filter.d.ts +45 -0
  24. package/dist/es/es2018/types/src/generated/types/FlattenFilter.d.ts +32 -0
  25. package/dist/es/es2018/types/src/generated/types/GenerateInsightBatchRequest.d.ts +33 -0
  26. package/dist/es/es2018/types/src/generated/types/GenerateInsightBatchResponse.d.ts +48 -0
  27. package/dist/es/es2018/types/src/generated/types/GenerateInsightBundleRequest.d.ts +37 -0
  28. package/dist/es/es2018/types/src/generated/types/GenerateInsightBundleResponse.d.ts +51 -0
  29. package/dist/es/es2018/types/src/generated/types/GenerateInsightBundleV2Request.d.ts +47 -0
  30. package/dist/es/es2018/types/src/generated/types/GetFilterValuesRequest.d.ts +46 -0
  31. package/dist/es/es2018/types/src/generated/types/GetFilterValuesResponse.d.ts +43 -0
  32. package/dist/es/es2018/types/src/generated/types/GetFilterValuesResponse_CategoricalValues.d.ts +29 -0
  33. package/dist/es/es2018/types/src/generated/types/GetInsightBatchResponse.d.ts +61 -0
  34. package/dist/es/es2018/types/src/generated/types/GoalMetadata.d.ts +30 -0
  35. package/dist/es/es2018/types/src/generated/types/GoalMetadata_StatusCondition.d.ts +37 -0
  36. package/dist/es/es2018/types/src/generated/types/InputMetric.d.ts +43 -0
  37. package/dist/es/es2018/types/src/generated/types/Insight.d.ts +46 -0
  38. package/dist/es/es2018/types/src/generated/types/InsightBundle.d.ts +35 -0
  39. package/dist/es/es2018/types/src/generated/types/InsightBundleInput.d.ts +31 -0
  40. package/dist/es/es2018/types/src/generated/types/InsightBundleOptions.d.ts +40 -0
  41. package/dist/es/es2018/types/src/generated/types/InsightFeedbackMetadata.d.ts +31 -0
  42. package/dist/es/es2018/types/src/generated/types/InsightGroup.d.ts +36 -0
  43. package/dist/es/es2018/types/src/generated/types/InsightResponse.d.ts +33 -0
  44. package/dist/es/es2018/types/src/generated/types/InsightsOptions.d.ts +28 -0
  45. package/dist/es/es2018/types/src/generated/types/InsightsOptions_InsightSetting.d.ts +29 -0
  46. package/dist/es/es2018/types/src/generated/types/Measure.d.ts +30 -0
  47. package/dist/es/es2018/types/src/generated/types/MeasurementPeriod.d.ts +35 -0
  48. package/dist/es/es2018/types/src/generated/types/MetricDefinition.d.ts +46 -0
  49. package/dist/es/es2018/types/src/generated/types/MetricInstance.d.ts +38 -0
  50. package/dist/es/es2018/types/src/generated/types/MetricInstanceInput.d.ts +32 -0
  51. package/dist/es/es2018/types/src/generated/types/MetricMetadata.d.ts +29 -0
  52. package/dist/es/es2018/types/src/generated/types/Overview.d.ts +30 -0
  53. package/dist/es/es2018/types/src/generated/types/OverviewResponse.d.ts +31 -0
  54. package/dist/es/es2018/types/src/generated/types/RangeFilterOptions.d.ts +35 -0
  55. package/dist/es/es2018/types/src/generated/types/RelativeDate.d.ts +49 -0
  56. package/dist/es/es2018/types/src/generated/types/RelativeDateFilterOptions.d.ts +25 -0
  57. package/dist/es/es2018/types/src/generated/types/RelativePeriod.d.ts +29 -0
  58. package/dist/es/es2018/types/src/generated/types/RepresentationOptions.d.ts +32 -0
  59. package/dist/es/es2018/types/src/generated/types/RepresentationOptions_NumberUnits.d.ts +29 -0
  60. package/dist/es/es2018/types/src/generated/types/SemanticDataModel.d.ts +27 -0
  61. package/dist/es/es2018/types/src/generated/types/SemanticFilter.d.ts +37 -0
  62. package/dist/es/es2018/types/src/generated/types/Status.d.ts +32 -0
  63. package/dist/es/es2018/types/src/generated/types/SummarizationOptions.d.ts +28 -0
  64. package/dist/es/es2018/types/src/generated/types/Summary.d.ts +37 -0
  65. package/dist/es/es2018/types/src/generated/types/SummaryResponse.d.ts +31 -0
  66. package/dist/es/es2018/types/src/generated/types/TimeDimension.d.ts +28 -0
  67. package/dist/es/es2018/types/src/generated/types/UnifiedFilter.d.ts +33 -0
  68. package/dist/es/es2018/types/src/generated/types/type-utils.d.ts +32 -0
  69. package/package.json +66 -0
  70. package/sfdc/index.d.ts +1 -0
  71. package/sfdc/index.js +3847 -0
  72. package/src/raml/api.raml +1198 -0
  73. package/src/raml/luvio.raml +53 -0
@@ -0,0 +1,3750 @@
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$5, typeCheckConfig as typeCheckConfig$5, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } 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 = 'analytics-insights';
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
+ function validate$I(obj, path = 'MetricMetadata') {
96
+ const v_error = (() => {
97
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
98
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
99
+ }
100
+ if (obj.definitionId !== undefined) {
101
+ const obj_definitionId = obj.definitionId;
102
+ const path_definitionId = path + '.definitionId';
103
+ if (typeof obj_definitionId !== 'string') {
104
+ return new TypeError('Expected "string" but received "' + typeof obj_definitionId + '" (at "' + path_definitionId + '")');
105
+ }
106
+ }
107
+ if (obj.name !== undefined) {
108
+ const obj_name = obj.name;
109
+ const path_name = path + '.name';
110
+ if (typeof obj_name !== 'string') {
111
+ return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
112
+ }
113
+ }
114
+ })();
115
+ return v_error === undefined ? null : v_error;
116
+ }
117
+
118
+ function validate$H(obj, path = 'ExtensionOptions') {
119
+ const v_error = (() => {
120
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
121
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
122
+ }
123
+ if (obj.analysisDimensions !== undefined) {
124
+ const obj_analysisDimensions = obj.analysisDimensions;
125
+ const path_analysisDimensions = path + '.analysisDimensions';
126
+ if (!ArrayIsArray(obj_analysisDimensions)) {
127
+ return new TypeError('Expected "array" but received "' + typeof obj_analysisDimensions + '" (at "' + path_analysisDimensions + '")');
128
+ }
129
+ for (let i = 0; i < obj_analysisDimensions.length; i++) {
130
+ const obj_analysisDimensions_item = obj_analysisDimensions[i];
131
+ const path_analysisDimensions_item = path_analysisDimensions + '[' + i + ']';
132
+ if (typeof obj_analysisDimensions_item !== 'string') {
133
+ return new TypeError('Expected "string" but received "' + typeof obj_analysisDimensions_item + '" (at "' + path_analysisDimensions_item + '")');
134
+ }
135
+ }
136
+ }
137
+ if (obj.minimumGranularity !== undefined) {
138
+ const obj_minimumGranularity = obj.minimumGranularity;
139
+ const path_minimumGranularity = path + '.minimumGranularity';
140
+ if (typeof obj_minimumGranularity !== 'string') {
141
+ return new TypeError('Expected "string" but received "' + typeof obj_minimumGranularity + '" (at "' + path_minimumGranularity + '")');
142
+ }
143
+ }
144
+ })();
145
+ return v_error === undefined ? null : v_error;
146
+ }
147
+
148
+ function validate$G(obj, path = 'GoalMetadata_StatusCondition') {
149
+ const v_error = (() => {
150
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
151
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
152
+ }
153
+ if (obj.color !== undefined) {
154
+ const obj_color = obj.color;
155
+ const path_color = path + '.color';
156
+ if (typeof obj_color !== 'string') {
157
+ return new TypeError('Expected "string" but received "' + typeof obj_color + '" (at "' + path_color + '")');
158
+ }
159
+ }
160
+ if (obj.currencyIsoCode !== undefined) {
161
+ const obj_currencyIsoCode = obj.currencyIsoCode;
162
+ const path_currencyIsoCode = path + '.currencyIsoCode';
163
+ if (typeof obj_currencyIsoCode !== 'string') {
164
+ return new TypeError('Expected "string" but received "' + typeof obj_currencyIsoCode + '" (at "' + path_currencyIsoCode + '")');
165
+ }
166
+ }
167
+ if (obj.operator !== undefined) {
168
+ const obj_operator = obj.operator;
169
+ const path_operator = path + '.operator';
170
+ if (typeof obj_operator !== 'string') {
171
+ return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
172
+ }
173
+ }
174
+ if (obj.primary !== undefined) {
175
+ const obj_primary = obj.primary;
176
+ const path_primary = path + '.primary';
177
+ if (typeof obj_primary !== 'boolean') {
178
+ return new TypeError('Expected "boolean" but received "' + typeof obj_primary + '" (at "' + path_primary + '")');
179
+ }
180
+ }
181
+ if (obj.statusName !== undefined) {
182
+ const obj_statusName = obj.statusName;
183
+ const path_statusName = path + '.statusName';
184
+ if (typeof obj_statusName !== 'string') {
185
+ return new TypeError('Expected "string" but received "' + typeof obj_statusName + '" (at "' + path_statusName + '")');
186
+ }
187
+ }
188
+ if (obj.value !== undefined) {
189
+ const obj_value = obj.value;
190
+ const path_value = path + '.value';
191
+ if (typeof obj_value !== 'string') {
192
+ return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
193
+ }
194
+ }
195
+ })();
196
+ return v_error === undefined ? null : v_error;
197
+ }
198
+
199
+ function validate$F(obj, path = 'GoalMetadata') {
200
+ const v_error = (() => {
201
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
202
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
203
+ }
204
+ if (obj.forecasting !== undefined) {
205
+ const obj_forecasting = obj.forecasting;
206
+ const path_forecasting = path + '.forecasting';
207
+ if (typeof obj_forecasting !== 'boolean') {
208
+ return new TypeError('Expected "boolean" but received "' + typeof obj_forecasting + '" (at "' + path_forecasting + '")');
209
+ }
210
+ }
211
+ if (obj.statusConditions !== undefined) {
212
+ const obj_statusConditions = obj.statusConditions;
213
+ const path_statusConditions = path + '.statusConditions';
214
+ if (!ArrayIsArray(obj_statusConditions)) {
215
+ return new TypeError('Expected "array" but received "' + typeof obj_statusConditions + '" (at "' + path_statusConditions + '")');
216
+ }
217
+ for (let i = 0; i < obj_statusConditions.length; i++) {
218
+ const obj_statusConditions_item = obj_statusConditions[i];
219
+ const path_statusConditions_item = path_statusConditions + '[' + i + ']';
220
+ const referencepath_statusConditions_itemValidationError = validate$G(obj_statusConditions_item, path_statusConditions_item);
221
+ if (referencepath_statusConditions_itemValidationError !== null) {
222
+ let message = 'Object doesn\'t match GoalMetadata_StatusCondition (at "' + path_statusConditions_item + '")\n';
223
+ message += referencepath_statusConditions_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
224
+ return new TypeError(message);
225
+ }
226
+ }
227
+ }
228
+ })();
229
+ return v_error === undefined ? null : v_error;
230
+ }
231
+
232
+ function validate$E(obj, path = 'InsightsOptions_InsightSetting') {
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
+ if (obj.disabled !== undefined) {
238
+ const obj_disabled = obj.disabled;
239
+ const path_disabled = path + '.disabled';
240
+ if (typeof obj_disabled !== 'boolean') {
241
+ return new TypeError('Expected "boolean" but received "' + typeof obj_disabled + '" (at "' + path_disabled + '")');
242
+ }
243
+ }
244
+ if (obj.type !== undefined) {
245
+ const obj_type = obj.type;
246
+ const path_type = path + '.type';
247
+ if (typeof obj_type !== 'string') {
248
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
249
+ }
250
+ }
251
+ })();
252
+ return v_error === undefined ? null : v_error;
253
+ }
254
+
255
+ function validate$D(obj, path = 'InsightsOptions') {
256
+ const v_error = (() => {
257
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
258
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
259
+ }
260
+ if (obj.settings !== undefined) {
261
+ const obj_settings = obj.settings;
262
+ const path_settings = path + '.settings';
263
+ if (!ArrayIsArray(obj_settings)) {
264
+ return new TypeError('Expected "array" but received "' + typeof obj_settings + '" (at "' + path_settings + '")');
265
+ }
266
+ for (let i = 0; i < obj_settings.length; i++) {
267
+ const obj_settings_item = obj_settings[i];
268
+ const path_settings_item = path_settings + '[' + i + ']';
269
+ const referencepath_settings_itemValidationError = validate$E(obj_settings_item, path_settings_item);
270
+ if (referencepath_settings_itemValidationError !== null) {
271
+ let message = 'Object doesn\'t match InsightsOptions_InsightSetting (at "' + path_settings_item + '")\n';
272
+ message += referencepath_settings_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
273
+ return new TypeError(message);
274
+ }
275
+ }
276
+ }
277
+ })();
278
+ return v_error === undefined ? null : v_error;
279
+ }
280
+
281
+ function validate$C(obj, path = 'CategoricalFilterOptions') {
282
+ const v_error = (() => {
283
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
284
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
285
+ }
286
+ if (obj.nullOption !== undefined) {
287
+ const obj_nullOption = obj.nullOption;
288
+ const path_nullOption = path + '.nullOption';
289
+ if (typeof obj_nullOption !== 'string') {
290
+ return new TypeError('Expected "string" but received "' + typeof obj_nullOption + '" (at "' + path_nullOption + '")');
291
+ }
292
+ }
293
+ if (obj.operator !== undefined) {
294
+ const obj_operator = obj.operator;
295
+ const path_operator = path + '.operator';
296
+ if (typeof obj_operator !== 'string') {
297
+ return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
298
+ }
299
+ }
300
+ if (obj.values !== undefined) {
301
+ const obj_values = obj.values;
302
+ const path_values = path + '.values';
303
+ if (!ArrayIsArray(obj_values)) {
304
+ return new TypeError('Expected "array" but received "' + typeof obj_values + '" (at "' + path_values + '")');
305
+ }
306
+ for (let i = 0; i < obj_values.length; i++) {
307
+ const obj_values_item = obj_values[i];
308
+ const path_values_item = path_values + '[' + i + ']';
309
+ if (obj_values_item === undefined) {
310
+ return new TypeError('Expected "defined" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
311
+ }
312
+ }
313
+ }
314
+ })();
315
+ return v_error === undefined ? null : v_error;
316
+ }
317
+
318
+ function validate$B(obj, path = 'FieldId') {
319
+ const v_error = (() => {
320
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
321
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
322
+ }
323
+ if (obj.datasource !== undefined) {
324
+ const obj_datasource = obj.datasource;
325
+ const path_datasource = path + '.datasource';
326
+ if (typeof obj_datasource !== 'string') {
327
+ return new TypeError('Expected "string" but received "' + typeof obj_datasource + '" (at "' + path_datasource + '")');
328
+ }
329
+ }
330
+ if (obj.fieldName !== undefined) {
331
+ const obj_fieldName = obj.fieldName;
332
+ const path_fieldName = path + '.fieldName';
333
+ if (typeof obj_fieldName !== 'string') {
334
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
335
+ }
336
+ }
337
+ if (obj.objectName !== undefined) {
338
+ const obj_objectName = obj.objectName;
339
+ const path_objectName = path + '.objectName';
340
+ if (typeof obj_objectName !== 'string') {
341
+ return new TypeError('Expected "string" but received "' + typeof obj_objectName + '" (at "' + path_objectName + '")');
342
+ }
343
+ }
344
+ })();
345
+ return v_error === undefined ? null : v_error;
346
+ }
347
+
348
+ function validate$A(obj, path = 'RangeFilterOptions') {
349
+ const v_error = (() => {
350
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
351
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
352
+ }
353
+ if (obj.excludeMax !== undefined) {
354
+ const obj_excludeMax = obj.excludeMax;
355
+ const path_excludeMax = path + '.excludeMax';
356
+ if (typeof obj_excludeMax !== 'boolean') {
357
+ return new TypeError('Expected "boolean" but received "' + typeof obj_excludeMax + '" (at "' + path_excludeMax + '")');
358
+ }
359
+ }
360
+ if (obj.excludeMin !== undefined) {
361
+ const obj_excludeMin = obj.excludeMin;
362
+ const path_excludeMin = path + '.excludeMin';
363
+ if (typeof obj_excludeMin !== 'boolean') {
364
+ return new TypeError('Expected "boolean" but received "' + typeof obj_excludeMin + '" (at "' + path_excludeMin + '")');
365
+ }
366
+ }
367
+ if (obj.max !== undefined) {
368
+ const obj_max = obj.max;
369
+ const path_max = path + '.max';
370
+ if (obj_max === undefined) {
371
+ return new TypeError('Expected "defined" but received "' + typeof obj_max + '" (at "' + path_max + '")');
372
+ }
373
+ }
374
+ if (obj.min !== undefined) {
375
+ const obj_min = obj.min;
376
+ const path_min = path + '.min';
377
+ if (obj_min === undefined) {
378
+ return new TypeError('Expected "defined" but received "' + typeof obj_min + '" (at "' + path_min + '")');
379
+ }
380
+ }
381
+ if (obj.nullOption !== undefined) {
382
+ const obj_nullOption = obj.nullOption;
383
+ const path_nullOption = path + '.nullOption';
384
+ if (typeof obj_nullOption !== 'string') {
385
+ return new TypeError('Expected "string" but received "' + typeof obj_nullOption + '" (at "' + path_nullOption + '")');
386
+ }
387
+ }
388
+ })();
389
+ return v_error === undefined ? null : v_error;
390
+ }
391
+
392
+ function validate$z(obj, path = 'RelativeDateFilterOptions') {
393
+ const v_error = (() => {
394
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
395
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
396
+ }
397
+ })();
398
+ return v_error === undefined ? null : v_error;
399
+ }
400
+
401
+ function validate$y(obj, path = 'Filter') {
402
+ const v_error = (() => {
403
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
404
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
405
+ }
406
+ if (obj.categoricalFilterOptions !== undefined) {
407
+ const obj_categoricalFilterOptions = obj.categoricalFilterOptions;
408
+ const path_categoricalFilterOptions = path + '.categoricalFilterOptions';
409
+ const referencepath_categoricalFilterOptionsValidationError = validate$C(obj_categoricalFilterOptions, path_categoricalFilterOptions);
410
+ if (referencepath_categoricalFilterOptionsValidationError !== null) {
411
+ let message = 'Object doesn\'t match CategoricalFilterOptions (at "' + path_categoricalFilterOptions + '")\n';
412
+ message += referencepath_categoricalFilterOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
413
+ return new TypeError(message);
414
+ }
415
+ }
416
+ if (obj.field !== undefined) {
417
+ const obj_field = obj.field;
418
+ const path_field = path + '.field';
419
+ const referencepath_fieldValidationError = validate$B(obj_field, path_field);
420
+ if (referencepath_fieldValidationError !== null) {
421
+ let message = 'Object doesn\'t match FieldId (at "' + path_field + '")\n';
422
+ message += referencepath_fieldValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
423
+ return new TypeError(message);
424
+ }
425
+ }
426
+ if (obj.fieldId !== undefined) {
427
+ const obj_fieldId = obj.fieldId;
428
+ const path_fieldId = path + '.fieldId';
429
+ const referencepath_fieldIdValidationError = validate$B(obj_fieldId, path_fieldId);
430
+ if (referencepath_fieldIdValidationError !== null) {
431
+ let message = 'Object doesn\'t match FieldId (at "' + path_fieldId + '")\n';
432
+ message += referencepath_fieldIdValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
433
+ return new TypeError(message);
434
+ }
435
+ }
436
+ if (obj.rangeFilterOptions !== undefined) {
437
+ const obj_rangeFilterOptions = obj.rangeFilterOptions;
438
+ const path_rangeFilterOptions = path + '.rangeFilterOptions';
439
+ const referencepath_rangeFilterOptionsValidationError = validate$A(obj_rangeFilterOptions, path_rangeFilterOptions);
440
+ if (referencepath_rangeFilterOptionsValidationError !== null) {
441
+ let message = 'Object doesn\'t match RangeFilterOptions (at "' + path_rangeFilterOptions + '")\n';
442
+ message += referencepath_rangeFilterOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
443
+ return new TypeError(message);
444
+ }
445
+ }
446
+ if (obj.relativeDateFilterOptions !== undefined) {
447
+ const obj_relativeDateFilterOptions = obj.relativeDateFilterOptions;
448
+ const path_relativeDateFilterOptions = path + '.relativeDateFilterOptions';
449
+ const referencepath_relativeDateFilterOptionsValidationError = validate$z(obj_relativeDateFilterOptions, path_relativeDateFilterOptions);
450
+ if (referencepath_relativeDateFilterOptionsValidationError !== null) {
451
+ let message = 'Object doesn\'t match RelativeDateFilterOptions (at "' + path_relativeDateFilterOptions + '")\n';
452
+ message += referencepath_relativeDateFilterOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
453
+ return new TypeError(message);
454
+ }
455
+ }
456
+ if (obj.type !== undefined) {
457
+ const obj_type = obj.type;
458
+ const path_type = path + '.type';
459
+ if (typeof obj_type !== 'string') {
460
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
461
+ }
462
+ }
463
+ })();
464
+ return v_error === undefined ? null : v_error;
465
+ }
466
+
467
+ function validate$x(obj, path = 'SemanticFilter') {
468
+ const v_error = (() => {
469
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
470
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
471
+ }
472
+ if (obj.aggregationMethod !== undefined) {
473
+ const obj_aggregationMethod = obj.aggregationMethod;
474
+ const path_aggregationMethod = path + '.aggregationMethod';
475
+ if (typeof obj_aggregationMethod !== 'string') {
476
+ return new TypeError('Expected "string" but received "' + typeof obj_aggregationMethod + '" (at "' + path_aggregationMethod + '")');
477
+ }
478
+ }
479
+ const obj_fieldName = obj.fieldName;
480
+ const path_fieldName = path + '.fieldName';
481
+ if (typeof obj_fieldName !== 'string') {
482
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
483
+ }
484
+ if (obj.fieldType !== undefined) {
485
+ const obj_fieldType = obj.fieldType;
486
+ const path_fieldType = path + '.fieldType';
487
+ if (typeof obj_fieldType !== 'string') {
488
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldType + '" (at "' + path_fieldType + '")');
489
+ }
490
+ }
491
+ const obj_operator = obj.operator;
492
+ const path_operator = path + '.operator';
493
+ if (typeof obj_operator !== 'string') {
494
+ return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
495
+ }
496
+ if (obj.value !== undefined) {
497
+ const obj_value = obj.value;
498
+ const path_value = path + '.value';
499
+ if (typeof obj_value !== 'string') {
500
+ return new TypeError('Expected "string" but received "' + typeof obj_value + '" (at "' + path_value + '")');
501
+ }
502
+ }
503
+ if (obj.values !== undefined) {
504
+ const obj_values = obj.values;
505
+ const path_values = path + '.values';
506
+ if (!ArrayIsArray(obj_values)) {
507
+ return new TypeError('Expected "array" but received "' + typeof obj_values + '" (at "' + path_values + '")');
508
+ }
509
+ for (let i = 0; i < obj_values.length; i++) {
510
+ const obj_values_item = obj_values[i];
511
+ const path_values_item = path_values + '[' + i + ']';
512
+ if (typeof obj_values_item !== 'string') {
513
+ return new TypeError('Expected "string" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
514
+ }
515
+ }
516
+ }
517
+ })();
518
+ return v_error === undefined ? null : v_error;
519
+ }
520
+
521
+ function validate$w(obj, path = 'FlattenFilter') {
522
+ const v_error = (() => {
523
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
524
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
525
+ }
526
+ if (obj.filterLogic !== undefined) {
527
+ const obj_filterLogic = obj.filterLogic;
528
+ const path_filterLogic = path + '.filterLogic';
529
+ if (typeof obj_filterLogic !== 'string') {
530
+ return new TypeError('Expected "string" but received "' + typeof obj_filterLogic + '" (at "' + path_filterLogic + '")');
531
+ }
532
+ }
533
+ if (obj.filters !== undefined) {
534
+ const obj_filters = obj.filters;
535
+ const path_filters = path + '.filters';
536
+ if (!ArrayIsArray(obj_filters)) {
537
+ return new TypeError('Expected "array" but received "' + typeof obj_filters + '" (at "' + path_filters + '")');
538
+ }
539
+ for (let i = 0; i < obj_filters.length; i++) {
540
+ const obj_filters_item = obj_filters[i];
541
+ const path_filters_item = path_filters + '[' + i + ']';
542
+ const referencepath_filters_itemValidationError = validate$x(obj_filters_item, path_filters_item);
543
+ if (referencepath_filters_itemValidationError !== null) {
544
+ let message = 'Object doesn\'t match SemanticFilter (at "' + path_filters_item + '")\n';
545
+ message += referencepath_filters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
546
+ return new TypeError(message);
547
+ }
548
+ }
549
+ }
550
+ })();
551
+ return v_error === undefined ? null : v_error;
552
+ }
553
+
554
+ function validate$v(obj, path = 'MetricInstance') {
555
+ const v_error = (() => {
556
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
557
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
558
+ }
559
+ if (obj.filters !== undefined) {
560
+ const obj_filters = obj.filters;
561
+ const path_filters = path + '.filters';
562
+ if (!ArrayIsArray(obj_filters)) {
563
+ return new TypeError('Expected "array" but received "' + typeof obj_filters + '" (at "' + path_filters + '")');
564
+ }
565
+ for (let i = 0; i < obj_filters.length; i++) {
566
+ const obj_filters_item = obj_filters[i];
567
+ const path_filters_item = path_filters + '[' + i + ']';
568
+ const referencepath_filters_itemValidationError = validate$y(obj_filters_item, path_filters_item);
569
+ if (referencepath_filters_itemValidationError !== null) {
570
+ let message = 'Object doesn\'t match Filter (at "' + path_filters_item + '")\n';
571
+ message += referencepath_filters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
572
+ return new TypeError(message);
573
+ }
574
+ }
575
+ }
576
+ if (obj.goals !== undefined) {
577
+ const obj_goals = obj.goals;
578
+ const path_goals = path + '.goals';
579
+ const referencepath_goalsValidationError = validate$F(obj_goals, path_goals);
580
+ if (referencepath_goalsValidationError !== null) {
581
+ let message = 'Object doesn\'t match GoalMetadata (at "' + path_goals + '")\n';
582
+ message += referencepath_goalsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
583
+ return new TypeError(message);
584
+ }
585
+ }
586
+ if (obj.measurementPeriod !== undefined) {
587
+ const obj_measurementPeriod = obj.measurementPeriod;
588
+ const path_measurementPeriod = path + '.measurementPeriod';
589
+ if (obj_measurementPeriod === undefined) {
590
+ return new TypeError('Expected "defined" but received "' + typeof obj_measurementPeriod + '" (at "' + path_measurementPeriod + '")');
591
+ }
592
+ }
593
+ if (obj.semanticFilter !== undefined) {
594
+ const obj_semanticFilter = obj.semanticFilter;
595
+ const path_semanticFilter = path + '.semanticFilter';
596
+ const referencepath_semanticFilterValidationError = validate$w(obj_semanticFilter, path_semanticFilter);
597
+ if (referencepath_semanticFilterValidationError !== null) {
598
+ let message = 'Object doesn\'t match FlattenFilter (at "' + path_semanticFilter + '")\n';
599
+ message += referencepath_semanticFilterValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
600
+ return new TypeError(message);
601
+ }
602
+ }
603
+ })();
604
+ return v_error === undefined ? null : v_error;
605
+ }
606
+
607
+ function validate$u(obj, path = 'CompareConfig') {
608
+ const v_error = (() => {
609
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
610
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
611
+ }
612
+ if (obj.comparison !== undefined) {
613
+ const obj_comparison = obj.comparison;
614
+ const path_comparison = path + '.comparison';
615
+ if (typeof obj_comparison !== 'string') {
616
+ return new TypeError('Expected "string" but received "' + typeof obj_comparison + '" (at "' + path_comparison + '")');
617
+ }
618
+ }
619
+ })();
620
+ return v_error === undefined ? null : v_error;
621
+ }
622
+
623
+ function validate$t(obj, path = 'Measure') {
624
+ const v_error = (() => {
625
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
626
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
627
+ }
628
+ if (obj.aggregation !== undefined) {
629
+ const obj_aggregation = obj.aggregation;
630
+ const path_aggregation = path + '.aggregation';
631
+ if (typeof obj_aggregation !== 'string') {
632
+ return new TypeError('Expected "string" but received "' + typeof obj_aggregation + '" (at "' + path_aggregation + '")');
633
+ }
634
+ }
635
+ const obj_field = obj.field;
636
+ const path_field = path + '.field';
637
+ const referencepath_fieldValidationError = validate$B(obj_field, path_field);
638
+ if (referencepath_fieldValidationError !== null) {
639
+ let message = 'Object doesn\'t match FieldId (at "' + path_field + '")\n';
640
+ message += referencepath_fieldValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
641
+ return new TypeError(message);
642
+ }
643
+ })();
644
+ return v_error === undefined ? null : v_error;
645
+ }
646
+
647
+ function validate$s(obj, path = 'SemanticDataModel') {
648
+ const v_error = (() => {
649
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
650
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
651
+ }
652
+ if (obj.apiName !== undefined) {
653
+ const obj_apiName = obj.apiName;
654
+ const path_apiName = path + '.apiName';
655
+ if (typeof obj_apiName !== 'string') {
656
+ return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
657
+ }
658
+ }
659
+ })();
660
+ return v_error === undefined ? null : v_error;
661
+ }
662
+
663
+ function validate$r(obj, path = 'TimeDimension') {
664
+ const v_error = (() => {
665
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
666
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
667
+ }
668
+ const obj_field = obj.field;
669
+ const path_field = path + '.field';
670
+ const referencepath_fieldValidationError = validate$B(obj_field, path_field);
671
+ if (referencepath_fieldValidationError !== null) {
672
+ let message = 'Object doesn\'t match FieldId (at "' + path_field + '")\n';
673
+ message += referencepath_fieldValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
674
+ return new TypeError(message);
675
+ }
676
+ })();
677
+ return v_error === undefined ? null : v_error;
678
+ }
679
+
680
+ function validate$q(obj, path = 'MetricDefinition') {
681
+ const v_error = (() => {
682
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
683
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
684
+ }
685
+ const obj_comparison = obj.comparison;
686
+ const path_comparison = path + '.comparison';
687
+ const referencepath_comparisonValidationError = validate$u(obj_comparison, path_comparison);
688
+ if (referencepath_comparisonValidationError !== null) {
689
+ let message = 'Object doesn\'t match CompareConfig (at "' + path_comparison + '")\n';
690
+ message += referencepath_comparisonValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
691
+ return new TypeError(message);
692
+ }
693
+ if (obj.filters !== undefined) {
694
+ const obj_filters = obj.filters;
695
+ const path_filters = path + '.filters';
696
+ if (!ArrayIsArray(obj_filters)) {
697
+ return new TypeError('Expected "array" but received "' + typeof obj_filters + '" (at "' + path_filters + '")');
698
+ }
699
+ for (let i = 0; i < obj_filters.length; i++) {
700
+ const obj_filters_item = obj_filters[i];
701
+ const path_filters_item = path_filters + '[' + i + ']';
702
+ const referencepath_filters_itemValidationError = validate$y(obj_filters_item, path_filters_item);
703
+ if (referencepath_filters_itemValidationError !== null) {
704
+ let message = 'Object doesn\'t match Filter (at "' + path_filters_item + '")\n';
705
+ message += referencepath_filters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
706
+ return new TypeError(message);
707
+ }
708
+ }
709
+ }
710
+ const obj_measure = obj.measure;
711
+ const path_measure = path + '.measure';
712
+ const referencepath_measureValidationError = validate$t(obj_measure, path_measure);
713
+ if (referencepath_measureValidationError !== null) {
714
+ let message = 'Object doesn\'t match Measure (at "' + path_measure + '")\n';
715
+ message += referencepath_measureValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
716
+ return new TypeError(message);
717
+ }
718
+ if (obj.runningTotal !== undefined) {
719
+ const obj_runningTotal = obj.runningTotal;
720
+ const path_runningTotal = path + '.runningTotal';
721
+ if (typeof obj_runningTotal !== 'boolean') {
722
+ return new TypeError('Expected "boolean" but received "' + typeof obj_runningTotal + '" (at "' + path_runningTotal + '")');
723
+ }
724
+ }
725
+ const obj_semanticDataModel = obj.semanticDataModel;
726
+ const path_semanticDataModel = path + '.semanticDataModel';
727
+ const referencepath_semanticDataModelValidationError = validate$s(obj_semanticDataModel, path_semanticDataModel);
728
+ if (referencepath_semanticDataModelValidationError !== null) {
729
+ let message = 'Object doesn\'t match SemanticDataModel (at "' + path_semanticDataModel + '")\n';
730
+ message += referencepath_semanticDataModelValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
731
+ return new TypeError(message);
732
+ }
733
+ if (obj.semanticFilter !== undefined) {
734
+ const obj_semanticFilter = obj.semanticFilter;
735
+ const path_semanticFilter = path + '.semanticFilter';
736
+ const referencepath_semanticFilterValidationError = validate$w(obj_semanticFilter, path_semanticFilter);
737
+ if (referencepath_semanticFilterValidationError !== null) {
738
+ let message = 'Object doesn\'t match FlattenFilter (at "' + path_semanticFilter + '")\n';
739
+ message += referencepath_semanticFilterValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
740
+ return new TypeError(message);
741
+ }
742
+ }
743
+ const obj_timeDimension = obj.timeDimension;
744
+ const path_timeDimension = path + '.timeDimension';
745
+ const referencepath_timeDimensionValidationError = validate$r(obj_timeDimension, path_timeDimension);
746
+ if (referencepath_timeDimensionValidationError !== null) {
747
+ let message = 'Object doesn\'t match TimeDimension (at "' + path_timeDimension + '")\n';
748
+ message += referencepath_timeDimensionValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
749
+ return new TypeError(message);
750
+ }
751
+ })();
752
+ return v_error === undefined ? null : v_error;
753
+ }
754
+
755
+ function validate$p(obj, path = 'RepresentationOptions_NumberUnits') {
756
+ const v_error = (() => {
757
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
758
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
759
+ }
760
+ if (obj.pluralNoun !== undefined) {
761
+ const obj_pluralNoun = obj.pluralNoun;
762
+ const path_pluralNoun = path + '.pluralNoun';
763
+ if (typeof obj_pluralNoun !== 'string') {
764
+ return new TypeError('Expected "string" but received "' + typeof obj_pluralNoun + '" (at "' + path_pluralNoun + '")');
765
+ }
766
+ }
767
+ if (obj.singularNoun !== undefined) {
768
+ const obj_singularNoun = obj.singularNoun;
769
+ const path_singularNoun = path + '.singularNoun';
770
+ if (typeof obj_singularNoun !== 'string') {
771
+ return new TypeError('Expected "string" but received "' + typeof obj_singularNoun + '" (at "' + path_singularNoun + '")');
772
+ }
773
+ }
774
+ })();
775
+ return v_error === undefined ? null : v_error;
776
+ }
777
+
778
+ function validate$o(obj, path = 'RepresentationOptions') {
779
+ const v_error = (() => {
780
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
781
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
782
+ }
783
+ const obj_numberUnits = obj.numberUnits;
784
+ const path_numberUnits = path + '.numberUnits';
785
+ const referencepath_numberUnitsValidationError = validate$p(obj_numberUnits, path_numberUnits);
786
+ if (referencepath_numberUnitsValidationError !== null) {
787
+ let message = 'Object doesn\'t match RepresentationOptions_NumberUnits (at "' + path_numberUnits + '")\n';
788
+ message += referencepath_numberUnitsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
789
+ return new TypeError(message);
790
+ }
791
+ if (obj.sentimentType !== undefined) {
792
+ const obj_sentimentType = obj.sentimentType;
793
+ const path_sentimentType = path + '.sentimentType';
794
+ if (typeof obj_sentimentType !== 'string') {
795
+ return new TypeError('Expected "string" but received "' + typeof obj_sentimentType + '" (at "' + path_sentimentType + '")');
796
+ }
797
+ }
798
+ if (obj.type !== undefined) {
799
+ const obj_type = obj.type;
800
+ const path_type = path + '.type';
801
+ if (typeof obj_type !== 'string') {
802
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
803
+ }
804
+ }
805
+ })();
806
+ return v_error === undefined ? null : v_error;
807
+ }
808
+
809
+ function validate$n(obj, path = 'InputMetric') {
810
+ const v_error = (() => {
811
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
812
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
813
+ }
814
+ const obj_extensionOptions = obj.extensionOptions;
815
+ const path_extensionOptions = path + '.extensionOptions';
816
+ const referencepath_extensionOptionsValidationError = validate$H(obj_extensionOptions, path_extensionOptions);
817
+ if (referencepath_extensionOptionsValidationError !== null) {
818
+ let message = 'Object doesn\'t match ExtensionOptions (at "' + path_extensionOptions + '")\n';
819
+ message += referencepath_extensionOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
820
+ return new TypeError(message);
821
+ }
822
+ if (obj.goals !== undefined) {
823
+ const obj_goals = obj.goals;
824
+ const path_goals = path + '.goals';
825
+ const referencepath_goalsValidationError = validate$F(obj_goals, path_goals);
826
+ if (referencepath_goalsValidationError !== null) {
827
+ let message = 'Object doesn\'t match GoalMetadata (at "' + path_goals + '")\n';
828
+ message += referencepath_goalsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
829
+ return new TypeError(message);
830
+ }
831
+ }
832
+ const obj_insightsOptions = obj.insightsOptions;
833
+ const path_insightsOptions = path + '.insightsOptions';
834
+ const referencepath_insightsOptionsValidationError = validate$D(obj_insightsOptions, path_insightsOptions);
835
+ if (referencepath_insightsOptionsValidationError !== null) {
836
+ let message = 'Object doesn\'t match InsightsOptions (at "' + path_insightsOptions + '")\n';
837
+ message += referencepath_insightsOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
838
+ return new TypeError(message);
839
+ }
840
+ const obj_instance = obj.instance;
841
+ const path_instance = path + '.instance';
842
+ const referencepath_instanceValidationError = validate$v(obj_instance, path_instance);
843
+ if (referencepath_instanceValidationError !== null) {
844
+ let message = 'Object doesn\'t match MetricInstance (at "' + path_instance + '")\n';
845
+ message += referencepath_instanceValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
846
+ return new TypeError(message);
847
+ }
848
+ const obj_metric = obj.metric;
849
+ const path_metric = path + '.metric';
850
+ const referencepath_metricValidationError = validate$q(obj_metric, path_metric);
851
+ if (referencepath_metricValidationError !== null) {
852
+ let message = 'Object doesn\'t match MetricDefinition (at "' + path_metric + '")\n';
853
+ message += referencepath_metricValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
854
+ return new TypeError(message);
855
+ }
856
+ const obj_representationOptions = obj.representationOptions;
857
+ const path_representationOptions = path + '.representationOptions';
858
+ const referencepath_representationOptionsValidationError = validate$o(obj_representationOptions, path_representationOptions);
859
+ if (referencepath_representationOptionsValidationError !== null) {
860
+ let message = 'Object doesn\'t match RepresentationOptions (at "' + path_representationOptions + '")\n';
861
+ message += referencepath_representationOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
862
+ return new TypeError(message);
863
+ }
864
+ })();
865
+ return v_error === undefined ? null : v_error;
866
+ }
867
+
868
+ function validate$m(obj, path = 'InsightBundleInput') {
869
+ const v_error = (() => {
870
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
871
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
872
+ }
873
+ const obj_metadata = obj.metadata;
874
+ const path_metadata = path + '.metadata';
875
+ const referencepath_metadataValidationError = validate$I(obj_metadata, path_metadata);
876
+ if (referencepath_metadataValidationError !== null) {
877
+ let message = 'Object doesn\'t match MetricMetadata (at "' + path_metadata + '")\n';
878
+ message += referencepath_metadataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
879
+ return new TypeError(message);
880
+ }
881
+ const obj_metric = obj.metric;
882
+ const path_metric = path + '.metric';
883
+ const referencepath_metricValidationError = validate$n(obj_metric, path_metric);
884
+ if (referencepath_metricValidationError !== null) {
885
+ let message = 'Object doesn\'t match InputMetric (at "' + path_metric + '")\n';
886
+ message += referencepath_metricValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
887
+ return new TypeError(message);
888
+ }
889
+ })();
890
+ return v_error === undefined ? null : v_error;
891
+ }
892
+
893
+ const VERSION$g = "7948f62379bf327a3cc190504223aecc";
894
+ function validate$l(obj, path = 'UnifiedFilter') {
895
+ const v_error = (() => {
896
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
897
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
898
+ }
899
+ if (obj.fieldName !== undefined) {
900
+ const obj_fieldName = obj.fieldName;
901
+ const path_fieldName = path + '.fieldName';
902
+ if (typeof obj_fieldName !== 'string') {
903
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
904
+ }
905
+ }
906
+ if (obj.operator !== undefined) {
907
+ const obj_operator = obj.operator;
908
+ const path_operator = path + '.operator';
909
+ if (typeof obj_operator !== 'string') {
910
+ return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
911
+ }
912
+ }
913
+ if (obj.values !== undefined) {
914
+ const obj_values = obj.values;
915
+ const path_values = path + '.values';
916
+ if (!ArrayIsArray(obj_values)) {
917
+ return new TypeError('Expected "array" but received "' + typeof obj_values + '" (at "' + path_values + '")');
918
+ }
919
+ for (let i = 0; i < obj_values.length; i++) {
920
+ const obj_values_item = obj_values[i];
921
+ const path_values_item = path_values + '[' + i + ']';
922
+ if (obj_values_item === undefined) {
923
+ return new TypeError('Expected "defined" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
924
+ }
925
+ }
926
+ }
927
+ })();
928
+ return v_error === undefined ? null : v_error;
929
+ }
930
+ const select$l = function UnifiedFilterSelect() {
931
+ return {
932
+ kind: 'Fragment',
933
+ version: VERSION$g,
934
+ private: [],
935
+ selections: [
936
+ {
937
+ name: 'fieldName',
938
+ kind: 'Scalar',
939
+ required: false
940
+ },
941
+ {
942
+ name: 'operator',
943
+ kind: 'Scalar',
944
+ required: false
945
+ },
946
+ {
947
+ name: 'values',
948
+ kind: 'Object',
949
+ // any
950
+ }
951
+ ]
952
+ };
953
+ };
954
+ function equals$g(existing, incoming) {
955
+ const existing_fieldName = existing.fieldName;
956
+ const incoming_fieldName = incoming.fieldName;
957
+ // if at least one of these optionals is defined
958
+ if (existing_fieldName !== undefined || incoming_fieldName !== undefined) {
959
+ // if one of these is not defined we know the other is defined and therefore
960
+ // not equal
961
+ if (existing_fieldName === undefined || incoming_fieldName === undefined) {
962
+ return false;
963
+ }
964
+ if (!(existing_fieldName === incoming_fieldName)) {
965
+ return false;
966
+ }
967
+ }
968
+ const existing_operator = existing.operator;
969
+ const incoming_operator = incoming.operator;
970
+ // if at least one of these optionals is defined
971
+ if (existing_operator !== undefined || incoming_operator !== undefined) {
972
+ // if one of these is not defined we know the other is defined and therefore
973
+ // not equal
974
+ if (existing_operator === undefined || incoming_operator === undefined) {
975
+ return false;
976
+ }
977
+ if (!(existing_operator === incoming_operator)) {
978
+ return false;
979
+ }
980
+ }
981
+ const existing_values = existing.values;
982
+ const incoming_values = incoming.values;
983
+ // if at least one of these optionals is defined
984
+ if (existing_values !== undefined || incoming_values !== undefined) {
985
+ // if one of these is not defined we know the other is defined and therefore
986
+ // not equal
987
+ if (existing_values === undefined || incoming_values === undefined) {
988
+ return false;
989
+ }
990
+ const equals_values_items = equalsArray(existing_values, incoming_values, (existing_values_item, incoming_values_item) => {
991
+ if (JSONStringify(incoming_values_item) !== JSONStringify(existing_values_item)) {
992
+ return false;
993
+ }
994
+ });
995
+ if (equals_values_items === false) {
996
+ return false;
997
+ }
998
+ }
999
+ return true;
1000
+ }
1001
+
1002
+ function validate$k(obj, path = 'MetricInstanceInput') {
1003
+ const v_error = (() => {
1004
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1005
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1006
+ }
1007
+ if (obj.measurementPeriod !== undefined) {
1008
+ const obj_measurementPeriod = obj.measurementPeriod;
1009
+ const path_measurementPeriod = path + '.measurementPeriod';
1010
+ const referencepath_measurementPeriodValidationError = validate$l(obj_measurementPeriod, path_measurementPeriod);
1011
+ if (referencepath_measurementPeriodValidationError !== null) {
1012
+ let message = 'Object doesn\'t match UnifiedFilter (at "' + path_measurementPeriod + '")\n';
1013
+ message += referencepath_measurementPeriodValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1014
+ return new TypeError(message);
1015
+ }
1016
+ }
1017
+ const obj_metricInstanceId = obj.metricInstanceId;
1018
+ const path_metricInstanceId = path + '.metricInstanceId';
1019
+ if (typeof obj_metricInstanceId !== 'string') {
1020
+ return new TypeError('Expected "string" but received "' + typeof obj_metricInstanceId + '" (at "' + path_metricInstanceId + '")');
1021
+ }
1022
+ const obj_sdmId = obj.sdmId;
1023
+ const path_sdmId = path + '.sdmId';
1024
+ if (typeof obj_sdmId !== 'string') {
1025
+ return new TypeError('Expected "string" but received "' + typeof obj_sdmId + '" (at "' + path_sdmId + '")');
1026
+ }
1027
+ })();
1028
+ return v_error === undefined ? null : v_error;
1029
+ }
1030
+
1031
+ function validate$j(obj, path = 'BatchInput') {
1032
+ const v_error = (() => {
1033
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1034
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1035
+ }
1036
+ if (obj.bundleInput !== undefined) {
1037
+ const obj_bundleInput = obj.bundleInput;
1038
+ const path_bundleInput = path + '.bundleInput';
1039
+ const referencepath_bundleInputValidationError = validate$m(obj_bundleInput, path_bundleInput);
1040
+ if (referencepath_bundleInputValidationError !== null) {
1041
+ let message = 'Object doesn\'t match InsightBundleInput (at "' + path_bundleInput + '")\n';
1042
+ message += referencepath_bundleInputValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1043
+ return new TypeError(message);
1044
+ }
1045
+ }
1046
+ if (obj.metricInstanceInput !== undefined) {
1047
+ const obj_metricInstanceInput = obj.metricInstanceInput;
1048
+ const path_metricInstanceInput = path + '.metricInstanceInput';
1049
+ const referencepath_metricInstanceInputValidationError = validate$k(obj_metricInstanceInput, path_metricInstanceInput);
1050
+ if (referencepath_metricInstanceInputValidationError !== null) {
1051
+ let message = 'Object doesn\'t match MetricInstanceInput (at "' + path_metricInstanceInput + '")\n';
1052
+ message += referencepath_metricInstanceInputValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1053
+ return new TypeError(message);
1054
+ }
1055
+ }
1056
+ })();
1057
+ return v_error === undefined ? null : v_error;
1058
+ }
1059
+
1060
+ function validate$i(obj, path = 'InsightBundleOptions') {
1061
+ const v_error = (() => {
1062
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1063
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1064
+ }
1065
+ if (obj.now !== undefined) {
1066
+ const obj_now = obj.now;
1067
+ const path_now = path + '.now';
1068
+ if (typeof obj_now !== 'string') {
1069
+ return new TypeError('Expected "string" but received "' + typeof obj_now + '" (at "' + path_now + '")');
1070
+ }
1071
+ }
1072
+ if (obj.outputFormat !== undefined) {
1073
+ const obj_outputFormat = obj.outputFormat;
1074
+ const path_outputFormat = path + '.outputFormat';
1075
+ if (typeof obj_outputFormat !== 'string') {
1076
+ return new TypeError('Expected "string" but received "' + typeof obj_outputFormat + '" (at "' + path_outputFormat + '")');
1077
+ }
1078
+ }
1079
+ if (obj.timeZone !== undefined) {
1080
+ const obj_timeZone = obj.timeZone;
1081
+ const path_timeZone = path + '.timeZone';
1082
+ if (typeof obj_timeZone !== 'string') {
1083
+ return new TypeError('Expected "string" but received "' + typeof obj_timeZone + '" (at "' + path_timeZone + '")');
1084
+ }
1085
+ }
1086
+ })();
1087
+ return v_error === undefined ? null : v_error;
1088
+ }
1089
+
1090
+ function validate$h(obj, path = 'SummarizationOptions') {
1091
+ const v_error = (() => {
1092
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1093
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1094
+ }
1095
+ if (obj.strategy !== undefined) {
1096
+ const obj_strategy = obj.strategy;
1097
+ const path_strategy = path + '.strategy';
1098
+ if (typeof obj_strategy !== 'string') {
1099
+ return new TypeError('Expected "string" but received "' + typeof obj_strategy + '" (at "' + path_strategy + '")');
1100
+ }
1101
+ }
1102
+ })();
1103
+ return v_error === undefined ? null : v_error;
1104
+ }
1105
+
1106
+ function validate$g(obj, path = 'BatchOptions') {
1107
+ const v_error = (() => {
1108
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1109
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1110
+ }
1111
+ if (obj.bundle !== undefined) {
1112
+ const obj_bundle = obj.bundle;
1113
+ const path_bundle = path + '.bundle';
1114
+ const referencepath_bundleValidationError = validate$i(obj_bundle, path_bundle);
1115
+ if (referencepath_bundleValidationError !== null) {
1116
+ let message = 'Object doesn\'t match InsightBundleOptions (at "' + path_bundle + '")\n';
1117
+ message += referencepath_bundleValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1118
+ return new TypeError(message);
1119
+ }
1120
+ }
1121
+ if (obj.skipCache !== undefined) {
1122
+ const obj_skipCache = obj.skipCache;
1123
+ const path_skipCache = path + '.skipCache';
1124
+ if (typeof obj_skipCache !== 'boolean') {
1125
+ return new TypeError('Expected "boolean" but received "' + typeof obj_skipCache + '" (at "' + path_skipCache + '")');
1126
+ }
1127
+ }
1128
+ if (obj.summarization !== undefined) {
1129
+ const obj_summarization = obj.summarization;
1130
+ const path_summarization = path + '.summarization';
1131
+ const referencepath_summarizationValidationError = validate$h(obj_summarization, path_summarization);
1132
+ if (referencepath_summarizationValidationError !== null) {
1133
+ let message = 'Object doesn\'t match SummarizationOptions (at "' + path_summarization + '")\n';
1134
+ message += referencepath_summarizationValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1135
+ return new TypeError(message);
1136
+ }
1137
+ }
1138
+ })();
1139
+ return v_error === undefined ? null : v_error;
1140
+ }
1141
+
1142
+ const VERSION$f = "07a8c889542dbad6f958515513d4e3fb";
1143
+ function validate$f(obj, path = 'Error') {
1144
+ const v_error = (() => {
1145
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1146
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1147
+ }
1148
+ if (obj.code !== undefined) {
1149
+ const obj_code = obj.code;
1150
+ const path_code = path + '.code';
1151
+ if (typeof obj_code !== 'string') {
1152
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
1153
+ }
1154
+ }
1155
+ if (obj.message !== undefined) {
1156
+ const obj_message = obj.message;
1157
+ const path_message = path + '.message';
1158
+ if (typeof obj_message !== 'string') {
1159
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
1160
+ }
1161
+ }
1162
+ })();
1163
+ return v_error === undefined ? null : v_error;
1164
+ }
1165
+ const select$k = function ErrorSelect() {
1166
+ return {
1167
+ kind: 'Fragment',
1168
+ version: VERSION$f,
1169
+ private: [],
1170
+ selections: [
1171
+ {
1172
+ name: 'code',
1173
+ kind: 'Scalar',
1174
+ required: false
1175
+ },
1176
+ {
1177
+ name: 'message',
1178
+ kind: 'Scalar',
1179
+ required: false
1180
+ }
1181
+ ]
1182
+ };
1183
+ };
1184
+ function equals$f(existing, incoming) {
1185
+ const existing_code = existing.code;
1186
+ const incoming_code = incoming.code;
1187
+ // if at least one of these optionals is defined
1188
+ if (existing_code !== undefined || incoming_code !== undefined) {
1189
+ // if one of these is not defined we know the other is defined and therefore
1190
+ // not equal
1191
+ if (existing_code === undefined || incoming_code === undefined) {
1192
+ return false;
1193
+ }
1194
+ if (!(existing_code === incoming_code)) {
1195
+ return false;
1196
+ }
1197
+ }
1198
+ const existing_message = existing.message;
1199
+ const incoming_message = incoming.message;
1200
+ // if at least one of these optionals is defined
1201
+ if (existing_message !== undefined || incoming_message !== undefined) {
1202
+ // if one of these is not defined we know the other is defined and therefore
1203
+ // not equal
1204
+ if (existing_message === undefined || incoming_message === undefined) {
1205
+ return false;
1206
+ }
1207
+ if (!(existing_message === incoming_message)) {
1208
+ return false;
1209
+ }
1210
+ }
1211
+ return true;
1212
+ }
1213
+
1214
+ const VERSION$e = "6e24eb6767cb7eb05e4ae19fffe299b1";
1215
+ function validate$e(obj, path = 'Summary') {
1216
+ const v_error = (() => {
1217
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1218
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1219
+ }
1220
+ if (obj.generationId !== undefined) {
1221
+ const obj_generationId = obj.generationId;
1222
+ const path_generationId = path + '.generationId';
1223
+ if (typeof obj_generationId !== 'string') {
1224
+ return new TypeError('Expected "string" but received "' + typeof obj_generationId + '" (at "' + path_generationId + '")');
1225
+ }
1226
+ }
1227
+ const obj_markup = obj.markup;
1228
+ const path_markup = path + '.markup';
1229
+ if (typeof obj_markup !== 'string') {
1230
+ return new TypeError('Expected "string" but received "' + typeof obj_markup + '" (at "' + path_markup + '")');
1231
+ }
1232
+ const obj_strategy = obj.strategy;
1233
+ const path_strategy = path + '.strategy';
1234
+ if (typeof obj_strategy !== 'string') {
1235
+ return new TypeError('Expected "string" but received "' + typeof obj_strategy + '" (at "' + path_strategy + '")');
1236
+ }
1237
+ const obj_timestamp = obj.timestamp;
1238
+ const path_timestamp = path + '.timestamp';
1239
+ if (typeof obj_timestamp !== 'string') {
1240
+ return new TypeError('Expected "string" but received "' + typeof obj_timestamp + '" (at "' + path_timestamp + '")');
1241
+ }
1242
+ })();
1243
+ return v_error === undefined ? null : v_error;
1244
+ }
1245
+ const select$j = function SummarySelect() {
1246
+ return {
1247
+ kind: 'Fragment',
1248
+ version: VERSION$e,
1249
+ private: [],
1250
+ selections: [
1251
+ {
1252
+ name: 'generationId',
1253
+ kind: 'Scalar',
1254
+ required: false
1255
+ },
1256
+ {
1257
+ name: 'markup',
1258
+ kind: 'Scalar'
1259
+ },
1260
+ {
1261
+ name: 'strategy',
1262
+ kind: 'Scalar'
1263
+ },
1264
+ {
1265
+ name: 'timestamp',
1266
+ kind: 'Scalar'
1267
+ }
1268
+ ]
1269
+ };
1270
+ };
1271
+ function equals$e(existing, incoming) {
1272
+ const existing_generationId = existing.generationId;
1273
+ const incoming_generationId = incoming.generationId;
1274
+ // if at least one of these optionals is defined
1275
+ if (existing_generationId !== undefined || incoming_generationId !== undefined) {
1276
+ // if one of these is not defined we know the other is defined and therefore
1277
+ // not equal
1278
+ if (existing_generationId === undefined || incoming_generationId === undefined) {
1279
+ return false;
1280
+ }
1281
+ if (!(existing_generationId === incoming_generationId)) {
1282
+ return false;
1283
+ }
1284
+ }
1285
+ const existing_markup = existing.markup;
1286
+ const incoming_markup = incoming.markup;
1287
+ if (!(existing_markup === incoming_markup)) {
1288
+ return false;
1289
+ }
1290
+ const existing_strategy = existing.strategy;
1291
+ const incoming_strategy = incoming.strategy;
1292
+ if (!(existing_strategy === incoming_strategy)) {
1293
+ return false;
1294
+ }
1295
+ const existing_timestamp = existing.timestamp;
1296
+ const incoming_timestamp = incoming.timestamp;
1297
+ if (!(existing_timestamp === incoming_timestamp)) {
1298
+ return false;
1299
+ }
1300
+ return true;
1301
+ }
1302
+
1303
+ const VERSION$d = "fc433e1c68019470090193fa4fdf976f";
1304
+ function validate$d(obj, path = 'SummaryResponse') {
1305
+ const v_error = (() => {
1306
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1307
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1308
+ }
1309
+ if (obj.error !== undefined) {
1310
+ const obj_error = obj.error;
1311
+ const path_error = path + '.error';
1312
+ const referencepath_errorValidationError = validate$f(obj_error, path_error);
1313
+ if (referencepath_errorValidationError !== null) {
1314
+ let message = 'Object doesn\'t match Error (at "' + path_error + '")\n';
1315
+ message += referencepath_errorValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1316
+ return new TypeError(message);
1317
+ }
1318
+ }
1319
+ const obj_result = obj.result;
1320
+ const path_result = path + '.result';
1321
+ const referencepath_resultValidationError = validate$e(obj_result, path_result);
1322
+ if (referencepath_resultValidationError !== null) {
1323
+ let message = 'Object doesn\'t match Summary (at "' + path_result + '")\n';
1324
+ message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1325
+ return new TypeError(message);
1326
+ }
1327
+ })();
1328
+ return v_error === undefined ? null : v_error;
1329
+ }
1330
+ const select$i = function SummaryResponseSelect() {
1331
+ const { selections: Error__selections, opaque: Error__opaque, } = select$k();
1332
+ const { selections: Summary__selections, opaque: Summary__opaque, } = select$j();
1333
+ return {
1334
+ kind: 'Fragment',
1335
+ version: VERSION$d,
1336
+ private: [],
1337
+ selections: [
1338
+ {
1339
+ name: 'error',
1340
+ kind: 'Object',
1341
+ selections: Error__selections,
1342
+ required: false
1343
+ },
1344
+ {
1345
+ name: 'result',
1346
+ kind: 'Object',
1347
+ selections: Summary__selections
1348
+ }
1349
+ ]
1350
+ };
1351
+ };
1352
+ function equals$d(existing, incoming) {
1353
+ const existing_error = existing.error;
1354
+ const incoming_error = incoming.error;
1355
+ // if at least one of these optionals is defined
1356
+ if (existing_error !== undefined || incoming_error !== undefined) {
1357
+ // if one of these is not defined we know the other is defined and therefore
1358
+ // not equal
1359
+ if (existing_error === undefined || incoming_error === undefined) {
1360
+ return false;
1361
+ }
1362
+ if (!(equals$f(existing_error, incoming_error))) {
1363
+ return false;
1364
+ }
1365
+ }
1366
+ const existing_result = existing.result;
1367
+ const incoming_result = incoming.result;
1368
+ if (!(equals$e(existing_result, incoming_result))) {
1369
+ return false;
1370
+ }
1371
+ return true;
1372
+ }
1373
+
1374
+ const VERSION$c = "18d65084646c870abf335d268675999e";
1375
+ function validate$c(obj, path = 'GenerateInsightBatchResponse') {
1376
+ const v_error = (() => {
1377
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1378
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1379
+ }
1380
+ const obj_batchId = obj.batchId;
1381
+ const path_batchId = path + '.batchId';
1382
+ if (typeof obj_batchId !== 'string') {
1383
+ return new TypeError('Expected "string" but received "' + typeof obj_batchId + '" (at "' + path_batchId + '")');
1384
+ }
1385
+ if (obj.generatingSummary !== undefined) {
1386
+ const obj_generatingSummary = obj.generatingSummary;
1387
+ const path_generatingSummary = path + '.generatingSummary';
1388
+ if (typeof obj_generatingSummary !== 'boolean') {
1389
+ return new TypeError('Expected "boolean" but received "' + typeof obj_generatingSummary + '" (at "' + path_generatingSummary + '")');
1390
+ }
1391
+ }
1392
+ if (obj.summary !== undefined) {
1393
+ const obj_summary = obj.summary;
1394
+ const path_summary = path + '.summary';
1395
+ const referencepath_summaryValidationError = validate$d(obj_summary, path_summary);
1396
+ if (referencepath_summaryValidationError !== null) {
1397
+ let message = 'Object doesn\'t match SummaryResponse (at "' + path_summary + '")\n';
1398
+ message += referencepath_summaryValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1399
+ return new TypeError(message);
1400
+ }
1401
+ }
1402
+ if (obj.timestamp !== undefined) {
1403
+ const obj_timestamp = obj.timestamp;
1404
+ const path_timestamp = path + '.timestamp';
1405
+ if (typeof obj_timestamp !== 'string') {
1406
+ return new TypeError('Expected "string" but received "' + typeof obj_timestamp + '" (at "' + path_timestamp + '")');
1407
+ }
1408
+ }
1409
+ })();
1410
+ return v_error === undefined ? null : v_error;
1411
+ }
1412
+ const RepresentationType$3 = 'GenerateInsightBatchResponse';
1413
+ function keyBuilder$5(luvio, config) {
1414
+ return keyPrefix + '::' + RepresentationType$3 + ':' + config.batchid;
1415
+ }
1416
+ function keyBuilderFromType$3(luvio, object) {
1417
+ const keyParams = {
1418
+ batchid: object.batchId
1419
+ };
1420
+ return keyBuilder$5(luvio, keyParams);
1421
+ }
1422
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
1423
+ return input;
1424
+ }
1425
+ const select$h = function GenerateInsightBatchResponseSelect() {
1426
+ const { selections: SummaryResponse__selections, opaque: SummaryResponse__opaque, } = select$i();
1427
+ return {
1428
+ kind: 'Fragment',
1429
+ version: VERSION$c,
1430
+ private: [],
1431
+ selections: [
1432
+ {
1433
+ name: 'batchId',
1434
+ kind: 'Scalar'
1435
+ },
1436
+ {
1437
+ name: 'generatingSummary',
1438
+ kind: 'Scalar',
1439
+ required: false
1440
+ },
1441
+ {
1442
+ name: 'summary',
1443
+ kind: 'Object',
1444
+ selections: SummaryResponse__selections,
1445
+ required: false
1446
+ },
1447
+ {
1448
+ name: 'timestamp',
1449
+ kind: 'Scalar',
1450
+ required: false
1451
+ }
1452
+ ]
1453
+ };
1454
+ };
1455
+ function equals$c(existing, incoming) {
1456
+ const existing_generatingSummary = existing.generatingSummary;
1457
+ const incoming_generatingSummary = incoming.generatingSummary;
1458
+ // if at least one of these optionals is defined
1459
+ if (existing_generatingSummary !== undefined || incoming_generatingSummary !== undefined) {
1460
+ // if one of these is not defined we know the other is defined and therefore
1461
+ // not equal
1462
+ if (existing_generatingSummary === undefined || incoming_generatingSummary === undefined) {
1463
+ return false;
1464
+ }
1465
+ if (!(existing_generatingSummary === incoming_generatingSummary)) {
1466
+ return false;
1467
+ }
1468
+ }
1469
+ const existing_batchId = existing.batchId;
1470
+ const incoming_batchId = incoming.batchId;
1471
+ if (!(existing_batchId === incoming_batchId)) {
1472
+ return false;
1473
+ }
1474
+ const existing_timestamp = existing.timestamp;
1475
+ const incoming_timestamp = incoming.timestamp;
1476
+ // if at least one of these optionals is defined
1477
+ if (existing_timestamp !== undefined || incoming_timestamp !== undefined) {
1478
+ // if one of these is not defined we know the other is defined and therefore
1479
+ // not equal
1480
+ if (existing_timestamp === undefined || incoming_timestamp === undefined) {
1481
+ return false;
1482
+ }
1483
+ if (!(existing_timestamp === incoming_timestamp)) {
1484
+ return false;
1485
+ }
1486
+ }
1487
+ const existing_summary = existing.summary;
1488
+ const incoming_summary = incoming.summary;
1489
+ // if at least one of these optionals is defined
1490
+ if (existing_summary !== undefined || incoming_summary !== undefined) {
1491
+ // if one of these is not defined we know the other is defined and therefore
1492
+ // not equal
1493
+ if (existing_summary === undefined || incoming_summary === undefined) {
1494
+ return false;
1495
+ }
1496
+ if (!(equals$d(existing_summary, incoming_summary))) {
1497
+ return false;
1498
+ }
1499
+ }
1500
+ return true;
1501
+ }
1502
+ const ingest$3 = function GenerateInsightBatchResponseIngest(input, path, luvio, store, timestamp) {
1503
+ if (process.env.NODE_ENV !== 'production') {
1504
+ const validateError = validate$c(input);
1505
+ if (validateError !== null) {
1506
+ throw validateError;
1507
+ }
1508
+ }
1509
+ const key = keyBuilderFromType$3(luvio, input);
1510
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
1511
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "analytics-insights", VERSION$c, RepresentationType$3, equals$c);
1512
+ return createLink(key);
1513
+ };
1514
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
1515
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1516
+ const rootKey = keyBuilderFromType$3(luvio, input);
1517
+ rootKeySet.set(rootKey, {
1518
+ namespace: keyPrefix,
1519
+ representationName: RepresentationType$3,
1520
+ mergeable: false
1521
+ });
1522
+ }
1523
+
1524
+ function select$g(luvio, params) {
1525
+ return select$h();
1526
+ }
1527
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
1528
+ getTypeCacheKeys$3(storeKeyMap, luvio, response);
1529
+ }
1530
+ function ingestSuccess$4(luvio, resourceParams, response) {
1531
+ const { body } = response;
1532
+ const key = keyBuilderFromType$3(luvio, body);
1533
+ luvio.storeIngest(key, ingest$3, body);
1534
+ const snapshot = luvio.storeLookup({
1535
+ recordId: key,
1536
+ node: select$g(),
1537
+ variables: {},
1538
+ });
1539
+ if (process.env.NODE_ENV !== 'production') {
1540
+ if (snapshot.state !== 'Fulfilled') {
1541
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1542
+ }
1543
+ }
1544
+ deepFreeze(snapshot.data);
1545
+ return snapshot;
1546
+ }
1547
+ function createResourceRequest$4(config) {
1548
+ const headers = {};
1549
+ const header_xSfdcSourceapp = config.headers.xSfdcSourceapp;
1550
+ if (header_xSfdcSourceapp !== undefined) {
1551
+ headers['x-sfdc-sourceapp'] = header_xSfdcSourceapp;
1552
+ }
1553
+ const header_xSfdcSourcecontext = config.headers.xSfdcSourcecontext;
1554
+ if (header_xSfdcSourcecontext !== undefined) {
1555
+ headers['x-sfdc-sourcecontext'] = header_xSfdcSourcecontext;
1556
+ }
1557
+ return {
1558
+ baseUri: 'api.salesforce.com',
1559
+ basePath: '/analytics/insights/v1/batches',
1560
+ method: 'post',
1561
+ body: config.body,
1562
+ urlParams: {},
1563
+ queryParams: {},
1564
+ headers,
1565
+ priority: 'normal',
1566
+ };
1567
+ }
1568
+
1569
+ const adapterName$4 = 'createInsightsBatch';
1570
+ const createInsightsBatch_ConfigPropertyMetadata = [
1571
+ generateParamConfigMetadata('batchInput', false, 2 /* Body */, 4 /* Unsupported */, true),
1572
+ generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
1573
+ generateParamConfigMetadata('xSfdcSourceapp', false, 3 /* Header */, 0 /* String */),
1574
+ generateParamConfigMetadata('xSfdcSourcecontext', false, 3 /* Header */, 0 /* String */),
1575
+ ];
1576
+ const createInsightsBatch_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, createInsightsBatch_ConfigPropertyMetadata);
1577
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$5(createInsightsBatch_ConfigPropertyMetadata);
1578
+ function typeCheckConfig$4(untrustedConfig) {
1579
+ const config = {};
1580
+ typeCheckConfig$5(untrustedConfig, config, createInsightsBatch_ConfigPropertyMetadata);
1581
+ const untrustedConfig_batchInput = untrustedConfig.batchInput;
1582
+ if (ArrayIsArray$1(untrustedConfig_batchInput)) {
1583
+ const untrustedConfig_batchInput_array = [];
1584
+ for (let i = 0, arrayLength = untrustedConfig_batchInput.length; i < arrayLength; i++) {
1585
+ const untrustedConfig_batchInput_item = untrustedConfig_batchInput[i];
1586
+ const referenceBatchInputValidationError = validate$j(untrustedConfig_batchInput_item);
1587
+ if (referenceBatchInputValidationError === null) {
1588
+ untrustedConfig_batchInput_array.push(untrustedConfig_batchInput_item);
1589
+ }
1590
+ }
1591
+ config.batchInput = untrustedConfig_batchInput_array;
1592
+ }
1593
+ const untrustedConfig_options = untrustedConfig.options;
1594
+ const referenceBatchOptionsValidationError = validate$g(untrustedConfig_options);
1595
+ if (referenceBatchOptionsValidationError === null) {
1596
+ config.options = untrustedConfig_options;
1597
+ }
1598
+ return config;
1599
+ }
1600
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
1601
+ if (!untrustedIsObject(untrustedConfig)) {
1602
+ return null;
1603
+ }
1604
+ if (process.env.NODE_ENV !== 'production') {
1605
+ validateConfig(untrustedConfig, configPropertyNames);
1606
+ }
1607
+ const config = typeCheckConfig$4(untrustedConfig);
1608
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1609
+ return null;
1610
+ }
1611
+ return config;
1612
+ }
1613
+ function buildNetworkSnapshot$4(luvio, config, options) {
1614
+ const resourceParams = createResourceParams$4(config);
1615
+ const request = createResourceRequest$4(resourceParams);
1616
+ return luvio.dispatchResourceRequest(request, options)
1617
+ .then((response) => {
1618
+ return luvio.handleSuccessResponse(() => {
1619
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response);
1620
+ return luvio.storeBroadcast().then(() => snapshot);
1621
+ }, () => {
1622
+ const cache = new StoreKeyMap();
1623
+ getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
1624
+ return cache;
1625
+ });
1626
+ }, (response) => {
1627
+ deepFreeze(response);
1628
+ throw response;
1629
+ });
1630
+ }
1631
+ const createInsightsBatchAdapterFactory = (luvio) => {
1632
+ return function createInsightsBatch(untrustedConfig) {
1633
+ const config = validateAdapterConfig$4(untrustedConfig, createInsightsBatch_ConfigPropertyNames);
1634
+ // Invalid or incomplete config
1635
+ if (config === null) {
1636
+ throw new Error('Invalid config for "createInsightsBatch"');
1637
+ }
1638
+ return buildNetworkSnapshot$4(luvio, config);
1639
+ };
1640
+ };
1641
+
1642
+ const VERSION$b = "f898ff84f82ad0ca1eca0045e17ce492";
1643
+ function validate$b(obj, path = 'GetFilterValuesResponse_CategoricalValues') {
1644
+ const v_error = (() => {
1645
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1646
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1647
+ }
1648
+ if (obj.values !== undefined) {
1649
+ const obj_values = obj.values;
1650
+ const path_values = path + '.values';
1651
+ if (!ArrayIsArray(obj_values)) {
1652
+ return new TypeError('Expected "array" but received "' + typeof obj_values + '" (at "' + path_values + '")');
1653
+ }
1654
+ for (let i = 0; i < obj_values.length; i++) {
1655
+ const obj_values_item = obj_values[i];
1656
+ const path_values_item = path_values + '[' + i + ']';
1657
+ let obj_values_item_union0 = null;
1658
+ const obj_values_item_union0_error = (() => {
1659
+ if (typeof obj_values_item !== 'string') {
1660
+ return new TypeError('Expected "string" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
1661
+ }
1662
+ })();
1663
+ if (obj_values_item_union0_error != null) {
1664
+ obj_values_item_union0 = obj_values_item_union0_error.message;
1665
+ }
1666
+ let obj_values_item_union1 = null;
1667
+ const obj_values_item_union1_error = (() => {
1668
+ if (typeof obj_values_item !== 'number') {
1669
+ return new TypeError('Expected "number" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
1670
+ }
1671
+ })();
1672
+ if (obj_values_item_union1_error != null) {
1673
+ obj_values_item_union1 = obj_values_item_union1_error.message;
1674
+ }
1675
+ let obj_values_item_union2 = null;
1676
+ const obj_values_item_union2_error = (() => {
1677
+ if (typeof obj_values_item !== 'boolean') {
1678
+ return new TypeError('Expected "boolean" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
1679
+ }
1680
+ })();
1681
+ if (obj_values_item_union2_error != null) {
1682
+ obj_values_item_union2 = obj_values_item_union2_error.message;
1683
+ }
1684
+ let obj_values_item_union3 = null;
1685
+ const obj_values_item_union3_error = (() => {
1686
+ if (obj_values_item !== null) {
1687
+ return new TypeError('Expected "null" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
1688
+ }
1689
+ })();
1690
+ if (obj_values_item_union3_error != null) {
1691
+ obj_values_item_union3 = obj_values_item_union3_error.message;
1692
+ }
1693
+ if (obj_values_item_union0 && obj_values_item_union1 && obj_values_item_union2 && obj_values_item_union3) {
1694
+ let message = 'Object doesn\'t match union (at "' + path_values_item + '")';
1695
+ message += '\n' + obj_values_item_union0.split('\n').map((line) => '\t' + line).join('\n');
1696
+ message += '\n' + obj_values_item_union1.split('\n').map((line) => '\t' + line).join('\n');
1697
+ message += '\n' + obj_values_item_union2.split('\n').map((line) => '\t' + line).join('\n');
1698
+ message += '\n' + obj_values_item_union3.split('\n').map((line) => '\t' + line).join('\n');
1699
+ return new TypeError(message);
1700
+ }
1701
+ }
1702
+ }
1703
+ })();
1704
+ return v_error === undefined ? null : v_error;
1705
+ }
1706
+ const select$f = function GetFilterValuesResponse_CategoricalValuesSelect() {
1707
+ return {
1708
+ kind: 'Fragment',
1709
+ version: VERSION$b,
1710
+ private: [],
1711
+ selections: [
1712
+ {
1713
+ name: 'values',
1714
+ kind: 'Scalar',
1715
+ plural: true,
1716
+ required: false
1717
+ }
1718
+ ]
1719
+ };
1720
+ };
1721
+ function equals$b(existing, incoming) {
1722
+ const existing_values = existing.values;
1723
+ const incoming_values = incoming.values;
1724
+ // if at least one of these optionals is defined
1725
+ if (existing_values !== undefined || incoming_values !== undefined) {
1726
+ // if one of these is not defined we know the other is defined and therefore
1727
+ // not equal
1728
+ if (existing_values === undefined || incoming_values === undefined) {
1729
+ return false;
1730
+ }
1731
+ const equals_values_items = equalsArray(existing_values, incoming_values, (existing_values_item, incoming_values_item) => {
1732
+ if (!(existing_values_item === incoming_values_item)) {
1733
+ return false;
1734
+ }
1735
+ });
1736
+ if (equals_values_items === false) {
1737
+ return false;
1738
+ }
1739
+ }
1740
+ return true;
1741
+ }
1742
+
1743
+ const VERSION$a = "2025bbf393050a10fae76d5b4d5d0f58";
1744
+ function validate$a(obj, path = 'GetFilterValuesResponse') {
1745
+ const v_error = (() => {
1746
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1747
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1748
+ }
1749
+ const obj_categoricalValues = obj.categoricalValues;
1750
+ const path_categoricalValues = path + '.categoricalValues';
1751
+ const referencepath_categoricalValuesValidationError = validate$b(obj_categoricalValues, path_categoricalValues);
1752
+ if (referencepath_categoricalValuesValidationError !== null) {
1753
+ let message = 'Object doesn\'t match GetFilterValuesResponse_CategoricalValues (at "' + path_categoricalValues + '")\n';
1754
+ message += referencepath_categoricalValuesValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1755
+ return new TypeError(message);
1756
+ }
1757
+ const obj_id = obj.id;
1758
+ const path_id = path + '.id';
1759
+ if (typeof obj_id !== 'string') {
1760
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1761
+ }
1762
+ if (obj.nextPageToken !== undefined) {
1763
+ const obj_nextPageToken = obj.nextPageToken;
1764
+ const path_nextPageToken = path + '.nextPageToken';
1765
+ if (typeof obj_nextPageToken !== 'string') {
1766
+ return new TypeError('Expected "string" but received "' + typeof obj_nextPageToken + '" (at "' + path_nextPageToken + '")');
1767
+ }
1768
+ }
1769
+ if (obj.totalAvailable !== undefined) {
1770
+ const obj_totalAvailable = obj.totalAvailable;
1771
+ const path_totalAvailable = path + '.totalAvailable';
1772
+ if (typeof obj_totalAvailable !== 'number' || (typeof obj_totalAvailable === 'number' && Math.floor(obj_totalAvailable) !== obj_totalAvailable)) {
1773
+ return new TypeError('Expected "integer" but received "' + typeof obj_totalAvailable + '" (at "' + path_totalAvailable + '")');
1774
+ }
1775
+ }
1776
+ })();
1777
+ return v_error === undefined ? null : v_error;
1778
+ }
1779
+ const RepresentationType$2 = 'GetFilterValuesResponse';
1780
+ function keyBuilder$4(luvio, config) {
1781
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.filterpageid;
1782
+ }
1783
+ function keyBuilderFromType$2(luvio, object) {
1784
+ const keyParams = {
1785
+ filterpageid: object.id
1786
+ };
1787
+ return keyBuilder$4(luvio, keyParams);
1788
+ }
1789
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
1790
+ return input;
1791
+ }
1792
+ const select$e = function GetFilterValuesResponseSelect() {
1793
+ const { selections: GetFilterValuesResponse_CategoricalValues__selections, opaque: GetFilterValuesResponse_CategoricalValues__opaque, } = select$f();
1794
+ return {
1795
+ kind: 'Fragment',
1796
+ version: VERSION$a,
1797
+ private: [],
1798
+ selections: [
1799
+ {
1800
+ name: 'categoricalValues',
1801
+ kind: 'Object',
1802
+ selections: GetFilterValuesResponse_CategoricalValues__selections
1803
+ },
1804
+ {
1805
+ name: 'id',
1806
+ kind: 'Scalar'
1807
+ },
1808
+ {
1809
+ name: 'nextPageToken',
1810
+ kind: 'Scalar',
1811
+ required: false
1812
+ },
1813
+ {
1814
+ name: 'totalAvailable',
1815
+ kind: 'Scalar',
1816
+ required: false
1817
+ }
1818
+ ]
1819
+ };
1820
+ };
1821
+ function equals$a(existing, incoming) {
1822
+ const existing_totalAvailable = existing.totalAvailable;
1823
+ const incoming_totalAvailable = incoming.totalAvailable;
1824
+ // if at least one of these optionals is defined
1825
+ if (existing_totalAvailable !== undefined || incoming_totalAvailable !== undefined) {
1826
+ // if one of these is not defined we know the other is defined and therefore
1827
+ // not equal
1828
+ if (existing_totalAvailable === undefined || incoming_totalAvailable === undefined) {
1829
+ return false;
1830
+ }
1831
+ if (!(existing_totalAvailable === incoming_totalAvailable)) {
1832
+ return false;
1833
+ }
1834
+ }
1835
+ const existing_id = existing.id;
1836
+ const incoming_id = incoming.id;
1837
+ if (!(existing_id === incoming_id)) {
1838
+ return false;
1839
+ }
1840
+ const existing_nextPageToken = existing.nextPageToken;
1841
+ const incoming_nextPageToken = incoming.nextPageToken;
1842
+ // if at least one of these optionals is defined
1843
+ if (existing_nextPageToken !== undefined || incoming_nextPageToken !== undefined) {
1844
+ // if one of these is not defined we know the other is defined and therefore
1845
+ // not equal
1846
+ if (existing_nextPageToken === undefined || incoming_nextPageToken === undefined) {
1847
+ return false;
1848
+ }
1849
+ if (!(existing_nextPageToken === incoming_nextPageToken)) {
1850
+ return false;
1851
+ }
1852
+ }
1853
+ const existing_categoricalValues = existing.categoricalValues;
1854
+ const incoming_categoricalValues = incoming.categoricalValues;
1855
+ if (!(equals$b(existing_categoricalValues, incoming_categoricalValues))) {
1856
+ return false;
1857
+ }
1858
+ return true;
1859
+ }
1860
+ const ingest$2 = function GetFilterValuesResponseIngest(input, path, luvio, store, timestamp) {
1861
+ if (process.env.NODE_ENV !== 'production') {
1862
+ const validateError = validate$a(input);
1863
+ if (validateError !== null) {
1864
+ throw validateError;
1865
+ }
1866
+ }
1867
+ const key = keyBuilderFromType$2(luvio, input);
1868
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
1869
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "analytics-insights", VERSION$a, RepresentationType$2, equals$a);
1870
+ return createLink(key);
1871
+ };
1872
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
1873
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1874
+ const rootKey = keyBuilderFromType$2(luvio, input);
1875
+ rootKeySet.set(rootKey, {
1876
+ namespace: keyPrefix,
1877
+ representationName: RepresentationType$2,
1878
+ mergeable: false
1879
+ });
1880
+ }
1881
+
1882
+ function select$d(luvio, params) {
1883
+ return select$e();
1884
+ }
1885
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
1886
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
1887
+ }
1888
+ function ingestSuccess$3(luvio, resourceParams, response) {
1889
+ const { body } = response;
1890
+ const key = keyBuilderFromType$2(luvio, body);
1891
+ luvio.storeIngest(key, ingest$2, body);
1892
+ const snapshot = luvio.storeLookup({
1893
+ recordId: key,
1894
+ node: select$d(),
1895
+ variables: {},
1896
+ });
1897
+ if (process.env.NODE_ENV !== 'production') {
1898
+ if (snapshot.state !== 'Fulfilled') {
1899
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1900
+ }
1901
+ }
1902
+ deepFreeze(snapshot.data);
1903
+ return snapshot;
1904
+ }
1905
+ function createResourceRequest$3(config) {
1906
+ const headers = {};
1907
+ const header_xSfdcSourceapp = config.headers.xSfdcSourceapp;
1908
+ if (header_xSfdcSourceapp !== undefined) {
1909
+ headers['x-sfdc-sourceapp'] = header_xSfdcSourceapp;
1910
+ }
1911
+ const header_xSfdcSourcecontext = config.headers.xSfdcSourcecontext;
1912
+ if (header_xSfdcSourcecontext !== undefined) {
1913
+ headers['x-sfdc-sourcecontext'] = header_xSfdcSourcecontext;
1914
+ }
1915
+ return {
1916
+ baseUri: 'api.salesforce.com',
1917
+ basePath: '/analytics/insights/v1/filterValues',
1918
+ method: 'post',
1919
+ body: config.body,
1920
+ urlParams: {},
1921
+ queryParams: {},
1922
+ headers,
1923
+ priority: 'normal',
1924
+ };
1925
+ }
1926
+
1927
+ const adapterName$3 = 'getMetricFilterValues';
1928
+ const getMetricFilterValues_ConfigPropertyMetadata = [
1929
+ generateParamConfigMetadata('semanticDataModel', true, 2 /* Body */, 4 /* Unsupported */),
1930
+ generateParamConfigMetadata('field', true, 2 /* Body */, 4 /* Unsupported */),
1931
+ generateParamConfigMetadata('pageToken', false, 2 /* Body */, 0 /* String */),
1932
+ generateParamConfigMetadata('pageSize', false, 2 /* Body */, 3 /* Integer */),
1933
+ generateParamConfigMetadata('searchTerm', false, 2 /* Body */, 0 /* String */),
1934
+ generateParamConfigMetadata('filters', false, 2 /* Body */, 4 /* Unsupported */, true),
1935
+ generateParamConfigMetadata('semanticFilter', false, 2 /* Body */, 4 /* Unsupported */),
1936
+ generateParamConfigMetadata('xSfdcSourceapp', false, 3 /* Header */, 0 /* String */),
1937
+ generateParamConfigMetadata('xSfdcSourcecontext', false, 3 /* Header */, 0 /* String */),
1938
+ ];
1939
+ const getMetricFilterValues_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getMetricFilterValues_ConfigPropertyMetadata);
1940
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$5(getMetricFilterValues_ConfigPropertyMetadata);
1941
+ function typeCheckConfig$3(untrustedConfig) {
1942
+ const config = {};
1943
+ typeCheckConfig$5(untrustedConfig, config, getMetricFilterValues_ConfigPropertyMetadata);
1944
+ const untrustedConfig_semanticDataModel = untrustedConfig.semanticDataModel;
1945
+ const referenceSemanticDataModelValidationError = validate$s(untrustedConfig_semanticDataModel);
1946
+ if (referenceSemanticDataModelValidationError === null) {
1947
+ config.semanticDataModel = untrustedConfig_semanticDataModel;
1948
+ }
1949
+ const untrustedConfig_field = untrustedConfig.field;
1950
+ const referenceFieldIdValidationError = validate$B(untrustedConfig_field);
1951
+ if (referenceFieldIdValidationError === null) {
1952
+ config.field = untrustedConfig_field;
1953
+ }
1954
+ const untrustedConfig_filters = untrustedConfig.filters;
1955
+ if (ArrayIsArray$1(untrustedConfig_filters)) {
1956
+ const untrustedConfig_filters_array = [];
1957
+ for (let i = 0, arrayLength = untrustedConfig_filters.length; i < arrayLength; i++) {
1958
+ const untrustedConfig_filters_item = untrustedConfig_filters[i];
1959
+ const referenceFilterValidationError = validate$y(untrustedConfig_filters_item);
1960
+ if (referenceFilterValidationError === null) {
1961
+ untrustedConfig_filters_array.push(untrustedConfig_filters_item);
1962
+ }
1963
+ }
1964
+ config.filters = untrustedConfig_filters_array;
1965
+ }
1966
+ const untrustedConfig_semanticFilter = untrustedConfig.semanticFilter;
1967
+ const referenceFlattenFilterValidationError = validate$w(untrustedConfig_semanticFilter);
1968
+ if (referenceFlattenFilterValidationError === null) {
1969
+ config.semanticFilter = untrustedConfig_semanticFilter;
1970
+ }
1971
+ return config;
1972
+ }
1973
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1974
+ if (!untrustedIsObject(untrustedConfig)) {
1975
+ return null;
1976
+ }
1977
+ if (process.env.NODE_ENV !== 'production') {
1978
+ validateConfig(untrustedConfig, configPropertyNames);
1979
+ }
1980
+ const config = typeCheckConfig$3(untrustedConfig);
1981
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1982
+ return null;
1983
+ }
1984
+ return config;
1985
+ }
1986
+ function buildNetworkSnapshot$3(luvio, config, options) {
1987
+ const resourceParams = createResourceParams$3(config);
1988
+ const request = createResourceRequest$3(resourceParams);
1989
+ return luvio.dispatchResourceRequest(request, options)
1990
+ .then((response) => {
1991
+ return luvio.handleSuccessResponse(() => {
1992
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
1993
+ return luvio.storeBroadcast().then(() => snapshot);
1994
+ }, () => {
1995
+ const cache = new StoreKeyMap();
1996
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1997
+ return cache;
1998
+ });
1999
+ }, (response) => {
2000
+ deepFreeze(response);
2001
+ throw response;
2002
+ });
2003
+ }
2004
+ const getMetricFilterValuesAdapterFactory = (luvio) => {
2005
+ return function getMetricFilterValues(untrustedConfig) {
2006
+ const config = validateAdapterConfig$3(untrustedConfig, getMetricFilterValues_ConfigPropertyNames);
2007
+ // Invalid or incomplete config
2008
+ if (config === null) {
2009
+ throw new Error('Invalid config for "getMetricFilterValues"');
2010
+ }
2011
+ return buildNetworkSnapshot$3(luvio, config);
2012
+ };
2013
+ };
2014
+
2015
+ const VERSION$9 = "6b47d2ed35a900956ff58b7d8a527e7f";
2016
+ function validate$9(obj, path = 'InsightFeedbackMetadata') {
2017
+ const v_error = (() => {
2018
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2019
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2020
+ }
2021
+ if (obj.dimensionHash !== undefined) {
2022
+ const obj_dimensionHash = obj.dimensionHash;
2023
+ const path_dimensionHash = path + '.dimensionHash';
2024
+ if (typeof obj_dimensionHash !== 'string') {
2025
+ return new TypeError('Expected "string" but received "' + typeof obj_dimensionHash + '" (at "' + path_dimensionHash + '")');
2026
+ }
2027
+ }
2028
+ if (obj.score !== undefined) {
2029
+ obj.score;
2030
+ }
2031
+ if (obj.type !== undefined) {
2032
+ const obj_type = obj.type;
2033
+ const path_type = path + '.type';
2034
+ if (typeof obj_type !== 'string') {
2035
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
2036
+ }
2037
+ }
2038
+ })();
2039
+ return v_error === undefined ? null : v_error;
2040
+ }
2041
+ const select$c = function InsightFeedbackMetadataSelect() {
2042
+ return {
2043
+ kind: 'Fragment',
2044
+ version: VERSION$9,
2045
+ private: [],
2046
+ selections: [
2047
+ {
2048
+ name: 'dimensionHash',
2049
+ kind: 'Scalar',
2050
+ required: false
2051
+ },
2052
+ {
2053
+ name: 'score',
2054
+ kind: 'Scalar',
2055
+ required: false
2056
+ },
2057
+ {
2058
+ name: 'type',
2059
+ kind: 'Scalar',
2060
+ required: false
2061
+ }
2062
+ ]
2063
+ };
2064
+ };
2065
+ function equals$9(existing, incoming) {
2066
+ const existing_dimensionHash = existing.dimensionHash;
2067
+ const incoming_dimensionHash = incoming.dimensionHash;
2068
+ // if at least one of these optionals is defined
2069
+ if (existing_dimensionHash !== undefined || incoming_dimensionHash !== undefined) {
2070
+ // if one of these is not defined we know the other is defined and therefore
2071
+ // not equal
2072
+ if (existing_dimensionHash === undefined || incoming_dimensionHash === undefined) {
2073
+ return false;
2074
+ }
2075
+ if (!(existing_dimensionHash === incoming_dimensionHash)) {
2076
+ return false;
2077
+ }
2078
+ }
2079
+ const existing_type = existing.type;
2080
+ const incoming_type = incoming.type;
2081
+ // if at least one of these optionals is defined
2082
+ if (existing_type !== undefined || incoming_type !== undefined) {
2083
+ // if one of these is not defined we know the other is defined and therefore
2084
+ // not equal
2085
+ if (existing_type === undefined || incoming_type === undefined) {
2086
+ return false;
2087
+ }
2088
+ if (!(existing_type === incoming_type)) {
2089
+ return false;
2090
+ }
2091
+ }
2092
+ const existing_score = existing.score;
2093
+ const incoming_score = incoming.score;
2094
+ // if at least one of these optionals is defined
2095
+ if (existing_score !== undefined || incoming_score !== undefined) {
2096
+ // if one of these is not defined we know the other is defined and therefore
2097
+ // not equal
2098
+ if (existing_score === undefined || incoming_score === undefined) {
2099
+ return false;
2100
+ }
2101
+ if (!(existing_score === incoming_score)) {
2102
+ return false;
2103
+ }
2104
+ }
2105
+ return true;
2106
+ }
2107
+
2108
+ const VERSION$8 = "be7014b0043386672b06a22807d7e549";
2109
+ function validate$8(obj, path = 'Insight') {
2110
+ const v_error = (() => {
2111
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2112
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2113
+ }
2114
+ if (obj.characterization !== undefined) {
2115
+ const obj_characterization = obj.characterization;
2116
+ const path_characterization = path + '.characterization';
2117
+ if (typeof obj_characterization !== 'string') {
2118
+ return new TypeError('Expected "string" but received "' + typeof obj_characterization + '" (at "' + path_characterization + '")');
2119
+ }
2120
+ }
2121
+ if (obj.facts !== undefined) {
2122
+ const obj_facts = obj.facts;
2123
+ const path_facts = path + '.facts';
2124
+ if (obj_facts === undefined) {
2125
+ return new TypeError('Expected "defined" but received "' + typeof obj_facts + '" (at "' + path_facts + '")');
2126
+ }
2127
+ }
2128
+ if (obj.id !== undefined) {
2129
+ const obj_id = obj.id;
2130
+ const path_id = path + '.id';
2131
+ if (typeof obj_id !== 'string') {
2132
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
2133
+ }
2134
+ }
2135
+ const obj_insightFeedbackMetadata = obj.insightFeedbackMetadata;
2136
+ const path_insightFeedbackMetadata = path + '.insightFeedbackMetadata';
2137
+ const referencepath_insightFeedbackMetadataValidationError = validate$9(obj_insightFeedbackMetadata, path_insightFeedbackMetadata);
2138
+ if (referencepath_insightFeedbackMetadataValidationError !== null) {
2139
+ let message = 'Object doesn\'t match InsightFeedbackMetadata (at "' + path_insightFeedbackMetadata + '")\n';
2140
+ message += referencepath_insightFeedbackMetadataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2141
+ return new TypeError(message);
2142
+ }
2143
+ if (obj.markup !== undefined) {
2144
+ const obj_markup = obj.markup;
2145
+ const path_markup = path + '.markup';
2146
+ if (typeof obj_markup !== 'string') {
2147
+ return new TypeError('Expected "string" but received "' + typeof obj_markup + '" (at "' + path_markup + '")');
2148
+ }
2149
+ }
2150
+ if (obj.question !== undefined) {
2151
+ const obj_question = obj.question;
2152
+ const path_question = path + '.question';
2153
+ if (typeof obj_question !== 'string') {
2154
+ return new TypeError('Expected "string" but received "' + typeof obj_question + '" (at "' + path_question + '")');
2155
+ }
2156
+ }
2157
+ if (obj.score !== undefined) {
2158
+ obj.score;
2159
+ }
2160
+ if (obj.type !== undefined) {
2161
+ const obj_type = obj.type;
2162
+ const path_type = path + '.type';
2163
+ if (typeof obj_type !== 'string') {
2164
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
2165
+ }
2166
+ }
2167
+ if (obj.version !== undefined) {
2168
+ const obj_version = obj.version;
2169
+ const path_version = path + '.version';
2170
+ if (typeof obj_version !== 'number' || (typeof obj_version === 'number' && Math.floor(obj_version) !== obj_version)) {
2171
+ return new TypeError('Expected "integer" but received "' + typeof obj_version + '" (at "' + path_version + '")');
2172
+ }
2173
+ }
2174
+ if (obj.viz !== undefined) {
2175
+ const obj_viz = obj.viz;
2176
+ const path_viz = path + '.viz';
2177
+ if (obj_viz === undefined) {
2178
+ return new TypeError('Expected "defined" but received "' + typeof obj_viz + '" (at "' + path_viz + '")');
2179
+ }
2180
+ }
2181
+ })();
2182
+ return v_error === undefined ? null : v_error;
2183
+ }
2184
+ const select$b = function InsightSelect() {
2185
+ const { selections: InsightFeedbackMetadata__selections, opaque: InsightFeedbackMetadata__opaque, } = select$c();
2186
+ return {
2187
+ kind: 'Fragment',
2188
+ version: VERSION$8,
2189
+ private: [],
2190
+ selections: [
2191
+ {
2192
+ name: 'characterization',
2193
+ kind: 'Scalar',
2194
+ required: false
2195
+ },
2196
+ {
2197
+ name: 'facts',
2198
+ kind: 'Object',
2199
+ // any
2200
+ },
2201
+ {
2202
+ name: 'id',
2203
+ kind: 'Scalar',
2204
+ required: false
2205
+ },
2206
+ {
2207
+ name: 'insightFeedbackMetadata',
2208
+ kind: 'Object',
2209
+ selections: InsightFeedbackMetadata__selections
2210
+ },
2211
+ {
2212
+ name: 'markup',
2213
+ kind: 'Scalar',
2214
+ required: false
2215
+ },
2216
+ {
2217
+ name: 'question',
2218
+ kind: 'Scalar',
2219
+ required: false
2220
+ },
2221
+ {
2222
+ name: 'score',
2223
+ kind: 'Scalar',
2224
+ required: false
2225
+ },
2226
+ {
2227
+ name: 'type',
2228
+ kind: 'Scalar',
2229
+ required: false
2230
+ },
2231
+ {
2232
+ name: 'version',
2233
+ kind: 'Scalar',
2234
+ required: false
2235
+ },
2236
+ {
2237
+ name: 'viz',
2238
+ kind: 'Object',
2239
+ // any
2240
+ }
2241
+ ]
2242
+ };
2243
+ };
2244
+ function equals$8(existing, incoming) {
2245
+ const existing_version = existing.version;
2246
+ const incoming_version = incoming.version;
2247
+ // if at least one of these optionals is defined
2248
+ if (existing_version !== undefined || incoming_version !== undefined) {
2249
+ // if one of these is not defined we know the other is defined and therefore
2250
+ // not equal
2251
+ if (existing_version === undefined || incoming_version === undefined) {
2252
+ return false;
2253
+ }
2254
+ if (!(existing_version === incoming_version)) {
2255
+ return false;
2256
+ }
2257
+ }
2258
+ const existing_characterization = existing.characterization;
2259
+ const incoming_characterization = incoming.characterization;
2260
+ // if at least one of these optionals is defined
2261
+ if (existing_characterization !== undefined || incoming_characterization !== undefined) {
2262
+ // if one of these is not defined we know the other is defined and therefore
2263
+ // not equal
2264
+ if (existing_characterization === undefined || incoming_characterization === undefined) {
2265
+ return false;
2266
+ }
2267
+ if (!(existing_characterization === incoming_characterization)) {
2268
+ return false;
2269
+ }
2270
+ }
2271
+ const existing_id = existing.id;
2272
+ const incoming_id = incoming.id;
2273
+ // if at least one of these optionals is defined
2274
+ if (existing_id !== undefined || incoming_id !== undefined) {
2275
+ // if one of these is not defined we know the other is defined and therefore
2276
+ // not equal
2277
+ if (existing_id === undefined || incoming_id === undefined) {
2278
+ return false;
2279
+ }
2280
+ if (!(existing_id === incoming_id)) {
2281
+ return false;
2282
+ }
2283
+ }
2284
+ const existing_markup = existing.markup;
2285
+ const incoming_markup = incoming.markup;
2286
+ // if at least one of these optionals is defined
2287
+ if (existing_markup !== undefined || incoming_markup !== undefined) {
2288
+ // if one of these is not defined we know the other is defined and therefore
2289
+ // not equal
2290
+ if (existing_markup === undefined || incoming_markup === undefined) {
2291
+ return false;
2292
+ }
2293
+ if (!(existing_markup === incoming_markup)) {
2294
+ return false;
2295
+ }
2296
+ }
2297
+ const existing_question = existing.question;
2298
+ const incoming_question = incoming.question;
2299
+ // if at least one of these optionals is defined
2300
+ if (existing_question !== undefined || incoming_question !== undefined) {
2301
+ // if one of these is not defined we know the other is defined and therefore
2302
+ // not equal
2303
+ if (existing_question === undefined || incoming_question === undefined) {
2304
+ return false;
2305
+ }
2306
+ if (!(existing_question === incoming_question)) {
2307
+ return false;
2308
+ }
2309
+ }
2310
+ const existing_type = existing.type;
2311
+ const incoming_type = incoming.type;
2312
+ // if at least one of these optionals is defined
2313
+ if (existing_type !== undefined || incoming_type !== undefined) {
2314
+ // if one of these is not defined we know the other is defined and therefore
2315
+ // not equal
2316
+ if (existing_type === undefined || incoming_type === undefined) {
2317
+ return false;
2318
+ }
2319
+ if (!(existing_type === incoming_type)) {
2320
+ return false;
2321
+ }
2322
+ }
2323
+ const existing_score = existing.score;
2324
+ const incoming_score = incoming.score;
2325
+ // if at least one of these optionals is defined
2326
+ if (existing_score !== undefined || incoming_score !== undefined) {
2327
+ // if one of these is not defined we know the other is defined and therefore
2328
+ // not equal
2329
+ if (existing_score === undefined || incoming_score === undefined) {
2330
+ return false;
2331
+ }
2332
+ if (!(existing_score === incoming_score)) {
2333
+ return false;
2334
+ }
2335
+ }
2336
+ const existing_facts = existing.facts;
2337
+ const incoming_facts = incoming.facts;
2338
+ // if at least one of these optionals is defined
2339
+ if (existing_facts !== undefined || incoming_facts !== undefined) {
2340
+ // if one of these is not defined we know the other is defined and therefore
2341
+ // not equal
2342
+ if (existing_facts === undefined || incoming_facts === undefined) {
2343
+ return false;
2344
+ }
2345
+ if (JSONStringify(incoming_facts) !== JSONStringify(existing_facts)) {
2346
+ return false;
2347
+ }
2348
+ }
2349
+ const existing_insightFeedbackMetadata = existing.insightFeedbackMetadata;
2350
+ const incoming_insightFeedbackMetadata = incoming.insightFeedbackMetadata;
2351
+ if (!(equals$9(existing_insightFeedbackMetadata, incoming_insightFeedbackMetadata))) {
2352
+ return false;
2353
+ }
2354
+ const existing_viz = existing.viz;
2355
+ const incoming_viz = incoming.viz;
2356
+ // if at least one of these optionals is defined
2357
+ if (existing_viz !== undefined || incoming_viz !== undefined) {
2358
+ // if one of these is not defined we know the other is defined and therefore
2359
+ // not equal
2360
+ if (existing_viz === undefined || incoming_viz === undefined) {
2361
+ return false;
2362
+ }
2363
+ if (JSONStringify(incoming_viz) !== JSONStringify(existing_viz)) {
2364
+ return false;
2365
+ }
2366
+ }
2367
+ return true;
2368
+ }
2369
+
2370
+ const VERSION$7 = "09a140bdbc97294bdce2b9555910f209";
2371
+ function validate$7(obj, path = 'InsightResponse') {
2372
+ const v_error = (() => {
2373
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2374
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2375
+ }
2376
+ if (obj.error !== undefined) {
2377
+ const obj_error = obj.error;
2378
+ const path_error = path + '.error';
2379
+ const referencepath_errorValidationError = validate$f(obj_error, path_error);
2380
+ if (referencepath_errorValidationError !== null) {
2381
+ let message = 'Object doesn\'t match Error (at "' + path_error + '")\n';
2382
+ message += referencepath_errorValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2383
+ return new TypeError(message);
2384
+ }
2385
+ }
2386
+ if (obj.insightType !== undefined) {
2387
+ const obj_insightType = obj.insightType;
2388
+ const path_insightType = path + '.insightType';
2389
+ if (typeof obj_insightType !== 'string') {
2390
+ return new TypeError('Expected "string" but received "' + typeof obj_insightType + '" (at "' + path_insightType + '")');
2391
+ }
2392
+ }
2393
+ if (obj.result !== undefined) {
2394
+ const obj_result = obj.result;
2395
+ const path_result = path + '.result';
2396
+ const referencepath_resultValidationError = validate$8(obj_result, path_result);
2397
+ if (referencepath_resultValidationError !== null) {
2398
+ let message = 'Object doesn\'t match Insight (at "' + path_result + '")\n';
2399
+ message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2400
+ return new TypeError(message);
2401
+ }
2402
+ }
2403
+ })();
2404
+ return v_error === undefined ? null : v_error;
2405
+ }
2406
+ const select$a = function InsightResponseSelect() {
2407
+ const { selections: Error__selections, opaque: Error__opaque, } = select$k();
2408
+ const { selections: Insight__selections, opaque: Insight__opaque, } = select$b();
2409
+ return {
2410
+ kind: 'Fragment',
2411
+ version: VERSION$7,
2412
+ private: [],
2413
+ selections: [
2414
+ {
2415
+ name: 'error',
2416
+ kind: 'Object',
2417
+ selections: Error__selections,
2418
+ required: false
2419
+ },
2420
+ {
2421
+ name: 'insightType',
2422
+ kind: 'Scalar',
2423
+ required: false
2424
+ },
2425
+ {
2426
+ name: 'result',
2427
+ kind: 'Object',
2428
+ selections: Insight__selections,
2429
+ required: false
2430
+ }
2431
+ ]
2432
+ };
2433
+ };
2434
+ function equals$7(existing, incoming) {
2435
+ const existing_insightType = existing.insightType;
2436
+ const incoming_insightType = incoming.insightType;
2437
+ // if at least one of these optionals is defined
2438
+ if (existing_insightType !== undefined || incoming_insightType !== undefined) {
2439
+ // if one of these is not defined we know the other is defined and therefore
2440
+ // not equal
2441
+ if (existing_insightType === undefined || incoming_insightType === undefined) {
2442
+ return false;
2443
+ }
2444
+ if (!(existing_insightType === incoming_insightType)) {
2445
+ return false;
2446
+ }
2447
+ }
2448
+ const existing_error = existing.error;
2449
+ const incoming_error = incoming.error;
2450
+ // if at least one of these optionals is defined
2451
+ if (existing_error !== undefined || incoming_error !== undefined) {
2452
+ // if one of these is not defined we know the other is defined and therefore
2453
+ // not equal
2454
+ if (existing_error === undefined || incoming_error === undefined) {
2455
+ return false;
2456
+ }
2457
+ if (!(equals$f(existing_error, incoming_error))) {
2458
+ return false;
2459
+ }
2460
+ }
2461
+ const existing_result = existing.result;
2462
+ const incoming_result = incoming.result;
2463
+ // if at least one of these optionals is defined
2464
+ if (existing_result !== undefined || incoming_result !== undefined) {
2465
+ // if one of these is not defined we know the other is defined and therefore
2466
+ // not equal
2467
+ if (existing_result === undefined || incoming_result === undefined) {
2468
+ return false;
2469
+ }
2470
+ if (!(equals$8(existing_result, incoming_result))) {
2471
+ return false;
2472
+ }
2473
+ }
2474
+ return true;
2475
+ }
2476
+
2477
+ const VERSION$6 = "bbba5f281b443221e96fa2e9e8eae2d9";
2478
+ function validate$6(obj, path = 'Status') {
2479
+ const v_error = (() => {
2480
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2481
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2482
+ }
2483
+ if (obj.qualifier !== undefined) {
2484
+ const obj_qualifier = obj.qualifier;
2485
+ const path_qualifier = path + '.qualifier';
2486
+ if (typeof obj_qualifier !== 'string') {
2487
+ return new TypeError('Expected "string" but received "' + typeof obj_qualifier + '" (at "' + path_qualifier + '")');
2488
+ }
2489
+ }
2490
+ if (obj.sentiment !== undefined) {
2491
+ const obj_sentiment = obj.sentiment;
2492
+ const path_sentiment = path + '.sentiment';
2493
+ if (typeof obj_sentiment !== 'string') {
2494
+ return new TypeError('Expected "string" but received "' + typeof obj_sentiment + '" (at "' + path_sentiment + '")');
2495
+ }
2496
+ }
2497
+ })();
2498
+ return v_error === undefined ? null : v_error;
2499
+ }
2500
+ const select$9 = function StatusSelect() {
2501
+ return {
2502
+ kind: 'Fragment',
2503
+ version: VERSION$6,
2504
+ private: [],
2505
+ selections: [
2506
+ {
2507
+ name: 'qualifier',
2508
+ kind: 'Scalar',
2509
+ required: false
2510
+ },
2511
+ {
2512
+ name: 'sentiment',
2513
+ kind: 'Scalar',
2514
+ required: false
2515
+ }
2516
+ ]
2517
+ };
2518
+ };
2519
+ function equals$6(existing, incoming) {
2520
+ const existing_qualifier = existing.qualifier;
2521
+ const incoming_qualifier = incoming.qualifier;
2522
+ // if at least one of these optionals is defined
2523
+ if (existing_qualifier !== undefined || incoming_qualifier !== undefined) {
2524
+ // if one of these is not defined we know the other is defined and therefore
2525
+ // not equal
2526
+ if (existing_qualifier === undefined || incoming_qualifier === undefined) {
2527
+ return false;
2528
+ }
2529
+ if (!(existing_qualifier === incoming_qualifier)) {
2530
+ return false;
2531
+ }
2532
+ }
2533
+ const existing_sentiment = existing.sentiment;
2534
+ const incoming_sentiment = incoming.sentiment;
2535
+ // if at least one of these optionals is defined
2536
+ if (existing_sentiment !== undefined || incoming_sentiment !== undefined) {
2537
+ // if one of these is not defined we know the other is defined and therefore
2538
+ // not equal
2539
+ if (existing_sentiment === undefined || incoming_sentiment === undefined) {
2540
+ return false;
2541
+ }
2542
+ if (!(existing_sentiment === incoming_sentiment)) {
2543
+ return false;
2544
+ }
2545
+ }
2546
+ return true;
2547
+ }
2548
+
2549
+ const VERSION$5 = "b8ee380c83f9ec2fff1e8045ba2301fc";
2550
+ function validate$5(obj, path = 'Overview') {
2551
+ const v_error = (() => {
2552
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2553
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2554
+ }
2555
+ if (obj.status !== undefined) {
2556
+ const obj_status = obj.status;
2557
+ const path_status = path + '.status';
2558
+ const referencepath_statusValidationError = validate$6(obj_status, path_status);
2559
+ if (referencepath_statusValidationError !== null) {
2560
+ let message = 'Object doesn\'t match Status (at "' + path_status + '")\n';
2561
+ message += referencepath_statusValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2562
+ return new TypeError(message);
2563
+ }
2564
+ }
2565
+ if (obj.viz !== undefined) {
2566
+ const obj_viz = obj.viz;
2567
+ const path_viz = path + '.viz';
2568
+ if (obj_viz === undefined) {
2569
+ return new TypeError('Expected "defined" but received "' + typeof obj_viz + '" (at "' + path_viz + '")');
2570
+ }
2571
+ }
2572
+ })();
2573
+ return v_error === undefined ? null : v_error;
2574
+ }
2575
+ const select$8 = function OverviewSelect() {
2576
+ const { selections: Status__selections, opaque: Status__opaque, } = select$9();
2577
+ return {
2578
+ kind: 'Fragment',
2579
+ version: VERSION$5,
2580
+ private: [],
2581
+ selections: [
2582
+ {
2583
+ name: 'status',
2584
+ kind: 'Object',
2585
+ selections: Status__selections,
2586
+ required: false
2587
+ },
2588
+ {
2589
+ name: 'viz',
2590
+ kind: 'Object',
2591
+ // any
2592
+ }
2593
+ ]
2594
+ };
2595
+ };
2596
+ function equals$5(existing, incoming) {
2597
+ const existing_status = existing.status;
2598
+ const incoming_status = incoming.status;
2599
+ // if at least one of these optionals is defined
2600
+ if (existing_status !== undefined || incoming_status !== undefined) {
2601
+ // if one of these is not defined we know the other is defined and therefore
2602
+ // not equal
2603
+ if (existing_status === undefined || incoming_status === undefined) {
2604
+ return false;
2605
+ }
2606
+ if (!(equals$6(existing_status, incoming_status))) {
2607
+ return false;
2608
+ }
2609
+ }
2610
+ const existing_viz = existing.viz;
2611
+ const incoming_viz = incoming.viz;
2612
+ // if at least one of these optionals is defined
2613
+ if (existing_viz !== undefined || incoming_viz !== undefined) {
2614
+ // if one of these is not defined we know the other is defined and therefore
2615
+ // not equal
2616
+ if (existing_viz === undefined || incoming_viz === undefined) {
2617
+ return false;
2618
+ }
2619
+ if (JSONStringify(incoming_viz) !== JSONStringify(existing_viz)) {
2620
+ return false;
2621
+ }
2622
+ }
2623
+ return true;
2624
+ }
2625
+
2626
+ const VERSION$4 = "ff01bfcbb0b2877fe279be648aceb371";
2627
+ function validate$4(obj, path = 'OverviewResponse') {
2628
+ const v_error = (() => {
2629
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2630
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2631
+ }
2632
+ if (obj.error !== undefined) {
2633
+ const obj_error = obj.error;
2634
+ const path_error = path + '.error';
2635
+ const referencepath_errorValidationError = validate$f(obj_error, path_error);
2636
+ if (referencepath_errorValidationError !== null) {
2637
+ let message = 'Object doesn\'t match Error (at "' + path_error + '")\n';
2638
+ message += referencepath_errorValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2639
+ return new TypeError(message);
2640
+ }
2641
+ }
2642
+ if (obj.result !== undefined) {
2643
+ const obj_result = obj.result;
2644
+ const path_result = path + '.result';
2645
+ const referencepath_resultValidationError = validate$5(obj_result, path_result);
2646
+ if (referencepath_resultValidationError !== null) {
2647
+ let message = 'Object doesn\'t match Overview (at "' + path_result + '")\n';
2648
+ message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2649
+ return new TypeError(message);
2650
+ }
2651
+ }
2652
+ })();
2653
+ return v_error === undefined ? null : v_error;
2654
+ }
2655
+ const select$7 = function OverviewResponseSelect() {
2656
+ const { selections: Error__selections, opaque: Error__opaque, } = select$k();
2657
+ const { selections: Overview__selections, opaque: Overview__opaque, } = select$8();
2658
+ return {
2659
+ kind: 'Fragment',
2660
+ version: VERSION$4,
2661
+ private: [],
2662
+ selections: [
2663
+ {
2664
+ name: 'error',
2665
+ kind: 'Object',
2666
+ selections: Error__selections,
2667
+ required: false
2668
+ },
2669
+ {
2670
+ name: 'result',
2671
+ kind: 'Object',
2672
+ selections: Overview__selections,
2673
+ required: false
2674
+ }
2675
+ ]
2676
+ };
2677
+ };
2678
+ function equals$4(existing, incoming) {
2679
+ const existing_error = existing.error;
2680
+ const incoming_error = incoming.error;
2681
+ // if at least one of these optionals is defined
2682
+ if (existing_error !== undefined || incoming_error !== undefined) {
2683
+ // if one of these is not defined we know the other is defined and therefore
2684
+ // not equal
2685
+ if (existing_error === undefined || incoming_error === undefined) {
2686
+ return false;
2687
+ }
2688
+ if (!(equals$f(existing_error, incoming_error))) {
2689
+ return false;
2690
+ }
2691
+ }
2692
+ const existing_result = existing.result;
2693
+ const incoming_result = incoming.result;
2694
+ // if at least one of these optionals is defined
2695
+ if (existing_result !== undefined || incoming_result !== undefined) {
2696
+ // if one of these is not defined we know the other is defined and therefore
2697
+ // not equal
2698
+ if (existing_result === undefined || incoming_result === undefined) {
2699
+ return false;
2700
+ }
2701
+ if (!(equals$5(existing_result, incoming_result))) {
2702
+ return false;
2703
+ }
2704
+ }
2705
+ return true;
2706
+ }
2707
+
2708
+ const VERSION$3 = "a70a5e68e786c3f38efb73cc0812d394";
2709
+ function validate$3(obj, path = 'InsightGroup') {
2710
+ const v_error = (() => {
2711
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2712
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2713
+ }
2714
+ if (obj.error !== undefined) {
2715
+ const obj_error = obj.error;
2716
+ const path_error = path + '.error';
2717
+ const referencepath_errorValidationError = validate$f(obj_error, path_error);
2718
+ if (referencepath_errorValidationError !== null) {
2719
+ let message = 'Object doesn\'t match Error (at "' + path_error + '")\n';
2720
+ message += referencepath_errorValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2721
+ return new TypeError(message);
2722
+ }
2723
+ }
2724
+ if (obj.insights !== undefined) {
2725
+ const obj_insights = obj.insights;
2726
+ const path_insights = path + '.insights';
2727
+ if (!ArrayIsArray(obj_insights)) {
2728
+ return new TypeError('Expected "array" but received "' + typeof obj_insights + '" (at "' + path_insights + '")');
2729
+ }
2730
+ for (let i = 0; i < obj_insights.length; i++) {
2731
+ const obj_insights_item = obj_insights[i];
2732
+ const path_insights_item = path_insights + '[' + i + ']';
2733
+ const referencepath_insights_itemValidationError = validate$7(obj_insights_item, path_insights_item);
2734
+ if (referencepath_insights_itemValidationError !== null) {
2735
+ let message = 'Object doesn\'t match InsightResponse (at "' + path_insights_item + '")\n';
2736
+ message += referencepath_insights_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2737
+ return new TypeError(message);
2738
+ }
2739
+ }
2740
+ }
2741
+ if (obj.overviews !== undefined) {
2742
+ const obj_overviews = obj.overviews;
2743
+ const path_overviews = path + '.overviews';
2744
+ if (!ArrayIsArray(obj_overviews)) {
2745
+ return new TypeError('Expected "array" but received "' + typeof obj_overviews + '" (at "' + path_overviews + '")');
2746
+ }
2747
+ for (let i = 0; i < obj_overviews.length; i++) {
2748
+ const obj_overviews_item = obj_overviews[i];
2749
+ const path_overviews_item = path_overviews + '[' + i + ']';
2750
+ const referencepath_overviews_itemValidationError = validate$4(obj_overviews_item, path_overviews_item);
2751
+ if (referencepath_overviews_itemValidationError !== null) {
2752
+ let message = 'Object doesn\'t match OverviewResponse (at "' + path_overviews_item + '")\n';
2753
+ message += referencepath_overviews_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2754
+ return new TypeError(message);
2755
+ }
2756
+ }
2757
+ }
2758
+ if (obj.type !== undefined) {
2759
+ const obj_type = obj.type;
2760
+ const path_type = path + '.type';
2761
+ if (typeof obj_type !== 'string') {
2762
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
2763
+ }
2764
+ }
2765
+ })();
2766
+ return v_error === undefined ? null : v_error;
2767
+ }
2768
+ const select$6 = function InsightGroupSelect() {
2769
+ const { selections: Error__selections, opaque: Error__opaque, } = select$k();
2770
+ const { selections: InsightResponse__selections, opaque: InsightResponse__opaque, } = select$a();
2771
+ const { selections: OverviewResponse__selections, opaque: OverviewResponse__opaque, } = select$7();
2772
+ return {
2773
+ kind: 'Fragment',
2774
+ version: VERSION$3,
2775
+ private: [],
2776
+ selections: [
2777
+ {
2778
+ name: 'error',
2779
+ kind: 'Object',
2780
+ selections: Error__selections,
2781
+ required: false
2782
+ },
2783
+ {
2784
+ name: 'insights',
2785
+ kind: 'Object',
2786
+ plural: true,
2787
+ selections: InsightResponse__selections,
2788
+ required: false
2789
+ },
2790
+ {
2791
+ name: 'overviews',
2792
+ kind: 'Object',
2793
+ plural: true,
2794
+ selections: OverviewResponse__selections,
2795
+ required: false
2796
+ },
2797
+ {
2798
+ name: 'type',
2799
+ kind: 'Scalar',
2800
+ required: false
2801
+ }
2802
+ ]
2803
+ };
2804
+ };
2805
+ function equals$3(existing, incoming) {
2806
+ const existing_type = existing.type;
2807
+ const incoming_type = incoming.type;
2808
+ // if at least one of these optionals is defined
2809
+ if (existing_type !== undefined || incoming_type !== undefined) {
2810
+ // if one of these is not defined we know the other is defined and therefore
2811
+ // not equal
2812
+ if (existing_type === undefined || incoming_type === undefined) {
2813
+ return false;
2814
+ }
2815
+ if (!(existing_type === incoming_type)) {
2816
+ return false;
2817
+ }
2818
+ }
2819
+ const existing_error = existing.error;
2820
+ const incoming_error = incoming.error;
2821
+ // if at least one of these optionals is defined
2822
+ if (existing_error !== undefined || incoming_error !== undefined) {
2823
+ // if one of these is not defined we know the other is defined and therefore
2824
+ // not equal
2825
+ if (existing_error === undefined || incoming_error === undefined) {
2826
+ return false;
2827
+ }
2828
+ if (!(equals$f(existing_error, incoming_error))) {
2829
+ return false;
2830
+ }
2831
+ }
2832
+ const existing_insights = existing.insights;
2833
+ const incoming_insights = incoming.insights;
2834
+ // if at least one of these optionals is defined
2835
+ if (existing_insights !== undefined || incoming_insights !== undefined) {
2836
+ // if one of these is not defined we know the other is defined and therefore
2837
+ // not equal
2838
+ if (existing_insights === undefined || incoming_insights === undefined) {
2839
+ return false;
2840
+ }
2841
+ const equals_insights_items = equalsArray(existing_insights, incoming_insights, (existing_insights_item, incoming_insights_item) => {
2842
+ if (!(equals$7(existing_insights_item, incoming_insights_item))) {
2843
+ return false;
2844
+ }
2845
+ });
2846
+ if (equals_insights_items === false) {
2847
+ return false;
2848
+ }
2849
+ }
2850
+ const existing_overviews = existing.overviews;
2851
+ const incoming_overviews = incoming.overviews;
2852
+ // if at least one of these optionals is defined
2853
+ if (existing_overviews !== undefined || incoming_overviews !== undefined) {
2854
+ // if one of these is not defined we know the other is defined and therefore
2855
+ // not equal
2856
+ if (existing_overviews === undefined || incoming_overviews === undefined) {
2857
+ return false;
2858
+ }
2859
+ const equals_overviews_items = equalsArray(existing_overviews, incoming_overviews, (existing_overviews_item, incoming_overviews_item) => {
2860
+ if (!(equals$4(existing_overviews_item, incoming_overviews_item))) {
2861
+ return false;
2862
+ }
2863
+ });
2864
+ if (equals_overviews_items === false) {
2865
+ return false;
2866
+ }
2867
+ }
2868
+ return true;
2869
+ }
2870
+
2871
+ const VERSION$2 = "ccf83d258110a04c1949592c91b69b3b";
2872
+ function validate$2(obj, path = 'InsightBundle') {
2873
+ const v_error = (() => {
2874
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2875
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2876
+ }
2877
+ if (obj.characterization !== undefined) {
2878
+ const obj_characterization = obj.characterization;
2879
+ const path_characterization = path + '.characterization';
2880
+ if (typeof obj_characterization !== 'string') {
2881
+ return new TypeError('Expected "string" but received "' + typeof obj_characterization + '" (at "' + path_characterization + '")');
2882
+ }
2883
+ }
2884
+ if (obj.hasErrors !== undefined) {
2885
+ const obj_hasErrors = obj.hasErrors;
2886
+ const path_hasErrors = path + '.hasErrors';
2887
+ if (typeof obj_hasErrors !== 'boolean') {
2888
+ return new TypeError('Expected "boolean" but received "' + typeof obj_hasErrors + '" (at "' + path_hasErrors + '")');
2889
+ }
2890
+ }
2891
+ if (obj.insightGroups !== undefined) {
2892
+ const obj_insightGroups = obj.insightGroups;
2893
+ const path_insightGroups = path + '.insightGroups';
2894
+ if (!ArrayIsArray(obj_insightGroups)) {
2895
+ return new TypeError('Expected "array" but received "' + typeof obj_insightGroups + '" (at "' + path_insightGroups + '")');
2896
+ }
2897
+ for (let i = 0; i < obj_insightGroups.length; i++) {
2898
+ const obj_insightGroups_item = obj_insightGroups[i];
2899
+ const path_insightGroups_item = path_insightGroups + '[' + i + ']';
2900
+ const referencepath_insightGroups_itemValidationError = validate$3(obj_insightGroups_item, path_insightGroups_item);
2901
+ if (referencepath_insightGroups_itemValidationError !== null) {
2902
+ let message = 'Object doesn\'t match InsightGroup (at "' + path_insightGroups_item + '")\n';
2903
+ message += referencepath_insightGroups_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2904
+ return new TypeError(message);
2905
+ }
2906
+ }
2907
+ }
2908
+ })();
2909
+ return v_error === undefined ? null : v_error;
2910
+ }
2911
+ const select$5 = function InsightBundleSelect() {
2912
+ const { selections: InsightGroup__selections, opaque: InsightGroup__opaque, } = select$6();
2913
+ return {
2914
+ kind: 'Fragment',
2915
+ version: VERSION$2,
2916
+ private: [],
2917
+ selections: [
2918
+ {
2919
+ name: 'characterization',
2920
+ kind: 'Scalar',
2921
+ required: false
2922
+ },
2923
+ {
2924
+ name: 'hasErrors',
2925
+ kind: 'Scalar',
2926
+ required: false
2927
+ },
2928
+ {
2929
+ name: 'insightGroups',
2930
+ kind: 'Object',
2931
+ plural: true,
2932
+ selections: InsightGroup__selections,
2933
+ required: false
2934
+ }
2935
+ ]
2936
+ };
2937
+ };
2938
+ function equals$2(existing, incoming) {
2939
+ const existing_hasErrors = existing.hasErrors;
2940
+ const incoming_hasErrors = incoming.hasErrors;
2941
+ // if at least one of these optionals is defined
2942
+ if (existing_hasErrors !== undefined || incoming_hasErrors !== undefined) {
2943
+ // if one of these is not defined we know the other is defined and therefore
2944
+ // not equal
2945
+ if (existing_hasErrors === undefined || incoming_hasErrors === undefined) {
2946
+ return false;
2947
+ }
2948
+ if (!(existing_hasErrors === incoming_hasErrors)) {
2949
+ return false;
2950
+ }
2951
+ }
2952
+ const existing_characterization = existing.characterization;
2953
+ const incoming_characterization = incoming.characterization;
2954
+ // if at least one of these optionals is defined
2955
+ if (existing_characterization !== undefined || incoming_characterization !== undefined) {
2956
+ // if one of these is not defined we know the other is defined and therefore
2957
+ // not equal
2958
+ if (existing_characterization === undefined || incoming_characterization === undefined) {
2959
+ return false;
2960
+ }
2961
+ if (!(existing_characterization === incoming_characterization)) {
2962
+ return false;
2963
+ }
2964
+ }
2965
+ const existing_insightGroups = existing.insightGroups;
2966
+ const incoming_insightGroups = incoming.insightGroups;
2967
+ // if at least one of these optionals is defined
2968
+ if (existing_insightGroups !== undefined || incoming_insightGroups !== undefined) {
2969
+ // if one of these is not defined we know the other is defined and therefore
2970
+ // not equal
2971
+ if (existing_insightGroups === undefined || incoming_insightGroups === undefined) {
2972
+ return false;
2973
+ }
2974
+ const equals_insightGroups_items = equalsArray(existing_insightGroups, incoming_insightGroups, (existing_insightGroups_item, incoming_insightGroups_item) => {
2975
+ if (!(equals$3(existing_insightGroups_item, incoming_insightGroups_item))) {
2976
+ return false;
2977
+ }
2978
+ });
2979
+ if (equals_insightGroups_items === false) {
2980
+ return false;
2981
+ }
2982
+ }
2983
+ return true;
2984
+ }
2985
+
2986
+ const VERSION$1 = "5da3ddbbd8ef8f7b1f24b4d609f91108";
2987
+ function validate$1(obj, path = 'GenerateInsightBundleResponse') {
2988
+ const v_error = (() => {
2989
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2990
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2991
+ }
2992
+ if (obj.error !== undefined) {
2993
+ const obj_error = obj.error;
2994
+ const path_error = path + '.error';
2995
+ const referencepath_errorValidationError = validate$f(obj_error, path_error);
2996
+ if (referencepath_errorValidationError !== null) {
2997
+ let message = 'Object doesn\'t match Error (at "' + path_error + '")\n';
2998
+ message += referencepath_errorValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2999
+ return new TypeError(message);
3000
+ }
3001
+ }
3002
+ if (obj.measurementPeriod !== undefined) {
3003
+ const obj_measurementPeriod = obj.measurementPeriod;
3004
+ const path_measurementPeriod = path + '.measurementPeriod';
3005
+ const referencepath_measurementPeriodValidationError = validate$l(obj_measurementPeriod, path_measurementPeriod);
3006
+ if (referencepath_measurementPeriodValidationError !== null) {
3007
+ let message = 'Object doesn\'t match UnifiedFilter (at "' + path_measurementPeriod + '")\n';
3008
+ message += referencepath_measurementPeriodValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3009
+ return new TypeError(message);
3010
+ }
3011
+ }
3012
+ if (obj.result !== undefined) {
3013
+ const obj_result = obj.result;
3014
+ const path_result = path + '.result';
3015
+ const referencepath_resultValidationError = validate$2(obj_result, path_result);
3016
+ if (referencepath_resultValidationError !== null) {
3017
+ let message = 'Object doesn\'t match InsightBundle (at "' + path_result + '")\n';
3018
+ message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3019
+ return new TypeError(message);
3020
+ }
3021
+ }
3022
+ const obj_sdm = obj.sdm;
3023
+ const path_sdm = path + '.sdm';
3024
+ if (typeof obj_sdm !== 'string') {
3025
+ return new TypeError('Expected "string" but received "' + typeof obj_sdm + '" (at "' + path_sdm + '")');
3026
+ }
3027
+ const obj_submetric = obj.submetric;
3028
+ const path_submetric = path + '.submetric';
3029
+ if (typeof obj_submetric !== 'string') {
3030
+ return new TypeError('Expected "string" but received "' + typeof obj_submetric + '" (at "' + path_submetric + '")');
3031
+ }
3032
+ })();
3033
+ return v_error === undefined ? null : v_error;
3034
+ }
3035
+ const RepresentationType$1 = 'GenerateInsightBundleResponse';
3036
+ function keyBuilder$3(luvio, config) {
3037
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.metricid;
3038
+ }
3039
+ function keyBuilderFromType$1(luvio, object) {
3040
+ const keyParams = {
3041
+ metricid: object.submetric
3042
+ };
3043
+ return keyBuilder$3(luvio, keyParams);
3044
+ }
3045
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
3046
+ return input;
3047
+ }
3048
+ const select$4 = function GenerateInsightBundleResponseSelect() {
3049
+ const { selections: Error__selections, opaque: Error__opaque, } = select$k();
3050
+ const { selections: UnifiedFilter__selections, opaque: UnifiedFilter__opaque, } = select$l();
3051
+ const { selections: InsightBundle__selections, opaque: InsightBundle__opaque, } = select$5();
3052
+ return {
3053
+ kind: 'Fragment',
3054
+ version: VERSION$1,
3055
+ private: [],
3056
+ selections: [
3057
+ {
3058
+ name: 'error',
3059
+ kind: 'Object',
3060
+ selections: Error__selections,
3061
+ required: false
3062
+ },
3063
+ {
3064
+ name: 'measurementPeriod',
3065
+ kind: 'Object',
3066
+ selections: UnifiedFilter__selections,
3067
+ required: false
3068
+ },
3069
+ {
3070
+ name: 'result',
3071
+ kind: 'Object',
3072
+ selections: InsightBundle__selections,
3073
+ required: false
3074
+ },
3075
+ {
3076
+ name: 'sdm',
3077
+ kind: 'Scalar'
3078
+ },
3079
+ {
3080
+ name: 'submetric',
3081
+ kind: 'Scalar'
3082
+ }
3083
+ ]
3084
+ };
3085
+ };
3086
+ function equals$1(existing, incoming) {
3087
+ const existing_sdm = existing.sdm;
3088
+ const incoming_sdm = incoming.sdm;
3089
+ if (!(existing_sdm === incoming_sdm)) {
3090
+ return false;
3091
+ }
3092
+ const existing_submetric = existing.submetric;
3093
+ const incoming_submetric = incoming.submetric;
3094
+ if (!(existing_submetric === incoming_submetric)) {
3095
+ return false;
3096
+ }
3097
+ const existing_error = existing.error;
3098
+ const incoming_error = incoming.error;
3099
+ // if at least one of these optionals is defined
3100
+ if (existing_error !== undefined || incoming_error !== undefined) {
3101
+ // if one of these is not defined we know the other is defined and therefore
3102
+ // not equal
3103
+ if (existing_error === undefined || incoming_error === undefined) {
3104
+ return false;
3105
+ }
3106
+ if (!(equals$f(existing_error, incoming_error))) {
3107
+ return false;
3108
+ }
3109
+ }
3110
+ const existing_measurementPeriod = existing.measurementPeriod;
3111
+ const incoming_measurementPeriod = incoming.measurementPeriod;
3112
+ // if at least one of these optionals is defined
3113
+ if (existing_measurementPeriod !== undefined || incoming_measurementPeriod !== undefined) {
3114
+ // if one of these is not defined we know the other is defined and therefore
3115
+ // not equal
3116
+ if (existing_measurementPeriod === undefined || incoming_measurementPeriod === undefined) {
3117
+ return false;
3118
+ }
3119
+ if (!(equals$g(existing_measurementPeriod, incoming_measurementPeriod))) {
3120
+ return false;
3121
+ }
3122
+ }
3123
+ const existing_result = existing.result;
3124
+ const incoming_result = incoming.result;
3125
+ // if at least one of these optionals is defined
3126
+ if (existing_result !== undefined || incoming_result !== undefined) {
3127
+ // if one of these is not defined we know the other is defined and therefore
3128
+ // not equal
3129
+ if (existing_result === undefined || incoming_result === undefined) {
3130
+ return false;
3131
+ }
3132
+ if (!(equals$2(existing_result, incoming_result))) {
3133
+ return false;
3134
+ }
3135
+ }
3136
+ return true;
3137
+ }
3138
+ const ingest$1 = function GenerateInsightBundleResponseIngest(input, path, luvio, store, timestamp) {
3139
+ if (process.env.NODE_ENV !== 'production') {
3140
+ const validateError = validate$1(input);
3141
+ if (validateError !== null) {
3142
+ throw validateError;
3143
+ }
3144
+ }
3145
+ const key = keyBuilderFromType$1(luvio, input);
3146
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
3147
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "analytics-insights", VERSION$1, RepresentationType$1, equals$1);
3148
+ return createLink(key);
3149
+ };
3150
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
3151
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3152
+ const rootKey = keyBuilderFromType$1(luvio, input);
3153
+ rootKeySet.set(rootKey, {
3154
+ namespace: keyPrefix,
3155
+ representationName: RepresentationType$1,
3156
+ mergeable: false
3157
+ });
3158
+ }
3159
+
3160
+ function select$3(luvio, params) {
3161
+ return select$4();
3162
+ }
3163
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
3164
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
3165
+ }
3166
+ function ingestSuccess$2(luvio, resourceParams, response) {
3167
+ const { body } = response;
3168
+ const key = keyBuilderFromType$1(luvio, body);
3169
+ luvio.storeIngest(key, ingest$1, body);
3170
+ const snapshot = luvio.storeLookup({
3171
+ recordId: key,
3172
+ node: select$3(),
3173
+ variables: {},
3174
+ });
3175
+ if (process.env.NODE_ENV !== 'production') {
3176
+ if (snapshot.state !== 'Fulfilled') {
3177
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3178
+ }
3179
+ }
3180
+ deepFreeze(snapshot.data);
3181
+ return snapshot;
3182
+ }
3183
+ function createResourceRequest$2(config) {
3184
+ const headers = {};
3185
+ const header_xSfdcSourceapp = config.headers.xSfdcSourceapp;
3186
+ if (header_xSfdcSourceapp !== undefined) {
3187
+ headers['x-sfdc-sourceapp'] = header_xSfdcSourceapp;
3188
+ }
3189
+ const header_xSfdcSourcecontext = config.headers.xSfdcSourcecontext;
3190
+ if (header_xSfdcSourcecontext !== undefined) {
3191
+ headers['x-sfdc-sourcecontext'] = header_xSfdcSourcecontext;
3192
+ }
3193
+ return {
3194
+ baseUri: 'api.salesforce.com',
3195
+ basePath: '/analytics/insights/v1/generateBundle',
3196
+ method: 'post',
3197
+ body: config.body,
3198
+ urlParams: {},
3199
+ queryParams: {},
3200
+ headers,
3201
+ priority: 'normal',
3202
+ };
3203
+ }
3204
+
3205
+ const adapterName$2 = 'generateInsights';
3206
+ const generateInsights_ConfigPropertyMetadata = [
3207
+ generateParamConfigMetadata('type', false, 2 /* Body */, 0 /* String */),
3208
+ generateParamConfigMetadata('version', false, 2 /* Body */, 3 /* Integer */),
3209
+ generateParamConfigMetadata('input', false, 2 /* Body */, 4 /* Unsupported */),
3210
+ generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
3211
+ generateParamConfigMetadata('xSfdcSourceapp', false, 3 /* Header */, 0 /* String */),
3212
+ generateParamConfigMetadata('xSfdcSourcecontext', false, 3 /* Header */, 0 /* String */),
3213
+ ];
3214
+ const generateInsights_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, generateInsights_ConfigPropertyMetadata);
3215
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$5(generateInsights_ConfigPropertyMetadata);
3216
+ function typeCheckConfig$2(untrustedConfig) {
3217
+ const config = {};
3218
+ typeCheckConfig$5(untrustedConfig, config, generateInsights_ConfigPropertyMetadata);
3219
+ const untrustedConfig_input = untrustedConfig.input;
3220
+ const referenceInsightBundleInputValidationError = validate$m(untrustedConfig_input);
3221
+ if (referenceInsightBundleInputValidationError === null) {
3222
+ config.input = untrustedConfig_input;
3223
+ }
3224
+ const untrustedConfig_options = untrustedConfig.options;
3225
+ const referenceInsightBundleOptionsValidationError = validate$i(untrustedConfig_options);
3226
+ if (referenceInsightBundleOptionsValidationError === null) {
3227
+ config.options = untrustedConfig_options;
3228
+ }
3229
+ return config;
3230
+ }
3231
+ function validateAdapterConfig$2(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$2(untrustedConfig);
3239
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3240
+ return null;
3241
+ }
3242
+ return config;
3243
+ }
3244
+ function buildNetworkSnapshot$2(luvio, config, options) {
3245
+ const resourceParams = createResourceParams$2(config);
3246
+ const request = createResourceRequest$2(resourceParams);
3247
+ return luvio.dispatchResourceRequest(request, options)
3248
+ .then((response) => {
3249
+ return luvio.handleSuccessResponse(() => {
3250
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
3251
+ return luvio.storeBroadcast().then(() => snapshot);
3252
+ }, () => {
3253
+ const cache = new StoreKeyMap();
3254
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
3255
+ return cache;
3256
+ });
3257
+ }, (response) => {
3258
+ deepFreeze(response);
3259
+ throw response;
3260
+ });
3261
+ }
3262
+ const generateInsightsAdapterFactory = (luvio) => {
3263
+ return function generateInsights(untrustedConfig) {
3264
+ const config = validateAdapterConfig$2(untrustedConfig, generateInsights_ConfigPropertyNames);
3265
+ // Invalid or incomplete config
3266
+ if (config === null) {
3267
+ throw new Error('Invalid config for "generateInsights"');
3268
+ }
3269
+ return buildNetworkSnapshot$2(luvio, config);
3270
+ };
3271
+ };
3272
+
3273
+ function select$2(luvio, params) {
3274
+ return select$4();
3275
+ }
3276
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
3277
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
3278
+ }
3279
+ function ingestSuccess$1(luvio, resourceParams, response) {
3280
+ const { body } = response;
3281
+ const key = keyBuilderFromType$1(luvio, body);
3282
+ luvio.storeIngest(key, ingest$1, body);
3283
+ const snapshot = luvio.storeLookup({
3284
+ recordId: key,
3285
+ node: select$2(),
3286
+ variables: {},
3287
+ });
3288
+ if (process.env.NODE_ENV !== 'production') {
3289
+ if (snapshot.state !== 'Fulfilled') {
3290
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3291
+ }
3292
+ }
3293
+ deepFreeze(snapshot.data);
3294
+ return snapshot;
3295
+ }
3296
+ function createResourceRequest$1(config) {
3297
+ const headers = {};
3298
+ const header_xSfdcSourceapp = config.headers.xSfdcSourceapp;
3299
+ if (header_xSfdcSourceapp !== undefined) {
3300
+ headers['x-sfdc-sourceapp'] = header_xSfdcSourceapp;
3301
+ }
3302
+ const header_xSfdcSourcecontext = config.headers.xSfdcSourcecontext;
3303
+ if (header_xSfdcSourcecontext !== undefined) {
3304
+ headers['x-sfdc-sourcecontext'] = header_xSfdcSourcecontext;
3305
+ }
3306
+ return {
3307
+ baseUri: 'api.salesforce.com',
3308
+ basePath: '/analytics/insights/v1/basic/generateBundle',
3309
+ method: 'post',
3310
+ body: config.body,
3311
+ urlParams: {},
3312
+ queryParams: {},
3313
+ headers,
3314
+ priority: 'normal',
3315
+ };
3316
+ }
3317
+
3318
+ const adapterName$1 = 'generateInsightsBasic';
3319
+ const generateInsightsBasic_ConfigPropertyMetadata = [
3320
+ generateParamConfigMetadata('type', false, 2 /* Body */, 0 /* String */),
3321
+ generateParamConfigMetadata('version', false, 2 /* Body */, 3 /* Integer */),
3322
+ generateParamConfigMetadata('input', false, 2 /* Body */, 4 /* Unsupported */),
3323
+ generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
3324
+ generateParamConfigMetadata('xSfdcSourceapp', false, 3 /* Header */, 0 /* String */),
3325
+ generateParamConfigMetadata('xSfdcSourcecontext', false, 3 /* Header */, 0 /* String */),
3326
+ ];
3327
+ const generateInsightsBasic_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, generateInsightsBasic_ConfigPropertyMetadata);
3328
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$5(generateInsightsBasic_ConfigPropertyMetadata);
3329
+ function typeCheckConfig$1(untrustedConfig) {
3330
+ const config = {};
3331
+ typeCheckConfig$5(untrustedConfig, config, generateInsightsBasic_ConfigPropertyMetadata);
3332
+ const untrustedConfig_input = untrustedConfig.input;
3333
+ const referenceInsightBundleInputValidationError = validate$m(untrustedConfig_input);
3334
+ if (referenceInsightBundleInputValidationError === null) {
3335
+ config.input = untrustedConfig_input;
3336
+ }
3337
+ const untrustedConfig_options = untrustedConfig.options;
3338
+ const referenceInsightBundleOptionsValidationError = validate$i(untrustedConfig_options);
3339
+ if (referenceInsightBundleOptionsValidationError === null) {
3340
+ config.options = untrustedConfig_options;
3341
+ }
3342
+ return config;
3343
+ }
3344
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
3345
+ if (!untrustedIsObject(untrustedConfig)) {
3346
+ return null;
3347
+ }
3348
+ if (process.env.NODE_ENV !== 'production') {
3349
+ validateConfig(untrustedConfig, configPropertyNames);
3350
+ }
3351
+ const config = typeCheckConfig$1(untrustedConfig);
3352
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3353
+ return null;
3354
+ }
3355
+ return config;
3356
+ }
3357
+ function buildNetworkSnapshot$1(luvio, config, options) {
3358
+ const resourceParams = createResourceParams$1(config);
3359
+ const request = createResourceRequest$1(resourceParams);
3360
+ return luvio.dispatchResourceRequest(request, options)
3361
+ .then((response) => {
3362
+ return luvio.handleSuccessResponse(() => {
3363
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
3364
+ return luvio.storeBroadcast().then(() => snapshot);
3365
+ }, () => {
3366
+ const cache = new StoreKeyMap();
3367
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
3368
+ return cache;
3369
+ });
3370
+ }, (response) => {
3371
+ deepFreeze(response);
3372
+ throw response;
3373
+ });
3374
+ }
3375
+ const generateInsightsBasicAdapterFactory = (luvio) => {
3376
+ return function generateInsightsBasic(untrustedConfig) {
3377
+ const config = validateAdapterConfig$1(untrustedConfig, generateInsightsBasic_ConfigPropertyNames);
3378
+ // Invalid or incomplete config
3379
+ if (config === null) {
3380
+ throw new Error('Invalid config for "generateInsightsBasic"');
3381
+ }
3382
+ return buildNetworkSnapshot$1(luvio, config);
3383
+ };
3384
+ };
3385
+
3386
+ const TTL = 5000;
3387
+ const VERSION = "b3ecf416df1c88948a22534e1143e6d5";
3388
+ function validate(obj, path = 'GetInsightBatchResponse') {
3389
+ const v_error = (() => {
3390
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
3391
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
3392
+ }
3393
+ const obj_batchId = obj.batchId;
3394
+ const path_batchId = path + '.batchId';
3395
+ if (typeof obj_batchId !== 'string') {
3396
+ return new TypeError('Expected "string" but received "' + typeof obj_batchId + '" (at "' + path_batchId + '")');
3397
+ }
3398
+ if (obj.bundles !== undefined) {
3399
+ const obj_bundles = obj.bundles;
3400
+ const path_bundles = path + '.bundles';
3401
+ if (!ArrayIsArray(obj_bundles)) {
3402
+ return new TypeError('Expected "array" but received "' + typeof obj_bundles + '" (at "' + path_bundles + '")');
3403
+ }
3404
+ for (let i = 0; i < obj_bundles.length; i++) {
3405
+ const obj_bundles_item = obj_bundles[i];
3406
+ const path_bundles_item = path_bundles + '[' + i + ']';
3407
+ if (typeof obj_bundles_item !== 'object' || Array.isArray(obj_bundles_item)) {
3408
+ return new TypeError('Expected "object" but received "' + typeof obj_bundles_item + '" (at "' + path_bundles_item + '")');
3409
+ }
3410
+ }
3411
+ }
3412
+ if (obj.hasErrors !== undefined) {
3413
+ const obj_hasErrors = obj.hasErrors;
3414
+ const path_hasErrors = path + '.hasErrors';
3415
+ if (typeof obj_hasErrors !== 'boolean') {
3416
+ return new TypeError('Expected "boolean" but received "' + typeof obj_hasErrors + '" (at "' + path_hasErrors + '")');
3417
+ }
3418
+ }
3419
+ if (obj.status !== undefined) {
3420
+ const obj_status = obj.status;
3421
+ const path_status = path + '.status';
3422
+ if (typeof obj_status !== 'string') {
3423
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
3424
+ }
3425
+ }
3426
+ if (obj.summary !== undefined) {
3427
+ const obj_summary = obj.summary;
3428
+ const path_summary = path + '.summary';
3429
+ const referencepath_summaryValidationError = validate$d(obj_summary, path_summary);
3430
+ if (referencepath_summaryValidationError !== null) {
3431
+ let message = 'Object doesn\'t match SummaryResponse (at "' + path_summary + '")\n';
3432
+ message += referencepath_summaryValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
3433
+ return new TypeError(message);
3434
+ }
3435
+ }
3436
+ })();
3437
+ return v_error === undefined ? null : v_error;
3438
+ }
3439
+ const RepresentationType = 'GetInsightBatchResponse';
3440
+ function keyBuilder$2(luvio, config) {
3441
+ return keyPrefix + '::' + RepresentationType + ':' + config.batchid;
3442
+ }
3443
+ function keyBuilderFromType(luvio, object) {
3444
+ const keyParams = {
3445
+ batchid: object.batchId
3446
+ };
3447
+ return keyBuilder$2(luvio, keyParams);
3448
+ }
3449
+ function normalize(input, existing, path, luvio, store, timestamp) {
3450
+ const input_bundles = input.bundles;
3451
+ const input_bundles_id = path.fullPath + '__bundles';
3452
+ if (input_bundles !== undefined) {
3453
+ for (let i = 0; i < input_bundles.length; i++) {
3454
+ const input_bundles_item = input_bundles[i];
3455
+ let input_bundles_item_id = input_bundles_id + '__' + i;
3456
+ input_bundles[i] = ingest$1(input_bundles_item, {
3457
+ fullPath: input_bundles_item_id,
3458
+ propertyName: i,
3459
+ parent: {
3460
+ data: input,
3461
+ key: path.fullPath,
3462
+ existing: existing,
3463
+ },
3464
+ ttl: path.ttl
3465
+ }, luvio, store, timestamp);
3466
+ }
3467
+ }
3468
+ return input;
3469
+ }
3470
+ const select$1 = function GetInsightBatchResponseSelect() {
3471
+ const { selections: SummaryResponse__selections, opaque: SummaryResponse__opaque, } = select$i();
3472
+ return {
3473
+ kind: 'Fragment',
3474
+ version: VERSION,
3475
+ private: [],
3476
+ selections: [
3477
+ {
3478
+ name: 'batchId',
3479
+ kind: 'Scalar'
3480
+ },
3481
+ {
3482
+ name: 'bundles',
3483
+ kind: 'Link',
3484
+ plural: true,
3485
+ required: false,
3486
+ fragment: select$4()
3487
+ },
3488
+ {
3489
+ name: 'hasErrors',
3490
+ kind: 'Scalar',
3491
+ required: false
3492
+ },
3493
+ {
3494
+ name: 'status',
3495
+ kind: 'Scalar',
3496
+ required: false
3497
+ },
3498
+ {
3499
+ name: 'summary',
3500
+ kind: 'Object',
3501
+ selections: SummaryResponse__selections,
3502
+ required: false
3503
+ }
3504
+ ]
3505
+ };
3506
+ };
3507
+ function equals(existing, incoming) {
3508
+ const existing_hasErrors = existing.hasErrors;
3509
+ const incoming_hasErrors = incoming.hasErrors;
3510
+ // if at least one of these optionals is defined
3511
+ if (existing_hasErrors !== undefined || incoming_hasErrors !== undefined) {
3512
+ // if one of these is not defined we know the other is defined and therefore
3513
+ // not equal
3514
+ if (existing_hasErrors === undefined || incoming_hasErrors === undefined) {
3515
+ return false;
3516
+ }
3517
+ if (!(existing_hasErrors === incoming_hasErrors)) {
3518
+ return false;
3519
+ }
3520
+ }
3521
+ const existing_batchId = existing.batchId;
3522
+ const incoming_batchId = incoming.batchId;
3523
+ if (!(existing_batchId === incoming_batchId)) {
3524
+ return false;
3525
+ }
3526
+ const existing_status = existing.status;
3527
+ const incoming_status = incoming.status;
3528
+ // if at least one of these optionals is defined
3529
+ if (existing_status !== undefined || incoming_status !== undefined) {
3530
+ // if one of these is not defined we know the other is defined and therefore
3531
+ // not equal
3532
+ if (existing_status === undefined || incoming_status === undefined) {
3533
+ return false;
3534
+ }
3535
+ if (!(existing_status === incoming_status)) {
3536
+ return false;
3537
+ }
3538
+ }
3539
+ const existing_bundles = existing.bundles;
3540
+ const incoming_bundles = incoming.bundles;
3541
+ // if at least one of these optionals is defined
3542
+ if (existing_bundles !== undefined || incoming_bundles !== undefined) {
3543
+ // if one of these is not defined we know the other is defined and therefore
3544
+ // not equal
3545
+ if (existing_bundles === undefined || incoming_bundles === undefined) {
3546
+ return false;
3547
+ }
3548
+ const equals_bundles_items = equalsArray(existing_bundles, incoming_bundles, (existing_bundles_item, incoming_bundles_item) => {
3549
+ if (!(existing_bundles_item.__ref === incoming_bundles_item.__ref)) {
3550
+ return false;
3551
+ }
3552
+ });
3553
+ if (equals_bundles_items === false) {
3554
+ return false;
3555
+ }
3556
+ }
3557
+ const existing_summary = existing.summary;
3558
+ const incoming_summary = incoming.summary;
3559
+ // if at least one of these optionals is defined
3560
+ if (existing_summary !== undefined || incoming_summary !== undefined) {
3561
+ // if one of these is not defined we know the other is defined and therefore
3562
+ // not equal
3563
+ if (existing_summary === undefined || incoming_summary === undefined) {
3564
+ return false;
3565
+ }
3566
+ if (!(equals$d(existing_summary, incoming_summary))) {
3567
+ return false;
3568
+ }
3569
+ }
3570
+ return true;
3571
+ }
3572
+ const ingest = function GetInsightBatchResponseIngest(input, path, luvio, store, timestamp) {
3573
+ if (process.env.NODE_ENV !== 'production') {
3574
+ const validateError = validate(input);
3575
+ if (validateError !== null) {
3576
+ throw validateError;
3577
+ }
3578
+ }
3579
+ const key = keyBuilderFromType(luvio, input);
3580
+ const ttlToUse = TTL;
3581
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "analytics-insights", VERSION, RepresentationType, equals);
3582
+ return createLink(key);
3583
+ };
3584
+ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
3585
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
3586
+ const rootKey = keyBuilderFromType(luvio, input);
3587
+ rootKeySet.set(rootKey, {
3588
+ namespace: keyPrefix,
3589
+ representationName: RepresentationType,
3590
+ mergeable: false
3591
+ });
3592
+ if (input.bundles !== undefined) {
3593
+ const input_bundles_length = input.bundles.length;
3594
+ for (let i = 0; i < input_bundles_length; i++) {
3595
+ getTypeCacheKeys$1(rootKeySet, luvio, input.bundles[i]);
3596
+ }
3597
+ }
3598
+ }
3599
+
3600
+ function select(luvio, params) {
3601
+ return select$1();
3602
+ }
3603
+ function keyBuilder$1(luvio, params) {
3604
+ return keyBuilder$2(luvio, {
3605
+ batchid: params.urlParams.batchId
3606
+ });
3607
+ }
3608
+ function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
3609
+ getTypeCacheKeys(storeKeyMap, luvio, response);
3610
+ }
3611
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
3612
+ const { body } = response;
3613
+ const key = keyBuilder$1(luvio, resourceParams);
3614
+ luvio.storeIngest(key, ingest, body);
3615
+ const snapshot = luvio.storeLookup({
3616
+ recordId: key,
3617
+ node: select(),
3618
+ variables: {},
3619
+ }, snapshotRefresh);
3620
+ if (process.env.NODE_ENV !== 'production') {
3621
+ if (snapshot.state !== 'Fulfilled') {
3622
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
3623
+ }
3624
+ }
3625
+ deepFreeze(snapshot.data);
3626
+ return snapshot;
3627
+ }
3628
+ function ingestError(luvio, params, error, snapshotRefresh) {
3629
+ const key = keyBuilder$1(luvio, params);
3630
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3631
+ const storeMetadataParams = {
3632
+ ttl: TTL,
3633
+ namespace: keyPrefix,
3634
+ version: VERSION,
3635
+ representationName: RepresentationType
3636
+ };
3637
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
3638
+ return errorSnapshot;
3639
+ }
3640
+ function createResourceRequest(config) {
3641
+ const headers = {};
3642
+ const header_xSfdcSourceapp = config.headers.xSfdcSourceapp;
3643
+ if (header_xSfdcSourceapp !== undefined) {
3644
+ headers['x-sfdc-sourceapp'] = header_xSfdcSourceapp;
3645
+ }
3646
+ const header_xSfdcSourcecontext = config.headers.xSfdcSourcecontext;
3647
+ if (header_xSfdcSourcecontext !== undefined) {
3648
+ headers['x-sfdc-sourcecontext'] = header_xSfdcSourcecontext;
3649
+ }
3650
+ return {
3651
+ baseUri: 'api.salesforce.com',
3652
+ basePath: '/analytics/insights/v1/batches/' + config.urlParams.batchId + '',
3653
+ method: 'get',
3654
+ body: null,
3655
+ urlParams: config.urlParams,
3656
+ queryParams: {},
3657
+ headers,
3658
+ priority: 'normal',
3659
+ };
3660
+ }
3661
+
3662
+ const adapterName = 'getInsightsBatch';
3663
+ const getInsightsBatch_ConfigPropertyMetadata = [
3664
+ generateParamConfigMetadata('batchId', true, 0 /* UrlParameter */, 0 /* String */),
3665
+ generateParamConfigMetadata('xSfdcSourceapp', false, 3 /* Header */, 0 /* String */),
3666
+ generateParamConfigMetadata('xSfdcSourcecontext', false, 3 /* Header */, 0 /* String */),
3667
+ ];
3668
+ const getInsightsBatch_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getInsightsBatch_ConfigPropertyMetadata);
3669
+ const createResourceParams = /*#__PURE__*/ createResourceParams$5(getInsightsBatch_ConfigPropertyMetadata);
3670
+ function keyBuilder(luvio, config) {
3671
+ const resourceParams = createResourceParams(config);
3672
+ return keyBuilder$1(luvio, resourceParams);
3673
+ }
3674
+ function typeCheckConfig(untrustedConfig) {
3675
+ const config = {};
3676
+ typeCheckConfig$5(untrustedConfig, config, getInsightsBatch_ConfigPropertyMetadata);
3677
+ return config;
3678
+ }
3679
+ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
3680
+ if (!untrustedIsObject(untrustedConfig)) {
3681
+ return null;
3682
+ }
3683
+ if (process.env.NODE_ENV !== 'production') {
3684
+ validateConfig(untrustedConfig, configPropertyNames);
3685
+ }
3686
+ const config = typeCheckConfig(untrustedConfig);
3687
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
3688
+ return null;
3689
+ }
3690
+ return config;
3691
+ }
3692
+ function adapterFragment(luvio, config) {
3693
+ createResourceParams(config);
3694
+ return select();
3695
+ }
3696
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
3697
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
3698
+ config,
3699
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
3700
+ });
3701
+ return luvio.storeBroadcast().then(() => snapshot);
3702
+ }
3703
+ function onFetchResponseError(luvio, config, resourceParams, response) {
3704
+ const snapshot = ingestError(luvio, resourceParams, response, {
3705
+ config,
3706
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
3707
+ });
3708
+ return luvio.storeBroadcast().then(() => snapshot);
3709
+ }
3710
+ function buildNetworkSnapshot(luvio, config, options) {
3711
+ const resourceParams = createResourceParams(config);
3712
+ const request = createResourceRequest(resourceParams);
3713
+ return luvio.dispatchResourceRequest(request, options)
3714
+ .then((response) => {
3715
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
3716
+ const cache = new StoreKeyMap();
3717
+ getResponseCacheKeys(cache, luvio, resourceParams, response.body);
3718
+ return cache;
3719
+ });
3720
+ }, (response) => {
3721
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
3722
+ });
3723
+ }
3724
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
3725
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
3726
+ }
3727
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
3728
+ const { luvio, config } = context;
3729
+ const selector = {
3730
+ recordId: keyBuilder(luvio, config),
3731
+ node: adapterFragment(luvio, config),
3732
+ variables: {},
3733
+ };
3734
+ const cacheSnapshot = storeLookup(selector, {
3735
+ config,
3736
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
3737
+ });
3738
+ return cacheSnapshot;
3739
+ }
3740
+ const getInsightsBatchAdapterFactory = (luvio) => function analyticsInsights__getInsightsBatch(untrustedConfig, requestContext) {
3741
+ const config = validateAdapterConfig(untrustedConfig, getInsightsBatch_ConfigPropertyNames);
3742
+ // Invalid or incomplete config
3743
+ if (config === null) {
3744
+ return null;
3745
+ }
3746
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
3747
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
3748
+ };
3749
+
3750
+ export { createInsightsBatchAdapterFactory, generateInsightsAdapterFactory, generateInsightsBasicAdapterFactory, getInsightsBatchAdapterFactory, getMetricFilterValuesAdapterFactory };