diff options
| author | Tommy D. Rossi <[email protected]> | 2025-12-20 16:00:20 +0100 |
|---|---|---|
| committer | opencode <[email protected]> | 2025-12-20 15:00:41 +0000 |
| commit | a7a2bbb497f9c8775bc93cbfd9c2964fe3472d79 (patch) | |
| tree | a9ccab518932c17d38172c05b5de5581c20d3a6b /packages/sdk/js/src | |
| parent | 6e93d14bdba29015ed8fe617bcc26d459c33a5b2 (diff) | |
| download | opencode-a7a2bbb497f9c8775bc93cbfd9c2964fe3472d79.tar.gz opencode-a7a2bbb497f9c8775bc93cbfd9c2964fe3472d79.zip | |
feat: add endpoints to delete and update message parts (#5433)
Diffstat (limited to 'packages/sdk/js/src')
| -rw-r--r-- | packages/sdk/js/src/v2/gen/sdk.gen.ts | 80 | ||||
| -rw-r--r-- | packages/sdk/js/src/v2/gen/types.gen.ts | 88 |
2 files changed, 168 insertions, 0 deletions
diff --git a/packages/sdk/js/src/v2/gen/sdk.gen.ts b/packages/sdk/js/src/v2/gen/sdk.gen.ts index 16fe07ae4..1a7128e24 100644 --- a/packages/sdk/js/src/v2/gen/sdk.gen.ts +++ b/packages/sdk/js/src/v2/gen/sdk.gen.ts @@ -47,6 +47,11 @@ import type { McpLocalConfig, McpRemoteConfig, McpStatusResponses, + Part as Part2, + PartDeleteErrors, + PartDeleteResponses, + PartUpdateErrors, + PartUpdateResponses, PathGetResponses, PermissionRespondErrors, PermissionRespondResponses, @@ -1486,6 +1491,79 @@ export class Session extends HeyApiClient { } } +export class Part extends HeyApiClient { + /** + * Delete a part from a message + */ + public delete<ThrowOnError extends boolean = false>( + parameters: { + sessionID: string + messageID: string + partID: string + directory?: string + }, + options?: Options<never, ThrowOnError>, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "path", key: "sessionID" }, + { in: "path", key: "messageID" }, + { in: "path", key: "partID" }, + { in: "query", key: "directory" }, + ], + }, + ], + ) + return (options?.client ?? this.client).delete<PartDeleteResponses, PartDeleteErrors, ThrowOnError>({ + url: "/session/{sessionID}/message/{messageID}/part/{partID}", + ...options, + ...params, + }) + } + + /** + * Update a part in a message + */ + public update<ThrowOnError extends boolean = false>( + parameters: { + sessionID: string + messageID: string + partID: string + directory?: string + part?: Part2 + }, + options?: Options<never, ThrowOnError>, + ) { + const params = buildClientParams( + [parameters], + [ + { + args: [ + { in: "path", key: "sessionID" }, + { in: "path", key: "messageID" }, + { in: "path", key: "partID" }, + { in: "query", key: "directory" }, + { key: "part", map: "body" }, + ], + }, + ], + ) + return (options?.client ?? this.client).patch<PartUpdateResponses, PartUpdateErrors, ThrowOnError>({ + url: "/session/{sessionID}/message/{messageID}/part/{partID}", + ...options, + ...params, + headers: { + "Content-Type": "application/json", + ...options?.headers, + ...params.headers, + }, + }) + } +} + export class Permission extends HeyApiClient { /** * Respond to permission @@ -2588,6 +2666,8 @@ export class OpencodeClient extends HeyApiClient { session = new Session({ client: this.client }) + part = new Part({ client: this.client }) + permission = new Permission({ client: this.client }) command = new Command({ client: this.client }) diff --git a/packages/sdk/js/src/v2/gen/types.gen.ts b/packages/sdk/js/src/v2/gen/types.gen.ts index c96530737..cdbdfdfda 100644 --- a/packages/sdk/js/src/v2/gen/types.gen.ts +++ b/packages/sdk/js/src/v2/gen/types.gen.ts @@ -2915,6 +2915,94 @@ export type SessionMessageResponses = { export type SessionMessageResponse = SessionMessageResponses[keyof SessionMessageResponses] +export type PartDeleteData = { + body?: never + path: { + /** + * Session ID + */ + sessionID: string + /** + * Message ID + */ + messageID: string + /** + * Part ID + */ + partID: string + } + query?: { + directory?: string + } + url: "/session/{sessionID}/message/{messageID}/part/{partID}" +} + +export type PartDeleteErrors = { + /** + * Bad request + */ + 400: BadRequestError + /** + * Not found + */ + 404: NotFoundError +} + +export type PartDeleteError = PartDeleteErrors[keyof PartDeleteErrors] + +export type PartDeleteResponses = { + /** + * Successfully deleted part + */ + 200: boolean +} + +export type PartDeleteResponse = PartDeleteResponses[keyof PartDeleteResponses] + +export type PartUpdateData = { + body?: Part + path: { + /** + * Session ID + */ + sessionID: string + /** + * Message ID + */ + messageID: string + /** + * Part ID + */ + partID: string + } + query?: { + directory?: string + } + url: "/session/{sessionID}/message/{messageID}/part/{partID}" +} + +export type PartUpdateErrors = { + /** + * Bad request + */ + 400: BadRequestError + /** + * Not found + */ + 404: NotFoundError +} + +export type PartUpdateError = PartUpdateErrors[keyof PartUpdateErrors] + +export type PartUpdateResponses = { + /** + * Successfully updated part + */ + 200: Part +} + +export type PartUpdateResponse = PartUpdateResponses[keyof PartUpdateResponses] + export type SessionPromptAsyncData = { body?: { messageID?: string |
