MCPcopy Create free account
hub / github.com/basecamp/hey-cli / fetchNextBoxPage

Function fetchNextBoxPage

internal/cmd/box.go:202–215  ·  view source on GitHub ↗

fetchNextBoxPage fetches a pagination URL and decodes it as a BoxShowResponse. It validates that the URL shares the same origin as the SDK base URL to prevent leaking auth credentials to a different host.

(ctx context.Context, nextURL string)

Source from the content-addressed store, hash-verified

200 if err != nil {
201 return nil, apierr.FromSDK(err)
202 }
203 return resp, nil
204 case "laterbox", "reply later":
205 resp, err := sdk.Boxes().GetLaterbox(ctx, &generated.GetLaterboxParams{Page: cursor})
206 if err != nil {
207 return nil, apierr.FromSDK(err)
208 }
209 return resp, nil
210 case "bubblebox", "bubbled up":
211 resp, err := sdk.Boxes().GetBubblebox(ctx, &generated.GetBubbleboxParams{Page: cursor})
212 if err != nil {
213 return nil, apierr.FromSDK(err)
214 }
215 return resp, nil
216 }
217
218 // Unknown name: list-then-filter fallback

Callers

nothing calls this directly

Calls 2

validateSameOriginFunction · 0.85
convertSDKErrorFunction · 0.85

Tested by

no test coverage detected