Skip to content

Commit ce48f26

Browse files
authored
chore: migrate to /api/v1/workflow/:id/execute (#250)
1 parent 98d6530 commit ce48f26

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

__tests__/httpServer/apiV1.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ describe('HTTP Server API V1', () => {
158158
test.todo('should return 500 for internal server error')
159159
})
160160

161-
describe('POST /api/v1/workflow/:id/run', () => {
161+
describe('POST /api/v1/workflow/:id/execute', () => {
162162
let workflowSpy
163163
let mockWorkflowFn
164164

@@ -191,7 +191,7 @@ describe('HTTP Server API V1', () => {
191191
test('should return 202 and run the specified workflow', async () => {
192192
mockWorkflowFn.mockResolvedValueOnce()
193193
const response = await app
194-
.post('/api/v1/workflow/test-workflow/run')
194+
.post('/api/v1/workflow/test-workflow/execute')
195195
.set('Content-Type', 'application/json')
196196
.send({ data: { some: 'data' } })
197197

@@ -208,7 +208,7 @@ describe('HTTP Server API V1', () => {
208208
workflowsList: []
209209
})
210210
const response = await app
211-
.post('/api/v1/workflow/invalid-workflow/run')
211+
.post('/api/v1/workflow/invalid-workflow/execute')
212212
.set('Content-Type', 'application/json')
213213
.send({})
214214

@@ -231,7 +231,7 @@ describe('HTTP Server API V1', () => {
231231
workflowsList: [{ id: 'test-workflow', description: 'Test workflow', isEnabled: false, isRequiredAdditionalData: false }]
232232
})
233233
const response = await app
234-
.post('/api/v1/workflow/test-workflow/run')
234+
.post('/api/v1/workflow/test-workflow/execute')
235235
.set('Content-Type', 'application/json')
236236
.send({})
237237

@@ -254,7 +254,7 @@ describe('HTTP Server API V1', () => {
254254
workflowsList: [{ id: 'test-workflow', description: 'Test workflow', isEnabled: true, isRequiredAdditionalData: true }]
255255
})
256256
const response = await app
257-
.post('/api/v1/workflow/test-workflow/run')
257+
.post('/api/v1/workflow/test-workflow/execute')
258258
.set('Content-Type', 'application/json')
259259
.send({})
260260

@@ -266,7 +266,7 @@ describe('HTTP Server API V1', () => {
266266
mockWorkflowFn.mockRejectedValueOnce(new Error('Something went wrong'))
267267

268268
const response = await app
269-
.post('/api/v1/workflow/test-workflow/run')
269+
.post('/api/v1/workflow/test-workflow/execute')
270270
.set('Content-Type', 'application/json')
271271
.send({ data: { some: 'data' } })
272272

src/httpServer/routers/apiV1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function createApiRouter (knex, express) {
181181
}
182182
})
183183

184-
router.post('/workflow/:id/run', async (req, res) => {
184+
router.post('/workflow/:id/execute', async (req, res) => {
185185
const { id } = req.params
186186
const { data } = req.body
187187
const { workflows } = getWorkflowsDetails()

src/httpServer/swagger/api-v1.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ paths:
6161
application/json:
6262
schema:
6363
$ref: '#/components/schemas/ErrorResponse'
64-
/api/v1/workflow/{workflowId}/run:
64+
/api/v1/workflow/{workflowId}/execute:
6565
post:
6666
summary: Execute a workflow
6767
description: Executes the specified workflow with the provided input data

0 commit comments

Comments
 (0)