1 |
|
2 | import { VisualizationObject, AFM } from "@gooddata/typings";
|
3 |
|
4 | export type SortDirection = "asc" | "desc";
|
5 |
|
6 | export interface IAccountInfo {
|
7 | login: string;
|
8 | loginMD5: string;
|
9 | firstName: string;
|
10 | lastName: string;
|
11 | organizationName: string;
|
12 | profileUri: string;
|
13 | }
|
14 |
|
15 | export interface IIdentifierUriPair {
|
16 | identifier: string;
|
17 | uri: string;
|
18 | }
|
19 |
|
20 | export interface IElement {
|
21 | element: {
|
22 | uri: string;
|
23 | title: string;
|
24 | };
|
25 | }
|
26 |
|
27 | export interface IValidElementsResponse {
|
28 | validElements: {
|
29 | items: IElement[];
|
30 | paging: {
|
31 | count: number;
|
32 | offset: string;
|
33 | total: string;
|
34 | };
|
35 | elementsMeta: {
|
36 | attribute: string;
|
37 | attributeDisplayForm: string;
|
38 | filter: string;
|
39 | order: SortDirection;
|
40 | };
|
41 | totalCountWithoutFilters?: string;
|
42 | };
|
43 | }
|
44 |
|
45 | export interface IGetObjectsByQueryOptions {
|
46 | category?: string;
|
47 | mode?: string;
|
48 | author?: string;
|
49 | limit?: number;
|
50 | deprecated?: boolean;
|
51 | }
|
52 |
|
53 | export interface IGetObjectUsingOptions {
|
54 | types?: string[];
|
55 | nearest?: boolean;
|
56 | }
|
57 |
|
58 | export interface IEtlPullResponse {
|
59 | pull2Task: {
|
60 | links: {
|
61 | poll: string;
|
62 | };
|
63 | };
|
64 | }
|
65 |
|
66 | export interface IBaseLoadOptions {
|
67 | bucketItems?: VisualizationObject.IVisualizationObjectContent;
|
68 | excludeObjectsWithTags?: string[];
|
69 | includeObjectsWithTags?: string[];
|
70 | }
|
71 |
|
72 | export interface ILoadCatalogOptions extends IBaseLoadOptions {
|
73 | filter?: string;
|
74 | paging?: {
|
75 | limit: number;
|
76 | offset: number;
|
77 | };
|
78 | types?: string[];
|
79 | }
|
80 |
|
81 | export interface ILoadDateDataSetOptions extends IBaseLoadOptions {
|
82 | dataSetIdentifier?: string;
|
83 | includeAvailableDateAttributes?: boolean;
|
84 | includeUnavailableDateDataSetsCount?: boolean;
|
85 | returnAllDateDataSets?: boolean;
|
86 | returnAllRelatedDateDataSets?: boolean;
|
87 | }
|
88 |
|
89 | export interface ISort {
|
90 | column: string;
|
91 | direction: string;
|
92 | }
|
93 |
|
94 | export interface IMetricDefinition {
|
95 | expression: string;
|
96 | format?: string;
|
97 | identifier: string;
|
98 | title?: string;
|
99 | [key: string]: string | undefined;
|
100 | }
|
101 |
|
102 | export interface IDefinition {
|
103 | metricDefinition: IMetricDefinition;
|
104 | }
|
105 |
|
106 | export interface IExecutionConfiguration {
|
107 | definitions?: IDefinition[];
|
108 | filters?: any[];
|
109 | orderBy?: ISort[];
|
110 | where?: {
|
111 | [key: string]: any;
|
112 | };
|
113 | }
|
114 |
|
115 | export interface IAttributeHeader {
|
116 | id: string;
|
117 | title: string;
|
118 | type: "attrLabel";
|
119 | uri: string;
|
120 | }
|
121 |
|
122 | export interface IMetricHeader {
|
123 | format?: string;
|
124 | id: string;
|
125 | title: string;
|
126 | type: "metric";
|
127 | uri?: string;
|
128 | }
|
129 |
|
130 | export type Header = IAttributeHeader | IMetricHeader;
|
131 |
|
132 | export type WarningParameterType = boolean | number | string | null;
|
133 |
|
134 | export interface ISimpleExecutorWarning {
|
135 | errorCode: string;
|
136 | message: string;
|
137 | parameters: WarningParameterType[];
|
138 | }
|
139 |
|
140 | export type MetricValue = string;
|
141 |
|
142 | export interface IAttributeValue {
|
143 | id: string;
|
144 | name: string;
|
145 | }
|
146 |
|
147 | export type ResultDataType = MetricValue | IAttributeValue;
|
148 |
|
149 | export interface ISimpleExecutorResult {
|
150 | headers?: Header[];
|
151 | isEmpty?: boolean;
|
152 | isLoaded?: boolean;
|
153 | rawData?: ResultDataType[][];
|
154 | warnings?: ISimpleExecutorWarning[];
|
155 | }
|
156 |
|
157 | export type EmbeddedFilter = IEmbeddedDateFilter | IEmbeddedListAttributeFilter;
|
158 |
|
159 | export type EmbeddedDateFilterType = "relative" | "absolute";
|
160 |
|
161 | export interface IEmbeddedDateFilter {
|
162 | dateFilter: {
|
163 | attribute?: string;
|
164 | dataset?: string;
|
165 | dimension?: string;
|
166 | from?: string | number;
|
167 | granularity: string;
|
168 | to?: string | number;
|
169 | type: EmbeddedDateFilterType;
|
170 | };
|
171 | }
|
172 |
|
173 | export interface IEmbeddedListAttributeFilter {
|
174 | listAttributeFilter: {
|
175 | attribute: string;
|
176 | displayForm: string;
|
177 | default: {
|
178 | attributeElements: string[];
|
179 | negativeSelection: boolean;
|
180 | };
|
181 | };
|
182 | }
|
183 |
|
184 | export interface IMeasureSort {
|
185 | direction: SortDirection;
|
186 | sortByPoP?: boolean;
|
187 | }
|
188 |
|
189 | export type VisualizationStyleType = "common" | "table" | "line" | "column" | "bar";
|
190 |
|
191 | export interface IVisualizationStyle {
|
192 | visualizationStyle: {
|
193 | type: VisualizationStyleType;
|
194 | colorPalette: {
|
195 | measure?: {
|
196 | color: string;
|
197 | periodOverPeriod: string;
|
198 | };
|
199 |
|
200 | stack?: any;
|
201 | };
|
202 | };
|
203 | }
|
204 |
|
205 | export type MeasureType = "metric" | "fact" | "attribute";
|
206 | export type MeasureAggregation = "sum" | "count" | "avg" | "min" | "max" | "median" | "runsum";
|
207 |
|
208 | export interface IMeasure {
|
209 | measure: {
|
210 | aggregation?: MeasureAggregation;
|
211 | format?: string;
|
212 | generatedId?: string;
|
213 | measureFilters: EmbeddedFilter[];
|
214 | objectUri: string;
|
215 | showInPercent: boolean;
|
216 | showPoP: boolean;
|
217 | sort?: IMeasureSort;
|
218 | styles?: IVisualizationStyle[];
|
219 | title: string;
|
220 | type: MeasureType;
|
221 | };
|
222 | }
|
223 |
|
224 | export interface IColor {
|
225 | r: number;
|
226 | g: number;
|
227 | b: number;
|
228 | }
|
229 |
|
230 | export type IColorPalette = IColorPaletteItem[];
|
231 |
|
232 | export interface IColorPaletteItem {
|
233 | guid: string;
|
234 | fill: IColor;
|
235 | }
|
236 |
|
237 | export interface ICreateProjectOptions {
|
238 | summary?: string;
|
239 | projectTemplate?: string;
|
240 | driver?: string;
|
241 | environment?: string;
|
242 | guidedNavigation?: number;
|
243 | }
|
244 |
|
245 | export interface ITimezone {
|
246 | id: string;
|
247 | displayName: string;
|
248 | currentOffsetMs: number;
|
249 | }
|
250 |
|
251 | export interface IXhrMockInBeforeSend {
|
252 | setRequestHeader(key: string, value: string): void;
|
253 | }
|
254 |
|
255 | export interface IXhrSettings {
|
256 | method?: "GET" | "POST" | "PUT" | "DELETE" | "HEAD";
|
257 | body?: any;
|
258 | beforeSend?(xhr: IXhrMockInBeforeSend, url: string): void;
|
259 |
|
260 | [key: string]: any;
|
261 | }
|
262 |
|
263 | export interface ISdkOptions {
|
264 | domain?: string;
|
265 | }
|
266 |
|
267 | export interface IFeatureFlags {
|
268 | [key: string]: number | boolean | string;
|
269 | }
|
270 |
|
271 | export interface IBaseExportConfig {
|
272 | title?: string;
|
273 | format?: "xlsx" | "csv" | "raw";
|
274 | mergeHeaders?: boolean;
|
275 | }
|
276 |
|
277 | export interface IExportConfig extends IBaseExportConfig {
|
278 | showFilters?: boolean;
|
279 | afm?: AFM.IAfm;
|
280 | }
|
281 |
|
282 | export interface IExportResponse {
|
283 | uri: string;
|
284 | }
|
285 |
|
286 | export type GuidType = "guid";
|
287 | export type RGBType = "rgb";
|
288 |
|
289 | export interface IGuidColorItem {
|
290 | type: GuidType;
|
291 | value: string;
|
292 | }
|
293 |
|
294 | export interface IRGBColorItem {
|
295 | type: RGBType;
|
296 | value: IColor;
|
297 | }
|
298 |
|
299 | export type IColorItem = IGuidColorItem | IRGBColorItem;
|
300 |
|
301 | export interface IColorMappingProperty {
|
302 | id: string;
|
303 | color: IColorItem;
|
304 | }
|
305 |
|
306 | export interface IPropertiesControls {
|
307 | colorMapping?: IColorMappingProperty[];
|
308 | }
|
309 |
|
310 | export interface IProperties {
|
311 | controls?: IPropertiesControls;
|
312 | sortItems?: AFM.SortItem[];
|
313 | }
|
314 |
|
315 | export interface IStoredItemDescription {
|
316 | uri: string;
|
317 | }
|
318 |
|
319 | export interface IAdHocItemDescription {
|
320 | expression: string;
|
321 | }
|
322 |
|
323 | export type ItemDescription = IStoredItemDescription | IAdHocItemDescription;
|