Skip to main content

@svatah/yam-migrate

v1/v2 to v3 migration and prototype database import

Exports

ExportKindSignature
environmentNamefunctionexport function environmentName(key: string): stringuser.passwordYAM_USER_PASSWORD.
extractPrototypeProjectfunctionexport function extractPrototypeProject(options: FromPrototypeOptions): FromPrototypeResultExtract the prototype's database into the inputs a v2 migration takes.
FromPrototypeOptionsinterfaceexport interface FromPrototypeOptions
FromPrototypeResultinterfaceexport interface FromPrototypeResult
hasInteriorPrepositionfunctionexport function hasInteriorPreposition(phrase: string): booleanA phrase that still has a preposition inside it, which usually means the
LegacyBlockinterfaceexport interface LegacyBlock
LegacyFlowinterfaceexport interface LegacyFlow
LegacyLocatorinterfaceexport interface LegacyLocatorA locator, as v2 wrote it: xpath://button, link text : Sign In.
LegacyStepinterfaceexport interface LegacyStep
looksSecretfunctionexport function looksSecret(key: string): boolean
migratefunctionexport function migrate(options: MigrateOptions): MigrateResult
migrateDatafunctionexport function migrateData(text: string): MigratedData
MigratedDatainterfaceexport interface MigratedData
MigratedLocatorinterfaceexport interface MigratedLocator
MigrateOptionsinterfaceexport interface MigrateOptions
MigrateResultinterfaceexport interface MigrateResult
NOT_IMPORTEDvariableNOT_IMPORTED = ["results", "images", "executionHistory", "apihistory", "settings"]Tables REQ-ADE-9 excludes. Listed, not silently skipped.
parseLegacyStepfunctionexport function parseLegacyStep(raw: string, line: number): LegacyStepOne legacy line, taken apart.
parseLocatorfunctionexport function parseLocator(raw: string): LegacyLocatorxpath://button, link text : Sign In, css selector : #a → by + value.
parseLocatorFilefunctionexport function parseLocatorFile(text: string): MigratedLocator[]Parse a whole .locator / .properties file.
parseLocatorLinefunctionexport function parseLocatorLine(line: string): MigratedLocator | undefinedParse one name = a & b & c line.
phraseForfunctionexport function phraseFor(A phrase for an element, from the prose beside it or from the locator.
PrototypeDatabaseinterfaceexport interface PrototypeDatabase
readLegacyFlowfunctionexport function readLegacyFlow(text: string, file: string): LegacyFlowRead a v1/v2 flow file.
readPrototypeDatabasefunctionexport function readPrototypeDatabase(path: string): PrototypeDatabaseRead an electron-db directory.
renderReviewReportfunctionexport function renderReviewReport(input: ReportInput): string
ReportInputinterfaceexport interface ReportInput
ReviewNoteinterfaceexport interface ReviewNoteThe migration review report (REQ-LANG-11: verified by T, R).
RewriteResultinterfaceexport interface RewriteResult
rewriteStepfunctionexport function rewriteStep(step: LegacyStep): RewriteResultRewrite one step.
seedBindingfunctionexport function seedBinding(locator: MigratedLocator, at: string): BindingFileOne migrated locator as a BindingFile (LLD §3.3).
Tabletypealiasexport type Table = ReadonlyArray<Record<string, unknown>>;One electron-db table, as rows.
valueForfunctionexport function valueFor(raw: string): stringA *…* value as a v3 value: a quoted literal or a {…} reference.
verbForfunctionexport function verbFor(action: string | undefined): Verb | undefinedThe v3 verb a legacy action means, through the ported vocabulary.