MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / makeHostedHttp

Function makeHostedHttp

packages/core/sdk/src/hosted-http-client.ts:758–770  ·  view source on GitHub ↗
(
  options: HostedHttpClientOptions = {},
)

Source from the content-addressed store, hash-verified

756 * over constructing the two independently.
757 */
758export const makeHostedHttp = (
759 options: HostedHttpClientOptions = {},
760): {
761 readonly fetch: typeof globalThis.fetch;
762 readonly httpClientLayer: Layer.Layer<HttpClient.HttpClient>;
763} => {
764 const resolve = makeSharedResolver(options);
765 return {
766 // oxlint-disable-next-line executor/no-raw-fetch -- boundary: exposes a guarded Fetch API adapter for libraries that require fetch
767 fetch: guardFetch(options.fetch ?? globalThis.fetch, options, resolve),
768 httpClientLayer: hostedHttpClientLayer(options, resolve),
769 };
770};
771
772const hostedHttpClientLayer = (
773 options: HostedHttpClientOptions,

Callers 3

makeScopedExecutorFunction · 0.85
makePlatformExecutorFunction · 0.85

Calls 3

makeSharedResolverFunction · 0.85
guardFetchFunction · 0.85
hostedHttpClientLayerFunction · 0.85

Tested by

no test coverage detected