@lowdefy/docs 4.0.0-alpha.7 → 4.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/operators/client/filter_default_value.js +55 -0
- package/{public/modules/connectDocsearch.js → dist/operatorsClient.js} +1 -19
- package/{templates/blocks/schemaTransformer.js → dist/types.js} +5 -10
- package/package.json +19 -3
- package/404.yaml +0 -26
- package/CHANGELOG.md +0 -697
- package/actions/CallMethod.yaml +0 -57
- package/actions/JsAction.yaml +0 -281
- package/actions/Link.yaml +0 -120
- package/actions/Login.yaml +0 -123
- package/actions/Logout.yaml +0 -44
- package/actions/Message.yaml +0 -68
- package/actions/Notification.yaml +0 -84
- package/actions/Request.yaml +0 -70
- package/actions/Reset.yaml +0 -42
- package/actions/ResetValidation.yaml +0 -102
- package/actions/ScrollTo.yaml +0 -100
- package/actions/SetGlobal.yaml +0 -78
- package/actions/SetState.yaml +0 -85
- package/actions/Throw.yaml +0 -89
- package/actions/Validate.yaml +0 -104
- package/actions/Wait.yaml +0 -40
- package/blocks/all_icons.yaml +0 -803
- package/blocks/container/Affix.yaml +0 -26
- package/blocks/container/Alert.yaml +0 -27
- package/blocks/container/Badge.yaml +0 -27
- package/blocks/container/Box.yaml +0 -27
- package/blocks/container/Card.yaml +0 -29
- package/blocks/container/Collapse.yaml +0 -38
- package/blocks/container/Comment.yaml +0 -43
- package/blocks/container/ConfirmModal.yaml +0 -36
- package/blocks/container/Descriptions.yaml +0 -51
- package/blocks/container/Drawer.yaml +0 -46
- package/blocks/container/Label.yaml +0 -28
- package/blocks/container/Modal.yaml +0 -46
- package/blocks/container/PageHCF.yaml +0 -28
- package/blocks/container/PageHCSF.yaml +0 -29
- package/blocks/container/PageHSCF.yaml +0 -29
- package/blocks/container/PageHeaderMenu.yaml +0 -52
- package/blocks/container/PageSHCF.yaml +0 -29
- package/blocks/container/PageSiderMenu.yaml +0 -53
- package/blocks/container/Result.yaml +0 -34
- package/blocks/container/Span.yaml +0 -27
- package/blocks/container/Spin.yaml +0 -27
- package/blocks/container/Tabs.yaml +0 -41
- package/blocks/container/Tooltip.yaml +0 -38
- package/blocks/display/Anchor.yaml +0 -25
- package/blocks/display/Avatar.yaml +0 -23
- package/blocks/display/Breadcrumb.yaml +0 -28
- package/blocks/display/Button.yaml +0 -43
- package/blocks/display/DangerousHtml.yaml +0 -62
- package/blocks/display/DangerousMarkdown.yaml +0 -46
- package/blocks/display/Divider.yaml +0 -23
- package/blocks/display/EChart.yaml +0 -53
- package/blocks/display/Html.yaml +0 -50
- package/blocks/display/Icon.yaml +0 -23
- package/blocks/display/Img.yaml +0 -40
- package/blocks/display/Markdown.yaml +0 -31
- package/blocks/display/MarkdownWithCode.yaml +0 -46
- package/blocks/display/Menu.yaml +0 -48
- package/blocks/display/Message.yaml +0 -34
- package/blocks/display/MobileMenu.yaml +0 -47
- package/blocks/display/Notification.yaml +0 -34
- package/blocks/display/Paragraph.yaml +0 -30
- package/blocks/display/Progress.yaml +0 -52
- package/blocks/display/Skeleton.yaml +0 -27
- package/blocks/display/Statistic.yaml +0 -35
- package/blocks/display/Title.yaml +0 -32
- package/blocks/input/AutoComplete.yaml +0 -30
- package/blocks/input/ButtonSelector.yaml +0 -36
- package/blocks/input/CheckboxSelector.yaml +0 -36
- package/blocks/input/CheckboxSwitch.yaml +0 -56
- package/blocks/input/ChromeColorSelector.yaml +0 -24
- package/blocks/input/CircleColorSelector.yaml +0 -24
- package/blocks/input/ColorSelector.yaml +0 -24
- package/blocks/input/CompactColorSelector.yaml +0 -24
- package/blocks/input/DateRangeSelector.yaml +0 -26
- package/blocks/input/DateSelector.yaml +0 -26
- package/blocks/input/DateTimeSelector.yaml +0 -28
- package/blocks/input/GithubColorSelector.yaml +0 -24
- package/blocks/input/MonthSelector.yaml +0 -26
- package/blocks/input/MultipleSelector.yaml +0 -117
- package/blocks/input/NumberInput.yaml +0 -24
- package/blocks/input/Pagination.yaml +0 -33
- package/blocks/input/ParagraphInput.yaml +0 -32
- package/blocks/input/PasswordInput.yaml +0 -48
- package/blocks/input/RadioSelector.yaml +0 -36
- package/blocks/input/RatingSlider.yaml +0 -24
- package/blocks/input/S3UploadButton.yaml +0 -28
- package/blocks/input/Selector.yaml +0 -98
- package/blocks/input/SliderColorSelector.yaml +0 -24
- package/blocks/input/SwatchesColorSelector.yaml +0 -24
- package/blocks/input/Switch.yaml +0 -24
- package/blocks/input/TextArea.yaml +0 -27
- package/blocks/input/TextInput.yaml +0 -59
- package/blocks/input/TitleInput.yaml +0 -32
- package/blocks/input/TwitterColorSelector.yaml +0 -24
- package/blocks/input/WeekSelector.yaml +0 -26
- package/blocks/list/ControlledList.yaml +0 -191
- package/blocks/list/List.yaml +0 -157
- package/blocks/list/TimelineList.yaml +0 -136
- package/body.html +0 -1
- package/concepts/blocks.yaml +0 -249
- package/concepts/cli.yaml +0 -173
- package/concepts/connections-and-requests.yaml +0 -114
- package/concepts/context-and-state.yaml +0 -82
- package/concepts/custom-blocks.yaml +0 -190
- package/concepts/custom-code.yaml +0 -197
- package/concepts/events-and-actions.yaml +0 -224
- package/concepts/hosting-files.yaml +0 -50
- package/concepts/layout.yaml +0 -1464
- package/concepts/lists.yaml +0 -162
- package/concepts/lowdefy-schema.yaml +0 -245
- package/concepts/operators.yaml +0 -66
- package/concepts/overview.yaml +0 -48
- package/concepts/secrets.yaml +0 -56
- package/connections/AWSS3.yaml +0 -228
- package/connections/AmazonRedshift.yaml +0 -75
- package/connections/AxiosHttp.yaml +0 -194
- package/connections/Elasticsearch.yaml +0 -378
- package/connections/GoogleSheet.yaml +0 -332
- package/connections/Knex.yaml +0 -181
- package/connections/KnexRequests.md +0 -121
- package/connections/MSSQL.yaml +0 -90
- package/connections/MariaDB.yaml +0 -77
- package/connections/MongoDB.yaml +0 -581
- package/connections/MySQL.yaml +0 -92
- package/connections/OracleDB.yaml +0 -73
- package/connections/PostgreSQL.yaml +0 -99
- package/connections/Redis.yaml +0 -147
- package/connections/SQLite.yaml +0 -94
- package/connections/SendGridMail.yaml +0 -113
- package/connections/Stripe.yaml +0 -139
- package/deployment/aws-lambda.yaml +0 -128
- package/deployment/docker.yaml +0 -118
- package/deployment/netlify.yaml +0 -69
- package/deployment/node-server.yaml +0 -111
- package/head.html +0 -7
- package/howto/generate-csv.yaml.njk +0 -252
- package/howto/generate-pdf.yaml.njk +0 -651
- package/howto/generateCsv/lowdefy.yaml +0 -64
- package/howto/generateCsv/public/csvMake.js +0 -27
- package/howto/generatePdf/inv_template.yaml +0 -200
- package/howto/generatePdf/lowdefy.yaml +0 -117
- package/howto/generatePdf/my_header.html +0 -1
- package/howto/generatePdf/public/logo_example.png +0 -0
- package/howto/generatePdf/public/modules/importUmd.js +0 -7
- package/howto/generatePdf/public/modules/pdfMake.js +0 -7
- package/howto/generatePdf/public/modules/vfs_fonts.js +0 -12
- package/howto/use-refrences.md +0 -5
- package/introduction.yaml +0 -100
- package/lowdefy.yaml +0 -66
- package/menus.yaml +0 -832
- package/operators/_actions.yaml +0 -123
- package/operators/_and.yaml +0 -90
- package/operators/_args.yaml +0 -79
- package/operators/_array.yaml +0 -326
- package/operators/_base64.yaml +0 -56
- package/operators/_change_case.yaml +0 -347
- package/operators/_date.yaml +0 -71
- package/operators/_diff.yaml +0 -75
- package/operators/_divide.yaml +0 -46
- package/operators/_eq.yaml +0 -67
- package/operators/_event.yaml +0 -103
- package/operators/_format.yaml +0 -209
- package/operators/_function.yaml +0 -66
- package/operators/_get.yaml +0 -108
- package/operators/_global.yaml +0 -107
- package/operators/_gt.yaml +0 -65
- package/operators/_gte.yaml +0 -65
- package/operators/_hash.yaml +0 -109
- package/operators/_if.yaml +0 -44
- package/operators/_if_none.yaml +0 -61
- package/operators/_index.yaml +0 -65
- package/operators/_input.yaml +0 -114
- package/operators/_js.yaml +0 -189
- package/operators/_json.yaml +0 -128
- package/operators/_list_contexts.yaml +0 -37
- package/operators/_location.yaml +0 -59
- package/operators/_log.yaml +0 -36
- package/operators/_lt.yaml +0 -65
- package/operators/_lte.yaml +0 -65
- package/operators/_math.yaml +0 -374
- package/operators/_media.yaml +0 -86
- package/operators/_menu.yaml +0 -81
- package/operators/_mql.yaml +0 -101
- package/operators/_ne.yaml +0 -77
- package/operators/_not.yaml +0 -47
- package/operators/_number.yaml +0 -157
- package/operators/_nunjucks.yaml +0 -73
- package/operators/_object.yaml +0 -193
- package/operators/_operator.yaml +0 -47
- package/operators/_or.yaml +0 -81
- package/operators/_product.yaml +0 -59
- package/operators/_random.yaml +0 -104
- package/operators/_ref.yaml +0 -266
- package/operators/_regex.yaml +0 -83
- package/operators/_request.yaml +0 -50
- package/operators/_secret.yaml +0 -74
- package/operators/_state.yaml +0 -114
- package/operators/_string.yaml +0 -283
- package/operators/_subtract.yaml +0 -38
- package/operators/_sum.yaml +0 -59
- package/operators/_switch.yaml +0 -51
- package/operators/_type.yaml +0 -92
- package/operators/_uri.yaml +0 -56
- package/operators/_url_query.yaml +0 -120
- package/operators/_user.yaml +0 -107
- package/operators/_uuid.yaml +0 -114
- package/operators/_var.yaml +0 -105
- package/operators/_yaml.yaml +0 -107
- package/pages.yaml +0 -227
- package/public/images/authors/gervwyk.jpeg +0 -0
- package/public/images/authors/sandile.jpeg +0 -0
- package/public/images/howto/header_generate_csv.jpg +0 -0
- package/public/images/howto/header_generate_pdf.jpg +0 -0
- package/public/logo_example.png +0 -0
- package/public/lowdefy_app_schema.png +0 -0
- package/public/modules/csvMake.js +0 -27
- package/public/modules/filterDefaultValue.js +0 -48
- package/public/modules/importUmd.js +0 -7
- package/public/modules/index.js +0 -5
- package/public/modules/pdfMake.js +0 -7
- package/public/modules/test/filterDefaultValue.test.js +0 -91
- package/public/modules/vfs_fonts.js +0 -12
- package/public/sitemap.xml +0 -1024
- package/templates/actions.yaml.njk +0 -68
- package/templates/blocks/defaultValueTransformer.js +0 -53
- package/templates/blocks/exampleTransformer.js +0 -81
- package/templates/blocks/layout.yaml +0 -114
- package/templates/blocks/propertiesFormTransformer.js +0 -419
- package/templates/blocks/propertiesGetterTransformer.js +0 -132
- package/templates/blocks/schema.yaml.njk +0 -42
- package/templates/blocks/style.yaml +0 -26
- package/templates/blocks/template.yaml.njk +0 -495
- package/templates/blog.yaml.njk +0 -221
- package/templates/cli_command.yaml.njk +0 -37
- package/templates/footer.yaml.njk +0 -604
- package/templates/general.yaml.njk +0 -124
- package/templates/generateSitemap.js +0 -41
- package/templates/header.yaml +0 -138
- package/templates/navigation_buttons.yaml +0 -68
- package/templates/operators.yaml.njk +0 -82
- package/templates/operatorsMethodTransformer.js +0 -119
- package/templates/test/array.test.js +0 -1335
- package/templates/test/boolean.test.js +0 -98
- package/templates/test/button.test.js +0 -166
- package/templates/test/color.test.js +0 -126
- package/templates/test/enum.test.js +0 -105
- package/templates/test/icon.test.js +0 -109
- package/templates/test/integer.test.js +0 -99
- package/templates/test/manual.test.js +0 -238
- package/templates/test/number.test.js +0 -99
- package/templates/test/object.test.js +0 -434
- package/templates/test/oneOf.test.js +0 -794
- package/templates/test/string.test.js +0 -98
- package/templates/test/yaml.test.js +0 -605
- package/tutorial/next-steps.yaml +0 -83
- package/tutorial/tutorial-actions-operators-config.yaml +0 -142
- package/tutorial/tutorial-actions-operators.yaml +0 -436
- package/tutorial/tutorial-add-blocks-config.yaml +0 -109
- package/tutorial/tutorial-add-blocks.yaml +0 -195
- package/tutorial/tutorial-create-page-config.yaml +0 -77
- package/tutorial/tutorial-create-page.yaml +0 -196
- package/tutorial/tutorial-deploy.yaml +0 -146
- package/tutorial/tutorial-requests-config.yaml +0 -186
- package/tutorial/tutorial-requests.yaml +0 -338
- package/tutorial/tutorial-start.yaml +0 -282
- package/users/login-and-logout.yaml +0 -164
- package/users/openid-connect.yaml +0 -84
- package/users/protected-pages.yaml +0 -67
- package/users/roles.yaml +0 -70
- package/users/user-object.yaml +0 -73
- package/users/users-introduction.yaml +0 -80
- package/version.yaml +0 -1
package/connections/AWSS3.yaml
DELETED
|
@@ -1,228 +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: AWSS3
|
|
19
|
-
pageTitle: Amazon S3
|
|
20
|
-
section: Connections
|
|
21
|
-
filePath: connections/AWSS3.yaml
|
|
22
|
-
content:
|
|
23
|
-
- id: markdown
|
|
24
|
-
type: MarkdownWithCode
|
|
25
|
-
properties:
|
|
26
|
-
content: |
|
|
27
|
-
AWS S3 is a file or data storage solution, provided by Amazon Web Services. S3 does not work like a traditional file system, data is stored as objects in a collection of objects called a bucket.
|
|
28
|
-
Objects can be read from S3 and stored in S3 using web requests. These objects can be public or private. You can read more [here](https://docs.aws.amazon.com/AmazonS3/latest/dev/Welcome.html).
|
|
29
|
-
|
|
30
|
-
Lowdefy integrates with AWS S3 using presigned links. These are links that are authorized to give access to private objects, or that allow you to create new objects, and that expire after a certain amount of time. This allows you to upload or download directly from S3 from the browser.
|
|
31
|
-
|
|
32
|
-
A guide to creating and connecting to an S3 bucket is given at the bottom of this page.
|
|
33
|
-
|
|
34
|
-
## Connections
|
|
35
|
-
|
|
36
|
-
Connection types:
|
|
37
|
-
- AwsS3Bucket
|
|
38
|
-
|
|
39
|
-
### AwsS3Bucket
|
|
40
|
-
|
|
41
|
-
The `AwsS3Bucket` connection is used to connect to a AWS S3 bucket. AWS S3 is the file storage solution provided by Amazon Web services.
|
|
42
|
-
|
|
43
|
-
#### Properties
|
|
44
|
-
- `accessKeyId: string`: __Required__ - AWS IAM access key id with s3 access.
|
|
45
|
-
- `secretAccessKey: string`: __Required__ - AWS IAM secret access key with s3 access.
|
|
46
|
-
- `region: string`: __Required__ - AWS region bucket is located in.
|
|
47
|
-
- `bucket: string`: __Required__ - S3 bucket name.
|
|
48
|
-
- `read: boolean`: Default: `true` - Allow reads from the bucket.
|
|
49
|
-
- `write: boolean`: Default: `false` - Allow writes to the bucket.
|
|
50
|
-
|
|
51
|
-
#### Examples
|
|
52
|
-
|
|
53
|
-
###### Read and writes on a bucket:
|
|
54
|
-
```yaml
|
|
55
|
-
connections:
|
|
56
|
-
- id: my_bucket
|
|
57
|
-
type: AwsS3Bucket
|
|
58
|
-
properties:
|
|
59
|
-
accessKeyId:
|
|
60
|
-
_secret: S3_ACCESS_KEY_ID
|
|
61
|
-
secretAccessKey:
|
|
62
|
-
_secret: S3_SECRET_ACCESS_KEY
|
|
63
|
-
region: eu-west-1
|
|
64
|
-
bucket: my-bucket-name
|
|
65
|
-
write: true
|
|
66
|
-
```
|
|
67
|
-
Environment variables:
|
|
68
|
-
```
|
|
69
|
-
LOWDEFY_SECRET_S3_ACCESS_KEY_ID = AKIAIOSFODNN7EXAMPLE
|
|
70
|
-
LOWDEFY_SECRET_S3_SECRET_ACCESS_KEY = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## Requests
|
|
74
|
-
|
|
75
|
-
Request types:
|
|
76
|
-
- AwsS3PresignedGetObject
|
|
77
|
-
- AwsS3PresignedPostPolicy
|
|
78
|
-
|
|
79
|
-
### AwsS3PresignedGetObject
|
|
80
|
-
|
|
81
|
-
The `AwsS3PresignedGetObject` request is used to get a download link for an object in AWS S3. The link provided by this request can be opened using the `Link` action.
|
|
82
|
-
|
|
83
|
-
#### Properties
|
|
84
|
-
- `versionId: string`: VersionId used to reference a specific version of the object.
|
|
85
|
-
- `expires: number`: Number of seconds for which the policy should be valid.
|
|
86
|
-
- `key: string`: __Required__ - Key (or filename) under which object will be stored. If another file is saved with the same key, that file will be overwritten, so a random string in this field is probably needed.
|
|
87
|
-
- `responseContentType: string`: Sets the Content-Type header of the response.
|
|
88
|
-
- `responseContentDisposition: string`: Sets the Content-Disposition header of the response.
|
|
89
|
-
|
|
90
|
-
#### Examples
|
|
91
|
-
|
|
92
|
-
###### Download a pdf and open in a new tab:
|
|
93
|
-
```yaml
|
|
94
|
-
requests:
|
|
95
|
-
- id: my_file_link
|
|
96
|
-
type: AwsS3PresignedGetObject
|
|
97
|
-
connectionId: my_bucket_connection
|
|
98
|
-
properties:
|
|
99
|
-
key: pdf-filename-as4dacd.pdf
|
|
100
|
-
responseContentType: application/pdf
|
|
101
|
-
|
|
102
|
-
...
|
|
103
|
-
blocks:
|
|
104
|
-
- id: getFileButton
|
|
105
|
-
type: Button
|
|
106
|
-
events:
|
|
107
|
-
onClick:
|
|
108
|
-
- id: open_file
|
|
109
|
-
type: Link
|
|
110
|
-
params:
|
|
111
|
-
url:
|
|
112
|
-
_request: my_file_link
|
|
113
|
-
newTab: true
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### AwsS3PresignedPostPolicy
|
|
117
|
-
|
|
118
|
-
The `AwsS3PresignedPostPolicy` request is used to create a policy that allows a file to be uploaded to AWS S3. This is used by a block like the `S3Uploadbutton` to upload a file.
|
|
119
|
-
|
|
120
|
-
#### Properties
|
|
121
|
-
- `acl: enum`: Access control lists used to grant read and write access.
|
|
122
|
-
- private
|
|
123
|
-
- public-read
|
|
124
|
-
- public-read-write
|
|
125
|
-
- aws-exec-read
|
|
126
|
-
- authenticated-read
|
|
127
|
-
- bucket-owner-read
|
|
128
|
-
- bucket-owner-full-control
|
|
129
|
-
- `conditions: object[] | string[][]`: Conditions to be enforced on the request. An array of objects, or condition arrays. See [here](https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html).
|
|
130
|
-
- `expires: number`: Number of seconds for which the policy should be valid.
|
|
131
|
-
- `key: string`: __Required__ - Key (or filename) under which object will be stored. If another file is saved with the same key, that file will be overwritten, so a random string in this field is probably needed.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
#### Examples
|
|
135
|
-
|
|
136
|
-
###### Upload a file with user filename and random id:
|
|
137
|
-
```yaml
|
|
138
|
-
- id: my_post_policy
|
|
139
|
-
type: AwsS3PresignedPostPolicy
|
|
140
|
-
connectionId: my_bucket_connection
|
|
141
|
-
properties:
|
|
142
|
-
key:
|
|
143
|
-
_nunjucks:
|
|
144
|
-
template: uploads/{{filename}}-{{uid}}
|
|
145
|
-
on:
|
|
146
|
-
filename:
|
|
147
|
-
_args: filename
|
|
148
|
-
uid:
|
|
149
|
-
_args: filename
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
## Creating a bucket
|
|
153
|
-
|
|
154
|
-
###### Step 1 - Create an AWS account
|
|
155
|
-
|
|
156
|
-
Go to the [AWS homepage](https://aws.amazon.com/) and create an account if you don't already have one. you can find more information [here](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/).
|
|
157
|
-
|
|
158
|
-
###### Step 2 - Create an S3 bucket
|
|
159
|
-
|
|
160
|
-
1. Once logged in, search for S3 in the search box.
|
|
161
|
-
2. Click 'Create Bucket'
|
|
162
|
-
3. Choose a name and AWS region for your bucket
|
|
163
|
-
4. Continue creating the bucket with any extra settings is needed.
|
|
164
|
-
5. Make sure the 'Block all public access' box is ticked if you don't want to allow public access.
|
|
165
|
-
6. Click 'Create Bucket'
|
|
166
|
-
|
|
167
|
-
###### Step 3 - Set the CORS settings for your bucket
|
|
168
|
-
|
|
169
|
-
CORS, or Cross-Origin Resource Sharing is a security feature that is used to restrict web applications from accessing resources from different origins, or domain names. To allow your Lowdefy app to access the contents of the bucket, you need to add a CORS rule on the bucket that authorizes your app
|
|
170
|
-
|
|
171
|
-
1. Click on you bucket.
|
|
172
|
-
2. Click on the 'Permissions' tab.
|
|
173
|
-
3. Click on the 'CORS Configuration' tab.
|
|
174
|
-
4. Paste this configuration and save (Fill in your own Lowdefy domain name).
|
|
175
|
-
|
|
176
|
-
```json
|
|
177
|
-
[
|
|
178
|
-
{
|
|
179
|
-
"AllowedHeaders": [
|
|
180
|
-
"*"
|
|
181
|
-
],
|
|
182
|
-
"AllowedMethods": [
|
|
183
|
-
"GET", "PUT", "POST", "DELETE", "HEAD"
|
|
184
|
-
],
|
|
185
|
-
"AllowedOrigins": [
|
|
186
|
-
"https://YOUR_LOWDEFY_DOMAIN_HERE"
|
|
187
|
-
],
|
|
188
|
-
"ExposeHeaders": []
|
|
189
|
-
},
|
|
190
|
-
]
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
###### Step 4 - Create an IAM user
|
|
194
|
-
|
|
195
|
-
IAM is the AWS identity and access management system. This can be used to give very granular access permissions. We will create a programmatic user that has the rights to read and write objects in the Bucket.
|
|
196
|
-
|
|
197
|
-
1. In the 'Services' dropdown in the header, search for 'IAM'.
|
|
198
|
-
2. Click on 'Users' in the menu on the left.
|
|
199
|
-
3. Click 'Add User'
|
|
200
|
-
4. Choose a descriptive name for the user.
|
|
201
|
-
5. Choose programmatic access and click next.
|
|
202
|
-
6. Choose 'Attach existing policies directly'.
|
|
203
|
-
7. Choose 'Create Policy'.
|
|
204
|
-
8. Choose the JSON tab and paste the following (Fill in your own bucket name):
|
|
205
|
-
```JSON
|
|
206
|
-
{
|
|
207
|
-
"Version": "2012-10-17",
|
|
208
|
-
"Statement": [
|
|
209
|
-
{
|
|
210
|
-
"Sid": "ListObjectsInBucket",
|
|
211
|
-
"Effect": "Allow",
|
|
212
|
-
"Action": ["s3:ListBucket"],
|
|
213
|
-
"Resource": ["arn:aws:s3:::YOUR_BUCKET_NAME_HERE"]
|
|
214
|
-
},
|
|
215
|
-
{
|
|
216
|
-
"Sid": "AllObjectActions",
|
|
217
|
-
"Effect": "Allow",
|
|
218
|
-
"Action": "s3:*Object",
|
|
219
|
-
"Resource": ["arn:aws:s3:::YOUR_BUCKET_NAME_HERE/*"]
|
|
220
|
-
}
|
|
221
|
-
]
|
|
222
|
-
}
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
9. Choose review policy and save.
|
|
226
|
-
10. In your previous tab, refresh and search for the policy you just created. Attach it to the user.
|
|
227
|
-
11. Click next, review and create the user.
|
|
228
|
-
12. Set the access key id and secret access key in your Lowdefy secrets store.
|
|
@@ -1,75 +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: AmazonRedshift
|
|
19
|
-
pageTitle: Amazon Redshift
|
|
20
|
-
section: Connections
|
|
21
|
-
filePath: connections/AmazonRedshift.yaml
|
|
22
|
-
content:
|
|
23
|
-
- id: markdown_intro
|
|
24
|
-
type: Markdown
|
|
25
|
-
properties:
|
|
26
|
-
content: |
|
|
27
|
-
The [Knex](/Knex) connection can be used to connect to a [Amazon Redshift](https://aws.amazon.com/redshift) database.
|
|
28
|
-
|
|
29
|
-
- id: markdown_connection
|
|
30
|
-
type: MarkdownWithCode
|
|
31
|
-
properties:
|
|
32
|
-
content: |
|
|
33
|
-
## Connections
|
|
34
|
-
|
|
35
|
-
Connection types:
|
|
36
|
-
- Knex
|
|
37
|
-
|
|
38
|
-
### Knex
|
|
39
|
-
|
|
40
|
-
#### Properties
|
|
41
|
-
- `client: enum`: __Required__ - Should be `redshift` to connect to Amazon Redshift.
|
|
42
|
-
- `connection: object | string`: __Required__ - Connection string or object to pass to the [`pg`](https://www.npmjs.com/package/pg) database client.
|
|
43
|
-
- `useNullAsDefault: boolean`: If true, undefined keys are replaced with NULL instead of DEFAULT.
|
|
44
|
-
|
|
45
|
-
#### Examples
|
|
46
|
-
|
|
47
|
-
###### Connection object:
|
|
48
|
-
```yaml
|
|
49
|
-
connections:
|
|
50
|
-
- id: redshift
|
|
51
|
-
type: Knex
|
|
52
|
-
properties:
|
|
53
|
-
client: redshift
|
|
54
|
-
connection:
|
|
55
|
-
host:
|
|
56
|
-
_secret: REDSHIFT_HOST
|
|
57
|
-
database:
|
|
58
|
-
_secret: REDSHIFT_DB
|
|
59
|
-
user:
|
|
60
|
-
_secret: REDSHIFT_USER
|
|
61
|
-
password:
|
|
62
|
-
_secret: REDSHIFT_PASSWORD
|
|
63
|
-
```
|
|
64
|
-
Environment variables:
|
|
65
|
-
```
|
|
66
|
-
LOWDEFY_SECRET_REDSHIFT_HOST = examplecluster.XXXXXXXXXXXX.us-west-2.redshift.amazonaws.com
|
|
67
|
-
LOWDEFY_SECRET_REDSHIFT_REDSHIFT_DB = db
|
|
68
|
-
LOWDEFY_SECRET_REDSHIFT_USER = user
|
|
69
|
-
LOWDEFY_SECRET_REDSHIFT_PASSWORD = password
|
|
70
|
-
```
|
|
71
|
-
- id: markdown_requests
|
|
72
|
-
type: MarkdownWithCode
|
|
73
|
-
properties:
|
|
74
|
-
content:
|
|
75
|
-
_ref: connections/KnexRequests.md
|
|
@@ -1,194 +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: AxiosHttp
|
|
19
|
-
pageTitle: AxiosHttp
|
|
20
|
-
section: Connections
|
|
21
|
-
filePath: connections/AxiosHttp.yaml
|
|
22
|
-
content:
|
|
23
|
-
- id: markdown
|
|
24
|
-
type: MarkdownWithCode
|
|
25
|
-
properties:
|
|
26
|
-
content: |
|
|
27
|
-
The `AxiosHttp` connection is used to connect to APIs and web servers using HTTP or HTTPS.
|
|
28
|
-
|
|
29
|
-
It uses the [axios](https://github.com/axios/axios) library.
|
|
30
|
-
|
|
31
|
-
The same properties can be set on both connections and requests. The properties will be merged, with the request properties overwriting connection properties. This allows properties like authentication headers and the baseURL to be set on the connection, with request specific properties like the request.
|
|
32
|
-
|
|
33
|
-
>Secrets like authentication headers and API keys should be stored using the [`_secret`](operators/secret.md) operator.
|
|
34
|
-
|
|
35
|
-
## Connections
|
|
36
|
-
|
|
37
|
-
Connection types:
|
|
38
|
-
- AxiosHttp
|
|
39
|
-
|
|
40
|
-
## Requests
|
|
41
|
-
|
|
42
|
-
Request types:
|
|
43
|
-
- AxiosHttp
|
|
44
|
-
|
|
45
|
-
### AxiosHttp
|
|
46
|
-
|
|
47
|
-
#### Properties
|
|
48
|
-
|
|
49
|
-
- `url: string`: The server URL that will be used for the request.
|
|
50
|
-
- `method: enum`: Default: `'get'` - The request method to be used when making the request. Options are:
|
|
51
|
-
- `'get'`
|
|
52
|
-
- `'delete'`
|
|
53
|
-
- `'head'`
|
|
54
|
-
- `'options'`
|
|
55
|
-
- `'post'`
|
|
56
|
-
- `'put'`
|
|
57
|
-
- `'patch'`
|
|
58
|
-
- `baseURL: string`: `baseURL` will be prepended to `url` unless `url` is absolute. It can be convenient to set `baseURL` for an axios connection to pass relative URLs to requests or mutations using that connection.
|
|
59
|
-
- `headers: object`: An object with custom headers to be sent sent with the request. The object keys should be header names, and the values should be the string header values.
|
|
60
|
-
- `params: object`: An object with URL parameters to be sent with the request.
|
|
61
|
-
- `data: string | object`: The data to be sent as the request body. Only applicable for request methods `'put'`, `'post'`, and `'patch'`. Can be an object or a string in the format `'Country=Brasil&City=Belo Horizonte'`.
|
|
62
|
-
- `auth: object`: Indicates that HTTP Basic authorization should be used, and supplies credentials. This will set an `Authorization` header, overwriting any existing `Authorization` custom headers you have set using `headers`. Only HTTP Basic auth is configurable through this parameter, for Bearer tokens and such, use `Authorization` custom headers instead. The `auth` object should have the following fields:
|
|
63
|
-
- `username: string`
|
|
64
|
-
- `password: string`
|
|
65
|
-
- `httpAgentOptions: object`: Options to pass to the Node.js [`http.Agent`](https://nodejs.org/api/http.html#http_class_http_agent) class.
|
|
66
|
-
- `httpsAgentOptions: object`: Options to pass to the Node.js [`https.Agent`](https://nodejs.org/api/http.html#http_class_http_agent) class.
|
|
67
|
-
- `maxContentLength: number`: Defines the max size of the http response content allowed in bytes.
|
|
68
|
-
- `maxRedirects: number`: Defines the maximum number of redirects to follow. If set to 0, no redirects will be followed.
|
|
69
|
-
- `proxy: object`: Defines the hostname and port of the proxy server. The `proxy` object should have the following fields:
|
|
70
|
-
- `host: string`: Host IP address (eg. `'127.0.0.1'`).
|
|
71
|
-
- `port: number`: Port number.
|
|
72
|
-
- `auth: object`: Object with username and password.
|
|
73
|
-
- `responseType: enum`: Default: `'json'` - The type of data that the server will respond with. Options are:
|
|
74
|
-
- `'document'`
|
|
75
|
-
- `'json'`
|
|
76
|
-
- `'text'`
|
|
77
|
-
- `responseEncoding: string`: Default: `'utf8'` - Indicates encoding to use for decoding responses.
|
|
78
|
-
- `timeout: number`: Default: `0` (no timeout) - The number of milliseconds before the request times out. If the request takes longer than `timeout`, the request will be aborted. Set to `0` for no timeout.
|
|
79
|
-
- `transformRequest: function`: A function to transform the request data before it is sent. Receives `data` and `headers` as arguments and should return the data to be sent.
|
|
80
|
-
- `transformResponse: function`: A function to transform the received data. Receives `data` as an argument and should return the transformed data.
|
|
81
|
-
- `validateStatus: function`: A function to validate whether the response should complete successfully given a status code. Receives `status` as an argument and should `true` if the status code is valid.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
#### Examples
|
|
85
|
-
|
|
86
|
-
Properties for a AxiosHttp can be set on either the connection, the request, or both. However, both a connection and request need to be defined.
|
|
87
|
-
|
|
88
|
-
###### A basic full example requesting data from https://jsonplaceholder.typicode.com
|
|
89
|
-
|
|
90
|
-
```yaml
|
|
91
|
-
lowdefy: 3.23.2
|
|
92
|
-
name: Lowdefy starter
|
|
93
|
-
connections:
|
|
94
|
-
- id: my_api
|
|
95
|
-
type: AxiosHttp
|
|
96
|
-
properties:
|
|
97
|
-
baseURL: https://jsonplaceholder.typicode.com
|
|
98
|
-
pages:
|
|
99
|
-
- id: welcome
|
|
100
|
-
type: PageHeaderMenu
|
|
101
|
-
requests:
|
|
102
|
-
- id: get_posts
|
|
103
|
-
type: AxiosHttp
|
|
104
|
-
connectionId: my_api
|
|
105
|
-
properties:
|
|
106
|
-
url: /posts
|
|
107
|
-
events:
|
|
108
|
-
onEnter:
|
|
109
|
-
- id: fetch_get_posts
|
|
110
|
-
type: Request
|
|
111
|
-
params: get_posts
|
|
112
|
-
blocks:
|
|
113
|
-
- id: rest_data
|
|
114
|
-
type: Markdown
|
|
115
|
-
properties:
|
|
116
|
-
content:
|
|
117
|
-
_string.concat:
|
|
118
|
-
- |
|
|
119
|
-
```yaml
|
|
120
|
-
- _yaml.stringify:
|
|
121
|
-
- _log:
|
|
122
|
-
_request: get_posts
|
|
123
|
-
- |
|
|
124
|
-
```
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
###### Using the connection to set baseURL and authorization, and handle specific requests as requests.
|
|
128
|
-
```yaml
|
|
129
|
-
connections:
|
|
130
|
-
- id: app_api
|
|
131
|
-
type: AxiosHttp
|
|
132
|
-
properties:
|
|
133
|
-
baseURL: app.com/api
|
|
134
|
-
auth:
|
|
135
|
-
username: api_user
|
|
136
|
-
password:
|
|
137
|
-
_secret: API_PASSWORD
|
|
138
|
-
# ...
|
|
139
|
-
requests:
|
|
140
|
-
- id: get_orders
|
|
141
|
-
type: AxiosHttp
|
|
142
|
-
connectionId: app_api
|
|
143
|
-
properties:
|
|
144
|
-
url: /orders
|
|
145
|
-
- id: update_order
|
|
146
|
-
type: AxiosHttp
|
|
147
|
-
connectionId: app_api
|
|
148
|
-
properties:
|
|
149
|
-
url:
|
|
150
|
-
_nunjucks: /orders/{{ order_id }}
|
|
151
|
-
method: post
|
|
152
|
-
data:
|
|
153
|
-
_state: true
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
###### Setting properties on only the connection:
|
|
158
|
-
```yaml
|
|
159
|
-
connections:
|
|
160
|
-
- id: get_count
|
|
161
|
-
type: AxiosHttp
|
|
162
|
-
properties:
|
|
163
|
-
url: myapp.com/api/count
|
|
164
|
-
headers:
|
|
165
|
-
X-Api-Key:
|
|
166
|
-
_secret: API_KEY
|
|
167
|
-
# ...
|
|
168
|
-
requests:
|
|
169
|
-
- id: get_count
|
|
170
|
-
type: AxiosHttp
|
|
171
|
-
connectionId: get_count
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
###### Setting properties on only the request, and using a generic connection:
|
|
175
|
-
```yaml
|
|
176
|
-
connections:
|
|
177
|
-
- id: axios
|
|
178
|
-
type: AxiosHttp
|
|
179
|
-
# ...
|
|
180
|
-
requests:
|
|
181
|
-
- id: get_api_1
|
|
182
|
-
type: AxiosHttp
|
|
183
|
-
connectionId: axios
|
|
184
|
-
properties:
|
|
185
|
-
url: app1.com/api/things
|
|
186
|
-
- id: post_to_api_2
|
|
187
|
-
type: AxiosHttp
|
|
188
|
-
connectionId: axios
|
|
189
|
-
properties:
|
|
190
|
-
url: api.otherapp.org/other/thing
|
|
191
|
-
method: post
|
|
192
|
-
data:
|
|
193
|
-
_state: true
|
|
194
|
-
```
|