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