11import { APIDefinitions } from "./definition.ts" ;
2+ import * as Http from "./http" ;
23
34type APIProject = {
45 owner : { handle : string } ;
@@ -85,7 +86,7 @@ const ShareAPI = {
8586 getProfile : async ( handle : string ) : Promise < APIProfile > => {
8687 const url = `${ ShareAPI . baseURL } /users/${ apiHandle ( handle ) } ` ;
8788
88- return fetch ( url ) . then ( async ( resp ) => {
89+ return Http . get ( url ) . then ( async ( resp ) => {
8990 if ( ! resp . ok ) {
9091 throw await error ( url , resp ) ;
9192 }
@@ -100,7 +101,7 @@ const ShareAPI = {
100101 ) : Promise < APIProject > => {
101102 const url = ShareAPI . projectBaseUrl ( handle , projectSlug ) ;
102103
103- return fetch ( url ) . then ( async ( resp ) => {
104+ return Http . get ( url ) . then ( async ( resp ) => {
104105 if ( ! resp . ok ) {
105106 throw await error ( url , resp ) ;
106107 }
@@ -119,7 +120,7 @@ const ShareAPI = {
119120 projectSlug ,
120121 `/contributions/${ contribRef } ` ,
121122 ) ;
122- return fetch ( url ) . then ( async ( resp ) => {
123+ return Http . get ( url ) . then ( async ( resp ) => {
123124 if ( ! resp . ok ) {
124125 throw await error ( url , resp ) ;
125126 }
@@ -138,7 +139,7 @@ const ShareAPI = {
138139 projectSlug ,
139140 `/tickets/${ ticketRef } ` ,
140141 ) ;
141- return fetch ( url ) . then ( async ( resp ) => {
142+ return Http . get ( url ) . then ( async ( resp ) => {
142143 if ( ! resp . ok ) {
143144 throw await error ( url , resp ) ;
144145 }
@@ -158,7 +159,7 @@ const ShareAPI = {
158159 `/releases/${ version } ` ,
159160 ) ;
160161
161- return fetch ( url ) . then ( async ( resp ) => {
162+ return Http . get ( url ) . then ( async ( resp ) => {
162163 if ( ! resp . ok ) {
163164 throw await error ( url , resp ) ;
164165 }
@@ -186,7 +187,7 @@ const ShareAPI = {
186187 url = mkUrl ( branchRef ) ;
187188 }
188189
189- return fetch ( url ) . then ( async ( resp ) => {
190+ return Http . get ( url ) . then ( async ( resp ) => {
190191 if ( ! resp . ok ) {
191192 throw await error ( url , resp ) ;
192193 }
0 commit comments