UNPKG

6.91 kBPlain TextView Raw
1// (C) 2007-2019 GoodData Corporation
2import { VisualizationObject, AFM } from "@gooddata/typings";
3
4export type SortDirection = "asc" | "desc";
5
6export interface IAccountInfo {
7 login: string;
8 loginMD5: string;
9 firstName: string;
10 lastName: string;
11 organizationName: string;
12 profileUri: string;
13}
14
15export interface IIdentifierUriPair {
16 identifier: string;
17 uri: string;
18}
19
20export interface IElement {
21 element: {
22 uri: string;
23 title: string;
24 };
25}
26
27export 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
45export interface IGetObjectsByQueryOptions {
46 category?: string;
47 mode?: string;
48 author?: string;
49 limit?: number;
50 deprecated?: boolean;
51}
52
53export interface IGetObjectUsingOptions {
54 types?: string[];
55 nearest?: boolean;
56}
57
58export interface IEtlPullResponse {
59 pull2Task: {
60 links: {
61 poll: string;
62 };
63 };
64}
65
66export interface IBaseLoadOptions {
67 bucketItems?: VisualizationObject.IVisualizationObjectContent;
68 excludeObjectsWithTags?: string[];
69 includeObjectsWithTags?: string[];
70}
71
72export interface ILoadCatalogOptions extends IBaseLoadOptions {
73 filter?: string;
74 paging?: {
75 limit: number;
76 offset: number;
77 };
78 types?: string[];
79}
80
81export interface ILoadDateDataSetOptions extends IBaseLoadOptions {
82 dataSetIdentifier?: string;
83 includeAvailableDateAttributes?: boolean;
84 includeUnavailableDateDataSetsCount?: boolean;
85 returnAllDateDataSets?: boolean;
86 returnAllRelatedDateDataSets?: boolean;
87}
88
89export interface ISort {
90 column: string;
91 direction: string;
92}
93
94export interface IMetricDefinition {
95 expression: string;
96 format?: string;
97 identifier: string;
98 title?: string;
99 [key: string]: string | undefined;
100}
101
102export interface IDefinition {
103 metricDefinition: IMetricDefinition;
104}
105
106export interface IExecutionConfiguration {
107 definitions?: IDefinition[];
108 filters?: any[];
109 orderBy?: ISort[];
110 where?: {
111 [key: string]: any;
112 };
113}
114
115export interface IAttributeHeader {
116 id: string;
117 title: string;
118 type: "attrLabel";
119 uri: string;
120}
121
122export interface IMetricHeader {
123 format?: string;
124 id: string;
125 title: string;
126 type: "metric";
127 uri?: string;
128}
129
130export type Header = IAttributeHeader | IMetricHeader;
131
132export type WarningParameterType = boolean | number | string | null;
133
134export interface ISimpleExecutorWarning {
135 errorCode: string;
136 message: string;
137 parameters: WarningParameterType[];
138}
139
140export type MetricValue = string;
141
142export interface IAttributeValue {
143 id: string;
144 name: string;
145}
146
147export type ResultDataType = MetricValue | IAttributeValue;
148
149export interface ISimpleExecutorResult {
150 headers?: Header[];
151 isEmpty?: boolean;
152 isLoaded?: boolean;
153 rawData?: ResultDataType[][];
154 warnings?: ISimpleExecutorWarning[];
155}
156
157export type EmbeddedFilter = IEmbeddedDateFilter | IEmbeddedListAttributeFilter;
158
159export type EmbeddedDateFilterType = "relative" | "absolute";
160
161export 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
173export interface IEmbeddedListAttributeFilter {
174 listAttributeFilter: {
175 attribute: string;
176 displayForm: string;
177 default: {
178 attributeElements: string[];
179 negativeSelection: boolean;
180 };
181 };
182}
183
184export interface IMeasureSort {
185 direction: SortDirection;
186 sortByPoP?: boolean;
187}
188
189export type VisualizationStyleType = "common" | "table" | "line" | "column" | "bar";
190
191export 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
205export type MeasureType = "metric" | "fact" | "attribute";
206export type MeasureAggregation = "sum" | "count" | "avg" | "min" | "max" | "median" | "runsum";
207
208export 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
224export interface IColor {
225 r: number;
226 g: number;
227 b: number;
228}
229
230export type IColorPalette = IColorPaletteItem[];
231
232export interface IColorPaletteItem {
233 guid: string;
234 fill: IColor;
235}
236
237export interface ICreateProjectOptions {
238 summary?: string;
239 projectTemplate?: string;
240 driver?: string;
241 environment?: string;
242 guidedNavigation?: number;
243}
244
245export interface ITimezone {
246 id: string;
247 displayName: string;
248 currentOffsetMs: number;
249}
250
251export interface IXhrMockInBeforeSend {
252 setRequestHeader(key: string, value: string): void;
253}
254
255export 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
263export interface ISdkOptions {
264 domain?: string;
265}
266
267export interface IFeatureFlags {
268 [key: string]: number | boolean | string;
269}
270
271export interface IBaseExportConfig {
272 title?: string;
273 format?: "xlsx" | "csv" | "raw";
274 mergeHeaders?: boolean;
275}
276
277export interface IExportConfig extends IBaseExportConfig {
278 showFilters?: boolean;
279 afm?: AFM.IAfm;
280}
281
282export interface IExportResponse {
283 uri: string;
284}
285
286export type GuidType = "guid";
287export type RGBType = "rgb";
288
289export interface IGuidColorItem {
290 type: GuidType;
291 value: string;
292}
293
294export interface IRGBColorItem {
295 type: RGBType;
296 value: IColor;
297}
298
299export type IColorItem = IGuidColorItem | IRGBColorItem;
300
301export interface IColorMappingProperty {
302 id: string;
303 color: IColorItem;
304}
305
306export interface IPropertiesControls {
307 colorMapping?: IColorMappingProperty[];
308}
309
310export interface IProperties {
311 controls?: IPropertiesControls;
312 sortItems?: AFM.SortItem[];
313}
314
315export interface IStoredItemDescription {
316 uri: string;
317}
318
319export interface IAdHocItemDescription {
320 expression: string;
321}
322
323export type ItemDescription = IStoredItemDescription | IAdHocItemDescription;