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

Function classifyCanonicalKind

apps/sim/serializer/index.ts:531–542  ·  view source on GitHub ↗

* Classify a canonical group as a credential/resource selector based on the * sub-block type of its members (oauth-input -> credential, *-selector -> * resource).

(
  blockConfig: any,
  memberIds: string[]
)

Source from the content-addressed store, hash-verified

529 * resource).
530 */
531function classifyCanonicalKind(
532 blockConfig: any,
533 memberIds: string[]
534): 'credential' | 'resource' | 'other' {
535 for (const id of memberIds) {
536 const cfg = blockConfig.subBlocks?.find((sb: any) => sb.id === id)
537 const type = cfg?.type
538 if (type === 'oauth-input') return 'credential'
539 if (typeof type === 'string' && type.endsWith('-selector')) return 'resource'
540 }
541 return 'other'
542}
543
544/**
545 * Non-throwing analysis of a block's required fields and canonical-mode value

Callers 1

collectBlockFieldIssuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected