n8n-nodes-powerbi
Version:
n8n nodes for integration with Power BI APIs
22 lines • 1.07 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRefreshHistory = void 0;
const GenericFunctions_1 = require("../../GenericFunctions");
async function getRefreshHistory(i) {
const returnData = [];
const groupId = this.getNodeParameter('groupId', i, '');
const datasetId = this.getNodeParameter('datasetId', i);
const top = this.getNodeParameter('top', i, undefined);
const queryParams = {};
if (top !== undefined) {
queryParams.$top = top;
}
const endpoint = groupId && groupId !== 'me' ?
`/groups/${groupId}/datasets/${datasetId}/refreshes` : `/datasets/${datasetId}/refreshes`;
const responseData = await GenericFunctions_1.powerBiApiRequest.call(this, 'GET', endpoint, {}, queryParams);
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
returnData.push(...executionData);
return returnData;
}
exports.getRefreshHistory = getRefreshHistory;
//# sourceMappingURL=getRefreshHistory.js.map