diff --git a/packages/typoas-runtime/src/context/types.ts b/packages/typoas-runtime/src/context/types.ts index d681e9c..7bb959a 100644 --- a/packages/typoas-runtime/src/context/types.ts +++ b/packages/typoas-runtime/src/context/types.ts @@ -69,20 +69,23 @@ export type CreateContextParams< Omit, 'authMethods'> & { authProviders: { [key in keyof AuthModes]: AuthProvider< - AuthModes[key] extends ApiKeySecurityAuthentication - ? string - : AuthModes[key] extends HttpBasicSecurityAuthentication - ? BasicAuthConfig - : AuthModes[key] extends HttpBearerSecurityAuthentication - ? BearerAuthConfig - : AuthModes[key] extends OAuth2SecurityAuthentication - ? BaseFlowConfig - : never + AuthProviderConfig >; }; } >; +export type AuthProviderConfig = + T extends ApiKeySecurityAuthentication + ? string + : T extends HttpBasicSecurityAuthentication + ? BasicAuthConfig + : T extends HttpBearerSecurityAuthentication + ? BearerAuthConfig + : T extends OAuth2SecurityAuthentication + ? BaseFlowConfig + : never; + export type ResponseHandler = { transforms?: TransformEntity; };