feat(core): add message delete endpoint (#14417)
This commit is contained in:
@@ -107,6 +107,8 @@ import type {
|
||||
SessionCreateErrors,
|
||||
SessionCreateResponses,
|
||||
SessionDeleteErrors,
|
||||
SessionDeleteMessageErrors,
|
||||
SessionDeleteMessageResponses,
|
||||
SessionDeleteResponses,
|
||||
SessionDiffResponses,
|
||||
SessionForkResponses,
|
||||
@@ -1561,6 +1563,42 @@ export class Session2 extends HeyApiClient {
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete message
|
||||
*
|
||||
* Permanently delete a specific message (and all of its parts) from a session. This does not revert any file changes that may have been made while processing the message.
|
||||
*/
|
||||
public deleteMessage<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
sessionID: string
|
||||
messageID: string
|
||||
directory?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "sessionID" },
|
||||
{ in: "path", key: "messageID" },
|
||||
{ in: "query", key: "directory" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).delete<
|
||||
SessionDeleteMessageResponses,
|
||||
SessionDeleteMessageErrors,
|
||||
ThrowOnError
|
||||
>({
|
||||
url: "/session/{sessionID}/message/{messageID}",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get message
|
||||
*
|
||||
|
||||
@@ -3564,6 +3564,46 @@ export type SessionPromptResponses = {
|
||||
|
||||
export type SessionPromptResponse = SessionPromptResponses[keyof SessionPromptResponses]
|
||||
|
||||
export type SessionDeleteMessageData = {
|
||||
body?: never
|
||||
path: {
|
||||
/**
|
||||
* Session ID
|
||||
*/
|
||||
sessionID: string
|
||||
/**
|
||||
* Message ID
|
||||
*/
|
||||
messageID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/session/{sessionID}/message/{messageID}"
|
||||
}
|
||||
|
||||
export type SessionDeleteMessageErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
/**
|
||||
* Not found
|
||||
*/
|
||||
404: NotFoundError
|
||||
}
|
||||
|
||||
export type SessionDeleteMessageError = SessionDeleteMessageErrors[keyof SessionDeleteMessageErrors]
|
||||
|
||||
export type SessionDeleteMessageResponses = {
|
||||
/**
|
||||
* Successfully deleted message
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type SessionDeleteMessageResponse = SessionDeleteMessageResponses[keyof SessionDeleteMessageResponses]
|
||||
|
||||
export type SessionMessageData = {
|
||||
body?: never
|
||||
path: {
|
||||
|
||||
Reference in New Issue
Block a user