@@ -36,7 +36,6 @@ import { openaiCodexOAuthProvider } from "./openai-chatgpt.js";
|
36 | 36 | import type { |
37 | 37 | OAuthCredentials, |
38 | 38 | OAuthProviderId, |
39 | | -OAuthProviderInfo, |
40 | 39 | OAuthProviderInterface, |
41 | 40 | } from "./types.js"; |
42 | 41 | |
@@ -64,21 +63,6 @@ export function registerOAuthProvider(provider: OAuthProviderInterface): void {
|
64 | 63 | oauthProviderRegistry.set(provider.id, provider); |
65 | 64 | } |
66 | 65 | |
67 | | -/** |
68 | | - * Unregister an OAuth provider. |
69 | | - * |
70 | | - * If the provider is built-in, restores the built-in implementation. |
71 | | - * Custom providers are removed completely. |
72 | | - */ |
73 | | -export function unregisterOAuthProvider(id: string): void { |
74 | | -const builtInProvider = BUILT_IN_OAUTH_PROVIDERS.find((provider) => provider.id === id); |
75 | | -if (builtInProvider) { |
76 | | -oauthProviderRegistry.set(id, builtInProvider); |
77 | | -return; |
78 | | -} |
79 | | -oauthProviderRegistry.delete(id); |
80 | | -} |
81 | | - |
82 | 66 | /** |
83 | 67 | * Reset OAuth providers to built-ins. |
84 | 68 | */ |
@@ -96,36 +80,10 @@ export function getOAuthProviders(): OAuthProviderInterface[] {
|
96 | 80 | return Array.from(oauthProviderRegistry.values()); |
97 | 81 | } |
98 | 82 | |
99 | | -/** |
100 | | - * @deprecated Use getOAuthProviders() which returns OAuthProviderInterface[] |
101 | | - */ |
102 | | -export function getOAuthProviderInfoList(): OAuthProviderInfo[] { |
103 | | -return getOAuthProviders().map((p) => ({ |
104 | | -id: p.id, |
105 | | -name: p.name, |
106 | | -available: true, |
107 | | -})); |
108 | | -} |
109 | | - |
110 | 83 | // ============================================================================ |
111 | 84 | // High-level API (uses provider registry) |
112 | 85 | // ============================================================================ |
113 | 86 | |
114 | | -/** |
115 | | - * Refresh token for unknown OAuth provider. |
116 | | - * @deprecated Use getOAuthProvider(id).refreshToken() instead |
117 | | - */ |
118 | | -export async function refreshOAuthToken( |
119 | | -providerId: OAuthProviderId, |
120 | | -credentials: OAuthCredentials, |
121 | | -): Promise<OAuthCredentials> { |
122 | | -const provider = getOAuthProvider(providerId); |
123 | | -if (!provider) { |
124 | | -throw new Error(`Unknown OAuth provider: ${providerId}`); |
125 | | -} |
126 | | -return provider.refreshToken(credentials); |
127 | | -} |
128 | | - |
129 | 87 | /** |
130 | 88 | * Get API key for a provider from OAuth credentials. |
131 | 89 | * Automatically refreshes expired tokens. |
|