From 80ec2c8ab893b2ca62d0bfc775b63529e742360c Mon Sep 17 00:00:00 2001 From: Vladimir Upirov <4648606+Valodya@users.noreply.github.com> Date: Fri, 30 Aug 2024 18:15:25 +0300 Subject: [PATCH 1/2] - AUTO-737 Add API endpoint to load flow execution context by its id --- src/automations/index.js | 13 +++++++++++++ src/urls.js | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/src/automations/index.js b/src/automations/index.js index 6aecccfb..e5bd9a68 100644 --- a/src/automations/index.js +++ b/src/automations/index.js @@ -23,6 +23,19 @@ export default class Automations { }) } + async loadFlowExecutionContext(executionId) { + if (!executionId || typeof executionId !== 'string') { + throw new Error('The "executionId" argument must be provided and must be a string.') + } + + return this.app.request.get({ + url : this.app.urls.automationFlowExecutionContext(), + query: { + executionId, + } + }) + } + async activateFlowById(flowId, initialData) { if (!flowId || typeof flowId !== 'string') { throw new Error('The "flowId" argument must be provided and must be a string.') diff --git a/src/urls.js b/src/urls.js index 4fc28b42..d400f9ca 100644 --- a/src/urls.js +++ b/src/urls.js @@ -17,6 +17,10 @@ export default class Urls { return `${this.automation()}/flow` } + automationFlowExecutionContext() { + return `${this.automation()}/flow/execution-context` + } + automationFlowTrigger() { return `${this.automationFlow()}/trigger` } From 5eebfc30c24bfd4c3ad7bc2026c7c927c2281140 Mon Sep 17 00:00:00 2001 From: Vladimir Upirov <4648606+Valodya@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:56:27 +0200 Subject: [PATCH 2/2] - fix --- src/automations/index.js | 5 +---- src/urls.js | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/automations/index.js b/src/automations/index.js index e5bd9a68..0b2291d6 100644 --- a/src/automations/index.js +++ b/src/automations/index.js @@ -29,10 +29,7 @@ export default class Automations { } return this.app.request.get({ - url : this.app.urls.automationFlowExecutionContext(), - query: { - executionId, - } + url : this.app.urls.automationFlowExecutionContext(executionId), }) } diff --git a/src/urls.js b/src/urls.js index 06f114a2..eabb6fd6 100644 --- a/src/urls.js +++ b/src/urls.js @@ -23,8 +23,8 @@ export default class Urls { return `${this.automation()}/flow` } - automationFlowExecutionContext() { - return `${this.automation()}/flow/execution-context` + automationFlowExecutionContext(executionId) { + return `${this.automation()}/flow/execution-context/${executionId}` } automationFlowTrigger() {