From a48f86ee347d1394d96034f01a9926c2a2204d8f Mon Sep 17 00:00:00 2001 From: Wallace Breza Date: Wed, 20 Apr 2016 14:14:31 -0700 Subject: [PATCH] Updated Node SDK to expose custom import functions --- .gitignore | 8 +- generate.bat | 2 +- .../models/basicCredentials.js | 0 lib/{client => autorest}/models/column.js | 0 lib/{client => autorest}/models/dataset.js | 0 lib/{client => autorest}/models/datasource.js | 0 .../models/gatewayDatasource.js | 0 lib/{client => autorest}/models/importInfo.js | 0 .../models/importModel.js | 0 lib/{client => autorest}/models/index.d.ts | 0 lib/{client => autorest}/models/index.js | 0 .../models/oDataResponseListDataset.js | 0 .../models/oDataResponseListDatasource.js | 0 .../oDataResponseListGatewayDatasource.js | 0 .../models/oDataResponseListImport.js | 0 .../models/oDataResponseListReport.js | 0 .../models/oDataResponseListTable.js | 0 .../models/oDataResponseListWorkspace.js | 0 lib/{client => autorest}/models/report.js | 0 lib/{client => autorest}/models/row.js | 0 lib/{client => autorest}/models/table.js | 0 lib/{client => autorest}/models/workspace.js | 0 .../operations/datasets.js | 7 +- .../operations/gateways.js | 0 .../operations/imports.js | 0 .../operations/index.d.ts | 0 lib/{client => autorest}/operations/index.js | 0 .../operations/reports.js | 0 .../operations/workspaces.js | 0 lib/{client => autorest}/powerBIClient.d.ts | 0 lib/{client => autorest}/powerBIClient.js | 0 lib/client/models/importFileOptions.ts | 5 + lib/client/models/index.ts | 2 + lib/client/operations/imports.ts | 166 ++++++++++++++++++ lib/client/operations/index.ts | 4 + lib/client/powerBIClient.ts | 14 ++ lib/core/powerBIToken.d.ts | 11 -- lib/core/powerBIToken.js | 58 ------ lib/index.d.ts | 4 +- lib/index.js | 3 +- lib/index.ts | 4 +- package.json | 4 +- 42 files changed, 208 insertions(+), 84 deletions(-) rename lib/{client => autorest}/models/basicCredentials.js (100%) rename lib/{client => autorest}/models/column.js (100%) rename lib/{client => autorest}/models/dataset.js (100%) rename lib/{client => autorest}/models/datasource.js (100%) rename lib/{client => autorest}/models/gatewayDatasource.js (100%) rename lib/{client => autorest}/models/importInfo.js (100%) rename lib/{client => autorest}/models/importModel.js (100%) rename lib/{client => autorest}/models/index.d.ts (100%) rename lib/{client => autorest}/models/index.js (100%) rename lib/{client => autorest}/models/oDataResponseListDataset.js (100%) rename lib/{client => autorest}/models/oDataResponseListDatasource.js (100%) rename lib/{client => autorest}/models/oDataResponseListGatewayDatasource.js (100%) rename lib/{client => autorest}/models/oDataResponseListImport.js (100%) rename lib/{client => autorest}/models/oDataResponseListReport.js (100%) rename lib/{client => autorest}/models/oDataResponseListTable.js (100%) rename lib/{client => autorest}/models/oDataResponseListWorkspace.js (100%) rename lib/{client => autorest}/models/report.js (100%) rename lib/{client => autorest}/models/row.js (100%) rename lib/{client => autorest}/models/table.js (100%) rename lib/{client => autorest}/models/workspace.js (100%) rename lib/{client => autorest}/operations/datasets.js (99%) rename lib/{client => autorest}/operations/gateways.js (100%) rename lib/{client => autorest}/operations/imports.js (100%) rename lib/{client => autorest}/operations/index.d.ts (100%) rename lib/{client => autorest}/operations/index.js (100%) rename lib/{client => autorest}/operations/reports.js (100%) rename lib/{client => autorest}/operations/workspaces.js (100%) rename lib/{client => autorest}/powerBIClient.d.ts (100%) rename lib/{client => autorest}/powerBIClient.js (100%) create mode 100644 lib/client/models/importFileOptions.ts create mode 100644 lib/client/models/index.ts create mode 100644 lib/client/operations/imports.ts create mode 100644 lib/client/operations/index.ts create mode 100644 lib/client/powerBIClient.ts delete mode 100644 lib/core/powerBIToken.d.ts delete mode 100644 lib/core/powerBIToken.js diff --git a/.gitignore b/.gitignore index 84235c9..4c2ec1b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,8 @@ node_modules/ -typings/ \ No newline at end of file +typings/ +lib/client/**/*.js +lib/client/**/*.js.map +lib/client/**/*.d.ts +lib/core/**/*.js +lib/core/**/*.js.map +lib/core/**/*.d.ts \ No newline at end of file diff --git a/generate.bat b/generate.bat index c22a436..8a0c800 100644 --- a/generate.bat +++ b/generate.bat @@ -1,5 +1,5 @@ pushd "%~dp0" rm -rf client -AutoRest.exe -CodeGenerator NodeJS -Modeler Swagger -Input swagger.json -Namespace powerbi -output lib/client -name PowerBIClient -AddCredentials +AutoRest.exe -CodeGenerator NodeJS -Modeler Swagger -Input swagger.json -Namespace powerbi -output lib/autorest -name PowerBIClient -AddCredentials popd pause \ No newline at end of file diff --git a/lib/client/models/basicCredentials.js b/lib/autorest/models/basicCredentials.js similarity index 100% rename from lib/client/models/basicCredentials.js rename to lib/autorest/models/basicCredentials.js diff --git a/lib/client/models/column.js b/lib/autorest/models/column.js similarity index 100% rename from lib/client/models/column.js rename to lib/autorest/models/column.js diff --git a/lib/client/models/dataset.js b/lib/autorest/models/dataset.js similarity index 100% rename from lib/client/models/dataset.js rename to lib/autorest/models/dataset.js diff --git a/lib/client/models/datasource.js b/lib/autorest/models/datasource.js similarity index 100% rename from lib/client/models/datasource.js rename to lib/autorest/models/datasource.js diff --git a/lib/client/models/gatewayDatasource.js b/lib/autorest/models/gatewayDatasource.js similarity index 100% rename from lib/client/models/gatewayDatasource.js rename to lib/autorest/models/gatewayDatasource.js diff --git a/lib/client/models/importInfo.js b/lib/autorest/models/importInfo.js similarity index 100% rename from lib/client/models/importInfo.js rename to lib/autorest/models/importInfo.js diff --git a/lib/client/models/importModel.js b/lib/autorest/models/importModel.js similarity index 100% rename from lib/client/models/importModel.js rename to lib/autorest/models/importModel.js diff --git a/lib/client/models/index.d.ts b/lib/autorest/models/index.d.ts similarity index 100% rename from lib/client/models/index.d.ts rename to lib/autorest/models/index.d.ts diff --git a/lib/client/models/index.js b/lib/autorest/models/index.js similarity index 100% rename from lib/client/models/index.js rename to lib/autorest/models/index.js diff --git a/lib/client/models/oDataResponseListDataset.js b/lib/autorest/models/oDataResponseListDataset.js similarity index 100% rename from lib/client/models/oDataResponseListDataset.js rename to lib/autorest/models/oDataResponseListDataset.js diff --git a/lib/client/models/oDataResponseListDatasource.js b/lib/autorest/models/oDataResponseListDatasource.js similarity index 100% rename from lib/client/models/oDataResponseListDatasource.js rename to lib/autorest/models/oDataResponseListDatasource.js diff --git a/lib/client/models/oDataResponseListGatewayDatasource.js b/lib/autorest/models/oDataResponseListGatewayDatasource.js similarity index 100% rename from lib/client/models/oDataResponseListGatewayDatasource.js rename to lib/autorest/models/oDataResponseListGatewayDatasource.js diff --git a/lib/client/models/oDataResponseListImport.js b/lib/autorest/models/oDataResponseListImport.js similarity index 100% rename from lib/client/models/oDataResponseListImport.js rename to lib/autorest/models/oDataResponseListImport.js diff --git a/lib/client/models/oDataResponseListReport.js b/lib/autorest/models/oDataResponseListReport.js similarity index 100% rename from lib/client/models/oDataResponseListReport.js rename to lib/autorest/models/oDataResponseListReport.js diff --git a/lib/client/models/oDataResponseListTable.js b/lib/autorest/models/oDataResponseListTable.js similarity index 100% rename from lib/client/models/oDataResponseListTable.js rename to lib/autorest/models/oDataResponseListTable.js diff --git a/lib/client/models/oDataResponseListWorkspace.js b/lib/autorest/models/oDataResponseListWorkspace.js similarity index 100% rename from lib/client/models/oDataResponseListWorkspace.js rename to lib/autorest/models/oDataResponseListWorkspace.js diff --git a/lib/client/models/report.js b/lib/autorest/models/report.js similarity index 100% rename from lib/client/models/report.js rename to lib/autorest/models/report.js diff --git a/lib/client/models/row.js b/lib/autorest/models/row.js similarity index 100% rename from lib/client/models/row.js rename to lib/autorest/models/row.js diff --git a/lib/client/models/table.js b/lib/autorest/models/table.js similarity index 100% rename from lib/client/models/table.js rename to lib/autorest/models/table.js diff --git a/lib/client/models/workspace.js b/lib/autorest/models/workspace.js similarity index 100% rename from lib/client/models/workspace.js rename to lib/autorest/models/workspace.js diff --git a/lib/client/operations/datasets.js b/lib/autorest/operations/datasets.js similarity index 99% rename from lib/client/operations/datasets.js rename to lib/autorest/operations/datasets.js index cace122..8c8cebe 100644 --- a/lib/client/operations/datasets.js +++ b/lib/autorest/operations/datasets.js @@ -1473,11 +1473,6 @@ Datasets.prototype.setAllConnections = function (collectionName, workspaceId, da if (parameters === null || parameters === undefined || typeof parameters !== 'object') { throw new Error('parameters cannot be null or undefined and it must be of type object.'); } - for(var valueElement in parameters) { - if (parameters[valueElement] !== null && parameters[valueElement] !== undefined && typeof parameters[valueElement] !== 'object') { - throw new Error('parameters[valueElement] must be of type object.'); - } - } } catch (error) { return callback(error); } @@ -1520,7 +1515,7 @@ Datasets.prototype.setAllConnections = function (collectionName, workspaceId, da required: false, serializedName: 'ObjectElementType', type: { - name: 'Object' + name: 'String' } } } diff --git a/lib/client/operations/gateways.js b/lib/autorest/operations/gateways.js similarity index 100% rename from lib/client/operations/gateways.js rename to lib/autorest/operations/gateways.js diff --git a/lib/client/operations/imports.js b/lib/autorest/operations/imports.js similarity index 100% rename from lib/client/operations/imports.js rename to lib/autorest/operations/imports.js diff --git a/lib/client/operations/index.d.ts b/lib/autorest/operations/index.d.ts similarity index 100% rename from lib/client/operations/index.d.ts rename to lib/autorest/operations/index.d.ts diff --git a/lib/client/operations/index.js b/lib/autorest/operations/index.js similarity index 100% rename from lib/client/operations/index.js rename to lib/autorest/operations/index.js diff --git a/lib/client/operations/reports.js b/lib/autorest/operations/reports.js similarity index 100% rename from lib/client/operations/reports.js rename to lib/autorest/operations/reports.js diff --git a/lib/client/operations/workspaces.js b/lib/autorest/operations/workspaces.js similarity index 100% rename from lib/client/operations/workspaces.js rename to lib/autorest/operations/workspaces.js diff --git a/lib/client/powerBIClient.d.ts b/lib/autorest/powerBIClient.d.ts similarity index 100% rename from lib/client/powerBIClient.d.ts rename to lib/autorest/powerBIClient.d.ts diff --git a/lib/client/powerBIClient.js b/lib/autorest/powerBIClient.js similarity index 100% rename from lib/client/powerBIClient.js rename to lib/autorest/powerBIClient.js diff --git a/lib/client/models/importFileOptions.ts b/lib/client/models/importFileOptions.ts new file mode 100644 index 0000000..a987f5c --- /dev/null +++ b/lib/client/models/importFileOptions.ts @@ -0,0 +1,5 @@ +export interface ImportFileOptions { + datasetDisplayName?: string, + nameConflict?: string, + customHeaders?: { [headerName: string]: string; } +} diff --git a/lib/client/models/index.ts b/lib/client/models/index.ts new file mode 100644 index 0000000..0098e19 --- /dev/null +++ b/lib/client/models/index.ts @@ -0,0 +1,2 @@ +export * from './importFileOptions'; +export * from '../../autorest/models'; \ No newline at end of file diff --git a/lib/client/operations/imports.ts b/lib/client/operations/imports.ts new file mode 100644 index 0000000..46f1349 --- /dev/null +++ b/lib/client/operations/imports.ts @@ -0,0 +1,166 @@ +import { PowerBIClient } from '../powerBIClient'; +import { ServiceClientOptions, RequestOptions, ServiceCallback, WebResource } from 'ms-rest'; +import fs = require('fs'); +import util = require('util'); +import * as operations from '../../autorest/operations'; +import * as models from '../models'; +let AuorestImports = require('../../autorest/operations/imports'); +let msRest = require('ms-rest'); + +export class Imports implements operations.Imports { + private client: any; + private base: operations.Imports; + + constructor(client: PowerBIClient) { + this.base = new AuorestImports(this); + this.client = client; + } + + public getImports(collectionName: string, workspaceId: string, callback: ServiceCallback): void; + public getImports(collectionName: string, workspaceId: string, options: { customHeaders?: { [headerName: string]: string; } }, callback: ServiceCallback): void; + + public getImports(collectionName: string, workspaceId: string, options: any, callback?: ServiceCallback): void { + this.base.getImports(collectionName, workspaceId, options, callback); + } + + public postImport(collectionName: string, workspaceId: string, importInfo: models.ImportInfo, callback: ServiceCallback): void; + public postImport(collectionName: string, workspaceId: string, importInfo: models.ImportInfo, options: models.ImportFileOptions, callback: ServiceCallback): void; + + public postImport(collectionName: string, workspaceId: string, importInfo: models.ImportInfo, options: any, callback?: ServiceCallback): void { + this.base.postImport.apply(this, arguments); + } + + public getImportById(collectionName: string, workspaceId: string, importId: string, options: models.ImportFileOptions, callback: ServiceCallback): void; + public getImportById(collectionName: string, workspaceId: string, importId: string, callback: ServiceCallback): void; + + public getImportById(collectionName: string, workspaceId: string, importId: string, options: any, callback?: ServiceCallback): void { + this.base.getImportById.apply(this, arguments); + } + + public uploadFile(collectionName: string, workspaceId: string, filePath: string, callback: ServiceCallback): void; + public uploadFile(collectionName: string, workspaceId: string, filePath: string, options: models.ImportFileOptions, callback: ServiceCallback): void; + + public uploadFile(collectionName: string, workspaceId: string, filePath: string, options: any, callback?: ServiceCallback): void { + if (!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + + var datasetDisplayName = (options && options.datasetDisplayName !== undefined) ? options.datasetDisplayName : undefined; + var nameConflict = (options && options.nameConflict !== undefined) ? options.nameConflict : undefined; + // Validate + try { + if (collectionName === null || collectionName === undefined || typeof collectionName.valueOf() !== 'string') { + throw new Error('collectionName cannot be null or undefined and it must be of type string.'); + } + if (workspaceId === null || workspaceId === undefined || typeof workspaceId.valueOf() !== 'string') { + throw new Error('workspaceId cannot be null or undefined and it must be of type string.'); + } + if (datasetDisplayName !== null && datasetDisplayName !== undefined && typeof datasetDisplayName.valueOf() !== 'string') { + throw new Error('datasetDisplayName must be of type string.'); + } + if (nameConflict !== null && nameConflict !== undefined && typeof nameConflict.valueOf() !== 'string') { + throw new Error('nameConflict must be of type string.'); + } + if (filePath === null || filePath === undefined) { + throw new Error('filePath cannot be null or undefined.'); + } + } catch (error) { + return callback(error, null, null, null); + } + + // Construct URL + var requestUrl = this.client['baseUri'] + '//beta/collections/{collectionName}/workspaces/{workspaceId}/imports'; + requestUrl = requestUrl.replace('{collectionName}', encodeURIComponent(collectionName)); + requestUrl = requestUrl.replace('{workspaceId}', encodeURIComponent(workspaceId)); + + var queryParameters = []; + if (datasetDisplayName !== null && datasetDisplayName !== undefined) { + queryParameters.push('datasetDisplayName=' + encodeURIComponent(datasetDisplayName)); + } + if (nameConflict !== null && nameConflict !== undefined) { + queryParameters.push('nameConflict=' + encodeURIComponent(nameConflict)); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + // trim all duplicate forward slashes in the url + var regex = /([^:]\/)\/+/gi; + requestUrl = requestUrl.replace(regex, '$1'); + + var formData = { + file: fs.createReadStream(filePath) + }; + + // Create HTTP transport objects + var httpRequest = WebResource.post(requestUrl); + httpRequest['url'] = requestUrl; + httpRequest['method'] = 'POST'; + httpRequest['formData'] = formData; + httpRequest['headers'] = {}; + + // Set Headers + if (options) { + for (var headerName in options.customHeaders) { + if (options.customHeaders.hasOwnProperty(headerName)) { + httpRequest.withHeader(headerName, options.customHeaders[headerName]); + } + } + } + + // Send Request + return this.client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err, null, null, null); + } + + var statusCode = response.statusCode; + if (statusCode !== 202) { + var error: any = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + var parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + } catch (defaultError) { + error.message = util.format('Error "%s" occurred in deserializing the responseBody ' + + '- "%s" for the default response.', defaultError.message, responseBody); + return callback(error, null, null, null); + } + return callback(error, null, null, null); + } + // Create Result + var result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 202) { + var parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + var resultMapper = new this.client.models['ImportModel']().mapper(); + result = this.client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + var deserializationError: any = new Error(util.format('Error "%s" occurred in deserializing the responseBody - "%s"', error, responseBody)); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError, null, null, null); + } + } + + return callback(null, result, httpRequest, response); + }); + } +} \ No newline at end of file diff --git a/lib/client/operations/index.ts b/lib/client/operations/index.ts new file mode 100644 index 0000000..7675aac --- /dev/null +++ b/lib/client/operations/index.ts @@ -0,0 +1,4 @@ +'use strict' +export { Datasets, Gateways, Reports, Workspaces } from '../../autorest/operations'; +export { Imports } from './imports'; +export * from '../models'; diff --git a/lib/client/powerBIClient.ts b/lib/client/powerBIClient.ts new file mode 100644 index 0000000..792bd78 --- /dev/null +++ b/lib/client/powerBIClient.ts @@ -0,0 +1,14 @@ +'use strict'; + +import AutorestClient = require('../autorest/powerBIClient'); +import * as operations from './operations'; +import {ServiceClientCredentials, ServiceClientOptions} from 'ms-rest'; + +export class PowerBIClient extends AutorestClient { + public imports:operations.Imports; + + constructor(credentials: ServiceClientCredentials, baseUri: string, options?: ServiceClientOptions) { + super(credentials, baseUri, options); + this.imports = new operations.Imports(this); + } +} \ No newline at end of file diff --git a/lib/core/powerBIToken.d.ts b/lib/core/powerBIToken.d.ts deleted file mode 100644 index e79eacc..0000000 --- a/lib/core/powerBIToken.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export declare class PowerBIToken { - private claims; - constructor(); - static createDevToken(workspaceCollectionName: string, workspaceId: string, expiration?: Date): PowerBIToken; - static createProvisionToken(workspaceCollectionName: string, expiration?: Date): PowerBIToken; - static createReportEmbedToken(workspaceCollectionName: string, workspaceId: string, reportId: string, expiration?: Date): PowerBIToken; - private setTokenExpiration(expiration); - addClaim(key: string, value: any): void; - private static getUnixTime(date); - generate(accessKey: string): string; -} diff --git a/lib/core/powerBIToken.js b/lib/core/powerBIToken.js deleted file mode 100644 index 99c8d62..0000000 --- a/lib/core/powerBIToken.js +++ /dev/null @@ -1,58 +0,0 @@ -'use strict'; -var jwt = require('jwt-simple'); -var PowerBIToken = (function () { - function PowerBIToken() { - this.claims = { - ver: '0.1.0', - aud: 'https://analysis.windows.net/powerbi/api', - iss: 'PowerBISDK' - }; - } - PowerBIToken.createDevToken = function (workspaceCollectionName, workspaceId, expiration) { - if (expiration === void 0) { expiration = null; } - var token = new PowerBIToken(); - token.addClaim('type', 'dev'); - token.addClaim('wcn', workspaceCollectionName); - token.addClaim('wid', workspaceId); - token.setTokenExpiration(expiration); - return token; - }; - PowerBIToken.createProvisionToken = function (workspaceCollectionName, expiration) { - if (expiration === void 0) { expiration = null; } - var token = new PowerBIToken(); - token.addClaim('type', 'provision'); - token.addClaim('wcn', workspaceCollectionName); - token.setTokenExpiration(expiration); - return token; - }; - PowerBIToken.createReportEmbedToken = function (workspaceCollectionName, workspaceId, reportId, expiration) { - if (expiration === void 0) { expiration = null; } - var token = new PowerBIToken(); - token.addClaim('type', 'provision'); - token.addClaim('wcn', workspaceCollectionName); - token.addClaim('wid', workspaceId); - token.addClaim('rid', reportId); - token.setTokenExpiration(expiration); - return token; - }; - PowerBIToken.prototype.setTokenExpiration = function (expiration) { - var nowSeconds = PowerBIToken.getUnixTime(new Date()); - var expirationSeconds = expiration ? PowerBIToken.getUnixTime(expiration) : nowSeconds + 3600; - if (expirationSeconds <= nowSeconds) { - throw new Error('Token expiration must be in the future'); - } - this.addClaim('nbf', nowSeconds); - this.addClaim('exp', expirationSeconds); - }; - PowerBIToken.prototype.addClaim = function (key, value) { - this.claims[key] = value; - }; - PowerBIToken.getUnixTime = function (date) { - return date.getTime() / 1000 | 0; - }; - PowerBIToken.prototype.generate = function (accessKey) { - return jwt.encode(this.claims, accessKey); - }; - return PowerBIToken; -}()); -exports.PowerBIToken = PowerBIToken; diff --git a/lib/index.d.ts b/lib/index.d.ts index aa017c9..65dcb08 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -1,3 +1,3 @@ -import client = require('./client/powerBIClient'); +export * from './client/powerBIClient'; +export * from './client/models'; export * from './core/powerBIToken'; -export declare let PowerBIClient: typeof client; diff --git a/lib/index.js b/lib/index.js index 7370850..217d6fa 100644 --- a/lib/index.js +++ b/lib/index.js @@ -2,6 +2,5 @@ function __export(m) { for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; } -var client = require('./client/powerBIClient'); +__export(require('./client/powerBIClient')); __export(require('./core/powerBIToken')); -exports.PowerBIClient = client; diff --git a/lib/index.ts b/lib/index.ts index 760de62..c4e80e2 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,4 +1,4 @@ 'use strict'; -import client = require('./client/powerBIClient'); +export * from './client/powerBIClient'; +export * from './client/models'; export * from './core/powerBIToken'; -export let PowerBIClient = client; diff --git a/package.json b/package.json index c7f3fb3..029b5b6 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,9 @@ }, "homepage": "https://github.com/Microsoft/PowerBI-Node#readme", "dependencies": { + "form-data": "^0.2.0", "jwt-simple": "^0.5.0", - "ms-rest": "^1.12.0" + "ms-rest": "^1.12.0", + "request": "^2.71.0" } }