@vizzly/services 0.7.0 → 0.7.1-dev-b20a0c09c1eedef43690cbdff448965dfea9c70a

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 (108) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/services/src/Services/APIServices.d.ts +153 -0
  3. package/dist/services/src/Services/CellServices.d.ts +4 -4
  4. package/dist/services/src/Services/ComponentLibraryServices.d.ts +4 -4
  5. package/dist/services/src/Services/DashboardServices.d.ts +1 -1
  6. package/dist/services/src/Services/ViewServices.d.ts +61 -0
  7. package/dist/services/src/index.d.ts +17 -13
  8. package/dist/shared-logic/src/AI/types.d.ts +12 -0
  9. package/dist/shared-logic/src/ApiResource/index.d.ts +7 -0
  10. package/dist/shared-logic/src/AreaChart/attributesSchema.d.ts +1 -1
  11. package/dist/shared-logic/src/BarChart/attributesSchema.d.ts +1 -1
  12. package/dist/shared-logic/src/Base64/index.d.ts +3 -0
  13. package/dist/shared-logic/src/BasicTable/attributesSchema.d.ts +1 -1
  14. package/dist/shared-logic/src/ComboChart/attributesSchema.d.ts +1 -1
  15. package/dist/shared-logic/src/Component/Component.d.ts +1 -3
  16. package/dist/shared-logic/src/Component/attributesSchema.d.ts +2 -2
  17. package/dist/shared-logic/src/Component/constants.d.ts +4 -0
  18. package/dist/shared-logic/src/Component/setAttributes.d.ts +1 -1
  19. package/dist/shared-logic/src/Component/sharedSchemas.d.ts +8 -7
  20. package/dist/shared-logic/src/Component/types.d.ts +30 -2
  21. package/dist/shared-logic/src/ComponentInterface/types.d.ts +3 -1
  22. package/dist/shared-logic/src/DashboardAPI/dashboardAPI/creating.d.ts +18 -0
  23. package/dist/shared-logic/src/DashboardAPI/dashboardAPI/updating.d.ts +16 -0
  24. package/dist/shared-logic/src/DashboardAPI/dashboardAPI.d.ts +17 -0
  25. package/dist/shared-logic/src/DashboardAPI/dashboardManager.d.ts +6 -0
  26. package/dist/shared-logic/src/DashboardAPI/dataConfigurationAndIdentity.d.ts +7 -0
  27. package/dist/shared-logic/src/DashboardAPI/dataSets.d.ts +12 -0
  28. package/dist/shared-logic/src/DashboardAPI/getDashboardAdminOverride.d.ts +1 -0
  29. package/dist/shared-logic/src/DashboardAPI/types.d.ts +17 -0
  30. package/dist/shared-logic/src/DashboardPermission/index.d.ts +7 -0
  31. package/dist/shared-logic/src/DashboardPermission/types.d.ts +12 -0
  32. package/dist/shared-logic/src/DataPanelConfig/types.d.ts +8 -1
  33. package/dist/shared-logic/src/DataTable/attributesSchema.d.ts +1 -1
  34. package/dist/shared-logic/src/DataTable/types.d.ts +1 -0
  35. package/dist/shared-logic/src/Documentation/index.d.ts +2 -0
  36. package/dist/shared-logic/src/Documentation/joiToDocumentation.d.ts +4 -0
  37. package/dist/shared-logic/src/Documentation/joiToSchemaDefinition.d.ts +2 -0
  38. package/dist/shared-logic/src/FormatPanelConfig/types.d.ts +5 -1
  39. package/dist/shared-logic/src/IdentityConfig/IdentityConfig.d.ts +4 -0
  40. package/dist/shared-logic/src/IdentityConfig/index.d.ts +1 -0
  41. package/dist/shared-logic/src/JWT/JWT.d.ts +2 -0
  42. package/dist/shared-logic/src/LineChart/attributesSchema.d.ts +1 -1
  43. package/dist/shared-logic/src/MercatorMap/attributesSchema.d.ts +1 -1
  44. package/dist/shared-logic/src/PieChart/attributesSchema.d.ts +1 -1
  45. package/dist/shared-logic/src/Progress/attributesSchema.d.ts +3 -0
  46. package/dist/shared-logic/src/Progress/index.d.ts +5 -0
  47. package/dist/shared-logic/src/Progress/types.d.ts +2 -0
  48. package/dist/shared-logic/src/Project/types.d.ts +67 -0
  49. package/dist/shared-logic/src/Query/validate.d.ts +6 -6
  50. package/dist/shared-logic/src/ScatterChart/attributesSchema.d.ts +1 -1
  51. package/dist/shared-logic/src/SingleStat/attributesSchema.d.ts +1 -1
  52. package/dist/shared-logic/src/SingleStat/upcastSingleValueAttributes.d.ts +4 -0
  53. package/dist/shared-logic/src/Table/attributesSchema.d.ts +1 -1
  54. package/dist/shared-logic/src/Theme/types.d.ts +7 -0
  55. package/dist/shared-logic/src/api/httpClient.d.ts +1 -0
  56. package/dist/shared-logic/src/api/index.d.ts +71 -0
  57. package/dist/shared-logic/src/api/queryEngine/createDashboard.d.ts +18 -0
  58. package/dist/shared-logic/src/api/queryEngine/fetchDataSets.d.ts +4 -0
  59. package/dist/shared-logic/src/api/queryEngine/multiGetDashboards.d.ts +7 -0
  60. package/dist/shared-logic/src/api/queryEngine/updateDashboard.d.ts +13 -0
  61. package/dist/shared-logic/src/api/types.d.ts +1 -0
  62. package/dist/shared-logic/src/api/vizzly/askAi/types.d.ts +2 -0
  63. package/dist/shared-logic/src/api/vizzly/askAi/validateAndUpcast.d.ts +5 -0
  64. package/dist/shared-logic/src/api/vizzly/askAi.d.ts +12 -0
  65. package/dist/shared-logic/src/api/vizzly/createDashboard.d.ts +18 -0
  66. package/dist/shared-logic/src/api/vizzly/createDashboardAccess.d.ts +8 -0
  67. package/dist/shared-logic/src/api/vizzly/createProjectApiKey.d.ts +2 -0
  68. package/dist/shared-logic/src/api/vizzly/createQueryEngineUser.d.ts +2 -0
  69. package/dist/shared-logic/src/api/vizzly/createSelfHostedDynamicQueryEngine.d.ts +3 -0
  70. package/dist/shared-logic/src/api/vizzly/createSelfHostedInBrowserQueryEngineProject.d.ts +3 -0
  71. package/dist/shared-logic/src/api/vizzly/createSelfHostedQueryEngineProject.d.ts +3 -0
  72. package/dist/shared-logic/src/api/vizzly/createVizzlyConfigVersion.d.ts +2 -0
  73. package/dist/shared-logic/src/api/vizzly/getConnection.d.ts +7 -0
  74. package/dist/shared-logic/src/api/vizzly/getManagedQueryEngineKeyPair.d.ts +5 -0
  75. package/dist/shared-logic/src/api/vizzly/getParentDashboards.d.ts +9 -0
  76. package/dist/shared-logic/src/api/vizzly/getProject.d.ts +3 -0
  77. package/dist/shared-logic/src/api/vizzly/getQueryEngineUser.d.ts +3 -0
  78. package/dist/shared-logic/src/api/vizzly/getTeamMembers.d.ts +11 -0
  79. package/dist/shared-logic/src/api/vizzly/getVizzlyConfig.d.ts +4 -0
  80. package/dist/shared-logic/src/api/vizzly/multiGetDashboards.d.ts +7 -0
  81. package/dist/shared-logic/src/api/vizzly/multiGetEncryptedDashboards.d.ts +7 -0
  82. package/dist/shared-logic/src/api/vizzly/saveConnection.d.ts +2 -0
  83. package/dist/shared-logic/src/api/vizzly/saveEncryptedProjectEncryptionSecret.d.ts +2 -0
  84. package/dist/shared-logic/src/api/vizzly/saveScheduledReport.d.ts +6 -0
  85. package/dist/shared-logic/src/api/vizzly/updateDashboard.d.ts +18 -0
  86. package/dist/shared-logic/src/api/vizzly/updateProjectApiKey.d.ts +6 -0
  87. package/dist/shared-logic/src/errors/AIUsageLimitReached.d.ts +4 -0
  88. package/dist/shared-logic/src/errors/CorruptedView.d.ts +1 -1
  89. package/dist/shared-logic/src/errors/DashboardQuotaReached.d.ts +4 -0
  90. package/dist/shared-logic/src/errors/EncryptedProjectSecretAlreadyExists.d.ts +4 -0
  91. package/dist/shared-logic/src/errors/FailedToCreateDashboard.d.ts +4 -0
  92. package/dist/shared-logic/src/errors/FailedToCreateDashboardAccess.d.ts +4 -0
  93. package/dist/shared-logic/src/errors/FailedToGetDashboard.d.ts +4 -0
  94. package/dist/shared-logic/src/errors/FailedToLoadIdentity.d.ts +4 -0
  95. package/dist/shared-logic/src/errors/FailedToResolveDataSets.d.ts +4 -0
  96. package/dist/shared-logic/src/errors/FailedToSaveVizzlyConfigVersion.d.ts +3 -0
  97. package/dist/shared-logic/src/errors/FailedToUpdateDashboard.d.ts +4 -0
  98. package/dist/shared-logic/src/errors/InvalidDataSetsPropType.d.ts +4 -0
  99. package/dist/shared-logic/src/errors/InvalidIdentityReturn.d.ts +4 -0
  100. package/dist/shared-logic/src/errors/ProjectEncryptedSecretAlreadySaved.d.ts +4 -0
  101. package/dist/shared-logic/src/errors/ReadOnlyPermissionNotFound.d.ts +4 -0
  102. package/dist/shared-logic/src/errors/ReadPermissionNotFound.d.ts +4 -0
  103. package/dist/shared-logic/src/errors/VizzlyApiCallErrorFailedToSetupProject.d.ts +4 -0
  104. package/dist/shared-logic/src/errors/WritePermissionNotFound.d.ts +4 -0
  105. package/dist/shared-logic/src/getComponentInterface.d.ts +1 -0
  106. package/package.json +1 -1
  107. package/dist/services/src/Services/ComponentServices.d.ts +0 -58
  108. package/dist/shared-logic/src/SingleStat/upcastSingleStatAttributes.d.ts +0 -3
@@ -0,0 +1,153 @@
1
+ import { identityCallback } from 'shared-logic/src/Callbacks/types';
2
+ import { Dashboard as DashboardType } from 'shared-logic/src/Dashboard';
3
+ import * as Dashboard from 'shared-logic/src/Dashboard';
4
+ import { ApiConfig } from 'shared-logic/src/ApiConfig';
5
+ import { DashboardStorageStrategy } from 'shared-logic/src/DashboardAPI/types';
6
+ import * as dataSetsProperty from 'shared-logic/src/DashboardAPI/dataSets';
7
+ /**
8
+ * Represents a Vizzly dashboard.
9
+ */
10
+ export type VizzlyDashboard = {
11
+ id: DashboardType['id'];
12
+ parentDashboardId: DashboardType['parentDashboardId'] | undefined;
13
+ display: DashboardType['display'];
14
+ componentLibrary: DashboardType['componentLibrary'];
15
+ createdAt: DashboardType['createdAt'];
16
+ updatedAt: DashboardType['updatedAt'];
17
+ metadata: DashboardType['metadata'];
18
+ };
19
+ /**
20
+ * Represents the payload for creating a dashboard.
21
+ */
22
+ export type CreateDashboard = {
23
+ definition: Dashboard.SaveableDashboardDefinition;
24
+ /**
25
+ * The metadata for the dashboard.
26
+ *
27
+ * @property {any} meta - The metadata for the dashboard can be set to anything you require.
28
+ *
29
+ */
30
+ meta: any;
31
+ /**
32
+ * The ID of the parent dashboard.
33
+ *
34
+ * @property {string} parentDashboardId - The ID of the parent dashboard.
35
+ * @default The default parent dashboard ID.
36
+ */
37
+ parentDashboardId?: string | null;
38
+ };
39
+ /**
40
+ * Options for updating a dashboard.
41
+ *
42
+ * @property {VizzlyDashboard['metadata']} metadata - The metadata to update the dashboard with.
43
+ */
44
+ type UpdateDashboardOptions = {
45
+ metadata?: VizzlyDashboard['metadata'];
46
+ };
47
+ type APIOptions = {
48
+ /**
49
+ * The parent dashboard ID to use when creating a child dashboard.
50
+ */
51
+ parentDashboardId?: string;
52
+ /**
53
+ * The API config to use when making requests to the Vizzly API.
54
+ *
55
+ * @default { host: 'https://api.vizzly.co' }
56
+ */
57
+ vizzlyAPIConfig?: ApiConfig;
58
+ /**
59
+ * The function to use when loading the data sets.
60
+ */
61
+ dataSets?: dataSetsProperty.DataSetsCallback;
62
+ };
63
+ /**
64
+ * Represents an API class for interacting with the services.
65
+ */
66
+ export declare class API {
67
+ private abortController;
68
+ private identity;
69
+ private identityTokens;
70
+ private permissions;
71
+ private identityConfig;
72
+ private dashboardStorageStrategy;
73
+ private loadDataSetsCallback;
74
+ private dashboards;
75
+ private vizzlyAPI;
76
+ private parentDashboardId;
77
+ /**
78
+ * Whether the API is currently loading.
79
+ * @default false
80
+ */
81
+ loading: boolean;
82
+ /**
83
+ *
84
+ * @param identity The identity callback to use when retrieving the identity.
85
+ * @param loadQueryEngineConfig The function to use when loading the query engine config.
86
+ * @param options The options for the API.
87
+ */
88
+ constructor(identity: identityCallback, options?: APIOptions);
89
+ /**
90
+ * Retrieves the dashboards from the API.
91
+ *
92
+ * @returns A promise that resolves to an array of client-facing dashboards.
93
+ * @throws {Error} If an error occurs during the retrieval process.
94
+ */
95
+ getDashboards(): Promise<import("shared-logic/src/DashboardAPI/types").VizzlyDashboard[] | undefined>;
96
+ /**
97
+ * Retrieves all child dashboards.
98
+ *
99
+ * @returns A promise that resolves to an array of child dashboards.
100
+ * @throws {Error} If an error occurs while retrieving the child dashboards.
101
+ */
102
+ getAllChildDashboards(): Promise<import("shared-logic/src/DashboardAPI/types").VizzlyDashboard[] | undefined>;
103
+ getDataSets(): Promise<import("shared-logic/src/DataSet/types").DataSet[] | undefined>;
104
+ /**
105
+ * Retrieves the parent dashboards.
106
+ * @returns A promise that resolves to an array of parent dashboards.
107
+ */
108
+ getParentDashboards(): Promise<import("shared-logic/src/DashboardAPI/types").VizzlyDashboard[] | undefined>;
109
+ /**
110
+ * Retrieves the child dashboards for a given parent dashboard.
111
+ * @param parentDashboardId The ID of the parent dashboard.
112
+ * @returns An array of child dashboards.
113
+ */
114
+ getChildDashboards(parentDashboardId: string): Promise<import("shared-logic/src/DashboardAPI/types").VizzlyDashboard[] | undefined>;
115
+ /**
116
+ * Creates a dashboard with the specified parameters.
117
+ *
118
+ * @param params - The parameters for creating the dashboard.
119
+ * @returns The created dashboard.
120
+ * @throws If there is an error during the creation process.
121
+ */
122
+ createDashboard(params: CreateDashboard): Promise<DashboardType | undefined>;
123
+ /**
124
+ * Updates a dashboard with the specified ID using the provided options.
125
+ * @param dashboardId - The ID of the dashboard to update.
126
+ * @param options - The options for updating the dashboard.
127
+ * @returns The updated dashboard.
128
+ */
129
+ updateDashboard(dashboardId: string, options: UpdateDashboardOptions): Promise<DashboardType | undefined>;
130
+ /**
131
+ * Deletes a dashboard.
132
+ * @param dashboardId The ID of the dashboard to delete.
133
+ * @returns The updated dashboard after deletion.
134
+ */
135
+ deleteDashboard(dashboardId: string): Promise<DashboardType | undefined>;
136
+ /**
137
+ * Checks if the user is an admin.
138
+ * @returns A promise that resolves to a string representing the user's access level ('admin' or 'user').
139
+ */
140
+ isAdmin(): Promise<"admin" | "standard" | undefined>;
141
+ /**
142
+ * Retrieves the default parent dashboard ID.
143
+ *
144
+ * @returns {Promise<string>} A promise that resolves to the default parent dashboard ID.
145
+ */
146
+ getDefaultParentDashboardId(): Promise<string>;
147
+ private checkEverythingIsDefined;
148
+ private fetchIdentityConfig;
149
+ private setPermissions;
150
+ private getDefaultParentDashboardIdBase;
151
+ getDashboardStorageStrategy(): DashboardStorageStrategy;
152
+ }
153
+ export {};
@@ -1,4 +1,4 @@
1
- import * as ComponentServices from './ComponentServices';
1
+ import * as ViewServices from './ViewServices';
2
2
  import { AdditionalFilter } from 'shared-logic/src/AdditionalFilter/types';
3
3
  /**
4
4
  * Represents a CellAttributes type.
@@ -7,7 +7,7 @@ import { AdditionalFilter } from 'shared-logic/src/AdditionalFilter/types';
7
7
  * @param localFilters - The local filters of the cell. Optional.
8
8
  */
9
9
  export type CellAttributes = {
10
- component?: ComponentServices.ComponentClasses;
10
+ component?: ViewServices.View;
11
11
  colSpan?: number;
12
12
  localFilters?: AdditionalFilter[];
13
13
  };
@@ -18,7 +18,7 @@ export declare class Cell {
18
18
  /**
19
19
  * The component contained within the cell. It's optional and can be undefined.
20
20
  */
21
- component: ComponentServices.ComponentClasses | undefined;
21
+ component: ViewServices.View | undefined;
22
22
  /**
23
23
  * The span of the cell in terms of columns. Defaults to 12.
24
24
  */
@@ -54,7 +54,7 @@ export declare class Cell {
54
54
  *
55
55
  * @param component The component to be set in the cell.
56
56
  */
57
- setComponent(component: ComponentServices.ComponentClasses): void;
57
+ setComponent(component: ViewServices.View): void;
58
58
  /**
59
59
  * Clears the component from the cell and optionally sets a new column span.
60
60
  * Marks the cell as empty.
@@ -1,6 +1,6 @@
1
1
  import { AdditionalFilter } from 'shared-logic/src/AdditionalFilter/types';
2
2
  import { Cell } from './CellServices';
3
- import * as ComponentServices from './ComponentServices';
3
+ import * as ViewServices from './ViewServices';
4
4
  /**
5
5
  * Represents a Library class.
6
6
  * @param components An optional array of Component instances to initialize the library.
@@ -15,7 +15,7 @@ export declare class Library {
15
15
  * @param attributes An optional object containing the attributes of the library.
16
16
  */
17
17
  constructor(attributes?: {
18
- components?: ComponentServices.ComponentClasses[];
18
+ components?: ViewServices.View[];
19
19
  });
20
20
  /**
21
21
  * Adds a cell to the library at a specified position or appends it at the end if no position is specified.
@@ -24,7 +24,7 @@ export declare class Library {
24
24
  * @example library.addComponent(Vizzly.AreaChart);
25
25
  * @example library.addComponent(Vizzly.AreaChart, { position: 0 });
26
26
  */
27
- addComponent(component: ComponentServices.ComponentClasses, attributes?: {
27
+ addComponent(component: ViewServices.View, attributes?: {
28
28
  position?: number;
29
29
  localFilters?: AdditionalFilter[];
30
30
  }): void;
@@ -32,5 +32,5 @@ export declare class Library {
32
32
  * Adds an array of cells to the library.
33
33
  * @param components An array of Component instances.
34
34
  */
35
- addComponents(components: ComponentServices.ComponentClasses[]): void;
35
+ addComponents(components: ViewServices.View[]): void;
36
36
  }
@@ -28,7 +28,7 @@ export declare class Dashboard<T> {
28
28
  * @param attributes - The attributes of the dashboard.
29
29
  * @throws Error if the dashboard id is undefined.
30
30
  */
31
- constructor(id: string, attributes?: DashboardAttributes);
31
+ constructor(id?: string | undefined, attributes?: DashboardAttributes);
32
32
  /**
33
33
  * Sets the display configuration for the dashboard.
34
34
  * @param display - An array of Row or Header objects representing the new
@@ -0,0 +1,61 @@
1
+ import type { Component as VizzlyComponentType } from 'shared-logic/src/Component/types';
2
+ import type { DataSet } from 'shared-logic/src/DataSet/types';
3
+ interface ViewAttributes {
4
+ areaChart: VizzlyComponentType.AreaChartAttributes;
5
+ lineChart: VizzlyComponentType.LineChartAttributes;
6
+ barChart: VizzlyComponentType.BarChartAttributes;
7
+ pieChart: VizzlyComponentType.PieChartAttributes;
8
+ scatterChart: VizzlyComponentType.ScatterChartAttributes;
9
+ comboChart: VizzlyComponentType.ComboChartAttributes;
10
+ dataTable: VizzlyComponentType.DataTableAttributes;
11
+ basicTable: VizzlyComponentType.BasicTableAttributes;
12
+ horizontalBarChart: VizzlyComponentType.HorizontalBarChartAttributes;
13
+ mercatorMap: VizzlyComponentType.MercatorMapAttributes;
14
+ singleStat: VizzlyComponentType.SingleStatAttributes;
15
+ progress: VizzlyComponentType.ProgressAttributes;
16
+ }
17
+ export declare class ViewServices<T extends keyof ViewAttributes> {
18
+ componentType: T;
19
+ attributes: ViewAttributes[T] | undefined;
20
+ private dataSet;
21
+ constructor(componentType: T, dataSet: DataSet, attributes?: Partial<ViewAttributes[T]>);
22
+ updateAttributes(newAttributes: Partial<ViewAttributes[T]>): void;
23
+ }
24
+ export type View = AreaChart | LineChart | BarChart | PieChart | ScatterChart | ComboChart | PivotTable | BasicTable | HorizontalBarChart | MercatorMap | SingleStat | Progress;
25
+ export declare class AreaChart extends ViewServices<'areaChart'> {
26
+ constructor(dataSet: DataSet, attributes?: Partial<ViewAttributes['areaChart']>);
27
+ }
28
+ export declare class LineChart extends ViewServices<'lineChart'> {
29
+ constructor(dataSet: DataSet, attributes?: Partial<ViewAttributes['lineChart']>);
30
+ }
31
+ export declare class BarChart extends ViewServices<'barChart'> {
32
+ constructor(dataSet: DataSet, attributes?: Partial<ViewAttributes['barChart']>);
33
+ }
34
+ export declare class PieChart extends ViewServices<'pieChart'> {
35
+ constructor(dataSet: DataSet, attributes?: Partial<ViewAttributes['pieChart']>);
36
+ }
37
+ export declare class ScatterChart extends ViewServices<'scatterChart'> {
38
+ constructor(dataSet: DataSet, attributes?: Partial<ViewAttributes['scatterChart']>);
39
+ }
40
+ export declare class ComboChart extends ViewServices<'comboChart'> {
41
+ constructor(dataSet: DataSet, attributes?: Partial<ViewAttributes['comboChart']>);
42
+ }
43
+ export declare class PivotTable extends ViewServices<'dataTable'> {
44
+ constructor(dataSet: DataSet, attributes?: Partial<ViewAttributes['dataTable']>);
45
+ }
46
+ export declare class BasicTable extends ViewServices<'basicTable'> {
47
+ constructor(dataSet: DataSet, attributes?: Partial<ViewAttributes['basicTable']>);
48
+ }
49
+ export declare class HorizontalBarChart extends ViewServices<'horizontalBarChart'> {
50
+ constructor(dataSet: DataSet, attributes?: Partial<ViewAttributes['horizontalBarChart']>);
51
+ }
52
+ export declare class MercatorMap extends ViewServices<'mercatorMap'> {
53
+ constructor(dataSet: DataSet, attributes?: Partial<ViewAttributes['mercatorMap']>);
54
+ }
55
+ export declare class SingleStat extends ViewServices<'singleStat'> {
56
+ constructor(dataSet: DataSet, attributes?: Partial<ViewAttributes['singleStat']>);
57
+ }
58
+ export declare class Progress extends ViewServices<'progress'> {
59
+ constructor(dataSet: DataSet, attributes?: Partial<ViewAttributes['progress']>);
60
+ }
61
+ export {};
@@ -1,28 +1,32 @@
1
1
  import { QueryEngineConfig, QueryEngineEndpoint } from '../../shared-logic/src/QueryEngineConfig/types';
2
- import * as ComponentServices from './Services/ComponentServices';
2
+ import * as ViewServices from './Services/ViewServices';
3
3
  import { Cell } from './Services/CellServices';
4
4
  import { Row } from './Services/RowServices';
5
5
  import { Dashboard } from './Services/DashboardServices';
6
6
  import { Header } from './Services/HeaderServices';
7
7
  import { Library } from './Services/ComponentLibraryServices';
8
8
  import { loadQueryEngineConfigCallback } from '../../shared-logic/src/Callbacks/types';
9
+ import { API } from './Services/APIServices';
9
10
  export declare class Vizzly {
10
- static queryEngineConfig: QueryEngineConfig | null;
11
+ static queryEngineConfig: QueryEngineConfig | undefined;
12
+ static queryEngineEndpoint: QueryEngineEndpoint | loadQueryEngineConfigCallback | 'in-browser' | undefined;
11
13
  static load(configUrl: QueryEngineEndpoint | loadQueryEngineConfigCallback | 'in-browser'): Promise<QueryEngineConfig | null>;
12
14
  static get Dashboard(): typeof Dashboard;
13
15
  static get Library(): typeof Library;
14
16
  static get Cell(): typeof Cell;
15
17
  static get Row(): typeof Row;
16
18
  static get Header(): typeof Header;
17
- static AreaChart: typeof ComponentServices.AreaChartClass;
18
- static LineChart: typeof ComponentServices.LineChartClass;
19
- static BarChart: typeof ComponentServices.BarChartClass;
20
- static PieChart: typeof ComponentServices.PieChartClass;
21
- static ScatterChart: typeof ComponentServices.ScatterChartClass;
22
- static ComboChart: typeof ComponentServices.ComboChartClass;
23
- static PivotTable: typeof ComponentServices.PivotTableClass;
24
- static BasicTable: typeof ComponentServices.BasicTableClass;
25
- static HorizontalBarChart: typeof ComponentServices.HorizontalBarChartClass;
26
- static MercatorMap: typeof ComponentServices.MercatorMapClass;
27
- static SingleStat: typeof ComponentServices.SingleStatClass;
19
+ static get API(): typeof API;
20
+ static AreaChart: typeof ViewServices.AreaChart;
21
+ static LineChart: typeof ViewServices.LineChart;
22
+ static BarChart: typeof ViewServices.BarChart;
23
+ static PieChart: typeof ViewServices.PieChart;
24
+ static ScatterChart: typeof ViewServices.ScatterChart;
25
+ static ComboChart: typeof ViewServices.ComboChart;
26
+ static PivotTable: typeof ViewServices.PivotTable;
27
+ static BasicTable: typeof ViewServices.BasicTable;
28
+ static HorizontalBarChart: typeof ViewServices.HorizontalBarChart;
29
+ static MercatorMap: typeof ViewServices.MercatorMap;
30
+ static SingleStat: typeof ViewServices.SingleStat;
31
+ static Progress: typeof ViewServices.Progress;
28
32
  }
@@ -0,0 +1,12 @@
1
+ type MessageHistory = Array<{
2
+ content: string;
3
+ sender_type: 'user' | 'ai';
4
+ status: 'active';
5
+ }>;
6
+ export type ConversationState = {
7
+ message: string;
8
+ conversationId: string | undefined;
9
+ messageState: 'waitingForMessage' | 'thinking';
10
+ messageHistory: MessageHistory;
11
+ };
12
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare enum ApiResourcePrefix {
2
+ ConfigStore = "cnf_",
3
+ Project = "prj_",
4
+ KeyPair = "kyp_",
5
+ Dashboard = "dsh_",
6
+ ProjectApiKey = "vizzly_project_api_key_"
7
+ }
@@ -1,3 +1,3 @@
1
- import Joi from 'joi';
1
+ import Joi from '@vizzly/joi';
2
2
  import { ComponentInterfaceConfig } from '../ComponentInterface/types';
3
3
  export declare const attributesSchema: (config: ComponentInterfaceConfig) => Joi.ObjectSchema<any>;
@@ -1,3 +1,3 @@
1
- import Joi from 'joi';
1
+ import Joi from '@vizzly/joi';
2
2
  import { ComponentInterfaceConfig } from '../ComponentInterface/types';
3
3
  export declare const attributesSchema: (config: ComponentInterfaceConfig) => Joi.ObjectSchema<any>;
@@ -0,0 +1,3 @@
1
+ export declare const encode: (str: string) => string;
2
+ export declare const decode: (str: string) => string;
3
+ export declare const isBase64: (str: string) => boolean;
@@ -1,3 +1,3 @@
1
- import Joi from 'joi';
1
+ import Joi from '@vizzly/joi';
2
2
  import { ComponentInterfaceConfig } from '../ComponentInterface/types';
3
3
  export declare const attributesSchema: (config: ComponentInterfaceConfig) => Joi.ObjectSchema<any>;
@@ -1,3 +1,3 @@
1
- import Joi from 'joi';
1
+ import Joi from '@vizzly/joi';
2
2
  import { ComponentInterfaceConfig } from '../ComponentInterface/types';
3
3
  export declare const attributesSchema: (config: ComponentInterfaceConfig) => Joi.ObjectSchema<any>;
@@ -1,8 +1,6 @@
1
1
  import { ComponentType, Component } from './types';
2
2
  import { EmptyCell, HeaderComponent } from '../Display/types';
3
- export declare const TIME_SERIES_CHARTS: ('areaChart' | 'lineChart' | 'horizontalBarChart' | 'barChart')[];
4
- export declare const ALL_COMPONENT_TYPES: ComponentType[];
5
- export declare const ALL_VIZZLY_COMPONENT_TYPES: ComponentType[];
3
+ export * from './constants';
6
4
  export declare const initialCustomComponent: (componentId: string, dataSetId: string) => Component<Component.CustomComponentAttributes>;
7
5
  export declare const initial: <T extends Component.Attributes>(attributes: T) => Component<T>;
8
6
  export declare const initialFromType: (type: ComponentType, dataSetId: string, viewId: string) => Component;
@@ -1,3 +1,3 @@
1
- import Joi from 'joi';
1
+ import Joi from '@vizzly/joi';
2
2
  import { ComponentInterfaceConfig } from '../ComponentInterface/types';
3
- export declare const attributesSchema: (config: ComponentInterfaceConfig) => Joi.AlternativesSchema<any>;
3
+ export declare const attributesSchema: (config: ComponentInterfaceConfig) => Joi.AlternativesSchema<unknown>;
@@ -0,0 +1,4 @@
1
+ import { ComponentType } from './types';
2
+ export declare const TIME_SERIES_CHARTS: ('areaChart' | 'lineChart' | 'horizontalBarChart' | 'barChart')[];
3
+ export declare const ALL_COMPONENT_TYPES: ComponentType[];
4
+ export declare const ALL_VIZZLY_COMPONENT_TYPES: ComponentType[];
@@ -1,4 +1,4 @@
1
- import Joi from 'joi';
1
+ import Joi from '@vizzly/joi';
2
2
  import { QueryAttributes } from '../QueryAttributes/types';
3
3
  import { Component } from './types';
4
4
  export declare const removeUnusedOrderFieldsFromTimeSeriesComponent: <T extends {
@@ -1,4 +1,4 @@
1
- import Joi from 'joi';
1
+ import Joi from '@vizzly/joi';
2
2
  import { SupportedAggregates } from '../Aggregate';
3
3
  import { QueryEngineConfig } from '../QueryEngineConfig/types';
4
4
  import { SupportedTimeTruncFunctions } from '../TimeDimension/types';
@@ -17,11 +17,11 @@ export declare const baseAttributesSchema: {
17
17
  dataSetId: Joi.StringSchema<string>;
18
18
  protectedByOrganisation: Joi.BooleanSchema<boolean>;
19
19
  };
20
- export declare const approxAxisLabelCountSchema: Joi.Schema<any>;
20
+ export declare const approxAxisLabelCountSchema: Joi.AnySchema<any>;
21
21
  export declare const timeDimensionQuerySchema: (queryEngineConfig: QueryEngineConfig) => {
22
22
  measure: Joi.ArraySchema<any[]>;
23
23
  dimension: Joi.ArraySchema<any[]>;
24
- drilldown: Joi.AlternativesSchema<any>;
24
+ drilldown: Joi.AlternativesSchema<string | any[]>;
25
25
  order: Joi.ArraySchema<any[]>;
26
26
  timeDimension: Joi.AlternativesSchema<any>;
27
27
  limit: Joi.NumberSchema<number>;
@@ -33,14 +33,15 @@ export declare const timeDimensionQuerySchema: (queryEngineConfig: QueryEngineCo
33
33
  yAxisPostfix: Joi.StringSchema<string>;
34
34
  yAxisFormat: Joi.AlternativesSchema<any>;
35
35
  xAxisFormat: Joi.AlternativesSchema<any>;
36
- approxYAxisLabelCount: Joi.Schema<any>;
37
- approxXAxisLabelCount: Joi.Schema<any>;
36
+ approxYAxisLabelCount: Joi.AnySchema<any>;
37
+ approxXAxisLabelCount: Joi.AnySchema<any>;
38
38
  };
39
39
  export declare const lineCurveSchema: Joi.StringSchema<string>;
40
- export declare const protectedFieldsMeasure: () => Joi.ArraySchema<any[]>;
41
- export declare const protectedFieldsDimension: () => Joi.ArraySchema<any[]>;
40
+ export declare const protectedFieldsMeasure: (queryEngineConfig: QueryEngineConfig) => Joi.ArraySchema<any[]>;
41
+ export declare const protectedFieldsDimension: (queryEngineConfig: QueryEngineConfig) => Joi.ArraySchema<any[]>;
42
42
  export declare const parametersSchema: (queryEngineConfig: QueryEngineConfig) => Joi.ObjectSchema<any>;
43
43
  export declare const goalLineSchema: () => Joi.ObjectSchema<any>;
44
44
  export declare const goalLinesSchema: () => Joi.ArraySchema<any[]>;
45
45
  export declare const axisTitleSchema: () => Joi.ObjectSchema<any>;
46
46
  export declare const sizingSchema: Joi.ObjectSchema<any>;
47
+ export declare const conditionalFormattingRulesSchema: (queryEngineConfig: QueryEngineConfig) => Joi.ArraySchema<any[]>;
@@ -9,7 +9,7 @@ import { TableFieldsV2 } from '../DataTable/types';
9
9
  export type getNumberFormatter = (formatterId: string | undefined | null) => (number: number) => string;
10
10
  export type FormatType = string | null;
11
11
  export type ApproxAxisLabelCount = 'auto' | number;
12
- export type ComponentType = 'barChart' | 'horizontalBarChart' | 'areaChart' | 'lineChart' | 'scatterChart' | 'pieChart' | 'singleStat' | 'dataTable' | 'basicTable' | 'comboChart' | 'mercatorMap' | 'custom';
12
+ export type ComponentType = 'barChart' | 'horizontalBarChart' | 'areaChart' | 'lineChart' | 'scatterChart' | 'pieChart' | 'singleStat' | 'dataTable' | 'basicTable' | 'comboChart' | 'mercatorMap' | 'custom' | 'progress';
13
13
  export declare namespace Component {
14
14
  export type LineCurve = 'natural' | 'straight' | 'step' | 'stepBefore' | 'stepAfter';
15
15
  export type RawComponent = Omit<Component, 'queries' | 'results' | 'span'> & {
@@ -218,6 +218,22 @@ export declare namespace Component {
218
218
  deltaTimeDimension: QueryAttributes.TimeDimension | null;
219
219
  parameters?: Parameters;
220
220
  };
221
+ export type ProgressAttributes = BaseAttributes & Omit<BaseQueryAttributes, 'dimension' | 'timeDimension' | 'order'> & {
222
+ type: 'progress';
223
+ conditionalFormattingRules: Array<ConditionalFormatting.Rule>;
224
+ parameters?: Parameters;
225
+ goals?: ProgressGoal[];
226
+ progressType?: ProgressTypes[];
227
+ prefixes: {
228
+ [fieldIdAndAggregate: string]: string;
229
+ };
230
+ postfixes: {
231
+ [fieldIdAndAggregate: string]: string;
232
+ };
233
+ formatter: {
234
+ [fieldIdAndAggregate: string]: string;
235
+ };
236
+ };
221
237
  export type ScatterChartAttributes = BaseAttributes & Omit<BaseQueryAttributes, 'measure'> & {
222
238
  type: 'scatterChart';
223
239
  xMeasure: QueryAttributes.Measure | null;
@@ -234,7 +250,7 @@ export declare namespace Component {
234
250
  goalLines?: Array<Component.GoalLine.Rule>;
235
251
  axisTitles?: AxisTitles;
236
252
  };
237
- export type Attributes = ScatterChartAttributes | LineChartAttributes | AreaChartAttributes | BarChartAttributes | PieChartAttributes | SingleStatAttributes | DataTableAttributes | BasicTableAttributes | ComboChartAttributes | HorizontalBarChartAttributes | MercatorMapAttributes | CustomComponentAttributes;
253
+ export type Attributes = ScatterChartAttributes | LineChartAttributes | AreaChartAttributes | BarChartAttributes | PieChartAttributes | SingleStatAttributes | DataTableAttributes | BasicTableAttributes | ComboChartAttributes | HorizontalBarChartAttributes | MercatorMapAttributes | CustomComponentAttributes | ProgressAttributes;
238
254
  type BaseOnViewClick = {
239
255
  viewId: string;
240
256
  };
@@ -315,3 +331,15 @@ export type Component<Attrs = Component.Attributes> = {
315
331
  colSpan: number;
316
332
  reports: Array<Report>;
317
333
  };
334
+ export declare enum ProgressType {
335
+ Linear = "linear",
336
+ Circular = "circular"
337
+ }
338
+ export type ProgressGoal = {
339
+ field: string;
340
+ value: number;
341
+ };
342
+ export type ProgressTypes = {
343
+ field: string;
344
+ value: ProgressType;
345
+ };
@@ -1,4 +1,4 @@
1
- import Joi from 'joi';
1
+ import Joi from '@vizzly/joi';
2
2
  import { Dumpable } from '../Dumpable';
3
3
  import { QueryEngineConfig } from '../QueryEngineConfig/types';
4
4
  import { DataSet } from '../DataSet/types';
@@ -12,6 +12,8 @@ export type ComponentInterfaceConfig = {
12
12
  };
13
13
  export interface ComponentInterface<Hydrated = any, Dumped = any> extends Dumpable<Hydrated, Dumped> {
14
14
  title: string;
15
+ description: string;
16
+ servicesClass: string;
15
17
  setDataAttributesFromPreAggregatedDataSet?: (attributes: Hydrated, dataSet: DataSet) => Hydrated;
16
18
  removeField: (hydrated: Hydrated, fieldId: string) => Hydrated;
17
19
  init: (dataSetId: string, overrides?: Partial<Hydrated>) => Hydrated;
@@ -0,0 +1,18 @@
1
+ import { DataSet } from '../../DataSet/types';
2
+ import * as Dashboard from 'shared-logic/src/Dashboard';
3
+ import { api } from '../../api';
4
+ import { IdentityConfig as IdentityConfigType } from 'shared-logic/src/IdentityConfig/types';
5
+ import { CreateDashboardParams } from '../../api/vizzly/createDashboard';
6
+ import { DashboardPermission as DashboardPermissionType, RawDashboardPermission } from 'shared-logic/src/DashboardPermission/types';
7
+ import { DashboardStorageStrategy } from '../types';
8
+ export declare function prepareCreateResponseForAdding(createdDashboardResponse: {
9
+ dashboard: Dashboard.RawDashboard;
10
+ permissions: RawDashboardPermission[];
11
+ }, dataSets: DataSet[]): {
12
+ createdDashboard: Dashboard.Dashboard;
13
+ formattedPermissions: DashboardPermissionType[];
14
+ };
15
+ export declare function postCreateDashboard(params: Omit<CreateDashboardParams, 'dashboardAccessToken'>, identityConfig: IdentityConfigType, dashboardStorageStrategy: DashboardStorageStrategy, vizzlyAPI: ReturnType<typeof api>): Promise<{
16
+ dashboard: Dashboard.RawDashboard;
17
+ permissions: RawDashboardPermission[];
18
+ }>;
@@ -0,0 +1,16 @@
1
+ import { DataSet } from '../../DataSet/types';
2
+ import { Dashboard as DashboardType } from 'shared-logic/src/Dashboard/types';
3
+ import * as Dashboard from 'shared-logic/src/Dashboard';
4
+ import { api } from '../../api';
5
+ import { UnEncryptedDashboardUpdateResponse, UpdateDashboardParams } from '../../api/vizzly/updateDashboard';
6
+ import { DashboardStorageStrategy } from '../types';
7
+ export declare function postUpdateDashboard(dashboardStorageStrategy: DashboardStorageStrategy, vizzlyAPI: ReturnType<typeof api>, updateParams: {
8
+ dashboardSessionToken: string;
9
+ definition?: Dashboard.SaveableDashboardDefinition;
10
+ meta?: any;
11
+ deleted?: boolean;
12
+ }): Promise<UnEncryptedDashboardUpdateResponse>;
13
+ export declare function updateDashboardFromUpdateResponse(updatedDashboardResponse: UnEncryptedDashboardUpdateResponse, dataSets: DataSet[], dashboards: DashboardType[], params: Omit<UpdateDashboardParams, 'dashboardSessionToken'>): {
14
+ newDashboards: DashboardType[];
15
+ updatedDashboard: DashboardType;
16
+ };
@@ -0,0 +1,17 @@
1
+ import { DataSet } from '../DataSet/types';
2
+ import { DashboardPermission as DashboardPermissionType } from 'shared-logic/src/DashboardPermission/types';
3
+ import { Dashboard as DashboardType } from 'shared-logic/src/Dashboard/types';
4
+ import { QueryEngineConfig, QueryEngineEndpoint } from '../QueryEngineConfig/types';
5
+ import { api } from '../api';
6
+ import { IdentityConfig as IdentityConfigType } from 'shared-logic/src/IdentityConfig/types';
7
+ import { DashboardStorageStrategy } from './types';
8
+ export * from './dashboardAPI/creating';
9
+ export * from './dashboardAPI/updating';
10
+ export declare function getDashboards<T extends {
11
+ found?: any[];
12
+ }>(dashboardsResponse: T, dataSets: DataSet[]): DashboardType[];
13
+ export declare function fetchDashboards(dashboardStorageStrategy: DashboardStorageStrategy, vizzlyAPI: ReturnType<typeof api>, dashboardAccessTokens: string[], abortController: AbortController): Promise<import("../api/vizzly/multiGetDashboards").Response>;
14
+ export declare const DEFAULT_STRATEGY: DashboardStorageStrategy;
15
+ export declare const getDashboardStorageStrategy: (queryEngineEndpoint: Function | QueryEngineEndpoint | undefined, queryEngineConfig: QueryEngineConfig | undefined) => DashboardStorageStrategy;
16
+ export declare const getDefaultParentDashboardId: (parentDashboardId: string | undefined, parentDashboardIdOnDashboardAccessToken: IdentityConfigType['dashboardAccess']['dashboardId'], dashboards: Array<DashboardType>) => string;
17
+ export declare function buildDashboardAccessTokens(permissions: DashboardPermissionType[]): string[];
@@ -0,0 +1,6 @@
1
+ import { Dashboard } from '../Dashboard/types';
2
+ import { VizzlyDashboard } from './types';
3
+ export declare function buildClientFacingDashboards(dashboards: Dashboard[]): VizzlyDashboard[];
4
+ export declare const getChildDashboards: (parentDashboardId: string, clientFacingDash: VizzlyDashboard[]) => VizzlyDashboard[];
5
+ export declare function getAllClientFacingChildDashboards(clientFacingDash: VizzlyDashboard[]): VizzlyDashboard[];
6
+ export declare function getParentDashboards(clientFacingDash: VizzlyDashboard[]): VizzlyDashboard[];
@@ -0,0 +1,7 @@
1
+ import { IdentityTokens } from '../Callbacks/types';
2
+ import { identityCallback as identityCallbackImported } from 'shared-logic/src/Callbacks/types';
3
+ export type identityCallback = identityCallbackImported;
4
+ export declare const fetchIdentityConfig: (identityCallback: identityCallbackImported) => Promise<{
5
+ identityConfig: import("../IdentityConfig/types").IdentityConfig;
6
+ tokens: IdentityTokens;
7
+ }>;
@@ -0,0 +1,12 @@
1
+ import Joi from '@vizzly/joi';
2
+ import { loadDataSetsCallback } from 'shared-logic/src/Callbacks/types';
3
+ import { IdentityConfig } from 'shared-logic/src/IdentityConfig/types';
4
+ import { QueryEngineEndpoint } from 'shared-logic/src/QueryEngineConfig/types';
5
+ import { DataSet } from '../DataSet/types';
6
+ export type DataSetsCallback = (identityConfig: IdentityConfig) => Promise<Array<DataSet> | null>;
7
+ export interface Property {
8
+ schema: Joi.Schema;
9
+ }
10
+ declare const dataSets: Property;
11
+ export default dataSets;
12
+ export declare const withReturnValidation: (dataSets?: DataSetsCallback, querEngineEndpoint?: QueryEngineEndpoint) => loadDataSetsCallback;
@@ -0,0 +1 @@
1
+ export declare const getDashboardAdminOverride: (url: string) => string | null;