MCPcopy Create free account
hub / github.com/GitbookIO/gitbook / fetchFilesystemNoCache

Function fetchFilesystemNoCache

packages/gitbook/src/lib/openapi/fetch.ts:94–113  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

92}
93
94async function fetchFilesystemNoCache(url: string) {
95 console.log(url);
96 // Wrap the raw string to prevent invalid URLs from being passed to fetch.
97 // This can happen if the URL has whitespace, which is currently handled differently by Cloudflare's implementation of fetch:
98 // https://github.com/cloudflare/workerd/issues/1957
99 const response = await fetch(new URL(url), {
100 ...noCacheFetchOptions,
101 cache: 'no-store',
102 });
103
104 if (!response.ok) {
105 throw new DataFetcherError('Failed to fetch OpenAPI file', response.status);
106 }
107
108 const text = await response.text();
109 const { filesystem } = await parseOpenAPI({ value: text, rootURL: url });
110 const richFilesystem = await enrichFilesystem(filesystem);
111
112 return richFilesystem;
113}

Callers 1

fetchFilesystemFunction · 0.85

Calls 3

parseOpenAPIFunction · 0.90
enrichFilesystemFunction · 0.90
fetchFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…