MCPcopy Create free account
hub / github.com/middleapi/orpc / handle

Method handle

packages/server/src/adapters/fetch/handler.ts:41–67  ·  view source on GitHub ↗
(
    request: Request,
    ...rest: MaybeOptionalOptions<FriendlyStandardHandleOptions<T>>
  )

Source from the content-addressed store, hash-verified

39 }
40
41 async handle(
42 request: Request,
43 ...rest: MaybeOptionalOptions<FriendlyStandardHandleOptions<T>>
44 ): Promise<FetchHandleResult> {
45 return intercept(
46 this.adapterInterceptors,
47 {
48 ...resolveFriendlyStandardHandleOptions(resolveMaybeOptionalOptions(rest)),
49 request,
50 toFetchResponseOptions: this.toFetchResponseOptions,
51 },
52 async ({ request, toFetchResponseOptions, ...options }) => {
53 const standardRequest = toStandardLazyRequest(request)
54
55 const result = await this.standardHandler.handle(standardRequest, options)
56
57 if (!result.matched) {
58 return result
59 }
60
61 return {
62 matched: true,
63 response: toFetchResponse(result.response, toFetchResponseOptions),
64 }
65 },
66 )
67 }
68}

Callers 15

assertSuccessCaseFunction · 0.45
assertErrorCaseFunction · 0.45
rpc-link.test.tsFile · 0.45
callFunction · 0.45
retry.test.tsFile · 0.45
batch.test.tsFile · 0.45
shared.tsFile · 0.45
helpers.tsFile · 0.45
interceptMethod · 0.45
plugin.test.tsFile · 0.45
callFunction · 0.45

Calls 5

interceptFunction · 0.90
toStandardLazyRequestFunction · 0.90
toFetchResponseFunction · 0.90

Tested by 5

assertSuccessCaseFunction · 0.36
assertErrorCaseFunction · 0.36
callFunction · 0.36
callFunction · 0.36
callFunction · 0.36