@salesforce/lds-adapters-sfap-analytics-insights 1.332.0-dev20 → 1.332.0-dev22

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.
@@ -852,6 +852,7 @@ function validate$m(obj, path = 'InsightBundleInput') {
852
852
  return v_error === undefined ? null : v_error;
853
853
  }
854
854
 
855
+ const VERSION$g = "7948f62379bf327a3cc190504223aecc";
855
856
  function validate$l(obj, path = 'UnifiedFilter') {
856
857
  const v_error = (() => {
857
858
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -888,6 +889,77 @@ function validate$l(obj, path = 'UnifiedFilter') {
888
889
  })();
889
890
  return v_error === undefined ? null : v_error;
890
891
  }
892
+ const select$l = function UnifiedFilterSelect() {
893
+ return {
894
+ kind: 'Fragment',
895
+ version: VERSION$g,
896
+ private: [],
897
+ selections: [
898
+ {
899
+ name: 'fieldName',
900
+ kind: 'Scalar',
901
+ required: false
902
+ },
903
+ {
904
+ name: 'operator',
905
+ kind: 'Scalar',
906
+ required: false
907
+ },
908
+ {
909
+ name: 'values',
910
+ kind: 'Object',
911
+ // any
912
+ }
913
+ ]
914
+ };
915
+ };
916
+ function equals$g(existing, incoming) {
917
+ const existing_fieldName = existing.fieldName;
918
+ const incoming_fieldName = incoming.fieldName;
919
+ // if at least one of these optionals is defined
920
+ if (existing_fieldName !== undefined || incoming_fieldName !== undefined) {
921
+ // if one of these is not defined we know the other is defined and therefore
922
+ // not equal
923
+ if (existing_fieldName === undefined || incoming_fieldName === undefined) {
924
+ return false;
925
+ }
926
+ if (!(existing_fieldName === incoming_fieldName)) {
927
+ return false;
928
+ }
929
+ }
930
+ const existing_operator = existing.operator;
931
+ const incoming_operator = incoming.operator;
932
+ // if at least one of these optionals is defined
933
+ if (existing_operator !== undefined || incoming_operator !== undefined) {
934
+ // if one of these is not defined we know the other is defined and therefore
935
+ // not equal
936
+ if (existing_operator === undefined || incoming_operator === undefined) {
937
+ return false;
938
+ }
939
+ if (!(existing_operator === incoming_operator)) {
940
+ return false;
941
+ }
942
+ }
943
+ const existing_values = existing.values;
944
+ const incoming_values = incoming.values;
945
+ // if at least one of these optionals is defined
946
+ if (existing_values !== undefined || incoming_values !== undefined) {
947
+ // if one of these is not defined we know the other is defined and therefore
948
+ // not equal
949
+ if (existing_values === undefined || incoming_values === undefined) {
950
+ return false;
951
+ }
952
+ const equals_values_items = equalsArray(existing_values, incoming_values, (existing_values_item, incoming_values_item) => {
953
+ if (JSONStringify(incoming_values_item) !== JSONStringify(existing_values_item)) {
954
+ return false;
955
+ }
956
+ });
957
+ if (equals_values_items === false) {
958
+ return false;
959
+ }
960
+ }
961
+ return true;
962
+ }
891
963
 
892
964
  function validate$k(obj, path = 'MetricInstanceInput') {
893
965
  const v_error = (() => {
@@ -2852,7 +2924,7 @@ function equals$2(existing, incoming) {
2852
2924
  return true;
2853
2925
  }
2854
2926
 
2855
- const VERSION$1 = "2f50f3271c566971f91d15a361482b6c";
2927
+ const VERSION$1 = "5da3ddbbd8ef8f7b1f24b4d609f91108";
2856
2928
  function validate$1(obj, path = 'GenerateInsightBundleResponse') {
2857
2929
  const v_error = (() => {
2858
2930
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -2868,6 +2940,16 @@ function validate$1(obj, path = 'GenerateInsightBundleResponse') {
2868
2940
  return new TypeError(message);
2869
2941
  }
2870
2942
  }
2943
+ if (obj.measurementPeriod !== undefined) {
2944
+ const obj_measurementPeriod = obj.measurementPeriod;
2945
+ const path_measurementPeriod = path + '.measurementPeriod';
2946
+ const referencepath_measurementPeriodValidationError = validate$l(obj_measurementPeriod, path_measurementPeriod);
2947
+ if (referencepath_measurementPeriodValidationError !== null) {
2948
+ let message = 'Object doesn\'t match UnifiedFilter (at "' + path_measurementPeriod + '")\n';
2949
+ message += referencepath_measurementPeriodValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2950
+ return new TypeError(message);
2951
+ }
2952
+ }
2871
2953
  if (obj.result !== undefined) {
2872
2954
  const obj_result = obj.result;
2873
2955
  const path_result = path + '.result';
@@ -2906,6 +2988,7 @@ function normalize$1(input, existing, path, luvio, store, timestamp) {
2906
2988
  }
2907
2989
  const select$4 = function GenerateInsightBundleResponseSelect() {
2908
2990
  const { selections: Error__selections, opaque: Error__opaque, } = select$k();
2991
+ const { selections: UnifiedFilter__selections, opaque: UnifiedFilter__opaque, } = select$l();
2909
2992
  const { selections: InsightBundle__selections, opaque: InsightBundle__opaque, } = select$5();
2910
2993
  return {
2911
2994
  kind: 'Fragment',
@@ -2918,6 +3001,12 @@ const select$4 = function GenerateInsightBundleResponseSelect() {
2918
3001
  selections: Error__selections,
2919
3002
  required: false
2920
3003
  },
3004
+ {
3005
+ name: 'measurementPeriod',
3006
+ kind: 'Object',
3007
+ selections: UnifiedFilter__selections,
3008
+ required: false
3009
+ },
2921
3010
  {
2922
3011
  name: 'result',
2923
3012
  kind: 'Object',
@@ -2959,6 +3048,19 @@ function equals$1(existing, incoming) {
2959
3048
  return false;
2960
3049
  }
2961
3050
  }
3051
+ const existing_measurementPeriod = existing.measurementPeriod;
3052
+ const incoming_measurementPeriod = incoming.measurementPeriod;
3053
+ // if at least one of these optionals is defined
3054
+ if (existing_measurementPeriod !== undefined || incoming_measurementPeriod !== undefined) {
3055
+ // if one of these is not defined we know the other is defined and therefore
3056
+ // not equal
3057
+ if (existing_measurementPeriod === undefined || incoming_measurementPeriod === undefined) {
3058
+ return false;
3059
+ }
3060
+ if (!(equals$g(existing_measurementPeriod, incoming_measurementPeriod))) {
3061
+ return false;
3062
+ }
3063
+ }
2962
3064
  const existing_result = existing.result;
2963
3065
  const incoming_result = incoming.result;
2964
3066
  // if at least one of these optionals is defined
@@ -1,7 +1,8 @@
1
1
  import { Error as Error_Error } from './Error';
2
+ import { UnifiedFilter as UnifiedFilter_UnifiedFilter } from './UnifiedFilter';
2
3
  import { InsightBundle as InsightBundle_InsightBundle } from './InsightBundle';
3
4
  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, FragmentSelection as $64$luvio_engine_FragmentSelection, ResourceIngest as $64$luvio_engine_ResourceIngest, DurableStoreKeyMetadataMap as $64$luvio_engine_DurableStoreKeyMetadataMap } from '@luvio/engine';
4
- export declare const VERSION = "2f50f3271c566971f91d15a361482b6c";
5
+ export declare const VERSION = "5da3ddbbd8ef8f7b1f24b4d609f91108";
5
6
  export declare function validate(obj: any, path?: string): TypeError | null;
6
7
  export declare const RepresentationType: string;
7
8
  export interface KeyParams extends $64$luvio_engine_KeyMetadata {
@@ -26,6 +27,7 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
26
27
  */
27
28
  export interface GenerateInsightBundleResponseNormalized {
28
29
  error?: Error_Error;
30
+ measurementPeriod?: UnifiedFilter_UnifiedFilter;
29
31
  /** Note that it is possible that we encountered some errors but were still
30
32
  able to compute part of the result. In that case, the result key will be
31
33
  present, and there will be errors at the appropriate level inside */
@@ -42,6 +44,7 @@ export interface GenerateInsightBundleResponseNormalized {
42
44
  */
43
45
  export interface GenerateInsightBundleResponse {
44
46
  error?: Error_Error;
47
+ measurementPeriod?: UnifiedFilter_UnifiedFilter;
45
48
  result?: InsightBundle_InsightBundle;
46
49
  sdm: string;
47
50
  submetric: string;
@@ -18,7 +18,8 @@ export declare function getTypeCacheKeys(rootKeySet: $64$luvio_engine_DurableSto
18
18
  export interface MeasurementPeriodNormalized {
19
19
  filter?: Filter_Filter;
20
20
  relativePeriod?: RelativePeriod_RelativePeriod;
21
- /** We do not yet have support for fiscal year */
21
+ /** We do not yet have support for fiscal year
22
+ We do not yet have support for unbounded time ranges (less than/greater than/all time) */
22
23
  semanticFilter?: unknown;
23
24
  }
24
25
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/lds-adapters-sfap-analytics-insights",
3
- "version": "1.332.0-dev20",
3
+ "version": "1.332.0-dev22",
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.332.0-dev20"
43
+ "@salesforce/lds-bindings": "^1.332.0-dev22"
44
44
  },
45
45
  "devDependencies": {
46
- "@salesforce/lds-compiler-plugins": "^1.332.0-dev20"
46
+ "@salesforce/lds-compiler-plugins": "^1.332.0-dev22"
47
47
  },
48
48
  "nx": {
49
49
  "targets": {
package/sfdc/index.js CHANGED
@@ -862,6 +862,7 @@ function validate$m(obj, path = 'InsightBundleInput') {
862
862
  return v_error === undefined ? null : v_error;
863
863
  }
864
864
 
865
+ const VERSION$g = "7948f62379bf327a3cc190504223aecc";
865
866
  function validate$l(obj, path = 'UnifiedFilter') {
866
867
  const v_error = (() => {
867
868
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -898,6 +899,77 @@ function validate$l(obj, path = 'UnifiedFilter') {
898
899
  })();
899
900
  return v_error === undefined ? null : v_error;
900
901
  }
902
+ const select$l = function UnifiedFilterSelect() {
903
+ return {
904
+ kind: 'Fragment',
905
+ version: VERSION$g,
906
+ private: [],
907
+ selections: [
908
+ {
909
+ name: 'fieldName',
910
+ kind: 'Scalar',
911
+ required: false
912
+ },
913
+ {
914
+ name: 'operator',
915
+ kind: 'Scalar',
916
+ required: false
917
+ },
918
+ {
919
+ name: 'values',
920
+ kind: 'Object',
921
+ // any
922
+ }
923
+ ]
924
+ };
925
+ };
926
+ function equals$g(existing, incoming) {
927
+ const existing_fieldName = existing.fieldName;
928
+ const incoming_fieldName = incoming.fieldName;
929
+ // if at least one of these optionals is defined
930
+ if (existing_fieldName !== undefined || incoming_fieldName !== undefined) {
931
+ // if one of these is not defined we know the other is defined and therefore
932
+ // not equal
933
+ if (existing_fieldName === undefined || incoming_fieldName === undefined) {
934
+ return false;
935
+ }
936
+ if (!(existing_fieldName === incoming_fieldName)) {
937
+ return false;
938
+ }
939
+ }
940
+ const existing_operator = existing.operator;
941
+ const incoming_operator = incoming.operator;
942
+ // if at least one of these optionals is defined
943
+ if (existing_operator !== undefined || incoming_operator !== undefined) {
944
+ // if one of these is not defined we know the other is defined and therefore
945
+ // not equal
946
+ if (existing_operator === undefined || incoming_operator === undefined) {
947
+ return false;
948
+ }
949
+ if (!(existing_operator === incoming_operator)) {
950
+ return false;
951
+ }
952
+ }
953
+ const existing_values = existing.values;
954
+ const incoming_values = incoming.values;
955
+ // if at least one of these optionals is defined
956
+ if (existing_values !== undefined || incoming_values !== undefined) {
957
+ // if one of these is not defined we know the other is defined and therefore
958
+ // not equal
959
+ if (existing_values === undefined || incoming_values === undefined) {
960
+ return false;
961
+ }
962
+ const equals_values_items = equalsArray(existing_values, incoming_values, (existing_values_item, incoming_values_item) => {
963
+ if (JSONStringify(incoming_values_item) !== JSONStringify(existing_values_item)) {
964
+ return false;
965
+ }
966
+ });
967
+ if (equals_values_items === false) {
968
+ return false;
969
+ }
970
+ }
971
+ return true;
972
+ }
901
973
 
902
974
  function validate$k(obj, path = 'MetricInstanceInput') {
903
975
  const v_error = (() => {
@@ -2499,7 +2571,7 @@ function equals$4(existing, incoming) {
2499
2571
  return true;
2500
2572
  }
2501
2573
 
2502
- const VERSION$3 = "2f50f3271c566971f91d15a361482b6c";
2574
+ const VERSION$3 = "5da3ddbbd8ef8f7b1f24b4d609f91108";
2503
2575
  function validate$3(obj, path = 'GenerateInsightBundleResponse') {
2504
2576
  const v_error = (() => {
2505
2577
  if (typeof obj !== 'object' || ArrayIsArray(obj) || obj === null) {
@@ -2515,6 +2587,16 @@ function validate$3(obj, path = 'GenerateInsightBundleResponse') {
2515
2587
  return new TypeError(message);
2516
2588
  }
2517
2589
  }
2590
+ if (obj.measurementPeriod !== undefined) {
2591
+ const obj_measurementPeriod = obj.measurementPeriod;
2592
+ const path_measurementPeriod = path + '.measurementPeriod';
2593
+ const referencepath_measurementPeriodValidationError = validate$l(obj_measurementPeriod, path_measurementPeriod);
2594
+ if (referencepath_measurementPeriodValidationError !== null) {
2595
+ let message = 'Object doesn\'t match UnifiedFilter (at "' + path_measurementPeriod + '")\n';
2596
+ message += referencepath_measurementPeriodValidationError.message.split('\n').map((line) => '\t' + line).join('\n');
2597
+ return new TypeError(message);
2598
+ }
2599
+ }
2518
2600
  if (obj.result !== undefined) {
2519
2601
  const obj_result = obj.result;
2520
2602
  const path_result = path + '.result';
@@ -2553,6 +2635,7 @@ function normalize$2(input, existing, path, luvio, store, timestamp) {
2553
2635
  }
2554
2636
  const select$7 = function GenerateInsightBundleResponseSelect() {
2555
2637
  const { selections: Error__selections, opaque: Error__opaque, } = select$k();
2638
+ const { selections: UnifiedFilter__selections, opaque: UnifiedFilter__opaque, } = select$l();
2556
2639
  const { selections: InsightBundle__selections, opaque: InsightBundle__opaque, } = select$8();
2557
2640
  return {
2558
2641
  kind: 'Fragment',
@@ -2565,6 +2648,12 @@ const select$7 = function GenerateInsightBundleResponseSelect() {
2565
2648
  selections: Error__selections,
2566
2649
  required: false
2567
2650
  },
2651
+ {
2652
+ name: 'measurementPeriod',
2653
+ kind: 'Object',
2654
+ selections: UnifiedFilter__selections,
2655
+ required: false
2656
+ },
2568
2657
  {
2569
2658
  name: 'result',
2570
2659
  kind: 'Object',
@@ -2606,6 +2695,19 @@ function equals$3(existing, incoming) {
2606
2695
  return false;
2607
2696
  }
2608
2697
  }
2698
+ const existing_measurementPeriod = existing.measurementPeriod;
2699
+ const incoming_measurementPeriod = incoming.measurementPeriod;
2700
+ // if at least one of these optionals is defined
2701
+ if (existing_measurementPeriod !== undefined || incoming_measurementPeriod !== undefined) {
2702
+ // if one of these is not defined we know the other is defined and therefore
2703
+ // not equal
2704
+ if (existing_measurementPeriod === undefined || incoming_measurementPeriod === undefined) {
2705
+ return false;
2706
+ }
2707
+ if (!(equals$g(existing_measurementPeriod, incoming_measurementPeriod))) {
2708
+ return false;
2709
+ }
2710
+ }
2609
2711
  const existing_result = existing.result;
2610
2712
  const incoming_result = incoming.result;
2611
2713
  // if at least one of these optionals is defined
@@ -3653,4 +3755,4 @@ withDefaultLuvio((luvio) => {
3653
3755
  });
3654
3756
 
3655
3757
  export { createInsightsBatch, generateInsights, generateInsightsBasic, getInsightsBatch, getInsightsBatchNotifyChange, getInsightsBatch_imperative, getMetricFilterValues };
3656
- // version: 1.332.0-dev20-8600de247a
3758
+ // version: 1.332.0-dev22-dd082a87cf
package/src/raml/api.raml CHANGED
@@ -65,6 +65,18 @@ types:
65
65
  definitionId:
66
66
  type: string
67
67
  required: false
68
+ InsightResponse:
69
+ type: object
70
+ properties:
71
+ result:
72
+ type: Insight
73
+ required: false
74
+ error:
75
+ type: Error
76
+ required: false
77
+ insightType:
78
+ type: string
79
+ required: false
68
80
  GoalMetadata_StatusCondition:
69
81
  type: object
70
82
  properties:
@@ -103,18 +115,6 @@ types:
103
115
  primary:
104
116
  type: boolean
105
117
  required: false
106
- InsightResponse:
107
- type: object
108
- properties:
109
- result:
110
- type: Insight
111
- required: false
112
- error:
113
- type: Error
114
- required: false
115
- insightType:
116
- type: string
117
- required: false
118
118
  Insight:
119
119
  type: object
120
120
  properties:
@@ -207,6 +207,7 @@ types:
207
207
  semanticFilter:
208
208
  description: |-
209
209
  We do not yet have support for fiscal year
210
+ We do not yet have support for unbounded time ranges (less than/greater than/all time)
210
211
  (amf-and):
211
212
  - FlattenFilter
212
213
  type: any
@@ -502,6 +503,9 @@ types:
502
503
  sdm:
503
504
  type: string
504
505
  required: true
506
+ measurementPeriod:
507
+ type: UnifiedFilter
508
+ required: false
505
509
  CategoricalFilterOptions:
506
510
  type: object
507
511
  properties: