@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,282 +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/general.yaml.njk
17
- vars:
18
- pageId: tutorial-start
19
- pageTitle: 1. Getting started
20
- section: Tutorial
21
- filePath: tutorial/tutorial-start.yaml
22
- prefetchPages:
23
- - tutorial-create-page
24
- content:
25
- - id: tutorial_video
26
- type: DangerousMarkdown
27
- properties:
28
- DOMPurifyOptions:
29
- ADD_TAGS:
30
- - iframe
31
- ADD_ATTR:
32
- - allowfullscreen
33
- - allow
34
- - frameborder
35
- content: |
36
- <iframe
37
- width="800"
38
- height="470"
39
- src="https://www.youtube.com/embed/Cd4Xxxisykg" frameborder="0"
40
- allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
41
- </iframe>
42
- - id: body_start
43
- type: MarkdownWithCode
44
- properties:
45
- content: |
46
- In this tutorial, we will be creating a simple ticketing app, that allows users to file new tickets and see a list of outstanding tickets. The app will write the ticket data to Google Sheets, and we will deploy the app using [Netlify](https://www.netlify.com).
47
-
48
- ### Requirements
49
-
50
- The Lowdefy CLI (Command Line Interface) is needed to run the development server. To run the Lowdefy CLI you need to install Node.js at version 12 or greater. If you don't have it installed, download Node.js from https://nodejs.org/en/download/, and follow the installation steps for your computer. All of the default settings given by the installer are fine for what we need. You will also need a text editor to modify the Lowdefy configuration files.
51
-
52
- #### Step 1.1 - Create a project directory
53
-
54
- Create a directory (folder) on your computer where you would like to create the configuration files for your project. We will be referring to this directory as the project directory
55
-
56
- #### Step 1.2 - Open a command line interface
57
-
58
- Open your computer's command line interface (Windows CMD, Terminal on MacOS), and change directory (`cd`) to the project directory.
59
-
60
- #### Step 1.3 - Initialize an app
61
-
62
- Use the Lowdefy CLI to initialize your project.
63
-
64
- Run the following in your terminal:
65
-
66
- - _ref:
67
- path: templates/cli_command.yaml.njk
68
- vars:
69
- id: init
70
- command: 'npx lowdefy@latest init'
71
-
72
- - id: body_init
73
- type: MarkdownWithCode
74
- properties:
75
- content: |
76
- This will create two files in your current working directory. The first file, called `lowdefy.yaml` is the starting point of your app's configuration. The second, called `.gitignore`, is a hidden file that tells `git`, a version control tool, not to version or upload some specific files.
77
-
78
- > We recommend using [`npx`](https://docs.npmjs.com/cli/v7/commands/npx) to run the Lowdefy CLI, since this ensures your are always running the latest version. You can also install the CLI globally or locally using `npm install lowdefy`
79
-
80
- - id: info_windows_paste
81
- type: Alert
82
- properties:
83
- type: info
84
- icon: AiFilledInfoCircle
85
- description: To paste into the Windows Command Prompt, you can right-click and select paste.
86
-
87
- - id: error_already_exists
88
- type: Alert
89
- properties:
90
- type: error
91
- icon: AiOutlinedFire
92
- message: A "lowdefy.yaml" file already exists
93
- description: If you get a 'A "lowdefy.yaml" file already exists' error, delete the "lowdefy.yaml" file in your current working directory or run the command in a new directory.
94
-
95
- - id: body_start_dev
96
- type: MarkdownWithCode
97
- properties:
98
- content: |
99
- #### Step 1.4 - Start the development server.
100
-
101
- Run:
102
-
103
- - _ref:
104
- path: templates/cli_command.yaml.njk
105
- vars:
106
- id: dev
107
- command: 'npx lowdefy@latest dev'
108
-
109
- - id: body_open_browser
110
- type: MarkdownWithCode
111
- properties:
112
- content: |
113
- Your browser should open on http://localhost:3000, and you should see the following:
114
-
115
- - id: example1
116
- type: PageHeaderMenu
117
- properties:
118
- style:
119
- minHeight: 300px
120
- menu:
121
- links:
122
- - id: welcome
123
- type: MenuLink
124
- properties:
125
- title: welcome
126
-
127
- blocks:
128
- - id: content_card
129
- type: Card
130
- areas:
131
- content:
132
- blocks:
133
- - id: content
134
- type: Result
135
- properties:
136
- title: Welcome to your Lowdefy app
137
- subTitle: We are excited to see what you are going to build
138
- status: success
139
- icon:
140
- name: AiTwoToneHeart
141
- color: '#f00'
142
- areas:
143
- extra:
144
- blocks:
145
- - id: docs_button
146
- type: Button
147
- properties:
148
- size: large
149
- title: Let's build something
150
- events:
151
- onClick:
152
- - id: link_to_docs
153
- type: Link
154
- params:
155
- url: https://docs.lowdefy.com
156
- newTab: true
157
- footer:
158
- blocks:
159
- - id: footer
160
- type: Paragraph
161
- properties:
162
- type: secondary
163
- content: |
164
- Made by a Lowdefy 🤖
165
-
166
- - id: error_could_not_find
167
- type: Alert
168
- properties:
169
- type: error
170
- icon: AiOutlinedFire
171
- message: Could not find "lowdefy.yaml"
172
- description: If you get a 'Could not find "lowdefy.yaml"' error, make sure your current working directory contains the "lowdefy.yaml" file. You can verify this by running the "dir" (Windows) or "ls" (MacOS) command.
173
-
174
- - id: body_edit
175
- type: MarkdownWithCode
176
- properties:
177
- content: |
178
- #### Step 1.5 - Open the configuration file
179
-
180
- Open the `lowdefy.yaml` file using a text editor like [VS Code](https://code.visualstudio.com/download). The content of the file should look like this:
181
-
182
- ```yaml
183
- lowdefy: 3.23.2
184
- name: Lowdefy starter
185
-
186
- pages:
187
- - id: welcome
188
- type: PageHeaderMenu
189
- properties:
190
- title: Welcome
191
- areas:
192
- content:
193
- justify: center
194
- blocks:
195
- - id: content_card
196
- type: Card
197
- style:
198
- maxWidth: 800
199
- blocks:
200
- - id: content
201
- type: Result
202
- properties:
203
- title: Welcome to your Lowdefy app
204
- subTitle: We are excited to see what you are going to build
205
- icon:
206
- name: AiTwoToneHeart
207
- color: '#f00'
208
- areas:
209
- extra:
210
- blocks:
211
- - id: docs_button
212
- type: Button
213
- properties:
214
- size: large
215
- title: Let's build something
216
- color: '#1890ff'
217
- events:
218
- onClick:
219
- - id: link_to_docs
220
- type: Link
221
- params:
222
- url: https://docs.lowdefy.com
223
- newWindow: true
224
- footer:
225
- blocks:
226
- - id: footer
227
- type: Paragraph
228
- properties:
229
- type: secondary
230
- content: |
231
- Made by a Lowdefy 🤖
232
- ```
233
-
234
- This configuration completely describes the app you are running.
235
-
236
-
237
- #### Step 1.6 - Make some changes
238
-
239
- Change some of the text in the app. Change the text `Welcome to your Lowdefy app` to `Hello __YOUR_NAME_HERE__` (filling in your own name). Save the file and browser should automatically refresh, and you should see your changes.
240
-
241
- ### YAML Files
242
-
243
- Lowdefy apps are written using YAML files. YAML files are useful for storing structured data, like the configuration of all of the elements of your app. YAML files focus on being easily readable by humans, this means they don't use lots of syntactic elements like brackets that make it difficult for humans to read, but instead use __indentation to indicate structure__. While this does make the file easier to read, this means care has to be taken that the data structure is as you intended. If you don't have any experience using YAML, this video is a good introduction.
244
- - id: body_yaml_vid
245
- type: DangerousMarkdown
246
- properties:
247
- DOMPurifyOptions:
248
- ADD_TAGS:
249
- - iframe
250
- ADD_ATTR:
251
- - allowfullscreen
252
- - allow
253
- - frameborder
254
- content: |
255
- <iframe
256
- id="ytplayer-yaml-video"
257
- type="text/html"
258
- width="800"
259
- height="470"
260
- src="https://www.youtube.com/embed/cdLNKUoMc6c?origin=https://docs.lowdefy.com"
261
- allowfullscreen="true"
262
- frameborder="0">
263
- </iframe>
264
- - id: body_what_happened
265
- type: Markdown
266
- properties:
267
- content: |
268
- ### What happened
269
-
270
- The Lowdefy CLI helps you develop a Lowdefy app.
271
-
272
- We used the `npx lowdefy@latest init` command to initialize a new project. This created all the essential files.
273
-
274
- We also used the `npx lowdefy@latest dev` command to start a development server. The development server runs a Lowdefy app locally on your computer, which can be accessed at http://localhost:3000. The development server watches your configuration files, and if any of them changes it "builds" (compiles the configuration together for the server to serve) the configuration again and refreshes the browser to show the changes.
275
-
276
- - _ref:
277
- path: templates/navigation_buttons.yaml
278
- vars:
279
- previous_page_title: Introduction
280
- previous_page_id: introduction
281
- next_page_title: Creating a page
282
- next_page_id: tutorial-create-page
@@ -1,164 +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/general.yaml.njk
17
- vars:
18
- pageId: login-and-logout
19
- pageTitle: Login and Logout
20
- section: User Authentication
21
- filePath: concepts/login-and-logout.yaml
22
- content:
23
- - id: introduction
24
- type: MarkdownWithCode
25
- properties:
26
- content: |
27
- The [`Login`](/Login) and [`Logout`](/Logout) actions can be used to log users in and out.
28
-
29
- ## Login
30
-
31
- The `Login` action requests the OpenID provider's authorization URL from the Lowdefy server. The user is redirected to this URL, which normally hosts a login page. If the user is already logged in at the provider, the provider might redirect the user back without requiring a password again.
32
-
33
- After the user has logged in successfully, the user is redirected to the `auth/openid-callback` route in the Lowdefy app, where the rest of the OpenID authorization code flow is completed.
34
-
35
- The parameters of the Login action specify where the user is redirected after login is complete. If the pageId is not set, the user is redirected to the homepage. The parameters are:
36
- - `authUrlQueryParams: object`: Query parameters to set for the authorization URL.
37
- - `pageId: string`: The pageId of the page to redirect to after the login flow is complete
38
- - `input: object`: The input to set for the page the user is redirected to after login.
39
- - `urlQuery: object`: The urlQuery to set for the page the user is redirected to after login.
40
-
41
- The `Login` action can be used to update the `user` object, for example to update the user profile after it has been edited, or to make sure the user token is still valid before editing or creating a record in a database.
42
-
43
- #### Examples
44
-
45
- ###### A login page that redirects users in the onEnter event:
46
- ```yaml
47
- id: login
48
- type: Context
49
- events:
50
- onEnter:
51
- # Redirect to "page1" if user is already logged in.
52
- - id: logged_in_redirect
53
- type: Link
54
- skip:
55
- _eq:
56
- - _user: sub
57
- - null
58
- params: page1
59
- # Call the Login action to log the user in.
60
- - id: login
61
- type: Login
62
- skip:
63
- _ne:
64
- - _user: sub
65
- - null
66
- params:
67
- # Redirect to "page1" after login is complete.
68
- pageId: page1
69
- ```
70
-
71
- ###### A set of login and logout buttons:
72
- ```yaml
73
- id: login_logout
74
- type: Box
75
- blocks:
76
- - id: Login
77
- type: Button
78
- visible:
79
- _eq:
80
- - _user: sub
81
- - null
82
- events:
83
- onClick:
84
- - id: login
85
- type: Login
86
- - id: Logout
87
- type: Button
88
- visible:
89
- _ne:
90
- - _user: sub
91
- - null
92
- events:
93
- onClick:
94
- - id: logout
95
- type: Logout
96
- ```
97
-
98
- ###### A signup button that uses authUrlQueryParams to request the signup screen:
99
- ```yaml
100
- id: Signup
101
- type: Button
102
- events:
103
- onClick:
104
- - id: login
105
- type: Login
106
- params:
107
- authUrlQueryParams:
108
- screen_hint: signup
109
- ```
110
-
111
- ## Logout
112
-
113
- When the `Logout` action is called, the user data and authorization cookie are cleared by the app. The `Logout` action does not take any parameters. The user is then redirected to the URL configured in `logoutRedirectUri`, or the app homepage if this is not configured.
114
-
115
- Some OpenID Connect providers provide a URL that the user can be directed to to logout the user from the the provider. These urls normally have a query parameter that specifies where the provider should redirect the user after they have logged out the user. These redirect URLs are normally configured with the provider.
116
-
117
- The logoutRedirectUri can be a [Nunjucks](https://mozilla.github.io/nunjucks/) template string, with the following template variables:
118
- - `client_id`: The OpenID Connect client ID in `LOWDEFY_SECRET_OPENID_CLIENT_ID`
119
- - `host`: The app host URL. This url includes the URL prefix (`https://` or `http://` if running a development server), and is URI encoded. It is intended to be used as a query parameter.
120
- - `id_token_hint`: The user idToken.
121
- - `openid_domain`: The OpenID Connect client ID in `LOWDEFY_SECRET_OPENID_DOMAIN`.
122
-
123
- #### Examples
124
-
125
- ###### Redirect to the `logged-out` page in the app after logout:
126
- ```yaml
127
- config:
128
- auth:
129
- openId:
130
- logoutRedirectUri: '/logged-out'
131
- ```
132
-
133
- ###### Redirect to the Auth0 logout URL and return to the `logged-out` page in the app after logout:
134
- ```yaml
135
- lowdefy: 3.23.2
136
- config:
137
- auth:
138
- openId:
139
- # Line breaks added for clarity
140
- logoutRedirectUri: "{{ openid_domain }}/v2/logout?\
141
- returnTo={{ host }}/logged-out&\
142
- client_id={{ client_id }}"
143
- ```
144
-
145
- ###### Redirect to the Keycloak logout URL and return to the `logged-out` page in the app after logout:
146
- ```yaml
147
- lowdefy: 3.23.2
148
- config:
149
- auth:
150
- openId:
151
- # Line breaks added for clarity
152
- logoutRedirectUri: "{{ openid_domain }}/protocol/openid-connect/logout?\
153
- post_logout_redirect_uri={{ host }}/logged-out&\
154
- client_id={{ client_id }}&\
155
- id_token_hint={{ id_token_hint }}"
156
- ```
157
-
158
- - _ref:
159
- path: templates/navigation_buttons.yaml
160
- vars:
161
- previous_page_title: OpenID Connect
162
- previous_page_id: openid-connect
163
- next_page_title: Protected pages
164
- next_page_id: protected-pages
@@ -1,84 +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/general.yaml.njk
17
- vars:
18
- pageId: openid-connect
19
- pageTitle: OpenID Connect
20
- section: User Authentication
21
- filePath: users/openid-connect.yaml
22
- content:
23
- - id: open_id_connect_content
24
- type: MarkdownWithCode
25
- properties:
26
- content: |
27
- Lowdefy supports the OpenID Connect standard as a user authorization mechanism. This means to add users to your app, you should setup a OpenID Connect provider. Some popular providers are:
28
-
29
- - [Auth0](https://auth0.com)
30
- - [Gluu](https://gluu.org)
31
- - [Keycloak](https://www.keycloak.org)
32
- - [Microsoft identity platform](https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-overview) (Active Directory)
33
- - [Okta](https://www.okta.com)
34
- - [Ory Hydra](https://www.ory.sh)
35
- - [Ping Identity](https://www.pingidentity.com)
36
- - [Sign In With Google](https://developers.google.com/identity) (Google Workspace is also supported)
37
-
38
- A full list of OpenID Connect providers can be found [here](https://openid.net/developers/certified/).
39
-
40
- ## Configuring an OpenID Connect provider
41
-
42
- To configure an OpenID Connect provider, you need to set the following lowdefy [secrets](/secrets): `OPENID_CLIENT_ID`, `OPENID_CLIENT_SECRET`, `OPENID_DOMAIN`, and `JWT_SECRET`. The can be set by setting the following environment variables:
43
- ```
44
- LOWDEFY_SECRET_OPENID_CLIENT_ID = YOUR_CLIENT_ID
45
- LOWDEFY_SECRET_OPENID_CLIENT_SECRET = YOUR_CLIENT_SECRET
46
- LOWDEFY_SECRET_OPENID_DOMAIN = YOUR_OPENID_DOMAIN
47
- LOWDEFY_SECRET_JWT_SECRET = YOUR_SECRET_KEY
48
- ```
49
-
50
- See the section on JSON Web Tokens below for information about the `JWT_SECRET`.
51
-
52
- If these are not set, the `Login` and `Logout` actions won't work, so users won't be able to log in. However, protected pages will not be served to public users.
53
-
54
- Optional configuration can also be set in the Lowdefy configuration, at the path `config.auth.openId`. The following fields can be set:
55
-
56
- - `scope: string`: _Optional_ - The OpenID Connect scope to request. The default is `openid profile email`. Should contain at least `openid`.
57
- - `logoutRedirectUri: string`: _Optional_ - The URL to redirect to after logout. See more [here](/login-and-logout).
58
-
59
-
60
- Details to configure specific OpenID Connect providers are given [here](/openid-provider-configuration).
61
-
62
- # JSON Web Tokens
63
-
64
- The app will use the `JWT_SECRET` to sign the JSON web tokens (with HS256) used to authorize users. This secret should be a long randomly generated string.
65
-
66
- You can run the following command in the command console to generate the key:
67
- ```bash
68
- node -e "console.log(require('crypto').randomBytes(256).toString('base64'));"
69
- ```
70
-
71
- We recommend using a different key in your development and production environments.
72
-
73
- Optional configuration can also be set in the Lowdefy configuration, at the path `config.auth.jwt`. The following fields can be set:
74
-
75
- - `loginStateExpiresIn: string | number`: The length of time an authorization request token should be valid. The default is 5 minutes. If you expect the user will not log-in immediately then you may want to increase this parameter. Can be expressed as a number in seconds, or a [vercel/ms string](https://github.com/vercel/ms).
76
- - `expiresIn: string | number`: The length of time a user token should be valid. The default is 4 hours. Can be expressed as a number in seconds, or a [vercel/ms string](https://github.com/vercel/ms).
77
-
78
- - _ref:
79
- path: templates/navigation_buttons.yaml
80
- vars:
81
- previous_page_title: Introduction
82
- previous_page_id: introduction
83
- next_page_title: Login and Logout
84
- next_page_id: login-and-logout
@@ -1,67 +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/general.yaml.njk
17
- vars:
18
- pageId: protected-pages
19
- pageTitle: Protected pages
20
- section: User Authentication
21
- filePath: concepts/protected-pages.yaml
22
- content:
23
- - id: introduction
24
- type: MarkdownWithCode
25
- properties:
26
- content: |
27
- By default, all the pages in a Lowdefy app are public. Protected pages are pages that can only be accessed by a logged in user. If a user that is not logged in tries to access a protected page, the user will be redirected to the 404 page. Pages that a user is not allowed to see will be filtered from the app menus.
28
-
29
- The config can either be set to protect all pages, except for a list of public pages, or vise-versa, all pages are public except for a a list of protected pages.
30
-
31
- Protected and public pages can be configured at the path `config.auth.pages` in the Lowdefy configuration. Here the fields `protected` and `public` fields can be set to true, or a list of pageIds. You cannot set `protected` or `public` to `false`, and both can't be an array or `true`.
32
-
33
- When protecting all pages in the app, you will need to set at least one as public, to allow users to log in to the app.
34
-
35
- #### Examples
36
-
37
- ###### List specific public pages:
38
- ```yaml
39
- lowdefy: 3.23.2
40
- config:
41
- auth:
42
- pages:
43
- protected: true
44
- public:
45
- - '404'
46
- - login
47
- - public-page
48
- ````
49
- ###### List specific protected pages:
50
- ```yaml
51
- lowdefy: 3.23.2
52
- config:
53
- auth:
54
- pages:
55
- public: true
56
- protected:
57
- - admin
58
- - users
59
- ````
60
-
61
- - _ref:
62
- path: templates/navigation_buttons.yaml
63
- vars:
64
- previous_page_title: Login and Logout
65
- previous_page_id: login-and-logout
66
- next_page_title: User object
67
- next_page_id: user-object
package/users/roles.yaml DELETED
@@ -1,70 +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/general.yaml.njk
17
- vars:
18
- pageId: roles
19
- pageTitle: Roles
20
- section: User Authentication
21
- filePath: concepts/roles.yaml
22
- content:
23
- - id: introduction
24
- type: MarkdownWithCode
25
- properties:
26
- content: |
27
- Roles can be used to limit user access to certain pages. Only users with the role will be able to see the page, and the page will be filtered from menus if the user does not have the role.
28
-
29
- Roles can be read from a custom claim on the OpenID Connect `idToken`. This should be an array of strings which are the role names. This needs to be configured at the OpenID Connect provider. The field that contains the roles array is configured in the `config.auth.openId` field in the Lowdefy configuration.
30
-
31
- ```yaml
32
- lowdefy: 3.23.2
33
- config:
34
- auth:
35
- openId:
36
- # Field in the user idToken that contains the roles array.
37
- rolesField: [string]
38
- ```
39
-
40
- The pages that are protected by roles are configured in the `config.auth.roles` field in the Lowdefy configuration. This should be an object, where the keys are the role names, and the values are an array of pageIds that are protected by that role.
41
-
42
- #### Examples
43
-
44
- ###### Protect pages using roles:
45
- ```yaml
46
- lowdefy: 3.23.2
47
- config:
48
- auth:
49
- openId:
50
- rolesField: custom_roles
51
- roles:
52
- user-admin:
53
- - users
54
- - new-user
55
- - edit-user
56
- sales:
57
- - customers
58
- - new-customer
59
- - edit-customer
60
- reports:
61
- - sales-report
62
- - operations-report
63
- ````
64
- # - _ref:
65
- # path: templates/navigation_buttons.yaml
66
- # vars:
67
- # previous_page_title: User object
68
- # previous_page_id: user-object
69
- # next_page_title: Provider configuration
70
- # next_page_id: openid-provider-configuration