@gooddata/typings
Advanced tools
Comparing version 0.0.1-vaclavbohac-init-2017-11-03T09-46-45-561Z to 0.0.1-vaclavbohac-pzb-header-items-2017-11-09T16-09-36-030Z
@@ -98,3 +98,2 @@ export declare namespace AFM { | ||
interface IDimension { | ||
name: string; | ||
itemIdentifiers: Identifier[]; | ||
@@ -133,2 +132,3 @@ totals?: ITotalItem[]; | ||
function isMeasureSortItem(sortItem: AFM.SortItem): sortItem is AFM.IMeasureSortItem; | ||
function isMeasureLocatorItem(locator: AFM.LocatorItem): locator is AFM.IMeasureLocatorItem; | ||
} | ||
@@ -145,2 +145,7 @@ export declare namespace Execution { | ||
} | ||
interface ITotalHeaderItem { | ||
totalHeaderItem: { | ||
name: string; | ||
}; | ||
} | ||
interface IMeasureGroupHeader { | ||
@@ -152,8 +157,13 @@ measureGroupHeader: { | ||
} | ||
interface ITotalHeaderItem { | ||
totalHeaderItem: { | ||
interface IAttributeHeader { | ||
attributeHeader: { | ||
uri: string; | ||
identifier: string; | ||
localIdentifier: string; | ||
name: string; | ||
totalItems?: ITotalHeaderItem[]; | ||
}; | ||
} | ||
interface IAttributeHeaderItem { | ||
type IHeader = IMeasureGroupHeader | IAttributeHeader; | ||
interface IResultAttributeHeaderItem { | ||
attributeHeaderItem: { | ||
@@ -164,15 +174,17 @@ uri: string; | ||
} | ||
interface IAttributeHeader { | ||
attributeHeader: { | ||
uri: string; | ||
identifier: string; | ||
localIdentifier: string; | ||
interface IResultMeasureHeaderItem { | ||
measureHeaderItem: { | ||
name: string; | ||
totalItems?: ITotalHeaderItem[]; | ||
order: number; | ||
}; | ||
} | ||
type Header = IMeasureGroupHeader | IAttributeHeader; | ||
interface IResultTotalHeaderItem { | ||
totalHeaderItem: { | ||
name: string; | ||
type: string; | ||
}; | ||
} | ||
type IResultHeaderItem = IResultAttributeHeaderItem | IResultMeasureHeaderItem | IResultTotalHeaderItem; | ||
interface IResultDimension { | ||
name: string; | ||
headers: Header[]; | ||
headers: IHeader[]; | ||
} | ||
@@ -190,3 +202,3 @@ interface IExecutionResponse { | ||
executionResult: { | ||
attributeHeaderItems?: IAttributeHeaderItem[][][]; | ||
headerItems?: IResultHeaderItem[][][]; | ||
data: DataValue[][] | DataValue[]; | ||
@@ -201,11 +213,16 @@ totals?: DataValue[][][]; | ||
} | ||
interface IError { | ||
code: number; | ||
message?: string; | ||
interface IError extends Error { | ||
response: { | ||
status: number; | ||
}; | ||
} | ||
/** | ||
* Combination of both AFM executions responses | ||
* | ||
* `null` value as executionResult means empty response (HTTP 204) | ||
*/ | ||
interface IExecutionResponses { | ||
executionResponse: IExecutionResponse; | ||
executionResult: IExecutionResult; | ||
executionResult: IExecutionResult | null; | ||
} | ||
type AfmExecutionResponse = IExecutionResponses | IError; | ||
} |
@@ -21,3 +21,7 @@ "use strict"; | ||
AFM.isMeasureSortItem = isMeasureSortItem; | ||
function isMeasureLocatorItem(locator) { | ||
return !!locator.measureLocatorItem; | ||
} | ||
AFM.isMeasureLocatorItem = isMeasureLocatorItem; | ||
})(AFM = exports.AFM || (exports.AFM = {})); | ||
//# sourceMappingURL=index.js.map |
64
index.ts
@@ -122,3 +122,2 @@ export namespace AFM { | ||
export interface IDimension { | ||
name: string; | ||
itemIdentifiers: Identifier[]; | ||
@@ -177,2 +176,6 @@ totals?: ITotalItem[]; | ||
} | ||
export function isMeasureLocatorItem(locator: AFM.LocatorItem): locator is AFM.IMeasureLocatorItem { | ||
return !!(locator as AFM.IMeasureLocatorItem).measureLocatorItem; | ||
} | ||
} | ||
@@ -191,2 +194,8 @@ | ||
export interface ITotalHeaderItem { | ||
totalHeaderItem: { | ||
name: string; | ||
} | ||
} | ||
export interface IMeasureGroupHeader { | ||
@@ -199,9 +208,15 @@ measureGroupHeader: { | ||
export interface ITotalHeaderItem { | ||
totalHeaderItem: { | ||
export interface IAttributeHeader { | ||
attributeHeader: { | ||
uri: string; | ||
identifier: string; | ||
localIdentifier: string; | ||
name: string; | ||
totalItems?: ITotalHeaderItem[]; | ||
} | ||
} | ||
export interface IAttributeHeaderItem { | ||
export type IHeader = IMeasureGroupHeader | IAttributeHeader; | ||
export interface IResultAttributeHeaderItem { | ||
attributeHeaderItem: { | ||
@@ -213,17 +228,20 @@ uri: string; | ||
export interface IAttributeHeader { | ||
attributeHeader: { | ||
uri: string; | ||
identifier: string; | ||
localIdentifier: string; | ||
name: string; | ||
totalItems?: ITotalHeaderItem[]; | ||
export interface IResultMeasureHeaderItem { | ||
measureHeaderItem: { | ||
name: string, | ||
order: number | ||
} | ||
} | ||
export type Header = IMeasureGroupHeader | IAttributeHeader; | ||
export interface IResultTotalHeaderItem { | ||
totalHeaderItem: { | ||
name: string, | ||
type: string | ||
} | ||
} | ||
export type IResultHeaderItem = IResultAttributeHeaderItem | IResultMeasureHeaderItem | IResultTotalHeaderItem; | ||
export interface IResultDimension { | ||
name: string; | ||
headers: Header[]; | ||
headers: IHeader[]; | ||
} | ||
@@ -244,3 +262,3 @@ | ||
executionResult: { | ||
attributeHeaderItems?: IAttributeHeaderItem[][][]; | ||
headerItems?: IResultHeaderItem[][][]; | ||
data: DataValue[][] | DataValue[]; | ||
@@ -256,13 +274,17 @@ totals?: DataValue[][][]; | ||
export interface IError { | ||
code: number; | ||
message?: string; | ||
export interface IError extends Error { | ||
response: { | ||
status: number; | ||
}; | ||
} | ||
/** | ||
* Combination of both AFM executions responses | ||
* | ||
* `null` value as executionResult means empty response (HTTP 204) | ||
*/ | ||
export interface IExecutionResponses { | ||
executionResponse: IExecutionResponse; | ||
executionResult: IExecutionResult; | ||
executionResult: IExecutionResult | null; | ||
} | ||
export type AfmExecutionResponse = IExecutionResponses | IError; | ||
} |
{ | ||
"name": "@gooddata/typings", | ||
"version": "0.0.1-vaclavbohac-init-2017-11-03T09-46-45-561Z", | ||
"version": "0.0.1-vaclavbohac-pzb-header-items-2017-11-09T16-09-36-030Z", | ||
"description": "TypeScript definition files for GoodData platform", | ||
@@ -8,3 +8,4 @@ "typings": "dist/index.d.ts", | ||
"scripts": { | ||
"prepublish": "rm -rf dist && tsc" | ||
"prepublish": "rm -rf dist && tsc", | ||
"dev": "tsc --watch --noEmit" | ||
}, | ||
@@ -11,0 +12,0 @@ "files": [ |
@@ -1,2 +0,46 @@ | ||
# gooddata-typings | ||
TypeScript definition files for GoodData platform | ||
# GoodData Typings | ||
> TypeScript interfaces used in UI SDK describing executeAfm API | ||
## Getting started | ||
### Usage | ||
With [yarn](https://yarnpkg.com) installed, go to your project directory and run | ||
``` | ||
$ yarn add -D @gooddata/typings | ||
``` | ||
If you prefer [npm](npmjs.com) run | ||
``` | ||
$ npm install --save-dev @gooddata/typings | ||
``` | ||
## Documentation | ||
[Documentation](https://help.gooddata.com/display/bHsp5IhQjuz0e6HS0s76/React+Components) | ||
## Develop | ||
### Running the development | ||
To develop, you need to run the typescript compiler. By running `yarn dev`, the typescript compiler will be run in watch mode. | ||
```sh | ||
$ cd gooddata-typings | ||
$ yarn dev | ||
``` | ||
### Deployment | ||
``` | ||
git checkout master && git pull upstream master --tags | ||
npm version [major|minor|patch] -m "Release v%s" | ||
npm publish | ||
git push upstream master --tags | ||
``` | ||
## Contributing | ||
Report bugs and features on our [issues page](https://github.com/gooddata/gooddata-typings/issues). | ||
## License | ||
Copyright (C) 2007-2017, GoodData(R) Corporation. All rights reserved. | ||
For more information, please see [LICENSE](https://github.com/gooddata/gooddata-typings/blob/master/LICENSE) |
Sorry, the diff of this file is not supported yet
19251
7
482
47