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

Function getServiceByProviderAndId

apps/sim/lib/oauth/utils.ts:472–488  ·  view source on GitHub ↗
(
  provider: OAuthProvider,
  serviceId?: string
)

Source from the content-addressed store, hash-verified

470}
471
472export function getServiceByProviderAndId(
473 provider: OAuthProvider,
474 serviceId?: string
475): OAuthServiceConfig {
476 const providerConfig = OAUTH_PROVIDERS[provider]
477 if (!providerConfig) {
478 throw new Error(`Provider ${provider} not found`)
479 }
480
481 if (!serviceId) {
482 return providerConfig.services[providerConfig.defaultService]
483 }
484
485 return (
486 providerConfig.services[serviceId] || providerConfig.services[providerConfig.defaultService]
487 )
488}
489
490export function getProviderIdFromServiceId(serviceId: string): string {
491 for (const provider of Object.values(OAUTH_PROVIDERS)) {

Callers 1

utils.test.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected