Skip to content

Commit 69276f0

Browse files
authored
chore(sdk): update @hey-api/openapi-ts to 0.90.4 (anomalyco#8921)
1 parent 3c1dfa6 commit 69276f0

4 files changed

Lines changed: 167 additions & 69 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"dist"
2121
],
2222
"devDependencies": {
23-
"@hey-api/openapi-ts": "0.88.1",
23+
"@hey-api/openapi-ts": "0.90.4",
2424
"@tsconfig/node22": "catalog:",
2525
"@types/node": "catalog:",
2626
"typescript": "catalog:",

src/v2/gen/client/client.gen.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,16 @@ export const createClient = (config: Config = {}): Client => {
162162
case "arrayBuffer":
163163
case "blob":
164164
case "formData":
165-
case "json":
166165
case "text":
167166
data = await response[parseAs]()
168167
break
168+
case "json": {
169+
// Some servers return 200 with no Content-Length and empty body.
170+
// response.json() would throw; read as text and parse if non-empty.
171+
const text = await response.text()
172+
data = text ? JSON.parse(text) : {}
173+
break
174+
}
169175
case "stream":
170176
return opts.responseStyle === "data"
171177
? response.body
@@ -244,6 +250,7 @@ export const createClient = (config: Config = {}): Client => {
244250
}
245251
return request
246252
},
253+
serializedBody: getValidRequestBody(opts) as BodyInit | null | undefined,
247254
url,
248255
})
249256
}

src/v2/gen/core/serverSentEvents.gen.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ export const createSseClient = <TData = unknown>({
151151
const { done, value } = await reader.read()
152152
if (done) break
153153
buffer += value
154+
// Normalize line endings: CRLF -> LF, then CR -> LF
155+
buffer = buffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n")
154156

155157
const chunks = buffer.split("\n\n")
156158
buffer = chunks.pop() ?? ""

src/v2/gen/sdk.gen.ts

Lines changed: 156 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type {
77
AppAgentsResponses,
88
AppLogErrors,
99
AppLogResponses,
10-
Auth as Auth2,
10+
Auth as Auth3,
1111
AuthSetErrors,
1212
AuthSetResponses,
1313
CommandListResponses,
@@ -2023,7 +2023,10 @@ export class Provider extends HeyApiClient {
20232023
})
20242024
}
20252025

2026-
oauth = new Oauth({ client: this.client })
2026+
private _oauth?: Oauth
2027+
get oauth(): Oauth {
2028+
return (this._oauth ??= new Oauth({ client: this.client }))
2029+
}
20272030
}
20282031

20292032
export class Find extends HeyApiClient {
@@ -2398,43 +2401,6 @@ export class Auth extends HeyApiClient {
23982401
},
23992402
)
24002403
}
2401-
2402-
/**
2403-
* Set auth credentials
2404-
*
2405-
* Set authentication credentials
2406-
*/
2407-
public set<ThrowOnError extends boolean = false>(
2408-
parameters: {
2409-
providerID: string
2410-
directory?: string
2411-
auth?: Auth2
2412-
},
2413-
options?: Options<never, ThrowOnError>,
2414-
) {
2415-
const params = buildClientParams(
2416-
[parameters],
2417-
[
2418-
{
2419-
args: [
2420-
{ in: "path", key: "providerID" },
2421-
{ in: "query", key: "directory" },
2422-
{ key: "auth", map: "body" },
2423-
],
2424-
},
2425-
],
2426-
)
2427-
return (options?.client ?? this.client).put<AuthSetResponses, AuthSetErrors, ThrowOnError>({
2428-
url: "/auth/{providerID}",
2429-
...options,
2430-
...params,
2431-
headers: {
2432-
"Content-Type": "application/json",
2433-
...options?.headers,
2434-
...params.headers,
2435-
},
2436-
})
2437-
}
24382404
}
24392405

24402406
export class Mcp extends HeyApiClient {
@@ -2550,7 +2516,10 @@ export class Mcp extends HeyApiClient {
25502516
})
25512517
}
25522518

2553-
auth = new Auth({ client: this.client })
2519+
private _auth?: Auth
2520+
get auth(): Auth {
2521+
return (this._auth ??= new Auth({ client: this.client }))
2522+
}
25542523
}
25552524

25562525
export class Resource extends HeyApiClient {
@@ -2575,7 +2544,10 @@ export class Resource extends HeyApiClient {
25752544
}
25762545

25772546
export class Experimental extends HeyApiClient {
2578-
resource = new Resource({ client: this.client })
2547+
private _resource?: Resource
2548+
get resource(): Resource {
2549+
return (this._resource ??= new Resource({ client: this.client }))
2550+
}
25792551
}
25802552

25812553
export class Lsp extends HeyApiClient {
@@ -2952,7 +2924,49 @@ export class Tui extends HeyApiClient {
29522924
})
29532925
}
29542926

2955-
control = new Control({ client: this.client })
2927+
private _control?: Control
2928+
get control(): Control {
2929+
return (this._control ??= new Control({ client: this.client }))
2930+
}
2931+
}
2932+
2933+
export class Auth2 extends HeyApiClient {
2934+
/**
2935+
* Set auth credentials
2936+
*
2937+
* Set authentication credentials
2938+
*/
2939+
public set<ThrowOnError extends boolean = false>(
2940+
parameters: {
2941+
providerID: string
2942+
directory?: string
2943+
auth?: Auth3
2944+
},
2945+
options?: Options<never, ThrowOnError>,
2946+
) {
2947+
const params = buildClientParams(
2948+
[parameters],
2949+
[
2950+
{
2951+
args: [
2952+
{ in: "path", key: "providerID" },
2953+
{ in: "query", key: "directory" },
2954+
{ key: "auth", map: "body" },
2955+
],
2956+
},
2957+
],
2958+
)
2959+
return (options?.client ?? this.client).put<AuthSetResponses, AuthSetErrors, ThrowOnError>({
2960+
url: "/auth/{providerID}",
2961+
...options,
2962+
...params,
2963+
headers: {
2964+
"Content-Type": "application/json",
2965+
...options?.headers,
2966+
...params.headers,
2967+
},
2968+
})
2969+
}
29562970
}
29572971

29582972
export class Event extends HeyApiClient {
@@ -2984,53 +2998,128 @@ export class OpencodeClient extends HeyApiClient {
29842998
OpencodeClient.__registry.set(this, args?.key)
29852999
}
29863000

2987-
global = new Global({ client: this.client })
3001+
private _global?: Global
3002+
get global(): Global {
3003+
return (this._global ??= new Global({ client: this.client }))
3004+
}
29883005

2989-
project = new Project({ client: this.client })
3006+
private _project?: Project
3007+
get project(): Project {
3008+
return (this._project ??= new Project({ client: this.client }))
3009+
}
29903010

2991-
pty = new Pty({ client: this.client })
3011+
private _pty?: Pty
3012+
get pty(): Pty {
3013+
return (this._pty ??= new Pty({ client: this.client }))
3014+
}
29923015

2993-
config = new Config({ client: this.client })
3016+
private _config?: Config
3017+
get config(): Config {
3018+
return (this._config ??= new Config({ client: this.client }))
3019+
}
29943020

2995-
tool = new Tool({ client: this.client })
3021+
private _tool?: Tool
3022+
get tool(): Tool {
3023+
return (this._tool ??= new Tool({ client: this.client }))
3024+
}
29963025

2997-
instance = new Instance({ client: this.client })
3026+
private _instance?: Instance
3027+
get instance(): Instance {
3028+
return (this._instance ??= new Instance({ client: this.client }))
3029+
}
29983030

2999-
path = new Path({ client: this.client })
3031+
private _path?: Path
3032+
get path(): Path {
3033+
return (this._path ??= new Path({ client: this.client }))
3034+
}
30003035

3001-
worktree = new Worktree({ client: this.client })
3036+
private _worktree?: Worktree
3037+
get worktree(): Worktree {
3038+
return (this._worktree ??= new Worktree({ client: this.client }))
3039+
}
30023040

3003-
vcs = new Vcs({ client: this.client })
3041+
private _vcs?: Vcs
3042+
get vcs(): Vcs {
3043+
return (this._vcs ??= new Vcs({ client: this.client }))
3044+
}
30043045

3005-
session = new Session({ client: this.client })
3046+
private _session?: Session
3047+
get session(): Session {
3048+
return (this._session ??= new Session({ client: this.client }))
3049+
}
30063050

3007-
part = new Part({ client: this.client })
3051+
private _part?: Part
3052+
get part(): Part {
3053+
return (this._part ??= new Part({ client: this.client }))
3054+
}
30083055

3009-
permission = new Permission({ client: this.client })
3056+
private _permission?: Permission
3057+
get permission(): Permission {
3058+
return (this._permission ??= new Permission({ client: this.client }))
3059+
}
30103060

3011-
question = new Question({ client: this.client })
3061+
private _question?: Question
3062+
get question(): Question {
3063+
return (this._question ??= new Question({ client: this.client }))
3064+
}
30123065

3013-
command = new Command({ client: this.client })
3066+
private _command?: Command
3067+
get command(): Command {
3068+
return (this._command ??= new Command({ client: this.client }))
3069+
}
30143070

3015-
provider = new Provider({ client: this.client })
3071+
private _provider?: Provider
3072+
get provider(): Provider {
3073+
return (this._provider ??= new Provider({ client: this.client }))
3074+
}
30163075

3017-
find = new Find({ client: this.client })
3076+
private _find?: Find
3077+
get find(): Find {
3078+
return (this._find ??= new Find({ client: this.client }))
3079+
}
30183080

3019-
file = new File({ client: this.client })
3081+
private _file?: File
3082+
get file(): File {
3083+
return (this._file ??= new File({ client: this.client }))
3084+
}
30203085

3021-
app = new App({ client: this.client })
3086+
private _app?: App
3087+
get app(): App {
3088+
return (this._app ??= new App({ client: this.client }))
3089+
}
30223090

3023-
mcp = new Mcp({ client: this.client })
3091+
private _mcp?: Mcp
3092+
get mcp(): Mcp {
3093+
return (this._mcp ??= new Mcp({ client: this.client }))
3094+
}
30243095

3025-
experimental = new Experimental({ client: this.client })
3096+
private _experimental?: Experimental
3097+
get experimental(): Experimental {
3098+
return (this._experimental ??= new Experimental({ client: this.client }))
3099+
}
30263100

3027-
lsp = new Lsp({ client: this.client })
3101+
private _lsp?: Lsp
3102+
get lsp(): Lsp {
3103+
return (this._lsp ??= new Lsp({ client: this.client }))
3104+
}
30283105

3029-
formatter = new Formatter({ client: this.client })
3106+
private _formatter?: Formatter
3107+
get formatter(): Formatter {
3108+
return (this._formatter ??= new Formatter({ client: this.client }))
3109+
}
30303110

3031-
tui = new Tui({ client: this.client })
3111+
private _tui?: Tui
3112+
get tui(): Tui {
3113+
return (this._tui ??= new Tui({ client: this.client }))
3114+
}
30323115

3033-
auth = new Auth({ client: this.client })
3116+
private _auth?: Auth2
3117+
get auth(): Auth2 {
3118+
return (this._auth ??= new Auth2({ client: this.client }))
3119+
}
30343120

3035-
event = new Event({ client: this.client })
3121+
private _event?: Event
3122+
get event(): Event {
3123+
return (this._event ??= new Event({ client: this.client }))
3124+
}
30363125
}

0 commit comments

Comments
 (0)