Added a typed overload to visitObjectAndTemplate in apps/apollo/src/common/utils/mustacheUtils.ts so that a Record<string, string> input returns Record<string, string> (rather than the broad Record<string, unknown>). This eliminates the need for callers with flat string-record inputs to cast the result.
The overload is a declaration-only addition — the implementation signature remains broad (Record<string, unknown>) so TypeScript correctly handles the complex nested types passed by oAuth2.ts, dcrOauth.ts, and oAuth1.ts. Notably, the overload is NOT <T extends Record<string,unknown>>(obj:T):T because the function builds a brand-new object and returning T would be a structural lie.
Removed the now-redundant as Record<string, string> casts at the two call sites in apps/apollo/src/lib/connected_accounts/revoke/buildRevokeRequest.ts (~lines 40, 46) where revokeConfig.params ?? {} and revokeConfig.headers ?? {} are typed as Record<string, string> by the auth-config Zod schema.
The casts at oAuth2.ts (~83, 93), dcrOauth.ts (~222, 232), and oAuth1.ts (~51) correctly remain: those call sites pass complex domain types (OAuth2AuthScheme, OAuth2AuthConfigDB, DCROAuthScheme, DCROAuthSchemeAuthConfigDB, OAuth1AuthScheme) that the string-record overload does not cover. Also removed the @ts-expect-error on the recursive internal call, replacing it with an explicit as Record<string, unknown> cast that matches the implementation signature.
node_modules is not installed in this worktree so local typecheck/tests could not be run.revokeConfig.params and revokeConfig.headers are z.record(z.string()) in packages/auth-config/src/base.ts (lines 395, 400), making them Record<string, string> — the overload applies and the casts are genuinely redundant.Record<string, unknown> overload.🤖 Generated with Claude Code