MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / tryResolveCredential

Function tryResolveCredential

packages/cli/src/auth/resolver.ts:84–95  ·  view source on GitHub ↗
(
  opts: ResolveOptions = {},
)

Source from the content-addressed store, hash-verified

82
83/** Like `resolveCredential` but returns `null` instead of throwing `NOT_CONFIGURED`. */
84export async function tryResolveCredential(
85 opts: ResolveOptions = {},
86): Promise<ResolvedCredential | null> {
87 try {
88 return await resolveCredential(opts);
89 } catch (err) {
90 if (isAuthError(err) && err.code === "NOT_CONFIGURED") {
91 return null;
92 }
93 throw err;
94 }
95}
96
97function pickOAuth(
98 tokens: NonNullable<Awaited<ReturnType<typeof readStore>>["credentials"]["oauth"]>,

Callers 3

resolver.test.tsFile · 0.85
runFunction · 0.85
reportIdentityFunction · 0.85

Calls 2

resolveCredentialFunction · 0.85
isAuthErrorFunction · 0.85

Tested by

no test coverage detected