1 | import { ITimezone, IColor, IColorPalette, IFeatureFlags } from "./interfaces";
|
2 | import { XhrModule, ApiResponse } from "./xhr";
|
3 | export interface IProjectConfigSettingItem {
|
4 | settingItem: {
|
5 | key: string;
|
6 | links: {
|
7 | self: string;
|
8 | };
|
9 | source: string;
|
10 | value: string;
|
11 | };
|
12 | }
|
13 | export interface IProjectConfigResponse {
|
14 | settings: {
|
15 | items: IProjectConfigSettingItem[];
|
16 | };
|
17 | }
|
18 | export declare const parseSettingItemValue: (value: string) => string | number | boolean;
|
19 | /**
|
20 | * Functions for working with projects
|
21 | *
|
22 | * @class project
|
23 | * @module project
|
24 | */
|
25 | export declare class ProjectModule {
|
26 | private xhr;
|
27 | constructor(xhr: XhrModule);
|
28 | /**
|
29 | * Get current project id
|
30 | *
|
31 | * @method getCurrentProjectId
|
32 | * @return {String} current project identifier
|
33 | */
|
34 | getCurrentProjectId(): Promise<string | null>;
|
35 | /**
|
36 | * Return current project id in bootstrap
|
37 | * @method getCurrentProjectIdInBootstrap
|
38 | * @param bootstrapData - data was got from bootstrap resource
|
39 | */
|
40 | getCurrentProjectIdInBootstrap(bootstrapData: any): string | null;
|
41 | /**
|
42 | * Fetches projects available for the user represented by the given profileId
|
43 | *
|
44 | * @method getProjects
|
45 | * @param {String} profileId - User profile identifier
|
46 | * @return {Array} An Array of projects
|
47 | */
|
48 | getProjects(profileId: string): Promise<any>;
|
49 | /**
|
50 | * Fetches all datasets for the given project
|
51 | *
|
52 | * @method getDatasets
|
53 | * @param {String} projectId - GD project identifier
|
54 | * @return {Array} An array of objects containing datasets metadata
|
55 | */
|
56 | getDatasets(projectId: string): Promise<any>;
|
57 | /**
|
58 | * Fetches a chart color palette for a project represented by the given
|
59 | * projectId parameter.
|
60 | *
|
61 | * @method getColorPalette
|
62 | * @param {String} projectId - A project identifier
|
63 | * @return {Array} An array of objects with r, g, b fields representing a project's
|
64 | * color palette
|
65 | */
|
66 | getColorPalette(projectId: string): Promise<any>;
|
67 | /**
|
68 | * Fetches a chart color palette for a project represented by the given
|
69 | * projectId parameter.
|
70 | *
|
71 | * @method getColorPaletteWithGuids
|
72 | * @param {String} projectId - A project identifier
|
73 | * @return {Array} An array of objects representing a project's
|
74 | * color palette with color guid or undefined
|
75 | */
|
76 | getColorPaletteWithGuids(projectId: string): Promise<IColorPalette | undefined>;
|
77 | /**
|
78 | * Sets given colors as a color palette for a given project.
|
79 | *
|
80 | * @method setColorPalette
|
81 | * @param {String} projectId - GD project identifier
|
82 | * @param {Array} colors - An array of colors that we want to use within the project.
|
83 | * Each color should be an object with r, g, b fields. // TODO really object?
|
84 | */
|
85 | setColorPalette(projectId: string, colors: IColor[]): Promise<ApiResponse>;
|
86 | /**
|
87 | * Gets current timezone and its offset. Example output:
|
88 | *
|
89 | * {
|
90 | * id: 'Europe/Prague',
|
91 | * displayName: 'Central European Time',
|
92 | * currentOffsetMs: 3600000
|
93 | * }
|
94 | *
|
95 | * @method getTimezone
|
96 | * @param {String} projectId - GD project identifier
|
97 | */
|
98 | getTimezone(projectId: string): Promise<ITimezone>;
|
99 | setTimezone(projectId: string, timezone: ITimezone): Promise<any>;
|
100 | /**
|
101 | * Create project
|
102 | * Note: returns a promise which is resolved when the project creation is finished
|
103 | *
|
104 | * @experimental
|
105 | * @method createProject
|
106 | * @param {String} title
|
107 | * @param {String} authorizationToken
|
108 | * @param {Object} options for project creation (summary, projectTemplate, ...)
|
109 | * @return {Object} created project object
|
110 | */
|
111 | createProject(title: string, authorizationToken: string, options?: any): Promise<any>;
|
112 | /**
|
113 | * Delete project
|
114 | *
|
115 | * @method deleteProject
|
116 | * @param {String} projectId
|
117 | */
|
118 | deleteProject(projectId: string): Promise<ApiResponse>;
|
119 | /**
|
120 | * Gets aggregated feature flags for given project and current user
|
121 | *
|
122 | * @method getFeatureFlags
|
123 | * @param {String} projectId - A project identifier
|
124 | * @return {IFeatureFlags} Hash table of feature flags and theirs values where feature flag is as key
|
125 | */
|
126 | getFeatureFlags(projectId: string): Promise<IFeatureFlags>;
|
127 | /**
|
128 | * Gets project config including project specific feature flags
|
129 | *
|
130 | * @param {String} projectId - A project identifier
|
131 | * @return {IProjectConfigSettingItem[]} An array of project config setting items
|
132 | */
|
133 | getConfig(projectId: string): Promise<IProjectConfigSettingItem[]>;
|
134 | /**
|
135 | * Gets project specific feature flags
|
136 | *
|
137 | * @param {String} projectId - A project identifier
|
138 | * @param {String} source - optional filter settingItems with specific source
|
139 | * @return {IFeatureFlags} Hash table of feature flags and theirs values where feature flag is as key
|
140 | */
|
141 | getProjectFeatureFlags(projectId: string, source?: string): Promise<IFeatureFlags>;
|
142 | }
|