File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8888 "suiteNameTemplate" : " {filepath}" ,
8989 "classNameTemplate" : " {classname}" ,
9090 "titleTemplate" : " {title}"
91+ },
92+ "dependencies" : {
93+ "undici" : " ^7.16.0"
9194 }
92- }
95+ }
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ export const orkesConductorClient = async (
1616 CustomHttpRequest : HttpRequestConstructor = OrkesHttpRequest
1717) => {
1818 const serverUrl = process . env . CONDUCTOR_SERVER_URL || config ?. serverUrl ;
19+
20+ if ( ! serverUrl ) throw new Error ( "Conductor server URL is not set" ) ;
21+
1922 const keyId = process . env . CONDUCTOR_AUTH_KEY || config ?. keyId ;
2023 const keySecret = process . env . CONDUCTOR_AUTH_SECRET || config ?. keySecret ;
2124
Original file line number Diff line number Diff line change @@ -4,14 +4,34 @@ import {
44 CancelablePromise ,
55 OpenAPIConfig ,
66} from "../../common" ;
7+ import { FetchFn } from "../types" ;
78import { orkesRequest } from "./request" ;
9+ import {
10+ fetch as undiciFetch ,
11+ Agent as UndiciAgent ,
12+ RequestInfo as UndiciRequestInfo ,
13+ RequestInit as UndiciRequestInit ,
14+ } from "undici" ;
815
916export class OrkesHttpRequest extends BaseHttpRequest {
17+ private fetchFn : FetchFn ;
18+
1019 constructor ( config : OpenAPIConfig ) {
1120 super ( config ) ;
21+ const undiciHttp2Agent = new UndiciAgent ( { allowH2 : true } ) ;
22+ const undiciHttp2Fetch = async (
23+ input : UndiciRequestInfo ,
24+ init : UndiciRequestInit = { }
25+ ) => {
26+ return undiciFetch ( input , {
27+ ...init ,
28+ dispatcher : undiciHttp2Agent ,
29+ } ) ;
30+ } ;
31+ this . fetchFn = undiciHttp2Fetch as FetchFn ;
1232 }
1333
1434 public request < T > ( options : ApiRequestOptions ) : CancelablePromise < T > {
15- return orkesRequest ( this . config , options ) ;
35+ return orkesRequest ( this . config , options , this . fetchFn ) ;
1636 }
1737}
Original file line number Diff line number Diff line change @@ -3445,6 +3445,11 @@ undici-types@~6.21.0:
34453445 resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz"
34463446 integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==
34473447
3448+ undici@^7.16.0 :
3449+ version "7.16.0"
3450+ resolved "https://registry.yarnpkg.com/undici/-/undici-7.16.0.tgz#cb2a1e957726d458b536e3f076bf51f066901c1a"
3451+ integrity sha512-QEg3HPMll0o3t2ourKwOeUAZ159Kn9mx5pnzHRQO8+Wixmh88YdZRiIwat0iNzNNXn0yoEtXJqFpyW7eM8BV7g==
3452+
34483453update-browserslist-db@^1.1.3 :
34493454 version "1.1.3"
34503455 resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.3.tgz"
You can’t perform that action at this time.
0 commit comments