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

Function fetchCollectionName

apps/sim/connectors/webflow/webflow.ts:403–420  ·  view source on GitHub ↗

* Fetches a collection's display name, caching in syncContext.

(
  accessToken: string,
  collectionId: string,
  syncContext?: Record<string, unknown>
)

Source from the content-addressed store, hash-verified

401 * Fetches a collection's display name, caching in syncContext.
402 */
403async function fetchCollectionName(
404 accessToken: string,
405 collectionId: string,
406 syncContext?: Record<string, unknown>
407): Promise<string> {
408 const names = (syncContext?.collectionNames ?? {}) as Record<string, string>
409 if (names[collectionId]) return names[collectionId]
410
411 const name = await fetchCollectionNameDirect(accessToken, collectionId)
412
413 if (syncContext) {
414 const cached = (syncContext.collectionNames ?? {}) as Record<string, string>
415 cached[collectionId] = name
416 syncContext.collectionNames = cached
417 }
418
419 return name
420}
421
422/**
423 * Fetches a collection's display name directly from the API.

Callers 1

webflow.tsFile · 0.85

Calls 1

Tested by

no test coverage detected