@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.
Files changed (275) hide show
  1. package/dist/operators/client/filter_default_value.js +55 -0
  2. package/{public/modules/connectDocsearch.js → dist/operatorsClient.js} +1 -19
  3. package/{templates/blocks/schemaTransformer.js → dist/types.js} +5 -10
  4. package/package.json +19 -3
  5. package/404.yaml +0 -26
  6. package/CHANGELOG.md +0 -697
  7. package/actions/CallMethod.yaml +0 -57
  8. package/actions/JsAction.yaml +0 -281
  9. package/actions/Link.yaml +0 -120
  10. package/actions/Login.yaml +0 -123
  11. package/actions/Logout.yaml +0 -44
  12. package/actions/Message.yaml +0 -68
  13. package/actions/Notification.yaml +0 -84
  14. package/actions/Request.yaml +0 -70
  15. package/actions/Reset.yaml +0 -42
  16. package/actions/ResetValidation.yaml +0 -102
  17. package/actions/ScrollTo.yaml +0 -100
  18. package/actions/SetGlobal.yaml +0 -78
  19. package/actions/SetState.yaml +0 -85
  20. package/actions/Throw.yaml +0 -89
  21. package/actions/Validate.yaml +0 -104
  22. package/actions/Wait.yaml +0 -40
  23. package/blocks/all_icons.yaml +0 -803
  24. package/blocks/container/Affix.yaml +0 -26
  25. package/blocks/container/Alert.yaml +0 -27
  26. package/blocks/container/Badge.yaml +0 -27
  27. package/blocks/container/Box.yaml +0 -27
  28. package/blocks/container/Card.yaml +0 -29
  29. package/blocks/container/Collapse.yaml +0 -38
  30. package/blocks/container/Comment.yaml +0 -43
  31. package/blocks/container/ConfirmModal.yaml +0 -36
  32. package/blocks/container/Descriptions.yaml +0 -51
  33. package/blocks/container/Drawer.yaml +0 -46
  34. package/blocks/container/Label.yaml +0 -28
  35. package/blocks/container/Modal.yaml +0 -46
  36. package/blocks/container/PageHCF.yaml +0 -28
  37. package/blocks/container/PageHCSF.yaml +0 -29
  38. package/blocks/container/PageHSCF.yaml +0 -29
  39. package/blocks/container/PageHeaderMenu.yaml +0 -52
  40. package/blocks/container/PageSHCF.yaml +0 -29
  41. package/blocks/container/PageSiderMenu.yaml +0 -53
  42. package/blocks/container/Result.yaml +0 -34
  43. package/blocks/container/Span.yaml +0 -27
  44. package/blocks/container/Spin.yaml +0 -27
  45. package/blocks/container/Tabs.yaml +0 -41
  46. package/blocks/container/Tooltip.yaml +0 -38
  47. package/blocks/display/Anchor.yaml +0 -25
  48. package/blocks/display/Avatar.yaml +0 -23
  49. package/blocks/display/Breadcrumb.yaml +0 -28
  50. package/blocks/display/Button.yaml +0 -43
  51. package/blocks/display/DangerousHtml.yaml +0 -62
  52. package/blocks/display/DangerousMarkdown.yaml +0 -46
  53. package/blocks/display/Divider.yaml +0 -23
  54. package/blocks/display/EChart.yaml +0 -53
  55. package/blocks/display/Html.yaml +0 -50
  56. package/blocks/display/Icon.yaml +0 -23
  57. package/blocks/display/Img.yaml +0 -40
  58. package/blocks/display/Markdown.yaml +0 -31
  59. package/blocks/display/MarkdownWithCode.yaml +0 -46
  60. package/blocks/display/Menu.yaml +0 -48
  61. package/blocks/display/Message.yaml +0 -34
  62. package/blocks/display/MobileMenu.yaml +0 -47
  63. package/blocks/display/Notification.yaml +0 -34
  64. package/blocks/display/Paragraph.yaml +0 -30
  65. package/blocks/display/Progress.yaml +0 -52
  66. package/blocks/display/Skeleton.yaml +0 -27
  67. package/blocks/display/Statistic.yaml +0 -35
  68. package/blocks/display/Title.yaml +0 -32
  69. package/blocks/input/AutoComplete.yaml +0 -30
  70. package/blocks/input/ButtonSelector.yaml +0 -36
  71. package/blocks/input/CheckboxSelector.yaml +0 -36
  72. package/blocks/input/CheckboxSwitch.yaml +0 -56
  73. package/blocks/input/ChromeColorSelector.yaml +0 -24
  74. package/blocks/input/CircleColorSelector.yaml +0 -24
  75. package/blocks/input/ColorSelector.yaml +0 -24
  76. package/blocks/input/CompactColorSelector.yaml +0 -24
  77. package/blocks/input/DateRangeSelector.yaml +0 -26
  78. package/blocks/input/DateSelector.yaml +0 -26
  79. package/blocks/input/DateTimeSelector.yaml +0 -28
  80. package/blocks/input/GithubColorSelector.yaml +0 -24
  81. package/blocks/input/MonthSelector.yaml +0 -26
  82. package/blocks/input/MultipleSelector.yaml +0 -117
  83. package/blocks/input/NumberInput.yaml +0 -24
  84. package/blocks/input/Pagination.yaml +0 -33
  85. package/blocks/input/ParagraphInput.yaml +0 -32
  86. package/blocks/input/PasswordInput.yaml +0 -48
  87. package/blocks/input/RadioSelector.yaml +0 -36
  88. package/blocks/input/RatingSlider.yaml +0 -24
  89. package/blocks/input/S3UploadButton.yaml +0 -28
  90. package/blocks/input/Selector.yaml +0 -98
  91. package/blocks/input/SliderColorSelector.yaml +0 -24
  92. package/blocks/input/SwatchesColorSelector.yaml +0 -24
  93. package/blocks/input/Switch.yaml +0 -24
  94. package/blocks/input/TextArea.yaml +0 -27
  95. package/blocks/input/TextInput.yaml +0 -59
  96. package/blocks/input/TitleInput.yaml +0 -32
  97. package/blocks/input/TwitterColorSelector.yaml +0 -24
  98. package/blocks/input/WeekSelector.yaml +0 -26
  99. package/blocks/list/ControlledList.yaml +0 -191
  100. package/blocks/list/List.yaml +0 -157
  101. package/blocks/list/TimelineList.yaml +0 -136
  102. package/body.html +0 -1
  103. package/concepts/blocks.yaml +0 -249
  104. package/concepts/cli.yaml +0 -173
  105. package/concepts/connections-and-requests.yaml +0 -114
  106. package/concepts/context-and-state.yaml +0 -82
  107. package/concepts/custom-blocks.yaml +0 -190
  108. package/concepts/custom-code.yaml +0 -197
  109. package/concepts/events-and-actions.yaml +0 -224
  110. package/concepts/hosting-files.yaml +0 -50
  111. package/concepts/layout.yaml +0 -1464
  112. package/concepts/lists.yaml +0 -162
  113. package/concepts/lowdefy-schema.yaml +0 -245
  114. package/concepts/operators.yaml +0 -66
  115. package/concepts/overview.yaml +0 -48
  116. package/concepts/secrets.yaml +0 -56
  117. package/connections/AWSS3.yaml +0 -228
  118. package/connections/AmazonRedshift.yaml +0 -75
  119. package/connections/AxiosHttp.yaml +0 -194
  120. package/connections/Elasticsearch.yaml +0 -378
  121. package/connections/GoogleSheet.yaml +0 -332
  122. package/connections/Knex.yaml +0 -181
  123. package/connections/KnexRequests.md +0 -121
  124. package/connections/MSSQL.yaml +0 -90
  125. package/connections/MariaDB.yaml +0 -77
  126. package/connections/MongoDB.yaml +0 -581
  127. package/connections/MySQL.yaml +0 -92
  128. package/connections/OracleDB.yaml +0 -73
  129. package/connections/PostgreSQL.yaml +0 -99
  130. package/connections/Redis.yaml +0 -147
  131. package/connections/SQLite.yaml +0 -94
  132. package/connections/SendGridMail.yaml +0 -113
  133. package/connections/Stripe.yaml +0 -139
  134. package/deployment/aws-lambda.yaml +0 -128
  135. package/deployment/docker.yaml +0 -118
  136. package/deployment/netlify.yaml +0 -69
  137. package/deployment/node-server.yaml +0 -111
  138. package/head.html +0 -7
  139. package/howto/generate-csv.yaml.njk +0 -252
  140. package/howto/generate-pdf.yaml.njk +0 -651
  141. package/howto/generateCsv/lowdefy.yaml +0 -64
  142. package/howto/generateCsv/public/csvMake.js +0 -27
  143. package/howto/generatePdf/inv_template.yaml +0 -200
  144. package/howto/generatePdf/lowdefy.yaml +0 -117
  145. package/howto/generatePdf/my_header.html +0 -1
  146. package/howto/generatePdf/public/logo_example.png +0 -0
  147. package/howto/generatePdf/public/modules/importUmd.js +0 -7
  148. package/howto/generatePdf/public/modules/pdfMake.js +0 -7
  149. package/howto/generatePdf/public/modules/vfs_fonts.js +0 -12
  150. package/howto/use-refrences.md +0 -5
  151. package/introduction.yaml +0 -100
  152. package/lowdefy.yaml +0 -66
  153. package/menus.yaml +0 -832
  154. package/operators/_actions.yaml +0 -123
  155. package/operators/_and.yaml +0 -90
  156. package/operators/_args.yaml +0 -79
  157. package/operators/_array.yaml +0 -326
  158. package/operators/_base64.yaml +0 -56
  159. package/operators/_change_case.yaml +0 -347
  160. package/operators/_date.yaml +0 -71
  161. package/operators/_diff.yaml +0 -75
  162. package/operators/_divide.yaml +0 -46
  163. package/operators/_eq.yaml +0 -67
  164. package/operators/_event.yaml +0 -103
  165. package/operators/_format.yaml +0 -209
  166. package/operators/_function.yaml +0 -66
  167. package/operators/_get.yaml +0 -108
  168. package/operators/_global.yaml +0 -107
  169. package/operators/_gt.yaml +0 -65
  170. package/operators/_gte.yaml +0 -65
  171. package/operators/_hash.yaml +0 -109
  172. package/operators/_if.yaml +0 -44
  173. package/operators/_if_none.yaml +0 -61
  174. package/operators/_index.yaml +0 -65
  175. package/operators/_input.yaml +0 -114
  176. package/operators/_js.yaml +0 -189
  177. package/operators/_json.yaml +0 -128
  178. package/operators/_list_contexts.yaml +0 -37
  179. package/operators/_location.yaml +0 -59
  180. package/operators/_log.yaml +0 -36
  181. package/operators/_lt.yaml +0 -65
  182. package/operators/_lte.yaml +0 -65
  183. package/operators/_math.yaml +0 -374
  184. package/operators/_media.yaml +0 -86
  185. package/operators/_menu.yaml +0 -81
  186. package/operators/_mql.yaml +0 -101
  187. package/operators/_ne.yaml +0 -77
  188. package/operators/_not.yaml +0 -47
  189. package/operators/_number.yaml +0 -157
  190. package/operators/_nunjucks.yaml +0 -73
  191. package/operators/_object.yaml +0 -193
  192. package/operators/_operator.yaml +0 -47
  193. package/operators/_or.yaml +0 -81
  194. package/operators/_product.yaml +0 -59
  195. package/operators/_random.yaml +0 -104
  196. package/operators/_ref.yaml +0 -266
  197. package/operators/_regex.yaml +0 -83
  198. package/operators/_request.yaml +0 -50
  199. package/operators/_secret.yaml +0 -74
  200. package/operators/_state.yaml +0 -114
  201. package/operators/_string.yaml +0 -283
  202. package/operators/_subtract.yaml +0 -38
  203. package/operators/_sum.yaml +0 -59
  204. package/operators/_switch.yaml +0 -51
  205. package/operators/_type.yaml +0 -92
  206. package/operators/_uri.yaml +0 -56
  207. package/operators/_url_query.yaml +0 -120
  208. package/operators/_user.yaml +0 -107
  209. package/operators/_uuid.yaml +0 -114
  210. package/operators/_var.yaml +0 -105
  211. package/operators/_yaml.yaml +0 -107
  212. package/pages.yaml +0 -227
  213. package/public/images/authors/gervwyk.jpeg +0 -0
  214. package/public/images/authors/sandile.jpeg +0 -0
  215. package/public/images/howto/header_generate_csv.jpg +0 -0
  216. package/public/images/howto/header_generate_pdf.jpg +0 -0
  217. package/public/logo_example.png +0 -0
  218. package/public/lowdefy_app_schema.png +0 -0
  219. package/public/modules/csvMake.js +0 -27
  220. package/public/modules/filterDefaultValue.js +0 -48
  221. package/public/modules/importUmd.js +0 -7
  222. package/public/modules/index.js +0 -5
  223. package/public/modules/pdfMake.js +0 -7
  224. package/public/modules/test/filterDefaultValue.test.js +0 -91
  225. package/public/modules/vfs_fonts.js +0 -12
  226. package/public/sitemap.xml +0 -1024
  227. package/templates/actions.yaml.njk +0 -68
  228. package/templates/blocks/defaultValueTransformer.js +0 -53
  229. package/templates/blocks/exampleTransformer.js +0 -81
  230. package/templates/blocks/layout.yaml +0 -114
  231. package/templates/blocks/propertiesFormTransformer.js +0 -419
  232. package/templates/blocks/propertiesGetterTransformer.js +0 -132
  233. package/templates/blocks/schema.yaml.njk +0 -42
  234. package/templates/blocks/style.yaml +0 -26
  235. package/templates/blocks/template.yaml.njk +0 -495
  236. package/templates/blog.yaml.njk +0 -221
  237. package/templates/cli_command.yaml.njk +0 -37
  238. package/templates/footer.yaml.njk +0 -604
  239. package/templates/general.yaml.njk +0 -124
  240. package/templates/generateSitemap.js +0 -41
  241. package/templates/header.yaml +0 -138
  242. package/templates/navigation_buttons.yaml +0 -68
  243. package/templates/operators.yaml.njk +0 -82
  244. package/templates/operatorsMethodTransformer.js +0 -119
  245. package/templates/test/array.test.js +0 -1335
  246. package/templates/test/boolean.test.js +0 -98
  247. package/templates/test/button.test.js +0 -166
  248. package/templates/test/color.test.js +0 -126
  249. package/templates/test/enum.test.js +0 -105
  250. package/templates/test/icon.test.js +0 -109
  251. package/templates/test/integer.test.js +0 -99
  252. package/templates/test/manual.test.js +0 -238
  253. package/templates/test/number.test.js +0 -99
  254. package/templates/test/object.test.js +0 -434
  255. package/templates/test/oneOf.test.js +0 -794
  256. package/templates/test/string.test.js +0 -98
  257. package/templates/test/yaml.test.js +0 -605
  258. package/tutorial/next-steps.yaml +0 -83
  259. package/tutorial/tutorial-actions-operators-config.yaml +0 -142
  260. package/tutorial/tutorial-actions-operators.yaml +0 -436
  261. package/tutorial/tutorial-add-blocks-config.yaml +0 -109
  262. package/tutorial/tutorial-add-blocks.yaml +0 -195
  263. package/tutorial/tutorial-create-page-config.yaml +0 -77
  264. package/tutorial/tutorial-create-page.yaml +0 -196
  265. package/tutorial/tutorial-deploy.yaml +0 -146
  266. package/tutorial/tutorial-requests-config.yaml +0 -186
  267. package/tutorial/tutorial-requests.yaml +0 -338
  268. package/tutorial/tutorial-start.yaml +0 -282
  269. package/users/login-and-logout.yaml +0 -164
  270. package/users/openid-connect.yaml +0 -84
  271. package/users/protected-pages.yaml +0 -67
  272. package/users/roles.yaml +0 -70
  273. package/users/user-object.yaml +0 -73
  274. package/users/users-introduction.yaml +0 -80
  275. package/version.yaml +0 -1
@@ -1,123 +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: _actions
20
- pageTitle: _actions
21
- filePath: operators/_actions.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
- }): any
32
- ```
33
- description: |
34
- The `_actions` operator returns the response value for a preceding action in the same event list.
35
-
36
- The action response object has the following structure:
37
- ```yaml
38
- error: Error,
39
- index: number,
40
- response: any,
41
- skipped: boolean,
42
- type: string,
43
- ```
44
- arguments: |
45
- ###### string
46
- If the `_actions` operator is called with a string equal to a preceding action id in the same event list, the action response object returned. If a string is passed which does not match preceding action id in the same event list, `null` is returned. Dot notation is supported.
47
-
48
- ###### boolean
49
- If the `_actions` operator is called with boolean argument `true`, an object with all the preceding action id responses in the same event list is returned.
50
-
51
- examples: |
52
- ##### Using a action response:
53
- ```yaml
54
- _actions: my_action.response
55
- ```
56
- Returns: The response returned by the action.
57
-
58
- ##### Setting a action response to `state`:
59
- ```yaml
60
- id: refresh
61
- type: Button
62
- events:
63
- onClick:
64
- - id: get_fresh_data
65
- type: Request
66
- skip:
67
- _state: should_not_fetch
68
- params: get_data
69
- - id: set_data
70
- type: SetState
71
- params:
72
- did_not_fetch_data:
73
- _actions: get_fresh_data.skipped
74
- ```
75
-
76
- ##### Setting a returned [`JsAction`](/JsAction) response to `state`:
77
- First register a custom JavaScript action: `getNormalizedEigenvector`
78
- ```yaml
79
- # file: lowdefy.yaml
80
- lowdefy: '3.23.2'
81
- app:
82
- html:
83
- appendHead: |
84
- <script type="text/javascript">
85
- const getNormalizedEigenvector = (context, ...args) => {
86
- const vectorLength = Math.sqrt(args.reduce((acc, curVal) => Math.pow(curVal, 2) + acc), 0);
87
- return args.map(val => val / vectorLength );
88
- }
89
- window.lowdefy.registerJsAction('getNormalizedEigenvector', getNormalizedEigenvector);
90
- </script>
91
- ```
92
- Then, calculate the vector and update state.
93
- ```yaml
94
- # onClick event on a block.
95
- id: calculate
96
- type: Button
97
- events:
98
- onClick:
99
- - id: get_normalized_eigenvector
100
- type: JsAction # TODO:
101
- params:
102
- name: getNormalizedEigenvector
103
- args:
104
- - 1
105
- - 5
106
- - -12
107
- - 7
108
- - 4
109
- - id: update_state
110
- type: SetState
111
- params:
112
- normal_eigenvector:
113
- _actions: get_normalized_eigenvector.response
114
- ```
115
- In this example, state will now be equal to:
116
- ```yaml
117
- normal_eigenvector:
118
- - 0.06523280730534423
119
- - 0.3261640365267211
120
- - -0.7827936876641306
121
- - 0.45662965113740955
122
- - 0.2609312292213769
123
- ```
@@ -1,90 +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: _and
20
- pageTitle: _and
21
- filePath: operators/_and.yaml
22
- types: |
23
- ```
24
- (values: any[]): boolean
25
- ```
26
- description: |
27
- The `_and` operator performs a logical `and` over an array of inputs, using javascript [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy) and [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) rules.
28
-
29
- 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.
30
- arguments: |
31
- ###### array
32
- An array of values over which to perform a logical and.
33
- examples: |
34
- ###### Two `true` values:
35
- ```yaml
36
- _and:
37
- - true
38
- - true
39
- ```
40
- Returns: `true`
41
-
42
- ###### Array of `true` and `false` values:
43
- ```yaml
44
- _and:
45
- - true
46
- - true
47
- - true
48
- - false
49
- ```
50
- Returns: `false`
51
-
52
- ###### Check if two boolean inputs are true:
53
- ```yaml
54
- _and:
55
- - _state: confirm_accept_terms
56
- - _state: confirm_accept_privacy_policy
57
- ```
58
- Returns: `true` if both inputs are `true`
59
-
60
- ###### Truthy values:
61
- ```yaml
62
- _and:
63
- - "Hello"
64
- - 42
65
- - []
66
- - key: value
67
- ```
68
- Returns: `true`
69
-
70
- ###### Falsy values:
71
- ```yaml
72
- _and:
73
- - true
74
- - null
75
- ```
76
- Returns: `false`
77
-
78
- ```yaml
79
- _and:
80
- - true
81
- - 0
82
- ```
83
- Returns: `false`
84
-
85
- ```yaml
86
- _and:
87
- - true
88
- - ""
89
- ```
90
- Returns: `false`
@@ -1,79 +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: _args
20
- pageTitle: _args
21
- filePath: operators/_args.yaml
22
- types: |
23
- ```
24
- (key: string): any
25
- (key: integer): any
26
- (all: boolean): any
27
- (arguments: {
28
- all?: boolean,
29
- key?: string | integer,
30
- default?: any
31
- }): any
32
- ```
33
- description: |
34
- The `_args` operator gets a value from the `arguments` array passed to a function operator. The `arguments` array is an array of all the positional arguments passed to the function.
35
- arguments: |
36
- ###### string
37
- If the `_args` operator is called with a string argument, the value of the key in the `arguments` array is returned. If the value is not found, `null` is returned. Dot notation and [block list indexes](/lists) are supported.
38
-
39
- ###### integer
40
- If the `_args` operator is called with a integer argument, the value at that index in the `arguments` array is returned. If the value is not found, `null` is returned. Dot notation and [block list indexes](/lists) are supported.
41
-
42
- ###### boolean
43
- If the `_args` operator is called with boolean argument `true`, the entire `arguments` array is returned.
44
-
45
- ###### object
46
- - `all: boolean`: If `all` is set to `true`, the entire `arguments` array is returned. One of `all` or `key` are required.
47
- - `key: string | integer`: The value of the key or index in the `arguments` array 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.
48
- - `default: any`: A value to return if the `key` is not found in `arguments`. By default, `null` is returned if a value is not found.
49
- examples: |
50
- ###### Map over an array:
51
-
52
- ```yaml
53
- _array.map:
54
- on:
55
- - firstName: Ted
56
- lastName: Mosby
57
- - firstName: Robin
58
- lastName: Scherbatsky
59
- - firstName: Marshall
60
- lastName: Eriksen
61
- - firstName: Lily
62
- lastName: Aldrin
63
- - firstName: Barney
64
- lastName: Stinson
65
- callback:
66
- _function:
67
- __string.concat:
68
- - __args: 0.firstName
69
- - ' '
70
- - __args: 0.lastName
71
- ```
72
- Returns:
73
- ```yaml
74
- - Ted Mosby
75
- - Robin Scherbatsky
76
- - Marshall Eriksen
77
- - Lily Aldrin
78
- - Barney Stinson
79
- ```
@@ -1,326 +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: _array
20
- pageTitle: _array
21
- filePath: operators/_array.yaml
22
- description: |
23
- The `_array` operator can be used to run javascript [`Array`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array) methods.
24
- methods:
25
- - name: concat
26
- types: |
27
- ```
28
- (arrays: any[][]): any[]
29
- ```
30
- description: |
31
- The `_array.concat` method [concatenates](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat) arrays.
32
- - name: copyWithin
33
- types: |
34
- ```
35
- (arguments: {
36
- on: any[],
37
- target: number,
38
- start?: number,
39
- end?: number
40
- }): any[]
41
- (arguments: [
42
- on: any[],
43
- target: number,
44
- start?: number,
45
- end?: number
46
- ]): any[]
47
- ```
48
- description: |
49
- The `_array.copyWithin` method [copies part of an array to another location in the same array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin) without modifying its length.
50
- - name: every
51
- types: |
52
- ```
53
- (arguments: {
54
- on: any[],
55
- callback: function,
56
- }): boolean
57
- (arguments: [
58
- on: any[],
59
- callback: function,
60
- ]): boolean
61
- ```
62
- description: |
63
- The `_array.every` method tests whether [all elements in the array pass](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every) the test implemented by the provided function. It returns a Boolean value.
64
- - name: fill
65
- types: |
66
- ```
67
- (arguments: {
68
- on: any[],
69
- value: any,
70
- start?: number,
71
- end?: number
72
- }): any[]
73
- (arguments: [
74
- on: any[],
75
- value: number,
76
- start?: number,
77
- end?: number
78
- ]): any[]
79
- ```
80
- description: |
81
- The `_array.fill` method [changes all elements in an array to a static value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill), from a `start` index to an `end` index.
82
- - name: filter
83
- types: |
84
- ```
85
- (arguments: {
86
- on: any[],
87
- callback: function,
88
- }): any[]
89
- (arguments: [
90
- on: any[],
91
- callback: function,
92
- ]): any[]
93
- ```
94
- description: |
95
- The `_array.filter` method returns [an array with all elements that pass the test](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter) implemented by the provided function.
96
- - name: find
97
- types: |
98
- ```
99
- (arguments: {
100
- on: any[],
101
- callback: function,
102
- }): any
103
- (arguments: [
104
- on: any[],
105
- callback: function,
106
- ]): any
107
- ```
108
- description: |
109
- The `_array.find` method returns the value of the [first element in the provided array that satisfies the provided testing function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find). If no values satisfies the testing function, undefined is returned.
110
- - name: findIndex
111
- types: |
112
- ```
113
- (arguments: {
114
- on: any[],
115
- callback: function,
116
- }): number
117
- (arguments: [
118
- on: any[],
119
- callback: function,
120
- ]): number
121
- ```
122
- description: |
123
- The `_array.findIndex` method returns [the index of the first element in the array that satisfies the provided testing function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex). Otherwise, it returns -1, indicating that no element passed the test.
124
- - name: flat
125
- types: |
126
- ```
127
- (arguments: {on: any[], depth?: number}): any[]
128
- (arguments: [on: any[], depth?: number]): any[]
129
- ```
130
- description: |
131
- The `_array.flat` method returns a array with all [sub-array elements concatenated into it recursively](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat) up to the specified `depth`.
132
- - name: includes
133
- types: |
134
- ```
135
- (arguments: {on: any[], value: any}): boolean
136
- (arguments: [on: any[], value: any]): boolean
137
- ```
138
- description: |
139
- The `_array.includes` method determines whether an array [includes a certain value among its entries](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes), returning `true` or `false` as appropriate.
140
- - name: indexOf
141
- types: |
142
- ```
143
- (arguments: {on: any[], value: any}): number
144
- (arguments: [on: any[], value: any]): number
145
- ```
146
- description: |
147
- The `_array.indexOf` method returns the [first index at which a given element can be found](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) in the array, or `-1` if it is not present.
148
- - name: join
149
- types: |
150
- ```
151
- (arguments: {on: any[], separator?: string}): string
152
- (arguments: [on: any[], separator?: string]): string
153
- ```
154
- description: |
155
- The `_array.join` method returns [a string by concatenating all of the elements in an array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join), separated by commas or a specified `separator` string. If the array has only one item, then that item will be returned without using the separator.
156
- - name: lastIndexOf
157
- types: |
158
- ```
159
- (arguments: {on: any[], value: any}): number
160
- (arguments: [on: any[], value: any]): number
161
- ```
162
- description: |
163
- The `_array.lastIndexOf` method returns the [last index at which a given element can be found](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/lastIndexOf) in the array, or -1 if it is not present.
164
- - name: length
165
- types: |
166
- ```
167
- (array: any[]}): number
168
- ```
169
- description: |
170
- The `_array.length` method returns the [number of elements](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length) in the array.
171
- - name: map
172
- types: |
173
- ```
174
- (arguments: {
175
- on: any[],
176
- callback: function,
177
- }): any[]
178
- (arguments: [
179
- on: any[],
180
- callback: function,
181
- ]): any[]
182
- ```
183
- description: |
184
- The `_array.map` method returns an array populated with the results of [calling a provided function on every element](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) in the provided array.
185
- - name: reduce
186
- types: |
187
- ```
188
- (arguments: {
189
- on: any[],
190
- callback: function,
191
- initialValue?: any
192
- }): any
193
- (arguments: [
194
- on: any[],
195
- callback: function,
196
- initialValue?: any
197
- ]): any
198
- ```
199
- description: |
200
- The `_array.reduce` method [executes a reducer function on each element of the array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce), resulting in single output value.
201
- examples: |
202
- The simplest example would probably be adding all the elements in an array:
203
- ```yaml
204
- sum:
205
- _array.reduce:
206
- on: [1, 2, 3, 4]
207
- callback:
208
- _function:
209
- __sum:
210
- - __args: 0
211
- - __args: 1
212
- ```
213
- This will return `sum: 10`
214
-
215
- You can start off by counting from 10 by specifying an `initialValue` for the reducer:
216
- ```yaml
217
- sum:
218
- _array.reduce:
219
- on: [1, 2, 3, 4]
220
- callback:
221
- _function:
222
- __sum:
223
- - __args: 0
224
- - __args: 1
225
- initialValue: 10
226
- ```
227
- This will return `sum: 20`
228
-
229
- You can use the index of the array element to add some logic to your `callback`. For instance, when you reach index 2 of your array (the 3rd entry), add 100 instead of the current element value:
230
- ```yaml
231
- sum:
232
- _array.reduce:
233
- on: [1, 2, 3, 4]
234
- callback:
235
- _function:
236
- __sum:
237
- - __args: 0
238
- - __if:
239
- test:
240
- __eq:
241
- - __args: 2
242
- - 2
243
- then: 100
244
- else:
245
- __args: 1
246
- ```
247
- This will return `sum: 107`
248
-
249
- - name: reduceRight
250
- types: |
251
- ```
252
- (arguments: {
253
- on: any[],
254
- callback: function,
255
- initialValue?: any
256
- }): any
257
- (arguments: [
258
- on: any[],
259
- callback: function,
260
- initialValue?: any
261
- ]): any
262
- ```
263
- description: |
264
- The `_array.reduceRight` method [applies a function against an accumulator and each value of the array (from right-to-left)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/ReduceRight) to reduce it to a single value.
265
- - name: reverse
266
- types: |
267
- ```
268
- (array: any[]}): any[]
269
- ```
270
- description: |
271
- The `_array.reverse` method [reverses](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reverse) an array.
272
- - name: slice
273
- types: |
274
- ```
275
- (arguments: {
276
- on: any[],
277
- start?: number,
278
- end?: number
279
- }): number
280
- (arguments: [
281
- on: any[],
282
- start?: number,
283
- end?: number
284
- ]): number
285
- ```
286
- description: |
287
- The `_array.slice` method returns [a portion of an array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) selected from `start` to `end` (end not included) where `start` and `end` represent the index of items in that array.
288
- - name: some
289
- types: |
290
- ```
291
- (arguments: {
292
- on: any[],
293
- callback: function,
294
- }): boolean
295
- (arguments: [
296
- on: any[],
297
- callback: function,
298
- ]): boolean
299
- ```
300
- description: |
301
- The `_array.some` method tests whether [at least one element in the array passes the test](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) implemented by the provided function. It returns a Boolean value.
302
- - name: sort
303
- types: |
304
- ```
305
- (arguments: {on: any[]}): number
306
- ```
307
- description: |
308
- The `_array.sort` method [sorts](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort) the elements of an array. The sort order is ascending, built upon converting the elements into strings, then comparing their sequences of UTF-16 code units values.
309
- - name: splice
310
- types: |
311
- ```
312
- (arguments: {
313
- on: any[],
314
- start: number,
315
- deleteCount?: number
316
- insert: any[]
317
- }): number
318
- (arguments: {
319
- on: any[],
320
- start: number,
321
- deleteCount?: number,
322
- insert: any[]
323
- }): number
324
- ```
325
- description: |
326
- The `_array.slice` method [changes the contents of an array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) by removing or replacing existing elements and/or adding new elements.
@@ -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: _base64
20
- pageTitle: _base64
21
- filePath: operators/_base64.yaml
22
- description: |
23
- The `_base64` operator converts strings to and from [base64](https://en.wikipedia.org/wiki/Base64) format.
24
- methods:
25
- - name: decode
26
- types: |
27
- ```
28
- (value: string): string
29
- ```
30
- description: |
31
- The `_base64.decode` method decodes base64 encoded content into an ASCII string.
32
- arguments: |
33
- ###### string
34
- The string to decode.
35
- examples: |
36
- ###### Decode a base64 string:
37
- ```yaml
38
- _base64.decode: SGVsbG8=
39
- ```
40
- Returns: `"Hello"`.
41
- - name: encode
42
- types: |
43
- ```
44
- (value: string): string
45
- ```
46
- description: |
47
- The `_base64.encode` method base64 encodes a ASCII string.
48
- arguments: |
49
- ###### string
50
- The string to encode.
51
- examples: |
52
- ###### Encode a string as base64:
53
- ```yaml
54
- _base64.encode: Hello
55
- ```
56
- Returns: `"SGVsbG8="`.