UNPKG

8.2 kBTypeScriptView Raw
1import basem = require('./ClientApiBases');
2import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces');
3import DashboardInterfaces = require("./interfaces/DashboardInterfaces");
4import TfsCoreInterfaces = require("./interfaces/CoreInterfaces");
5export interface IDashboardApi extends basem.ClientApiBase {
6 createDashboard(dashboard: DashboardInterfaces.Dashboard, teamContext: TfsCoreInterfaces.TeamContext): Promise<DashboardInterfaces.Dashboard>;
7 deleteDashboard(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise<void>;
8 getDashboard(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise<DashboardInterfaces.Dashboard>;
9 getDashboardsByProject(teamContext: TfsCoreInterfaces.TeamContext): Promise<DashboardInterfaces.Dashboard[]>;
10 replaceDashboard(dashboard: DashboardInterfaces.Dashboard, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise<DashboardInterfaces.Dashboard>;
11 replaceDashboards(group: DashboardInterfaces.DashboardGroup, teamContext: TfsCoreInterfaces.TeamContext): Promise<DashboardInterfaces.DashboardGroup>;
12 createWidget(widget: DashboardInterfaces.Widget, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise<DashboardInterfaces.Widget>;
13 deleteWidget(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise<DashboardInterfaces.Dashboard>;
14 getWidget(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise<DashboardInterfaces.Widget>;
15 replaceWidget(widget: DashboardInterfaces.Widget, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise<DashboardInterfaces.Widget>;
16 updateWidget(widget: DashboardInterfaces.Widget, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise<DashboardInterfaces.Widget>;
17 getWidgetMetadata(contributionId: string, project?: string): Promise<DashboardInterfaces.WidgetMetadataResponse>;
18 getWidgetTypes(scope: DashboardInterfaces.WidgetScope, project?: string): Promise<DashboardInterfaces.WidgetTypesResponse>;
19}
20export declare class DashboardApi extends basem.ClientApiBase implements IDashboardApi {
21 constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], options?: VsoBaseInterfaces.IRequestOptions);
22 static readonly RESOURCE_AREA_ID = "31c84e0a-3ece-48fd-a29d-100849af99ba";
23 /**
24 * Create the supplied dashboard.
25 *
26 * @param {DashboardInterfaces.Dashboard} dashboard - The initial state of the dashboard
27 * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation
28 */
29 createDashboard(dashboard: DashboardInterfaces.Dashboard, teamContext: TfsCoreInterfaces.TeamContext): Promise<DashboardInterfaces.Dashboard>;
30 /**
31 * Delete a dashboard given its ID. This also deletes the widgets associated with this dashboard.
32 *
33 * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation
34 * @param {string} dashboardId - ID of the dashboard to delete.
35 */
36 deleteDashboard(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise<void>;
37 /**
38 * Get a dashboard by its ID.
39 *
40 * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation
41 * @param {string} dashboardId
42 */
43 getDashboard(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise<DashboardInterfaces.Dashboard>;
44 /**
45 * Get a list of dashboards under a project.
46 *
47 * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation
48 */
49 getDashboardsByProject(teamContext: TfsCoreInterfaces.TeamContext): Promise<DashboardInterfaces.Dashboard[]>;
50 /**
51 * Replace configuration for the specified dashboard. Replaces Widget list on Dashboard, only if property is supplied.
52 *
53 * @param {DashboardInterfaces.Dashboard} dashboard - The Configuration of the dashboard to replace.
54 * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation
55 * @param {string} dashboardId - ID of the dashboard to replace.
56 */
57 replaceDashboard(dashboard: DashboardInterfaces.Dashboard, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise<DashboardInterfaces.Dashboard>;
58 /**
59 * Update the name and position of dashboards in the supplied group, and remove omitted dashboards. Does not modify dashboard content.
60 *
61 * @param {DashboardInterfaces.DashboardGroup} group
62 * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation
63 */
64 replaceDashboards(group: DashboardInterfaces.DashboardGroup, teamContext: TfsCoreInterfaces.TeamContext): Promise<DashboardInterfaces.DashboardGroup>;
65 /**
66 * Create a widget on the specified dashboard.
67 *
68 * @param {DashboardInterfaces.Widget} widget - State of the widget to add
69 * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation
70 * @param {string} dashboardId - ID of dashboard the widget will be added to.
71 */
72 createWidget(widget: DashboardInterfaces.Widget, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise<DashboardInterfaces.Widget>;
73 /**
74 * Delete the specified widget.
75 *
76 * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation
77 * @param {string} dashboardId - ID of the dashboard containing the widget.
78 * @param {string} widgetId - ID of the widget to update.
79 */
80 deleteWidget(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise<DashboardInterfaces.Dashboard>;
81 /**
82 * Get the current state of the specified widget.
83 *
84 * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation
85 * @param {string} dashboardId - ID of the dashboard containing the widget.
86 * @param {string} widgetId - ID of the widget to read.
87 */
88 getWidget(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise<DashboardInterfaces.Widget>;
89 /**
90 * Override the state of the specified widget.
91 *
92 * @param {DashboardInterfaces.Widget} widget - State to be written for the widget.
93 * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation
94 * @param {string} dashboardId - ID of the dashboard containing the widget.
95 * @param {string} widgetId - ID of the widget to update.
96 */
97 replaceWidget(widget: DashboardInterfaces.Widget, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise<DashboardInterfaces.Widget>;
98 /**
99 * Perform a partial update of the specified widget.
100 *
101 * @param {DashboardInterfaces.Widget} widget - Description of the widget changes to apply. All non-null fields will be replaced.
102 * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation
103 * @param {string} dashboardId - ID of the dashboard containing the widget.
104 * @param {string} widgetId - ID of the widget to update.
105 */
106 updateWidget(widget: DashboardInterfaces.Widget, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise<DashboardInterfaces.Widget>;
107 /**
108 * Get the widget metadata satisfying the specified contribution ID.
109 *
110 * @param {string} contributionId - The ID of Contribution for the Widget
111 * @param {string} project - Project ID or project name
112 */
113 getWidgetMetadata(contributionId: string, project?: string): Promise<DashboardInterfaces.WidgetMetadataResponse>;
114 /**
115 * Get all available widget metadata in alphabetical order, including widgets marked with isVisibleFromCatalog == false.
116 *
117 * @param {DashboardInterfaces.WidgetScope} scope
118 * @param {string} project - Project ID or project name
119 */
120 getWidgetTypes(scope: DashboardInterfaces.WidgetScope, project?: string): Promise<DashboardInterfaces.WidgetTypesResponse>;
121}