refactor(client): simplify local service lifecycle
This commit is contained in:
parent
4f1298063b
commit
75bc611ef1
51 changed files with 635 additions and 534 deletions
|
|
@ -179,7 +179,7 @@ import type {
|
|||
QuestionReplyErrors,
|
||||
QuestionReplyResponses,
|
||||
QuestionV2Reply,
|
||||
ServiceStopRequestV2,
|
||||
ServiceStopRequest,
|
||||
SessionAbortErrors,
|
||||
SessionAbortResponses,
|
||||
SessionChildrenErrors,
|
||||
|
|
@ -5091,11 +5091,11 @@ export class Health extends HeyApiClient {
|
|||
*/
|
||||
public stop<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
serviceStopRequestV2: ServiceStopRequestV2
|
||||
serviceStopRequest: ServiceStopRequest
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams([parameters], [{ args: [{ key: "serviceStopRequestV2", map: "body" }] }])
|
||||
const params = buildClientParams([parameters], [{ args: [{ key: "serviceStopRequest", map: "body" }] }])
|
||||
return (options?.client ?? this.client).post<V2HealthStopResponses, V2HealthStopErrors, ThrowOnError>({
|
||||
url: "/api/service/stop",
|
||||
...options,
|
||||
|
|
|
|||
|
|
@ -2795,29 +2795,10 @@ export type WorkspaceWarpError = {
|
|||
}
|
||||
}
|
||||
|
||||
export type ServiceStatus =
|
||||
| {
|
||||
type: "starting"
|
||||
}
|
||||
| {
|
||||
type: "ready"
|
||||
}
|
||||
| {
|
||||
type: "stopping"
|
||||
targetVersion?: string
|
||||
}
|
||||
| {
|
||||
type: "failed"
|
||||
message: string
|
||||
action: string
|
||||
}
|
||||
|
||||
export type ServiceHealth = {
|
||||
healthy: true
|
||||
version: string
|
||||
pid: number
|
||||
instanceID?: string
|
||||
status?: ServiceStatus
|
||||
}
|
||||
|
||||
export type UnauthorizedError = {
|
||||
|
|
@ -2827,7 +2808,6 @@ export type UnauthorizedError = {
|
|||
|
||||
export type ServiceStopRequest = {
|
||||
instanceID: string
|
||||
targetVersion?: string
|
||||
}
|
||||
|
||||
export type ServiceStopResponse = {
|
||||
|
|
@ -8141,29 +8121,10 @@ export type BadRequestError = {
|
|||
}
|
||||
}
|
||||
|
||||
export type ServiceStatusV2 =
|
||||
| {
|
||||
type: "starting"
|
||||
}
|
||||
| {
|
||||
type: "ready"
|
||||
}
|
||||
| {
|
||||
type: "stopping"
|
||||
targetVersion?: string | null
|
||||
}
|
||||
| {
|
||||
type: "failed"
|
||||
message: string
|
||||
action: string
|
||||
}
|
||||
|
||||
export type ServiceHealthV2 = {
|
||||
healthy: true
|
||||
version: string
|
||||
pid: number
|
||||
instanceID?: string | null
|
||||
status?: ServiceStatusV2
|
||||
}
|
||||
|
||||
export type InvalidRequestErrorV2 = {
|
||||
|
|
@ -8173,11 +8134,6 @@ export type InvalidRequestErrorV2 = {
|
|||
field?: string | null
|
||||
}
|
||||
|
||||
export type ServiceStopRequestV2 = {
|
||||
instanceID: string
|
||||
targetVersion?: string | null
|
||||
}
|
||||
|
||||
export type SessionsResponseV2 = {
|
||||
data: Array<SessionInfoV2>
|
||||
cursor: {
|
||||
|
|
@ -15183,7 +15139,7 @@ export type V2HealthGetResponses = {
|
|||
export type V2HealthGetResponse = V2HealthGetResponses[keyof V2HealthGetResponses]
|
||||
|
||||
export type V2HealthStopData = {
|
||||
body: ServiceStopRequestV2
|
||||
body: ServiceStopRequest
|
||||
path?: never
|
||||
query?: never
|
||||
url: "/api/service/stop"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue