@vizzly/api-client 0.0.9 → 0.0.11
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.
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Vizzly } from './Vizzly';
|
|
2
|
-
import { CreateDashboardParams, DashboardDefinition, Dashboard as DashboardType, GlobalLibrary, UpdateDashboardParams } from '../types';
|
|
2
|
+
import { CreateDashboardParams, Dashboard, DashboardDefinition, Dashboard as DashboardType, GlobalLibrary, UpdateDashboardParams } from '../types';
|
|
3
3
|
export declare class DashboardManager {
|
|
4
4
|
private vizzly;
|
|
5
5
|
constructor(vizzly: Vizzly);
|
|
6
6
|
create(params: CreateDashboardParams): Promise<{
|
|
7
|
-
dashboard:
|
|
7
|
+
dashboard: Dashboard;
|
|
8
8
|
permissions: import("../types").DashboardPermission[];
|
|
9
9
|
}>;
|
|
10
10
|
update(params: Omit<UpdateDashboardParams, 'dashboardPermission' | 'definition'> & {
|
|
11
11
|
dashboardId: string;
|
|
12
12
|
definition?: DashboardDefinition;
|
|
13
|
-
}): Promise<
|
|
13
|
+
}): Promise<Dashboard>;
|
|
14
14
|
getDashboards(): Promise<DashboardType[]>;
|
|
15
15
|
static mergeDashboardsAndGlobalLibraries(dashboards: DashboardType[], globalLibraries: GlobalLibrary[]): DashboardType[];
|
|
16
16
|
static mergeCustomFields(dashboard: DashboardType, dashboards: DashboardType[], parentGlobalLibrariesForDashboard: GlobalLibrary[], childGlobalLibrariesForDashboard: GlobalLibrary[]): DashboardType['definition']['customFields'];
|
|
@@ -40,7 +40,7 @@ class DashboardManager {
|
|
|
40
40
|
if (!updateDashboardToken)
|
|
41
41
|
throw new Error(`Failed to find update token for dashboard.`);
|
|
42
42
|
// Send the update request.
|
|
43
|
-
yield dashboardRepository.updateDashboard(Object.assign(Object.assign({}, params), { dashboardPermission: updateDashboardToken }));
|
|
43
|
+
const updatedDashboard = yield dashboardRepository.updateDashboard(Object.assign(Object.assign({}, params), { dashboardPermission: updateDashboardToken }));
|
|
44
44
|
// Build the views to store in the libraries
|
|
45
45
|
let libraryViewsToSave = [];
|
|
46
46
|
if ((_a = params.definition) === null || _a === void 0 ? void 0 : _a.componentLibrary) {
|
|
@@ -90,6 +90,7 @@ class DashboardManager {
|
|
|
90
90
|
}
|
|
91
91
|
}));
|
|
92
92
|
yield Promise.all(updatePromises);
|
|
93
|
+
return updatedDashboard;
|
|
93
94
|
});
|
|
94
95
|
}
|
|
95
96
|
getDashboards() {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Api } from './Api';
|
|
2
2
|
import { Authentication } from './Authentication';
|
|
3
|
-
import { CreateDashboardParams, CreateGlobalLibraryParams, GlobalLibrary, GlobalLibraryPermission, Request, UpdateDashboardParams, UpdateGlobalLibraryParams } from '../types';
|
|
3
|
+
import { CreateDashboardParams, CreateGlobalLibraryParams, GlobalLibrary, GlobalLibraryPermission, Request, UpdateDashboardParams, UpdateDashboardResponseBody, UpdateGlobalLibraryParams } from '../types';
|
|
4
4
|
import { nVizzlyApi } from '../types';
|
|
5
5
|
export declare class VizzlyApi extends Api {
|
|
6
6
|
constructor(auth: Authentication, host?: string);
|
|
@@ -70,7 +70,7 @@ export declare class VizzlyApi extends Api {
|
|
|
70
70
|
buildSaveEncryptedProjectEncryptionSecretRequest(params: nVizzlyApi.SaveEncryptedProjectEncryptionSecretParams): Request<{}>;
|
|
71
71
|
saveScheduledReport(params: nVizzlyApi.SaveScheduledReportParams): Promise<import("../types").Response<unknown>>;
|
|
72
72
|
buildSaveScheduledReportRequest(params: nVizzlyApi.SaveScheduledReportParams): Request<{}>;
|
|
73
|
-
updateDashboard(params: UpdateDashboardParams): Promise<import("../types").Response<
|
|
73
|
+
updateDashboard(params: UpdateDashboardParams): Promise<import("../types").Response<UpdateDashboardResponseBody>>;
|
|
74
74
|
buildUpdateDashboardRequest(params: UpdateDashboardParams): Request<{}>;
|
|
75
75
|
updateParentGlobalLibrary(params: nVizzlyApi.UpdateParentGlobalLibraryParams): Promise<import("../types").Response<unknown>>;
|
|
76
76
|
buildUpdateParentGlobalLibraryRequest(params: nVizzlyApi.UpdateParentGlobalLibraryParams): Request<{}>;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { VizzlyQueryEngineApi } from './models/VizzlyQueryEngineApi';
|
|
2
2
|
import { VizzlyApi } from './models/VizzlyApi';
|
|
3
3
|
import { VizzlyAppApi } from './models/VizzlyAppApi';
|
|
4
|
-
import { DashboardDefinition } from './types/dashboard';
|
|
4
|
+
import { DashboardDefinition, DashboardFromAPI } from './types/dashboard';
|
|
5
5
|
export * from './types/dashboard';
|
|
6
6
|
export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
7
|
+
export type UpdateDashboardResponseBody = {
|
|
8
|
+
dashboard: DashboardFromAPI;
|
|
9
|
+
};
|
|
7
10
|
export type Response<T> = {
|
|
8
11
|
status: number;
|
|
9
12
|
headers: Headers;
|