File tree Expand file tree Collapse file tree 3 files changed +107
-161
lines changed Expand file tree Collapse file tree 3 files changed +107
-161
lines changed Original file line number Diff line number Diff line change 3636 ],
3737 "license" : " Apache-2.0" ,
3838 "devDependencies" : {
39- "@types/eventsource" : " ^1.1.15" ,
4039 "@types/jest" : " ^29.4.0" ,
4140 "@types/node" : " ^20.14.2" ,
4241 "@types/yargs" : " ^17.0.10" ,
5251 },
5352 "dependencies" : {
5453 "@zodios/core" : " ^10.9.6" ,
55- "eventsource" : " ^2 .0.2 " ,
54+ "eventsource" : " ^3 .0.5 " ,
5655 "zod" : " ^3.23.8"
5756 }
5857}
Original file line number Diff line number Diff line change 1- import EventSource from "eventsource" ;
1+ import { EventSource } from "eventsource" ;
22import { schemas } from "./zodSchemas" ;
33import { z } from "zod" ;
44import { camelToSnakeCaseObject } from "./utils" ;
@@ -152,7 +152,8 @@ export class HermesClient {
152152 }
153153 return await this . httpRequest (
154154 url . toString ( ) ,
155- schemas . LatestPublisherStakeCapsUpdateDataResponse
155+ schemas . LatestPublisherStakeCapsUpdateDataResponse ,
156+ fetchOptions
156157 ) ;
157158 }
158159
@@ -265,7 +266,15 @@ export class HermesClient {
265266 this . appendUrlSearchParams ( url , transformedOptions ) ;
266267 }
267268
268- return new EventSource ( url . toString ( ) , { headers : this . headers } ) ;
269+ return new EventSource ( url . toString ( ) , {
270+ fetch : ( input , init ) => fetch ( input , {
271+ ...init ,
272+ headers : {
273+ ...init ?. headers ,
274+ ...this . headers ,
275+ }
276+ } )
277+ } ) ;
269278 }
270279
271280 /**
You can’t perform that action at this time.
0 commit comments