MCPcopy Index your code
hub / github.com/simstudioai/sim / parseProvider

Function parseProvider

apps/sim/lib/oauth/utils.ts:606–631  ·  view source on GitHub ↗
(provider: OAuthProvider)

Source from the content-addressed store, hash-verified

604 * Uses the pre-computed mapping from OAUTH_PROVIDERS for accuracy.
605 */
606export function parseProvider(provider: OAuthProvider): ProviderConfig {
607 // First, check if this is a known providerId from our config
608 const mapping = PROVIDER_ID_TO_BASE_PROVIDER[provider]
609 if (mapping) {
610 return {
611 baseProvider: mapping.baseProvider,
612 featureType: mapping.serviceKey,
613 }
614 }
615
616 // Handle compound providers (e.g., 'google-email' -> { baseProvider: 'google', featureType: 'email' })
617 const [base, feature] = provider.split('-')
618
619 if (feature) {
620 return {
621 baseProvider: base,
622 featureType: feature,
623 }
624 }
625
626 // For simple providers, use 'default' as feature type
627 return {
628 baseProvider: provider,
629 featureType: 'default',
630 }
631}

Callers 6

utils.test.tsFile · 0.90
resolveServiceFunction · 0.90
getProviderIconFunction · 0.90
getProviderNameFunction · 0.90
CredentialSelectorFunction · 0.90
route.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected