parseLinksCsv turns a CSV export from another shortener (or our own
linksToCsv export) into CreateLinkInput rows for
core.importLinks(tenant, rows, { dryRun, onConflict }). Row i of the
result is data row i of the file, so import errors point at file rows.
linksToCsv exports links in the native format (round-trips).
Column maps are header-alias based and tolerant: headers are compared after
lowercasing and dropping everything but letters and digits ("Long URL",
"long_url" and "longUrl" all read as longurl), and unknown columns are
ignored. Assumptions per format (vendor exports change; extra aliases are
cheap — every map also accepts the API field names):
format
destination
slug / short link
other
native
url
slug (+ domain)
every column linksToCsv writes
bitly
Destination URL, Long URL, long_url
Custom Bitlink / custom_bitlinks, else Bitlink / Short link / link (path → slug)
Bitly’s dashboard export (paid plans) has Title, Bitlink, Custom Bitlink,
Destination URL, Date created, Engagements; its API uses long_url,
title, tags, custom_bitlinks. Dub’s dashboard export defaults to
Short link, Destination URL, Clicks, Created at with optional columns
named after its API (key, domain, title, tags, …). Shlink’s own
importer and web-client export use Short code / Long URL / Title / Domain /
Tags (shortCode, longUrl, …). Kutt has no first-party CSV export; the
map follows its API’s link object (address, target, description,
domain, expire_in).
Domains: foreign formats drop the source domain by default (bit.ly is not
yours), so links land on the tenant’s default domain; pass
keepDomains: true when migrating a branded domain you have registered, or
domain to put every row on one domain. native keeps domains.