Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/sessions / migrations

migrations

Migration registry for the JSONL session-export schema. v0.1 ships MAJOR 1 only; the registry exists so future MAJOR bumps can plug a migrator in without forking this package.

Each migrator is a pure function that takes the parsed records of a MAJOR N file and returns the parsed records as MAJOR N+1. The runtime CLI (graphorin migrate-export <input> --to-schema 2.0) walks the chain.

Interfaces

InterfaceDescription
ExportMigratorMigrator entry. Both sides of the version pair are 'MAJOR.MINOR' strings.

Functions

FunctionDescription
_resetExportMigratorsForTestingReset the registry. Test-only.
listExportMigratorsSnapshot of the registry. Sorted by fromVersion.
migrateExportWalk the registered migrators to advance records from fromVersion to toVersion. Throws when no chain exists.
registerExportMigratorRegister a migrator. Idempotent on the (fromVersion, toVersion) pair — re-registering replaces the prior entry.