@vizzly/services 0.9.0 → 0.9.1-dev-1a81ea83cd1eedd03984d8a3056c32e4f16b3f7b

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.
@@ -3,8 +3,12 @@ import { Cell } from './CellServices';
3
3
  import * as ViewServices from './ViewServices';
4
4
  /**
5
5
  * Represents a Library class.
6
- * @param components An optional array of Component instances to initialize the library.
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 = {
9
+ component: ViewServices.View;
10
+ uniqueViewId: string;
11
+ };
8
12
  export declare class Library {
9
13
  /**
10
14
  * An array of Cell instances representing the cells in the library.
@@ -13,24 +17,28 @@ export declare class Library {
13
17
  /**
14
18
  * Creates a new instance of a Library.
15
19
  * @param attributes An optional object containing the attributes of the library.
20
+ * @param components The `component` instance to be added to the library. `uniqueViewId` of the component, should always be the same and not auto-generated.
16
21
  */
17
22
  constructor(attributes?: {
18
- components?: ViewServices.View[];
23
+ components?: LibrayView[];
19
24
  });
20
25
  /**
21
26
  * Adds a cell to the library at a specified position or appends it at the end if no position is specified.
22
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.
23
29
  * @param attributes An optional object containing the attributes of the cell.
24
- * @example library.addComponent(Vizzly.AreaChart);
25
- * @example library.addComponent(Vizzly.AreaChart, { position: 0 });
30
+ * @example library.addComponent(Vizzly.AreaChart, "uniqueViewId");
31
+ * @example library.addComponent(Vizzly.AreaChart, "uniqueViewId", { position: 0 });
26
32
  */
27
- addComponent(component: ViewServices.View, attributes?: {
33
+ addComponent(component: ViewServices.View, uniqueViewId: string, attributes?: {
28
34
  position?: number;
29
35
  localFilters?: AdditionalFilter[];
30
36
  }): void;
31
37
  /**
32
38
  * Adds an array of cells to the library.
33
- * @param components An array of Component instances.
39
+ * @param components The `component` instance to be added to the library. `uniqueViewId` of the component, should always be the same and not auto-generated.
34
40
  */
35
- addComponents(components: ViewServices.View[]): void;
41
+ addComponents(components: LibrayView[]): void;
36
42
  }
43
+ export declare const mergeInViewId: (component: ViewServices.View, uniqueViewId: string) => ViewServices.View;
44
+ export {};
@@ -26,4 +26,5 @@ export declare const updateLibraryWithProtectedComponents: (dashboards: Dashboar
26
26
  export declare function resetToParentDashboard(dashboard: Dashboard, dashboards: Dashboard[], parentDashboardId: string): Dashboard;
27
27
  export declare const buildProgrammaticDashboard: (programaticDashboards: Partial<SaveableDashboardDefinition>[], dataSets: DataSet[]) => Dashboard[];
28
28
  export declare function updateWithProgrammaticDashboard(allDashboards: Dashboard[], programmaticDashboards: Dashboard[]): Dashboard[];
29
+ export declare const addUniqueLibraryComponents: (programmaticLibrary: ComponentType[], dashboardLibrary: ComponentType[]) => ComponentType[];
29
30
  export declare const checkAndReturnProgrammaticDashboardId: (dashboards: Dashboard[]) => string | undefined;
@@ -10,5 +10,6 @@ export declare type DateTimeFieldOverrides = FieldOverrides & Partial<{
10
10
  }>;
11
11
  export declare const stringField: (queryEngineConfig: QueryEngineConfig, id: string, publicName: string, overrides?: FieldOverrides) => NonDateTimeField;
12
12
  export declare const numberField: (queryEngineConfig: QueryEngineConfig, id: string, publicName: string, overrides?: FieldOverrides) => NonDateTimeField;
13
+ export declare const stringArrayField: (queryEngineConfig: QueryEngineConfig, id: string, publicName: string, overrides?: FieldOverrides) => NonDateTimeField;
13
14
  export declare const booleanField: (queryEngineConfig: QueryEngineConfig, id: string, publicName: string, overrides?: FieldOverrides) => NonDateTimeField;
14
15
  export declare const dateTimeField: (queryEngineConfig: QueryEngineConfig, id: string, publicName: string, overrides: DateTimeFieldOverrides) => DateTimeField;
@@ -8,6 +8,11 @@ export declare type DataSet = {
8
8
  id: string;
9
9
  name: string;
10
10
  description?: string;
11
+ /**
12
+ * Hide the data set from the editor. This allows data sets to be used to power dashboard
13
+ * filters, but not used to create views on.
14
+ * */
15
+ hide?: boolean;
11
16
  fields: DataSet.Field[];
12
17
  preAggregated?: undefined | false | string[];
13
18
  };
@@ -1,6 +1,6 @@
1
1
  import { Query, SubQuery } from '../Query/types';
2
2
  export declare type DataMap = {
3
- [key: string]: string | boolean | number | Date | null;
3
+ [key: string]: string | boolean | number | Date | null | string[];
4
4
  };
5
5
  declare type JSQueryEngineOperator = '>' | '<' | '=' | '!=' | '>=' | '<=' | 'is_one_of' | 'is_not_one_of' | 'starts_with' | 'ends_with' | 'contains_substring' | 'does_not_contain_substring';
6
6
  export declare type JSQueryEngineTimeFunction = 'month' | 'year' | 'quarter' | 'week' | 'day' | 'hour' | 'minute' | 'second';
package/package.json CHANGED
@@ -22,5 +22,5 @@
22
22
  "test": "jest",
23
23
  "prepare": "yarn build"
24
24
  },
25
- "version": "0.9.0"
25
+ "version": "0.9.1-dev-1a81ea83cd1eedd03984d8a3056c32e4f16b3f7b"
26
26
  }