Typescript model migration tools: Stable API?

Hi.
This is a follow-up to SME Backend API Changes in 10.3.1 - #2 by tgreifenberg

I was told, that the single A12 development teams (application, form, overview, tree -models) created a “stable API” for the Typescript migration tools for A12 models.

For me, as a Java-Developer, the API does not look stable.


Question 1: Why is the input type of the “migrate” Method not of type “Model”? It is of type object. In a stable API i would expect a overall accepted interface class for the input parameter.

Questionn 2: The return value should be of type “MigrationResult”, but using it in my code, it is resolved as any. I wonder, why the return statements construct JSON-Arrays instead of using class-constructors etc.

Even VSCode cannot find the class “MigrationResult”. Although it is showing the Type as return-type, it cannot be imported by my code.

Is it exported correctly?

The migration API cannot work on the Model interface because any change to that interface (or any new model interface) would describe the Model type/format for models after a migration to the respective A12 version has happened.

This signature, however, refers to the input model type and it should fit to whatever kind of structure a model could have.
They could also be different from one (of multiple) migration steps to the next.

To the 2nd question: I don’t know. It looks like the export is missing and that would be a bug.

About the second question, I tried to reproduce the compilation error but nothing found:


Can you please change the type of migratedModels at line 17 into MigrationResult[] instead?