File tree Expand file tree Collapse file tree 3 files changed +108
-161
lines changed Expand file tree Collapse file tree 3 files changed +108
-161
lines changed Original file line number Diff line number Diff line change 36
36
],
37
37
"license" : " Apache-2.0" ,
38
38
"devDependencies" : {
39
- "@types/eventsource" : " ^1.1.15" ,
40
39
"@types/jest" : " ^29.4.0" ,
41
40
"@types/node" : " ^20.14.2" ,
42
41
"@types/yargs" : " ^17.0.10" ,
52
51
},
53
52
"dependencies" : {
54
53
"@zodios/core" : " ^10.9.6" ,
55
- "eventsource" : " ^2 .0.2 " ,
54
+ "eventsource" : " ^3 .0.5 " ,
56
55
"zod" : " ^3.23.8"
57
56
}
58
57
}
Original file line number Diff line number Diff line change 1
- import EventSource from "eventsource" ;
1
+ import { EventSource } from "eventsource" ;
2
2
import { schemas } from "./zodSchemas" ;
3
3
import { z } from "zod" ;
4
4
import { camelToSnakeCaseObject } from "./utils" ;
@@ -152,7 +152,8 @@ export class HermesClient {
152
152
}
153
153
return await this . httpRequest (
154
154
url . toString ( ) ,
155
- schemas . LatestPublisherStakeCapsUpdateDataResponse
155
+ schemas . LatestPublisherStakeCapsUpdateDataResponse ,
156
+ fetchOptions
156
157
) ;
157
158
}
158
159
@@ -265,7 +266,16 @@ export class HermesClient {
265
266
this . appendUrlSearchParams ( url , transformedOptions ) ;
266
267
}
267
268
268
- return new EventSource ( url . toString ( ) , { headers : this . headers } ) ;
269
+ return new EventSource ( url . toString ( ) , {
270
+ fetch : ( input , init ) =>
271
+ fetch ( input , {
272
+ ...init ,
273
+ headers : {
274
+ ...init ?. headers ,
275
+ ...this . headers ,
276
+ } ,
277
+ } ) ,
278
+ } ) ;
269
279
}
270
280
271
281
/**
You can’t perform that action at this time.
0 commit comments