Skip to content

Commit d788c71

Browse files
authored
Merge pull request #217 from codesandbox/CSB-622-add-exitcode-to-exec-response-pint-api-spec
chore: add exitcode to the exec response in pint api spec file
2 parents 6c3f34c + 98bc68e commit d788c71

File tree

1 file changed

+98
-47
lines changed

1 file changed

+98
-47
lines changed

pint-openapi-bundled.json

Lines changed: 98 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -715,12 +715,6 @@
715715
"schema": {
716716
"$ref": "#/components/schemas/ExecListResponse"
717717
}
718-
},
719-
"text/event-stream": {
720-
"schema": {
721-
"type": "string",
722-
"description": "Server-Sent Events stream of exec updates"
723-
}
724718
}
725719
}
726720
},
@@ -1042,12 +1036,6 @@
10421036
"200": {
10431037
"description": "Exec output retrieved successfully",
10441038
"content": {
1045-
"text/plain": {
1046-
"schema": {
1047-
"$ref": "#/components/schemas/ExecStdout",
1048-
"description": "Plain text exec output"
1049-
}
1050-
},
10511039
"text/event-stream": {
10521040
"schema": {
10531041
"type": "string",
@@ -1638,14 +1626,62 @@
16381626
}
16391627
}
16401628
},
1641-
"/api/v1/ports/stream": {
1629+
"/api/v1/stream/execs": {
1630+
"get": {
1631+
"summary": "List all execs",
1632+
"tags": [
1633+
"execs"
1634+
],
1635+
"description": "Returns a list of all active execs using SSE.",
1636+
"operationId": "StreamExecsList",
1637+
"security": [
1638+
{
1639+
"bearerAuth": []
1640+
}
1641+
],
1642+
"responses": {
1643+
"200": {
1644+
"description": "Execs retrieved successfully",
1645+
"content": {
1646+
"text/event-stream": {
1647+
"schema": {
1648+
"type": "string",
1649+
"description": "Server-Sent Events stream of exec updates"
1650+
}
1651+
}
1652+
}
1653+
},
1654+
"401": {
1655+
"description": "Unauthorized",
1656+
"content": {
1657+
"application/json": {
1658+
"schema": {
1659+
"$ref": "#/components/schemas/Error"
1660+
}
1661+
}
1662+
}
1663+
},
1664+
"default": {
1665+
"description": "Unexpected Error",
1666+
"content": {
1667+
"application/json": {
1668+
"schema": {
1669+
"$ref": "#/components/schemas/Error"
1670+
}
1671+
}
1672+
}
1673+
}
1674+
}
1675+
}
1676+
},
1677+
"/api/v1/stream/ports": {
16421678
"get": {
16431679
"summary": "List open ports using Server-Sent Events (SSE)",
16441680
"tags": [
16451681
"ports"
16461682
],
16471683
"description": "Lists all open TCP ports on the system AND LISTEN TO THE CHANGES, excluding ignored ports configured in the server.",
1648-
"operationId": "ListPortsSSE",
1684+
"operationId": "StreamPortsList",
16491685
"security": [
16501686
{
16511687
"bearerAuth": []
@@ -1889,14 +1925,24 @@
18891925
"pid": {
18901926
"type": "integer",
18911927
"description": "Process ID of the exec"
1928+
},
1929+
"interactive": {
1930+
"type": "boolean",
1931+
"description": "Whether the exec is interactive"
1932+
},
1933+
"exitCode": {
1934+
"type": "integer",
1935+
"description": "Exit code of the process (only present when process has exited)"
18921936
}
18931937
},
18941938
"required": [
18951939
"id",
18961940
"command",
18971941
"args",
18981942
"status",
1899-
"pid"
1943+
"pid",
1944+
"interactive",
1945+
"exitCode"
19001946
]
19011947
},
19021948
"ExecListResponse": {
@@ -1969,38 +2015,6 @@
19692015
"message"
19702016
]
19712017
},
1972-
"ExecStdout": {
1973-
"type": "object",
1974-
"properties": {
1975-
"type": {
1976-
"type": "string",
1977-
"description": "Type of the exec output",
1978-
"enum": [
1979-
"stdout",
1980-
"stderr"
1981-
]
1982-
},
1983-
"output": {
1984-
"type": "string",
1985-
"description": "Data associated with the exec output"
1986-
},
1987-
"sequence": {
1988-
"type": "integer",
1989-
"format": "int32",
1990-
"description": "Sequence number of the output message"
1991-
},
1992-
"timestamp": {
1993-
"type": "string",
1994-
"format": "date-time",
1995-
"description": "Timestamp of when the output was generated"
1996-
}
1997-
},
1998-
"required": [
1999-
"type",
2000-
"output",
2001-
"sequence"
2002-
]
2003-
},
20042018
"ExecStdin": {
20052019
"type": "object",
20062020
"properties": {
@@ -2296,6 +2310,43 @@
22962310
"ports"
22972311
]
22982312
},
2313+
"ExecStdout": {
2314+
"type": "object",
2315+
"properties": {
2316+
"type": {
2317+
"type": "string",
2318+
"description": "Type of the exec output",
2319+
"enum": [
2320+
"stdout",
2321+
"stderr"
2322+
]
2323+
},
2324+
"output": {
2325+
"type": "string",
2326+
"description": "Data associated with the exec output"
2327+
},
2328+
"sequence": {
2329+
"type": "integer",
2330+
"format": "int32",
2331+
"description": "Sequence number of the output message"
2332+
},
2333+
"timestamp": {
2334+
"type": "string",
2335+
"format": "date-time",
2336+
"description": "Timestamp of when the output was generated"
2337+
},
2338+
"exitCode": {
2339+
"type": "integer",
2340+
"description": "Exit code of the process (only present when process has exited)"
2341+
}
2342+
},
2343+
"required": [
2344+
"type",
2345+
"output",
2346+
"sequence",
2347+
"exitCode"
2348+
]
2349+
},
22992350
"Task": {
23002351
"$ref": "#/components/schemas/TaskItem"
23012352
}

0 commit comments

Comments
 (0)