@vizzly/services 0.14.4-dev-d0e2dcb72115609967eac641863436c4976d6900 → 0.14.4-dev-62d05e92c038ece2db481a3184d969602622fcc5

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.
@@ -34,7 +34,6 @@ export interface ComponentInterface<Hydrated = any, Dumped = any> extends Dumpab
34
34
  roundedNumbers: boolean;
35
35
  dateCalculations: boolean;
36
36
  conditional: boolean;
37
- calculatedField: Array<AcceptedTypes> | false;
38
37
  customBuild: Array<AcceptedTypes> | false;
39
38
  };
40
39
  supportedFeatures: {
@@ -1,5 +1,5 @@
1
1
  import { DataSet as DataSetType } from '../DataSet/types';
2
- import { AggregateMathField, ConditionalField, CustomBuildMetricField, CustomField, DateCalculationField, MetricField, PercentageField, RoundedNumberField, RulesField, SimpleMathField } from '../CustomField/types';
2
+ import { AggregateMathField, ConditionalField, CustomField, DateCalculationField, MetricField, PercentageField, RoundedNumberField, RulesField, SimpleMathField } from '../CustomField/types';
3
3
  import { QueryAttributes } from '../QueryAttributes/types';
4
4
  import { QueryEngineConfig } from '../QueryEngineConfig/types';
5
5
  import { Query } from '../Query/types';
@@ -11,8 +11,7 @@ export declare const isAggregateMathField: (field: DataSetType.Field) => field i
11
11
  export declare const isPercentageField: (field: DataSetType.Field) => field is PercentageField;
12
12
  export declare const isRules: (field: DataSetType.Field) => field is RulesField;
13
13
  export declare const isConditional: (field: DataSetType.Field) => field is ConditionalField;
14
- export declare const isMetric: (field: DataSetType.Field) => field is MetricField;
15
- export declare const isCustomBuildMetric: (field: DataSetType.Field) => field is CustomBuildMetricField;
14
+ export declare const isCustomBuildMetric: (field: DataSetType.Field) => field is MetricField;
16
15
  export declare const isDateCalculation: (field: DataSetType.Field) => field is DateCalculationField;
17
16
  export declare const getCustomFieldCategory: (field: CustomField) => CustomFieldCategory;
18
17
  export declare const isCustomField: (field: DataSetType.Field) => field is CustomField;
@@ -1,11 +1,7 @@
1
1
  import { DataSet } from '../../DataSet/types';
2
- import { Query, QueryNameSpace } from '../../Query/types';
3
- import * as Filter from '../../Filter';
4
- import * as Types from './types';
2
+ import { Query } from '../../Query/types';
5
3
  import { QueryAttributes } from '../../QueryAttributes/types';
6
4
  import { Params } from '../../../../results-driver/src/types';
7
5
  import { QueryEngineConfig } from '../../QueryEngineConfig/types';
8
- export declare const buildOperator: (operator: Types.Operator, dataSet: DataSet, params: Params, measureAttribute?: QueryAttributes.Measure) => Query['measure'][number];
9
- export declare const buildIfLogic: (ifLogic: Types.IfLogic, dataSet: DataSet, localAndDashboardFilters: QueryAttributes.Filter[], queryEngineConfig: QueryEngineConfig, params: Params, measureAttribute?: QueryAttributes.Measure) => QueryNameSpace.FieldDefinition<string, string, string>;
10
- export declare const buildNumber: (numberInput: Types.NumberInput) => QueryNameSpace.FieldDefinition<string, string, string>;
11
- export declare const buildField: (field: Types.Field) => QueryNameSpace.FieldDefinition<string, string, string>;
6
+ import { MetricField } from '../types';
7
+ export declare const build: (measureAttribute: QueryAttributes.Measure, customField: MetricField, dataSet: DataSet, queryEngineConfig: QueryEngineConfig, params: Params) => Query['measure'][number];
@@ -1,10 +1,3 @@
1
- import { DataSet } from '../../DataSet/types';
2
- import { Query } from '../../Query/types';
3
- import * as Types from './types';
4
- import { QueryAttributes } from '../../QueryAttributes/types';
5
- import { Params } from '../../../../results-driver/src/types';
6
- import { QueryEngineConfig } from '../../QueryEngineConfig/types';
7
- import { MetricField } from '../types';
8
- export declare const init: (publicName: string, metric: Types.Metric, queryEngineConfig: QueryEngineConfig) => MetricField;
9
- export declare const build: (measureAttribute: QueryAttributes.Measure, customField: MetricField, dataSet: DataSet, queryEngineConfig: QueryEngineConfig, params: Params) => Query['measure'][number];
10
- export declare const validate: (field: MetricField) => boolean;
1
+ export * from './init';
2
+ export * from './build';
3
+ export * from './validate';
@@ -0,0 +1,4 @@
1
+ import * as Types from './types';
2
+ import { QueryEngineConfig } from '../../QueryEngineConfig/types';
3
+ import { MetricField } from '../types';
4
+ export declare const init: (publicName: string, metric: Types.Metric, queryEngineConfig: QueryEngineConfig) => MetricField;
@@ -7,11 +7,12 @@ export declare enum PropertyType {
7
7
  Field = "field",
8
8
  Aggregate = "aggregate"
9
9
  }
10
- export declare type Operator = {
11
- type: PropertyType.Operator;
12
- op: OperatorType;
13
- values: Array<Operator | NumberInput | Field | Variable | IfLogic | Aggregate>;
14
- };
10
+ export declare enum OperatorType {
11
+ Divide = "/",
12
+ Multiply = "*",
13
+ Subtract = "-",
14
+ Add = "+"
15
+ }
15
16
  export declare type NumberInput = {
16
17
  type: PropertyType.NumberInput;
17
18
  value: number | undefined;
@@ -25,6 +26,11 @@ export declare type Field = {
25
26
  fieldId: string;
26
27
  function: string;
27
28
  };
29
+ export declare type Aggregate = {
30
+ type: PropertyType.Aggregate;
31
+ fieldId: string;
32
+ function?: string;
33
+ };
28
34
  export declare type IfLogic = {
29
35
  type: PropertyType.IfLogic;
30
36
  cases: Array<{
@@ -33,15 +39,9 @@ export declare type IfLogic = {
33
39
  }>;
34
40
  else: Operator | NumberInput | Field | Variable | IfLogic | undefined | Aggregate;
35
41
  };
36
- export declare type Aggregate = {
37
- type: PropertyType.Aggregate;
38
- fieldId: string;
39
- function?: string;
42
+ export declare type Operator = {
43
+ type: PropertyType.Operator;
44
+ op: OperatorType;
45
+ values: Array<Operator | NumberInput | Field | Variable | IfLogic | Aggregate>;
40
46
  };
41
- export declare type Metric = Operator | IfLogic;
42
- export declare enum OperatorType {
43
- Divide = "/",
44
- Multiply = "*",
45
- Subtract = "-",
46
- Add = "+"
47
- }
47
+ export declare type Metric = Operator | IfLogic | Aggregate | NumberInput | Field;
@@ -0,0 +1,2 @@
1
+ import { MetricField } from '../types';
2
+ export declare const validate: (field: MetricField) => boolean;
@@ -6,5 +6,5 @@ export * as Rules from './Rules';
6
6
  export * as RoundedNumber from './RoundedNumber';
7
7
  export * as DateCalculation from './DateCalculation';
8
8
  export * as Conditional from './Conditional';
9
- export * as CustomBuild from "./CustomBuild";
9
+ export * as CustomMetric from './CustomMetric';
10
10
  export * from './upcast';
@@ -3,26 +3,15 @@ import { BaseField, DataType, NonDateTimeField } from '../Field/types';
3
3
  import { Rules } from './Rules/types';
4
4
  import { Metric } from './CustomMetric/types';
5
5
  declare type BaseCustomField = Omit<NonDateTimeField, 'dashboardFilterGroups'>;
6
- export declare type PercentageField = BaseCustomField & Percentage;
7
- export declare type RoundedNumberField = BaseCustomField & RoundedNumber;
8
- export declare type DateCalculationField = BaseCustomField & DateCalculation;
9
- export declare type AggregateMathField = BaseCustomField & AggregateMath;
10
- export declare type ConditionalField = BaseCustomField & Conditional;
11
- export declare type MetricField = BaseCustomField & {
12
- metric: Metric;
6
+ declare type SimpleMath = {
7
+ leftFieldId: string;
8
+ operator: MathOperator;
9
+ rightFieldId: string;
13
10
  };
14
- export declare type SimpleMathField = BaseCustomField & SimpleMath & {
15
- dataType: 'number';
11
+ declare type RoundedNumber = {
12
+ roundToDecimalPlaces: 0 | 2;
13
+ fieldId: string;
16
14
  };
17
- export interface RulesField extends BaseField {
18
- rules: Rules[];
19
- dataType: 'string';
20
- }
21
- export interface CustomBuildMetricField extends BaseField {
22
- metricAtrributes: Metric;
23
- dataType: 'number';
24
- }
25
- export declare type CustomField = PercentageField | SimpleMathField | AggregateMathField | RulesField | RoundedNumberField | DateCalculationField | ConditionalField | MetricField | CustomBuildMetricField;
26
15
  export declare type Conditional = {
27
16
  fieldId: string;
28
17
  function: string;
@@ -59,26 +48,36 @@ export declare type AggregateMath = {
59
48
  /** @deprecated ignore this outside of upcasting */
60
49
  rightAggregate?: string;
61
50
  };
62
- export declare type SimpleMath = {
63
- leftFieldId: string;
64
- operator: MathOperator;
65
- rightFieldId: string;
66
- };
67
- export declare type RoundedNumber = {
68
- roundToDecimalPlaces: 0 | 2;
69
- fieldId: string;
70
- };
71
51
  export declare type DateCalculation = {
72
52
  leftFieldId: string;
73
53
  rightFieldId: string;
74
54
  dateCalculationFunction: 'seconds_between' | 'minutes_between' | 'hours_between' | 'days_between';
75
55
  };
56
+ export declare type PercentageField = BaseCustomField & Percentage;
57
+ export declare type RoundedNumberField = BaseCustomField & RoundedNumber;
58
+ export declare type DateCalculationField = BaseCustomField & DateCalculation;
59
+ export declare type AggregateMathField = BaseCustomField & AggregateMath;
60
+ export declare type ConditionalField = BaseCustomField & Conditional;
61
+ export declare type MetricField = BaseCustomField & {
62
+ metric: Metric;
63
+ };
64
+ export declare type SimpleMathField = BaseCustomField & SimpleMath & {
65
+ dataType: 'number';
66
+ };
67
+ export declare type RulesField = BaseField & {
68
+ rules: Rules[];
69
+ dataType: 'string';
70
+ };
71
+ export declare type CustomBuildMetricField = BaseField & {
72
+ metricAttributes: Metric;
73
+ dataType: 'number';
74
+ };
75
+ export declare type CustomField = PercentageField | SimpleMathField | AggregateMathField | RulesField | RoundedNumberField | DateCalculationField | ConditionalField | MetricField | CustomBuildMetricField;
76
76
  export declare type MathOperator = '*' | '-' | '/' | '+';
77
- export declare type CustomFieldCategory = 'percentage' | 'math' | 'rules' | 'roundedNumber' | 'dateCalculation' | 'conditional' | 'calculatedField' | 'customBuildMetric';
77
+ export declare type CustomFieldCategory = 'percentage' | 'math' | 'rules' | 'roundedNumber' | 'dateCalculation' | 'conditional' | 'customBuildMetric';
78
78
  export declare enum AcceptedTypes {
79
79
  Maths = "maths",
80
80
  IfStatement = "ifStatement",
81
81
  Aggregates = "aggregates"
82
82
  }
83
- export declare type MaybeOldCustomField = CustomField;
84
83
  export {};
package/package.json CHANGED
@@ -26,7 +26,7 @@
26
26
  "fix-type-alias": "tsc-alias -p tsconfig.json",
27
27
  "prepare": "yarn build"
28
28
  },
29
- "version": "0.14.4-dev-d0e2dcb72115609967eac641863436c4976d6900",
29
+ "version": "0.14.4-dev-62d05e92c038ece2db481a3184d969602622fcc5",
30
30
  "dependencies": {
31
31
  "@vizzly/api-client": "0.0.51",
32
32
  "@vizzly/joi": "^17.11.0",
@@ -1,7 +0,0 @@
1
- import { Query } from '../../Query/types';
2
- import { QueryEngineConfig } from '../../QueryEngineConfig/types';
3
- import { CustomBuildMetricField } from '../types';
4
- import { Metric } from '../CustomMetric/types';
5
- export * from './validate';
6
- export declare const init: (publicName: string, metric: Metric, queryEngineConfig: QueryEngineConfig) => CustomBuildMetricField;
7
- export declare const build: () => Query['measure'][number];
@@ -1,5 +0,0 @@
1
- import Joi from '@vizzly/joi';
2
- import { QueryEngineConfig } from '../../QueryEngineConfig/types';
3
- declare const operatorSchema: Joi.ObjectSchema<any>;
4
- export declare const ifLogicSchema: (queryEngineConfig: QueryEngineConfig) => Joi.ObjectSchema<any>;
5
- export { operatorSchema };
@@ -1,6 +0,0 @@
1
- import { QueryEngineConfig } from '../../QueryEngineConfig/types';
2
- import { Metric } from '../CustomMetric/types';
3
- export declare const validate: (queryEngineConfig: QueryEngineConfig, metric?: Metric) => {
4
- isValid: boolean;
5
- errors?: string[];
6
- };