File tree Expand file tree Collapse file tree
packages/tool-registry-publish/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 shouldPublishTarball ,
1010 sha512Integrity ,
1111 type ApiCall ,
12+ type FetchTarballPut ,
1213} from "./publish" ;
1314import { tarballsCoverRequiredSeedPackages } from "./registry" ;
1415
@@ -143,7 +144,7 @@ describe("publishCorbitsToolsRegistry", () => {
143144 status : 200 ,
144145 headers : { "Content-Type" : "application/json" } ,
145146 } ,
146- ) ) as typeof fetch ,
147+ ) ) satisfies FetchTarballPut ,
147148 } ) ;
148149 throw new Error ( "expected EmptyRegistryPublishError" ) ;
149150 } catch ( cause ) {
Original file line number Diff line number Diff line change @@ -275,13 +275,18 @@ export async function isCorbitsToolsRegistrySeeded(
275275 ) ;
276276}
277277
278+ export type FetchTarballPut = (
279+ input : string ,
280+ init : RequestInit ,
281+ ) => Promise < Response > ;
282+
278283async function putTarball (
279284 hubUrl : string ,
280285 cookies : string [ ] ,
281286 tenantId : string ,
282287 assetId : string ,
283288 tarball : PackedTarball ,
284- fetchImpl : typeof fetch ,
289+ fetchImpl : FetchTarballPut ,
285290) : Promise < PublishSummary > {
286291 const headers : Record < string , string > = {
287292 "Content-Type" : "application/octet-stream" ,
@@ -315,7 +320,7 @@ export type PublishCorbitsToolsRegistryArgs = {
315320 cookies : string [ ] ;
316321 hubUrl : string ;
317322 tenantId : string ;
318- fetchImpl ?: typeof fetch ;
323+ fetchImpl ?: FetchTarballPut ;
319324 log ?: ( line : string ) => void ;
320325 /** Test seam. Production omits this and runs `checkToolPackageFreshness`. */
321326 checkFreshness ?: ( ) => Promise < void > ;
You can’t perform that action at this time.
0 commit comments