Joplin Vacuum - A Python script to remove orphaned resources

I checked all the related Joplin API, but note history is not accessible via Joplin Data API or Joplin Plugin API. According to this thread, the only way is to directly backup the Joplin sync directory. From my perspective, one issue of using Git or other revision control system, is that a large amount of info is stored in an internal SQLite database, which is not very Git-friendly.

You may find some info about how the revision service works here: joplin/RevisionService.ts at 8a2ca0535d4dc9ac835262c4613225c40218ce8f ยท laurent22/joplin (github.com)

It seems that note history info is stored in the revision table in database.sqlite, which can be found under your Joplin config directory.