Signed-off-by: solimant <solimant@users.noreply.github.com>
This commit is contained in:
solimant
2025-01-02 00:26:13 +00:00
parent b7e98127e6
commit 845e8a1283
4 changed files with 14 additions and 93 deletions
@@ -1163,20 +1163,20 @@ paths:
parameters:
- $ref: '#/components/parameters/taskId'
/v2/tasks/{taskId}/eventstream:
get:
operationId: StreamLogsEventStream
description: Get event stream for a task by ID.
responses:
'200':
description: Ok
content:
text/event-stream:
schema:
type: string
parameters:
- $ref: '#/components/parameters/eventsAfter'
- $ref: '#/components/parameters/taskId'
# /v2/tasks/{taskId}/eventstream:
# get:
# operationId: StreamLogsEventStream
# description: Get event stream for a task by ID.
# responses:
# '200':
# description: Ok
# content:
# text/event-stream:
# schema:
# type: string
# parameters:
# - $ref: '#/components/parameters/eventsAfter'
# - $ref: '#/components/parameters/taskId'
/v2/tasks/{taskId}/events:
get:
@@ -118,18 +118,6 @@ export type Scaffold = {
body: ScaffolderScaffoldOptions;
response: Scaffold201Response | Scaffold400Response;
};
/**
* @public
*/
export type StreamLogsEventStream = {
path: {
taskId: string;
};
query: {
after?: number;
};
response: string;
};
/**
* @public
*/
@@ -162,7 +150,5 @@ export type EndpointMap = {
'#post|/v2/tasks': Scaffold;
'#get|/v2/tasks/{taskId}/eventstream': StreamLogsEventStream;
'#get|/v2/tasks/{taskId}/events': StreamLogsPolling;
};
@@ -907,32 +907,6 @@ export const spec = {
],
},
},
'/v2/tasks/{taskId}/eventstream': {
get: {
operationId: 'StreamLogsEventStream',
description: 'Get event stream for a task by ID.',
responses: {
'200': {
description: 'Ok',
content: {
'text/event-stream': {
schema: {
type: 'string',
},
},
},
},
},
parameters: [
{
$ref: '#/components/parameters/eventsAfter',
},
{
$ref: '#/components/parameters/taskId',
},
],
},
},
'/v2/tasks/{taskId}/events': {
get: {
operationId: 'StreamLogsPolling',
@@ -126,17 +126,6 @@ export type Retry = {
export type Scaffold = {
body: ScaffolderScaffoldOptions;
};
/**
* @public
*/
export type StreamLogsEventStream = {
path: {
taskId: string;
};
query: {
after?: number;
};
};
/**
* @public
*/
@@ -407,34 +396,6 @@ export class DefaultApiClient {
});
}
/**
* Get event stream for a task by ID.
* @param taskId -
* @param after - Offset event ID to stream events after.
*/
public async streamLogsEventStream(
// @ts-ignore
request: StreamLogsEventStream,
options?: RequestOptions,
): Promise<TypedResponse<string>> {
const baseUrl = await this.discoveryApi.getBaseUrl(pluginId);
const uriTemplate = `/v2/tasks/{taskId}/eventstream{?after}`;
const uri = parser.parse(uriTemplate).expand({
taskId: request.path.taskId,
...request.query,
});
return await this.fetchApi.fetch(`${baseUrl}${uri}`, {
headers: {
'Content-Type': 'application/json',
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
},
method: 'GET',
});
}
/**
* Get events for a task by ID.
* @param taskId -