2020//
2121
2222import type {
23+ ParseOptions ,
2324 SolidDataset ,
2425 UrlString ,
2526 WebId ,
@@ -90,11 +91,14 @@ export async function getProfileAll<
9091 options ?: {
9192 fetch ?: typeof fetch ;
9293 webIdProfile ?: T ;
93- } ,
94+ } & Partial < ParseOptions > ,
9495) : Promise < ProfileAll < T > > ;
9596export async function getProfileAll (
9697 webId : WebId ,
97- options ?: { fetch ?: typeof fetch ; webIdProfile : undefined } ,
98+ options ?: {
99+ fetch ?: typeof fetch ;
100+ webIdProfile : undefined ;
101+ } & Partial < ParseOptions > ,
98102) : Promise < ProfileAll < SolidDataset & WithServerResourceInfo > > ;
99103export async function getProfileAll <
100104 T extends SolidDataset & WithServerResourceInfo ,
@@ -103,17 +107,19 @@ export async function getProfileAll<
103107 options ?: {
104108 fetch ?: typeof fetch ;
105109 webIdProfile ?: T ;
106- } ,
110+ } & Partial < ParseOptions > ,
107111) : Promise < ProfileAll < T | ( SolidDataset & WithServerResourceInfo ) > > {
108- const authFetch = options ?. fetch ?? fetch ;
112+ const unauthenticatedOptions = Object . assign ( { } , options ) ;
113+ delete unauthenticatedOptions [ "fetch" ] ;
114+
109115 const webIdProfile =
110116 options ?. webIdProfile ??
111117 // This should always use an unauthenticated fetch.
112- ( await getSolidDataset ( webId ) ) ;
118+ ( await getSolidDataset ( webId , unauthenticatedOptions ) ) ;
113119 const altProfileAll = (
114120 await Promise . allSettled (
115121 getAltProfileUrlAllFrom ( webId , webIdProfile ) . map ( ( uniqueProfileIri ) =>
116- getSolidDataset ( uniqueProfileIri , { fetch : authFetch } ) ,
122+ getSolidDataset ( uniqueProfileIri , options ) ,
117123 ) ,
118124 )
119125 )
@@ -147,7 +153,7 @@ export async function getProfileAll<
147153 */
148154export async function getPodUrlAll (
149155 webId : WebId ,
150- options ?: { fetch ?: typeof fetch } ,
156+ options ?: { fetch ?: typeof fetch } & Partial < ParseOptions > ,
151157) : Promise < UrlString [ ] > {
152158 const profiles = await getProfileAll ( webId , options ) ;
153159 return getPodUrlAllFrom ( profiles , webId ) ;
@@ -201,6 +207,7 @@ export function getPodUrlAllFrom(
201207 */
202208export async function getWebIdDataset (
203209 webId : WebId ,
210+ options ?: { fetch ?: typeof fetch } & Partial < ParseOptions > ,
204211) : Promise < ReturnType < typeof getSolidDataset > > {
205- return getSolidDataset ( webId ) ;
212+ return getSolidDataset ( webId , options ) ;
206213}
0 commit comments