@vizzly/services 0.9.1 → 0.10.0-dev-9df5ee845450a397ffb4a78ed75733b0a912c5ec

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.
Files changed (25) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/services/src/Services/APIServices.d.ts +2 -2
  3. package/dist/services/src/Services/CellServices.d.ts +2 -2
  4. package/dist/services/src/Services/ComponentLibraryServices.d.ts +2 -3
  5. package/dist/services/src/schemaValidations/cell.d.ts +1 -0
  6. package/dist/services/src/schemaValidations/dashboard.d.ts +2 -1
  7. package/dist/services/src/schemaValidations/filters.d.ts +2 -0
  8. package/dist/services/src/schemaValidations/library.d.ts +2 -0
  9. package/dist/shared-logic/src/AdditionalFilter/schema.d.ts +4 -0
  10. package/dist/shared-logic/src/Component/Component.d.ts +2 -1
  11. package/dist/shared-logic/src/Component/dumpable.d.ts +1 -1
  12. package/dist/shared-logic/src/Component/sharedSchemas.d.ts +1 -1
  13. package/dist/shared-logic/src/Dashboard/Dashboard.d.ts +1 -0
  14. package/dist/shared-logic/src/Dashboard/saveableDashboardDefinitionSchema.d.ts +5 -0
  15. package/dist/shared-logic/src/DashboardAPI/clientDashboardSchema.d.ts +3 -0
  16. package/dist/shared-logic/src/DashboardAPI/dashboardManager.d.ts +4 -1
  17. package/dist/shared-logic/src/Display/Display.d.ts +3 -5
  18. package/dist/shared-logic/src/Display/types.d.ts +1 -4
  19. package/dist/shared-logic/src/Display/upcast.d.ts +2 -1
  20. package/dist/shared-logic/src/Header/index.d.ts +7 -0
  21. package/dist/shared-logic/src/Header/schema.d.ts +2 -0
  22. package/dist/shared-logic/src/Header/types.d.ts +4 -0
  23. package/dist/shared-logic/src/Translations/translation.types.d.ts +76 -6
  24. package/dist/shared-logic/src/errors/ServicesValidation.d.ts +4 -0
  25. package/package.json +1 -1
@@ -101,7 +101,7 @@ export declare class API {
101
101
  * @returns A promise that resolves to an array of child dashboards.
102
102
  * @throws {Error} If an error occurs while retrieving the child dashboards.
103
103
  */
104
- getAllChildDashboards(): Promise<import("shared-logic/src/DashboardAPI/types").VizzlyDashboard[] | undefined>;
104
+ getAllChildDashboards(): Promise<import("shared-logic/src/DashboardAPI/types").VizzlyDashboard[]>;
105
105
  getDataSets(): Promise<import("shared-logic/src/DataSet/types").DataSet[] | undefined>;
106
106
  /**
107
107
  * Retrieves the parent dashboards.
@@ -146,7 +146,7 @@ export declare class API {
146
146
  * @returns {Promise<string>} A promise that resolves to the default parent dashboard ID.
147
147
  */
148
148
  getDefaultParentDashboardId(): Promise<string>;
149
- private checkEverythingIsDefined;
149
+ private checkPermissionsAndIdentityDefined;
150
150
  private fetchIdentityConfig;
151
151
  private setPermissions;
152
152
  private getDefaultParentDashboardIdBase;
@@ -24,7 +24,7 @@ export declare class Cell {
24
24
  */
25
25
  colSpan: number;
26
26
  /**
27
- * The span of the cell in terms of columns. Defaults to 12.
27
+ * The local filters of the cell. Optional.
28
28
  */
29
29
  localFilters: AdditionalFilter[] | undefined;
30
30
  /**
@@ -46,7 +46,7 @@ export declare class Cell {
46
46
  /**
47
47
  * Sets the column span of the cell.
48
48
  *
49
- * @param colSpan The new column span for the cell.
49
+ * @param colSpan The new column span for the cell. Number should be between 1 and 12.
50
50
  */
51
51
  setColSpan(colSpan: number): void;
52
52
  /**
@@ -5,7 +5,7 @@ import * as ViewServices from './ViewServices';
5
5
  * Represents a Library class.
6
6
  * @param components The `component` instance to be added to the library. `uniqueViewId` of the component, should always be the same and not auto-generated.
7
7
  */
8
- declare type LibrayView = {
8
+ export declare type LibrayView = {
9
9
  component: ViewServices.View;
10
10
  uniqueViewId: string;
11
11
  };
@@ -25,7 +25,7 @@ export declare class Library {
25
25
  /**
26
26
  * Adds a cell to the library at a specified position or appends it at the end if no position is specified.
27
27
  * @param component The Component instance to be added to the library.
28
- * @param uniqueViewId The unique view id of the component, should always be the same and not auto-generated.
28
+ * @param uniqueViewId The unique view id of the component, should always be the same and not auto-generated. The `uniqueViewId` will become the `viewId` of the component.
29
29
  * @param attributes An optional object containing the attributes of the cell.
30
30
  * @example library.addComponent(Vizzly.AreaChart, "uniqueViewId");
31
31
  * @example library.addComponent(Vizzly.AreaChart, "uniqueViewId", { position: 0 });
@@ -41,4 +41,3 @@ export declare class Library {
41
41
  addComponents(components: LibrayView[]): void;
42
42
  }
43
43
  export declare const mergeInViewId: (component: ViewServices.View, uniqueViewId: string) => ViewServices.View;
44
- export {};
@@ -0,0 +1 @@
1
+ export declare function validateColSpan(colSpan: number): number;
@@ -1,3 +1,4 @@
1
1
  import { CreateDashboard, UpdateDashboardOptions } from '../Services/APIServices';
2
- export declare const validateCreateDashboardParams: (params: CreateDashboard) => void;
2
+ import { QueryEngineConfig } from 'shared-logic/src/QueryEngineConfig/types';
3
+ export declare const validateCreateDashboardParams: (params: CreateDashboard, queryEngineConfig: QueryEngineConfig | undefined) => void;
3
4
  export declare const validateUpdateDashboardParams: (params: UpdateDashboardOptions) => void;
@@ -0,0 +1,2 @@
1
+ import { AdditionalFilter } from 'shared-logic/src/AdditionalFilter/types';
2
+ export declare function validateAndSetLocalFilters(localFilters: AdditionalFilter[]): AdditionalFilter[];
@@ -0,0 +1,2 @@
1
+ import { LibrayView } from '../Services/ComponentLibraryServices';
2
+ export declare function validateLibraryComponent(item: LibrayView): void;
@@ -0,0 +1,4 @@
1
+ import Joi from '@vizzly/joi';
2
+ export declare const additionalFilterSchema: Joi.AlternativesSchema<any>;
3
+ export declare const globalFilterSchema: Joi.ArraySchema<any[]>;
4
+ export declare const localFiltersSchema: Joi.ArraySchema<any[]>;
@@ -1,5 +1,6 @@
1
1
  import { ComponentType, Component } from './types';
2
- import { EmptyCell, HeaderComponent } from '../Display/types';
2
+ import { EmptyCell } from '../Display/types';
3
+ import { HeaderComponent } from '../Header/types';
3
4
  export * from './constants';
4
5
  export declare const initialCustomComponent: (componentId: string, dataSetId: string) => Component<Component.CustomComponentAttributes>;
5
6
  export declare const initial: <T extends Component.Attributes>(attributes: T) => Component<T>;
@@ -1,6 +1,6 @@
1
1
  import { Dumpable } from '../Dumpable';
2
2
  import { Component } from './types';
3
- import { HeaderComponent } from '../Display/types';
3
+ import { HeaderComponent } from '../Header/types';
4
4
  declare type EmptyComponent = {
5
5
  isEmpty: true;
6
6
  colSpan: number;
@@ -4,7 +4,7 @@ import { QueryEngineConfig } from '../QueryEngineConfig/types';
4
4
  import { SupportedTimeTruncFunctions } from '../TimeDimension/types';
5
5
  import { ComponentInterfaceConfig } from '../ComponentInterface/types';
6
6
  export declare const additionalFilterSchema: (queryEngineConfig: QueryEngineConfig, shouldAlwaysHaveValue?: boolean) => Joi.Schema;
7
- export declare const measureSchema: (supportedAggregates: SupportedAggregates, attributeSchemaOptions: ComponentInterfaceConfig['attributesSchemaOptions']) => Joi.AlternativesSchema<any> | Joi.ObjectSchema<any>;
7
+ export declare const measureSchema: (supportedAggregates: SupportedAggregates, attributeSchemaOptions: ComponentInterfaceConfig['attributesSchemaOptions']) => Joi.ObjectSchema<any> | Joi.AlternativesSchema<any>;
8
8
  export declare const orderSchema: (queryEngineConfig: QueryEngineConfig) => Joi.ObjectSchema<any>;
9
9
  export declare const timeDimensionSchema: (supportedTimeTruncFunctions: SupportedTimeTruncFunctions) => Joi.ObjectSchema<any>;
10
10
  export declare const dimensionSchema: (supportedTimeTruncFunctions: SupportedTimeTruncFunctions, attributeSchemaOptions: ComponentInterfaceConfig['attributesSchemaOptions']) => Joi.ArraySchema<any[]>;
@@ -2,6 +2,7 @@ import { Component as ComponentType } from '../Component/types';
2
2
  import { DataSet } from '../DataSet/types';
3
3
  import { CustomField } from '../CustomField/types';
4
4
  import { Dashboard, SaveableDashboardDefinition } from './types';
5
+ export * from './saveableDashboardDefinitionSchema';
5
6
  export * from './fromRaw';
6
7
  export declare const indexOfDataSet: (dashboard: Dashboard, dataSetId: string) => number;
7
8
  export declare const getDataSet: (dashboard: Dashboard, dataSetId: string) => DataSet | null;
@@ -0,0 +1,5 @@
1
+ import Joi from '@vizzly/joi';
2
+ import { QueryEngineConfig } from '../QueryEngineConfig/types';
3
+ export declare const colSpanSchema: Joi.NumberSchema<number>;
4
+ export declare const saveableDashboardDefinitionSchema: (queryEngineConfig: QueryEngineConfig) => Joi.ObjectSchema<any>;
5
+ export declare function displaySchema(queryEngineConfig: QueryEngineConfig): Joi.ArraySchema<any[]>;
@@ -0,0 +1,3 @@
1
+ import Joi from '@vizzly/joi';
2
+ import { QueryEngineConfig } from '../QueryEngineConfig/types';
3
+ export declare function clientDashboardSchema(queryEngineConfig: QueryEngineConfig | undefined): Joi.ObjectSchema<any>;
@@ -1,6 +1,9 @@
1
1
  import { Dashboard } from '../Dashboard/types';
2
+ import { QueryEngineConfig } from '../QueryEngineConfig/types';
2
3
  import { VizzlyDashboard } from './types';
3
- export declare function buildClientFacingDashboards(dashboards: Dashboard[]): VizzlyDashboard[];
4
+ import { JoiOptions } from '../validations';
5
+ export declare const joiOptions: JoiOptions;
6
+ export declare function buildClientFacingDashboards(dashboards: Dashboard[], queryEngineConfig: QueryEngineConfig | undefined): VizzlyDashboard[];
4
7
  export declare const getChildDashboards: (parentDashboardId: string, clientFacingDash: VizzlyDashboard[]) => VizzlyDashboard[];
5
8
  export declare function getAllClientFacingChildDashboards(clientFacingDash: VizzlyDashboard[]): VizzlyDashboard[];
6
9
  export declare function getParentDashboards(clientFacingDash: VizzlyDashboard[]): VizzlyDashboard[];
@@ -1,5 +1,6 @@
1
- import { Component, ComponentType, MaybeOldComponent } from '../Component/types';
2
- import { Display, DisplayRow, EmptyCell, HeaderComponent } from './types';
1
+ import { Component, ComponentType } from '../Component/types';
2
+ import { Display, DisplayRow, EmptyCell } from './types';
3
+ import { HeaderComponent } from '../Header/types';
3
4
  export { removeAllFieldReferences } from './removeAllFieldReferences';
4
5
  export declare const allComponentsInDirection: (display: Display, rowIndex: number, cellIndex: number, direction: 'left' | 'right') => Array<Component | EmptyCell | HeaderComponent>;
5
6
  export declare const getNextComponentIndexWithSpace: (display: Display, rowIndex: number, cellIndex: number, direction: 'left' | 'right') => number;
@@ -7,7 +8,6 @@ export declare const insertRow: (display: Display, rowIndex: number, height?: nu
7
8
  export declare const newEmptyCell: (colSpan: number) => EmptyCell;
8
9
  export declare const TOTAL_COLSPAN = 12;
9
10
  export declare const appendEmptyCell: (currentPanels: Display, rowIndex: number) => Display;
10
- export declare const addHeaderRow: (display: Display, rowIndex: number, initialTitle: string) => Display;
11
11
  export declare const setComponent: (display: Display, component: Component | EmptyCell | HeaderComponent, rowIndex: number, cellIndex: number) => Display;
12
12
  declare type Move = {
13
13
  rowIndex: number;
@@ -16,8 +16,6 @@ declare type Move = {
16
16
  export declare const swapComponents: (display: Display, positionA: Move, positionB: Move) => Display;
17
17
  export declare const init: () => Display;
18
18
  export declare const initRow: (components: Array<Component | EmptyCell | HeaderComponent>, height?: number) => DisplayRow;
19
- export declare const initHeaderComponent: (displayTitle: string) => HeaderComponent;
20
19
  export declare const listComponentTypesUsed: (display: Display) => ComponentType[];
21
20
  export declare const isComponentEmpty: (component: Component | EmptyCell | HeaderComponent) => component is EmptyCell;
22
- export declare const isHeaderComponent: (component: Component.RawComponent | EmptyCell | HeaderComponent | MaybeOldComponent) => component is HeaderComponent;
23
21
  export declare function isDisplayComponentsEmpty(display: Display): boolean;
@@ -1,12 +1,9 @@
1
1
  import { Component } from '../Component/types';
2
+ import { HeaderComponent } from '../Header/types';
2
3
  export declare type EmptyCell = {
3
4
  isEmpty: true;
4
5
  colSpan: number;
5
6
  };
6
- export declare type HeaderComponent = {
7
- displayTitle: string;
8
- colSpan: number;
9
- };
10
7
  export declare type DisplayRow = {
11
8
  components: Array<Component | EmptyCell | HeaderComponent>;
12
9
  height: number;
@@ -1,6 +1,7 @@
1
- import { DisplayRow, EmptyCell, HeaderComponent } from './types';
1
+ import { DisplayRow, EmptyCell } from './types';
2
2
  import { Component as ComponentType } from '../Component/types';
3
3
  import { ComponentInterfaceConfig } from '../ComponentInterface/types';
4
+ import { HeaderComponent } from '../Header/types';
4
5
  declare type OldDisplayRow = (ComponentType | null | EmptyCell | HeaderComponent)[];
5
6
  export declare const upcastRow: (displayRow: OldDisplayRow | DisplayRow, componentInterfaceConfig?: ComponentInterfaceConfig) => DisplayRow;
6
7
  export {};
@@ -0,0 +1,7 @@
1
+ import { Component, MaybeOldComponent } from '../Component/types';
2
+ import { Display, EmptyCell } from '../Display/types';
3
+ import { HeaderComponent } from './types';
4
+ export declare const init: (displayTitle: string) => HeaderComponent;
5
+ export declare const isComponent: (component: Component.RawComponent | EmptyCell | HeaderComponent | MaybeOldComponent) => component is HeaderComponent;
6
+ export declare const HEADER_ROW_HEIGHT = 52;
7
+ export declare const add: (display: Display, rowIndex: number, initialTitle: string) => Display;
@@ -0,0 +1,2 @@
1
+ import Joi from '@vizzly/joi';
2
+ export declare const attributesSchema: Joi.ObjectSchema<any>;
@@ -0,0 +1,4 @@
1
+ export declare type HeaderComponent = {
2
+ displayTitle: string;
3
+ colSpan: number;
4
+ };
@@ -66,6 +66,13 @@ export declare type VizzlyTranslations = {
66
66
  * String containing the translation.
67
67
  */
68
68
  remove_pill: string;
69
+ /**
70
+ * @default 'Page'
71
+ *
72
+ * @returns
73
+ * String containing the translation.
74
+ */
75
+ 'pagination.page': string;
69
76
  /**
70
77
  * @default 'Select...'
71
78
  *
@@ -469,6 +476,27 @@ export declare type VizzlyTranslations = {
469
476
  * String containing the translation.
470
477
  */
471
478
  download: string;
479
+ /**
480
+ * @default 'Attributes in raw JSON format'
481
+ *
482
+ * @returns
483
+ * String containing the translation.
484
+ */
485
+ json_attributes: string;
486
+ /**
487
+ * @default 'Copy'
488
+ *
489
+ * @returns
490
+ * String containing the translation.
491
+ */
492
+ copy: string;
493
+ /**
494
+ * @default 'Data in raw JSON format'
495
+ *
496
+ * @returns
497
+ * String containing the translation.
498
+ */
499
+ json_results: string;
472
500
  /**
473
501
  * @default 'Download dashboard to PDF'
474
502
  *
@@ -762,6 +790,20 @@ export declare type VizzlyTranslations = {
762
790
  * String containing the translation.
763
791
  */
764
792
  manage_reports: string;
793
+ /**
794
+ * @default 'JSON Results'
795
+ *
796
+ * @returns
797
+ * String containing the translation.
798
+ */
799
+ view_raw_results: string;
800
+ /**
801
+ * @default 'JSON Attributes'
802
+ *
803
+ * @returns
804
+ * String containing the translation.
805
+ */
806
+ view_view_attributes: string;
765
807
  /**
766
808
  * @default 'Options'
767
809
  *
@@ -996,26 +1038,47 @@ export declare type VizzlyTranslations = {
996
1038
  */
997
1039
  denominator: string;
998
1040
  /**
999
- * @default 'Denominator required'
1041
+ * @default 'Across all groups'
1000
1042
  *
1001
1043
  * @returns
1002
1044
  * String containing the translation.
1003
1045
  */
1004
- 'percentage_modal.denominator_required': string;
1046
+ denominator_scope_all_title: string;
1005
1047
  /**
1006
- * @default 'Numerator required'
1048
+ * @default 'Denominator is calculated using all your data'
1007
1049
  *
1008
1050
  * @returns
1009
1051
  * String containing the translation.
1010
1052
  */
1011
- 'percentage_modal.numerator_required': string;
1053
+ denominator_scope_all_description: string;
1012
1054
  /**
1013
- * @default 'Filters cannot be added to this already created Percentage Custom Metric.'
1055
+ * @default 'Denominator is calculated using the data within each grouping'
1014
1056
  *
1015
1057
  * @returns
1016
1058
  * String containing the translation.
1017
1059
  */
1018
- 'percentage_modal.filters_cannot_be_added': string;
1060
+ denominator_scope_within_group_description: string;
1061
+ /**
1062
+ * @default 'Scope'
1063
+ *
1064
+ * @returns
1065
+ * String containing the translation.
1066
+ */
1067
+ denominator_scope_title: string;
1068
+ /**
1069
+ * @default 'Denominator required'
1070
+ *
1071
+ * @returns
1072
+ * String containing the translation.
1073
+ */
1074
+ 'percentage_modal.denominator_required': string;
1075
+ /**
1076
+ * @default 'Numerator required'
1077
+ *
1078
+ * @returns
1079
+ * String containing the translation.
1080
+ */
1081
+ 'percentage_modal.numerator_required': string;
1019
1082
  /**
1020
1083
  * @default '+ Filter by'
1021
1084
  *
@@ -4887,6 +4950,13 @@ export declare type VizzlyTranslations = {
4887
4950
  * String containing the translation.
4888
4951
  */
4889
4952
  'config.supported_aggregate.countDistinct': string;
4953
+ /**
4954
+ * @default "Median"
4955
+ *
4956
+ * @returns
4957
+ * String containing the translation.
4958
+ */
4959
+ 'config.supported_aggregate.median': string;
4890
4960
  /**
4891
4961
  * @default "Monthly"
4892
4962
  *
@@ -0,0 +1,4 @@
1
+ import ValidationError from './ValidationError';
2
+ export default class ServicesValidation extends ValidationError {
3
+ constructor(value: unknown, service: string);
4
+ }
package/package.json CHANGED
@@ -22,5 +22,5 @@
22
22
  "test": "jest",
23
23
  "prepare": "yarn build"
24
24
  },
25
- "version": "0.9.1"
25
+ "version": "0.10.0-dev-9df5ee845450a397ffb4a78ed75733b0a912c5ec"
26
26
  }