@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.
package/sfdc/index.js CHANGED
@@ -14,7 +14,7 @@
14
14
  /* proxy-compat-disable */
15
15
  import { createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, createImperativeAdapter } from 'force/ldsBindings';
16
16
  import { withDefaultLuvio } from 'force/ldsEngine';
17
- import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$4, typeCheckConfig as typeCheckConfig$4, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } from 'force/luvioEngine';
17
+ import { serializeStructuredKey, ingestShape, deepFreeze, StoreKeyMap, createResourceParams as createResourceParams$5, typeCheckConfig as typeCheckConfig$5, buildNetworkSnapshotCachePolicy as buildNetworkSnapshotCachePolicy$1 } from 'force/luvioEngine';
18
18
 
19
19
  const { hasOwnProperty: ObjectPrototypeHasOwnProperty } = Object.prototype;
20
20
  const { keys: ObjectKeys, create: ObjectCreate } = Object;
@@ -974,7 +974,7 @@ function validate$e(obj, path = 'Error') {
974
974
  })();
975
975
  return v_error === undefined ? null : v_error;
976
976
  }
977
- const select$i = function ErrorSelect() {
977
+ const select$j = function ErrorSelect() {
978
978
  return {
979
979
  kind: 'Fragment',
980
980
  version: VERSION$e,
@@ -1052,7 +1052,7 @@ function validate$d(obj, path = 'Summary') {
1052
1052
  })();
1053
1053
  return v_error === undefined ? null : v_error;
1054
1054
  }
1055
- const select$h = function SummarySelect() {
1055
+ const select$i = function SummarySelect() {
1056
1056
  return {
1057
1057
  kind: 'Fragment',
1058
1058
  version: VERSION$d,
@@ -1128,9 +1128,9 @@ function validate$c(obj, path = 'SummaryResponse') {
1128
1128
  })();
1129
1129
  return v_error === undefined ? null : v_error;
1130
1130
  }
1131
- const select$g = function SummaryResponseSelect() {
1132
- const { selections: Error__selections, opaque: Error__opaque, } = select$i();
1133
- const { selections: Summary__selections, opaque: Summary__opaque, } = select$h();
1131
+ const select$h = function SummaryResponseSelect() {
1132
+ const { selections: Error__selections, opaque: Error__opaque, } = select$j();
1133
+ const { selections: Summary__selections, opaque: Summary__opaque, } = select$i();
1134
1134
  return {
1135
1135
  kind: 'Fragment',
1136
1136
  version: VERSION$c,
@@ -1223,8 +1223,8 @@ function keyBuilderFromType$3(luvio, object) {
1223
1223
  function normalize$3(input, existing, path, luvio, store, timestamp) {
1224
1224
  return input;
1225
1225
  }
1226
- const select$f = function GenerateInsightBatchResponseSelect() {
1227
- const { selections: SummaryResponse__selections, opaque: SummaryResponse__opaque, } = select$g();
1226
+ const select$g = function GenerateInsightBatchResponseSelect() {
1227
+ const { selections: SummaryResponse__selections, opaque: SummaryResponse__opaque, } = select$h();
1228
1228
  return {
1229
1229
  kind: 'Fragment',
1230
1230
  version: VERSION$b,
@@ -1322,19 +1322,19 @@ function getTypeCacheKeys$3(rootKeySet, luvio, input, fullPathFactory) {
1322
1322
  });
1323
1323
  }
1324
1324
 
1325
- function select$e(luvio, params) {
1326
- return select$f();
1325
+ function select$f(luvio, params) {
1326
+ return select$g();
1327
1327
  }
1328
- function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
1328
+ function getResponseCacheKeys$4(storeKeyMap, luvio, resourceParams, response) {
1329
1329
  getTypeCacheKeys$3(storeKeyMap, luvio, response);
1330
1330
  }
1331
- function ingestSuccess$3(luvio, resourceParams, response) {
1331
+ function ingestSuccess$4(luvio, resourceParams, response) {
1332
1332
  const { body } = response;
1333
1333
  const key = keyBuilderFromType$3(luvio, body);
1334
1334
  luvio.storeIngest(key, ingest$3, body);
1335
1335
  const snapshot = luvio.storeLookup({
1336
1336
  recordId: key,
1337
- node: select$e(),
1337
+ node: select$f(),
1338
1338
  variables: {},
1339
1339
  });
1340
1340
  if (process.env.NODE_ENV !== 'production') {
@@ -1345,7 +1345,7 @@ function ingestSuccess$3(luvio, resourceParams, response) {
1345
1345
  deepFreeze(snapshot.data);
1346
1346
  return snapshot;
1347
1347
  }
1348
- function createResourceRequest$3(config) {
1348
+ function createResourceRequest$4(config) {
1349
1349
  const headers = {};
1350
1350
  return {
1351
1351
  baseUri: 'api.salesforce.com',
@@ -1359,14 +1359,14 @@ function createResourceRequest$3(config) {
1359
1359
  };
1360
1360
  }
1361
1361
 
1362
- const adapterName$3 = 'createInsightsBatch';
1362
+ const adapterName$4 = 'createInsightsBatch';
1363
1363
  const createInsightsBatch_ConfigPropertyMetadata = [
1364
1364
  generateParamConfigMetadata('batchInput', false, 2 /* Body */, 4 /* Unsupported */, true),
1365
1365
  generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
1366
1366
  ];
1367
- const createInsightsBatch_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, createInsightsBatch_ConfigPropertyMetadata);
1368
- const createResourceParams$3 = /*#__PURE__*/ createResourceParams$4(createInsightsBatch_ConfigPropertyMetadata);
1369
- function typeCheckConfig$3(untrustedConfig) {
1367
+ const createInsightsBatch_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$4, createInsightsBatch_ConfigPropertyMetadata);
1368
+ const createResourceParams$4 = /*#__PURE__*/ createResourceParams$5(createInsightsBatch_ConfigPropertyMetadata);
1369
+ function typeCheckConfig$4(untrustedConfig) {
1370
1370
  const config = {};
1371
1371
  const untrustedConfig_batchInput = untrustedConfig.batchInput;
1372
1372
  if (ArrayIsArray$1(untrustedConfig_batchInput)) {
@@ -1387,30 +1387,30 @@ function typeCheckConfig$3(untrustedConfig) {
1387
1387
  }
1388
1388
  return config;
1389
1389
  }
1390
- function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
1390
+ function validateAdapterConfig$4(untrustedConfig, configPropertyNames) {
1391
1391
  if (!untrustedIsObject(untrustedConfig)) {
1392
1392
  return null;
1393
1393
  }
1394
1394
  if (process.env.NODE_ENV !== 'production') {
1395
1395
  validateConfig(untrustedConfig, configPropertyNames);
1396
1396
  }
1397
- const config = typeCheckConfig$3(untrustedConfig);
1397
+ const config = typeCheckConfig$4(untrustedConfig);
1398
1398
  if (!areRequiredParametersPresent(config, configPropertyNames)) {
1399
1399
  return null;
1400
1400
  }
1401
1401
  return config;
1402
1402
  }
1403
- function buildNetworkSnapshot$3(luvio, config, options) {
1404
- const resourceParams = createResourceParams$3(config);
1405
- const request = createResourceRequest$3(resourceParams);
1403
+ function buildNetworkSnapshot$4(luvio, config, options) {
1404
+ const resourceParams = createResourceParams$4(config);
1405
+ const request = createResourceRequest$4(resourceParams);
1406
1406
  return luvio.dispatchResourceRequest(request, options)
1407
1407
  .then((response) => {
1408
1408
  return luvio.handleSuccessResponse(() => {
1409
- const snapshot = ingestSuccess$3(luvio, resourceParams, response);
1409
+ const snapshot = ingestSuccess$4(luvio, resourceParams, response);
1410
1410
  return luvio.storeBroadcast().then(() => snapshot);
1411
1411
  }, () => {
1412
1412
  const cache = new StoreKeyMap();
1413
- getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
1413
+ getResponseCacheKeys$4(cache, luvio, resourceParams, response.body);
1414
1414
  return cache;
1415
1415
  });
1416
1416
  }, (response) => {
@@ -1420,12 +1420,12 @@ function buildNetworkSnapshot$3(luvio, config, options) {
1420
1420
  }
1421
1421
  const createInsightsBatchAdapterFactory = (luvio) => {
1422
1422
  return function createInsightsBatch(untrustedConfig) {
1423
- const config = validateAdapterConfig$3(untrustedConfig, createInsightsBatch_ConfigPropertyNames);
1423
+ const config = validateAdapterConfig$4(untrustedConfig, createInsightsBatch_ConfigPropertyNames);
1424
1424
  // Invalid or incomplete config
1425
1425
  if (config === null) {
1426
1426
  throw new Error('Invalid config for "createInsightsBatch"');
1427
1427
  }
1428
- return buildNetworkSnapshot$3(luvio, config);
1428
+ return buildNetworkSnapshot$4(luvio, config);
1429
1429
  };
1430
1430
  };
1431
1431
 
@@ -1455,7 +1455,7 @@ function validate$a(obj, path = 'InsightFeedbackMetadata') {
1455
1455
  })();
1456
1456
  return v_error === undefined ? null : v_error;
1457
1457
  }
1458
- const select$d = function InsightFeedbackMetadataSelect() {
1458
+ const select$e = function InsightFeedbackMetadataSelect() {
1459
1459
  return {
1460
1460
  kind: 'Fragment',
1461
1461
  version: VERSION$a,
@@ -1598,8 +1598,8 @@ function validate$9(obj, path = 'Insight') {
1598
1598
  })();
1599
1599
  return v_error === undefined ? null : v_error;
1600
1600
  }
1601
- const select$c = function InsightSelect() {
1602
- const { selections: InsightFeedbackMetadata__selections, opaque: InsightFeedbackMetadata__opaque, } = select$d();
1601
+ const select$d = function InsightSelect() {
1602
+ const { selections: InsightFeedbackMetadata__selections, opaque: InsightFeedbackMetadata__opaque, } = select$e();
1603
1603
  return {
1604
1604
  kind: 'Fragment',
1605
1605
  version: VERSION$9,
@@ -1784,7 +1784,7 @@ function equals$9(existing, incoming) {
1784
1784
  return true;
1785
1785
  }
1786
1786
 
1787
- const VERSION$8 = "6707f0d0aa09112abbca1db5e32bb172";
1787
+ const VERSION$8 = "09a140bdbc97294bdce2b9555910f209";
1788
1788
  function validate$8(obj, path = 'InsightResponse') {
1789
1789
  const v_error = (() => {
1790
1790
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -1807,20 +1807,22 @@ function validate$8(obj, path = 'InsightResponse') {
1807
1807
  return new TypeError('Expected "string" but received "' + typeof obj_insightType + '" (at "' + path_insightType + '")');
1808
1808
  }
1809
1809
  }
1810
- const obj_result = obj.result;
1811
- const path_result = path + '.result';
1812
- const referencepath_resultValidationError = validate$9(obj_result, path_result);
1813
- if (referencepath_resultValidationError !== null) {
1814
- let message = 'Object doesn\'t match Insight (at "' + path_result + '")\n';
1815
- message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1816
- return new TypeError(message);
1810
+ if (obj.result !== undefined) {
1811
+ const obj_result = obj.result;
1812
+ const path_result = path + '.result';
1813
+ const referencepath_resultValidationError = validate$9(obj_result, path_result);
1814
+ if (referencepath_resultValidationError !== null) {
1815
+ let message = 'Object doesn\'t match Insight (at "' + path_result + '")\n';
1816
+ message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1817
+ return new TypeError(message);
1818
+ }
1817
1819
  }
1818
1820
  })();
1819
1821
  return v_error === undefined ? null : v_error;
1820
1822
  }
1821
- const select$b = function InsightResponseSelect() {
1822
- const { selections: Error__selections, opaque: Error__opaque, } = select$i();
1823
- const { selections: Insight__selections, opaque: Insight__opaque, } = select$c();
1823
+ const select$c = function InsightResponseSelect() {
1824
+ const { selections: Error__selections, opaque: Error__opaque, } = select$j();
1825
+ const { selections: Insight__selections, opaque: Insight__opaque, } = select$d();
1824
1826
  return {
1825
1827
  kind: 'Fragment',
1826
1828
  version: VERSION$8,
@@ -1840,7 +1842,8 @@ const select$b = function InsightResponseSelect() {
1840
1842
  {
1841
1843
  name: 'result',
1842
1844
  kind: 'Object',
1843
- selections: Insight__selections
1845
+ selections: Insight__selections,
1846
+ required: false
1844
1847
  }
1845
1848
  ]
1846
1849
  };
@@ -1874,8 +1877,16 @@ function equals$8(existing, incoming) {
1874
1877
  }
1875
1878
  const existing_result = existing.result;
1876
1879
  const incoming_result = incoming.result;
1877
- if (!(equals$9(existing_result, incoming_result))) {
1878
- return false;
1880
+ // if at least one of these optionals is defined
1881
+ if (existing_result !== undefined || incoming_result !== undefined) {
1882
+ // if one of these is not defined we know the other is defined and therefore
1883
+ // not equal
1884
+ if (existing_result === undefined || incoming_result === undefined) {
1885
+ return false;
1886
+ }
1887
+ if (!(equals$9(existing_result, incoming_result))) {
1888
+ return false;
1889
+ }
1879
1890
  }
1880
1891
  return true;
1881
1892
  }
@@ -1896,7 +1907,7 @@ function validate$7(obj, path = 'Overview') {
1896
1907
  })();
1897
1908
  return v_error === undefined ? null : v_error;
1898
1909
  }
1899
- const select$a = function OverviewSelect() {
1910
+ const select$b = function OverviewSelect() {
1900
1911
  return {
1901
1912
  kind: 'Fragment',
1902
1913
  version: VERSION$7,
@@ -1927,7 +1938,7 @@ function equals$7(existing, incoming) {
1927
1938
  return true;
1928
1939
  }
1929
1940
 
1930
- const VERSION$6 = "ac3296a9832f46fda66420bc753d8c61";
1941
+ const VERSION$6 = "ff01bfcbb0b2877fe279be648aceb371";
1931
1942
  function validate$6(obj, path = 'OverviewResponse') {
1932
1943
  const v_error = (() => {
1933
1944
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -1943,20 +1954,22 @@ function validate$6(obj, path = 'OverviewResponse') {
1943
1954
  return new TypeError(message);
1944
1955
  }
1945
1956
  }
1946
- const obj_result = obj.result;
1947
- const path_result = path + '.result';
1948
- const referencepath_resultValidationError = validate$7(obj_result, path_result);
1949
- if (referencepath_resultValidationError !== null) {
1950
- let message = 'Object doesn\'t match Overview (at "' + path_result + '")\n';
1951
- message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1952
- return new TypeError(message);
1957
+ if (obj.result !== undefined) {
1958
+ const obj_result = obj.result;
1959
+ const path_result = path + '.result';
1960
+ const referencepath_resultValidationError = validate$7(obj_result, path_result);
1961
+ if (referencepath_resultValidationError !== null) {
1962
+ let message = 'Object doesn\'t match Overview (at "' + path_result + '")\n';
1963
+ message += referencepath_resultValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
1964
+ return new TypeError(message);
1965
+ }
1953
1966
  }
1954
1967
  })();
1955
1968
  return v_error === undefined ? null : v_error;
1956
1969
  }
1957
- const select$9 = function OverviewResponseSelect() {
1958
- const { selections: Error__selections, opaque: Error__opaque, } = select$i();
1959
- const { selections: Overview__selections, opaque: Overview__opaque, } = select$a();
1970
+ const select$a = function OverviewResponseSelect() {
1971
+ const { selections: Error__selections, opaque: Error__opaque, } = select$j();
1972
+ const { selections: Overview__selections, opaque: Overview__opaque, } = select$b();
1960
1973
  return {
1961
1974
  kind: 'Fragment',
1962
1975
  version: VERSION$6,
@@ -1971,7 +1984,8 @@ const select$9 = function OverviewResponseSelect() {
1971
1984
  {
1972
1985
  name: 'result',
1973
1986
  kind: 'Object',
1974
- selections: Overview__selections
1987
+ selections: Overview__selections,
1988
+ required: false
1975
1989
  }
1976
1990
  ]
1977
1991
  };
@@ -1992,8 +2006,16 @@ function equals$6(existing, incoming) {
1992
2006
  }
1993
2007
  const existing_result = existing.result;
1994
2008
  const incoming_result = incoming.result;
1995
- if (!(equals$7(existing_result, incoming_result))) {
1996
- return false;
2009
+ // if at least one of these optionals is defined
2010
+ if (existing_result !== undefined || incoming_result !== undefined) {
2011
+ // if one of these is not defined we know the other is defined and therefore
2012
+ // not equal
2013
+ if (existing_result === undefined || incoming_result === undefined) {
2014
+ return false;
2015
+ }
2016
+ if (!(equals$7(existing_result, incoming_result))) {
2017
+ return false;
2018
+ }
1997
2019
  }
1998
2020
  return true;
1999
2021
  }
@@ -2058,10 +2080,10 @@ function validate$5(obj, path = 'InsightGroup') {
2058
2080
  })();
2059
2081
  return v_error === undefined ? null : v_error;
2060
2082
  }
2061
- const select$8 = function InsightGroupSelect() {
2062
- const { selections: Error__selections, opaque: Error__opaque, } = select$i();
2063
- const { selections: InsightResponse__selections, opaque: InsightResponse__opaque, } = select$b();
2064
- const { selections: OverviewResponse__selections, opaque: OverviewResponse__opaque, } = select$9();
2083
+ const select$9 = function InsightGroupSelect() {
2084
+ const { selections: Error__selections, opaque: Error__opaque, } = select$j();
2085
+ const { selections: InsightResponse__selections, opaque: InsightResponse__opaque, } = select$c();
2086
+ const { selections: OverviewResponse__selections, opaque: OverviewResponse__opaque, } = select$a();
2065
2087
  return {
2066
2088
  kind: 'Fragment',
2067
2089
  version: VERSION$5,
@@ -2201,8 +2223,8 @@ function validate$4(obj, path = 'InsightBundle') {
2201
2223
  })();
2202
2224
  return v_error === undefined ? null : v_error;
2203
2225
  }
2204
- const select$7 = function InsightBundleSelect() {
2205
- const { selections: InsightGroup__selections, opaque: InsightGroup__opaque, } = select$8();
2226
+ const select$8 = function InsightBundleSelect() {
2227
+ const { selections: InsightGroup__selections, opaque: InsightGroup__opaque, } = select$9();
2206
2228
  return {
2207
2229
  kind: 'Fragment',
2208
2230
  version: VERSION$4,
@@ -2328,9 +2350,9 @@ function keyBuilderFromType$2(luvio, object) {
2328
2350
  function normalize$2(input, existing, path, luvio, store, timestamp) {
2329
2351
  return input;
2330
2352
  }
2331
- const select$6 = function GenerateInsightBundleResponseSelect() {
2332
- const { selections: Error__selections, opaque: Error__opaque, } = select$i();
2333
- const { selections: InsightBundle__selections, opaque: InsightBundle__opaque, } = select$7();
2353
+ const select$7 = function GenerateInsightBundleResponseSelect() {
2354
+ const { selections: Error__selections, opaque: Error__opaque, } = select$j();
2355
+ const { selections: InsightBundle__selections, opaque: InsightBundle__opaque, } = select$8();
2334
2356
  return {
2335
2357
  kind: 'Fragment',
2336
2358
  version: VERSION$3,
@@ -2420,8 +2442,111 @@ function getTypeCacheKeys$2(rootKeySet, luvio, input, fullPathFactory) {
2420
2442
  });
2421
2443
  }
2422
2444
 
2445
+ function select$6(luvio, params) {
2446
+ return select$7();
2447
+ }
2448
+ function getResponseCacheKeys$3(storeKeyMap, luvio, resourceParams, response) {
2449
+ getTypeCacheKeys$2(storeKeyMap, luvio, response);
2450
+ }
2451
+ function ingestSuccess$3(luvio, resourceParams, response) {
2452
+ const { body } = response;
2453
+ const key = keyBuilderFromType$2(luvio, body);
2454
+ luvio.storeIngest(key, ingest$2, body);
2455
+ const snapshot = luvio.storeLookup({
2456
+ recordId: key,
2457
+ node: select$6(),
2458
+ variables: {},
2459
+ });
2460
+ if (process.env.NODE_ENV !== 'production') {
2461
+ if (snapshot.state !== 'Fulfilled') {
2462
+ throw new Error('Invalid network response. Expected resource response to result in Fulfilled snapshot');
2463
+ }
2464
+ }
2465
+ deepFreeze(snapshot.data);
2466
+ return snapshot;
2467
+ }
2468
+ function createResourceRequest$3(config) {
2469
+ const headers = {};
2470
+ return {
2471
+ baseUri: 'api.salesforce.com',
2472
+ basePath: '/analytics/insights/v1/generateBundle',
2473
+ method: 'post',
2474
+ body: config.body,
2475
+ urlParams: {},
2476
+ queryParams: {},
2477
+ headers,
2478
+ priority: 'normal',
2479
+ };
2480
+ }
2481
+
2482
+ const adapterName$3 = 'generateInsights';
2483
+ const generateInsights_ConfigPropertyMetadata = [
2484
+ generateParamConfigMetadata('type', false, 2 /* Body */, 0 /* String */),
2485
+ generateParamConfigMetadata('version', false, 2 /* Body */, 3 /* Integer */),
2486
+ generateParamConfigMetadata('input', false, 2 /* Body */, 4 /* Unsupported */),
2487
+ generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
2488
+ ];
2489
+ const generateInsights_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$3, generateInsights_ConfigPropertyMetadata);
2490
+ const createResourceParams$3 = /*#__PURE__*/ createResourceParams$5(generateInsights_ConfigPropertyMetadata);
2491
+ function typeCheckConfig$3(untrustedConfig) {
2492
+ const config = {};
2493
+ typeCheckConfig$5(untrustedConfig, config, generateInsights_ConfigPropertyMetadata);
2494
+ const untrustedConfig_input = untrustedConfig.input;
2495
+ const referenceInsightBundleInputValidationError = validate$k(untrustedConfig_input);
2496
+ if (referenceInsightBundleInputValidationError === null) {
2497
+ config.input = untrustedConfig_input;
2498
+ }
2499
+ const untrustedConfig_options = untrustedConfig.options;
2500
+ const referenceInsightBundleOptionsValidationError = validate$h(untrustedConfig_options);
2501
+ if (referenceInsightBundleOptionsValidationError === null) {
2502
+ config.options = untrustedConfig_options;
2503
+ }
2504
+ return config;
2505
+ }
2506
+ function validateAdapterConfig$3(untrustedConfig, configPropertyNames) {
2507
+ if (!untrustedIsObject(untrustedConfig)) {
2508
+ return null;
2509
+ }
2510
+ if (process.env.NODE_ENV !== 'production') {
2511
+ validateConfig(untrustedConfig, configPropertyNames);
2512
+ }
2513
+ const config = typeCheckConfig$3(untrustedConfig);
2514
+ if (!areRequiredParametersPresent(config, configPropertyNames)) {
2515
+ return null;
2516
+ }
2517
+ return config;
2518
+ }
2519
+ function buildNetworkSnapshot$3(luvio, config, options) {
2520
+ const resourceParams = createResourceParams$3(config);
2521
+ const request = createResourceRequest$3(resourceParams);
2522
+ return luvio.dispatchResourceRequest(request, options)
2523
+ .then((response) => {
2524
+ return luvio.handleSuccessResponse(() => {
2525
+ const snapshot = ingestSuccess$3(luvio, resourceParams, response);
2526
+ return luvio.storeBroadcast().then(() => snapshot);
2527
+ }, () => {
2528
+ const cache = new StoreKeyMap();
2529
+ getResponseCacheKeys$3(cache, luvio, resourceParams, response.body);
2530
+ return cache;
2531
+ });
2532
+ }, (response) => {
2533
+ deepFreeze(response);
2534
+ throw response;
2535
+ });
2536
+ }
2537
+ const generateInsightsAdapterFactory = (luvio) => {
2538
+ return function generateInsights(untrustedConfig) {
2539
+ const config = validateAdapterConfig$3(untrustedConfig, generateInsights_ConfigPropertyNames);
2540
+ // Invalid or incomplete config
2541
+ if (config === null) {
2542
+ throw new Error('Invalid config for "generateInsights"');
2543
+ }
2544
+ return buildNetworkSnapshot$3(luvio, config);
2545
+ };
2546
+ };
2547
+
2423
2548
  function select$5(luvio, params) {
2424
- return select$6();
2549
+ return select$7();
2425
2550
  }
2426
2551
  function getResponseCacheKeys$2(storeKeyMap, luvio, resourceParams, response) {
2427
2552
  getTypeCacheKeys$2(storeKeyMap, luvio, response);
@@ -2447,7 +2572,7 @@ function createResourceRequest$2(config) {
2447
2572
  const headers = {};
2448
2573
  return {
2449
2574
  baseUri: 'api.salesforce.com',
2450
- basePath: '/analytics/insights/v1/generateBundle',
2575
+ basePath: '/analytics/insights/v1/basic/generateBundle',
2451
2576
  method: 'post',
2452
2577
  body: config.body,
2453
2578
  urlParams: {},
@@ -2457,18 +2582,18 @@ function createResourceRequest$2(config) {
2457
2582
  };
2458
2583
  }
2459
2584
 
2460
- const adapterName$2 = 'generateInsights';
2461
- const generateInsights_ConfigPropertyMetadata = [
2585
+ const adapterName$2 = 'generateInsightsBasic';
2586
+ const generateInsightsBasic_ConfigPropertyMetadata = [
2462
2587
  generateParamConfigMetadata('type', false, 2 /* Body */, 0 /* String */),
2463
2588
  generateParamConfigMetadata('version', false, 2 /* Body */, 3 /* Integer */),
2464
2589
  generateParamConfigMetadata('input', false, 2 /* Body */, 4 /* Unsupported */),
2465
2590
  generateParamConfigMetadata('options', false, 2 /* Body */, 4 /* Unsupported */),
2466
2591
  ];
2467
- const generateInsights_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, generateInsights_ConfigPropertyMetadata);
2468
- const createResourceParams$2 = /*#__PURE__*/ createResourceParams$4(generateInsights_ConfigPropertyMetadata);
2592
+ const generateInsightsBasic_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$2, generateInsightsBasic_ConfigPropertyMetadata);
2593
+ const createResourceParams$2 = /*#__PURE__*/ createResourceParams$5(generateInsightsBasic_ConfigPropertyMetadata);
2469
2594
  function typeCheckConfig$2(untrustedConfig) {
2470
2595
  const config = {};
2471
- typeCheckConfig$4(untrustedConfig, config, generateInsights_ConfigPropertyMetadata);
2596
+ typeCheckConfig$5(untrustedConfig, config, generateInsightsBasic_ConfigPropertyMetadata);
2472
2597
  const untrustedConfig_input = untrustedConfig.input;
2473
2598
  const referenceInsightBundleInputValidationError = validate$k(untrustedConfig_input);
2474
2599
  if (referenceInsightBundleInputValidationError === null) {
@@ -2512,17 +2637,18 @@ function buildNetworkSnapshot$2(luvio, config, options) {
2512
2637
  throw response;
2513
2638
  });
2514
2639
  }
2515
- const generateInsightsAdapterFactory = (luvio) => {
2516
- return function generateInsights(untrustedConfig) {
2517
- const config = validateAdapterConfig$2(untrustedConfig, generateInsights_ConfigPropertyNames);
2640
+ const generateInsightsBasicAdapterFactory = (luvio) => {
2641
+ return function generateInsightsBasic(untrustedConfig) {
2642
+ const config = validateAdapterConfig$2(untrustedConfig, generateInsightsBasic_ConfigPropertyNames);
2518
2643
  // Invalid or incomplete config
2519
2644
  if (config === null) {
2520
- throw new Error('Invalid config for "generateInsights"');
2645
+ throw new Error('Invalid config for "generateInsightsBasic"');
2521
2646
  }
2522
2647
  return buildNetworkSnapshot$2(luvio, config);
2523
2648
  };
2524
2649
  };
2525
2650
 
2651
+ const TTL = 5000;
2526
2652
  const VERSION$2 = "b3ecf416df1c88948a22534e1143e6d5";
2527
2653
  function validate$2(obj, path = 'GetInsightBatchResponse') {
2528
2654
  const v_error = (() => {
@@ -2607,7 +2733,7 @@ function normalize$1(input, existing, path, luvio, store, timestamp) {
2607
2733
  return input;
2608
2734
  }
2609
2735
  const select$4 = function GetInsightBatchResponseSelect() {
2610
- const { selections: SummaryResponse__selections, opaque: SummaryResponse__opaque, } = select$g();
2736
+ const { selections: SummaryResponse__selections, opaque: SummaryResponse__opaque, } = select$h();
2611
2737
  return {
2612
2738
  kind: 'Fragment',
2613
2739
  version: VERSION$2,
@@ -2622,7 +2748,7 @@ const select$4 = function GetInsightBatchResponseSelect() {
2622
2748
  kind: 'Link',
2623
2749
  plural: true,
2624
2750
  required: false,
2625
- fragment: select$6()
2751
+ fragment: select$7()
2626
2752
  },
2627
2753
  {
2628
2754
  name: 'hasErrors',
@@ -2716,7 +2842,7 @@ const ingest$1 = function GetInsightBatchResponseIngest(input, path, luvio, stor
2716
2842
  }
2717
2843
  }
2718
2844
  const key = keyBuilderFromType$1(luvio, input);
2719
- const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
2845
+ const ttlToUse = TTL;
2720
2846
  ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "analytics-insights", VERSION$2, RepresentationType$1, equals$2);
2721
2847
  return createLink(key);
2722
2848
  };
@@ -2767,7 +2893,13 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
2767
2893
  function ingestError(luvio, params, error, snapshotRefresh) {
2768
2894
  const key = keyBuilder$2(luvio, params);
2769
2895
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2770
- luvio.storeIngestError(key, errorSnapshot);
2896
+ const storeMetadataParams = {
2897
+ ttl: TTL,
2898
+ namespace: keyPrefix,
2899
+ version: VERSION$2,
2900
+ representationName: RepresentationType$1
2901
+ };
2902
+ luvio.storeIngestError(key, errorSnapshot, storeMetadataParams);
2771
2903
  return errorSnapshot;
2772
2904
  }
2773
2905
  function createResourceRequest$1(config) {
@@ -2796,14 +2928,14 @@ const getInsightsBatch_ConfigPropertyMetadata = [
2796
2928
  generateParamConfigMetadata('batchId', true, 0 /* UrlParameter */, 0 /* String */),
2797
2929
  ];
2798
2930
  const getInsightsBatch_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName$1, getInsightsBatch_ConfigPropertyMetadata);
2799
- const createResourceParams$1 = /*#__PURE__*/ createResourceParams$4(getInsightsBatch_ConfigPropertyMetadata);
2931
+ const createResourceParams$1 = /*#__PURE__*/ createResourceParams$5(getInsightsBatch_ConfigPropertyMetadata);
2800
2932
  function keyBuilder$1(luvio, config) {
2801
2933
  const resourceParams = createResourceParams$1(config);
2802
2934
  return keyBuilder$2(luvio, resourceParams);
2803
2935
  }
2804
2936
  function typeCheckConfig$1(untrustedConfig) {
2805
2937
  const config = {};
2806
- typeCheckConfig$4(untrustedConfig, config, getInsightsBatch_ConfigPropertyMetadata);
2938
+ typeCheckConfig$5(untrustedConfig, config, getInsightsBatch_ConfigPropertyMetadata);
2807
2939
  return config;
2808
2940
  }
2809
2941
  function validateAdapterConfig$1(untrustedConfig, configPropertyNames) {
@@ -2897,7 +3029,12 @@ const notifyChangeFactory = (luvio, options) => {
2897
3029
  }, (error) => {
2898
3030
  return luvio.handleErrorResponse(() => {
2899
3031
  const errorSnapshot = luvio.errorSnapshot(error);
2900
- luvio.storeIngestError(key, errorSnapshot, undefined);
3032
+ luvio.storeIngestError(key, errorSnapshot, {
3033
+ ttl: TTL,
3034
+ namespace: keyPrefix,
3035
+ version: VERSION$2,
3036
+ representationName: RepresentationType$1
3037
+ });
2901
3038
  return luvio.storeBroadcast().then(() => errorSnapshot);
2902
3039
  });
2903
3040
  });
@@ -3194,10 +3331,10 @@ const getMetricFilterValues_ConfigPropertyMetadata = [
3194
3331
  generateParamConfigMetadata('semanticFilter', false, 2 /* Body */, 4 /* Unsupported */),
3195
3332
  ];
3196
3333
  const getMetricFilterValues_ConfigPropertyNames = /*#__PURE__*/ buildAdapterValidationConfig(adapterName, getMetricFilterValues_ConfigPropertyMetadata);
3197
- const createResourceParams = /*#__PURE__*/ createResourceParams$4(getMetricFilterValues_ConfigPropertyMetadata);
3334
+ const createResourceParams = /*#__PURE__*/ createResourceParams$5(getMetricFilterValues_ConfigPropertyMetadata);
3198
3335
  function typeCheckConfig(untrustedConfig) {
3199
3336
  const config = {};
3200
- typeCheckConfig$4(untrustedConfig, config, getMetricFilterValues_ConfigPropertyMetadata);
3337
+ typeCheckConfig$5(untrustedConfig, config, getMetricFilterValues_ConfigPropertyMetadata);
3201
3338
  const untrustedConfig_semanticDataModel = untrustedConfig.semanticDataModel;
3202
3339
  const referenceSemanticDataModelValidationError = validate$q(untrustedConfig_semanticDataModel);
3203
3340
  if (referenceSemanticDataModelValidationError === null) {
@@ -3271,12 +3408,17 @@ const getMetricFilterValuesAdapterFactory = (luvio) => {
3271
3408
 
3272
3409
  let createInsightsBatch;
3273
3410
  let generateInsights;
3411
+ let generateInsightsBasic;
3274
3412
  let getInsightsBatch;
3275
3413
  let getInsightsBatchNotifyChange;
3276
3414
  let getMetricFilterValues;
3277
3415
  // Imperative GET Adapters
3278
3416
  let getInsightsBatch_imperative;
3279
- const getInsightsBatchMetadata = { apiFamily: 'analyticsinsights', name: 'getInsightsBatch' };
3417
+ const getInsightsBatchMetadata = {
3418
+ apiFamily: 'analyticsinsights',
3419
+ name: 'getInsightsBatch',
3420
+ ttl: 5000,
3421
+ };
3280
3422
  // Notify Update Available
3281
3423
  function bindExportsTo(luvio) {
3282
3424
  // LDS Adapters
@@ -3288,6 +3430,7 @@ function bindExportsTo(luvio) {
3288
3430
  return {
3289
3431
  createInsightsBatch: unwrapSnapshotData(createInsightsBatchAdapterFactory),
3290
3432
  generateInsights: unwrapSnapshotData(generateInsightsAdapterFactory),
3433
+ generateInsightsBasic: unwrapSnapshotData(generateInsightsBasicAdapterFactory),
3291
3434
  getInsightsBatch: createWireAdapterConstructor(luvio, getInsightsBatch_ldsAdapter, getInsightsBatchMetadata),
3292
3435
  getInsightsBatchNotifyChange: createLDSAdapter(luvio, 'getInsightsBatchNotifyChange', notifyChangeFactory),
3293
3436
  getMetricFilterValues: unwrapSnapshotData(getMetricFilterValuesAdapterFactory),
@@ -3300,6 +3443,7 @@ withDefaultLuvio((luvio) => {
3300
3443
  ({
3301
3444
  createInsightsBatch,
3302
3445
  generateInsights,
3446
+ generateInsightsBasic,
3303
3447
  getInsightsBatch,
3304
3448
  getInsightsBatchNotifyChange,
3305
3449
  getMetricFilterValues,
@@ -3307,5 +3451,5 @@ withDefaultLuvio((luvio) => {
3307
3451
  } = bindExportsTo(luvio));
3308
3452
  });
3309
3453
 
3310
- export { createInsightsBatch, generateInsights, getInsightsBatch, getInsightsBatchNotifyChange, getInsightsBatch_imperative, getMetricFilterValues };
3311
- // version: 1.309.0-dev16-189d0681ed
3454
+ export { createInsightsBatch, generateInsights, generateInsightsBasic, getInsightsBatch, getInsightsBatchNotifyChange, getInsightsBatch_imperative, getMetricFilterValues };
3455
+ // version: 1.309.0-dev18-8649efafcc