FooSoft / anki-connect

Anki plugin to expose a remote API for creating flash cards.
https://foosoft.net/projects/anki-connect/
Other
1.94k stars 221 forks source link

Missing actions in models.md #249

Open cm107 opened 3 years ago

cm107 commented 3 years ago

I'm going through the API documentation and testing all of the endpoints as I go, but there are a couple of actions that I believe should be in there but seem to be missing.

There is an action 'createModel', which defines:

  1. The model's name. ('modelName')
  2. A list of fields that can be written to when adding a new note. ('inOrderFields')
  3. The model's styling ('css')
  4. Card templates ('cardTemplates')

And there is also an action 'updateModelStyling' for updating the styling and 'updateModelTemplates' for updating the templates. How do I update the model's name? How do I add a new field? How do I delete a model?

All of the above can be done in the GUI via Tools > Manage Note Types, but the API doesn't seem to permit the same level of freedom. Were these endpoints left out intentionally in order to prevent people from accidentally doing irreversible damage to their data, or is there some other reason? From my perspective, it would be more convenient for me to have those endpoints for my testing. I don't want to have to use the GUI every time I want to delete a model or add another field. Are there, by any chance, other undocumented endpoints that do what I am looking for?

salkrr commented 3 years ago

@cm107 no, there aren't. As mentioned in the README, the project is in self-serve mode. It seems that no one needed methods for these tasks badly enough to implement them.