Skip to content

Commit

Permalink
docs: ✏️ rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
touv committed Nov 25, 2024
1 parent 70981fd commit 104388f
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 102 deletions.
25 changes: 16 additions & 9 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,25 @@
$ ezs -h
Usage: ezs [options] [<file>|<directory>] [<file2> <file3> ...]

Options:
--help Affiche de l'aide [booléen]
Options :
--help Affiche l'aide [booléen]
--version Affiche le numéro de version [booléen]
--verbose, -v Enable debug mode with DEBUG=ezs [booléen] [défaut: false]
--verbose, -v Make ezs more talkative, which is equivalent to setting the
envar to DEBUG=ezs:*,-ezs:debug,-ezs:trace
[booléen] [défaut : false]
--logs, -l Enable logs mode, which is equivalent to setting the envar to
DEBUG_COLORS=0 DEBUG=ezs:*,-ezs:debug,-ezs:trace
[booléen] [défaut : false]
--tracer, -t Enable tracer mode [booléen] [défaut : false]
--metrics, -m Enable metrics mode [booléen] [défaut : false]
--rpc, -r Enable RPC mode [booléen] [défaut : false]
--daemon, -d Launch daemon on a directory containing commands script
[chaine de caractère]
--slave, -l Launch slave daemon to execute remote commands [booléen]
--server, -s Server to dispach commands [chaine de caractère]
--env, -e Execute commands with environement variables as input
[booléen] [défaut: false]
[chaîne de caractères]
--env, -e Execute commands with environment variables as input
[booléen] [défaut : false]
--file, -f Execute commands with a file as input
[chaine de caractère] [défaut: false]
[chaîne de caractères] [défaut : false]
--param, -p Environment parameters [chaîne de caractères]
for more information, find our manual at https://github.com/Inist-CNRS/ezs
```
34 changes: 0 additions & 34 deletions docs/plugin-conditor.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Sachant qu'on appauvrit (casse, accents, tiret, apostrophe) tous les champs.
* [compareRnsr](#comparernsr)
* [conditorScroll](#conditorscroll)
* [CORHALFetch](#corhalfetch)
* [CORHALFetch](#corhalfetch-1)
* [getRnsr](#getrnsr)
* [getRnsrInfo](#getrnsrinfo)
* [WOSFetch](#wosfetch)
Expand Down Expand Up @@ -223,39 +222,6 @@ Output:

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

### CORHALFetch

Take `String` as URL, throw each chunk from the result

Input:

```json
[
{ q: "toto" },
]
```

Script:

```ini
[CORHALFetch]
url = https://corhal-api.inist.fr
```

Output:

```json
[{...}, {"a": "b"}, {"a": "c" }]
```

#### Parameters

* `url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** corhal api url
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `1000`)
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

### getRnsr

Find the RNSR identifier(s) matching the `address` and the publication `year`
Expand Down
34 changes: 23 additions & 11 deletions docs/plugin-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ peuvent apparaître comme similaires mais leur fonctionnement est différent :
* [truncate](#truncate)
* [ungroup](#ungroup)
* [unpack](#unpack)
* [use](#use)
* [validate](#validate)

### assign
Expand Down Expand Up @@ -229,22 +230,13 @@ Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G

### debug

Take `Object`, print it (with its number), and throw the same object.

with ezs debug enabled:
every object will be stringify for printed and all others ezs debug traces will be print

with ezs debug disabled:
every objects will be inspected (indented and colorized) and print on stderr (error level) or stdout (log level)

if ezs parameter is set, every object are not log (it's a global action)
Take `Object`, print it (with its index number), and throw the same object.

#### Parameters

* `level` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** console level : log or error or silent (optional, default `error`)
* `level` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** DEBUG ezs level (depends of DEBUG env variable, see cli parameters) (optional, default `info`)
* `text` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** text before the dump (optional, default `valueOf`)
* `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** path of field to print
* `ezs` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** enable or disable ezs global debug traces

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

Expand Down Expand Up @@ -1424,6 +1416,26 @@ Take `String`s or `Buffer`s and throw `Object` builded by JSON.parse on each lin
Returns **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
### use
Take all `String`, concat them and throw just one.
Script:
```ini
[use]
plugin = basics
plugin = analytics
```
#### Parameters
* `beginWith` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Add value at the begin
* `joinWith` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** use value to join 2 chunk
* `endWith` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Add value at the end
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
### validate
From an `Object`, throw the same object if all rules pass
Expand Down
34 changes: 0 additions & 34 deletions packages/conditor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Sachant qu'on appauvrit (casse, accents, tiret, apostrophe) tous les champs.
* [compareRnsr](#comparernsr)
* [conditorScroll](#conditorscroll)
* [CORHALFetch](#corhalfetch)
* [CORHALFetch](#corhalfetch-1)
* [getRnsr](#getrnsr)
* [getRnsrInfo](#getrnsrinfo)
* [WOSFetch](#wosfetch)
Expand Down Expand Up @@ -223,39 +222,6 @@ Output:

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

### CORHALFetch

Take `String` as URL, throw each chunk from the result

Input:

```json
[
{ q: "toto" },
]
```

Script:

```ini
[CORHALFetch]
url = https://corhal-api.inist.fr
```

Output:

```json
[{...}, {"a": "b"}, {"a": "c" }]
```

#### Parameters

* `url` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** corhal api url
* `timeout` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** Timeout in milliseconds (optional, default `1000`)
* `retries` **[Number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The maximum amount of times to retry the connection (optional, default `5`)

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

### getRnsr

Find the RNSR identifier(s) matching the `address` and the publication `year`
Expand Down
34 changes: 23 additions & 11 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ peuvent apparaître comme similaires mais leur fonctionnement est différent :
* [truncate](#truncate)
* [ungroup](#ungroup)
* [unpack](#unpack)
* [use](#use)
* [validate](#validate)

### assign
Expand Down Expand Up @@ -229,22 +230,13 @@ Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G

### debug

Take `Object`, print it (with its number), and throw the same object.

with ezs debug enabled:
every object will be stringify for printed and all others ezs debug traces will be print

with ezs debug disabled:
every objects will be inspected (indented and colorized) and print on stderr (error level) or stdout (log level)

if ezs parameter is set, every object are not log (it's a global action)
Take `Object`, print it (with its index number), and throw the same object.

#### Parameters

* `level` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** console level : log or error or silent (optional, default `error`)
* `level` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** DEBUG ezs level (depends of DEBUG env variable, see cli parameters) (optional, default `info`)
* `text` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** text before the dump (optional, default `valueOf`)
* `path` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** path of field to print
* `ezs` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** enable or disable ezs global debug traces

Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;

Expand Down Expand Up @@ -1424,6 +1416,26 @@ Take `String`s or `Buffer`s and throw `Object` builded by JSON.parse on each lin
Returns **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**&#x20;
### use
Take all `String`, concat them and throw just one.
Script:
```ini
[use]
plugin = basics
plugin = analytics
```
#### Parameters
* `beginWith` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Add value at the begin
* `joinWith` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** use value to join 2 chunk
* `endWith` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Add value at the end
Returns **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**&#x20;
### validate
From an `Object`, throw the same object if all rules pass
Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/statements/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import debugGlobal from 'debug';
import _ from 'lodash';

/**
* Take `Object`, print it (with its number index), and throw the same object.
* Take `Object`, print it (with its index number), and throw the same object.
*
* @name debug
* @param {String} [level=info] DEBUG ezs level (depends of DEBUG env variable)
* @param {String} [level=info] DEBUG ezs level (depends of DEBUG env variable, see cli parameters)
* @param {String} [text=valueOf] text before the dump
* @param {String} [path] path of field to print
* @param {Boolean} [namespaces=ezs:*,-ezs:debug,-ezs:trace] set DEBUG namespaces
* @returns {Object}
*/
export default function debug(data, feed) {
Expand Down

0 comments on commit 104388f

Please sign in to comment.