1919// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2020//
2121
22+ import { ParserOptions } from "n3" ;
2223import type {
2324 SolidDataset ,
2425 UrlString ,
@@ -90,11 +91,11 @@ export async function getProfileAll<
9091 options ?: {
9192 fetch ?: typeof fetch ;
9293 webIdProfile ?: T ;
93- } ,
94+ } & ParserOptions ,
9495) : Promise < ProfileAll < T > > ;
9596export async function getProfileAll (
9697 webId : WebId ,
97- options ?: { fetch ?: typeof fetch ; webIdProfile : undefined } ,
98+ options ?: { fetch ?: typeof fetch ; webIdProfile : undefined } & ParserOptions ,
9899) : Promise < ProfileAll < SolidDataset & WithServerResourceInfo > > ;
99100export async function getProfileAll <
100101 T extends SolidDataset & WithServerResourceInfo ,
@@ -103,17 +104,19 @@ export async function getProfileAll<
103104 options ?: {
104105 fetch ?: typeof fetch ;
105106 webIdProfile ?: T ;
106- } ,
107+ } & ParserOptions ,
107108) : Promise < ProfileAll < T | ( SolidDataset & WithServerResourceInfo ) > > {
108- const authFetch = options ?. fetch ?? fetch ;
109+ const unauthenticatedOptions = Object . assign ( { } , options ) ;
110+ delete unauthenticatedOptions [ "fetch" ] ;
111+
109112 const webIdProfile =
110113 options ?. webIdProfile ??
111114 // This should always use an unauthenticated fetch.
112- ( await getSolidDataset ( webId ) ) ;
115+ ( await getSolidDataset ( webId , unauthenticatedOptions ) ) ;
113116 const altProfileAll = (
114117 await Promise . allSettled (
115118 getAltProfileUrlAllFrom ( webId , webIdProfile ) . map ( ( uniqueProfileIri ) =>
116- getSolidDataset ( uniqueProfileIri , { fetch : authFetch } ) ,
119+ getSolidDataset ( uniqueProfileIri , options ) ,
117120 ) ,
118121 )
119122 )
@@ -147,7 +150,7 @@ export async function getProfileAll<
147150 */
148151export async function getPodUrlAll (
149152 webId : WebId ,
150- options ?: { fetch ?: typeof fetch } ,
153+ options ?: { fetch ?: typeof fetch } & ParserOptions ,
151154) : Promise < UrlString [ ] > {
152155 const profiles = await getProfileAll ( webId , options ) ;
153156 return getPodUrlAllFrom ( profiles , webId ) ;
@@ -201,6 +204,7 @@ export function getPodUrlAllFrom(
201204 */
202205export async function getWebIdDataset (
203206 webId : WebId ,
207+ options ?: { fetch ?: typeof fetch } & ParserOptions ,
204208) : Promise < ReturnType < typeof getSolidDataset > > {
205- return getSolidDataset ( webId ) ;
209+ return getSolidDataset ( webId , options ) ;
206210}
0 commit comments