@lowdefy/docs 4.0.0-alpha.7 → 4.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/operators/client/filter_default_value.js +55 -0
- package/{public/modules/connectDocsearch.js → dist/operatorsClient.js} +1 -19
- package/{templates/blocks/schemaTransformer.js → dist/types.js} +5 -10
- package/package.json +19 -3
- package/404.yaml +0 -26
- package/CHANGELOG.md +0 -697
- package/actions/CallMethod.yaml +0 -57
- package/actions/JsAction.yaml +0 -281
- package/actions/Link.yaml +0 -120
- package/actions/Login.yaml +0 -123
- package/actions/Logout.yaml +0 -44
- package/actions/Message.yaml +0 -68
- package/actions/Notification.yaml +0 -84
- package/actions/Request.yaml +0 -70
- package/actions/Reset.yaml +0 -42
- package/actions/ResetValidation.yaml +0 -102
- package/actions/ScrollTo.yaml +0 -100
- package/actions/SetGlobal.yaml +0 -78
- package/actions/SetState.yaml +0 -85
- package/actions/Throw.yaml +0 -89
- package/actions/Validate.yaml +0 -104
- package/actions/Wait.yaml +0 -40
- package/blocks/all_icons.yaml +0 -803
- package/blocks/container/Affix.yaml +0 -26
- package/blocks/container/Alert.yaml +0 -27
- package/blocks/container/Badge.yaml +0 -27
- package/blocks/container/Box.yaml +0 -27
- package/blocks/container/Card.yaml +0 -29
- package/blocks/container/Collapse.yaml +0 -38
- package/blocks/container/Comment.yaml +0 -43
- package/blocks/container/ConfirmModal.yaml +0 -36
- package/blocks/container/Descriptions.yaml +0 -51
- package/blocks/container/Drawer.yaml +0 -46
- package/blocks/container/Label.yaml +0 -28
- package/blocks/container/Modal.yaml +0 -46
- package/blocks/container/PageHCF.yaml +0 -28
- package/blocks/container/PageHCSF.yaml +0 -29
- package/blocks/container/PageHSCF.yaml +0 -29
- package/blocks/container/PageHeaderMenu.yaml +0 -52
- package/blocks/container/PageSHCF.yaml +0 -29
- package/blocks/container/PageSiderMenu.yaml +0 -53
- package/blocks/container/Result.yaml +0 -34
- package/blocks/container/Span.yaml +0 -27
- package/blocks/container/Spin.yaml +0 -27
- package/blocks/container/Tabs.yaml +0 -41
- package/blocks/container/Tooltip.yaml +0 -38
- package/blocks/display/Anchor.yaml +0 -25
- package/blocks/display/Avatar.yaml +0 -23
- package/blocks/display/Breadcrumb.yaml +0 -28
- package/blocks/display/Button.yaml +0 -43
- package/blocks/display/DangerousHtml.yaml +0 -62
- package/blocks/display/DangerousMarkdown.yaml +0 -46
- package/blocks/display/Divider.yaml +0 -23
- package/blocks/display/EChart.yaml +0 -53
- package/blocks/display/Html.yaml +0 -50
- package/blocks/display/Icon.yaml +0 -23
- package/blocks/display/Img.yaml +0 -40
- package/blocks/display/Markdown.yaml +0 -31
- package/blocks/display/MarkdownWithCode.yaml +0 -46
- package/blocks/display/Menu.yaml +0 -48
- package/blocks/display/Message.yaml +0 -34
- package/blocks/display/MobileMenu.yaml +0 -47
- package/blocks/display/Notification.yaml +0 -34
- package/blocks/display/Paragraph.yaml +0 -30
- package/blocks/display/Progress.yaml +0 -52
- package/blocks/display/Skeleton.yaml +0 -27
- package/blocks/display/Statistic.yaml +0 -35
- package/blocks/display/Title.yaml +0 -32
- package/blocks/input/AutoComplete.yaml +0 -30
- package/blocks/input/ButtonSelector.yaml +0 -36
- package/blocks/input/CheckboxSelector.yaml +0 -36
- package/blocks/input/CheckboxSwitch.yaml +0 -56
- package/blocks/input/ChromeColorSelector.yaml +0 -24
- package/blocks/input/CircleColorSelector.yaml +0 -24
- package/blocks/input/ColorSelector.yaml +0 -24
- package/blocks/input/CompactColorSelector.yaml +0 -24
- package/blocks/input/DateRangeSelector.yaml +0 -26
- package/blocks/input/DateSelector.yaml +0 -26
- package/blocks/input/DateTimeSelector.yaml +0 -28
- package/blocks/input/GithubColorSelector.yaml +0 -24
- package/blocks/input/MonthSelector.yaml +0 -26
- package/blocks/input/MultipleSelector.yaml +0 -117
- package/blocks/input/NumberInput.yaml +0 -24
- package/blocks/input/Pagination.yaml +0 -33
- package/blocks/input/ParagraphInput.yaml +0 -32
- package/blocks/input/PasswordInput.yaml +0 -48
- package/blocks/input/RadioSelector.yaml +0 -36
- package/blocks/input/RatingSlider.yaml +0 -24
- package/blocks/input/S3UploadButton.yaml +0 -28
- package/blocks/input/Selector.yaml +0 -98
- package/blocks/input/SliderColorSelector.yaml +0 -24
- package/blocks/input/SwatchesColorSelector.yaml +0 -24
- package/blocks/input/Switch.yaml +0 -24
- package/blocks/input/TextArea.yaml +0 -27
- package/blocks/input/TextInput.yaml +0 -59
- package/blocks/input/TitleInput.yaml +0 -32
- package/blocks/input/TwitterColorSelector.yaml +0 -24
- package/blocks/input/WeekSelector.yaml +0 -26
- package/blocks/list/ControlledList.yaml +0 -191
- package/blocks/list/List.yaml +0 -157
- package/blocks/list/TimelineList.yaml +0 -136
- package/body.html +0 -1
- package/concepts/blocks.yaml +0 -249
- package/concepts/cli.yaml +0 -173
- package/concepts/connections-and-requests.yaml +0 -114
- package/concepts/context-and-state.yaml +0 -82
- package/concepts/custom-blocks.yaml +0 -190
- package/concepts/custom-code.yaml +0 -197
- package/concepts/events-and-actions.yaml +0 -224
- package/concepts/hosting-files.yaml +0 -50
- package/concepts/layout.yaml +0 -1464
- package/concepts/lists.yaml +0 -162
- package/concepts/lowdefy-schema.yaml +0 -245
- package/concepts/operators.yaml +0 -66
- package/concepts/overview.yaml +0 -48
- package/concepts/secrets.yaml +0 -56
- package/connections/AWSS3.yaml +0 -228
- package/connections/AmazonRedshift.yaml +0 -75
- package/connections/AxiosHttp.yaml +0 -194
- package/connections/Elasticsearch.yaml +0 -378
- package/connections/GoogleSheet.yaml +0 -332
- package/connections/Knex.yaml +0 -181
- package/connections/KnexRequests.md +0 -121
- package/connections/MSSQL.yaml +0 -90
- package/connections/MariaDB.yaml +0 -77
- package/connections/MongoDB.yaml +0 -581
- package/connections/MySQL.yaml +0 -92
- package/connections/OracleDB.yaml +0 -73
- package/connections/PostgreSQL.yaml +0 -99
- package/connections/Redis.yaml +0 -147
- package/connections/SQLite.yaml +0 -94
- package/connections/SendGridMail.yaml +0 -113
- package/connections/Stripe.yaml +0 -139
- package/deployment/aws-lambda.yaml +0 -128
- package/deployment/docker.yaml +0 -118
- package/deployment/netlify.yaml +0 -69
- package/deployment/node-server.yaml +0 -111
- package/head.html +0 -7
- package/howto/generate-csv.yaml.njk +0 -252
- package/howto/generate-pdf.yaml.njk +0 -651
- package/howto/generateCsv/lowdefy.yaml +0 -64
- package/howto/generateCsv/public/csvMake.js +0 -27
- package/howto/generatePdf/inv_template.yaml +0 -200
- package/howto/generatePdf/lowdefy.yaml +0 -117
- package/howto/generatePdf/my_header.html +0 -1
- package/howto/generatePdf/public/logo_example.png +0 -0
- package/howto/generatePdf/public/modules/importUmd.js +0 -7
- package/howto/generatePdf/public/modules/pdfMake.js +0 -7
- package/howto/generatePdf/public/modules/vfs_fonts.js +0 -12
- package/howto/use-refrences.md +0 -5
- package/introduction.yaml +0 -100
- package/lowdefy.yaml +0 -66
- package/menus.yaml +0 -832
- package/operators/_actions.yaml +0 -123
- package/operators/_and.yaml +0 -90
- package/operators/_args.yaml +0 -79
- package/operators/_array.yaml +0 -326
- package/operators/_base64.yaml +0 -56
- package/operators/_change_case.yaml +0 -347
- package/operators/_date.yaml +0 -71
- package/operators/_diff.yaml +0 -75
- package/operators/_divide.yaml +0 -46
- package/operators/_eq.yaml +0 -67
- package/operators/_event.yaml +0 -103
- package/operators/_format.yaml +0 -209
- package/operators/_function.yaml +0 -66
- package/operators/_get.yaml +0 -108
- package/operators/_global.yaml +0 -107
- package/operators/_gt.yaml +0 -65
- package/operators/_gte.yaml +0 -65
- package/operators/_hash.yaml +0 -109
- package/operators/_if.yaml +0 -44
- package/operators/_if_none.yaml +0 -61
- package/operators/_index.yaml +0 -65
- package/operators/_input.yaml +0 -114
- package/operators/_js.yaml +0 -189
- package/operators/_json.yaml +0 -128
- package/operators/_list_contexts.yaml +0 -37
- package/operators/_location.yaml +0 -59
- package/operators/_log.yaml +0 -36
- package/operators/_lt.yaml +0 -65
- package/operators/_lte.yaml +0 -65
- package/operators/_math.yaml +0 -374
- package/operators/_media.yaml +0 -86
- package/operators/_menu.yaml +0 -81
- package/operators/_mql.yaml +0 -101
- package/operators/_ne.yaml +0 -77
- package/operators/_not.yaml +0 -47
- package/operators/_number.yaml +0 -157
- package/operators/_nunjucks.yaml +0 -73
- package/operators/_object.yaml +0 -193
- package/operators/_operator.yaml +0 -47
- package/operators/_or.yaml +0 -81
- package/operators/_product.yaml +0 -59
- package/operators/_random.yaml +0 -104
- package/operators/_ref.yaml +0 -266
- package/operators/_regex.yaml +0 -83
- package/operators/_request.yaml +0 -50
- package/operators/_secret.yaml +0 -74
- package/operators/_state.yaml +0 -114
- package/operators/_string.yaml +0 -283
- package/operators/_subtract.yaml +0 -38
- package/operators/_sum.yaml +0 -59
- package/operators/_switch.yaml +0 -51
- package/operators/_type.yaml +0 -92
- package/operators/_uri.yaml +0 -56
- package/operators/_url_query.yaml +0 -120
- package/operators/_user.yaml +0 -107
- package/operators/_uuid.yaml +0 -114
- package/operators/_var.yaml +0 -105
- package/operators/_yaml.yaml +0 -107
- package/pages.yaml +0 -227
- package/public/images/authors/gervwyk.jpeg +0 -0
- package/public/images/authors/sandile.jpeg +0 -0
- package/public/images/howto/header_generate_csv.jpg +0 -0
- package/public/images/howto/header_generate_pdf.jpg +0 -0
- package/public/logo_example.png +0 -0
- package/public/lowdefy_app_schema.png +0 -0
- package/public/modules/csvMake.js +0 -27
- package/public/modules/filterDefaultValue.js +0 -48
- package/public/modules/importUmd.js +0 -7
- package/public/modules/index.js +0 -5
- package/public/modules/pdfMake.js +0 -7
- package/public/modules/test/filterDefaultValue.test.js +0 -91
- package/public/modules/vfs_fonts.js +0 -12
- package/public/sitemap.xml +0 -1024
- package/templates/actions.yaml.njk +0 -68
- package/templates/blocks/defaultValueTransformer.js +0 -53
- package/templates/blocks/exampleTransformer.js +0 -81
- package/templates/blocks/layout.yaml +0 -114
- package/templates/blocks/propertiesFormTransformer.js +0 -419
- package/templates/blocks/propertiesGetterTransformer.js +0 -132
- package/templates/blocks/schema.yaml.njk +0 -42
- package/templates/blocks/style.yaml +0 -26
- package/templates/blocks/template.yaml.njk +0 -495
- package/templates/blog.yaml.njk +0 -221
- package/templates/cli_command.yaml.njk +0 -37
- package/templates/footer.yaml.njk +0 -604
- package/templates/general.yaml.njk +0 -124
- package/templates/generateSitemap.js +0 -41
- package/templates/header.yaml +0 -138
- package/templates/navigation_buttons.yaml +0 -68
- package/templates/operators.yaml.njk +0 -82
- package/templates/operatorsMethodTransformer.js +0 -119
- package/templates/test/array.test.js +0 -1335
- package/templates/test/boolean.test.js +0 -98
- package/templates/test/button.test.js +0 -166
- package/templates/test/color.test.js +0 -126
- package/templates/test/enum.test.js +0 -105
- package/templates/test/icon.test.js +0 -109
- package/templates/test/integer.test.js +0 -99
- package/templates/test/manual.test.js +0 -238
- package/templates/test/number.test.js +0 -99
- package/templates/test/object.test.js +0 -434
- package/templates/test/oneOf.test.js +0 -794
- package/templates/test/string.test.js +0 -98
- package/templates/test/yaml.test.js +0 -605
- package/tutorial/next-steps.yaml +0 -83
- package/tutorial/tutorial-actions-operators-config.yaml +0 -142
- package/tutorial/tutorial-actions-operators.yaml +0 -436
- package/tutorial/tutorial-add-blocks-config.yaml +0 -109
- package/tutorial/tutorial-add-blocks.yaml +0 -195
- package/tutorial/tutorial-create-page-config.yaml +0 -77
- package/tutorial/tutorial-create-page.yaml +0 -196
- package/tutorial/tutorial-deploy.yaml +0 -146
- package/tutorial/tutorial-requests-config.yaml +0 -186
- package/tutorial/tutorial-requests.yaml +0 -338
- package/tutorial/tutorial-start.yaml +0 -282
- package/users/login-and-logout.yaml +0 -164
- package/users/openid-connect.yaml +0 -84
- package/users/protected-pages.yaml +0 -67
- package/users/roles.yaml +0 -70
- package/users/user-object.yaml +0 -73
- package/users/users-introduction.yaml +0 -80
- package/version.yaml +0 -1
package/operators/_state.yaml
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
# Copyright 2020-2021 Lowdefy, Inc
|
|
2
|
-
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
_ref:
|
|
16
|
-
path: templates/operators.yaml.njk
|
|
17
|
-
transformer: templates/operatorsMethodTransformer.js
|
|
18
|
-
vars:
|
|
19
|
-
pageId: _state
|
|
20
|
-
pageTitle: _state
|
|
21
|
-
filePath: operators/_state.yaml
|
|
22
|
-
env: Client Only
|
|
23
|
-
types: |
|
|
24
|
-
```
|
|
25
|
-
(key: string): any
|
|
26
|
-
(all: boolean): any
|
|
27
|
-
(arguments: {
|
|
28
|
-
all?: boolean,
|
|
29
|
-
key?: string,
|
|
30
|
-
default?: any,
|
|
31
|
-
contextId?: string
|
|
32
|
-
}): any
|
|
33
|
-
```
|
|
34
|
-
description: |
|
|
35
|
-
The `_state` operator gets a value from the [`state`](/context-and-state) object. The `state` is a data object specific to the context it is in. The value of `input` blocks are available in `state`, with their `blockId` as key. By default, `_state` accesses the `state` object from the [`context`](/context-and-state) the operator is used in, but a different context can be specified.
|
|
36
|
-
|
|
37
|
-
arguments: |
|
|
38
|
-
###### string
|
|
39
|
-
If the `_state` operator is called with a string argument, the value of the key in the `state` object is returned. If the value is not found, `null` is returned. Dot notation and [block list indexes](/lists) are supported.
|
|
40
|
-
|
|
41
|
-
###### boolean
|
|
42
|
-
If the `_state` operator is called with boolean argument `true`, the entire `state` object is returned.
|
|
43
|
-
|
|
44
|
-
###### object
|
|
45
|
-
- `all: boolean`: If `all` is set to `true`, the entire `state` object is returned. One of `all` or `key` are required.
|
|
46
|
-
- `key: string`: The value of the key in the `state` object is returned. If the value is not found, `null`, or the specified default value is returned. Dot notation and [block list indexes](/lists) are supported. One of `all` or `key` are required.
|
|
47
|
-
- `default: any`: A value to return if the `key` is not found in `state`. By default, `null` is returned if a value is not found.
|
|
48
|
-
- `contextId: string`: The id of a `context`. Setting this will get the value from the `state` of the specified context. A list of `contexts` that exist are returned by the [`_list_contexts`](/_list_contexts) operator. Cannot be used in `connections` or `requests`.
|
|
49
|
-
examples: |
|
|
50
|
-
###### Get the value of `my_key` from `state`:
|
|
51
|
-
```yaml
|
|
52
|
-
_state: my_key
|
|
53
|
-
```
|
|
54
|
-
```yaml
|
|
55
|
-
_state:
|
|
56
|
-
key: my_key
|
|
57
|
-
```
|
|
58
|
-
Returns: The value of `my_key` in `state`.
|
|
59
|
-
|
|
60
|
-
###### Get the entire `state` object:
|
|
61
|
-
```yaml
|
|
62
|
-
_state: true
|
|
63
|
-
```
|
|
64
|
-
```yaml
|
|
65
|
-
_state:
|
|
66
|
-
all: true
|
|
67
|
-
```
|
|
68
|
-
Returns: The entire `state` object.
|
|
69
|
-
|
|
70
|
-
###### Dot notation:
|
|
71
|
-
Assuming state:
|
|
72
|
-
```yaml
|
|
73
|
-
my_object:
|
|
74
|
-
subfield: 'Value'
|
|
75
|
-
```
|
|
76
|
-
then:
|
|
77
|
-
```yaml
|
|
78
|
-
_state: my_object.subfield
|
|
79
|
-
```
|
|
80
|
-
```yaml
|
|
81
|
-
_state:
|
|
82
|
-
key: my_object.subfield
|
|
83
|
-
```
|
|
84
|
-
Returns: `"Value"`.
|
|
85
|
-
|
|
86
|
-
###### Return a default value if the value is not found:
|
|
87
|
-
```yaml
|
|
88
|
-
_state:
|
|
89
|
-
key: might_not_exist
|
|
90
|
-
default: Default value
|
|
91
|
-
```
|
|
92
|
-
Returns: The value of `might_not_exist`, or `"Default value"`.
|
|
93
|
-
|
|
94
|
-
###### Block list indices:
|
|
95
|
-
Assuming `state`:
|
|
96
|
-
```yaml
|
|
97
|
-
my_array:
|
|
98
|
-
- value: 0
|
|
99
|
-
- value: 1
|
|
100
|
-
- value: 2
|
|
101
|
-
```
|
|
102
|
-
then:
|
|
103
|
-
```yaml
|
|
104
|
-
_state: my_array.$.value
|
|
105
|
-
```
|
|
106
|
-
Returns: `0` when used from the first block (0th index) in a list.
|
|
107
|
-
|
|
108
|
-
###### Get a value from another `context`:
|
|
109
|
-
```yaml
|
|
110
|
-
_state:
|
|
111
|
-
key: my_key
|
|
112
|
-
contextId: 'pageId:contextId:{}'
|
|
113
|
-
```
|
|
114
|
-
Returns: The value of `my_key` in `state` in context `contextId` on page `pageId`.
|
package/operators/_string.yaml
DELETED
|
@@ -1,283 +0,0 @@
|
|
|
1
|
-
# Copyright 2020-2021 Lowdefy, Inc
|
|
2
|
-
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
_ref:
|
|
16
|
-
path: templates/operators.yaml.njk
|
|
17
|
-
transformer: templates/operatorsMethodTransformer.js
|
|
18
|
-
vars:
|
|
19
|
-
pageId: _string
|
|
20
|
-
pageTitle: _string
|
|
21
|
-
filePath: operators/_string.yaml
|
|
22
|
-
description: |
|
|
23
|
-
The `_string` operator can be used to run javascript [`String`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) methods.
|
|
24
|
-
methods:
|
|
25
|
-
- name: charAt
|
|
26
|
-
types: |
|
|
27
|
-
```
|
|
28
|
-
(arguments: {on: string, index: number}): string
|
|
29
|
-
(arguments: [on: string, index: number]): string
|
|
30
|
-
```
|
|
31
|
-
description: |
|
|
32
|
-
The `_string.charAt` method returns a string consisting of [the single UTF-16 code (character) unit located at the specified offset](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt) into the string.
|
|
33
|
-
- name: concat
|
|
34
|
-
types: |
|
|
35
|
-
```
|
|
36
|
-
(strings: string[]): string
|
|
37
|
-
```
|
|
38
|
-
description: |
|
|
39
|
-
The `_string.concat` method [concatenates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/concat) strings.
|
|
40
|
-
- name: endsWith
|
|
41
|
-
types: |
|
|
42
|
-
```
|
|
43
|
-
(arguments: {
|
|
44
|
-
on: string,
|
|
45
|
-
searchString: string,
|
|
46
|
-
length?: number
|
|
47
|
-
}): boolean
|
|
48
|
-
(arguments: [
|
|
49
|
-
on: string,
|
|
50
|
-
searchString: string,
|
|
51
|
-
length?: number
|
|
52
|
-
]): boolean
|
|
53
|
-
```
|
|
54
|
-
description: |
|
|
55
|
-
The `_string.endsWith` method determines whether a string [ends with the characters of a specified string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith), returning `true` or `false` as appropriate.
|
|
56
|
-
- name: includes
|
|
57
|
-
types: |
|
|
58
|
-
```
|
|
59
|
-
(arguments: {
|
|
60
|
-
on: string,
|
|
61
|
-
searchString: string,
|
|
62
|
-
position?: number
|
|
63
|
-
}): boolean
|
|
64
|
-
(arguments: [
|
|
65
|
-
on: string,
|
|
66
|
-
searchString: string,
|
|
67
|
-
position?: number
|
|
68
|
-
]): boolean
|
|
69
|
-
```
|
|
70
|
-
description: |
|
|
71
|
-
The `_string.includes` method determines whether [one string may be found within another string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes), returning `true` or `false` as appropriate.
|
|
72
|
-
- name: indexOf
|
|
73
|
-
types: |
|
|
74
|
-
```
|
|
75
|
-
(arguments: {
|
|
76
|
-
on: string,
|
|
77
|
-
searchValue: string,
|
|
78
|
-
fromIndex?: number
|
|
79
|
-
}): number
|
|
80
|
-
(arguments: [
|
|
81
|
-
on: string,
|
|
82
|
-
searchValue: string,
|
|
83
|
-
fromIndex?: number
|
|
84
|
-
]): number
|
|
85
|
-
```
|
|
86
|
-
description: |
|
|
87
|
-
The `_string.indexOf` method returns the index within string of the [first occurrence of the specified value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf), starting the search at `fromIndex`. Returns `-1` if the value is not found.
|
|
88
|
-
- name: length
|
|
89
|
-
types: |
|
|
90
|
-
```
|
|
91
|
-
(string: string): number
|
|
92
|
-
```
|
|
93
|
-
description: |
|
|
94
|
-
The `_string.length` method returns the [length](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length) of a string.
|
|
95
|
-
- name: lastIndexOf
|
|
96
|
-
types: |
|
|
97
|
-
```
|
|
98
|
-
(arguments: {
|
|
99
|
-
on: string,
|
|
100
|
-
searchValue: string,
|
|
101
|
-
fromIndex?: number
|
|
102
|
-
}): number
|
|
103
|
-
(arguments: [
|
|
104
|
-
on: string,
|
|
105
|
-
searchValue: string,
|
|
106
|
-
fromIndex?: number
|
|
107
|
-
]): number
|
|
108
|
-
```
|
|
109
|
-
description: |
|
|
110
|
-
The `_string.lastIndexOf` method returns the index within string of the [last occurrence of the specified value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/lastIndexOf), searching backwards from `fromIndex`. Returns `-1` if the value is not found.
|
|
111
|
-
- name: match
|
|
112
|
-
types: |
|
|
113
|
-
```
|
|
114
|
-
(arguments: {
|
|
115
|
-
on: string,
|
|
116
|
-
regex: string,
|
|
117
|
-
regexFlags?: string
|
|
118
|
-
}): string[]
|
|
119
|
-
```
|
|
120
|
-
description: |
|
|
121
|
-
The `_string.match` method returns the [result of matching a string against a regular expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match).
|
|
122
|
-
- name: normalize
|
|
123
|
-
types: |
|
|
124
|
-
```
|
|
125
|
-
(arguments: {on: string, form?: enum}): string
|
|
126
|
-
(arguments: [on: string, form?: enum]): string
|
|
127
|
-
```
|
|
128
|
-
description: |
|
|
129
|
-
The `_string.normalize` method returns the [Unicode Normalization Form](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) of the string.
|
|
130
|
-
- name: padEnd
|
|
131
|
-
types: |
|
|
132
|
-
```
|
|
133
|
-
(arguments: {
|
|
134
|
-
on: string,
|
|
135
|
-
targetLength: number,
|
|
136
|
-
padString?: string
|
|
137
|
-
}): string
|
|
138
|
-
(arguments: [
|
|
139
|
-
on: string,
|
|
140
|
-
targetLength: number,
|
|
141
|
-
padString?: string
|
|
142
|
-
]): string
|
|
143
|
-
```
|
|
144
|
-
description: |
|
|
145
|
-
The `_string.padEnd` method [pads the string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) with a given string (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the end of the string.
|
|
146
|
-
- name: padStart
|
|
147
|
-
types: |
|
|
148
|
-
```
|
|
149
|
-
(arguments: {
|
|
150
|
-
on: string,
|
|
151
|
-
targetLength: number,
|
|
152
|
-
padString?: string
|
|
153
|
-
}): string
|
|
154
|
-
(arguments: [
|
|
155
|
-
on: string,
|
|
156
|
-
targetLength: number,
|
|
157
|
-
padString?: string
|
|
158
|
-
]): string
|
|
159
|
-
```
|
|
160
|
-
description: |
|
|
161
|
-
The `_string.padStart` method [pads the string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padEnd) with a given string (repeated, if needed) so that the resulting string reaches a given length. The padding is applied from the start of the string.
|
|
162
|
-
- name: repeat
|
|
163
|
-
types: |
|
|
164
|
-
```
|
|
165
|
-
(arguments: {on: string, count: number}): string
|
|
166
|
-
(arguments: [on: string, count: number]): string
|
|
167
|
-
```
|
|
168
|
-
description: |
|
|
169
|
-
The `_string.repeat` method returns a string which contains [the specified number of copies of the string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat) on which it was called, concatenated together.
|
|
170
|
-
- name: replace
|
|
171
|
-
types: |
|
|
172
|
-
```
|
|
173
|
-
(arguments: {
|
|
174
|
-
on: string,
|
|
175
|
-
regex: string,
|
|
176
|
-
newSubstr: string,
|
|
177
|
-
regexFlags?: string
|
|
178
|
-
}): string
|
|
179
|
-
```
|
|
180
|
-
description: |
|
|
181
|
-
The `_string.replace` method returns a string with [some or all matches of a pattern replaced by a replacement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace).
|
|
182
|
-
- name: search
|
|
183
|
-
types: |
|
|
184
|
-
```
|
|
185
|
-
(arguments: {
|
|
186
|
-
on: string,
|
|
187
|
-
regex: string,
|
|
188
|
-
regexFlags?: string
|
|
189
|
-
}): number
|
|
190
|
-
```
|
|
191
|
-
description: |
|
|
192
|
-
The `_string.search` method executes a [search for a match between a regular expression and a string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search). It returns the index of the first match between the regular expression and the given string, or `-1` if no match was found.
|
|
193
|
-
- name: slice
|
|
194
|
-
types: |
|
|
195
|
-
```
|
|
196
|
-
(arguments: {
|
|
197
|
-
on: string,
|
|
198
|
-
start: number,
|
|
199
|
-
end?: number
|
|
200
|
-
}): string
|
|
201
|
-
(arguments: [
|
|
202
|
-
on: string,
|
|
203
|
-
start: number,
|
|
204
|
-
end?: number
|
|
205
|
-
]): string
|
|
206
|
-
```
|
|
207
|
-
description: |
|
|
208
|
-
The `_string.slice` method [extracts a section](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) of a string.
|
|
209
|
-
- name: split
|
|
210
|
-
types: |
|
|
211
|
-
```
|
|
212
|
-
(arguments: {on: string, separator?: string}): string[]
|
|
213
|
-
(arguments: [on: string, separator?: string]): string[]
|
|
214
|
-
```
|
|
215
|
-
description: |
|
|
216
|
-
The `_string.split` method [divides a string into an array of substrings](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split), splitting on the provided separator.
|
|
217
|
-
- name: startsWith
|
|
218
|
-
types: |
|
|
219
|
-
```
|
|
220
|
-
(arguments: {
|
|
221
|
-
on: string,
|
|
222
|
-
searchString: string,
|
|
223
|
-
position?: number
|
|
224
|
-
}): boolean
|
|
225
|
-
(arguments: [
|
|
226
|
-
on: string,
|
|
227
|
-
searchString: string,
|
|
228
|
-
position?: number
|
|
229
|
-
]): boolean
|
|
230
|
-
```
|
|
231
|
-
description: |
|
|
232
|
-
The `_string.startsWith` method determines whether a string [starts with the characters of a specified string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith), returning `true` or `false` as appropriate.
|
|
233
|
-
- name: substring
|
|
234
|
-
types: |
|
|
235
|
-
```
|
|
236
|
-
(arguments: {
|
|
237
|
-
on: string,
|
|
238
|
-
start: number,
|
|
239
|
-
end?: number
|
|
240
|
-
}): string
|
|
241
|
-
(arguments: [
|
|
242
|
-
on: string,
|
|
243
|
-
start: number,
|
|
244
|
-
end?: number
|
|
245
|
-
]): string
|
|
246
|
-
```
|
|
247
|
-
description: |
|
|
248
|
-
The `_string.startsWith` method returns [the part of the string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring) between the `start` and `end` indexes, or to the end of the string.
|
|
249
|
-
- name: toLowerCase
|
|
250
|
-
types: |
|
|
251
|
-
```
|
|
252
|
-
(string: string): string
|
|
253
|
-
```
|
|
254
|
-
description: |
|
|
255
|
-
The `_string.toLowerCase` method converts the string to [lower case](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase).
|
|
256
|
-
- name: toUpperCase
|
|
257
|
-
types: |
|
|
258
|
-
```
|
|
259
|
-
(string: string): string
|
|
260
|
-
```
|
|
261
|
-
description: |
|
|
262
|
-
The `_string.toUpperCase` method converts the string to [upper case](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase).
|
|
263
|
-
- name: trim
|
|
264
|
-
types: |
|
|
265
|
-
```
|
|
266
|
-
(string: string): string
|
|
267
|
-
```
|
|
268
|
-
description: |
|
|
269
|
-
The `_string.trim` method [removes whitespace from both ends](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) of a string.
|
|
270
|
-
- name: trimEnd
|
|
271
|
-
types: |
|
|
272
|
-
```
|
|
273
|
-
(string: string): string
|
|
274
|
-
```
|
|
275
|
-
description: |
|
|
276
|
-
The `_string.trimEnd` method [removes whitespace from the end](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimEnd) of a string.
|
|
277
|
-
- name: trimStart
|
|
278
|
-
types: |
|
|
279
|
-
```
|
|
280
|
-
(string: string): string
|
|
281
|
-
```
|
|
282
|
-
description: |
|
|
283
|
-
The `_string.trimStart` method [removes whitespace from the start](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trimStart) of a string.
|
package/operators/_subtract.yaml
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
# Copyright 2020-2021 Lowdefy, Inc
|
|
2
|
-
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
_ref:
|
|
16
|
-
path: templates/operators.yaml.njk
|
|
17
|
-
transformer: templates/operatorsMethodTransformer.js
|
|
18
|
-
vars:
|
|
19
|
-
pageId: _subtract
|
|
20
|
-
pageTitle: _subtract
|
|
21
|
-
filePath: operators/_subtract.yaml
|
|
22
|
-
types: |
|
|
23
|
-
```
|
|
24
|
-
([minuend: number, subtrahend: number]): number
|
|
25
|
-
```
|
|
26
|
-
description: |
|
|
27
|
-
The `_subtract` operator takes an array of two numbers as input and returns the second number subtracted from the first.
|
|
28
|
-
arguments: |
|
|
29
|
-
###### array
|
|
30
|
-
An array of two numbers.
|
|
31
|
-
examples: |
|
|
32
|
-
###### Subtract a number:
|
|
33
|
-
```yaml
|
|
34
|
-
_subtract:
|
|
35
|
-
- 12
|
|
36
|
-
- 4
|
|
37
|
-
```
|
|
38
|
-
Returns: `8`
|
package/operators/_sum.yaml
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
# Copyright 2020-2021 Lowdefy, Inc
|
|
2
|
-
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
_ref:
|
|
16
|
-
path: templates/operators.yaml.njk
|
|
17
|
-
transformer: templates/operatorsMethodTransformer.js
|
|
18
|
-
vars:
|
|
19
|
-
pageId: _sum
|
|
20
|
-
pageTitle: _sum
|
|
21
|
-
filePath: operators/_sum.yaml
|
|
22
|
-
types: |
|
|
23
|
-
```
|
|
24
|
-
(values: any[]): number
|
|
25
|
-
```
|
|
26
|
-
description: |
|
|
27
|
-
The `_sum` operator takes the sum of the values given as input. If a value is not a number, the value is skipped.
|
|
28
|
-
arguments: |
|
|
29
|
-
#### array
|
|
30
|
-
An array of values to add.
|
|
31
|
-
examples: |
|
|
32
|
-
###### Two numbers:
|
|
33
|
-
```yaml
|
|
34
|
-
_sum:
|
|
35
|
-
- 3
|
|
36
|
-
- 4
|
|
37
|
-
```
|
|
38
|
-
Returns: `7`
|
|
39
|
-
|
|
40
|
-
###### Array of numbers:
|
|
41
|
-
```yaml
|
|
42
|
-
_sum:
|
|
43
|
-
- 1
|
|
44
|
-
- 2
|
|
45
|
-
- 3
|
|
46
|
-
- 4
|
|
47
|
-
```
|
|
48
|
-
Returns: `10`
|
|
49
|
-
|
|
50
|
-
###### Non-numbers are skipped:
|
|
51
|
-
```yaml
|
|
52
|
-
_sum:
|
|
53
|
-
- 1
|
|
54
|
-
- null
|
|
55
|
-
- 3
|
|
56
|
-
- "four"
|
|
57
|
-
- 5
|
|
58
|
-
```
|
|
59
|
-
Returns: `9`
|
package/operators/_switch.yaml
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# Copyright 2020-2021 Lowdefy, Inc
|
|
2
|
-
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
_ref:
|
|
16
|
-
path: templates/operators.yaml.njk
|
|
17
|
-
transformer: templates/operatorsMethodTransformer.js
|
|
18
|
-
vars:
|
|
19
|
-
pageId: _switch
|
|
20
|
-
pageTitle: _switch
|
|
21
|
-
filePath: operators/_switch.yaml
|
|
22
|
-
types: |
|
|
23
|
-
```
|
|
24
|
-
(arguments: {branches: {if: boolean, then: any}[], default: any}): any
|
|
25
|
-
```
|
|
26
|
-
description: |
|
|
27
|
-
The `_switch` operator evaluates an array of conditions and returns the `then` argument of the first item for which the `if` argument evaluates to `true`. If no condition evaluates to `true`, the value of the `default` argument is returned.
|
|
28
|
-
arguments: |
|
|
29
|
-
###### object
|
|
30
|
-
- `branches:`
|
|
31
|
-
`if: boolean`: The boolean result of a test.
|
|
32
|
-
`then: any`: The value to return if the test is `true`.
|
|
33
|
-
- `default: any`: The value to return if all the `if` tests are `false`.
|
|
34
|
-
examples: |
|
|
35
|
-
###### Return a value based on a series of conditions:
|
|
36
|
-
```yaml
|
|
37
|
-
_switch:
|
|
38
|
-
branches:
|
|
39
|
-
- if:
|
|
40
|
-
_eq:
|
|
41
|
-
- x
|
|
42
|
-
- y
|
|
43
|
-
then: A
|
|
44
|
-
- if:
|
|
45
|
-
_eq:
|
|
46
|
-
- x
|
|
47
|
-
- z
|
|
48
|
-
then: B
|
|
49
|
-
default: C
|
|
50
|
-
```
|
|
51
|
-
Returns: `"C"` since both of the `if` tests are `false`.
|
package/operators/_type.yaml
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# Copyright 2020-2021 Lowdefy, Inc
|
|
2
|
-
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
_ref:
|
|
16
|
-
path: templates/operators.yaml.njk
|
|
17
|
-
transformer: templates/operatorsMethodTransformer.js
|
|
18
|
-
vars:
|
|
19
|
-
pageId: _type
|
|
20
|
-
pageTitle: _type
|
|
21
|
-
filePath: operators/_type.yaml
|
|
22
|
-
types: |
|
|
23
|
-
```
|
|
24
|
-
(type: enum): boolean
|
|
25
|
-
(arguments: {
|
|
26
|
-
type: string,
|
|
27
|
-
on?: any,
|
|
28
|
-
key?: string
|
|
29
|
-
}): boolean
|
|
30
|
-
```
|
|
31
|
-
description: |
|
|
32
|
-
The `_type` operator performs a type test on an object, and returns true if the object is of the specified type.
|
|
33
|
-
|
|
34
|
-
The regex operator has shorthand argument definitions that can be used on web client.
|
|
35
|
-
arguments: |
|
|
36
|
-
###### object
|
|
37
|
-
- `type: enum`: __Required__ - The type to test. Can be one of:
|
|
38
|
-
- `string`
|
|
39
|
-
- `array`
|
|
40
|
-
- `date`
|
|
41
|
-
- `object`
|
|
42
|
-
- `boolean`
|
|
43
|
-
- `number`
|
|
44
|
-
- `integer`
|
|
45
|
-
- `null`
|
|
46
|
-
- `undefined`
|
|
47
|
-
- `none` (`null` or `undefined`)
|
|
48
|
-
- `primitive` (`undefined`, `null`, `string`, `number`, `boolean`, or `date`)
|
|
49
|
-
- `on: any`: The value to test. One of `on` or `key` must be specified unless the operator is used in an input block.
|
|
50
|
-
- `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.
|
|
51
|
-
|
|
52
|
-
###### string
|
|
53
|
-
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.
|
|
54
|
-
examples: |
|
|
55
|
-
###### Check if a value is a number:
|
|
56
|
-
```yaml
|
|
57
|
-
_type:
|
|
58
|
-
type: number
|
|
59
|
-
on:
|
|
60
|
-
_state: input
|
|
61
|
-
```
|
|
62
|
-
Returns: `true` if a number.
|
|
63
|
-
|
|
64
|
-
###### Using the key of the value in `state`:
|
|
65
|
-
```yaml
|
|
66
|
-
_type:
|
|
67
|
-
type: number
|
|
68
|
-
key: input
|
|
69
|
-
```
|
|
70
|
-
Returns: `true` if a number.
|
|
71
|
-
|
|
72
|
-
###### Using the value of the block in which the operator is evaluated:
|
|
73
|
-
```yaml
|
|
74
|
-
id: input
|
|
75
|
-
type: TextInput
|
|
76
|
-
validate:
|
|
77
|
-
- message: This field id required.
|
|
78
|
-
status: error
|
|
79
|
-
pass:
|
|
80
|
-
_not:
|
|
81
|
-
_type: none
|
|
82
|
-
```
|
|
83
|
-
Returns: `true` if the input is none.
|
|
84
|
-
|
|
85
|
-
###### Test if an id in the `urlQuery` is undefined or null:
|
|
86
|
-
```yaml
|
|
87
|
-
_type:
|
|
88
|
-
type: none
|
|
89
|
-
on:
|
|
90
|
-
_url_query: id
|
|
91
|
-
```
|
|
92
|
-
Returns: `true` if the id is none,
|
package/operators/_uri.yaml
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Copyright 2020-2021 Lowdefy, Inc
|
|
2
|
-
|
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
# you may not use this file except in compliance with the License.
|
|
5
|
-
# You may obtain a copy of the License at
|
|
6
|
-
|
|
7
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
|
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
# See the License for the specific language governing permissions and
|
|
13
|
-
# limitations under the License.
|
|
14
|
-
|
|
15
|
-
_ref:
|
|
16
|
-
path: templates/operators.yaml.njk
|
|
17
|
-
transformer: templates/operatorsMethodTransformer.js
|
|
18
|
-
vars:
|
|
19
|
-
pageId: _uri
|
|
20
|
-
pageTitle: _uri
|
|
21
|
-
filePath: operators/_uri.yaml
|
|
22
|
-
description: |
|
|
23
|
-
The `_uri` operator [encodes and decodes](https://en.wikipedia.org/wiki/Percent-encoding) Uniform Resource Identifiers (URI). It encodes characters that are not in the limited US-ASCII characters legal within a URI.
|
|
24
|
-
methods:
|
|
25
|
-
- name: decode
|
|
26
|
-
types: |
|
|
27
|
-
```
|
|
28
|
-
(value: string): string
|
|
29
|
-
```
|
|
30
|
-
description: |
|
|
31
|
-
The `_uri.decode` method decodes a string that has been uri-encoded. It uses [`decodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent).
|
|
32
|
-
arguments: |
|
|
33
|
-
###### string
|
|
34
|
-
The string to decode.
|
|
35
|
-
examples: |
|
|
36
|
-
###### Decode a base64 string:
|
|
37
|
-
```yaml
|
|
38
|
-
_uri.decode: http%3A%2F%2Fusername%3Apassword%40www.example.com%3A80%2Fpath%2Fto%2Ffile.php%3Ffoo%3D316%26bar%3Dthis%2Bhas%2Bspaces%23anchor
|
|
39
|
-
```
|
|
40
|
-
Returns: `"http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor"`.
|
|
41
|
-
- name: encode
|
|
42
|
-
types: |
|
|
43
|
-
```
|
|
44
|
-
(value: string): string
|
|
45
|
-
```
|
|
46
|
-
description: |
|
|
47
|
-
The `_uri.encode` uri-encodes a string. It uses [`encodeURIComponent`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent).
|
|
48
|
-
arguments: |
|
|
49
|
-
###### string
|
|
50
|
-
The string to encode.
|
|
51
|
-
examples: |
|
|
52
|
-
###### Encode a string as base64:
|
|
53
|
-
```yaml
|
|
54
|
-
_uri.encode: http://username:password@www.example.com:80/path/to/file.php?foo=316&bar=this+has+spaces#anchor
|
|
55
|
-
```
|
|
56
|
-
Returns: `"http%3A%2F%2Fusername%3Apassword%40www.example.com%3A80%2Fpath%2Fto%2Ffile.php%3Ffoo%3D316%26bar%3Dthis%2Bhas%2Bspaces%23anchor"`.
|