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

Function remapGroupColumnRefs

apps/sim/lib/table/column-keys.ts:100–120  ·  view source on GitHub ↗
(
  group: WorkflowGroup,
  idByName: ReadonlyMap<string, string>
)

Source from the content-addressed store, hash-verified

98 * (mothership) or by id (first-party UI).
99 */
100export function remapGroupColumnRefs(
101 group: WorkflowGroup,
102 idByName: ReadonlyMap<string, string>
103): WorkflowGroup {
104 const remap = (ref: string) => idByName.get(ref) ?? ref
105 return {
106 ...group,
107 outputs: group.outputs.map((o) => ({ ...o, columnName: remap(o.columnName) })),
108 ...(group.dependencies?.columns
109 ? { dependencies: { columns: group.dependencies.columns.map(remap) } }
110 : {}),
111 ...(group.inputMappings
112 ? {
113 inputMappings: group.inputMappings.map((m) => ({
114 ...m,
115 columnName: remap(m.columnName),
116 })),
117 }
118 : {}),
119 }
120}
121
122/** `name → id` for translating inbound wire data (v1 / mothership / CSV import). */
123export function buildIdByName(schema: TableSchema): Map<string, string> {

Callers 2

addWorkflowGroupFunction · 0.90

Calls 1

remapFunction · 0.85

Tested by

no test coverage detected