@lowdefy/docs-content 0.0.0-experimental-20260710073520
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/LICENSE +201 -0
- package/README.md +20 -0
- package/content/actions/callapi.md +66 -0
- package/content/actions/callmethod.md +41 -0
- package/content/actions/copytoclipboard.md +32 -0
- package/content/actions/displaymessage.md +53 -0
- package/content/actions/downloadcsv.md +89 -0
- package/content/actions/fetch.md +50 -0
- package/content/actions/geolocationcurrentposition.md +56 -0
- package/content/actions/link.md +104 -0
- package/content/actions/login.md +85 -0
- package/content/actions/logout.md +56 -0
- package/content/actions/pdfmake.md +304 -0
- package/content/actions/request.md +67 -0
- package/content/actions/reset.md +27 -0
- package/content/actions/resetvalidation.md +85 -0
- package/content/actions/scrollto.md +85 -0
- package/content/actions/setdarkmode.md +62 -0
- package/content/actions/setfocus.md +33 -0
- package/content/actions/setglobal.md +63 -0
- package/content/actions/setlocale.md +69 -0
- package/content/actions/setstate.md +70 -0
- package/content/actions/throw.md +72 -0
- package/content/actions/validate.md +87 -0
- package/content/actions/wait.md +24 -0
- package/content/agents/agent-endpoint-tools.md +190 -0
- package/content/agents/agent-mcp-tools.md +124 -0
- package/content/agents/agent-multi-agent.md +136 -0
- package/content/agents/agent-properties.md +174 -0
- package/content/agents/agent-server-hooks.md +336 -0
- package/content/agents/agentchat.md +515 -0
- package/content/agents/agentconversations.md +148 -0
- package/content/concepts/ai-agent-docs.md +190 -0
- package/content/concepts/cli.md +213 -0
- package/content/concepts/connections-and-requests.md +7 -0
- package/content/concepts/custom-html.md +3 -0
- package/content/concepts/custom-styling.md +161 -0
- package/content/concepts/events-and-actions.md +271 -0
- package/content/concepts/hosting-files.md +18 -0
- package/content/concepts/i18n.md +320 -0
- package/content/concepts/keyboard-shortcuts.md +218 -0
- package/content/concepts/layout-overview.md +478 -0
- package/content/concepts/lists.md +144 -0
- package/content/concepts/logger.md +43 -0
- package/content/concepts/lowdefy-schema.md +365 -0
- package/content/concepts/menus.md +144 -0
- package/content/concepts/module-authoring.md +564 -0
- package/content/concepts/modules.md +338 -0
- package/content/concepts/operators.md +45 -0
- package/content/concepts/overview.md +19 -0
- package/content/concepts/references-and-templates.md +207 -0
- package/content/concepts/secrets.md +24 -0
- package/content/concepts/selectors.md +143 -0
- package/content/connections/amazonredshift.md +176 -0
- package/content/connections/anthropic.md +232 -0
- package/content/connections/awss3.md +313 -0
- package/content/connections/azureblobstorage.md +133 -0
- package/content/connections/elasticsearch.md +371 -0
- package/content/connections/google.md +228 -0
- package/content/connections/googlecloudstorage.md +139 -0
- package/content/connections/googlesheet.md +313 -0
- package/content/connections/knex.md +206 -0
- package/content/connections/mariadb.md +177 -0
- package/content/connections/mcp.md +134 -0
- package/content/connections/mongodb.md +739 -0
- package/content/connections/mssql.md +191 -0
- package/content/connections/mysql.md +192 -0
- package/content/connections/openai-connection.md +228 -0
- package/content/connections/postgresql.md +200 -0
- package/content/connections/redis.md +116 -0
- package/content/connections/sendgridmail.md +94 -0
- package/content/connections/smtp.md +149 -0
- package/content/connections/sqlite.md +187 -0
- package/content/connections/stripe.md +115 -0
- package/content/container-blocks/affix.md +413 -0
- package/content/container-blocks/alert.md +937 -0
- package/content/container-blocks/badge.md +1222 -0
- package/content/container-blocks/box.md +1453 -0
- package/content/container-blocks/card.md +1200 -0
- package/content/container-blocks/carousel.md +2247 -0
- package/content/container-blocks/collapse.md +1335 -0
- package/content/container-blocks/configprovider.md +1070 -0
- package/content/container-blocks/confirmmodal.md +1159 -0
- package/content/container-blocks/content.md +597 -0
- package/content/container-blocks/descriptions.md +870 -0
- package/content/container-blocks/drawer.md +1379 -0
- package/content/container-blocks/dropdownmenu.md +643 -0
- package/content/container-blocks/flex.md +1510 -0
- package/content/container-blocks/footer.md +380 -0
- package/content/container-blocks/googlemaps.md +546 -0
- package/content/container-blocks/googlemapsheatmap.md +607 -0
- package/content/container-blocks/googlemapsscript.md +61 -0
- package/content/container-blocks/header.md +302 -0
- package/content/container-blocks/label.md +739 -0
- package/content/container-blocks/layout.md +604 -0
- package/content/container-blocks/masonry.md +1090 -0
- package/content/container-blocks/mobilemenu.md +1244 -0
- package/content/container-blocks/modal.md +1180 -0
- package/content/container-blocks/pageheadermenu.md +614 -0
- package/content/container-blocks/pagesidebarlayout.md +438 -0
- package/content/container-blocks/pagesidermenu.md +651 -0
- package/content/container-blocks/popover.md +1421 -0
- package/content/container-blocks/result.md +972 -0
- package/content/container-blocks/sider.md +1064 -0
- package/content/container-blocks/span.md +747 -0
- package/content/container-blocks/spinner.md +267 -0
- package/content/container-blocks/splitter.md +1735 -0
- package/content/container-blocks/tabs.md +1718 -0
- package/content/container-blocks/tooltip.md +1274 -0
- package/content/container-blocks/watermark.md +515 -0
- package/content/controls/for.md +103 -0
- package/content/controls/if.md +107 -0
- package/content/controls/log.md +50 -0
- package/content/controls/parallel.md +71 -0
- package/content/controls/parallel_for.md +36 -0
- package/content/controls/reject.md +56 -0
- package/content/controls/return.md +66 -0
- package/content/controls/set_state.md +98 -0
- package/content/controls/switch.md +90 -0
- package/content/controls/throw.md +79 -0
- package/content/controls/try.md +88 -0
- package/content/deployment/docker.md +149 -0
- package/content/deployment/node-server.md +27 -0
- package/content/deployment/vercel.md +101 -0
- package/content/display-blocks/aggrid.md +1459 -0
- package/content/display-blocks/anchor.md +336 -0
- package/content/display-blocks/avatar.md +1154 -0
- package/content/display-blocks/breadcrumb.md +517 -0
- package/content/display-blocks/button.md +758 -0
- package/content/display-blocks/calendar.md +156 -0
- package/content/display-blocks/dangeroushtml.md +314 -0
- package/content/display-blocks/dangerousmarkdown.md +423 -0
- package/content/display-blocks/diffgit.md +44 -0
- package/content/display-blocks/difflist.md +225 -0
- package/content/display-blocks/diffsidebyside.md +56 -0
- package/content/display-blocks/difftimeline.md +94 -0
- package/content/display-blocks/divider.md +406 -0
- package/content/display-blocks/download.md +60 -0
- package/content/display-blocks/dropdownbutton.md +661 -0
- package/content/display-blocks/echart.md +418 -0
- package/content/display-blocks/floatbutton.md +545 -0
- package/content/display-blocks/html.md +311 -0
- package/content/display-blocks/icon.md +717 -0
- package/content/display-blocks/img.md +479 -0
- package/content/display-blocks/markdown.md +520 -0
- package/content/display-blocks/markdownwithcode.md +730 -0
- package/content/display-blocks/menu.md +1123 -0
- package/content/display-blocks/message.md +941 -0
- package/content/display-blocks/notification.md +1410 -0
- package/content/display-blocks/paragraph.md +643 -0
- package/content/display-blocks/progress.md +818 -0
- package/content/display-blocks/qrcode.md +519 -0
- package/content/display-blocks/s3download.md +240 -0
- package/content/display-blocks/search.md +360 -0
- package/content/display-blocks/skeleton.md +272 -0
- package/content/display-blocks/skeletonavatar.md +222 -0
- package/content/display-blocks/skeletonbutton.md +245 -0
- package/content/display-blocks/skeletoninput.md +223 -0
- package/content/display-blocks/skeletonparagraph.md +201 -0
- package/content/display-blocks/statistic.md +485 -0
- package/content/display-blocks/steps.md +585 -0
- package/content/display-blocks/tag.md +620 -0
- package/content/display-blocks/title.md +654 -0
- package/content/display-blocks/tour.md +2359 -0
- package/content/input-blocks/autocomplete.md +786 -0
- package/content/input-blocks/buttonselector.md +964 -0
- package/content/input-blocks/checkboxselector.md +765 -0
- package/content/input-blocks/checkboxswitch.md +497 -0
- package/content/input-blocks/colorselector.md +884 -0
- package/content/input-blocks/daterangeselector.md +777 -0
- package/content/input-blocks/dateselector.md +693 -0
- package/content/input-blocks/datetimeselector.md +791 -0
- package/content/input-blocks/inputgallery.md +528 -0
- package/content/input-blocks/monthselector.md +717 -0
- package/content/input-blocks/multipleselector.md +1337 -0
- package/content/input-blocks/numberinput.md +855 -0
- package/content/input-blocks/pagination.md +679 -0
- package/content/input-blocks/paragraphinput.md +1664 -0
- package/content/input-blocks/passwordinput.md +480 -0
- package/content/input-blocks/phonenumberinput.md +688 -0
- package/content/input-blocks/radioselector.md +820 -0
- package/content/input-blocks/ratingslider.md +684 -0
- package/content/input-blocks/s3uploadbutton.md +384 -0
- package/content/input-blocks/s3uploaddragger.md +305 -0
- package/content/input-blocks/s3uploadphoto.md +288 -0
- package/content/input-blocks/segmentedselector.md +782 -0
- package/content/input-blocks/selector.md +1162 -0
- package/content/input-blocks/switch.md +552 -0
- package/content/input-blocks/textarea.md +714 -0
- package/content/input-blocks/textinput.md +639 -0
- package/content/input-blocks/tiptapinput.md +226 -0
- package/content/input-blocks/tiptapmentioninput.md +471 -0
- package/content/input-blocks/titleinput.md +1094 -0
- package/content/input-blocks/treeinput.md +144 -0
- package/content/input-blocks/treemultipleselector.md +162 -0
- package/content/input-blocks/treeselector.md +185 -0
- package/content/input-blocks/upload.md +149 -0
- package/content/input-blocks/uploaddragger.md +85 -0
- package/content/input-blocks/uploadphoto.md +84 -0
- package/content/input-blocks/weekselector.md +630 -0
- package/content/list-blocks/controlledlist.md +498 -0
- package/content/list-blocks/list.md +529 -0
- package/content/list-blocks/listselector.md +301 -0
- package/content/list-blocks/masonrylist.md +230 -0
- package/content/migration/upgrade-guide.md +106 -0
- package/content/migration/v4-to-v5.md +589 -0
- package/content/migration/v5-to-v6.md +36 -0
- package/content/operators/_actions.md +58 -0
- package/content/operators/_and.md +76 -0
- package/content/operators/_api.md +254 -0
- package/content/operators/_app.md +114 -0
- package/content/operators/_args.md +65 -0
- package/content/operators/_array.md +331 -0
- package/content/operators/_base64.md +49 -0
- package/content/operators/_boolean.md +33 -0
- package/content/operators/_build.md +166 -0
- package/content/operators/_change_case.md +357 -0
- package/content/operators/_date.md +415 -0
- package/content/operators/_dayjs.md +128 -0
- package/content/operators/_diff.md +61 -0
- package/content/operators/_divide.md +32 -0
- package/content/operators/_eq.md +52 -0
- package/content/operators/_event.md +86 -0
- package/content/operators/_function.md +52 -0
- package/content/operators/_get.md +92 -0
- package/content/operators/_global.md +86 -0
- package/content/operators/_gt.md +50 -0
- package/content/operators/_gte.md +50 -0
- package/content/operators/_hash.md +112 -0
- package/content/operators/_if.md +30 -0
- package/content/operators/_if_none.md +47 -0
- package/content/operators/_index.md +48 -0
- package/content/operators/_input.md +86 -0
- package/content/operators/_intl.md +135 -0
- package/content/operators/_item.md +166 -0
- package/content/operators/_js.md +113 -0
- package/content/operators/_json.md +120 -0
- package/content/operators/_jsonata.md +152 -0
- package/content/operators/_locale.md +65 -0
- package/content/operators/_location.md +40 -0
- package/content/operators/_log.md +22 -0
- package/content/operators/_lt.md +50 -0
- package/content/operators/_lte.md +50 -0
- package/content/operators/_math.md +407 -0
- package/content/operators/_media.md +83 -0
- package/content/operators/_menu.md +62 -0
- package/content/operators/_module.md +340 -0
- package/content/operators/_mql.md +95 -0
- package/content/operators/_ne.md +62 -0
- package/content/operators/_not.md +33 -0
- package/content/operators/_number.md +159 -0
- package/content/operators/_nunjucks.md +117 -0
- package/content/operators/_object.md +253 -0
- package/content/operators/_operator.md +33 -0
- package/content/operators/_or.md +67 -0
- package/content/operators/_product.md +45 -0
- package/content/operators/_random.md +90 -0
- package/content/operators/_ref.md +80 -0
- package/content/operators/_regex.md +69 -0
- package/content/operators/_request.md +35 -0
- package/content/operators/_request_details.md +29 -0
- package/content/operators/_secret.md +56 -0
- package/content/operators/_state.md +134 -0
- package/content/operators/_step.md +98 -0
- package/content/operators/_string.md +327 -0
- package/content/operators/_subtract.md +24 -0
- package/content/operators/_sum.md +45 -0
- package/content/operators/_switch.md +37 -0
- package/content/operators/_t.md +96 -0
- package/content/operators/_theme.md +65 -0
- package/content/operators/_type.md +78 -0
- package/content/operators/_uri.md +49 -0
- package/content/operators/_url_query.md +92 -0
- package/content/operators/_user.md +154 -0
- package/content/operators/_uuid.md +118 -0
- package/content/operators/_var.md +88 -0
- package/content/operators/_yaml.md +96 -0
- package/content/other/introduction.md +39 -0
- package/content/other/next-auth-providers.md +3 -0
- package/content/other/updatesession.md +26 -0
- package/content/plugins/plugins-actions.md +80 -0
- package/content/plugins/plugins-connections.md +98 -0
- package/content/plugins/plugins-dev.md +138 -0
- package/content/plugins/plugins-introduction.md +29 -0
- package/content/plugins/plugins-operators.md +71 -0
- package/content/testing/e2e-auth.md +108 -0
- package/content/testing/e2e-configuration.md +107 -0
- package/content/testing/e2e-getting-started.md +96 -0
- package/content/testing/e2e-introduction.md +53 -0
- package/content/testing/e2e-mocking.md +155 -0
- package/content/testing/e2e-writing-tests.md +214 -0
- package/content/tutorial/tutorial-actions-operators.md +222 -0
- package/content/tutorial/tutorial-add-blocks.md +86 -0
- package/content/tutorial/tutorial-create-page.md +57 -0
- package/content/tutorial/tutorial-display-data-page.md +181 -0
- package/content/tutorial/tutorial-next-steps.md +53 -0
- package/content/tutorial/tutorial-requests-sql.md +22 -0
- package/content/tutorial/tutorial-start.md +71 -0
- package/content/user-authentication/auth-providers.md +15 -0
- package/content/user-authentication/login-and-logout.md +122 -0
- package/content/user-authentication/users-introduction.md +31 -0
- package/index.json +2281 -0
- package/package.json +34 -0
- package/scripts/extractAgentDocs.js +130 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# :log
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
({:log: any, :level: string}): void
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `:log` control outputs messages to the server console at specified log levels (debug, info, warn, error).
|
|
8
|
+
|
|
9
|
+
#### Keys
|
|
10
|
+
|
|
11
|
+
- `:log: any`: __Required__ - The value to be log to the console.
|
|
12
|
+
- `:level: string`: Level of log. One of debug, info, warn, error. The default is info.
|
|
13
|
+
|
|
14
|
+
#### Examples
|
|
15
|
+
|
|
16
|
+
###### String Message
|
|
17
|
+
```yaml
|
|
18
|
+
:log: 'New Log Message'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
###### Log a JSON Object
|
|
22
|
+
```yaml
|
|
23
|
+
:log:
|
|
24
|
+
message: Log Message
|
|
25
|
+
user_id:
|
|
26
|
+
_user: id
|
|
27
|
+
timestamp:
|
|
28
|
+
_date: now
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
###### Set log levels
|
|
32
|
+
```yaml
|
|
33
|
+
- :log:
|
|
34
|
+
payload:
|
|
35
|
+
_payload: true
|
|
36
|
+
:level: debug
|
|
37
|
+
- :log: 'Processing started'
|
|
38
|
+
:level: 'info'
|
|
39
|
+
- :log:
|
|
40
|
+
message: Multiple failed attempts
|
|
41
|
+
attempts:
|
|
42
|
+
_payload: attempt_count
|
|
43
|
+
user:
|
|
44
|
+
_user: id
|
|
45
|
+
:level: warn
|
|
46
|
+
- :log:
|
|
47
|
+
message: An error occurred.
|
|
48
|
+
|
|
49
|
+
:level: error
|
|
50
|
+
```
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# :parallel
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
({:parallel: routine[]}): void
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `:parallel` control executes multiple independent routines simultaneously. All routines within the `:parallel` array are started at the same time and the control waits for all of them to complete before continuing. If any routine returns with an error, rejection, or explicit return, the parallel control will exit early with that status (prioritizing errors first, then rejections, then returns).
|
|
8
|
+
|
|
9
|
+
#### Keys
|
|
10
|
+
|
|
11
|
+
- `:parallel: routine[]`: __Required__ - An array of routines that will be executed in parallel.
|
|
12
|
+
|
|
13
|
+
#### Examples
|
|
14
|
+
|
|
15
|
+
###### Fetch from multiple sources in parallel
|
|
16
|
+
|
|
17
|
+
```yaml
|
|
18
|
+
routine:
|
|
19
|
+
- :parallel:
|
|
20
|
+
- id: fetch_user_stats
|
|
21
|
+
type: MongoDBAggregation
|
|
22
|
+
connectionId: users
|
|
23
|
+
properties:
|
|
24
|
+
pipeline:
|
|
25
|
+
- $match:
|
|
26
|
+
account_id:
|
|
27
|
+
_payload: account_id
|
|
28
|
+
- $group:
|
|
29
|
+
_id: null
|
|
30
|
+
total_users:
|
|
31
|
+
$sum: 1
|
|
32
|
+
active_users:
|
|
33
|
+
$sum:
|
|
34
|
+
$cond:
|
|
35
|
+
- $eq: ['$status', 'active']
|
|
36
|
+
- 1
|
|
37
|
+
- 0
|
|
38
|
+
|
|
39
|
+
- id: fetch_revenue
|
|
40
|
+
type: KnexRaw
|
|
41
|
+
connectionId: analytics_db
|
|
42
|
+
properties:
|
|
43
|
+
query: |
|
|
44
|
+
SELECT
|
|
45
|
+
SUM(amount) as total_revenue,
|
|
46
|
+
COUNT(*) as transaction_count
|
|
47
|
+
FROM transactions
|
|
48
|
+
WHERE account_id = :account_id
|
|
49
|
+
AND created_at >= NOW() - INTERVAL '30 days'
|
|
50
|
+
parameters:
|
|
51
|
+
account_id:
|
|
52
|
+
_payload: account_id
|
|
53
|
+
|
|
54
|
+
- id: fetch_tickets
|
|
55
|
+
type: AxiosHttp
|
|
56
|
+
connectionId: tickets-api
|
|
57
|
+
properties:
|
|
58
|
+
url: '/tickets'
|
|
59
|
+
method: get
|
|
60
|
+
params:
|
|
61
|
+
organization_id:
|
|
62
|
+
_payload: account_id
|
|
63
|
+
status: 'open'
|
|
64
|
+
- :return:
|
|
65
|
+
user_stats:
|
|
66
|
+
_step: fetch_user_stats
|
|
67
|
+
revenue:
|
|
68
|
+
_step: revenue
|
|
69
|
+
tickets:
|
|
70
|
+
_step: fetch_tickets
|
|
71
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# :parallel_for
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
({:parallel_for: string, :in: any[], :do: routine}): void
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `:parallel_for` control executes a routine for each item in an array simultaneously. Each iteration has access to its array item through the [`_item`](/_item) operator using the key specified in `:parallel_for`.
|
|
8
|
+
Unlike sequential [`:for`](/:for), all iterations start at the same time, making it ideal for processing independent items where order doesn't matter.
|
|
9
|
+
The control waits for all iterations to complete before continuing, unless an error, rejection, or return occurs.
|
|
10
|
+
|
|
11
|
+
#### Keys
|
|
12
|
+
|
|
13
|
+
- `:parallel_for: string`: __Required__ - Used to define the key that can be used to access the value of the array item of the executing iteration.
|
|
14
|
+
- `:in: any`: __Required__ - Used to define the array of data to iterate over.
|
|
15
|
+
- `:do: routine`: __Required__ - Used to define the routine that will be executed for each array item in parallel.
|
|
16
|
+
|
|
17
|
+
#### Examples
|
|
18
|
+
|
|
19
|
+
###### Update Multiple Users
|
|
20
|
+
```yaml
|
|
21
|
+
- :parallel_for: user_id
|
|
22
|
+
:in:
|
|
23
|
+
_payload: user_ids
|
|
24
|
+
:do:
|
|
25
|
+
id: update_last_seen
|
|
26
|
+
type: MongoDBUpdateOne
|
|
27
|
+
connectionId: users
|
|
28
|
+
properties:
|
|
29
|
+
filter:
|
|
30
|
+
_id:
|
|
31
|
+
_item: user_id
|
|
32
|
+
update:
|
|
33
|
+
$set:
|
|
34
|
+
last_seen:
|
|
35
|
+
_date: now
|
|
36
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# :reject
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
({:reject: string, :cause: any}): void
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `:reject` control is used to return a user-friendly error to the client when validation fails or business rules are violated.
|
|
8
|
+
Unlike [`:throw`](/:throw), which indicates a system error, `:reject` represents an expected failure condition that should be communicated to the user.
|
|
9
|
+
The control immediately stops routine execution and returns with a `"reject"` status.
|
|
10
|
+
Importantly, `:reject` does not trigger `:catch` blocks in [`:try`](/:try) statements, making it ideal for handling validation and business logic errors separately from system errors.
|
|
11
|
+
|
|
12
|
+
#### Keys
|
|
13
|
+
|
|
14
|
+
- `:reject: string`: __Required__ - The error message that will be returned in the response object of the API call result.
|
|
15
|
+
- `:cause: any`: Additional metadata that will be returned with the error message.
|
|
16
|
+
|
|
17
|
+
#### Examples
|
|
18
|
+
|
|
19
|
+
###### Example
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
- id: check_inventory
|
|
23
|
+
type: MongoDBFindOne
|
|
24
|
+
connectionId: products
|
|
25
|
+
properties:
|
|
26
|
+
query:
|
|
27
|
+
product_id:
|
|
28
|
+
_payload: product_id
|
|
29
|
+
- :if:
|
|
30
|
+
_lt:
|
|
31
|
+
- _step: check_inventory.quantity
|
|
32
|
+
- _payload: requested_quantity
|
|
33
|
+
:then:
|
|
34
|
+
:reject:
|
|
35
|
+
_string.concat:
|
|
36
|
+
- "Insufficient inventory. Only "
|
|
37
|
+
- _step: check_inventory.quantity
|
|
38
|
+
- " items available"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
###### Reject with Additional Context
|
|
42
|
+
|
|
43
|
+
```yaml
|
|
44
|
+
- :if:
|
|
45
|
+
_not:
|
|
46
|
+
_step: get_user.email_verified
|
|
47
|
+
:then:
|
|
48
|
+
:reject: "Please verify your email before proceeding"
|
|
49
|
+
:cause:
|
|
50
|
+
user_id:
|
|
51
|
+
_step: get_user._id
|
|
52
|
+
email:
|
|
53
|
+
_step: get_user.email
|
|
54
|
+
account_created_at:
|
|
55
|
+
_step: get_user.created_at
|
|
56
|
+
```
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# :return
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
({:return: any}): void
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `:return` control immediately ends the execution of an API endpoint routine and returns a successful response with the specified data.
|
|
8
|
+
Any routine steps after a `:return` are not executed. The control accepts any value type (objects, arrays, strings, numbers, null) and marks the API call as successful.
|
|
9
|
+
When used within conditional controls like [`:if`](/:if) or [`:switch`](/:switch), it provides a way to exit early with a success status and return data to the client.
|
|
10
|
+
|
|
11
|
+
The `:return` control also works in client [event action lists](/events-and-actions) — it ends the whole event successfully, the event's `catch` actions do not run, and any actions after it are recorded as skipped. Inside a `catch` action list, `:return` ends the remaining catch actions the same way, but the event keeps its error result — `success` stays `false`.
|
|
12
|
+
|
|
13
|
+
#### Keys
|
|
14
|
+
|
|
15
|
+
- `:return: any`: __Required__ - The value that will be returned in the response object of the API call result.
|
|
16
|
+
|
|
17
|
+
#### Examples
|
|
18
|
+
|
|
19
|
+
###### Return Step Result
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
- id: get_company
|
|
23
|
+
type: MongoDBInsertOne
|
|
24
|
+
connectionId: companies
|
|
25
|
+
properties:
|
|
26
|
+
doc:
|
|
27
|
+
_id:
|
|
28
|
+
_payload: company_id
|
|
29
|
+
- :return:
|
|
30
|
+
_step: get_company
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
###### Switch with multiple returns
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
- id: get_user_subscription
|
|
37
|
+
type: MongoDBFindOne
|
|
38
|
+
connectionId: subscriptions
|
|
39
|
+
properties:
|
|
40
|
+
query:
|
|
41
|
+
user_id:
|
|
42
|
+
_user: id
|
|
43
|
+
- :switch:
|
|
44
|
+
- :case:
|
|
45
|
+
_not:
|
|
46
|
+
_step: get_user_subscription
|
|
47
|
+
:then:
|
|
48
|
+
:return:
|
|
49
|
+
plan: "free"
|
|
50
|
+
features: ["basic_access"]
|
|
51
|
+
limit: 10
|
|
52
|
+
- :case:
|
|
53
|
+
_eq:
|
|
54
|
+
- _step: get_user_subscription.type
|
|
55
|
+
- "premium"
|
|
56
|
+
:then:
|
|
57
|
+
:return:
|
|
58
|
+
plan: "premium"
|
|
59
|
+
features: ["full_access", "priority_support", "api_access"]
|
|
60
|
+
limit: -1
|
|
61
|
+
:default:
|
|
62
|
+
:return:
|
|
63
|
+
plan: "standard"
|
|
64
|
+
features: ["standard_access", "email_support"]
|
|
65
|
+
limit: 100
|
|
66
|
+
```
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# :set_state
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
({:set_state: object}): void
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `:set_state` control sets values in the server-side state object during API endpoint execution.
|
|
8
|
+
It accepts an object where each key-value pair is saved to the state, making data available throughout the routine via the `_state` operator.
|
|
9
|
+
This server state is isolated to the current API call and does not persist between calls or affect client state. The control supports nested paths using dot notation and can store any data type.
|
|
10
|
+
Values are evaluated before being set, allowing dynamic state updates based on previous operations.
|
|
11
|
+
|
|
12
|
+
#### Keys
|
|
13
|
+
|
|
14
|
+
- `:set_state: object`: __Required__ - Object to be saved to server state.
|
|
15
|
+
|
|
16
|
+
#### Examples
|
|
17
|
+
|
|
18
|
+
###### Accumulating Values
|
|
19
|
+
```yaml
|
|
20
|
+
- :set_state:
|
|
21
|
+
total: 0
|
|
22
|
+
count: 0
|
|
23
|
+
- :for: product
|
|
24
|
+
:in:
|
|
25
|
+
_payload: products
|
|
26
|
+
:do:
|
|
27
|
+
- :set_state:
|
|
28
|
+
total:
|
|
29
|
+
_sum:
|
|
30
|
+
- _state: total
|
|
31
|
+
- _item: product.price
|
|
32
|
+
count:
|
|
33
|
+
_sum:
|
|
34
|
+
- _state: processed_count
|
|
35
|
+
- 1
|
|
36
|
+
- :return:
|
|
37
|
+
total:
|
|
38
|
+
_state: total
|
|
39
|
+
count:
|
|
40
|
+
_state: count
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
###### Dot Notation
|
|
44
|
+
```yaml
|
|
45
|
+
- :set_state:
|
|
46
|
+
user:
|
|
47
|
+
_step: get_user
|
|
48
|
+
- :set_state:
|
|
49
|
+
user.profile.name:
|
|
50
|
+
_string.concat:
|
|
51
|
+
- _state: user.profile.first_name
|
|
52
|
+
- ' '
|
|
53
|
+
- _state: user.profile.last_name
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
###### Shared Value
|
|
57
|
+
```yaml
|
|
58
|
+
- :set_state:
|
|
59
|
+
product_id:
|
|
60
|
+
_uuid: true
|
|
61
|
+
- id: insert_product
|
|
62
|
+
type: MongoDBInsertOne
|
|
63
|
+
connectionId: tickets
|
|
64
|
+
properties:
|
|
65
|
+
doc:
|
|
66
|
+
_id:
|
|
67
|
+
_state: product_id
|
|
68
|
+
name:
|
|
69
|
+
_payload: product_name
|
|
70
|
+
created_at:
|
|
71
|
+
_date: now
|
|
72
|
+
|
|
73
|
+
- id: insert_new_product_event
|
|
74
|
+
type: MongoDBInsertOne
|
|
75
|
+
connectionId: events
|
|
76
|
+
properties:
|
|
77
|
+
doc:
|
|
78
|
+
_id:
|
|
79
|
+
_uuid: true
|
|
80
|
+
type: new-product
|
|
81
|
+
description:
|
|
82
|
+
_nunjucks:
|
|
83
|
+
template: New product {{ product_name }} created by {{ user_name }}.
|
|
84
|
+
on:
|
|
85
|
+
product_name:
|
|
86
|
+
_payload: product_name
|
|
87
|
+
user_name:
|
|
88
|
+
_user: name
|
|
89
|
+
product_id:
|
|
90
|
+
_state: product_id
|
|
91
|
+
user:
|
|
92
|
+
id:
|
|
93
|
+
_user: id
|
|
94
|
+
name:
|
|
95
|
+
_user: name
|
|
96
|
+
timestamp:
|
|
97
|
+
_date: now
|
|
98
|
+
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# :switch
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
({:switch: [{:case: boolean, :then: routine], :default: routine}): void
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `:switch` control evaluates multiple conditions sequentially and executes the routine for the first matching case.
|
|
8
|
+
Each case in the `:switch` array contains a `:case` condition and a `:then` routine.
|
|
9
|
+
The control evaluates conditions from top to bottom, executing only the first matching case's `:then` block.
|
|
10
|
+
If no cases match, the optional `:default` routine is executed.
|
|
11
|
+
This control is ideal for handling multiple mutually exclusive conditions more elegantly than nested [`:if`](/:if) statements.
|
|
12
|
+
|
|
13
|
+
The `:switch` control also works in client [event action lists](/events-and-actions) — there each `:then` and `:default` is a list of actions, and the same syntax and semantics apply.
|
|
14
|
+
|
|
15
|
+
#### Keys
|
|
16
|
+
|
|
17
|
+
- `:switch: array`: __Required__
|
|
18
|
+
- `:case: boolean`: __Required__ - The boolean result of a test.
|
|
19
|
+
- `:then: routine`: __Required__ - The routine to execute if the test is `true`.
|
|
20
|
+
- `:default: routine`: The routine to execute if all the `:case` tests are `false`.
|
|
21
|
+
|
|
22
|
+
#### Examples
|
|
23
|
+
|
|
24
|
+
###### Validation
|
|
25
|
+
```yaml
|
|
26
|
+
- :switch:
|
|
27
|
+
- :case:
|
|
28
|
+
_not:
|
|
29
|
+
_payload: email
|
|
30
|
+
:then:
|
|
31
|
+
:reject: "Email is required"
|
|
32
|
+
- :case:
|
|
33
|
+
_not:
|
|
34
|
+
_regex:
|
|
35
|
+
on:
|
|
36
|
+
_payload: email
|
|
37
|
+
pattern: ^[^@]+@[^@]+\\.[^@]+$
|
|
38
|
+
:then:
|
|
39
|
+
:reject: "Invalid email format"
|
|
40
|
+
- :case:
|
|
41
|
+
_lt:
|
|
42
|
+
- _string.length:
|
|
43
|
+
_payload: password
|
|
44
|
+
- 8
|
|
45
|
+
:then:
|
|
46
|
+
:reject: "Password must be at least 8 characters"
|
|
47
|
+
- :case:
|
|
48
|
+
_not:
|
|
49
|
+
_eq:
|
|
50
|
+
- _payload: password
|
|
51
|
+
- _payload: confirm_password
|
|
52
|
+
:then:
|
|
53
|
+
:reject: "Passwords do not match"
|
|
54
|
+
:default: []
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
###### Switch with multiple returns
|
|
58
|
+
|
|
59
|
+
```yaml
|
|
60
|
+
- id: get_user_subscription
|
|
61
|
+
type: MongoDBFindOne
|
|
62
|
+
connectionId: subscriptions
|
|
63
|
+
properties:
|
|
64
|
+
filter:
|
|
65
|
+
user_id:
|
|
66
|
+
_user: id
|
|
67
|
+
- :switch:
|
|
68
|
+
- :case:
|
|
69
|
+
_not:
|
|
70
|
+
_step: get_user_subscription
|
|
71
|
+
:then:
|
|
72
|
+
:return:
|
|
73
|
+
plan: "free"
|
|
74
|
+
features: ["basic_access"]
|
|
75
|
+
limit: 10
|
|
76
|
+
- :case:
|
|
77
|
+
_eq:
|
|
78
|
+
- _step: get_user_subscription.type
|
|
79
|
+
- "premium"
|
|
80
|
+
:then:
|
|
81
|
+
:return:
|
|
82
|
+
plan: "premium"
|
|
83
|
+
features: ["full_access", "priority_support", "api_access"]
|
|
84
|
+
limit: -1
|
|
85
|
+
:default:
|
|
86
|
+
:return:
|
|
87
|
+
plan: "standard"
|
|
88
|
+
features: ["standard_access", "email_support"]
|
|
89
|
+
limit: 100
|
|
90
|
+
```
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# :throw
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
({:throw: string, :cause: any}): void
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
The `:throw` control creates a system error that immediately stops routine execution and returns with an "error" status.
|
|
8
|
+
Unlike [`:reject`](/:reject), which handles expected user errors, `:throw` is designed for unexpected system failures, programming errors, or critical issues that require attention.
|
|
9
|
+
The key difference is that `:throw` can be caught and handled by [`:try`](/:try)/`:catch` blocks, while [`:reject`](/:reject) cannot.
|
|
10
|
+
This makes `:throw` ideal for recoverable system errors where you might want to implement fallback logic.
|
|
11
|
+
|
|
12
|
+
#### Keys
|
|
13
|
+
|
|
14
|
+
- `:throw: string`: __Required__ - The error message that will be returned in the response object of the API call result.
|
|
15
|
+
- `:cause: any`: Additional metadata that will be returned with the error message.
|
|
16
|
+
|
|
17
|
+
#### Examples
|
|
18
|
+
|
|
19
|
+
###### Throw on invalid status
|
|
20
|
+
```yaml
|
|
21
|
+
- :switch:
|
|
22
|
+
- :case:
|
|
23
|
+
_eq:
|
|
24
|
+
- _payload: status
|
|
25
|
+
- accept
|
|
26
|
+
:then:
|
|
27
|
+
- :return:
|
|
28
|
+
message: Accepted
|
|
29
|
+
- :case:
|
|
30
|
+
_eq:
|
|
31
|
+
- _payload: status
|
|
32
|
+
- deny
|
|
33
|
+
:then:
|
|
34
|
+
- :return:
|
|
35
|
+
message: Denied
|
|
36
|
+
- :case:
|
|
37
|
+
_eq:
|
|
38
|
+
- _payload: status
|
|
39
|
+
- more_info_required
|
|
40
|
+
:then:
|
|
41
|
+
- :return:
|
|
42
|
+
message: More info required
|
|
43
|
+
:default:
|
|
44
|
+
- :throw: 'Invalid status type'
|
|
45
|
+
:cause:
|
|
46
|
+
status:
|
|
47
|
+
_payload: status
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
###### Throw on invalid configuration
|
|
51
|
+
```yaml
|
|
52
|
+
- id: get_system_config
|
|
53
|
+
type: MongoDBFindOne
|
|
54
|
+
connectionId: config
|
|
55
|
+
properties:
|
|
56
|
+
query:
|
|
57
|
+
name: 'max_file_size'
|
|
58
|
+
|
|
59
|
+
- :if:
|
|
60
|
+
_not:
|
|
61
|
+
_step: get_system_config
|
|
62
|
+
:then:
|
|
63
|
+
:throw: 'System configuration missing: max_file_size not found'
|
|
64
|
+
|
|
65
|
+
- :if:
|
|
66
|
+
_gt:
|
|
67
|
+
- _payload: file_size
|
|
68
|
+
- _step: get_system_config.value
|
|
69
|
+
:then:
|
|
70
|
+
:throw: 'File size exceeds system limit'
|
|
71
|
+
:cause:
|
|
72
|
+
maxAllowed:
|
|
73
|
+
_step: get_system_config.value
|
|
74
|
+
received:
|
|
75
|
+
_payload: file_size
|
|
76
|
+
|
|
77
|
+
- :return:
|
|
78
|
+
message: 'File upload validated'
|
|
79
|
+
```
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# :try
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
({:try: routine, :catch: routine, :finally: routine}): void
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
If one control in the routine chain defined in the `:try` key fails by throwing an error, the steps in the list following the failed control will not be executed.
|
|
8
|
+
To handle any errors thrown by a routine element, a routine can be provided using `catch` key.
|
|
9
|
+
The routine defined using the `:finally` key will be run regardless of whether or not the routine throws an error.
|
|
10
|
+
|
|
11
|
+
#### Keys
|
|
12
|
+
|
|
13
|
+
- `:try: routine`: __Required__ - The routine to be run.
|
|
14
|
+
- `:catch: routine`: The routine to execute if any step in the routine defined errors.
|
|
15
|
+
- `:finally: routine`: The routine to be run regardless of the out come of the initial routine.
|
|
16
|
+
|
|
17
|
+
#### Examples
|
|
18
|
+
|
|
19
|
+
###### Try external API with fallback
|
|
20
|
+
```yaml
|
|
21
|
+
- :try:
|
|
22
|
+
- id: get_weather
|
|
23
|
+
type: AxiosHttp
|
|
24
|
+
connectionId: weather-api
|
|
25
|
+
properties:
|
|
26
|
+
url: /current
|
|
27
|
+
params:
|
|
28
|
+
city:
|
|
29
|
+
_payload: city
|
|
30
|
+
:catch:
|
|
31
|
+
- id: get_default_weather
|
|
32
|
+
type: MongoDBFindOne
|
|
33
|
+
connectionId: weather-cache
|
|
34
|
+
properties:
|
|
35
|
+
query:
|
|
36
|
+
city:
|
|
37
|
+
_payload: city
|
|
38
|
+
- :return:
|
|
39
|
+
weather:
|
|
40
|
+
_if:
|
|
41
|
+
test:
|
|
42
|
+
_step: get_weather
|
|
43
|
+
then:
|
|
44
|
+
_step: get_weather.data
|
|
45
|
+
else:
|
|
46
|
+
_step: get_default_weather
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
###### Try database operation with fallback
|
|
50
|
+
```yaml
|
|
51
|
+
- :try:
|
|
52
|
+
- id: update_user
|
|
53
|
+
type: MongoDBUpdateOne
|
|
54
|
+
connectionId: database
|
|
55
|
+
properties:
|
|
56
|
+
filter:
|
|
57
|
+
_id:
|
|
58
|
+
_payload: user._id
|
|
59
|
+
update:
|
|
60
|
+
$set:
|
|
61
|
+
last_login:
|
|
62
|
+
_date: now
|
|
63
|
+
:catch:
|
|
64
|
+
- :log:
|
|
65
|
+
message: 'Database update failed, creating new user record'
|
|
66
|
+
user_id:
|
|
67
|
+
_payload: user._id
|
|
68
|
+
:level: warn
|
|
69
|
+
- id: create_user
|
|
70
|
+
type: MongoDBInsertOne
|
|
71
|
+
connectionId: database
|
|
72
|
+
properties:
|
|
73
|
+
doc:
|
|
74
|
+
_id:
|
|
75
|
+
_payload: user._id
|
|
76
|
+
last_login:
|
|
77
|
+
_date: now
|
|
78
|
+
created_at:
|
|
79
|
+
_date: now
|
|
80
|
+
:finally:
|
|
81
|
+
- :log:
|
|
82
|
+
message: 'User login process completed'
|
|
83
|
+
:level: info
|
|
84
|
+
- :return:
|
|
85
|
+
success: true
|
|
86
|
+
user_id:
|
|
87
|
+
_payload: user._id
|
|
88
|
+
```
|