@salesforce/lds-adapters-sfap-analytics-insights 1.309.0-dev16 → 1.309.0-dev18

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.
@@ -4,7 +4,7 @@
4
4
  * For full license text, see the LICENSE.txt file
5
5
  */
6
6
 
7
- import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$4, typeCheckConfig as typeCheckConfig$4, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } from '@luvio/engine';
7
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$5, typeCheckConfig as typeCheckConfig$5, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } from '@luvio/engine';
8
8
 
9
9
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
10
10
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -964,7 +964,7 @@ function validate$e(obj, path = 'Error') {
964
964
  })();
965
965
  return v_error === undefined ? null : v_error;
966
966
  }
967
- const select$i = function ErrorSelect() {
967
+ const select$j = function ErrorSelect() {
968
968
  return {
969
969
  kind: 'Fragment',
970
970
  version: VERSION$e,
@@ -1042,7 +1042,7 @@ function validate$d(obj, path = 'Summary') {
1042
1042
  })();
1043
1043
  return v_error === undefined ? null : v_error;
1044
1044
  }
1045
- const select$h = function SummarySelect() {
1045
+ const select$i = function SummarySelect() {
1046
1046
  return {
1047
1047
  kind: 'Fragment',
1048
1048
  version: VERSION$d,
@@ -1118,9 +1118,9 @@ function validate$c(obj, path = 'SummaryResponse') {
1118
1118
  })();
1119
1119
  return v_error === undefined ? null : v_error;
1120
1120
  }
1121
- const select$g = function SummaryResponseSelect() {
1122
- const { selections: Error__selections, opaque: Error__opaque, } = select$i();
1123
- const { selections: Summary__selections, opaque: Summary__opaque, } = select$h();
1121
+ const select$h = function SummaryResponseSelect() {
1122
+ const { selections: Error__selections, opaque: Error__opaque, } = select$j();
1123
+ const { selections: Summary__selections, opaque: Summary__opaque, } = select$i();
1124
1124
  return {
1125
1125
  kind: 'Fragment',
1126
1126
  version: VERSION$c,
@@ -1213,8 +1213,8 @@ function keyBuilderFromType$3(luvio, object) {
1213
1213
  function normalize$3(input, existing, path, luvio, store, timestamp) {
1214
1214
  return input;
1215
1215
  }
1216
- const select$f = function GenerateInsightBatchResponseSelect() {
1217
- const { selections: SummaryResponse__selections, opaque: SummaryResponse__opaque, } = select$g();
1216
+ const select$g = function GenerateInsightBatchResponseSelect() {
1217
+ const { selections: SummaryResponse__selections, opaque: SummaryResponse__opaque, } = select$h();
1218
1218
  return {
1219
1219
  kind: 'Fragment',
1220
1220
  version: VERSION$b,
@@ -1312,19 +1312,19 @@ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
1312
1312
  });
1313
1313
  }
1314
1314
 
1315
- function select$e(luvio, params) {
1316
- return select$f();
1315
+ function select$f(luvio, params) {
1316
+ return select$g();
1317
1317
  }
1318
- function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
1318
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
1319
1319
  getTypeCacheKeys$3(storeKeyMap, luvio, response);
1320
1320
  }
1321
- function ingestSuccess$3(luvio, resourceParams, response) {
1321
+ function ingestSuccess$4(luvio, resourceParams, response) {
1322
1322
  const { body } = response;
1323
1323
  const key = keyBuilderFromType$3(luvio, body);
1324
1324
  luvio.storeIngest(key, ingest$3, body);
1325
1325
  const snapshot = luvio.storeLookup({
1326
1326
  recordId: key,
1327
- node: select$e(),
1327
+ node: select$f(),
1328
1328
  variables: {},
1329
1329
  });
1330
1330
  if (process.env.NODE_ENV !== 'production') {
@@ -1335,7 +1335,7 @@ function ingestSuccess$3(luvio, resourceParams, response) {
1335
1335
  deepFreeze(snapshot.data);
1336
1336
  return snapshot;
1337
1337
  }
1338
- function createResourceRequest$3(config) {
1338
+ function createResourceRequest$4(config) {
1339
1339
  const headers = {};
1340
1340
  return {
1341
1341
  baseUri: 'api.salesforce.com',
@@ -1349,14 +1349,14 @@ function createResourceRequest$3(config) {
1349
1349
  };
1350
1350
  }
1351
1351
 
1352
- const adapterName$3 = 'createInsightsBatch';
1352
+ const adapterName$4 = 'createInsightsBatch';
1353
1353
  const createInsightsBatch_ConfigPropertyMetadata = [
1354
1354
  generateParamConfigMetadata('batchInput', false, 2 /* Body */, 4 /* Unsupported */, true),
1355
1355
  generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
1356
1356
  ];
1357
- const createInsightsBatch_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createInsightsBatch_ConfigPropertyMetadata);
1358
- const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(createInsightsBatch_ConfigPropertyMetadata);
1359
- function typeCheckConfig$3(untrustedConfig) {
1357
+ const createInsightsBatch_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, createInsightsBatch_ConfigPropertyMetadata);
1358
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$5(createInsightsBatch_ConfigPropertyMetadata);
1359
+ function typeCheckConfig$4(untrustedConfig) {
1360
1360
  const config = {};
1361
1361
  const untrustedConfig_batchInput = untrustedConfig.batchInput;
1362
1362
  if (ArrayIsArray$1(untrustedConfig_batchInput)) {
@@ -1377,30 +1377,30 @@ function typeCheckConfig$3(untrustedConfig) {
1377
1377
  }
1378
1378
  return config;
1379
1379
  }
1380
- function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1380
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
1381
1381
  if (!untrustedIsObject(untrustedConfig)) {
1382
1382
  return null;
1383
1383
  }
1384
1384
  if (process.env.NODE_ENV !== 'production') {
1385
1385
  validateConfig(untrustedConfig, configPropertyNames);
1386
1386
  }
1387
- const config = typeCheckConfig$3(untrustedConfig);
1387
+ const config = typeCheckConfig$4(untrustedConfig);
1388
1388
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1389
1389
  return null;
1390
1390
  }
1391
1391
  return config;
1392
1392
  }
1393
- function buildNetworkSnapshot$3(luvio, config, options) {
1394
- const resourceParams = createResourceParams$3(config);
1395
- const request = createResourceRequest$3(resourceParams);
1393
+ function buildNetworkSnapshot$4(luvio, config, options) {
1394
+ const resourceParams = createResourceParams$4(config);
1395
+ const request = createResourceRequest$4(resourceParams);
1396
1396
  return luvio.dispatchResourceRequest(request, options)
1397
1397
  .then((response) => {
1398
1398
  return luvio.handleSuccessResponse(() => {
1399
- const snapshot = ingestSuccess$3(luvio, resourceParams, response);
1399
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response);
1400
1400
  return luvio.storeBroadcast().then(() => snapshot);
1401
1401
  }, () => {
1402
1402
  const cache = new StoreKeyMap();
1403
- getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1403
+ getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
1404
1404
  return cache;
1405
1405
  });
1406
1406
  }, (response) => {
@@ -1410,12 +1410,12 @@ function buildNetworkSnapshot$3(luvio, config, options) {
1410
1410
  }
1411
1411
  const createInsightsBatchAdapterFactory = (luvio) => {
1412
1412
  return function createInsightsBatch(untrustedConfig) {
1413
- const config = validateAdapterConfig$3(untrustedConfig, createInsightsBatch_ConfigPropertyNames);
1413
+ const config = validateAdapterConfig$4(untrustedConfig, createInsightsBatch_ConfigPropertyNames);
1414
1414
  // Invalid or incomplete config
1415
1415
  if (config === null) {
1416
1416
  throw new Error('Invalid config for "createInsightsBatch"');
1417
1417
  }
1418
- return buildNetworkSnapshot$3(luvio, config);
1418
+ return buildNetworkSnapshot$4(luvio, config);
1419
1419
  };
1420
1420
  };
1421
1421
 
@@ -1483,7 +1483,7 @@ function validate$a(obj, path = 'GetFilterValuesResponse_CategoricalValues') {
1483
1483
  })();
1484
1484
  return v_error === undefined ? null : v_error;
1485
1485
  }
1486
- const select$d = function GetFilterValuesResponse_CategoricalValuesSelect() {
1486
+ const select$e = function GetFilterValuesResponse_CategoricalValuesSelect() {
1487
1487
  return {
1488
1488
  kind: 'Fragment',
1489
1489
  version: VERSION$a,
@@ -1569,8 +1569,8 @@ function keyBuilderFromType$2(luvio, object) {
1569
1569
  function normalize$2(input, existing, path, luvio, store, timestamp) {
1570
1570
  return input;
1571
1571
  }
1572
- const select$c = function GetFilterValuesResponseSelect() {
1573
- const { selections: GetFilterValuesResponse_CategoricalValues__selections, opaque: GetFilterValuesResponse_CategoricalValues__opaque, } = select$d();
1572
+ const select$d = function GetFilterValuesResponseSelect() {
1573
+ const { selections: GetFilterValuesResponse_CategoricalValues__selections, opaque: GetFilterValuesResponse_CategoricalValues__opaque, } = select$e();
1574
1574
  return {
1575
1575
  kind: 'Fragment',
1576
1576
  version: VERSION$9,
@@ -1659,19 +1659,19 @@ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
1659
1659
  });
1660
1660
  }
1661
1661
 
1662
- function select$b(luvio, params) {
1663
- return select$c();
1662
+ function select$c(luvio, params) {
1663
+ return select$d();
1664
1664
  }
1665
- function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
1665
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
1666
1666
  getTypeCacheKeys$2(storeKeyMap, luvio, response);
1667
1667
  }
1668
- function ingestSuccess$2(luvio, resourceParams, response) {
1668
+ function ingestSuccess$3(luvio, resourceParams, response) {
1669
1669
  const { body } = response;
1670
1670
  const key = keyBuilderFromType$2(luvio, body);
1671
1671
  luvio.storeIngest(key, ingest$2, body);
1672
1672
  const snapshot = luvio.storeLookup({
1673
1673
  recordId: key,
1674
- node: select$b(),
1674
+ node: select$c(),
1675
1675
  variables: {},
1676
1676
  });
1677
1677
  if (process.env.NODE_ENV !== 'production') {
@@ -1682,7 +1682,7 @@ function ingestSuccess$2(luvio, resourceParams, response) {
1682
1682
  deepFreeze(snapshot.data);
1683
1683
  return snapshot;
1684
1684
  }
1685
- function createResourceRequest$2(config) {
1685
+ function createResourceRequest$3(config) {
1686
1686
  const headers = {};
1687
1687
  return {
1688
1688
  baseUri: 'api.salesforce.com',
@@ -1696,7 +1696,7 @@ function createResourceRequest$2(config) {
1696
1696
  };
1697
1697
  }
1698
1698
 
1699
- const adapterName$2 = 'getMetricFilterValues';
1699
+ const adapterName$3 = 'getMetricFilterValues';
1700
1700
  const getMetricFilterValues_ConfigPropertyMetadata = [
1701
1701
  generateParamConfigMetadata('semanticDataModel', true, 2 /* Body */, 4 /* Unsupported */),
1702
1702
  generateParamConfigMetadata('field', true, 2 /* Body */, 4 /* Unsupported */),
@@ -1706,11 +1706,11 @@ const getMetricFilterValues_ConfigPropertyMetadata = [
1706
1706
  generateParamConfigMetadata('filters', false, 2 /* Body */, 4 /* Unsupported */, true),
1707
1707
  generateParamConfigMetadata('semanticFilter', false, 2 /* Body */, 4 /* Unsupported */),
1708
1708
  ];
1709
- const getMetricFilterValues_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, getMetricFilterValues_ConfigPropertyMetadata);
1710
- const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(getMetricFilterValues_ConfigPropertyMetadata);
1711
- function typeCheckConfig$2(untrustedConfig) {
1709
+ const getMetricFilterValues_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, getMetricFilterValues_ConfigPropertyMetadata);
1710
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$5(getMetricFilterValues_ConfigPropertyMetadata);
1711
+ function typeCheckConfig$3(untrustedConfig) {
1712
1712
  const config = {};
1713
- typeCheckConfig$4(untrustedConfig, config, getMetricFilterValues_ConfigPropertyMetadata);
1713
+ typeCheckConfig$5(untrustedConfig, config, getMetricFilterValues_ConfigPropertyMetadata);
1714
1714
  const untrustedConfig_semanticDataModel = untrustedConfig.semanticDataModel;
1715
1715
  const referenceSemanticDataModelValidationError = validate$q(untrustedConfig_semanticDataModel);
1716
1716
  if (referenceSemanticDataModelValidationError === null) {
@@ -1740,30 +1740,30 @@ function typeCheckConfig$2(untrustedConfig) {
1740
1740
  }
1741
1741
  return config;
1742
1742
  }
1743
- function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
1743
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1744
1744
  if (!untrustedIsObject(untrustedConfig)) {
1745
1745
  return null;
1746
1746
  }
1747
1747
  if (process.env.NODE_ENV !== 'production') {
1748
1748
  validateConfig(untrustedConfig, configPropertyNames);
1749
1749
  }
1750
- const config = typeCheckConfig$2(untrustedConfig);
1750
+ const config = typeCheckConfig$3(untrustedConfig);
1751
1751
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1752
1752
  return null;
1753
1753
  }
1754
1754
  return config;
1755
1755
  }
1756
- function buildNetworkSnapshot$2(luvio, config, options) {
1757
- const resourceParams = createResourceParams$2(config);
1758
- const request = createResourceRequest$2(resourceParams);
1756
+ function buildNetworkSnapshot$3(luvio, config, options) {
1757
+ const resourceParams = createResourceParams$3(config);
1758
+ const request = createResourceRequest$3(resourceParams);
1759
1759
  return luvio.dispatchResourceRequest(request, options)
1760
1760
  .then((response) => {
1761
1761
  return luvio.handleSuccessResponse(() => {
1762
- const snapshot = ingestSuccess$2(luvio, resourceParams, response);
1762
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
1763
1763
  return luvio.storeBroadcast().then(() => snapshot);
1764
1764
  }, () => {
1765
1765
  const cache = new StoreKeyMap();
1766
- getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
1766
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1767
1767
  return cache;
1768
1768
  });
1769
1769
  }, (response) => {
@@ -1773,12 +1773,12 @@ function buildNetworkSnapshot$2(luvio, config, options) {
1773
1773
  }
1774
1774
  const getMetricFilterValuesAdapterFactory = (luvio) => {
1775
1775
  return function getMetricFilterValues(untrustedConfig) {
1776
- const config = validateAdapterConfig$2(untrustedConfig, getMetricFilterValues_ConfigPropertyNames);
1776
+ const config = validateAdapterConfig$3(untrustedConfig, getMetricFilterValues_ConfigPropertyNames);
1777
1777
  // Invalid or incomplete config
1778
1778
  if (config === null) {
1779
1779
  throw new Error('Invalid config for "getMetricFilterValues"');
1780
1780
  }
1781
- return buildNetworkSnapshot$2(luvio, config);
1781
+ return buildNetworkSnapshot$3(luvio, config);
1782
1782
  };
1783
1783
  };
1784
1784
 
@@ -1808,7 +1808,7 @@ function validate$8(obj, path = 'InsightFeedbackMetadata') {
1808
1808
  })();
1809
1809
  return v_error === undefined ? null : v_error;
1810
1810
  }
1811
- const select$a = function InsightFeedbackMetadataSelect() {
1811
+ const select$b = function InsightFeedbackMetadataSelect() {
1812
1812
  return {
1813
1813
  kind: 'Fragment',
1814
1814
  version: VERSION$8,
@@ -1951,8 +1951,8 @@ function validate$7(obj, path = 'Insight') {
1951
1951
  })();
1952
1952
  return v_error === undefined ? null : v_error;
1953
1953
  }
1954
- const select$9 = function InsightSelect() {
1955
- const { selections: InsightFeedbackMetadata__selections, opaque: InsightFeedbackMetadata__opaque, } = select$a();
1954
+ const select$a = function InsightSelect() {
1955
+ const { selections: InsightFeedbackMetadata__selections, opaque: InsightFeedbackMetadata__opaque, } = select$b();
1956
1956
  return {
1957
1957
  kind: 'Fragment',
1958
1958
  version: VERSION$7,
@@ -2137,7 +2137,7 @@ function equals$7(existing, incoming) {
2137
2137
  return true;
2138
2138
  }
2139
2139
 
2140
- const VERSION$6 = "6707f0d0aa09112abbca1db5e32bb172";
2140
+ const VERSION$6 = "09a140bdbc97294bdce2b9555910f209";
2141
2141
  function validate$6(obj, path = 'InsightResponse') {
2142
2142
  const v_error = (() => {
2143
2143
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -2160,20 +2160,22 @@ function validate$6(obj, path = 'InsightResponse') {
2160
2160
  return new TypeError('Expected "string" but received "' + typeof obj_insightType + '" (at "' + path_insightType + '")');
2161
2161
  }
2162
2162
  }
2163
- const obj_result = obj.result;
2164
- const path_result = path + '.result';
2165
- const referencepath_resultValidationError = validate$7(obj_result, path_result);
2166
- if (referencepath_resultValidationError !== null) {
2167
- let message = 'Object doesn\'t match Insight (at "' + path_result + '")\n';
2168
- message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2169
- return new TypeError(message);
2163
+ if (obj.result !== undefined) {
2164
+ const obj_result = obj.result;
2165
+ const path_result = path + '.result';
2166
+ const referencepath_resultValidationError = validate$7(obj_result, path_result);
2167
+ if (referencepath_resultValidationError !== null) {
2168
+ let message = 'Object doesn\'t match Insight (at "' + path_result + '")\n';
2169
+ message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2170
+ return new TypeError(message);
2171
+ }
2170
2172
  }
2171
2173
  })();
2172
2174
  return v_error === undefined ? null : v_error;
2173
2175
  }
2174
- const select$8 = function InsightResponseSelect() {
2175
- const { selections: Error__selections, opaque: Error__opaque, } = select$i();
2176
- const { selections: Insight__selections, opaque: Insight__opaque, } = select$9();
2176
+ const select$9 = function InsightResponseSelect() {
2177
+ const { selections: Error__selections, opaque: Error__opaque, } = select$j();
2178
+ const { selections: Insight__selections, opaque: Insight__opaque, } = select$a();
2177
2179
  return {
2178
2180
  kind: 'Fragment',
2179
2181
  version: VERSION$6,
@@ -2193,7 +2195,8 @@ const select$8 = function InsightResponseSelect() {
2193
2195
  {
2194
2196
  name: 'result',
2195
2197
  kind: 'Object',
2196
- selections: Insight__selections
2198
+ selections: Insight__selections,
2199
+ required: false
2197
2200
  }
2198
2201
  ]
2199
2202
  };
@@ -2227,8 +2230,16 @@ function equals$6(existing, incoming) {
2227
2230
  }
2228
2231
  const existing_result = existing.result;
2229
2232
  const incoming_result = incoming.result;
2230
- if (!(equals$7(existing_result, incoming_result))) {
2231
- return false;
2233
+ // if at least one of these optionals is defined
2234
+ if (existing_result !== undefined || incoming_result !== undefined) {
2235
+ // if one of these is not defined we know the other is defined and therefore
2236
+ // not equal
2237
+ if (existing_result === undefined || incoming_result === undefined) {
2238
+ return false;
2239
+ }
2240
+ if (!(equals$7(existing_result, incoming_result))) {
2241
+ return false;
2242
+ }
2232
2243
  }
2233
2244
  return true;
2234
2245
  }
@@ -2249,7 +2260,7 @@ function validate$5(obj, path = 'Overview') {
2249
2260
  })();
2250
2261
  return v_error === undefined ? null : v_error;
2251
2262
  }
2252
- const select$7 = function OverviewSelect() {
2263
+ const select$8 = function OverviewSelect() {
2253
2264
  return {
2254
2265
  kind: 'Fragment',
2255
2266
  version: VERSION$5,
@@ -2280,7 +2291,7 @@ function equals$5(existing, incoming) {
2280
2291
  return true;
2281
2292
  }
2282
2293
 
2283
- const VERSION$4 = "ac3296a9832f46fda66420bc753d8c61";
2294
+ const VERSION$4 = "ff01bfcbb0b2877fe279be648aceb371";
2284
2295
  function validate$4(obj, path = 'OverviewResponse') {
2285
2296
  const v_error = (() => {
2286
2297
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -2296,20 +2307,22 @@ function validate$4(obj, path = 'OverviewResponse') {
2296
2307
  return new TypeError(message);
2297
2308
  }
2298
2309
  }
2299
- const obj_result = obj.result;
2300
- const path_result = path + '.result';
2301
- const referencepath_resultValidationError = validate$5(obj_result, path_result);
2302
- if (referencepath_resultValidationError !== null) {
2303
- let message = 'Object doesn\'t match Overview (at "' + path_result + '")\n';
2304
- message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2305
- return new TypeError(message);
2310
+ if (obj.result !== undefined) {
2311
+ const obj_result = obj.result;
2312
+ const path_result = path + '.result';
2313
+ const referencepath_resultValidationError = validate$5(obj_result, path_result);
2314
+ if (referencepath_resultValidationError !== null) {
2315
+ let message = 'Object doesn\'t match Overview (at "' + path_result + '")\n';
2316
+ message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2317
+ return new TypeError(message);
2318
+ }
2306
2319
  }
2307
2320
  })();
2308
2321
  return v_error === undefined ? null : v_error;
2309
2322
  }
2310
- const select$6 = function OverviewResponseSelect() {
2311
- const { selections: Error__selections, opaque: Error__opaque, } = select$i();
2312
- const { selections: Overview__selections, opaque: Overview__opaque, } = select$7();
2323
+ const select$7 = function OverviewResponseSelect() {
2324
+ const { selections: Error__selections, opaque: Error__opaque, } = select$j();
2325
+ const { selections: Overview__selections, opaque: Overview__opaque, } = select$8();
2313
2326
  return {
2314
2327
  kind: 'Fragment',
2315
2328
  version: VERSION$4,
@@ -2324,7 +2337,8 @@ const select$6 = function OverviewResponseSelect() {
2324
2337
  {
2325
2338
  name: 'result',
2326
2339
  kind: 'Object',
2327
- selections: Overview__selections
2340
+ selections: Overview__selections,
2341
+ required: false
2328
2342
  }
2329
2343
  ]
2330
2344
  };
@@ -2345,8 +2359,16 @@ function equals$4(existing, incoming) {
2345
2359
  }
2346
2360
  const existing_result = existing.result;
2347
2361
  const incoming_result = incoming.result;
2348
- if (!(equals$5(existing_result, incoming_result))) {
2349
- return false;
2362
+ // if at least one of these optionals is defined
2363
+ if (existing_result !== undefined || incoming_result !== undefined) {
2364
+ // if one of these is not defined we know the other is defined and therefore
2365
+ // not equal
2366
+ if (existing_result === undefined || incoming_result === undefined) {
2367
+ return false;
2368
+ }
2369
+ if (!(equals$5(existing_result, incoming_result))) {
2370
+ return false;
2371
+ }
2350
2372
  }
2351
2373
  return true;
2352
2374
  }
@@ -2411,10 +2433,10 @@ function validate$3(obj, path = 'InsightGroup') {
2411
2433
  })();
2412
2434
  return v_error === undefined ? null : v_error;
2413
2435
  }
2414
- const select$5 = function InsightGroupSelect() {
2415
- const { selections: Error__selections, opaque: Error__opaque, } = select$i();
2416
- const { selections: InsightResponse__selections, opaque: InsightResponse__opaque, } = select$8();
2417
- const { selections: OverviewResponse__selections, opaque: OverviewResponse__opaque, } = select$6();
2436
+ const select$6 = function InsightGroupSelect() {
2437
+ const { selections: Error__selections, opaque: Error__opaque, } = select$j();
2438
+ const { selections: InsightResponse__selections, opaque: InsightResponse__opaque, } = select$9();
2439
+ const { selections: OverviewResponse__selections, opaque: OverviewResponse__opaque, } = select$7();
2418
2440
  return {
2419
2441
  kind: 'Fragment',
2420
2442
  version: VERSION$3,
@@ -2554,8 +2576,8 @@ function validate$2(obj, path = 'InsightBundle') {
2554
2576
  })();
2555
2577
  return v_error === undefined ? null : v_error;
2556
2578
  }
2557
- const select$4 = function InsightBundleSelect() {
2558
- const { selections: InsightGroup__selections, opaque: InsightGroup__opaque, } = select$5();
2579
+ const select$5 = function InsightBundleSelect() {
2580
+ const { selections: InsightGroup__selections, opaque: InsightGroup__opaque, } = select$6();
2559
2581
  return {
2560
2582
  kind: 'Fragment',
2561
2583
  version: VERSION$2,
@@ -2681,9 +2703,9 @@ function keyBuilderFromType$1(luvio, object) {
2681
2703
  function normalize$1(input, existing, path, luvio, store, timestamp) {
2682
2704
  return input;
2683
2705
  }
2684
- const select$3 = function GenerateInsightBundleResponseSelect() {
2685
- const { selections: Error__selections, opaque: Error__opaque, } = select$i();
2686
- const { selections: InsightBundle__selections, opaque: InsightBundle__opaque, } = select$4();
2706
+ const select$4 = function GenerateInsightBundleResponseSelect() {
2707
+ const { selections: Error__selections, opaque: Error__opaque, } = select$j();
2708
+ const { selections: InsightBundle__selections, opaque: InsightBundle__opaque, } = select$5();
2687
2709
  return {
2688
2710
  kind: 'Fragment',
2689
2711
  version: VERSION$1,
@@ -2773,8 +2795,111 @@ function getTypeCacheKeys$1(rootKeySet, luvio, input, fullPathFactory) {
2773
2795
  });
2774
2796
  }
2775
2797
 
2798
+ function select$3(luvio, params) {
2799
+ return select$4();
2800
+ }
2801
+ function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
2802
+ getTypeCacheKeys$1(storeKeyMap, luvio, response);
2803
+ }
2804
+ function ingestSuccess$2(luvio, resourceParams, response) {
2805
+ const { body } = response;
2806
+ const key = keyBuilderFromType$1(luvio, body);
2807
+ luvio.storeIngest(key, ingest$1, body);
2808
+ const snapshot = luvio.storeLookup({
2809
+ recordId: key,
2810
+ node: select$3(),
2811
+ variables: {},
2812
+ });
2813
+ if (process.env.NODE_ENV !== 'production') {
2814
+ if (snapshot.state !== 'Fulfilled') {
2815
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2816
+ }
2817
+ }
2818
+ deepFreeze(snapshot.data);
2819
+ return snapshot;
2820
+ }
2821
+ function createResourceRequest$2(config) {
2822
+ const headers = {};
2823
+ return {
2824
+ baseUri: 'api.salesforce.com',
2825
+ basePath: '/analytics/insights/v1/generateBundle',
2826
+ method: 'post',
2827
+ body: config.body,
2828
+ urlParams: {},
2829
+ queryParams: {},
2830
+ headers,
2831
+ priority: 'normal',
2832
+ };
2833
+ }
2834
+
2835
+ const adapterName$2 = 'generateInsights';
2836
+ const generateInsights_ConfigPropertyMetadata = [
2837
+ generateParamConfigMetadata('type', false, 2 /* Body */, 0 /* String */),
2838
+ generateParamConfigMetadata('version', false, 2 /* Body */, 3 /* Integer */),
2839
+ generateParamConfigMetadata('input', false, 2 /* Body */, 4 /* Unsupported */),
2840
+ generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
2841
+ ];
2842
+ const generateInsights_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, generateInsights_ConfigPropertyMetadata);
2843
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$5(generateInsights_ConfigPropertyMetadata);
2844
+ function typeCheckConfig$2(untrustedConfig) {
2845
+ const config = {};
2846
+ typeCheckConfig$5(untrustedConfig, config, generateInsights_ConfigPropertyMetadata);
2847
+ const untrustedConfig_input = untrustedConfig.input;
2848
+ const referenceInsightBundleInputValidationError = validate$k(untrustedConfig_input);
2849
+ if (referenceInsightBundleInputValidationError === null) {
2850
+ config.input = untrustedConfig_input;
2851
+ }
2852
+ const untrustedConfig_options = untrustedConfig.options;
2853
+ const referenceInsightBundleOptionsValidationError = validate$h(untrustedConfig_options);
2854
+ if (referenceInsightBundleOptionsValidationError === null) {
2855
+ config.options = untrustedConfig_options;
2856
+ }
2857
+ return config;
2858
+ }
2859
+ function validateAdapterConfig$2(untrustedConfig, configPropertyNames) {
2860
+ if (!untrustedIsObject(untrustedConfig)) {
2861
+ return null;
2862
+ }
2863
+ if (process.env.NODE_ENV !== 'production') {
2864
+ validateConfig(untrustedConfig, configPropertyNames);
2865
+ }
2866
+ const config = typeCheckConfig$2(untrustedConfig);
2867
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2868
+ return null;
2869
+ }
2870
+ return config;
2871
+ }
2872
+ function buildNetworkSnapshot$2(luvio, config, options) {
2873
+ const resourceParams = createResourceParams$2(config);
2874
+ const request = createResourceRequest$2(resourceParams);
2875
+ return luvio.dispatchResourceRequest(request, options)
2876
+ .then((response) => {
2877
+ return luvio.handleSuccessResponse(() => {
2878
+ const snapshot = ingestSuccess$2(luvio, resourceParams, response);
2879
+ return luvio.storeBroadcast().then(() => snapshot);
2880
+ }, () => {
2881
+ const cache = new StoreKeyMap();
2882
+ getResponseCacheKeys$2(cache, luvio, resourceParams, response.body);
2883
+ return cache;
2884
+ });
2885
+ }, (response) => {
2886
+ deepFreeze(response);
2887
+ throw response;
2888
+ });
2889
+ }
2890
+ const generateInsightsAdapterFactory = (luvio) => {
2891
+ return function generateInsights(untrustedConfig) {
2892
+ const config = validateAdapterConfig$2(untrustedConfig, generateInsights_ConfigPropertyNames);
2893
+ // Invalid or incomplete config
2894
+ if (config === null) {
2895
+ throw new Error('Invalid config for "generateInsights"');
2896
+ }
2897
+ return buildNetworkSnapshot$2(luvio, config);
2898
+ };
2899
+ };
2900
+
2776
2901
  function select$2(luvio, params) {
2777
- return select$3();
2902
+ return select$4();
2778
2903
  }
2779
2904
  function getResponseCacheKeys$1(storeKeyMap, luvio, resourceParams, response) {
2780
2905
  getTypeCacheKeys$1(storeKeyMap, luvio, response);
@@ -2800,7 +2925,7 @@ function createResourceRequest$1(config) {
2800
2925
  const headers = {};
2801
2926
  return {
2802
2927
  baseUri: 'api.salesforce.com',
2803
- basePath: '/analytics/insights/v1/generateBundle',
2928
+ basePath: '/analytics/insights/v1/basic/generateBundle',
2804
2929
  method: 'post',
2805
2930
  body: config.body,
2806
2931
  urlParams: {},
@@ -2810,18 +2935,18 @@ function createResourceRequest$1(config) {
2810
2935
  };
2811
2936
  }
2812
2937
 
2813
- const adapterName$1 = 'generateInsights';
2814
- const generateInsights_ConfigPropertyMetadata = [
2938
+ const adapterName$1 = 'generateInsightsBasic';
2939
+ const generateInsightsBasic_ConfigPropertyMetadata = [
2815
2940
  generateParamConfigMetadata('type', false, 2 /* Body */, 0 /* String */),
2816
2941
  generateParamConfigMetadata('version', false, 2 /* Body */, 3 /* Integer */),
2817
2942
  generateParamConfigMetadata('input', false, 2 /* Body */, 4 /* Unsupported */),
2818
2943
  generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
2819
2944
  ];
2820
- const generateInsights_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, generateInsights_ConfigPropertyMetadata);
2821
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(generateInsights_ConfigPropertyMetadata);
2945
+ const generateInsightsBasic_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, generateInsightsBasic_ConfigPropertyMetadata);
2946
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$5(generateInsightsBasic_ConfigPropertyMetadata);
2822
2947
  function typeCheckConfig$1(untrustedConfig) {
2823
2948
  const config = {};
2824
- typeCheckConfig$4(untrustedConfig, config, generateInsights_ConfigPropertyMetadata);
2949
+ typeCheckConfig$5(untrustedConfig, config, generateInsightsBasic_ConfigPropertyMetadata);
2825
2950
  const untrustedConfig_input = untrustedConfig.input;
2826
2951
  const referenceInsightBundleInputValidationError = validate$k(untrustedConfig_input);
2827
2952
  if (referenceInsightBundleInputValidationError === null) {
@@ -2865,17 +2990,18 @@ function buildNetworkSnapshot$1(luvio, config, options) {
2865
2990
  throw response;
2866
2991
  });
2867
2992
  }
2868
- const generateInsightsAdapterFactory = (luvio) => {
2869
- return function generateInsights(untrustedConfig) {
2870
- const config = validateAdapterConfig$1(untrustedConfig, generateInsights_ConfigPropertyNames);
2993
+ const generateInsightsBasicAdapterFactory = (luvio) => {
2994
+ return function generateInsightsBasic(untrustedConfig) {
2995
+ const config = validateAdapterConfig$1(untrustedConfig, generateInsightsBasic_ConfigPropertyNames);
2871
2996
  // Invalid or incomplete config
2872
2997
  if (config === null) {
2873
- throw new Error('Invalid config for "generateInsights"');
2998
+ throw new Error('Invalid config for "generateInsightsBasic"');
2874
2999
  }
2875
3000
  return buildNetworkSnapshot$1(luvio, config);
2876
3001
  };
2877
3002
  };
2878
3003
 
3004
+ const TTL = 5000;
2879
3005
  const VERSION = "b3ecf416df1c88948a22534e1143e6d5";
2880
3006
  function validate(obj, path = 'GetInsightBatchResponse') {
2881
3007
  const v_error = (() => {
@@ -2960,7 +3086,7 @@ function normalize(input, existing, path, luvio, store, timestamp) {
2960
3086
  return input;
2961
3087
  }
2962
3088
  const select$1 = function GetInsightBatchResponseSelect() {
2963
- const { selections: SummaryResponse__selections, opaque: SummaryResponse__opaque, } = select$g();
3089
+ const { selections: SummaryResponse__selections, opaque: SummaryResponse__opaque, } = select$h();
2964
3090
  return {
2965
3091
  kind: 'Fragment',
2966
3092
  version: VERSION,
@@ -2975,7 +3101,7 @@ const select$1 = function GetInsightBatchResponseSelect() {
2975
3101
  kind: 'Link',
2976
3102
  plural: true,
2977
3103
  required: false,
2978
- fragment: select$3()
3104
+ fragment: select$4()
2979
3105
  },
2980
3106
  {
2981
3107
  name: 'hasErrors',
@@ -3069,7 +3195,7 @@ const ingest = function GetInsightBatchResponseIngest(input, path, luvio, store,
3069
3195
  }
3070
3196
  }
3071
3197
  const key = keyBuilderFromType(luvio, input);
3072
- const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
3198
+ const ttlToUse = TTL;
3073
3199
  ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "analytics-insights", VERSION, RepresentationType, equals);
3074
3200
  return createLink(key);
3075
3201
  };
@@ -3120,7 +3246,13 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
3120
3246
  function ingestError(luvio, params, error, snapshotRefresh) {
3121
3247
  const key = keyBuilder$1(luvio, params);
3122
3248
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3123
- luvio.storeIngestError(key, errorSnapshot);
3249
+ const storeMetadataParams = {
3250
+ ttl: TTL,
3251
+ namespace: keyPrefix,
3252
+ version: VERSION,
3253
+ representationName: RepresentationType
3254
+ };
3255
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
3124
3256
  return errorSnapshot;
3125
3257
  }
3126
3258
  function createResourceRequest(config) {
@@ -3142,14 +3274,14 @@ const getInsightsBatch_ConfigPropertyMetadata = [
3142
3274
  generateParamConfigMetadata('batchId', true, 0 /* UrlParameter */, 0 /* String */),
3143
3275
  ];
3144
3276
  const getInsightsBatch_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getInsightsBatch_ConfigPropertyMetadata);
3145
- const createResourceParams = /*#__PURE__*/ createResourceParams$4(getInsightsBatch_ConfigPropertyMetadata);
3277
+ const createResourceParams = /*#__PURE__*/ createResourceParams$5(getInsightsBatch_ConfigPropertyMetadata);
3146
3278
  function keyBuilder(luvio, config) {
3147
3279
  const resourceParams = createResourceParams(config);
3148
3280
  return keyBuilder$1(luvio, resourceParams);
3149
3281
  }
3150
3282
  function typeCheckConfig(untrustedConfig) {
3151
3283
  const config = {};
3152
- typeCheckConfig$4(untrustedConfig, config, getInsightsBatch_ConfigPropertyMetadata);
3284
+ typeCheckConfig$5(untrustedConfig, config, getInsightsBatch_ConfigPropertyMetadata);
3153
3285
  return config;
3154
3286
  }
3155
3287
  function validateAdapterConfig(untrustedConfig, configPropertyNames) {
@@ -3223,4 +3355,4 @@ const getInsightsBatchAdapterFactory = (luvio) => function analyticsInsights__ge
3223
3355
  buildCachedSnapshotCachePolicy, buildNetworkSnapshotCachePolicy);
3224
3356
  };
3225
3357
 
3226
- export { createInsightsBatchAdapterFactory, generateInsightsAdapterFactory, getInsightsBatchAdapterFactory, getMetricFilterValuesAdapterFactory };
3358
+ export { createInsightsBatchAdapterFactory, generateInsightsAdapterFactory, generateInsightsBasicAdapterFactory, getInsightsBatchAdapterFactory, getMetricFilterValuesAdapterFactory };