Zenroom icon indicating copy to clipboard operation
Zenroom copied to clipboard

Adding check for Restroom-mw statements

Open andrea-dintino opened this issue 4 years ago • 3 comments

The Zencode parser returning Zencode pattern not found could also try and match a list of Restroom-mw statements. The statements are all contained in files .ts or .js in a structure like this :

const actions = {
  CONNECT: "I have a valid redis connection on {}",
  WRITE: "write all data as a hash into redis",
  WRITE_WITH_KEY: "write all data into redis under the key {}",
};

Therefore the list can be generated with a script and the script put in CI

andrea-dintino avatar Jan 14 '22 14:01 andrea-dintino

It can be a rule unknown observe restroom where in DATA the caller also passes a JSON array named restroom containing statements formatted as Zencode (with single quotes '' in place of {}), then the ZEN.parser() function should be modified to observe with a simple match these statements before producing an error.

I can take it from the ZEN.parser() onwards.

jaromil avatar Jan 24 '22 06:01 jaromil

@puria watcha say?

andrea-dintino avatar Jan 24 '22 15:01 andrea-dintino

that I have a PR from 7 months waiting to be merged in https://github.com/dyne/restroom-mw/pull/206 that exposes all the sentences. I was lazy, need to write tests and also a small refactorin to include them in cliroom. Will do that, as soon as it's merged, you can ask the list of all the restroom sentences, from any restroom instance under http://restroom-instance-address/sids

puria avatar May 31 '23 15:05 puria