fix(docs): Operator docs fixes.

This commit is contained in:
SamTolmay 2021-01-28 11:38:15 +02:00
parent 47ad077446
commit a36f31cfed
5 changed files with 24 additions and 13 deletions

View File

@ -76,7 +76,7 @@ _ref:
The CLI collects usage and error information to help us fix bugs, prioritize features, and understand how Lowdefy is being used.
zll telemetry can be disabled by setting the `disableTelemetry` flag in `cli` config object in your `lowdefy.yaml` file (this cannot be a reference to another file):
All telemetry can be disabled by setting the `disableTelemetry` flag in `cli` config object in your `lowdefy.yaml` file (this cannot be a reference to another file):
###### `lowdefy.yaml`
```yaml

View File

@ -28,14 +28,14 @@ _ref:
The regex operator has shorthand argument definitions that can be used on web client.
arguments: |
###### string
The regular expression pattern to test. The string shorthand can only be used in an input block, and the tested value will be the block's value.
###### object
- `pattern: string`: __Required__ - The regular expression pattern to test.
- `on: string`: The string to test the value on. One of `on` or `key` must be specified unless the operator is used in an input block.
- `key: string`: The key of a value in `state` to test. One of `on` or `key` must be specified unless the operator is used in an input block.
- `flags: string`: The regex flags to use. The default value is `"gm"`.
###### string
The regular expression pattern to test. The string shorthand can only be used in an input block, and the tested value will be the block's value.
examples: |
###### Check if a username is valid (Alphanumeric string that may include _ and having a length of 3 to 16 characters):
```yaml
@ -56,7 +56,13 @@ _ref:
###### Using the value of the block in which the operator is evaluated:
```yaml
_regex: ^[a-z0-9_-]{3,16}$
id: username_input
type: TextInput
validation:
- message: Invalid username.
status: error
pass:
_regex: ^[a-z0-9_-]{3,16}$
```
Returns: `true` if matched else `false`.

View File

@ -24,8 +24,6 @@ _ref:
```
description: |
The `_request` operator returns the response value of a request. If the request has not yet been call, or is still executing, the returned value is `null`.
It only returns true if all the values in the array are truthy (not `false`, `0`, `null`, `undefined`, or the empty string `""`). Else it returns false.
arguments: |
###### string
The id of the request.

View File

@ -28,9 +28,6 @@ _ref:
The regex operator has shorthand argument definitions that can be used on web client.
arguments: |
###### string
The type to test. The string shorthand can only be used in an input block, and the tested value will be the block's value.
###### object
- `type: enum`: __Required__ - The type to test. Can be one of:
- `string`
@ -46,6 +43,9 @@ _ref:
- `primitive` (`undefined`, `null`, `string`, `number`, `boolean`, or `date`)
- `on: any`: The value to test. One of `on` or `key` must be specified unless the operator is used in an input block.
- `key: string`: The key of a value in `state` to test. One of `on` or `key` must be specified unless the operator is used in an input block.
###### string
The type to test. The string shorthand can only be used in an input block, and the tested value will be the block's value.
examples: |
###### Check if a value is a number:
```yaml
@ -66,9 +66,16 @@ _ref:
###### Using the value of the block in which the operator is evaluated:
```yaml
_type: number
id: input
type: TextInput
validation:
- message: This field id required.
status: error
pass:
_not:
_type: none
```
Returns: `true` if a number
Returns: `true` if the input is none.
###### Test if an id in the `urlQuery` is undefined or null:
```yaml

View File

@ -23,7 +23,7 @@ _ref:
(value: any): string
```
description: |
The `_uuid` operator a version 4 [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). A UUID is a random identifier that can be used as an id that is, for practical purposes, unique. It looks like:
The `_uuid` operator creates a version 4 [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). A UUID is a random identifier that can be used as an id that is, for practical purposes, unique. It looks like:
```
123e4567-e89b-12d3-a456-426614174000