Skip to content

Commit eba2cce

Browse files
committed
fix(integrations): sync docs manifest for the Semrush page
1 parent a54f45c commit eba2cce

2 files changed

Lines changed: 11 additions & 15 deletions

File tree

apps/sim/lib/copilot/generated/docs-manifest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ export const DOCS_MANIFEST: readonly string[] = [
277277
'integrations/sap_concur.mdx',
278278
'integrations/sap_s4hana.mdx',
279279
'integrations/secrets_manager.mdx',
280+
'integrations/semrush.mdx',
280281
'integrations/sendblue.mdx',
281282
'integrations/sendgrid.mdx',
282283
'integrations/sentry.mdx',

apps/sim/tools/semrush/utils.ts

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ interface SemrushColumnDef {
3131
labels: string[]
3232
}
3333

34-
function column(
35-
key: string,
36-
type: SemrushValueType,
37-
...labels: string[]
38-
): Omit<SemrushColumnDef, 'labels'> & { labels: string[] } {
34+
function column(key: string, type: SemrushValueType, ...labels: string[]): SemrushColumnDef {
3935
return { key, type, labels: labels.map((label) => label.toLowerCase()) }
4036
}
4137

@@ -254,18 +250,17 @@ function resolveHeader(
254250

255251
for (const [index, cell] of headerCells.entries()) {
256252
const label = normalizeLabel(cell)
257-
const code = columnCodes.find(
258-
(candidate, position) =>
259-
position >= cursor &&
260-
(candidate.toLowerCase() === label || COLUMN_DEFS[candidate].labels.includes(label))
261-
)
253+
let matched: SemrushColumnDef | null = null
262254

263-
if (code) {
264-
cursor = columnCodes.indexOf(code, cursor) + 1
265-
resolved.push(COLUMN_DEFS[code])
266-
} else {
267-
resolved.push(sameLength ? defs[index] : null)
255+
for (let position = cursor; position < defs.length; position++) {
256+
const code = columnCodes[position]
257+
if (code.toLowerCase() === label || defs[position].labels.includes(label)) {
258+
matched = defs[position]
259+
cursor = position + 1
260+
break
261+
}
268262
}
263+
resolved.push(matched ?? (sameLength ? defs[index] : null))
269264
}
270265
return resolved
271266
}

0 commit comments

Comments
 (0)