@salesforce/lds-adapters-sfap-analytics-insights 1.324.0 → 1.326.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.
@@ -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,13 +2160,15 @@ 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;
@@ -2193,7 +2195,8 @@ const select$9 = 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
  }
@@ -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,13 +2307,15 @@ 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;
@@ -2324,7 +2337,8 @@ const select$7 = 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
  }
@@ -2979,6 +3001,7 @@ const generateInsightsBasicAdapterFactory = (luvio) => {
2979
3001
  };
2980
3002
  };
2981
3003
 
3004
+ const TTL = 5000;
2982
3005
  const VERSION = "b3ecf416df1c88948a22534e1143e6d5";
2983
3006
  function validate(obj, path = 'GetInsightBatchResponse') {
2984
3007
  const v_error = (() => {
@@ -3172,7 +3195,7 @@ const ingest = function GetInsightBatchResponseIngest(input, path, luvio, store,
3172
3195
  }
3173
3196
  }
3174
3197
  const key = keyBuilderFromType(luvio, input);
3175
- const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
3198
+ const ttlToUse = TTL;
3176
3199
  ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize, "analytics-insights", VERSION, RepresentationType, equals);
3177
3200
  return createLink(key);
3178
3201
  };
@@ -3223,7 +3246,13 @@ function ingestSuccess(luvio, resourceParams, response, snapshotRefresh) {
3223
3246
  function ingestError(luvio, params, error, snapshotRefresh) {
3224
3247
  const key = keyBuilder$1(luvio, params);
3225
3248
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
3226
- 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);
3227
3256
  return errorSnapshot;
3228
3257
  }
3229
3258
  function createResourceRequest(config) {
@@ -1,6 +1,7 @@
1
1
  import { SummaryResponse as SummaryResponse_SummaryResponse } from './SummaryResponse';
2
2
  import { KeyMetadata as $64$luvio_engine_KeyMetadata, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata, Luvio as $64$luvio_engine_Luvio, IngestPath as $64$luvio_engine_IngestPath, Store as $64$luvio_engine_Store, ResourceIngest as $64$luvio_engine_ResourceIngest, FragmentSelection as $64$luvio_engine_FragmentSelection, LinkSelection as $64$luvio_engine_LinkSelection, StoreLink as $64$luvio_engine_StoreLink, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap } from '@luvio/engine';
3
3
  import { GenerateInsightBundleResponse as GenerateInsightBundleResponse_GenerateInsightBundleResponse } from './GenerateInsightBundleResponse';
4
+ export declare const TTL = 5000;
4
5
  export declare const VERSION = "b3ecf416df1c88948a22534e1143e6d5";
5
6
  export declare function validate(obj: any, path?: string): TypeError | null;
6
7
  export declare const RepresentationType: string;
@@ -1,7 +1,7 @@
1
1
  import { Error as Error_Error } from './Error';
2
2
  import { Insight as Insight_Insight } from './Insight';
3
3
  import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
4
- export declare const VERSION = "6707f0d0aa09112abbca1db5e32bb172";
4
+ export declare const VERSION = "09a140bdbc97294bdce2b9555910f209";
5
5
  export declare function validate(obj: any, path?: string): TypeError | null;
6
6
  export declare const RepresentationType: string;
7
7
  export declare function normalize(input: InsightResponse, existing: InsightResponseNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): InsightResponseNormalized;
@@ -18,7 +18,7 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
18
18
  export interface InsightResponseNormalized {
19
19
  error?: Error_Error;
20
20
  insightType?: string;
21
- result: Insight_Insight;
21
+ result?: Insight_Insight;
22
22
  }
23
23
  /**
24
24
  *
@@ -29,5 +29,5 @@ export interface InsightResponseNormalized {
29
29
  export interface InsightResponse {
30
30
  error?: Error_Error;
31
31
  insightType?: string;
32
- result: Insight_Insight;
32
+ result?: Insight_Insight;
33
33
  }
@@ -1,7 +1,7 @@
1
1
  import { Error as Error_Error } from './Error';
2
2
  import { Overview as Overview_Overview } from './Overview';
3
3
  import { IngestPath as $64$luvio_engine_IngestPath, Luvio as $64$luvio_engine_Luvio, Store as $64$luvio_engine_Store, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap, NormalizedKeyMetadata as $64$luvio_engine_NormalizedKeyMetadata } from '@luvio/engine';
4
- export declare const VERSION = "ac3296a9832f46fda66420bc753d8c61";
4
+ export declare const VERSION = "ff01bfcbb0b2877fe279be648aceb371";
5
5
  export declare function validate(obj: any, path?: string): TypeError | null;
6
6
  export declare const RepresentationType: string;
7
7
  export declare function normalize(input: OverviewResponse, existing: OverviewResponseNormalized, path: $64$luvio_engine_IngestPath, luvio: $64$luvio_engine_Luvio, store: $64$luvio_engine_Store, timestamp: number): OverviewResponseNormalized;
@@ -17,7 +17,7 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
17
17
  */
18
18
  export interface OverviewResponseNormalized {
19
19
  error?: Error_Error;
20
- result: Overview_Overview;
20
+ result?: Overview_Overview;
21
21
  }
22
22
  /**
23
23
  *
@@ -27,5 +27,5 @@ export interface OverviewResponseNormalized {
27
27
  */
28
28
  export interface OverviewResponse {
29
29
  error?: Error_Error;
30
- result: Overview_Overview;
30
+ result?: Overview_Overview;
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-sfap-analytics-insights",
3
- "version": "1.324.0",
3
+ "version": "1.326.0",
4
4
  "description": "APIs for generating insights about metrics",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "dist/es/es2018/sfap-analytics-insights.js",
@@ -40,10 +40,10 @@
40
40
  "test:unit": "jest"
41
41
  },
42
42
  "dependencies": {
43
- "@salesforce/lds-bindings": "^1.324.0"
43
+ "@salesforce/lds-bindings": "^1.326.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@salesforce/lds-compiler-plugins": "^1.324.0"
46
+ "@salesforce/lds-compiler-plugins": "^1.326.0"
47
47
  },
48
48
  "nx": {
49
49
  "targets": {
package/sfdc/index.js CHANGED
@@ -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,13 +1807,15 @@ 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;
@@ -1840,7 +1842,8 @@ const select$c = 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
  }
@@ -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,13 +1954,15 @@ 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;
@@ -1971,7 +1984,8 @@ const select$a = 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
  }
@@ -2626,6 +2648,7 @@ const generateInsightsBasicAdapterFactory = (luvio) => {
2626
2648
  };
2627
2649
  };
2628
2650
 
2651
+ const TTL = 5000;
2629
2652
  const VERSION$2 = "b3ecf416df1c88948a22534e1143e6d5";
2630
2653
  function validate$2(obj, path = 'GetInsightBatchResponse') {
2631
2654
  const v_error = (() => {
@@ -2819,7 +2842,7 @@ const ingest$1 = function GetInsightBatchResponseIngest(input, path, luvio, stor
2819
2842
  }
2820
2843
  }
2821
2844
  const key = keyBuilderFromType$1(luvio, input);
2822
- const ttlToUse = path.ttl !== undefined ? path.ttl : 300000;
2845
+ const ttlToUse = TTL;
2823
2846
  ingestShape(input, path, luvio, store, timestamp, ttlToUse, key, normalize$1, "analytics-insights", VERSION$2, RepresentationType$1, equals$2);
2824
2847
  return createLink(key);
2825
2848
  };
@@ -2870,7 +2893,13 @@ function ingestSuccess$1(luvio, resourceParams, response, snapshotRefresh) {
2870
2893
  function ingestError(luvio, params, error, snapshotRefresh) {
2871
2894
  const key = keyBuilder$2(luvio, params);
2872
2895
  const errorSnapshot = luvio.errorSnapshot(error, snapshotRefresh);
2873
- 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);
2874
2903
  return errorSnapshot;
2875
2904
  }
2876
2905
  function createResourceRequest$1(config) {
@@ -3000,7 +3029,12 @@ const notifyChangeFactory = (luvio, options) => {
3000
3029
  }, (error) => {
3001
3030
  return luvio.handleErrorResponse(() => {
3002
3031
  const errorSnapshot = luvio.errorSnapshot(error);
3003
- 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
+ });
3004
3038
  return luvio.storeBroadcast().then(() => errorSnapshot);
3005
3039
  });
3006
3040
  });
@@ -3380,7 +3414,11 @@ let getInsightsBatchNotifyChange;
3380
3414
  let getMetricFilterValues;
3381
3415
  // Imperative GET Adapters
3382
3416
  let getInsightsBatch_imperative;
3383
- const getInsightsBatchMetadata = { apiFamily: 'analyticsinsights', name: 'getInsightsBatch' };
3417
+ const getInsightsBatchMetadata = {
3418
+ apiFamily: 'analyticsinsights',
3419
+ name: 'getInsightsBatch',
3420
+ ttl: 5000,
3421
+ };
3384
3422
  // Notify Update Available
3385
3423
  function bindExportsTo(luvio) {
3386
3424
  // LDS Adapters
@@ -3414,4 +3452,4 @@ withDefaultLuvio((luvio) => {
3414
3452
  });
3415
3453
 
3416
3454
  export { createInsightsBatch, generateInsights, generateInsightsBasic, getInsightsBatch, getInsightsBatchNotifyChange, getInsightsBatch_imperative, getMetricFilterValues };
3417
- // version: 1.324.0-f16f2a27c7
3455
+ // version: 1.326.0-c4e3f37efd
package/src/raml/api.raml CHANGED
@@ -68,7 +68,9 @@ types:
68
68
  InsightResponse:
69
69
  type: object
70
70
  properties:
71
- result: Insight
71
+ result:
72
+ type: Insight
73
+ required: false
72
74
  error:
73
75
  type: Error
74
76
  required: false
@@ -328,7 +330,9 @@ types:
328
330
  OverviewResponse:
329
331
  type: object
330
332
  properties:
331
- result: Overview
333
+ result:
334
+ type: Overview
335
+ required: false
332
336
  error:
333
337
  type: Error
334
338
  required: false
@@ -45,6 +45,7 @@ types:
45
45
  (luvio.key):
46
46
  filterpageid: id
47
47
  GetInsightBatchResponse:
48
+ (luvio.ttl): 5000
48
49
  (luvio.key):
49
50
  batchid: batchId
50
51
  GenerateInsightBatchResponse: