Skip to content

Commit a93a995

Browse files
feat: FIT-974: [FSM API] Manual Transition Endpoint (#676)
Co-authored-by: fern-api[bot] <115122769+fern-api[bot]@users.noreply.github.com>
1 parent 9953362 commit a93a995

File tree

4 files changed

+134
-3
lines changed

4 files changed

+134
-3
lines changed

.mock/definition/__package__.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2298,6 +2298,14 @@ types:
22982298
maxLength: 2048
22992299
source:
23002300
openapi: openapi/openapi.yaml
2301+
FsmTransitionExecuteResponse:
2302+
docs: Response serializer for manual FSM transition execution.
2303+
properties:
2304+
new_state: optional<string>
2305+
state_record: optional<StateModel>
2306+
success: boolean
2307+
source:
2308+
openapi: openapi/openapi.yaml
23012309
FileUpload:
23022310
properties:
23032311
file: string

.mock/definition/fsm.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,52 @@ service:
7676
id: 1
7777
audiences:
7878
- internal
79+
execute_transition:
80+
path: /api/fsm/entities/{entity_name}/{entity_id}/transition/
81+
method: POST
82+
auth: true
83+
docs: Execute a registered manual transition for an entity.
84+
source:
85+
openapi: openapi/openapi.yaml
86+
path-parameters:
87+
entity_id: integer
88+
entity_name: string
89+
display-name: Execute manual FSM transition
90+
request:
91+
name: FsmTransitionExecuteRequestRequest
92+
body:
93+
properties:
94+
transition_data: optional<map<string, unknown>>
95+
transition_name:
96+
type: string
97+
validation:
98+
minLength: 1
99+
content-type: application/json
100+
response:
101+
docs: ''
102+
type: root.FsmTransitionExecuteResponse
103+
examples:
104+
- path-parameters:
105+
entity_id: 1
106+
entity_name: entity_name
107+
request:
108+
transition_name: transition_name
109+
response:
110+
body:
111+
new_state: new_state
112+
state_record:
113+
context_data:
114+
key: value
115+
created_at: '2024-01-15T09:30:00Z'
116+
id: id
117+
previous_state: previous_state
118+
state: state
119+
transition_name: transition_name
120+
triggered_by:
121+
email: email
122+
id: 1
123+
success: true
124+
audiences:
125+
- internal
79126
source:
80127
openapi: openapi/openapi.yaml

.mock/openapi/openapi.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4048,6 +4048,49 @@ paths:
40484048
results: $response.results
40494049
x-fern-sdk-group-name: fsm
40504050
x-fern-sdk-method-name: state_history
4051+
/api/fsm/entities/{entity_name}/{entity_id}/transition/:
4052+
post:
4053+
description: Execute a registered manual transition for an entity.
4054+
operationId: api_fsm_entities_transition_create
4055+
parameters:
4056+
- in: path
4057+
name: entity_id
4058+
required: true
4059+
schema:
4060+
type: integer
4061+
- in: path
4062+
name: entity_name
4063+
required: true
4064+
schema:
4065+
type: string
4066+
requestBody:
4067+
content:
4068+
application/json:
4069+
schema:
4070+
$ref: '#/components/schemas/FSMTransitionExecuteRequestRequest'
4071+
application/x-www-form-urlencoded:
4072+
schema:
4073+
$ref: '#/components/schemas/FSMTransitionExecuteRequestRequest'
4074+
multipart/form-data:
4075+
schema:
4076+
$ref: '#/components/schemas/FSMTransitionExecuteRequestRequest'
4077+
required: true
4078+
responses:
4079+
'200':
4080+
content:
4081+
application/json:
4082+
schema:
4083+
$ref: '#/components/schemas/FSMTransitionExecuteResponse'
4084+
description: ''
4085+
security:
4086+
- Token: []
4087+
summary: Execute manual FSM transition
4088+
tags:
4089+
- FSM
4090+
x-fern-audiences:
4091+
- internal
4092+
x-fern-sdk-group-name: fsm
4093+
x-fern-sdk-method-name: execute_transition
40514094
/api/import/file-upload/{id}:
40524095
delete:
40534096
description: Delete a specific uploaded file.
@@ -22154,6 +22197,39 @@ components:
2215422197
required:
2215522198
- export_type
2215622199
type: object
22200+
FSMTransitionExecuteRequestRequest:
22201+
description: Request body serializer for executing a manual FSM transition.
22202+
properties:
22203+
transition_data:
22204+
additionalProperties: {}
22205+
nullable: true
22206+
type: object
22207+
transition_name:
22208+
minLength: 1
22209+
type: string
22210+
required:
22211+
- transition_name
22212+
type: object
22213+
FSMTransitionExecuteResponse:
22214+
description: Response serializer for manual FSM transition execution.
22215+
properties:
22216+
new_state:
22217+
nullable: true
22218+
readOnly: true
22219+
type: string
22220+
state_record:
22221+
allOf:
22222+
- $ref: '#/components/schemas/StateModel'
22223+
nullable: true
22224+
readOnly: true
22225+
success:
22226+
readOnly: true
22227+
type: boolean
22228+
required:
22229+
- new_state
22230+
- state_record
22231+
- success
22232+
type: object
2215722233
FileUpload:
2215822234
properties:
2215922235
file:

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)