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

Function rowWireTranslators

apps/sim/app/api/table/row-wire.ts:30–46  ·  view source on GitHub ↗
(
  authType: AuthTypeValue | undefined,
  schema: TableSchema
)

Source from the content-addressed store, hash-verified

28 * name↔id at this boundary, mirroring the public v1 routes.
29 */
30export function rowWireTranslators(
31 authType: AuthTypeValue | undefined,
32 schema: TableSchema
33): RowWireTranslators {
34 if (authType !== AuthType.INTERNAL_JWT) {
35 const identity = <T>(value: T): T => value
36 return { dataIn: identity, dataOut: identity, filterIn: identity, sortIn: identity }
37 }
38 const idByName = buildIdByName(schema)
39 const nameById = buildNameById(schema)
40 return {
41 dataIn: (data) => rowDataNameToId(data, idByName),
42 dataOut: (data) => rowDataIdToName(data, nameById),
43 filterIn: (filter) => filterNamesToIds(filter, idByName),
44 sortIn: (sort) => sortNamesToIds(sort, idByName),
45 }
46}

Callers 4

handleBatchInsertFunction · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90

Calls 6

buildIdByNameFunction · 0.90
buildNameByIdFunction · 0.90
rowDataNameToIdFunction · 0.90
rowDataIdToNameFunction · 0.90
filterNamesToIdsFunction · 0.90
sortNamesToIdsFunction · 0.90

Tested by

no test coverage detected