[MWS] Questions about Bags and Recipes

That’s not how modern APIs should work. The wiki does not and should not know anything about the underlaying backend. So it will be easy to change it in the future.

An API to get information from the MWS backend will look like this.

  • URL/bags.json or URL/bags.txt which returns a list of all bags, where the user has access to.
  • The same is true for eg: URL/recipes.json

Once you know the bags you have access to you should be able to do this:

  • URL/bags/my-bag/tiddlers.json which gives you a list and the content of tiddlers that you have access to
  • URL/bags/my-bag/tiddlers/GettingStarted.json returns a single tiddler as JSON
  • eg: URL/bags/my-bag/tiddlers.json?skinny (not sure if this URL is valid)… may return the tiddler list with all the meta data, but no text field. To make the data easy to handle.

and so on

1 Like

I definitely think some kind of filtering can be done. Prisma has a few basic filter operators which we could probably support at the very least.

You’re right that we want the underlaying database to be swappable. And I’m certainly not going to execute SQL from the client. So it would have to be a server-side implantation of some kind of filter syntax that we can modify based on the active database.

At the moment, a query syntax which supports a subset of filter operators seems like the most likely solution.

At the very least I can add sorting, skip, and take.

With TiddlyWeb, which was used by TiddlySpace the bags configuration could contain a filter instead of selecting all tiddlers from a bag.

So we could have several different bags containing TW filters. Bags could then be used as I described in the first response.

1 Like

No matter what we allow the client to retrieve, we should always provide whatever options we can to allow it to only retrieve a subset of that for performance reasons. At the very least we can easily provide some form of pagination, either with skip/take, or since_revision/limit (or both).

The filter idea is somewhat speculative on my part, as we haven’t gotten that far yet. Either one could be an option. If the server can parse filters, we will probably have that feature available as both a query and as a bag filter in recipes (and who knows where else).

That’s right. I did only mention the possibility in TS. But I do not know a single configuration that really used it. So it should not be a priority. Just keep it in mind

1 Like

I’d add to that like so: All but Only.

This thread is fascinating: but I’m having difficultly understanding its in’s and out’s.

TT