Skip to content

Commit 7a17d6b

Browse files
committed
add getDataSet function to handle most datasets
1 parent 377df3e commit 7a17d6b

File tree

3 files changed

+206
-20
lines changed

3 files changed

+206
-20
lines changed

package-lock.json

Lines changed: 187 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rantalainen/fuusor-api-client",
3-
"version": "3.1.0",
3+
"version": "4.0.0",
44
"description": "Fuusor API client library",
55
"main": "dist/index.js",
66
"scripts": {

src/index.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,24 @@ export class FuusorApiClient {
152152
return access_token;
153153
}
154154

155+
/**
156+
* Get DataSet from Fuusor.
157+
*
158+
* Note that with included hierarchies and connected datasets the response can be quite large. This function can't handle very large responses, so if you need those, consider using direct API calls with your own HTTP client.
159+
* @param dataSetId - The ID of the dataset to retrieve
160+
* @param includeHierarchies - Whether to include hierarchies in the response
161+
* @param includeConnectedDataSets - Whether to include connected datasets in the response
162+
*/
163+
async getDataSet(dataSetId: string, includeHierarchies: boolean = false, includeConnectedDataSets: boolean = false): Promise<any> {
164+
const params = {
165+
DatasetId: dataSetId,
166+
IncludeHierarchies: includeHierarchies,
167+
IncludeConnectedDataSets: includeConnectedDataSets
168+
};
169+
170+
return await this.request('datasets', 'DataSet/Get/', 'GET', undefined, params);
171+
}
172+
155173
/** @private */
156174
resetAccessToken(scope: string) {
157175
this.accessTokens[scope] = undefined;

0 commit comments

Comments
 (0)