mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fmt
This commit is contained in:
@@ -37,10 +37,9 @@ const fallbackIcon = FaKey;
|
||||
|
||||
// --8<-- [start:ProviderIconsEmbed]
|
||||
// Provider icons mapping - uses fallback for unknown providers
|
||||
export const providerIcons: Partial<Record<
|
||||
string,
|
||||
React.FC<{ className?: string }>
|
||||
>> = {
|
||||
export const providerIcons: Partial<
|
||||
Record<string, React.FC<{ className?: string }>>
|
||||
> = {
|
||||
aiml_api: fallbackIcon,
|
||||
anthropic: fallbackIcon,
|
||||
apollo: fallbackIcon,
|
||||
|
||||
@@ -25,15 +25,15 @@ function toDisplayName(provider: string): string {
|
||||
smtp: "SMTP",
|
||||
revid: "Rev.ID",
|
||||
};
|
||||
|
||||
|
||||
if (specialCases[provider]) {
|
||||
return specialCases[provider];
|
||||
}
|
||||
|
||||
|
||||
// General case: convert snake_case to Title Case
|
||||
return provider
|
||||
.split(/[_-]/)
|
||||
.map(word => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
||||
.map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())
|
||||
.join(" ");
|
||||
}
|
||||
|
||||
@@ -127,7 +127,11 @@ export default function CredentialsProvider({
|
||||
state_token: string,
|
||||
): Promise<CredentialsMetaResponse> => {
|
||||
try {
|
||||
const credsMeta = await api.oAuthCallback(provider as string, code, state_token);
|
||||
const credsMeta = await api.oAuthCallback(
|
||||
provider as string,
|
||||
code,
|
||||
state_token,
|
||||
);
|
||||
addCredentials(provider as string, credsMeta);
|
||||
return credsMeta;
|
||||
} catch (error) {
|
||||
@@ -211,7 +215,11 @@ export default function CredentialsProvider({
|
||||
CredentialsDeleteResponse | CredentialsDeleteNeedConfirmationResponse
|
||||
> => {
|
||||
try {
|
||||
const result = await api.deleteCredentials(provider as string, id, force);
|
||||
const result = await api.deleteCredentials(
|
||||
provider as string,
|
||||
id,
|
||||
force,
|
||||
);
|
||||
if (!result.deleted) {
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ export type Credentials =
|
||||
// This allows for SDK-registered providers without hardcoding
|
||||
export type CredentialsProviderName = string;
|
||||
|
||||
// For backward compatibility, we'll keep PROVIDER_NAMES but it should be
|
||||
// For backward compatibility, we'll keep PROVIDER_NAMES but it should be
|
||||
// populated dynamically from the API. This is a placeholder that will be
|
||||
// replaced with actual values from the /api/integrations/providers endpoint
|
||||
export const PROVIDER_NAMES = {} as Record<string, string>;
|
||||
|
||||
Reference in New Issue
Block a user