@salesforce/lds-adapters-sfap-analytics-insights 1.304.0 → 1.306.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/es/es2018/sfap-analytics-insights.js +1446 -2168
  2. package/dist/es/es2018/types/src/generated/adapters/createInsightsBatch.d.ts +2 -2
  3. package/dist/es/es2018/types/src/generated/adapters/generateInsights.d.ts +2 -2
  4. package/dist/es/es2018/types/src/generated/adapters/getInsightsBatch.d.ts +5 -5
  5. package/dist/es/es2018/types/src/generated/adapters/getMetricFilterValues.d.ts +4 -6
  6. package/dist/es/es2018/types/src/generated/artifacts/main.d.ts +2 -2
  7. package/dist/es/es2018/types/src/generated/resources/{getAnalyticsTuaInsightsServiceV1BatchesByBatch_id.d.ts → getAnalyticsInsightsV1BatchesByBatchId.d.ts} +1 -1
  8. package/dist/es/es2018/types/src/generated/resources/{postAnalyticsTuaInsightsServiceV1FilterValues.d.ts → postAnalyticsInsightsV1FilterValues.d.ts} +2 -4
  9. package/dist/es/es2018/types/src/generated/types/BatchInput.d.ts +4 -3
  10. package/dist/es/es2018/types/src/generated/types/CategoricalFilterOptions.d.ts +32 -0
  11. package/dist/es/es2018/types/src/generated/types/{SemanticField.d.ts → FieldId.d.ts} +12 -9
  12. package/dist/es/es2018/types/src/generated/types/Filter.d.ts +19 -12
  13. package/dist/es/es2018/types/src/generated/types/GenerateInsightBundleResponse.d.ts +9 -7
  14. package/dist/es/es2018/types/src/generated/types/GetFilterValuesRequest.d.ts +4 -7
  15. package/dist/es/es2018/types/src/generated/types/GetInsightBatchResponse.d.ts +19 -7
  16. package/dist/es/es2018/types/src/generated/types/Measure.d.ts +4 -7
  17. package/dist/es/es2018/types/src/generated/types/MeasurementPeriod.d.ts +9 -17
  18. package/dist/es/es2018/types/src/generated/types/{TableField.d.ts → MetricInstanceInput.d.ts} +10 -12
  19. package/dist/es/es2018/types/src/generated/types/RangeFilterOptions.d.ts +35 -0
  20. package/dist/es/es2018/types/src/generated/types/RelativeDate.d.ts +49 -0
  21. package/dist/es/es2018/types/src/generated/types/RelativeDateFilterOptions.d.ts +32 -0
  22. package/dist/es/es2018/types/src/generated/types/RelativePeriod.d.ts +29 -0
  23. package/dist/es/es2018/types/src/generated/types/TimeDimension.d.ts +4 -7
  24. package/package.json +3 -3
  25. package/sfdc/index.js +467 -1189
  26. package/src/raml/api.raml +174 -125
  27. package/src/raml/luvio.raml +11 -11
  28. package/dist/es/es2018/types/src/generated/types/NullableValue.d.ts +0 -36
  29. /package/dist/es/es2018/types/src/generated/resources/{postAnalyticsTuaInsightsServiceV1Batches.d.ts → postAnalyticsInsightsV1Batches.d.ts} +0 -0
  30. /package/dist/es/es2018/types/src/generated/resources/{postAnalyticsTuaInsightsServiceV1GenerateBundle.d.ts → postAnalyticsInsightsV1GenerateBundle.d.ts} +0 -0
@@ -92,2431 +92,1616 @@ function createLink(ref) {
92
92
  };
93
93
  }
94
94
 
95
- const VERSION$c = "07a8c889542dbad6f958515513d4e3fb";
96
- function validate$w(obj, path = 'Error') {
95
+ function validate$s(obj, path = 'MetricMetadata') {
97
96
  const v_error = (() => {
98
97
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
99
98
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
100
99
  }
101
- if (obj.code !== undefined) {
102
- const obj_code = obj.code;
103
- const path_code = path + '.code';
104
- if (typeof obj_code !== 'string') {
105
- return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
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 + '")');
106
105
  }
107
106
  }
108
- if (obj.message !== undefined) {
109
- const obj_message = obj.message;
110
- const path_message = path + '.message';
111
- if (typeof obj_message !== 'string') {
112
- return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
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 + '")');
113
112
  }
114
113
  }
115
114
  })();
116
115
  return v_error === undefined ? null : v_error;
117
116
  }
118
- const select$g = function ErrorSelect() {
119
- return {
120
- kind: 'Fragment',
121
- version: VERSION$c,
122
- private: [],
123
- selections: [
124
- {
125
- name: 'code',
126
- kind: 'Scalar',
127
- required: false
128
- },
129
- {
130
- name: 'message',
131
- kind: 'Scalar',
132
- required: false
117
+
118
+ function validate$r(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
+ }
133
135
  }
134
- ]
135
- };
136
- };
137
- function equals$c(existing, incoming) {
138
- const existing_code = existing.code;
139
- const incoming_code = incoming.code;
140
- // if at least one of these optionals is defined
141
- if (existing_code !== undefined || incoming_code !== undefined) {
142
- // if one of these is not defined we know the other is defined and therefore
143
- // not equal
144
- if (existing_code === undefined || incoming_code === undefined) {
145
- return false;
146
136
  }
147
- if (!(existing_code === incoming_code)) {
148
- return false;
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
+ }
149
143
  }
150
- }
151
- const existing_message = existing.message;
152
- const incoming_message = incoming.message;
153
- // if at least one of these optionals is defined
154
- if (existing_message !== undefined || incoming_message !== undefined) {
155
- // if one of these is not defined we know the other is defined and therefore
156
- // not equal
157
- if (existing_message === undefined || incoming_message === undefined) {
158
- return false;
144
+ })();
145
+ return v_error === undefined ? null : v_error;
146
+ }
147
+
148
+ function validate$q(obj, path = 'InsightsOptions_InsightSetting') {
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 + '")');
159
152
  }
160
- if (!(existing_message === incoming_message)) {
161
- return false;
153
+ if (obj.disabled !== undefined) {
154
+ const obj_disabled = obj.disabled;
155
+ const path_disabled = path + '.disabled';
156
+ if (typeof obj_disabled !== 'boolean') {
157
+ return new TypeError('Expected "boolean" but received "' + typeof obj_disabled + '" (at "' + path_disabled + '")');
158
+ }
162
159
  }
163
- }
164
- return true;
160
+ if (obj.type !== undefined) {
161
+ const obj_type = obj.type;
162
+ const path_type = path + '.type';
163
+ if (typeof obj_type !== 'string') {
164
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
165
+ }
166
+ }
167
+ })();
168
+ return v_error === undefined ? null : v_error;
165
169
  }
166
170
 
167
- const VERSION$b = "e64bc88a0a4f11fcf5a12538b4b51a87";
168
- function validate$v(obj, path = 'GenerateInsightBundleResponse') {
171
+ function validate$p(obj, path = 'InsightsOptions') {
169
172
  const v_error = (() => {
170
173
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
171
174
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
172
175
  }
173
- if (obj.error !== undefined) {
174
- const obj_error = obj.error;
175
- const path_error = path + '.error';
176
- const referencepath_errorValidationError = validate$w(obj_error, path_error);
177
- if (referencepath_errorValidationError !== null) {
178
- let message = 'Object doesn\'t match Error (at "' + path_error + '")\n';
179
- message += referencepath_errorValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
180
- return new TypeError(message);
176
+ if (obj.settings !== undefined) {
177
+ const obj_settings = obj.settings;
178
+ const path_settings = path + '.settings';
179
+ if (!ArrayIsArray(obj_settings)) {
180
+ return new TypeError('Expected "array" but received "' + typeof obj_settings + '" (at "' + path_settings + '")');
181
+ }
182
+ for (let i = 0; i < obj_settings.length; i++) {
183
+ const obj_settings_item = obj_settings[i];
184
+ const path_settings_item = path_settings + '[' + i + ']';
185
+ const referencepath_settings_itemValidationError = validate$q(obj_settings_item, path_settings_item);
186
+ if (referencepath_settings_itemValidationError !== null) {
187
+ let message = 'Object doesn\'t match InsightsOptions_InsightSetting (at "' + path_settings_item + '")\n';
188
+ message += referencepath_settings_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
189
+ return new TypeError(message);
190
+ }
181
191
  }
182
192
  }
183
- const obj_id = obj.id;
184
- const path_id = path + '.id';
185
- if (typeof obj_id !== 'string') {
186
- return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
193
+ })();
194
+ return v_error === undefined ? null : v_error;
195
+ }
196
+
197
+ function validate$o(obj, path = 'CategoricalFilterOptions') {
198
+ const v_error = (() => {
199
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
200
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
187
201
  }
188
- if (obj.result !== undefined) {
189
- const obj_result = obj.result;
190
- const path_result = path + '.result';
191
- if (obj_result === undefined) {
192
- return new TypeError('Expected "defined" but received "' + typeof obj_result + '" (at "' + path_result + '")');
202
+ if (obj.nullOption !== undefined) {
203
+ const obj_nullOption = obj.nullOption;
204
+ const path_nullOption = path + '.nullOption';
205
+ if (typeof obj_nullOption !== 'string') {
206
+ return new TypeError('Expected "string" but received "' + typeof obj_nullOption + '" (at "' + path_nullOption + '")');
207
+ }
208
+ }
209
+ if (obj.operator !== undefined) {
210
+ const obj_operator = obj.operator;
211
+ const path_operator = path + '.operator';
212
+ if (typeof obj_operator !== 'string') {
213
+ return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
214
+ }
215
+ }
216
+ if (obj.values !== undefined) {
217
+ const obj_values = obj.values;
218
+ const path_values = path + '.values';
219
+ if (!ArrayIsArray(obj_values)) {
220
+ return new TypeError('Expected "array" but received "' + typeof obj_values + '" (at "' + path_values + '")');
221
+ }
222
+ for (let i = 0; i < obj_values.length; i++) {
223
+ const obj_values_item = obj_values[i];
224
+ const path_values_item = path_values + '[' + i + ']';
225
+ if (obj_values_item === undefined) {
226
+ return new TypeError('Expected "defined" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
227
+ }
193
228
  }
194
229
  }
195
230
  })();
196
231
  return v_error === undefined ? null : v_error;
197
232
  }
198
- const RepresentationType$3 = 'GenerateInsightBundleResponse';
199
- function keyBuilder$5(luvio, config) {
200
- return keyPrefix + '::' + RepresentationType$3 + ':' + config.bundleresponseid;
201
- }
202
- function keyBuilderFromType$3(luvio, object) {
203
- const keyParams = {
204
- bundleresponseid: object.id
205
- };
206
- return keyBuilder$5(luvio, keyParams);
207
- }
208
- function normalize$3(input, existing, path, luvio, store, timestamp) {
209
- return input;
233
+
234
+ function validate$n(obj, path = 'FieldId') {
235
+ const v_error = (() => {
236
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
237
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
238
+ }
239
+ if (obj.datasource !== undefined) {
240
+ const obj_datasource = obj.datasource;
241
+ const path_datasource = path + '.datasource';
242
+ if (typeof obj_datasource !== 'string') {
243
+ return new TypeError('Expected "string" but received "' + typeof obj_datasource + '" (at "' + path_datasource + '")');
244
+ }
245
+ }
246
+ if (obj.fieldName !== undefined) {
247
+ const obj_fieldName = obj.fieldName;
248
+ const path_fieldName = path + '.fieldName';
249
+ if (typeof obj_fieldName !== 'string') {
250
+ return new TypeError('Expected "string" but received "' + typeof obj_fieldName + '" (at "' + path_fieldName + '")');
251
+ }
252
+ }
253
+ if (obj.objectName !== undefined) {
254
+ const obj_objectName = obj.objectName;
255
+ const path_objectName = path + '.objectName';
256
+ if (typeof obj_objectName !== 'string') {
257
+ return new TypeError('Expected "string" but received "' + typeof obj_objectName + '" (at "' + path_objectName + '")');
258
+ }
259
+ }
260
+ })();
261
+ return v_error === undefined ? null : v_error;
210
262
  }
211
- const select$f = function GenerateInsightBundleResponseSelect() {
212
- const { selections: Error__selections, opaque: Error__opaque, } = select$g();
213
- return {
214
- kind: 'Fragment',
215
- version: VERSION$b,
216
- private: [],
217
- selections: [
218
- {
219
- name: 'error',
220
- kind: 'Object',
221
- selections: Error__selections,
222
- required: false
223
- },
224
- {
225
- name: 'id',
226
- kind: 'Scalar'
227
- },
228
- {
229
- name: 'result',
230
- kind: 'Object',
231
- // any
263
+
264
+ function validate$m(obj, path = 'RangeFilterOptions') {
265
+ const v_error = (() => {
266
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
267
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
268
+ }
269
+ if (obj.excludeMax !== undefined) {
270
+ const obj_excludeMax = obj.excludeMax;
271
+ const path_excludeMax = path + '.excludeMax';
272
+ if (typeof obj_excludeMax !== 'boolean') {
273
+ return new TypeError('Expected "boolean" but received "' + typeof obj_excludeMax + '" (at "' + path_excludeMax + '")');
232
274
  }
233
- ]
234
- };
235
- };
236
- function equals$b(existing, incoming) {
237
- const existing_id = existing.id;
238
- const incoming_id = incoming.id;
239
- if (!(existing_id === incoming_id)) {
240
- return false;
241
- }
242
- const existing_error = existing.error;
243
- const incoming_error = incoming.error;
244
- // if at least one of these optionals is defined
245
- if (existing_error !== undefined || incoming_error !== undefined) {
246
- // if one of these is not defined we know the other is defined and therefore
247
- // not equal
248
- if (existing_error === undefined || incoming_error === undefined) {
249
- return false;
250
275
  }
251
- if (!(equals$c(existing_error, incoming_error))) {
252
- return false;
276
+ if (obj.excludeMin !== undefined) {
277
+ const obj_excludeMin = obj.excludeMin;
278
+ const path_excludeMin = path + '.excludeMin';
279
+ if (typeof obj_excludeMin !== 'boolean') {
280
+ return new TypeError('Expected "boolean" but received "' + typeof obj_excludeMin + '" (at "' + path_excludeMin + '")');
281
+ }
253
282
  }
254
- }
255
- const existing_result = existing.result;
256
- const incoming_result = incoming.result;
257
- // if at least one of these optionals is defined
258
- if (existing_result !== undefined || incoming_result !== undefined) {
259
- // if one of these is not defined we know the other is defined and therefore
260
- // not equal
261
- if (existing_result === undefined || incoming_result === undefined) {
262
- return false;
283
+ if (obj.max !== undefined) {
284
+ const obj_max = obj.max;
285
+ const path_max = path + '.max';
286
+ if (obj_max === undefined) {
287
+ return new TypeError('Expected "defined" but received "' + typeof obj_max + '" (at "' + path_max + '")');
288
+ }
263
289
  }
264
- if (JSONStringify(incoming_result) !== JSONStringify(existing_result)) {
265
- return false;
290
+ if (obj.min !== undefined) {
291
+ const obj_min = obj.min;
292
+ const path_min = path + '.min';
293
+ if (obj_min === undefined) {
294
+ return new TypeError('Expected "defined" but received "' + typeof obj_min + '" (at "' + path_min + '")');
295
+ }
266
296
  }
267
- }
268
- return true;
297
+ if (obj.nullOption !== undefined) {
298
+ const obj_nullOption = obj.nullOption;
299
+ const path_nullOption = path + '.nullOption';
300
+ if (typeof obj_nullOption !== 'string') {
301
+ return new TypeError('Expected "string" but received "' + typeof obj_nullOption + '" (at "' + path_nullOption + '")');
302
+ }
303
+ }
304
+ })();
305
+ return v_error === undefined ? null : v_error;
269
306
  }
270
- const ingest$3 = function GenerateInsightBundleResponseIngest(input, path, luvio, store, timestamp) {
271
- if (process.env.NODE_ENV !== 'production') {
272
- const validateError = validate$v(input);
273
- if (validateError !== null) {
274
- throw validateError;
307
+
308
+ function validate$l(obj, path = 'RelativeDate') {
309
+ const v_error = (() => {
310
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
311
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
275
312
  }
276
- }
277
- const key = keyBuilderFromType$3(luvio, input);
278
- const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
279
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "analytics-insights", VERSION$b, RepresentationType$3, equals$b);
280
- return createLink(key);
281
- };
282
- function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
283
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
284
- const rootKey = keyBuilderFromType$3(luvio, input);
285
- rootKeySet.set(rootKey, {
286
- namespace: keyPrefix,
287
- representationName: RepresentationType$3,
288
- mergeable: false
289
- });
290
- }
291
-
292
- function select$e(luvio, params) {
293
- return select$f();
294
- }
295
- function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
296
- getTypeCacheKeys$3(storeKeyMap, luvio, response);
297
- }
298
- function ingestSuccess$3(luvio, resourceParams, response) {
299
- const { body } = response;
300
- const key = keyBuilderFromType$3(luvio, body);
301
- luvio.storeIngest(key, ingest$3, body);
302
- const snapshot = luvio.storeLookup({
303
- recordId: key,
304
- node: select$e(),
305
- variables: {},
306
- });
307
- if (process.env.NODE_ENV !== 'production') {
308
- if (snapshot.state !== 'Fulfilled') {
309
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
313
+ if (obj.periodType !== undefined) {
314
+ const obj_periodType = obj.periodType;
315
+ const path_periodType = path + '.periodType';
316
+ if (typeof obj_periodType !== 'string') {
317
+ return new TypeError('Expected "string" but received "' + typeof obj_periodType + '" (at "' + path_periodType + '")');
318
+ }
310
319
  }
311
- }
312
- deepFreeze(snapshot.data);
313
- return snapshot;
314
- }
315
- function createResourceRequest$3(config) {
316
- const headers = {};
317
- return {
318
- baseUri: 'api.salesforce.com',
319
- basePath: '/analytics/tua-insights-service/v1/generateBundle',
320
- method: 'post',
321
- body: config.body,
322
- urlParams: {},
323
- queryParams: {},
324
- headers,
325
- priority: 'normal',
326
- };
327
- }
328
-
329
- const adapterName$3 = 'generateInsights';
330
- const generateInsights_ConfigPropertyMetadata = [
331
- generateParamConfigMetadata('type', false, 2 /* Body */, 0 /* String */),
332
- generateParamConfigMetadata('version', false, 2 /* Body */, 3 /* Integer */),
333
- generateParamConfigMetadata('input', false, 2 /* Body */, 4 /* Unsupported */),
334
- generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
335
- ];
336
- const generateInsights_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, generateInsights_ConfigPropertyMetadata);
337
- const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(generateInsights_ConfigPropertyMetadata);
338
- function typeCheckConfig$3(untrustedConfig) {
339
- const config = {};
340
- typeCheckConfig$4(untrustedConfig, config, generateInsights_ConfigPropertyMetadata);
341
- const untrustedConfig_input = untrustedConfig.input;
342
- config.input = untrustedConfig_input;
343
- const untrustedConfig_options = untrustedConfig.options;
344
- config.options = untrustedConfig_options;
345
- return config;
346
- }
347
- function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
348
- if (!untrustedIsObject(untrustedConfig)) {
349
- return null;
350
- }
351
- if (process.env.NODE_ENV !== 'production') {
352
- validateConfig(untrustedConfig, configPropertyNames);
353
- }
354
- const config = typeCheckConfig$3(untrustedConfig);
355
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
356
- return null;
357
- }
358
- return config;
359
- }
360
- function buildNetworkSnapshot$3(luvio, config, options) {
361
- const resourceParams = createResourceParams$3(config);
362
- const request = createResourceRequest$3(resourceParams);
363
- return luvio.dispatchResourceRequest(request, options)
364
- .then((response) => {
365
- return luvio.handleSuccessResponse(() => {
366
- const snapshot = ingestSuccess$3(luvio, resourceParams, response);
367
- return luvio.storeBroadcast().then(() => snapshot);
368
- }, () => {
369
- const cache = new StoreKeyMap();
370
- getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
371
- return cache;
372
- });
373
- }, (response) => {
374
- deepFreeze(response);
375
- throw response;
376
- });
377
- }
378
- const generateInsightsAdapterFactory = (luvio) => {
379
- return function generateInsights(untrustedConfig) {
380
- const config = validateAdapterConfig$3(untrustedConfig, generateInsights_ConfigPropertyNames);
381
- // Invalid or incomplete config
382
- if (config === null) {
383
- throw new Error('Invalid config for "generateInsights"');
320
+ if (obj.rangeN !== undefined) {
321
+ const obj_rangeN = obj.rangeN;
322
+ const path_rangeN = path + '.rangeN';
323
+ if (typeof obj_rangeN !== 'number' || (typeof obj_rangeN === 'number' && Math.floor(obj_rangeN) !== obj_rangeN)) {
324
+ return new TypeError('Expected "integer" but received "' + typeof obj_rangeN + '" (at "' + path_rangeN + '")');
325
+ }
384
326
  }
385
- return buildNetworkSnapshot$3(luvio, config);
386
- };
387
- };
327
+ if (obj.rangeType !== undefined) {
328
+ const obj_rangeType = obj.rangeType;
329
+ const path_rangeType = path + '.rangeType';
330
+ if (typeof obj_rangeType !== 'string') {
331
+ return new TypeError('Expected "string" but received "' + typeof obj_rangeType + '" (at "' + path_rangeType + '")');
332
+ }
333
+ }
334
+ })();
335
+ return v_error === undefined ? null : v_error;
336
+ }
388
337
 
389
- function validate$u(obj, path = 'SemanticDataModel') {
338
+ function validate$k(obj, path = 'RelativeDateFilterOptions') {
390
339
  const v_error = (() => {
391
340
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
392
341
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
393
342
  }
394
- if (obj.apiName !== undefined) {
395
- const obj_apiName = obj.apiName;
396
- const path_apiName = path + '.apiName';
397
- if (typeof obj_apiName !== 'string') {
398
- return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
343
+ if (obj.anchorDate !== undefined) {
344
+ const obj_anchorDate = obj.anchorDate;
345
+ const path_anchorDate = path + '.anchorDate';
346
+ if (typeof obj_anchorDate !== 'string') {
347
+ return new TypeError('Expected "string" but received "' + typeof obj_anchorDate + '" (at "' + path_anchorDate + '")');
399
348
  }
400
349
  }
350
+ const obj_max = obj.max;
351
+ const path_max = path + '.max';
352
+ const referencepath_maxValidationError = validate$l(obj_max, path_max);
353
+ if (referencepath_maxValidationError !== null) {
354
+ let message = 'Object doesn\'t match RelativeDate (at "' + path_max + '")\n';
355
+ message += referencepath_maxValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
356
+ return new TypeError(message);
357
+ }
358
+ const obj_min = obj.min;
359
+ const path_min = path + '.min';
360
+ const referencepath_minValidationError = validate$l(obj_min, path_min);
361
+ if (referencepath_minValidationError !== null) {
362
+ let message = 'Object doesn\'t match RelativeDate (at "' + path_min + '")\n';
363
+ message += referencepath_minValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
364
+ return new TypeError(message);
365
+ }
401
366
  })();
402
367
  return v_error === undefined ? null : v_error;
403
368
  }
404
369
 
405
- function validate$t(obj, path = 'TableField') {
370
+ function validate$j(obj, path = 'Filter') {
406
371
  const v_error = (() => {
407
372
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
408
373
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
409
374
  }
410
- if (obj.name !== undefined) {
411
- const obj_name = obj.name;
412
- const path_name = path + '.name';
413
- if (typeof obj_name !== 'string') {
414
- return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
415
- }
375
+ const obj_categoricalFilterOptions = obj.categoricalFilterOptions;
376
+ const path_categoricalFilterOptions = path + '.categoricalFilterOptions';
377
+ const referencepath_categoricalFilterOptionsValidationError = validate$o(obj_categoricalFilterOptions, path_categoricalFilterOptions);
378
+ if (referencepath_categoricalFilterOptionsValidationError !== null) {
379
+ let message = 'Object doesn\'t match CategoricalFilterOptions (at "' + path_categoricalFilterOptions + '")\n';
380
+ message += referencepath_categoricalFilterOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
381
+ return new TypeError(message);
382
+ }
383
+ const obj_field = obj.field;
384
+ const path_field = path + '.field';
385
+ const referencepath_fieldValidationError = validate$n(obj_field, path_field);
386
+ if (referencepath_fieldValidationError !== null) {
387
+ let message = 'Object doesn\'t match FieldId (at "' + path_field + '")\n';
388
+ message += referencepath_fieldValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
389
+ return new TypeError(message);
390
+ }
391
+ const obj_rangeFilterOptions = obj.rangeFilterOptions;
392
+ const path_rangeFilterOptions = path + '.rangeFilterOptions';
393
+ const referencepath_rangeFilterOptionsValidationError = validate$m(obj_rangeFilterOptions, path_rangeFilterOptions);
394
+ if (referencepath_rangeFilterOptionsValidationError !== null) {
395
+ let message = 'Object doesn\'t match RangeFilterOptions (at "' + path_rangeFilterOptions + '")\n';
396
+ message += referencepath_rangeFilterOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
397
+ return new TypeError(message);
398
+ }
399
+ const obj_relativeDateFilterOptions = obj.relativeDateFilterOptions;
400
+ const path_relativeDateFilterOptions = path + '.relativeDateFilterOptions';
401
+ const referencepath_relativeDateFilterOptionsValidationError = validate$k(obj_relativeDateFilterOptions, path_relativeDateFilterOptions);
402
+ if (referencepath_relativeDateFilterOptionsValidationError !== null) {
403
+ let message = 'Object doesn\'t match RelativeDateFilterOptions (at "' + path_relativeDateFilterOptions + '")\n';
404
+ message += referencepath_relativeDateFilterOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
405
+ return new TypeError(message);
416
406
  }
417
- if (obj.tableName !== undefined) {
418
- const obj_tableName = obj.tableName;
419
- const path_tableName = path + '.tableName';
420
- if (typeof obj_tableName !== 'string') {
421
- return new TypeError('Expected "string" but received "' + typeof obj_tableName + '" (at "' + path_tableName + '")');
407
+ if (obj.type !== undefined) {
408
+ const obj_type = obj.type;
409
+ const path_type = path + '.type';
410
+ if (typeof obj_type !== 'string') {
411
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
422
412
  }
423
413
  }
424
414
  })();
425
415
  return v_error === undefined ? null : v_error;
426
416
  }
427
417
 
428
- function validate$s(obj, path = 'SemanticField') {
418
+ function validate$i(obj, path = 'MeasurementPeriod') {
429
419
  const v_error = (() => {
430
420
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
431
421
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
432
422
  }
433
- if (obj.name !== undefined) {
434
- const obj_name = obj.name;
435
- const path_name = path + '.name';
436
- if (typeof obj_name !== 'string') {
437
- return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
423
+ if (obj.filter !== undefined) {
424
+ const obj_filter = obj.filter;
425
+ const path_filter = path + '.filter';
426
+ if (obj_filter === undefined) {
427
+ return new TypeError('Expected "defined" but received "' + typeof obj_filter + '" (at "' + path_filter + '")');
428
+ }
429
+ }
430
+ if (obj.relativePeriod !== undefined) {
431
+ const obj_relativePeriod = obj.relativePeriod;
432
+ const path_relativePeriod = path + '.relativePeriod';
433
+ if (obj_relativePeriod === undefined) {
434
+ return new TypeError('Expected "defined" but received "' + typeof obj_relativePeriod + '" (at "' + path_relativePeriod + '")');
438
435
  }
439
436
  }
440
437
  })();
441
438
  return v_error === undefined ? null : v_error;
442
439
  }
443
440
 
444
- function validate$r(obj, path = 'NullableValue') {
441
+ function validate$h(obj, path = 'MetricInstance') {
445
442
  const v_error = (() => {
446
443
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
447
444
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
448
445
  }
449
- if (obj.boolean !== undefined) {
450
- const obj_boolean = obj.boolean;
451
- const path_boolean = path + '.boolean';
452
- if (typeof obj_boolean !== 'boolean') {
453
- return new TypeError('Expected "boolean" but received "' + typeof obj_boolean + '" (at "' + path_boolean + '")');
446
+ if (obj.filters !== undefined) {
447
+ const obj_filters = obj.filters;
448
+ const path_filters = path + '.filters';
449
+ if (!ArrayIsArray(obj_filters)) {
450
+ return new TypeError('Expected "array" but received "' + typeof obj_filters + '" (at "' + path_filters + '")');
454
451
  }
455
- }
456
- if (obj.date !== undefined) {
457
- const obj_date = obj.date;
458
- const path_date = path + '.date';
459
- if (typeof obj_date !== 'string') {
460
- return new TypeError('Expected "string" but received "' + typeof obj_date + '" (at "' + path_date + '")');
452
+ for (let i = 0; i < obj_filters.length; i++) {
453
+ const obj_filters_item = obj_filters[i];
454
+ const path_filters_item = path_filters + '[' + i + ']';
455
+ const referencepath_filters_itemValidationError = validate$j(obj_filters_item, path_filters_item);
456
+ if (referencepath_filters_itemValidationError !== null) {
457
+ let message = 'Object doesn\'t match Filter (at "' + path_filters_item + '")\n';
458
+ message += referencepath_filters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
459
+ return new TypeError(message);
460
+ }
461
461
  }
462
462
  }
463
- if (obj.nullValue !== undefined) {
464
- const obj_nullValue = obj.nullValue;
465
- const path_nullValue = path + '.nullValue';
466
- if (typeof obj_nullValue !== 'string') {
467
- return new TypeError('Expected "string" but received "' + typeof obj_nullValue + '" (at "' + path_nullValue + '")');
468
- }
463
+ const obj_measurementPeriod = obj.measurementPeriod;
464
+ const path_measurementPeriod = path + '.measurementPeriod';
465
+ const referencepath_measurementPeriodValidationError = validate$i(obj_measurementPeriod, path_measurementPeriod);
466
+ if (referencepath_measurementPeriodValidationError !== null) {
467
+ let message = 'Object doesn\'t match MeasurementPeriod (at "' + path_measurementPeriod + '")\n';
468
+ message += referencepath_measurementPeriodValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
469
+ return new TypeError(message);
469
470
  }
470
- if (obj.number !== undefined) {
471
- const obj_number = obj.number;
472
- const path_number = path + '.number';
473
- if (typeof obj_number !== 'number') {
474
- return new TypeError('Expected "number" but received "' + typeof obj_number + '" (at "' + path_number + '")');
475
- }
471
+ })();
472
+ return v_error === undefined ? null : v_error;
473
+ }
474
+
475
+ function validate$g(obj, path = 'CompareConfig') {
476
+ const v_error = (() => {
477
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
478
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
476
479
  }
477
- if (obj.string !== undefined) {
478
- const obj_string = obj.string;
479
- const path_string = path + '.string';
480
- if (typeof obj_string !== 'string') {
481
- return new TypeError('Expected "string" but received "' + typeof obj_string + '" (at "' + path_string + '")');
480
+ if (obj.comparison !== undefined) {
481
+ const obj_comparison = obj.comparison;
482
+ const path_comparison = path + '.comparison';
483
+ if (typeof obj_comparison !== 'string') {
484
+ return new TypeError('Expected "string" but received "' + typeof obj_comparison + '" (at "' + path_comparison + '")');
482
485
  }
483
486
  }
484
487
  })();
485
488
  return v_error === undefined ? null : v_error;
486
489
  }
487
490
 
488
- function validate$q(obj, path = 'Filter') {
491
+ function validate$f(obj, path = 'Measure') {
489
492
  const v_error = (() => {
490
493
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
491
494
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
492
495
  }
493
- if (obj.operator !== undefined) {
494
- const obj_operator = obj.operator;
495
- const path_operator = path + '.operator';
496
- if (typeof obj_operator !== 'string') {
497
- return new TypeError('Expected "string" but received "' + typeof obj_operator + '" (at "' + path_operator + '")');
496
+ if (obj.aggregation !== undefined) {
497
+ const obj_aggregation = obj.aggregation;
498
+ const path_aggregation = path + '.aggregation';
499
+ if (typeof obj_aggregation !== 'string') {
500
+ return new TypeError('Expected "string" but received "' + typeof obj_aggregation + '" (at "' + path_aggregation + '")');
498
501
  }
499
502
  }
500
- const obj_semanticField = obj.semanticField;
501
- const path_semanticField = path + '.semanticField';
502
- const referencepath_semanticFieldValidationError = validate$s(obj_semanticField, path_semanticField);
503
- if (referencepath_semanticFieldValidationError !== null) {
504
- let message = 'Object doesn\'t match SemanticField (at "' + path_semanticField + '")\n';
505
- message += referencepath_semanticFieldValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
506
- return new TypeError(message);
507
- }
508
- const obj_tableField = obj.tableField;
509
- const path_tableField = path + '.tableField';
510
- const referencepath_tableFieldValidationError = validate$t(obj_tableField, path_tableField);
511
- if (referencepath_tableFieldValidationError !== null) {
512
- let message = 'Object doesn\'t match TableField (at "' + path_tableField + '")\n';
513
- message += referencepath_tableFieldValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
503
+ const obj_field = obj.field;
504
+ const path_field = path + '.field';
505
+ const referencepath_fieldValidationError = validate$n(obj_field, path_field);
506
+ if (referencepath_fieldValidationError !== null) {
507
+ let message = 'Object doesn\'t match FieldId (at "' + path_field + '")\n';
508
+ message += referencepath_fieldValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
514
509
  return new TypeError(message);
515
510
  }
516
- if (obj.values !== undefined) {
517
- const obj_values = obj.values;
518
- const path_values = path + '.values';
519
- if (!ArrayIsArray(obj_values)) {
520
- return new TypeError('Expected "array" but received "' + typeof obj_values + '" (at "' + path_values + '")');
521
- }
522
- for (let i = 0; i < obj_values.length; i++) {
523
- const obj_values_item = obj_values[i];
524
- const path_values_item = path_values + '[' + i + ']';
525
- const referencepath_values_itemValidationError = validate$r(obj_values_item, path_values_item);
526
- if (referencepath_values_itemValidationError !== null) {
527
- let message = 'Object doesn\'t match NullableValue (at "' + path_values_item + '")\n';
528
- message += referencepath_values_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
529
- return new TypeError(message);
530
- }
531
- }
532
- }
533
511
  })();
534
512
  return v_error === undefined ? null : v_error;
535
513
  }
536
514
 
537
- const VERSION$a = "f898ff84f82ad0ca1eca0045e17ce492";
538
- function validate$p(obj, path = 'GetFilterValuesResponse_CategoricalValues') {
515
+ function validate$e(obj, path = 'SemanticDataModel') {
539
516
  const v_error = (() => {
540
517
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
541
518
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
542
519
  }
543
- if (obj.values !== undefined) {
544
- const obj_values = obj.values;
545
- const path_values = path + '.values';
546
- if (!ArrayIsArray(obj_values)) {
547
- return new TypeError('Expected "array" but received "' + typeof obj_values + '" (at "' + path_values + '")');
548
- }
549
- for (let i = 0; i < obj_values.length; i++) {
550
- const obj_values_item = obj_values[i];
551
- const path_values_item = path_values + '[' + i + ']';
552
- let obj_values_item_union0 = null;
553
- const obj_values_item_union0_error = (() => {
554
- if (typeof obj_values_item !== 'string') {
555
- return new TypeError('Expected "string" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
556
- }
557
- })();
558
- if (obj_values_item_union0_error != null) {
559
- obj_values_item_union0 = obj_values_item_union0_error.message;
560
- }
561
- let obj_values_item_union1 = null;
562
- const obj_values_item_union1_error = (() => {
563
- if (typeof obj_values_item !== 'number') {
564
- return new TypeError('Expected "number" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
565
- }
566
- })();
567
- if (obj_values_item_union1_error != null) {
568
- obj_values_item_union1 = obj_values_item_union1_error.message;
569
- }
570
- let obj_values_item_union2 = null;
571
- const obj_values_item_union2_error = (() => {
572
- if (typeof obj_values_item !== 'boolean') {
573
- return new TypeError('Expected "boolean" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
574
- }
575
- })();
576
- if (obj_values_item_union2_error != null) {
577
- obj_values_item_union2 = obj_values_item_union2_error.message;
578
- }
579
- let obj_values_item_union3 = null;
580
- const obj_values_item_union3_error = (() => {
581
- if (obj_values_item !== null) {
582
- return new TypeError('Expected "null" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
583
- }
584
- })();
585
- if (obj_values_item_union3_error != null) {
586
- obj_values_item_union3 = obj_values_item_union3_error.message;
587
- }
588
- if (obj_values_item_union0 && obj_values_item_union1 && obj_values_item_union2 && obj_values_item_union3) {
589
- let message = 'Object doesn\'t match union (at "' + path_values_item + '")';
590
- message += '\n' + obj_values_item_union0.split('\n').map((line) => '\t' + line).join('\n');
591
- message += '\n' + obj_values_item_union1.split('\n').map((line) => '\t' + line).join('\n');
592
- message += '\n' + obj_values_item_union2.split('\n').map((line) => '\t' + line).join('\n');
593
- message += '\n' + obj_values_item_union3.split('\n').map((line) => '\t' + line).join('\n');
594
- return new TypeError(message);
595
- }
520
+ if (obj.apiName !== undefined) {
521
+ const obj_apiName = obj.apiName;
522
+ const path_apiName = path + '.apiName';
523
+ if (typeof obj_apiName !== 'string') {
524
+ return new TypeError('Expected "string" but received "' + typeof obj_apiName + '" (at "' + path_apiName + '")');
596
525
  }
597
526
  }
598
527
  })();
599
528
  return v_error === undefined ? null : v_error;
600
529
  }
601
- const select$d = function GetFilterValuesResponse_CategoricalValuesSelect() {
602
- return {
603
- kind: 'Fragment',
604
- version: VERSION$a,
605
- private: [],
606
- selections: [
607
- {
608
- name: 'values',
609
- kind: 'Scalar',
610
- plural: true,
611
- required: false
612
- }
613
- ]
614
- };
615
- };
616
- function equals$a(existing, incoming) {
617
- const existing_values = existing.values;
618
- const incoming_values = incoming.values;
619
- // if at least one of these optionals is defined
620
- if (existing_values !== undefined || incoming_values !== undefined) {
621
- // if one of these is not defined we know the other is defined and therefore
622
- // not equal
623
- if (existing_values === undefined || incoming_values === undefined) {
624
- return false;
530
+
531
+ function validate$d(obj, path = 'TimeDimension') {
532
+ const v_error = (() => {
533
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
534
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
625
535
  }
626
- const equals_values_items = equalsArray(existing_values, incoming_values, (existing_values_item, incoming_values_item) => {
627
- if (!(existing_values_item === incoming_values_item)) {
628
- return false;
629
- }
630
- });
631
- if (equals_values_items === false) {
632
- return false;
536
+ const obj_field = obj.field;
537
+ const path_field = path + '.field';
538
+ const referencepath_fieldValidationError = validate$n(obj_field, path_field);
539
+ if (referencepath_fieldValidationError !== null) {
540
+ let message = 'Object doesn\'t match FieldId (at "' + path_field + '")\n';
541
+ message += referencepath_fieldValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
542
+ return new TypeError(message);
633
543
  }
634
- }
635
- return true;
544
+ })();
545
+ return v_error === undefined ? null : v_error;
636
546
  }
637
547
 
638
- const VERSION$9 = "2025bbf393050a10fae76d5b4d5d0f58";
639
- function validate$o(obj, path = 'GetFilterValuesResponse') {
548
+ function validate$c(obj, path = 'MetricDefinition') {
640
549
  const v_error = (() => {
641
550
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
642
551
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
643
552
  }
644
- const obj_categoricalValues = obj.categoricalValues;
645
- const path_categoricalValues = path + '.categoricalValues';
646
- const referencepath_categoricalValuesValidationError = validate$p(obj_categoricalValues, path_categoricalValues);
647
- if (referencepath_categoricalValuesValidationError !== null) {
648
- let message = 'Object doesn\'t match GetFilterValuesResponse_CategoricalValues (at "' + path_categoricalValues + '")\n';
649
- message += referencepath_categoricalValuesValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
553
+ const obj_comparison = obj.comparison;
554
+ const path_comparison = path + '.comparison';
555
+ const referencepath_comparisonValidationError = validate$g(obj_comparison, path_comparison);
556
+ if (referencepath_comparisonValidationError !== null) {
557
+ let message = 'Object doesn\'t match CompareConfig (at "' + path_comparison + '")\n';
558
+ message += referencepath_comparisonValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
650
559
  return new TypeError(message);
651
560
  }
652
- const obj_id = obj.id;
653
- const path_id = path + '.id';
654
- if (typeof obj_id !== 'string') {
655
- return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
656
- }
657
- if (obj.nextPageToken !== undefined) {
658
- const obj_nextPageToken = obj.nextPageToken;
659
- const path_nextPageToken = path + '.nextPageToken';
660
- if (typeof obj_nextPageToken !== 'string') {
661
- return new TypeError('Expected "string" but received "' + typeof obj_nextPageToken + '" (at "' + path_nextPageToken + '")');
561
+ if (obj.filters !== undefined) {
562
+ const obj_filters = obj.filters;
563
+ const path_filters = path + '.filters';
564
+ if (!ArrayIsArray(obj_filters)) {
565
+ return new TypeError('Expected "array" but received "' + typeof obj_filters + '" (at "' + path_filters + '")');
566
+ }
567
+ for (let i = 0; i < obj_filters.length; i++) {
568
+ const obj_filters_item = obj_filters[i];
569
+ const path_filters_item = path_filters + '[' + i + ']';
570
+ const referencepath_filters_itemValidationError = validate$j(obj_filters_item, path_filters_item);
571
+ if (referencepath_filters_itemValidationError !== null) {
572
+ let message = 'Object doesn\'t match Filter (at "' + path_filters_item + '")\n';
573
+ message += referencepath_filters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
574
+ return new TypeError(message);
575
+ }
662
576
  }
663
577
  }
664
- if (obj.totalAvailable !== undefined) {
665
- const obj_totalAvailable = obj.totalAvailable;
666
- const path_totalAvailable = path + '.totalAvailable';
667
- if (typeof obj_totalAvailable !== 'number' || (typeof obj_totalAvailable === 'number' && Math.floor(obj_totalAvailable) !== obj_totalAvailable)) {
668
- return new TypeError('Expected "integer" but received "' + typeof obj_totalAvailable + '" (at "' + path_totalAvailable + '")');
578
+ const obj_measure = obj.measure;
579
+ const path_measure = path + '.measure';
580
+ const referencepath_measureValidationError = validate$f(obj_measure, path_measure);
581
+ if (referencepath_measureValidationError !== null) {
582
+ let message = 'Object doesn\'t match Measure (at "' + path_measure + '")\n';
583
+ message += referencepath_measureValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
584
+ return new TypeError(message);
585
+ }
586
+ if (obj.runningTotal !== undefined) {
587
+ const obj_runningTotal = obj.runningTotal;
588
+ const path_runningTotal = path + '.runningTotal';
589
+ if (typeof obj_runningTotal !== 'boolean') {
590
+ return new TypeError('Expected "boolean" but received "' + typeof obj_runningTotal + '" (at "' + path_runningTotal + '")');
669
591
  }
670
592
  }
593
+ const obj_semanticDataModel = obj.semanticDataModel;
594
+ const path_semanticDataModel = path + '.semanticDataModel';
595
+ const referencepath_semanticDataModelValidationError = validate$e(obj_semanticDataModel, path_semanticDataModel);
596
+ if (referencepath_semanticDataModelValidationError !== null) {
597
+ let message = 'Object doesn\'t match SemanticDataModel (at "' + path_semanticDataModel + '")\n';
598
+ message += referencepath_semanticDataModelValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
599
+ return new TypeError(message);
600
+ }
601
+ const obj_timeDimension = obj.timeDimension;
602
+ const path_timeDimension = path + '.timeDimension';
603
+ const referencepath_timeDimensionValidationError = validate$d(obj_timeDimension, path_timeDimension);
604
+ if (referencepath_timeDimensionValidationError !== null) {
605
+ let message = 'Object doesn\'t match TimeDimension (at "' + path_timeDimension + '")\n';
606
+ message += referencepath_timeDimensionValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
607
+ return new TypeError(message);
608
+ }
671
609
  })();
672
610
  return v_error === undefined ? null : v_error;
673
611
  }
674
- const RepresentationType$2 = 'GetFilterValuesResponse';
675
- function keyBuilder$4(luvio, config) {
676
- return keyPrefix + '::' + RepresentationType$2 + ':' + config.filterpageid;
677
- }
678
- function keyBuilderFromType$2(luvio, object) {
679
- const keyParams = {
680
- filterpageid: object.id
681
- };
682
- return keyBuilder$4(luvio, keyParams);
683
- }
684
- function normalize$2(input, existing, path, luvio, store, timestamp) {
685
- return input;
686
- }
687
- const select$c = function GetFilterValuesResponseSelect() {
688
- const { selections: GetFilterValuesResponse_CategoricalValues__selections, opaque: GetFilterValuesResponse_CategoricalValues__opaque, } = select$d();
689
- return {
690
- kind: 'Fragment',
691
- version: VERSION$9,
692
- private: [],
693
- selections: [
694
- {
695
- name: 'categoricalValues',
696
- kind: 'Object',
697
- selections: GetFilterValuesResponse_CategoricalValues__selections
698
- },
699
- {
700
- name: 'id',
701
- kind: 'Scalar'
702
- },
703
- {
704
- name: 'nextPageToken',
705
- kind: 'Scalar',
706
- required: false
707
- },
708
- {
709
- name: 'totalAvailable',
710
- kind: 'Scalar',
711
- required: false
612
+
613
+ function validate$b(obj, path = 'RepresentationOptions_NumberUnits') {
614
+ const v_error = (() => {
615
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
616
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
617
+ }
618
+ if (obj.pluralNoun !== undefined) {
619
+ const obj_pluralNoun = obj.pluralNoun;
620
+ const path_pluralNoun = path + '.pluralNoun';
621
+ if (typeof obj_pluralNoun !== 'string') {
622
+ return new TypeError('Expected "string" but received "' + typeof obj_pluralNoun + '" (at "' + path_pluralNoun + '")');
712
623
  }
713
- ]
714
- };
715
- };
716
- function equals$9(existing, incoming) {
717
- const existing_totalAvailable = existing.totalAvailable;
718
- const incoming_totalAvailable = incoming.totalAvailable;
719
- // if at least one of these optionals is defined
720
- if (existing_totalAvailable !== undefined || incoming_totalAvailable !== undefined) {
721
- // if one of these is not defined we know the other is defined and therefore
722
- // not equal
723
- if (existing_totalAvailable === undefined || incoming_totalAvailable === undefined) {
724
- return false;
725
624
  }
726
- if (!(existing_totalAvailable === incoming_totalAvailable)) {
727
- return false;
625
+ if (obj.singularNoun !== undefined) {
626
+ const obj_singularNoun = obj.singularNoun;
627
+ const path_singularNoun = path + '.singularNoun';
628
+ if (typeof obj_singularNoun !== 'string') {
629
+ return new TypeError('Expected "string" but received "' + typeof obj_singularNoun + '" (at "' + path_singularNoun + '")');
630
+ }
728
631
  }
729
- }
730
- const existing_id = existing.id;
731
- const incoming_id = incoming.id;
732
- if (!(existing_id === incoming_id)) {
733
- return false;
734
- }
735
- const existing_nextPageToken = existing.nextPageToken;
736
- const incoming_nextPageToken = incoming.nextPageToken;
737
- // if at least one of these optionals is defined
738
- if (existing_nextPageToken !== undefined || incoming_nextPageToken !== undefined) {
739
- // if one of these is not defined we know the other is defined and therefore
740
- // not equal
741
- if (existing_nextPageToken === undefined || incoming_nextPageToken === undefined) {
742
- return false;
632
+ })();
633
+ return v_error === undefined ? null : v_error;
634
+ }
635
+
636
+ function validate$a(obj, path = 'RepresentationOptions') {
637
+ const v_error = (() => {
638
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
639
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
743
640
  }
744
- if (!(existing_nextPageToken === incoming_nextPageToken)) {
745
- return false;
641
+ const obj_numberUnits = obj.numberUnits;
642
+ const path_numberUnits = path + '.numberUnits';
643
+ const referencepath_numberUnitsValidationError = validate$b(obj_numberUnits, path_numberUnits);
644
+ if (referencepath_numberUnitsValidationError !== null) {
645
+ let message = 'Object doesn\'t match RepresentationOptions_NumberUnits (at "' + path_numberUnits + '")\n';
646
+ message += referencepath_numberUnitsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
647
+ return new TypeError(message);
746
648
  }
747
- }
748
- const existing_categoricalValues = existing.categoricalValues;
749
- const incoming_categoricalValues = incoming.categoricalValues;
750
- if (!(equals$a(existing_categoricalValues, incoming_categoricalValues))) {
751
- return false;
752
- }
753
- return true;
754
- }
755
- const ingest$2 = function GetFilterValuesResponseIngest(input, path, luvio, store, timestamp) {
756
- if (process.env.NODE_ENV !== 'production') {
757
- const validateError = validate$o(input);
758
- if (validateError !== null) {
759
- throw validateError;
649
+ if (obj.sentimentType !== undefined) {
650
+ const obj_sentimentType = obj.sentimentType;
651
+ const path_sentimentType = path + '.sentimentType';
652
+ if (typeof obj_sentimentType !== 'string') {
653
+ return new TypeError('Expected "string" but received "' + typeof obj_sentimentType + '" (at "' + path_sentimentType + '")');
654
+ }
760
655
  }
761
- }
762
- const key = keyBuilderFromType$2(luvio, input);
763
- const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
764
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "analytics-insights", VERSION$9, RepresentationType$2, equals$9);
765
- return createLink(key);
766
- };
767
- function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
768
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
769
- const rootKey = keyBuilderFromType$2(luvio, input);
770
- rootKeySet.set(rootKey, {
771
- namespace: keyPrefix,
772
- representationName: RepresentationType$2,
773
- mergeable: false
774
- });
656
+ if (obj.type !== undefined) {
657
+ const obj_type = obj.type;
658
+ const path_type = path + '.type';
659
+ if (typeof obj_type !== 'string') {
660
+ return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
661
+ }
662
+ }
663
+ })();
664
+ return v_error === undefined ? null : v_error;
775
665
  }
776
666
 
777
- function select$b(luvio, params) {
778
- return select$c();
779
- }
780
- function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
781
- getTypeCacheKeys$2(storeKeyMap, luvio, response);
782
- }
783
- function ingestSuccess$2(luvio, resourceParams, response) {
784
- const { body } = response;
785
- const key = keyBuilderFromType$2(luvio, body);
786
- luvio.storeIngest(key, ingest$2, body);
787
- const snapshot = luvio.storeLookup({
788
- recordId: key,
789
- node: select$b(),
790
- variables: {},
791
- });
792
- if (process.env.NODE_ENV !== 'production') {
793
- if (snapshot.state !== 'Fulfilled') {
794
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
667
+ function validate$9(obj, path = 'InputMetric') {
668
+ const v_error = (() => {
669
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
670
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
795
671
  }
796
- }
797
- deepFreeze(snapshot.data);
798
- return snapshot;
799
- }
800
- function createResourceRequest$2(config) {
801
- const headers = {};
802
- return {
803
- baseUri: 'api.salesforce.com',
804
- basePath: '/analytics/tua-insights-service/v1/filterValues',
805
- method: 'post',
806
- body: config.body,
807
- urlParams: {},
808
- queryParams: {},
809
- headers,
810
- priority: 'normal',
811
- };
672
+ const obj_extensionOptions = obj.extensionOptions;
673
+ const path_extensionOptions = path + '.extensionOptions';
674
+ const referencepath_extensionOptionsValidationError = validate$r(obj_extensionOptions, path_extensionOptions);
675
+ if (referencepath_extensionOptionsValidationError !== null) {
676
+ let message = 'Object doesn\'t match ExtensionOptions (at "' + path_extensionOptions + '")\n';
677
+ message += referencepath_extensionOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
678
+ return new TypeError(message);
679
+ }
680
+ const obj_insightsOptions = obj.insightsOptions;
681
+ const path_insightsOptions = path + '.insightsOptions';
682
+ const referencepath_insightsOptionsValidationError = validate$p(obj_insightsOptions, path_insightsOptions);
683
+ if (referencepath_insightsOptionsValidationError !== null) {
684
+ let message = 'Object doesn\'t match InsightsOptions (at "' + path_insightsOptions + '")\n';
685
+ message += referencepath_insightsOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
686
+ return new TypeError(message);
687
+ }
688
+ const obj_instance = obj.instance;
689
+ const path_instance = path + '.instance';
690
+ const referencepath_instanceValidationError = validate$h(obj_instance, path_instance);
691
+ if (referencepath_instanceValidationError !== null) {
692
+ let message = 'Object doesn\'t match MetricInstance (at "' + path_instance + '")\n';
693
+ message += referencepath_instanceValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
694
+ return new TypeError(message);
695
+ }
696
+ const obj_metric = obj.metric;
697
+ const path_metric = path + '.metric';
698
+ const referencepath_metricValidationError = validate$c(obj_metric, path_metric);
699
+ if (referencepath_metricValidationError !== null) {
700
+ let message = 'Object doesn\'t match MetricDefinition (at "' + path_metric + '")\n';
701
+ message += referencepath_metricValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
702
+ return new TypeError(message);
703
+ }
704
+ const obj_representationOptions = obj.representationOptions;
705
+ const path_representationOptions = path + '.representationOptions';
706
+ const referencepath_representationOptionsValidationError = validate$a(obj_representationOptions, path_representationOptions);
707
+ if (referencepath_representationOptionsValidationError !== null) {
708
+ let message = 'Object doesn\'t match RepresentationOptions (at "' + path_representationOptions + '")\n';
709
+ message += referencepath_representationOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
710
+ return new TypeError(message);
711
+ }
712
+ })();
713
+ return v_error === undefined ? null : v_error;
812
714
  }
813
715
 
814
- const adapterName$2 = 'getMetricFilterValues';
815
- const getMetricFilterValues_ConfigPropertyMetadata = [
816
- generateParamConfigMetadata('semanticDataModel', true, 2 /* Body */, 4 /* Unsupported */),
817
- generateParamConfigMetadata('tableField', false, 2 /* Body */, 4 /* Unsupported */),
818
- generateParamConfigMetadata('semanticField', false, 2 /* Body */, 4 /* Unsupported */),
819
- generateParamConfigMetadata('pageToken', false, 2 /* Body */, 0 /* String */),
820
- generateParamConfigMetadata('pageSize', false, 2 /* Body */, 3 /* Integer */),
821
- generateParamConfigMetadata('searchTerm', false, 2 /* Body */, 0 /* String */),
822
- generateParamConfigMetadata('filters', false, 2 /* Body */, 4 /* Unsupported */, true),
823
- ];
824
- const getMetricFilterValues_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getMetricFilterValues_ConfigPropertyMetadata);
825
- const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(getMetricFilterValues_ConfigPropertyMetadata);
826
- function typeCheckConfig$2(untrustedConfig) {
827
- const config = {};
828
- typeCheckConfig$4(untrustedConfig, config, getMetricFilterValues_ConfigPropertyMetadata);
829
- const untrustedConfig_semanticDataModel = untrustedConfig.semanticDataModel;
830
- const referenceSemanticDataModelValidationError = validate$u(untrustedConfig_semanticDataModel);
831
- if (referenceSemanticDataModelValidationError === null) {
832
- config.semanticDataModel = untrustedConfig_semanticDataModel;
833
- }
834
- const untrustedConfig_tableField = untrustedConfig.tableField;
835
- const referenceTableFieldValidationError = validate$t(untrustedConfig_tableField);
836
- if (referenceTableFieldValidationError === null) {
837
- config.tableField = untrustedConfig_tableField;
838
- }
839
- const untrustedConfig_semanticField = untrustedConfig.semanticField;
840
- const referenceSemanticFieldValidationError = validate$s(untrustedConfig_semanticField);
841
- if (referenceSemanticFieldValidationError === null) {
842
- config.semanticField = untrustedConfig_semanticField;
843
- }
844
- const untrustedConfig_filters = untrustedConfig.filters;
845
- if (ArrayIsArray$1(untrustedConfig_filters)) {
846
- const untrustedConfig_filters_array = [];
847
- for (let i = 0, arrayLength = untrustedConfig_filters.length; i < arrayLength; i++) {
848
- const untrustedConfig_filters_item = untrustedConfig_filters[i];
849
- const referenceFilterValidationError = validate$q(untrustedConfig_filters_item);
850
- if (referenceFilterValidationError === null) {
851
- untrustedConfig_filters_array.push(untrustedConfig_filters_item);
852
- }
716
+ function validate$8(obj, path = 'InsightBundleInput') {
717
+ const v_error = (() => {
718
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
719
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
853
720
  }
854
- config.filters = untrustedConfig_filters_array;
855
- }
856
- return config;
857
- }
858
- function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
859
- if (!untrustedIsObject(untrustedConfig)) {
860
- return null;
861
- }
862
- if (process.env.NODE_ENV !== 'production') {
863
- validateConfig(untrustedConfig, configPropertyNames);
864
- }
865
- const config = typeCheckConfig$2(untrustedConfig);
866
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
867
- return null;
868
- }
869
- return config;
721
+ const obj_metadata = obj.metadata;
722
+ const path_metadata = path + '.metadata';
723
+ const referencepath_metadataValidationError = validate$s(obj_metadata, path_metadata);
724
+ if (referencepath_metadataValidationError !== null) {
725
+ let message = 'Object doesn\'t match MetricMetadata (at "' + path_metadata + '")\n';
726
+ message += referencepath_metadataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
727
+ return new TypeError(message);
728
+ }
729
+ const obj_metric = obj.metric;
730
+ const path_metric = path + '.metric';
731
+ const referencepath_metricValidationError = validate$9(obj_metric, path_metric);
732
+ if (referencepath_metricValidationError !== null) {
733
+ let message = 'Object doesn\'t match InputMetric (at "' + path_metric + '")\n';
734
+ message += referencepath_metricValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
735
+ return new TypeError(message);
736
+ }
737
+ })();
738
+ return v_error === undefined ? null : v_error;
870
739
  }
871
- function buildNetworkSnapshot$2(luvio, config, options) {
872
- const resourceParams = createResourceParams$2(config);
873
- const request = createResourceRequest$2(resourceParams);
874
- return luvio.dispatchResourceRequest(request, options)
875
- .then((response) => {
876
- return luvio.handleSuccessResponse(() => {
877
- const snapshot = ingestSuccess$2(luvio, resourceParams, response);
878
- return luvio.storeBroadcast().then(() => snapshot);
879
- }, () => {
880
- const cache = new StoreKeyMap();
881
- getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
882
- return cache;
883
- });
884
- }, (response) => {
885
- deepFreeze(response);
886
- throw response;
887
- });
740
+
741
+ function validate$7(obj, path = 'MetricInstanceInput') {
742
+ const v_error = (() => {
743
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
744
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
745
+ }
746
+ const obj_metricInstanceId = obj.metricInstanceId;
747
+ const path_metricInstanceId = path + '.metricInstanceId';
748
+ if (typeof obj_metricInstanceId !== 'string') {
749
+ return new TypeError('Expected "string" but received "' + typeof obj_metricInstanceId + '" (at "' + path_metricInstanceId + '")');
750
+ }
751
+ const obj_sdmId = obj.sdmId;
752
+ const path_sdmId = path + '.sdmId';
753
+ if (typeof obj_sdmId !== 'string') {
754
+ return new TypeError('Expected "string" but received "' + typeof obj_sdmId + '" (at "' + path_sdmId + '")');
755
+ }
756
+ })();
757
+ return v_error === undefined ? null : v_error;
888
758
  }
889
- const getMetricFilterValuesAdapterFactory = (luvio) => {
890
- return function getMetricFilterValues(untrustedConfig) {
891
- const config = validateAdapterConfig$2(untrustedConfig, getMetricFilterValues_ConfigPropertyNames);
892
- // Invalid or incomplete config
893
- if (config === null) {
894
- throw new Error('Invalid config for "getMetricFilterValues"');
759
+
760
+ function validate$6(obj, path = 'BatchInput') {
761
+ const v_error = (() => {
762
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
763
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
895
764
  }
896
- return buildNetworkSnapshot$2(luvio, config);
897
- };
898
- };
765
+ if (obj.bundleInput !== undefined) {
766
+ const obj_bundleInput = obj.bundleInput;
767
+ const path_bundleInput = path + '.bundleInput';
768
+ const referencepath_bundleInputValidationError = validate$8(obj_bundleInput, path_bundleInput);
769
+ if (referencepath_bundleInputValidationError !== null) {
770
+ let message = 'Object doesn\'t match InsightBundleInput (at "' + path_bundleInput + '")\n';
771
+ message += referencepath_bundleInputValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
772
+ return new TypeError(message);
773
+ }
774
+ }
775
+ if (obj.metricInstanceInput !== undefined) {
776
+ const obj_metricInstanceInput = obj.metricInstanceInput;
777
+ const path_metricInstanceInput = path + '.metricInstanceInput';
778
+ const referencepath_metricInstanceInputValidationError = validate$7(obj_metricInstanceInput, path_metricInstanceInput);
779
+ if (referencepath_metricInstanceInputValidationError !== null) {
780
+ let message = 'Object doesn\'t match MetricInstanceInput (at "' + path_metricInstanceInput + '")\n';
781
+ message += referencepath_metricInstanceInputValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
782
+ return new TypeError(message);
783
+ }
784
+ }
785
+ })();
786
+ return v_error === undefined ? null : v_error;
787
+ }
899
788
 
900
- const VERSION$8 = "6b47d2ed35a900956ff58b7d8a527e7f";
901
- function validate$n(obj, path = 'InsightFeedbackMetadata') {
789
+ const VERSION$5 = "a8b8e8e21e2dc1b5b067efa90209dce3";
790
+ function validate$5(obj, path = 'GenerateInsightBatchResponse') {
902
791
  const v_error = (() => {
903
792
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
904
793
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
905
794
  }
906
- if (obj.dimensionHash !== undefined) {
907
- const obj_dimensionHash = obj.dimensionHash;
908
- const path_dimensionHash = path + '.dimensionHash';
909
- if (typeof obj_dimensionHash !== 'string') {
910
- return new TypeError('Expected "string" but received "' + typeof obj_dimensionHash + '" (at "' + path_dimensionHash + '")');
795
+ const obj_batchId = obj.batchId;
796
+ const path_batchId = path + '.batchId';
797
+ if (typeof obj_batchId !== 'string') {
798
+ return new TypeError('Expected "string" but received "' + typeof obj_batchId + '" (at "' + path_batchId + '")');
799
+ }
800
+ if (obj.generatingSummary !== undefined) {
801
+ const obj_generatingSummary = obj.generatingSummary;
802
+ const path_generatingSummary = path + '.generatingSummary';
803
+ if (typeof obj_generatingSummary !== 'boolean') {
804
+ return new TypeError('Expected "boolean" but received "' + typeof obj_generatingSummary + '" (at "' + path_generatingSummary + '")');
911
805
  }
912
806
  }
913
- if (obj.score !== undefined) {
914
- obj.score;
807
+ if (obj.summary !== undefined) {
808
+ const obj_summary = obj.summary;
809
+ const path_summary = path + '.summary';
810
+ if (obj_summary === undefined) {
811
+ return new TypeError('Expected "defined" but received "' + typeof obj_summary + '" (at "' + path_summary + '")');
812
+ }
915
813
  }
916
- if (obj.type !== undefined) {
917
- const obj_type = obj.type;
918
- const path_type = path + '.type';
919
- if (typeof obj_type !== 'string') {
920
- return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
814
+ if (obj.timestamp !== undefined) {
815
+ const obj_timestamp = obj.timestamp;
816
+ const path_timestamp = path + '.timestamp';
817
+ if (typeof obj_timestamp !== 'string') {
818
+ return new TypeError('Expected "string" but received "' + typeof obj_timestamp + '" (at "' + path_timestamp + '")');
921
819
  }
922
820
  }
923
821
  })();
924
822
  return v_error === undefined ? null : v_error;
925
823
  }
926
- const select$a = function InsightFeedbackMetadataSelect() {
824
+ const RepresentationType$3 = 'GenerateInsightBatchResponse';
825
+ function keyBuilder$5(luvio, config) {
826
+ return keyPrefix + '::' + RepresentationType$3 + ':' + config.batchid;
827
+ }
828
+ function keyBuilderFromType$3(luvio, object) {
829
+ const keyParams = {
830
+ batchid: object.batchId
831
+ };
832
+ return keyBuilder$5(luvio, keyParams);
833
+ }
834
+ function normalize$3(input, existing, path, luvio, store, timestamp) {
835
+ return input;
836
+ }
837
+ const select$9 = function GenerateInsightBatchResponseSelect() {
927
838
  return {
928
839
  kind: 'Fragment',
929
- version: VERSION$8,
840
+ version: VERSION$5,
930
841
  private: [],
931
842
  selections: [
932
843
  {
933
- name: 'dimensionHash',
934
- kind: 'Scalar',
935
- required: false
844
+ name: 'batchId',
845
+ kind: 'Scalar'
936
846
  },
937
847
  {
938
- name: 'score',
848
+ name: 'generatingSummary',
939
849
  kind: 'Scalar',
940
850
  required: false
941
851
  },
942
852
  {
943
- name: 'type',
853
+ name: 'summary',
854
+ kind: 'Object',
855
+ // any
856
+ },
857
+ {
858
+ name: 'timestamp',
944
859
  kind: 'Scalar',
945
860
  required: false
946
861
  }
947
862
  ]
948
863
  };
949
864
  };
950
- function equals$8(existing, incoming) {
951
- const existing_dimensionHash = existing.dimensionHash;
952
- const incoming_dimensionHash = incoming.dimensionHash;
865
+ function equals$5(existing, incoming) {
866
+ const existing_generatingSummary = existing.generatingSummary;
867
+ const incoming_generatingSummary = incoming.generatingSummary;
953
868
  // if at least one of these optionals is defined
954
- if (existing_dimensionHash !== undefined || incoming_dimensionHash !== undefined) {
869
+ if (existing_generatingSummary !== undefined || incoming_generatingSummary !== undefined) {
955
870
  // if one of these is not defined we know the other is defined and therefore
956
871
  // not equal
957
- if (existing_dimensionHash === undefined || incoming_dimensionHash === undefined) {
872
+ if (existing_generatingSummary === undefined || incoming_generatingSummary === undefined) {
958
873
  return false;
959
874
  }
960
- if (!(existing_dimensionHash === incoming_dimensionHash)) {
875
+ if (!(existing_generatingSummary === incoming_generatingSummary)) {
961
876
  return false;
962
877
  }
963
878
  }
964
- const existing_type = existing.type;
965
- const incoming_type = incoming.type;
879
+ const existing_batchId = existing.batchId;
880
+ const incoming_batchId = incoming.batchId;
881
+ if (!(existing_batchId === incoming_batchId)) {
882
+ return false;
883
+ }
884
+ const existing_timestamp = existing.timestamp;
885
+ const incoming_timestamp = incoming.timestamp;
966
886
  // if at least one of these optionals is defined
967
- if (existing_type !== undefined || incoming_type !== undefined) {
887
+ if (existing_timestamp !== undefined || incoming_timestamp !== undefined) {
968
888
  // if one of these is not defined we know the other is defined and therefore
969
889
  // not equal
970
- if (existing_type === undefined || incoming_type === undefined) {
890
+ if (existing_timestamp === undefined || incoming_timestamp === undefined) {
971
891
  return false;
972
892
  }
973
- if (!(existing_type === incoming_type)) {
893
+ if (!(existing_timestamp === incoming_timestamp)) {
974
894
  return false;
975
895
  }
976
896
  }
977
- const existing_score = existing.score;
978
- const incoming_score = incoming.score;
897
+ const existing_summary = existing.summary;
898
+ const incoming_summary = incoming.summary;
979
899
  // if at least one of these optionals is defined
980
- if (existing_score !== undefined || incoming_score !== undefined) {
900
+ if (existing_summary !== undefined || incoming_summary !== undefined) {
981
901
  // if one of these is not defined we know the other is defined and therefore
982
902
  // not equal
983
- if (existing_score === undefined || incoming_score === undefined) {
903
+ if (existing_summary === undefined || incoming_summary === undefined) {
984
904
  return false;
985
905
  }
986
- if (!(existing_score === incoming_score)) {
906
+ if (JSONStringify(incoming_summary) !== JSONStringify(existing_summary)) {
987
907
  return false;
988
908
  }
989
909
  }
990
910
  return true;
991
911
  }
992
-
993
- const VERSION$7 = "b973507f0d8eb5a125451461b0e5cea2";
994
- function validate$m(obj, path = 'Insight') {
995
- const v_error = (() => {
996
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
997
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
998
- }
999
- if (obj.characterization !== undefined) {
1000
- const obj_characterization = obj.characterization;
1001
- const path_characterization = path + '.characterization';
1002
- if (typeof obj_characterization !== 'string') {
1003
- return new TypeError('Expected "string" but received "' + typeof obj_characterization + '" (at "' + path_characterization + '")');
1004
- }
1005
- }
1006
- if (obj.facts !== undefined) {
1007
- const obj_facts = obj.facts;
1008
- const path_facts = path + '.facts';
1009
- if (typeof obj_facts !== 'object' || ArrayIsArray(obj_facts) || obj_facts === null) {
1010
- return new TypeError('Expected "object" but received "' + typeof obj_facts + '" (at "' + path_facts + '")');
1011
- }
1012
- }
1013
- if (obj.id !== undefined) {
1014
- const obj_id = obj.id;
1015
- const path_id = path + '.id';
1016
- if (typeof obj_id !== 'string') {
1017
- return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1018
- }
1019
- }
1020
- const obj_insightFeedbackMetadata = obj.insightFeedbackMetadata;
1021
- const path_insightFeedbackMetadata = path + '.insightFeedbackMetadata';
1022
- const referencepath_insightFeedbackMetadataValidationError = validate$n(obj_insightFeedbackMetadata, path_insightFeedbackMetadata);
1023
- if (referencepath_insightFeedbackMetadataValidationError !== null) {
1024
- let message = 'Object doesn\'t match InsightFeedbackMetadata (at "' + path_insightFeedbackMetadata + '")\n';
1025
- message += referencepath_insightFeedbackMetadataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1026
- return new TypeError(message);
1027
- }
1028
- if (obj.markup !== undefined) {
1029
- const obj_markup = obj.markup;
1030
- const path_markup = path + '.markup';
1031
- if (typeof obj_markup !== 'string') {
1032
- return new TypeError('Expected "string" but received "' + typeof obj_markup + '" (at "' + path_markup + '")');
1033
- }
1034
- }
1035
- if (obj.question !== undefined) {
1036
- const obj_question = obj.question;
1037
- const path_question = path + '.question';
1038
- if (typeof obj_question !== 'string') {
1039
- return new TypeError('Expected "string" but received "' + typeof obj_question + '" (at "' + path_question + '")');
1040
- }
1041
- }
1042
- if (obj.score !== undefined) {
1043
- obj.score;
912
+ const ingest$3 = function GenerateInsightBatchResponseIngest(input, path, luvio, store, timestamp) {
913
+ if (process.env.NODE_ENV !== 'production') {
914
+ const validateError = validate$5(input);
915
+ if (validateError !== null) {
916
+ throw validateError;
1044
917
  }
1045
- if (obj.type !== undefined) {
1046
- const obj_type = obj.type;
1047
- const path_type = path + '.type';
1048
- if (typeof obj_type !== 'string') {
1049
- return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
1050
- }
918
+ }
919
+ const key = keyBuilderFromType$3(luvio, input);
920
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
921
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$3, "analytics-insights", VERSION$5, RepresentationType$3, equals$5);
922
+ return createLink(key);
923
+ };
924
+ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
925
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
926
+ const rootKey = keyBuilderFromType$3(luvio, input);
927
+ rootKeySet.set(rootKey, {
928
+ namespace: keyPrefix,
929
+ representationName: RepresentationType$3,
930
+ mergeable: false
931
+ });
932
+ }
933
+
934
+ function select$8(luvio, params) {
935
+ return select$9();
936
+ }
937
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
938
+ getTypeCacheKeys$3(storeKeyMap, luvio, response);
939
+ }
940
+ function ingestSuccess$3(luvio, resourceParams, response) {
941
+ const { body } = response;
942
+ const key = keyBuilderFromType$3(luvio, body);
943
+ luvio.storeIngest(key, ingest$3, body);
944
+ const snapshot = luvio.storeLookup({
945
+ recordId: key,
946
+ node: select$8(),
947
+ variables: {},
948
+ });
949
+ if (process.env.NODE_ENV !== 'production') {
950
+ if (snapshot.state !== 'Fulfilled') {
951
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1051
952
  }
1052
- if (obj.vegaLiteViz !== undefined) {
1053
- const obj_vegaLiteViz = obj.vegaLiteViz;
1054
- const path_vegaLiteViz = path + '.vegaLiteViz';
1055
- if (typeof obj_vegaLiteViz !== 'object' || ArrayIsArray(obj_vegaLiteViz) || obj_vegaLiteViz === null) {
1056
- return new TypeError('Expected "object" but received "' + typeof obj_vegaLiteViz + '" (at "' + path_vegaLiteViz + '")');
953
+ }
954
+ deepFreeze(snapshot.data);
955
+ return snapshot;
956
+ }
957
+ function createResourceRequest$3(config) {
958
+ const headers = {};
959
+ return {
960
+ baseUri: 'api.salesforce.com',
961
+ basePath: '/analytics/insights/v1/batches',
962
+ method: 'post',
963
+ body: config.body,
964
+ urlParams: {},
965
+ queryParams: {},
966
+ headers,
967
+ priority: 'normal',
968
+ };
969
+ }
970
+
971
+ const adapterName$3 = 'createInsightsBatch';
972
+ const createInsightsBatch_ConfigPropertyMetadata = [
973
+ generateParamConfigMetadata('batchInput', false, 2 /* Body */, 4 /* Unsupported */, true),
974
+ generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
975
+ ];
976
+ const createInsightsBatch_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createInsightsBatch_ConfigPropertyMetadata);
977
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(createInsightsBatch_ConfigPropertyMetadata);
978
+ function typeCheckConfig$3(untrustedConfig) {
979
+ const config = {};
980
+ const untrustedConfig_batchInput = untrustedConfig.batchInput;
981
+ if (ArrayIsArray$1(untrustedConfig_batchInput)) {
982
+ const untrustedConfig_batchInput_array = [];
983
+ for (let i = 0, arrayLength = untrustedConfig_batchInput.length; i < arrayLength; i++) {
984
+ const untrustedConfig_batchInput_item = untrustedConfig_batchInput[i];
985
+ const referenceBatchInputValidationError = validate$6(untrustedConfig_batchInput_item);
986
+ if (referenceBatchInputValidationError === null) {
987
+ untrustedConfig_batchInput_array.push(untrustedConfig_batchInput_item);
1057
988
  }
1058
989
  }
1059
- if (obj.version !== undefined) {
1060
- const obj_version = obj.version;
1061
- const path_version = path + '.version';
1062
- if (typeof obj_version !== 'number' || (typeof obj_version === 'number' && Math.floor(obj_version) !== obj_version)) {
1063
- return new TypeError('Expected "integer" but received "' + typeof obj_version + '" (at "' + path_version + '")');
1064
- }
990
+ config.batchInput = untrustedConfig_batchInput_array;
991
+ }
992
+ const untrustedConfig_options = untrustedConfig.options;
993
+ config.options = untrustedConfig_options;
994
+ return config;
995
+ }
996
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
997
+ if (!untrustedIsObject(untrustedConfig)) {
998
+ return null;
999
+ }
1000
+ if (process.env.NODE_ENV !== 'production') {
1001
+ validateConfig(untrustedConfig, configPropertyNames);
1002
+ }
1003
+ const config = typeCheckConfig$3(untrustedConfig);
1004
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1005
+ return null;
1006
+ }
1007
+ return config;
1008
+ }
1009
+ function buildNetworkSnapshot$3(luvio, config, options) {
1010
+ const resourceParams = createResourceParams$3(config);
1011
+ const request = createResourceRequest$3(resourceParams);
1012
+ return luvio.dispatchResourceRequest(request, options)
1013
+ .then((response) => {
1014
+ return luvio.handleSuccessResponse(() => {
1015
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
1016
+ return luvio.storeBroadcast().then(() => snapshot);
1017
+ }, () => {
1018
+ const cache = new StoreKeyMap();
1019
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1020
+ return cache;
1021
+ });
1022
+ }, (response) => {
1023
+ deepFreeze(response);
1024
+ throw response;
1025
+ });
1026
+ }
1027
+ const createInsightsBatchAdapterFactory = (luvio) => {
1028
+ return function createInsightsBatch(untrustedConfig) {
1029
+ const config = validateAdapterConfig$3(untrustedConfig, createInsightsBatch_ConfigPropertyNames);
1030
+ // Invalid or incomplete config
1031
+ if (config === null) {
1032
+ throw new Error('Invalid config for "createInsightsBatch"');
1033
+ }
1034
+ return buildNetworkSnapshot$3(luvio, config);
1035
+ };
1036
+ };
1037
+
1038
+ const VERSION$4 = "f898ff84f82ad0ca1eca0045e17ce492";
1039
+ function validate$4(obj, path = 'GetFilterValuesResponse_CategoricalValues') {
1040
+ const v_error = (() => {
1041
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1042
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1065
1043
  }
1066
- if (obj.viz !== undefined) {
1067
- const obj_viz = obj.viz;
1068
- const path_viz = path + '.viz';
1069
- if (typeof obj_viz !== 'object' || ArrayIsArray(obj_viz) || obj_viz === null) {
1070
- return new TypeError('Expected "object" but received "' + typeof obj_viz + '" (at "' + path_viz + '")');
1044
+ if (obj.values !== undefined) {
1045
+ const obj_values = obj.values;
1046
+ const path_values = path + '.values';
1047
+ if (!ArrayIsArray(obj_values)) {
1048
+ return new TypeError('Expected "array" but received "' + typeof obj_values + '" (at "' + path_values + '")');
1049
+ }
1050
+ for (let i = 0; i < obj_values.length; i++) {
1051
+ const obj_values_item = obj_values[i];
1052
+ const path_values_item = path_values + '[' + i + ']';
1053
+ let obj_values_item_union0 = null;
1054
+ const obj_values_item_union0_error = (() => {
1055
+ if (typeof obj_values_item !== 'string') {
1056
+ return new TypeError('Expected "string" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
1057
+ }
1058
+ })();
1059
+ if (obj_values_item_union0_error != null) {
1060
+ obj_values_item_union0 = obj_values_item_union0_error.message;
1061
+ }
1062
+ let obj_values_item_union1 = null;
1063
+ const obj_values_item_union1_error = (() => {
1064
+ if (typeof obj_values_item !== 'number') {
1065
+ return new TypeError('Expected "number" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
1066
+ }
1067
+ })();
1068
+ if (obj_values_item_union1_error != null) {
1069
+ obj_values_item_union1 = obj_values_item_union1_error.message;
1070
+ }
1071
+ let obj_values_item_union2 = null;
1072
+ const obj_values_item_union2_error = (() => {
1073
+ if (typeof obj_values_item !== 'boolean') {
1074
+ return new TypeError('Expected "boolean" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
1075
+ }
1076
+ })();
1077
+ if (obj_values_item_union2_error != null) {
1078
+ obj_values_item_union2 = obj_values_item_union2_error.message;
1079
+ }
1080
+ let obj_values_item_union3 = null;
1081
+ const obj_values_item_union3_error = (() => {
1082
+ if (obj_values_item !== null) {
1083
+ return new TypeError('Expected "null" but received "' + typeof obj_values_item + '" (at "' + path_values_item + '")');
1084
+ }
1085
+ })();
1086
+ if (obj_values_item_union3_error != null) {
1087
+ obj_values_item_union3 = obj_values_item_union3_error.message;
1088
+ }
1089
+ if (obj_values_item_union0 && obj_values_item_union1 && obj_values_item_union2 && obj_values_item_union3) {
1090
+ let message = 'Object doesn\'t match union (at "' + path_values_item + '")';
1091
+ message += '\n' + obj_values_item_union0.split('\n').map((line) => '\t' + line).join('\n');
1092
+ message += '\n' + obj_values_item_union1.split('\n').map((line) => '\t' + line).join('\n');
1093
+ message += '\n' + obj_values_item_union2.split('\n').map((line) => '\t' + line).join('\n');
1094
+ message += '\n' + obj_values_item_union3.split('\n').map((line) => '\t' + line).join('\n');
1095
+ return new TypeError(message);
1096
+ }
1071
1097
  }
1072
1098
  }
1073
1099
  })();
1074
1100
  return v_error === undefined ? null : v_error;
1075
1101
  }
1076
- const select$9 = function InsightSelect() {
1077
- const { selections: InsightFeedbackMetadata__selections, opaque: InsightFeedbackMetadata__opaque, } = select$a();
1102
+ const select$7 = function GetFilterValuesResponse_CategoricalValuesSelect() {
1078
1103
  return {
1079
1104
  kind: 'Fragment',
1080
- version: VERSION$7,
1105
+ version: VERSION$4,
1081
1106
  private: [],
1082
1107
  selections: [
1083
1108
  {
1084
- name: 'characterization',
1085
- kind: 'Scalar',
1086
- required: false
1087
- },
1088
- {
1089
- name: 'id',
1090
- kind: 'Scalar',
1091
- required: false
1092
- },
1093
- {
1094
- name: 'insightFeedbackMetadata',
1095
- kind: 'Object',
1096
- selections: InsightFeedbackMetadata__selections
1097
- },
1098
- {
1099
- name: 'markup',
1100
- kind: 'Scalar',
1101
- required: false
1102
- },
1103
- {
1104
- name: 'question',
1105
- kind: 'Scalar',
1106
- required: false
1107
- },
1108
- {
1109
- name: 'score',
1110
- kind: 'Scalar',
1111
- required: false
1112
- },
1113
- {
1114
- name: 'type',
1115
- kind: 'Scalar',
1116
- required: false
1117
- },
1118
- {
1119
- name: 'version',
1109
+ name: 'values',
1120
1110
  kind: 'Scalar',
1111
+ plural: true,
1121
1112
  required: false
1122
1113
  }
1123
1114
  ]
1124
1115
  };
1125
1116
  };
1126
- function equals$7(existing, incoming) {
1127
- const existing_version = existing.version;
1128
- const incoming_version = incoming.version;
1117
+ function equals$4(existing, incoming) {
1118
+ const existing_values = existing.values;
1119
+ const incoming_values = incoming.values;
1129
1120
  // if at least one of these optionals is defined
1130
- if (existing_version !== undefined || incoming_version !== undefined) {
1121
+ if (existing_values !== undefined || incoming_values !== undefined) {
1131
1122
  // if one of these is not defined we know the other is defined and therefore
1132
1123
  // not equal
1133
- if (existing_version === undefined || incoming_version === undefined) {
1124
+ if (existing_values === undefined || incoming_values === undefined) {
1134
1125
  return false;
1135
1126
  }
1136
- if (!(existing_version === incoming_version)) {
1127
+ const equals_values_items = equalsArray(existing_values, incoming_values, (existing_values_item, incoming_values_item) => {
1128
+ if (!(existing_values_item === incoming_values_item)) {
1129
+ return false;
1130
+ }
1131
+ });
1132
+ if (equals_values_items === false) {
1137
1133
  return false;
1138
1134
  }
1139
1135
  }
1140
- const existing_characterization = existing.characterization;
1141
- const incoming_characterization = incoming.characterization;
1142
- // if at least one of these optionals is defined
1143
- if (existing_characterization !== undefined || incoming_characterization !== undefined) {
1144
- // if one of these is not defined we know the other is defined and therefore
1145
- // not equal
1146
- if (existing_characterization === undefined || incoming_characterization === undefined) {
1147
- return false;
1148
- }
1149
- if (!(existing_characterization === incoming_characterization)) {
1150
- return false;
1136
+ return true;
1137
+ }
1138
+
1139
+ const VERSION$3 = "2025bbf393050a10fae76d5b4d5d0f58";
1140
+ function validate$3(obj, path = 'GetFilterValuesResponse') {
1141
+ const v_error = (() => {
1142
+ if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1143
+ return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1151
1144
  }
1152
- }
1153
- const existing_id = existing.id;
1154
- const incoming_id = incoming.id;
1155
- // if at least one of these optionals is defined
1156
- if (existing_id !== undefined || incoming_id !== undefined) {
1157
- // if one of these is not defined we know the other is defined and therefore
1158
- // not equal
1159
- if (existing_id === undefined || incoming_id === undefined) {
1160
- return false;
1145
+ const obj_categoricalValues = obj.categoricalValues;
1146
+ const path_categoricalValues = path + '.categoricalValues';
1147
+ const referencepath_categoricalValuesValidationError = validate$4(obj_categoricalValues, path_categoricalValues);
1148
+ if (referencepath_categoricalValuesValidationError !== null) {
1149
+ let message = 'Object doesn\'t match GetFilterValuesResponse_CategoricalValues (at "' + path_categoricalValues + '")\n';
1150
+ message += referencepath_categoricalValuesValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1151
+ return new TypeError(message);
1161
1152
  }
1162
- if (!(existing_id === incoming_id)) {
1163
- return false;
1153
+ const obj_id = obj.id;
1154
+ const path_id = path + '.id';
1155
+ if (typeof obj_id !== 'string') {
1156
+ return new TypeError('Expected "string" but received "' + typeof obj_id + '" (at "' + path_id + '")');
1164
1157
  }
1165
- }
1166
- const existing_markup = existing.markup;
1167
- const incoming_markup = incoming.markup;
1168
- // if at least one of these optionals is defined
1169
- if (existing_markup !== undefined || incoming_markup !== undefined) {
1170
- // if one of these is not defined we know the other is defined and therefore
1171
- // not equal
1172
- if (existing_markup === undefined || incoming_markup === undefined) {
1173
- return false;
1158
+ if (obj.nextPageToken !== undefined) {
1159
+ const obj_nextPageToken = obj.nextPageToken;
1160
+ const path_nextPageToken = path + '.nextPageToken';
1161
+ if (typeof obj_nextPageToken !== 'string') {
1162
+ return new TypeError('Expected "string" but received "' + typeof obj_nextPageToken + '" (at "' + path_nextPageToken + '")');
1163
+ }
1174
1164
  }
1175
- if (!(existing_markup === incoming_markup)) {
1176
- return false;
1177
- }
1178
- }
1179
- const existing_question = existing.question;
1180
- const incoming_question = incoming.question;
1181
- // if at least one of these optionals is defined
1182
- if (existing_question !== undefined || incoming_question !== undefined) {
1183
- // if one of these is not defined we know the other is defined and therefore
1184
- // not equal
1185
- if (existing_question === undefined || incoming_question === undefined) {
1186
- return false;
1187
- }
1188
- if (!(existing_question === incoming_question)) {
1189
- return false;
1190
- }
1191
- }
1192
- const existing_type = existing.type;
1193
- const incoming_type = incoming.type;
1194
- // if at least one of these optionals is defined
1195
- if (existing_type !== undefined || incoming_type !== undefined) {
1196
- // if one of these is not defined we know the other is defined and therefore
1197
- // not equal
1198
- if (existing_type === undefined || incoming_type === undefined) {
1199
- return false;
1200
- }
1201
- if (!(existing_type === incoming_type)) {
1202
- return false;
1203
- }
1204
- }
1205
- const existing_score = existing.score;
1206
- const incoming_score = incoming.score;
1207
- // if at least one of these optionals is defined
1208
- if (existing_score !== undefined || incoming_score !== undefined) {
1209
- // if one of these is not defined we know the other is defined and therefore
1210
- // not equal
1211
- if (existing_score === undefined || incoming_score === undefined) {
1212
- return false;
1213
- }
1214
- if (!(existing_score === incoming_score)) {
1215
- return false;
1216
- }
1217
- }
1218
- const existing_facts = existing.facts;
1219
- const incoming_facts = incoming.facts;
1220
- // if at least one of these optionals is defined
1221
- if (existing_facts !== undefined || incoming_facts !== undefined) {
1222
- // if one of these is not defined we know the other is defined and therefore
1223
- // not equal
1224
- if (existing_facts === undefined || incoming_facts === undefined) {
1225
- return false;
1226
- }
1227
- }
1228
- const existing_insightFeedbackMetadata = existing.insightFeedbackMetadata;
1229
- const incoming_insightFeedbackMetadata = incoming.insightFeedbackMetadata;
1230
- if (!(equals$8(existing_insightFeedbackMetadata, incoming_insightFeedbackMetadata))) {
1231
- return false;
1232
- }
1233
- const existing_vegaLiteViz = existing.vegaLiteViz;
1234
- const incoming_vegaLiteViz = incoming.vegaLiteViz;
1235
- // if at least one of these optionals is defined
1236
- if (existing_vegaLiteViz !== undefined || incoming_vegaLiteViz !== undefined) {
1237
- // if one of these is not defined we know the other is defined and therefore
1238
- // not equal
1239
- if (existing_vegaLiteViz === undefined || incoming_vegaLiteViz === undefined) {
1240
- return false;
1241
- }
1242
- }
1243
- const existing_viz = existing.viz;
1244
- const incoming_viz = incoming.viz;
1245
- // if at least one of these optionals is defined
1246
- if (existing_viz !== undefined || incoming_viz !== undefined) {
1247
- // if one of these is not defined we know the other is defined and therefore
1248
- // not equal
1249
- if (existing_viz === undefined || incoming_viz === undefined) {
1250
- return false;
1251
- }
1252
- }
1253
- return true;
1254
- }
1255
-
1256
- const VERSION$6 = "6707f0d0aa09112abbca1db5e32bb172";
1257
- function validate$l(obj, path = 'InsightResponse') {
1258
- const v_error = (() => {
1259
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1260
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1261
- }
1262
- if (obj.error !== undefined) {
1263
- const obj_error = obj.error;
1264
- const path_error = path + '.error';
1265
- const referencepath_errorValidationError = validate$w(obj_error, path_error);
1266
- if (referencepath_errorValidationError !== null) {
1267
- let message = 'Object doesn\'t match Error (at "' + path_error + '")\n';
1268
- message += referencepath_errorValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1269
- return new TypeError(message);
1270
- }
1271
- }
1272
- if (obj.insightType !== undefined) {
1273
- const obj_insightType = obj.insightType;
1274
- const path_insightType = path + '.insightType';
1275
- if (typeof obj_insightType !== 'string') {
1276
- return new TypeError('Expected "string" but received "' + typeof obj_insightType + '" (at "' + path_insightType + '")');
1277
- }
1278
- }
1279
- const obj_result = obj.result;
1280
- const path_result = path + '.result';
1281
- const referencepath_resultValidationError = validate$m(obj_result, path_result);
1282
- if (referencepath_resultValidationError !== null) {
1283
- let message = 'Object doesn\'t match Insight (at "' + path_result + '")\n';
1284
- message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1285
- return new TypeError(message);
1165
+ if (obj.totalAvailable !== undefined) {
1166
+ const obj_totalAvailable = obj.totalAvailable;
1167
+ const path_totalAvailable = path + '.totalAvailable';
1168
+ if (typeof obj_totalAvailable !== 'number' || (typeof obj_totalAvailable === 'number' && Math.floor(obj_totalAvailable) !== obj_totalAvailable)) {
1169
+ return new TypeError('Expected "integer" but received "' + typeof obj_totalAvailable + '" (at "' + path_totalAvailable + '")');
1170
+ }
1286
1171
  }
1287
1172
  })();
1288
1173
  return v_error === undefined ? null : v_error;
1289
1174
  }
1290
- const select$8 = function InsightResponseSelect() {
1291
- const { selections: Error__selections, opaque: Error__opaque, } = select$g();
1292
- const { selections: Insight__selections, opaque: Insight__opaque, } = select$9();
1175
+ const RepresentationType$2 = 'GetFilterValuesResponse';
1176
+ function keyBuilder$4(luvio, config) {
1177
+ return keyPrefix + '::' + RepresentationType$2 + ':' + config.filterpageid;
1178
+ }
1179
+ function keyBuilderFromType$2(luvio, object) {
1180
+ const keyParams = {
1181
+ filterpageid: object.id
1182
+ };
1183
+ return keyBuilder$4(luvio, keyParams);
1184
+ }
1185
+ function normalize$2(input, existing, path, luvio, store, timestamp) {
1186
+ return input;
1187
+ }
1188
+ const select$6 = function GetFilterValuesResponseSelect() {
1189
+ const { selections: GetFilterValuesResponse_CategoricalValues__selections, opaque: GetFilterValuesResponse_CategoricalValues__opaque, } = select$7();
1293
1190
  return {
1294
1191
  kind: 'Fragment',
1295
- version: VERSION$6,
1192
+ version: VERSION$3,
1296
1193
  private: [],
1297
1194
  selections: [
1298
1195
  {
1299
- name: 'error',
1196
+ name: 'categoricalValues',
1300
1197
  kind: 'Object',
1301
- selections: Error__selections,
1302
- required: false
1198
+ selections: GetFilterValuesResponse_CategoricalValues__selections
1199
+ },
1200
+ {
1201
+ name: 'id',
1202
+ kind: 'Scalar'
1303
1203
  },
1304
1204
  {
1305
- name: 'insightType',
1205
+ name: 'nextPageToken',
1306
1206
  kind: 'Scalar',
1307
1207
  required: false
1308
1208
  },
1309
1209
  {
1310
- name: 'result',
1311
- kind: 'Object',
1312
- selections: Insight__selections
1210
+ name: 'totalAvailable',
1211
+ kind: 'Scalar',
1212
+ required: false
1313
1213
  }
1314
1214
  ]
1315
1215
  };
1316
1216
  };
1317
- function equals$6(existing, incoming) {
1318
- const existing_insightType = existing.insightType;
1319
- const incoming_insightType = incoming.insightType;
1217
+ function equals$3(existing, incoming) {
1218
+ const existing_totalAvailable = existing.totalAvailable;
1219
+ const incoming_totalAvailable = incoming.totalAvailable;
1320
1220
  // if at least one of these optionals is defined
1321
- if (existing_insightType !== undefined || incoming_insightType !== undefined) {
1221
+ if (existing_totalAvailable !== undefined || incoming_totalAvailable !== undefined) {
1322
1222
  // if one of these is not defined we know the other is defined and therefore
1323
1223
  // not equal
1324
- if (existing_insightType === undefined || incoming_insightType === undefined) {
1224
+ if (existing_totalAvailable === undefined || incoming_totalAvailable === undefined) {
1325
1225
  return false;
1326
1226
  }
1327
- if (!(existing_insightType === incoming_insightType)) {
1227
+ if (!(existing_totalAvailable === incoming_totalAvailable)) {
1328
1228
  return false;
1329
1229
  }
1330
1230
  }
1331
- const existing_error = existing.error;
1332
- const incoming_error = incoming.error;
1231
+ const existing_id = existing.id;
1232
+ const incoming_id = incoming.id;
1233
+ if (!(existing_id === incoming_id)) {
1234
+ return false;
1235
+ }
1236
+ const existing_nextPageToken = existing.nextPageToken;
1237
+ const incoming_nextPageToken = incoming.nextPageToken;
1333
1238
  // if at least one of these optionals is defined
1334
- if (existing_error !== undefined || incoming_error !== undefined) {
1239
+ if (existing_nextPageToken !== undefined || incoming_nextPageToken !== undefined) {
1335
1240
  // if one of these is not defined we know the other is defined and therefore
1336
1241
  // not equal
1337
- if (existing_error === undefined || incoming_error === undefined) {
1242
+ if (existing_nextPageToken === undefined || incoming_nextPageToken === undefined) {
1338
1243
  return false;
1339
1244
  }
1340
- if (!(equals$c(existing_error, incoming_error))) {
1245
+ if (!(existing_nextPageToken === incoming_nextPageToken)) {
1341
1246
  return false;
1342
1247
  }
1343
1248
  }
1344
- const existing_result = existing.result;
1345
- const incoming_result = incoming.result;
1346
- if (!(equals$7(existing_result, incoming_result))) {
1249
+ const existing_categoricalValues = existing.categoricalValues;
1250
+ const incoming_categoricalValues = incoming.categoricalValues;
1251
+ if (!(equals$4(existing_categoricalValues, incoming_categoricalValues))) {
1347
1252
  return false;
1348
1253
  }
1349
1254
  return true;
1350
1255
  }
1351
-
1352
- const VERSION$5 = "9a4f5492d8e4788f172b90ac222f71c5";
1353
- function validate$k(obj, path = 'Overview') {
1354
- const v_error = (() => {
1355
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1356
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1357
- }
1358
- if (obj.vegaLiteViz !== undefined) {
1359
- const obj_vegaLiteViz = obj.vegaLiteViz;
1360
- const path_vegaLiteViz = path + '.vegaLiteViz';
1361
- if (typeof obj_vegaLiteViz !== 'object' || ArrayIsArray(obj_vegaLiteViz) || obj_vegaLiteViz === null) {
1362
- return new TypeError('Expected "object" but received "' + typeof obj_vegaLiteViz + '" (at "' + path_vegaLiteViz + '")');
1363
- }
1364
- }
1365
- if (obj.viz !== undefined) {
1366
- const obj_viz = obj.viz;
1367
- const path_viz = path + '.viz';
1368
- if (typeof obj_viz !== 'object' || ArrayIsArray(obj_viz) || obj_viz === null) {
1369
- return new TypeError('Expected "object" but received "' + typeof obj_viz + '" (at "' + path_viz + '")');
1370
- }
1371
- }
1372
- })();
1373
- return v_error === undefined ? null : v_error;
1374
- }
1375
- const select$7 = function OverviewSelect() {
1376
- return {
1377
- kind: 'Fragment',
1378
- version: VERSION$5,
1379
- private: [],
1380
- selections: []
1381
- };
1382
- };
1383
- function equals$5(existing, incoming) {
1384
- const existing_vegaLiteViz = existing.vegaLiteViz;
1385
- const incoming_vegaLiteViz = incoming.vegaLiteViz;
1386
- // if at least one of these optionals is defined
1387
- if (existing_vegaLiteViz !== undefined || incoming_vegaLiteViz !== undefined) {
1388
- // if one of these is not defined we know the other is defined and therefore
1389
- // not equal
1390
- if (existing_vegaLiteViz === undefined || incoming_vegaLiteViz === undefined) {
1391
- return false;
1392
- }
1393
- }
1394
- const existing_viz = existing.viz;
1395
- const incoming_viz = incoming.viz;
1396
- // if at least one of these optionals is defined
1397
- if (existing_viz !== undefined || incoming_viz !== undefined) {
1398
- // if one of these is not defined we know the other is defined and therefore
1399
- // not equal
1400
- if (existing_viz === undefined || incoming_viz === undefined) {
1401
- return false;
1256
+ const ingest$2 = function GetFilterValuesResponseIngest(input, path, luvio, store, timestamp) {
1257
+ if (process.env.NODE_ENV !== 'production') {
1258
+ const validateError = validate$3(input);
1259
+ if (validateError !== null) {
1260
+ throw validateError;
1402
1261
  }
1403
1262
  }
1404
- return true;
1263
+ const key = keyBuilderFromType$2(luvio, input);
1264
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
1265
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$2, "analytics-insights", VERSION$3, RepresentationType$2, equals$3);
1266
+ return createLink(key);
1267
+ };
1268
+ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
1269
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1270
+ const rootKey = keyBuilderFromType$2(luvio, input);
1271
+ rootKeySet.set(rootKey, {
1272
+ namespace: keyPrefix,
1273
+ representationName: RepresentationType$2,
1274
+ mergeable: false
1275
+ });
1405
1276
  }
1406
1277
 
1407
- const VERSION$4 = "ac3296a9832f46fda66420bc753d8c61";
1408
- function validate$j(obj, path = 'OverviewResponse') {
1409
- const v_error = (() => {
1410
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1411
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1412
- }
1413
- if (obj.error !== undefined) {
1414
- const obj_error = obj.error;
1415
- const path_error = path + '.error';
1416
- const referencepath_errorValidationError = validate$w(obj_error, path_error);
1417
- if (referencepath_errorValidationError !== null) {
1418
- let message = 'Object doesn\'t match Error (at "' + path_error + '")\n';
1419
- message += referencepath_errorValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1420
- return new TypeError(message);
1421
- }
1422
- }
1423
- const obj_result = obj.result;
1424
- const path_result = path + '.result';
1425
- const referencepath_resultValidationError = validate$k(obj_result, path_result);
1426
- if (referencepath_resultValidationError !== null) {
1427
- let message = 'Object doesn\'t match Overview (at "' + path_result + '")\n';
1428
- message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1429
- return new TypeError(message);
1278
+ function select$5(luvio, params) {
1279
+ return select$6();
1280
+ }
1281
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
1282
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
1283
+ }
1284
+ function ingestSuccess$2(luvio, resourceParams, response) {
1285
+ const { body } = response;
1286
+ const key = keyBuilderFromType$2(luvio, body);
1287
+ luvio.storeIngest(key, ingest$2, body);
1288
+ const snapshot = luvio.storeLookup({
1289
+ recordId: key,
1290
+ node: select$5(),
1291
+ variables: {},
1292
+ });
1293
+ if (process.env.NODE_ENV !== 'production') {
1294
+ if (snapshot.state !== 'Fulfilled') {
1295
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1430
1296
  }
1431
- })();
1432
- return v_error === undefined ? null : v_error;
1297
+ }
1298
+ deepFreeze(snapshot.data);
1299
+ return snapshot;
1433
1300
  }
1434
- const select$6 = function OverviewResponseSelect() {
1435
- const { selections: Error__selections, opaque: Error__opaque, } = select$g();
1436
- const { selections: Overview__selections, opaque: Overview__opaque, } = select$7();
1301
+ function createResourceRequest$2(config) {
1302
+ const headers = {};
1437
1303
  return {
1438
- kind: 'Fragment',
1439
- version: VERSION$4,
1440
- private: [],
1441
- selections: [
1442
- {
1443
- name: 'error',
1444
- kind: 'Object',
1445
- selections: Error__selections,
1446
- required: false
1447
- },
1448
- {
1449
- name: 'result',
1450
- kind: 'Object',
1451
- selections: Overview__selections
1452
- }
1453
- ]
1304
+ baseUri: 'api.salesforce.com',
1305
+ basePath: '/analytics/insights/v1/filterValues',
1306
+ method: 'post',
1307
+ body: config.body,
1308
+ urlParams: {},
1309
+ queryParams: {},
1310
+ headers,
1311
+ priority: 'normal',
1454
1312
  };
1455
- };
1456
- function equals$4(existing, incoming) {
1457
- const existing_error = existing.error;
1458
- const incoming_error = incoming.error;
1459
- // if at least one of these optionals is defined
1460
- if (existing_error !== undefined || incoming_error !== undefined) {
1461
- // if one of these is not defined we know the other is defined and therefore
1462
- // not equal
1463
- if (existing_error === undefined || incoming_error === undefined) {
1464
- return false;
1465
- }
1466
- if (!(equals$c(existing_error, incoming_error))) {
1467
- return false;
1468
- }
1469
- }
1470
- const existing_result = existing.result;
1471
- const incoming_result = incoming.result;
1472
- if (!(equals$5(existing_result, incoming_result))) {
1473
- return false;
1474
- }
1475
- return true;
1476
1313
  }
1477
1314
 
1478
- const VERSION$3 = "a70a5e68e786c3f38efb73cc0812d394";
1479
- function validate$i(obj, path = 'InsightGroup') {
1480
- const v_error = (() => {
1481
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1482
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1483
- }
1484
- if (obj.error !== undefined) {
1485
- const obj_error = obj.error;
1486
- const path_error = path + '.error';
1487
- const referencepath_errorValidationError = validate$w(obj_error, path_error);
1488
- if (referencepath_errorValidationError !== null) {
1489
- let message = 'Object doesn\'t match Error (at "' + path_error + '")\n';
1490
- message += referencepath_errorValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1491
- return new TypeError(message);
1492
- }
1493
- }
1494
- if (obj.insights !== undefined) {
1495
- const obj_insights = obj.insights;
1496
- const path_insights = path + '.insights';
1497
- if (!ArrayIsArray(obj_insights)) {
1498
- return new TypeError('Expected "array" but received "' + typeof obj_insights + '" (at "' + path_insights + '")');
1499
- }
1500
- for (let i = 0; i < obj_insights.length; i++) {
1501
- const obj_insights_item = obj_insights[i];
1502
- const path_insights_item = path_insights + '[' + i + ']';
1503
- const referencepath_insights_itemValidationError = validate$l(obj_insights_item, path_insights_item);
1504
- if (referencepath_insights_itemValidationError !== null) {
1505
- let message = 'Object doesn\'t match InsightResponse (at "' + path_insights_item + '")\n';
1506
- message += referencepath_insights_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1507
- return new TypeError(message);
1508
- }
1509
- }
1510
- }
1511
- if (obj.overviews !== undefined) {
1512
- const obj_overviews = obj.overviews;
1513
- const path_overviews = path + '.overviews';
1514
- if (!ArrayIsArray(obj_overviews)) {
1515
- return new TypeError('Expected "array" but received "' + typeof obj_overviews + '" (at "' + path_overviews + '")');
1516
- }
1517
- for (let i = 0; i < obj_overviews.length; i++) {
1518
- const obj_overviews_item = obj_overviews[i];
1519
- const path_overviews_item = path_overviews + '[' + i + ']';
1520
- const referencepath_overviews_itemValidationError = validate$j(obj_overviews_item, path_overviews_item);
1521
- if (referencepath_overviews_itemValidationError !== null) {
1522
- let message = 'Object doesn\'t match OverviewResponse (at "' + path_overviews_item + '")\n';
1523
- message += referencepath_overviews_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1524
- return new TypeError(message);
1525
- }
1526
- }
1527
- }
1528
- if (obj.type !== undefined) {
1529
- const obj_type = obj.type;
1530
- const path_type = path + '.type';
1531
- if (typeof obj_type !== 'string') {
1532
- return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
1533
- }
1534
- }
1535
- })();
1536
- return v_error === undefined ? null : v_error;
1537
- }
1538
- const select$5 = function InsightGroupSelect() {
1539
- const { selections: Error__selections, opaque: Error__opaque, } = select$g();
1540
- const { selections: InsightResponse__selections, opaque: InsightResponse__opaque, } = select$8();
1541
- const { selections: OverviewResponse__selections, opaque: OverviewResponse__opaque, } = select$6();
1542
- return {
1543
- kind: 'Fragment',
1544
- version: VERSION$3,
1545
- private: [],
1546
- selections: [
1547
- {
1548
- name: 'error',
1549
- kind: 'Object',
1550
- selections: Error__selections,
1551
- required: false
1552
- },
1553
- {
1554
- name: 'insights',
1555
- kind: 'Object',
1556
- plural: true,
1557
- selections: InsightResponse__selections,
1558
- required: false
1559
- },
1560
- {
1561
- name: 'overviews',
1562
- kind: 'Object',
1563
- plural: true,
1564
- selections: OverviewResponse__selections,
1565
- required: false
1566
- },
1567
- {
1568
- name: 'type',
1569
- kind: 'Scalar',
1570
- required: false
1571
- }
1572
- ]
1573
- };
1574
- };
1575
- function equals$3(existing, incoming) {
1576
- const existing_type = existing.type;
1577
- const incoming_type = incoming.type;
1578
- // if at least one of these optionals is defined
1579
- if (existing_type !== undefined || incoming_type !== undefined) {
1580
- // if one of these is not defined we know the other is defined and therefore
1581
- // not equal
1582
- if (existing_type === undefined || incoming_type === undefined) {
1583
- return false;
1584
- }
1585
- if (!(existing_type === incoming_type)) {
1586
- return false;
1587
- }
1588
- }
1589
- const existing_error = existing.error;
1590
- const incoming_error = incoming.error;
1591
- // if at least one of these optionals is defined
1592
- if (existing_error !== undefined || incoming_error !== undefined) {
1593
- // if one of these is not defined we know the other is defined and therefore
1594
- // not equal
1595
- if (existing_error === undefined || incoming_error === undefined) {
1596
- return false;
1597
- }
1598
- if (!(equals$c(existing_error, incoming_error))) {
1599
- return false;
1600
- }
1315
+ const adapterName$2 = 'getMetricFilterValues';
1316
+ const getMetricFilterValues_ConfigPropertyMetadata = [
1317
+ generateParamConfigMetadata('semanticDataModel', true, 2 /* Body */, 4 /* Unsupported */),
1318
+ generateParamConfigMetadata('field', true, 2 /* Body */, 4 /* Unsupported */),
1319
+ generateParamConfigMetadata('pageToken', false, 2 /* Body */, 0 /* String */),
1320
+ generateParamConfigMetadata('pageSize', false, 2 /* Body */, 3 /* Integer */),
1321
+ generateParamConfigMetadata('searchTerm', false, 2 /* Body */, 0 /* String */),
1322
+ generateParamConfigMetadata('filters', false, 2 /* Body */, 4 /* Unsupported */, true),
1323
+ ];
1324
+ const getMetricFilterValues_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getMetricFilterValues_ConfigPropertyMetadata);
1325
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(getMetricFilterValues_ConfigPropertyMetadata);
1326
+ function typeCheckConfig$2(untrustedConfig) {
1327
+ const config = {};
1328
+ typeCheckConfig$4(untrustedConfig, config, getMetricFilterValues_ConfigPropertyMetadata);
1329
+ const untrustedConfig_semanticDataModel = untrustedConfig.semanticDataModel;
1330
+ const referenceSemanticDataModelValidationError = validate$e(untrustedConfig_semanticDataModel);
1331
+ if (referenceSemanticDataModelValidationError === null) {
1332
+ config.semanticDataModel = untrustedConfig_semanticDataModel;
1601
1333
  }
1602
- const existing_insights = existing.insights;
1603
- const incoming_insights = incoming.insights;
1604
- // if at least one of these optionals is defined
1605
- if (existing_insights !== undefined || incoming_insights !== undefined) {
1606
- // if one of these is not defined we know the other is defined and therefore
1607
- // not equal
1608
- if (existing_insights === undefined || incoming_insights === undefined) {
1609
- return false;
1610
- }
1611
- const equals_insights_items = equalsArray(existing_insights, incoming_insights, (existing_insights_item, incoming_insights_item) => {
1612
- if (!(equals$6(existing_insights_item, incoming_insights_item))) {
1613
- return false;
1614
- }
1615
- });
1616
- if (equals_insights_items === false) {
1617
- return false;
1618
- }
1334
+ const untrustedConfig_field = untrustedConfig.field;
1335
+ const referenceFieldIdValidationError = validate$n(untrustedConfig_field);
1336
+ if (referenceFieldIdValidationError === null) {
1337
+ config.field = untrustedConfig_field;
1619
1338
  }
1620
- const existing_overviews = existing.overviews;
1621
- const incoming_overviews = incoming.overviews;
1622
- // if at least one of these optionals is defined
1623
- if (existing_overviews !== undefined || incoming_overviews !== undefined) {
1624
- // if one of these is not defined we know the other is defined and therefore
1625
- // not equal
1626
- if (existing_overviews === undefined || incoming_overviews === undefined) {
1627
- return false;
1628
- }
1629
- const equals_overviews_items = equalsArray(existing_overviews, incoming_overviews, (existing_overviews_item, incoming_overviews_item) => {
1630
- if (!(equals$4(existing_overviews_item, incoming_overviews_item))) {
1631
- return false;
1339
+ const untrustedConfig_filters = untrustedConfig.filters;
1340
+ if (ArrayIsArray$1(untrustedConfig_filters)) {
1341
+ const untrustedConfig_filters_array = [];
1342
+ for (let i = 0, arrayLength = untrustedConfig_filters.length; i < arrayLength; i++) {
1343
+ const untrustedConfig_filters_item = untrustedConfig_filters[i];
1344
+ const referenceFilterValidationError = validate$j(untrustedConfig_filters_item);
1345
+ if (referenceFilterValidationError === null) {
1346
+ untrustedConfig_filters_array.push(untrustedConfig_filters_item);
1632
1347
  }
1633
- });
1634
- if (equals_overviews_items === false) {
1635
- return false;
1636
1348
  }
1349
+ config.filters = untrustedConfig_filters_array;
1637
1350
  }
1638
- return true;
1639
- }
1640
-
1641
- const VERSION$2 = "ccf83d258110a04c1949592c91b69b3b";
1642
- function validate$h(obj, path = 'InsightBundle') {
1643
- const v_error = (() => {
1644
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1645
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1646
- }
1647
- if (obj.characterization !== undefined) {
1648
- const obj_characterization = obj.characterization;
1649
- const path_characterization = path + '.characterization';
1650
- if (typeof obj_characterization !== 'string') {
1651
- return new TypeError('Expected "string" but received "' + typeof obj_characterization + '" (at "' + path_characterization + '")');
1652
- }
1653
- }
1654
- if (obj.hasErrors !== undefined) {
1655
- const obj_hasErrors = obj.hasErrors;
1656
- const path_hasErrors = path + '.hasErrors';
1657
- if (typeof obj_hasErrors !== 'boolean') {
1658
- return new TypeError('Expected "boolean" but received "' + typeof obj_hasErrors + '" (at "' + path_hasErrors + '")');
1659
- }
1660
- }
1661
- if (obj.insightGroups !== undefined) {
1662
- const obj_insightGroups = obj.insightGroups;
1663
- const path_insightGroups = path + '.insightGroups';
1664
- if (!ArrayIsArray(obj_insightGroups)) {
1665
- return new TypeError('Expected "array" but received "' + typeof obj_insightGroups + '" (at "' + path_insightGroups + '")');
1666
- }
1667
- for (let i = 0; i < obj_insightGroups.length; i++) {
1668
- const obj_insightGroups_item = obj_insightGroups[i];
1669
- const path_insightGroups_item = path_insightGroups + '[' + i + ']';
1670
- const referencepath_insightGroups_itemValidationError = validate$i(obj_insightGroups_item, path_insightGroups_item);
1671
- if (referencepath_insightGroups_itemValidationError !== null) {
1672
- let message = 'Object doesn\'t match InsightGroup (at "' + path_insightGroups_item + '")\n';
1673
- message += referencepath_insightGroups_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1674
- return new TypeError(message);
1675
- }
1676
- }
1677
- }
1678
- })();
1679
- return v_error === undefined ? null : v_error;
1351
+ return config;
1680
1352
  }
1681
- const select$4 = function InsightBundleSelect() {
1682
- const { selections: InsightGroup__selections, opaque: InsightGroup__opaque, } = select$5();
1683
- return {
1684
- kind: 'Fragment',
1685
- version: VERSION$2,
1686
- private: [],
1687
- selections: [
1688
- {
1689
- name: 'characterization',
1690
- kind: 'Scalar',
1691
- required: false
1692
- },
1693
- {
1694
- name: 'hasErrors',
1695
- kind: 'Scalar',
1696
- required: false
1697
- },
1698
- {
1699
- name: 'insightGroups',
1700
- kind: 'Object',
1701
- plural: true,
1702
- selections: InsightGroup__selections,
1703
- required: false
1704
- }
1705
- ]
1706
- };
1707
- };
1708
- function equals$2(existing, incoming) {
1709
- const existing_hasErrors = existing.hasErrors;
1710
- const incoming_hasErrors = incoming.hasErrors;
1711
- // if at least one of these optionals is defined
1712
- if (existing_hasErrors !== undefined || incoming_hasErrors !== undefined) {
1713
- // if one of these is not defined we know the other is defined and therefore
1714
- // not equal
1715
- if (existing_hasErrors === undefined || incoming_hasErrors === undefined) {
1716
- return false;
1717
- }
1718
- if (!(existing_hasErrors === incoming_hasErrors)) {
1719
- return false;
1720
- }
1353
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1354
+ if (!untrustedIsObject(untrustedConfig)) {
1355
+ return null;
1721
1356
  }
1722
- const existing_characterization = existing.characterization;
1723
- const incoming_characterization = incoming.characterization;
1724
- // if at least one of these optionals is defined
1725
- if (existing_characterization !== undefined || incoming_characterization !== undefined) {
1726
- // if one of these is not defined we know the other is defined and therefore
1727
- // not equal
1728
- if (existing_characterization === undefined || incoming_characterization === undefined) {
1729
- return false;
1730
- }
1731
- if (!(existing_characterization === incoming_characterization)) {
1732
- return false;
1733
- }
1357
+ if (process.env.NODE_ENV !== 'production') {
1358
+ validateConfig(untrustedConfig, configPropertyNames);
1734
1359
  }
1735
- const existing_insightGroups = existing.insightGroups;
1736
- const incoming_insightGroups = incoming.insightGroups;
1737
- // if at least one of these optionals is defined
1738
- if (existing_insightGroups !== undefined || incoming_insightGroups !== undefined) {
1739
- // if one of these is not defined we know the other is defined and therefore
1740
- // not equal
1741
- if (existing_insightGroups === undefined || incoming_insightGroups === undefined) {
1742
- return false;
1743
- }
1744
- const equals_insightGroups_items = equalsArray(existing_insightGroups, incoming_insightGroups, (existing_insightGroups_item, incoming_insightGroups_item) => {
1745
- if (!(equals$3(existing_insightGroups_item, incoming_insightGroups_item))) {
1746
- return false;
1747
- }
1748
- });
1749
- if (equals_insightGroups_items === false) {
1750
- return false;
1751
- }
1360
+ const config = typeCheckConfig$2(untrustedConfig);
1361
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1362
+ return null;
1752
1363
  }
1753
- return true;
1754
- }
1755
-
1756
- const VERSION$1 = "8c719ff91e25e9ab6139733bd1b5c2bc";
1757
- function validate$g(obj, path = 'GetInsightBatchResponse') {
1758
- const v_error = (() => {
1759
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
1760
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1761
- }
1762
- const obj_batchId = obj.batchId;
1763
- const path_batchId = path + '.batchId';
1764
- if (typeof obj_batchId !== 'string') {
1765
- return new TypeError('Expected "string" but received "' + typeof obj_batchId + '" (at "' + path_batchId + '")');
1766
- }
1767
- if (obj.bundles !== undefined) {
1768
- const obj_bundles = obj.bundles;
1769
- const path_bundles = path + '.bundles';
1770
- if (!ArrayIsArray(obj_bundles)) {
1771
- return new TypeError('Expected "array" but received "' + typeof obj_bundles + '" (at "' + path_bundles + '")');
1772
- }
1773
- for (let i = 0; i < obj_bundles.length; i++) {
1774
- const obj_bundles_item = obj_bundles[i];
1775
- const path_bundles_item = path_bundles + '[' + i + ']';
1776
- const referencepath_bundles_itemValidationError = validate$h(obj_bundles_item, path_bundles_item);
1777
- if (referencepath_bundles_itemValidationError !== null) {
1778
- let message = 'Object doesn\'t match InsightBundle (at "' + path_bundles_item + '")\n';
1779
- message += referencepath_bundles_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1780
- return new TypeError(message);
1781
- }
1782
- }
1783
- }
1784
- if (obj.hasErrors !== undefined) {
1785
- const obj_hasErrors = obj.hasErrors;
1786
- const path_hasErrors = path + '.hasErrors';
1787
- if (typeof obj_hasErrors !== 'boolean') {
1788
- return new TypeError('Expected "boolean" but received "' + typeof obj_hasErrors + '" (at "' + path_hasErrors + '")');
1789
- }
1790
- }
1791
- if (obj.summary !== undefined) {
1792
- const obj_summary = obj.summary;
1793
- const path_summary = path + '.summary';
1794
- if (obj_summary === undefined) {
1795
- return new TypeError('Expected "defined" but received "' + typeof obj_summary + '" (at "' + path_summary + '")');
1796
- }
1797
- }
1798
- })();
1799
- return v_error === undefined ? null : v_error;
1800
- }
1801
- const RepresentationType$1 = 'GetInsightBatchResponse';
1802
- function keyBuilder$3(luvio, config) {
1803
- return keyPrefix + '::' + RepresentationType$1 + ':' + config.batchid;
1804
- }
1805
- function keyBuilderFromType$1(luvio, object) {
1806
- const keyParams = {
1807
- batchid: object.batchId
1808
- };
1809
- return keyBuilder$3(luvio, keyParams);
1810
- }
1811
- function normalize$1(input, existing, path, luvio, store, timestamp) {
1812
- return input;
1364
+ return config;
1813
1365
  }
1814
- const select$3 = function GetInsightBatchResponseSelect() {
1815
- const { selections: InsightBundle__selections, opaque: InsightBundle__opaque, } = select$4();
1816
- return {
1817
- kind: 'Fragment',
1818
- version: VERSION$1,
1819
- private: [],
1820
- selections: [
1821
- {
1822
- name: 'batchId',
1823
- kind: 'Scalar'
1824
- },
1825
- {
1826
- name: 'bundles',
1827
- kind: 'Object',
1828
- plural: true,
1829
- selections: InsightBundle__selections,
1830
- required: false
1831
- },
1832
- {
1833
- name: 'hasErrors',
1834
- kind: 'Scalar',
1835
- required: false
1836
- },
1837
- {
1838
- name: 'summary',
1839
- kind: 'Object',
1840
- // any
1841
- }
1842
- ]
1843
- };
1844
- };
1845
- function equals$1(existing, incoming) {
1846
- const existing_hasErrors = existing.hasErrors;
1847
- const incoming_hasErrors = incoming.hasErrors;
1848
- // if at least one of these optionals is defined
1849
- if (existing_hasErrors !== undefined || incoming_hasErrors !== undefined) {
1850
- // if one of these is not defined we know the other is defined and therefore
1851
- // not equal
1852
- if (existing_hasErrors === undefined || incoming_hasErrors === undefined) {
1853
- return false;
1854
- }
1855
- if (!(existing_hasErrors === incoming_hasErrors)) {
1856
- return false;
1857
- }
1858
- }
1859
- const existing_batchId = existing.batchId;
1860
- const incoming_batchId = incoming.batchId;
1861
- if (!(existing_batchId === incoming_batchId)) {
1862
- return false;
1863
- }
1864
- const existing_bundles = existing.bundles;
1865
- const incoming_bundles = incoming.bundles;
1866
- // if at least one of these optionals is defined
1867
- if (existing_bundles !== undefined || incoming_bundles !== undefined) {
1868
- // if one of these is not defined we know the other is defined and therefore
1869
- // not equal
1870
- if (existing_bundles === undefined || incoming_bundles === undefined) {
1871
- return false;
1872
- }
1873
- const equals_bundles_items = equalsArray(existing_bundles, incoming_bundles, (existing_bundles_item, incoming_bundles_item) => {
1874
- if (!(equals$2(existing_bundles_item, incoming_bundles_item))) {
1875
- return false;
1876
- }
1877
- });
1878
- if (equals_bundles_items === false) {
1879
- return false;
1880
- }
1881
- }
1882
- const existing_summary = existing.summary;
1883
- const incoming_summary = incoming.summary;
1884
- // if at least one of these optionals is defined
1885
- if (existing_summary !== undefined || incoming_summary !== undefined) {
1886
- // if one of these is not defined we know the other is defined and therefore
1887
- // not equal
1888
- if (existing_summary === undefined || incoming_summary === undefined) {
1889
- return false;
1890
- }
1891
- if (JSONStringify(incoming_summary) !== JSONStringify(existing_summary)) {
1892
- return false;
1893
- }
1894
- }
1895
- return true;
1896
- }
1897
- const ingest$1 = function GetInsightBatchResponseIngest(input, path, luvio, store, timestamp) {
1898
- if (process.env.NODE_ENV !== 'production') {
1899
- const validateError = validate$g(input);
1900
- if (validateError !== null) {
1901
- throw validateError;
1902
- }
1903
- }
1904
- const key = keyBuilderFromType$1(luvio, input);
1905
- const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
1906
- ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "analytics-insights", VERSION$1, RepresentationType$1, equals$1);
1907
- return createLink(key);
1908
- };
1909
- function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
1910
- // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1911
- const rootKey = keyBuilderFromType$1(luvio, input);
1912
- rootKeySet.set(rootKey, {
1913
- namespace: keyPrefix,
1914
- representationName: RepresentationType$1,
1915
- mergeable: false
1916
- });
1917
- }
1918
-
1919
- function select$2(luvio, params) {
1920
- return select$3();
1921
- }
1922
- function keyBuilder$2(luvio, params) {
1923
- return keyBuilder$3(luvio, {
1924
- batchid: params.urlParams.batch_id
1925
- });
1926
- }
1927
- function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
1928
- getTypeCacheKeys$1(storeKeyMap, luvio, response);
1929
- }
1930
- function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
1931
- const { body } = response;
1932
- const key = keyBuilder$2(luvio, resourceParams);
1933
- luvio.storeIngest(key, ingest$1, body);
1934
- const snapshot = luvio.storeLookup({
1935
- recordId: key,
1936
- node: select$2(),
1937
- variables: {},
1938
- }, snapshotRefresh);
1939
- if (process.env.NODE_ENV !== 'production') {
1940
- if (snapshot.state !== 'Fulfilled') {
1941
- throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
1942
- }
1943
- }
1944
- deepFreeze(snapshot.data);
1945
- return snapshot;
1946
- }
1947
- function ingestError(luvio, params, error, snapshotRefresh) {
1948
- const key = keyBuilder$2(luvio, params);
1949
- const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1950
- luvio.storeIngestError(key, errorSnapshot);
1951
- return errorSnapshot;
1952
- }
1953
- function createResourceRequest$1(config) {
1954
- const headers = {};
1955
- return {
1956
- baseUri: 'api.salesforce.com',
1957
- basePath: '/analytics/tua-insights-service/v1/batches/' + config.urlParams.batch_id + '',
1958
- method: 'get',
1959
- body: null,
1960
- urlParams: config.urlParams,
1961
- queryParams: {},
1962
- headers,
1963
- priority: 'normal',
1964
- };
1965
- }
1966
-
1967
- const adapterName$1 = 'getInsightsBatch';
1968
- const getInsightsBatch_ConfigPropertyMetadata = [
1969
- generateParamConfigMetadata('batch_id', true, 0 /* UrlParameter */, 0 /* String */),
1970
- ];
1971
- const getInsightsBatch_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getInsightsBatch_ConfigPropertyMetadata);
1972
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(getInsightsBatch_ConfigPropertyMetadata);
1973
- function keyBuilder$1(luvio, config) {
1974
- const resourceParams = createResourceParams$1(config);
1975
- return keyBuilder$2(luvio, resourceParams);
1976
- }
1977
- function typeCheckConfig$1(untrustedConfig) {
1978
- const config = {};
1979
- typeCheckConfig$4(untrustedConfig, config, getInsightsBatch_ConfigPropertyMetadata);
1980
- return config;
1981
- }
1982
- function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1983
- if (!untrustedIsObject(untrustedConfig)) {
1984
- return null;
1985
- }
1986
- if (process.env.NODE_ENV !== 'production') {
1987
- validateConfig(untrustedConfig, configPropertyNames);
1988
- }
1989
- const config = typeCheckConfig$1(untrustedConfig);
1990
- if (!areRequiredParametersPresent(config, configPropertyNames)) {
1991
- return null;
1992
- }
1993
- return config;
1994
- }
1995
- function adapterFragment(luvio, config) {
1996
- createResourceParams$1(config);
1997
- return select$2();
1998
- }
1999
- function onFetchResponseSuccess(luvio, config, resourceParams, response) {
2000
- const snapshot = ingestSuccess$1(luvio, resourceParams, response, {
2001
- config,
2002
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
2003
- });
2004
- return luvio.storeBroadcast().then(() => snapshot);
2005
- }
2006
- function onFetchResponseError(luvio, config, resourceParams, response) {
2007
- const snapshot = ingestError(luvio, resourceParams, response, {
2008
- config,
2009
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
2010
- });
2011
- return luvio.storeBroadcast().then(() => snapshot);
2012
- }
2013
- function buildNetworkSnapshot$1(luvio, config, options) {
2014
- const resourceParams = createResourceParams$1(config);
2015
- const request = createResourceRequest$1(resourceParams);
1366
+ function buildNetworkSnapshot$2(luvio, config, options) {
1367
+ const resourceParams = createResourceParams$2(config);
1368
+ const request = createResourceRequest$2(resourceParams);
2016
1369
  return luvio.dispatchResourceRequest(request, options)
2017
1370
  .then((response) => {
2018
- return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
1371
+ return luvio.handleSuccessResponse(() => {
1372
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
1373
+ return luvio.storeBroadcast().then(() => snapshot);
1374
+ }, () => {
2019
1375
  const cache = new StoreKeyMap();
2020
- getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
1376
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
2021
1377
  return cache;
2022
1378
  });
2023
- }, (response) => {
2024
- return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
2025
- });
2026
- }
2027
- function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
2028
- return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot$1, undefined, false);
2029
- }
2030
- function buildCachedSnapshotCachePolicy(context, storeLookup) {
2031
- const { luvio, config } = context;
2032
- const selector = {
2033
- recordId: keyBuilder$1(luvio, config),
2034
- node: adapterFragment(luvio, config),
2035
- variables: {},
2036
- };
2037
- const cacheSnapshot = storeLookup(selector, {
2038
- config,
2039
- resolve: () => buildNetworkSnapshot$1(luvio, config, snapshotRefreshOptions)
2040
- });
2041
- return cacheSnapshot;
2042
- }
2043
- const getInsightsBatchAdapterFactory = (luvio) => function analyticsInsights__getInsightsBatch(untrustedConfig, requestContext) {
2044
- const config = validateAdapterConfig$1(untrustedConfig, getInsightsBatch_ConfigPropertyNames);
2045
- // Invalid or incomplete config
2046
- if (config === null) {
2047
- return null;
2048
- }
2049
- return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2050
- buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
2051
- };
2052
-
2053
- function validate$f(obj, path = 'MetricMetadata') {
2054
- const v_error = (() => {
2055
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2056
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2057
- }
2058
- if (obj.definitionId !== undefined) {
2059
- const obj_definitionId = obj.definitionId;
2060
- const path_definitionId = path + '.definitionId';
2061
- if (typeof obj_definitionId !== 'string') {
2062
- return new TypeError('Expected "string" but received "' + typeof obj_definitionId + '" (at "' + path_definitionId + '")');
2063
- }
2064
- }
2065
- if (obj.name !== undefined) {
2066
- const obj_name = obj.name;
2067
- const path_name = path + '.name';
2068
- if (typeof obj_name !== 'string') {
2069
- return new TypeError('Expected "string" but received "' + typeof obj_name + '" (at "' + path_name + '")');
2070
- }
2071
- }
2072
- })();
2073
- return v_error === undefined ? null : v_error;
2074
- }
2075
-
2076
- function validate$e(obj, path = 'ExtensionOptions') {
2077
- const v_error = (() => {
2078
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2079
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2080
- }
2081
- if (obj.analysisDimensions !== undefined) {
2082
- const obj_analysisDimensions = obj.analysisDimensions;
2083
- const path_analysisDimensions = path + '.analysisDimensions';
2084
- if (!ArrayIsArray(obj_analysisDimensions)) {
2085
- return new TypeError('Expected "array" but received "' + typeof obj_analysisDimensions + '" (at "' + path_analysisDimensions + '")');
2086
- }
2087
- for (let i = 0; i < obj_analysisDimensions.length; i++) {
2088
- const obj_analysisDimensions_item = obj_analysisDimensions[i];
2089
- const path_analysisDimensions_item = path_analysisDimensions + '[' + i + ']';
2090
- if (typeof obj_analysisDimensions_item !== 'string') {
2091
- return new TypeError('Expected "string" but received "' + typeof obj_analysisDimensions_item + '" (at "' + path_analysisDimensions_item + '")');
2092
- }
2093
- }
2094
- }
2095
- if (obj.minimumGranularity !== undefined) {
2096
- const obj_minimumGranularity = obj.minimumGranularity;
2097
- const path_minimumGranularity = path + '.minimumGranularity';
2098
- if (typeof obj_minimumGranularity !== 'string') {
2099
- return new TypeError('Expected "string" but received "' + typeof obj_minimumGranularity + '" (at "' + path_minimumGranularity + '")');
2100
- }
2101
- }
2102
- })();
2103
- return v_error === undefined ? null : v_error;
2104
- }
2105
-
2106
- function validate$d(obj, path = 'InsightsOptions_InsightSetting') {
2107
- const v_error = (() => {
2108
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2109
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2110
- }
2111
- if (obj.disabled !== undefined) {
2112
- const obj_disabled = obj.disabled;
2113
- const path_disabled = path + '.disabled';
2114
- if (typeof obj_disabled !== 'boolean') {
2115
- return new TypeError('Expected "boolean" but received "' + typeof obj_disabled + '" (at "' + path_disabled + '")');
2116
- }
2117
- }
2118
- if (obj.type !== undefined) {
2119
- const obj_type = obj.type;
2120
- const path_type = path + '.type';
2121
- if (typeof obj_type !== 'string') {
2122
- return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
2123
- }
2124
- }
2125
- })();
2126
- return v_error === undefined ? null : v_error;
2127
- }
2128
-
2129
- function validate$c(obj, path = 'InsightsOptions') {
2130
- const v_error = (() => {
2131
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2132
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2133
- }
2134
- if (obj.settings !== undefined) {
2135
- const obj_settings = obj.settings;
2136
- const path_settings = path + '.settings';
2137
- if (!ArrayIsArray(obj_settings)) {
2138
- return new TypeError('Expected "array" but received "' + typeof obj_settings + '" (at "' + path_settings + '")');
2139
- }
2140
- for (let i = 0; i < obj_settings.length; i++) {
2141
- const obj_settings_item = obj_settings[i];
2142
- const path_settings_item = path_settings + '[' + i + ']';
2143
- const referencepath_settings_itemValidationError = validate$d(obj_settings_item, path_settings_item);
2144
- if (referencepath_settings_itemValidationError !== null) {
2145
- let message = 'Object doesn\'t match InsightsOptions_InsightSetting (at "' + path_settings_item + '")\n';
2146
- message += referencepath_settings_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2147
- return new TypeError(message);
2148
- }
2149
- }
2150
- }
2151
- })();
2152
- return v_error === undefined ? null : v_error;
2153
- }
2154
-
2155
- function validate$b(obj, path = 'MeasurementPeriod') {
2156
- const v_error = (() => {
2157
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2158
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2159
- }
2160
- if (obj.end !== undefined) {
2161
- const obj_end = obj.end;
2162
- const path_end = path + '.end';
2163
- if (typeof obj_end !== 'string') {
2164
- return new TypeError('Expected "string" but received "' + typeof obj_end + '" (at "' + path_end + '")');
2165
- }
2166
- }
2167
- if (obj.granularity !== undefined) {
2168
- const obj_granularity = obj.granularity;
2169
- const path_granularity = path + '.granularity';
2170
- if (typeof obj_granularity !== 'string') {
2171
- return new TypeError('Expected "string" but received "' + typeof obj_granularity + '" (at "' + path_granularity + '")');
2172
- }
2173
- }
2174
- if (obj.range !== undefined) {
2175
- const obj_range = obj.range;
2176
- const path_range = path + '.range';
2177
- if (typeof obj_range !== 'string') {
2178
- return new TypeError('Expected "string" but received "' + typeof obj_range + '" (at "' + path_range + '")');
2179
- }
2180
- }
2181
- if (obj.start !== undefined) {
2182
- const obj_start = obj.start;
2183
- const path_start = path + '.start';
2184
- if (typeof obj_start !== 'string') {
2185
- return new TypeError('Expected "string" but received "' + typeof obj_start + '" (at "' + path_start + '")');
2186
- }
2187
- }
2188
- })();
2189
- return v_error === undefined ? null : v_error;
2190
- }
2191
-
2192
- function validate$a(obj, path = 'MetricInstance') {
2193
- const v_error = (() => {
2194
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2195
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2196
- }
2197
- if (obj.filters !== undefined) {
2198
- const obj_filters = obj.filters;
2199
- const path_filters = path + '.filters';
2200
- if (!ArrayIsArray(obj_filters)) {
2201
- return new TypeError('Expected "array" but received "' + typeof obj_filters + '" (at "' + path_filters + '")');
2202
- }
2203
- for (let i = 0; i < obj_filters.length; i++) {
2204
- const obj_filters_item = obj_filters[i];
2205
- const path_filters_item = path_filters + '[' + i + ']';
2206
- const referencepath_filters_itemValidationError = validate$q(obj_filters_item, path_filters_item);
2207
- if (referencepath_filters_itemValidationError !== null) {
2208
- let message = 'Object doesn\'t match Filter (at "' + path_filters_item + '")\n';
2209
- message += referencepath_filters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2210
- return new TypeError(message);
2211
- }
2212
- }
2213
- }
2214
- const obj_measurementPeriod = obj.measurementPeriod;
2215
- const path_measurementPeriod = path + '.measurementPeriod';
2216
- const referencepath_measurementPeriodValidationError = validate$b(obj_measurementPeriod, path_measurementPeriod);
2217
- if (referencepath_measurementPeriodValidationError !== null) {
2218
- let message = 'Object doesn\'t match MeasurementPeriod (at "' + path_measurementPeriod + '")\n';
2219
- message += referencepath_measurementPeriodValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2220
- return new TypeError(message);
2221
- }
2222
- })();
2223
- return v_error === undefined ? null : v_error;
2224
- }
2225
-
2226
- function validate$9(obj, path = 'CompareConfig') {
2227
- const v_error = (() => {
2228
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2229
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2230
- }
2231
- if (obj.comparison !== undefined) {
2232
- const obj_comparison = obj.comparison;
2233
- const path_comparison = path + '.comparison';
2234
- if (typeof obj_comparison !== 'string') {
2235
- return new TypeError('Expected "string" but received "' + typeof obj_comparison + '" (at "' + path_comparison + '")');
2236
- }
2237
- }
2238
- })();
2239
- return v_error === undefined ? null : v_error;
2240
- }
2241
-
2242
- function validate$8(obj, path = 'Measure') {
2243
- const v_error = (() => {
2244
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2245
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2246
- }
2247
- if (obj.aggregation !== undefined) {
2248
- const obj_aggregation = obj.aggregation;
2249
- const path_aggregation = path + '.aggregation';
2250
- if (typeof obj_aggregation !== 'string') {
2251
- return new TypeError('Expected "string" but received "' + typeof obj_aggregation + '" (at "' + path_aggregation + '")');
2252
- }
2253
- }
2254
- const obj_semanticField = obj.semanticField;
2255
- const path_semanticField = path + '.semanticField';
2256
- const referencepath_semanticFieldValidationError = validate$s(obj_semanticField, path_semanticField);
2257
- if (referencepath_semanticFieldValidationError !== null) {
2258
- let message = 'Object doesn\'t match SemanticField (at "' + path_semanticField + '")\n';
2259
- message += referencepath_semanticFieldValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2260
- return new TypeError(message);
2261
- }
2262
- const obj_tableField = obj.tableField;
2263
- const path_tableField = path + '.tableField';
2264
- const referencepath_tableFieldValidationError = validate$t(obj_tableField, path_tableField);
2265
- if (referencepath_tableFieldValidationError !== null) {
2266
- let message = 'Object doesn\'t match TableField (at "' + path_tableField + '")\n';
2267
- message += referencepath_tableFieldValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2268
- return new TypeError(message);
2269
- }
2270
- })();
2271
- return v_error === undefined ? null : v_error;
2272
- }
2273
-
2274
- function validate$7(obj, path = 'TimeDimension') {
2275
- const v_error = (() => {
2276
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2277
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2278
- }
2279
- const obj_semanticField = obj.semanticField;
2280
- const path_semanticField = path + '.semanticField';
2281
- const referencepath_semanticFieldValidationError = validate$s(obj_semanticField, path_semanticField);
2282
- if (referencepath_semanticFieldValidationError !== null) {
2283
- let message = 'Object doesn\'t match SemanticField (at "' + path_semanticField + '")\n';
2284
- message += referencepath_semanticFieldValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2285
- return new TypeError(message);
2286
- }
2287
- const obj_tableField = obj.tableField;
2288
- const path_tableField = path + '.tableField';
2289
- const referencepath_tableFieldValidationError = validate$t(obj_tableField, path_tableField);
2290
- if (referencepath_tableFieldValidationError !== null) {
2291
- let message = 'Object doesn\'t match TableField (at "' + path_tableField + '")\n';
2292
- message += referencepath_tableFieldValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2293
- return new TypeError(message);
2294
- }
2295
- })();
2296
- return v_error === undefined ? null : v_error;
2297
- }
2298
-
2299
- function validate$6(obj, path = 'MetricDefinition') {
2300
- const v_error = (() => {
2301
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2302
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2303
- }
2304
- const obj_comparison = obj.comparison;
2305
- const path_comparison = path + '.comparison';
2306
- const referencepath_comparisonValidationError = validate$9(obj_comparison, path_comparison);
2307
- if (referencepath_comparisonValidationError !== null) {
2308
- let message = 'Object doesn\'t match CompareConfig (at "' + path_comparison + '")\n';
2309
- message += referencepath_comparisonValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2310
- return new TypeError(message);
2311
- }
2312
- if (obj.filters !== undefined) {
2313
- const obj_filters = obj.filters;
2314
- const path_filters = path + '.filters';
2315
- if (!ArrayIsArray(obj_filters)) {
2316
- return new TypeError('Expected "array" but received "' + typeof obj_filters + '" (at "' + path_filters + '")');
2317
- }
2318
- for (let i = 0; i < obj_filters.length; i++) {
2319
- const obj_filters_item = obj_filters[i];
2320
- const path_filters_item = path_filters + '[' + i + ']';
2321
- const referencepath_filters_itemValidationError = validate$q(obj_filters_item, path_filters_item);
2322
- if (referencepath_filters_itemValidationError !== null) {
2323
- let message = 'Object doesn\'t match Filter (at "' + path_filters_item + '")\n';
2324
- message += referencepath_filters_itemValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2325
- return new TypeError(message);
2326
- }
2327
- }
2328
- }
2329
- const obj_measure = obj.measure;
2330
- const path_measure = path + '.measure';
2331
- const referencepath_measureValidationError = validate$8(obj_measure, path_measure);
2332
- if (referencepath_measureValidationError !== null) {
2333
- let message = 'Object doesn\'t match Measure (at "' + path_measure + '")\n';
2334
- message += referencepath_measureValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2335
- return new TypeError(message);
2336
- }
2337
- if (obj.runningTotal !== undefined) {
2338
- const obj_runningTotal = obj.runningTotal;
2339
- const path_runningTotal = path + '.runningTotal';
2340
- if (typeof obj_runningTotal !== 'boolean') {
2341
- return new TypeError('Expected "boolean" but received "' + typeof obj_runningTotal + '" (at "' + path_runningTotal + '")');
2342
- }
2343
- }
2344
- const obj_semanticDataModel = obj.semanticDataModel;
2345
- const path_semanticDataModel = path + '.semanticDataModel';
2346
- const referencepath_semanticDataModelValidationError = validate$u(obj_semanticDataModel, path_semanticDataModel);
2347
- if (referencepath_semanticDataModelValidationError !== null) {
2348
- let message = 'Object doesn\'t match SemanticDataModel (at "' + path_semanticDataModel + '")\n';
2349
- message += referencepath_semanticDataModelValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2350
- return new TypeError(message);
2351
- }
2352
- const obj_timeDimension = obj.timeDimension;
2353
- const path_timeDimension = path + '.timeDimension';
2354
- const referencepath_timeDimensionValidationError = validate$7(obj_timeDimension, path_timeDimension);
2355
- if (referencepath_timeDimensionValidationError !== null) {
2356
- let message = 'Object doesn\'t match TimeDimension (at "' + path_timeDimension + '")\n';
2357
- message += referencepath_timeDimensionValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2358
- return new TypeError(message);
2359
- }
2360
- })();
2361
- return v_error === undefined ? null : v_error;
1379
+ }, (response) => {
1380
+ deepFreeze(response);
1381
+ throw response;
1382
+ });
2362
1383
  }
1384
+ const getMetricFilterValuesAdapterFactory = (luvio) => {
1385
+ return function getMetricFilterValues(untrustedConfig) {
1386
+ const config = validateAdapterConfig$2(untrustedConfig, getMetricFilterValues_ConfigPropertyNames);
1387
+ // Invalid or incomplete config
1388
+ if (config === null) {
1389
+ throw new Error('Invalid config for "getMetricFilterValues"');
1390
+ }
1391
+ return buildNetworkSnapshot$2(luvio, config);
1392
+ };
1393
+ };
2363
1394
 
2364
- function validate$5(obj, path = 'RepresentationOptions_NumberUnits') {
1395
+ const VERSION$2 = "07a8c889542dbad6f958515513d4e3fb";
1396
+ function validate$2(obj, path = 'Error') {
2365
1397
  const v_error = (() => {
2366
1398
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2367
1399
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2368
1400
  }
2369
- if (obj.pluralNoun !== undefined) {
2370
- const obj_pluralNoun = obj.pluralNoun;
2371
- const path_pluralNoun = path + '.pluralNoun';
2372
- if (typeof obj_pluralNoun !== 'string') {
2373
- return new TypeError('Expected "string" but received "' + typeof obj_pluralNoun + '" (at "' + path_pluralNoun + '")');
1401
+ if (obj.code !== undefined) {
1402
+ const obj_code = obj.code;
1403
+ const path_code = path + '.code';
1404
+ if (typeof obj_code !== 'string') {
1405
+ return new TypeError('Expected "string" but received "' + typeof obj_code + '" (at "' + path_code + '")');
2374
1406
  }
2375
1407
  }
2376
- if (obj.singularNoun !== undefined) {
2377
- const obj_singularNoun = obj.singularNoun;
2378
- const path_singularNoun = path + '.singularNoun';
2379
- if (typeof obj_singularNoun !== 'string') {
2380
- return new TypeError('Expected "string" but received "' + typeof obj_singularNoun + '" (at "' + path_singularNoun + '")');
1408
+ if (obj.message !== undefined) {
1409
+ const obj_message = obj.message;
1410
+ const path_message = path + '.message';
1411
+ if (typeof obj_message !== 'string') {
1412
+ return new TypeError('Expected "string" but received "' + typeof obj_message + '" (at "' + path_message + '")');
2381
1413
  }
2382
1414
  }
2383
1415
  })();
2384
1416
  return v_error === undefined ? null : v_error;
2385
1417
  }
2386
-
2387
- function validate$4(obj, path = 'RepresentationOptions') {
2388
- const v_error = (() => {
2389
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2390
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1418
+ const select$4 = function ErrorSelect() {
1419
+ return {
1420
+ kind: 'Fragment',
1421
+ version: VERSION$2,
1422
+ private: [],
1423
+ selections: [
1424
+ {
1425
+ name: 'code',
1426
+ kind: 'Scalar',
1427
+ required: false
1428
+ },
1429
+ {
1430
+ name: 'message',
1431
+ kind: 'Scalar',
1432
+ required: false
1433
+ }
1434
+ ]
1435
+ };
1436
+ };
1437
+ function equals$2(existing, incoming) {
1438
+ const existing_code = existing.code;
1439
+ const incoming_code = incoming.code;
1440
+ // if at least one of these optionals is defined
1441
+ if (existing_code !== undefined || incoming_code !== undefined) {
1442
+ // if one of these is not defined we know the other is defined and therefore
1443
+ // not equal
1444
+ if (existing_code === undefined || incoming_code === undefined) {
1445
+ return false;
2391
1446
  }
2392
- const obj_numberUnits = obj.numberUnits;
2393
- const path_numberUnits = path + '.numberUnits';
2394
- const referencepath_numberUnitsValidationError = validate$5(obj_numberUnits, path_numberUnits);
2395
- if (referencepath_numberUnitsValidationError !== null) {
2396
- let message = 'Object doesn\'t match RepresentationOptions_NumberUnits (at "' + path_numberUnits + '")\n';
2397
- message += referencepath_numberUnitsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2398
- return new TypeError(message);
1447
+ if (!(existing_code === incoming_code)) {
1448
+ return false;
2399
1449
  }
2400
- if (obj.sentimentType !== undefined) {
2401
- const obj_sentimentType = obj.sentimentType;
2402
- const path_sentimentType = path + '.sentimentType';
2403
- if (typeof obj_sentimentType !== 'string') {
2404
- return new TypeError('Expected "string" but received "' + typeof obj_sentimentType + '" (at "' + path_sentimentType + '")');
2405
- }
1450
+ }
1451
+ const existing_message = existing.message;
1452
+ const incoming_message = incoming.message;
1453
+ // if at least one of these optionals is defined
1454
+ if (existing_message !== undefined || incoming_message !== undefined) {
1455
+ // if one of these is not defined we know the other is defined and therefore
1456
+ // not equal
1457
+ if (existing_message === undefined || incoming_message === undefined) {
1458
+ return false;
2406
1459
  }
2407
- if (obj.type !== undefined) {
2408
- const obj_type = obj.type;
2409
- const path_type = path + '.type';
2410
- if (typeof obj_type !== 'string') {
2411
- return new TypeError('Expected "string" but received "' + typeof obj_type + '" (at "' + path_type + '")');
2412
- }
1460
+ if (!(existing_message === incoming_message)) {
1461
+ return false;
2413
1462
  }
2414
- })();
2415
- return v_error === undefined ? null : v_error;
1463
+ }
1464
+ return true;
2416
1465
  }
2417
1466
 
2418
- function validate$3(obj, path = 'InputMetric') {
1467
+ const VERSION$1 = "8dd18b6afd3fc20ff954cca4d0124897";
1468
+ function validate$1(obj, path = 'GenerateInsightBundleResponse') {
2419
1469
  const v_error = (() => {
2420
1470
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2421
1471
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2422
1472
  }
2423
- const obj_extensionOptions = obj.extensionOptions;
2424
- const path_extensionOptions = path + '.extensionOptions';
2425
- const referencepath_extensionOptionsValidationError = validate$e(obj_extensionOptions, path_extensionOptions);
2426
- if (referencepath_extensionOptionsValidationError !== null) {
2427
- let message = 'Object doesn\'t match ExtensionOptions (at "' + path_extensionOptions + '")\n';
2428
- message += referencepath_extensionOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2429
- return new TypeError(message);
2430
- }
2431
- const obj_insightsOptions = obj.insightsOptions;
2432
- const path_insightsOptions = path + '.insightsOptions';
2433
- const referencepath_insightsOptionsValidationError = validate$c(obj_insightsOptions, path_insightsOptions);
2434
- if (referencepath_insightsOptionsValidationError !== null) {
2435
- let message = 'Object doesn\'t match InsightsOptions (at "' + path_insightsOptions + '")\n';
2436
- message += referencepath_insightsOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2437
- return new TypeError(message);
1473
+ if (obj.error !== undefined) {
1474
+ const obj_error = obj.error;
1475
+ const path_error = path + '.error';
1476
+ const referencepath_errorValidationError = validate$2(obj_error, path_error);
1477
+ if (referencepath_errorValidationError !== null) {
1478
+ let message = 'Object doesn\'t match Error (at "' + path_error + '")\n';
1479
+ message += referencepath_errorValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1480
+ return new TypeError(message);
1481
+ }
2438
1482
  }
2439
- const obj_instance = obj.instance;
2440
- const path_instance = path + '.instance';
2441
- const referencepath_instanceValidationError = validate$a(obj_instance, path_instance);
2442
- if (referencepath_instanceValidationError !== null) {
2443
- let message = 'Object doesn\'t match MetricInstance (at "' + path_instance + '")\n';
2444
- message += referencepath_instanceValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2445
- return new TypeError(message);
1483
+ if (obj.result !== undefined) {
1484
+ const obj_result = obj.result;
1485
+ const path_result = path + '.result';
1486
+ if (obj_result === undefined) {
1487
+ return new TypeError('Expected "defined" but received "' + typeof obj_result + '" (at "' + path_result + '")');
1488
+ }
2446
1489
  }
2447
- const obj_metric = obj.metric;
2448
- const path_metric = path + '.metric';
2449
- const referencepath_metricValidationError = validate$6(obj_metric, path_metric);
2450
- if (referencepath_metricValidationError !== null) {
2451
- let message = 'Object doesn\'t match MetricDefinition (at "' + path_metric + '")\n';
2452
- message += referencepath_metricValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2453
- return new TypeError(message);
1490
+ const obj_sdm = obj.sdm;
1491
+ const path_sdm = path + '.sdm';
1492
+ if (typeof obj_sdm !== 'string') {
1493
+ return new TypeError('Expected "string" but received "' + typeof obj_sdm + '" (at "' + path_sdm + '")');
2454
1494
  }
2455
- const obj_representationOptions = obj.representationOptions;
2456
- const path_representationOptions = path + '.representationOptions';
2457
- const referencepath_representationOptionsValidationError = validate$4(obj_representationOptions, path_representationOptions);
2458
- if (referencepath_representationOptionsValidationError !== null) {
2459
- let message = 'Object doesn\'t match RepresentationOptions (at "' + path_representationOptions + '")\n';
2460
- message += referencepath_representationOptionsValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2461
- return new TypeError(message);
1495
+ const obj_submetric = obj.submetric;
1496
+ const path_submetric = path + '.submetric';
1497
+ if (typeof obj_submetric !== 'string') {
1498
+ return new TypeError('Expected "string" but received "' + typeof obj_submetric + '" (at "' + path_submetric + '")');
2462
1499
  }
2463
1500
  })();
2464
1501
  return v_error === undefined ? null : v_error;
2465
1502
  }
2466
-
2467
- function validate$2(obj, path = 'InsightBundleInput') {
2468
- const v_error = (() => {
2469
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2470
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
1503
+ const RepresentationType$1 = 'GenerateInsightBundleResponse';
1504
+ function keyBuilder$3(luvio, config) {
1505
+ return keyPrefix + '::' + RepresentationType$1 + ':' + config.metricid;
1506
+ }
1507
+ function keyBuilderFromType$1(luvio, object) {
1508
+ const keyParams = {
1509
+ metricid: object.submetric
1510
+ };
1511
+ return keyBuilder$3(luvio, keyParams);
1512
+ }
1513
+ function normalize$1(input, existing, path, luvio, store, timestamp) {
1514
+ return input;
1515
+ }
1516
+ const select$3 = function GenerateInsightBundleResponseSelect() {
1517
+ const { selections: Error__selections, opaque: Error__opaque, } = select$4();
1518
+ return {
1519
+ kind: 'Fragment',
1520
+ version: VERSION$1,
1521
+ private: [],
1522
+ selections: [
1523
+ {
1524
+ name: 'error',
1525
+ kind: 'Object',
1526
+ selections: Error__selections,
1527
+ required: false
1528
+ },
1529
+ {
1530
+ name: 'result',
1531
+ kind: 'Object',
1532
+ // any
1533
+ },
1534
+ {
1535
+ name: 'sdm',
1536
+ kind: 'Scalar'
1537
+ },
1538
+ {
1539
+ name: 'submetric',
1540
+ kind: 'Scalar'
1541
+ }
1542
+ ]
1543
+ };
1544
+ };
1545
+ function equals$1(existing, incoming) {
1546
+ const existing_sdm = existing.sdm;
1547
+ const incoming_sdm = incoming.sdm;
1548
+ if (!(existing_sdm === incoming_sdm)) {
1549
+ return false;
1550
+ }
1551
+ const existing_submetric = existing.submetric;
1552
+ const incoming_submetric = incoming.submetric;
1553
+ if (!(existing_submetric === incoming_submetric)) {
1554
+ return false;
1555
+ }
1556
+ const existing_error = existing.error;
1557
+ const incoming_error = incoming.error;
1558
+ // if at least one of these optionals is defined
1559
+ if (existing_error !== undefined || incoming_error !== undefined) {
1560
+ // if one of these is not defined we know the other is defined and therefore
1561
+ // not equal
1562
+ if (existing_error === undefined || incoming_error === undefined) {
1563
+ return false;
2471
1564
  }
2472
- const obj_metadata = obj.metadata;
2473
- const path_metadata = path + '.metadata';
2474
- const referencepath_metadataValidationError = validate$f(obj_metadata, path_metadata);
2475
- if (referencepath_metadataValidationError !== null) {
2476
- let message = 'Object doesn\'t match MetricMetadata (at "' + path_metadata + '")\n';
2477
- message += referencepath_metadataValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2478
- return new TypeError(message);
1565
+ if (!(equals$2(existing_error, incoming_error))) {
1566
+ return false;
2479
1567
  }
2480
- const obj_metric = obj.metric;
2481
- const path_metric = path + '.metric';
2482
- const referencepath_metricValidationError = validate$3(obj_metric, path_metric);
2483
- if (referencepath_metricValidationError !== null) {
2484
- let message = 'Object doesn\'t match InputMetric (at "' + path_metric + '")\n';
2485
- message += referencepath_metricValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2486
- return new TypeError(message);
1568
+ }
1569
+ const existing_result = existing.result;
1570
+ const incoming_result = incoming.result;
1571
+ // if at least one of these optionals is defined
1572
+ if (existing_result !== undefined || incoming_result !== undefined) {
1573
+ // if one of these is not defined we know the other is defined and therefore
1574
+ // not equal
1575
+ if (existing_result === undefined || incoming_result === undefined) {
1576
+ return false;
1577
+ }
1578
+ if (JSONStringify(incoming_result) !== JSONStringify(existing_result)) {
1579
+ return false;
1580
+ }
1581
+ }
1582
+ return true;
1583
+ }
1584
+ const ingest$1 = function GenerateInsightBundleResponseIngest(input, path, luvio, store, timestamp) {
1585
+ if (process.env.NODE_ENV !== 'production') {
1586
+ const validateError = validate$1(input);
1587
+ if (validateError !== null) {
1588
+ throw validateError;
1589
+ }
1590
+ }
1591
+ const key = keyBuilderFromType$1(luvio, input);
1592
+ const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
1593
+ ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "analytics-insights", VERSION$1, RepresentationType$1, equals$1);
1594
+ return createLink(key);
1595
+ };
1596
+ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
1597
+ // root cache key (uses fullPathFactory if keyBuilderFromType isn't defined)
1598
+ const rootKey = keyBuilderFromType$1(luvio, input);
1599
+ rootKeySet.set(rootKey, {
1600
+ namespace: keyPrefix,
1601
+ representationName: RepresentationType$1,
1602
+ mergeable: false
1603
+ });
1604
+ }
1605
+
1606
+ function select$2(luvio, params) {
1607
+ return select$3();
1608
+ }
1609
+ function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
1610
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
1611
+ }
1612
+ function ingestSuccess$1(luvio, resourceParams, response) {
1613
+ const { body } = response;
1614
+ const key = keyBuilderFromType$1(luvio, body);
1615
+ luvio.storeIngest(key, ingest$1, body);
1616
+ const snapshot = luvio.storeLookup({
1617
+ recordId: key,
1618
+ node: select$2(),
1619
+ variables: {},
1620
+ });
1621
+ if (process.env.NODE_ENV !== 'production') {
1622
+ if (snapshot.state !== 'Fulfilled') {
1623
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2487
1624
  }
2488
- })();
2489
- return v_error === undefined ? null : v_error;
1625
+ }
1626
+ deepFreeze(snapshot.data);
1627
+ return snapshot;
1628
+ }
1629
+ function createResourceRequest$1(config) {
1630
+ const headers = {};
1631
+ return {
1632
+ baseUri: 'api.salesforce.com',
1633
+ basePath: '/analytics/insights/v1/generateBundle',
1634
+ method: 'post',
1635
+ body: config.body,
1636
+ urlParams: {},
1637
+ queryParams: {},
1638
+ headers,
1639
+ priority: 'normal',
1640
+ };
2490
1641
  }
2491
1642
 
2492
- function validate$1(obj, path = 'BatchInput') {
2493
- const v_error = (() => {
2494
- if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2495
- return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
2496
- }
2497
- if (obj.bundleInput !== undefined) {
2498
- const obj_bundleInput = obj.bundleInput;
2499
- const path_bundleInput = path + '.bundleInput';
2500
- const referencepath_bundleInputValidationError = validate$2(obj_bundleInput, path_bundleInput);
2501
- if (referencepath_bundleInputValidationError !== null) {
2502
- let message = 'Object doesn\'t match InsightBundleInput (at "' + path_bundleInput + '")\n';
2503
- message += referencepath_bundleInputValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2504
- return new TypeError(message);
2505
- }
2506
- }
2507
- if (obj.metricInstanceId !== undefined) {
2508
- const obj_metricInstanceId = obj.metricInstanceId;
2509
- const path_metricInstanceId = path + '.metricInstanceId';
2510
- if (typeof obj_metricInstanceId !== 'string') {
2511
- return new TypeError('Expected "string" but received "' + typeof obj_metricInstanceId + '" (at "' + path_metricInstanceId + '")');
2512
- }
2513
- }
2514
- })();
2515
- return v_error === undefined ? null : v_error;
1643
+ const adapterName$1 = 'generateInsights';
1644
+ const generateInsights_ConfigPropertyMetadata = [
1645
+ generateParamConfigMetadata('type', false, 2 /* Body */, 0 /* String */),
1646
+ generateParamConfigMetadata('version', false, 2 /* Body */, 3 /* Integer */),
1647
+ generateParamConfigMetadata('input', false, 2 /* Body */, 4 /* Unsupported */),
1648
+ generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
1649
+ ];
1650
+ const generateInsights_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, generateInsights_ConfigPropertyMetadata);
1651
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(generateInsights_ConfigPropertyMetadata);
1652
+ function typeCheckConfig$1(untrustedConfig) {
1653
+ const config = {};
1654
+ typeCheckConfig$4(untrustedConfig, config, generateInsights_ConfigPropertyMetadata);
1655
+ const untrustedConfig_input = untrustedConfig.input;
1656
+ config.input = untrustedConfig_input;
1657
+ const untrustedConfig_options = untrustedConfig.options;
1658
+ config.options = untrustedConfig_options;
1659
+ return config;
1660
+ }
1661
+ function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
1662
+ if (!untrustedIsObject(untrustedConfig)) {
1663
+ return null;
1664
+ }
1665
+ if (process.env.NODE_ENV !== 'production') {
1666
+ validateConfig(untrustedConfig, configPropertyNames);
1667
+ }
1668
+ const config = typeCheckConfig$1(untrustedConfig);
1669
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
1670
+ return null;
1671
+ }
1672
+ return config;
1673
+ }
1674
+ function buildNetworkSnapshot$1(luvio, config, options) {
1675
+ const resourceParams = createResourceParams$1(config);
1676
+ const request = createResourceRequest$1(resourceParams);
1677
+ return luvio.dispatchResourceRequest(request, options)
1678
+ .then((response) => {
1679
+ return luvio.handleSuccessResponse(() => {
1680
+ const snapshot = ingestSuccess$1(luvio, resourceParams, response);
1681
+ return luvio.storeBroadcast().then(() => snapshot);
1682
+ }, () => {
1683
+ const cache = new StoreKeyMap();
1684
+ getResponseCacheKeys$1(cache, luvio, resourceParams, response.body);
1685
+ return cache;
1686
+ });
1687
+ }, (response) => {
1688
+ deepFreeze(response);
1689
+ throw response;
1690
+ });
2516
1691
  }
1692
+ const generateInsightsAdapterFactory = (luvio) => {
1693
+ return function generateInsights(untrustedConfig) {
1694
+ const config = validateAdapterConfig$1(untrustedConfig, generateInsights_ConfigPropertyNames);
1695
+ // Invalid or incomplete config
1696
+ if (config === null) {
1697
+ throw new Error('Invalid config for "generateInsights"');
1698
+ }
1699
+ return buildNetworkSnapshot$1(luvio, config);
1700
+ };
1701
+ };
2517
1702
 
2518
- const VERSION = "a8b8e8e21e2dc1b5b067efa90209dce3";
2519
- function validate(obj, path = 'GenerateInsightBatchResponse') {
1703
+ const VERSION = "94ce8446612f6dc54775a9c8489b1b52";
1704
+ function validate(obj, path = 'GetInsightBatchResponse') {
2520
1705
  const v_error = (() => {
2521
1706
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
2522
1707
  return new TypeError('Expected "object" but received "' + typeof obj + '" (at "' + path + '")');
@@ -2526,11 +1711,32 @@ function validate(obj, path = 'GenerateInsightBatchResponse') {
2526
1711
  if (typeof obj_batchId !== 'string') {
2527
1712
  return new TypeError('Expected "string" but received "' + typeof obj_batchId + '" (at "' + path_batchId + '")');
2528
1713
  }
2529
- if (obj.generatingSummary !== undefined) {
2530
- const obj_generatingSummary = obj.generatingSummary;
2531
- const path_generatingSummary = path + '.generatingSummary';
2532
- if (typeof obj_generatingSummary !== 'boolean') {
2533
- return new TypeError('Expected "boolean" but received "' + typeof obj_generatingSummary + '" (at "' + path_generatingSummary + '")');
1714
+ if (obj.bundles !== undefined) {
1715
+ const obj_bundles = obj.bundles;
1716
+ const path_bundles = path + '.bundles';
1717
+ if (!ArrayIsArray(obj_bundles)) {
1718
+ return new TypeError('Expected "array" but received "' + typeof obj_bundles + '" (at "' + path_bundles + '")');
1719
+ }
1720
+ for (let i = 0; i < obj_bundles.length; i++) {
1721
+ const obj_bundles_item = obj_bundles[i];
1722
+ const path_bundles_item = path_bundles + '[' + i + ']';
1723
+ if (typeof obj_bundles_item !== 'object') {
1724
+ return new TypeError('Expected "object" but received "' + typeof obj_bundles_item + '" (at "' + path_bundles_item + '")');
1725
+ }
1726
+ }
1727
+ }
1728
+ if (obj.hasErrors !== undefined) {
1729
+ const obj_hasErrors = obj.hasErrors;
1730
+ const path_hasErrors = path + '.hasErrors';
1731
+ if (typeof obj_hasErrors !== 'boolean') {
1732
+ return new TypeError('Expected "boolean" but received "' + typeof obj_hasErrors + '" (at "' + path_hasErrors + '")');
1733
+ }
1734
+ }
1735
+ if (obj.status !== undefined) {
1736
+ const obj_status = obj.status;
1737
+ const path_status = path + '.status';
1738
+ if (typeof obj_status !== 'string') {
1739
+ return new TypeError('Expected "string" but received "' + typeof obj_status + '" (at "' + path_status + '")');
2534
1740
  }
2535
1741
  }
2536
1742
  if (obj.summary !== undefined) {
@@ -2540,30 +1746,41 @@ function validate(obj, path = 'GenerateInsightBatchResponse') {
2540
1746
  return new TypeError('Expected "defined" but received "' + typeof obj_summary + '" (at "' + path_summary + '")');
2541
1747
  }
2542
1748
  }
2543
- if (obj.timestamp !== undefined) {
2544
- const obj_timestamp = obj.timestamp;
2545
- const path_timestamp = path + '.timestamp';
2546
- if (typeof obj_timestamp !== 'string') {
2547
- return new TypeError('Expected "string" but received "' + typeof obj_timestamp + '" (at "' + path_timestamp + '")');
2548
- }
2549
- }
2550
1749
  })();
2551
1750
  return v_error === undefined ? null : v_error;
2552
1751
  }
2553
- const RepresentationType = 'GenerateInsightBatchResponse';
2554
- function keyBuilder(luvio, config) {
1752
+ const RepresentationType = 'GetInsightBatchResponse';
1753
+ function keyBuilder$2(luvio, config) {
2555
1754
  return keyPrefix + '::' + RepresentationType + ':' + config.batchid;
2556
1755
  }
2557
1756
  function keyBuilderFromType(luvio, object) {
2558
1757
  const keyParams = {
2559
1758
  batchid: object.batchId
2560
1759
  };
2561
- return keyBuilder(luvio, keyParams);
1760
+ return keyBuilder$2(luvio, keyParams);
2562
1761
  }
2563
1762
  function normalize(input, existing, path, luvio, store, timestamp) {
1763
+ const input_bundles = input.bundles;
1764
+ const input_bundles_id = path.fullPath + '__bundles';
1765
+ if (input_bundles !== undefined) {
1766
+ for (let i = 0; i < input_bundles.length; i++) {
1767
+ const input_bundles_item = input_bundles[i];
1768
+ let input_bundles_item_id = input_bundles_id + '__' + i;
1769
+ input_bundles[i] = ingest$1(input_bundles_item, {
1770
+ fullPath: input_bundles_item_id,
1771
+ propertyName: i,
1772
+ parent: {
1773
+ data: input,
1774
+ key: path.fullPath,
1775
+ existing: existing,
1776
+ },
1777
+ ttl: path.ttl
1778
+ }, luvio, store, timestamp);
1779
+ }
1780
+ }
2564
1781
  return input;
2565
1782
  }
2566
- const select$1 = function GenerateInsightBatchResponseSelect() {
1783
+ const select$1 = function GetInsightBatchResponseSelect() {
2567
1784
  return {
2568
1785
  kind: 'Fragment',
2569
1786
  version: VERSION,
@@ -2574,7 +1791,19 @@ const select$1 = function GenerateInsightBatchResponseSelect() {
2574
1791
  kind: 'Scalar'
2575
1792
  },
2576
1793
  {
2577
- name: 'generatingSummary',
1794
+ name: 'bundles',
1795
+ kind: 'Link',
1796
+ plural: true,
1797
+ required: false,
1798
+ fragment: select$3()
1799
+ },
1800
+ {
1801
+ name: 'hasErrors',
1802
+ kind: 'Scalar',
1803
+ required: false
1804
+ },
1805
+ {
1806
+ name: 'status',
2578
1807
  kind: 'Scalar',
2579
1808
  required: false
2580
1809
  },
@@ -2582,26 +1811,21 @@ const select$1 = function GenerateInsightBatchResponseSelect() {
2582
1811
  name: 'summary',
2583
1812
  kind: 'Object',
2584
1813
  // any
2585
- },
2586
- {
2587
- name: 'timestamp',
2588
- kind: 'Scalar',
2589
- required: false
2590
1814
  }
2591
1815
  ]
2592
1816
  };
2593
1817
  };
2594
1818
  function equals(existing, incoming) {
2595
- const existing_generatingSummary = existing.generatingSummary;
2596
- const incoming_generatingSummary = incoming.generatingSummary;
1819
+ const existing_hasErrors = existing.hasErrors;
1820
+ const incoming_hasErrors = incoming.hasErrors;
2597
1821
  // if at least one of these optionals is defined
2598
- if (existing_generatingSummary !== undefined || incoming_generatingSummary !== undefined) {
1822
+ if (existing_hasErrors !== undefined || incoming_hasErrors !== undefined) {
2599
1823
  // if one of these is not defined we know the other is defined and therefore
2600
1824
  // not equal
2601
- if (existing_generatingSummary === undefined || incoming_generatingSummary === undefined) {
1825
+ if (existing_hasErrors === undefined || incoming_hasErrors === undefined) {
2602
1826
  return false;
2603
1827
  }
2604
- if (!(existing_generatingSummary === incoming_generatingSummary)) {
1828
+ if (!(existing_hasErrors === incoming_hasErrors)) {
2605
1829
  return false;
2606
1830
  }
2607
1831
  }
@@ -2610,16 +1834,34 @@ function equals(existing, incoming) {
2610
1834
  if (!(existing_batchId === incoming_batchId)) {
2611
1835
  return false;
2612
1836
  }
2613
- const existing_timestamp = existing.timestamp;
2614
- const incoming_timestamp = incoming.timestamp;
1837
+ const existing_status = existing.status;
1838
+ const incoming_status = incoming.status;
2615
1839
  // if at least one of these optionals is defined
2616
- if (existing_timestamp !== undefined || incoming_timestamp !== undefined) {
1840
+ if (existing_status !== undefined || incoming_status !== undefined) {
2617
1841
  // if one of these is not defined we know the other is defined and therefore
2618
1842
  // not equal
2619
- if (existing_timestamp === undefined || incoming_timestamp === undefined) {
1843
+ if (existing_status === undefined || incoming_status === undefined) {
2620
1844
  return false;
2621
1845
  }
2622
- if (!(existing_timestamp === incoming_timestamp)) {
1846
+ if (!(existing_status === incoming_status)) {
1847
+ return false;
1848
+ }
1849
+ }
1850
+ const existing_bundles = existing.bundles;
1851
+ const incoming_bundles = incoming.bundles;
1852
+ // if at least one of these optionals is defined
1853
+ if (existing_bundles !== undefined || incoming_bundles !== undefined) {
1854
+ // if one of these is not defined we know the other is defined and therefore
1855
+ // not equal
1856
+ if (existing_bundles === undefined || incoming_bundles === undefined) {
1857
+ return false;
1858
+ }
1859
+ const equals_bundles_items = equalsArray(existing_bundles, incoming_bundles, (existing_bundles_item, incoming_bundles_item) => {
1860
+ if (!(existing_bundles_item.__ref === incoming_bundles_item.__ref)) {
1861
+ return false;
1862
+ }
1863
+ });
1864
+ if (equals_bundles_items === false) {
2623
1865
  return false;
2624
1866
  }
2625
1867
  }
@@ -2638,7 +1880,7 @@ function equals(existing, incoming) {
2638
1880
  }
2639
1881
  return true;
2640
1882
  }
2641
- const ingest = function GenerateInsightBatchResponseIngest(input, path, luvio, store, timestamp) {
1883
+ const ingest = function GetInsightBatchResponseIngest(input, path, luvio, store, timestamp) {
2642
1884
  if (process.env.NODE_ENV !== 'production') {
2643
1885
  const validateError = validate(input);
2644
1886
  if (validateError !== null) {
@@ -2658,23 +1900,34 @@ function getTypeCacheKeys(rootKeySet, luvio, input, fullPathFactory) {
2658
1900
  representationName: RepresentationType,
2659
1901
  mergeable: false
2660
1902
  });
1903
+ if (input.bundles !== undefined) {
1904
+ const input_bundles_length = input.bundles.length;
1905
+ for (let i = 0; i < input_bundles_length; i++) {
1906
+ getTypeCacheKeys$1(rootKeySet, luvio, input.bundles[i]);
1907
+ }
1908
+ }
2661
1909
  }
2662
1910
 
2663
1911
  function select(luvio, params) {
2664
1912
  return select$1();
2665
1913
  }
1914
+ function keyBuilder$1(luvio, params) {
1915
+ return keyBuilder$2(luvio, {
1916
+ batchid: params.urlParams.batchId
1917
+ });
1918
+ }
2666
1919
  function getResponseCacheKeys(storeKeyMap, luvio, resourceParams, response) {
2667
1920
  getTypeCacheKeys(storeKeyMap, luvio, response);
2668
1921
  }
2669
- function ingestSuccess(luvio, resourceParams, response) {
1922
+ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
2670
1923
  const { body } = response;
2671
- const key = keyBuilderFromType(luvio, body);
1924
+ const key = keyBuilder$1(luvio, resourceParams);
2672
1925
  luvio.storeIngest(key, ingest, body);
2673
1926
  const snapshot = luvio.storeLookup({
2674
1927
  recordId: key,
2675
1928
  node: select(),
2676
1929
  variables: {},
2677
- });
1930
+ }, snapshotRefresh);
2678
1931
  if (process.env.NODE_ENV !== 'production') {
2679
1932
  if (snapshot.state !== 'Fulfilled') {
2680
1933
  throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
@@ -2683,43 +1936,39 @@ function ingestSuccess(luvio, resourceParams, response) {
2683
1936
  deepFreeze(snapshot.data);
2684
1937
  return snapshot;
2685
1938
  }
1939
+ function ingestError(luvio, params, error, snapshotRefresh) {
1940
+ const key = keyBuilder$1(luvio, params);
1941
+ const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
1942
+ luvio.storeIngestError(key, errorSnapshot);
1943
+ return errorSnapshot;
1944
+ }
2686
1945
  function createResourceRequest(config) {
2687
1946
  const headers = {};
2688
1947
  return {
2689
1948
  baseUri: 'api.salesforce.com',
2690
- basePath: '/analytics/tua-insights-service/v1/batches',
2691
- method: 'post',
2692
- body: config.body,
2693
- urlParams: {},
1949
+ basePath: '/analytics/insights/v1/batches/' + config.urlParams.batchId + '',
1950
+ method: 'get',
1951
+ body: null,
1952
+ urlParams: config.urlParams,
2694
1953
  queryParams: {},
2695
1954
  headers,
2696
1955
  priority: 'normal',
2697
1956
  };
2698
1957
  }
2699
1958
 
2700
- const adapterName = 'createInsightsBatch';
2701
- const createInsightsBatch_ConfigPropertyMetadata = [
2702
- generateParamConfigMetadata('batchInput', false, 2 /* Body */, 4 /* Unsupported */, true),
2703
- generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
1959
+ const adapterName = 'getInsightsBatch';
1960
+ const getInsightsBatch_ConfigPropertyMetadata = [
1961
+ generateParamConfigMetadata('batchId', true, 0 /* UrlParameter */, 0 /* String */),
2704
1962
  ];
2705
- const createInsightsBatch_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, createInsightsBatch_ConfigPropertyMetadata);
2706
- const createResourceParams = /*#__PURE__*/ createResourceParams$4(createInsightsBatch_ConfigPropertyMetadata);
1963
+ const getInsightsBatch_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getInsightsBatch_ConfigPropertyMetadata);
1964
+ const createResourceParams = /*#__PURE__*/ createResourceParams$4(getInsightsBatch_ConfigPropertyMetadata);
1965
+ function keyBuilder(luvio, config) {
1966
+ const resourceParams = createResourceParams(config);
1967
+ return keyBuilder$1(luvio, resourceParams);
1968
+ }
2707
1969
  function typeCheckConfig(untrustedConfig) {
2708
1970
  const config = {};
2709
- const untrustedConfig_batchInput = untrustedConfig.batchInput;
2710
- if (ArrayIsArray$1(untrustedConfig_batchInput)) {
2711
- const untrustedConfig_batchInput_array = [];
2712
- for (let i = 0, arrayLength = untrustedConfig_batchInput.length; i < arrayLength; i++) {
2713
- const untrustedConfig_batchInput_item = untrustedConfig_batchInput[i];
2714
- const referenceBatchInputValidationError = validate$1(untrustedConfig_batchInput_item);
2715
- if (referenceBatchInputValidationError === null) {
2716
- untrustedConfig_batchInput_array.push(untrustedConfig_batchInput_item);
2717
- }
2718
- }
2719
- config.batchInput = untrustedConfig_batchInput_array;
2720
- }
2721
- const untrustedConfig_options = untrustedConfig.options;
2722
- config.options = untrustedConfig_options;
1971
+ typeCheckConfig$4(untrustedConfig, config, getInsightsBatch_ConfigPropertyMetadata);
2723
1972
  return config;
2724
1973
  }
2725
1974
  function validateAdapterConfig(untrustedConfig, configPropertyNames) {
@@ -2735,33 +1984,62 @@ function validateAdapterConfig(untrustedConfig, configPropertyNames) {
2735
1984
  }
2736
1985
  return config;
2737
1986
  }
1987
+ function adapterFragment(luvio, config) {
1988
+ createResourceParams(config);
1989
+ return select();
1990
+ }
1991
+ function onFetchResponseSuccess(luvio, config, resourceParams, response) {
1992
+ const snapshot = ingestSuccess(luvio, resourceParams, response, {
1993
+ config,
1994
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
1995
+ });
1996
+ return luvio.storeBroadcast().then(() => snapshot);
1997
+ }
1998
+ function onFetchResponseError(luvio, config, resourceParams, response) {
1999
+ const snapshot = ingestError(luvio, resourceParams, response, {
2000
+ config,
2001
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
2002
+ });
2003
+ return luvio.storeBroadcast().then(() => snapshot);
2004
+ }
2738
2005
  function buildNetworkSnapshot(luvio, config, options) {
2739
2006
  const resourceParams = createResourceParams(config);
2740
2007
  const request = createResourceRequest(resourceParams);
2741
2008
  return luvio.dispatchResourceRequest(request, options)
2742
2009
  .then((response) => {
2743
- return luvio.handleSuccessResponse(() => {
2744
- const snapshot = ingestSuccess(luvio, resourceParams, response);
2745
- return luvio.storeBroadcast().then(() => snapshot);
2746
- }, () => {
2010
+ return luvio.handleSuccessResponse(() => onFetchResponseSuccess(luvio, config, resourceParams, response), () => {
2747
2011
  const cache = new StoreKeyMap();
2748
2012
  getResponseCacheKeys(cache, luvio, resourceParams, response.body);
2749
2013
  return cache;
2750
2014
  });
2751
2015
  }, (response) => {
2752
- deepFreeze(response);
2753
- throw response;
2016
+ return luvio.handleErrorResponse(() => onFetchResponseError(luvio, config, resourceParams, response));
2754
2017
  });
2755
2018
  }
2756
- const createInsightsBatchAdapterFactory = (luvio) => {
2757
- return function createInsightsBatch(untrustedConfig) {
2758
- const config = validateAdapterConfig(untrustedConfig, createInsightsBatch_ConfigPropertyNames);
2759
- // Invalid or incomplete config
2760
- if (config === null) {
2761
- throw new Error('Invalid config for "createInsightsBatch"');
2762
- }
2763
- return buildNetworkSnapshot(luvio, config);
2019
+ function buildNetworkSnapshotCachePolicy(context, coercedAdapterRequestContext) {
2020
+ return buildNetworkSnapshotCachePolicy$1(context, coercedAdapterRequestContext, buildNetworkSnapshot, undefined, false);
2021
+ }
2022
+ function buildCachedSnapshotCachePolicy(context, storeLookup) {
2023
+ const { luvio, config } = context;
2024
+ const selector = {
2025
+ recordId: keyBuilder(luvio, config),
2026
+ node: adapterFragment(luvio, config),
2027
+ variables: {},
2764
2028
  };
2029
+ const cacheSnapshot = storeLookup(selector, {
2030
+ config,
2031
+ resolve: () => buildNetworkSnapshot(luvio, config, snapshotRefreshOptions)
2032
+ });
2033
+ return cacheSnapshot;
2034
+ }
2035
+ const getInsightsBatchAdapterFactory = (luvio) => function analyticsInsights__getInsightsBatch(untrustedConfig, requestContext) {
2036
+ const config = validateAdapterConfig(untrustedConfig, getInsightsBatch_ConfigPropertyNames);
2037
+ // Invalid or incomplete config
2038
+ if (config === null) {
2039
+ return null;
2040
+ }
2041
+ return luvio.applyCachePolicy((requestContext || {}), { config, luvio }, // BuildSnapshotContext
2042
+ buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
2765
2043
  };
2766
2044
 
2767
2045
  export { createInsightsBatchAdapterFactory, generateInsightsAdapterFactory, getInsightsBatchAdapterFactory, getMetricFilterValuesAdapterFactory };