feat(tui): support session deletion
This commit is contained in:
@@ -416,6 +416,8 @@ import type {
|
||||
V2SessionQuestionRejectResponses,
|
||||
V2SessionQuestionReplyErrors,
|
||||
V2SessionQuestionReplyResponses,
|
||||
V2SessionRemoveErrors,
|
||||
V2SessionRemoveResponses,
|
||||
V2SessionRenameErrors,
|
||||
V2SessionRenameResponses,
|
||||
V2SessionRevertClearErrors,
|
||||
@@ -5905,6 +5907,25 @@ export class Session3 extends HeyApiClient {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete session
|
||||
*
|
||||
* Delete a session and its child sessions.
|
||||
*/
|
||||
public remove<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
sessionID: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "sessionID" }] }])
|
||||
return (options?.client ?? this.client).delete<V2SessionRemoveResponses, V2SessionRemoveErrors, ThrowOnError>({
|
||||
url: "/api/session/{sessionID}",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get session
|
||||
*
|
||||
|
||||
@@ -824,7 +824,6 @@ export type GlobalEvent = {
|
||||
type: "session.deleted"
|
||||
properties: {
|
||||
sessionID: string
|
||||
info: Session
|
||||
}
|
||||
}
|
||||
| {
|
||||
@@ -2914,6 +2913,7 @@ export type SessionDurableEvent =
|
||||
| SessionModelSelected
|
||||
| SessionMoved
|
||||
| SessionRenamed
|
||||
| SessionDeleted
|
||||
| SessionForked
|
||||
| SessionPromptPromoted
|
||||
| SessionPromptAdmitted
|
||||
@@ -3576,13 +3576,12 @@ export type SyncEventSessionDeleted = {
|
||||
type: "sync"
|
||||
id: string
|
||||
syncEvent: {
|
||||
type: "session.deleted.1"
|
||||
type: "session.deleted.2"
|
||||
id: string
|
||||
seq: number
|
||||
aggregateID: string
|
||||
data: {
|
||||
sessionID: string
|
||||
info: Session
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4698,6 +4697,24 @@ export type SessionRenamed = {
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionDeleted = {
|
||||
id: string
|
||||
created: number
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
type: "session.deleted"
|
||||
durable: {
|
||||
aggregateID: string
|
||||
seq: number
|
||||
version: number
|
||||
}
|
||||
location?: LocationRef
|
||||
data: {
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionForked = {
|
||||
id: string
|
||||
created: number
|
||||
@@ -5761,25 +5778,6 @@ export type SessionUpdated = {
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionDeleted = {
|
||||
id: string
|
||||
created: number
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
type: "session.deleted"
|
||||
durable: {
|
||||
aggregateID: string
|
||||
seq: number
|
||||
version: number
|
||||
}
|
||||
location?: LocationRef
|
||||
data: {
|
||||
sessionID: string
|
||||
info: Session
|
||||
}
|
||||
}
|
||||
|
||||
export type MessageUpdated = {
|
||||
id: string
|
||||
created: number
|
||||
@@ -6835,7 +6833,6 @@ export type EventSessionDeleted = {
|
||||
type: "session.deleted"
|
||||
properties: {
|
||||
sessionID: string
|
||||
info: Session
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8403,7 +8400,7 @@ export type V2EventV2 =
|
||||
| AgentUpdatedV2
|
||||
| SessionCreatedV2
|
||||
| SessionUpdatedV2
|
||||
| SessionDeletedV2
|
||||
| SessionDeleted1
|
||||
| MessageUpdatedV2
|
||||
| MessageRemovedV2
|
||||
| MessagePartUpdatedV2
|
||||
@@ -8412,6 +8409,7 @@ export type V2EventV2 =
|
||||
| SessionModelSelectedV2
|
||||
| SessionMovedV2
|
||||
| SessionRenamedV2
|
||||
| SessionDeletedV2
|
||||
| SessionForkedV2
|
||||
| SessionPromptPromotedV2
|
||||
| SessionPromptAdmittedV2
|
||||
@@ -8817,6 +8815,24 @@ export type SessionRenamedV2 = {
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionDeletedV2 = {
|
||||
id: string
|
||||
created: number
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
type: "session.deleted"
|
||||
durable: {
|
||||
aggregateID: string
|
||||
seq: number
|
||||
version: number
|
||||
}
|
||||
location?: LocationRefV2
|
||||
data: {
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionForkedV2 = {
|
||||
id: string
|
||||
created: number
|
||||
@@ -9718,7 +9734,7 @@ export type SessionUpdatedV2 = {
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionDeletedV2 = {
|
||||
export type SessionDeleted1 = {
|
||||
id: string
|
||||
created: number
|
||||
metadata?: {
|
||||
@@ -14968,6 +14984,41 @@ export type V2SessionActiveResponses = {
|
||||
|
||||
export type V2SessionActiveResponse = V2SessionActiveResponses[keyof V2SessionActiveResponses]
|
||||
|
||||
export type V2SessionRemoveData = {
|
||||
body?: never
|
||||
path: {
|
||||
sessionID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/api/session/{sessionID}"
|
||||
}
|
||||
|
||||
export type V2SessionRemoveErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
400: InvalidRequestErrorV2
|
||||
/**
|
||||
* UnauthorizedError
|
||||
*/
|
||||
401: UnauthorizedError
|
||||
/**
|
||||
* SessionNotFoundError
|
||||
*/
|
||||
404: SessionNotFoundError
|
||||
}
|
||||
|
||||
export type V2SessionRemoveError = V2SessionRemoveErrors[keyof V2SessionRemoveErrors]
|
||||
|
||||
export type V2SessionRemoveResponses = {
|
||||
/**
|
||||
* <No Content>
|
||||
*/
|
||||
204: void
|
||||
}
|
||||
|
||||
export type V2SessionRemoveResponse = V2SessionRemoveResponses[keyof V2SessionRemoveResponses]
|
||||
|
||||
export type V2SessionGetData = {
|
||||
body?: never
|
||||
path: {
|
||||
|
||||
Reference in New Issue
Block a user