@integration-app/sdk
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -220,8 +220,8 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const latestNodeRun = flowRun.nodeRuns | ||
// ids are created by MongoDB and are sequential | ||
.sort((r1, r2) => (r1.id > r2.id ? 1 : -1)) | ||
const latestNodeRunId = flowRun.nodeRuns | ||
.map((nodeRun) => nodeRun.id) | ||
.sort() | ||
.pop(); | ||
if (latestNodeRun) { | ||
return this.getFlowNodeRunOutput(latestNodeRun.id); | ||
if (latestNodeRunId) { | ||
return this.getFlowNodeRunOutput(latestNodeRunId); | ||
} | ||
@@ -228,0 +228,0 @@ else { |
{ | ||
"name": "@integration-app/sdk", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "JavaScript SDK for Integration.app", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -227,8 +227,8 @@ import Axios, { AxiosRequestConfig } from 'axios' | ||
public async getFlowRunOutput(flowRun: any): Promise<any> { | ||
const latestNodeRun = flowRun.nodeRuns | ||
// ids are created by MongoDB and are sequential | ||
.sort((r1: any, r2: any) => (r1.id > r2.id ? 1 : -1)) | ||
const latestNodeRunId = flowRun.nodeRuns | ||
.map((nodeRun: any) => nodeRun.id) | ||
.sort() | ||
.pop() | ||
if (latestNodeRun) { | ||
return this.getFlowNodeRunOutput(latestNodeRun.id) | ||
if (latestNodeRunId) { | ||
return this.getFlowNodeRunOutput(latestNodeRunId) | ||
} else { | ||
@@ -235,0 +235,0 @@ return undefined |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
301660
3552